Bug - Transients created in autoload=true, on table wp_options
Steps required to reproduce the problem
- Insert a embed on post content (Youtube, Facebook, Twitter or Instagram)
- Access this post
- Verify MySQL table wp_options, and run this query:
SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'
- See the result, and you'll find something like this:
option_name option_value _transient_c80eac53c8183dd70511050453ff1b33 youtube _transient_c80eac53c89340d9dfd49d8gddf42d94 twitter
Expected Result
The expected result is that this item is without autoload = true, which is overloading the mysql response, which needs to return a huge amount of completely unnecessary information.
Version Info
Please state exact versions, not latest or new.
- Plugin version: 4.0.6
- WordPress version: 4.9.4
- PHP version: 5.5.9
Without the above information we are not able to debug the issue and will close it.
No news on this bug?
@algmelo Not sure I fully understood the problem you are raising here.
Are you affirming that the autoload = true is being set by this plugin?
Exact, @everton-rosario !
Before opening the issue, I did the test:
- I disabled all the plugins that were in my Wordpress installation
- I removed all entries that had 'transient' in option_name and autoload = true
- I accessed the url /feed/instant-articles/
When you run the above query (SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes') in MySQL, entries with autoload = true have been re-created.
The problem is that as I have an installation with a large database (over 1.5Gb), and with large traffic (more than 8mil simultaneous accesses).
One of the slowest queries is the one I mentioned.
Gotcha. I could find the lines you should try change:
File embeds.php
if ( $provider_name ) {
$html = instant_articles_embed_get_html( $provider_name, $html, $url, $attr, $post_id );
delete_transient( $cache_key ); // Add this line right after the get_html
}
Didn't test, but it looks promising. Check if this will fix the issue for you.
Great, @everton-rosario !!!
This solved the problem, but how to do in case of future updates in the plugin?
Thanks!
Can you send a PR with that fix? We need to double check for further impact into the code (if this will generate any unwanted collateral behavior).
Hi, @everton-rosario
I created a PR with the fix. I had never done a PR haha
I hope the amendment is accepted.
Thanks for the guidance!
This issue has been marked stale because it has been open for 30 days with no activity. If there is no activity within 7 days, it will be closed. This is an automation to keep issues manageable and actionable and is not a comment on the quality of this issue nor on the work done so far. Closed issues are still valuable to the project and are available to be searched.
The PR was merged and released in 4.1.1.