72% ip-based-login

Code Review | IP Based Login

WordPress plugin IP Based Login scored72%from 54 tests.

About plugin

  • Plugin page: ip-based-login
  • Plugin version: 2.3.10
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4
  • WordPress version: 6.3.1
  • First release: Jul 7, 2013
  • Latest release: Nov 22, 2023
  • Number of updates: 168
  • Update frequency: every 22.6 days
  • Top authors: brijeshk89 (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

600+ active /35,454 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.53MB] [CPU: ▼11.50ms] Passed 4 tests

Analyzing server-side resources used by IP Based Login
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.18 ▲0.7242.66 ▲0.57
Dashboard /wp-admin3.91 ▲0.5640.20 ▼23.49
Posts /wp-admin/edit.php3.97 ▲0.6146.68 ▼4.25
Add New Post /wp-admin/post-new.php6.15 ▲0.2575.54 ▼18.84
Media Library /wp-admin/upload.php3.91 ▲0.6839.36 ▲5.99
Settings /wp-admin/admin.php?page=ip-based-login3.8836.60
IP Based Login /wp-admin/options-general.php?page=ip-based-login3.8838.33

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 10 new files
Database: 1 new table, 7 new options
New tables
wp_ip_based_login
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
ipbl_version
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for IP Based Login
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,852 ▲9014.73 ▲0.381.51 ▼0.1835.87 ▼7.98
Dashboard /wp-admin2,257 ▲775.54 ▼0.1395.35 ▼1.3547.71 ▲0.85
Posts /wp-admin/edit.php2,162 ▲592.11 ▲0.1039.33 ▼2.6941.81 ▲2.93
Add New Post /wp-admin/post-new.php1,577 ▲5123.22 ▼0.01673.04 ▲55.1252.12 ▼3.67
Media Library /wp-admin/upload.php1,462 ▲594.25 ▲0.0597.70 ▼0.5050.00 ▲6.23
Settings /wp-admin/admin.php?page=ip-based-login1,6741.6928.8747.24
IP Based Login /wp-admin/options-general.php?page=ip-based-login1,6561.6928.4141.45

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ip-based-login
    • > Notice in wp-content/plugins/ip-based-login/init.php+1611
    Undefined variable: env
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ip-based-login
    • > Notice in wp-content/plugins/ip-based-login/init.php+1611
    Trying to access array offset on value of type null

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/ip-based-login/ip-based-login.php
    • > /wp-content/plugins/ip-based-login/init.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      include_once(IPBL_LIB_DIR/IPv6/IPv6.php): failed to open stream: No such file or directory in wp-content/plugins/ip-based-login/functions.php on line 3
    • > PHP Warning
      Use of undefined constant IPBL_LIB_DIR - assumed 'IPBL_LIB_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/ip-based-login/functions.php on line 3
    • > PHP Warning
      include_once(): Failed opening 'IPBL_LIB_DIR/IPv6/IPv6.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/ip-based-login/functions.php on line 3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 16 tag instead of maximum 10
You can take inspiration from this readme.txt

ip-based-login/ip-based-login.php 92% from 13 tests

The primary PHP file in "IP Based Login" version 2.3.10 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 298 characters long)

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 plugin3,335 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP69201,4013,335

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity366.00
▷ Minimum class complexity366.00
▷ Maximum class complexity366.00
Average method complexity6.29
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods69
▷ Static methods00.00%
▷ Public methods69100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions35
▷ Named functions35100.00%
▷ Anonymous functions00.00%
Constants29
▷ Global constants29100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin