About this plugin
Firefox allows a user to drag and drop an image from their desktop into the TinyMCE editor (Visual), where it is immediately converted to base64 code, which is undesirable as the image file size is much larger than the equivalent added by the standard WordPress method because…
- base64 images are larger than binary images
- WordPress would normally have ‘crunched’ the image to give various different sizes, including a thumbnail, all smaller than the original
5 seconds and immediately removes any base64 image found, also displaying an alert message:
’.
If you manage multiple WordPress sites this plugin will save you time checking if your clients are unwittingly crippling their page downloads.
A PixelTiger plugin.
Developer Notes
I am aware that using setInterval to detect a freshly dropped image is not ideal from a theoretical standpoint as most of the time it’s unnecessary and it could impact TinyMCE performance, albeit by a tiny amount. js to detect the DOMNodeInserted event then deleting the new image node. 8-wp.
I also searched the TinyMCE documentation for a way to bind this event in a plugin, but no joy there either.
So if you’re a javascript genius feel free to make this plugin redundant with a DOM checking one. Until that time arrives I hope people find this useful.