62% product-review

Code Review | Product Review

WordPress plugin Product Review scored62%from 54 tests.

About plugin

  • Plugin page: product-review
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.7
  • WordPress version: 6.3.1
  • First release: Dec 10, 2016
  • Latest release: Apr 2, 2017
  • Number of updates: 24
  • Update frequency: every 6.0 days
  • Top authors: mukto90 (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

20+ active /5,180 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▼0.45MB] [CPU: ▼33.19ms] Passed 4 tests

Server-side resources used by Product Review
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1942.44 ▲4.66
Dashboard /wp-admin3.54 ▲0.1927.79 ▼33.79
Posts /wp-admin/edit.php3.54 ▲0.1825.94 ▼19.24
Add New Post /wp-admin/post-new.php3.54 ▼2.3527.48 ▼74.68
Media Library /wp-admin/upload.php3.54 ▲0.3130.67 ▼5.06
Product Review /wp-admin/admin.php?page=product-review3.5426.45
Add-ons /wp-admin/admin.php?page=product-review-add-ons3.5427.41

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 99 new files
Database: no new tables, 10 new options
New WordPress options
cbpr_appearance
widget_cbpr-widget
theysaidso_admin_options
cbpr_general
cbpr_activated
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Product Review: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,145 ▲39915.67 ▲1.1310.51 ▲8.8043.75 ▼2.11
Dashboard /wp-admin2,431 ▲2436.66 ▲1.79124.65 ▲20.1142.03 ▼1.09
Posts /wp-admin/edit.php2,377 ▲2883.72 ▲1.7165.83 ▲26.8934.30 ▲2.21
Add New Post /wp-admin/post-new.php7,094 ▲5,42622.49 ▲0.22952.74 ▲267.4644.14 ▼15.28
Media Library /wp-admin/upload.php1,479 ▲944.43 ▲0.2182.84 ▼21.0442.51 ▼1.42
Product Review /wp-admin/admin.php?page=product-review2,4855.02104.9630.86
Add-ons /wp-admin/admin.php?page=product-review-add-ons1,1313.5844.7774.74

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/product-review/vendor/wordpress-settings-api/class.settings-api.php+108
    Function create_function() is deprecated
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • theysaidso_admin_options
    • cbpr_general
    • can_compress_scripts
    • db_upgraded
    • cbpr_appearance
    • widget_cbpr-widget
    • cbpr_activated
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=product-review-add-ons
    • > Deprecated in wp-content/plugins/product-review/vendor/wordpress-settings-api/class.settings-api.php+108
    Function create_function() is deprecated
  • 18 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=product-review-add-ons
    • > Notice in wp-content/plugins/product-review/vendor/wordpress-settings-api/class.settings-api.php+143
    Undefined index: disabled
  • 50 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=product-review-add-ons
    • > Notice in wp-content/plugins/product-review/vendor/wordpress-settings-api/class.settings-api.php+144
    Undefined index: readonly
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=product-review-add-ons
    • > Notice in wp-content/plugins/product-review/includes/class-product-review-add-ons.php+99
    Undefined index: product-review-pro/product-review-pro.php
    • > GET request to /wp-admin/admin.php?page=product-review-add-ons
    • > Notice in wp-content/plugins/product-review/includes/class-product-review-add-ons.php+104
    Undefined index: product-review-rich-snippet/product-review-rich-snippet.php
    • > GET request to /wp-admin/admin.php?page=product-review-add-ons
    • > Notice in wp-content/plugins/product-review/includes/class-product-review-add-ons.php+104
    Undefined index: product-review-style-editor/product-review-style-editor.php
    • > GET request to /wp-admin/admin.php?page=product-review-add-ons
    • > Notice in wp-content/plugins/product-review/includes/class-product-review-add-ons.php+104
    Undefined index: product-review-pros-cons/product-review-pros-cons.php
    • > GET request to /wp-admin/admin.php?page=product-review-add-ons
    • > Notice in wp-content/plugins/product-review/includes/class-product-review-add-ons.php+104
    Undefined index: product-review-user-rating/product-review-user-rating.php

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 28× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required './vendor/mdc-meta-box/class.mdc-meta-box.php' (include_path='.:/usr/share/php') in wp-content/plugins/product-review/includes/meta-box/settings.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cbpr_meta() in wp-content/plugins/product-review/public/templates/footer.php:7
    • > PHP Fatal error
      require_once(): Failed opening required './vendor/wordpress-settings-api/class.settings-api.php' (include_path='.:/usr/share/php') in wp-content/plugins/product-review/includes/class-product-review-options.php on line 3
    • > PHP Warning
      Use of undefined constant CB_PRODUCT_REVIEW - assumed 'CB_PRODUCT_REVIEW' (this will throw an Error in a future version of PHP) in wp-content/plugins/product-review/includes/meta-box.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required './vendor/mdc-meta-box/class.mdc-meta-box.php' (include_path='.:/usr/share/php') in wp-content/plugins/product-review/includes/meta-box/affiliate.php on line 5
    • > PHP Warning
      require_once(./includes/meta-box/settings.php): failed to open stream: No such file or directory in wp-content/plugins/product-review/includes/meta-box.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required './vendor/mdc-meta-box/class.mdc-meta-box.php' (include_path='.:/usr/share/php') in wp-content/plugins/product-review/includes/meta-box/review.php on line 5
    • > PHP Warning
      Use of undefined constant CB_PRODUCT_REVIEW - assumed 'CB_PRODUCT_REVIEW' (this will throw an Error in a future version of PHP) in wp-content/plugins/product-review/includes/meta-box/affiliate.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required './includes/meta-box/settings.php' (include_path='.:/usr/share/php') in wp-content/plugins/product-review/includes/meta-box.php on line 5
    • > PHP Warning
      Use of undefined constant CB_PRODUCT_REVIEW - assumed 'CB_PRODUCT_REVIEW' (this will throw an Error in a future version of PHP) in wp-content/plugins/product-review/includes/meta-box/settings.php on line 5

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=product-review-add-ons
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/product-review/admin/assets/js/product-review-admin.js?ver=1.2.3:100:37)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&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,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=product-review-add-ons
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Screenshots: Add a description for screenshot #18 in product-review/assets to your readme.txt
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt might help

product-review/product-review.php Passed 13 tests

"Product Review" version 1.2.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
35 characters long description:
Product Review Plugin for WordPress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin14,192 lines of code in 75 files:
LanguageFilesBlank linesComment linesLines of code
SVG3003,644
CSS651363,063
PHP335349122,607
Sass1434341,768
LESS1434441,758
JavaScript3308481,026
Markdown2470326

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity16.21
▷ Minimum class complexity1.00
▷ Maximum class complexity83.00
Average method complexity2.99
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods107
▷ Static methods43.74%
▷ Public methods9689.72%
▷ Protected methods00.00%
▷ Private methods1110.28%
Functions31
▷ Named functions31100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.10MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/img/rich-snippets.png16.84KB6.79KB▼ 59.66%
public/assets/img/product.png90.50KB26.07KB▼ 71.19%