74% custom-error-pages

Code Review | Custom Error Pages

WordPress plugin Custom Error Pages scored74%from 54 tests.

About plugin

  • Plugin page: custom-error-pages
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Nov 2, 2013
  • Latest release: May 22, 2023
  • Number of updates: 21
  • Update frequency: every 166.2 days
  • Top authors: jesin (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

800+ active /16,170 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.50ms] Passed 4 tests

Analyzing server-side resources used by Custom Error Pages
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0240.76 ▼3.38
Dashboard /wp-admin3.39 ▲0.0446.74 ▼16.80
Posts /wp-admin/edit.php3.51 ▲0.1557.64 ▲5.27
Add New Post /wp-admin/post-new.php5.97 ▲0.0897.37 ▼4.03
Media Library /wp-admin/upload.php3.32 ▲0.0836.20 ▲2.20
Custom Error Pages /wp-admin/options-general.php?page=custom-error-pages3.3540.22

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Custom Error Pages
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.36 ▲0.071.80 ▲0.0140.74 ▼5.00
Dashboard /wp-admin2,199 ▲225.63 ▼0.0390.00 ▼5.9640.03 ▼0.67
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0639.62 ▲0.2436.91 ▲0.41
Add New Post /wp-admin/post-new.php1,537 ▲918.45 ▼4.83619.98 ▼8.6870.54 ▲19.19
Media Library /wp-admin/upload.php1,404 ▲44.17 ▼0.0596.62 ▼10.5843.41 ▲2.06
Custom Error Pages /wp-admin/options-general.php?page=custom-error-pages1,8818.11167.9468.54

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/custom-error-pages/uninstall.php+8
    Undefined variable: custom_error_pages_plugin
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/custom-error-pages/plugin.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Custom_Error_Pages_Plugin' not found in wp-content/plugins/custom-error-pages/admin_options.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: 403, htaccess, errors, http, error...

custom-error-pages/plugin.php 92% from 13 tests

The main PHP script in "Custom Error Pages" version 1.2 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("custom-error-pages.php" instead of "plugin.php")

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
Everything looks great! No dangerous files found in this plugin216 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP34132216

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity6.33
▷ Minimum class complexity4.00
▷ Maximum class complexity9.00
Average method complexity1.73
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screen-icon.png1.95KB1.75KB▼ 10.36%