Plugin Directory

Changeset 2368117


Ignore:
Timestamp:
08/24/2020 08:45:11 PM (6 years ago)
Author:
transact
Message:

version 5.2.0: oembed support and fix subscription validation check

Location:
transact
Files:
10 edited
6 copied

Legend:

Unmodified
Added
Removed
  • transact/tags/5.2.0/admin/controllers/transact-admin-settings-post.php

    r2328310 r2368117  
    66
    77use Transact\Admin\Settings\Shortcode\transactShortcode;
     8use Transact\Utils\Config\Parser\ConfigParser;
     9
    810require_once  plugin_dir_path(__FILE__) . 'transact-shortcode.php';
    911
     
    5153    public function __construct($post_id = null)
    5254    {
     55        $config = new ConfigParser();
     56
    5357        if ($post_id) {
    5458            $this->post_id = $post_id;
  • transact/tags/5.2.0/config.ini

    r2344350 r2368117  
    77api_subscription_validate = "group/{{account_id}}/subscriber/valid/{{subscription_id}}"
    88xsact_purchase_url        = "https://transact.io/purchase/"
     9postd_url                 = "https://www.postd.io/api/"
     10postd_regex               = "#https?://(www\.)?postd.io/post/.*#i"
    911
    1012js_xsact_library          = "//transact.io/assets/js/transact.js"
  • transact/tags/5.2.0/frontend/controllers/transact-api.php

    r2348646 r2368117  
    280280        $url = str_replace(self::ACCOUNT_ID_KEY, $account_id, $validate_url);
    281281        $url = str_replace(self::SUBSCRIPTION_ID_KEY, $subscription_id, $url);
     282
     283        $this->transact->setSecret($this->secret_id);
     284        $this->transact->setAlg($this->alg);
     285
    282286        $secret = $this->transact->getSubscriptionValidationToken($account_id);
    283287
     
    298302
    299303        if ($body->expires > time() * 1000) {
     304            // TODO if the expiration date has changed should we update meta?
    300305            return true;
    301306        } else {
  • transact/tags/5.2.0/frontend/controllers/transact-single-post.php

    r2367448 r2368117  
    556556        add_action( 'wp_head', array($this, 'add_wp_nonce') );
    557557
     558        wp_oembed_add_provider(
     559            $this->config->getPostdPostRegex(),
     560            $this->config->getPostdUrl() . 'services/oembed?url=',
     561            true
     562        );
     563
    558564        if(!self::INLINE_COMMENTS_OUTPUT) {
    559565            /**
  • transact/tags/5.2.0/readme.txt

    r2367448 r2368117  
    66Requires PHP: 5.6
    77Tested up to: 5.4.2
    8 Stable tag: 5.1.4
     8Stable tag: 5.2.0
    99License: APACHE-2.0
    1010License URI: https://www.apache.org/licenses/LICENSE-2.0
     
    8282
    8383
     84= 5.2.0 =
     85* Add oembed support
     86* fix for subscription validation
     87
    8488= 5.1.4 =
    8589* Check for already exising email registration.
  • transact/tags/5.2.0/transact-plugin.php

    r2367448 r2368117  
    33 * Plugin Name: transact.io
    44 * Description: Integrates transact.io services into WP
    5  * Version: 5.1.4
     5 * Version: 5.2.0
    66 * Author: transact.io
    77 * Author URI: https://transact.io
  • transact/tags/5.2.0/utils/transact-utils-config-parser.php

    r2344350 r2368117  
    4545
    4646    /**
     47     * Key for POSTD_URL
     48     */
     49    const POSTD_URL = 'postd_url';
     50
     51    /**
     52     * Key for POSTD_REGEX
     53     */
     54    const POSTD_REGEX = 'postd_regex';
     55
     56    /**
    4757     * Parses config.ini
    4858     */
     
    8393
    8494    /**
     95     * Returning Postd api url for oembed
     96     *
     97     * @return string transact purchase url
     98     */
     99    public function getPostdUrl()
     100    {
     101        return $this->config[self::POSTD_URL];
     102    }
     103
     104    /**
     105     * Returning Postd api url for oembed
     106     *
     107     * @return string transact purchase url
     108     */
     109    public function getPostdPostRegex()
     110    {
     111        return $this->config[self::POSTD_REGEX];
     112    }
     113
     114    /**
    85115     * Retrieves Api authentication url
    86116     *
  • transact/trunk/admin/controllers/transact-admin-settings-post.php

    r2328310 r2368117  
    66
    77use Transact\Admin\Settings\Shortcode\transactShortcode;
     8use Transact\Utils\Config\Parser\ConfigParser;
     9
    810require_once  plugin_dir_path(__FILE__) . 'transact-shortcode.php';
    911
     
    5153    public function __construct($post_id = null)
    5254    {
     55        $config = new ConfigParser();
     56
    5357        if ($post_id) {
    5458            $this->post_id = $post_id;
  • transact/trunk/config.ini

    r2344350 r2368117  
    77api_subscription_validate = "group/{{account_id}}/subscriber/valid/{{subscription_id}}"
    88xsact_purchase_url        = "https://transact.io/purchase/"
     9postd_url                 = "https://www.postd.io/api/"
     10postd_regex               = "#https?://(www\.)?postd.io/post/.*#i"
    911
    1012js_xsact_library          = "//transact.io/assets/js/transact.js"
  • transact/trunk/frontend/controllers/transact-api.php

    r2348646 r2368117  
    280280        $url = str_replace(self::ACCOUNT_ID_KEY, $account_id, $validate_url);
    281281        $url = str_replace(self::SUBSCRIPTION_ID_KEY, $subscription_id, $url);
     282
     283        $this->transact->setSecret($this->secret_id);
     284        $this->transact->setAlg($this->alg);
     285
    282286        $secret = $this->transact->getSubscriptionValidationToken($account_id);
    283287
     
    298302
    299303        if ($body->expires > time() * 1000) {
     304            // TODO if the expiration date has changed should we update meta?
    300305            return true;
    301306        } else {
  • transact/trunk/frontend/controllers/transact-single-post.php

    r2367448 r2368117  
    556556        add_action( 'wp_head', array($this, 'add_wp_nonce') );
    557557
     558        wp_oembed_add_provider(
     559            $this->config->getPostdPostRegex(),
     560            $this->config->getPostdUrl() . 'services/oembed?url=',
     561            true
     562        );
     563
    558564        if(!self::INLINE_COMMENTS_OUTPUT) {
    559565            /**
  • transact/trunk/readme.txt

    r2367448 r2368117  
    66Requires PHP: 5.6
    77Tested up to: 5.4.2
    8 Stable tag: 5.1.4
     8Stable tag: 5.2.0
    99License: APACHE-2.0
    1010License URI: https://www.apache.org/licenses/LICENSE-2.0
     
    8282
    8383
     84= 5.2.0 =
     85* Add oembed support
     86* fix for subscription validation
     87
    8488= 5.1.4 =
    8589* Check for already exising email registration.
  • transact/trunk/transact-plugin.php

    r2367448 r2368117  
    33 * Plugin Name: transact.io
    44 * Description: Integrates transact.io services into WP
    5  * Version: 5.1.4
     5 * Version: 5.2.0
    66 * Author: transact.io
    77 * Author URI: https://transact.io
  • transact/trunk/utils/transact-utils-config-parser.php

    r2344350 r2368117  
    4545
    4646    /**
     47     * Key for POSTD_URL
     48     */
     49    const POSTD_URL = 'postd_url';
     50
     51    /**
     52     * Key for POSTD_REGEX
     53     */
     54    const POSTD_REGEX = 'postd_regex';
     55
     56    /**
    4757     * Parses config.ini
    4858     */
     
    8393
    8494    /**
     95     * Returning Postd api url for oembed
     96     *
     97     * @return string transact purchase url
     98     */
     99    public function getPostdUrl()
     100    {
     101        return $this->config[self::POSTD_URL];
     102    }
     103
     104    /**
     105     * Returning Postd api url for oembed
     106     *
     107     * @return string transact purchase url
     108     */
     109    public function getPostdPostRegex()
     110    {
     111        return $this->config[self::POSTD_REGEX];
     112    }
     113
     114    /**
    85115     * Retrieves Api authentication url
    86116     *
Note: See TracChangeset for help on using the changeset viewer.