10% addsearch-instant-search

Code Review | AddSearch

WordPress plugin AddSearch scored 10% from 54 tests.

About plugin

  • Plugin page: addsearch-instant...
  • Plugin version: 2.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.8.2
  • WordPress version: 5.9.2
  • First release: Sep 28, 2017
  • Latest release: Nov 19, 2021
  • Number of updates: 55
  • Update frequency: every 27.7 days
  • Top authors: sofokus (67.27%)addsearch (34.55%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 5,004 total downloads


Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/addsearch-instant-search/addsearch.php+257
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼0.42MB] [CPU: ▼315.71ms] Passed 4 tests

Server-side resources used by AddSearch
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.12 ▼0.4022.66 ▼41.34
Dashboard /wp-admin3.32 ▼0.0932.64 ▼7.65
Posts /wp-admin/edit.php3.30 ▼0.3425.75 ▼15.05
Add New Post /wp-admin/post-new.php6.10 ▼0.8780.36 ▼1,195.57
Media Library /wp-admin/upload.php3.33 ▲0.0329.01 ▼10.87
AddSearch /wp-admin/options-general.php?page=addsearch-options3.3023.55

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for AddSearch
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,820 ▲7615.94 ▲0.376.03 ▲0.462.87 ▲0.33
Dashboard /wp-admin2,908 ▲576.16 ▲0.00116.53 ▼20.08153.13 ▼9.04
Posts /wp-admin/edit.php2,708 ▲173.23 ▼0.0163.90 ▲1.07148.60 ▼0.97
Add New Post /wp-admin/post-new.php1,704 ▲4321.02 ▲4.32433.15 ▲46.77154.46 ▼10.75
Media Library /wp-admin/upload.php1,715 ▲175.55 ▲0.05144.71 ▲4.06187.94 ▲10.34
AddSearch /wp-admin/options-general.php?page=addsearch-options1,1792.5353.63137.87

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=addsearch-options
    • > Notice in wp-content/plugins/addsearch-instant-search/admin/settings.php+44
    Trying to access array offset on value of type bool

SRP 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/addsearch-instant-search/templates/search.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side


Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes: You can take inspiration from this readme.txt

addsearch-instant-search/addsearch.php 85% from 13 tests

The main file in "AddSearch" v. 2.0.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("addsearch-instant-search.php" instead of "addsearch.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
No dangerous file extensions were detected1,636 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PO File1262971
Bourne Shell1363664

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
▷ Static methods642.86%
▷ Public methods964.29%
▷ Protected methods00.00%
▷ Private methods535.71%
▷ Named functions7100.00%
▷ Anonymous functions00.00%
▷ 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
No PNG files were detected