Benchmarks
Plugin footprint Passed 16 tests
Installer Passed 1 test
🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully
Server metrics [RAM: ▲0.00MB] [CPU: ▼147.21ms] Passed 4 tests
A check of server-side resources used by Add Device Type to Body Class
No issues were detected with server-side resource usage
Page | Memory (MB) | CPU Time (ms) |
---|---|---|
Home / | 3.11 ▲0.39 | 40.86 ▲20.58 |
Dashboard /wp-admin | 3.06 ▲0.01 | 42.98 ▼2.81 |
Posts /wp-admin/edit.php | 3.12 ▲0.01 | 44.80 ▼2.67 |
Add New Post /wp-admin/post-new.php | 5.43 ▼0.00 | 92.06 ▼577.13 |
Media Library /wp-admin/upload.php | 3.01 ▼0.00 | 31.46 ▼6.23 |
Server storage [IO: ▲0.08MB] [DB: ▲0.00MB] Passed 3 tests
Filesystem and database footprint
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, no new options
Browser metrics Passed 4 tests
This is an overview of browser requirements for Add Device Type to Body Class
This plugin has a minimal impact on browser resources
Page | Nodes | Memory (MB) | Script (ms) | Layout (ms) |
---|---|---|---|---|
Home / | 3,703 ▲107 | 15.91 ▲0.25 | 10.02 ▲0.63 | 51.04 ▲6.19 |
Dashboard /wp-admin | 2,967 ▲33 | 5.92 ▼0.01 | 135.42 ▼11.74 | 112.12 ▼1.56 |
Posts /wp-admin/edit.php | 2,739 ▼0 | 2.72 ▼0.00 | 60.89 ▼6.36 | 92.74 ▲1.88 |
Add New Post /wp-admin/post-new.php | 1,872 ▼4 | 19.16 ▲0.00 | 367.45 ▼40.89 | 102.43 ▼11.19 |
Media Library /wp-admin/upload.php | 1,810 ▲3 | 5.05 ▲0.02 | 140.77 ▼13.13 | 113.49 ▼18.76 |
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
Uninstall script ran successfully
Smoke tests 75% from 4 tests
Server-side errors Passed 1 test
🔹 Test weight: 20 | A smoke test targeting 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
- 1× PHP files trigger server-side errors or warnings when accessed directly:
- > PHP Fatal error
Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/add-device-type-to-body-class/add-device-type-to-body-class.php:23
- > PHP Fatal error
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)
Everything seems fine on the user side
Optimizations
Plugin configuration 96% from 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
5 plugin tags: add mobile to body class, tablet, device specific css, desktop, add device type to wordpress
add-device-type-to-body-class/add-device-type-to-body-class.php 92% from 13 tests
The main PHP file in "Add Device Type to Body Class" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
- Description: Keep the plugin description shorter than 140 characters (currently 152 characters long)
Code Analysis Passed 3 tests
File types Passed 1 test
🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin705 lines of code in 2 files:
Language | Files | Blank lines | Comment lines | Lines of code |
---|---|---|---|---|
PHP | 2 | 163 | 665 | 705 |
PHP code Passed 2 tests
An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity | |
---|---|
Average complexity per logical line of code | 0.95 |
Average class complexity | 134.00 |
▷ Minimum class complexity | 134.00 |
▷ Maximum class complexity | 134.00 |
Average method complexity | 4.69 |
▷ Minimum method complexity | 1.00 |
▷ Maximum method complexity | 77.00 |
Code structure | ||
---|---|---|
Namespaces | 0 | |
Interfaces | 0 | |
Traits | 0 | |
Classes | 1 | |
▷ Abstract classes | 0 | 0.00% |
▷ Concrete classes | 1 | 100.00% |
▷ Final classes | 0 | 0.00% |
Methods | 36 | |
▷ Static methods | 9 | 25.00% |
▷ Public methods | 33 | 91.67% |
▷ Protected methods | 2 | 5.56% |
▷ Private methods | 1 | 2.78% |
Functions | 4 | |
▷ Named functions | 4 | 100.00% |
▷ Anonymous functions | 0 | 0.00% |
Constants | 12 | |
▷ Global constants | 3 | 25.00% |
▷ Class constants | 9 | 75.00% |
▷ Public constants | 9 | 100.00% |
Plugin size Passed 2 tests
Image compression Passed 2 tests
All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected