diff --git a/eth-amp-analytics-wp.php b/eth-amp-analytics-wp.php index 363b81a6e2d4d337f8e6de510e68e8b2641b0744..c55559a8338f7eb6d6bc48a7f84203a75f14641c 100644 --- a/eth-amp-analytics-wp.php +++ b/eth-amp-analytics-wp.php @@ -61,11 +61,18 @@ class ETH_AMP_Analytics_WP { private $options = null; /** - * Register actions and filters + * Defer plugin action loading until all plugins are loaded * * @return null */ private function __construct() { + add_action( 'plugins_loaded', array( $this, 'action_plugins_loaded' ) ); + } + + /** + * Register actions and filters + */ + public function action_plugins_loaded() { if ( ! defined( 'AMP__FILE__' ) ) { return; }