• Resolved RakieM

    (@rakiem)


    Hi there,

    When you deactivate LearnDash LMS on pages etc, it throws a critical error. As an example you cannot deactivate this on a Homepage. There is no reason to have it running on the home page. This goes the same for posts. This is something i have been experiencing for a while but was not able to get to the bottom of it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jose

    (@giuse)

    Hi @rakiem,

    probably a third plugin that depends on LearnDash calls the homepage on other pages, maybe as an iframe or a remote request.
    Usually, when they do that, they call the homepage URL with some additional query arguments, e.g. https://yoursite.com?arg1=value1&arg2=value2…

    The URL https://yoursite.com?arg1=value1&arg2=value2 of the example above triggers the FDP settings of the homepage, and FDP disables the plugins that you have disabled on the homepage.

    If this is the cause of the issue, you will solve it by doing so:

    • Go to Custom URLs => Frontend URLs
    • Add a row with the pattern [home]?*
    • Keep LearnDash enabled on that row
    • Save the changes

    [home]?* matches whatever URL that looks like https://yoursite.com?arg1=value1&arg2=value2..

    Let me know if it helps.

    Have a great day!

    Jose

    Thread Starter RakieM

    (@rakiem)

    Jose thank you.

    This was very helpful. I managed to pinpoint the issue. IT was our very own plugin “Certificate Tracker Pro for LearnDash”. We are going to have to tweak our plugin. Our other plugins are fine. It’s just this one.

    Thank you so much.

    Plugin Author Jose

    (@giuse)

    Hi @rakiem,

    Perfect! I suggest you always use if( function_exists( … ) )…., if( class_exists( … ) ) …. instead of if( in_array( $plugin, get_option( ‘active_plugins’ ) ) … to check if LearnDash or whatever plugin is active.

    The option get_option( ‘active_plugins’ ) is filtered by Freesoul Deactivate Plugins to do its job, but FDP has to remove all its filters before the first standard plugin loads. This is to avoid more serious issues like having a plugin that is globally disabled.
    There are some plugins that if they see a certain plugin is not active, then they disable themselves by updating the option ‘active_plugins’.
    If this kind of plugin does it when the filter of FDP is still there, then you can imagine the result. The plugins that were disabled by FDP using the filter are disabled globally, and you find them disabled on the page of plugins.

    My suggestion is never to use get_option( ‘active_plugins’ ) to check if a certain plugin is active, but always check the function or class that you are going to use in your code.

    Have a great day!

    Jose

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘LearnDash LMS critical error’ is closed to new replies.