78% login-attempts-limit-wp

Code Review | LOGIN AND REGISTRATION ATTEMPTS LIMIT

WordPress plugin LOGIN AND REGISTRATION ATTEMPTS LIMIT scored 78% from 54 tests.

About plugin

  • Plugin page: login-attempts-li...
  • Plugin version: 2.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 5.9.2
  • First release: Apr 3, 2020
  • Latest release: Apr 3, 2020
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: krut1 (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

10+ active / 298 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼313.02ms] Passed 4 tests

Server-side resources used by LOGIN AND REGISTRATION ATTEMPTS LIMIT
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.5661.69 ▼65.82
Dashboard /wp-admin3.55 ▲0.1438.71 ▼4.27
Posts /wp-admin/edit.php3.77 ▲0.1445.08 ▲3.96
Add New Post /wp-admin/post-new.php7.01 ▲0.05102.31 ▼1,185.96
Media Library /wp-admin/upload.php3.43 ▲0.1333.83 ▲6.36

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 25 new files
Database: 3 new tables, 1 new option
New tables
wp_login_attempts_limit_wp_failed_login_attempts
wp_login_attempts_limit_wp_blog_registration_attempts
wp_login_attempts_limit_wp_user_registration_attempts
New WordPress options
login_attempts_limit_wp_options

Browser metrics Passed 4 tests

A check of browser resources used by LOGIN AND REGISTRATION ATTEMPTS LIMIT
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,802 ▲4815.60 ▼0.376.09 ▼0.292.37 ▼0.14
Dashboard /wp-admin2,896 ▲386.06 ▼0.09131.40 ▼12.62155.71 ▼13.54
Posts /wp-admin/edit.php2,711 ▲203.24 ▲0.0162.71 ▼6.56141.03 ▼7.59
Add New Post /wp-admin/post-new.php1,674 ▲816.11 ▼4.65397.23 ▼26.55157.55 ▼14.45
Media Library /wp-admin/upload.php1,712 ▲175.60 ▲0.09151.75 ▲11.57200.75 ▼11.95

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 1 option
    • login_attempts_limit_wp_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/login-attempts-limit-wp/templates/settings-page.php
    • > /wp-content/plugins/login-attempts-limit-wp/templates/settings-tabs/statistic.php
    • > /wp-content/plugins/login-attempts-limit-wp/templates/settings-tabs/options.php
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant KRUT1_LOGIN_ATTEMPTS_LIMIT_WP_PATH - assumed 'KRUT1_LOGIN_ATTEMPTS_LIMIT_WP_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/login-attempts-limit-wp/includes/Plugin.php on line 92
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/login-attempts-limit-wp/login-attempts-limit-wp.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Krut1LoginAttemptsLimitWp\\TableManager' not found in wp-content/plugins/login-attempts-limit-wp/includes/LoginManager.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Krut1LoginAttemptsLimitWp\\TableManager' not found in wp-content/plugins/login-attempts-limit-wp/includes/RegistrationUserManager.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Krut1LoginAttemptsLimitWp\\TableManager' not found in wp-content/plugins/login-attempts-limit-wp/includes/RegistrationBlogManager.php:10
    • > PHP Fatal error
      require_once(): Failed opening required 'KRUT1_LOGIN_ATTEMPTS_LIMIT_WP_PATHincludes/Autoloader.php' (include_path='.:/usr/share/php') in wp-content/plugins/login-attempts-limit-wp/includes/Plugin.php on line 92
    • > PHP Warning
      require_once(KRUT1_LOGIN_ATTEMPTS_LIMIT_WP_PATHincludes/Autoloader.php): failed to open stream: No such file or directory in wp-content/plugins/login-attempts-limit-wp/includes/Plugin.php on line 92

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Contributors: Contributors not specified
The official readme.txt might help

login-attempts-limit-wp/login-attempts-limit-wp.php Passed 13 tests

The main PHP script in "LOGIN AND REGISTRATION ATTEMPTS LIMIT" version 2.1 is automatically included on every request by WordPress
70 characters long description:
Protects your blog from password guessing and from auto registrations.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin912 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP17183340716
PO File28684184
CSS12012

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity4.92
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes13
▷ Abstract classes17.69%
▷ Concrete classes1292.31%
▷ Final classes00.00%
Methods42
▷ Static methods1638.10%
▷ Public methods3890.48%
▷ Protected methods00.00%
▷ Private methods49.52%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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 compressed PNG file occupies 0.01MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/avatar-author.png10.86KB11.24KB0.00%