Instant Articles for WP - Version 4.0.5

Version Description

Download this release

Release Info

Developer diegoquinteiro
Plugin Icon 128x128 Instant Articles for WP
Version 4.0.5
Comparing to
See all releases

Code changes from version 4.0.4 to 4.0.5

CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
  ## Change Log
2
 
3
- ### 4.0.4 (2017/07/27 20:13 +00:00)
 
 
 
4
  - [#738](https://github.com/automattic/facebook-instant-articles-wp/pull/738) Add changelog to script (@diegoquinteiro)
5
  - [#737](https://github.com/automattic/facebook-instant-articles-wp/pull/737) Updates IA SDK to 1.6.2 and dependencies (@diegoquinteiro)
6
 
1
  ## Change Log
2
 
3
+ ### 4.0.5 (2017/08/24 19:07 +00:00)
4
+ - [#750](https://github.com/automattic/facebook-instant-articles-wp/pull/750) Fix query limit and escaping on AMP generation (@diegoquinteiro)
5
+
6
+ ### 4.0.4 (2017/07/27 20:14 +00:00)
7
  - [#738](https://github.com/automattic/facebook-instant-articles-wp/pull/738) Add changelog to script (@diegoquinteiro)
8
  - [#737](https://github.com/automattic/facebook-instant-articles-wp/pull/737) Updates IA SDK to 1.6.2 and dependencies (@diegoquinteiro)
9
 
class-instant-articles-amp-markup.php CHANGED
@@ -71,8 +71,9 @@ class Instant_Articles_AMP_Markup {
71
  $url = $adapter->get_canonical_url();
72
  $url = add_query_arg( self::QUERY_ARG, '1', $url );
73
 
74
- echo '<link rel="amphtml" href="' . $url . '">';
75
-
 
76
  }
77
 
78
  /**
@@ -119,7 +120,13 @@ class Instant_Articles_AMP_Markup {
119
 
120
  // Get all children with mime type image that are attached to the posts
121
  // NOTE: this will not get images that are not hosted in the WP
122
- $image_children = get_children( 'post_type=attachment&post_mime_type=image&post_parent=' . $post->ID );
 
 
 
 
 
 
123
 
124
  foreach ( $image_children as $img_id => $img ) {
125
  $meta = wp_get_attachment_metadata( $img_id );
71
  $url = $adapter->get_canonical_url();
72
  $url = add_query_arg( self::QUERY_ARG, '1', $url );
73
 
74
+ ?>
75
+ <link rel="amphtml" href="<?php echo esc_url($url); ?>">
76
+ <?php
77
  }
78
 
79
  /**
120
 
121
  // Get all children with mime type image that are attached to the posts
122
  // NOTE: this will not get images that are not hosted in the WP
123
+ $query_args = array(
124
+ 'post_parent' => $post->ID,
125
+ 'post_type' => 'attachment',
126
+ 'numberposts' => 100,
127
+ 'post_mime_type' => 'image'
128
+ );
129
+ $image_children = get_children( $query_args );
130
 
131
  foreach ( $image_children as $img_id => $img ) {
132
  $meta = wp_get_attachment_metadata( $img_id );
facebook-instant-articles.php CHANGED
@@ -4,7 +4,7 @@
4
  * Description: Add support for Instant Articles for Facebook to your WordPress site.
5
  * Author: Automattic, Dekode, Facebook
6
  * Author URI: https://vip.wordpress.com/plugins/instant-articles/
7
- * Version: 4.0.4
8
  * Text Domain: instant-articles
9
  * License: GPLv2
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -68,7 +68,7 @@ if ( version_compare( PHP_VERSION, '5.4', '<' ) ) {
68
 
69
  defined( 'ABSPATH' ) || die( 'Shame on you' );
70
 
71
- define( 'IA_PLUGIN_VERSION', '4.0.4' );
72
  define( 'IA_PLUGIN_PATH_FULL', __FILE__ );
73
  define( 'IA_PLUGIN_PATH', plugin_basename( __FILE__ ) );
74
  define( 'IA_PLUGIN_FILE_BASENAME', pathinfo( __FILE__, PATHINFO_FILENAME ) );
4
  * Description: Add support for Instant Articles for Facebook to your WordPress site.
5
  * Author: Automattic, Dekode, Facebook
6
  * Author URI: https://vip.wordpress.com/plugins/instant-articles/
7
+ * Version: 4.0.5
8
  * Text Domain: instant-articles
9
  * License: GPLv2
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
68
 
69
  defined( 'ABSPATH' ) || die( 'Shame on you' );
70
 
71
+ define( 'IA_PLUGIN_VERSION', '4.0.5' );
72
  define( 'IA_PLUGIN_PATH_FULL', __FILE__ );
73
  define( 'IA_PLUGIN_PATH', plugin_basename( __FILE__ ) );
74
  define( 'IA_PLUGIN_FILE_BASENAME', pathinfo( __FILE__, PATHINFO_FILENAME ) );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: trrine, olethomas, bjornjohansen, dekode, automattic, facebook
3
  Tags: instant articles, facebook, mobile
4
  Requires at least: 4.3
5
  Tested up to: 4.8
6
- Stable tag: 4.0.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -86,7 +86,10 @@ Usually simply visiting the permalinks settings page in the WordPress dashboard
86
  == Changelog ==
87
  ## Change Log
88
 
89
- ### 4.0.4 (2017/07/27 20:13 +00:00)
 
 
 
90
  - [#738](https://github.com/automattic/facebook-instant-articles-wp/pull/738) Add changelog to script (@diegoquinteiro)
91
  - [#737](https://github.com/automattic/facebook-instant-articles-wp/pull/737) Updates IA SDK to 1.6.2 and dependencies (@diegoquinteiro)
92
 
3
  Tags: instant articles, facebook, mobile
4
  Requires at least: 4.3
5
  Tested up to: 4.8
6
+ Stable tag: 4.0.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
86
  == Changelog ==
87
  ## Change Log
88
 
89
+ ### 4.0.5 (2017/08/24 19:07 +00:00)
90
+ - [#750](https://github.com/automattic/facebook-instant-articles-wp/pull/750) Fix query limit and escaping on AMP generation (@diegoquinteiro)
91
+
92
+ ### 4.0.4 (2017/07/27 20:14 +00:00)
93
  - [#738](https://github.com/automattic/facebook-instant-articles-wp/pull/738) Add changelog to script (@diegoquinteiro)
94
  - [#737](https://github.com/automattic/facebook-instant-articles-wp/pull/737) Updates IA SDK to 1.6.2 and dependencies (@diegoquinteiro)
95