Replies
Thanks Brajesh! That would be awesome, but please only worry about this if you are interested and think it’d benefit other users too, and you have time. The method I’m using is working, so, no need for a special addition just on my behalf. Thanks again for the helpful info.
Hi again guys,
Confirmed with Shane from EWWW that the first hook should indeed be add_filter, as above. This allows EWWW to resize earlier and use less memory, and also ensures image rotation is handled properly for thumbnails. Shane said he is going to do some more testing and plans to include these 2 filters directly in a future version of EWWW.
- This reply was modified 7 years, 6 months ago by Andy.
Hi again,
Shane from ewww suggested using ‘mpp_generate_metadata’ for the second hook and problem is solved!
Another thing I noticed is mpp_handle_upload looks like a filter hook, not an action hook. (See line 267: https://github.com/buddydev/mediapress/blob/master/core/storage/class-mpp-local-storage.php). I tried changing ‘add_action’ to ‘add_filter’ for the first hook, result seems the same. I guess as long as ewww_image_optimizer_handle_upload is returning what the hook expects it will be fine either way. But maybe good practice to use ‘add_filter’ here?
Here is the code I am testing now:
—
add_action( ‘init’, ‘mpp_ewww_optimizer_bridge’ );
function mpp_ewww_optimizer_bridge() {if( function_exists( ‘ewww_image_optimizer_handle_upload’ ) ) {
add_filter( ‘mpp_handle_upload’, ‘ewww_image_optimizer_handle_upload’ );
add_filter( ‘mpp_generate_metadata’, ‘ewww_image_optimizer_resize_from_meta_data’, 15, 2 );}
}
—Just tested with a 5120×3400 image upload and it successfully processed the original, resizing down to 1920px as specified in ewww settings, and compressed by 96%! So all seems to be working.
Thank you, Brajesh.
The information you provide is really helpful, and I figured out the issue, on my site anyways.
Apparently jquery UI sortable/droppable doesn’t work properly on IOS by default (see here for example: https://stackoverflow.com/questions/12051045/jquery-ui-sortable-and-dragable-not-working-on-ipad-iphone-or-android)
There is an easy fix, which is to load the following small js script that modifies the behavior:
Just implemented this and it works on my iphone now! The styling of the reorder template is messed up but it’s probably my theme and I should be able to make it look nice with a child theme override and CSS work.
Thanks,
AndyHi Brajesh,
Thanks for your reply. I have set the preferences as you suggest and the ‘protected’ tab is still present as a navigation tab in every member’s profile. Even though these profiles are not set to protected either by default or in each member’s profile settings. Also the plugin’s mode is set to redirect.
Here is a screenshot:
https://ibb.co/bxoidFI am sure this is not the intended behavior of your plugin?
Thanks,
Andy