10% authorize-ip-address

Code Review | Authorize IP Address

WordPress plugin Authorize IP Address scored 10% from 54 tests.

About plugin

  • Plugin page: authorize-ip-address
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.1
  • WordPress version: 6.3.1
  • First release: Oct 15, 2016
  • Latest release: Feb 2, 2017
  • Number of updates: 8
  • Update frequency: every 13.9 days
  • Top authors: jovevskitoni (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,114 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/authorize-ip-address/authorize-ip-address.php+74
    Trying to access array offset on value of type null

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.84ms] Passed 4 tests

Server-side resources used by Authorize IP Address
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0741.15 ▼4.19
Dashboard /wp-admin3.37 ▲0.0747.07 ▼6.02
Posts /wp-admin/edit.php3.42 ▲0.0646.62 ▲1.33
Add New Post /wp-admin/post-new.php5.95 ▲0.0684.35 ▼12.96
Media Library /wp-admin/upload.php3.29 ▲0.0635.39 ▼0.18
Authorize IP Address /wp-admin/options-general.php?page=authorizeipaddress3.2630.81

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
authorizeipaddress
db_upgraded
widget_recent-posts
widget_recent-comments
authorizeipaddress_ip_whitelist
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Authorize IP Address
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.25 ▼1.134.40 ▲2.3346.86 ▲2.35
Dashboard /wp-admin2,210 ▲225.88 ▼0.0295.02 ▼29.3639.72 ▼4.50
Posts /wp-admin/edit.php2,090 ▲11.99 ▼0.0034.69 ▼3.4837.38 ▲4.86
Add New Post /wp-admin/post-new.php1,535 ▲1323.37 ▲0.23689.34 ▲26.2256.60 ▼0.99
Media Library /wp-admin/upload.php1,389 ▲44.17 ▲0.01110.57 ▼0.5650.73 ▲1.99
Authorize IP Address /wp-admin/options-general.php?page=authorizeipaddress9722.0822.5727.38

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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 trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function home_url() in wp-content/plugins/authorize-ip-address/authorize-ip-address.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/authorize-ip-address/wpaip-options-page.php:24

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed: You can take inspiration from this readme.txt

authorize-ip-address/authorize-ip-address.php Passed 13 tests

Analyzing the main PHP file in "Authorize IP Address" version 1.0.1
140 characters long description:
Allows users to setup IP whitelists for logging in and sends them an email with an activation key if the IP address is not on the whitelist.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected373 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP412354373

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin