84% lock-login

Code Review | Lock Login

WordPress plugin Lock Login scored 84% from 54 tests.

About plugin

  • Plugin page: lock-login
  • Plugin version: 0.1.7
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 3, 2022
  • Latest release: Aug 4, 2023
  • Number of updates: 18
  • Update frequency: every 16.9 days
  • Top authors: aixeiger (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 697 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 gracefully, with no errors

Server metrics [RAM: ▲0.12MB] [CPU: ▼1.30ms] Passed 4 tests

This is a short check of server-side resources used by Lock Login
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1339.81 ▼3.60
Dashboard /wp-admin3.43 ▲0.1249.21 ▲2.56
Posts /wp-admin/edit.php3.54 ▲0.1844.67 ▼2.20
Add New Post /wp-admin/post-new.php6.01 ▲0.1292.89 ▲4.49
Media Library /wp-admin/upload.php3.35 ▲0.1236.07 ▼1.97
Lock Login /wp-admin/options-general.php?page=lock-login3.3132.51

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 48 new files
Database: 1 new table, 6 new options
New tables
wp_lock_registers_rec
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Lock Login
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.60 ▼0.751.98 ▲0.2142.67 ▼7.20
Dashboard /wp-admin2,207 ▲164.83 ▼1.06105.66 ▼0.4242.84 ▲4.22
Posts /wp-admin/edit.php2,093 ▲72.01 ▼0.0534.88 ▼4.1634.10 ▲0.56
Add New Post /wp-admin/post-new.php1,537 ▲322.85 ▼0.20589.43 ▼93.0848.64 ▲1.28
Media Library /wp-admin/upload.php1,392 ▲104.19 ▼0.0193.25 ▼2.8240.22 ▼1.96
Lock Login /wp-admin/options-general.php?page=lock-login7942.0224.6526.94

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

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)
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/lock-login/vendor/cbschuld/browser.php/tests/UCBrowserTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/lock-login/vendor/cbschuld/browser.php/tests/InternetExplorerTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/lock-login/vendor/cbschuld/browser.php/tests/FirefoxTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/lock-login/vendor/cbschuld/browser.php/tests/BraveTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/lock-login/vendor/cbschuld/browser.php/tests/OperaTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/lock-login/vendor/cbschuld/browser.php/tests/EdgeTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/lock-login/vendor/cbschuld/browser.php/tests/FirefoxMobileTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/lock-login/vendor/cbschuld/browser.php/tests/PalemoonTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/lock-login/vendor/cbschuld/browser.php/tests/CurlWgetTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/lock-login/vendor/cbschuld/browser.php/tests/ChromeTest.php:8

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: login failed, login, unlock, lock, security

lock-login/locklogin.php 92% from 13 tests

The main PHP file in "Lock Login" ver. 0.1.7 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("lock-login.php" instead of "locklogin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin2,828 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP273559682,534
Markdown3490183
JSON20096
XML1008
YAML1507

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity20.15
▷ Minimum class complexity1.00
▷ Maximum class complexity271.00
Average method complexity3.10
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes1155.00%
Methods183
▷ Static methods2111.48%
▷ Public methods10859.02%
▷ Protected methods6837.16%
▷ Private methods73.83%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants93
▷ Global constants22.15%
▷ Class constants9197.85%
▷ Public constants91100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected