73% login-tracker-logs

Code Review | Login IP Restrictor

WordPress plugin Login IP Restrictor scored73%from 54 tests.

About plugin

  • Plugin page: login-tracker-logs
  • Plugin version: 2.27
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2
  • WordPress version: 6.3.1
  • First release: Sep 18, 2014
  • Latest release: Jul 27, 2016
  • Number of updates: 96
  • Update frequency: every 10.3 days
  • Top authors: selnomeria (79.17%)tazotodua (21.88%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,859 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▲0.30ms] Passed 4 tests

A check of server-side resources used by Login IP Restrictor
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1542.81 ▲0.76
Dashboard /wp-admin3.44 ▲0.1450.35 ▲0.71
Posts /wp-admin/edit.php3.56 ▲0.2052.67 ▼6.16
Add New Post /wp-admin/post-new.php6.02 ▲0.14103.87 ▲5.88
Media Library /wp-admin/upload.php3.37 ▲0.1444.75 ▲8.07
LOGIN Restrictor /wp-admin/options-general.php?page=lgs-submenu-page3.3333.98

Server storage [IO: ▲7.70MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Please try to fix the following items
  • You have illegally modified 2 files (0.99KB) outside of "wp-content/plugins/login-tracker-logs/" and "wp-content/uploads/"
    • (new file) wp-content/ALLOWED_IP/wp_com/.htaccess
    • (new file) wp-content/ALLOWED_IP/wp_com/ALLOWED_IPs_FOR_WP_LOGIN.txt
Filesystem: 42 new files
Database: 1 new table, 7 new options
New tables
wp_restrictor_logins
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
optLRL__arrays

Browser metrics Passed 4 tests

This is an overview of browser requirements for Login IP Restrictor
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6413.21 ▼1.384.68 ▲2.6840.29 ▼4.97
Dashboard /wp-admin2,207 ▲195.96 ▲0.06102.89 ▼4.1340.40 ▼0.09
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0235.75 ▼14.4636.99 ▼10.95
Add New Post /wp-admin/post-new.php1,535 ▲1623.41 ▲0.21666.84 ▲10.3955.84 ▼8.37
Media Library /wp-admin/upload.php1,392 ▲44.35 ▲0.1396.90 ▼18.6842.73 ▼11.07
LOGIN Restrictor /wp-admin/options-general.php?page=lgs-submenu-page1,1831.6923.4043.68

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
  • Zombie tables were found after uninstall: 1 table
    • wp_restrictor_logins
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • optLRL__arrays
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means 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
Please take a closer look at the following
  • 27× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GeoIp2\\ProviderInterface' not found in wp-content/plugins/login-tracker-logs/ip_country_data/GeoIP_V2/GeoIp2/Database/Reader.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\AbstractModel' not found in wp-content/plugins/login-tracker-logs/ip_country_data/GeoIP_V2/GeoIp2/Model/ConnectionType.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\City' not found in wp-content/plugins/login-tracker-logs/ip_country_data/GeoIP_V2/GeoIp2/Model/Enterprise.php:54
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\AbstractModel' not found in wp-content/plugins/login-tracker-logs/ip_country_data/GeoIP_V2/GeoIp2/Model/AnonymousIp.php:27
    • > PHP Fatal error
      Uncaught Error: Interface 'GeoIp2\\Compat\\JsonSerializable' not found in wp-content/plugins/login-tracker-logs/ip_country_data/GeoIP_V2/GeoIp2/Record/AbstractRecord.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\AbstractModel' not found in wp-content/plugins/login-tracker-logs/ip_country_data/GeoIP_V2/GeoIp2/Model/Domain.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Exception\\HttpException' not found in wp-content/plugins/login-tracker-logs/ip_country_data/GeoIP_V2/GeoIp2/Exception/InvalidRequestException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\AbstractModel' not found in wp-content/plugins/login-tracker-logs/ip_country_data/GeoIP_V2/GeoIp2/Model/Country.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Record\\Country' not found in wp-content/plugins/login-tracker-logs/ip_country_data/GeoIP_V2/GeoIp2/Record/RepresentedCountry.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Record\\AbstractPlaceRecord' not found in wp-content/plugins/login-tracker-logs/ip_country_data/GeoIP_V2/GeoIp2/Record/Subdivision.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
8 plugin tags: logins, attempts, track, restrict, disable...

login-tracker-logs/index.php 85% from 13 tests

The primary PHP file in "Login IP Restrictor" version 2.27 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("login-tracker-logs.php" instead of "index.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 170 characters long)

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
Good job! No executable or dangerous file extensions detected1,552 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP373691,1121,552

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity6.62
▷ Minimum class complexity1.00
▷ Maximum class complexity117.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces9
Interfaces3
Traits0
Classes34
▷ Abstract classes38.82%
▷ Concrete classes3191.18%
▷ Final classes00.00%
Methods111
▷ Static methods10.90%
▷ Public methods7567.57%
▷ Protected methods43.60%
▷ Private methods3228.83%
Functions5
▷ Named functions120.00%
▷ Anonymous functions480.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected