78% ajax-search-popup

Code Review | Ajax Search Popup

WordPress plugin Ajax Search Popup scored78%from 54 tests.

About plugin

  • Plugin page: ajax-search-popup
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.8
  • WordPress version: 6.3.1
  • First release: Aug 28, 2018
  • Latest release: Sep 21, 2018
  • Number of updates: 5
  • Update frequency: every 4.8 days
  • Top authors: yasintechnology (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /891 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.01MB] [CPU: ▼7.89ms] Passed 4 tests

An overview of server-side resources used by Ajax Search Popup
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.48 ▼3.18
Dashboard /wp-admin3.33 ▼0.0244.15 ▼16.78
Posts /wp-admin/edit.php3.38 ▲0.0250.49 ▲1.54
Add New Post /wp-admin/post-new.php5.91 ▲0.0293.91 ▼5.63
Media Library /wp-admin/upload.php3.25 ▲0.0233.38 ▼5.96
Setting /wp-admin/admin.php?page=search-popup-setting3.2630.71
Contact Us /wp-admin/admin.php?page=about-us3.2132.31

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 18 new files
Database: no new tables, 11 new options
New WordPress options
s_popup_post
s_popup_posts_per_page
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
s_popup_page
widget_search_popup_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
...

Browser metrics Passed 4 tests

An overview of browser requirements for Ajax Search Popup
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,917 ▲14613.72 ▼0.845.67 ▲3.7971.88 ▲29.00
Dashboard /wp-admin2,235 ▲504.84 ▼1.03107.95 ▲3.3842.22 ▼2.13
Posts /wp-admin/edit.php2,118 ▲292.04 ▲0.0142.14 ▲3.7635.91 ▼0.98
Add New Post /wp-admin/post-new.php1,552 ▲3323.14 ▼0.40591.63 ▼60.0154.84 ▲2.90
Media Library /wp-admin/upload.php1,411 ▲234.18 ▼0.0794.34 ▼17.9541.72 ▼5.62
Setting /wp-admin/admin.php?page=search-popup-setting9182.0525.0135.13
Contact Us /wp-admin/admin.php?page=about-us7882.0524.9424.19

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
Please fix the following items
  • The uninstall procedure has failed, leaving 11 options in the database
    • db_upgraded
    • widget_search_popup_widget
    • theysaidso_admin_options
    • s_popup_title
    • widget_recent-comments
    • widget_theysaidso_widget
    • s_popup_post
    • widget_recent-posts
    • s_popup_posts_per_page
    • s_popup_page
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% 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 take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/ajax-search-popup/ajax-search-popup.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr__() in wp-content/plugins/ajax-search-popup/setting.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ajax-search-popup/widget.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ajax-search-popup/form.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% 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 your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This screen shot show a view of search form.), #2 (This screen shot show a view of search form with options.), #3 (This screen shot show a view of search form in widget.), #4 (This screen shot show a view of search form with result.), #5 (This screen shot show a view from the admin panel.)
You can take inspiration from this readme.txt

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

The main PHP script in "Ajax Search Popup" version 1.0 is automatically included on every request by WordPress
52 characters long description:
Ajax Popup Search. Search By Post And Page On KeyUp.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin585 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
CSS26526310
PHP417370231
JavaScript229044

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity6.00
▷ Minimum class complexity4.00
▷ Maximum class complexity8.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods1173.33%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/296814-322.png0.58KB0.48KB▼ 17.42%
img/115702-32.png0.69KB0.28KB▼ 59.29%