-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclass-seodash.php
executable file
·145 lines (126 loc) · 3.06 KB
/
class-seodash.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
/**
* Plugin Name: Seo Dash Widget
* Plugin URI: https://www.kazilab.com/
* Description: PLugin to show the chart graph as dashboard widget
* Version: 1.0.0
* Author: Bogere Goldsoft
* Author URI: https://github.com/bogere
* Requires PHP: 5.4
* Text Domain: seo-dash
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Domain Path: /languages
*
* @package seo-dash
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // deny direct access to the plugin file by hackers.
}
if ( ! class_exists( 'SeoDash' ) ) {
/**
* Main School Pay class
*/
final class SeoDash {
/**
* Reference to plugin version
*
* @var string
*/
public $version = '1.0.0';
/**
* Plugin options key to store and retrieve settings in WordPress database
*
* @var string
*/
private $options_key = 'seo-dash';
/**
* Variable that holds the one and only instance of M-Alkhair
*
* @var SeoDash
*/
private static $seo_instance = null;
/**
* A dependency injection container
*
* @var Object
*/
public $container = null;
/**
* A MonoLog log object
*
* @var Object
*/
public $logger = null;
/**
* Load the global M-Alkhair instance
*
* @return SeoDash
*/
public static function get_instance() {
if ( is_null( self::$seo_instance ) ) {
self::$seo_instance = new self();
}
return self::$seo_instance;
}
/**
* Cloning is forbidden.
*
* @since 1.8.0
*/
public function __clone() {
_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'seo-dash' ), esc_html( $this->version ) );
}
/**
* Unserializing instances of this class is forbidden.
*
* @since 1.8.0
*/
public function __wakeup() {
_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'seo-dash' ), esc_html( $this->version ) );
}
/**
* Class constructor
*/
public function __construct() {
$this->define_constants();
$this->includes();
}
/**
* Papa Site constants
*/
private function define_constants() {
$this->define( 'SEO_DASH_VERSION', $this->version );
$this->define( 'SEO_DASH_SLUG', 'seo-dash' );
$this->define( 'SEO_DASH_DIR', plugin_dir_path( __FILE__ ) );
$this->define( 'SEO_DASH_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
$this->define( 'SEO_DASH_PLUGIN_FILE', __FILE__ );
$this->define( 'SEO_DASH_OPTIONS_KEY', $this->options_key );
}
/**
* Define constant if not already set.
*
* @param string $name variable.
* @param string|bool $value variable.
*/
private function define( $name, $value ) {
if ( ! defined( $name ) ) {
define( $name, $value );
}
}
/**
* Include required files
*/
private function includes() {
require_once SEO_DASH_DIR . '/includes/classes/class-classtable.php';
require_once SEO_DASH_DIR . '/includes/class-hook-registry.php';
}
}
/**
* Make Seo Dash class instance available globally
*/
function seo_dash() {
return SeoDash::get_instance();
}
seo_dash();
}