88% redirection

Code Review | Redirection

WordPress plugin Redirection scored 88% from 54 tests.

About plugin

  • Plugin page: redirection
  • Plugin version: 5.2.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.9
  • WordPress version: 5.9.2
  • First release: Sep 10, 2007
  • Latest release: Feb 6, 2022
  • Number of updates: 393
  • Update frequency: every 13.4 days
  • Top authors: johnny5 (100%)

Code review

54 tests

User reviews

587 reviews

Install metrics

2,000,000+ active / 37,136,095 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.96MB] [CPU: ▼294.06ms] Passed 4 tests

Analyzing server-side resources used by Redirection
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.23 ▲0.7155.38 ▲3.83
Dashboard /wp-admin4.48 ▲1.0740.67 ▲5.12
Posts /wp-admin/edit.php4.70 ▲1.0645.06 ▲8.58
Add New Post /wp-admin/post-new.php8.00 ▲1.0299.03 ▼1,189.94
Media Library /wp-admin/upload.php4.35 ▲1.0531.52 ▲4.75

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 171 new files
Database: no new tables, 1 new option
New WordPress options
redirection_options

Browser metrics Passed 4 tests

A check of browser resources used by Redirection
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,810 ▲5615.53 ▼0.125.81 ▲0.032.86 ▼0.16
Dashboard /wp-admin2,907 ▲466.17 ▲0.02122.27 ▼11.12154.63 ▼10.30
Posts /wp-admin/edit.php2,701 ▲133.36 ▲0.0062.97 ▼0.42139.06 ▼7.17
Add New Post /wp-admin/post-new.php1,767 ▲5021.52 ▼0.23457.69 ▲9.06163.29 ▲6.32
Media Library /wp-admin/upload.php1,710 ▲125.60 ▲0.09144.31 ▼4.83188.03 ▼0.73
Redirection /wp-admin/redirection.php260.940.0420.03

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 54× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/redirection/redirection-admin.php:672
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/redirection/redirection-cli.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Red_Log' not found in wp-content/plugins/redirection/models/log/log-redirect.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Red_Log' not found in wp-content/plugins/redirection/models/log/log-404.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Red_Database_Upgrader' not found in wp-content/plugins/redirection/database/schema/233.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Redirection_Api_Filter_Route' not found in wp-content/plugins/redirection/api/api-redirect.php:173
    • > PHP Fatal error
      Uncaught Error: Class 'Red_FileIO' not found in wp-content/plugins/redirection/fileio/rss.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Red_Action' not found in wp-content/plugins/redirection/actions/url.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Redirection_Api_Route' not found in wp-content/plugins/redirection/api/api-settings.php:82
    • > PHP Fatal error
      Uncaught Error: Class 'Red_Database_Upgrader' not found in wp-content/plugins/redirection/database/schema/400.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/redirection.php
    • > Network (severe)
    wp-admin/redirection.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% 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
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === redirection === )
You can look at the official readme.txt

redirection/redirection.php Passed 13 tests

"Redirection" version 5.2.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
52 characters long description:
Manage all your 301 redirects and monitor 404 errors

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
Success! There were no dangerous files found in this plugin38,012 lines of code in 141 files:
LanguageFilesBlank linesComment linesLines of code
PO File2514,51616,33929,386
PHP882,2753,8058,505
CSS18060
Markdown125035
JSON250025
JavaScript1011

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity13.15
▷ Minimum class complexity1.00
▷ Maximum class complexity94.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits2
Classes94
▷ Abstract classes66.38%
▷ Concrete classes8893.62%
▷ Final classes00.00%
Methods713
▷ Static methods9913.88%
▷ Public methods51371.95%
▷ Protected methods486.73%
▷ Private methods15221.32%
Functions31
▷ Named functions1548.39%
▷ Anonymous functions1651.61%
Constants72
▷ Global constants1419.44%
▷ Class constants5880.56%
▷ Public constants58100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/GitHub-Mark-64px.png2.56KB1.51KB▼ 41.07%