10% browser-body-classes-with-shortcodes

Code Review | Browser Body Classes with Shortcodes

WordPress plugin Browser Body Classes with Shortcodes scored10%from 54 tests.

About plugin

  • Plugin page: browser-body-clas...
  • Plugin version: 1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.9
  • WordPress version: 6.3.1
  • First release: Oct 1, 2013
  • Latest release: May 9, 2014
  • Number of updates: 74
  • Update frequency: every 3.0 days
  • Top authors: thomstark (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

40+ active /6,622 total downloads


Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/browser-body-classes-with-shortcodes/browser-body-classes-with-shortcodes.php+359
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼0.12MB] [CPU: ▼8.27ms] Passed 4 tests

A check of server-side resources used by Browser Body Classes with Shortcodes
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0728.16 ▼13.19
Dashboard /wp-admin3.32 ▲0.0250.89 ▼3.11
Posts /wp-admin/edit.php3.37 ▲0.0250.32 ▼3.05
Add New Post /wp-admin/post-new.php5.46 ▼0.4380.44 ▼13.72
Media Library /wp-admin/upload.php3.25 ▲0.0240.33 ▲5.56
Browser Body Classes Options /wp-admin/options-general.php?page=browser-body-classes-with-shortcodes/browser-body-classes-with-shortcodes.php3.2131.68

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options

Browser metrics Passed 4 tests

A check of browser resources used by Browser Body Classes with Shortcodes
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.24 ▼0.111.67 ▲0.1041.73 ▲1.59
Dashboard /wp-admin2,198 ▲175.53 ▼0.1685.98 ▼17.3640.68 ▼4.74
Posts /wp-admin/edit.php2,106 ▲32.03 ▲0.0640.83 ▲1.3837.36 ▼3.95
Add New Post /wp-admin/post-new.php6,515 ▲4,98921.37 ▼1.72889.92 ▲195.5681.22 ▲19.43
Media Library /wp-admin/upload.php1,403 ▲34.22 ▼0.05104.15 ▲1.5446.05 ▲0.02
Browser Body Classes Options /wp-admin/options-general.php?page=browser-body-classes-with-shortcodes/browser-body-classes-with-shortcodes.php1,3491.9925.9451.32

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/browser-body-classes-with-shortcodes/includes/ssbbc-shortcode-generator.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/browser-body-classes-with-shortcodes/browser-body-classes-with-shortcodes.php:46
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/browser-body-classes-with-shortcodes/browser-body-classes-with-shortcodes.php on line 12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: There are too many tags (49 tag instead of maximum 10)
The official readme.txt is a good inspiration

browser-body-classes-with-shortcodes/browser-body-classes-with-shortcodes.php Passed 13 tests

The primary PHP file in "Browser Body Classes with Shortcodes" version 1.6 is used by WordPress to initiate all plugin functionality
113 characters long description:
Adds browser-specific body classes and shortcodes to show or hide content to/from specified browsers and devices.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected846 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.95
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
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions22100.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.05MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/tmcebbc.png4.00KB0.82KB▼ 79.49%
images/other_plugins.png5.47KB1.69KB▼ 69.16%
images/eyesonly_banner.png23.84KB8.46KB▼ 64.53%
images/bbc_banner.png22.41KB8.03KB▼ 64.17%