78% custom-404

Code Review | Custom 404

WordPress plugin Custom 404 scored78%from 54 tests.

About plugin

  • Plugin page: custom-404
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Nov 29, 2017
  • Latest release: Nov 29, 2017
  • Number of updates: 11
  • Update frequency: every 0.6 days
  • Top authors: viewup (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /664 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.15MB] [CPU: ▼4.04ms] Passed 4 tests

This is a short check of server-side resources used by Custom 404
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1641.82 ▲4.03
Dashboard /wp-admin3.45 ▲0.1545.40 ▼5.42
Posts /wp-admin/edit.php3.56 ▲0.2149.65 ▲2.54
Add New Post /wp-admin/post-new.php6.05 ▲0.1681.60 ▼13.15
Media Library /wp-admin/upload.php3.37 ▲0.1434.83 ▼0.14

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Custom 404
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲5413.18 ▼1.121.67 ▼0.3042.71 ▼1.46
Dashboard /wp-admin2,223 ▲375.81 ▼0.1096.64 ▼11.0537.94 ▼6.60
Posts /wp-admin/edit.php2,109 ▲202.03 ▲0.0341.37 ▲7.6734.95 ▼0.32
Add New Post /wp-admin/post-new.php1,531 ▲1723.03 ▲5.47693.53 ▲88.3253.95 ▼5.41
Media Library /wp-admin/upload.php1,411 ▲204.20 ▲0.0293.85 ▼4.3944.03 ▲1.51

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/custom-404/admin/partials/cnf-admin-display.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/custom-404/public/partials/cnf-404.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-404/includes/kirki/kirki-installer.php:103

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 errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === custom-404 === )
The official readme.txt is a good inspiration

custom-404/custom-404.php 92% from 13 tests

The main PHP file in "Custom 404" 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:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin740 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP14222725675
CSS24845
Markdown19014
JavaScript24546

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity12.00
▷ Minimum class complexity1.00
▷ Maximum class complexity80.00
Average method complexity3.48
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods41
▷ Static methods717.07%
▷ Public methods3380.49%
▷ Protected methods12.44%
▷ Private methods717.07%
Functions6
▷ Named functions466.67%
▷ Anonymous functions233.33%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin