58% jc-ajax-search-for-woocommerce

Code Review | JC Ajax Search for WooCommerce

WordPress plugin JC Ajax Search for WooCommerce scored58%from 54 tests.

About plugin

  • Plugin page: jc-ajax-search-fo...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Sep 15, 2022
  • Latest release: Sep 19, 2022
  • Number of updates: 5
  • Update frequency: every 0.6 days
  • Top authors: jcwpplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /227 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.49MB] [CPU: ▲3.13ms] Passed 4 tests

A check of server-side resources used by JC Ajax Search for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.97 ▲0.5147.91 ▲10.74
Dashboard /wp-admin3.81 ▲0.4746.41 ▼5.88
Posts /wp-admin/edit.php3.87 ▲0.5146.41 ▲8.50
Add New Post /wp-admin/post-new.php6.35 ▲0.4789.96 ▲0.55
Media Library /wp-admin/upload.php3.74 ▲0.5141.59 ▲9.36
Freemius Debug [v.2.4.5] /wp-admin/admin.php?page=freemius3.9436.28

Server storage [IO: ▲3.84MB] [DB: ▲0.08MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 206 new files
Database: 1 new table, 10 new options
New tables
wcjc_ajax_search_shorcode
New WordPress options
fs_gdpr
widget_recent-posts
widget_recent-comments
fs_active_plugins
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
fs_accounts
fs_debug_mode

Browser metrics Passed 4 tests

A check of browser resources used by JC Ajax Search for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,007 ▲24613.72 ▼0.906.52 ▲4.9333.71 ▼5.48
Dashboard /wp-admin2,302 ▲1305.10 ▼0.5088.85 ▼31.0885.53 ▲37.71
Posts /wp-admin/edit.php2,210 ▲1072.53 ▲0.5438.78 ▼1.0935.71 ▲6.23
Add New Post /wp-admin/post-new.php1,772 ▲23722.83 ▼2.21687.26 ▲42.5130.80 ▼28.85
Media Library /wp-admin/upload.php1,501 ▲1044.68 ▲0.51101.92 ▲8.0591.00 ▲52.27
Freemius Debug [v.2.4.5] /wp-admin/admin.php?page=freemius1,1652.2529.3526.35

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/jc-ajax-search-for-woocommerce/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • The uninstall procedure failed, leaving 1 table in the database
    • wcjc_ajax_search_shorcode
  • This plugin does not fully uninstall, leaving 10 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • fs_gdpr
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • fs_active_plugins
    • db_upgraded
    • widget_recent-posts
    • fs_debug_mode
    • fs_accounts

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/jc-ajax-search-for-woocommerce/admin/partials/wc-ajax-search-jc-admin-display.php
    • > /wp-content/plugins/jc-ajax-search-for-woocommerce/frontend/partials/wc-ajax-search-jc-public-display.php
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/jc-ajax-search-for-woocommerce/frontend/class-wc-ajax-search-jc-public.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/jc-ajax-search-for-woocommerce/admin/class-wc-ajax-search-jc-admin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/jc-ajax-search-for-woocommerce/frontend/controller/wcjc-public-ajax-search.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/jc-ajax-search-for-woocommerce/admin/views/search-form-create.php:71
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/jc-ajax-search-for-woocommerce/admin/controller/wcjc-admin-ajax-search.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/jc-ajax-search-for-woocommerce/admin/views/search-form-list.php:6
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/jc-ajax-search-for-woocommerce/frontend/views/wpjc-shorcode-search-print.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
6 plugin tags: ajax, woocommerce search ajax, woo, search, woocommerce search form...

jc-ajax-search-for-woocommerce/jc-ajax-search-for-woocommerce.php Passed 13 tests

The main PHP file in "JC Ajax Search for WooCommerce" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
139 characters long description:
JC Ajax Search for WooCommerce allows you to create search forms with different settings to search for products without refreshing the page

Code Analysis 97% from 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
Success! There were no dangerous files found in this plugin33,187 lines of code in 147 files:
LanguageFilesBlank linesComment linesLines of code
PHP1257,39316,59631,162
CSS143391,421
JavaScript649120492
PO File1333386
SVG10126

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
The following items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,911)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity74.02
▷ Minimum class complexity1.00
▷ Maximum class complexity2,911.00
Average method complexity4.57
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes56
▷ Abstract classes23.57%
▷ Concrete classes5496.43%
▷ Final classes00.00%
Methods1,177
▷ Static methods17514.87%
▷ Public methods83270.69%
▷ Protected methods151.27%
▷ Private methods33028.04%
Functions97
▷ Named functions97100.00%
▷ Anonymous functions00.00%
Constants125
▷ Global constants9979.20%
▷ Class constants2620.80%
▷ Public constants26100.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
6 PNG files occupy 0.15MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/wc-ajax-search-jc.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/screenshot-1.png108.64KB28.19KB▼ 74.05%
assets/icon-256x256.png10.34KB4.38KB▼ 57.69%
assets/icon-128x128.png4.62KB2.37KB▼ 48.71%