Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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

    #1324505

    Hey 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,
    Ismael

    #1324629

    Hello 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

    #1324868

    Hi,

    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,
    Ismael

    #1324982

    Hello 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

    #1325188

    Hi,

    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,
    Ismael

    #1325225

    Hello 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 1 week, 1 day ago by  wtechgr.
    #1325258

    Hi,
    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,
    Mike

    #1325303

    Hello 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

    #1325347

    Hi,

    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,
    Ismael

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.