100% body-class-by-url-parameter

Code Review | Body Class By URL Parameter

WordPress plugin Body Class By URL Parameter scored 100% from 54 tests.

About plugin

  • Plugin page: body-class-by-url...
  • Plugin version: 0.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8
  • WordPress version: 5.8.1
  • First release: Oct 30, 2021
  • Latest release: Oct 30, 2021
  • Number of updates: 4
  • Update frequency: every 6.3 days
  • Top authors: giuse (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 33 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼141.35ms] Passed 4 tests

Analyzing server-side resources used by Body Class By URL Parameter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0034.70 ▲0.09
Dashboard /wp-admin3.06 ▲0.0146.51 ▲1.56
Posts /wp-admin/edit.php3.11 ▲0.0144.11 ▼0.05
Add New Post /wp-admin/post-new.php5.42 ▼0.0191.43 ▼566.99
Media Library /wp-admin/upload.php3.01 ▲0.0034.66 ▲3.43

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Body Class By URL Parameter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲9715.92 ▲0.358.99 ▲0.4051.36 ▲8.53
Dashboard /wp-admin2,970 ▲395.92 ▼0.03130.99 ▼14.28108.54 ▼20.74
Posts /wp-admin/edit.php2,736 ▼02.72 ▲0.0163.63 ▼2.1291.23 ▲2.60
Add New Post /wp-admin/post-new.php1,876 ▲619.16 ▼0.33376.25 ▲6.13109.80 ▼5.01
Media Library /wp-admin/upload.php1,807 ▼35.04 ▼0.01144.66 ▼6.89118.39 ▲2.05

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: custom css by url, body class

body-class-by-url-parameter/body-class-by-url-parameter.php Passed 13 tests

"Body Class By URL Parameter" version 0.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
79 characters long description:
It adds CSS classes to the body depending on the parameters included in the URL

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
Everything looks great! No dangerous files found in this plugin11 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP211611

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.75
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.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
No PNG files were detected