Plugin Directory

Changeset 1654720


Ignore:
Timestamp:
05/11/2017 01:11:24 AM (9 years ago)
Author:
atheken
Message:

Update javascript and admin panel to use wp-nonce security.

Location:
postmark-approved-wordpress-plugin/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • postmark-approved-wordpress-plugin/trunk/assets/css/admin.css

    r1512009 r1654720  
    3030    display: block;
    3131}
     32
     33.footnote {
     34    font-size: 13px;
     35}
     36input[type=text] {
     37    width: 300px;
     38}
  • postmark-approved-wordpress-plugin/trunk/assets/js/admin.js

    r1512009 r1654720  
    1 (function($) {
     1(function ($) {
    22    $(function() {
    33        var settings = postmark.settings;
     
    1919
    2020            $.post(ajaxurl, {
     21                '_wpnonce' : $('#_wpnonce').val(),
    2122                'action': 'postmark_save',
    2223                'data': JSON.stringify(data)
     
    3031        $(document).on('click', '.send-test', function() {
    3132            $.post(ajaxurl, {
     33                '_wpnonce' : $('#_wpnonce').val(),
    3234                'action': 'postmark_test',
    3335                'email': $('.pm-test-email').val(),
  • postmark-approved-wordpress-plugin/trunk/page-settings.php

    r1653796 r1654720  
    1515        <a class="nav-tab" rel="test">Send Test Email</a>
    1616        <a class="nav-tab" rel="overrides">Overrides</a>
    17        <?php if ( 'POSTMARK_PLUGIN_TESTING' == $_ENV['POSTMARK_PLUGIN_TESTING'] ) : ?>
     17
     18       <?php if ( isset($_ENV['POSTMARK_PLUGIN_TESTING']) && 'POSTMARK_PLUGIN_TESTING' == $_ENV['POSTMARK_PLUGIN_TESTING'] ) : ?>
    1819            <a class="nav-tab" rel="plugin-testing">Plugin Testing</a>
    1920        <?php endif; ?>
     
    106107        To learn more about <code>wp_mail</code>, see the <a href="https://developer.wordpress.org/reference/functions/wp_mail/">WordPress Codex page.</a>
    107108    </div>
    108    <?php if ( 'POSTMARK_PLUGIN_TESTING' == $_ENV['POSTMARK_PLUGIN_TESTING'] ) : ?>
     109   <?php if ( isset($_ENV['POSTMARK_PLUGIN_TESTING']) &&'POSTMARK_PLUGIN_TESTING' == $_ENV['POSTMARK_PLUGIN_TESTING'] ) : ?>
    109110    <div class="tab-content tab-plugin-testing">
    110111        <table class="form-table" style="max-width:740px;">
  • postmark-approved-wordpress-plugin/trunk/postmark.php

    r1653796 r1654720  
    44Plugin URI: https://postmarkapp.com/
    55Description: Overwrites wp_mail to send emails through Postmark
    6 Version: 1.9.4
     6Version: 1.9.5
    77Author: Andrew Yates & Matt Gibbs
    88*/
     
    6161        // We check the wp_nonce.
    6262        if ( ! isset($_POST['_wpnonce']) || ! wp_verify_nonce( $_POST['_wpnonce'], 'postmark_nonce' ) ) {
    63             wp_die(__('Cheatin’ uh?'));
     63            wp_die(__('We were unable to verify this request, please reload the page and try again.'));
    6464        }
    6565       
    6666        // We check that the current user is allowed to update settings.
    6767        if ( ! current_user_can('manage_options') ) {
    68             wp_die(__('Cheatin’ uh?'));
     68            wp_die(__('We were unable to verify this request, please reload the page and try again.'));
    6969        }
    7070       
     
    125125        // We check the wp_nonce.
    126126        if ( ! isset($_POST['_wpnonce']) || ! wp_verify_nonce( $_POST['_wpnonce'], 'postmark_nonce' ) ) {
    127             wp_die(__('Cheatin’ uh?'));
     127            wp_die(__('We were unable to verify this request, please reload the page and try again.'));
    128128        }
    129129               
    130130        // We check that the current user is allowed to update settings.
    131131        if ( ! current_user_can('manage_options') ) {
    132             wp_die(__('Cheatin’ uh?'));
     132            wp_die(__('We were unable to verify this request, please reload the page and try again.'));
    133133        }
    134134       
    135135        // We check that we have received some data.
    136136        if ( ! isset($_POST['data']) ) {
    137             wp_die(__('Cheatin’ uh?'));
     137            wp_die(__('We were unable to verify this request, please reload the page and try again.'));
    138138    }
    139139
  • postmark-approved-wordpress-plugin/trunk/readme.txt

    r1653796 r1654720  
    33Tags: postmark, email, smtp, notifications, wp_mail, wildbit
    44Requires at least: 4.0
    5 Tested up to: 4.6.1
     5Tested up to: 4.7.4
    66Stable tag: trunk
    77
     
    6262== Changelog ==
    6363
     64= v1.9.5 =
     65* Update javascript to fix settings update issue.
     66
    6467= v1.9.4 =
    6568* Added `postmark_error` and `postmark_response` actions to the plugin, to intercept API results after calling wp_mail. You can register callbacks for these using `add_action` (more info here: https://developer.wordpress.org/reference/functions/add_action/)
Note: See TracChangeset for help on using the changeset viewer.