10% login-protection

Code Review | Login Protection

WordPress plugin Login Protection scored10%from 54 tests.

About plugin

  • Plugin page: login-protection
  • Plugin version: 0.2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5
  • WordPress version: 6.3.1
  • First release: Apr 24, 2014
  • Latest release: Apr 26, 2014
  • Number of updates: 9
  • Update frequency: every 0.2 days
  • Top authors: couhie (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,237 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

Server metrics [RAM: ▲0.13MB] [CPU: ▼1.95ms] Passed 4 tests

A check of server-side resources used by Login Protection
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0442.80 ▼2.57
Dashboard /wp-admin3.47 ▲0.1655.18 ▲4.83
Posts /wp-admin/edit.php3.58 ▲0.2251.86 ▲1.83
Add New Post /wp-admin/post-new.php6.05 ▲0.1691.04 ▼11.25
Media Library /wp-admin/upload.php3.39 ▲0.1643.43 ▲4.21
Login Protection /wp-admin/options-general.php?page=login-protection3.3431.76

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: 1 new table, 7 new options
New tables
wp_login_protection_auth_fail
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
login-protection-options
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Login Protection
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.36 ▲0.001.83 ▼0.0143.74 ▼0.97
Dashboard /wp-admin2,210 ▲335.64 ▼0.0386.56 ▼13.8240.12 ▼5.72
Posts /wp-admin/edit.php2,118 ▲152.15 ▲0.1736.37 ▼7.1536.37 ▼7.95
Add New Post /wp-admin/post-new.php1,540 ▲1423.34 ▲0.20704.01 ▲49.3556.59 ▲2.88
Media Library /wp-admin/upload.php1,412 ▲154.11 ▼0.05103.29 ▼5.6146.62 ▼1.54
Login Protection /wp-admin/options-general.php?page=login-protection8942.1423.6234.96

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=login-protection
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=login-protection
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=login-protection
    • > Notice in wp-content/plugins/login-protection/admin.php+307
    Undefined index: block_login_ips

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 fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'LoginProtection' not found in wp-content/plugins/login-protection/admin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_blog_prefix() on null in wp-content/plugins/login-protection/login-protection.php:84

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% 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 need to be fixed:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
You can take inspiration from this readme.txt

login-protection/login-protection.php Passed 13 tests

"Login Protection" version 0.2.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
117 characters long description:
This plugin make improve the security of the administration page by taking advantage of such as basic authentication.

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 detected860 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP214211760
PO File13537100

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity57.50
▷ Minimum class complexity41.00
▷ Maximum class complexity74.00
Average method complexity3.40
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods47
▷ Static methods00.00%
▷ Public methods1429.79%
▷ Protected methods1429.79%
▷ Private methods1940.43%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin