• Resolved cruisetastic

    (@cruisetastic)


    I’m trying to run another plugin that uses The Parsedown class and we’ve finally figured out that I can’t run both this plugin and that one.

    Is it possible to remove the class or rename it? I’m told it’s used to parse the add-on plugins readme.txt content into a dataset internally.

    Cannot redeclare class Parsedown in /home/freelance/public_html/wp-content/plugins/sfwd-lms/includes/class-ld-bitbucket-api.php on line 464

Viewing 1 replies (of 1 total)
  • Plugin Author Chester McLaughlin

    (@chetmac)

    Airpress checks for the existence of the Parsedown class before attempting to include and instantiate, like this:

    if ( ! class_exists("Parsedown")){
    	require_once("lib/erusev/Parsedown.php");
    }
    
    if (!isset($parsedown)){
    	$parsedown = new Parsedown();
    	$parsedown->setBreaksEnabled(true);
    }
    

    I’m guessing that LearnDash does not do this and it is initiating AFTER Airpress causing this issue. I recommend altering the load order of plugins to place Airpress last using the following snippet in your functions.php file (you’ll have to activate a plugin for this code to run, so try deactivating any plugin and reactivating, or just activate/deactivate Hello Dolly):

    <?php
    function airpress_last() {
      $this_plugin = "airpress/airpress.php";
      $active_plugins = get_option('active_plugins');
      $this_plugin_key = array_search($this_plugin, $active_plugins);
      array_splice($active_plugins, $this_plugin_key, 1);
      array_push($active_plugins, $this_plugin);
      update_option('active_plugins', $active_plugins);
    }
    add_action("activated_plugin", "airpress_last");
    ?>

    Modified from: https://gist.github.com/bappi-d-great/26808240df88dd1fc3fe

Viewing 1 replies (of 1 total)
  • The topic ‘Fatal Error in Activation’ is closed to new replies.