73% adunblocker

Code Review | AdUnblocker

WordPress plugin AdUnblocker scored 73% from 54 tests.

About plugin

  • Plugin page: adunblocker
  • Plugin version: 1.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8
  • WordPress version: 5.9.2
  • First release: Dec 1, 2017
  • Latest release: Sep 20, 2021
  • Number of updates: 53
  • Update frequency: every 26.3 days
  • Top authors: digitalapps (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

1,000+ active / 13,328 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼290.01ms] Passed 4 tests

Server-side resources used by AdUnblocker
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.0856.45 ▲6.81
Dashboard /wp-admin3.49 ▲0.0834.98 ▲2.74
Posts /wp-admin/edit.php3.72 ▲0.0842.25 ▲6.25
Add New Post /wp-admin/post-new.php6.95 ▼0.0294.62 ▼1,167.50
Media Library /wp-admin/upload.php3.37 ▲0.0726.51 ▼1.51
Help /wp-admin/admin.php?page=adunblocker-help3.3823.86
Settings /wp-admin/admin.php?page=adunblocker-general-settings-page3.3923.61
Go Pro /wp-admin/admin.php?page=adunblocker_go_pro3.2118.49

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 39 new files
Database: no new tables, 3 new options
New WordPress options
adunblocker-options
adunblocker-review-notify
adunblocker-install-date

Browser metrics Passed 4 tests

A check of browser resources used by AdUnblocker
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,874 ▲13016.08 ▲0.216.08 ▲0.002.56 ▲0.18
Dashboard /wp-admin2,933 ▲726.27 ▼0.04124.98 ▼10.52169.05 ▲3.86
Posts /wp-admin/edit.php2,734 ▲403.44 ▲0.0163.59 ▲1.07157.85 ▲17.82
Add New Post /wp-admin/post-new.php1,788 ▲7722.98 ▲1.59415.84 ▼45.94160.24 ▼0.12
Media Library /wp-admin/upload.php1,748 ▲505.75 ▲0.03138.73 ▼11.43203.22 ▲11.07
Help /wp-admin/admin.php?page=adunblocker-help1,2412.8260.38135.99
Settings /wp-admin/admin.php?page=adunblocker-general-settings-page1,3373.3770.06160.53
Go Pro /wp-admin/admin.php?page=adunblocker_go_pro1,2777.87200.18132.18

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
  • Zombie WordPress options detected upon uninstall: 2 options
    • adunblocker-review-notify
    • adunblocker-install-date

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/adunblocker/admin/partials/adunblocker-admin-section-content.php
    • > /wp-content/plugins/adunblocker/public/partials/adunblocker-public-display.php
    • > /wp-content/plugins/adunblocker/admin/partials/adunblocker-admin-section-style.php
    • > /wp-content/plugins/adunblocker/admin/partials/adunblocker-admin-section-options.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-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-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 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_attr() in wp-content/plugins/adunblocker/admin/partials/adunblocker-admin-field-editor.php:28
    • > 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-field-checkbox.php:13
    • > 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 wp_get_current_user() in wp-content/plugins/adunblocker/admin/partials/adunblocker-admin-page-sidebar.php:15

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > 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

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === adunblocker === )
The official readme.txt is a good inspiration

adunblocker/adunblocker.php Passed 13 tests

The main file in "AdUnblocker" v. 1.1.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
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 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected1,850 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP225539421,464
JavaScript47959269
CSS3203117

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin