10% browser-blocker

Code Review | Browser Blocker

WordPress plugin Browser Blocker scored 10% from 53 tests.

About plugin

  • Plugin page: browser-blocker
  • Plugin version: 0.5.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.4.2
  • WordPress version: 5.8.1
  • First release: Oct 11, 2011
  • Latest release: Oct 11, 2012
  • Number of updates: 73
  • Update frequency: every 5.3 days
  • Top authors: bdoga (100%)

Code review

53 tests

User reviews

7 reviews

Install metrics

200+ active / 10,206 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/browser-blocker/browser_blocker.php+620
    in_array() expects parameter 2 to be array, bool given

Server metrics [RAM: ▲0.06MB] [CPU: ▼263.66ms] Passed 4 tests

This is a short check of server-side resources used by Browser Blocker
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1740.32 ▲19.82
Dashboard /wp-admin3.12 ▲0.0644.15 ▼0.59
Posts /wp-admin/edit.php3.17 ▲0.0639.93 ▼3.42
Add New Post /wp-admin/post-new.php5.48 ▲0.0589.08 ▼1,045.20
Media Library /wp-admin/upload.php3.06 ▲0.0533.91 ▼5.43
Browser Blocker /wp-admin/options-general.php?page=Browser_Blocker_Admin3.0127.70

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 38 new files
Database: no new tables, 12 new options
New WordPress options
Browser_Blocker_Code
Browser_Blocker_Title
Browser_Blocker_DwnldDesc
Browser_Blocker_Display_Browsers
Browser_Blocker_Splash_Img
Browser_Blocker_Enabled
Browser_Blocker_Pages
Browser_Blocker_Bypass
Browser_Blocker_Msg
Browser_Blocker_Credit
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Browser Blocker
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,678 ▲7215.79 ▼0.128.65 ▼0.1551.53 ▲3.93
Dashboard /wp-admin2,935 ▲825.93 ▲0.07134.99 ▼11.61114.28 ▲7.70
Posts /wp-admin/edit.php2,711 ▲82.68 ▼0.0264.68 ▲3.2387.81 ▲5.10
Add New Post /wp-admin/post-new.php1,856 ▲26819.16 ▼2.76375.83 ▲94.60104.70 ▼4.16
Media Library /wp-admin/upload.php1,780 ▲84.99 ▼0.01140.53 ▼6.75110.50 ▼13.44
Browser Blocker /wp-admin/options-general.php?page=Browser_Blocker_Admin9552.0952.9155.92

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/browser-blocker/browser_blocker.php+741
    mktime(): You should be using the time() function instead
  • Zombie WordPress options were found after uninstall: 12 options
    • Browser_Blocker_Code
    • Browser_Blocker_Display_Browsers
    • Browser_Blocker_BPtext
    • Browser_Blocker_DwnldDesc
    • Browser_Blocker_Msg
    • Browser_Blocker_Enabled
    • Browser_Blocker_Title
    • Browser_Blocker_Splash_Img
    • Browser_Blocker_Blocked
    • Browser_Blocker_Bypass
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=Browser_Blocker_Admin
    • > Warning in wp-includes/class-wp-hook.php+303
    call_user_func_array() expects parameter 1 to be a valid callback, function 'BrowserBlocker_Options_Page' not found or invalid function name

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/browser-blocker/splash.php on line 207
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BrowserBlocker_GetBlocked() in wp-content/plugins/browser-blocker/advanced.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/browser-blocker/browser_blocker.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BrowserBlocker_GetBlocked() in wp-content/plugins/browser-blocker/simple.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (Simple Admin Interface), #2 (Advanced Admin Interface), #3 (Default Splash Page)
  • Tags: Too many tags (25 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

browser-blocker/browser_blocker.php 85% from 13 tests

The main PHP file in "Browser Blocker" ver. 0.5.6 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 273 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("browser-blocker.php" instead of "browser_blocker.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin1,724 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP51734811,724

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity118.00
▷ Minimum class complexity118.00
▷ Maximum class complexity118.00
Average method complexity3.13
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods55
▷ Static methods00.00%
▷ Public methods1934.55%
▷ Protected methods3665.45%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants55
▷ Global constants00.00%
▷ Class constants55100.00%
▷ Public constants55100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
22 PNG files occupy 0.16MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/bb-64.png10.23KB3.62KB▼ 64.64%
images/exclamation.png1.51KB1.40KB▼ 7.07%
images/edit.png0.67KB0.83KB0.00%
images/globe.png1.50KB1.40KB▼ 6.39%
images/bb-16.png1.08KB1.15KB0.00%