84% limit-max-ips-per-user

Code Review | Limit Max IPs Per User

WordPress plugin Limit Max IPs Per User scored84%from 54 tests.

About plugin

  • Plugin page: limit-max-ips-per...
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.0
  • WordPress version: 6.3.1
  • First release: Mar 22, 2017
  • Latest release: Oct 22, 2022
  • Number of updates: 14
  • Update frequency: every 145.7 days
  • Top authors: ralxz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,895 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
Installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▲1.92ms] Passed 4 tests

A check of server-side resources used by Limit Max IPs Per User
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1449.78 ▲8.88
Dashboard /wp-admin3.51 ▲0.1673.14 ▲9.48
Posts /wp-admin/edit.php3.54 ▲0.1850.31 ▲3.80
Add New Post /wp-admin/post-new.php6.01 ▲0.1296.38 ▼7.02
Media Library /wp-admin/upload.php3.35 ▲0.1236.66 ▲2.01
Limit Max IPs Per User /wp-admin/options-general.php?page=limit_max_ips_per_user3.3333.82

Server storage [IO: ▲0.14MB] [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: 1 new table, 9 new options
New tables
wp_limit_max_ips_per_user
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
limit_max_ips_per_user_max_ips
limit_max_ips_per_user_db_ver
db_upgraded
widget_recent-posts
widget_recent-comments
limit_max_ips_per_user_number_of_days
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Limit Max IPs Per User
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.24 ▼1.051.97 ▲0.1842.18 ▼1.79
Dashboard /wp-admin2,210 ▲225.83 ▼0.0399.50 ▼1.1438.87 ▼2.55
Posts /wp-admin/edit.php2,093 ▲72.01 ▼0.0340.12 ▲3.1434.45 ▼8.92
Add New Post /wp-admin/post-new.php1,545 ▲3118.43 ▲0.91608.46 ▼102.4952.04 ▼14.90
Media Library /wp-admin/upload.php1,386 ▼24.21 ▲0.0295.29 ▼18.8141.61 ▼5.94
Limit Max IPs Per User /wp-admin/options-general.php?page=limit_max_ips_per_user1,0572.5342.9337.77

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/limit-max-ips-per-user/limit-max-ips-per-user.php:45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/limit-max-ips-per-user/includes/pages/settings/settings.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/limit-max-ips-per-user/includes/pages/user-edit/user-edit.php:8

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: membership, user, restrict, security, max...

limit-max-ips-per-user/limit-max-ips-per-user.php Passed 13 tests

The primary PHP file in "Limit Max IPs Per User" version 1.5 is used by WordPress to initiate all plugin functionality
60 characters long description:
Limit the maximum number of IPs that a user can log in with.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin758 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP3163100543
JavaScript304187
CSS35028

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity60.00
▷ Minimum class complexity60.00
▷ Maximum class complexity60.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods41
▷ Static methods49.76%
▷ Public methods41100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
5 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/jquery.dataTables/images/sort_asc.png0.16KB0.25KB0.00%
includes/jquery.dataTables/images/sort_both.png0.20KB0.29KB0.00%
includes/jquery.dataTables/images/sort_desc.png0.15KB0.25KB0.00%
includes/jquery.dataTables/images/sort_desc_disabled.png0.14KB0.25KB0.00%
includes/jquery.dataTables/images/sort_asc_disabled.png0.14KB0.25KB0.00%