88% ad-blocking-alert

Code Review | Ad Blocking Alert

WordPress plugin Ad Blocking Alert scored 88% from 54 tests.

About plugin

  • Plugin page: ad-blocking-alert
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5
  • WordPress version: 5.9.2
  • First release: Nov 16, 2015
  • Latest release: Apr 26, 2016
  • Number of updates: 8
  • Update frequency: every 20.2 days
  • Top authors: deano1987 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 2,169 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼293.64ms] Passed 4 tests

Analyzing server-side resources used by Ad Blocking Alert
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0349.18 ▼3.34
Dashboard /wp-admin3.43 ▲0.0232.59 ▼1.45
Posts /wp-admin/edit.php3.65 ▲0.0239.44 ▲2.72
Add New Post /wp-admin/post-new.php6.89 ▼0.0891.51 ▼1,169.35
Media Library /wp-admin/upload.php3.31 ▲0.0123.75 ▼0.42

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 4 new options
New WordPress options

Browser metrics Passed 4 tests

Ad Blocking Alert: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,170 ▲41515.88 ▲0.108.19 ▲2.412.20 ▼0.39
Dashboard /wp-admin2,907 ▲536.16 ▲0.09126.39 ▼3.97170.72 ▲11.82
Posts /wp-admin/edit.php2,706 ▲153.25 ▲0.0064.20 ▲0.81144.46 ▲2.55
Add New Post /wp-admin/post-new.php1,623 ▼13918.17 ▼0.72407.54 ▲23.43185.68 ▲27.85
Media Library /wp-admin/upload.php1,715 ▲205.53 ▲0.00122.08 ▼18.24200.57 ▲17.01

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/ad-blocking-alert/includes/preview.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ad-blocking-alert/includes/jj.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/ad-blocking-alert/includes/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/ad-blocking-alert/ad-blocking-alert.php:13

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, but this is not an exhaustive test


Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: You are using too many tags: 17 tag instead of maximum 10
You can look at the official readme.txt

ad-blocking-alert/ad-blocking-alert.php 92% from 13 tests

The main PHP file in "Ad Blocking Alert" ver. 1.0.3 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 238 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin328 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.14
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions00.00%
▷ Anonymous functions00.00%
▷ 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
2 PNG files occupy 0.09MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/alerter.png15.25KB1.26KB▼ 91.75%
img/alert.png74.97KB27.64KB▼ 63.13%