88% admin-block-country

Code Review | Admin Block Country

WordPress plugin Admin Block Country scored 88% from 54 tests.

About plugin

  • Plugin page: admin-block-country
  • Plugin version: 7.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.8.2
  • WordPress version: 5.9.2
  • First release: Jul 3, 2013
  • Latest release: Nov 4, 2021
  • Number of updates: 37
  • Update frequency: every 82.3 days
  • Top authors: MMDeveloper (100%)

Code review

54 tests

User reviews

24 reviews

Install metrics

3,000+ active / 38,853 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▲264.96ms] 75% from 4 tests

An overview of server-side resources used by Admin Block Country
Please take the time to fix the following items
  • Extra CPU: The extra CPU usage must be under 200.00ms (currently 264.96ms on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.01114.21 ▲37.12
Dashboard /wp-admin3.42 ▲0.01701.95 ▲620.52
Posts /wp-admin/edit.php3.65 ▲0.011,020.83 ▲939.52
Add New Post /wp-admin/post-new.php6.89 ▼0.08854.64 ▼537.32
Media Library /wp-admin/upload.php3.30 ▲0.011,025.80 ▲971.20

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 38 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Admin Block Country
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,810 ▲5616.15 ▲0.5315.04 ▲4.043.05 ▼0.23
Dashboard /wp-admin2,938 ▲556.54 ▼0.02267.99 ▲19.09220.42 ▼33.91
Posts /wp-admin/edit.php2,708 ▲173.42 ▼0.01100.32 ▼36.64269.87 ▼4.67
Add New Post /wp-admin/post-new.php1,648 ▲1416.15 ▲0.07767.91 ▼54.64225.07 ▲18.16
Media Library /wp-admin/upload.php1,712 ▲205.70 ▼0.04259.92 ▼30.01260.07 ▼49.19

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
The following issues need your attention
  • 13× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/admin-block-country/geoip-api-php-master/sample.php
    • > /wp-content/plugins/admin-block-country/geoip-api-php-master/sample_asn-v6.php
    • > /wp-content/plugins/admin-block-country/geoip-api-php-master/benchmark.php
    • > /wp-content/plugins/admin-block-country/geoip-api-php-master/sample_distributed.php
    • > /wp-content/plugins/admin-block-country/geoip-api-php-master/sample_domain.php
    • > /wp-content/plugins/admin-block-country/geoip-api-php-master/sample_netspeed.php
    • > /wp-content/plugins/admin-block-country/geoip-api-php-master/sample_netspeedcell.php
    • > /wp-content/plugins/admin-block-country/geoip-api-php-master/sample_region.php
    • > /wp-content/plugins/admin-block-country/geoip-api-php-master/sample_org.php
    • > /wp-content/plugins/admin-block-country/geoip-api-php-master/sample-v6.php
  • 4095× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined offset: 1 in wp-content/plugins/admin-block-country/geoip-api-php-master/admin/generate_geoipregionvars.php on line 46
    • > PHP Warning
      feof() expects parameter 1 to be resource, bool given in wp-content/plugins/admin-block-country/geoip-api-php-master/admin/generate_geoipregionvars.php on line 43
    • > PHP Warning
      feof() expects parameter 1 to be resource, bool given in wp-content/plugins/admin-block-country/geoip-api-php-master/admin/generate_geoipregionvars.php on line 43
    • > PHP Warning
      fgets() expects parameter 1 to be resource, bool given in wp-content/plugins/admin-block-country/geoip-api-php-master/admin/generate_geoipregionvars.php on line 44
    • > PHP Notice
      Undefined offset: 1 in wp-content/plugins/admin-block-country/geoip-api-php-master/admin/generate_geoipregionvars.php on line 46
    • > PHP Notice
      Undefined offset: 1 in wp-content/plugins/admin-block-country/geoip-api-php-master/admin/generate_geoipregionvars.php on line 46
    • > PHP Warning
      feof() expects parameter 1 to be resource, bool given in wp-content/plugins/admin-block-country/geoip-api-php-master/admin/generate_geoipregionvars.php on line 43
    • > PHP Notice
      Undefined offset: 2 in wp-content/plugins/admin-block-country/geoip-api-php-master/admin/generate_geoipregionvars.php on line 46
    • > PHP Warning
      fgets() expects parameter 1 to be resource, bool given in wp-content/plugins/admin-block-country/geoip-api-php-master/admin/generate_geoipregionvars.php on line 44
    • > PHP Warning
      fgets() expects parameter 1 to be resource, bool given in wp-content/plugins/admin-block-country/geoip-api-php-master/admin/generate_geoipregionvars.php on line 44

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Donate link: Invalid URI found ("")
The official readme.txt is a good inspiration

admin-block-country/admin-block-country.php Passed 13 tests

The primary PHP file in "Admin Block Country" version 7.1.4 is used by WordPress to initiate all plugin functionality
29 characters long description:
Blocks admin site by country.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin8,274 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP212151328,128
Markdown133062
Perl17239
JSON10021
CSS10014
JavaScript10010

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity41.50
▷ Minimum class complexity8.00
▷ Maximum class complexity75.00
Average method complexity8.36
▷ Minimum method complexity1.00
▷ Maximum method complexity49.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/edit.png1.69KB0.59KB▼ 65.22%
images/rate-me.png2.62KB1.53KB▼ 41.67%
images/trash.png1.52KB0.70KB▼ 53.85%