10% presta-products

Code Review | Presta Products for WordPress

WordPress plugin Presta Products for WordPress scored10%from 54 tests.

About plugin

  • Plugin page: presta-products
  • Plugin version: 1.1.20
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Jan 12, 2022
  • Latest release: Nov 27, 2023
  • Number of updates: 76
  • Update frequency: every 9.0 days
  • Top authors: knhar (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /2,730 total downloads

Benchmarks

Plugin footprint 39% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/presta-products/presta-products.php+790
    Undefined property: stdClass::$success

Server metrics [RAM: ▼1.48MB] [CPU: ▲1,128.51ms] 50% from 4 tests

Server-side resources used by Presta Products for WordPress
Please take the time to fix the following items
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,652.66ms on /wp-admin/admin.php?page=presta-products&tab=features)
  • Extra CPU: Extra CPU usage must be kept under 200.00ms (currently 1,128.51ms on /wp-admin/admin.php?page=presta-products&tab=features)
Page Memory (MB) CPU Time (ms)
Home / 4.01 ▲0.55 46.27 ▲4.02
Dashboard /wp-admin 2.48 ▼0.87 1,685.90 ▲1,622.75
Posts /wp-admin/edit.php 2.48 ▼0.88 1,591.59 ▲1,545.27
Add New Post /wp-admin/post-new.php 2.48 ▼3.41 1,522.79 ▲1,428.60
Media Library /wp-admin/upload.php 2.48 ▼0.75 1,569.32 ▲1,536.16
Configuration /wp-admin/admin.php?page=presta-products&tab=options 2.48 1,445.07
Presta Products for WordPress /wp-admin/admin.php?page=presta-products 2.48 1,522.60
Documentation /wp-admin/admin.php?page=presta-products&tab=examples 2.48 1,572.95
Used on /wp-admin/admin.php?page=presta-products&tab=used 2.48 1,843.38
Cache /wp-admin/admin.php?page=presta-products&tab=cache 2.48 1,589.14
Features /wp-admin/admin.php?page=presta-products&tab=features 2.48 1,652.66

Server storage [IO: ▲2.07MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 57 new files
Database: 1 new table, 38 new options
New tables
wp_ppgbo_cache
New WordPress options
ppgbo_description_short_size
ppgbo_oldprice_display
ppgbo_description_size
ppgbo_counter_freemium
widget_theysaidso_widget
db_upgraded
ppgbo_image_display
ppgbo_name_display
ppgbo_navigation_carrousel
ppgbo_counter_line
...

Browser metrics Passed 4 tests

Checking browser requirements for Presta Products for WordPress
This plugin renders optimally with no browser resource issues detected
Page Nodes Memory (MB) Script (ms) Layout (ms)
Home / 2,862 ▲104 14.32 ▼0.03 2.24 ▲0.26 43.63 ▲0.09
Dashboard /wp-admin 2,235 ▲54 5.63 ▼0.11 87.92 ▼27.61 41.90 ▼1.89
Posts /wp-admin/edit.php 2,143 ▲40 1.93 ▼0.01 36.38 ▼1.07 34.03 ▼1.59
Add New Post /wp-admin/post-new.php 1,568 ▲37 23.14 ▲0.50 646.81 ▼8.45 56.00 ▼8.38
Media Library /wp-admin/upload.php 1,435 ▲35 4.05 ▼0.12 109.92 ▲12.47 46.75 ▲2.70
Configuration /wp-admin/admin.php?page=presta-products&tab=options 2,207 2.27 29.15 58.64
Presta Products for WordPress /wp-admin/admin.php?page=presta-products 2,197 2.34 29.52 26.17
Documentation /wp-admin/admin.php?page=presta-products&tab=examples 2,197 2.24 24.66 40.37
Used on /wp-admin/admin.php?page=presta-products&tab=used 2,200 2.24 27.50 25.43
Cache /wp-admin/admin.php?page=presta-products&tab=cache 2,194 2.24 27.44 24.28
Features /wp-admin/admin.php?page=presta-products&tab=features 2,223 2.37 29.25 31.03

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/presta-products/presta-products.php+790
    Undefined property: stdClass::$success
  • Zombie WordPress options detected upon uninstall: 16 options
    • ppgbo_btn_goto_product
    • theysaidso_admin_options
    • widget_recent-posts
    • ppgbo_dots_carrousel
    • ppgbo_arrows_carrousel
    • ppgbo_counter_freemium
    • widget_recent-comments
    • ppgbo_use_cache
    • can_compress_scripts
    • ppgbo_image_format
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=presta-products&tab=features
    • > Notice in wp-content/plugins/presta-products/presta-products.php+790
    Undefined property: stdClass::$success
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=presta-products&tab=features
    • > Notice in wp-content/plugins/presta-products/presta-products.php+1003
    Undefined variable: elements
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=presta-products&tab=features
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 6× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/presta-products/scripts/cron/crontab-presta-products.php
    • > /wp-content/plugins/presta-products/includes/product/product-1.php
    • > /wp-content/plugins/presta-products/includes/product/product-3.php
    • > /wp-content/plugins/presta-products/includes/admin-footer.php
    • > /wp-content/plugins/presta-products/includes/product/product-2.php
    • > /wp-content/plugins/presta-products/includes/product/carrousel.php
  • 48× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: page in wp-content/plugins/presta-products/includes/tabs/form-options.php on line 1
    • > PHP Notice
      Undefined variable: page in wp-content/plugins/presta-products/includes/tabs/cache.php on line 1
    • > PHP Notice
      Undefined variable: autoplay in wp-content/plugins/presta-products/includes/product/carrousel.php on line 19
    • > PHP Notice
      Undefined variable: products in wp-content/plugins/presta-products/includes/product/product-1.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/presta-products/includes/admin-header.php:2
    • > PHP Notice
      Undefined variable: products in wp-content/plugins/presta-products/includes/product/product-2.php on line 3
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/presta-products/includes/product/product-3.php on line 3
    • > PHP Notice
      Undefined variable: products in wp-content/plugins/presta-products/includes/product/product-3.php on line 3
    • > PHP Notice
      Undefined variable: counter_line_carrousel in wp-content/plugins/presta-products/includes/product/carrousel.php on line 19
    • > PHP Notice
      Undefined variable: width in wp-content/plugins/presta-products/includes/product/carrousel.php on line 1

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=presta-products
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of null (reading 'defaultPrevented')" "TypeError: Cannot read properties of null (reading 'defaultPrevented')\n at Mn.show (/wp-content/plugins/presta-products/assets/javascript/bootstrap-5.1.3.bundle.min.js?ver=1:6:75675)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/presta-products/assets/javascript/ppgbo-admin.js?ver=1:6:63)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=presta-products&tab=features
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of null (reading 'defaultPrevented')
    • > GET request to /wp-admin/admin.php?page=presta-products&tab=features
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of null (reading 'defaultPrevented')" "TypeError: Cannot read properties of null (reading 'defaultPrevented')\n at Mn.show (/wp-content/plugins/presta-products/assets/javascript/bootstrap-5.1.3.bundle.min.js?ver=1:6:75675)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/presta-products/assets/javascript/ppgbo-admin.js?ver=1:9:64)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: produit, lien, seo, prestashop, obfuscation...

presta-products/presta-products.php 85% from 13 tests

The entry point to "Presta Products for WordPress" version 1.1.20 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Requires PHP: The required version number did not match the one declared in readme.txt ("5.6" instead of "7.2")
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.7" instead of "5.2")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin4,534 lines of code in 40 files:
Language Files Blank lines Comment lines Lines of code
PHP 17 343 242 2,088
PO File 3 555 669 1,742
JavaScript 7 68 67 391
CSS 3 7 8 283
SVG 10 0 0 30

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code 0.48
Average class complexity 127.50
▷ Minimum class complexity 59.00
▷ Maximum class complexity 196.00
Average method complexity 10.33
▷ Minimum method complexity 1.00
▷ Maximum method complexity 65.00
Code structure
Namespaces 0
Interfaces 0
Traits 0
Classes 2
▷ Abstract classes 0 0.00%
▷ Concrete classes 2 100.00%
▷ Final classes 0 0.00%
Methods 29
▷ Static methods 0 0.00%
▷ Public methods 28 96.55%
▷ Protected methods 0 0.00%
▷ Private methods 1 3.45%
Functions 0
▷ Named functions 0 0.00%
▷ Anonymous functions 0 0.00%
Constants 1
▷ Global constants 1 100.00%
▷ Class constants 0 0.00%
▷ Public constants 0 0.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
13 PNG files occupy 1.34MB with 0.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
File Size - original Size - compressed Savings
assets/screenshot-6.png 117.10KB 124.29KB 0.00%
assets/icon-128x128.png 11.95KB 6.34KB ▼ 46.97%
assets/screenshot-5.png 195.86KB 206.77KB 0.00%
assets/screenshot-3.png 205.71KB 216.05KB 0.00%
assets/banner-1544x500.png 256.48KB 103.07KB ▼ 59.81%