84% restrict-new-users-by-domain

Code Review | Restrict New Users by Domain

WordPress plugin Restrict New Users by Domain scored84%from 54 tests.

About plugin

  • Plugin page: restrict-new-user...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 6.3.1
  • First release: Jan 29, 2017
  • Latest release: Apr 29, 2017
  • Number of updates: 4
  • Update frequency: every 21.7 days
  • Top authors: exportsmedia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /2,630 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
The plugin installed gracefully, with no errors

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

Server-side resources used by Restrict New Users by Domain
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.54 ▼6.27
Dashboard /wp-admin3.35 ▲0.0549.71 ▼2.44
Posts /wp-admin/edit.php3.46 ▲0.1150.94 ▲2.09
Add New Post /wp-admin/post-new.php5.93 ▲0.0494.10 ▼5.68
Media Library /wp-admin/upload.php3.27 ▲0.0436.70 ▼1.19
Restrict New Users by Domain /wp-admin/options-general.php?page=rnud-settings3.2133.04

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Restrict New Users by Domain
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.27 ▼1.172.12 ▲0.1641.81 ▼1.70
Dashboard /wp-admin2,210 ▲254.87 ▼0.06109.21 ▲0.7840.96 ▼0.16
Posts /wp-admin/edit.php2,093 ▲41.98 ▼0.0141.64 ▲0.7735.74 ▼1.12
Add New Post /wp-admin/post-new.php1,522 ▼223.34 ▲0.29597.74 ▼102.3963.96 ▲6.98
Media Library /wp-admin/upload.php1,386 ▼24.20 ▲0.02102.85 ▼1.8543.58 ▼4.16
Restrict New Users by Domain /wp-admin/options-general.php?page=rnud-settings8492.0223.0026.76

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=rnud-settings
    • > Notice in wp-content/plugins/restrict-new-users-by-domain/class-admin.php+115
    Trying to access array offset on value of type bool

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: restrict, restrict email, sign up, new users, restrict domain

restrict-new-users-by-domain/restrict-new-users-by-domain.php Passed 13 tests

Analyzing the main PHP file in "Restrict New Users by Domain" version 1.0.2
58 characters long description:
Restrict allowed email domains for new user registrations.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected147 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP313078147

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity5.67
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.93
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
2 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.PNG51.99KB25.37KB▼ 51.19%
assets/screenshot-2.PNG22.99KB11.61KB▼ 49.52%