• James Jones

    (@jamesjonesphoenix)


    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 to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support eugenewhite

    (@eugenewhite)

    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

    (@jamesjonesphoenix)

    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 eugenewhite

    (@eugenewhite)

    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)
  • You must be logged in to reply to this topic.