84% simple-ajax-search

Code Review | Simple Ajax Search

WordPress plugin Simple Ajax Search scored84%from 54 tests.

About plugin

  • Plugin page: simple-ajax-search
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.3
  • WordPress version: 6.3.1
  • First release: Jun 21, 2018
  • Latest release: Nov 16, 2019
  • Number of updates: 7
  • Update frequency: every 73.3 days
  • Top authors: pablocianes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /985 total downloads

Benchmarks

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 successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Simple Ajax Search
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0844.01 ▲5.67
Dashboard /wp-admin3.37 ▲0.0748.90 ▼0.39
Posts /wp-admin/edit.php3.49 ▲0.1349.73 ▲0.72
Add New Post /wp-admin/post-new.php5.96 ▲0.0782.45 ▼10.65
Media Library /wp-admin/upload.php3.30 ▲0.0740.11 ▲6.34

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Simple Ajax Search: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.31 ▼0.061.72 ▲0.2448.95 ▲3.92
Dashboard /wp-admin2,192 ▲185.60 ▼0.0194.46 ▲3.0741.14 ▲2.56
Posts /wp-admin/edit.php2,103 ▲32.03 ▲0.0936.67 ▲1.2532.36 ▲1.33
Add New Post /wp-admin/post-new.php1,526 ▼1123.32 ▲5.32629.84 ▲18.6049.47 ▼22.23
Media Library /wp-admin/upload.php1,397 ▼64.20 ▲0.01100.94 ▼5.5042.66 ▼2.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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Unterminated comment starting line 1 in wp-content/plugins/simple-ajax-search/core/index.php on line 1
    • > PHP Warning
      Unterminated comment starting line 1 in wp-content/plugins/simple-ajax-search/public/index.php on line 1
    • > PHP Warning
      Unterminated comment starting line 1 in wp-content/plugins/simple-ajax-search/index.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/simple-ajax-search/public/views/simple-ajax-search-public-display.php:18

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
5 plugin tags: ajax, blog, search, search engine, seeker

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

The primary PHP file in "Simple Ajax Search" version 1.0.1 is used by WordPress to initiate all plugin functionality
57 characters long description:
Easily create a dynamic ajax search engine for your blog.

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
Everything looks great! No dangerous files found in this plugin418 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP9136551277
JavaScript228088
CSS20553

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity4.67
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.76
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods29
▷ Static methods310.34%
▷ Public methods2172.41%
▷ Protected methods13.45%
▷ Private methods724.14%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin