84% detect-adblock

Code Review | Detect AdBlock

WordPress plugin Detect AdBlock scored84%from 54 tests.

About plugin

  • Plugin page: detect-adblock
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-4.9.4
  • WordPress version: 6.3.1
  • First release: Sep 8, 2016
  • Latest release: Feb 11, 2018
  • Number of updates: 8
  • Update frequency: every 65.3 days
  • Top authors: Alobaidi (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

50+ active /5,299 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.06MB] [CPU: ▲1.25ms] Passed 4 tests

Server-side resources used by Detect AdBlock
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0842.67 ▲1.02
Dashboard /wp-admin3.36 ▲0.0645.71 ▼2.56
Posts /wp-admin/edit.php3.41 ▲0.0648.86 ▲5.08
Add New Post /wp-admin/post-new.php5.94 ▲0.0694.32 ▲7.95
Media Library /wp-admin/upload.php3.29 ▲0.0634.29 ▲1.44
Detect AdBlock /wp-admin/options-general.php?page=oba_detect_adblock_settings3.2533.07

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
adab_cookie_name
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Detect AdBlock
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲7413.34 ▼1.041.59 ▼0.3740.92 ▼3.55
Dashboard /wp-admin2,210 ▲194.85 ▼0.14110.45 ▼15.0040.96 ▼1.75
Posts /wp-admin/edit.php2,093 ▲42.01 ▲0.0139.31 ▲3.4135.41 ▲1.47
Add New Post /wp-admin/post-new.php1,550 ▲2918.27 ▼4.88598.67 ▼87.7064.98 ▲7.73
Media Library /wp-admin/upload.php1,395 ▲44.21 ▼0.0494.56 ▼2.0140.93 ▼1.98
Detect AdBlock /wp-admin/options-general.php?page=oba_detect_adblock_settings8652.0326.5323.61

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • adab_cookie_name
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/detect-adblock/detect-adblock.php
    • > /wp-content/plugins/detect-adblock/settings.php
    • > /wp-content/plugins/detect-adblock/index.php
    • > /wp-content/plugins/detect-adblock/uninstall.php
    • > /wp-content/plugins/detect-adblock/js/index.php
    • > /wp-content/plugins/detect-adblock/banners/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

detect-adblock/detect-adblock.php 92% from 13 tests

The principal PHP file in "Detect AdBlock" v. 1.0.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 163 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin286 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP48226285
JavaScript1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
banners/bluehost.png9.86KB4.35KB▼ 55.86%