tangurin
Forum Replies Created
-
Thank you,
That was the problem ?
Hello @obolgun
For testing I added the “wp offload media lite” plugin and it works when I use that, which give me the indication the service account and permissions is correct. The service account has the storage admin role.
Forum: Plugins
In reply to: [WP-Stateless - Google Cloud Storage] Wrong url’sOne idea for me is to set the folder setting to: /
Then I upload all folders manually to the bucket.
Then I run the sync to get all url’s pointed to the bucket instead of locally.———–
The alternative is to only have the wp-stateless plugin activated and not sync at all, instead I have something like this in the functions.phpadd_filter('wp_get_attachment_url', function($url, $attachment_id) { $newUrl = str_replace(home_url('wp-content/uploads'), BUCKET_URL, $url); return $newUrl; }, 99, 2);
I understand that the sync is creating a post_meta. Will this slow down the site in some way? I mean will there be a sql query for each media to get the bucket url? If that’s the reality, then I guess my second option with the add_filter() would be a better choice to improve the performance of the site.
Please tell me what you think of these alternatives and if there will be a performance cost to use the plugin instead of add_filter.
Thanks in advance
Forum: Plugins
In reply to: [WP-Stateless - Google Cloud Storage] Wrong url’sAbout the url’s.
I tried to change the setting “folder” to only a “/”.
Instead of /%month%/%date%/When I sync the url’s are correct:
https://storage.googleapis.com/xxx-offload-testing-bucket/2024/03/DSC02080-scaled.jpg
But unfortunately, no images are uploaded.
Also the wp_sm_sync table is always empty.
- This reply was modified 8 months ago by tangurin.
Forum: Plugins
In reply to: [WP-Stateless - Google Cloud Storage] Wrong url’sHello,
I ran a complete test now with no plugins, only my theme with my images I have locally.
- I start with a empty bucket. A wordpress 6.4.3 with only wp-stateless plugin activated. Mode: Stateless. File url replacement: disable. Folder: Single site /date_year/date_month/
- The database contains a lof of images and the uploads folder too. All images in the media library are showing from the uploads folder.
- I go to Media -> Stateless settings -> Sync. At “Media Library Images” I find: “Total Items: 5526”. I click do nothing else but click the button “Run”.
- The status bar is showing up and the queued are increasing against the total number of files and the Processed are slowly counting up, as it should.
- Right now when I am writing this, the processed is at “252”. If I go into the bucket at Google Console, there is no images uploaded.
- When I look into the media library, the images are not working because the url’s are pointed to an empty bucket, but also with wrong urls /month/date/month/date. Multiple.
This is the url of the first image: https://storage.googleapis.com/xxx-offload-testing-bucket/2024/03/2024/03/DSC02044-scaled.jpg
Still, there is no images in the bucket and the url’s are wrong.
The problem is with the sync, because when I upload an image manually, it works. It uploads to the bucket and the url is correct.- This reply was modified 8 months ago by tangurin.
Forum: Plugins
In reply to: [WP-Stateless - Google Cloud Storage] Wrong url’sOkey strange.
I’v did not change those values:
/%date_year/date_month%/
“https://storage.googleapis.com/bucket/2024/03/lu2pxsk1-your-image-name.jpeg”
It has only been a problem when I use sync. not when I upload a new image.
And to be clear, when I run the sync, no images are transferred to the bucket.Forum: Plugins
In reply to: [WP-Stateless - Google Cloud Storage] Wrong url’sNo I’ve done nothing to the database my self. Should I?
The wrong url appears after I run the sync.Is the sync suppose to upload the existing uploads to the bucket?
Forum: Plugins
In reply to: [WP-Stateless - Google Cloud Storage] Wrong url’sClarification:
I run the sync. The image url’s in frontend are changed to e.g. “https://storage.googleapis.com/test-bucket/2024/03/2024/02/image.jpg”
And no images has been uploaded to the bucket.
Forum: Plugins
In reply to: [W3 Total Cache] Purge cache for an URL programmaticallyOr maybe the question is this simple. Why isn’t the term page cache purged when saving a post?
It works locally but not in production at the server.
Forum: Plugins
In reply to: [W3 Total Cache] Purge cache for an URL programmaticallyHello @vmarko
I need to do it dynamically with code, else I need to add a url everytime the terms are changed/added.
The problem is that I want to add the term url’s when a post i saved: “add_action( ‘save_post’)
But then the cache is already purged, and that’s why I can’t queue the urls with flush_url function.<span style=”text-decoration: underline;”>To be clear:</span>
Problem:
- When a post is saved, the cache on the term landing pages is not purged
- “Purge Policy: Page Cache” -> “Post terms pages” is checked
- Maybe the problem is because the url to our website’s admin and the frontend is different? It is purging cache for the admin url and not the frontend? (I don’t know how the purge is working)
What I am trying to do to solve it:
- I have an add_action for “save_post”
- When a post i saved, I want to add the url’s to the “w3tc_flush_url”, but this doesn’t work because the url’s array are already flushed when the “save_post” is triggered.