*/ class Pro_Upgrade { use Date; public $slug; protected $data = array(); /** * Construct method */ public function __construct() { $this->slug = Helper::slug_cleanup(); $this->set_data(); add_action( 'admin_footer', array($this, 'display_popup') ); } /** * Set merged data * * @return void * @author Jewel Theme */ public function set_data() { $this->data = Helper::get_merged_data( self::get_data() ); } /** * Get Sheet data * * @author Jewel Theme */ public static function get_data() { return get_option( 'pxlbsadminify_sheet_promo_data' ); } /** * Get Contents * * @param [type] $key . * * @author Jewel Theme */ public function get_content( $key ) { if ( empty( $this->data ) ) { return; } return $this->data[$key]; } /** * Display popup contents * * @author Jewel Theme */ public function display_popup() { if ( empty( $this->get_content( 'is_live' ) ) ) { $image_url = PXLBSADMINIFY_ASSETS_IMAGE . 'promo-image.png'; $notice = 'Use "SPECIAL40" to Get Flat 40% OFF'; $btn_url = 'https://wpadminify.com/pricing/'; $btn_text = 'GET THE DEAL'; } else { $image_url = $this->get_content( 'image_url' ); $notice = $this->get_content( 'notice' ); $btn_url = $this->get_content( 'button_url' ); $btn_text = $this->get_content( 'button_text' ); } ?> */ public function counter_date() { $endDate = $this->get_content( 'end_date' ); $is_active = $this->date_is_current_or_next( $endDate ); if ( $is_active ) { return $endDate; } return $this->date_increment( $this->current_time(), 3 ); } }