73% adunblocker

Code Review | AdUnblocker

WordPress plugin AdUnblocker scored 73% from 54 tests.

About plugin

  • Plugin page: adunblocker
  • Plugin version: 1.1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.0.2
  • WordPress version: 6.3.1
  • First release: Dec 1, 2017
  • Latest release: Oct 17, 2022
  • Number of updates: 55
  • Update frequency: every 32.5 days
  • Top authors: digitalapps (100%)

Code review

54 tests

User reviews

32 reviews

Install metrics

800+ active / 19,198 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.32MB] [CPU: ▼2.74ms] Passed 4 tests

This is a short check of server-side resources used by AdUnblocker
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3345.92 ▲6.91
Dashboard /wp-admin3.66 ▲0.3647.67 ▼1.07
Posts /wp-admin/edit.php3.71 ▲0.3650.08 ▼4.05
Add New Post /wp-admin/post-new.php6.18 ▲0.2998.27 ▼6.82
Media Library /wp-admin/upload.php3.52 ▲0.2936.49 ▲0.97
Go Pro /wp-admin/admin.php?page=adunblocker_go_pro3.3627.89
Help /wp-admin/admin.php?page=adunblocker-help3.5034.82
Settings /wp-admin/admin.php?page=adunblocker-general-settings-page3.5133.45

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 39 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
db_upgraded
adunblocker-review-notify
widget_recent-comments
adunblocker-install-date
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
adunblocker-options

Browser metrics Passed 4 tests

A check of browser resources used by AdUnblocker
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,861 ▲12613.32 ▼1.061.75 ▼0.0833.43 ▼7.28
Dashboard /wp-admin2,246 ▲585.91 ▲0.09100.42 ▼15.4945.26 ▼4.17
Posts /wp-admin/edit.php2,126 ▲372.03 ▲0.0641.52 ▲2.6038.01 ▲2.47
Add New Post /wp-admin/post-new.php1,544 ▲3023.52 ▲6.00607.21 ▼71.2251.21 ▼2.18
Media Library /wp-admin/upload.php1,425 ▲344.27 ▲0.0597.87 ▲0.9643.79 ▼0.64
Go Pro /wp-admin/admin.php?page=adunblocker_go_pro1,43511.78357.8790.90
Help /wp-admin/admin.php?page=adunblocker-help9632.0627.4133.39
Settings /wp-admin/admin.php?page=adunblocker-general-settings-page1,0562.1336.5032.52

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 8 options in the database
    • adunblocker-review-notify
    • widget_recent-comments
    • adunblocker-install-date
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, 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
Almost there! Just fix the following items
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/adunblocker/admin/partials/adunblocker-admin-section-options.php
    • > /wp-content/plugins/adunblocker/admin/partials/adunblocker-admin-section-style.php
    • > /wp-content/plugins/adunblocker/admin/partials/adunblocker-admin-section-content.php
    • > /wp-content/plugins/adunblocker/public/partials/adunblocker-public-display.php
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/adunblocker/admin/partials/adunblocker-admin-field-select.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/adunblocker/admin/partials/adunblocker-admin-page-settings.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/adunblocker/admin/partials/adunblocker-admin-color-picker.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/adunblocker/admin/partials/adunblocker-admin-field-editor.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/adunblocker/admin/partials/adunblocker-admin-field-text.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/adunblocker/admin/partials/adunblocker-admin-alpha-color-picker.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/adunblocker/admin/partials/adunblocker-admin-page-sidebar.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _ex() in wp-content/plugins/adunblocker/admin/partials/adunblocker-admin-page-help.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/adunblocker/admin/partials/adunblocker-admin-field-checkbox.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=adunblocker_go_pro
    • > Javascript (severe) in unknown
    https://digitalapps.com/wordpress-plugins/adunblocker/?utm_source=gopro&utm_medium=web&utm_content=link&utm_campaign=freeplugin 92:9 Uncaught TypeError: Cannot read properties of null (reading 'appendChild')
    • > GET request to /wp-admin/admin.php?page=adunblocker-help
    • > Javascript (severe) in unknown
    /wp-content/plugins/adunblocker/admin/js/adunblocker-admin-help.js?ver=1.1.5 34:23 Uncaught ReferenceError: daau_app is not defined

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === adunblocker === )
You can look at the official readme.txt

adunblocker/adunblocker.php Passed 13 tests

The principal PHP file in "AdUnblocker" v. 1.1.6 is loaded by WordPress automatically on each request
137 characters long description:
This plugin detects if Google AdSense ads are blocked by ad-blocker. A popup shows with a text requesting user to whitelist your website.

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
No dangerous file extensions were detected1,850 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP225539421,464
JavaScript47959269
CSS3203117

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity18.88
▷ Minimum class complexity1.00
▷ Maximum class complexity78.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods84
▷ Static methods55.95%
▷ Public methods7386.90%
▷ Protected methods00.00%
▷ Private methods1113.10%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG images were found in this plugin