• Resolved schakko

    (@schakko)


    Hey guys,
    EAL does not work when wp-cli activates the plugin with

    
    /mnt/e/projects/schakko/schakko.de$ wp --path=src/wordpress/ plugin deactivate easy-affiliate-links
    

    It fails with:

    
    PHP Fatal error:  Uncaught Error: Class 'EAFL_Permalinks' not found in /mnt/e/projects/schakko/schakko.de/src/wp-content/plugins/easy-affiliate-links/includes/class-eafl-activator.php:31
    Stack trace:
    #0 /mnt/e/projects/schakko/schakko.de/src/wp-content/plugins/easy-affiliate-links/easy-affiliate-links.php(38): EAFL_Activator::activate()
    #1 /mnt/e/projects/schakko/schakko.de/src/wordpress/wp-includes/class-wp-hook.php(286): activate_easy_affiliate_links(NULL)
    #2 /mnt/e/projects/schakko/schakko.de/src/wordpress/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array)
    #3 /mnt/e/projects/schakko/schakko.de/src/wordpress/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
    #4 /mnt/e/projects/schakko/schakko.de/src/wordpress/wp-admin/includes/plugin.php(672): do_action('activate_easy-a...', NULL)
    #5 phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php(321): activate_plugin('easy-affiliate-...', '', NULL)
    #6 [internal function]: Plugin_Command->activate(Array, Array)
    #7 phar:///usr/local/bin/ in /mnt/e/projects/schakko/schakko.de/src/wp-content/plugins/easy-affiliate-links/includes/class-eafl-activator.php on line 31
    Fatal error: Uncaught Error: Class 'EAFL_Permalinks' not found in /mnt/e/projects/schakko/schakko.de/src/wp-content/plugins/easy-affiliate-links/includes/class-eafl-activator.php:31
    Stack trace:
    #0 /mnt/e/projects/schakko/schakko.de/src/wp-content/plugins/easy-affiliate-links/easy-affiliate-links.php(38): EAFL_Activator::activate()
    #1 /mnt/e/projects/schakko/schakko.de/src/wordpress/wp-includes/class-wp-hook.php(286): activate_easy_affiliate_links(NULL)
    #2 /mnt/e/projects/schakko/schakko.de/src/wordpress/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array)
    #3 /mnt/e/projects/schakko/schakko.de/src/wordpress/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
    #4 /mnt/e/projects/schakko/schakko.de/src/wordpress/wp-admin/includes/plugin.php(672): do_action('activate_easy-a...', NULL)
    #5 phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php(321): activate_plugin('easy-affiliate-...', '', NULL)
    #6 [internal function]: Plugin_Command->activate(Array, Array)
    #7 phar:///usr/local/bin/ in /mnt/e/projects/schakko/schakko.de/src/wp-content/plugins/easy-affiliate-links/includes/class-eafl-activator.php on line 31
    

    Can you please fix it by changing the file includes/class-eafl-activator.php to following (or restructure your loader):

    
    	public static function activate() {
    	    // FIX for getting EAFL to work with wp-cli
    	    include_once __DIR__ . "/admin/class-eafl-permalinks.php";
    
    		add_option( 'eafl_activated', true );
    		EAFL_Permalinks::set_flush_needed();
    	}
    

    Thank you in advance!

    • This topic was modified 6 years, 8 months ago by schakko.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Brecht

    (@brechtvds)

    Thanks for letting me know. Will look into it for the next update.

    Plugin Author Brecht

    (@brechtvds)

    Hi again,

    Just wanted to let you know that this problem should be fixed in the latest 3.1.0 version of the plugin.

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

The topic ‘Easy Affiliate Links does not work with wp-cli’ is closed to new replies.