84% ajax-product-search

Code Review | Ajax Product Search for WooCommerce

WordPress plugin Ajax Product Search for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: ajax-product-search
  • Plugin version: 1.0.1
  • PHP compatiblity: 6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8
  • WordPress version: 6.3.1
  • First release: Mar 27, 2020
  • Latest release: Jul 22, 2021
  • Number of updates: 15
  • Update frequency: every 32.2 days
  • Top authors: themebing (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,711 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼8.09ms] Passed 4 tests

Server-side resources used by Ajax Product Search for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.33 ▼8.42
Dashboard /wp-admin3.34 ▼0.0152.78 ▼15.83
Posts /wp-admin/edit.php3.39 ▲0.0348.22 ▼3.20
Add New Post /wp-admin/post-new.php5.92 ▲0.0391.29 ▼4.92
Media Library /wp-admin/upload.php3.26 ▲0.0337.87 ▼1.99

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Ajax Product Search for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲11413.41 ▼0.949.03 ▲6.9443.83 ▲1.44
Dashboard /wp-admin2,198 ▲215.57 ▼0.0187.44 ▼11.4448.10 ▲5.30
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0233.00 ▼4.8134.71 ▲0.85
Add New Post /wp-admin/post-new.php1,526 ▼223.30 ▲0.17629.33 ▼103.8450.57 ▼8.31
Media Library /wp-admin/upload.php1,400 ▼04.18 ▲0.0199.22 ▼9.7645.89 ▼2.92

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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 take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ajax-product-search/includes/wpbakery/vc_shortcodes.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/ajax-product-search/functions.php:24

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
9 plugin tags: product search, ajax, woocommerce product search, ajax search, search...

ajax-product-search/ajax-product-search.php Passed 13 tests

The main PHP script in "Ajax Product Search for WooCommerce" version 1.0.1 is automatically included on every request by WordPress
78 characters long description:
Ajax Product Search is a simple instant product search plugin for WooCommerce.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin247 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP66521191
CSS17047
JavaScript1519

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity2.67
▷ Minimum class complexity1.00
▷ Maximum class complexity4.00
Average method complexity1.31
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods16
▷ Static methods16.25%
▷ Public methods1381.25%
▷ Protected methods212.50%
▷ Private methods16.25%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin