Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Learndash compatibility #11

Open
fabiomb opened this issue May 4, 2023 · 2 comments
Open

Learndash compatibility #11

fabiomb opened this issue May 4, 2023 · 2 comments

Comments

@fabiomb
Copy link

fabiomb commented May 4, 2023

Hi Ollie, i´m trying to use this on a Learndash (WP plugin) website with more than 350k users, yeah, a lot.

The main issue is with the admin page, not the users one, so when i try to edit a course it still make this query:

SELECT w337p_users.ID,w337p_users.user_login,w337p_users.display_name FROM w337p_users INNER JOIN w337p_usermeta ON ( w337p_users.ID = w337p_usermeta.user_id ) WHERE 1=1 AND ( ( ( ( w337p_usermeta.meta_key = 'w337p_capabilities' AND w337p_usermeta.meta_value LIKE '%\"edit\\_courses\"%' ) OR ( w337p_usermeta.meta_key = 'w337p_capabilities' AND w337p_usermeta.meta_value LIKE '%\"administrator\"%' ) OR ( w337p_usermeta.meta_key = 'w337p_capabilities' AND w337p_usermeta.meta_value LIKE '%\"editor\"%' ) ) ) ) ORDER BY display_name ASC

with all the likes. I have installed the plugin, i don´t know if the problem is the use of a particular tag for the tables (w377p) or if it´s a problem with Learndash but as far as i understand this query has to be more direct without the LIKEs.

What do you think?

@OllieJones
Copy link
Owner

Thanks for reporting this issue!

The most important function of this plugin is to get rid of those meta_value LIKE '%\"editor\"%' queries, because they're ludicrously slow as you have discovered. But WordPress still uses those slow queries until user indexing is complete. I suppose it's possible that user indexing did not proceed correctly.

Do you have WP_Cron disabled? If so, try opening the All Users panel and leaving it open until the indexing-in-progress message goes away: we do indexing in batches of 5000 users, and we use the dashboard heartbeat to run batches.

@fabiomb
Copy link
Author

fabiomb commented May 8, 2023

Thanks Ollie! we have a good performance improvement, from 25 seconds to 5 seconds, still is a huge database and the same query takes a long time (Learndash has the worst queries editing a course, and repeats this twice!) but now admins can edit courses! thanks for the advice and your plugin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants