83% yith-woocommerce-ajax-search

Code Review | YITH WooCommerce Ajax Search

WordPress plugin YITH WooCommerce Ajax Search scored 83% from 54 tests.

About plugin

  • Plugin page: yith-woocommerce-...
  • Plugin version: 1.18.0
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-5.9
  • WordPress version: 5.9.2
  • First release: Aug 2, 2013
  • Latest release: Apr 5, 2022
  • Number of updates: 202
  • Update frequency: every 15.7 days
  • Top authors: yithemes (100%)

Code review

54 tests

User reviews

38 reviews

Install metrics

80,000+ active / 2,255,338 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by YITH WooCommerce Ajax Search
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0367.78 ▼2.02
Dashboard /wp-admin3.43 ▲0.0235.24 ▼9.01
Posts /wp-admin/edit.php3.67 ▲0.0245.58 ▼6.39
Add New Post /wp-admin/post-new.php6.90 ▼0.07113.07 ▼1,212.59
Media Library /wp-admin/upload.php3.32 ▲0.0233.80 ▼1.68

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 284 new files
Database: no new tables, 1 new option
New WordPress options

Browser metrics Passed 4 tests

YITH WooCommerce Ajax Search: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,871 ▲11315.91 ▲0.3910.14 ▲0.043.78 ▼0.02
Dashboard /wp-admin2,968 ▲496.43 ▲0.00184.60 ▼47.05197.79 ▼28.43
Posts /wp-admin/edit.php2,730 ▲63.44 ▲0.0286.29 ▼4.06173.04 ▼24.41
Add New Post /wp-admin/post-new.php1,749 ▲6118.54 ▲2.66679.65 ▲64.19211.82 ▲1.47
Media Library /wp-admin/upload.php1,740 ▲105.68 ▼0.02208.53 ▲0.26245.23 ▼18.69

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 1 option in the database
    • yit_recently_activated

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however 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
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/yith-woocommerce-ajax-search/templates/admin/premium.php:238

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side


Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: There are too many tags (50 tag instead of maximum 10)
You can take inspiration from this readme.txt

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

The main PHP script in "YITH WooCommerce Ajax Search" version 1.18.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("5.7" instead of "6.2")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("yith-woocommerce-ajax-search.php" instead of "init.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 410 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin34,754 lines of code in 215 files:
LanguageFilesBlank linesComment linesLines of code
PO File61,0851,4962,626

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity34.71
▷ Minimum class complexity1.00
▷ Maximum class complexity258.00
Average method complexity4.10
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
▷ Abstract classes13.23%
▷ Concrete classes3096.77%
▷ Final classes00.00%
▷ Static methods4914.45%
▷ Public methods28684.37%
▷ Protected methods3510.32%
▷ Private methods185.31%
▷ Named functions12096.77%
▷ Anonymous functions43.23%
▷ Global constants1493.33%
▷ Class constants16.67%
▷ Public constants1100.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
39 PNG files occupy 0.19MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/number-three.png1.91KB0.67KB▼ 64.72%
assets/images/02.png117.83KB43.84KB▼ 62.80%