83% wp247-body-classes

Code Review | WP247 Body Classes

WordPress plugin WP247 Body Classes scored 83% from 54 tests.

About plugin

  • Plugin page: wp247-body-classes
  • Plugin version: 2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: Mar 2, 2015
  • Latest release: Aug 11, 2021
  • Number of updates: 99
  • Update frequency: every 23.8 days
  • Top authors: wescleveland (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

300+ active / 5,145 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.27MB] [CPU: ▼0.43ms] Passed 4 tests

An overview of server-side resources used by WP247 Body Classes
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.48 ▼3.03
Dashboard /wp-admin3.68 ▲0.3850.98 ▲2.41
Posts /wp-admin/edit.php3.73 ▲0.3850.99 ▲2.62
Add New Post /wp-admin/post-new.php6.23 ▲0.3594.94 ▼2.29
Media Library /wp-admin/upload.php3.55 ▲0.3239.50 ▲1.21
Body Classes /wp-admin/options-general.php?page=wp247_body_classes_options3.6441.55

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 14 new options
New WordPress options
wp247_body_classes_css
wp247_body_classes_scroll
wp247_body_classes_mobile
wp247_body_classes_environment
wp247_body_classes_user
wp247_body_classes_custom
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

A check of browser resources used by WP247 Body Classes
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.34 ▼1.041.80 ▼0.0939.41 ▼4.57
Dashboard /wp-admin2,213 ▲245.89 ▲0.9397.19 ▼15.2338.96 ▼1.50
Posts /wp-admin/edit.php2,096 ▲71.99 ▼0.0340.44 ▲1.5738.48 ▲6.01
Add New Post /wp-admin/post-new.php6,487 ▲4,96723.14 ▼0.00895.70 ▲207.2755.24 ▼15.26
Media Library /wp-admin/upload.php1,392 ▲44.24 ▲0.0493.48 ▼9.0442.92 ▼7.04
Body Classes /wp-admin/options-general.php?page=wp247_body_classes_options6,0573.3558.3655.91

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 14 options in the database
    • wp247_body_classes_user
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • wp247_body_classes_scroll
    • wp247_body_classes_archive
    • wp247_body_classes_mobile
    • wp247_body_classes_css
    • can_compress_scripts
    • db_upgraded
    • ...

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 9× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp247-body-classes/admin/wp247-body-classes-admin-sections.php
    • > /wp-content/plugins/wp247-body-classes/admin/wp247xns-client-corequisite-notice/wp247xns-client-corequisite-notice.php
    • > /wp-content/plugins/wp247-body-classes/admin/wp247-body-classes-admin-fields.php
    • > /wp-content/plugins/wp247-body-classes/admin/wp247-body-classes-admin.php
    • > /wp-content/plugins/wp247-body-classes/admin/wp247-body-classes-admin-infobar.php
    • > /wp-content/plugins/wp247-body-classes/admin/wp247-settings-api/wp247-settings-api.class.php
    • > /wp-content/plugins/wp247-body-classes/wp247-body-classes.php
    • > /wp-content/plugins/wp247-body-classes/admin/wp247-body-classes-admin-menu.php
    • > /wp-content/plugins/wp247-body-classes/admin/wp247-settings-api/wp247-settings-api.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 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
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #8 (Custom CSS setting), #9 (Custom Individual Post Body Classes)
  • Tags: There are too many tags (40 tag instead of maximum 10)
  • Plugin Name: You should set the name of your plugin on the first line ( === wp247-body-classes === )
You can look at the official readme.txt

wp247-body-classes/wp247-body-classes.php 92% from 13 tests

This is the main PHP file of "WP247 Body Classes" version 2.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 165 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin5,589 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP141,0553,9845,276
JavaScript33128199
CSS1283114

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.82
Average class complexity108.11
▷ Minimum class complexity3.00
▷ Maximum class complexity169.00
Average method complexity4.39
▷ Minimum method complexity1.00
▷ Maximum method complexity78.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods277
▷ Static methods5720.58%
▷ Public methods26194.22%
▷ Protected methods124.33%
▷ Private methods41.44%
Functions23
▷ Named functions2295.65%
▷ Anonymous functions14.35%
Constants66
▷ Global constants1218.18%
▷ Class constants5481.82%
▷ Public constants54100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin