74% adblock-detector

Code Review | AdBlock Detector

WordPress plugin AdBlock Detector scored74%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: 6.3.1
  • 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

20+ active /1,749 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.81ms] Passed 4 tests

A check of server-side resources used by AdBlock Detector
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.25 ▼6.02
Dashboard /wp-admin3.33 ▲0.0345.12 ▼1.46
Posts /wp-admin/edit.php3.38 ▲0.0347.27 ▲2.37
Add New Post /wp-admin/post-new.php5.91 ▲0.0382.81 ▼10.13
Media Library /wp-admin/upload.php3.25 ▲0.0334.56 ▲4.44

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 45 new files
Database: 1 new table, 7 new options
New tables
wp_ap_adblock_detector_log
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
adblockmon_settings

Browser metrics Passed 4 tests

AdBlock Detector: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲8613.25 ▼0.995.03 ▲2.9141.06 ▼4.78
Dashboard /wp-admin2,215 ▲275.77 ▼0.06102.90 ▼8.8039.05 ▼4.95
Posts /wp-admin/edit.php2,101 ▲122.00 ▲0.0040.31 ▲4.4135.53 ▲3.33
Add New Post /wp-admin/post-new.php1,543 ▲723.00 ▼0.20598.22 ▼71.8158.45 ▼2.08
Media Library /wp-admin/upload.php1,403 ▲214.17 ▼0.1296.71 ▼4.8842.13 ▼6.16

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_ap_adblock_detector_log
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • adblockmon_settings
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/adblock-detector/admin/partials/ap-adblock-detector-admin-display.php
    • > /wp-content/plugins/adblock-detector/public/partials/ap-adblock-detector-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of 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 take inspiration from this readme.txt

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

The main file in "AdBlock Detector" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to 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 check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected4,836 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript94097162,668
CSS670911,727
PHP12176550441

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
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-icons_2e83ff_256x240.png4.57KB4.18KB▼ 8.43%
admin/css/jquery-ui-themes/smoothness/images/ui-icons_888888_256x240.png6.94KB4.18KB▼ 39.78%
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-icons_454545_256x240.png6.92KB4.18KB▼ 39.61%