73% wp-limit-failed-login-attempts

Code Review | Limit Login Attempts (Spam Protection)

WordPress plugin Limit Login Attempts (Spam Protection) scored73%from 54 tests.

About plugin

  • Plugin page: wp-limit-failed-l...
  • Plugin version: 5.3
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Feb 20, 2020
  • Latest release: Sep 12, 2023
  • Number of updates: 76
  • Update frequency: every 17.1 days
  • Top authors: osamaesh (75%)codepressplugins (23.68%)wp-buy (3.95%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active /9,794 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.59MB] [CPU: ▲0.09ms] Passed 4 tests

This is a short check of server-side resources used by Limit Login Attempts (Spam Protection)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.05 ▲0.5941.17 ▲0.41
Dashboard /wp-admin3.94 ▲0.6452.84 ▼1.18
Posts /wp-admin/edit.php3.99 ▲0.6349.68 ▲8.48
Add New Post /wp-admin/post-new.php6.45 ▲0.5794.80 ▼6.45
Media Library /wp-admin/upload.php3.80 ▲0.5738.81 ▲7.60
Block countries /wp-admin/admin.php?page=WPLFLACOUNTRIES3.7731.85
Options /wp-admin/admin.php?page=WPLFLASettings3.7735.20
Settings /wp-admin/admin.php?page=WPLFLARANGEIP3.7732.04
Statistics /wp-admin/admin.php?page=WPLFLA3.7734.80
Attempts log /wp-admin/admin.php?page=WPLFLALOG3.7730.06
Lockout Log /wp-admin/admin.php?page=logblockip3.7732.01

Server storage [IO: ▲1.14MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 287 new files
Database: 4 new tables, 8 new options
New tables
wp_WPLFLA_log_block_ip
wp_WPLFLA_block_ip_range
wp_WPLFLA_block_countries
wp_WPLFLA_login_failed
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
WPLFLA_options
WPLFLA_version

Browser metrics Passed 4 tests

Checking browser requirements for Limit Login Attempts (Spam Protection)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,005 ▲25913.23 ▼1.521.75 ▲0.0844.05 ▲0.25
Dashboard /wp-admin2,411 ▲2264.87 ▼0.01113.65 ▲10.3245.51 ▲9.47
Posts /wp-admin/edit.php2,117 ▲282.00 ▼0.0338.76 ▼4.4533.86 ▼0.18
Add New Post /wp-admin/post-new.php1,539 ▲1117.50 ▼0.57697.93 ▲91.1555.16 ▼11.87
Media Library /wp-admin/upload.php1,413 ▲314.16 ▲0.0394.85 ▼11.7041.36 ▼4.98
Block countries /wp-admin/admin.php?page=WPLFLACOUNTRIES8412.1530.1124.24
Options /wp-admin/admin.php?page=WPLFLASettings1,0052.1631.5834.25
Settings /wp-admin/admin.php?page=WPLFLARANGEIP1,5313.6397.1846.08
Statistics /wp-admin/admin.php?page=WPLFLA9432.3031.4828.82
Attempts log /wp-admin/admin.php?page=WPLFLALOG1,2283.2868.1628.29
Lockout Log /wp-admin/admin.php?page=logblockip1,2563.3269.1831.90

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 4 tables in the database
    • wp_WPLFLA_log_block_ip
    • wp_WPLFLA_login_failed
    • wp_WPLFLA_block_countries
    • wp_WPLFLA_block_ip_range
  • The uninstall procedure has failed, leaving 8 options in the database
    • theysaidso_admin_options
    • WPLFLA_version
    • can_compress_scripts
    • db_upgraded
    • WPLFLA_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-limit-failed-login-attempts/failed.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-limit-failed-login-attempts/admin/dashboard_widget.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-limit-failed-login-attempts/admin/range_ip.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-limit-failed-login-attempts/admin/log.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-limit-failed-login-attempts/admin/logblockip.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-limit-failed-login-attempts/admin/statistics.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-limit-failed-login-attempts/admin/setting.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-limit-failed-login-attempts/login.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-limit-failed-login-attempts/admin/countries.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention: Please take inspiration from this readme.txt

wp-limit-failed-login-attempts/failed.php 77% from 13 tests

Analyzing the main PHP file in "Limit Login Attempts (Spam Protection)" version 5.3
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-limit-failed-login-attempts.php" instead of "failed.php")
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

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
No dangerous file extensions were detected5,876 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript43496133,119
PHP10390492,264
CSS58311493

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity20.67
▷ Minimum class complexity3.00
▷ Maximum class complexity69.00
Average method complexity3.13
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods83
▷ Static methods11.20%
▷ Public methods8298.80%
▷ Protected methods00.00%
▷ Private methods11.20%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
261 compressed PNG files occupy 0.36MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/flags/cr.png1.63KB1.61KB▼ 0.84%
assets/images/flags/sr.png1.60KB1.59KB▼ 0.55%
assets/images/flags/na.png1.67KB1.65KB▼ 1.34%
assets/images/flags/gi.png1.38KB1.36KB▼ 0.99%
assets/images/flags/am.png1.31KB1.30KB▼ 0.82%