78% swiftninjapro-wp-login-whitelist-ip

Code Review | WP-Login and WP-Admin Whitelist

WordPress plugin WP-Login and WP-Admin Whitelist scored 78% from 54 tests.

About plugin

  • Plugin page: swiftninjapro-wp-...
  • Plugin version: 1.11.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.5
  • WordPress version: 6.3.1
  • First release: Mar 1, 2019
  • Latest release: Nov 4, 2020
  • Number of updates: 77
  • Update frequency: every 8.0 days
  • Top authors: swiftninjapro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,885 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼2.76ms] Passed 4 tests

This is a short check of server-side resources used by WP-Login and WP-Admin Whitelist
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0343.44 ▲2.07
Dashboard /wp-admin3.34 ▲0.0445.67 ▼2.15
Posts /wp-admin/edit.php3.45 ▲0.1044.00 ▼1.70
Add New Post /wp-admin/post-new.php5.92 ▲0.0482.39 ▼6.24
Media Library /wp-admin/upload.php3.26 ▲0.0433.86 ▼0.96
WP-Login Whitelist /wp-admin/admin.php?page=swiftninjapro-wp-login-whitelist-ip3.3533.03
SwiftNinjaPro Settings /wp-admin/admin.php?page=swiftninjapro-settings3.2329.29

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
SwiftNinjaProWhitelistLoginIP_RecoveryGUID
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

WP-Login and WP-Admin Whitelist: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲6913.29 ▼1.081.93 ▼0.2744.27 ▼8.20
Dashboard /wp-admin2,235 ▲475.84 ▲0.9595.23 ▼20.4363.30 ▲17.51
Posts /wp-admin/edit.php2,112 ▲232.00 ▼0.0433.84 ▼1.3431.41 ▼0.03
Add New Post /wp-admin/post-new.php1,536 ▲1721.70 ▼1.40699.25 ▲32.3548.14 ▼7.58
Media Library /wp-admin/upload.php1,417 ▲294.22 ▼0.1095.93 ▼7.8278.73 ▲34.00
WP-Login Whitelist /wp-admin/admin.php?page=swiftninjapro-wp-login-whitelist-ip1,0052.0527.0447.71
SwiftNinjaPro Settings /wp-admin/admin.php?page=swiftninjapro-settings7842.0625.3626.12

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=swiftninjapro-wp-login-whitelist-ip
    • > Warning in wp-content/plugins/swiftninjapro-wp-login-whitelist-ip/templates/admin.php+109
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)
    • > GET request to /wp-admin/admin.php?page=swiftninjapro-wp-login-whitelist-ip
    • > Warning in wp-content/plugins/swiftninjapro-wp-login-whitelist-ip/templates/admin.php+296
    Use of undefined constant SwiftNinjaProSettingBrowserDetectSelectName - assumed 'SwiftNinjaProSettingBrowserDetectSelectName' (this will throw an Error in a future version of PHP)

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 7× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/swiftninjapro-wp-login-whitelist-ip/swiftninjapro-wp-login-whitelist-ip.php
    • > /wp-content/plugins/swiftninjapro-wp-login-whitelist-ip/templates/settings-info.php
    • > /wp-content/plugins/swiftninjapro-wp-login-whitelist-ip/templates/admin.php
    • > /wp-content/plugins/swiftninjapro-wp-login-whitelist-ip/main.php
    • > /wp-content/plugins/swiftninjapro-wp-login-whitelist-ip/templates/recovery.php
    • > /wp-content/plugins/swiftninjapro-wp-login-whitelist-ip/whitelist.php
    • > /wp-content/plugins/swiftninjapro-wp-login-whitelist-ip/functions.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 96% from 29 tests

readme.txt Passed 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
8 plugin tags: whitelist, ip, login, wp-login, browser...

swiftninjapro-wp-login-whitelist-ip/swiftninjapro-wp-login-whitelist-ip.php 92% from 13 tests

"WP-Login and WP-Admin Whitelist" version 1.11.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 181 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin1,076 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP8232521,076

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity35.00
▷ Minimum class complexity11.00
▷ Maximum class complexity64.00
Average method complexity5.25
▷ Minimum method complexity1.00
▷ Maximum method complexity49.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods32
▷ Static methods00.00%
▷ Public methods3196.88%
▷ Protected methods00.00%
▷ Private methods13.12%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/settings_icon.png3.27KB1.85KB▼ 43.48%