84% wpg-detect-browser

Code Review | WPG Detect Browser

WordPress plugin WPG Detect Browser scored 84% from 54 tests.

About plugin

  • Plugin page: wpg-detect-browser
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.0
  • WordPress version: 6.3.1
  • First release: Sep 12, 2014
  • Latest release: Nov 28, 2016
  • Number of updates: 13
  • Update frequency: every 62.2 days
  • Top authors: rakeshraja (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,479 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by WPG Detect Browser
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.58 ▼4.84
Dashboard /wp-admin3.31 ▲0.0049.57 ▲0.82
Posts /wp-admin/edit.php3.36 ▲0.0046.59 ▼4.28
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.07 ▼4.90
Media Library /wp-admin/upload.php3.23 ▲0.0034.48 ▼1.80

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by WPG Detect Browser
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.29 ▼0.961.57 ▼0.3639.15 ▼14.72
Dashboard /wp-admin2,209 ▲214.82 ▼1.02109.58 ▼8.6337.85 ▼8.29
Posts /wp-admin/edit.php2,092 ▲31.97 ▼0.0341.22 ▲5.3935.33 ▼0.07
Add New Post /wp-admin/post-new.php1,513 ▼2017.89 ▼5.37578.33 ▼60.1347.43 ▼12.75
Media Library /wp-admin/upload.php1,391 ▲94.18 ▲0.0198.01 ▼1.7642.77 ▲0.40

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
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 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)
Everything seems fine, however 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
Almost there! Just fix the following items
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/wpg-detect-browser/index.php on line 14
    • > PHP Notice
      Undefined variable: ub in wp-content/plugins/wpg-detect-browser/index.php on line 68
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/wpg-detect-browser/index.php on line 14
    • > PHP Notice
      Undefined offset: 1 in wp-content/plugins/wpg-detect-browser/index.php on line 84
    • > PHP Notice
      Undefined variable: ub in wp-content/plugins/wpg-detect-browser/index.php on line 68
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wpg-detect-browser/index.php:119
    • > PHP Notice
      Undefined variable: ub in wp-content/plugins/wpg-detect-browser/index.php on line 80
    • > PHP Notice
      Undefined variable: ub in wp-content/plugins/wpg-detect-browser/index.php on line 80
    • > PHP Notice
      Undefined offset: 1 in wp-content/plugins/wpg-detect-browser/index.php on line 84

User-side errors Passed 1 test

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

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: comments, wpg, css, browser, detect

wpg-detect-browser/index.php 92% from 13 tests

This is the main PHP file of "WPG Detect Browser" version 2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wpg-detect-browser.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected93 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1132093

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.41
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin