Title: Strange PHP Errors
Last modified: October 14, 2024

---

# Strange PHP Errors

 *  [James Jones](https://wordpress.org/support/users/jamesjonesphoenix/)
 * (@jamesjonesphoenix)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/strange-php-errors/)
 * Hi folks,
 * I’ve been getting this error which occurs on both frontend and backend of WordPress.
 * `[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`
 * 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.
 * I’ve tried changing PHP versions – 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.
 * Through debugging I’m pretty sure it’s happening when the class file is included.
   Not when it is instantiated.
 * Sometimes there are variations on the same error. For example one go through 
   I got:
 * `[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`
 * The fact it works for a while and then breaks suggests some caching error or 
   problematic cron task. But I’m finding this extremely hard to diagnose because
   I can’t reliably replicate it.
 * The files with the classes that can’t be found are still present, there are no
   permissions changes.
 * Any suggestions would me most appreciated! Have you run into a problem like this
   before?
 * Kind Regards,
 * James
 * —
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fstrange-php-errors%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [Eugene White](https://wordpress.org/support/users/eugenewhite/)
 * (@eugenewhite)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/strange-php-errors/#post-18081802)
 * Hello there! 
 * Sorry to hear that you faced such an issue with our Timetable plugin. 
 * But to be honest, we have never received similar complaints from other customers
   who use it. We didn’t encounter any similar issues during our testing.
 * But here’s the info I located online: 
 * The “Fatal Error: Uncaught Error: Class … not found” in WordPress usually occurs
   when the PHP code refers to a class that is not available or not defined in the
   current scope. This could be due to several reasons such as:
    1. The class file is not included or required correctly.
    2. The class file is not present in the specified location.
    3. The class file is not loaded yet when it’s being used.
    4. The class name is misspelled.
 * This, in turn, may be due to server misconfiguration. Perhaps your website content
   is being cached by a CDN, causing this issue. Alternatively, you may have a separate
   caching tool enabled on your server.
 *  Thread Starter [James Jones](https://wordpress.org/support/users/jamesjonesphoenix/)
 * (@jamesjonesphoenix)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/strange-php-errors/#post-18084838)
 * Thanks for the reply! Yes I already noticed through searching that nobody else
   is having this issue. It’s easily in the top 5 of strangest bugs I’ve ever encountered.
 * The issue is replicated on my local dev machine too, which is a simple LAMP setup
   on Ubuntu 24.04.
 * The 4 measures you suggested I’ve already checked with judicious use of _print\
   _r_(), _class\_exists_() and _get\_included\_files_() calls. The relevant files
   are definitely being loaded and seemingly in the correct order determined by 
   your plugin’s init process. I’ve deactivated caching and on my local dev machine
   never had any caching in the first place. The staging site doesn’t use a CDN.
   What’s really odd is that I can confirm the class with correct namespace exists
   right before the class is declared with _class\_exists_() but it throws the fatal
   error anyway.
 * The only thing I can suggest on your end would be to refactor the namespace tree
   a bit. Mostly I mean eliminate “plugin_core” for the high level classes so the
   children classes exist on a sub-namespace leading straight to these high level
   classes instead of a separate branch. But I understand that’s asking for a lot
   of refactoring for one user’s esoteric problem that may not even help.
 * If nothing else, this thread can provide a record in case someone else has the
   same problem. Hoping they’ll comment here and maybe we’ll see some commonalities
   with their situation.
 *  Plugin Support [Eugene White](https://wordpress.org/support/users/eugenewhite/)
 * (@eugenewhite)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/strange-php-errors/#post-18122753)
 * Hello James! 
 * Thank you for your response and for sharing all the details.
 * While I can’t promise we refactor the namespace tree in our Timetable plugin,
   I let our developers know about your issue to see if they have thoughts on this.
 * In the meantime, I may only recommend you take a look at our paid alternative,
   the new plugin called ‘WordPress Events Calendar – Visual Builder for Events 
   Schedule”, which allows you to create calendars or timetables even in a more 
   efficient way. You can find the plugin on our website. Please note that this 
   is a new plugin, and detailed documentation is not yet available. However, we
   are actively working on it 🙂

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

The topic ‘Strange PHP Errors’ is closed to new replies.

 * ![](https://ps.w.org/mp-timetable/assets/icon-256x256.png?rev=2665792)
 * [Timetable and Event Schedule by MotoPress](https://wordpress.org/plugins/mp-timetable/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mp-timetable/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mp-timetable/)
 * [Active Topics](https://wordpress.org/support/plugin/mp-timetable/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mp-timetable/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mp-timetable/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Eugene White](https://wordpress.org/support/users/eugenewhite/)
 * Last activity: [1 year, 7 months ago](https://wordpress.org/support/topic/strange-php-errors/#post-18122753)
 * Status: not resolved