89% search-box-on-navigation-menu

Code Review | Search box on Navigation Menu

WordPress plugin Search box on Navigation Menu scored 89% from 54 tests.

About plugin

  • Plugin page: search-box-on-nav...
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.8
  • WordPress version: 6.3.1
  • First release: Jan 29, 2013
  • Latest release: Jun 29, 2017
  • Number of updates: 17
  • Update frequency: every 95.4 days
  • Top authors: re_enter_rupok (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

800+ active / 41,860 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
Install script ran successfully

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

Analyzing server-side resources used by Search box on Navigation Menu
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.26 ▼5.42
Dashboard /wp-admin3.32 ▲0.0259.01 ▲6.72
Posts /wp-admin/edit.php3.37 ▲0.0254.25 ▼1.38
Add New Post /wp-admin/post-new.php5.90 ▲0.02101.20 ▼1.11
Media Library /wp-admin/upload.php3.24 ▲0.0239.39 ▲3.55
Search box on Navigation Menu /wp-admin/options-general.php?page=search_box_to_menu3.2038.08

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
search_box_to_menu

Browser metrics Passed 4 tests

Checking browser requirements for Search box on Navigation Menu
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▼713.55 ▼0.861.61 ▼0.4343.12 ▲0.21
Dashboard /wp-admin2,210 ▲44.82 ▼1.05108.14 ▲0.4243.03 ▲4.63
Posts /wp-admin/edit.php2,093 ▲42.01 ▲0.0339.12 ▼0.9334.76 ▲0.19
Add New Post /wp-admin/post-new.php1,536 ▼623.02 ▲4.70634.04 ▲32.3455.14 ▼6.06
Media Library /wp-admin/upload.php1,389 ▲74.33 ▲0.1395.88 ▼3.4246.80 ▲1.49
Search box on Navigation Menu /wp-admin/options-general.php?page=search_box_to_menu8172.0326.3727.25

Uninstaller [IO: ✅] [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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • search_box_to_menu
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% 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 to be fixed: Please take inspiration from this readme.txt

search-box-on-navigation-menu/search-box-to-menu.php 85% from 13 tests

"Search box on Navigation Menu" version 2.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("search-box-on-navigation-menu.php" instead of "search-box-to-menu.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
No dangerous file extensions were detected254 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP8132377254

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity4.17
▷ Minimum class complexity2.00
▷ Maximum class complexity9.00
Average method complexity1.66
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods2586.21%
▷ Protected methods00.00%
▷ Private methods413.79%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected