68% wp-upload-restriction

Code Review | WP Upload Restriction

WordPress plugin WP Upload Restriction scored68%from 54 tests.

About plugin

  • Plugin page: wp-upload-restric...
  • Plugin version: 2.2.8
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 20, 2015
  • Latest release: Feb 25, 2022
  • Number of updates: 39
  • Update frequency: every 64.2 days
  • Top authors: msh134 (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

2,000+ active /17,951 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼8.52MB] [CPU: ▼1,771,314.53ms] Passed 4 tests

This is a short check of server-side resources used by WP Upload Restriction
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▼34.4041.46 ▼7,085,252.22
Dashboard /wp-admin3.47 ▲0.0854.49 ▼11.28
Posts /wp-admin/edit.php3.59 ▲0.1856.84 ▲3.66
Add New Post /wp-admin/post-new.php6.06 ▲0.13102.54 ▲1.72
Media Library /wp-admin/upload.php3.40 ▲0.1243.32 ▲7.61
WP Upload Restriction /wp-admin/options-general.php?page=wp-upload-restriction/settings.php3.3836.03

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 11 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
wpur_selected_mimes_author
can_compress_scripts
db_upgraded
widget_recent-comments
wpur_selected_mimes_editor
wpur_selected_mimes_administrator
theysaidso_admin_options
wpur_selected_mimes_contributor
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Upload Restriction
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.67 ▲0.311.61 ▼0.2641.02 ▼4.47
Dashboard /wp-admin2,196 ▲165.57 ▼0.0988.18 ▼14.8439.21 ▼9.12
Posts /wp-admin/edit.php2,107 ▲102.07 ▲0.0840.74 ▲5.7536.79 ▲2.25
Add New Post /wp-admin/post-new.php1,529 ▲323.74 ▲0.23696.42 ▼33.9155.21 ▼23.28
Media Library /wp-admin/upload.php1,407 ▲44.15 ▼0.0297.45 ▼0.8741.91 ▼0.30
WP Upload Restriction /wp-admin/options-general.php?page=wp-upload-restriction/settings.php1,7531.9032.7234.63

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method WPUploadRestriction::uninstall() should not be called statically
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-upload-restriction/settings.php
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-upload-restriction/settings.php
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(http://www.fillyourtaproom.com/wp-json/wp/v2/posts?per_page=10): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

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
Please fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-upload-restriction/languages/index.php
    • > /wp-content/plugins/wp-upload-restriction/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 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: upload, developer tool, media

wp-upload-restriction/wp-upload-restriction.php Passed 13 tests

The main PHP script in "WP Upload Restriction" version 2.2.8 is automatically included on every request by WordPress
80 characters long description:
This plugin allows you to control upload of files based on file types and sizes.

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 plugin636 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP496156472
JavaScript1160101
CSS12063

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity58.00
▷ Minimum class complexity58.00
▷ Maximum class complexity58.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods31
▷ Static methods00.00%
▷ Public methods2270.97%
▷ Protected methods00.00%
▷ Private methods929.03%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin