78% wp-keyboard-shortcuts

Code Review | WP Keyboard Shortcuts Lite

WordPress plugin WP Keyboard Shortcuts Lite scored78%from 54 tests.

About plugin

  • Plugin page: wp-keyboard-short...
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.7
  • WordPress version: 6.3.1
  • First release: Aug 11, 2018
  • Latest release: Aug 11, 2018
  • Number of updates: 10
  • Update frequency: N/A
  • Top authors: evgendob (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /536 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.58MB] [CPU: ▼28.70ms] Passed 4 tests

An overview of server-side resources used by WP Keyboard Shortcuts Lite
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0831.44 ▼15.52
Dashboard /wp-admin3.36 ▲0.0633.87 ▼17.18
Posts /wp-admin/edit.php3.44 ▲0.0837.01 ▼15.11
Add New Post /wp-admin/post-new.php3.33 ▼2.5637.70 ▼66.97
Media Library /wp-admin/upload.php3.35 ▲0.1232.67 ▲0.41
Add Query /wp-admin/post-new.php?post_type=actions_query3.2636.12
Action Queries /wp-admin/edit.php?post_type=actions_query3.4234.86
Shortcuts /wp-admin/edit.php?post_type=actions_query&page=wks_editor3.3532.58
Shortcuts /wp-admin/admin.php?page=wks_editor3.3433.02
Settings /wp-admin/admin.php?page=wks_settings3.3428.95
Settings /wp-admin/edit.php?post_type=actions_query&page=wks_settings3.3531.57

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 44 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by WP Keyboard Shortcuts Lite
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,139 ▲35315.17 ▲0.446.56 ▲4.2343.22 ▼0.27
Dashboard /wp-admin2,437 ▲2606.39 ▲0.73109.55 ▲20.7338.31 ▼2.12
Posts /wp-admin/edit.php2,359 ▲2563.64 ▲1.6054.86 ▲12.7535.60 ▼1.71
Add New Post /wp-admin/post-new.php1,588 ▲6023.22 ▼0.11647.98 ▼24.4738.57 ▼27.99
Media Library /wp-admin/upload.php1,497 ▲1034.45 ▲0.2883.46 ▼22.0842.29 ▼3.03
Add Query /wp-admin/post-new.php?post_type=actions_query1,8483.7764.2539.19
Action Queries /wp-admin/edit.php?post_type=actions_query1,3383.5644.9228.96
Shortcuts /wp-admin/edit.php?post_type=actions_query&page=wks_editor1,5043.4142.7329.89
Shortcuts /wp-admin/admin.php?page=wks_editor1,5043.4643.3129.63
Settings /wp-admin/admin.php?page=wks_settings1,1363.2938.0425.47
Settings /wp-admin/edit.php?post_type=actions_query&page=wks_settings1,1393.2539.8827.00

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

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
These errors were triggered by the plugin
    • > GET request to /wp-admin/post-new.php?post_type=actions_query
    • > Notice in wp-content/plugins/wp-keyboard-shortcuts/modules/meta_box.php+116
    Undefined index: post_type
    • > GET request to /wp-admin/post-new.php?post_type=actions_query
    • > Notice in wp-content/plugins/wp-keyboard-shortcuts/modules/meta_box.php+132
    Undefined index: query_action
    • > GET request to /wp-admin/post-new.php?post_type=actions_query
    • > Warning in wp-content/plugins/wp-keyboard-shortcuts/modules/meta_box.php+132
    Invalid argument supplied for foreach()
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Warning in wp-content/plugins/wp-keyboard-shortcuts/modules/settings.php+450
    Illegal string offset 'show_menu_help'
  • 492 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Notice in wp-content/plugins/wp-keyboard-shortcuts/modules/hooks.php+322
    Uninitialized string offset: 0
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Warning in wp-content/plugins/wp-keyboard-shortcuts/modules/settings.php+450
    Illegal string offset 'trace_input'
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Warning in wp-content/plugins/wp-keyboard-shortcuts/modules/hooks.php+322
    Illegal string offset 'show_in_admin_bar'
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Notice in wp-content/plugins/wp-keyboard-shortcuts/modules/settings.php+452
    Undefined variable: out
  • 34 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Warning in wp-content/plugins/wp-keyboard-shortcuts/modules/hooks.php+196
    Illegal string offset 'combination'
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Warning in wp-content/plugins/wp-keyboard-shortcuts/modules/hooks.php+196
    count(): Parameter must be an array or an object that implements Countable
  • 136 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Warning in wp-content/plugins/wp-keyboard-shortcuts/modules/hooks.php+225
    Illegal string offset 'menu_element'
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Warning in wp-content/plugins/wp-keyboard-shortcuts/modules/hooks.php+198
    substr_count(): Empty substring
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Warning in wp-content/plugins/wp-keyboard-shortcuts/modules/hooks.php+207
    Illegal string offset 'actions_query'
  • 18 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Warning in wp-content/plugins/wp-keyboard-shortcuts/modules/hooks.php+234
    Illegal string offset 'action'
  • 20 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Warning in wp-content/plugins/wp-keyboard-shortcuts/modules/hooks.php+227
    Illegal string offset 'custom_action'
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Warning in wp-content/plugins/wp-keyboard-shortcuts/modules/hooks.php+228
    Illegal string offset 'visit_url_link'
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Warning in wp-content/plugins/wp-keyboard-shortcuts/modules/hooks.php+229
    Illegal string offset 'click_emulation_selector'
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Warning in wp-content/plugins/wp-keyboard-shortcuts/modules/hooks.php+276
    Illegal string offset 'small_descr'
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Notice in wp-content/plugins/wp-keyboard-shortcuts/modules/hooks.php+278
    Undefined variable: title
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Notice in wp-content/plugins/wp-keyboard-shortcuts/modules/hooks.php+279
    Undefined variable: value
  • 136 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wks_editor
    • > Notice in wp-content/plugins/wp-keyboard-shortcuts/modules/settings.php+304
    Undefined variable: i
  • 136 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wks_editor
    • > Notice in wp-content/plugins/wp-keyboard-shortcuts/modules/settings.php+304
    String offset cast occurred
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Notice in wp-content/plugins/wp-keyboard-shortcuts/modules/settings.php+450
    Undefined index: id
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Notice in wp-content/plugins/wp-keyboard-shortcuts/modules/settings.php+450
    Undefined index: class
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=actions_query&page=wks_settings
    • > Warning in wp-content/plugins/wp-keyboard-shortcuts/modules/settings.php+450
    Illegal string offset 'show_helper'

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-keyboard-shortcuts/modules/scripts.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_Action() in wp-content/plugins/wp-keyboard-shortcuts/modules/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-keyboard-shortcuts/modules/cpt.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_Action() in wp-content/plugins/wp-keyboard-shortcuts/modules/hooks.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-keyboard-shortcuts/modules/meta_box.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Contributors: The plugin contributors field is not present
  • Screenshots: Please add images for these screenshots: #1 (editor.png), #2 (settings.png)
You can look at the official readme.txt

wp-keyboard-shortcuts/wp-keyboard-shortcuts-lite.php 92% from 13 tests

The main PHP script in "WP Keyboard Shortcuts Lite" version 1.5 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-keyboard-shortcuts.php" instead of "wp-keyboard-shortcuts-lite.php")

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
No dangerous file extensions were detected23,150 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
CSS101,23025011,665
JavaScript142,8202,23510,372
PHP727261977
HTML1204136

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
8 PNG files occupy 0.15MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
modules/inc/assets/css/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%
modules/inc/assets/img/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%
documentation/assets/css/img/warning.png0.59KB0.50KB▼ 14.99%
modules/inc/assets/css/glyphicons-halflings-white.png8.57KB9.20KB0.00%
documentation/assets/images/image_1.png57.78KB24.90KB▼ 56.91%