100% add-custom-body-class

Code Review | Add Custom Body Class

WordPress plugin Add Custom Body Class scored 100% from 54 tests.

About plugin

  • Plugin page: add-custom-body-c...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.8
  • WordPress version: 5.8.1
  • First release: Jan 13, 2021
  • Latest release: Aug 23, 2021
  • Number of updates: 8
  • Update frequency: every 27.9 days
  • Top authors: anilankola (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

500+ active / 1,387 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.32MB] [CPU: ▼155.85ms] Passed 4 tests

An overview of server-side resources used by Add Custom Body Class
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.0126.40 ▲0.70
Dashboard /wp-admin3.09 ▲0.0229.56 ▼11.61
Posts /wp-admin/edit.php3.14 ▲0.0328.29 ▼2.04
Add New Post /wp-admin/post-new.php4.09 ▼1.3536.90 ▼608.38
Media Library /wp-admin/upload.php3.03 ▲0.0322.11 ▼1.38

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Add Custom Body Class: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲1515.68 ▼0.097.13 ▲1.7875.06 ▼3.31
Dashboard /wp-admin2,930 ▲346.15 ▼0.04114.06 ▼34.50165.41 ▼12.07
Posts /wp-admin/edit.php2,737 ▼33.23 ▼0.0161.29 ▼0.83138.63 ▲1.72
Add New Post /wp-admin/post-new.php3,785 ▼2218.40 ▼0.18472.60 ▲24.78190.69 ▲2.38
Media Library /wp-admin/upload.php1,752 ▼05.50 ▼0.01146.03 ▼6.43187.76 ▲1.30

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
This plugin's uninstaller ran successfully

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Requires php: The plugin version is formatted incorrectly
You can take inspiration from this readme.txt

add-custom-body-class/add-custom-body-class.php Passed 13 tests

"Add Custom Body Class" version 1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
59 characters long description:
Use this plugin to add a custom class in the HTML body tag.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin36 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP141036

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin