94% wp-logged-in-only

Code Review | Logged-in-only

WordPress plugin Logged-in-only scored 94% from 54 tests.

About plugin

  • Plugin page: wp-logged-in-only
  • Plugin version: 2.1.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.3
  • WordPress version: 5.8.1
  • First release: Feb 17, 2014
  • Latest release: Nov 6, 2019
  • Number of updates: 22
  • Update frequency: every 95.0 days
  • Top authors: Drivingralle (72.73%)janreim (31.82%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active / 14,482 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼149.52ms] Passed 4 tests

Server-side resources used by Logged-in-only
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0058.02 ▲18.16
Dashboard /wp-admin3.06 ▲0.0146.33 ▼3.22
Posts /wp-admin/edit.php3.11 ▲0.0147.49 ▼11.17
Add New Post /wp-admin/post-new.php5.42 ▼0.0190.36 ▼575.39
Media Library /wp-admin/upload.php3.01 ▲0.0031.68 ▼8.28

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Logged-in-only
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲10715.96 ▲0.409.91 ▲0.7376.83 ▲23.49
Dashboard /wp-admin2,967 ▲365.94 ▼0.03136.55 ▼25.18103.63 ▼29.52
Posts /wp-admin/edit.php2,736 ▼32.71 ▼0.0066.30 ▼9.5593.41 ▼14.92
Add New Post /wp-admin/post-new.php1,672 ▲9118.84 ▼1.55360.65 ▼55.06110.45 ▼9.34
Media Library /wp-admin/upload.php1,807 ▼05.03 ▲0.02149.21 ▼15.70119.48 ▼19.65

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 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-logged-in-only/loggedinonly.php:20

User-side errors Passed 1 test

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


Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
8 plugin tags: simple, password, protect, redirect, rest api...

wp-logged-in-only/loggedinonly.php 85% from 13 tests

"Logged-in-only" version 2.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-logged-in-only.php" instead of "loggedinonly.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 159 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin21 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
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
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions3100.00%
▷ Anonymous functions00.00%
▷ 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
There are no PNG files in this plugin