88% product-reviews-for-woocommerce

Code Review | Product Reviews for WooCommerce - Add Customer Review Rating and Recommendations, Set Review Reminder

WordPress plugin Product Reviews for WooCommerce - Add Customer Review Rating and Recommendations, Set Review Reminder scored 88% from 54 tests.

About plugin

  • Plugin page: product-reviews-f...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8.1
  • WordPress version: 5.8.1
  • First release: Jul 1, 2021
  • Latest release: Sep 18, 2021
  • Number of updates: 4
  • Update frequency: every 19.8 days
  • Top authors: makewebbetter (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 278 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.00MB] [CPU: ▼146.11ms] Passed 4 tests

An overview of server-side resources used by Product Reviews for WooCommerce - Add Customer Review Rating and Recommendations, Set Review Reminder
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.83 ▲0.1236.88 ▲13.29
Dashboard /wp-admin3.06 ▲0.0042.86 ▼7.08
Posts /wp-admin/edit.php3.11 ▲0.0043.20 ▼4.65
Add New Post /wp-admin/post-new.php5.42 ▼0.0280.56 ▼572.41
Media Library /wp-admin/upload.php3.00 ▲0.0032.05 ▼0.31

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 147 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Product Reviews for WooCommerce - Add Customer Review Rating and Recommendations, Set Review Reminder
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.90 ▲0.3512.49 ▲2.2944.42 ▼10.90
Dashboard /wp-admin2,973 ▲396.05 ▲0.09143.50 ▼13.12107.53 ▼0.18
Posts /wp-admin/edit.php2,739 ▼02.71 ▼0.0271.25 ▲4.8585.20 ▼5.73
Add New Post /wp-admin/post-new.php1,672 ▼1118.66 ▼0.05373.66 ▼48.27104.83 ▼4.50
Media Library /wp-admin/upload.php1,807 ▼05.04 ▲0.02154.95 ▼17.42114.52 ▲0.47

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/product-reviews-for-woocommerce/public/partials/product-reviews-for-woocommerce-public-display.php
    • > /wp-content/plugins/product-reviews-for-woocommerce/common/partials/product-reviews-for-woocommerce-common-display.php
  • 20× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      require_once(PRODUCT_REVIEWS_FOR_WOOCOMMERCE_DIR_PATH/includes/class-product-reviews-for-woocommerce-qna-data.php): failed to open stream: No such file or directory in wp-content/plugins/product-reviews-for-woocommerce/admin/partials/product-reviews-for-woocommerce-review-qna-display.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Comment_Query' not found in wp-content/plugins/product-reviews-for-woocommerce/common/partials/product-reviews-for-woocommerce-common-grid-view.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Comment_Query' not found in wp-content/plugins/product-reviews-for-woocommerce/common/partials/product-reviews-for-woocommerce-common-list-view.php:20
    • > PHP Fatal error
      require_once(): Failed opening required 'PRODUCT_REVIEWS_FOR_WOOCOMMERCE_DIR_PATH/includes/class-product-reviews-for-woocommerce-qna-data.php' (include_path='.:/usr/share/php') in wp-content/plugins/product-reviews-for-woocommerce/admin/partials/product-reviews-for-woocommerce-review-qna-display.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/product-reviews-for-woocommerce/onboarding/templates/product-reviews-for-woocommerce-onboarding-template.php:15
    • > PHP Warning
      Use of undefined constant PRODUCT_REVIEWS_FOR_WOOCOMMERCE_DIR_PATH - assumed 'PRODUCT_REVIEWS_FOR_WOOCOMMERCE_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/product-reviews-for-woocommerce/admin/partials/product-reviews-for-woocommerce-review-qna-display.php on line 17
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/product-reviews-for-woocommerce/includes/class-product-reviews-for-woocommerce-qna-data.php on line 13
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/product-reviews-for-woocommerce/includes/class-product-reviews-for-woocommerce-review-data.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_id() on null in wp-content/plugins/product-reviews-for-woocommerce/public/partials/product-reviews-for-woocommerce-qna-callback.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/product-reviews-for-woocommerce/public/partials/product-reviews-for-woocommerce-review-vote-html.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Requires php: Invalid plugin version format
You can take inspiration from this readme.txt

product-reviews-for-woocommerce/product-reviews-for-woocommerce.php 92% from 13 tests

Analyzing the main PHP file in "Product Reviews for WooCommerce - Add Customer Review Rating and Recommendations, Set Review Reminder" version 1.0.2
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 201 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected44,915 lines of code in 90 files:
LanguageFilesBlank linesComment linesLines of code
SVG140035,217
PHP447841,9495,294
CSS175731302,994
JavaScript1212966827
PO File1248332568
XML11010
Sass1205

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity49.08
▷ Minimum class complexity1.00
▷ Maximum class complexity137.00
Average method complexity5.40
▷ Minimum method complexity1.00
▷ Maximum method complexity96.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods140
▷ Static methods117.86%
▷ Public methods12891.43%
▷ Protected methods42.86%
▷ Private methods85.71%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
23 PNG files occupy 0.38MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/src/images/documentation.png1.48KB1.58KB0.00%
admin/src/images/mwb-logo.png0.34KB0.26KB▼ 22.09%
admin/image/Upload-Image.png4.78KB2.30KB▼ 51.80%
admin/image/banner.png220.90KB68.96KB▼ 68.78%
admin/src/images/connected.png1.32KB1.07KB▼ 18.77%