Undefined array key PHP post

Nothing major, probably just having add isset() or declare a variable or something. Maybe you can look into this for a coming update.

Viewing 15 replies - 1 through 15 (of 20 total)

1 2 →

  • Plugin Author arnaudbroes

    (@arnaudbroes)

    Hi @vespino,

    Thank you for reporting this issue.

    We already have a fix for it in our next update, which is currently going through QA. It should be released on December 6 if all goes well. 🙂

    Thread Starter vespino

    (@vespino)

    Excellent! I’ll just delete my PHP error logs until then.

    Thread Starter vespino

    (@vespino)

    Just got the following warnings on version 4.2.8:

    [11-Dec-2022 16:54:59 UTC] PHP Warning:  Undefined array key "url" in /public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Schema/Graphs/WebPage/WebPage.php on line 39
    [11-Dec-2022 16:54:59 UTC] PHP Warning:  Undefined array key "url" in /public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Schema/Graphs/WebPage/WebPage.php on line 40
    [11-Dec-2022 16:54:59 UTC] PHP Warning:  Undefined array key "description" in /public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Schema/Graphs/WebPage/WebPage.php on line 42
    [11-Dec-2022 16:54:59 UTC] PHP Warning:  Undefined array key "url" in /public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Schema/Graphs/WebPage/WebPage.php on line 45

    Thread Starter vespino

    (@vespino)

    Any news on this? Warnings keep pouring in.

    Plugin Support Steve M

    (@wpsmort)

    Hi @vespino,

    This was fixed in All in One SEO version 4.2.8. Please make sure to update to the latest version and then check to see if the warning comes back.

    Thread Starter vespino

    (@vespino)

    I’m on the latest version, but these errors keep coming.

    Plugin Support Steve M

    (@wpsmort)

    Hi @vespino,

    Can you contact us via our site and so we can get more information on your site configuration please.

    Thread Starter vespino

    (@vespino)

    What information are you looking for that I can’t post here? And where would you like me to submit it?

    Plugin Support Steve M

    (@wpsmort)

    Hi @vespino,

    We fixed this issue and you’re the only user who’s still experiencing this which is an anomaly, so we need to take a closer look at your setup and see what’s specific about your site that is causing this issue.

    If you want to try troubleshooting this yourself then please follow the steps here – https://aioseo.com/docs/how-to-troubleshoot-issues-with-all-in-one-seo-pack/

    Thread Starter vespino

    (@vespino)

    The errors keep coming, so please let me know what information you’d like me to send and where to send it to. My guess is here so others may benefit from this.

    Latest warnings:

    [06-Jan-2023 11:33:56 UTC] PHP Warning: Undefined array key "url" in ***/public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Schema/Graphs/WebPage/WebPage.php on line 39
    [06-Jan-2023 11:33:56 UTC] PHP Warning: Undefined array key "url" in ***/public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Schema/Graphs/WebPage/WebPage.php on line 40
    [06-Jan-2023 11:33:56 UTC] PHP Warning: Undefined array key "description" in ***/public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Schema/Graphs/WebPage/WebPage.php on line 42
    [06-Jan-2023 11:33:56 UTC] PHP Warning: Undefined array key "url" in ***/public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Schema/Graphs/WebPage/WebPage.php on line 45

    fmanu

    (@fmanu)

    Hello

    I also have the following error messages in the single post below the text:

    Warning: Undefined array key “url” in /home/clients/b19adb5619324e69140d23127c2c7dc3/web/wp-content/plugins/gp-premium/elements/class-block-elements.php on line 1306

    Warning: Undefined array key “linkType” in /home/clients/b19adb5619324e69140d23127c2c7dc3/web/wp-content/plugins/gp-premium/elements/class-block-elements.php on line 1306

    Warning: Undefined array key “linkType” in /home/clients/b19adb5619324e69140d23127c2c7dc3/web/wp-content/plugins/gp-premium/elements/class-block-elements.php on line 1306

    PHP Version WordPress: 8.1

    How can I delete these error messages?

    Best wishes Manuela

    Plugin Author arnaudbroes

    (@arnaudbroes)

    Hey @fmanu, those errors are coming from a different plugin, namely GeneratePress Premium. I’d recommend you to ask them about this in their forums since this isn’t something we can help you with – https://generatepress.com/support/

    Hey @vespino, can you let us know what theme you’re using? Also, are you seeing the errors only in your error log or also on the front-end of your site? I’m asking since it would be very helpful to know on which type of page you’re seeing these errors (post, term, archive page, etc.).

    Thread Starter vespino

    (@vespino)

    I believe the errors occur on both custom and premium themes. One theme I’m certain it occurred on is Enfold. Can’t say if the errors come from frontend or backend though, they’re logged in my PHP logs.

    Thread Starter vespino

    (@vespino)

    I just got the following errors on my personal website which uses a child theme of business-point:

    [11-Jan-2023 13:27:45 UTC] PHP Warning: Undefined array key "url" in ***/public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Schema/Graphs/WebPage/WebPage.php on line 39
    [11-Jan-2023 13:27:45 UTC] PHP Warning: Undefined array key "url" in ***/public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Schema/Graphs/WebPage/WebPage.php on line 40
    [11-Jan-2023 13:27:45 UTC] PHP Warning: Undefined array key "description" in ***/public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Schema/Graphs/WebPage/WebPage.php on line 42
    [11-Jan-2023 13:27:45 UTC] PHP Warning: Undefined array key "url" in ***/public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Schema/Graphs/WebPage/WebPage.php on line 45

    Not sure what happened at the time the errors occurred, but I wasn’t logged in, so I assume they occurred by a process on the frontend.

    Plugin Author arnaudbroes

    (@arnaudbroes)

    @vespino I switched to that theme and tried every type of page (post, page, custom post, term archive, author archive, date archive, search page, static homepage) but couldn’t reproduce the errors I’m afraid.

    However, looking at the code, I can see how this might be happening. Do you have any plugins on your site that register special types of pages by any chance? Forum plugins are a great example of this.

    If you’d like to see if I’m right, please remove lines 160-162 in all-in-one-seo-pack-pro/app/Common/Schema/Schema.php via the Plugin Editor or FTP and see if the errors go away.

    How do I fix undefined array key in PHP?

    It might show an undefined array key warning for some. It means the same thing that you are trying to access an undefined array key. It can be solved similarly like the last two cases by using isset(), arrayexists() or empty() function.

    How to resolve undefined variable error in PHP?

    Here are some ways in which you can get rid of this error in your PHP program..
    Define your variables before using them. ... .
    Validating variables with isset() function. ... .
    Setting the undefined variable to a default value. ... .
    Disabling Notice error reporting..

    What if index is undefined in PHP?

    Undefined Index is the usual error that comes up when we try to access the variable which does not persist. For instance, an array we are trying to access the index does not really exist in that, so in this scenario, we will get an Undefined Index in PHP.

    What undefined index means?

    When using them, you might encounter an error called “Notice: Undefined Index”. This error means that within your code, there is a variable or constant that has no value assigned to it.