Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
options = empty($options) ? array() : $options;
}
// The function that will be called when the plugin is loaded
add_action('wp_mail', 'gosmtp_load_phpmailer');
function gosmtp_load_phpmailer($atts){
global $gosmtp, $phpmailer;
if(!class_exists('GOSMTP_PHPMailer')){
// Load PHPMailer class, so we can subclass it.
require_once ABSPATH . WPINC . '/PHPMailer/PHPMailer.php';
require_once ABSPATH . WPINC . '/PHPMailer/SMTP.php';
require_once ABSPATH . WPINC . '/PHPMailer/Exception.php';
class GOSMTP_PHPMailer extends \PHPMailer\PHPMailer\PHPMailer {
// Modify the default send() behaviour of PHPMailer.
public function send(){
global $gosmtp, $phpmailer;
// Define a custom header, that will be used to identify the plugin and the mailer.
$this->XMailer = 'GOSMTP/Mailer/' . $gosmtp->_mailer . ' ' . GOSMTP_VERSION;
do_action( 'gosmtp_mailer_mail_pre_send' );
// If mailer not exists or send function not exists
if(!method_exists($gosmtp->mailer, 'send')){
return parent::send();
}
do_action( 'gosmtp_mailer_mail_send_before' );
// Are we to enforce from ?
$gosmtp->mailer->set_from();
$exception = false;
/*
* Send the actual email.
* We reuse everything, that was preprocessed for usage in \PHPMailer.
*/
try{
$is_sent = $gosmtp->mailer->send();
}catch(PHPMailer\PHPMailer\Exception $e){
$is_sent = false;
$exception = $e;
}
// Get backup connection
$backup_connection = $gosmtp->mailer->get_backup_connection();
$backup_sent = false;
// Store current values
$current_data = array(
'_mailer' => $gosmtp->_mailer,
'mailer' => $gosmtp->mailer,
'conn_id' => $gosmtp->mailer->conn_id
);
// Try to send email with secondary email
if(empty($is_sent) && !empty($backup_connection) ){
$mailer = sanitize_key( $gosmtp->options['mailer'][$backup_connection]['mail_type'] );
$class = $gosmtp->mailer_list[$mailer]['class'];
$parent_log = $gosmtp->mailer->last_log;
if(class_exists($class)){
$gosmtp->_mailer = $mailer;
$gosmtp->mailer = new $class();
$gosmtp->mailer->conn_id = $backup_connection;
$gosmtp->mailer->parent_log = $parent_log;
try{
$backup_sent = $phpmailer->send();
}catch(Exception $e){}
}
}
// Reset connection
$gosmtp->_mailer = $current_data['_mailer'];
$gosmtp->mailer = $current_data['mailer'];
$gosmtp->mailer->conn_id = $current_data['conn_id'];
do_action( 'gosmtp_mailer_mail_send_after', $is_sent, $exception, $backup_sent );
if($exception && !$backup_sent){
throw $exception;
}
return $is_sent || $backup_sent;
}
}
}
if($phpmailer instanceof GOSMTP_PHPMailer){
return $atts;
}
// Load all mailer
$gosmtp->mailer_list = gosmtp_get_mailer_list();
$connection_key = apply_filters('gosmtp_connection_key', 0);
// Making sure the filter returns expected type
if(!is_string($connection_key) && !is_int($connection_key)){
$connection_key = 0;
}
// For PHP Email dont do anything
if(empty($gosmtp->options['mailer'][$connection_key]['mail_type'])){
return $atts;
}
$mailer = sanitize_key( $gosmtp->options['mailer'][$connection_key]['mail_type'] );
$class = $gosmtp->mailer_list[$mailer]['class'];
if(!class_exists($class)){
return $atts;
}
$gosmtp->_mailer = $mailer;
$gosmtp->mailer = new $class();
$gosmtp->mailer->conn_id = $connection_key;
// Handle the from email name
add_filter('wp_mail_from', [$gosmtp->mailer, 'get_from'], 100, 1);
$phpmailer = new GOSMTP_PHPMailer(true);
return $atts;
}
// This adds the left menu in WordPress Admin page
add_action('admin_menu', 'gosmtp_admin_menu', 5);
function gosmtp_admin_menu() {
global $wp_version;
$capability = 'activate_plugins';// TODO : Capability for accessing this page
// Add the menu page
add_menu_page(__('GoSMTP', 'gosmtp'), __('GoSMTP', 'gosmtp'), $capability, 'gosmtp', 'gosmtp_page_handler', 'dashicons-email-alt');
// Settings Page
add_submenu_page( 'gosmtp', __('Settings', 'gosmtp'), __('Settings', 'gosmtp'), $capability, 'gosmtp', 'gosmtp_page_handler');
// Test Mail Page
add_submenu_page( 'gosmtp', 'Test Mail', 'Test Mail', $capability, 'gosmtp#test-mail', 'gosmtp_page_handler');
if(defined('GOSMTP_PREMIUM')){
// Logs Page
add_submenu_page( 'gosmtp', __('Email Logs', 'gosmtp'), __('Email Logs', 'gosmtp'), $capability, 'gosmtp-logs', 'gosmtp_logs_handler');
// Email reports
add_submenu_page( 'gosmtp', __('Email Reports', 'gosmtp'), __('Email Reports', 'gosmtp'), $capability, 'email_reports', 'gosmtp_email_reports_handler');
// Export Page
add_submenu_page( 'gosmtp', __('Export', 'gosmtp'), __('Export', 'gosmtp'), $capability, 'export', 'gosmtp_export_handler');
// Email reports
add_submenu_page( '', __('Email Reports', 'gosmtp'), __('Weekly Email', 'gosmtp'), $capability, 'weekly_email_reports', 'gosmtp_weekly_email_handler');
// License Page
if(!defined('SITEPAD')){
add_submenu_page( 'gosmtp', __('License', 'gosmtp'), __('License', 'gosmtp'), $capability, 'gosmtp-license', 'gosmtp_license_handler');
}
}
// Support
if(!defined('SITEPAD')){
add_submenu_page( 'gosmtp', __('Support', 'gosmtp'), __('Support', 'gosmtp'), $capability, 'gosmtp#support', 'gosmtp_page_handler');
}
}
// SMTP page Handler
function gosmtp_page_handler(){
include_once GOSMTP_DIR .'/main/settings.php';
gosmtp_settings_page();
}
function gosmtp_logs_handler(){
include_once GOSMTP_PRO_DIR .'/main/smtp-logs.php';
}
function gosmtp_email_reports_handler(){
include_once GOSMTP_PRO_DIR .'/main/email-reports.php';
gosmtp_reports_table();
}
function gosmtp_export_handler(){
include_once GOSMTP_PRO_DIR .'/main/export.php';
gosmtp_export_page();
}
function gosmtp_weekly_email_handler(){
include_once GOSMTP_PRO_DIR .'/main/weekly_email_reports.php';
gosmtp_send_email_reports();
}
function gosmtp_license_handler(){
global $gosmtp;
include_once GOSMTP_PRO_DIR .'/main/license.php';
}
if(wp_doing_ajax()){
include_once GOSMTP_DIR.'/main/ajax.php';
}
add_action( 'admin_init', 'gosmtp_admin_init');
function gosmtp_admin_init(){
wp_register_style( 'gosmtp-admin', GOSMTP_URL .'/css/admin.css', array(), GOSMTP_VERSION);
wp_register_script( 'gosmtp-admin', GOSMTP_URL .'/js/admin.js', array('jquery'), GOSMTP_VERSION);
include_once GOSMTP_DIR .'/main/admin.php';
gosmtp_admin_hooks();
}