84% restrict-user-registration

Code Review | Restrict User Registration

WordPress plugin Restrict User Registration scored84%from 54 tests.

About plugin

  • Plugin page: restrict-user-reg...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4.1
  • WordPress version: 6.3.1
  • First release: Feb 2, 2016
  • Latest release: Feb 2, 2016
  • Number of updates: 9
  • Update frequency: N/A
  • Top authors: elhardoum (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /2,831 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.28ms] Passed 4 tests

This is a short check of server-side resources used by Restrict User Registration
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0451.50 ▲0.21
Dashboard /wp-admin3.34 ▲0.0458.77 ▼5.73
Posts /wp-admin/edit.php3.40 ▲0.0456.61 ▼4.21
Add New Post /wp-admin/post-new.php5.94 ▲0.06105.54 ▲1.49
Media Library /wp-admin/upload.php3.27 ▲0.0442.03 ▼3.37
Restrict Registration /wp-admin/users.php?page=rur3.2440.57

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Restrict User Registration
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲3614.38 ▼0.001.98 ▲0.0943.28 ▼2.07
Dashboard /wp-admin2,203 ▲265.55 ▼0.0587.29 ▼6.7245.06 ▼1.04
Posts /wp-admin/edit.php2,108 ▲52.01 ▲0.0436.11 ▼2.3837.37 ▼0.60
Add New Post /wp-admin/post-new.php1,371 ▼15717.18 ▼5.91593.42 ▼59.0848.18 ▼9.57
Media Library /wp-admin/upload.php1,408 ▲84.21 ▲0.03105.33 ▲11.5951.07 ▲8.86
Restrict Registration /wp-admin/users.php?page=rur1,0561.9925.3044.61

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

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
Good news, no errors were detected

SRP 50% from 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
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/restrict-user-registration/sidebar.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: users, spam, anti spam, email, registration...

restrict-user-registration/index.php 92% from 13 tests

The main PHP script in "Restrict User Registration" version 1.0.1 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("restrict-user-registration.php" instead of "index.php")

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
There were no executable files found in this plugin343 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2879170
JavaScript184110
CSS12463

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity3.40
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods114.29%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected