84% slug-as-body-class

Code Review | Slug as body class

WordPress plugin Slug as body class scored 84% from 54 tests.

About plugin

  • Plugin page: slug-as-body-class
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-3.9
  • WordPress version: 6.3.1
  • First release: Aug 9, 2014
  • Latest release: Aug 11, 2014
  • Number of updates: 4
  • Update frequency: every 1.0 days
  • Top authors: carloroosen (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

200+ active / 2,438 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

A check of server-side resources used by Slug as body class
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0136.30 ▼6.07
Dashboard /wp-admin3.31 ▲0.0140.98 ▼12.09
Posts /wp-admin/edit.php3.36 ▲0.0039.72 ▼4.53
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.03 ▼9.48
Media Library /wp-admin/upload.php3.23 ▲0.0034.47 ▼1.54

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Slug as body class
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.56 ▼0.711.65 ▼0.2840.45 ▼4.00
Dashboard /wp-admin2,206 ▲184.87 ▼0.98109.92 ▼5.8043.73 ▲0.43
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0038.94 ▲2.5629.67 ▼6.77
Add New Post /wp-admin/post-new.php1,523 ▼1023.13 ▼0.12642.30 ▼22.2747.96 ▲0.05
Media Library /wp-admin/upload.php1,388 ▼34.25 ▲0.0195.66 ▼8.4441.09 ▼5.96

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

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

SRP 50% from 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
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/slug-as-body-class/slug-as-body-class.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: body, class, url, slug

slug-as-body-class/slug-as-body-class.php Passed 13 tests

The entry point to "Slug as body class" version 1.0 is a PHP file that has certain tags in its header comment area
71 characters long description:
Add a unique class to the body tag for easy styling of individual pages

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 plugin9 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1469

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
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 functions1100.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
There are no PNG files in this plugin