10% knock-on-wood-redirect

Code Review | Knock on Wood Redirect

WordPress plugin Knock on Wood Redirect scored10%from 54 tests.

About plugin

  • Plugin page: knock-on-wood-red...
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.1-5.5.3
  • WordPress version: 6.3.1
  • First release: Aug 15, 2019
  • Latest release: Nov 10, 2020
  • Number of updates: 11
  • Update frequency: every 41.4 days
  • Top authors: alandaniels (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,031 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/knock-on-wood-redirect/includes/helper.php+123
    include(wp-content/plugins/knock-on-wood-redirect/cache/settings.php): failed to open stream: No such file or directory

Server metrics [RAM: ▼1.82MB] [CPU: ▼54.99ms] Passed 4 tests

This is a short check of server-side resources used by Knock on Wood Redirect
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.17 ▼1.305.67 ▼38.95
Dashboard /wp-admin2.19 ▼1.127.11 ▼44.37
Posts /wp-admin/edit.php2.19 ▼1.177.22 ▼49.24
Add New Post /wp-admin/post-new.php2.19 ▼3.706.95 ▼87.41
Media Library /wp-admin/upload.php2.19 ▼1.047.02 ▼27.28

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 33 new files
Database: 3 new tables, 6 new options
New tables
wp_redirect_points
wp_redirect_clicks
wp_redirect_settings
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Knock on Wood Redirect
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7013.16 ▼1.204.86 ▲3.1949.52 ▲4.27
Dashboard /wp-admin2,222 ▲345.83 ▲0.96102.32 ▼11.0938.63 ▼5.23
Posts /wp-admin/edit.php2,105 ▲162.01 ▼0.0236.17 ▲0.3531.35 ▲1.73
Add New Post /wp-admin/post-new.php1,555 ▲1718.29 ▲0.06612.34 ▼21.6050.47 ▼3.82
Media Library /wp-admin/upload.php1,404 ▲194.34 ▲0.1294.68 ▼7.9940.91 ▼2.52

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/knock-on-wood-redirect/includes/helper.php+123
    include(wp-content/plugins/knock-on-wood-redirect/cache/settings.php): failed to open stream: No such file or directory
  • The uninstall procedure failed, leaving 3 tables in the database
    • wp_redirect_settings
    • wp_redirect_points
    • wp_redirect_clicks
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% 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 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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/knock-on-wood-redirect/cache/index.php
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant KOW_REDIRECT_ROOT - assumed 'KOW_REDIRECT_ROOT' (this will throw an Error in a future version of PHP) in wp-content/plugins/knock-on-wood-redirect/includes/update.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function KOW_Redirect\\plugins_url() in wp-content/plugins/knock-on-wood-redirect/redirect.php:30
    • > PHP Fatal error
      require_once(): Failed opening required 'KOW_REDIRECT_ROOT/includes/database.php' (include_path='.:/usr/share/php') in wp-content/plugins/knock-on-wood-redirect/includes/helper.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'KOW_Redirect\\Helper' not found in wp-content/plugins/knock-on-wood-redirect/includes/redirect.php:4
    • > PHP Warning
      require_once(KOW_REDIRECT_ROOT/includes/database.php): failed to open stream: No such file or directory in wp-content/plugins/knock-on-wood-redirect/includes/helper.php on line 5
    • > PHP Warning
      Use of undefined constant KOW_REDIRECT_ROOT - assumed 'KOW_REDIRECT_ROOT' (this will throw an Error in a future version of PHP) in wp-content/plugins/knock-on-wood-redirect/includes/helper.php on line 5
    • > PHP Warning
      require_once(KOW_REDIRECT_ROOT/includes/helper.php): failed to open stream: No such file or directory in wp-content/plugins/knock-on-wood-redirect/includes/update.php on line 4
    • > PHP Warning
      require_once(KOW_REDIRECT_ROOT/includes/helper.php): failed to open stream: No such file or directory in wp-content/plugins/knock-on-wood-redirect/includes/rest.php on line 9
    • > PHP Fatal error
      require_once(): Failed opening required 'KOW_REDIRECT_ROOT/includes/helper.php' (include_path='.:/usr/share/php') in wp-content/plugins/knock-on-wood-redirect/includes/rest.php on line 9
    • > PHP Fatal error
      require_once(): Failed opening required 'KOW_REDIRECT_ROOT/includes/helper.php' (include_path='.:/usr/share/php') in wp-content/plugins/knock-on-wood-redirect/includes/update.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
8 plugin tags: redirect loop, redirect chain, redirects, redirect loops, redirect...

knock-on-wood-redirect/redirect.php 85% from 13 tests

Analyzing the main PHP file in "Knock on Wood Redirect" version 2.0.0
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 374 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("knock-on-wood-redirect.php" instead of "redirect.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected10,455 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
SVG30129,445
PHP8147135999
JavaScript702610
CSS10111

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity18.00
▷ Minimum class complexity4.00
▷ Maximum class complexity36.00
Average method complexity2.52
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods67
▷ Static methods34.48%
▷ Public methods6089.55%
▷ Protected methods00.00%
▷ Private methods710.45%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants240.00%
▷ Class constants360.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin