78% ad-invalid-click-protector

Code Review | Ad Invalid Click Protector (AICP)

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

About plugin

  • Plugin page: ad-invalid-click-...
  • Plugin version: 1.2.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2
  • WordPress version: 6.3.1
  • First release: Nov 16, 2016
  • Latest release: Mar 21, 2023
  • Number of updates: 53
  • Update frequency: every 46.8 days
  • Top authors: isaumya (100%)

Code review

54 tests

User reviews

60 reviews

Install metrics

30,000+ active /230,004 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.17MB] [CPU: ▼2.00ms] Passed 4 tests

A check of server-side resources used by Ad Invalid Click Protector (AICP)
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1739.75 ▲0.80
Dashboard /wp-admin3.49 ▲0.1845.76 ▼8.45
Posts /wp-admin/edit.php3.59 ▲0.2348.52 ▲0.64
Add New Post /wp-admin/post-new.php6.05 ▲0.1793.97 ▼1.00
Media Library /wp-admin/upload.php3.40 ▲0.1736.89 ▲4.79
General Settings /wp-admin/admin.php?page=aicp_settings3.3631.02
Banned User Details /wp-admin/admin.php?page=aicp_banned_user_details3.3838.62

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 25 new files
Database: 1 new table, 7 new options
New tables
wp_adsense_invalid_click_protector
New WordPress options
widget_theysaidso_widget
aicp_db_ver
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Ad Invalid Click Protector (AICP)
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,041 ▲29513.60 ▼1.1511.62 ▲9.6930.13 ▼25.41
Dashboard /wp-admin2,330 ▲1544.84 ▼0.05108.57 ▼2.2045.71 ▼2.43
Posts /wp-admin/edit.php2,151 ▲622.10 ▲0.0840.72 ▲4.8237.27 ▲1.22
Add New Post /wp-admin/post-new.php1,579 ▲4223.24 ▲5.05627.98 ▲14.0558.91 ▲3.71
Media Library /wp-admin/upload.php1,448 ▲604.19 ▲0.0199.29 ▲5.5344.52 ▲2.94
General Settings /wp-admin/admin.php?page=aicp_settings1,53510.16310.5431.00
Banned User Details /wp-admin/admin.php?page=aicp_banned_user_details1,0242.0627.5027.35

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% 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
Please fix the following
  • 4× GET requests to PHP files return non-empty strings:
    • > /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/banned_user_table.php
    • > /wp-content/plugins/ad-invalid-click-protector/inc/setup.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=aicp_settings
    • > Network (severe)
    https://api.razorpay.com/v1/payment_buttons/pl_FXG3hGY91IY5Rk/button_preferences - Failed to load resource: the server responded with a status of 400 (Bad Request)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: invalid click, save adsense account, isaumya, google adsense, adsense invalid click...

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

This is the main PHP file of "Ad Invalid Click Protector (AICP)" version 1.2.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same 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 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin1,658 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP5128211704
PO File3147150555
JavaScript64666313
CSS20586

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
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
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods41
▷ Static methods37.32%
▷ Public methods41100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ 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
PNG images were not found in this plugin