10% admin-allow-by-ip

Code Review | Admin Allow by IP

WordPress plugin Admin Allow by IP scored 10% from 54 tests.

About plugin

  • Plugin page: admin-allow-by-ip
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 5.9.2
  • First release: Aug 20, 2021
  • Latest release: Sep 5, 2021
  • Number of updates: 8
  • Update frequency: every 2.0 days
  • Top authors: apsaraaruna (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 179 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/admin-allow-by-ip/includes/class-admin-allow-by-ip.php+173
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.15MB] [CPU: ▼329.51ms] Passed 4 tests

Analyzing server-side resources used by Admin Allow by IP
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.1667.11 ▲12.80
Dashboard /wp-admin3.18 ▼0.2322.09 ▼19.95
Posts /wp-admin/edit.php3.18 ▼0.4620.82 ▼31.76
Add New Post /wp-admin/post-new.php3.18 ▼3.7934.02 ▼1,261.43
Media Library /wp-admin/upload.php3.18 ▼0.1121.55 ▼4.88
Admin block /wp-admin/options-general.php?page=abbi_options3.1822.43

Server storage [IO: ▲0.06MB] [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: 24 new files
Database: no new tables, 1 new option
New WordPress options
abbi_options_advanced_options

Browser metrics Passed 4 tests

An overview of browser requirements for Admin Allow by IP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,899 ▲15516.26 ▲0.648.79 ▲2.972.76 ▲0.50
Dashboard /wp-admin2,884 ▲236.19 ▲0.03122.32 ▼7.92152.00 ▼1.54
Posts /wp-admin/edit.php2,697 ▲123.23 ▼0.0164.04 ▼1.26140.72 ▼12.01
Add New Post /wp-admin/post-new.php1,668 ▲215.71 ▼5.18395.93 ▼30.00162.71 ▲2.91
Media Library /wp-admin/upload.php1,702 ▲45.54 ▲0.01135.97 ▼8.87174.46 ▼16.06
Admin block /wp-admin/options-general.php?page=abbi_options1,0622.4153.19144.59

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5768
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • This plugin does not fully uninstall, leaving 1 option in the database
    • abbi_options_advanced_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=abbi_options
    • > User notice in wp-includes/functions.php+5768
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=abbi_options
    • > Notice in wp-content/plugins/admin-allow-by-ip/admin/class-admin-allow-by-ip-settings.php+304
    Undefined index: direction_option

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
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/admin-allow-by-ip/admin/partials/admin-allow-by-ip-admin-display.php
    • > /wp-content/plugins/admin-allow-by-ip/public/partials/admin-allow-by-ip-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Requires php: The plugin version is formatted incorrectly
The official readme.txt is a good inspiration

admin-allow-by-ip/admin-allow-by-ip.php Passed 13 tests

The main file in "Admin Allow by IP" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
107 characters long description:
Protect you wp-admin from hackers! You can allow wp-admin for specific IP(s). make sure you have static IP.

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
Good job! No executable or dangerous file extensions detected514 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP13258651460
Markdown120048
JavaScript24546
CSS2080

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity4.50
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity1.72
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods39
▷ Static methods25.13%
▷ Public methods3384.62%
▷ Protected methods00.00%
▷ Private methods615.38%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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 files were detected