78% redirect-404-to-parent

Code Review | Redirect 404 to parent

WordPress plugin Redirect 404 to parent scored78%from 54 tests.

About plugin

  • Plugin page: redirect-404-to-p...
  • Plugin version: 1.4.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.3
  • WordPress version: 6.3.1
  • First release: Mar 1, 2016
  • Latest release: Aug 28, 2023
  • Number of updates: 33
  • Update frequency: every 82.9 days
  • Top authors: MooveAgency (57.58%)gaspar.nemes (45.45%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /5,036 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼4.14ms] Passed 4 tests

Server-side resources used by Redirect 404 to parent
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0637.52 ▼0.59
Dashboard /wp-admin3.37 ▲0.0645.45 ▼2.15
Posts /wp-admin/edit.php3.48 ▲0.1244.85 ▼0.41
Add New Post /wp-admin/post-new.php5.97 ▲0.0886.18 ▼11.05
Media Library /wp-admin/upload.php3.29 ▲0.0637.24 ▼2.75
Moove redirect 404 /wp-admin/options-general.php?page=moove-redirect-settings3.88499.42

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Redirect 404 to parent
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.55 ▲0.331.70 ▲0.1642.13 ▲2.12
Dashboard /wp-admin2,206 ▲295.65 ▲0.0783.61 ▼3.6040.89 ▲2.18
Posts /wp-admin/edit.php2,105 ▲52.03 ▲0.0233.87 ▼0.3235.25 ▼2.96
Add New Post /wp-admin/post-new.php1,542 ▲1518.06 ▼5.19601.00 ▼67.3972.44 ▲12.29
Media Library /wp-admin/upload.php1,408 ▲84.19 ▼0.00107.27 ▲3.3850.16 ▲3.54
Moove redirect 404 /wp-admin/options-general.php?page=moove-redirect-settings1,1212.0126.0555.93

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • moove_404_redirect_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/redirect-404-to-parent/views/moove/admin/settings/documentation.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'Moove_Redirect_Controller' not found in wp-content/plugins/redirect-404-to-parent/views/moove/admin/settings/plugin_boxes.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Moove_Redirect_Controller' not found in wp-content/plugins/redirect-404-to-parent/views/moove/admin/settings/add_new_redirect.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/redirect-404-to-parent/controllers/moove-controller.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/redirect-404-to-parent/views/moove/admin/settings/general_settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/redirect-404-to-parent/views/moove/admin/settings/settings_page.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/redirect-404-to-parent/views/moove/admin/settings/redirects.php:40

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

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
5 plugin tags: url, parent, broken, 404, redirect

redirect-404-to-parent/moove-redirect.php 85% from 13 tests

The main PHP script in "Redirect 404 to parent" version 1.4.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("redirect-404-to-parent.php" instead of "moove-redirect.php")

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
Success! There were no dangerous files found in this plugin1,325 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP1359184779
CSS1704515
JavaScript13031

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity11.75
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity3.87
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods15
▷ Static methods746.67%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.66MB with 0.46MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/uat-promo-wp.png364.67KB99.99KB▼ 72.58%
assets/images/logo_moove.png3.72KB1.45KB▼ 60.99%
assets/images/gdpr-promo-wp.png302.79KB67.10KB▼ 77.84%