| Server IP : 69.72.244.102 / Your IP : 216.73.216.164 Web Server : LiteSpeed System : Linux s3434.fra1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64 User : konzalta ( 1271) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/konzalta/public_html/wp-content/plugins/wemail/includes/Admin/ |
Upload File : |
<?php
namespace WeDevs\WeMail\Admin;
use WeDevs\WeMail\Traits\Hooker;
class Admin {
use Hooker;
public function __construct() {
$this->add_action( 'admin_init', 'redirect_after_activation', 9999 );
$this->includes();
Notice::instance()->connect_notice();
ReviewNotice::instance()->connect_review_notice();
}
private function includes() {
new Scripts();
new Menu();
new FormPreview();
if ( current_user_can( 'edit_posts' ) && wemail_validate_boolean( get_user_option( 'rich_editing' ) ) ) {
new Shortcode();
}
}
public function remove_admin_notice() {
remove_all_actions( 'admin_notices' );
}
/**
* Redirect to wemail setup page after plugin installation
*
* If the setup isn't done, it'll be redirected to the wemail page,
* also that redirects to the authentication page.
*
* @return void
*/
public function redirect_after_activation() {
if ( ! get_transient( 'wemail_activation_redirect' ) || wemail()->user->api_key ) {
return;
}
delete_transient( 'wemail_activation_redirect' );
// Only do this for single site installs.
if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
return;
}
wp_safe_redirect( admin_url( 'admin.php?page=wemail' ) );
exit;
}
}