Delicious Brains
Forum Replies Created
-
The
amazonS3_cache
records are a way of caching the local and remote (bucket/CDN) URLs used in a post to make rewriting URLs during save and display of a post quicker by referencing their attachment ID.So if posts were being rendered with a template that had some redundant URLs in it, they would still be cached, but because the attachment ID could not be found, that timestamp is added to delay checking for their attachment ID a little while.
Now that you’ve updated that template, you should find new
amazonS3_cache
records will not reference those old URLs any longer.The
amazonS3_cache
records are ephemeral, feel free to delete them all to clean out all those old URLs if you like, theamazonS3_cache
records will be re-created. However, those old URLs being in theamazonS3_cache
records doesn’t really harm anything, they’re just redundant entries that will not be used or re-checked now that no content includes them.–IJ
The file path you pass to
wp_generate_attachment_metadata()
should be the local file path.It looks like you’re somehow getting an already offloaded media item’s remote stream wrapper URL.
Please check your code to make sure you’re only passing in the local absolute file path for the newly created Media Library item, and that you’re not accidentally re-processing a file.
As soon as you first call
wp_update_attachment_metadata()
with generated metadata, WP Offload Media will have offloaded the files, and will start filtering requests for URLs etc.If you happen to be using the “Remove Local Media” setting in OME, you’ll then get stream wrapper URLs like you see when using functions like
get_attached_file()
unless you tell it to be unfiltered.–IJ
Re-using the same offloaded media from separate sites is not possible unless the sites are purely duplicates of each other, with only one being used to offload the media, and the clones of that site not able to manage media.
We do not recommend trying to do that though, it is very easy to break one site by accidentally removing or updating offloaded media from another, if the sites have their own databases.
If the sites are exactly the same except for a domain name change, then we’d recommend using domain mapping on a single site.
Otherwise, the safest bet is to manage each site’s media individually, unless they happen to just be staging or development versions: https://deliciousbrains.com/strategies-handling-large-wordpress-media-libraries-dev-staging-environments/
–IJ
Forum: Plugins
In reply to: [WP Offload SES Lite] emails are in QUEUE, not being sent!Hey @ofmarconi,
The original poster has had an issue with sending email since before the Enqueue Only feature was introduced, so it will not be that, for them.
However, for yourself, please can you confirm that you accidentally enabled Enqueue Only, maybe while exploring the settings, and that it wasn’t on by default?
Just want to make sure there’s not a bug that somehow enabled the Enqueue Only setting by default.
–IJ
Forum: Plugins
In reply to: [WP Offload SES Lite] Cleaning database optionHey @lucanepote,
WP Offload SES Lite & Pro v1.7.0 have been released with a couple of new features that I think you’ll find very helpful.
The Instantly Remove Successfully Sent Emails From The Log setting: https://deliciousbrains.com/wp-offload-ses/doc/settings/#delete-successful
The Remove Successfully Re-sent Failed Emails From The Log setting (Pro only): https://deliciousbrains.com/wp-offload-ses/doc/settings/#delete-re-sent-failed
The Purge Logs feature, including an All (fast) mode: https://deliciousbrains.com/wp-offload-ses/doc/settings/#purge-logs
–IJ
Forum: Plugins
In reply to: [WP Offload SES Lite] Blocking all outgoing emailsHey @markwill,
WP Offload SES Lite & Pro v1.7.0 have been released with a new “Enqueue Only” setting that you may find very helpful!
There’s an
enqueue-only
key you can set totrue
in theOSES_SETTINGS
define too.https://deliciousbrains.com/wp-offload-ses/doc/settings-constants/#main-settings
–IJ
@todordvv, WP Offload Media (Pro) has built in integration with EWWW Image Optimizer, which we regularly test, but WP Offload Media Lite does not. If you’re dependent on EIO, it might be worth giving WP Offload Media a try, and if there are still problems, we’ll be in a better position to try and help you debug them via our dedicated and private support.
Otherwise, EIO does have built in integration for WP Offload Media, so it might be worth checking with them if you have a Pro license to see whether they can help.
–IJ
Thanks @todordvv, I can’t see anything obviously amiss in the code.
Please can you run a couple of tests for me:
- Upload the test mp4 to the Media Library via the standard UI to check that it offloads as expected.
- Disable EWWW Image Optimizer and try uploading the test mp4 via the custom code.
- Try uploading a test png via the custom code.
You mentioned nothing found in wp-content/debug.log, but your diagnostics say that debug errors go to logs/php-error.log, please check that after running your tests.
I’m assuming the custom code is in the “WedSociety HUB 2.0” plugin, but if not, where is it?
Have you tried debugging this to see whether
\DeliciousBrains\WP_Offload_Media\Integrations\Media_Library::wp_update_attachment_metadata()
gets called in response to thewp_update_attachment_metadata
filter firing?Please also confirm when the
upload_from_url
function is run. Is it triggered from a manual admin UI function called by a user that’s entered a URL, or something automatic, e.g. cron?–IJ
Hey @alexliii,
As you’re using WP Offload Media (Pro), please can you contact support via the Support tab in the plugin, or the email address you see in the Support section for your license in https://deliciousbrains.com/my-account/licenses/.
Please supply steps to reproduce and reference this message and we’ll try and help you out.
We are unable to support the Pro version of the plugin here, it’s against forum policy.
–IJ
Hey @todordvv,
Please could you share the custom code you’re using to perform the upload and insert into the Media Library?
–IJ
We don’t have any experience with cross-account assuming of roles in EC2 instances, but from the looks of things, you should be able to do it with WP Offload Media, as long as you’ve correctly attached the IAM Role to the EC2 instance (we often see that a restart helps after attaching a new/updated role).
Your AS3CF_SETTINGS define looks fine, but if you’re setting the region in there you should probably set the bucket too. If you take the region out of there, and ensure that the two roles allow for listing buckets, it might be easier to debug stuff in the UI as you’ll be able to see the available buckets.
This guide seems to detail all the bits you’ll need to put in place in the two accounts:
But, again, this is advanced use, and isn’t something we’ve tested. We’d be interested in hearing how you get on though, and anything WP Offload Media related that had to be adjusted to get it to work.
–IJ
Yes, WP Offload Media works well in a clustered environment such as 3 front end WordPress servers behind a load balancer, all of which connect to the same database.
We have many customers who use the “Remove local media” option in such an environment, especially if using ephemeral file systems.
–IJ
Thanks for letting us know that Smush Pro has been released with a fix for the issue.
–IJ
Excellent, glad I could help.
The tweaks plugin isn’t automatically updated as it’s not a published plugin, just an example that you may customise.
You can check it in to your source control, and should we update it in the future with stuff you want, you could then just grab the bits that have changed.
Alternatively, just move the bits you want and have working out to your own small custom plugin, or add to your child theme’s
functions.php
file.–IJ
It’s a little difficult to decipher with so much redacted in your screenshots, but it looks like you’ve set up CloudFront to deliver from the
stage-wp/neu2/
path, correct?If so, you need to unset part 1, and then part 0 from the path parts array. Probably something like the following:
public function cloudfront_path_parts( $path_parts = array(), $domain = '' ) { if ( 'any43rh7uieufjds7.cloudfront.net' === $domain && 2 < count( $path_parts ) && 'stage-wp' === $path_parts[0] && 'neu2' === $path_parts[1] ) { // Order is important here, and for safety, they are done in 2 statements rather than 1. unset( $path_parts[1] ); unset( $path_parts[0] ); } return $path_parts; }
–IJ