94% ad-invalid-click-protector

Code Review | Ad Invalid Click Protector (AICP)

WordPress plugin Ad Invalid Click Protector (AICP) scored 94% from 54 tests.

About plugin

  • Plugin page: ad-invalid-click-...
  • Plugin version: 1.2.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 5.9.2
  • First release: Nov 16, 2016
  • Latest release: Apr 5, 2022
  • Number of updates: 48
  • Update frequency: every 41.0 days
  • Top authors: isaumya (100%)

Code review

54 tests

User reviews

54 reviews

Install metrics

20,000+ active / 155,052 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼321.77ms] Passed 4 tests

An overview of server-side resources used by Ad Invalid Click Protector (AICP)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.6284.71 ▲43.11
Dashboard /wp-admin3.60 ▲0.1936.05 ▼4.23
Posts /wp-admin/edit.php3.81 ▲0.1743.08 ▼18.68
Add New Post /wp-admin/post-new.php7.05 ▲0.08108.81 ▼1,264.43
Media Library /wp-admin/upload.php3.46 ▲0.1733.90 ▲0.26
General Settings /wp-admin/admin.php?page=aicp_settings3.4330.10
Banned User Details /wp-admin/admin.php?page=aicp_banned_user_details3.4628.54

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 25 new files
Database: 1 new table, 1 new option
New tables
New WordPress options

Browser metrics Passed 4 tests

An overview of browser requirements for Ad Invalid Click Protector (AICP)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,147 ▲39316.40 ▲0.6615.08 ▼10.343.73 ▲0.20
Dashboard /wp-admin3,123 ▲2046.43 ▲0.04183.36 ▼29.19248.90 ▲45.96
Posts /wp-admin/edit.php2,796 ▲723.56 ▲0.1390.30 ▼1.91174.56 ▼5.32
Add New Post /wp-admin/post-new.php1,716 ▲7217.25 ▼2.06620.61 ▼35.67198.82 ▼8.82
Media Library /wp-admin/upload.php1,805 ▲755.84 ▲0.16198.78 ▲2.40254.45 ▼4.43
General Settings /wp-admin/admin.php?page=aicp_settings1,63511.26513.08186.77
Banned User Details /wp-admin/admin.php?page=aicp_banned_user_details1,3062.6375.35120.43

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 fix the following items
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ad-invalid-click-protector/inc/admin_setup.php
    • > /wp-content/plugins/ad-invalid-click-protector/adsense-invalid-click-protector.php
    • > /wp-content/plugins/ad-invalid-click-protector/inc/setup.php
    • > /wp-content/plugins/ad-invalid-click-protector/inc/banned_user_table.php

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)
Everything seems fine on the user side


Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: google adsense, aicp wordpress, aicp, adsense invalid click, protect adsense account...

ad-invalid-click-protector/adsense-invalid-click-protector.php 85% from 13 tests

The main file in "Ad Invalid Click Protector (AICP)" v. 1.2.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ad-invalid-click-protector.php" instead of "adsense-invalid-click-protector.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin1,658 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PO File3147150555

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity16.00
▷ Minimum class complexity5.00
▷ Maximum class complexity37.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
▷ Static methods37.32%
▷ Public methods41100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions1100.00%
▷ Anonymous functions00.00%
▷ Global constants2100.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