78% f4-error-pages

Code Review | F4 Error Pages

WordPress plugin F4 Error Pages scored78%from 54 tests.

About plugin

  • Plugin page: f4-error-pages
  • Plugin version: 1.0.10
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Apr 4, 2020
  • Latest release: Nov 24, 2022
  • Number of updates: 12
  • Update frequency: every 80.3 days
  • Top authors: faktorvier (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /2,651 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼9.02ms] Passed 4 tests

A check of server-side resources used by F4 Error Pages
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0338.59 ▲2.39
Dashboard /wp-admin3.34 ▼0.0149.04 ▼11.89
Posts /wp-admin/edit.php3.39 ▲0.0344.91 ▼4.52
Add New Post /wp-admin/post-new.php5.92 ▲0.0378.84 ▼18.32
Media Library /wp-admin/upload.php3.26 ▲0.0334.45 ▼1.33
Error Pages /wp-admin/options-general.php?page=f4-error-pages3.2732.62

Server storage [IO: ▲0.03MB] [DB: ▲0.07MB] 67% from 3 tests

A short overview of filesystem and database impact
Please fix the following
  • You have illegally modified 1 file (0.82KB) outside of "wp-content/plugins/f4-error-pages/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

F4 Error Pages: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5814.42 ▲0.051.80 ▲0.2443.80 ▲4.45
Dashboard /wp-admin2,225 ▲455.49 ▼0.1182.59 ▼8.4937.18 ▼8.87
Posts /wp-admin/edit.php2,130 ▲301.97 ▲0.0234.23 ▲0.1733.79 ▲0.60
Add New Post /wp-admin/post-new.php1,555 ▲2923.06 ▼0.61643.86 ▼38.5752.93 ▼6.77
Media Library /wp-admin/upload.php1,433 ▲364.26 ▲0.1193.84 ▼5.7545.24 ▲3.83
Error Pages /wp-admin/options-general.php?page=f4-error-pages9032.0025.0725.39

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/f4-error-pages/modules/Core/Options/views/admin-options.php
    • > /wp-content/plugins/f4-error-pages/modules/Core/Options/views/element-title.php
    • > /wp-content/plugins/f4-error-pages/modules/Core/Options/views/field-select.php
    • > /wp-content/plugins/f4-error-pages/modules/Core/Options/views/field-checkboxes.php
    • > /wp-content/plugins/f4-error-pages/modules/Core/Options/views/element-description.php
    • > /wp-content/plugins/f4-error-pages/modules/Core/Options/views/element-fields.php
  • 25× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/f4-error-pages/modules/Core/Options/views/element-fields.php on line 3
    • > PHP Warning
      Use of undefined constant F4_EP_OPTION_NAME - assumed 'F4_EP_OPTION_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/f4-error-pages/modules/Core/Options/views/field-select.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/f4-error-pages/modules/Core/Options/views/field-checkbox.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_parse_args() in wp-content/plugins/f4-error-pages/modules/Core/Options/views/field-textarea.php:2
    • > PHP Notice
      Undefined variable: field_name in wp-content/plugins/f4-error-pages/modules/Core/Options/views/field-checkbox.php on line 3
    • > PHP Notice
      Undefined variable: field_name in wp-content/plugins/f4-error-pages/modules/Core/Options/views/field-select.php on line 3
    • > PHP Notice
      Undefined variable: element in wp-content/plugins/f4-error-pages/modules/Core/Options/views/element-title.php on line 2
    • > PHP Warning
      Use of undefined constant F4_EP_OPTION_NAME - assumed 'F4_EP_OPTION_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/f4-error-pages/modules/Core/Options/views/field-checkbox.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/f4-error-pages/modules/Core/Options/views/element-description.php on line 2
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/f4-error-pages/modules/Core/Options/views/field-select.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
The official readme.txt might help

f4-error-pages/f4-error-pages.php Passed 13 tests

The main PHP script in "F4 Error Pages" version 1.0.10 is automatically included on every request by WordPress
66 characters long description:
Allows you to assign pages that appear as 404 and 403 error pages.

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
There were no executable files found in this plugin673 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP16158387673

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity13.40
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity2.63
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods40
▷ Static methods40100.00%
▷ Public methods40100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants12
▷ Global constants12100.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 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/made-with-love-by-f4.png1.83KB1.95KB0.00%