78% role-based-storage-limiter

Code Review | Role Based Storage Limiter

WordPress plugin Role Based Storage Limiter scored78%from 54 tests.

About plugin

  • Plugin page: role-based-storag...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.2
  • WordPress version: 6.3.1
  • First release: Feb 27, 2017
  • Latest release: Feb 27, 2017
  • Number of updates: 4
  • Update frequency: every 3.5 days
  • Top authors: mlcapulong (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /654 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼4.74ms] Passed 4 tests

This is a short check of server-side resources used by Role Based Storage Limiter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0841.24 ▼2.16
Dashboard /wp-admin3.38 ▲0.0851.98 ▲0.97
Posts /wp-admin/edit.php3.50 ▲0.1452.67 ▼0.33
Add New Post /wp-admin/post-new.php5.98 ▲0.1087.54 ▼17.45
Media Library /wp-admin/upload.php3.31 ▲0.0841.52 ▲8.85
Storage Limiter /wp-admin/options-general.php?page=role-based-storage-limiter3.2834.47

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
role_based_storage_limiter
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Role Based Storage Limiter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲11913.50 ▼0.708.23 ▲6.5444.08 ▲1.39
Dashboard /wp-admin2,197 ▲175.62 ▼0.0387.29 ▼4.1939.42 ▼4.36
Posts /wp-admin/edit.php2,108 ▲52.02 ▲0.0835.10 ▼1.3635.20 ▼4.07
Add New Post /wp-admin/post-new.php1,533 ▲722.95 ▼0.80685.77 ▼12.0258.34 ▲3.32
Media Library /wp-admin/upload.php1,402 ▲24.21 ▲0.0199.38 ▼6.0043.14 ▼5.49
Storage Limiter /wp-admin/options-general.php?page=role-based-storage-limiter9652.1223.0529.66

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

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/role-based-storage-limiter/public/partials/role-based-storage-limiter-public-display.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/role-based-storage-limiter/admin/partials/role-based-storage-limiter-admin-display.php:19

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === role-based-storage-limiter === )
Please take inspiration from this readme.txt

role-based-storage-limiter/role-based-storage-limiter.php Passed 13 tests

The main PHP file in "Role Based Storage Limiter" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
57 characters long description:
Sets a storage limit for each member based on their role.

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
Good job! No executable or dangerous file extensions detected627 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP12184573319
CSS34980302
JavaScript24546

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity4.71
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity1.81
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods32
▷ Static methods26.25%
▷ Public methods2784.38%
▷ Protected methods00.00%
▷ Private methods515.62%
Functions3
▷ Named functions3100.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