90% user-agent-body-class

Code Review | Super Browser Detector

WordPress plugin Super Browser Detector scored 90% from 54 tests.

About plugin

  • Plugin page: user-agent-body-c...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.2
  • WordPress version: 6.3.1
  • First release: Oct 16, 2016
  • Latest release: Mar 27, 2020
  • Number of updates: 8
  • Update frequency: every 158.4 days
  • Top authors: eastsidecode (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active / 1,724 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

This is a short check of server-side resources used by Super Browser Detector
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.08 ▼6.48
Dashboard /wp-admin3.31 ▲0.0047.21 ▼0.13
Posts /wp-admin/edit.php3.36 ▲0.0041.94 ▼5.03
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.86 ▼5.06
Media Library /wp-admin/upload.php3.23 ▲0.0033.57 ▲2.42

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Super Browser Detector
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6814.84 ▲0.461.95 ▼0.3344.18 ▲0.01
Dashboard /wp-admin2,209 ▲184.88 ▼0.2398.24 ▼5.7539.06 ▼0.23
Posts /wp-admin/edit.php2,089 ▼32.01 ▲0.0135.64 ▼0.7536.04 ▲2.38
Add New Post /wp-admin/post-new.php1,514 ▼1917.76 ▼5.40657.37 ▼12.1355.55 ▼2.43
Media Library /wp-admin/upload.php1,391 ▲34.29 ▲0.0393.37 ▼10.9540.46 ▼2.79

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

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

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 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
3 plugin tags: php, browser detect, user agent

user-agent-body-class/super-browser-detector.php 92% from 13 tests

Analyzing the main PHP file in "Super Browser Detector" version 1.1
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("user-agent-body-class.php" instead of "super-browser-detector.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin97 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1111697

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.79
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%
Functions11
▷ Named functions11100.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