89% yith-woocommerce-affiliates

Code Review | YITH WooCommerce Affiliates

WordPress plugin YITH WooCommerce Affiliates scored89%from 54 tests.

About plugin

  • Plugin page: yith-woocommerce-...
  • Plugin version: 3.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 8.1-6.4
  • WordPress version: 6.3.1
  • First release: Jul 30, 2015
  • Latest release: Nov 16, 2023
  • Number of updates: 180
  • Update frequency: every 16.8 days
  • Top authors: yithemes (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

8,000+ active /321,133 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: ▼7.10ms] Passed 4 tests

An overview of server-side resources used by YITH WooCommerce Affiliates
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.29 ▼4.71
Dashboard /wp-admin3.33 ▼0.0146.53 ▼8.38
Posts /wp-admin/edit.php3.38 ▲0.0340.95 ▼6.14
Add New Post /wp-admin/post-new.php5.91 ▲0.0388.78 ▼9.15
Media Library /wp-admin/upload.php3.26 ▲0.0331.61 ▼3.50

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

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

Browser metrics Passed 4 tests

A check of browser resources used by YITH WooCommerce Affiliates
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲914.54 ▲0.291.85 ▼0.1443.68 ▼0.72
Dashboard /wp-admin2,198 ▲185.56 ▼0.0986.80 ▼7.6339.60 ▼1.94
Posts /wp-admin/edit.php2,107 ▲72.00 ▲0.0236.96 ▼1.8036.86 ▼2.63
Add New Post /wp-admin/post-new.php1,532 ▲623.53 ▲0.28653.62 ▼40.9351.93 ▼0.62
Media Library /wp-admin/upload.php1,403 ▲34.17 ▼0.07100.48 ▲0.5041.65 ▼4.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • yit_recently_activated
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests Passed 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 Passed 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
Everything seems fine, however this is by no means an exhaustive test

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)
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 30 tag instead of maximum 10
Please take inspiration from this readme.txt

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

The main PHP file in "YITH WooCommerce Affiliates" ver. 3.1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("yith-woocommerce-affiliates.php" instead of "init.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 392 characters long)
  • Requires at least: Required version must be the same as 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 review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin102,125 lines of code in 434 files:
LanguageFilesBlank linesComment linesLines of code
PHP3047,61219,33432,347
JavaScript713,3583,56331,003
PO File1310,58422,71223,194
CSS231,7051,00212,375
SVG21413,142
XML112940
JSON10024

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity30.94
▷ Minimum class complexity1.00
▷ Maximum class complexity336.00
Average method complexity3.40
▷ Minimum method complexity1.00
▷ Maximum method complexity84.00
Code structure
Namespaces0
Interfaces3
Traits4
Classes113
▷ Abstract classes87.08%
▷ Concrete classes10592.92%
▷ Final classes00.00%
Methods1,509
▷ Static methods29219.35%
▷ Public methods1,31286.94%
▷ Protected methods17511.60%
▷ Private methods221.46%
Functions210
▷ Named functions17683.81%
▷ Anonymous functions3416.19%
Constants26
▷ Global constants2284.62%
▷ Class constants415.38%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
29 compressed PNG files occupy 0.06MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugin-fw/assets/images/sleep.png0.11KB0.11KB▼ 5.13%
plugin-fw/assets/css/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png0.07KB0.08KB0.00%
plugin-fw/assets/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
plugin-fw/assets/css/jquery-ui/images/ui-icons_cd0a0a_256x240.png3.69KB4.18KB0.00%
plugin-fw/assets/css/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png0.09KB0.14KB0.00%