You might have come across this very common error while building your site with WordPress.

When you install and activate a plugin or when you try to access plugin page, you might encounter this issue.

Though there are a number of reasons for this to happen, there is one reason that becomes relevant when you encounter this while using Woo Discount Rules.

In some installations, plugins or themes might be using the wp_loaded hook with a wrong priority. This messes up the other plugins that depends on it.

Here is how to fix it when you come across this error when activating or using Woo Discount Rules.

Edit /wp-content/plugins/woo-discount-rules/woo-discount-rules.php

Change this line 

include_once('loader.php');

to

add_action( 'wp_loaded', function () {
    include_once('loader.php');
}, 0); 

Save.

That should fix the issue.

If that does not fix the issue, please review this article explaining all other possible causes

Did this answer your question?