84% better-404-redirect-to-homepage

Code Review | Better 404 Redirect To Homepage

WordPress plugin Better 404 Redirect To Homepage scored84%from 54 tests.

About plugin

  • Plugin page: better-404-redire...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.1.1
  • WordPress version: 6.3.1
  • First release: Jun 25, 2018
  • Latest release: Dec 24, 2022
  • Number of updates: 4
  • Update frequency: every 411.0 days
  • Top authors: rilwis (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

800+ active /3,129 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 gracefully, with no errors

Server metrics [RAM: ▼0.00MB] [CPU: ▼4.39ms] Passed 4 tests

This is a short check of server-side resources used by Better 404 Redirect To Homepage
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.01 ▼2.51
Dashboard /wp-admin3.31 ▼0.0350.47 ▼17.57
Posts /wp-admin/edit.php3.36 ▲0.0151.02 ▲4.61
Add New Post /wp-admin/post-new.php5.89 ▲0.01123.64 ▲19.44
Media Library /wp-admin/upload.php3.24 ▲0.0136.28 ▼2.08

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Better 404 Redirect To Homepage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲4413.30 ▼1.131.75 ▼0.5946.08 ▼3.61
Dashboard /wp-admin2,224 ▲184.82 ▼0.07105.68 ▼4.0141.76 ▼3.79
Posts /wp-admin/edit.php2,097 ▼32.02 ▼0.0135.05 ▼5.9433.97 ▼4.13
Add New Post /wp-admin/post-new.php1,546 ▲123.10 ▲0.04684.64 ▲26.0150.88 ▼1.50
Media Library /wp-admin/upload.php1,397 ▼04.22 ▼0.15104.83 ▲0.1946.43 ▼3.42

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/better-404-redirect-to-homepage/better-404-redirect-to-homepage.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: error, 301, 404, redirection, redirect

better-404-redirect-to-homepage/better-404-redirect-to-homepage.php 85% from 13 tests

The main PHP file in "Better 404 Redirect To Homepage" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin32 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP141132

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code1.00
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity4.67
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin