84% somewhere-search-box

Code Review | Somewhere search box

WordPress plugin Somewhere search box scored84%from 54 tests.

About plugin

  • Plugin page: somewhere-search-box
  • Plugin version: 1.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-5.8.0
  • WordPress version: 6.3.1
  • First release: Dec 24, 2012
  • Latest release: Jul 20, 2021
  • Number of updates: 19
  • Update frequency: every 164.8 days
  • Top authors: tmatsuur (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /3,843 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.89ms] Passed 4 tests

Analyzing server-side resources used by Somewhere search box
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0639.14 ▼2.21
Dashboard /wp-admin3.37 ▲0.0245.55 ▼14.31
Posts /wp-admin/edit.php3.42 ▲0.0646.87 ▼5.30
Add New Post /wp-admin/post-new.php5.95 ▲0.0690.51 ▲2.86
Media Library /wp-admin/upload.php3.28 ▲0.0635.76 ▲2.27

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
somewhere-search-box-db-version
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Somewhere search box
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,898 ▲15213.64 ▼0.674.39 ▲2.1937.59 ▼5.29
Dashboard /wp-admin2,304 ▲1255.88 ▲0.0797.29 ▼8.3838.09 ▼1.88
Posts /wp-admin/edit.php2,096 ▲42.03 ▼0.0039.71 ▼2.3935.02 ▼2.05
Add New Post /wp-admin/post-new.php6,284 ▲4,76226.30 ▲3.21858.15 ▲254.3762.21 ▲8.06
Media Library /wp-admin/upload.php1,391 ▲34.30 ▲0.1198.50 ▼6.2944.41 ▲4.94

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
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • somewhere-search-box-db-version
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/somewhere-search-box/somewhere-search-box.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Search post widget in edit page.), #2 (Previous and next post edit button in edit page.), #3 (Replicate link in posts link page.)
The official readme.txt might help

somewhere-search-box/somewhere-search-box.php Passed 13 tests

"Somewhere search box" version 1.4.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
47 characters long description:
Search box widget add to the admin post editor.

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
Good job! No executable or dangerous file extensions detected270 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP17103236
PO File191134

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.73
Average class complexity58.00
▷ Minimum class complexity58.00
▷ Maximum class complexity58.00
Average method complexity5.75
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods975.00%
▷ Protected methods00.00%
▷ Private methods325.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png7.05KB3.35KB▼ 52.55%
screenshot-1.png3.50KB1.67KB▼ 52.37%
screenshot-2.png10.38KB4.30KB▼ 58.52%