84% country-blocker-for-adsense

Code Review | Country Blocker for AdSense

WordPress plugin Country Blocker for AdSense scored84%from 54 tests.

About plugin

  • Plugin page: country-blocker-f...
  • Plugin version: 1.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.2
  • WordPress version: 6.3.1
  • First release: Apr 27, 2023
  • Latest release: Apr 27, 2023
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: soyrodriguez (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /124 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.16MB] [CPU: ▼18.27ms] Passed 4 tests

Server-side resources used by Country Blocker for AdSense
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.29 ▼0.29
Dashboard /wp-admin3.22 ▼0.1330.97 ▼29.37
Posts /wp-admin/edit.php3.29 ▼0.0734.08 ▼12.00
Add New Post /wp-admin/post-new.php5.46 ▼0.4369.93 ▼31.42
Media Library /wp-admin/upload.php3.22 ▼0.0130.90 ▲0.63
Country Blocker for AdSense /wp-admin/options-general.php?page=CountryBlockerForAdSense3.2331.20

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
cbfa_configured
cbfa_settings
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Country Blocker for AdSense
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲1814.38 ▼0.211.66 ▼0.3944.37 ▲1.82
Dashboard /wp-admin2,213 ▲415.63 ▲0.0595.44 ▼2.9648.90 ▲8.58
Posts /wp-admin/edit.php2,115 ▲152.02 ▲0.0332.61 ▼6.1133.31 ▼1.47
Add New Post /wp-admin/post-new.php1,542 ▲723.34 ▲5.07744.42 ▲147.2759.53 ▼24.83
Media Library /wp-admin/upload.php1,415 ▲184.18 ▼0.04101.84 ▼9.5743.57 ▼7.01
Country Blocker for AdSense /wp-admin/options-general.php?page=CountryBlockerForAdSense1,0121.8226.6125.63

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/country-blocker-for-adsense/inc/admin-html.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function home_url() in wp-content/plugins/country-blocker-for-adsense/inc/header-html.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Contributors: The plugin contributors field is not present
The official readme.txt might help

country-blocker-for-adsense/index.php 92% from 13 tests

Analyzing the main PHP file in "Country Blocker for AdSense" version 1.0
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("country-blocker-for-adsense.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
There were no executable files found in this plugin336 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP32715336

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin