Open archon810 opened 5 years ago
Upon the 3rd time trying this dance, I managed to get the premium plugin to activate without bringing the site down.
This issue should definitely still be fixed, especially since the plugin says it periodically pings freemius, which I'm afraid uses the same logic that causes that crazy query to start mass-executing, thus it may happen again at an unexpected point in the future when I may be away and unable to deal with the issue.
A similar issue was closed without a resolution https://github.com/Freemius/wordpress-sdk/issues/260.
In case it's relevant, I'll add that I noticed we're using another plugin that uses Freemius: https://wordpress.org/plugins/post-snippets/ (version 3.0.5).
The reason I bring that up is I noticed some Freemius-related notices today so maybe they're not playing well together, or they're unrelated. I'm not using a premium version of post-snippets.
For example: https://sentry.io/share/issue/a4a168fe4fdd405192831ed91df305ed/ https://sentry.io/share/issue/95b9cfa1b75b44dba889cf9b525f5a1f/
@archon810 thanks for the report. Do you have a test/staging environment so we can troubleshoot?
I do, but the problem is it doesn't get any traffic compared to production and isn't likely to exhibit this issue. The live traffic is what's exacerbating this issue (as is common for race condition bugs, for example).
There are tools to simulate highv traffic load so as long as the environment is identical we should be able to reproduce it.
I understand, but simulating this properly and without affecting the production db will be quite tricky. Additionally, I won't be available to look at stuff for at least a good week due to the New Year celebrations.
Can you try to brainstorm some reasons for why this could be happening based on the code you have and the report? What happens to this query that it is seemingly executed by every visitor to the site for some time (what is that time?) rather than just the admin user one time? I think you should be able to figure it out based on that.
I will update here once we have any news.
Actual Behavior:
What is the issue? (*)
I've been using WP Security Audit Log which uses Freemius for premium upgrades for a number of months. Today, I decided to upgrade to premium. The upgrade process took down our site (it's a busy one with millions of monthly PVs). This query was listed over and over in the db, hundreds of times, clogging up every connection. This is extremely poor coding, guys.I managed to recover from this, then installed the premium version of the plugin and attempted to activate it. Same thing. This time, I had to move the plugin physically on the disk and restart the db so that WP deactivates it. Insanity.
Take a look:
What is the expected behavior?
The query isn't repeatedly called, bringing down the database and the site.Versions: (*)
Freemius SDK Version:
2.2.2WordPress Version:
5.0.2PHP Version:
7.2Plugin / Theme: (*)
Name:
WP Security Audit Log (regular and premium)Slug:
wp-security-audit-log-premiumFreemius ID:
unable to findAdditional Information:
Browser Type: (*)
ChromeBrowser Version: (*)
71OS: (*)
WindowsStack Traces:
Note:
(*)
indicates required information. Without this information, your issue may be auto-closed.