Plugin Directory

Changeset 1994954


Ignore:
Timestamp:
12/14/2018 03:55:24 PM (7 years ago)
Author:
satoshipay
Message:

tagging version 1.7

Location:
satoshipay/trunk
Files:
48 added
4 edited

Legend:

Unmodified
Added
Removed
  • satoshipay/trunk/readme.txt

    r1985825 r1994954  
    44Tags: micropayments, stellar, lumen, blockchain, paypal, paywall, paid content, paid downloads, payment, satoshipay, widget, adblocking, digital goods
    55Requires at least: 4.4.5
    6 Tested up to: 4.9.8
    7 Stable tag: 1.6
     6Tested up to: 5.0.1
     7Stable tag: 1.7
    88License: MIT
    99License URI: https://opensource.org/licenses/MIT
     
    8080== Changelog ==
    8181
     82= 1.7 =
     83
     84* Added support for text paywall and paid media (audio, video, and image) in the Gutenberg editor.
     85
    8286= 1.6 =
    8387
    84 * Improved plugin performance.
    85 * Improved API communication.
     88* Changed API endpoint for currency conversion.
     89* Added new plugin directory graphics.
     90* Removed unused code.
    8691
    8792= 1.5 =
  • satoshipay/trunk/satoshipay.php

    r1985825 r1994954  
    1212 * Plugin URI:        https://wordpress.org/plugins/satoshipay/
    1313 * Description:       Integrates SatoshiPay's micropayment system into WordPress.
    14  * Version:           1.6
     14 * Version:           1.7
    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', '1.6');
     32define('SATOSHIPAY_VERSION', '1.7');
    3333
    3434// Plugin root file
     
    9090require_once __DIR__ . '/src/SatoshiPay/SatoshiPayPlugin.php';
    9191require_once __DIR__ . '/src/SatoshiPay/SatoshiPayAdminPlugin.php';
     92require_once __DIR__ . '/src/SatoshiPay/Gutenberg/init.php';
    9293
    9394use SatoshiPay\SatoshiPayPlugin;
    9495use SatoshiPay\SatoshiPayAdminPlugin;
     96use SatoshiPay\GutenbergEditor;
    9597
    9698if (is_admin()) {
     
    100102}
    101103
     104// Initialize Gutenberg Satoshipay blocks
     105GutenbergEditor\init();
     106
    102107// installation procedure
    103108include_once __DIR__ . '/src/SatoshiPay/SatoshiPayInstall.php';
  • satoshipay/trunk/src/SatoshiPay/Api/Client.php

    r1959692 r1994954  
    101101    {
    102102        if (empty($goodId)) {
    103             // TODO: add sensible error behaviour
    104103            return;
    105104        }
     
    126125    {
    127126        if (empty($goodId)) {
    128             // TODO: add sensible error behaviour
    129127            return;
    130128        }
     
    179177    {
    180178        if (empty($publisherId)) {
    181             // TODO: add sensible error behaviour
    182179            return;
    183180        }
     
    305302            if ($json) {
    306303                $message = '';
    307                 if ($json['name']) {
     304                if (array_key_exists('name', $json)) {
    308305                    $message .= $json['name'] . ' / ';
    309306                }
  • satoshipay/trunk/src/SatoshiPay/SatoshiPayAdminPlugin.php

    r1985825 r1994954  
    1515require_once __DIR__ . '/SatoshiPayException.php';
    1616
     17// Included to use is_plugin_active
     18include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
     19
    1720use WP_Ajax_Response;
    1821use WP_Post;
     
    106109    public function init()
    107110    {
     111        global $wp_version;
     112
    108113        load_plugin_textdomain($this->name, false, WP_PLUGIN_DIR . '/' . $this->name . '/languages/' );
    109114
     
    115120        add_action('admin_notices', array($this, 'adminNotices'));
    116121
    117         // Register edit post function
    118         add_action('load-post.php', array($this, 'onEditPost'));
    119 
    120         // Register update post function
    121         add_action('post updated', array($this, 'onUpdatePost'));
     122
     123        if(
     124            !(
     125                is_plugin_active( 'gutenberg/gutenberg.php' )
     126                || ( version_compare( $wp_version, '5.0', '>=' ) && !is_plugin_active( 'classic-editor/classic-editor.php' ) )
     127            )
     128        ) {
     129            // Disable post hooks if Gutenberg is enabled
     130            // check namespace SatoshiPay\GutenbergEditor for Gutenberg handlers
     131
     132            // Register edit post function
     133            add_action('load-post.php', array($this, 'onEditPost'));
     134
     135            // Register update post function
     136            add_action('post updated', array($this, 'onUpdatePost'));
     137            add_action('save_post', array($this, 'onSavePost'));
     138            add_action('edit_attachment', array($this, 'onSavePost'));
     139        }
    122140
    123141        add_action('admin_menu', array($this, 'onAdminMenu'));
     
    126144
    127145        add_action('add_meta_boxes', array($this, 'onAddMetaBoxes'));
    128         add_action('save_post', array($this, 'onSavePost'));
    129146        add_action('get_post', array($this, 'onPrepareAttachmentForJavascript'));
    130         add_action('edit_attachment', array($this, 'onSavePost'));
    131147        add_action('before_delete_post', array($this, 'onBeforeDeletePost'));
    132148
     
    550566    function apiError($message)
    551567    {
    552         // TODO: Show admin notice instead
    553568        WP_die($message);
    554569    }
Note: See TracChangeset for help on using the changeset viewer.