10% sh-contextual-help

Code Review | SH Contextual Help

WordPress plugin SH Contextual Help scored 10% from 54 tests.

About plugin

  • Plugin page: sh-contextual-help
  • Plugin version: 3.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-3.5.1
  • WordPress version: 5.8.1
  • First release: Apr 23, 2011
  • Latest release: Jun 22, 2013
  • Number of updates: 71
  • Update frequency: every 11.2 days
  • Top authors: samhoamt (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active / 3,619 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/sh-contextual-help/shcontextual-help.php+32
    Use of undefined constant SH_CONTEXTUAL_HELP_FOLDER - assumed 'SH_CONTEXTUAL_HELP_FOLDER' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.86MB] [CPU: ▼188.67ms] Passed 4 tests

A check of server-side resources used by SH Contextual Help
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /1.77 ▼0.954.82 ▼16.08
Dashboard /wp-admin1.79 ▼1.266.68 ▼39.04
Posts /wp-admin/edit.php1.79 ▼1.316.40 ▼33.02
Add New Post /wp-admin/post-new.php1.79 ▼3.645.44 ▼652.60
Media Library /wp-admin/upload.php1.79 ▼1.215.53 ▼30.01
SH Contextual Help /wp-admin/options-general.php?page=sh-contextual-help/settings.php1.796.03

Server storage [IO: ▲0.06MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 9 new options
New WordPress options
sh_menu_help_role
sh_menu_help_widget_content
sh_menu_help_content
sh_menu_help_menu_title
sh_menu_help_widget_title
sh_help_menus
sh_menu_help
sh_menu_help_widget
sh_menu_help_title

Browser metrics Passed 4 tests

Checking browser requirements for SH Contextual Help
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,704 ▲10815.94 ▲0.238.94 ▼1.0250.67 ▲4.86
Dashboard /wp-admin2,992 ▲585.93 ▼0.04157.78 ▲11.07112.66 ▼1.26
Posts /wp-admin/edit.php2,764 ▲252.72 ▲0.0160.54 ▼2.4694.34 ▲6.95
Add New Post /wp-admin/post-new.php1,516 ▼16718.53 ▼0.25353.27 ▼3.44109.26 ▲3.89
Media Library /wp-admin/upload.php1,835 ▲875.01 ▼0.03145.33 ▼20.01117.54 ▼6.09
SH Contextual Help /wp-admin/options-general.php?page=sh-contextual-help/settings.php2,3892.0955.1981.85

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/sh-contextual-help/shcontextual-help.php+32
    Use of undefined constant SH_CONTEXTUAL_HELP_FOLDER - assumed 'SH_CONTEXTUAL_HELP_FOLDER' (this will throw an Error in a future version of PHP)
  • The uninstall procedure has failed, leaving 8 options in the database
    • sh_menu_help_menu_title
    • sh_menu_help_widget
    • sh_menu_help_role
    • sh_menu_help_content
    • sh_menu_help_title
    • sh_menu_help_widget_content
    • sh_menu_help
    • sh_menu_help_widget_title

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=sh-contextual-help/settings.php
    • > Warning in wp-content/plugins/sh-contextual-help/shcontextual-help.php+32
    Use of undefined constant SH_CONTEXTUAL_HELP_FOLDER - assumed 'SH_CONTEXTUAL_HELP_FOLDER' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=sh-contextual-help/settings.php
    • > Warning in wp-content/plugins/sh-contextual-help/shcontextual-help.php+33
    Use of undefined constant SH_CONTEXTUAL_HELP_PATH - assumed 'SH_CONTEXTUAL_HELP_PATH' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=sh-contextual-help/settings.php
    • > Warning in wp-content/plugins/sh-contextual-help/shcontextual-help.php+34
    Use of undefined constant PLUGIN_BASENAME - assumed 'PLUGIN_BASENAME' (this will throw an Error in a future version of PHP)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=sh-contextual-help/settings.php
    • > User deprecated in wp-includes/functions.php+5495
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=sh-contextual-help/settings.php
    • > User deprecated in wp-includes/functions.php+5586
    contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=sh-contextual-help/settings.php
    • > Notice in wp-content/plugins/sh-contextual-help/settings.php+17
    Undefined index: tab
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=sh-contextual-help/settings.php
    • > Notice in wp-content/plugins/sh-contextual-help/functions.php+38
    Undefined index: submit
    • > GET request to /wp-admin/options-general.php?page=sh-contextual-help/settings.php
    • > Notice in wp-content/plugins/sh-contextual-help/functions.php+87
    Undefined index: action

SRP 0% 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× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/sh-contextual-help/functions.php
  • 12× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/sh-contextual-help/shcontextual-help.php:34
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sh-contextual-help/settings.php on line 12
    • > PHP Warning
      Use of undefined constant PLUGIN_BASENAME - assumed 'PLUGIN_BASENAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/sh-contextual-help/shcontextual-help.php on line 34
    • > PHP Warning
      Use of undefined constant SH_CONTEXTUAL_HELP_PATH - assumed 'SH_CONTEXTUAL_HELP_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sh-contextual-help/functions.php on line 17
    • > PHP Warning
      Use of undefined constant SH_CONTEXTUAL_HELP_PATH - assumed 'SH_CONTEXTUAL_HELP_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sh-contextual-help/functions.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sh-contextual-help/functions.php:24
    • > PHP Notice
      Undefined index: tab in wp-content/plugins/sh-contextual-help/settings.php on line 17
    • > PHP Warning
      Use of undefined constant SH_CONTEXTUAL_HELP_FOLDER - assumed 'SH_CONTEXTUAL_HELP_FOLDER' (this will throw an Error in a future version of PHP) in wp-content/plugins/sh-contextual-help/shcontextual-help.php on line 32
    • > PHP Warning
      Use of undefined constant SH_CONTEXTUAL_HELP_PATH - assumed 'SH_CONTEXTUAL_HELP_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sh-contextual-help/functions.php on line 17
    • > PHP Warning
      Use of undefined constant SH_CONTEXTUAL_HELP_PATH - assumed 'SH_CONTEXTUAL_HELP_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sh-contextual-help/shcontextual-help.php on line 33

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Donate link: Invalid url: ""
You can look at the official readme.txt

sh-contextual-help/shcontextual-help.php 85% from 13 tests

The principal PHP file in "SH Contextual Help" v. 3.2.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 202 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sh-contextual-help.php" instead of "shcontextual-help.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin650 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP41839650

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
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%
Constants3
▷ Global constants3100.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
No PNG files were detected