73% my-quota

Code Review | My Quota

WordPress plugin My Quota scored73%from 54 tests.

About plugin

  • Plugin page: my-quota
  • Plugin version: 1.0.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Dec 3, 2020
  • Latest release: Jun 9, 2022
  • Number of updates: 35
  • Update frequency: every 15.8 days
  • Top authors: dropstr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,610 total downloads

Benchmarks

Plugin footprint 65% 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.05MB] [CPU: ▼5.00ms] 75% from 4 tests

A check of server-side resources used by My Quota
The following require your attention
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,227.18ms on /wp-admin/admin.php?page=myquota-settings)
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0541.40 ▲0.47
Dashboard /wp-admin3.35 ▲0.0546.38 ▼1.58
Posts /wp-admin/edit.php3.46 ▲0.1147.13 ▼2.88
Add New Post /wp-admin/post-new.php5.93 ▲0.0585.95 ▼15.93
Media Library /wp-admin/upload.php3.27 ▲0.0533.13 ▲0.40
My Quota /wp-admin/admin.php?page=myquota3.2733.88
Groups /wp-admin/admin.php?page=myquota-editor3.2731.47
Settings /wp-admin/admin.php?page=myquota-settings3.311,227.18

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 21 new files
Database: 1 new table, 9 new options
New tables
wp_quotas
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
dropstr_api
myquota_notifications
theysaidso_admin_options
myquota_db_version
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for My Quota
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲8013.27 ▼1.111.69 ▼0.2543.78 ▲2.29
Dashboard /wp-admin2,240 ▲514.94 ▲0.0498.79 ▼19.7384.61 ▲35.59
Posts /wp-admin/edit.php2,131 ▲421.99 ▼0.0237.98 ▼3.2134.12 ▼3.86
Add New Post /wp-admin/post-new.php1,539 ▲2523.36 ▲5.77667.84 ▲75.8059.37 ▲1.85
Media Library /wp-admin/upload.php1,415 ▲274.22 ▼0.0397.17 ▼0.5275.45 ▲30.20
My Quota /wp-admin/admin.php?page=myquota9722.1728.0526.91
Groups /wp-admin/admin.php?page=myquota-editor8962.0224.6429.86
Settings /wp-admin/admin.php?page=myquota-settings1,1322.0324.2731.60

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_quotas
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • myquota_db_version
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • dropstr_api
    • myquota_notifications

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
  • 15× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'my_quota_dropstr_quota_list' not found in wp-content/plugins/my-quota/inc/core.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'my_quota_dropstr_quota_list' not found in wp-content/plugins/my-quota/inc/roster_class.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'my_quota_dropstr_quota_core' not found in wp-content/plugins/my-quota/addons/wordpress-seo.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'my_quota_dropstr_quota_list' not found in wp-content/plugins/my-quota/inc/archive_class.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'my_quota_dropstr_quota_list' not found in wp-content/plugins/my-quota/editor.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'my_quota_dropstr_quota_list' not found in wp-content/plugins/my-quota/addons/publishpress.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'my_quota_dropstr_quota_list' not found in wp-content/plugins/my-quota/inc/add_ons.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/my-quota/inc/notifications.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'my_quota_dropstr_quota_core' not found in wp-content/plugins/my-quota/settings.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'my_quota_dropstr_quota_list' not found in wp-content/plugins/my-quota/inc/errors.php:11

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Quota Roster - Show all your users and their quota requirements (Limited view based on editor role).), #2 (Quota Policy - Apply polices for your quota groups.), #3 (Quota Groups - Create groups for your writers and apply quota policies.)
You can take inspiration from this readme.txt

my-quota/index.php 85% from 13 tests

The principal PHP file in "My Quota" v. 1.0.8 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("my-quota.php" instead of "index.php")

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
Everything looks great! No dangerous files found in this plugin5,659 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP143,0151,5935,532
CSS111088
JavaScript17439

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.69
Average class complexity125.56
▷ Minimum class complexity16.00
▷ Maximum class complexity527.00
Average method complexity10.75
▷ Minimum method complexity1.00
▷ Maximum method complexity60.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods115
▷ Static methods00.00%
▷ Public methods6455.65%
▷ Protected methods00.00%
▷ Private methods5144.35%
Functions12
▷ Named functions12100.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
4 PNG files occupy 0.28MB with 0.19MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png20.88KB8.87KB▼ 57.51%
images/icon.png52.08KB0.61KB▼ 98.82%
screenshot-1.png58.18KB24.67KB▼ 57.61%
screenshot-2.png159.62KB70.55KB▼ 55.80%