68% enhanced-body-class

Code Review | Enhanced Body Class

WordPress plugin Enhanced Body Class scored68%from 54 tests.

About plugin

  • Plugin page: enhanced-body-class
  • Plugin version: 1.0.6
  • PHP compatiblity: 5.6.40+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2.2
  • WordPress version: 6.3.1
  • First release: Feb 20, 2019
  • Latest release: Jul 21, 2023
  • Number of updates: 6
  • Update frequency: every 268.7 days
  • Top authors: revnoah (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /732 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.92MB] [CPU: ▼33.46ms] Passed 4 tests

This is a short check of server-side resources used by Enhanced Body Class
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.04 ▼6.56
Dashboard /wp-admin3.03 ▼0.2825.16 ▼30.90
Posts /wp-admin/edit.php3.03 ▼0.3326.88 ▼20.82
Add New Post /wp-admin/post-new.php3.03 ▼2.8625.74 ▼67.75
Media Library /wp-admin/upload.php3.03 ▼0.2022.13 ▼14.37
Enhanced Body Class /wp-admin/options-general.php?page=enhanced-body-class/includes/admin.inc.php3.0324.01

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Enhanced Body Class: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.53 ▼0.641.70 ▼0.3148.01 ▲2.38
Dashboard /wp-admin2,210 ▲224.84 ▼1.02105.89 ▼11.1238.49 ▼6.19
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0040.01 ▲2.0334.04 ▼0.40
Add New Post /wp-admin/post-new.php1,536 ▼623.23 ▲5.08658.76 ▲25.2557.25 ▼2.27
Media Library /wp-admin/upload.php1,389 ▲14.17 ▼0.1097.43 ▼2.7543.68 ▼1.92
Enhanced Body Class /wp-admin/options-general.php?page=enhanced-body-class/includes/admin.inc.php8322.0628.0929.20

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=enhanced-body-class/includes/admin.inc.php
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

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
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/enhanced-body-class/includes/admin.inc.php:59
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/enhanced-body-class/includes/admin.inc.php:59

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
1 plugin tags: body class style

enhanced-body-class/enhanced-body-class.php Passed 13 tests

The entry point to "Enhanced Body Class" version 1.0.6 is a PHP file that has certain tags in its header comment area
51 characters long description:
Plugin to add user-related classes to the body tag.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected269 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP457147269

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
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%
Functions20
▷ Named functions20100.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
PNG images were not found in this plugin