73% wp-file-upload

Code Review | Wordpress File Upload

WordPress plugin Wordpress File Upload scored73%from 54 tests.

About plugin

  • Plugin page: wp-file-upload
  • Plugin version: 4.24.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9.2-6.4.1
  • WordPress version: 6.3.1
  • First release: Dec 9, 2013
  • Latest release: Nov 9, 2023
  • Number of updates: 273
  • Update frequency: every 13.3 days
  • Top authors: nickboss (100%)

Code review

54 tests

User reviews

113 reviews

Install metrics

20,000+ active /1,149,989 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲4.28MB] [CPU: ▲24.40ms] Passed 4 tests

An overview of server-side resources used by Wordpress File Upload
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /7.76 ▲4.3064.80 ▲21.77
Dashboard /wp-admin7.59 ▲4.2869.42 ▲23.03
Posts /wp-admin/edit.php7.64 ▲4.2878.02 ▲27.44
Add New Post /wp-admin/post-new.php10.17 ▲4.28122.34 ▲26.63
Media Library /wp-admin/upload.php7.51 ▲4.2865.16 ▲26.18
Wordpress File Upload /wp-admin/options-general.php?page=wordpress_file_upload7.51384.07

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 135 new files
Database: 3 new tables, 15 new options
New tables
wp_wfu_dbxqueue
wp_wfu_userdata
wp_wfu_log
New WordPress options
db_upgraded
wfu_environment_variables
wfu_userstate_list_last_check
wordpress_file_upload_last_idlog
widget_theysaidso_widget
widget_wordpress_file_upload_widget
can_compress_scripts
wordpress_file_upload_table_dbxqueue_version
wfu_userstate_peyyxg6jd6fl8mj7wm9hmz9mn8z14gtd
widget_recent-posts
...

Browser metrics Passed 4 tests

Wordpress File Upload: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,987 ▲22513.58 ▼0.8511.51 ▲9.7135.40 ▼9.57
Dashboard /wp-admin2,235 ▲615.61 ▼0.0794.97 ▼7.5842.81 ▲0.72
Posts /wp-admin/edit.php2,146 ▲462.01 ▲0.0339.73 ▲3.8634.88 ▼3.57
Add New Post /wp-admin/post-new.php1,556 ▲3122.70 ▼0.49680.56 ▲13.6252.59 ▲2.08
Media Library /wp-admin/upload.php1,437 ▲434.19 ▼0.0497.46 ▼5.2642.62 ▼4.04
Wordpress File Upload /wp-admin/options-general.php?page=wordpress_file_upload1,6592.0730.5436.43

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie tables were found after uninstall: 3 tables
    • wp_wfu_dbxqueue
    • wp_wfu_log
    • wp_wfu_userdata
  • This plugin did not uninstall successfully, leaving 15 options in the database
    • wfu_userstate_list
    • widget_recent-posts
    • can_compress_scripts
    • wordpress_file_upload_table_log_version
    • wordpress_file_upload_table_dbxqueue_version
    • widget_theysaidso_widget
    • widget_wordpress_file_upload_widget
    • wfu_userstate_list_last_check
    • wordpress_file_upload_table_userdata_version
    • widget_recent-comments
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following items
  • 13× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WFU_Original_Template' not found in wp-content/plugins/wp-file-upload/templates/uploader-Custom1.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'MatthiasMullie\\PathConverter\\ConverterInterface' not found in wp-content/plugins/wp-file-upload/vendor/minifier/path-converter/src/NoConverter.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Minify' not found in wp-content/plugins/wp-file-upload/vendor/minifier/minify/src/JS.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function home_url() in wp-content/plugins/wp-file-upload/wordpress_file_upload.php:44
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Minify' not found in wp-content/plugins/wp-file-upload/vendor/minifier/minify/src/CSS.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/wp-file-upload/lib/wfu_constants.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Exceptions\\BasicException' not found in wp-content/plugins/wp-file-upload/vendor/minifier/minify/src/Exceptions/IOException.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Exception' not found in wp-content/plugins/wp-file-upload/vendor/minifier/minify/src/Exceptions/BasicException.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Exceptions\\BasicException' not found in wp-content/plugins/wp-file-upload/vendor/minifier/minify/src/Exceptions/FileImportException.php:20
    • > PHP Warning
      Use of undefined constant ABSWPFILEUPLOAD_DIR - assumed 'ABSWPFILEUPLOAD_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-file-upload/lib/wfu_security.php on line 8

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 on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (A screenshot of the plugin in its most simple form.), #2 (A screenshot of the plugin showing the progress bar.), #3 (A screenshot of the plugin showing the successful upload message.), #4 (A screenshot of the plugin with additional form fields.), #5 (A screenshot of the plugin with subfolder selection.), #6 (A screenshot of the plugin in a sidebar.), #7 (A screenshot of the shortcode composer.), #8 (A screenshot of the file browser.)
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
The official readme.txt is a good inspiration

wp-file-upload/wordpress_file_upload.php 92% from 13 tests

The main PHP script in "Wordpress File Upload" version 4.24.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-file-upload.php" instead of "wordpress_file_upload.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin31,925 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
PHP391,81210,48420,444
PO File143,4283,53810,503
CSS93240588
SVG42231250
JavaScript51814140

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity25.53
▷ Minimum class complexity1.00
▷ Maximum class complexity185.00
Average method complexity4.91
▷ Minimum method complexity1.00
▷ Maximum method complexity85.00
Code structure
Namespaces3
Interfaces1
Traits0
Classes14
▷ Abstract classes321.43%
▷ Concrete classes1178.57%
▷ Final classes00.00%
Methods103
▷ Static methods32.91%
▷ Public methods6159.22%
▷ Protected methods3836.89%
▷ Private methods43.88%
Functions434
▷ Named functions42397.47%
▷ Anonymous functions112.53%
Constants1
▷ Global constants00.00%
▷ Class constants1100.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
19 PNG files occupy 0.21MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/add_16.png0.40KB0.39KB▼ 2.67%
images/add_12.png0.20KB0.15KB▼ 25.25%
vendor/jquery/images/ui-icons_cc0000_256x240.png4.44KB4.17KB▼ 6.02%
images/Version Comparison.png174.57KB54.77KB▼ 68.62%
images/remove_16.png0.74KB0.82KB0.00%