Plugin Directory

Changeset 2126721


Ignore:
Timestamp:
07/22/2019 02:48:05 PM (7 years ago)
Author:
canvasflow
Message:

Support for new Canvasflow api syntax

Location:
canvasflow/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • canvasflow/trunk/README.md

    r2057696 r2126721  
    2727
    2828#### Requirements
    29 * WordPress 4.2 +
     29* WordPress 5.2.2 +
    3030* PHP 5.4 or higher (7.x recommended)
    3131* MySQL 5.0 or higher
     
    7878
    7979#### Changelog
    80 ##### 1.5.2
    81 * Works with wordpress 5.1.1
     80##### 1.5.3
     81* Added support for new API syntax
    8282
    8383##### 1.5.0
     
    185185
    186186#### Upgrade Notice
    187 
    188 ##### 1.5.2
    189 * Works with wordpress 5.1.1
     187##### 1.5.3
     188* Added support for new API syntax
    190189
    191190##### 1.5.0
     
    263262* Users can specify to which issue an post is going to be published
    264263
    265 #### 0.10.0
     264##### 0.10.0
    266265* Added support for WordPress Shortcodes
    267266
  • canvasflow/trunk/canvasflow-plugin.php

    r2025423 r2126721  
    33  Plugin Name: Canvasflow for WordPress
    44  Description: This out-of-the-box connector provides a quick and simple way to push your blog content directly to an existing Canvasflow publication.
    5   Version: 1.5.2
     5  Version: 1.5.3
    66    Developer:  Canvasflow
    77    Developer URI: https://canvasflow.io
     
    3838class WP_Canvasflow{
    3939    private $wpdb;
    40     public static $version = "1.5.2";
     40    public static $version = "1.5.3";
    4141    private $canvasflow_db;
    4242    private $canvasflow_tables_names;
     
    4444    function __construct() {
    4545        $this->wpdb = $GLOBALS['wpdb'];
     46        $this->version = "1.5.2";
    4647        $this->canvasflow_db = new Canvasflow_DB();
    4748       
  • canvasflow/trunk/includes/canvasflow-api.php

    r2025423 r2126721  
    33    require_once(realpath(dirname(__FILE__) . '/..').'/canvasflow-plugin.php');
    44    class Canvasflow_Api {
    5         private $base_url = 'https://api.canvasflow.io/v1/index.cfm';
    65        public $domain = 'canvasflow.io';
     6        private $base_url = "https://api.canvasflow.io/v1";
     7       
    78        private $version;
    8         /*private $base_url = 'http://api.canvasflow.webhop.net/v1/index.cfm';
    9         public $domain = 'canvasflow.webhop.net';*/
    109        private $max_timeout = 30;
    1110        private $canvasflow_shortcodes;
     
    3736
    3837        public function publish_post($content, $post_title, $post_id, $style_id, $issue_id, $secret_key, $merge_adjacent_paragraphs, $publication_id, $channel_id, $collection_id, $title_in_content = FALSE, $author_name, $post_date, $auto_publish = FALSE, $enable_feature_image = TRUE) {
     38            // $url = $this->base_url."/article";
     39            // $url = "http://api.{$this->domain}/v1/index.cfm?endpoint=/article";
    3940            $url = $this->base_url."/article";
    4041           
     
    7172            if($this->canvasflow_shortcodes != null) {
    7273                $this->canvasflow_shortcodes->register();
    73             } else {
    74                 echo '<script>console.log("Shortcodes are null")</script>';
    7574            }
    7675
     
    8382            if($this->canvasflow_shortcodes != null) {
    8483                $this->canvasflow_shortcodes->unregister();
    85             }  else {
    86                 echo '<script>console.log("Shortcodes are null")</script>';
    8784            }
    8885
     
    9390            if($title_in_content == 1) {
    9491                $content = "<h1>{$post_title}</h1>".$content;
    95             } 
     92            }
    9693           
    9794            // Uncomment this to ignore shortcodes
     
    106103
    107104            $data = array(
    108                 'secretkey' => $secret_key,
     105                'secretKey' => $secret_key,
    109106                'content' => $content,
    110107                'contentType' => "html",
     
    135132                'httpversion' => '1.0',
    136133                'blocking'    => true,
    137                 'headers'     => array(),
     134                'headers'     => array(
     135                    'Accept-Encoding' => 'gzip, deflate'
     136                ),
    138137                'body'        => $data,
    139138                'cookies'     => array()
     
    214213                'timeout'     => 45,
    215214                'redirection' => 5,
    216                 'httpversion' => '1.0'
     215                'httpversion' => '1.0',
     216                'headers'     => array(
     217                    'Accept-Encoding' => 'gzip, deflate'
     218                )
    217219            ));
    218220   
     
    238240                'timeout'     => 45,
    239241                'redirection' => 5,
    240                 'httpversion' => '1.0'
     242                'httpversion' => '1.0',
     243                'headers'     => array(
     244                    'Accept-Encoding' => 'gzip, deflate'
     245                )
    241246            ));
    242247            if ( is_wp_error( $response ) ) {
     
    267272                'timeout'     => 45,
    268273                'redirection' => 5,
    269                 'httpversion' => '1.0'
     274                'httpversion' => '1.0',
     275                'headers'     => array(
     276                    'Accept-Encoding' => 'gzip, deflate'
     277                )
    270278            ));
    271279
     
    291299                'timeout'     => 45,
    292300                'redirection' => 5,
    293                 'httpversion' => '1.0'
     301                'httpversion' => '1.0',
     302                'headers'     => array(
     303                    'Accept-Encoding' => 'gzip, deflate'
     304                )
    294305            ));
    295306
     
    316327                'timeout'     => 45,
    317328                'redirection' => 5,
    318                 'httpversion' => '1.0'
     329                'httpversion' => '1.0',
     330                'headers'     => array(
     331                    'Accept-Encoding' => 'gzip, deflate'
     332                )
    319333            ));
    320334            if ( is_wp_error( $response ) ) {
     
    346360                'timeout'     => 45,
    347361                'redirection' => 5,
    348                 'httpversion' => '1.0'
     362                'httpversion' => '1.0',
     363                'headers'     => array(
     364                    'Accept-Encoding' => 'gzip, deflate'
     365                )
    349366            ));
    350367
     
    373390                'timeout'     => 45,
    374391                'redirection' => 5,
    375                 'httpversion' => '1.0'
     392                'httpversion' => '1.0',
     393                'headers'     => array(
     394                    'Accept-Encoding' => 'gzip, deflate'
     395                )
    376396            ));
    377397
     
    392412                'timeout'     => 45,
    393413                'redirection' => 5,
    394                 'httpversion' => '1.0'
     414                'httpversion' => '1.0',
     415                'headers'     => array(
     416                    'Accept-Encoding' => 'gzip, deflate'
     417                )
    395418            ));
    396419
  • canvasflow/trunk/readme.txt

    r2057808 r2126721  
    33Tags: Canvasflow, Digital Publishing Solution, Digital Publishing, Publishing, HTML5, Twixl, Pugpig, Sprylab, PurpleDS, Adobe, AEM Mobile, Adobe Experience Manager Mobile
    44Requires at least: 4.2
    5 Tested up to: 5.1.1
     5Tested up to: 5.2.2
    66Stable tag: stable
    77License: GPLv3 or later
     
    7474
    7575== Changelog ==
     76= 1.5.3 =
     77* Added support for new API syntax
     78
    7679= 1.5.2 =
    7780* Works with wordpress 5.1.1
     
    182185
    183186== Upgrade Notice ==
     187= 1.5.3 =
     188* Added support for new API syntax
     189
    184190= 1.5.2 =
    185191* Works with wordpress 5.1.1
Note: See TracChangeset for help on using the changeset viewer.