Skip to content

Commit

Permalink
Release version 2.0.4 (#714)
Browse files Browse the repository at this point in the history
* Bump tested version to 5.4.0

* Bump version number to 2.0.4

* phpcs & phpunit fixes

* Adds changelog for release

* Bump node version to 12, run npm audit fix

* Add note about bumping node version and npm audit
  • Loading branch information
kevinfodness committed Mar 31, 2020
1 parent 666312e commit 1e5ec58
Show file tree
Hide file tree
Showing 14 changed files with 4,401 additions and 2,698 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
assets/js
!assets/js/pluginsidebar
!assets/js/util
build
24 changes: 12 additions & 12 deletions admin/settings/class-admin-apple-settings-section-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ public function __construct( $page ) {

// Add the settings.
$this->settings = array(
'api_channel' => array(
'label' => __( 'Channel ID', 'apple-news' ),
'type' => 'string',
'size' => 40,
'api_channel' => array(
'label' => __( 'Channel ID', 'apple-news' ),
'type' => 'string',
'size' => 40,
),
'api_key' => array(
'label' => __( 'API Key ID', 'apple-news' ),
'type' => 'string',
'size' => 40,
'api_key' => array(
'label' => __( 'API Key ID', 'apple-news' ),
'type' => 'string',
'size' => 40,
),
'api_secret' => array(
'label' => __( 'API Key Secret', 'apple-news' ),
'type' => 'password',
'size' => 40,
'api_secret' => array(
'label' => __( 'API Key Secret', 'apple-news' ),
'type' => 'password',
'size' => 40,
),
'api_autosync' => array(
'label' => __( 'Automatically publish to Apple News when published in WordPress', 'apple-news' ),
Expand Down
10 changes: 5 additions & 5 deletions admin/settings/class-admin-apple-settings-section-post-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ public function __construct( $page ) {
}

$this->settings['post_types'] = array(
'label' => __( 'Post Types', 'apple-news' ),
'type' => $post_type_options,
'multiple' => true,
'sanitize' => array( $this, 'sanitize_array' ),
'size' => 10,
'label' => __( 'Post Types', 'apple-news' ),
'type' => $post_type_options,
'multiple' => true,
'sanitize' => array( $this, 'sanitize_array' ),
'size' => 10,
);
}

Expand Down
2 changes: 1 addition & 1 deletion apple-news.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Plugin Name: Publish to Apple News
* Plugin URI: http://github.com/alleyinteractive/apple-news
* Description: Export and sync posts to Apple format.
* Version: 2.0.3
* Version: 2.0.4
* Author: Alley
* Author URI: https://alley.co
* Text Domain: apple-news
Expand Down
2 changes: 2 additions & 0 deletions assets/js/util/safeJsonParse.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global describe, expect, it */

import safeJsonParse from './safeJsonParse';

describe('safeJsonParse', () => {
Expand Down
2 changes: 2 additions & 0 deletions assets/js/util/safeJsonParseArray.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global describe, expect, it */

import safeJsonParseArray from './safeJsonParseArray';

describe('safeJsonParseArray', () => {
Expand Down
2 changes: 2 additions & 0 deletions assets/js/util/safeJsonParseObject.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global describe, expect, it */

import safeJsonParseObject from './safeJsonParseObject';

describe('safeJsonParseObject', () => {
Expand Down
7 changes: 3 additions & 4 deletions includes/apple-exporter/components/class-embed-generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ protected function build( $html ) {
}

// Fork for iframe handling vs. not. Non-iframe detection is less straightforward, so it is best-effort.
if ( false !== strpos( $html, '<iframe' ) && $provider !== 'tiktok' ) {
if ( 'tiktok' === $provider && preg_match( '/<blockquote[^>]+?cite=[\'"]([^\'"]+)/', $html, $matches ) ) {
$url = $matches[1];
} elseif ( false !== strpos( $html, '<iframe' ) ) {
// Try to get the source URL.
if ( preg_match( '/<iframe[^>]+?src=[\'"]([^\'"]+)/', $html, $matches ) ) {
$url = $matches[1];
Expand All @@ -162,9 +164,6 @@ protected function build( $html ) {
if ( preg_match( '/<iframe[^>]+?title=[\'"]([^\'"]+)/', $html, $matches ) ) {
$title = $matches[1];
}
} elseif ( $provider === 'tiktok' && preg_match( '/<blockquote[^>]+?cite=[\'"]([^\'"]+)/', $html, $matches ) ) {
//TikTok stores the source URL in the blockquote cite attribute.
$url = $matches[1];
} elseif ( preg_match( '/data-(?:url|href)=[\'"]([^\'"]+)/', $html, $matches ) ) {
$url = $matches[1];
} elseif ( preg_match( '/<a[^>]+?href=[\'"]([^\'"]+)/', $html, $matches ) ) {
Expand Down
4 changes: 2 additions & 2 deletions includes/apple-exporter/components/class-image.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ class Image extends Component {
public static function node_matches( $node ) {

$has_image_child = false;
// If this is a figure and it has children, see if we can find an image
// If this is a figure and it has children, see if we can find an image.
if ( $node->hasChildNodes() && 'figure' === $node->tagName ) {
foreach ( $node->childNodes as $child ) {
if ( 'img' === $child->tagName ) {
if ( 'img' === $child->nodeName ) {
$has_image_child = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion includes/class-apple-news.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Apple_News {
* @var string
* @access public
*/
public static $version = '2.0.3';
public static $version = '2.0.4';

/**
* Link to support for the plugin on WordPress.org.
Expand Down
Loading

0 comments on commit 1e5ec58

Please sign in to comment.