89% custom-404-error-page

Code Review | Custom 404 Error Page

WordPress plugin Custom 404 Error Page scored89%from 54 tests.

About plugin

  • Plugin page: custom-404-error-...
  • Plugin version: 0.2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Feb 13, 2014
  • Latest release: May 18, 2023
  • Number of updates: 19
  • Update frequency: every 178.0 days
  • Top authors: kasparsd (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

2,000+ active /24,217 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.02MB] [CPU: ▼9.84ms] Passed 4 tests

Server-side resources used by Custom 404 Error Page
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.29 ▲0.71
Dashboard /wp-admin3.33 ▼0.0154.14 ▼8.41
Posts /wp-admin/edit.php3.38 ▲0.0351.30 ▼2.62
Add New Post /wp-admin/post-new.php5.91 ▲0.0386.74 ▼29.02
Media Library /wp-admin/upload.php3.25 ▲0.0342.53 ▲5.12

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Custom 404 Error Page: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.34 ▼1.205.43 ▲3.5742.50 ▼2.21
Dashboard /wp-admin2,209 ▲214.81 ▼0.06117.15 ▲13.9846.27 ▲2.60
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0434.81 ▼5.4336.23 ▼2.11
Add New Post /wp-admin/post-new.php1,547 ▲2623.03 ▼0.16681.77 ▲55.8655.15 ▲1.92
Media Library /wp-admin/upload.php1,388 ▲34.23 ▲0.06104.81 ▲3.0243.96 ▼1.30

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (Custom 404 Error Page Settings) image missing
Please take inspiration from this readme.txt

custom-404-error-page/custom-404-page.php 85% from 13 tests

The main PHP script in "Custom 404 Error Page" version 0.2.5 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("custom-404-error-page.php" instead of "custom-404-page.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected147 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP17328116
PO File181031

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods888.89%
▷ Protected methods00.00%
▷ Private methods111.11%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png56.19KB32.50KB▼ 42.16%