84% wp-ajax-search-widget

Code Review | WP Ajax Search Widget

WordPress plugin WP Ajax Search Widget scored84%from 54 tests.

About plugin

  • Plugin page: wp-ajax-search-wi...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.3
  • WordPress version: 6.3.1
  • First release: Jul 10, 2014
  • Latest release: Jul 4, 2015
  • Number of updates: 8
  • Update frequency: every 45.1 days
  • Top authors: scottsweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /3,851 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.12ms] Passed 4 tests

This is a short check of server-side resources used by WP Ajax Search Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0135.91 ▼9.68
Dashboard /wp-admin3.32 ▲0.0249.79 ▲0.18
Posts /wp-admin/edit.php3.37 ▲0.0153.03 ▲3.33
Add New Post /wp-admin/post-new.php5.90 ▲0.0198.81 ▼5.94
Media Library /wp-admin/upload.php3.24 ▲0.0134.41 ▼1.03

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
widget_wpasw-widget
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by WP Ajax Search Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.35 ▼1.011.95 ▲0.1342.49 ▼3.28
Dashboard /wp-admin2,203 ▲125.90 ▼0.02104.76 ▲0.6542.62 ▼1.20
Posts /wp-admin/edit.php2,092 ▲32.01 ▲0.0039.50 ▲1.2636.95 ▼0.57
Add New Post /wp-admin/post-new.php1,545 ▲2618.38 ▼4.44610.02 ▼70.0755.44 ▲1.00
Media Library /wp-admin/upload.php1,382 ▼94.32 ▲0.1594.37 ▼11.5141.35 ▼4.89

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_wpasw-widget
    • 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
Even though no errors were found, 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
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-ajax-search-widget/wp-ajax-search-widget.php:38

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
You can look at the official readme.txt

wp-ajax-search-widget/wp-ajax-search-widget.php 92% from 13 tests

The primary PHP file in "WP Ajax Search Widget" version 1.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin277 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP24585113
JavaScript116160
Markdown123045
PO File1121244
JSON10015

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity18.00
▷ Minimum class complexity18.00
▷ Maximum class complexity18.00
Average method complexity3.43
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected