84% only-registered-users

Code Review | Only Registered Users

WordPress plugin Only Registered Users scored84%from 54 tests.

About plugin

  • Plugin page: only-registered-u...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.9
  • WordPress version: 6.3.1
  • First release: Mar 4, 2022
  • Latest release: Mar 4, 2022
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: rezakhan995 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /290 total downloads

Benchmarks

Plugin footprint 83% from 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.04MB] [CPU: ▼7.43ms] Passed 4 tests

A check of server-side resources used by Only Registered Users
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0539.14 ▼6.14
Dashboard /wp-admin3.35 ▲0.0450.58 ▲1.80
Posts /wp-admin/edit.php3.46 ▲0.1049.54 ▼2.98
Add New Post /wp-admin/post-new.php5.93 ▲0.0486.90 ▼19.51
Media Library /wp-admin/upload.php3.27 ▲0.0437.29 ▼1.09
Only Registered Users /wp-admin/options-general.php?page=only-registered-users3.2532.74

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
ofrusers_activated
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Only Registered Users
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3714.35 ▼0.001.76 ▼0.4842.67 ▲0.75
Dashboard /wp-admin2,196 ▲215.50 ▼0.1588.45 ▼14.4238.01 ▼8.00
Posts /wp-admin/edit.php2,104 ▲72.03 ▲0.0436.16 ▼4.9132.02 ▼6.41
Add New Post /wp-admin/post-new.php1,529 ▲323.52 ▼0.33726.82 ▲55.3277.11 ▲25.25
Media Library /wp-admin/upload.php1,407 ▲74.30 ▲0.1298.45 ▼7.0746.31 ▼2.32
Only Registered Users /wp-admin/options-general.php?page=only-registered-users8711.9622.1132.19

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 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 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 take a closer look at the following
  • 3× 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/only-registered-users/core/bootstrap.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/only-registered-users/templates/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/only-registered-users/only-registered-users.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues 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
4 plugin tags: registered only, registration, restriction, registered user

only-registered-users/only-registered-users.php Passed 13 tests

Analyzing the main PHP file in "Only Registered Users" version 1.0.0
63 characters long description:
Redirects all non-logged in users to your website's login form.

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
No dangerous file extensions were detected261 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP483105220
CSS14041

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity12.00
▷ Minimum class complexity2.00
▷ Maximum class complexity22.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods22
▷ Static methods1254.55%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin