10% admin-allow-by-ip

Code Review | Admin Allow by IP

WordPress plugin Admin Allow by IP scored10%from 54 tests.

About plugin

  • Plugin page: admin-allow-by-ip
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Aug 20, 2021
  • Latest release: Oct 19, 2023
  • Number of updates: 11
  • Update frequency: every 71.8 days
  • Top authors: apsaraaruna (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /489 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > 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: ▼0.87MB] [CPU: ▼31.32ms] Passed 4 tests

Server-side resources used by Admin Allow by IP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0936.90 ▼2.10
Dashboard /wp-admin3.08 ▼0.2324.24 ▼23.78
Posts /wp-admin/edit.php3.08 ▼0.2825.12 ▼19.22
Add New Post /wp-admin/post-new.php3.08 ▼2.8123.87 ▼66.68
Media Library /wp-admin/upload.php3.08 ▼0.1521.73 ▼15.58
Admin block /wp-admin/options-general.php?page=abbi_options3.0825.81

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, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
abbi_options_advanced_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Admin Allow by IP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,905 ▲11913.56 ▼1.087.25 ▲5.3942.16 ▼3.32
Dashboard /wp-admin2,203 ▲295.58 ▼0.0492.07 ▼2.5136.94 ▼6.44
Posts /wp-admin/edit.php2,111 ▲112.00 ▼0.0238.54 ▲0.6734.76 ▲0.35
Add New Post /wp-admin/post-new.php1,535 ▲923.10 ▼0.08653.56 ▲12.8865.57 ▲12.11
Media Library /wp-admin/upload.php1,405 ▲114.20 ▲0.0297.50 ▲0.4440.09 ▼2.77
Admin block /wp-admin/options-general.php?page=abbi_options8611.9922.0226.46

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • abbi_options_advanced_options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=abbi_options
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric 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 | 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
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/admin-allow-by-ip/public/partials/admin-allow-by-ip-public-display.php
    • > /wp-content/plugins/admin-allow-by-ip/admin/partials/admin-allow-by-ip-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Requires php: Invalid version format
The official readme.txt is a good inspiration

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

The primary PHP file in "Admin Allow by IP" version 1.0.2 is used by WordPress to initiate all plugin functionality
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 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin514 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP13258651460
Markdown120048
JavaScript24546
CSS2080

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
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
There were not PNG files found in your plugin