compare_date = (int) strtotime('now'); if ( current_user_can('administrator') ) { if ( empty(get_option('bard_update_to_pro_dismiss_notice', false)) ) { add_action( 'admin_init', [$this, 'check_theme_install_time'] ); } } if ( is_admin() ) { add_action( 'admin_head', [$this, 'enqueue_scripts' ] ); } add_action( 'wp_ajax_bard_update_to_pro_dismiss_notice', [$this, 'bard_update_to_pro_dismiss_notice'] ); add_action( 'wp_ajax_bard_update_to_pro_maybe_later', [$this, 'bard_update_to_pro_maybe_later'] ); } public function check_theme_install_time() { $install_date = (int) get_option('bard_activation_time_update_to_pro'); if ( get_option('bard_update_to_pro_maybe_later_time') != false && !(($this->compare_date - $install_date) >= 172800) ) { return; } add_action( 'admin_notices', [$this, 'render_update_to_pro_notice' ]); if ( get_option('bard_update_to_pro_maybe_later_time') != false && (($this->compare_date - $install_date) >= 172800) ) { delete_option('bard_update_to_pro_maybe_later_time'); } } public function bard_update_to_pro_dismiss_notice() { update_option( 'bard_update_to_pro_dismiss_notice', true ); } public function bard_update_to_pro_maybe_later() { update_option('bard_update_to_pro_maybe_later_time', true); delete_option('bard_activation_time_update_to_pro'); } public function render_update_to_pro_notice() { global $pagenow; if ( is_admin() ) { echo '
'; } } public function enqueue_scripts() { echo " "; } } if ( 'Bard' === wp_get_theme()->get('Name')) { new bardUpdateToProNotice(); }