Improve plugin upload error message

Hey there!

I had to invest why I wasn’t able to upload a plugin to my MainWP Dashboard, and after reading the docs, I saw “tmpfile” being mentioned. It was indeed this PHP function that was disabled, problem solved.

But it would be better if this was improved upon and wouldn’t fatal:

Een fout van het type E_ERROR trad op op lijn 35 in het bestand /home/siteflydev/webapps/siteflydev/mwp/wp-content/plugins/mainwp/class/class-mainwp-qq2-uploaded-file-xhr.php. Foutmelding: Uncaught Error: Call to undefined function MainWP\Dashboard\tmpfile() in /home/siteflydev/webapps/siteflydev/mwp/wp-content/plugins/mainwp/class/class-mainwp-qq2-uploaded-file-xhr.php:35
Stack trace:
#0 /home/siteflydev/webapps/siteflydev/mwp/wp-content/plugins/mainwp/class/class-mainwp-qq2-file-uploader.php(143): MainWP\Dashboard\MainWP_QQ2_Uploaded_File_Xhr->save()
#1 /home/siteflydev/webapps/siteflydev/mwp/wp-content/plugins/mainwp/pages/page-mainwp-install-bulk.php(61): MainWP\Dashboard\MainWP_QQ2_File_Uploader->handle_upload()
#2 /home/siteflydev/webapps/siteflydev/mwp/wp-includes/class-wp-hook.php(308): MainWP\Dashboard\MainWP_Install_Bulk::admin_init()
#3 /home/siteflydev/webapps/siteflydev/mwp/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
#4 /home/siteflydev/webapps/siteflydev/mwp/wp-includes/plugin.php(517): WP_Hook->do_action()
#5 /home/siteflydev/webapps/siteflydev/mwp/wp-admin/admin.php(175): do_action()
#6 {main}
  thrown

Wouldn’t it be possible to check if the tmpfile is enabled and if not, abort the process in the first place and fail gracefully with a better error message?

2 Likes

Hi @jeroenrotty

Thanks for the suggestion.

The development team will look into it further, and I’ll update you via this thread as soon as I have more information.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.