84% wp-search-live

Code Review | WP Live Search

WordPress plugin WP Live Search scored84%from 54 tests.

About plugin

  • Plugin page: wp-search-live
  • Plugin version: 0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.2.1
  • WordPress version: 6.3.1
  • First release: Jun 15, 2015
  • Latest release: Jun 25, 2015
  • Number of updates: 14
  • Update frequency: every 0.7 days
  • Top authors: nphaskins (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

80+ active /6,483 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

Server-side resources used by WP Live Search
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0640.51 ▲1.19
Dashboard /wp-admin3.35 ▲0.0455.55 ▲5.59
Posts /wp-admin/edit.php3.46 ▲0.1154.92 ▲1.98
Add New Post /wp-admin/post-new.php5.93 ▲0.0494.50 ▼42.73
Media Library /wp-admin/upload.php3.27 ▲0.0434.45 ▼0.57

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

WP Live Search: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,925 ▲17913.88 ▼0.8010.65 ▲7.9742.35 ▼2.26
Dashboard /wp-admin2,206 ▲184.89 ▲0.01112.03 ▲5.9641.99 ▼1.13
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0040.57 ▼0.2037.57 ▲1.92
Add New Post /wp-admin/post-new.php1,533 ▲522.66 ▼0.57657.32 ▲43.2856.75 ▲5.87
Media Library /wp-admin/upload.php1,388 ▲34.14 ▼0.03102.95 ▼4.4044.88 ▲0.84

Uninstaller [IO: ▲0.00MB] [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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-search-live/public/includes/class.assets.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-search-live/public/includes/class.shortcode.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-search-live/public/includes/underscore-template.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% 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
Please fix the following attributes:
  • Screenshots: Screenshot #2 (compact mode) image required
You can take inspiration from this readme.txt

wp-search-live/wp-live-search.php 92% from 13 tests

Analyzing the main PHP file in "WP Live Search" version 0.9
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-search-live.php" instead of "wp-live-search.php")

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
There were no executable files found in this plugin1,165 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2191299673
Sass55724272
PHP8114157214
Markdown1405
CSS1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity10.00
▷ Minimum class complexity3.00
▷ Maximum class complexity16.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods15
▷ Static methods853.33%
▷ Public methods960.00%
▷ Protected methods00.00%
▷ Private methods640.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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