-
AuthorPosts
-
October 11, 2021 at 8:47 am #1324374
Hello there guys,
As soon as the Woocommerce plugin is activated, the front page that includes the element “Blog posts” gets broken and starts showing random entries, among them are courses created with the plugin masterstudy.
I’ve disabled all 3rd party optimizations (including cloudflare’s).
Please kindly assist me in fixing it. You may find all the required information at the private section of this post.
Thank you in advance for your guidance.
Best regards,
Victor
October 12, 2021 at 9:29 am #1324505Hey wtechgr,
Thank you for the inquiry.
Would you mind providing a screenshot of the issue? We checked the site and the blog posts elements in the home page only display items from the selected categories (Certifications, Private Sessions).
Best regards,
IsmaelOctober 12, 2021 at 5:15 pm #1324629Hello there Ismael,
Thank you for your reply. In order for the issue to appear, after activating the Woocommerce plugin, there is a need to flush the WP Rocket cache and then force refresh. Of course at the moment the woocommerce plugin is deactivated.
I went ahead and replicated the issue in order to have a screenshot. You may find the link to the screenshot at the private area of this post.
Thank you in advance for your reply and your actions.
Best regards,
Victor
October 14, 2021 at 8:38 am #1324868Hi,
Thank you for the update.
We can now reproduce the issue on our end. Looks like the posts from the MasterStudy LMS plugin are getting included in the blog posts element when Woocommerce is enabled. We are not yet sure why that is happening, but adding this filter in the functions.php file should help.
function avia_masonry_entries_query_mod($query, $params) { foreach($query['post_type'] as $key => $value) { if( $value == 'stm-lessons' ) { unset($query['post_type'][$key]); } } return $query; } add_filter('avia_masonry_entries_query', 'avia_masonry_entries_query_mod', 10, 2);
Removing the post type “stm-lessons” should hide the unwanted posts.
Best regards,
IsmaelOctober 14, 2021 at 7:05 pm #1324982Hello there Ismael,
Thank you for the reply. I have tried this but the issue remains. It appeared that the stm-lesson entries were hidden, only because the Masterstudy plugin was disabled. It needs both the free and the Pro Masterstudy plugin activated, in order for the courses to work.
Can you please kindly have another look on the issue, since I really don’t have a clue how to hide those lessons from the element?
Thank you so much, once again, for your assistance!
Best regards,
Victor
October 16, 2021 at 3:25 am #1325188Hi,
Thank you for the info.
We modified the filter in the functions.php file so that it only queries posts from the default post type, which works but for some reason, all items from the post type are now displaying regardless of the selected category in the blog posts settings. Looks like there is something in the site that overrides the blog posts query.
We cannot reproduce the same issue on our installation, so this is probably caused by a plugin. Is there a staging or development version of the site? Can we deactivate the plugins temporarily?
Best regards,
IsmaelOctober 16, 2021 at 10:30 am #1325225Hello there Ismael,
Thank you for your reply.
I went ahead and created a staging / clone of the website at the link in the private section.
The same credentials of the original work for the staging too. Of course you can enable and disable anything. When fixed and live, I wish that both masterstudy plugins are active, as well as the woocommerce plugin.
Thank you so much, in advance, for your actions and assistance.
Best regards,
Victor
- This reply was modified 3 years, 1 month ago by wtechgr.
October 16, 2021 at 9:53 pm #1325258Hi,
I’m not sure if this will help your situation, but at the start of this thread you said that your issues seem to start when the woocommerce plugin is activated, if you are using WooCommerce 5.7.1 try downgrading to 5.6.1, in another thread woocommerce said that there was a known bug in 5.7.1 that caused issues on some sites. Perhaps this is your issue. I couldn’t login to your site and my keyboard doesn’t respond correctly on your site so it’s hard to say.Best regards,
MikeOctober 17, 2021 at 12:15 pm #1325303Hello there Mike,
Sorry for the laggy staging website, it was due to WP Rocket plugin which I have disabled. I think it should respond correctly now.
I went ahead and downgraded woocommerce to 5.6.1 , unfortunately this did not fix it. I have also upgraded to 5.8.0, still the same issue.
Please kindly try to log in with the credentials provided at the previous posts (I will place them again at the private section of this post).
Looking forward to receiving your reply , hopefully with good news!
Best regards,
Victor
October 18, 2021 at 5:25 am #1325347Hi,
Thank you for the access.
The issue does not occur when we disabled all plugins except Woocmmerce, so the issue is not entirely due to the shop plugin. It only occurs when both MasterStudy LMS and the Woocommerce plugin is enabled. And the reason why the blog posts element display all posts when the plugins are enabled is because the default query..
SELECT wp_posts.* FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (4) ) AND wp_posts.post_type IN ('post', 'page', 'attachment', 'revision', 'nav_menu_item', 'custom_css', 'customize_changeset', 'oembed_cache', 'user_request', 'wp_block', 'wp_template', 'scheduled-action', 'product', 'product_variation', 'shop_order', 'shop_order_refund', 'shop_coupon', 'portfolio', 'avia_framework_post') AND (wp_posts.post_status = 'publish' OR wp_posts.post_author = 13 AND wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC
.. gets transformed to..
SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type IN ('post', 'page', 'attachment', 'revision', 'nav_menu_item', 'custom_css', 'customize_changeset', 'oembed_cache', 'user_request', 'wp_block', 'wp_template', 'product', 'product_variation', 'shop_order', 'shop_order_refund', 'shop_coupon', 'stm-courses', 'stm-lessons', 'stm-quizzes', 'stm-questions', 'stm-reviews', 'stm-orders', 'stm-payout', 'portfolio', 'avia_framework_post') AND (wp_posts.post_status = 'publish' OR wp_posts.post_author = 13 AND wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC
.. and this part of the query that is supposed to retrieve posts from the selected category gets omitted.
LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
It is possible that the plugin is using the pre_get_posts filter somewhere in its code base and overrides the blog posts query. You may need to contact the developers of the Master Study LMS plugin for additional assistance regarding the issue.
Best regards,
IsmaelOctober 25, 2021 at 10:52 am #1326279Hello there Ismael,
Thanks for your reply. I went ahead and requested support from the plugin developers and they told me there is nothing they can do since the issue is not present when they use the default wordpress themes. Please find the support request at the private section.
Is there anything we can do on our part regarding this issue?
Thank you so much in advance for your actions!
Best regards,
Victor
October 25, 2021 at 11:59 am #1326301Hi,
Thank you for the update.
Can we access the file server? We will try to trace and debug the issue inside the LMS plugin. Additional info from the plugin developers will help.
It is possible that the plugin is using the pre_get_posts filter somewhere in its code base and overrides the blog posts query. You may need to contact the developers of the Master Study LMS plugin for additional assistance regarding the issue.
Please try to forward the above statement to the plugin developers, or just ask them if the pre_get_posts filter is used or added somewhere in the plugin.
Best regards,
IsmaelOctober 29, 2021 at 1:24 pm #1326994Hello there Ismael,
Thank you for your reply. I went ahead and forwarded the statement you requested and here is their reply:
“Please note that our plugin is not fully compatible with your theme.
Try to replace the code under this line- masterstudy-lms-learning-management-system/lms/classes/instructors.php line: 28With this code:
if (is_admin()) {
add_filter(‘pre_get_posts’, ‘STM_LMS_Instructor::posts_for_current_author’);
}Then please inform if it helped and our developers will add this code for the plugin update.”
I’ve tried this at the staging website and it did not resolve the issue, so I reverted it back to its original file.
Is that information helpful / does this reply to your request?
Thank you once again for your time.
Best regards
November 1, 2021 at 2:59 am #1327248Hi,
Thank you for the info.
What happens when you temporarily disable the filter by commenting it out?
// add_filter(‘pre_get_posts’, ‘STM_LMS_Instructor::posts_for_current_author’);
We may need to access the file server in order to properly check the issue.
Best regards,
IsmaelNovember 1, 2021 at 1:18 pm #1327293Hello there again Ismael,
Sorry for not attaching FTP credentials. Please find them at the private section.
Best regards,
Victor
November 9, 2021 at 7:41 am #1328303Hi,
Unfortunately, we are still not sure why the issue occurs but we have found out that it only happens when the Pro version of the LMS plugin is activated. We activated the LMS (Master Study) and shop (Woocommerce) plugin in our own WordPress installation and created a test page with the blog posts element. Only the selected posts are displayed in the front end.
Screenshot: https://imgur.com/0FWI83o
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.