90% file-upload-types

Code Review | File Upload Types by WPForms

WordPress plugin File Upload Types by WPForms scored 90% from 54 tests.

About plugin

  • Plugin page: file-upload-types
  • Plugin version: 1.3.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.1
  • WordPress version: 6.3.1
  • First release: Feb 12, 2020
  • Latest release: Feb 15, 2023
  • Number of updates: 17
  • Update frequency: every 66.7 days
  • Top authors: sanzeeb3 (88.24%)slaFFik (17.65%)

Code review

54 tests

User reviews

13 reviews

Install metrics

20,000+ active / 122,091 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.23MB] [CPU: ▼0.09ms] Passed 4 tests

Server-side resources used by File Upload Types by WPForms
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2248.88 ▲7.70
Dashboard /wp-admin3.51 ▲0.2144.10 ▼5.34
Posts /wp-admin/edit.php3.63 ▲0.2746.20 ▼0.67
Add New Post /wp-admin/post-new.php6.10 ▲0.21101.30 ▲0.35
Media Library /wp-admin/upload.php3.99 ▲0.7738.11 ▲5.29
File Upload Types /wp-admin/options-general.php?page=file-upload-types5.2357.05

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 34 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by File Upload Types by WPForms
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.29 ▼0.945.98 ▲4.3342.60 ▼0.81
Dashboard /wp-admin2,213 ▲285.85 ▼0.0596.87 ▼2.9038.38 ▼4.61
Posts /wp-admin/edit.php2,096 ▲42.02 ▲0.0438.05 ▼3.4533.17 ▼4.17
Add New Post /wp-admin/post-new.php1,548 ▲3518.45 ▲1.02587.41 ▼15.5148.60 ▼5.07
Media Library /wp-admin/upload.php1,392 ▲14.21 ▲0.0198.53 ▼1.1144.74 ▼0.11
File Upload Types /wp-admin/options-general.php?page=file-upload-types8,5081.3430.2799.24

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely 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
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/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
5 plugin tags: file upload, upload, mime, attachments, files

file-upload-types/file-upload-types.php Passed 13 tests

This is the main PHP file of "File Upload Types by WPForms" version 1.3.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
110 characters long description:
Easily allow WordPress to accept and upload any file type extension or MIME type, including custom file types.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin1,405 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP153387501,332
JavaScript29245
XML10016
SVG9009
JSON2002
CSS1011

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of 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.47
Average class complexity27.50
▷ Minimum class complexity1.00
▷ Maximum class complexity49.00
Average method complexity3.29
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes116.67%
Methods64
▷ Static methods1929.69%
▷ Public methods5890.62%
▷ Protected methods00.00%
▷ Private methods69.38%
Functions18
▷ Named functions1266.67%
▷ Anonymous functions633.33%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo.png16.67KB9.41KB▼ 43.57%