{"id":17880886,"date":"2024-07-10T12:13:37","date_gmt":"2024-07-10T12:13:37","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/php-warning-about-array-keys\/"},"modified":"2024-07-10T12:13:37","modified_gmt":"2024-07-10T12:13:37","slug":"php-warning-about-array-keys","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/php-warning-about-array-keys\/","title":{"rendered":"PHP warning about array keys"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I&#8217;ve noticed a warning in the error_log &#8211; this one tripped about 15000 times in the past 9 hours and goes back possibly to the update I did on May 28, or further.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[10-Jul-2024 02:56:17 UTC] PHP Warning: Undefined array key 4039 in \/home\/abcdef\/public_html\/wp-content\/plugins\/404-solution\/includes\/SpellChecker.php on line 811<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The key changes but everything else is the same.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">WP 6.4.x<br \/>PHP 8.1 EA<br \/>404 Solutions 2.35.9<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">line 811 is: if (is_array($minDistances[$minDist])) {<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I went to the plugin&#8217;s debug log and it threw a critical error.<br \/>&#8220;GET \/wp-admin\/options-general.php?page=abj404_solution&amp;subpage=abj404_debugfile HTTP\/2&#8221; 500<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I switched to PHP 8.0. &amp; 7.4 and the 404 Solutions debug page is blank.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I found the log here https:\/\/www.&lt;&lt;&gt;&gt;\/wp-content\/uploads\/temp_abj404_solution\/abj404_debug.txt<br \/>But despite edit timestamp being today, the last row is from November 2023:<br \/>2023-11-03 11:41:47 AEDT (INFO): deleteOldRedirectsCron. Old captured URLs removed: 22, Old automatic redirects removed: 0, Old manual redirects removed: 0, Old log lines removed: 0, New log size: 100.03MB, Duplicate rows deleted: 0, Debug file size limited: false, Admin email notification option turned off., Permlink cache rows updated: 0, User initiated: false<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks for you plugin, it&#8217;s been very useful. Any idea about this one?<\/p>\n","protected":false},"template":"","class_list":["post-17880886","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17880886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17880886\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=17880886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}