'.$message.'
|
license['license'])){
$expires = $gosmtp->license['expires'];
$expires = substr($expires, 0, 4).'/'.substr($expires, 4, 2).'/'.substr($expires, 6);
echo ' License Status : '.(empty($gosmtp->license['status_txt']) ? 'N.A.' : wp_kses_post($gosmtp->license['status_txt'])).'
License Expires : '.($gosmtp->license['expires'] <= date('Ymd') ? ''.esc_attr($expires).'' : esc_attr($expires)).'
';
}?>
|
|
| URL | |
| Path | |
| .htaccess | Yes' : 'No');?> |
![]() | ||||||||||||||||||||||||
| ||||||||||||||||||||||||
'.__('Email Sent successfully to ').' '.$admin_email.'.
'.__('Weekly email reports were sent from: '.$start.' to: '.$end.'').'
'.__('Failed to send email to ').' '.__($admin_email).''.__('. Plesae check ').''. __(' Email logs ').''.__('for more info.').'
'.esc_html($lower_version).' Install/Update Now
GoSMTP Pro depends on the free version of GoSMTP, so you need to install / update the free version first.
Install/Update Now'.__('To view email reports, please enable email logs from GoSMTP').' '.__('settings').'.
| '.$mail_array[$ck].' | '; } echo '||||||||
%s
new $class(...).
*/
class Gosmtp_PucFactory {
protected static $classVersions = array();
protected static $sorted = false;
/**
* Create a new instance of GosmtpUpdateChecker.
*
* @see GosmtpUpdateChecker::__construct()
*
* @param $metadataUrl
* @param $pluginFile
* @param string $slug
* @param int $checkPeriod
* @param string $optionName
* @param string $muPluginFile
* @return GosmtpUpdateChecker_3_2
*/
public static function buildUpdateChecker($metadataUrl, $pluginFile, $slug = '', $checkPeriod = 12, $optionName = '', $muPluginFile = '') {
$class = self::getLatestClassVersion('GosmtpUpdateChecker');
return new $class($metadataUrl, $pluginFile, $slug, $checkPeriod, $optionName, $muPluginFile);
}
/**
* Get the specific class name for the latest available version of a class.
*
* @param string $class
* @return string|null
*/
public static function getLatestClassVersion($class) {
if ( !self::$sorted ) {
self::sortVersions();
}
if ( isset(self::$classVersions[$class]) ) {
return reset(self::$classVersions[$class]);
} else {
return null;
}
}
/**
* Sort available class versions in descending order (i.e. newest first).
*/
protected static function sortVersions() {
foreach ( self::$classVersions as $class => $versions ) {
uksort($versions, array(__CLASS__, 'compareVersions'));
self::$classVersions[$class] = $versions;
}
self::$sorted = true;
}
protected static function compareVersions($a, $b) {
return -version_compare($a, $b);
}
/**
* Register a version of a class.
*
* @access private This method is only for internal use by the library.
*
* @param string $generalClass Class name without version numbers, e.g. 'GosmtpUpdateChecker'.
* @param string $versionedClass Actual class name, e.g. 'GosmtpUpdateChecker_1_2'.
* @param string $version Version number, e.g. '1.2'.
*/
public static function addVersion($generalClass, $versionedClass, $version) {
if ( !isset(self::$classVersions[$generalClass]) ) {
self::$classVersions[$generalClass] = array();
}
self::$classVersions[$generalClass][$version] = $versionedClass;
self::$sorted = false;
}
}
endif;
//Register classes defined in this file with the factory.
Gosmtp_PucFactory::addVersion('GosmtpUpdateChecker', 'GosmtpUpdateChecker_3_2', '3.2');
Gosmtp_PucFactory::addVersion('GosmtpUpdate', 'GosmtpUpdate_3_2', '3.2');
Gosmtp_PucFactory::addVersion('GosmtpInfo', 'GosmtpInfo_3_2', '3.2');
Gosmtp_PucFactory::addVersion('Gosmtp_PucGitHubChecker', 'Gosmtp_PucGitHubChecker_3_2', '3.2');
main/logger.php 0000644 00000011173 15171073004 0007461 0 ustar 00 table = $wpdb->prefix . GOSMTP_DB_PREFIX .'email_logs';
}
public function create_table(){
global $wpdb;
$charsetCollate = $wpdb->get_charset_collate();
if($wpdb->get_var("SHOW TABLES LIKE '$this->table'") == $this->table){
return;
}
$sql = "CREATE TABLE $this->table (
`id` INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
`site_id` INT UNSIGNED NULL,
`message_id` VARCHAR(255) NULL,
`to` VARCHAR(255),
`from` VARCHAR(255),
`subject` VARCHAR(255),
`body` LONGTEXT NULL,
`headers` LONGTEXT NULL,
`attachments` LONGTEXT NULL,
`status` VARCHAR(20) DEFAULT 'pending',
`response` TEXT NULL,
`extra` TEXT NULL,
`retries` INT UNSIGNED NULL DEFAULT 0,
`resent_count` INT UNSIGNED NULL DEFAULT 0,
`provider` TEXT NULL,
`source` VARCHAR(255) NULL,
`created_at` TIMESTAMP NULL,
`updated_at` TIMESTAMP NULL,
`parent_id` INT UNSIGNED NULL DEFAULT 0
) $charsetCollate;";
// Make Sitepad compatible
$upgrade = ABSPATH . 'site-admin/includes/upgrade.php';
$upgrade = file_exists($upgrade) ? $upgrade : ABSPATH . 'wp-admin/includes/upgrade.php';
require_once( $upgrade );
dbDelta($sql);
}
public function add_logs($data){
global $wpdb;
if(empty($data)){
return false;
}
$result = $wpdb->insert($this->table, $data);
if($result){
return $wpdb->insert_id;
}
return false;
}
public function update_logs($data, $id){
global $wpdb;
if(empty($data) || empty($id)){
return false;
}
$result = $wpdb->update( $this->table, $data, array( 'id' => $id ) );
if($result){
return true;
}
return false;
}
public function delete_log($id){
global $wpdb;
$data['id'] = $id;
$result = $wpdb->delete($this->table, $data);
if(!empty($result)){
return true;
}
return false;
}
public function get_logs($for = 'records', $id = '', $args = array()){
global $wpdb;
$defaults = array(
'interval' => array(),
'limit' => 10,
'offset' => 0,
'pagination' => true,
'multiselect' => array(),
);
$args = wp_parse_args( $args, $defaults );
$query = '';
$start = '';
$end = date('y-m-d').' 23:59:59';
if(!empty($args['filter'])){
$query .= 'status="'.$args['filter'].'"';
}
if(!empty($args['interval']) && !empty($args['interval']['start'])){
$start = $args['interval']['start'].' 00:00:00';
if(!empty($args['interval']['end'])){
$end = $args['interval']['end'].' 23:59:59';
}
$query .= (!empty($query) ? ' and (' : '').'`created_at` between "'.$start.'" and "'.$end.'" '.(!empty($query) ? ') ' : ' ');
}
if(!empty($args['search']) && empty($args['multiselect'])){
$query .= (!empty($query) ? ' and ' : '').' (
`from` like "%'. $args['search'] .'%" or
`subject` like "%'. $args['search'] .'%" or
`to` like "%'. $args['search'] .'%" or
`body` like "%'. $args['search'] .'%" )';
}else if(!empty($args['search'])){
$search_qry ='';
foreach($args['multiselect'] as $key => $value){
$search_qry .= '`'.$value.'` like "%'.$args['search'].'%"';
if(count($args['multiselect']) - 1 > $key){
$search_qry .= ' or ';
}
}
$query .= (!empty($query) ? ' and ' : '').' ('.$search_qry.')';
}
if(!empty($query)){
$query = ' where '.$query;
}
if(!empty($id)){
$query = ' where id='.$id;
}else if(!empty($args['pagination'])){
$query .= $for != 'count' ? ' order by id desc LIMIT '.$args['limit'].' OFFSET '.$args['offset'] : ' ';
}
// echo "SELECT * FROM ".$this->table. $query;
try{
if($for == 'count'){
$result = $wpdb->get_results("SELECT count(*) as records FROM ".$this->table. $query)[0];
}else{
$result = $wpdb->get_results("SELECT * FROM ".$this->table. $query);
if( count($result) == 0 ){
return false;
}
}
return $result;
}catch(\Exception $e){}
return false;
}
public function clear_records( $period = 0 ){
if( empty($period) || $period == 0 ) return;
global $wpdb;
$date = ( new \DateTime( '-'.$period.' seconds' ))->format('Y-m-d H:i:s');
$query = 'DELETE FROM `'.$this->table.'` WHERE created_at < %s';
if( $period == -1 ){
$query = 'TRUNCATE TABLE '.$this->table;
$date = '';
}
$wpdb->query(
$wpdb->prepare( $query , $date)
);
}
public static function retention_logs(){
global $gosmtp;
if(empty($gosmtp->options['logs']['retention_period'])){
return;
}
$logger = new Logger();
// Clear logs
$logger->clear_records($gosmtp->options['logs']['retention_period']);
}
} main/smtp-logs.php 0000644 00000035147 15171073004 0010136 0 ustar 00 options['logs']['enable_logs']) ){
echo ''.__('To store and view email logs, please enable email logs from GoSMTP').' '.__('settings').'.
'.esc_html__('You are using an older version of GoSMTP Pro. We recommend updating to the latest version to ensure seamless and uninterrupted use of the application.', 'gosmtp').'
'.esc_html__('You are using an older version of GoSMTP. We recommend updating to the latest free version to ensure smooth and uninterrupted use of the application.', 'gosmtp').'