• Resolved jcbsep

    (@jcbsep)


    Hi.

    I’m experimenting some missconfigurations since the lasts updates (I had/have* the plugin configured to show 8 related posts and now it showing only 6).

    Do you have any idea of why is this happening?

    Thank you in advance.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Ajay

    (@ajay)

    Are these on all posts or only specific ones.

    Can you please also double-check settings again once you’ve upgraded.

    Also check if it helps when you do the include Content including Title – setting under List Tuning and if this finds the 8 posts.

    Would be helpful if you are able to check queries generated using Query Monitor if this is consistently showing you 6 posts and not 8.

    Thread Starter jcbsep

    (@jcbsep)

    It seems to be working again after disable and enable back the option: “Related posts based on title and content”. But It’s being going back and forth since the last most recent updates. So I’m not sure if it’s definitely fixed.

    Answering your questions:

    1) It’s happening in al posts.

    2) I double-checked before I posted the ticket.

    3) Unchecked “Related posts based on title and content”. Still showed 5 posts (it was 5 not 6). Started to show not-related posts after this.

    I enabled it back and it seems to be working normal.

    4) Potential troublemakers queries according to Query monitor:

    usingcrp_get_attachment_id_from_url()
    1 call
    crp_get_image_html()
    1 call
    Plugin Author Ajay

    (@ajay)

    Thanks. These two queries are fine.
    Would be good to disable the cache (temporarily) and then check what Query Monitor throws up for the WP_Query->get_posts function throws up for the contextual-related-posts component.

    Thread Starter jcbsep

    (@jcbsep)

    It showing 5 related posts again (instead of 8).

    What it throws:

    QUERY:

    SELECT wp_posts.ID
    FROM wp_posts
    WHERE 1=1
    AND wp_posts.ID IN (1012772,1012799,9719,1011403,1012637,1012220,1012917,5297)
    AND wp_posts.post_type = 'post'
    AND ((wp_posts.post_status = 'publish'))
    ORDER BY FIELD(wp_posts.ID,1012772,1012799,9719,1011403,1012637,1012220,1012917,5297)
    LIMIT 0, 5

    CALLERS:

    WP_Query->get_posts()
    wp-includes/class-wp-query.php:3016
    WP_Query->query()
    wp-includes/class-wp-query.php:3448
    get_posts()
    wp-includes/post.php:2065
    CRP_Query->posts_pre_query()
    wp-content/plugins/contextual-related-posts/includes/class-crp-query.php:621
    apply_filters_ref_array('posts_pre_query')
    wp-includes/plugin.php:255
    WP_Query->get_posts()
    wp-includes/class-wp-query.php:2951
    WP_Query->query()
    wp-includes/class-wp-query.php:3448
    WP_Query->__construct()
    wp-includes/class-wp-query.php:3559
    CRP_Query->__construct()
    wp-content/plugins/contextual-related-posts/includes/class-crp-query.php:112
    get_crp_posts()
    wp-content/plugins/contextual-related-posts/includes/main-query.php:630
    get_crp()
    wp-content/plugins/contextual-related-posts/includes/main-query.php:85
    echo_crp()
    wp-content/plugins/contextual-related-posts/includes/content.php:203

    Can I do something else? What it changed in the last updated to have this missconfiguration?

    Thank you in advance.

    Plugin Author Ajay

    (@ajay)

    Thanks – it looks like you still have the caching on for the plugin. But, what I can ssee is that it is pulling out 8 posts as you can see from the first query. Which is what I think you expect.

    However, it looks like the 8 are getting narrowed down to 5.

    Can you please check which of these three post IDs are being eliminated?

    The only thing I can think of that could be causing this the exclude categories check – https://github.com/WebberZone/contextual-related-posts/blob/master/includes/main-query.php#L140

    Do you have this in your settings page which is then causing the posts to be eliminated?

    Thread Starter jcbsep

    (@jcbsep)

    Hi again.

    1) The problem gets fixed when disabling “Cache posts only” (General tab); without touching anything else. (*) But it happens again when enabled.

    2) I have no categories or posts excluded. https://ibb.co/v43JNR7

    3) Selecting “only from same” category (general tab) shows 8 related posts when “cache post only” is enabled.

    So, I’ll keep it this way for the moment.

    Thank you for the awesome plugin and support.

    Thread Starter jcbsep

    (@jcbsep)

    Update: number 3 from last post doesn’t work either.

    So far, the only fix I’ve found is to disable “Cache posts only” (General tab).

    Plugin Author Ajay

    (@ajay)

    I have to admit I am extremely confused. The post above clearly shows that you’re pulling the correct number of posts.

    Were you able to check exactly which three post IDs were eliminated above from the 8 you had in the query?

    Do you have any multilang plugin like WPML or Polylang? Are any of the post IDs from a different language if this is the case?

    Would you be able to debug a few things? Ideally on a staging install rather than live to avoid breaking your site.

    Can you delete this line / comment it out so that the loop doesn’t break:
    https://github.com/WebberZone/contextual-related-posts/blob/v3.0.3/includes/main-query.php#L177

    If that doesn’t solve it: worth trying a var_dump( $results ) after here:
    https://github.com/WebberZone/contextual-related-posts/blob/v3.0.3/includes/main-query.php#L81
    Idea is to see that you’re actually pulling out 8 posts – which I would expect should show 8 IDs and not 5.

    You should do all this with the caching posts only enabled.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Missconfigurations from last updates’ is closed to new replies.