83% time-limit-for-users

Code Review | Time Limit

WordPress plugin Time Limit scored 83% from 54 tests.

About plugin

  • Plugin page: time-limit-for-users
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-3.8.1
  • WordPress version: 6.3.1
  • First release: Jun 4, 2020
  • Latest release: Jun 5, 2020
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: hazbert (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 461 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

An overview of server-side resources used by Time Limit
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0536.31 ▼5.16
Dashboard /wp-admin3.35 ▲0.0444.08 ▼10.05
Posts /wp-admin/edit.php3.40 ▲0.0447.35 ▼2.35
Add New Post /wp-admin/post-new.php5.93 ▲0.0493.41 ▼4.23
Media Library /wp-admin/upload.php3.27 ▲0.0437.20 ▲5.61
Limited Account /wp-admin/users.php?page=limited_account3.3130.63

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

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

Browser metrics Passed 4 tests

Time Limit: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9414.48 ▲0.101.97 ▲0.3040.69 ▼7.01
Dashboard /wp-admin2,210 ▲254.84 ▼0.05107.51 ▼10.0441.60 ▼3.14
Posts /wp-admin/edit.php2,096 ▲42.06 ▲0.0540.12 ▼1.7435.91 ▼4.12
Add New Post /wp-admin/post-new.php1,545 ▲318.33 ▲0.11602.10 ▼38.7258.01 ▲6.52
Media Library /wp-admin/upload.php1,395 ▲44.21 ▼0.0399.08 ▲1.0745.23 ▲0.41
Limited Account /wp-admin/users.php?page=limited_account8262.0226.6428.74

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/time-limit-for-users/uninstall.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/time-limit-for-users/options.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/time-limit-for-users/loggedin.php:59
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/time-limit-for-users/login.php:51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/time-limit-for-users/time_limit.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/time-limit-for-users/admin.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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:
  • Screenshots: These screenshots require images: #1 (Account status on user profile page.), #2 (Account status on users list page.), #3 (Time Limited Account options page)
  • Tags: Please delete some tags, you are using 16 tag instead of maximum 10
You can take inspiration from this readme.txt

time-limit-for-users/time_limit.php 85% from 13 tests

The main file in "Time Limit" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 148 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("time-limit-for-users.php" instead of "time_limit.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin199 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP64262199

PHP code Passed 2 tests

This is a short overview 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.31
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.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 files were detected