88% f4-error-pages

Code Review | F4 Error Pages

WordPress plugin F4 Error Pages scored 88% from 54 tests.

About plugin

  • Plugin page: f4-error-pages
  • Plugin version: 1.0.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 5.8.1
  • First release: Apr 4, 2020
  • Latest release: Nov 9, 2021
  • Number of updates: 8
  • Update frequency: every 73.0 days
  • Top authors: faktorvier (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,046 total downloads

Benchmarks

Plugin footprint Passed 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.11MB] [CPU: ▼144.33ms] 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 /2.92 ▲0.2036.47 ▲18.27
Dashboard /wp-admin3.16 ▲0.1144.74 ▼1.30
Posts /wp-admin/edit.php3.27 ▲0.1745.56 ▲1.25
Add New Post /wp-admin/post-new.php5.52 ▲0.0883.51 ▼576.88
Media Library /wp-admin/upload.php3.10 ▲0.1034.30 ▼0.37
Error Pages /wp-admin/options-general.php?page=f4-error-pages3.0929.70

Server storage [IO: ▲0.03MB] [DB: ▲0.00MB] 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, no new options

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 /3,714 ▲11816.21 ▲0.629.60 ▼3.5045.01 ▼4.83
Dashboard /wp-admin3,008 ▲775.88 ▼0.04149.90 ▲0.92111.38 ▲0.63
Posts /wp-admin/edit.php2,774 ▲352.74 ▲0.0265.68 ▼4.3284.79 ▼0.64
Add New Post /wp-admin/post-new.php1,713 ▲3018.34 ▼0.38413.87 ▲2.79102.87 ▼15.94
Media Library /wp-admin/upload.php1,841 ▲345.05 ▲0.04152.72 ▼3.73115.75 ▼1.31
Error Pages /wp-admin/options-general.php?page=f4-error-pages1,1992.1050.6977.02

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script ran successfully

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/element-description.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-fields.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/admin-options.php
  • 25× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/f4-error-pages/modules/Core/Options/views/element-fields.php on line 3
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/f4-error-pages/modules/Core/Options/views/field-select.php on line 5
    • > 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 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 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 Notice
      Undefined variable: element in wp-content/plugins/f4-error-pages/modules/Core/Options/views/element-title.php on line 2
    • > PHP Notice
      Undefined variable: element in wp-content/plugins/f4-error-pages/modules/Core/Options/views/element-description.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_parse_args() in wp-content/plugins/f4-error-pages/modules/Core/Options/views/field-text.php: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-select.php on line 2

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.6 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.png2.42KB2.42KB0.12%