83% yith-woocommerce-frequently-bought-together

Code Review | YITH WooCommerce Frequently Bought Together

WordPress plugin YITH WooCommerce Frequently Bought Together scored83%from 54 tests.

About plugin

  • Plugin page: yith-woocommerce-...
  • Plugin version: 1.31.0
  • PHP version: 7.4.16
  • WordPress compatibility: 8.1-6.4
  • WordPress version: 6.3.1
  • First release: Jul 24, 2015
  • Latest release: Nov 28, 2023
  • Number of updates: 126
  • Update frequency: every 24.2 days
  • Top authors: yithemes (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

7,000+ active /282,907 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

Analyzing server-side resources used by YITH WooCommerce Frequently Bought Together
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.91 ▼2.78
Dashboard /wp-admin3.31 ▼0.0344.62 ▼23.12
Posts /wp-admin/edit.php3.37 ▲0.0147.04 ▼1.64
Add New Post /wp-admin/post-new.php5.90 ▲0.0191.65 ▼3.76
Media Library /wp-admin/upload.php3.24 ▲0.0134.53 ▲1.11

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 330 new files
Database: no new tables, 7 new options
New WordPress options
yit_recently_activated
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for YITH WooCommerce Frequently Bought Together
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲7414.21 ▼0.141.97 ▲0.3237.09 ▼9.63
Dashboard /wp-admin2,201 ▲275.60 ▼0.0091.72 ▼1.3242.18 ▼4.56
Posts /wp-admin/edit.php2,107 ▲72.01 ▲0.0138.93 ▲2.6834.75 ▲0.11
Add New Post /wp-admin/post-new.php1,532 ▲623.46 ▲0.50612.49 ▼55.5047.64 ▼21.64
Media Library /wp-admin/upload.php1,406 ▲124.27 ▲0.1097.76 ▼2.6244.89 ▲1.38

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
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • yit_recently_activated
    • theysaidso_admin_options

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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/yith-woocommerce-frequently-bought-together/plugin-options/general-options.php:14

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 86% 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
Attributes that need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === yith-woocommerce-frequently-bought-together === )
You can look at the official readme.txt

yith-woocommerce-frequently-bought-together/init.php 77% from 13 tests

"YITH WooCommerce Frequently Bought Together" version 1.31.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("yith-woocommerce-frequently-bought-together.php" instead of "init.php")
  • Requires at least: Required version must match the one declared in readme.txt ("5.7" instead of "8.1")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 408 characters long)

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 plugin41,720 lines of code in 253 files:
LanguageFilesBlank linesComment linesLines of code
PHP1702,7695,44415,381
JavaScript451,3068229,238
CSS191,6592439,203
PO File91,8872,5554,925
SVG8012,926
XML212947

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of 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.50
Average class complexity43.03
▷ Minimum class complexity1.00
▷ Maximum class complexity336.00
Average method complexity4.07
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes29
▷ Abstract classes13.45%
▷ Concrete classes2896.55%
▷ Final classes00.00%
Methods384
▷ Static methods5213.54%
▷ Public methods31281.25%
▷ Protected methods5213.54%
▷ Private methods205.21%
Functions140
▷ Named functions13294.29%
▷ Anonymous functions85.71%
Constants19
▷ Global constants1894.74%
▷ Class constants15.26%
▷ 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
54 PNG files occupy 0.77MB with 0.27MB 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_75_dadada_1x400.png0.09KB0.16KB0.00%
plugin-fw/assets/images/licence-error.png1.61KB0.94KB▼ 41.62%
assets/images/02-icon.png1.42KB0.64KB▼ 55.01%
plugin-fw/assets/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
plugin-fw/assets/images/ui-icons_888888_256x240.png6.83KB4.17KB▼ 38.92%