Undefined array keys
-
Hello,
After update I started to see this errors:
Warning: Undefined array key “description” in /plugins/schema-and-structured-data-for-wp/output/function.php on line 3410
Warning: Undefined array key “uploadDate” in /plugins/schema-and-structured-data-for-wp/output/function.php on line 3411
Warning: Undefined array key “duration” in plugins/schema-and-structured-data-for-wp/output/function.php on line 3412
Warning: Undefined array key “viewCount” in /plugins/schema-and-structured-data-for-wp/output/function.php on line 3418
The page I need help with: [log in to see the link]
-
Sorry for the inconvenience. Can you please provide more info to recreate this issue? So that we will reproduce the scenario and get back to you with the fix to resolve the issue.
Hello again @magazine3
I just received email from google…
`Videos structured data issues detected in https://www.sanalsergi.com/
To the owner of https://www.sanalsergi.com/:
Search Console has identified that your site is affected by 3 Videos structured data issue(s). The following issues were found on your site.
Top critical issues*Missing field “description”
Missing field “uploadDate”
Missing field “name”`
Thanks for the details. I have checked in the validator as well as in rich results also. There are no errors there. Can you please check once by recrawling your site in the GSC and let us know the result? So that we will help you to resolve them.
Sorry for the inconvenience. We will be going to fix this and get back to you with an update once we fixed it.
We are receiving the same error on PHP 8.0, from wp-content/plugins/schema-and-structured-data-for-wp/output/function.php, lines 3410 to 3418, if this helps.
I’m using PHP 8.0 too
It could be I think…
But it was working perfectly before then last update.
We are working on this issue, It will be fixed in the next update 1.9.101.2 and once it gets fixed then we will get back to you with an update to resolve your issue: https://github.com/ahmedkaludi/schema-and-structured-data-for-wp/issues/1751
Hi @magazine3,
just to clarify: your recent link to the github issue points to another error while enabling the plugin connected to
schema_type.php.The post’s author is referencing a PHP warning from php8+ affecting
output/function.php(captured also from my PHP logs as follows):PHP Warning: Undefined array key "title" in .../schema-and-structured-data-for-wp/output/function.php on line 3408 PHP Warning: Undefined array key "description" in .../schema-and-structured-data-for-wp/output/function.php on line 3410 PHP Warning: Undefined array key "uploadDate" in .../schema-and-structured-data-for-wp/output/function.php on line 3411 PHP Warning: Undefined array key "duration" in .../schema-and-structured-data-for-wp/output/function.php on line 3412 PHP Warning: Undefined array key "viewCount" in .../schema-and-structured-data-for-wp/output/function.php on line 3418I do not know why some of the array values remain empty, but as a quick fix, I just added a default value.
--- function.org.php 2022-10-11 12:28:42.354689807 +0200 +++ function.php 2022-10-11 12:31:20.730785565 +0200 @@ -3405,17 +3405,17 @@ $input1['itemListElement'][] = array( '@type' => 'VideoObject', "position" => $vkey+1, - 'name' => $v_val['title'], + 'name' => $v_val['title'] ?? '', 'url' => $v_val['video_url'], - 'description' => $v_val['description'], - 'uploadDate' => $v_val['uploadDate'], - 'duration' => $v_val['duration'], + 'description' => $v_val['description'] ?? '', + 'uploadDate' => $v_val['uploadDate'] ?? '', + 'duration' => $v_val['duration'] ?? '', 'contentUrl' => $v_val['video_url'], 'embedUrl' => $v_val['video_url'], 'interactionStatistic' => array( "@type" => "InteractionCounter", "interactionType" => array("@type" => "WatchAction" ), - "userInteractionCount" => $v_val['viewCount'] + "userInteractionCount" => $v_val['viewCount'] ?? '' ), 'thumbnailUrl' => isset($v_val['thumbnail_url'])? $v_val['thumbnail_url'] : saswp_get_thumbnail(), );Cheers!
Matthieu
-
This reply was modified 3 years, 5 months ago by
Matthieu.
@theschappy: We are working on this issue, It will be fixed in the next update 1.9.101.2 and once it gets fixed then we will get back to you with an update to resolve your issue.
Same problem here on PHP 8.1. Hope this will be fixed asap. Thanks
We fixed the issue in our latest update 1.9.102. Can you please check once by updating the schema plugin to the latest version and let us know back if you face any issues? So that we will help you to resolve them.
Hello
New issue arrived after update:
Warning: Undefined array key “thumbnail_url” in /plugins/schema-and-structured-data-for-wp/admin_section/common-function.php on line 3634
We pushed the update again 1.9.102.1. Can you please check once and let us know back if it fixes your issue? So that we will help you resolve them.
New issue arrived after update:
Warning: Undefined array key “thumbnail_url” in /plugins/schema-and-structured-data-for-wp/admin_section/common-function.php on line 3634 — Regarding this, I’ve raised the GitHub ticket in our repository. We’ll fix this and get back to you with an update.
Reference ticket: https://github.com/ahmedkaludi/schema-and-structured-data-for-wp/issues/1756
-
This reply was modified 3 years, 5 months ago by
The topic ‘Undefined array keys’ is closed to new replies.