Plugin Directory

Changeset 2248825


Ignore:
Timestamp:
02/22/2020 10:00:56 PM (6 years ago)
Author:
clash82
Message:

Fixed issue related to incorrect admin-ajax.php file path when WP is installed in subdirectory (wp-admin), added extra check for fromEmail when sending test e-mail message

Location:
wp-lemme-know/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • wp-lemme-know/trunk/LICENSE

    r1566665 r2248825  
    1 Copyright (C) 2016-2017 Rafał Toborek. All rights reserved.
     1Copyright (C) 2016-2020 Rafał Toborek. All rights reserved.
    22This source code is provided under the following license:
    33
  • wp-lemme-know/trunk/assets/js/lemme-know-admin.js

    r1740287 r2248825  
    1515    clash82.LemmeKnowAdmin = function (config) {
    1616        this.emailRegexPattern = /^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
     17
     18        this.adminAjaxUrl = config.adminAjaxUrl || '//'+ window.location.hostname+'/wp-admin/admin-ajax.php';
    1719
    1820        // custom form elements
     
    116118        }
    117119
    118         xmlHttp.open('POST', '//'+ window.location.hostname+'/wp-admin/admin-ajax.php', true);
     120        xmlHttp.open('POST', this.adminAjaxUrl, true);
    119121        xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
    120122
  • wp-lemme-know/trunk/plugin.php

    r2179618 r2248825  
    55Plugin URI:  https://github.com/clash82/wp-lemme-know
    66Description: Sends e-mail notification for subscribers when a new post is published.
    7 Version:     0.5.0
     7Version:     0.6.0
    88Author:      Rafał Toborek
    99Author URI:  https://toborek.info/about/
  • wp-lemme-know/trunk/readme.txt

    r2179624 r2248825  
    22
    33Contributors: clash82
    4 Tags: notifications, email, newsletter, subscribe2, mailing, smtp
     4Tags: notifications, email, newsletter, subscribe2, mailing, smtp, mailing
    55Requires at least: 4.6
    6 Tested up to: 5.2.4
     6Tested up to: 5.3.2
    77Requires PHP: 5.4
    88Stable tag: trunk
     
    4646== Changelog ==
    4747
     48= v0.6.0 =
     49* fixed: issue related to incorrect admin-ajax.php file path when WP is installed in subdirectory (wp-admin),
     50* added: validation if `e-mail from` value is specified when sending test message.
     51
    4852= v0.5.0 =
    4953* fixed: issue related to incorrect admin-ajax.php file path when WP is installed in subdirectory.
  • wp-lemme-know/trunk/src/ajax.php

    r1740284 r2248825  
    1515function wp_lemme_know_ajax_test_email_callback()
    1616{
     17    if (empty($_POST['mailFrom'])) {
     18        die (json_encode([
     19            'status' => 1, // e-mail from address is missing
     20            'results' => __('Please provide E-mail from address'),
     21        ]));
     22    }
     23
    1724    $sender = new WP_LemmeKnowNotificationSender(
    1825        $_POST['mailerType'] === 'default' ? false : true,
     
    3643    if ($sender->send() === true) {
    3744        die (json_encode([
    38             'status' => 0 // e-mail was successfully sent
     45            'status' => 0, // e-mail was successfully sent
    3946        ]));
    4047    }
     
    4249    die (json_encode([
    4350        'status' => 1, // there were some issues when sending e-mail
    44         'results' => $sender->getDebugDetails()
     51        'results' => $sender->getDebugDetails(),
    4552    ]));
    4653}
     
    98105
    99106    die (json_encode([
    100         'status' => 0 // e-mail was successfully added
     107        'status' => 0, // e-mail was successfully added
    101108    ]));
    102109}
  • wp-lemme-know/trunk/src/settings.php

    r2179618 r2248825  
    380380            (function() {
    381381                new clash82.LemmeKnowAdmin({
     382                    adminAjaxUrl: "%sadmin-ajax.php",
    382383                    sendingMsg: "%s",
    383384                    successMsg: "%s",
     
    389390        __('email@example.com'),
    390391        __('Send e-mail notification now'),
     392        get_admin_url(),
    391393        __('Sending test message, please wait...'),
    392394        __('Congratulations! test e-mail was sent, configuration is correct'),
Note: See TracChangeset for help on using the changeset viewer.