84% extra-product-options-for-woocommerce

Code Review | Extra Product Options for WooCommerce

WordPress plugin Extra Product Options for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: extra-product-opt...
  • Plugin version: 3.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.3.1
  • WordPress version: 6.3.1
  • First release: Oct 25, 2020
  • Latest release: Sep 8, 2023
  • Number of updates: 57
  • Update frequency: every 18.5 days
  • Top authors: actpro (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /30,204 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

An overview of server-side resources used by Extra Product Options for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.08 ▼7.30
Dashboard /wp-admin3.31 ▲0.0054.69 ▲8.77
Posts /wp-admin/edit.php3.36 ▲0.0046.99 ▲4.27
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.32 ▼10.29
Media Library /wp-admin/upload.php3.23 ▲0.0036.22 ▲5.52

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 76 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Extra Product Options for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.311.67 ▲0.0835.84 ▼3.22
Dashboard /wp-admin2,192 ▲175.55 ▼0.1485.80 ▼14.7636.25 ▼3.50
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0438.21 ▲2.8435.53 ▲0.27
Add New Post /wp-admin/post-new.php1,526 ▼023.37 ▲0.33646.98 ▼30.2057.22 ▲5.17
Media Library /wp-admin/upload.php1,400 ▼34.16 ▼0.0193.86 ▲0.5241.87 ▼2.23

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/extra-product-options-for-woocommerce/includes/class-epofw-init.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Background_Process' not found in wp-content/plugins/extra-product-options-for-woocommerce/includes/class-epofw-bg-process.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/extra-product-options-for-woocommerce/settings/epofw-actions.php:18
    • > PHP Warning
      include_once(WP_PLUGIN_DIR/woocommerce/includes/abstracts/class-wc-background-process.php): failed to open stream: No such file or directory in wp-content/plugins/extra-product-options-for-woocommerce/includes/class-epofw-bg-process.php on line 9
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/extra-product-options-for-woocommerce/includes/class-epofw-bg-process.php on line 9
    • > PHP Warning
      include_once(): Failed opening 'WP_PLUGIN_DIR/woocommerce/includes/abstracts/class-wc-background-process.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/extra-product-options-for-woocommerce/includes/class-epofw-bg-process.php on line 9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: woocommerce extra product fields, woocommerce extra product options, product options, woocommerce product addons

extra-product-options-for-woocommerce/extra-product-options-for-woocommerce.php 85% from 13 tests

This is the main PHP file of "Extra Product Options for WooCommerce" version 3.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 200 characters long)
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.8" instead of "3.6")

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
Success! There were no dangerous files found in this plugin12,970 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
PHP353652,6517,203
JavaScript82373413,258
CSS14470222,262
PO File1113151244
Markdown1303

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity56.89
▷ Minimum class complexity4.00
▷ Maximum class complexity223.00
Average method complexity5.79
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods105
▷ Static methods2019.05%
▷ Public methods9893.33%
▷ Protected methods54.76%
▷ Private methods21.90%
Functions106
▷ Named functions106100.00%
▷ Anonymous functions00.00%
Constants25
▷ Global constants25100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
12 PNG files occupy 0.37MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/checkout_field_option.png52.53KB29.76KB▼ 43.35%
assets/images/desc1.png0.40KB0.37KB▼ 7.06%
assets/images/ui-icons_444444_256x240.png6.84KB4.18KB▼ 38.90%
assets/images/front_field_option.png160.00KB55.40KB▼ 65.37%
assets/images/admin_order_detail.png13.19KB7.98KB▼ 39.51%