updated plugin SMTP Mailer version 1.1.12

This commit is contained in:
KawaiiPunk 2024-02-08 12:31:47 +00:00 committed by Gitium
parent 8d5e7cc070
commit b1a8675fb3
5 changed files with 158 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -0,0 +1,34 @@
.smtp_mailer_addons_item_canvas{
background-color:#fff;
font-family:sans-serif,arial;
font-size:12px;
border:1px solid #ccc;
display:block;
float:left;
margin:3px 12px 12px 0;
padding:10px 0px 10px 10px;
position:relative;
width:222px;
height:340px;
}
.smtp_mailer_addons_item_canvas:hover{border-color:#999;}
.smtp_mailer_addons_item_thumb img {height: 150px; width: 200px; padding: 5px; border: 1px solid #ccc;}
.smtp_mailer_addons_item_thumb a img {border: 1px solid #ccc;}
.smtp_mailer_addons_item_body{line-height:22px;height:170px;overflow:hidden;}
.smtp_mailer_addons_item_name{font-size:16px;font-weight:bold;text-align: center;margin:10px 10px 10px 0px;}
.smtp_mailer_addons_item_description{margin:10px 10px 5px 0px;/*text-align:justify;*/overflow:hidden;height:70px;}
.smtp_mailer_addons_clear{clear:both;}
.smtp_mailer_addons_item_details_link{
text-align: center;
}
.smtp_mailer_addons_item_details_link a{
border: 3px solid #2d3140;
color: #2d3140;
display: inline-block;
padding: 5px 15px;
text-decoration: none !important;
}
.smtp_mailer_addons_item_details_link a:hover{
background-color: #2d3140;
color: #FFF;
}

View File

@ -0,0 +1,41 @@
<?php
function smtp_mailer_display_addons()
{
/*
echo '<div class="wrap">';
echo '<h2>' .__('SMTP Mailer Add-ons', 'smtp-mailer') . '</h2>';
*/
$addons_data = array();
$addon_1 = array(
'name' => 'Reply-To',
'thumbnail' => SMTP_MAILER_URL.'/addons/images/smtp-mailer-reply-to.png',
'description' => 'Set a Reply-To address for all outgoing email messages',
'page_url' => 'https://wphowto.net/how-to-add-a-reply-to-address-in-the-smtp-mailer-wordpress-plugin-6997',
);
array_push($addons_data, $addon_1);
//Display the list
foreach ($addons_data as $addon) {
?>
<div class="smtp_mailer_addons_item_canvas">
<div class="smtp_mailer_addons_item_thumb">
<img src="<?php echo esc_url($addon['thumbnail']);?>" alt="<?php echo esc_attr($addon['name']);?>">
</div>
<div class="smtp_mailer_addons_item_body">
<div class="smtp_mailer_addons_item_name">
<a href="<?php echo esc_url($addon['page_url']);?>" target="_blank"><?php echo esc_html($addon['name']);?></a>
</div>
<div class="smtp_mailer_addons_item_description">
<?php echo esc_html($addon['description']);?>
</div>
<div class="smtp_mailer_addons_item_details_link">
<a href="<?php echo esc_url($addon['page_url']);?>" class="smtp_mailer_addons_view_details" target="_blank">View Details</a>
</div>
</div>
</div>
<?php
}
echo '</div>';//end of wrap
}

View File

@ -1,7 +1,7 @@
<?php
/*
Plugin Name: SMTP Mailer
Version: 1.1.11
Version: 1.1.12
Plugin URI: https://wphowto.net/smtp-mailer-plugin-for-wordpress-1482
Author: naa986
Author URI: https://wphowto.net/
@ -16,7 +16,7 @@ if (!defined('ABSPATH')){
class SMTP_MAILER {
var $plugin_version = '1.1.11';
var $plugin_version = '1.1.12';
var $phpmailer_version = '6.8.1';
var $plugin_url;
var $plugin_path;
@ -36,12 +36,24 @@ class SMTP_MAILER {
}
function loader_operations() {
if (is_admin()) {
include_once('addons/smtp-mailer-addons.php');
}
add_action('plugins_loaded', array($this, 'plugins_loaded_handler'));
add_action('admin_menu', array($this, 'options_menu'));
add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
//add_action('admin_notices', 'smtp_mailer_admin_notice');
add_filter('pre_wp_mail', 'smtp_mailer_pre_wp_mail', 10, 2);
}
function enqueue_admin_scripts($hook) {
if('settings_page_smtp-mailer-settings' != $hook) {
return;
}
wp_register_style('smtp-mailer-addons-menu', SMTP_MAILER_URL.'/addons/smtp-mailer-addons.css');
wp_enqueue_style('smtp-mailer-addons-menu');
}
function plugins_loaded_handler()
{
if(is_admin() && current_user_can('manage_options')){
@ -78,6 +90,8 @@ class SMTP_MAILER {
'smtp-mailer-settings' => __('General', 'smtp-mailer'),
'smtp-mailer-settings&action=test-email' => __('Test Email', 'smtp-mailer'),
'smtp-mailer-settings&action=server-info' => __('Server Info', 'smtp-mailer'),
'smtp-mailer-settings&action=addons' => __('Add-ons', 'smtp-mailer'),
'smtp-mailer-settings&action=advanced' => __('Advanced', 'smtp-mailer'),
);
$url = "https://wphowto.net/smtp-mailer-plugin-for-wordpress-1482";
$link_text = sprintf(__('Please visit the <a target="_blank" href="%s">SMTP Mailer</a> documentation page for usage instructions.', 'smtp-mailer'), esc_url($url));
@ -130,6 +144,12 @@ class SMTP_MAILER {
case 'server-info':
$this->server_info_settings();
break;
case 'addons':
smtp_mailer_display_addons();
break;
case 'advanced':
$this->advanced_settings();
break;
}
}
else
@ -404,7 +424,47 @@ class SMTP_MAILER {
</form>
<?php
}
}
function advanced_settings() {
?>
<div class="update-nag"><?php _e('Settings from add-ons will appear here.', 'smtp-mailer');?></div>
<?php
if (isset($_POST['smtp_mailer_update_advanced_settings'])) {
$nonce = $_REQUEST['_wpnonce'];
if (!wp_verify_nonce($nonce, 'smtp_mailer_advanced_settings')) {
wp_die('Error! Nonce Security Check Failed! please save the settings again.');
}
$post = $_POST;
do_action('smtp_mailer_advanced_settings_submitted', $post);
echo '<div id="message" class="updated fade"><p><strong>';
echo __('Settings Saved!', 'smtp-mailer');
echo '</strong></p></div>';
}
$settings_fields = '';
$settings_fields = apply_filters('smtp_mailer_advanced_settings_fields', $settings_fields);
if(empty($settings_fields)){
return;
}
?>
<form method="post" action="">
<?php wp_nonce_field('smtp_mailer_advanced_settings'); ?>
<table class="form-table">
<tbody>
<?php
if(!empty($settings_fields)){
echo $settings_fields;
}
?>
</tbody>
</table>
<p class="submit"><input type="submit" name="smtp_mailer_update_advanced_settings" id="smtp_mailer_update_advanced_settings" class="button button-primary" value="<?php _e('Save Changes', 'smtp-mailer');?>"></p>
</form>
<?php
}
}
function smtp_mailer_get_option(){
@ -692,7 +752,18 @@ function smtp_mailer_pre_wp_mail($null, $atts)
return false;
}
/*reply_to code */
$smtpmailer_reply_to = '';
$smtpmailer_reply_to = apply_filters('smtpmailer_reply_to', $smtpmailer_reply_to);
if(isset($smtpmailer_reply_to) && !empty($smtpmailer_reply_to)){
$temp_reply_to_addresses = explode(",", $smtpmailer_reply_to);
$reply_to = array();
foreach($temp_reply_to_addresses as $temp_reply_to_address){
$reply_to_address = trim($temp_reply_to_address);
$reply_to[] = $reply_to_address;
}
}
/*end of reply_to code */
// Set mail's subject and body.
$phpmailer->Subject = $subject;
$phpmailer->Body = $message;

View File

@ -4,7 +4,7 @@ Donate link: https://wphowto.net/
Tags: email, mail, smtp, phpmailer
Requires at least: 6.4
Tested up to: 6.4
Stable tag: 1.1.11
Stable tag: 1.1.12
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@ -16,6 +16,10 @@ Configure a SMTP server to send email from your WordPress site. Configure the wp
https://www.youtube.com/watch?v=7O_jgtykcEk&rel=0
=== SMTP Mailer Add-ons ===
* [Reply-To](https://wphowto.net/how-to-add-a-reply-to-address-in-the-smtp-mailer-wordpress-plugin-6997)
=== SMTP Mailer Settings ===
* **SMTP Host**: Your outgoing mail server (e.g. smtp.gmail.com).
@ -68,6 +72,9 @@ none
== Changelog ==
= 1.1.12 =
* Added support for the reply-to add-on.
= 1.1.11 =
* WordPress 6.4 compatibility update.