83% login-ip-country-restriction

Code Review | Login IP & Country Restriction

WordPress plugin Login IP & Country Restriction scored83%from 54 tests.

About plugin

  • Plugin page: login-ip-country-...
  • Plugin version: 6.4.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 4, 2014
  • Latest release: Jul 27, 2023
  • Number of updates: 66
  • Update frequency: every 48.3 days
  • Top authors: Iulia Cazan (100%)

Code review

54 tests

User reviews

42 reviews

Install metrics

6,000+ active /55,374 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.39MB] [CPU: ▼6.99ms] Passed 4 tests

Server-side resources used by Login IP & Country Restriction
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4140.96 ▲2.18
Dashboard /wp-admin3.70 ▲0.3648.11 ▼13.16
Posts /wp-admin/edit.php3.82 ▲0.4644.20 ▼6.79
Add New Post /wp-admin/post-new.php6.29 ▲0.4080.63 ▼10.03
Media Library /wp-admin/upload.php3.63 ▲0.4037.51 ▲2.01
Login IP & Country Restriction Settings /wp-admin/options-general.php?page=login-ip-country-restriction-settings3.60468.99

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 14 new options
New WordPress options
widget_recent-posts
sisanu_rcil_settings
sisanu_rcil_bypass_roles
sisanu_rcil_block_countries
widget_recent-comments
can_compress_scripts
sisanu_rcil_allow_countries
sisanu_rcil_db_ver
sisanu_rcil_actions_notices
sislrc_plugin_notice_db_ver
...

Browser metrics Passed 4 tests

Checking browser requirements for Login IP & Country Restriction
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,864 ▲10314.19 ▼0.041.87 ▲0.1843.13 ▼1.64
Dashboard /wp-admin2,273 ▲935.71 ▲0.0593.84 ▲9.9285.30 ▲41.71
Posts /wp-admin/edit.php2,179 ▲792.15 ▲0.1437.04 ▲2.6832.98 ▼0.24
Add New Post /wp-admin/post-new.php1,593 ▲6723.74 ▲0.24672.55 ▼0.8789.04 ▲35.50
Media Library /wp-admin/upload.php1,472 ▲724.23 ▲0.0495.00 ▼25.1180.62 ▲30.31
Login IP & Country Restriction Settings /wp-admin/options-general.php?page=login-ip-country-restriction-settings1,1281.8324.9964.11

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
  • Zombie WordPress options detected upon uninstall: 14 options
    • sisanu_rcil_bypass_roles
    • sisanu_rcil_allow_countries
    • sisanu_rcil_allow_ips
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • sisanu_rcil_actions_notices
    • widget_recent-comments
    • sisanu_rcil_block_countries
    • sisanu_rcil_db_ver
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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 take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/login-ip-country-restriction/login-restrict-country.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
  • Requires at least: Invalid plugin version format
The official readme.txt might help

login-ip-country-restriction/login-restrict-country.php 77% from 13 tests

The main PHP file in "Login IP & Country Restriction" ver. 6.4.1 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("login-ip-country-restriction.php" instead of "login-restrict-country.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: Keep the plugin description shorter than 140 characters (currently 681 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected2,489 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP22175232,098
PO File1182216389
CSS1001
JavaScript1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity281.00
▷ Minimum class complexity281.00
▷ Maximum class complexity281.00
Average method complexity6.19
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods54
▷ Static methods5296.30%
▷ Public methods5398.15%
▷ Protected methods00.00%
▷ Private methods11.85%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants545.45%
▷ Class constants654.55%
▷ Public constants6100.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.22MB with 0.12MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/banner-772x250.png183.83KB106.42KB▼ 42.11%
assets/images/buy-me-a-coffee.png19.75KB7.15KB▼ 63.78%
assets/images/icon-128x128.png23.99KB11.58KB▼ 51.72%