83% yith-woocommerce-ajax-navigation

Code Review | YITH WooCommerce Ajax Product Filter

WordPress plugin YITH WooCommerce Ajax Product Filter scored83%from 54 tests.

About plugin

  • Plugin page: yith-woocommerce-...
  • Plugin version: 4.28.0
  • PHP version: 7.4.16
  • WordPress compatibility: 8.1-6.4
  • WordPress version: 6.3.1
  • First release: Jun 24, 2013
  • Latest release: Nov 20, 2023
  • Number of updates: 308
  • Update frequency: every 12.4 days
  • Top authors: yithemes (100%)

Code review

54 tests

User reviews

84 reviews

Install metrics

90,000+ active /3,937,380 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
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.17ms] Passed 4 tests

An overview of server-side resources used by YITH WooCommerce Ajax Product Filter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0335.11 ▼5.46
Dashboard /wp-admin3.34 ▲0.0349.34 ▼5.10
Posts /wp-admin/edit.php3.39 ▲0.0350.57 ▼1.40
Add New Post /wp-admin/post-new.php5.92 ▲0.0395.24 ▼4.72
Media Library /wp-admin/upload.php3.27 ▲0.0334.26 ▲1.33

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

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

Browser metrics Passed 4 tests

Checking browser requirements for YITH WooCommerce Ajax Product Filter
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲4914.56 ▲0.221.70 ▼0.3436.39 ▼6.88
Dashboard /wp-admin2,204 ▲275.63 ▲0.0395.39 ▼6.4242.59 ▼3.56
Posts /wp-admin/edit.php2,107 ▲72.02 ▲0.0240.01 ▼0.5438.26 ▲0.72
Add New Post /wp-admin/post-new.php1,532 ▲623.21 ▼0.44664.62 ▲37.0452.32 ▲10.71
Media Library /wp-admin/upload.php1,400 ▲64.21 ▲0.0296.25 ▼2.2743.16 ▲0.81

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 5× 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-ajax-navigation/plugin-options/preset-options.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function YITH_WCAN_Query() in wp-content/plugins/yith-woocommerce-ajax-navigation/plugin-options/filter-options.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/yith-woocommerce-ajax-navigation/plugin-options/seo-options.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/yith-woocommerce-ajax-navigation/plugin-options/general-options.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/yith-woocommerce-ajax-navigation/plugin-options/legacy-options.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: Too many tags (37 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

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

The principal PHP file in "YITH WooCommerce Ajax Product Filter" v. 4.28.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("yith-woocommerce-ajax-navigation.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")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 419 characters long)

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
Everything looks great! No dangerous files found in this plugin69,748 lines of code in 380 files:
LanguageFilesBlank linesComment linesLines of code
PHP2204,5839,47422,353
JavaScript742,5511,47416,453
PO File145,1299,40712,144
CSS211,74027410,966
Sass33934574,782
SVG16022,988
XML212962

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity42.66
▷ Minimum class complexity1.00
▷ Maximum class complexity336.00
Average method complexity3.83
▷ Minimum method complexity1.00
▷ Maximum method complexity88.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes53
▷ Abstract classes23.77%
▷ Concrete classes5196.23%
▷ Final classes00.00%
Methods764
▷ Static methods11515.05%
▷ Public methods65485.60%
▷ Protected methods8811.52%
▷ Private methods222.88%
Functions197
▷ Named functions17890.36%
▷ Anonymous functions199.64%
Constants20
▷ Global constants1785.00%
▷ Class constants315.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
34 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugin-fw/assets/images/sidebar-left.png0.95KB0.11KB▼ 87.91%
assets/images/checkbox_sprite.png1.05KB0.22KB▼ 79.33%
plugin-fw/assets/images/sleep.png0.11KB0.11KB▼ 5.13%
plugin-fw/assets/css/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png0.08KB0.08KB0.00%
plugin-fw/assets/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%