74% adblock-detector

Code Review | AdBlock Detector

WordPress plugin AdBlock Detector scored 74% from 54 tests.

About plugin

  • Plugin page: adblock-detector
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.0-4.5.3
  • WordPress version: 5.9.2
  • First release: Aug 2, 2016
  • Latest release: Aug 23, 2016
  • Number of updates: 19
  • Update frequency: every 1.3 days
  • Top authors: AdPushup (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,483 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼296.23ms] Passed 4 tests

Server-side resources used by AdBlock Detector
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.1768.42 ▲13.72
Dashboard /wp-admin3.52 ▲0.1264.79 ▲30.90
Posts /wp-admin/edit.php3.75 ▲0.1139.36 ▼40.96
Add New Post /wp-admin/post-new.php6.98 ▲0.01132.06 ▼1,151.42
Media Library /wp-admin/upload.php3.40 ▲0.1125.40 ▼6.26

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 45 new files
Database: 1 new table, 1 new option
New tables
wp_ap_adblock_detector_log
New WordPress options
adblockmon_settings

Browser metrics Passed 4 tests

This is an overview of browser requirements for AdBlock Detector
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,785 ▲4115.53 ▼0.147.64 ▲1.622.08 ▼0.23
Dashboard /wp-admin2,907 ▲466.12 ▼0.08119.10 ▼11.61161.70 ▼6.45
Posts /wp-admin/edit.php2,706 ▲153.24 ▲0.0164.67 ▼0.36146.24 ▼6.74
Add New Post /wp-admin/post-new.php1,721 ▲6020.76 ▲4.39452.41 ▲19.96159.56 ▼7.58
Media Library /wp-admin/upload.php1,716 ▲185.47 ▼0.08139.40 ▼2.31192.65 ▲7.02

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie tables were found after uninstall: 1 table
    • wp_ap_adblock_detector_log
  • Zombie WordPress options were found after uninstall: 1 option
    • adblockmon_settings

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
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/adblock-detector/public/partials/ap-adblock-detector-public-display.php
    • > /wp-content/plugins/adblock-detector/admin/partials/ap-adblock-detector-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (The plugin dashboard that allows you to see some quick stats and use some quick filtering.) image not found
You can look at the official readme.txt

adblock-detector/ap-adblock-detector.php 92% from 13 tests

"AdBlock Detector" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("adblock-detector.php" instead of "ap-adblock-detector.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
Everything looks great! No dangerous files found in this plugin4,836 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript94097162,668
CSS670911,727
PHP12176550441

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity4.71
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity1.76
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods34
▷ Static methods25.88%
▷ Public methods2985.29%
▷ Protected methods00.00%
▷ Private methods514.71%
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
11 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/jquery-ui-themes/smoothness/images/ui-icons_cd0a0a_256x240.png4.57KB4.18KB▼ 8.43%
admin/css/jquery-ui-themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png0.38KB0.12KB▼ 67.68%
admin/css/jquery-ui-themes/smoothness/images/ui-icons_222222_256x240.png6.86KB4.18KB▼ 39.05%
admin/css/jquery-ui-themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png0.32KB0.16KB▼ 50.46%
admin/css/jquery-ui-themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png0.38KB0.15KB▼ 61.54%