Featured Image From URL - Version 2.1.3

Version Description

  • Bug fixes: parse error, featured image not shown on WooCommerce column.
Download this release

Release Info

Developer marceljm
Plugin Icon 128x128 Featured Image From URL
Version 2.1.3
Comparing to
See all releases

Code changes from version 2.1.2 to 2.1.3

featured-image-from-url.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Featured Image from URL
5
  * Plugin URI: https://featuredimagefromurl.com/
6
  * Description: Use an external image as Featured Image of your post/page/custom post type (WooCommerce). Includes Auto Set (External Post), Product Gallery, Social Tags and more.
7
- * Version: 2.1.2
8
  * Author: Marcel Jacques Machado
9
  * Author URI: https://www.linkedin.com/in/marceljm/
10
  */
4
  * Plugin Name: Featured Image from URL
5
  * Plugin URI: https://featuredimagefromurl.com/
6
  * Description: Use an external image as Featured Image of your post/page/custom post type (WooCommerce). Includes Auto Set (External Post), Product Gallery, Social Tags and more.
7
+ * Version: 2.1.3
8
  * Author: Marcel Jacques Machado
9
  * Author URI: https://www.linkedin.com/in/marceljm/
10
  */
includes/thumbnail.php CHANGED
@@ -72,7 +72,7 @@ function fifu_replace($html, $post_id, $post_thumbnail_id, $size) {
72
  $width = fifu_get_attribute('width', $html);
73
  $height = fifu_get_attribute('height', $html);
74
 
75
- if (fifu_is_on('fifu_lazy'))
76
  $html = str_replace("src", "data-src", $html);
77
 
78
  if (get_post_meta($post_id, 'fifu_image_url', true))
@@ -140,12 +140,6 @@ function fifu_lazy_url($url) {
140
  return (fifu_is_main_page() ? 'data-src="' : 'src="') . $url . '"';
141
  }
142
 
143
- function fifu_lazy_src_type() {
144
- if (fifu_is_off('fifu_lazy') || is_ajax_call())
145
- return 'src=';
146
- return (fifu_is_main_page() ? 'data-src=' : 'src=');
147
- }
148
-
149
  function fifu_is_main_page() {
150
  return is_home() || (class_exists('WooCommerce') && is_shop());
151
  }
72
  $width = fifu_get_attribute('width', $html);
73
  $height = fifu_get_attribute('height', $html);
74
 
75
+ if (fifu_is_on('fifu_lazy') && !is_admin())
76
  $html = str_replace("src", "data-src", $html);
77
 
78
  if (get_post_meta($post_id, 'fifu_image_url', true))
140
  return (fifu_is_main_page() ? 'data-src="' : 'src="') . $url . '"';
141
  }
142
 
 
 
 
 
 
 
143
  function fifu_is_main_page() {
144
  return is_home() || (class_exists('WooCommerce') && is_shop());
145
  }
includes/util.php CHANGED
@@ -4,8 +4,16 @@ function fifu_get_attribute($attribute, $html) {
4
  $attribute = $attribute . '=';
5
  if (strpos($html, $attribute) === false)
6
  return null;
7
- $aux = explode($attribute, $html)[1];
8
- return explode('"', $aux)[1];
 
 
 
 
 
 
 
 
9
  }
10
 
11
  function fifu_is_on($option) {
4
  $attribute = $attribute . '=';
5
  if (strpos($html, $attribute) === false)
6
  return null;
7
+
8
+ $aux = explode($attribute, $html);
9
+ if ($aux)
10
+ $aux = $aux[1];
11
+
12
+ $aux = explode('"', $aux);
13
+ if ($aux)
14
+ return $aux[1];
15
+
16
+ return null;
17
  }
18
 
19
  function fifu_is_on($option) {
readme.txt CHANGED
@@ -161,6 +161,9 @@ Features:
161
 
162
  == Changelog ==
163
 
 
 
 
164
  = 2.1.2 =
165
  * Bug fix: parse error on util.php
166
 
@@ -467,6 +470,9 @@ was removed. To finish, a Premium version is now been presented.
467
 
468
  == Upgrade Notice ==
469
 
 
 
 
470
  = 2.1.2 =
471
  * Bug fix: parse error on util.php
472
 
161
 
162
  == Changelog ==
163
 
164
+ = 2.1.3 =
165
+ * Bug fixes: parse error, featured image not shown on WooCommerce column.
166
+
167
  = 2.1.2 =
168
  * Bug fix: parse error on util.php
169
 
470
 
471
  == Upgrade Notice ==
472
 
473
+ = 2.1.3 =
474
+ * Bug fixes: parse error, featured image not shown on WooCommerce column.
475
+
476
  = 2.1.2 =
477
  * Bug fix: parse error on util.php
478