{"id":18071461,"date":"2024-10-14T11:56:50","date_gmt":"2024-10-14T11:56:50","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/strange-php-errors\/"},"modified":"2024-10-14T11:56:50","modified_gmt":"2024-10-14T11:56:50","slug":"strange-php-errors","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/strange-php-errors\/","title":{"rendered":"Strange PHP Errors"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hi folks, <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;ve been getting this error which occurs on both frontend and backend of WordPress. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>[07-Oct-2024 01:20:36 Australia\/Adelaide] PHP Fatal error: Uncaught Error: Class 'mp_timetable\\plugin_core\\classes\\Controller' not found in \/home\/phoenixstaging2\/staging\/powertomove\/public_html\/wp-content\/plugins\/mp-timetable\/classes\/controllers\/class-controller-popup.php:12 Stack trace: #0 {main} thrown in \/home\/phoenixstaging2\/staging\/powertomove\/public_html\/wp-content\/plugins\/mp-timetable\/classes\/controllers\/class-controller-popup.php on line 12<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I can make the error go away by manually deleting the plugin files and then reinstalling it. The plugin works fine for a while and inevitably throws this error or similar after about a day.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;ve tried changing PHP versions &#8211; 8.2, 7.4.,7.2. Tried disabling all other plugins and switching to 2024 theme. Tried updating WP Core from 6.1.7 to latest 6.6.2. None of these changes prevent the error.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Through debugging I&#8217;m pretty sure it&#8217;s happening when the class file is included. Not when it is instantiated.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Sometimes there are variations on the same error. For example one go through I got:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>[24-Sep-2024 03:28:21 Australia\/Adelaide] PHP Fatal error: Uncaught Error: Class 'mp_timetable\\plugin_core\\classes\\Model' not found in \/home\/phoenixstaging2\/staging\/powertomove\/public_html\/wp-content\/plugins\/mp-timetable\/classes\/models\/class-settings.php:10 Stack trace: #0 {main} thrown in \/home\/phoenixstaging2\/staging\/powertomove\/public_html\/wp-content\/plugins\/mp-timetable\/classes\/models\/class-settings.php on line 10<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The fact it works for a while and then breaks suggests some caching error or problematic cron task. But I&#8217;m finding this extremely hard to diagnose because I can&#8217;t reliably replicate it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The files with the classes that can&#8217;t be found are still present, there are no permissions changes. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Any suggestions would me most appreciated! Have you run into a problem like this before?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Kind Regards,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">James<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8212;<\/p>\n","protected":false},"template":"","class_list":["post-18071461","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18071461","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\/18071461\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=18071461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}