interfacelab
Forum Replies Created
-
There isn’t, but you can just hook into WordPress’s filter for this (which is what Media Cloud does). Make sure you do it at a priority higher than 10000 though. I would do something like this in your functions.php:
// We only want to generate the custom upload dir during an // actual upload add_filter('wp_handle_upload_prefilter', function($file){ add_filter('upload_dir', 'customUploadDir', 10001); return $file; }); // Upload has been handled, so remove our custom filter add_filter('wp_handle_upload', function($fileinfo){ remove_filter('upload_dir', 'customUploadDir'); return $fileinfo; }); // do whatever you need to do here to customize the path function customUploadDir($params) { $newPath = '/nice/'.date('Y/m/d/G/i/s'); $params['path'] = str_replace($params['subdir'], $newPath, $params['path']); $params['url'] = str_replace($params['subdir'], $newPath, $params['url']); $parms['subdir'] = $newPath; return $params; }
There’s a fix for this coming in the next release, hold tight.
No idea.
Can you tell me what PHP version you are using?
Image optimizer support is now live. ShortPixel, Imagify, EWWW and Smush.
Imagify is the best of the bunch, imho. ShortPixel has some issues that aren’t specific to Media Cloud, for example using WordPress’s image editor doesn’t trigger ShortPixel to do anything while Imagify automatically optimizes the new image edits. Also, ShortPixel requires your service be publicly accessible, while Imagify doesn’t. That kind of sucks for a dev setup, but also because of how I usually setup clients WordPress installs:
Comment
byu/RO9a0TON from discussion
inWordPressAnyways, let me know if you run into any issues!
Cheers,
Jon.
PS. Make sure to keep the storage setting “Delete From Storage” turned off, and toggle on the new Imgix setting “Keep WordPress Thumbnails”.
This should be fixed in the latest.
Also got ShortPixel working, but I haven’t published that version yet. Tomorrow probably.
The upload file prefix can be anything you want. For example, you might set it to:
client/client-name/@{date:Y-m-d}
It’s really up to you how you want to set it up. It might make sense to set it up:
@{site-host}/@{date:Y/m}
which would give you directories that look like:nicestuff.com/2018/12
If they were using Imgix, you can’t go back.
If you were just using S3, you’ll need to mirror all of the S3 media to your WordPress uploads directory. Turning off the plugin should return everything to normal, unless posts contain URLs to S3, then you’ll have to search and replace in the database.
Keeping media on your WordPress server is a bad move though, so good luck.
The latest version of the plugin should resolve this issue. Let me know if it does!
A lot of people have asked for “importing” feature but it’s a tall order with a lot of edge cases. Until I get a client that has the need I can’t see myself building the feature out.
Part of the problem, perhaps the biggest problem, is that you have to generate thumbnails and other image sizes. So you’d have to download from S3, then make all the different sizes and upload those sizes back to S3.
Sorry!
– Make sure your space is PUBLIC and allows PUBLIC listing (https://imgur.com/TaE9bC2)
– In Imgix, make sure the source is set to: https://sfo2.digitaloceanspaces.com/YOURBUCKET/
– Verify that Media Cloud is uploaded images to your space
– Profit!Let me know if that worked.
Yes, that’s how DO works but I tried to make the backend as generic as possible, so it will attempt to create a normal client first, but if no region was specified then it creates a multi region client.
I tested DO a lot today and didn’t run into any issues.
I’ve not tested DO with Cloudflare or a load balancer, so I have to think one or the other is causing the issue.
Your bucket must explicitly be set to public with DO though, unlike S3, which is maybe why you are getting the 404 or 400 errors. Spaces doesn’t have ACLs like S3 yet.
I went through about 3-4 days of testing this week with NextGen and couldn’t get it to integrate. They do their own upload thing and the codebase is less than spectacular, so I just gave up. Trying to use NextGen will now give you a warning. The plugin will work, it just won’t use Media Cloud.
You are using PHP 5.6. (Or were using).
You should upgrade to 7.x as 5.6 is being EOL’d next month.
This is fixed in the latest. If you are still using the plugin, let me know if it’s solved.