78% user-allowed-ip-addresses

Code Review | User Allowed IP Addresses

WordPress plugin User Allowed IP Addresses scored78%from 54 tests.

About plugin

  • Plugin page: user-allowed-ip-a...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.3.1
  • WordPress version: 6.3.1
  • First release: Nov 4, 2015
  • Latest release: Nov 6, 2015
  • Number of updates: 10
  • Update frequency: every 0.2 days
  • Top authors: mattpramschufer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,042 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼7.28ms] Passed 4 tests

An overview of server-side resources used by User Allowed IP Addresses
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0843.50 ▼2.96
Dashboard /wp-admin3.39 ▲0.0849.75 ▼2.40
Posts /wp-admin/edit.php3.50 ▲0.1450.18 ▼5.18
Add New Post /wp-admin/post-new.php5.97 ▲0.0888.79 ▼18.59
Media Library /wp-admin/upload.php3.31 ▲0.0840.01 ▲3.80
User Allowed IP Addresses /wp-admin/options-general.php?page=user-allowed-ip-addresses3.2834.54

Server storage [IO: ▲0.05MB] [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: 17 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

User Allowed IP Addresses: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.26 ▲0.021.61 ▼0.1443.33 ▼1.36
Dashboard /wp-admin2,190 ▲135.55 ▼0.1282.88 ▼10.0542.11 ▼1.31
Posts /wp-admin/edit.php2,104 ▲41.96 ▼0.0134.87 ▼3.6441.40 ▲5.77
Add New Post /wp-admin/post-new.php1,529 ▲422.99 ▼0.35678.90 ▲19.0758.91 ▲0.82
Media Library /wp-admin/upload.php1,404 ▲44.13 ▼0.11111.83 ▼6.1348.56 ▼0.79
User Allowed IP Addresses /wp-admin/options-general.php?page=user-allowed-ip-addresses9011.9922.8229.71

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

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
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=user-allowed-ip-addresses
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=user-allowed-ip-addresses
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/user-allowed-ip-addresses/admin/tpl/options.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
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 describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === user-allowed-ip-addresses === )
The official readme.txt is a good inspiration

user-allowed-ip-addresses/user-allowed-ip-addresses.php Passed 13 tests

"User Allowed IP Addresses" version 1.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
87 characters long description:
Gives the ability to restrict login access to specific IP addresses for specific users.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin342 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP11170428342

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity5.29
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity1.88
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods34
▷ Static methods25.88%
▷ Public methods2470.59%
▷ Protected methods514.71%
▷ Private methods514.71%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin