* * @return boolean true if WooCommerce Germanized is activated */ public function is_woocommerce_gzd_activated() { return $this->is_plugin_activated('woocommerce-germanized/woocommerce-germanized.php'); } /** * Checks if WooCommerce is activated * * @return boolean true if WooCommerce is activated */ public function is_woocommerce_activated() { return $this->is_plugin_activated('woocommerce/woocommerce.php'); } public function is_loadable() { return $this->loadable; } public function dependencies_notice() { include_once 'admin/views/html-notice-dependencies.php'; } public function version_notice() { include_once 'admin/views/html-notice-versions.php'; } } WC_GZDP_Dependencies::instance();
/** * adds some initialization hooks and inits WooCommerce Germanized */ public function __construct() { // Auto-load classes on demand if (function_exists("__autoload")) { spl_autoload_register("__autoload"); } spl_autoload_register(array($this, 'autoload')); $this->plugin_file = plugin_basename(__FILE__); // Always load textdomain add_action('plugins_loaded', array($this, 'load_plugin_textdomain')); // Check if dependecies are installed and up to date $init = WC_GZDP_Dependencies::instance(); if (!$init->is_loadable()) { return; } // Define constants $this->define_constants(); do_action('woocommerce_gzdp_before_load'); // Vendidero include_once 'includes/vendidero/vendidero-functions.php'; $this->includes(); $this->load_modules(); // Hooks add_action('init', array($this, 'init'), 1); add_filter('plugin_action_links_' . $this->plugin_file, array($this, 'action_links')); add_action('pre_get_posts', array($this, 'hide_invoice_attachments')); add_filter('vendidero_updateable_products', array($this, 'register_updates')); // Loaded action do_action('woocommerce_gzdp_loaded'); }