10% upload-quota-per-user

Code Review | Upload Quota per User

WordPress plugin Upload Quota per User scored10%from 54 tests.

About plugin

  • Plugin page: upload-quota-per-...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.2.2
  • WordPress version: 6.3.1
  • First release: Jan 13, 2014
  • Latest release: Mar 8, 2016
  • Number of updates: 30
  • Update frequency: every 26.2 days
  • Top authors: cristian.sarov (70%)daniyalahmedk (33.33%)

Code review

54 tests

User reviews

10 reviews

Install metrics

600+ active /5,108 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/upload-quota-per-user/upload-quota-per-user.php+38
    Undefined variable: uqpu_version

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

Server-side resources used by Upload Quota per User
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0637.28 ▼6.39
Dashboard /wp-admin3.35 ▲0.0147.93 ▼13.81
Posts /wp-admin/edit.php3.40 ▲0.0549.53 ▲0.70
Add New Post /wp-admin/post-new.php5.93 ▲0.0588.41 ▼22.73
Media Library /wp-admin/upload.php3.28 ▲0.0538.11 ▲4.73
Upload Quota /wp-admin/upload.php?page=upload-quota-per-user3.2233.48

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 11 new options
New WordPress options
uqpu_single_file_size
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
uqpu_capabilities
db_upgraded
uqpu_disk_space
can_compress_scripts
theysaidso_admin_options
uqpu_version
...

Browser metrics Passed 4 tests

An overview of browser requirements for Upload Quota per User
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5813.62 ▼0.632.05 ▲0.2546.19 ▲0.69
Dashboard /wp-admin2,225 ▲215.90 ▼0.01110.57 ▼0.8340.05 ▼0.45
Posts /wp-admin/edit.php2,104 ▲42.04 ▲0.0241.49 ▲2.7336.64 ▼2.20
Add New Post /wp-admin/post-new.php1,548 ▲322.90 ▼0.47646.76 ▼61.7059.55 ▲5.10
Media Library /wp-admin/upload.php1,401 ▲14.21 ▼0.0492.79 ▼20.0741.22 ▼6.04
Upload Quota /wp-admin/upload.php?page=upload-quota-per-user8702.0527.2529.74

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/upload.php?page=upload-quota-per-user
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/upload.php?page=upload-quota-per-user
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/upload.php?page=upload-quota-per-user
    • > Notice in wp-content/plugins/upload-quota-per-user/admin.php+23
    Undefined index: settings-updated
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/upload.php?page=upload-quota-per-user
    • > Notice in wp-content/plugins/upload-quota-per-user/admin.php+94
    Undefined variable: selected

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
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/upload-quota-per-user/upload-quota-per-user.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/upload-quota-per-user/admin.php:2

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, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
1 plugin tags: attachment limit

upload-quota-per-user/upload-quota-per-user.php Passed 13 tests

"Upload Quota per User" version 1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
90 characters long description:
Limits the total space a user can use uploading files and changes single file upload size.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected227 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP23212227

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin