84% network-subsite-user-registration

Code Review | Network Subsite User Registration

WordPress plugin Network Subsite User Registration scored 84% from 54 tests.

About plugin

  • Plugin page: network-subsite-u...
  • Plugin version: 4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Mar 7, 2017
  • Latest release: Jul 27, 2023
  • Number of updates: 194
  • Update frequency: every 12.0 days
  • Top authors: JustinTicktock (100%)

Code review

54 tests

User reviews

51 reviews

Install metrics

100+ active / 33,939 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.18ms] Passed 4 tests

An overview of server-side resources used by Network Subsite User Registration
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.79 ▼11.12
Dashboard /wp-admin3.31 ▲0.0143.07 ▼4.38
Posts /wp-admin/edit.php3.36 ▲0.0146.10 ▼0.88
Add New Post /wp-admin/post-new.php5.89 ▲0.0197.53 ▲7.69
Media Library /wp-admin/upload.php3.24 ▲0.0134.45 ▲3.68

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 7 new options
New WordPress options
nsur_install_date
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Network Subsite User Registration
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6213.21 ▼1.171.66 ▼0.0641.29 ▲1.00
Dashboard /wp-admin2,217 ▲264.85 ▼0.04133.24 ▲25.8451.62 ▲14.65
Posts /wp-admin/edit.php2,097 ▲52.03 ▲0.0340.87 ▼0.0434.83 ▼2.00
Add New Post /wp-admin/post-new.php1,556 ▲4218.65 ▲1.19599.24 ▼72.1352.11 ▼5.32
Media Library /wp-admin/upload.php1,387 ▼14.16 ▲0.0396.35 ▼11.1446.49 ▼1.05

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
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • nsur_install_date
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 32× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-load.php' (include_path='.:/usr/share/php') in wp-content/plugins/network-subsite-user-registration/template/page-signup-wp5.php on line 12
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/network-subsite-user-registration/template/page-signup-wp53.php on line 12
    • > PHP Warning
      require_once(ABSPATHwp-load.php): failed to open stream: No such file or directory in wp-content/plugins/network-subsite-user-registration/template/page-signup-wp53.php on line 12
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-load.php' (include_path='.:/usr/share/php') in wp-content/plugins/network-subsite-user-registration/template/page-signup-wp47.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function nocache_headers() in wp-content/plugins/network-subsite-user-registration/template/page-signup-wp63.php:13
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-load.php' (include_path='.:/usr/share/php') in wp-content/plugins/network-subsite-user-registration/template/page-signup-wp496.php on line 12
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/network-subsite-user-registration/template/page-registration-notice-logged-in.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function nocache_headers() in wp-content/plugins/network-subsite-user-registration/template/page-signup-wp57.php:13
    • > PHP Warning
      require_once(ABSPATHwp-load.php): failed to open stream: No such file or directory in wp-content/plugins/network-subsite-user-registration/template/page-registration-notice-logged-out.php on line 8
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/network-subsite-user-registration/template/page-registration-notice-logged-out.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === network-subsite-user-registration === )
The official readme.txt is a good inspiration

network-subsite-user-registration/network-subsite-user-registration.php 92% from 13 tests

Analyzing the main PHP file in "Network Subsite User Registration" version 4.0
It is important to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin8,968 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP202,0435,3148,968

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity33.20
▷ Minimum class complexity3.00
▷ Maximum class complexity91.00
Average method complexity3.30
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods70
▷ Static methods22.86%
▷ Public methods6694.29%
▷ Protected methods00.00%
▷ Private methods45.71%
Functions230
▷ Named functions230100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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