plugin_file = $file; $this->loader = $loader; $this->table_manager = $table_manager; $this->add_loadie( $table_manager ); $this->translations_path = dirname( plugin_basename( $this->plugin_file ) ) . '/languages/' ; } /** * Set Licenser. * * @param \EmailLog\Addon\License\Licenser $licenser Add-on Licenser. */ public function set_licenser( $licenser ) { if ( $this->add_loadie( $licenser ) ) { $this->licenser = $licenser; } } /** * Get Licenser. * * @return null|\EmailLog\Addon\License\Licenser */ public function get_licenser() { return $this->licenser; } /** * Add an Email Log Loadie. * The `load()` method of the Loadies will be called when Email Log is loaded. * * @param \EmailLog\Core\Loadie $loadie Loadie to be loaded. * * @return bool False if Email Log is already loaded or if $loadie is not of `Loadie` type. True otherwise. */ public function add_loadie( $loadie ) { if ( $this->loaded ) { return false; } if ( ! $loadie instanceof Loadie ) { return false; } $this->loadies[] = $loadie; return true; } /** * Load the plugin. */ public function load() { if ( $this->loaded ) { return; } load_plugin_textdomain( 'email-log', false, $this->translations_path ); $this->table_manager->load(); foreach ( $this->loadies as $loadie ) { $loadie->load(); } $this->loaded = true; /** * Email Log plugin loaded. * * @since 2.0 */ do_action( 'el_loaded' ); } /** * Return Email Log version. * * @return string Email Log Version. */ public function get_version() { return self::VERSION; } /** * Return the Email Log plugin directory path. * * @return string Plugin directory path. */ public function get_plugin_path() { return plugin_dir_path( $this->plugin_file ); } /** * Return the Email Log plugin file. * * @since 2.0.0 * * @return string Plugin directory path. */ public function get_plugin_file() { return $this->plugin_file; } /** * Get Email Log Store URL. * * @since 2.0.0 * * @return string Store URL */ public function get_store_url() { return self::STORE_URL; } }