10% addsearch-instant-search

Code Review | AddSearch

WordPress plugin AddSearch scored10%from 54 tests.

About plugin

  • Plugin page: addsearch-instant...
  • Plugin version: 2.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-6.2
  • WordPress version: 6.3.1
  • First release: Sep 28, 2017
  • Latest release: Jun 16, 2023
  • Number of updates: 66
  • Update frequency: every 31.8 days
  • Top authors: sofokus (56.06%)addsearch (45.45%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /8,732 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/addsearch-instant-search/addsearch.php+458
    Trying to access array offset on value of type bool

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

Server-side resources used by AddSearch
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.92 ▼0.5519.44 ▼20.30
Dashboard /wp-admin3.39 ▲0.0943.88 ▼8.11
Posts /wp-admin/edit.php3.51 ▲0.1548.79 ▲4.56
Add New Post /wp-admin/post-new.php5.97 ▲0.0979.97 ▼18.88
Media Library /wp-admin/upload.php3.32 ▲0.0933.93 ▲1.04
AddSearch /wp-admin/options-general.php?page=addsearch-options3.3030.71

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 20 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
addsearch_currentversion
theysaidso_admin_options
addsearch_prexisting
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for AddSearch
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲4613.25 ▼1.181.55 ▼0.2325.33 ▼18.80
Dashboard /wp-admin2,207 ▲255.84 ▲0.96108.34 ▲6.7141.21 ▼0.76
Posts /wp-admin/edit.php2,096 ▲72.01 ▲0.0138.98 ▼0.1236.40 ▲4.60
Add New Post /wp-admin/post-new.php1,517 ▼217.50 ▼5.58689.22 ▲18.5565.86 ▲2.07
Media Library /wp-admin/upload.php1,392 ▲74.21 ▲0.0493.45 ▼18.9441.68 ▼0.91
AddSearch /wp-admin/options-general.php?page=addsearch-options1,6461.6923.8729.38

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 29 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/addsearch.php+666
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/addsearch-instant-search/admin/settings-srp.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/addsearch-instant-search/admin/settings.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/addsearch-instant-search/includes/theme-functions.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/addsearch-instant-search/templates/searchv2.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/addsearch-instant-search/templates/search.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/addsearch-instant-search/templates/search-results.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/addsearch-instant-search/admin/settings-widget.php:10

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 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention: Please take inspiration from this readme.txt

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

The primary PHP file in "AddSearch" version 2.2.3 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("addsearch-instant-search.php" instead of "addsearch.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin2,157 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JSON1001,151
PHP11162321774
PO File1262971
Markdown153065
Bourne Shell1363664
JavaScript14024
CSS1108

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity55.00
▷ Minimum class complexity55.00
▷ Maximum class complexity55.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods30
▷ Static methods826.67%
▷ Public methods2583.33%
▷ Protected methods00.00%
▷ Private methods516.67%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected