94% lh-404s-for-static-resources

Code Review | LH 404s for static resources

WordPress plugin LH 404s for static resources scored 94% from 54 tests.

About plugin

  • Plugin page: lh-404s-for-stati...
  • Plugin version: 1.00
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5
  • WordPress version: 5.8.1
  • First release: Sep 6, 2019
  • Latest release: Oct 14, 2020
  • Number of updates: 5
  • Update frequency: every 80.8 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 300 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.01MB] [CPU: ▼143.64ms] Passed 4 tests

This is a short check of server-side resources used by LH 404s for static resources
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1244.89 ▲20.49
Dashboard /wp-admin3.07 ▲0.0145.14 ▼2.93
Posts /wp-admin/edit.php3.13 ▲0.0148.97 ▲3.71
Add New Post /wp-admin/post-new.php5.43 ▼0.0190.68 ▼576.13
Media Library /wp-admin/upload.php3.02 ▲0.0131.18 ▲0.78

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for LH 404s for static resources
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10716.27 ▲0.4310.22 ▲3.1755.25 ▼5.35
Dashboard /wp-admin2,973 ▲425.92 ▲0.00147.23 ▼13.53122.66 ▼2.03
Posts /wp-admin/edit.php2,739 ▼02.69 ▲0.0070.80 ▲3.2795.21 ▼9.41
Add New Post /wp-admin/post-new.php1,683 ▼018.25 ▼0.32383.95 ▼23.28118.86 ▲3.82
Media Library /wp-admin/upload.php1,807 ▼05.02 ▼0.00155.96 ▼6.22129.10 ▼2.47

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lh-404s-for-static-resources/lh-404s-for-static-resources.php:99

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: url, redirect, status code, static, 404

lh-404s-for-static-resources/lh-404s-for-static-resources.php 92% from 13 tests

"LH 404s for static resources" version 1.00's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin57 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2412257

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods240.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin