• Resolved Jose

    (@giuse)


    Hello, the plugin gives a fatal error on the course page

    Fatal error: Uncaught Error: Class “Ultimate_Google_Font_Manager” not found in /Users/josemortellaro/Sites/zamoraserra/wp-content/plugins/masterstudy-lms-learning-management-system/lms/classes/lesson.php:263 Stack trace: #0 /Users/josemortellaro/Sites/zamoraserra/wp-content/plugins/masterstudy-lms-learning-management-system/stm-lms-templates/course/parts/lesson.php

    I think you don’t need any other information to reproduce the problem because the class Ultimate_Google_Font_Manager is not defined anywhere in the plugin.

    Have a great day!

    Jose

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi, @giuse

    To avoid misunderstandings, could you please clarify if you made any changes to the core code or the location of the files inside the plugin? Since by default such cases should not arise. It would also be good if you specified after what exact moment this situation occurred? Initially or after some modifications?

    Best regards.

    Thread Starter Jose

    (@giuse)

    Hi @stanstm

    look at line 263 https://plugins.trac.www.ads-software.com/browser/masterstudy-lms-learning-management-system/tags/2.9.3/lms/classes/lesson.php

    This is a file of the last version of your plugin. Nobody changed anything.

    Then download the last version of your plugin https://downloads.www.ads-software.com/plugin/masterstudy-lms-learning-management-system.zip

    Use a text editor to search “Ultimate_Google_Font_Manager”. You will not find anywhere the definition of that class.

    In my case, the error is triggered on the course page. But it’s enough to read the code to see that you have a bug. You use a class that is not defined anywhere in your plugin.
    Are you calling a class defined in another plugin? If so, I suggest you first check the existence of that class, and only if it exists you can use it.

    I mean something that looks like:

    if( class_exists( 'Ultimate_Google_Font_Manager' ) ){
        $Ultimate_Google_Font_Manager = new Ultimate_Google_Font_Manager;
        $Ultimate_Google_Font_Manager->enqueue_selected_ultimate_google_fonts();
    }

    Best regards.

    Hi, @giuse

    We cannot identify this case as it should not cause fatal errors. In any case, we will take a closer look at this situation. This seems to be a unique case only on your website, since we have not yet received similar requests from our users, from this we can conclude that this is not a global issue.
    We need to look at the case and your website personally, because without that we will not be able to identify the cause.

    Best wishes.

    @giuse

    We just checked this case on different websites and no errors were found. The developers are checking the cause of this situation and we will inform you about the progress.
    Also, could you please clarify which version of PHP you have installed on your server?

    Regards.

    Thread Starter Jose

    (@giuse)

    Hi @stanstm

    please, read again my thread. The solution is in my comment, and it’s very simple and clean.
    If in your code you use a class that is not defined anywhere, of course, you may have a fatal error if you don’t check that class exists.

    This seems to be a unique case only on your website since we have not yet received similar requests from our users, from this we can conclude that this is not a global issue.

    This will be the case of all those users who use the plugin Ultimate VC Addons.

    This is your code in lesson.php:

    if(class_exists('Ultimate_VC_Addons')) {
        STM_LMS_Lesson::aio_front_scripts();
    }

    Inside the method aio_front_scripts() you call a class Ultimate_Google_Font_Manager that you don’t define anywhere, and probably it’s not defined anymore in Ultimate VC Addons.

    The solution is. very simple:

    ...
    if( class_exists( 'Ultimate_Google_Font_Manager' ) ){
        $Ultimate_Google_Font_Manager = new Ultimate_Google_Font_Manager;
        $Ultimate_Google_Font_Manager->enqueue_selected_ultimate_google_fonts();
    }
    ...

    instead of this:

    ...
    $Ultimate_Google_Font_Manager = new Ultimate_Google_Font_Manager;
    $Ultimate_Google_Font_Manager->enqueue_selected_ultimate_google_fonts();
    ...

    and you solve the issue. Why you don’t want to correct your code?

    As said you don’t need to get access to the website. In your plugin, you use a class that is not defined in your plugin. On the course page in my case, that class doesn’t exist, and it triggers a fatal error.
    We can say your plugin has a bug already looking at the code. You don’t need to do any tests to confirm it.

    WHEN YOU USE A FUNCTION OR A CLASS THAT IS NOT DEFINED IN YOUR CODE YOU MUST CHECK THAT FUNCTION OR CLASS EXISTS BEFORE USING IT.
    Or you don’t agree with that?

    I strongly suggest checking the class before using it if you want to avoid conflicts with other plugins.

    • This reply was modified 2 years, 3 months ago by Jose.

    Hi, @giuse

    I apologize for the misunderstanding.
    Thank you for pointing out the problem to us. I have forwarded your comments to the development team for processing. The task has already been created.

    Best regards.

    Thread Starter Jose

    (@giuse)

    Hi @stanstm

    many thanks to you for forwarding my comments to the development team!

    Have a great day!

    Jose

    Plugin Support EricStylemixThemes

    (@ericstylemixthemes)

    You are welcome! ??

    Feel free to create new topics in case of new questions.

    Regards

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Fatal error on the course page’ is closed to new replies.