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)
PageMemory (MB)CPU Time (ms)
Home /4.01 ▲0.5546.27 ▲4.02
Dashboard /wp-admin2.48 ▼0.871,685.90 ▲1,622.75
Posts /wp-admin/edit.php2.48 ▼0.881,591.59 ▲1,545.27
Add New Post /wp-admin/post-new.php2.48 ▼3.411,522.79 ▲1,428.60
Media Library /wp-admin/upload.php2.48 ▼0.751,569.32 ▲1,536.16
Configuration /wp-admin/admin.php?page=presta-products&tab=options2.481,445.07
Presta Products for WordPress /wp-admin/admin.php?page=presta-products2.481,522.60
Documentation /wp-admin/admin.php?page=presta-products&tab=examples2.481,572.95
Used on /wp-admin/admin.php?page=presta-products&tab=used2.481,843.38
Cache /wp-admin/admin.php?page=presta-products&tab=cache2.481,589.14
Features /wp-admin/admin.php?page=presta-products&tab=features2.481,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
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,862 ▲10414.32 ▼0.032.24 ▲0.2643.63 ▲0.09
Dashboard /wp-admin2,235 ▲545.63 ▼0.1187.92 ▼27.6141.90 ▼1.89
Posts /wp-admin/edit.php2,143 ▲401.93 ▼0.0136.38 ▼1.0734.03 ▼1.59
Add New Post /wp-admin/post-new.php1,568 ▲3723.14 ▲0.50646.81 ▼8.4556.00 ▼8.38
Media Library /wp-admin/upload.php1,435 ▲354.05 ▼0.12109.92 ▲12.4746.75 ▲2.70
Configuration /wp-admin/admin.php?page=presta-products&tab=options2,2072.2729.1558.64
Presta Products for WordPress /wp-admin/admin.php?page=presta-products2,1972.3429.5226.17
Documentation /wp-admin/admin.php?page=presta-products&tab=examples2,1972.2424.6640.37
Used on /wp-admin/admin.php?page=presta-products&tab=used2,2002.2427.5025.43
Cache /wp-admin/admin.php?page=presta-products&tab=cache2,1942.2427.4424.28
Features /wp-admin/admin.php?page=presta-products&tab=features2,2232.3729.2531.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:
LanguageFilesBlank linesComment linesLines of code
PHP173432422,088
PO File35556691,742
JavaScript76867391
CSS378283
SVG100030

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 code0.48
Average class complexity127.50
▷ Minimum class complexity59.00
▷ Maximum class complexity196.00
Average method complexity10.33
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods2896.55%
▷ Protected methods00.00%
▷ Private methods13.45%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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
FileSize - originalSize - compressedSavings
assets/screenshot-6.png117.10KB124.29KB0.00%
assets/icon-128x128.png11.95KB6.34KB▼ 46.97%
assets/screenshot-5.png195.86KB206.77KB0.00%
assets/screenshot-3.png205.71KB216.05KB0.00%
assets/banner-1544x500.png256.48KB103.07KB▼ 59.81%