68% redirect-to-404

Code Review | 404 Redirect

WordPress plugin 404 Redirect scored68%from 54 tests.

About plugin

  • Plugin page: redirect-to-404
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.5
  • WordPress version: 6.3.1
  • First release: Jun 5, 2016
  • Latest release: Jun 5, 2016
  • Number of updates: 6
  • Update frequency: every 0.7 days
  • Top authors: jamalteri (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

400+ active /7,855 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.94MB] [CPU: ▼30.94ms] Passed 4 tests

Server-side resources used by 404 Redirect
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.27 ▼5.49
Dashboard /wp-admin3.01 ▼0.3024.65 ▼24.73
Posts /wp-admin/edit.php3.01 ▼0.3525.46 ▼21.14
Add New Post /wp-admin/post-new.php3.01 ▼2.8824.76 ▼72.24
Media Library /wp-admin/upload.php3.01 ▼0.2225.02 ▼5.66
404 Redirect /wp-admin/options-general.php?page=redirect-4043.0123.17

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for 404 Redirect
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6214.85 ▲0.492.23 ▲0.3045.27 ▲0.01
Dashboard /wp-admin2,217 ▲265.88 ▲0.06110.54 ▲4.5143.07 ▲2.42
Posts /wp-admin/edit.php2,079 ▼102.02 ▲0.0336.52 ▼2.5334.70 ▼2.33
Add New Post /wp-admin/post-new.php1,675 ▲15522.51 ▼0.35579.25 ▼89.5353.05 ▲0.84
Media Library /wp-admin/upload.php1,396 ▲144.24 ▲0.0196.70 ▼2.7246.43 ▲2.81
404 Redirect /wp-admin/options-general.php?page=redirect-4048272.0625.1527.78

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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 did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/redirect-to-404/redirect_404.php+72
    Undefined variable: get_cache
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-comments
    • theysaidso_admin_options
    • prfx_value
    • widget_recent-posts
    • PRT_redirect_404_pageUrl
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=redirect-404
    • > Notice in wp-content/plugins/redirect-to-404/redirect_404.php+72
    Undefined variable: get_cache
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=redirect-404
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/redirect-to-404/PRT_redirect_404_admin.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (Admin view) image not found
The official readme.txt is a good inspiration

redirect-to-404/redirect_404.php 92% from 13 tests

This is the main PHP file of "404 Redirect" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("redirect-to-404.php" instead of "redirect_404.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected131 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP24826124
CSS2057

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods112.50%
▷ Public methods675.00%
▷ Protected methods00.00%
▷ Private methods225.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin