10% wp-adsense-guard

Code Review | Wordpress Adsense Guard

WordPress plugin Wordpress Adsense Guard scored10%from 54 tests.

About plugin

  • Plugin page: wp-adsense-guard
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9.2
  • WordPress version: 6.3.1
  • First release: Jan 24, 2018
  • Latest release: Jan 24, 2018
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: technoyer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,059 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/wp-adsense-guard/includes/functions.php+103
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▼1.00MB] [CPU: ▼53.09ms] Passed 4 tests

This is a short check of server-side resources used by Wordpress Adsense Guard
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.00 ▼0.478.87 ▼30.48
Dashboard /wp-admin3.02 ▼0.298.68 ▼47.18
Posts /wp-admin/edit.php3.02 ▼0.358.08 ▼42.05
Add New Post /wp-admin/post-new.php3.02 ▼2.889.99 ▼92.65
Media Library /wp-admin/upload.php3.02 ▼0.229.18 ▼24.82
Dashboard /wp-admin/admin.php?page=wp-adsense-guard3.027.84
Ads Management /wp-admin/admin.php?page=wp-adsense-guard-ads3.0211.57
Settings /wp-admin/admin.php?page=wp-adsense-guard-settings3.028.91
Go to Premium /wp-admin/admin.php?page=wp-adsense-guard-pro3.029.81

Server storage [IO: ▲1.81MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 59 new files
Database: 3 new tables, 31 new options
New tables
wp_wpadgunots
wp_wpadgublocked_ips
wp_wpadguads
New WordPress options
wpadguguard_status
wpadguadblock_action
wpadgublacklist_bots
wpadgugoogle_engine_id
wpadgudesktop_status
wpadguphones_status
can_compress_scripts
wpadgudefault_margin
wpadgucookie_expiration
wpadgusecurity_hash
...

Browser metrics Passed 4 tests

Checking browser requirements for Wordpress Adsense Guard
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,893 ▲14714.26 ▼0.025.48 ▲3.8244.27 ▲2.55
Dashboard /wp-admin2,217 ▲405.51 ▼0.1688.80 ▼1.2384.71 ▲46.27
Posts /wp-admin/edit.php2,137 ▲401.97 ▲0.0338.48 ▲3.5134.41 ▼4.23
Add New Post /wp-admin/post-new.php1,561 ▲3323.24 ▲0.03695.39 ▼10.0053.71 ▼14.45
Media Library /wp-admin/upload.php1,431 ▲314.10 ▼0.07100.48 ▼10.9874.69 ▲28.57
Dashboard /wp-admin/admin.php?page=wp-adsense-guard9111.9925.6734.14
Ads Management /wp-admin/admin.php?page=wp-adsense-guard-ads1,2512.0522.8630.30
Settings /wp-admin/admin.php?page=wp-adsense-guard-settings1,3952.0623.5939.00
Go to Premium /wp-admin/admin.php?page=wp-adsense-guard-pro9052.1121.8229.29

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 25% 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
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/wp-adsense-guard/includes/functions.php+103
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • Zombie tables detected upon uninstall: 3 tables
    • wp_wpadguads
    • wp_wpadgublocked_ips
    • wp_wpadgunots
  • This plugin did not uninstall successfully, leaving 31 options in the database
    • theysaidso_admin_options
    • wpadgureports
    • widget_recent-comments
    • wpadgucookie_expiration
    • widget_recent-posts
    • wpadguban_duration
    • wpadguadblock_message
    • wpadguadblock_status
    • wpadguadblock_redirect_url
    • wpadgumin_words
    • ...

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-adsense-guard-pro
    • > Deprecated in wp-content/plugins/wp-adsense-guard/includes/functions.php+103
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-adsense-guard-settings
    • > Deprecated in wp-content/plugins/wp-adsense-guard/index.php+918
    Non-static method wpadgu_help::tuts() should not be called statically
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-adsense-guard-settings
    • > Deprecated in wp-content/plugins/wp-adsense-guard/index.php+921
    Non-static method wpadgu_help::products() should not be called statically
  • 20 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-adsense-guard-ads
    • > Notice in wp-content/plugins/wp-adsense-guard/index.php+2196
    Trying to access array offset on value of type bool

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: google adsense, wordpress ads, wordpress adsense plugin, wordpress adsense widget, adsense...

wp-adsense-guard/index.php 85% from 13 tests

"Wordpress Adsense Guard" version 1.0'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:
  • Description: The description should be shorter than 140 characters (currently 262 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-adsense-guard.php" instead of "index.php")

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
No dangerous file extensions were detected10,844 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP197361,5938,679
CSS5323121,367
JavaScript55924439
PO File1155159358
JSON1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity55.81
▷ Minimum class complexity1.00
▷ Maximum class complexity292.00
Average method complexity4.80
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods231
▷ Static methods5021.65%
▷ Public methods16571.43%
▷ Protected methods6528.14%
▷ Private methods10.43%
Functions56
▷ Named functions5598.21%
▷ Anonymous functions11.79%
Constants155
▷ Global constants6038.71%
▷ Class constants9561.29%
▷ Public constants95100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
24 PNG files occupy 0.27MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/article-32.png1.05KB1.16KB0.00%
assets/img/fixed-16.png0.43KB0.43KB0.00%
assets/img/blank.png0.20KB0.09KB▼ 52.45%
assets/img/adsguardpro_banner.png34.19KB16.22KB▼ 52.54%
assets/img/adsguard_icon.png0.82KB0.81KB▼ 0.84%