62% custom-404-pro

Code Review | Custom 404 Pro

WordPress plugin Custom 404 Pro scored62%from 54 tests.

About plugin

  • Plugin page: custom-404-pro
  • Plugin version: 3.10.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.4
  • WordPress version: 6.3.1
  • First release: Apr 23, 2015
  • Latest release: Nov 19, 2023
  • Number of updates: 151
  • Update frequency: every 20.7 days
  • Top authors: kunalnagar (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

10,000+ active /240,173 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.82MB] [CPU: ▼29.96ms] Passed 4 tests

An overview of server-side resources used by Custom 404 Pro
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1040.55 ▲0.17
Dashboard /wp-admin3.12 ▼0.1824.61 ▼26.09
Posts /wp-admin/edit.php3.12 ▼0.2324.88 ▼24.09
Add New Post /wp-admin/post-new.php3.12 ▼2.7723.56 ▼58.08
Media Library /wp-admin/upload.php3.12 ▼0.1124.22 ▼11.57
Settings /wp-admin/admin.php?page=c4p-settings3.1222.52
About /wp-admin/admin.php?page=c4p-about3.1226.34
Logs /wp-admin/admin.php?page=c4p-main3.1225.35

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 27 new files
Database: 2 new tables, 6 new options
New tables
wp_custom_404_pro_options
wp_custom_404_pro_logs
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Custom 404 Pro
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲5914.26 ▲0.191.78 ▼0.0342.96 ▼5.54
Dashboard /wp-admin2,229 ▲495.63 ▼0.0191.44 ▼5.6639.97 ▼5.25
Posts /wp-admin/edit.php2,131 ▲312.03 ▲0.0139.18 ▼4.2636.21 ▲0.66
Add New Post /wp-admin/post-new.php1,560 ▲3425.13 ▲2.22621.97 ▼127.7971.07 ▲8.11
Media Library /wp-admin/upload.php1,434 ▲374.19 ▼0.0197.02 ▼3.1744.02 ▼3.94
Settings /wp-admin/admin.php?page=c4p-settings9361.6527.8126.85
About /wp-admin/admin.php?page=c4p-about9731.9926.5927.58
Logs /wp-admin/admin.php?page=c4p-main1,0481.6826.8030.96

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/custom-404-pro/admin/AdminClass.php+116
    Undefined index: form-logs-options
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=c4p-main
    • > Notice in wp-content/plugins/custom-404-pro/admin/AdminClass.php+116
    Undefined index: form-logs-options
    • > GET request to /wp-admin/admin.php?page=c4p-settings
    • > Notice in wp-content/plugins/custom-404-pro/admin/views/settings.php+3
    Undefined index: tab

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 12× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Helpers' not found in wp-content/plugins/custom-404-pro/admin/views/settings-general.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-404-pro/admin/LogsClass.php on line 4
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/custom-404-pro/admin/LogsClass.php on line 4
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/class-wp-list-table.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/custom-404-pro/admin/LogsClass.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-404-pro/admin/LogsClass.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/custom-404-pro/admin/views/about.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/custom-404-pro/admin/LogsClass.php:7
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/custom-404-pro/admin/LogsClass.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_pages() in wp-content/plugins/custom-404-pro/admin/views/settings-global-redirect.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/custom-404-pro/admin/views/settings.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=c4p-settings
    • > Console-api (warning) in wp-content/plugins/custom-404-pro/admin/js/custom-404-pro-admin.js?ver=3.2.0+10:14

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Activate the plugin from the WordPress Admin Panel), #2 (404 Logs), #3 (Global Settings)
  • Tags: You are using too many tags: 19 tag instead of maximum 10
The official readme.txt is a good inspiration

custom-404-pro/custom-404-pro.php Passed 13 tests

"Custom 404 Pro" version 3.10.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
81 characters long description:
Override the default 404 page with any page or a custom URL from the Admin Panel.

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
No dangerous file extensions were detected1,124 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP1485441,028
CSS113745
Markdown119028
JavaScript11023

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity16.29
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity3.06
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods52
▷ Static methods713.46%
▷ Public methods4790.38%
▷ Protected methods00.00%
▷ Private methods59.62%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.57MB with 0.36MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png109.22KB32.41KB▼ 70.33%
admin/views/me.png217.16KB118.56KB▼ 45.40%
banner-772x250.png23.11KB7.09KB▼ 69.31%
icon-256x256.png8.97KB3.46KB▼ 61.45%
screenshot-1.png95.18KB31.64KB▼ 66.76%