83% ajax-product-search-for-woocommerce

Code Review | Ajax Product Search for Woocommerce

WordPress plugin Ajax Product Search for Woocommerce scored 83% from 54 tests.

About plugin

  • Plugin page: ajax-product-sear...
  • Plugin version: 1.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-5.3
  • WordPress version: 6.3.1
  • First release: Sep 25, 2015
  • Latest release: Jan 24, 2020
  • Number of updates: 143
  • Update frequency: every 11.1 days
  • Top authors: phoeniixx (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 12,526 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼8.96ms] Passed 4 tests

Server-side resources used by Ajax Product Search for Woocommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0541.50 ▼0.28
Dashboard /wp-admin3.39 ▲0.0841.01 ▼15.89
Posts /wp-admin/edit.php3.42 ▲0.0745.71 ▼2.87
Add New Post /wp-admin/post-new.php6.06 ▲0.1872.45 ▼16.81
Media Library /wp-admin/upload.php3.33 ▲0.1034.03 ▲0.54

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 34 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ajax Product Search for Woocommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.25 ▼1.121.72 ▼0.0539.05 ▼5.15
Dashboard /wp-admin2,212 ▲245.91 ▲0.0198.54 ▼18.4838.59 ▼8.84
Posts /wp-admin/edit.php2,091 ▲22.02 ▼0.0339.18 ▲3.8837.75 ▲0.28
Add New Post /wp-admin/post-new.php1,548 ▲618.34 ▲0.19598.87 ▼11.3251.99 ▲4.61
Media Library /wp-admin/upload.php1,394 ▲94.13 ▼0.1697.89 ▼2.1641.23 ▼3.19

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 did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/ajax-product-search-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ajax-product-search-for-woocommerce/ajax_search_widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/ajax-product-search-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/ajax-product-search-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Tags: You are using too many tags: 30 tag instead of maximum 10
You can take inspiration from this readme.txt

ajax-product-search-for-woocommerce/plugin.php 69% from 13 tests

The main PHP file in "Ajax Product Search for Woocommerce" ver. 1.5.2 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Domain Path: The domain path points to an invalid folder, "/languages/" does not exist
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ajax-product-search-for-woocommerce.php" instead of "plugin.php")
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0" instead of "2.6.0")

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 plugin2,564 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP77631,7032,485
JavaScript153479

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity42.62
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.17
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods105
▷ Static methods54.76%
▷ Public methods8278.10%
▷ Protected methods2321.90%
▷ Private methods00.00%
Functions13
▷ Named functions1292.31%
▷ Anonymous functions17.69%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
21 PNG files occupy 0.34MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/widget.png16.56KB5.14KB▼ 68.97%
assets/images/search-options.png7.16KB4.17KB▼ 41.72%
assets/images/search-by-sku.png7.13KB4.86KB▼ 31.84%
assets/images/view-all.png113.44KB39.23KB▼ 65.42%
assets/images/short-code.png1.03KB0.94KB▼ 8.70%