• Hi. Is this still supported?

    I’m getting a lot of warning errors PHP Warning: Invalid argument supplied for foreach() in /home/xxxxx/public_html/account1/xxxxx/wp-content/plugins/hide-trackbacks/hide-trackbacks.php on line 112

    Thank you

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Sander van Dragt

    (@pacifika)

    Hi aecnews, thanks for using the plug-in. I’ll have a look at the warnings you’ve reported and issue an update.

    The plug-in is small and usually ticking along merrily between WordPress updates, so there’s not been a need to update it.

    But it looks like now there is, I’ll report back with my findings.

    Thread Starter aseannewstoday

    (@aecnews)

    Hi Sander,

    Thanks very much. Yes. You are correct. It just ticks along.

    FYI it is WP 5.9 with plugin version 1.1.4.

    The website is here, if that is of any help: https://aseannewstoday.com/

    Thank you, stay safe.

    John

    Plugin Author Sander van Dragt

    (@pacifika)

    This part of the plugins accepts a list of posts (an array of retrieved posts after they’ve been fetched and internally processed.). If you’re seeing a warning that iterating on that is not possible then I suspect there’s an logic error on the theme, as an empty list should be returned.

    Here’s the source https://github.com/svandragt/hide-trackbacks/blob/1.1.4/hide-trackbacks.php#L112

    If you’d like me to give more details could you please provide the following:

    – Can you reproduce it with one of the default themes, to rule out the theme?
    – could you post a link to one of the pages where this warning is happening so I can inspect the html and derive context from it.
    – do you know the php version you are using, this can be found on the site health screen.

    Hope we can get this sorted.

    Thanks, Sander

    Thread Starter aseannewstoday

    (@aecnews)

    Hi Sander.
    Thanks very much. I’ll have a look over the weekend. I’m seeing this in the server error logs. It’s probably a theme fault. PHP version 7.4

    Thanks very much.

    John

    Plugin Author Sander van Dragt

    (@pacifika)

    Hi John,
    I’ve pushed a new version 1.1.5 where it’s being extra checks around this issue, and the PHP warning will no longer show.

    I’ll mark the support issue as resolved.

    Thread Starter aseannewstoday

    (@aecnews)

    Hi Sander,
    Thanks very much.
    Any tips on where I should go hunting in the theme looking for what was causing that?

    Thanks again, stay safe.

    John

    Plugin Author Sander van Dragt

    (@pacifika)

    The filter is this one: https://developer.www.ads-software.com/reference/hooks/the_posts/
    It is used by get_posts(): https://developer.www.ads-software.com/reference/classes/wp_query/get_posts/.

    So to start, if you have Query Monitor active, navigate to a page where you see the warning happening (bar will turn orange). Query Monitor will tell you also what template is loaded. Search that for get_posts.

    It also could be code messing with global $posts variable, if that’s happening all bets are off.

    The fix depends on how it’s being used, I see you’re using a commercial theme so perhaps you’re able to get support. https://www.gabfirethemes.com/themes/advanced-wordpress-newspaper-theme/

    Apart from the warning, there are no side effects.

    Thread Starter aseannewstoday

    (@aecnews)

    Hi Sander,
    Sorry for the late reply.
    Thank you for the tips. I’ll go searching.

    Stay safe,
    John

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Still supported?’ is closed to new replies.