??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/pgtankstorage.sg/wp-content/plugins/suremails/inc/api/notice.php
⬅ Kembali
<?php
/**
* Disable admin notice API.
*
* @package SureMails\Inc\API
* @since 1.7.0
*/
namespace SureMails\Inc\API;
use SureMails\Inc\Traits\Instance;
use WP_REST_Request;
use WP_REST_Response;
use WP_REST_Server;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Class Notice
*
* Handles the notice dismissal REST API endpoints.
*/
class Notice extends Api_Base {
use Instance;
/**
* Route base.
*
* @var string
*/
protected $rest_base = '/disable-notice';
/**
* Register API routes.
*
* @since 1.7.0
* @return void
*/
public function register_routes() {
// Configuration notice dismissal (15 days).
register_rest_route(
$this->get_api_namespace(),
$this->rest_base,
[
[
'methods' => WP_REST_Server::EDITABLE,
'callback' => [ $this, 'handle_configuration_notice' ],
'permission_callback' => [ $this, 'validate_permission' ],
],
]
);
// Menu location notice dismissal (permanent).
register_rest_route(
$this->get_api_namespace(),
'/disable-menu-location-notice',
[
[
'methods' => WP_REST_Server::EDITABLE,
'callback' => [ $this, 'handle_menu_location_notice' ],
'permission_callback' => [ $this, 'validate_permission' ],
],
]
);
// SureContact cross-sell promo dismissal (15 days).
register_rest_route(
$this->get_api_namespace(),
'/disable-surecontact-promo',
[
[
'methods' => WP_REST_Server::EDITABLE,
'callback' => [ $this, 'handle_surecontact_promo' ],
'permission_callback' => [ $this, 'validate_permission' ],
],
]
);
// SureContact SMTP launch promo dismissal (15 days).
register_rest_route(
$this->get_api_namespace(),
'/disable-surecontact-smtp-promo',
[
[
'methods' => WP_REST_Server::EDITABLE,
'callback' => [ $this, 'handle_surecontact_smtp_promo' ],
'permission_callback' => [ $this, 'validate_permission' ],
],
]
);
// SureContact custom sending domain nudge dismissal (15 days).
register_rest_route(
$this->get_api_namespace(),
'/disable-surecontact-custom-domain-promo',
[
[
'methods' => WP_REST_Server::EDITABLE,
'callback' => [ $this, 'handle_surecontact_custom_domain_promo' ],
'permission_callback' => [ $this, 'validate_permission' ],
],
]
);
}
/**
* Disable configuration notice for 15 days.
*
* @param WP_REST_Request<array<string, mixed>> $request The request object.
* @return WP_REST_Response
*/
public function handle_configuration_notice( $request ) {
// Calculate "now + 15 days".
$expiry_time = time() + ( 1296000 );
update_option( 'suremails_notice_dismissal_time', $expiry_time );
return rest_ensure_response(
[
'success' => true,
'message' => __( 'Notice disabled for 15 days.', 'suremails' ),
]
);
}
/**
* Disable menu location notice permanently (one-time dismissal).
*
* @param WP_REST_Request<array<string, mixed>> $request The request object.
* @return WP_REST_Response
*/
public function handle_menu_location_notice( $request ) {
// Set a permanent flag - notice will never show again once dismissed.
update_option( 'suremails_menu_notice_dismissed', true );
return rest_ensure_response(
[
'success' => true,
'message' => __( 'Menu location notice dismissed.', 'suremails' ),
]
);
}
/**
* Dismiss the SureContact cross-sell promo for 15 days.
*
* @param WP_REST_Request<array<string, mixed>> $request The request object.
* @return WP_REST_Response
*/
public function handle_surecontact_promo( $request ) {
// Calculate "now + 15 days".
$expiry_time = time() + ( 1296000 );
update_option( 'suremails_surecontact_promo_dismissal_time', $expiry_time );
return rest_ensure_response(
[
'success' => true,
'message' => __( 'SureContact promo dismissed for 15 days.', 'suremails' ),
]
);
}
/**
* Dismiss the SureContact SMTP launch promo for 15 days.
*
* @param WP_REST_Request<array<string, mixed>> $request The request object.
* @return WP_REST_Response
*/
public function handle_surecontact_smtp_promo( $request ) {
// Calculate "now + 15 days".
$expiry_time = time() + ( 1296000 );
update_option( 'suremails_surecontact_smtp_promo_dismissal_time', $expiry_time );
return rest_ensure_response(
[
'success' => true,
'message' => __( 'SureContact SMTP promo dismissed for 15 days.', 'suremails' ),
]
);
}
/**
* Dismiss the SureContact custom sending domain nudge for 15 days.
*
* @param WP_REST_Request<array<string, mixed>> $request The request object.
* @return WP_REST_Response
*/
public function handle_surecontact_custom_domain_promo( $request ) {
// Calculate "now + 15 days".
$expiry_time = time() + ( 1296000 );
update_option( 'suremails_surecontact_custom_domain_promo_dismissal_time', $expiry_time );
return rest_ensure_response(
[
'success' => true,
'message' => __( 'SureContact custom domain nudge dismissed for 15 days.', 'suremails' ),
]
);
}
}
// Initialize the Notice singleton.
Notice::instance();
Nama
Tipe
Ukuran
Diubah
Aksi
🐘 api-base.php
php
1.8 KB
2026-06-24 02:23
🐘 api-init.php
php
1.7 KB
2026-06-24 02:23
🐘 auth.php
php
2.4 KB
2026-06-24 02:23
🐘 content-guard.php
php
6.6 KB
2026-06-24 02:23
🐘 dashboard-data.php
php
3.8 KB
2026-06-24 02:23
🐘 delete-connection.php
php
8.4 KB
2026-06-24 02:23
🐘 delete-logs.php
php
4.4 KB
2026-06-24 02:23
🐘 email-stats.php
php
4.1 KB
2026-06-24 02:23
🐘 get-settings.php
php
1.8 KB
2026-06-24 02:23
🐘 logs.php
php
5.8 KB
2026-06-24 02:23
🐘 notice.php
php
5.1 KB
2026-06-24 02:23
🐘 onboarding.php
php
1.9 KB
2026-06-24 02:23
🐘 otto-kit.php
php
1.6 KB
2026-06-24 02:23
🐘 provider.php
php
2.6 KB
2026-06-24 02:23
🐘 recommended-plugin.php
php
4 KB
2026-06-24 02:23
🐘 resend-email.php
php
3.8 KB
2026-06-24 02:23
🐘 save-test-connection.php
php
21.2 KB
2026-06-24 02:23
🐘 send-test-email.php
php
5.2 KB
2026-06-24 02:23
🐘 set-settings.php
php
7.7 KB
2026-06-24 02:23
🐘 sure-contact-plans.php
php
3.8 KB
2026-06-24 02:23
🐘 sure-contact-provision.php
php
9.7 KB
2026-06-24 02:23
🐘 sure-contact-resend-verification.php
php
4.8 KB
2026-06-24 02:23
🐘 sure-contact-saas-disconnect.php
php
7.8 KB
2026-06-24 02:23
🐘 sure-contact-sending-domains.php
php
3.8 KB
2026-06-24 02:23
🐘 sure-contact-status.php
php
4.7 KB
2026-06-24 02:23
🐘 sure-contact-verify.php
php
1.7 KB
2026-06-24 02:23