78% wp-search-keyword-highlight

Code Review | WP Search Keyword Highlight

WordPress plugin WP Search Keyword Highlight scored 78% from 54 tests.

About plugin

  • Plugin page: wp-search-keyword...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.8.1
  • WordPress version: 6.3.1
  • First release: Feb 19, 2014
  • Latest release: Mar 24, 2014
  • Number of updates: 14
  • Update frequency: every 2.4 days
  • Top authors: suifengtec (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,189 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
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by WP Search Keyword Highlight
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1039.09 ▼4.16
Dashboard /wp-admin3.38 ▲0.0848.31 ▼2.24
Posts /wp-admin/edit.php3.43 ▲0.0752.01 ▲2.02
Add New Post /wp-admin/post-new.php5.96 ▲0.0786.48 ▼9.44
Media Library /wp-admin/upload.php3.30 ▲0.0736.41 ▲0.48
SKH Pannel /wp-admin/options-general.php?page=coolwp_skh2.8717.30

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 15 new options
New WordPress options
skh_help_callout
skh_general_callout
widget_recent-comments
db_upgraded
skh_color
widget_theysaidso_widget
recovery_mode_email_last_sent
of_shortname
skh_bgcolor
of_template
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Search Keyword Highlight
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.64 ▼0.741.80 ▼0.3241.23 ▼7.61
Dashboard /wp-admin2,210 ▲255.12 ▼0.69106.58 ▼11.9838.59 ▼7.49
Posts /wp-admin/edit.php2,093 ▲72.03 ▼0.0140.31 ▲2.6635.27 ▲1.25
Add New Post /wp-admin/post-new.php1,517 ▼1817.71 ▼5.45671.86 ▼4.1151.37 ▼5.27
Media Library /wp-admin/upload.php1,395 ▲74.18 ▼0.0394.82 ▼0.4843.59 ▼1.15
SKH Pannel /wp-admin/options-general.php?page=coolwp_skh7521.8318.9929.44

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
  • This plugin does not fully uninstall, leaving 15 options in the database
    • skh_bgcolor
    • skh_help_callout
    • skh_general_callout
    • can_compress_scripts
    • of_shortname
    • skh_turn_on
    • widget_recent-comments
    • skh_color
    • widget_recent-posts
    • widget_theysaidso_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=coolwp_skh
    • > Notice in wp-content/plugins/wp-search-keyword-highlight/admin/cwp-plugin-admin-functions.php+11
    Undefined index: id
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=coolwp_skh
    • > Notice in wp-content/plugins/wp-search-keyword-highlight/admin/cwp-plugin-admin-functions.php+12
    Undefined index: std
    • > GET request to /wp-admin/options-general.php?page=coolwp_skh
    • > Error in wp-content/plugins/wp-search-keyword-highlight/admin/cwp-plugin-admin-interface.php+417
    Uncaught Error: Call to undefined function ereg_replace() in wp-content/plugins/wp-search-keyword-highlight/admin/cwp-plugin-admin-interface.php:417
    Stack trace:
    #0 wp-content/plugins/wp-search-keyword-highlight/admin/cwp-plugin-admin-interface.php(61): coolwp_plugin_skh_robot()
    #1 wp-includes/class-wp-hook.php(310): coolwp_skh_options_page()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #6 {main}
    thrown

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
Almost there! Just fix the following items
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-search-keyword-highlight/admin/cwp-plugin-admin-interface.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-search-keyword-highlight/admin/cwp-plugin-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-search-keyword-highlight/admin/cwp-plugin-admin-functions.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wp-search-keyword-highlight/wp-search-keyword-highlight.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-search-keyword-highlight/admin/cwp-plugin-admin-functions.php:21

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

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: keyword highlight, search keyword highlight

wp-search-keyword-highlight/wp-search-keyword-highlight.php 77% from 13 tests

"WP Search Keyword Highlight" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Domain Path: The domain path folder does not exist ("/lang/")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 197 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected1,538 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
CSS36121606
PHP510066485
JavaScript108447

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
11 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/colorpicker/colorpicker_rgb_b.png0.95KB0.76KB▼ 19.48%
admin/images/colorpicker/colorpicker_overlay.png10.11KB8.24KB▼ 18.50%
admin/images/colorpicker/colorpicker_background.png1.85KB2.14KB0.00%
admin/images/colorpicker/colorpicker_hsb_h.png0.99KB0.77KB▼ 21.94%
admin/images/colorpicker/colorpicker_hsb_s.png1.14KB0.80KB▼ 29.97%