Support » Plugin: Broken Link Checker » Error with 1.11.13 and other get_posts

  • Resolved Fabian Todt

    (@gaambo)


    Hi,
    I just updated to the newest version (1.11.13) and encountered a 500 Error on the Site.
    The error states a undefined method is_user_logged_in in the accesspress-anonymous-post plugin. But since this error only occurs when updating Broken Link Checker – so I digged into it.
    is_user_logged_in is a pluggable function which is not available very early and get’s called in a pre_get_posts hook by the accesspress-anonymous-post plugin. Until now this wasn’t a problem because the resynch method of blcPostTypeOverlord used a custom SQL query to get posts, but now it uses get_posts which uses WP_Query and calls all those hooks. I can’t quite figure out when and how the resnych get’s started but it seems to be too early for is_user_logged_in to be available (= before init?). Maybe a suppress_hooks would be enough?
    I don’t think it’s the fault of accesspress-anonymous-post plugin, because it call’s the method in the pre_get_posts hook and in this hook the is_user_logged_in should be defined normally.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @gaambo ,
    Thank you for taking the time to report the issue,
    You’re right we are removing the SQL query and added a WP_Query to fetch posts on the plugin this update because that’s more optimized and convenient way of fetching the posts.

    For the pre_get_posts that was a really nice catch, but I think the plugin you’re using can do a better job at identifying when the use that hook and when it should be just ignored.
    However, we’ll check if we can fix those on the plugin as well.
    If I find any quick fix after a detail review of the plugin I’ll post it as well.

    Best regards,
    Biplav.

    Thanks for your fast response. I’m with you regarding the pre_get_posts handling, there probably should be some kind of conditional check if the function is loaded and if it’s the right query – I’m gonna open a issue at the other plugin as well.

    Best regards,
    Fabian

    Plugin Support Adam – WPMU DEV Support

    (@wpmudev-support8)

    Hi @gaambo

    Thanks for update and let us know, please, if you got feedback from that other plugin’s developers. Meanwhile, we’ll be looking into out code and update you here if we come with any reasonable solution on our end.

    Best regards,
    Adam

    Plugin Support Jonathan – WPMU DEV Support

    (@wpmudev-support9)

    Hello @gaambo

    I hope you are doing well!

    We haven’t heard back from you for a while now so we’ve marked this ticket as resolved. If you do have any followup questions or require further assistance feel free to reopen it and let us know here.

    Kind regards,
    Nastia

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.