74% members-page-only-for-logged-in-users

Code Review | Members page only for logged in users

WordPress plugin Members page only for logged in users scored74%from 54 tests.

About plugin

  • Plugin page: members-page-only...
  • Plugin version: 1.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0-5.7.0
  • WordPress version: 6.3.1
  • First release: Mar 20, 2015
  • Latest release: Mar 30, 2021
  • Number of updates: 16
  • Update frequency: every 137.6 days
  • Top authors: narendrants (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active /13,519 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.92MB] [CPU: ▼35.37ms] Passed 4 tests

Server-side resources used by Members page only for logged in users
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0434.76 ▼12.77
Dashboard /wp-admin3.03 ▼0.2825.07 ▼27.40
Posts /wp-admin/edit.php3.03 ▼0.3325.30 ▼26.62
Add New Post /wp-admin/post-new.php3.03 ▼2.8622.27 ▼71.42
Media Library /wp-admin/upload.php3.03 ▼0.2019.96 ▼16.04

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Members page only for logged in users
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.34 ▼0.231.75 ▲0.0040.42 ▼4.88
Dashboard /wp-admin2,211 ▲315.62 ▼0.0696.45 ▲0.7442.74 ▲1.41
Posts /wp-admin/edit.php2,119 ▲192.02 ▲0.0336.51 ▲1.3432.38 ▼1.97
Add New Post /wp-admin/post-new.php1,539 ▲1123.12 ▼0.01672.34 ▲67.1056.71 ▼0.77
Media Library /wp-admin/upload.php1,419 ▲194.16 ▼0.0297.87 ▼15.3843.30 ▼7.81

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/members-page-only-for-logged-in-users/members_page_only_for_logged_in_users.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
You can take inspiration from this readme.txt

members-page-only-for-logged-in-users/members_page_only_for_logged_in_users.php 92% from 13 tests

The primary PHP file in "Members page only for logged in users" version 1.4.2 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("members-page-only-for-logged-in-users.php" instead of "members_page_only_for_logged_in_users.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected136 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13422136

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.75
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin