10% redirect-404-to-home-page-custom-url

Code Review | Redirect 404 to Home Page - Custom URL

WordPress plugin Redirect 404 to Home Page - Custom URL scored10%from 54 tests.

About plugin

  • Plugin page: redirect-404-to-h...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Oct 10, 2019
  • Latest release: Oct 10, 2019
  • Number of updates: 2
  • Update frequency: every 3.5 days
  • Top authors: danielbolander (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

3,000+ active /5,195 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method RDT_Custom_Page::rdt_active() should not be called statically

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.32ms] Passed 4 tests

This is a short check of server-side resources used by Redirect 404 to Home Page - Custom URL
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.05 ▲0.99
Dashboard /wp-admin3.31 ▲0.0146.41 ▼0.33
Posts /wp-admin/edit.php3.36 ▲0.0144.33 ▲3.19
Add New Post /wp-admin/post-new.php5.89 ▲0.0188.03 ▼7.44
Media Library /wp-admin/upload.php3.24 ▲0.0135.90 ▲1.51
404s Redirect /wp-admin/options-general.php?page=rdtcp_custom_page3.2230.07

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 9 new options
New WordPress options
rdtcp_redirect_type
theysaidso_admin_options
widget_recent-comments
rdtcp_custom_page
rdtcp_enable
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Redirect 404 to Home Page - Custom URL
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.25 ▼0.141.72 ▲0.0548.94 ▲3.93
Dashboard /wp-admin2,199 ▲195.61 ▼0.0780.84 ▼13.9639.70 ▼3.55
Posts /wp-admin/edit.php2,104 ▲41.98 ▼0.0439.46 ▲1.3436.15 ▲3.21
Add New Post /wp-admin/post-new.php1,540 ▲518.34 ▲0.29673.22 ▲52.6067.01 ▼11.94
Media Library /wp-admin/upload.php1,407 ▲44.15 ▼0.03106.42 ▲7.4046.55 ▲4.86
404s Redirect /wp-admin/options-general.php?page=rdtcp_custom_page9652.1622.8653.20

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • rdtcp_enable
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • rdtcp_custom_page
    • rdtcp_redirect_type

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/redirect-404-to-home-page-custom-url/redirect-404-page.php:17

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=rdtcp_custom_page
    • > Javascript (severe) in unknown
    /wp-admin/options-general.php?page=rdtcp_custom_page 314:2 Uncaught TypeError: $ is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Contributors: Plugin contributors field is missing
  • Screenshots: Add an image for screenshot #1 (Select the Error code and enter user agent in setting page.)
The official readme.txt is a good inspiration

redirect-404-to-home-page-custom-url/redirect-404-page.php 92% from 13 tests

The main PHP script in "Redirect 404 to Home Page - Custom URL" version 1.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("redirect-404-to-home-page-custom-url.php" instead of "redirect-404-page.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin474 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP122414474

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity3.60
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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