| 1 |
<?php |
| 2 |
/** |
| 3 |
* The file that defines the core plugin class |
| 4 |
* |
| 5 |
* A class definition that includes attributes and functions used across both the |
| 6 |
* public-facing side of the site and the admin area. |
| 7 |
* |
| 8 |
* @link https://posimyth.com/ |
| 9 |
* @since 1.0.0 |
| 10 |
* |
| 11 |
* @package Wdesignkit |
| 12 |
* @subpackage Wdesignkit/includes |
| 13 |
*/ |
| 14 |
|
| 15 |
if ( ! defined( 'ABSPATH' ) ) { |
| 16 |
exit; // Exit if accessed directly. |
| 17 |
} |
| 18 |
|
| 19 |
if ( ! class_exists( 'Wdkit_Notice_Main' ) ) { |
| 20 |
|
| 21 |
/** |
| 22 |
* Wdkit_Notice_Main |
| 23 |
* |
| 24 |
* @since 1.0.0 |
| 25 |
*/ |
| 26 |
class Wdkit_Notice_Main { |
| 27 |
|
| 28 |
/** |
| 29 |
* Singleton instance variable. |
| 30 |
* |
| 31 |
* @var instance|null The single instance of the class. |
| 32 |
*/ |
| 33 |
private static $instance; |
| 34 |
|
| 35 |
/** |
| 36 |
* Singleton instance getter method. |
| 37 |
* |
| 38 |
* @since 1.0.0 |
| 39 |
* @return self The single instance of the class. |
| 40 |
*/ |
| 41 |
public static function get_instance() { |
| 42 |
if ( ! isset( self::$instance ) ) { |
| 43 |
self::$instance = new self(); |
| 44 |
} |
| 45 |
|
| 46 |
return self::$instance; |
| 47 |
} |
| 48 |
|
| 49 |
/** |
| 50 |
* Constructor for the core functionality of the plugin. |
| 51 |
* |
| 52 |
* @since 1.0.0 |
| 53 |
*/ |
| 54 |
public function __construct() { |
| 55 |
$this->wdkit_notice_fileload(); |
| 56 |
$this->wdkit_unique_id(); |
| 57 |
} |
| 58 |
|
| 59 |
/** |
| 60 |
* Loads the file for setting plugin page notices. |
| 61 |
* |
| 62 |
* @since 1.0.0 |
| 63 |
*/ |
| 64 |
public function wdkit_notice_fileload() { |
| 65 |
|
| 66 |
if ( is_admin() && current_user_can( 'manage_options' ) ) { |
| 67 |
/**Remove Key In Databash*/ |
| 68 |
include WDKIT_PATH . 'includes/admin/notices/class-wdkit-notices-remove.php'; |
| 69 |
include WDKIT_PATH . 'includes/admin/notices/class-wdkit-plugin-page.php'; |
| 70 |
} |
| 71 |
|
| 72 |
if ( is_admin() ) { |
| 73 |
include WDKIT_PATH . 'includes/admin/notices/class-wdkit-deactivate-feedback.php'; |
| 74 |
} |
| 75 |
|
| 76 |
// if ( current_user_can( 'manage_options' ) ) { |
| 77 |
// if ( is_user_logged_in() ) { |
| 78 |
// include WDKIT_PATH . 'includes/admin/notices/class-wdkit-review-form.php'; |
| 79 |
// } |
| 80 |
// } |
| 81 |
|
| 82 |
/**Add Banner For Reating after 3 day*/ |
| 83 |
// include WDKIT_PATH . 'includes/admin/notices/class-wdkit-rating.php'; |
| 84 |
} |
| 85 |
|
| 86 |
/** |
| 87 |
* Loads the file for setting plugin page notices. |
| 88 |
* |
| 89 |
* @since 1.0.0 |
| 90 |
*/ |
| 91 |
public function wdkit_unique_id() { |
| 92 |
|
| 93 |
if ( empty( get_option( 'wdkit_unique_id' ) ) ) { |
| 94 |
|
| 95 |
$year = substr(date('Y'), -2); |
| 96 |
$number = mt_rand() / mt_getrandmax(); |
| 97 |
$base36 = base_convert( substr((string)$number, 2), 10, 36 ); |
| 98 |
$uid = substr($base36, 0, 8); |
| 99 |
$wdkit_unique_id = $year . '-' . $uid; |
| 100 |
|
| 101 |
add_option( 'wdkit_unique_id', $wdkit_unique_id ); |
| 102 |
} |
| 103 |
} |
| 104 |
} |
| 105 |
|
| 106 |
Wdkit_Notice_Main::get_instance(); |
| 107 |
} |