• Resolved Mordechaj

    (@mordechaj)


    Hello

    An error occurred:

    Warning: Attempt to read property “ID” on null in /home/platne/serwer55633/public_html/darkorbitwiki/wp-content/plugins/all-in-one-seo-pack/app/Common/Social/Image.php on line 74

    I think the error occurs when I connect to google search concole, but I’m not sure.

    What should I do?

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support MM Aurangajeb

    (@aurangajeb)

    Hi @mordechaj ,

    Thanks for bringing this to our attention!

    What’s happening

    The warning you’re seeing:

    Warning: Attempt to read property "ID" on null in .../all-in-one-seo-pack/app/Common/Social/Image.php on line 74

    is caused by AIOSEO trying to access a post’s ID in a context where no valid post object exists (for example, on your homepage when it’s set to display latest posts, on archive pages, or on 404 pages). It’s a missing safety check in the code that generates the social media (Open Graph) image tags.

    This isn’t related to Google Search Console; it happens on every front-end page load where AIOSEO can’t find a valid post object to work with. You’d see it on any page visit, regardless of whether GSC is connected or not.

    How to fix this on your end right now

    This warning only triggers when the Default Post Image Source is set to “First Available Image” in your AIOSEO social settings. Changing it to a different option will stop the warning immediately.

    Here’s what to do:

    1. Go to All in One SEO > Social Networks > Facebook.
    2. Find the Default Post Image Source dropdown.
    3. Change it from “First Available Image” to either:
      • “Default Image (Set Below)” — then set a default image in the field below it. This is the recommended option since it gives you control over the image used when sharing your site on social media.
      • “Featured Image” — this will use each post’s featured image instead. Just make sure your posts have a featured image set.

    Here’s a screenshot showing where the setting is: https://a.supportally.com/i/Mgr8cs

    How to hide the warning from visitors

    The reason this warning is showing up visibly on your site is because PHP error display is turned on in your server configuration. This is useful for development, but on a live site it exposes warnings like this to visitors. To hide it, you can add this line near the top of your wp-config.php file (before the line that says /* That's all, stop editing! */):

    ini_set( 'display_errors', '0' );

    Or if you have these lines in your wp-config.php, change them to:

    define( 'WP_DEBUG', false );

    This won’t fix the underlying bug, but it’ll stop all PHP warnings from being visible on your site.

    On our end

    I was able to replicate the problem you described on my local site.

    I’ve raised an internal issue with our Development team, and they’re actively investigating this further.

    Thanks again for taking the time to report this, and sorry for the inconvenience!

    Thread Starter Mordechaj

    (@mordechaj)

    Thank you for your comprehensive answer, I followed the instructions and the warning no longer appears.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.