I have been trying to narrow this down and have it down to a single line of code, from my plugin. I used LifterLMS and a single call to this function results in 27 extra database calls when SEOPress is activated. If I simply deactivate SEOPress then those 27 database calls go away.
https://developer.lifterlms.com/reference/classes/llms_course/get_sections/
This behavior, likely replicated across a number of calls to the LifterLMS API, probably explains why the number of database calls increases by more than 500 on one of my key pages, merely by activating SEOPress (no other changes).
I am very eager to understand how activating SEOPress can have such an impact.
-
This reply was modified 1 year, 4 months ago by
markwill.
Hi Mark,
Thank you for reaching out to us and sorry you’re facing this issue.
Can you please reachout to the LifterLMS development team concerning this issue? You can join the #developers channel on our Slack Community.
A member of the engineering team would get in touch with you as soon as possible.
Regards,`
Hi @markwill
can you share the URL of your page with the issue please?
Do you use the free version or the PRO version of LifterLMS?
Do you use Query Monitor (free plugin) to debug this?
Thank you for the response, Benjamin. Yes, Query Monitor is how I noticed this issue.
I have opened a ticket for this and included further information. The following query is being made 13 times (in my test, at least) when I have BOTH SEOPress (free or Pro) and Oxygen. The post in question is a LifterLMS course.
SELECT * FROM wp_posts WHERE ID = 1261 LIMIT 1
Multiplied across a number of methods in my production code and I see hundreds/thousands of extra calls on a single page.
That does not happen if I disable either of those plugins – this query is made just once.
As I reported in my ticket, I narrowed this down to 2 lines of code (happy to share access via the ticket, if needed). I do not believe this is a LifterLMS issue though.
$new_course = new LLMS_Course(1261);
$course_sections = $new_course->get_sections(‘sections’);
Thank you.
-
This reply was modified 1 year, 4 months ago by
markwill.
A little more detail…
The extra / duplicated calls are initiated by a code path that includes the following…
apply_filters(‘seopress_titles_template_replace_array’)
include(‘/plugins/wp-seopress/inc/functions/variables/dynamic-variables.php’)
Note that, as far as I can tell, these extra calls ONLY happen when Oxygen is running at the same time as SEOPress. Deactivate either and I am back to a single query.
May I know if you have checked any options from SEO, Tools, Compatibility Center tab? If it’s the case, disable them.
This is something that will get deprecated soon in a future update.
Thank you for the response, Benjamin. I do not have any of the options under Compatibility Mode checked.
At this stage and with tickets opened with LifterLMS, Oxygen and SEOPress, I think we can discount LifterLMS from our investigations. Use of the LifterLMS API reasonably often on a single page was where this was exposed, but I am seeing this across many aspects of my site, including on pages where LifterLMS is not involved.
The problem seems to be something to do with the interaction between Oxygen and SEOPress. As I mentioned, disabling either one resolves this issue. I have the option to deactivate SEOPress (that is what I have done for now) but not Oxygen, since my site is built with it.
The Oxygen team seems to think this is something to do with SEOPress’ support for Oxygen. They made this comment…
“I’ve seen something similar with SEOPress in the past where the number of calls was largely increased once it was activated, and I think it’s something to do with how their Oxygen integration works.”
The end result can be rather dramatic, with the number of database queries increasing by almost 10x (with both plugins running), compared to when SEOPress is deactivated.
I welcome your thoughts. Thank you.
-
This reply was modified 1 year, 4 months ago by
markwill.
-
This reply was modified 1 year, 4 months ago by
markwill.
According to some discussions I have with one or two folks in the Oxygen Facebook group this SEEMS like it is related to how SEOPress is handling CPTs.
On a simple test page that creates a single instance of a lesson I see this call (1261 is the post ID for the lesson, which is a LifterLMS CPT)
SELECT * FROM wp_posts WHERE ID = 1261 LIMIT 1
That appears just once when either SEOPress or Oxygen are deactivated. However, when I activate both, that single query happens 13 times. Each call is associated with the SEOPress filter I mentioned above.
I asked another person to test on his own site. When he did so on a page that used a different CPT (nothing to do with LifterLMS) he saw the same i.e. the database query was called many times. So that seems like a big clue.
Any news for this @markwill?