94% user-period-register

Code Review | User Period Register

WordPress plugin User Period Register scored 94% from 54 tests.

About plugin

  • Plugin page: user-period-register
  • Plugin version: 1.07
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8
  • WordPress version: 5.9.2
  • First release: Jan 17, 2019
  • Latest release: Nov 6, 2021
  • Number of updates: 28
  • Update frequency: every 36.5 days
  • Top authors: Katsushi Kawamori (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 849 total downloads

Benchmarks

Plugin footprint Passed 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.01MB] [CPU: ▼311.00ms] Passed 4 tests

Analyzing server-side resources used by User Period Register
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0351.65 ▲0.16
Dashboard /wp-admin3.44 ▲0.0433.93 ▲1.71
Posts /wp-admin/edit.php3.67 ▲0.0345.84 ▲8.65
Add New Post /wp-admin/post-new.php6.91 ▼0.0690.39 ▼1,247.99
Media Library /wp-admin/upload.php3.32 ▲0.0325.53 ▲2.13
User Period Register /wp-admin/options-general.php?page=userperiodregister3.2922.54

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 1 new option
New WordPress options
userperiodregister

Browser metrics Passed 4 tests

Checking browser requirements for User Period Register
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,800 ▲5816.06 ▲0.365.92 ▼0.502.56 ▲0.37
Dashboard /wp-admin2,897 ▲366.10 ▼0.09117.44 ▼18.00156.24 ▼2.90
Posts /wp-admin/edit.php2,696 ▲23.23 ▼0.0163.17 ▼0.68133.44 ▼11.30
Add New Post /wp-admin/post-new.php1,671 ▲1018.07 ▲1.60413.01 ▲17.23153.95 ▼3.26
Media Library /wp-admin/upload.php1,703 ▲25.52 ▲0.02135.92 ▼0.45181.60 ▲0.30
User Period Register /wp-admin/options-general.php?page=userperiodregister1,2672.4955.47120.47

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 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 following issues need your attention
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/user-period-register/lib/class-userperiodregister.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-period-register/lib/class-userperiodregisteradmin.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-period-register/lib/class-userperiodregisterregist.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-period-register/lib/class-userperiodregisterregist.php:37

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: users, roles, register

user-period-register/userperiodregister.php 92% from 13 tests

The principal PHP file in "User Period Register" v. 1.07 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("user-period-register.php" instead of "userperiodregister.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin513 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP5115250513

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity25.67
▷ Minimum class complexity6.00
▷ Maximum class complexity44.00
Average method complexity3.96
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods2080.00%
▷ Protected methods00.00%
▷ Private methods520.00%
Functions0
▷ Named functions00.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
No PNG files were detected