Featured Image From URL - Version 3.2.2

Version Description

  • Adjustment: layout changes for WordPress 5.5; improvement: Flickr Thumbnails (less controls and more precision); bug fix: conflict between Lazy Load and Avada theme.
Download this release

Release Info

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

Code changes from version 3.2.1 to 3.2.2

admin/html/js/menu.js CHANGED
@@ -30,7 +30,6 @@ jQuery(function () {
30
  });
31
  });
32
 
33
- jQuery("#tabs-flickr").tabs();
34
  jQuery("#tabs").tabs();
35
  jQuery("#tabs-top").tabs();
36
  jQuery("#fifu_input_spinner_cron_metadata").spinner({min: 1, step: 1});
30
  });
31
  });
32
 
 
33
  jQuery("#tabs").tabs();
34
  jQuery("#tabs-top").tabs();
35
  jQuery("#fifu_input_spinner_cron_metadata").spinner({min: 1, step: 1});
admin/html/js/meta-box.js CHANGED
@@ -93,4 +93,7 @@ jQuery(document).ready(function () {
93
  evt.stopImmediatePropagation();
94
  jQuery.fancybox.open('<img src="' + jQuery("#fifu_input_url").val() + '" style="max-height:600px">');
95
  });
 
 
 
96
  });
93
  evt.stopImmediatePropagation();
94
  jQuery.fancybox.open('<img src="' + jQuery("#fifu_input_url").val() + '" style="max-height:600px">');
95
  });
96
+
97
+ jQuery("div#imageUrlMetaBox").find('h2').replaceWith('<h3 style="top:7px;position:relative;"><span class="dashicons dashicons-camera" style="font-size:15px"></span> Featured image</h3>');
98
+ jQuery("div#urlMetaBox").find('h2').replaceWith('<h4 style="top:5px;position:relative;"><span class="dashicons dashicons-camera" style="font-size:15px"></span> Product image</h4>');
99
  });
admin/html/menu.html CHANGED
@@ -669,7 +669,7 @@
669
  href="javascript:void(0)"
670
  id="fifu_toggle_enable_default_url"
671
  onclick="invert('enable_default_url');
672
- fifu_default_js();"
673
  name="fifu_toggle_enable_default_url"
674
  class="<?php echo $enable_default_url; ?>"
675
  value=""
@@ -1084,7 +1084,7 @@
1084
  href="javascript:void(0)"
1085
  id="fifu_toggle_fake"
1086
  onclick="invert('fake');
1087
- fifu_fake_js();";
1088
  name="fifu_toggle_fake"
1089
  class="<?php echo $enable_fake; ?>"
1090
  value=""
@@ -1121,7 +1121,7 @@
1121
  href="javascript:void(0)"
1122
  id="fifu_toggle_data_clean"
1123
  onclick="invert('data_clean');
1124
- fifu_clean_js();";
1125
  name="fifu_toggle_data_clean"
1126
  class="<?php echo $enable_data_clean; ?>"
1127
  value=""
@@ -1969,136 +1969,18 @@
1969
 
1970
  <div class="box">
1971
  <div class="fifu-pro">premium</div>
1972
- <h2><a href="https://www.flickr.com/">Flickr</a> <?php esc_html_e('Thumbnails', 'featured-image-from-url'); ?></h2>
1973
  <div class="greybox" id="grad2">
1974
- <div id="tabs-flickr">
1975
- <ul>
1976
- <li><a href="#tabs-flickr-d"><?php esc_html_e('Sizes', 'featured-image-from-url'); ?></a></li>
1977
- <li><a href="#tabs-flickr-c"><?php esc_html_e('Getting Flickr URL', 'featured-image-from-url'); ?></a></li>
1978
-
1979
- <div id="tabs-flickr-c">
1980
- <br><br><br>
1981
- <?php esc_html_e('You just need to get one URL (Square 75, for example). Use that into the Featured Image (URL) field of your post. FIFU will handle this URL to provide the image in different sizes.', 'featured-image-from-url'); ?><br><br>
1982
- <img src="https://c1.staticflickr.com/1/745/31593837206_8e081be749_z_d.jpg" style="width:100%"/>
1983
- <br><br>
1984
- <img src="https://c1.staticflickr.com/1/223/30820834393_f869fcff49_z_d.jpg" style="width:100%"/>
1985
- </div>
1986
- <div id="tabs-flickr-d">
1987
- <br><br>
1988
- <table id="thumbnail-size">
1989
- <tr>
1990
- <th><?php esc_html_e('width', 'featured-image-from-url'); ?></th>
1991
- <th>75</th>
1992
- <th>100</th>
1993
- <th>150</th>
1994
- <th>240</th>
1995
- <th>320</th>
1996
- <th>500</th>
1997
- <th>640</th>
1998
- <th>800</th>
1999
- <th>1024</th>
2000
- </tr>
2001
- <tr>
2002
- <td><center><?php esc_html_e('post', 'featured-image-from-url'); ?></center></td>
2003
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-post-75"></center></td>
2004
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-post-100"></center></td>
2005
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-post-150"></center></td>
2006
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-post-240"></center></td>
2007
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-post-320"></center></td>
2008
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-post-500"></center></td>
2009
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-post-640"></center></td>
2010
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-post-800"></center></td>
2011
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-post-1024"></center></td>
2012
- </tr>
2013
- <tr>
2014
- <td><center><?php esc_html_e('page', 'featured-image-from-url'); ?></center></td>
2015
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-page-75"></center></td>
2016
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-page-100"></center></td>
2017
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-page-150"></center></td>
2018
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-page-240"></center></td>
2019
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-page-320"></center></td>
2020
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-page-500"></center></td>
2021
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-page-640"></center></td>
2022
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-page-800"></center></td>
2023
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-page-1024"></center></td>
2024
- </tr>
2025
- <tr>
2026
- <td><center><?php esc_html_e('archive', 'featured-image-from-url'); ?></center></td>
2027
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-arch-75"></center></td>
2028
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-arch-100"></center></td>
2029
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-arch-150"></center></td>
2030
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-arch-240"></center></td>
2031
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-arch-320"></center></td>
2032
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-arch-500"></center></td>
2033
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-arch-640"></center></td>
2034
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-arch-800"></center></td>
2035
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-arch-1024"></center></td>
2036
- </tr>
2037
- <tr>
2038
- <td><center><?php esc_html_e('cart', 'featured-image-from-url'); ?></center></td>
2039
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-cart-75"></center></td>
2040
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-cart-100"></center></td>
2041
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-cart-150"></center></td>
2042
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-cart-240"></center></td>
2043
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-cart-320"></center></td>
2044
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-cart-500"></center></td>
2045
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-cart-640"></center></td>
2046
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-cart-800"></center></td>
2047
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-cart-1024"></center></td>
2048
- </tr>
2049
- <tr>
2050
- <td><center><?php esc_html_e('category', 'featured-image-from-url'); ?></center></td>
2051
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-ctgr-75"></center></td>
2052
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-ctgr-100"></center></td>
2053
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-ctgr-150"></center></td>
2054
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-ctgr-240"></center></td>
2055
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-ctgr-320"></center></td>
2056
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-ctgr-500"></center></td>
2057
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-ctgr-640"></center></td>
2058
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-ctgr-800"></center></td>
2059
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-ctgr-1024"></center></td>
2060
- </tr>
2061
- <tr>
2062
- <td><center><?php esc_html_e('home', 'featured-image-from-url'); ?></center></td>
2063
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-home-75"></center></td>
2064
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-home-100"></center></td>
2065
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-home-150"></center></td>
2066
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-home-240"></center></td>
2067
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-home-320"></center></td>
2068
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-home-500"></center></td>
2069
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-home-640"></center></td>
2070
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-home-800"></center></td>
2071
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-home-1024"></center></td>
2072
- </tr>
2073
- <tr>
2074
- <td><center><?php esc_html_e('product', 'featured-image-from-url'); ?></center></td>
2075
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-prod-75"></center></td>
2076
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-prod-100"></center></td>
2077
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-prod-150"></center></td>
2078
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-prod-240"></center></td>
2079
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-prod-320"></center></td>
2080
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-prod-500"></center></td>
2081
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-prod-640"></center></td>
2082
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-prod-800"></center></td>
2083
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-prod-1024"></center></td>
2084
- </tr>
2085
- <tr>
2086
- <td><center><?php esc_html_e('shop', 'featured-image-from-url'); ?></center></td>
2087
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-shop-75"></center></td>
2088
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-shop-100"></center></td>
2089
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-shop-150"></center></td>
2090
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-shop-240"></center></td>
2091
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-shop-320"></center></td>
2092
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-shop-500"></center></td>
2093
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-shop-640"></center></td>
2094
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-shop-800"></center></td>
2095
- <td><center><input type="checkbox" onclick="javascript:void(0)" id="cb-shop-1024"></center></td>
2096
- </tr>
2097
- </table>
2098
- </div>
2099
- </ul>
2100
- </div>
2101
- </div>
2102
  </div>
2103
  </div>
2104
  <div id="tabs-q">
@@ -2752,8 +2634,8 @@
2752
  <h2><?php esc_html_e('Fast support', 'featured-image-from-url'); ?></h2>
2753
  <div class="greybox">
2754
  <?php esc_html_e('If you need help, you can refer to', 'featured-image-from-url'); ?> <a href="admin.php?page=featured-image-from-url#tabs-t" target="_blank"><?php esc_html_e('troubleshooting', 'featured-image-from-url'); ?></a> <?php esc_html_e('or send an email to', 'featured-image-from-url'); ?><b> marcel@featuredimagefromurl.com</b> (<?php esc_html_e('with this', 'featured-image-from-url'); ?> <a href="admin.php?page=fifu-support-data"><button id="opener" onclick="jQuery('#tabs-top').block({message: '<?php esc_html_e('Please wait some seconds...', 'featured-image-from-url'); ?>', css: {backgroundColor: 'none', border: 'none', color: 'white'}});"><?php esc_html_e('status', 'featured-image-from-url'); ?></button></a>).
2755
- </div>
2756
- <div class="greybox">
2757
  <table style="background-color: #fff; border-radius: 13px;">
2758
  <tr>
2759
  <td style="width:33%;text-align:center;border-bottom: 1px solid #ddd !important">
@@ -2792,9 +2674,9 @@
2792
  </td>
2793
  </tr>
2794
  </table>
2795
- </div>
2796
 
2797
- <div class="greybox">
 
2798
  <table style="background-color: #fff; border-radius: 13px;">
2799
  <tr>
2800
  <td style="width:33%;text-align:center;border-bottom: 1px solid #ddd !important">
@@ -2836,6 +2718,7 @@
2836
  </tr>
2837
  </table>
2838
  </div>
 
2839
  </div>
2840
  <!--div class="box">
2841
  <h2><a class="dbox-donation-button" style="background: #2d81c5;color: #fff;text-decoration: none;display: inline-block;font-size: 16px;padding: 2px 17px;-webkit-border-radius: 2px;-moz-border-radius: 2px;border-radius: 2px;box-shadow: 0px 0px 0px 0px #1f5a89;text-shadow: 0 1px rgba(0, 0, 0, 0.3);" href="https://fifu.app/#price" target="_blank">Buy Premium</a> and help me to take this project to the next level <span class="dashicons dashicons-info" style="font-size: 25px;" title="Pay with a Card, Apple Pay, Google Pay, Stripe, PayPal and more. No account required."></span></h2>
669
  href="javascript:void(0)"
670
  id="fifu_toggle_enable_default_url"
671
  onclick="invert('enable_default_url');
672
+ fifu_default_js();"
673
  name="fifu_toggle_enable_default_url"
674
  class="<?php echo $enable_default_url; ?>"
675
  value=""
1084
  href="javascript:void(0)"
1085
  id="fifu_toggle_fake"
1086
  onclick="invert('fake');
1087
+ fifu_fake_js();";
1088
  name="fifu_toggle_fake"
1089
  class="<?php echo $enable_fake; ?>"
1090
  value=""
1121
  href="javascript:void(0)"
1122
  id="fifu_toggle_data_clean"
1123
  onclick="invert('data_clean');
1124
+ fifu_clean_js();";
1125
  name="fifu_toggle_data_clean"
1126
  class="<?php echo $enable_data_clean; ?>"
1127
  value=""
1969
 
1970
  <div class="box">
1971
  <div class="fifu-pro">premium</div>
1972
+ <h2><?php esc_html_e('Flickr Thumbnails', 'fifu-premium'); ?></h2>
1973
  <div class="greybox" id="grad2">
1974
+ <?php esc_html_e('Flickr images have thumbnails and FIFU is able to load the exactly thumbnail your site needs. The supported sizes are 75, 100, 150, 240, 320, 500, 640, 800 and 1024 px width. Larger sizes can\'t be used due a different URL pattern.', 'fifu-premium'); ?><br><br>
1975
+ <b><?php esc_html_e('Requirement:', 'fifu-premium'); ?></b> <?php esc_html_e('the Lazy Load feature should be enabled.', 'fifu-premium'); ?>
1976
+ </div>
1977
+ <br>
1978
+ <input
1979
+ type="submit"
1980
+ href="javascript:void(0)"
1981
+ class="toggleoff"
1982
+ value=""
1983
+ style="display:block;border:none">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1984
  </div>
1985
  </div>
1986
  <div id="tabs-q">
2634
  <h2><?php esc_html_e('Fast support', 'featured-image-from-url'); ?></h2>
2635
  <div class="greybox">
2636
  <?php esc_html_e('If you need help, you can refer to', 'featured-image-from-url'); ?> <a href="admin.php?page=featured-image-from-url#tabs-t" target="_blank"><?php esc_html_e('troubleshooting', 'featured-image-from-url'); ?></a> <?php esc_html_e('or send an email to', 'featured-image-from-url'); ?><b> marcel@featuredimagefromurl.com</b> (<?php esc_html_e('with this', 'featured-image-from-url'); ?> <a href="admin.php?page=fifu-support-data"><button id="opener" onclick="jQuery('#tabs-top').block({message: '<?php esc_html_e('Please wait some seconds...', 'featured-image-from-url'); ?>', css: {backgroundColor: 'none', border: 'none', color: 'white'}});"><?php esc_html_e('status', 'featured-image-from-url'); ?></button></a>).
2637
+ <br>
2638
+ <br>
2639
  <table style="background-color: #fff; border-radius: 13px;">
2640
  <tr>
2641
  <td style="width:33%;text-align:center;border-bottom: 1px solid #ddd !important">
2674
  </td>
2675
  </tr>
2676
  </table>
 
2677
 
2678
+ <br>
2679
+
2680
  <table style="background-color: #fff; border-radius: 13px;">
2681
  <tr>
2682
  <td style="width:33%;text-align:center;border-bottom: 1px solid #ddd !important">
2718
  </tr>
2719
  </table>
2720
  </div>
2721
+
2722
  </div>
2723
  <!--div class="box">
2724
  <h2><a class="dbox-donation-button" style="background: #2d81c5;color: #fff;text-decoration: none;display: inline-block;font-size: 16px;padding: 2px 17px;-webkit-border-radius: 2px;-moz-border-radius: 2px;border-radius: 2px;box-shadow: 0px 0px 0px 0px #1f5a89;text-shadow: 0 1px rgba(0, 0, 0, 0.3);" href="https://fifu.app/#price" target="_blank">Buy Premium</a> and help me to take this project to the next level <span class="dashicons dashicons-info" style="font-size: 25px;" title="Pay with a Card, Apple Pay, Google Pay, Stripe, PayPal and more. No account required."></span></h2>
admin/html/meta-box.html CHANGED
@@ -13,17 +13,6 @@
13
  </tr>
14
  </table>
15
 
16
- <table id="fifu_giphy" style="<?php echo $show_button ?>;padding-bottom:4px">
17
- <tr>
18
- <th style="width:5px">
19
- <input type="checkbox" name="fifu_giphy_checkbox" id="fifu_giphy_checkbox" disabled>
20
- </th>
21
- <th>
22
- <label for="fifu_giphy_checkbox" style="font-weight:normal;color:#cccccc"><?php esc_html_e('Giphy search', 'featured-image-from-url'); ?> (Premium)</label>
23
- </th>
24
- </tr>
25
- </table>
26
-
27
  <input id="fifu_input_alt"
28
  type="text"
29
  name="fifu_input_alt"
13
  </tr>
14
  </table>
15
 
 
 
 
 
 
 
 
 
 
 
 
16
  <input id="fifu_input_alt"
17
  type="text"
18
  name="fifu_input_alt"
admin/meta-box.php CHANGED
@@ -8,17 +8,9 @@ function fifu_insert_meta_box() {
8
 
9
  foreach ($post_types as $post_type) {
10
  if ($post_type == 'product') {
11
- add_meta_box('urlMetaBox', '<span class="dashicons dashicons-camera" style="font-size:20px"></span> ' . esc_html__('Product Image (URL)', 'featured-image-from-url'), 'fifu_show_elements', $post_type, 'side', 'low');
12
- add_meta_box('wooCommerceGalleryMetaBox', '<span class="dashicons dashicons-format-gallery" style="font-size:20px"></span> ' . esc_html__('Image Gallery (URL)', 'featured-image-from-url'), 'fifu_wc_show_elements', $post_type, 'side', 'low');
13
- add_meta_box('videoUrlMetaBox', '<span class="dashicons dashicons-video-alt3" style="font-size:20px"></span> ' . esc_html__('Featured Video (URL)', 'featured-image-from-url'), 'fifu_video_show_elements', $post_type, 'side', 'low');
14
- add_meta_box('wooCommerceVideoGalleryMetaBox', '<span class="dashicons dashicons-format-video" style="font-size:20px"></span> ' . esc_html__('Video Gallery (URL)', 'featured-image-from-url'), 'fifu_video_wc_show_elements', $post_type, 'side', 'low');
15
- add_meta_box('sliderImageUrlMetaBox', '<span class="dashicons dashicons-images-alt2" style="font-size:20px"></span> ' . esc_html__('Featured Slider (URL)', 'featured-image-from-url'), 'fifu_slider_show_elements', $post_type, 'side', 'low');
16
- add_meta_box('shortCodeMetaBox', '<span class="dashicons dashicons-editor-code" style="font-size:20px"></span> ' . esc_html__('Featured Shortcode', 'featured-image-from-url'), 'fifu_shortcode_show_elements', $post_type, 'side', 'low');
17
  } else if ($post_type) {
18
- add_meta_box('imageUrlMetaBox', '<span class="dashicons dashicons-camera" style="font-size:20px;padding-right:10px"></span> ' . esc_html__('Featured Image (URL)', 'featured-image-from-url'), 'fifu_show_elements', $post_type, 'side', 'low');
19
- add_meta_box('videoUrlMetaBox', '<span class="dashicons dashicons-video-alt3" style="font-size:20px;padding-right:10px"></span> ' . esc_html__('Featured Video (URL)', 'featured-image-from-url'), $post_type, 'side', 'low');
20
- add_meta_box('sliderImageUrlMetaBox', '<span class="dashicons dashicons-images-alt2" style="font-size:20px;padding-right:10px"></span> ' . esc_html__('Featured Slider (URL)', 'featured-image-from-url'), 'fifu_slider_show_elements', $post_type, 'side', 'low');
21
- add_meta_box('shortCodeMetaBox', '<span class="dashicons dashicons-editor-code" style="font-size:20px;padding-right:10px"></span> ' . esc_html__('Featured Shortcode', 'featured-image-from-url'), 'fifu_shortcode_show_elements', $post_type, 'side', 'low');
22
  }
23
  }
24
  fifu_register_meta_box_script();
8
 
9
  foreach ($post_types as $post_type) {
10
  if ($post_type == 'product') {
11
+ add_meta_box('urlMetaBox', esc_html__('Product image', 'featured-image-from-url'), 'fifu_show_elements', $post_type, 'side', 'low');
 
 
 
 
 
12
  } else if ($post_type) {
13
+ add_meta_box('imageUrlMetaBox', esc_html__('Featured image', 'featured-image-from-url'), 'fifu_show_elements', $post_type, 'side', 'low');
 
 
 
14
  }
15
  }
16
  fifu_register_meta_box_script();
featured-image-from-url.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Featured Image from URL
5
  * Plugin URI: https://fifu.app/
6
  * Description: Use an external image as Featured Image of a post or WooCommerce product. Includes Image Search, Video, Social Tags, SEO, Lazy Load, Gallery, Automation etc.
7
- * Version: 3.2.1
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
  * WC requires at least: 3.0
4
  * Plugin Name: Featured Image from URL
5
  * Plugin URI: https://fifu.app/
6
  * Description: Use an external image as Featured Image of a post or WooCommerce product. Includes Image Search, Video, Social Tags, SEO, Lazy Load, Gallery, Automation etc.
7
+ * Version: 3.2.2
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
  * WC requires at least: 3.0
includes/attachment.php CHANGED
@@ -155,7 +155,7 @@ function fifu_callback($buffer) {
155
  else
156
  continue;
157
 
158
- if ($data['done'] && strpos($imgItem, 'fifu-replaced') !== false)
159
  continue;
160
 
161
  $post_id = $data['post_id'];
@@ -167,8 +167,6 @@ function fifu_callback($buffer) {
167
 
168
  $buffer = str_replace($imgItem, fifu_replace($newImgItem, $post_id, null, null), $buffer);
169
  }
170
-
171
- $_POST[$url]['done'] = 1;
172
  }
173
 
174
  /* background-image */
@@ -189,7 +187,7 @@ function fifu_callback($buffer) {
189
  if (isset($_POST[$url])) {
190
  $data = $_POST[$url];
191
 
192
- if ($data['done'])
193
  continue;
194
  }
195
 
@@ -197,21 +195,22 @@ function fifu_callback($buffer) {
197
  // lazy load for background-image
198
  $class = 'lazyload ';
199
 
 
200
  $newImgItem = str_replace('class=' . $mainDelimiter, 'class=' . $mainDelimiter . $class, $imgItem);
 
 
 
 
201
  $attr = 'data-bg=' . $mainDelimiter . $url . $mainDelimiter;
202
  $newImgItem = str_replace('>', ' ' . $attr . '>', $newImgItem);
203
 
204
  // remove background-image
205
  $pattern = '/background-image.*url\(' . $subDelimiter . '.*' . $subDelimiter . '\)/';
206
  $newImgItem = preg_replace($pattern, '', $newImgItem);
207
-
208
- $buffer = str_replace($imgItem, $newImgItem, $buffer);
209
  }
210
 
211
  if ($newImgItem != $imgItem)
212
  $buffer = str_replace($imgItem, $newImgItem, $buffer);
213
-
214
- $_POST[$url]['done'] = 1;
215
  }
216
 
217
  return $buffer;
@@ -267,7 +266,6 @@ function fifu_add_url_parameters($url, $att_id) {
267
  $parameters['att_id'] = $att_id;
268
  $parameters['post_id'] = $post_id;
269
  $parameters['featured'] = $featured;
270
- $parameters['done'] = 0;
271
 
272
  $_POST[$url] = $parameters;
273
  return $url;
155
  else
156
  continue;
157
 
158
+ if (strpos($imgItem, 'fifu-replaced') !== false)
159
  continue;
160
 
161
  $post_id = $data['post_id'];
167
 
168
  $buffer = str_replace($imgItem, fifu_replace($newImgItem, $post_id, null, null), $buffer);
169
  }
 
 
170
  }
171
 
172
  /* background-image */
187
  if (isset($_POST[$url])) {
188
  $data = $_POST[$url];
189
 
190
+ if (strpos($imgItem, 'fifu-replaced') !== false)
191
  continue;
192
  }
193
 
195
  // lazy load for background-image
196
  $class = 'lazyload ';
197
 
198
+ // add class
199
  $newImgItem = str_replace('class=' . $mainDelimiter, 'class=' . $mainDelimiter . $class, $imgItem);
200
+
201
+ // add status
202
+ $newImgItem = str_replace('<img ', '<img fifu-replaced="1" ', $newImgItem);
203
+
204
  $attr = 'data-bg=' . $mainDelimiter . $url . $mainDelimiter;
205
  $newImgItem = str_replace('>', ' ' . $attr . '>', $newImgItem);
206
 
207
  // remove background-image
208
  $pattern = '/background-image.*url\(' . $subDelimiter . '.*' . $subDelimiter . '\)/';
209
  $newImgItem = preg_replace($pattern, '', $newImgItem);
 
 
210
  }
211
 
212
  if ($newImgItem != $imgItem)
213
  $buffer = str_replace($imgItem, $newImgItem, $buffer);
 
 
214
  }
215
 
216
  return $buffer;
266
  $parameters['att_id'] = $att_id;
267
  $parameters['post_id'] = $post_id;
268
  $parameters['featured'] = $featured;
 
269
 
270
  $_POST[$url] = $parameters;
271
  return $url;
includes/html/js/lazySizesConfig.js CHANGED
@@ -7,6 +7,8 @@
7
  window.lazySizesConfig.throttleDelay = 0;
8
  })();
9
 
 
 
10
  function fifu_lazy() {
11
  jQuery('img').each(function (index) {
12
  fifu_add_placeholder(this);
@@ -15,10 +17,6 @@ function fifu_lazy() {
15
  if (!jQuery(this).hasClass('fifu'))
16
  fifu_add_lazyload(this);
17
  });
18
-
19
- jQuery('a[data-bg], div[data-bg]').each(function (index) {
20
- fifu_add_lazyload(this);
21
- });
22
  }
23
 
24
  function fifu_add_lazyload($) {
@@ -30,7 +28,7 @@ function fifu_add_placeholder($) {
30
  src = jQuery($).attr('src');
31
  datasrc = jQuery($).attr('data-src');
32
  if (!src && datasrc)
33
- jQuery($).attr('src', 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
34
  }
35
 
36
  document.addEventListener('lazybeforeunveil', function (e) {
@@ -46,6 +44,9 @@ document.addEventListener('lazybeforeunveil', function (e) {
46
  jQuery(e.target).attr('fifu-height', e.srcElement.clientHeight);
47
  });
48
 
 
 
 
49
  function fifu_get_delimiter($, attr) {
50
  return $[0].outerHTML.split(attr + '=')[1][0];
51
  }
7
  window.lazySizesConfig.throttleDelay = 0;
8
  })();
9
 
10
+ const FIFU_PLACEHOLDER = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
11
+
12
  function fifu_lazy() {
13
  jQuery('img').each(function (index) {
14
  fifu_add_placeholder(this);
17
  if (!jQuery(this).hasClass('fifu'))
18
  fifu_add_lazyload(this);
19
  });
 
 
 
 
20
  }
21
 
22
  function fifu_add_lazyload($) {
28
  src = jQuery($).attr('src');
29
  datasrc = jQuery($).attr('data-src');
30
  if (!src && datasrc)
31
+ jQuery($).attr('src', FIFU_PLACEHOLDER);
32
  }
33
 
34
  document.addEventListener('lazybeforeunveil', function (e) {
44
  jQuery(e.target).attr('fifu-height', e.srcElement.clientHeight);
45
  });
46
 
47
+ document.addEventListener('lazyunveilread', function (e) {
48
+ });
49
+
50
  function fifu_get_delimiter($, attr) {
51
  return $[0].outerHTML.split(attr + '=')[1][0];
52
  }
includes/thumbnail.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  add_filter('wp_head', 'fifu_add_jquery');
4
  add_filter('wp_head', 'fifu_add_js');
5
 
@@ -25,8 +27,8 @@ function fifu_add_js() {
25
  wp_enqueue_style('lazyload-spinner', plugins_url('/html/css/lazyload.css', __FILE__), array(), fifu_version_number());
26
  wp_enqueue_script('lazysizes-config', plugins_url('/html/js/lazySizesConfig.js', __FILE__), array(), fifu_version_number());
27
  wp_enqueue_script('unveilhooks', 'https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/plugins/unveilhooks/ls.unveilhooks.min.js');
 
28
  wp_enqueue_script('lazysizes', 'https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/lazysizes.min.js');
29
- // wp_enqueue_script('bgset', 'https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/plugins/bgset/ls.bgset.min.js');
30
  }
31
 
32
  if (class_exists('WooCommerce')) {
@@ -101,9 +103,8 @@ function fifu_replace($html, $post_id, $post_thumbnail_id, $size) {
101
  $src = $datasrc ? $datasrc : fifu_get_attribute('src', $html);
102
  if (isset($_POST[$src])) {
103
  $data = $_POST[$src];
104
- if ($data['done'] && strpos($html, 'fifu-replaced') !== false)
105
  return $html;
106
- $_POST[$src]['done'] = 1;
107
  }
108
 
109
  $url = get_post_meta($post_id, 'fifu_image_url', true);
@@ -117,11 +118,19 @@ function fifu_replace($html, $post_id, $post_thumbnail_id, $size) {
117
  $html = preg_replace('/alt=[\'\"][^[\'\"]*[\'\"]/', 'alt=' . $delimiter . $alt . $delimiter . ' title=' . $delimiter . $alt . $delimiter, $html);
118
  }
119
 
120
- $width = fifu_get_attribute('width', $html);
121
- $height = fifu_get_attribute('height', $html);
122
-
123
- if (fifu_is_on('fifu_lazy') && !is_admin())
124
- $html = str_replace(" src", " data-src", $html);
 
 
 
 
 
 
 
 
125
 
126
  $css = get_option('fifu_css');
127
 
@@ -138,6 +147,9 @@ function fifu_replace($html, $post_id, $post_thumbnail_id, $size) {
138
  return $css ? str_replace('/>', ' style="' . $css . '"/>', $html) : $html;
139
  }
140
 
 
 
 
141
  return !$url ? $html : fifu_get_html($url, $alt, $width, $height);
142
  }
143
 
1
  <?php
2
 
3
+ define('FIFU_PLACEHOLDER', 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
4
+
5
  add_filter('wp_head', 'fifu_add_jquery');
6
  add_filter('wp_head', 'fifu_add_js');
7
 
27
  wp_enqueue_style('lazyload-spinner', plugins_url('/html/css/lazyload.css', __FILE__), array(), fifu_version_number());
28
  wp_enqueue_script('lazysizes-config', plugins_url('/html/js/lazySizesConfig.js', __FILE__), array(), fifu_version_number());
29
  wp_enqueue_script('unveilhooks', 'https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/plugins/unveilhooks/ls.unveilhooks.min.js');
30
+ wp_enqueue_script('bgset', 'https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/plugins/bgset/ls.bgset.min.js');
31
  wp_enqueue_script('lazysizes', 'https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/lazysizes.min.js');
 
32
  }
33
 
34
  if (class_exists('WooCommerce')) {
103
  $src = $datasrc ? $datasrc : fifu_get_attribute('src', $html);
104
  if (isset($_POST[$src])) {
105
  $data = $_POST[$src];
106
+ if (strpos($html, 'fifu-replaced') !== false)
107
  return $html;
 
108
  }
109
 
110
  $url = get_post_meta($post_id, 'fifu_image_url', true);
118
  $html = preg_replace('/alt=[\'\"][^[\'\"]*[\'\"]/', 'alt=' . $delimiter . $alt . $delimiter . ' title=' . $delimiter . $alt . $delimiter, $html);
119
  }
120
 
121
+ if (fifu_is_on('fifu_lazy') && !is_admin()) {
122
+ if (fifu_is_avada_active()) {
123
+ if (strpos($html, ' src=') !== false && strpos($html, ' data-srcset=') === false)
124
+ $html = str_replace(" src=", " data-srcset=", $html);
125
+ if (strpos($html, ' srcset=') !== false && strpos($html, ' data-srcset=') !== false)
126
+ $html = preg_replace("/ srcset=[\'\"][^\'\"]+[\'\"]/", ' ', $html);
127
+ } else {
128
+ if (strpos($html, ' src=') !== false && strpos($html, ' data-src=') === false)
129
+ $html = str_replace(" src=", " data-src=", $html);
130
+ if (strpos($html, ' src=') !== false && strpos($html, ' data-src=') !== false)
131
+ $html = preg_replace("/ src=[\'\"][^\'\"]+[\'\"]/", ' ', $html);
132
+ }
133
+ }
134
 
135
  $css = get_option('fifu_css');
136
 
147
  return $css ? str_replace('/>', ' style="' . $css . '"/>', $html) : $html;
148
  }
149
 
150
+ $width = fifu_get_attribute('width', $html);
151
+ $height = fifu_get_attribute('height', $html);
152
+
153
  return !$url ? $html : fifu_get_html($url, $alt, $width, $height);
154
  }
155
 
includes/util.php CHANGED
@@ -125,3 +125,9 @@ function fifu_is_elementor_editor() {
125
  return \Elementor\Plugin::$instance->editor->is_edit_mode() || \Elementor\Plugin::$instance->preview->is_preview_mode();
126
  }
127
 
 
 
 
 
 
 
125
  return \Elementor\Plugin::$instance->editor->is_edit_mode() || \Elementor\Plugin::$instance->preview->is_preview_mode();
126
  }
127
 
128
+ // active themes
129
+
130
+ function fifu_is_avada_active() {
131
+ return 'avada' == strtolower(get_option('template'));
132
+ }
133
+
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: marceljm
3
  Donate link: https://donorbox.org/fifu
4
  Tags: featured image, featured, image, url, link, woocommerce, product, gallery, video, slider, external, thumbnail
5
  Requires at least: 5.0
6
- Tested up to: 5.4
7
- Stable tag: 3.2.1
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -193,20 +193,20 @@ Supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr and Publiti
193
 
194
  == Changelog ==
195
 
 
 
 
196
  = 3.2.1 =
197
  * New: performance tips; bug fix: images from some addresses were not being shown.
198
 
199
  = 3.2.0 =
200
  * Bug fix: images from some addresses were not being shown; bug fix: URL from Post Content (hide option not working for IFTTT posts).
201
 
202
- = 3.1.9 =
203
- * Improvement: Lazy Load (performance and compatibility); deprecated: URL Parameters; bug fix: Default Featured Image not working for IFTTT posts.
204
-
205
  = others =
206
  * [more](https://fifu.app/changelog/)
207
 
208
 
209
  == Upgrade Notice ==
210
 
211
- = 3.2.1 =
212
- * New: performance tips; bug fix: images from some addresses were not being shown.
3
  Donate link: https://donorbox.org/fifu
4
  Tags: featured image, featured, image, url, link, woocommerce, product, gallery, video, slider, external, thumbnail
5
  Requires at least: 5.0
6
+ Tested up to: 5.5
7
+ Stable tag: 3.2.2
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
193
 
194
  == Changelog ==
195
 
196
+ = 3.2.2 =
197
+ * Adjustment: layout changes for WordPress 5.5; improvement: Flickr Thumbnails (less controls and more precision); bug fix: conflict between Lazy Load and Avada theme.
198
+
199
  = 3.2.1 =
200
  * New: performance tips; bug fix: images from some addresses were not being shown.
201
 
202
  = 3.2.0 =
203
  * Bug fix: images from some addresses were not being shown; bug fix: URL from Post Content (hide option not working for IFTTT posts).
204
 
 
 
 
205
  = others =
206
  * [more](https://fifu.app/changelog/)
207
 
208
 
209
  == Upgrade Notice ==
210
 
211
+ = 3.2.2 =
212
+ * Adjustment: layout changes for WordPress 5.5; improvement: Flickr Thumbnails (less controls and more precision); bug fix: conflict between Lazy Load and Avada theme.