Plugin Directory

Changeset 1347999


Ignore:
Timestamp:
02/11/2016 05:11:17 AM (10 years ago)
Author:
satoshipay
Message:

update to 0.6.1

Location:
satoshipay/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • satoshipay/trunk/assets/js/script_admin.js

    r1338096 r1347999  
    22var oldSecretPattern = new RegExp(/^[0-9a-f]{40}$/);
    33var keyPattern = new RegExp(/^[0-9A-Za-z]{17}$/);
     4var SATOSHIPAY_LAST_API_KEY;
     5var SATOSHIPAY_LAST_API_SECRET;
     6var SATOSHIPAY_REMOTE_CHECK_DONE = false;
     7var SATOSHIPAY_REMOTE_CHECK_SUCCESSFUL = false;
     8
     9SATOSHIPAY_LOG = false;
    410
    511var wrapError = function (errorText) {
     
    1622var providerApiUrl = 'https://provider-api.satoshipay.io/v1';
    1723
     24
     25var log = function (string) {
     26    if (SATOSHIPAY_LOG) {
     27        console.log(string);
     28    }
     29};
     30
    1831var activateButtons = function () {
    19     jQuery('#satoshipay-error-dismiss').on('click', function() {
     32    jQuery('#satoshipay-error-dismiss').on('click', function () {
    2033        removeErrors();
    2134    });
     
    7790    });
    7891};
     92
     93var remoteCheckSuccessful = function (apiKey, apiSecret) {
     94    if (SATOSHIPAY_REMOTE_CHECK_DONE) {
     95        if (apiKey === SATOSHIPAY_LAST_API_KEY && apiSecret === SATOSHIPAY_LAST_API_SECRET) {
     96            return SATOSHIPAY_REMOTE_CHECK_SUCCESSFUL;
     97        }
     98    }
     99    return false;
     100};
     101
     102
    79103var removeErrors = function () {
    80104    jQuery('.satoshipay-error').html('');
     
    86110    jQuery('.wrap').find('h2').first().after('<div class="satoshipay-error"></div>');
    87111
    88     var remoteCheckDone = false;
    89     var remoteCheckSuccessful = false;
     112    var apiSecret = jQuery('#satoshipay_api_auth_secret').val();
     113    var apiKey = jQuery('#satoshipay_api_auth_key').val();
     114
    90115    jQuery('form').submit(function (event) {
    91         if (remoteCheckDone) {
    92             remoteCheckDone = false;
    93             return remoteCheckSuccessful;
     116        if (remoteCheckSuccessful(apiKey, apiSecret)) {
     117            log('Remote check done, returning result');
     118            return;
     119        }
     120        event.preventDefault();
     121        if (SATOSHIPAY_REMOTE_CHECK_DONE) {
     122            SATOSHIPAY_REMOTE_CHECK_DONE = false;
    94123        }
    95124        removeErrors();
    96125        if (localApiKeyCheck() && localApiSecretCheck()) {
    97126            remoteCredCheck(function (err, result) {
     127                SATOSHIPAY_LAST_API_KEY = apiKey;
     128                SATOSHIPAY_LAST_API_SECRET = apiSecret;
     129                SATOSHIPAY_REMOTE_CHECK_DONE = true;
    98130                if (!err) {
    99                     remoteCheckSuccessful = true;
     131                    SATOSHIPAY_REMOTE_CHECK_SUCCESSFUL = true;
     132                    jQuery('form').submit();
     133                } else {
     134                    SATOSHIPAY_REMOTE_CHECK_SUCCESSFUL = false;
    100135                }
    101                 remoteCheckDone = true;
    102                 jQuery('form').submit();
    103136            });
     137            log('Local checks passed, delaying submit and waiting for remote check to be completed.');
    104138            return false;
    105139        }
  • satoshipay/trunk/readme.txt

    r1338142 r1347999  
    44Tags: micropayments, bitcoin, paywall, paid content, payment, satoshipay, nanopayments, widget, adblocking
    55Requires at least: 4.0
    6 Tested up to: 4.4.1
    7 Stable tag: 0.6
     6Tested up to: 4.4.2
     7Stable tag: 0.6.1
    88License: GPL2
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2929= How do I show a free teaser of my paid content? =
    3030
    31 Use an excerpt. When editing a post you can enter your teaser in the Excerpt box underneath the post edit box. The excerpt text will always be shown for free when viewing the post. If you don't see the Excerpt box when editing, activate Screen Options > Boxes > Excerpt.
     31Use an excerpt. When editing a post you can enter your teaser in the Excerpt box underneath the post edit box. The excerpt text will always be shown for free when viewing the post.
     32If you don't see the Excerpt box when editing, activate Screen Options > Boxes > Excerpt.
     33
     34= Will SatoshiPay work well with my other plugins? =
     35
     36Yes. We ensured that our plugin is compatible with the most popular WordPress plugins. However, there are a few known issues:
     37
     38** [Duplicate Post plugin](https://wordpress.org/plugins/duplicate-post/) **
     39
     40Issue: The duplicate of a post with "Paid content" enabled will not show up when displayed on the same page with the original.
     41
     42Solution: Unfortunately there is currently no work-around for this.
     43
     44** [W3 Total Cache plugin](https://wordpress.org/plugins/w3-total-cache/) **
     45
     46Issue: SatoshiPay's ad blocker detection feature will not work.
     47
     48Solution: Disable Page Cache (W3 Total Cache settings > General Settings > Disable Page cache). You can enable all other caching features.
    3249
    3350= Where can I find more documentation on SatoshiPay? =
     
    4562
    4663== Changelog ==
     64
     65= 0.6.1 =
     66
     67* Added known issues to FAQ.
     68* Fixed compatibility issue with Jetpack plugin.
    4769
    4870= 0.6 =
     
    6385* Added plugin directory icon and banner.
    6486
    65 = 0.5.0 =
     87= 0.5 =
    6688
    6789* Initial release.
  • satoshipay/trunk/satoshipay.php

    r1338096 r1347999  
    1212 * Plugin URI:        https://wordpress.org/plugins/satoshipay/
    1313 * Description:       Integrates SatoshiPay into WordPress. Quick start: 1) Select SatoshiPay from the left-hand admin menu, 2) add SatoshiPay API credentials, 3) edit a post, 4) activate "Paid Content" in SatoshiPay meta box, 5) set a price, 6) publish and view post. The SatoshiPay widget will appear and allow you to pay for the post.
    14  * Version:           0.6
     14 * Version:           0.6.1
    1515 * Author:            SatoshiPay
    1616 * Author URI:        https://satoshipay.io
     
    3030// Plugin version, used in user-agent string for API calls; keep in sync with
    3131// version in plugin description above!
    32 define('SATOSHIPAY_VERSION', '0.6');
     32define('SATOSHIPAY_VERSION', '0.6.1');
    3333
    3434// Load configuration, silently ignore missing config.php
Note: See TracChangeset for help on using the changeset viewer.