84% redirect-404-page-to-home-by-fahad

Code Review | Redirect 404 Page to Home

WordPress plugin Redirect 404 Page to Home scored84%from 54 tests.

About plugin

  • Plugin page: redirect-404-page...
  • Plugin version: 2.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.0
  • WordPress version: 6.3.1
  • First release: Nov 7, 2022
  • Latest release: Dec 18, 2022
  • Number of updates: 8
  • Update frequency: every 5.5 days
  • Top authors: faddies (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /176 total downloads

Benchmarks

Plugin footprint 83% 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 successfully, without throwing any errors or notices

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

Server-side resources used by Redirect 404 Page to Home
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.49 ▼7.28
Dashboard /wp-admin3.31 ▲0.0149.10 ▼5.75
Posts /wp-admin/edit.php3.36 ▲0.0150.02 ▼3.77
Add New Post /wp-admin/post-new.php5.89 ▲0.0193.74 ▼12.75
Media Library /wp-admin/upload.php3.23 ▲0.0139.42 ▲1.51

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Redirect 404 Page to Home: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲4113.20 ▼1.184.45 ▲2.4540.28 ▼10.60
Dashboard /wp-admin2,233 ▲305.85 ▼0.03107.61 ▼8.6443.52 ▼0.38
Posts /wp-admin/edit.php2,115 ▲152.05 ▲0.0140.66 ▲4.4235.99 ▼0.92
Add New Post /wp-admin/post-new.php1,556 ▲123.19 ▲4.94606.07 ▼6.7052.89 ▼15.00
Media Library /wp-admin/upload.php1,415 ▲184.21 ▼0.0698.23 ▼6.2441.71 ▼5.36

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/redirect-404-page-to-home-by-fahad/plugin_gui.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/redirect-404-page-to-home-by-fahad/404BrokenPagesToHomePage.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
10 plugin tags: nginx, 301, admin, seo, permalink...

redirect-404-page-to-home-by-fahad/404BrokenPagesToHomePage.php 92% from 13 tests

The main PHP script in "Redirect 404 Page to Home" version 2.1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("redirect-404-page-to-home-by-fahad.php" instead of "404BrokenPagesToHomePage.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin49 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2141549

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.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 were not PNG files found in your plugin