68% dh-anti-adblocker

Code Review | DH - Anti AdBlocker

WordPress plugin DH - Anti AdBlocker scored68%from 54 tests.

About plugin

  • Plugin page: dh-anti-adblocker
  • Plugin version: 46...
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jan 26, 2018
  • Latest release: Feb 8, 2023
  • Number of updates: 159
  • Update frequency: every 11.6 days
  • Top authors: k0z3y (100%)

Code review

54 tests

User reviews

28 reviews

Install metrics

200+ active /24,975 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▼3.25ms] Passed 4 tests

Analyzing server-side resources used by DH - Anti AdBlocker
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1840.27 ▲0.77
Dashboard /wp-admin3.46 ▲0.1545.96 ▼3.45
Posts /wp-admin/edit.php3.57 ▲0.2148.22 ▲3.09
Add New Post /wp-admin/post-new.php6.04 ▲0.1591.54 ▼10.31
Media Library /wp-admin/upload.php3.38 ▲0.1534.82 ▼0.00
DH – Anti AdBlocker /wp-admin/options-general.php?page=dh-anti-adblocker3.6333.29

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 205 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
dhadb_admin_notice
dhadb_token
theysaidso_admin_options
widget_recent-posts
dhadb_update_notice
dh_antiadblocker
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for DH - Anti AdBlocker
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,942 ▲19613.99 ▼0.249.25 ▲7.4336.52 ▼8.09
Dashboard /wp-admin2,212 ▲245.86 ▼0.02101.96 ▼18.9238.36 ▼7.87
Posts /wp-admin/edit.php2,092 ▲32.01 ▲0.0140.12 ▲0.4535.77 ▼2.50
Add New Post /wp-admin/post-new.php1,533 ▼923.37 ▲5.13667.39 ▲33.5759.75 ▲5.18
Media Library /wp-admin/upload.php1,391 ▲34.21 ▲0.0497.79 ▼10.8042.12 ▲0.30
DH – Anti AdBlocker /wp-admin/options-general.php?page=dh-anti-adblocker2,8176.57132.42126.98

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/dh-anti-adblocker/includes/class-dh-anti-adblocker-deactivator.php+72
    Undefined variable: remove_dir_trans
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • dh_antiadblocker
    • dhadb_admin_notice
    • dhadb_update_notice
    • widget_theysaidso_widget

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=dh-anti-adblocker
    • > Notice in wp-content/plugins/dh-anti-adblocker/admin/partials/dh-anti-adblocker-admin-display.php+338
    Undefined index: dhadb_content
    • > GET request to /wp-admin/options-general.php?page=dh-anti-adblocker
    • > Notice in wp-includes/formatting.php+1104
    Array to string conversion

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/dh-anti-adblocker/admin/partials/dh-anti-adblocker-admin-display.php
    • > /wp-content/plugins/dh-anti-adblocker/public/partials/dh-anti-adblocker-public-display.php

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 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 23 tag instead of maximum 10
  • Screenshots: These screenshots do not have images: #1 (If adblocker active then showing notice.), #2 (All settings on WP Dashboard.)
You can look at the official readme.txt

dh-anti-adblocker/dh-anti-adblocker.php 92% from 13 tests

This is the main PHP file of "DH - Anti AdBlocker" version 46..., providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Version: Use periods and digits only for your plugin's version number (ex. "1.0.3" instead of "46...")

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
Success! There were no dangerous files found in this plugin56,053 lines of code in 173 files:
LanguageFilesBlank linesComment linesLines of code
CSS1023,1965,04227,426
JavaScript542,0751,03324,037
SVG30122,880
PHP122817351,439
PO File2107167271

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity5.57
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity1.91
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods35
▷ Static methods25.71%
▷ Public methods2880.00%
▷ Protected methods00.00%
▷ Private methods720.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.21MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/dh.png0.85KB0.81KB▼ 5.06%
admin/img/icon.png2.02KB1.60KB▼ 20.67%
screenshot-2.png126.75KB36.75KB▼ 71.01%
screenshot-1.png56.34KB16.57KB▼ 70.59%
admin/css/themes/default/assets/images/flags.png27.46KB29.21KB0.00%