90% ws-force-login-page

Code Review | WS Force Login Page

WordPress plugin WS Force Login Page scored90%from 54 tests.

About plugin

  • Plugin page: ws-force-login-page
  • Plugin version: 3.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.0.0
  • WordPress version: 6.3.1
  • First release: Apr 27, 2016
  • Latest release: Jun 8, 2022
  • Number of updates: 41
  • Update frequency: every 54.5 days
  • Top authors: silvermuru (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /11,933 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

Server-side resources used by WS Force Login Page
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0032.10 ▼3.92
Dashboard /wp-admin3.32 ▲0.0146.01 ▲0.42
Posts /wp-admin/edit.php3.37 ▲0.0147.02 ▲4.00
Add New Post /wp-admin/post-new.php5.90 ▲0.0192.61 ▲4.21
Media Library /wp-admin/upload.php3.24 ▲0.0135.16 ▼1.97
WS Force Login /wp-admin/options-general.php?page=ws-force-login-settings3.2128.44

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for WS Force Login Page
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.41 ▼1.251.86 ▲0.2637.69 ▼3.94
Dashboard /wp-admin2,210 ▲225.91 ▲0.02107.06 ▲0.5340.36 ▲1.41
Posts /wp-admin/edit.php2,096 ▲102.00 ▼0.0439.11 ▲2.8433.80 ▼1.09
Add New Post /wp-admin/post-new.php1,536 ▲2223.18 ▲5.75654.10 ▼41.7850.94 ▼0.64
Media Library /wp-admin/upload.php1,386 ▼54.19 ▲0.0396.60 ▼14.5840.01 ▼7.01
WS Force Login /wp-admin/options-general.php?page=ws-force-login-settings8232.0723.0927.45

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

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

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 17 tag instead of maximum 10
Please take inspiration from this readme.txt

ws-force-login-page/ws-force-login-page.php Passed 13 tests

The principal PHP file in "WS Force Login Page" v. 3.0.3 is loaded by WordPress automatically on each request
91 characters long description:
Redirecting user to login page if not logged in and when needed the custom message is shown

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected211 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP41710104
Markdown168070
PO File191137

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity6.00
▷ Minimum class complexity3.00
▷ Maximum class complexity9.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin