78% block-user-ads

Code Review | Block User Ads

WordPress plugin Block User Ads scored 78% from 54 tests.

About plugin

  • Plugin page: block-user-ads
  • Plugin version: 1.4.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.2.4
  • WordPress version: 5.8.1
  • First release: Oct 10, 2017
  • Latest release: Oct 30, 2019
  • Number of updates: 34
  • Update frequency: every 22.3 days
  • Top authors: easycpmods (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,081 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.75MB] [CPU: ▼172.37ms] Passed 4 tests

A check of server-side resources used by Block User Ads
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.93 ▲0.2139.51 ▲6.88
Dashboard /wp-admin2.90 ▼0.1629.58 ▼18.88
Posts /wp-admin/edit.php2.90 ▼0.2121.20 ▼28.41
Add New Post /wp-admin/post-new.php2.90 ▼2.5322.97 ▼627.08
Media Library /wp-admin/upload.php2.90 ▼0.1121.04 ▼15.12
Block User Ads /wp-admin/options-general.php?page=ecpm_bua_settings_page2.9023.11

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 46 new files
Database: no new tables, 1 new option
New WordPress options
ecpm_bua_settings

Browser metrics Passed 4 tests

A check of browser resources used by Block User Ads
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,931 ▲35917.72 ▲1.778.83 ▼0.9452.32 ▼1.43
Dashboard /wp-admin3,198 ▲2688.23 ▲2.14174.11 ▼1.44110.10 ▼15.02
Posts /wp-admin/edit.php3,011 ▲2724.36 ▲1.6688.17 ▲19.1289.73 ▼6.41
Add New Post /wp-admin/post-new.php1,522 ▼8418.22 ▼0.58343.51 ▼70.75102.99 ▼29.26
Media Library /wp-admin/upload.php1,845 ▲414.94 ▼0.09119.02 ▼101.37119.50 ▼24.56
Block User Ads /wp-admin/options-general.php?page=ecpm_bua_settings_page3,3214.1996.72105.90

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/block-user-ads/ecpm-bua-functions.php+5
    Use of undefined constant APP_TD - assumed 'APP_TD' (this will throw an Error in a future version of PHP)

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=ecpm_bua_settings_page
    • > Warning in wp-content/plugins/block-user-ads/ecpm-bua-functions.php+5
    Use of undefined constant APP_TD - assumed 'APP_TD' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ecpm_bua_settings_page
    • > Warning in wp-content/plugins/block-user-ads/ecpm-bua-settings.php+337
    Use of undefined constant ECPM_ECP - assumed 'ECPM_ECP' (this will throw an Error in a future version of PHP)

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/block-user-ads/image_sidebar.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_template_part() in wp-content/plugins/block-user-ads/templates/ecpm-bua-blocked-template-4.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cp_breadcrumb() in wp-content/plugins/block-user-ads/templates/ecpm-bua-blocked-template.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/block-user-ads/ecpm-bua-settings.php:9

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

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Image settings), #2 (Top notice), #3 (Bottom notice), #4 (Ad settings), #5 (Empty blocked user list), #6 (Blocked user list), #7 (Warning template user sees)
You can look at the official readme.txt

block-user-ads/ecpm-bua.php 85% from 13 tests

"Block User Ads" version 1.4.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("block-user-ads.php" instead of "ecpm-bua.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin1,232 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP719727957
PO File19496213
CSS19148
JavaScript11014

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
33 compressed PNG files occupy 0.33MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/cp-author-online.png2.37KB2.37KB0.00%
images/1-click-bump-renew.png2.50KB2.61KB0.00%
images/user-ads-limiter.png16.25KB16.64KB0.00%
images/qr-code-tab-feat.png7.46KB7.79KB0.00%
images/auto-bump-renew.png6.62KB6.88KB0.00%