94% prevent-concurrent-logins

Code Review | Prevent Concurrent Logins

WordPress plugin Prevent Concurrent Logins scored 94% from 54 tests.

About plugin

  • Plugin page: prevent-concurren...
  • Plugin version: 0.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.6
  • WordPress version: 5.8.1
  • First release: Dec 31, 2014
  • Latest release: Aug 17, 2016
  • Number of updates: 24
  • Update frequency: every 24.8 days
  • Top authors: fjarrett (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

1,000+ active / 12,922 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by Prevent Concurrent Logins
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1337.45 ▲16.36
Dashboard /wp-admin3.07 ▲0.0245.22 ▼1.61
Posts /wp-admin/edit.php3.12 ▲0.0246.56 ▲5.75
Add New Post /wp-admin/post-new.php5.43 ▲0.0092.58 ▼550.54
Media Library /wp-admin/upload.php3.01 ▲0.0132.26 ▼8.13

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Prevent Concurrent Logins
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8316.03 ▲0.3812.42 ▲3.3352.96 ▼0.14
Dashboard /wp-admin2,967 ▲336.09 ▲0.13150.47 ▼15.27111.91 ▲4.92
Posts /wp-admin/edit.php2,739 ▼02.73 ▲0.0062.97 ▼2.9488.05 ▼2.87
Add New Post /wp-admin/post-new.php1,500 ▲218.81 ▼0.05384.46 ▼15.81115.93 ▲8.16
Media Library /wp-admin/upload.php1,807 ▼185.03 ▲0.01152.63 ▲1.10117.82 ▼2.91

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% 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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/prevent-concurrent-logins/prevent-concurrent-logins.php:17

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)
No browser issues were found

Optimizations

Plugin configuration Passed 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
7 plugin tags: membership, security, login, sensei, woocommerce...

prevent-concurrent-logins/prevent-concurrent-logins.php Passed 13 tests

Analyzing the main PHP file in "Prevent Concurrent Logins" version 0.4.0
78 characters long description:
Prevents users from staying logged into the same account from multiple places.

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
Everything looks great! No dangerous files found in this plugin58 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1457458

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
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%
Functions5
▷ Named functions5100.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
There were not PNG files found in your plugin