Schema & Structured Data for WP & AMP - Version 1.8.3

Version Description

(16 May 2019) =

  • Bug Fixed: Warning: getimagesize #271
Download this release

Release Info

Developer magazine3
Plugin Icon 128x128 Schema & Structured Data for WP & AMP
Version 1.8.3
Comparing to
See all releases

Code changes from version 1.8.2 to 1.8.3

admin_section/common-function.php CHANGED
@@ -1638,4 +1638,32 @@ function saswp_frontend_enqueue(){
1638
 
1639
  }
1640
  return $aurthor_name;
1641
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1638
 
1639
  }
1640
  return $aurthor_name;
1641
+ }
1642
+
1643
+ function saswp_get_attachment_details_by_url($url, $post_id = '',$count='') {
1644
+
1645
+ $response = array();
1646
+
1647
+ $cached_data = get_transient('saswp_imageobject_' .$post_id.'_'.$count );
1648
+
1649
+ if (empty($cached_data)) {
1650
+
1651
+ $image = @getimagesize($url);
1652
+
1653
+ $response[0] = $image[0]; //width
1654
+ $response[1] = $image[1]; //height
1655
+
1656
+ if(empty($image) || $image == false){
1657
+ $img_id = attachment_url_to_postid($url);
1658
+ $imageDetail = wp_get_attachment_image_src( $img_id , 'full');
1659
+ $response[0] = $imageDetail[1]; // width
1660
+ $response[1] = $imageDetail[2]; // height
1661
+ }
1662
+ set_transient('saswp_imageobject_' .$post_id.'_'.$count, $response, 24*30*HOUR_IN_SECONDS );
1663
+
1664
+ $cached_data = $response;
1665
+ }
1666
+
1667
+ return $cached_data;
1668
+
1669
+ }
output/service.php CHANGED
@@ -1824,7 +1824,7 @@ Class saswp_output_service{
1824
  $k = 0;
1825
  foreach ($attachments[2] as $attachment) {
1826
 
1827
- $attach_details = getimagesize($attachment);
1828
  if($attach_details){
1829
 
1830
 
1824
  $k = 0;
1825
  foreach ($attachments[2] as $attachment) {
1826
 
1827
+ $attach_details = saswp_get_attachment_details_by_url($attachment, $post->ID, $k );
1828
  if($attach_details){
1829
 
1830
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: magazine3
3
  Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
4
  Requires at least: 3.0
5
  Tested up to: 5.2
6
- Stable tag: 1.8.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -66,6 +66,10 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
66
  == Changelog ==
67
 
68
 
 
 
 
 
69
  = 1.8.2 (13 May 2019) =
70
 
71
  * Bug Fixed: Warning: getimagesize #271
3
  Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
4
  Requires at least: 3.0
5
  Tested up to: 5.2
6
+ Stable tag: 1.8.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
66
  == Changelog ==
67
 
68
 
69
+ = 1.8.3 (16 May 2019) =
70
+
71
+ * Bug Fixed: Warning: getimagesize #271
72
+
73
  = 1.8.2 (13 May 2019) =
74
 
75
  * Bug Fixed: Warning: getimagesize #271
structured-data-for-wp.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Schema & Structured Data for WP
4
  Description: Schema & Structured Data adds Google Rich Snippets markup according to Schema.org guidelines to structure your site for SEO. (AMP Compatible)
5
- Version: 1.8.2
6
  Text Domain: schema-and-structured-data-for-wp
7
  Domain Path: /languages
8
  Author: Magazine3
@@ -13,7 +13,7 @@ License: GPL2
13
  // Exit if accessed directly.
14
  if ( ! defined( 'ABSPATH' ) ) exit;
15
 
16
- define('SASWP_VERSION', '1.8.2');
17
  define('SASWP_DIR_NAME_FILE', __FILE__ );
18
  define('SASWP_DIR_NAME', dirname( __FILE__ ));
19
  define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
2
  /*
3
  Plugin Name: Schema & Structured Data for WP
4
  Description: Schema & Structured Data adds Google Rich Snippets markup according to Schema.org guidelines to structure your site for SEO. (AMP Compatible)
5
+ Version: 1.8.3
6
  Text Domain: schema-and-structured-data-for-wp
7
  Domain Path: /languages
8
  Author: Magazine3
13
  // Exit if accessed directly.
14
  if ( ! defined( 'ABSPATH' ) ) exit;
15
 
16
+ define('SASWP_VERSION', '1.8.3');
17
  define('SASWP_DIR_NAME_FILE', __FILE__ );
18
  define('SASWP_DIR_NAME', dirname( __FILE__ ));
19
  define('SASWP_DIR_URI', plugin_dir_url(__FILE__));