pro_extenstions();
$this->fs = freemius( 10461 );
$hide_notice = get_transient( 'post_smtp_skip_banner' );
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
$this->fs->add_action( 'addons/after_addons', array( $this, 'promote_bundles_fs' ) );
if( !post_smtp_has_pro() ) {
add_action( 'admin_menu', array( $this, 'add_menu' ), 22 );
}
if( !post_smtp_has_pro() && !$hide_notice ){
add_action( 'post_smtp_dashboard_after_config', array( $this, 'promote_bundles_dashboard' ) );
}
add_filter( 'gettext', array( $this, 'change_fs_submenu_text' ), 10, 3 );
add_action( 'admin_action_ps_skip_pro_banner', array( $this, 'skip_pro_banner' ) );
}
/**
* Gather pro extenstions
*
* @since 2.2
* @version 1.0
*/
public function pro_extenstions() {
if( !class_exists( 'Post_Smtp_Office365' ) ) {
$this->data[] = array(
'extenstion' => 'Office365 API (Pro)',
'logo' => POST_SMTP_ASSETS . 'images/logos/office365.png',
'pro' => POST_SMTP_ASSETS . 'images/icons/pro.png',
'url' => 'https://postmansmtp.com/extensions/office-365-extension-for-post-smtp/'
);
}
if( !class_exists( 'Post_Smtp_Amazon_Ses' ) ) {
$this->data[] = array(
'extenstion' => 'Amazon SES (Pro)',
'logo' => POST_SMTP_ASSETS . 'images/logos/amazonses.png',
'pro' => POST_SMTP_ASSETS . 'images/icons/pro.png',
'url' => 'https://postmansmtp.com/extensions/post-smtp-extension-for-amazon-ses/'
);
}
if( !class_exists( 'PostSMTP_ZohoMail' ) ) {
$this->data[] = array(
'extenstion' => 'Zoho (Pro)',
'logo' => POST_SMTP_ASSETS . 'images/logos/zoho.jpg',
'pro' => POST_SMTP_ASSETS . 'images/icons/pro.png',
'url' => 'https://postmansmtp.com/extensions/zoho-mail-pro-extension/'
);
}
}
/**
* Enqueue Script | Action call-back
*
* @since 2.2
* @version 1.0
*/
public function admin_enqueue_scripts( $hook ) {
$pluginData = apply_filters( 'postman_get_plugin_metadata', null );
wp_register_script( 'postman-suggest-pro-sockets', POST_SMTP_ASSETS . 'js/postman-admin.js', array( 'jquery' ), '1.2.5' , true );
wp_enqueue_script( 'postman-suggest-pro-sockets' );
$this->data['lessSecureNotice'] = wp_create_nonce( 'less-secure-security' );
wp_localize_script(
'postman-suggest-pro-sockets',
'postmanPro',
$this->data
);
wp_register_style( 'extension-ui-fonts', 'https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap', array(), $pluginData['version'], 'all' );
if ( 'post-smtp_page_extensions' === $hook ) {
wp_enqueue_style( 'extensions-ui', plugin_dir_url( __FILE__ ) . 'assets/css/extensions-ui.css', array( 'extension-ui-fonts' ), $pluginData['version'], 'all' );
wp_enqueue_script( 'extensions-ui', plugin_dir_url( __FILE__ ) . 'assets/js/extensions-ui.js', array( 'jquery' ), $pluginData['version'], true );
}
}
/**
* Promote bundles HTML
*
* @since 2.5.9.3
* @version 1.0.1
*/
public function promote_bundles_html() {
?>
promote_bundles_html(); ?>
promote_bundles_html(); ?>
%s',
esc_html__( 'Get', 'post-smtp' ),
esc_html__( 'Pro Bundle', 'post-smtp' )
);
}
return $translated_text;
}
/**
* Skip Pro banner
*
* @since 2.6.0
* @version 1.0.0
*/
public function skip_pro_banner() {
if( isset( $_GET['action'] ) && $_GET['action'] == 'ps_skip_pro_banner' ) {
set_transient( 'post_smtp_skip_banner', 23668200 );
wp_redirect( admin_url( 'admin.php?page=postman' ) );
}
}
/**
* Add menu
*
* @since 2.8.6
* @version 1.0.0
*/
public function add_menu() {
if( postman_is_bfcm() ) {
$menu_text = sprintf(
'%1$s',
__( 'Extensions', 'post-smtp' ),
'24%OFF'
);
}
else {
$menu_text = sprintf( ' %1$s', __( 'Extensions', 'post-smtp' ) );
}
add_submenu_page(
PostmanViewController::POSTMAN_MENU_SLUG,
__( 'Extensions', 'post-smtp' ),
$menu_text,
'manage_options',
'extensions',
array( $this, 'extensions' ),
99
);
}
public function extensions() {
$images_url = plugin_dir_url( __FILE__ ) . 'assets/images/';
$sockets = array(
array(
'logo' => $images_url . 'logos/office365.png',
'title' => esc_html__( 'Office / Microsoft 365', 'post-smtp' ),
'description' => esc_html__( 'Integrate your WordPress site with your Office 365 / Microsoft 365 account to improve email deliverability.', 'post-smtp' ),
),
array(
'logo' => $images_url . 'logos/amazonses.png',
'title' => esc_html__( 'Amazon SES', 'post-smtp' ),
'description' => esc_html__( 'Integrate your WordPress site with your Amazon SES account to improve email deliverability.', 'post-smtp' ),
),
array(
'logo' => $images_url . 'logos/zoho.png',
'title' => esc_html__( 'Zoho Mail', 'post-smtp' ),
'description' => esc_html__( 'Integrate your WordPress site with your Zoho Mail account to improve email deliverability.', 'post-smtp' ),
),
array(
'logo' => $images_url . 'logos/wizard-google.png',
'title' => __( 'Google One-Click SMTP', 'post-smtp-pro' ),
'description' => __( 'Instantly connect with Google Workspace (Gmail) SMTP by authorizing your Google account.', 'post-smtp-pro' ),
),
array(
'logo' => $images_url . 'logos/office365.png',
'title' => __( 'Microsoft 365 One-Click SMTP', 'post-smtp-pro' ),
'description' => __( 'Instantly connect with your Microsoft 365/ Office 365 account without manually configuring your own app.', 'post-smtp-pro' ),
),
);
$bonus = array(
'email-logs-attachment' =>
array(
'logo' => $images_url . 'logos/email-delivery-log.png',
'title' => __( 'Email Log Attachment', 'post-smtp-pro' ),
'description' => __( 'View and resend any email attachment right from you email log screen to streamline email communication.', 'post-smtp-pro' )
),
array(
'logo' => $images_url . 'logos/advance-logs-filter.svg',
'title' => esc_html__( 'Advance Logs\' Filter', 'post-smtp-pro' ),
'description' => esc_html__( 'Get more advance logs filter with all technical details', 'post-smtp' ),
),
array(
'logo' => $images_url . 'logos/report-tracking.png',
'title' => esc_html__( 'Reporting and Tracking', 'post-smtp' ),
'description' => esc_html__( 'Monitor email delivery status with daily, weekly, and monthly reports and track opened emails to analyze email performance.', 'post-smtp' ),
),
array(
'logo' => $images_url . 'logos/twilio-sms-notification.png',
'title' => esc_html__( 'Twilio SMS Notification', 'post-smtp' ),
'description' => esc_html__( 'Configure and receive all your WordPress email failure alerts through SMS by connecting your Twilio account.', 'post-smtp' ),
),
array(
'logo' => $images_url . 'logos/email-delivery-and-logs.png',
'title' => esc_html__( 'Email Delivery and Logs', 'post-smtp' ),
'description' => esc_html__( 'Send emails from the back-end, manage your email quota, retry failed emails, and delete log history to optimize email delivery.', 'post-smtp' ),
),
array(
'logo' => $images_url . 'logos/microsoft-teams.png',
'title' => esc_html__( 'Microsoft Teams Notification', 'post-smtp' ),
'description' => esc_html__( 'Set up and receive all your WordPress email failure alerts through webhook URL of your MS Teams.', 'post-smtp' ),
),
);
$features = array(
esc_attr__( 'Office365, Amazon SES, and Zoho SMTP', 'post-smtp' ),
esc_attr__( 'Resend failed emails in bulk', 'post-smtp' ),
esc_attr__( 'Auto-resend failed emails', 'post-smtp' ),
esc_attr__( 'Open emails tracking', 'post-smtp' ),
esc_attr__( 'Google / Microsoft One-Click Setup', 'post-smtp' ),
esc_attr__( 'Post SMTP Mobile App Pro', 'post-smtp' ),
);
ob_start();
?>