90% body-class-by-url-parameter

Code Review | Body Class By URL Parameter

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

About plugin

  • Plugin page: body-class-by-url...
  • Plugin version: 0.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Oct 30, 2021
  • Latest release: Nov 1, 2023
  • Number of updates: 12
  • Update frequency: every 63.1 days
  • Top authors: giuse (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /568 total downloads

Benchmarks

Plugin footprint 83% from 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.01MB] [CPU: ▼9.76ms] 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 /3.47 ▲0.0038.31 ▼2.22
Dashboard /wp-admin3.31 ▼0.0444.36 ▼23.35
Posts /wp-admin/edit.php3.36 ▲0.0047.87 ▼0.67
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.10 ▼9.73
Media Library /wp-admin/upload.php3.24 ▲0.0033.17 ▼3.74

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, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts

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 /2,789 ▲4314.59 ▲0.251.83 ▼0.0244.28 ▼3.25
Dashboard /wp-admin2,195 ▲145.54 ▼0.1582.64 ▼20.5237.83 ▼4.90
Posts /wp-admin/edit.php2,100 ▼02.01 ▼0.0239.67 ▲1.5837.03 ▲1.64
Add New Post /wp-admin/post-new.php1,526 ▼023.64 ▲0.54666.11 ▲71.8949.75 ▼6.85
Media Library /wp-admin/upload.php1,403 ▲64.19 ▲0.00101.49 ▲0.0642.50 ▼1.45

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

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.2'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