78% redirect-redirection

Code Review | Redirection

WordPress plugin Redirection scored78%from 54 tests.

About plugin

  • Plugin page: redirect-redirection
  • Plugin version: 1.1.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Jun 29, 2021
  • Latest release: Nov 7, 2023
  • Number of updates: 23
  • Update frequency: every 37.5 days
  • Top authors: iclyde (82.61%)socialdude (21.74%)

Code review

54 tests

User reviews

41 reviews

Install metrics

40,000+ active /162,277 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.16MB] [CPU: ▲12.04ms] 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.67 ▲1.2156.01 ▲14.48
Dashboard /wp-admin4.49 ▲1.1962.84 ▲10.41
Posts /wp-admin/edit.php4.54 ▲1.1863.88 ▲16.62
Add New Post /wp-admin/post-new.php7.02 ▲1.14107.61 ▲6.63
Media Library /wp-admin/upload.php4.35 ▲1.1250.50 ▲16.99

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 221 new files
Database: 3 new tables, 8 new options
New tables
wp_irrp_redirection_logs
wp_irrp_redirectionmeta
wp_irrp_redirections
New WordPress options
can_compress_scripts
theysaidso_admin_options
_irb_h_bn_review
db_upgraded
widget_recent-comments
analyst_cache
widget_theysaidso_widget
widget_recent-posts

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 /3,100 ▲31314.10 ▼0.082.09 ▼0.4044.06 ▲0.29
Dashboard /wp-admin2,479 ▲3025.66 ▲0.0291.91 ▲0.8782.91 ▲38.32
Posts /wp-admin/edit.php2,399 ▲2992.08 ▲0.0836.63 ▼4.6841.80 ▲1.66
Add New Post /wp-admin/post-new.php1,820 ▲29320.37 ▼2.71697.38 ▲14.9042.47 ▼20.98
Media Library /wp-admin/upload.php1,687 ▲2874.16 ▼0.02104.30 ▼0.7975.51 ▲33.37

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • analyst_cache
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • _irb_h_bn_review

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/redirect-redirection/analyst/templates/forms/deactivate.php
    • > /wp-content/plugins/redirect-redirection/analyst/templates/forms/install.php
    • > /wp-content/plugins/redirect-redirection/analyst/templates/optout.php
    • > /wp-content/plugins/redirect-redirection/analyst/templates/optin.php
  • 23× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: pencilImage in wp-content/plugins/redirect-redirection/analyst/templates/forms/deactivate.php on line 6
    • > PHP Notice
      Undefined variable: pluginToInstall in wp-content/plugins/redirect-redirection/analyst/templates/forms/install.php on line 1
    • > PHP Notice
      Undefined variable: shieldImage in wp-content/plugins/redirect-redirection/analyst/templates/optout.php on line 6
    • > PHP Fatal error
      Uncaught Error: Interface 'Analyst\\Contracts\\AnalystContract' not found in wp-content/plugins/redirect-redirection/analyst/src/Analyst.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Analyst\\Contracts\\TrackerContract' not found in wp-content/plugins/redirect-redirection/analyst/src/Account/Account.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Analyst\\Http\\Requests\\AbstractLoggerRequest' not found in wp-content/plugins/redirect-redirection/analyst/src/Http/Requests/OptOutRequest.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Analyst\\Contracts\\HttpClientContract' not found in wp-content/plugins/redirect-redirection/analyst/src/Http/WordPressHttpClient.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Analyst\\Contracts\\RequestorContract' not found in wp-content/plugins/redirect-redirection/analyst/src/ApiRequestor.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Analyst\\Contracts\\HttpClientContract' not found in wp-content/plugins/redirect-redirection/analyst/src/Http/CurlHttpClient.php:8
    • > PHP Notice
      Undefined variable: shieldImage in wp-content/plugins/redirect-redirection/analyst/templates/forms/install.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: 307, redirection, redirect, 301, redirects...

redirect-redirection/redirect-redirection.php 92% from 13 tests

The principal PHP file in "Redirection" v. 1.1.7 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 143 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected13,966 lines of code in 169 files:
LanguageFilesBlank linesComment linesLines of code
PHP931,6101,8807,516
CSS257422084,113
JavaScript94873611,894
SVG4202443

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 119)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity23.70
▷ Minimum class complexity1.00
▷ Maximum class complexity340.00
Average method complexity3.57
▷ Minimum method complexity1.00
▷ Maximum method complexity119.00
Code structure
Namespaces9
Interfaces7
Traits0
Classes30
▷ Abstract classes26.67%
▷ Concrete classes2893.33%
▷ Final classes00.00%
Methods314
▷ Static methods3310.51%
▷ Public methods26183.12%
▷ Protected methods103.18%
▷ Private methods4313.69%
Functions29
▷ Named functions724.14%
▷ Anonymous functions2275.86%
Constants32
▷ Global constants1237.50%
▷ Class constants2062.50%
▷ Public constants20100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
30 compressed PNG files occupy 0.36MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/banner/views/projects/bmi/imgs/big-colored-logo.png0.85KB0.83KB▼ 2.18%
includes/banner/views/projects/red/imgs/big-colored-logo-rr.png8.54KB4.02KB▼ 52.89%
includes/banner/views/projects/fit/imgs/face4.png2.59KB2.43KB▼ 6.22%
includes/banner/views/projects/fit/imgs/face3.png2.33KB2.29KB▼ 1.47%
includes/banner/views/projects/red/imgs/main-background-image.png73.46KB76.01KB0.00%