83% yith-woocommerce-product-add-ons

Code Review | YITH WooCommerce Product Add-Ons

WordPress plugin YITH WooCommerce Product Add-Ons scored83%from 54 tests.

About plugin

  • Plugin page: yith-woocommerce-...
  • Plugin version: 4.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4
  • WordPress version: 6.3.1
  • First release: May 20, 2016
  • Latest release: Nov 22, 2023
  • Number of updates: 126
  • Update frequency: every 21.8 days
  • Top authors: yithemes (100%)

Code review

54 tests

User reviews

40 reviews

Install metrics

10,000+ active /456,414 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.25ms] Passed 4 tests

This is a short check of server-side resources used by YITH WooCommerce Product Add-Ons
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.85 ▼5.51
Dashboard /wp-admin3.31 ▲0.0145.94 ▼0.83
Posts /wp-admin/edit.php3.36 ▲0.0147.26 ▼2.13
Add New Post /wp-admin/post-new.php5.89 ▲0.0195.30 ▲11.70
Media Library /wp-admin/upload.php3.24 ▲0.0132.15 ▼0.52

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 428 new files
Database: no new tables, 7 new options
New WordPress options
yit_recently_activated
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by YITH WooCommerce Product Add-Ons
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3414.42 ▲0.231.51 ▼0.2138.24 ▼4.04
Dashboard /wp-admin2,198 ▲205.59 ▼0.1192.45 ▼21.8741.92 ▼4.37
Posts /wp-admin/edit.php2,110 ▲101.96 ▼0.0139.12 ▼4.3638.20 ▲1.64
Add New Post /wp-admin/post-new.php1,532 ▲623.42 ▲0.51589.95 ▲1.7065.49 ▲15.35
Media Library /wp-admin/upload.php1,409 ▲94.17 ▼0.0397.63 ▼1.8542.19 ▼0.73

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • yit_recently_activated
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/yith-woocommerce-product-add-ons/templates/front/addons-price-table.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function yith_wapo_get_addon_tabs() in wp-content/plugins/yith-woocommerce-product-add-ons/views/addon-editor/addon-tabs.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
The official readme.txt is a good inspiration

yith-woocommerce-product-add-ons/init.php 85% from 13 tests

The main PHP file in "YITH WooCommerce Product Add-Ons" ver. 4.3.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 275 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("yith-woocommerce-product-add-ons.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin57,788 lines of code in 319 files:
LanguageFilesBlank linesComment linesLines of code
PHP2104,1317,55221,768
JavaScript491,9771,16711,971
CSS201,67730811,057
PO File125,26710,5679,718
SVG260173,229
XML212945

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity50.92
▷ Minimum class complexity1.00
▷ Maximum class complexity336.00
Average method complexity4.58
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes38
▷ Abstract classes12.63%
▷ Concrete classes3797.37%
▷ Final classes00.00%
Methods520
▷ Static methods6312.12%
▷ Public methods43383.27%
▷ Protected methods5610.77%
▷ Private methods315.96%
Functions170
▷ Named functions16295.29%
▷ Anonymous functions84.71%
Constants36
▷ Global constants2980.56%
▷ Class constants719.44%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
60 PNG files occupy 0.14MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugin-fw/assets/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%
assets/img/icon-edit.png2.58KB1.33KB▼ 48.33%
assets/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png0.13KB0.18KB0.00%
plugin-fw/assets/images/no-sidebar.png0.92KB0.08KB▼ 90.72%
plugin-fw/assets/images/licence-error.png1.61KB0.94KB▼ 41.62%