78% redirection

Code Review | Redirection

WordPress plugin Redirection scored 78% from 54 tests.

About plugin

  • Plugin page: redirection
  • Plugin version: 5.3.10
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.3.1
  • WordPress version: 6.3.1
  • First release: Sep 10, 2007
  • Latest release: Sep 10, 2023
  • Number of updates: 419
  • Update frequency: every 14.0 days
  • Top authors: johnny5 (100%)

Code review

54 tests

User reviews

635 reviews

Install metrics

2,000,000+ active / 50,596,073 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.04MB] [CPU: ▲1.98ms] Passed 4 tests

A check of server-side resources used by Redirection
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.21 ▲0.7539.60 ▼6.48
Dashboard /wp-admin4.41 ▲1.1150.47 ▲3.89
Posts /wp-admin/edit.php4.53 ▲1.1755.83 ▲7.90
Add New Post /wp-admin/post-new.php7.06 ▲1.1793.23 ▲2.60
Media Library /wp-admin/upload.php4.34 ▲1.1144.84 ▲9.66

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 178 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
redirection_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Redirection
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲10013.12 ▼1.255.64 ▲3.7139.99 ▼1.03
Dashboard /wp-admin2,216 ▲344.88 ▼1.14108.79 ▲4.6138.28 ▼0.26
Posts /wp-admin/edit.php2,101 ▲152.00 ▼0.0140.91 ▲7.3535.47 ▲0.64
Add New Post /wp-admin/post-new.php1,542 ▲923.39 ▲0.16643.08 ▲52.4156.75 ▲2.21
Media Library /wp-admin/upload.php1,398 ▲104.25 ▲0.07103.42 ▲4.0344.88 ▲0.41
Redirection /wp-admin/redirection.php260.440.1112.55

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • 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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 54× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Red_Module' not found in wp-content/plugins/redirection/modules/nginx.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Red_FileIO' not found in wp-content/plugins/redirection/fileio/nginx.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Red_Match' not found in wp-content/plugins/redirection/matches/http-header.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Redirection_Api_Filter_Route' not found in wp-content/plugins/redirection/api/api-log.php:103
    • > PHP Warning
      Use of undefined constant REDIRECTION_FILE - assumed 'REDIRECTION_FILE' (this will throw an Error in a future version of PHP) in wp-content/plugins/redirection/models/fixer.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Red_Database_Upgrader' not found in wp-content/plugins/redirection/database/schema/232.php:4
    • > 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_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 'Red_Action' not found in wp-content/plugins/redirection/actions/nothing.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > 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

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === redirection === )
The official readme.txt is a good inspiration

redirection/redirection.php Passed 13 tests

The main file in "Redirection" v. 5.3.10 serves as a complement to information provided in readme.txt and as the entry point to the plugin
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 not allowed as they can serve as attack vectors
There were no executable files found in this plugin41,099 lines of code in 144 files:
LanguageFilesBlank linesComment linesLines of code
PO File2515,87517,82532,206
PHP892,3693,9588,770
CSS18060
Markdown125035
JSON270027
JavaScript1011

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity13.73
▷ Minimum class complexity1.00
▷ Maximum class complexity94.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits2
Classes95
▷ Abstract classes66.32%
▷ Concrete classes8993.68%
▷ Final classes00.00%
Methods727
▷ Static methods10013.76%
▷ Public methods51871.25%
▷ Protected methods486.60%
▷ Private methods16122.15%
Functions32
▷ Named functions1546.88%
▷ Anonymous functions1753.12%
Constants72
▷ Global constants1419.44%
▷ Class constants5880.56%
▷ Public constants58100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
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%