CoursePress Pro extremely slow query

Hi there,

I noticed that my site is extremely slow when it loads CoursePress pages. I’ve installed a query monitor plugin and that plugin showed that this specific query from the CoursePress plugin is slow:

This is the query:

SELECT wp_posts.*
FROM wp_posts
INNER JOIN wp_postmeta
ON ( wp_posts.ID = wp_postmeta.post_id )
WHERE 1=1
AND wp_posts.post_parent = 554
AND ( wp_postmeta.meta_key = 'module_order' )
AND wp_posts.post_type = 'module'
AND ((wp_posts.post_status <> 'trash'
AND wp_posts.post_status <> 'auto-draft'))
GROUP BY wp_posts.ID
ORDER BY wp_postmeta.meta_value+0 ASC

Is there anything you can do about that? The site loads in 6-7 seconds on CoursePress pages, on normal pages it’s 1-2 seconds.

If you need any other information please let me know!

  • Sajid
    • DEV MAN’s Sidekick

    Hi @kitty

    Hope you are doing good today :slight_smile:

    I am sorry for the inconvenience. We are aware of performance issues and our developers are working on it.

    Thanks for pointing out the query, I can reproduce the same on my site and flagging developer so they can optimize the query in upcoming versions.

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

  • Sajid
    • DEV MAN’s Sidekick

    Hi @kitty

    Hope you are doing good today :slight_smile:

    I have not heard back from developer yet. They will post a reply here as soon as possible.

    I am sorry but we can not provide a firm ETA. Please keep an eye on this thread for updates or see WPMU DEV > Updates.

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

  • Sajid
    • DEV MAN’s Sidekick

    Hi @kitty

    Hope you are doing good today :slight_smile:

    I am sorry for the delay here. I am afraid I can’t provide firm ETA when it will be fixed and ready for prime time.

    Also I still did not heard back any thing from developer so I am unable to provide a feedback update. It looks like he is super busy with development of the plugin and could not get time to post here on the thread.

    I am flagging again and also sending him an offline message to provide some insights. However its a main query of CouresPresss so I am not sure there is an easy and quick way to optimize it without changing the structure of plugin.

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

  • Kitty
    • Flash Drive

    Hi Sajid,

    What does that mean? It is so slow that it is very annoying to work with. I am sorry I only found out after I had already moved over a lot of my content. It would be a waste of time and energy to return to my old LMS provider now, however do I understand correctly that every user of this plugin experiences the same problems? In that case, howcome you ever released it without fixing it? Or am I the only person to esperience this?

    I have been looking trough the forums but I see no other complaints.

    All I would like to know now is a timeframe for repair of the plugin, so I can reconsider using Coursepress for my next course or not.

    Thanks, Kitty

  • Jose
    • Bruno Diaz

    Hello there @kitty,

    Hope you are doing great despite the problems that you are experiencing with the plugin.

    I was running some test on my dev environment and found that the specific query that you mention above is running just fine for me.

    I suspect that this might be related to the size of the metadata table.

    Any chance you could give me access to your site so that I can emulate the same course structure on my dev environment?

    If that’s not a problem for you, please send me the following information via contact form :

    – In the subject field add “Attn: Jose”

    – Link back to this thread

    – Include WP admin/network access. (if this happens only with some specific student/course, please include the credentials and specify the course)

    – Include cPanel access or similar.

    – Include any relevant URLS for your site

    On the contact form, select “I have a different question“, this ensures it comes through and gets assigned to me.

    Thanks in advance,

    José

  • Tom Whittaker
    • The Crimson Coder

    Hey @kitty,

    just wanted to mention these two plugins, one of them might help you, they use the Memcached algorithm, where its main purpose to help with slow database query and help to improve those queries by caching them and make them easily accessible.

    https://wordpress.org/plugins/sg-cachepress/

    https://wordpress.org/plugins/nginx-cache-optimizer/

    the 1st one, will only work fully if you’re hosting with siteground.com

    the second one can also be used, but ofcourse , you should first try it locally and see if it improves the queries performance.

    Hope that help, have a nice evening.

  • Kitty
    • Flash Drive

    @thomas Whittaker hi my name is Andre, the dev of Kitty. Unfortunately both plugins won’t work since 1: we don’t host at SiteGround and don’t have the correct server requirements and 2: we don’t use nginx as the webserver. But thanks for suggesting them!

  • Kitty
    • Flash Drive

    @jose Please could you look at my course like right now? I am getting frustrated as I have no idea wheter or not my students and I will have to keep waiting for 6 seconds any time a page needs to load – my developer sees no way to improve so if you do, please help me out.

    Otherwise I will need to transfer to a different platform.

    Sajid wrote earlier:

    However its a main query of CouresPresss so I am not sure there is an easy and quick way to optimize it without changing the structure of plugin.

    So I am rather confused – is Coursepress always slow? Then I do not understand why you are selling it.

    Thanks, Kitty

  • Jose
    • Bruno Diaz

    Hi Kitty,

    I was working on the performance improvements and just pushed a fix into your site.

    The problem wasn’t related to the query that you mentioned above but just to the combination of a huge amount of units in the same course plus some iteration routines that weren’t cached as expected.

    I was doing some testing in your site and the times are reduced dramatically. ( Of course, the loading time for a course page where a lot of results and progress need to be check will never be as fast as the landing page )

    Please give it a try now and let me know.

    Regarding the other issues that you mention:

    – did you create a specific ticket for those already? If you do so it will be easier to track the support status for the issue.

    – did you try using the checkbox ‘ Force unit completion refresh.’ and re-saving for all the units where you are having issues? Due to performance concerns, some statistics are not refreshed on every page load.

    Please advise.

    Cheers,

    José

  • Kitty
    • Flash Drive

    Hi Jose,

    Thank you very much. Today is a weird day because it is my father’s funeral. I have a few moments on my iPad but I will check later when I am back home, tomorrow. I will check the force unit completion refresh-buttons. I have noticed the site is loading faster indeed.

    Will be back tomorrow!

    Thanks again!

    Kitty

  • Kitty
    • Flash Drive

    Hi, I am back on my desktop. Yup, it’s a bit less slow.

    But honestly, it’s still slow.

    I cannot offer my expensive courses on a site that slow. The plugin has too many problems, the way I see it. I am going to have to look for a different solution.

    Thanks very much for your effort, Jose.

  • Jose
    • Bruno Diaz

    Hi there @kitty,

    Apologizes for the delay on my response, took some days off.

    First, sorry to hear about you father. Hope you are doing well.

    Regarding the plugin, I can take a further look if you still want to go with CoursePress.

    I noticed that your course structure is a bit weird since there are too many units.

    Normally, it would be expected to have fewer units with many pages inside each unit.

    This way the unit completion calcuclation wouldn’t take all the processing time that it’s taking now.

    Please advise.

    Cheers,

    José

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.