GoSMTP Test Email Sent Successfully!
CONGRATS!
Your test email was sent successfully using GoSMTP.
Thank you for choosing GoSMTP — a simple and reliable way to ensure your WordPress emails are delivered smoothly and securely.
GoSMTP helps you connect with popular email providers and monitor your outgoing emails easily.
Visit GoSMTP
Need help? You can contact the GoSMTP Team via email.
Our email address is support@gosmtp.net
or through Our Premium Support Ticket System here
';
}
// Auto update free version after update pro version
function gosmtp_pro_update_free_after_pro($upgrader_object, $options){
// Check if the action is an update for the plugins
if($options['action'] != 'update' || $options['type'] != 'plugin'){
return;
}
// Define the slugs for the free and pro plugins
$free_slug = 'gosmtp/gosmtp.php';
$pro_slug = 'gosmtp-pro/gosmtp-pro.php';
// Check if the pro plugin is in the list of updated plugins
if(
(isset($options['plugins']) && in_array($pro_slug, $options['plugins']) && !in_array($free_slug, $options['plugins'])) ||
(isset($options['plugin']) && $pro_slug == $options['plugin'])
){
// Trigger the update for the free plugin
$current_version = gosmtp_pro_get_free_version_num();
if(empty($current_version)){
return;
}
$GLOBALS['gosmtp_pro_is_upgraded'] = true;
// This will set the 'update_plugins' transient again
wp_update_plugins();
// Check for updates for the free plugin
$update_plugins = get_site_transient('update_plugins');
if(empty($update_plugins) || !isset($update_plugins->response[$free_slug]) || version_compare($update_plugins->response[$free_slug]->new_version, $current_version, '<=')){
return;
}
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
require_once(ABSPATH . 'wp-admin/includes/class-wp-upgrader.php');
$skin = wp_doing_ajax()? new WP_Ajax_Upgrader_Skin() : null;
$upgrader = new Plugin_Upgrader($skin);
$upgraded = $upgrader->upgrade($free_slug);
if(!is_wp_error($upgraded) && $upgraded){
// Re-active free plugins
if( file_exists( WP_PLUGIN_DIR . '/'. $free_slug ) && is_plugin_inactive($free_slug) ){
activate_plugin($free_slug); // TODO for network
}
// Re-active pro plugins
if( file_exists( WP_PLUGIN_DIR . '/'. $pro_slug ) && is_plugin_inactive($pro_slug) ){
activate_plugin($pro_slug); // TODO for network
}
}
}
}
function gosmtp_pro_api_url($main_server = 0, $suffix = 'gosmtp'){
global $gosmtp;
$r = array(
'https://s0.softaculous.com/a/softwp/',
'https://s1.softaculous.com/a/softwp/',
'https://s2.softaculous.com/a/softwp/',
'https://s3.softaculous.com/a/softwp/',
'https://s4.softaculous.com/a/softwp/',
'https://s5.softaculous.com/a/softwp/',
'https://s7.softaculous.com/a/softwp/',
'https://s8.softaculous.com/a/softwp/'
);
$mirror = $r[array_rand($r)];
// If the license is newly issued, we need to fetch from API only
if(!empty($main_server) || empty($gosmtp->license['last_edit']) ||
(!empty($gosmtp->license['last_edit']) && (time() - 3600) < $gosmtp->license['last_edit'])
){
$mirror = GOSMTP_API;
}
if(!empty($suffix)){
$mirror = str_replace('/softwp', '/'.$suffix, $mirror);
}
return $mirror;
}
function gosmtp_pro_plugins_expired($plugins){
$plugins[] = 'GoSMTP';
return $plugins;
}
function gosmtp_pro_expiry_notice(){
global $gosmtp;
// The combined notice for all Softaculous plugin to show that the license has expired
$dismissed_at = get_option('softaculous_expired_licenses', 0);
$expired_plugins = apply_filters('softaculous_expired_licenses', []);
if(
!empty($expired_plugins) &&
is_array($expired_plugins) &&
!defined('SOFTACULOUS_EXPIRY_LICENSES') &&
(empty($dismissed_at) || ($dismissed_at + WEEK_IN_SECONDS) < time())
){
define('SOFTACULOUS_EXPIRY_LICENSES', true); // To make sure other plugins don't return a Notice
echo '
'.sprintf(__('Your SoftWP license has %1$sexpired%2$s. Please renew it to continue receiving uninterrupted updates and support for %3$s.', 'gosmtp-pro'),
'',
'',
esc_html(implode(', ', $expired_plugins))
). '
';
wp_register_script('gosmtp-pro-expiry-notice', '', ['jquery'], GOSMTP_PRO_VERSION, true);
wp_enqueue_script('gosmtp-pro-expiry-notice');
wp_add_inline_script('gosmtp-pro-expiry-notice', '
jQuery(document).ready(function(){
jQuery("#gosmtp-pro-expiry-notice").on("click", ".notice-dismiss", function(e){
e.preventDefault();
let target = jQuery(e.target);
let jEle = target.closest("#gosmtp-pro-expiry-notice");
jEle.slideUp();
jQuery.post("'.admin_url('admin-ajax.php').'", {
security : "'.wp_create_nonce('gosmtp_expiry_notice').'",
action: "gosmtp_pro_dismiss_expired_licenses",
}, function(res){
if(!res["success"]){
alert(res["data"]);
}
}).fail(function(data){
alert("There seems to be some issue dismissing this alert");
});
});
})');
}
}
function gosmtp_pro_check_failure_and_notify_handler($is_sent, $exception, $backup_sent){
include_once GOSMTP_PRO_DIR .'/main/notifications/sender.php';
gosmtp_pro_check_failure_and_notify($is_sent, $exception, $backup_sent);
}
function gosmtp_pro_get_notifications_service_list(){
$list = [
'email' => ['title' => __('Email', 'gosmtp-pro'), 'class' => 'GOSMTP\Notifications\Email'],
'slack' => ['title' => __('Slack', 'gosmtp-pro'), 'class' => 'GOSMTP\Notifications\Slack'],
'discord' => ['title' => __('Discord', 'gosmtp-pro'), 'class' => 'GOSMTP\Notifications\Discord'],
'webhook' => ['title' => __('Webhook', 'gosmtp-pro'), 'class' => 'GOSMTP\Notifications\Webhook'],
'pushover' => ['title' => __('Pushover', 'gosmtp-pro'), 'class' => 'GOSMTP\Notifications\Pushover'],
];
return apply_filters('gosmtp_pro_get_notifications_service_list', $list);
}
function gosmtp_pro_load_notifications_service_list(){
$list = gosmtp_pro_get_notifications_service_list();
$smtp_service = [];
foreach($list as $key => $service){
$class = $service['class'];
if(!class_exists($class)){
continue;
}
$smtp_service[$key] = new $class();
}
return apply_filters('gosmtp_pro_load_notifications_service_list', $smtp_service);
}