84% login-restrict

Code Review | Login Restrict

WordPress plugin Login Restrict scored84%from 54 tests.

About plugin

  • Plugin page: login-restrict
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.2
  • WordPress version: 6.3.1
  • First release: Jul 27, 2019
  • Latest release: Jul 27, 2019
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: skydev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,595 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▲0.25ms] Passed 4 tests

Analyzing server-side resources used by Login Restrict
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0343.20 ▲1.22
Dashboard /wp-admin3.32 ▲0.0252.63 ▼1.12
Posts /wp-admin/edit.php3.37 ▲0.0152.70 ▲0.96
Add New Post /wp-admin/post-new.php5.90 ▲0.0195.56 ▼0.06
Media Library /wp-admin/upload.php3.24 ▲0.0146.07 ▲9.36
Login Restrict /wp-admin/options-general.php?page=login-lmt-attempts3.2136.06

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Login Restrict
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.57 ▲0.391.81 ▼0.1644.84 ▼4.61
Dashboard /wp-admin2,199 ▲195.61 ▼0.0589.63 ▼2.2640.19 ▼2.52
Posts /wp-admin/edit.php2,107 ▲71.99 ▼0.0335.87 ▼3.2336.52 ▼3.63
Add New Post /wp-admin/post-new.php1,529 ▼223.57 ▲0.94684.61 ▲12.7154.59 ▼0.36
Media Library /wp-admin/upload.php1,404 ▲44.20 ▲0.0899.71 ▼25.4048.23 ▲0.31
Login Restrict /wp-admin/options-general.php?page=login-lmt-attempts9112.0224.1028.38

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant LMT_LOGIN_DIR_ADD - assumed 'LMT_LOGIN_DIR_ADD' (this will throw an Error in a future version of PHP) in wp-content/plugins/login-restrict/variables.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/login-restrict/login-restrict.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: login, security, authentication

login-restrict/login-restrict.php 92% from 13 tests

The main file in "Login Restrict" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected690 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP4205221690

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions34
▷ Named functions34100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
There are no PNG files in this plugin