set_notice_time(); $this->set_temporary_dismiss_notice_time(); $this->set_dismiss_notice(); } private function set_notice_time() { if ( ! get_option( 'zakra_upgrade_notice_start_time' ) ) { update_option( 'zakra_upgrade_notice_start_time', time() ); } } private function set_temporary_dismiss_notice_time() { if ( isset( $_GET['zakra_notice_dismiss_temporary'] ) && 'upgrade' === $_GET['zakra_notice_dismiss_temporary'] ) { update_user_meta( $this->current_user_id, 'zakra_upgrade_notice_dismiss_temporary_start_time', time() ); } } public function set_dismiss_notice() { if ( ! function_exists( 'is_plugin_active' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } /** * Do not show notice if: * * 1. Zakra Pro plugin is active. * 2. It has not been 5 days since the theme is activated. * 3. If the user has ignored the message partially for 2 days. * 4. Dismiss always if clicked on 'Dismiss' button. */ if ( is_plugin_active( 'zakra-pro/zakra-pro.php' ) || get_option( 'zakra_upgrade_notice_start_time' ) > strtotime( '-5 day' ) || get_user_meta( get_current_user_id(), 'zakra_upgrade_notice_dismiss', true ) || get_user_meta( get_current_user_id(), 'zakra_upgrade_notice_dismiss_temporary_start_time', true ) > strtotime( '-2 day' ) ) { add_filter( 'zakra_upgrade_notice_dismiss', '__return_true' ); } else { add_filter( 'zakra_upgrade_notice_dismiss', '__return_false' ); } } public function notice_markup() { ?>

' . esc_html( $current_user->display_name ) . '', 'Zakra', 'ZTFREEUSER', '35%' ); ?>