DB
2 months ago
Request
2 months ago
UI
2 months ago
Auth.php
2 months ago
Check_Email_Admin_Capability_Giver.php
2 months ago
Check_Email_Export_Log.php
2 months ago
Check_Email_From_Handler.php
2 months ago
Check_Email_Log.php
2 months ago
Check_Email_Logger.php
2 months ago
Check_Email_Multisite.php
2 months ago
Check_Email_Review.php
2 months ago
Loadie.php
2 months ago
Check_Email_Log.php
76 lines
| 1 | <?php namespace CheckEmail\Core; |
| 2 | defined( 'ABSPATH' ) || exit; // Exit if accessed directly. |
| 3 | /** |
| 4 | * The main plugin class. |
| 5 | */ |
| 6 | class Check_Email_Log { |
| 7 | |
| 8 | const VERSION = '1.0.12'; |
| 9 | |
| 10 | private $loaded = false; |
| 11 | |
| 12 | private $plugin_file; |
| 13 | |
| 14 | public $translations_path; |
| 15 | |
| 16 | public $loader; |
| 17 | |
| 18 | public $table_manager; |
| 19 | |
| 20 | private $loadies = array(); |
| 21 | |
| 22 | public function __construct( $file, $loader, $table_manager ) { |
| 23 | $this->plugin_file = $file; |
| 24 | $this->loader = $loader; |
| 25 | $this->table_manager = $table_manager; |
| 26 | |
| 27 | $this->add_loadie( $table_manager ); |
| 28 | |
| 29 | $this->translations_path = dirname( plugin_basename( $this->plugin_file ) ) . '/languages/' ; |
| 30 | } |
| 31 | |
| 32 | public function add_loadie( $loadie ) { |
| 33 | if ( $this->loaded ) { |
| 34 | return false; |
| 35 | } |
| 36 | |
| 37 | if ( ! $loadie instanceof Loadie ) { |
| 38 | return false; |
| 39 | } |
| 40 | |
| 41 | $this->loadies[] = $loadie; |
| 42 | |
| 43 | return true; |
| 44 | } |
| 45 | |
| 46 | public function load() { |
| 47 | if ( $this->loaded ) { |
| 48 | return; |
| 49 | } |
| 50 | |
| 51 | load_plugin_textdomain( 'check-email', false, $this->translations_path ); |
| 52 | |
| 53 | $this->table_manager->load(); |
| 54 | |
| 55 | foreach ( $this->loadies as $loadie ) { |
| 56 | $loadie->load(); |
| 57 | } |
| 58 | |
| 59 | $this->loaded = true; |
| 60 | // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound |
| 61 | do_action( 'check_email_loaded' ); |
| 62 | } |
| 63 | |
| 64 | public function get_version() { |
| 65 | return self::VERSION; |
| 66 | } |
| 67 | |
| 68 | public function get_plugin_path() { |
| 69 | return plugin_dir_path( $this->plugin_file ); |
| 70 | } |
| 71 | |
| 72 | public function get_plugin_file() { |
| 73 | return $this->plugin_file; |
| 74 | } |
| 75 | } |
| 76 |