Done !
Server IP : 162.0.217.223 / Your IP : 216.73.216.150 Web Server : LiteSpeed System : Linux premium269.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : mypckeys ( 1539) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/mypckeys/yeslicense.org/wp-content/plugins/yaymail/src/Notices/ |
Upload File : |
<?php namespace YayMail\Notices; use YayMail\Utils\SingletonTrait; /** * * @method static Ajax get_instance() */ class Ajax { use SingletonTrait; protected function __construct() { $this->init_hooks(); } protected function init_hooks() { add_action( 'wp_ajax_yaymail_dismiss_suggest_addons_notice', [ $this, 'yaymail_dismiss_suggest_addons_notice' ] ); add_action( 'wp_ajax_yaymail_dismiss_upgrade_notice', [ $this, 'yaymail_dismiss_upgrade_notice' ] ); } public function yaymail_dismiss_suggest_addons_notice() { $nonce = isset( $_POST['nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['nonce'] ) ) : ''; if ( ! wp_verify_nonce( $nonce, 'yaymail_nonce' ) ) { return wp_send_json_error( [ 'mess' => __( 'Verify nonce failed', 'yaymail' ) ] ); } try { // The Notice should comeback after 60 days update_option( 'yaymail_next_recommendation_suggest_addons_notice_time', time() + 60 * 60 * 24 * 60 ); wp_send_json_success(); } catch ( \Error $error ) { yaymail_get_logger( $error ); } catch ( \Exception $exception ) { yaymail_get_logger( $exception ); } } public function yaymail_dismiss_upgrade_notice() { $nonce = isset( $_POST['nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['nonce'] ) ) : ''; if ( ! wp_verify_nonce( $nonce, 'yaymail_nonce' ) ) { return wp_send_json_error( [ 'mess' => __( 'Verify nonce failed', 'yaymail' ) ] ); } try { // The Notice should comeback after 60 days update_option( 'yaymail_next_recommendation_upgrade_notice_time', time() + 60 * 60 * 24 * 60 ); wp_send_json_success(); } catch ( \Error $error ) { yaymail_get_logger( $error ); } catch ( \Exception $exception ) { yaymail_get_logger( $exception ); } } }