83% yith-woocommerce-product-bundles

Code Review | YITH WooCommerce Product Bundles

WordPress plugin YITH WooCommerce Product Bundles scored83%from 54 tests.

About plugin

  • Plugin page: yith-woocommerce-...
  • Plugin version: 2.1.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 8.1-6.4
  • WordPress version: 6.3.1
  • First release: Jul 20, 2015
  • Latest release: Nov 20, 2023
  • Number of updates: 163
  • Update frequency: every 18.7 days
  • Top authors: yithemes (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

5,000+ active /235,645 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.53ms] Passed 4 tests

Server-side resources used by YITH WooCommerce Product Bundles
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0240.57 ▼1.16
Dashboard /wp-admin3.33 ▲0.0348.91 ▼4.60
Posts /wp-admin/edit.php3.39 ▲0.0247.92 ▼2.97
Add New Post /wp-admin/post-new.php5.92 ▲0.0293.61 ▼1.38
Media Library /wp-admin/upload.php3.26 ▲0.0234.95 ▲2.72

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 327 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
yit_recently_activated
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by YITH WooCommerce Product Bundles
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲4914.24 ▼0.101.67 ▲0.0848.08 ▲2.97
Dashboard /wp-admin2,198 ▲205.50 ▼0.1189.88 ▼21.0437.39 ▼7.53
Posts /wp-admin/edit.php2,107 ▲42.02 ▲0.0438.17 ▼1.4738.75 ▲0.87
Add New Post /wp-admin/post-new.php1,532 ▲623.21 ▲0.16633.10 ▼18.8346.66 ▼8.16
Media Library /wp-admin/upload.php1,409 ▲154.19 ▼0.01100.26 ▲2.3644.22 ▲1.43

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • yit_recently_activated
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/yith-woocommerce-product-bundles/templates/premium.php:206
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/yith-woocommerce-product-bundles/templates/how-to.php:63

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 15 tag instead of maximum 10
You can look at the official readme.txt

yith-woocommerce-product-bundles/init.php 77% from 13 tests

The principal PHP file in "YITH WooCommerce Product Bundles" v. 2.1.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 309 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("yith-woocommerce-product-bundles.php" instead of "init.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("6.2" instead of "8.1")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin44,350 lines of code in 271 files:
LanguageFilesBlank linesComment linesLines of code
PHP1823,0356,20416,715
CSS221,78232110,744
JavaScript501,3608259,577
PO File61,5661,9204,307
SVG8012,926
XML3241781

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity41.09
▷ Minimum class complexity1.00
▷ Maximum class complexity336.00
Average method complexity3.92
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes35
▷ Abstract classes12.86%
▷ Concrete classes3497.14%
▷ Final classes00.00%
Methods467
▷ Static methods5611.99%
▷ Public methods37780.73%
▷ Protected methods6714.35%
▷ Private methods234.93%
Functions150
▷ Named functions14294.67%
▷ Anonymous functions85.33%
Constants22
▷ Global constants2195.45%
▷ Class constants14.55%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
35 PNG files occupy 0.73MB with 0.30MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugin-fw/assets/css/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png0.11KB0.14KB0.00%
plugin-fw/assets/images/yithemes-icon.png0.43KB0.42KB▼ 2.03%
plugin-fw/assets/images/sidebar-right.png0.95KB0.11KB▼ 87.91%
plugin-fw/assets/images/banner-premium.png10.78KB5.54KB▼ 48.66%
assets/images/how-to/06.png483.80KB170.06KB▼ 64.85%