Featured Image From URL - Version 3.3.0

Version Description

  • Improvement: responsive external images with Jetpack; bug fix: cropped Jetpack images; deprecated: Add Class and jQuery options.
Download this release

Release Info

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

Code changes from version 3.2.9 to 3.3.0

admin/html/menu.html CHANGED
@@ -120,38 +120,6 @@
120
  </table>
121
  </form>
122
  </div>
123
- <div class="box">
124
- <h2><?php $fifu['title']['jquery']() ?></h2>
125
- <div class="greybox">
126
- <?php $fifu['jquery']['desc']() ?>
127
- </div>
128
- <br>
129
- <form
130
- id="fifu_form_jquery"
131
- action="javascript:void(0)"
132
- method="post">
133
- <table>
134
- <tr>
135
- <td>
136
- <input
137
- type="submit"
138
- href="javascript:void(0)"
139
- id="fifu_toggle_jquery"
140
- onclick="invert('jquery')"
141
- name="fifu_toggle_jquery"
142
- class="<?php echo $enable_jquery; ?>"
143
- value=""
144
- style="display:block;border:none">
145
- <input
146
- type="hidden"
147
- id="fifu_input_jquery"
148
- name="fifu_input_jquery"
149
- value="" ></td>
150
- <td><?php $fifu['jquery']['cdn']() ?></td>
151
- </tr>
152
- </table>
153
- </form>
154
- </div>
155
  </div>
156
  <div id="tabs-b">
157
  <div class="box">
@@ -783,33 +751,6 @@
783
  value="" style="display:block;border:none">
784
  </div>
785
 
786
- <div class="box">
787
- <h2><?php $fifu['title']['class']() ?></h2>
788
- <div class="greybox">
789
- <?php $fifu['class']['desc']() ?><br>
790
- </div>
791
- <br>
792
- <form
793
- id="fifu_form_class"
794
- action="javascript:void(0)"
795
- method="post">
796
- <input
797
- type="submit"
798
- href="javascript:void(0)"
799
- id="fifu_toggle_class"
800
- onclick="invert('class')"
801
- name="fifu_toggle_class"
802
- class="<?php echo $enable_class; ?>"
803
- value="" style="display:block;border:none">
804
-
805
- <input
806
- type="hidden"
807
- id="fifu_input_class"
808
- name="fifu_input_class"
809
- value="" >
810
- </form>
811
- </div>
812
-
813
  </div>
814
  <div id="tabs-j">
815
  <div class="box">
@@ -2629,6 +2570,47 @@
2629
  </div>
2630
  </div>
2631
  <div id="tabs-t">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2632
  <div class="box">
2633
  <table>
2634
  <tr>
@@ -2934,21 +2916,6 @@
2934
  2) for each video access "Edit Post Meta > Choose Specific Skin", select "YoutubeStream" or "VimeoStream" and click on "Save Post Meta".<br>
2935
  </div>
2936
  </div>
2937
- <div class="box">
2938
- <table>
2939
- <tr>
2940
- <td style="border-bottom:none">2020-02-26</td>
2941
- <td style="border-bottom:none"><h3> Bimber</h3></td>
2942
- <td style="border-bottom:none">theme</td>
2943
- </tr>
2944
- </table>
2945
- <div class="greybox" style="position: relative; top: -10px">
2946
- External images are not being shown:<br>
2947
- 1) access "Appearance > Bimber > Customize > Additional CSS";<br>
2948
- 2) add ".g1-frame-inner{height:auto}";<br>
2949
- 3) publish.<br>
2950
- </div>
2951
- </div>
2952
  <div class="box">
2953
  <table>
2954
  <tr>
@@ -3025,10 +2992,6 @@
3025
  <td style="border-bottom:none">plugin</td>
3026
  </tr>
3027
  </table>
3028
- <div class="greybox" style="position: relative; top: -10px">
3029
- Featured images missing after enabling Lazy Load:<br>
3030
- 1) disable "FIFU settings > Performance > Lazy Load" or "Jetpack settings > Performance > Enable Lazy Loading for images". You can't have both.<br>
3031
- </div>
3032
  <div class="greybox" style="position: relative; top: -10px">
3033
  Showing external images on "Related Posts":<br>
3034
  x) There is no local solution. Jetpack Related Posts documentation informs: "we do all the analysis, processing, and serving from our cloud". It means Jetpack would need to adapt its web service to work with the images provided by FIFU. So you may contact Jetpack support or install an alternative plugin for Related Posts, like <a href="https://wordpress.org/plugins/related-posts-thumbnails/">this</a>.<br>
@@ -3053,19 +3016,6 @@
3053
  2) add this code before "Happy publishing" line: set_time_limit(1800);<br>
3054
  </div>
3055
  </div>
3056
- <div class="box">
3057
- <table>
3058
- <tr>
3059
- <td style="border-bottom:none">2019-12-01</td>
3060
- <td style="border-bottom:none"><h3>jQuery</h3></td>
3061
- <td style="border-bottom:none">JavaScript library</td>
3062
- </tr>
3063
- </table>
3064
- <div class="greybox" style="position: relative; top: -10px">
3065
- Solving "Uncaught ReferenceError: jQuery is not defined"<br>
3066
- 1) enable "FIFU settings > Admin > jQuery".<br>
3067
- </div>
3068
- </div>
3069
  <div class="box">
3070
  <table>
3071
  <tr>
@@ -3142,34 +3092,6 @@
3142
  1) just enable "Featured Image" toggle on WP Telegram.<br>
3143
  </div>
3144
  </div>
3145
- <div class="box">
3146
- <table>
3147
- <tr>
3148
- <td style="border-bottom:none;">2019-09-14</td>
3149
- <td style="border-bottom:none"><h3>Divi</h3></td>
3150
- <td style="border-bottom:none">theme</td>
3151
- </tr>
3152
- </table>
3153
- <div class="greybox" style="position: relative; top: -10px">
3154
- Preventing a small image from scaling to 100%:<br>
3155
- 1) inspect the image and get the CSS selector;<br>
3156
- 2) access "Customize > Additional CSS";<br>
3157
- 3) set "width:unset" for your selector.<br>
3158
- </div>
3159
- <div class="greybox" style="position: relative; top: -10px">
3160
- Centering a small image:<br>
3161
- 1) inspect the image and get the CSS selector;<br>
3162
- 2) access "Customize > Additional CSS";<br>
3163
- 3) set "display:inherit" for your selector;<br>
3164
- 4) set "text-align:center" for its parent.<br>
3165
- </div>
3166
- <div class="greybox" style="position: relative; top: -10px">
3167
- Defining a height for an image:<br>
3168
- 1) inspect the image and get the CSS selector;<br>
3169
- 2) access "Customize > Additional CSS";<br>
3170
- 3) set "height:300px" (or a different number) for your selector.<br>
3171
- </div>
3172
- </div>
3173
  <div class="box">
3174
  <table>
3175
  <tr>
120
  </table>
121
  </form>
122
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  </div>
124
  <div id="tabs-b">
125
  <div class="box">
751
  value="" style="display:block;border:none">
752
  </div>
753
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
754
  </div>
755
  <div id="tabs-j">
756
  <div class="box">
2570
  </div>
2571
  </div>
2572
  <div id="tabs-t">
2573
+ <div class="box">
2574
+ <table>
2575
+ <tr>
2576
+ <td style="border-bottom:none">2020-08-27</td>
2577
+ <td style="border-bottom:none"><h3> WP Super Cache</h3></td>
2578
+ <td style="border-bottom:none">plugin</td>
2579
+ </tr>
2580
+ </table>
2581
+ <div class="greybox" style="position: relative; top: -10px">
2582
+ Images not visible after cleaning and generating FIFU metadata:<br>
2583
+ 1) click on "Delete Cache".<br>
2584
+ </div>
2585
+ </div>
2586
+ <div class="box">
2587
+ <table>
2588
+ <tr>
2589
+ <td style="border-bottom:none">2020-08-26</td>
2590
+ <td style="border-bottom:none"><h3> WordPress</h3></td>
2591
+ <td style="border-bottom:none"></td>
2592
+ </tr>
2593
+ </table>
2594
+ <div class="greybox" style="position: relative; top: -10px">
2595
+ The image URL is not in the feed:<br>
2596
+ 1) enable "FIFU Settings > Social > Media RSS Tags";<br>
2597
+ 2) for single posts (only) it's necessary to add "?withoutcomments=1" in the end of the feed URL.<br>
2598
+ </div>
2599
+ </div>
2600
+ <div class="box">
2601
+ <table>
2602
+ <tr>
2603
+ <td style="border-bottom:none">2020-08-25</td>
2604
+ <td style="border-bottom:none"><h3> Flatsome</h3></td>
2605
+ <td style="border-bottom:none">theme</td>
2606
+ </tr>
2607
+ </table>
2608
+ <div class="greybox" style="position: relative; top: -10px">
2609
+ WooCommerce lightbox doesn't work. Two possible solutions:<br>
2610
+ a) run "FIFU Settings > Metadata > Save Image Dimensions";<br>
2611
+ b) select "Flatsome > Customize > WooCommerce > Product Page > Gallery > Product Image Lightbox > Flatsome Lightbox".<br>
2612
+ </div>
2613
+ </div>
2614
  <div class="box">
2615
  <table>
2616
  <tr>
2916
  2) for each video access "Edit Post Meta > Choose Specific Skin", select "YoutubeStream" or "VimeoStream" and click on "Save Post Meta".<br>
2917
  </div>
2918
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2919
  <div class="box">
2920
  <table>
2921
  <tr>
2992
  <td style="border-bottom:none">plugin</td>
2993
  </tr>
2994
  </table>
 
 
 
 
2995
  <div class="greybox" style="position: relative; top: -10px">
2996
  Showing external images on "Related Posts":<br>
2997
  x) There is no local solution. Jetpack Related Posts documentation informs: "we do all the analysis, processing, and serving from our cloud". It means Jetpack would need to adapt its web service to work with the images provided by FIFU. So you may contact Jetpack support or install an alternative plugin for Related Posts, like <a href="https://wordpress.org/plugins/related-posts-thumbnails/">this</a>.<br>
3016
  2) add this code before "Happy publishing" line: set_time_limit(1800);<br>
3017
  </div>
3018
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
3019
  <div class="box">
3020
  <table>
3021
  <tr>
3092
  1) just enable "Featured Image" toggle on WP Telegram.<br>
3093
  </div>
3094
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3095
  <div class="box">
3096
  <table>
3097
  <tr>
admin/html/support-data.html CHANGED
@@ -22,7 +22,6 @@ php-curl:<?php echo fifu_has_curl() ? 'yes' : 'no' ?>;
22
  Plugins:<?php echo fifu_get_plugins_list() ?>;
23
  Active plugins:<?php echo fifu_get_active_plugins_list() ?>;
24
  fifu_auto_alt:<?php echo $enable_auto_alt ?>;
25
- fifu_class:<?php echo $enable_class ?>;
26
  fifu_column_height:<?php echo $column_height ?>;
27
  fifu_confirm_delete_all:<?php echo $enable_confirm_delete_all ?>;
28
  fifu_confirm_delete_all_time:<?php echo $enable_confirm_delete_all_time ?>;
@@ -38,7 +37,6 @@ fifu_grid_category:<?php echo $enable_grid_category ?>;
38
  fifu_hide_cpt:<?php echo $enable_hide_cpt ?>;
39
  fifu_hide_page:<?php echo $enable_hide_page ?>;
40
  fifu_hide_post:<?php echo $enable_hide_post ?>;
41
- fifu_jquery:<?php echo $enable_jquery ?>;
42
  fifu_lazy:<?php echo $enable_lazy ?>;
43
  fifu_media_library:<?php echo $enable_media_library ?>;
44
  fifu_ovw_first:<?php echo $enable_ovw_first ?>;
22
  Plugins:<?php echo fifu_get_plugins_list() ?>;
23
  Active plugins:<?php echo fifu_get_active_plugins_list() ?>;
24
  fifu_auto_alt:<?php echo $enable_auto_alt ?>;
 
25
  fifu_column_height:<?php echo $column_height ?>;
26
  fifu_confirm_delete_all:<?php echo $enable_confirm_delete_all ?>;
27
  fifu_confirm_delete_all_time:<?php echo $enable_confirm_delete_all_time ?>;
37
  fifu_hide_cpt:<?php echo $enable_hide_cpt ?>;
38
  fifu_hide_page:<?php echo $enable_hide_page ?>;
39
  fifu_hide_post:<?php echo $enable_hide_post ?>;
 
40
  fifu_lazy:<?php echo $enable_lazy ?>;
41
  fifu_media_library:<?php echo $enable_media_library ?>;
42
  fifu_ovw_first:<?php echo $enable_ovw_first ?>;
admin/menu.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- define('FIFU_SETTINGS', serialize(array('fifu_social', 'fifu_social_image_only', 'fifu_lazy', 'fifu_jquery', 'fifu_media_library', 'fifu_content', 'fifu_content_page', 'fifu_enable_default_url', 'fifu_spinner_db', 'fifu_spinner_nth', 'fifu_fake', 'fifu_default_url', 'fifu_wc_lbox', 'fifu_wc_zoom', 'fifu_hide_page', 'fifu_hide_post', 'fifu_hide_cpt', 'fifu_class', 'fifu_get_first', 'fifu_pop_first', 'fifu_ovw_first', 'fifu_query_strings', 'fifu_confirm_delete_all', 'fifu_run_delete_all', 'fifu_column_height', 'fifu_grid_category', 'fifu_auto_alt', 'fifu_dynamic_alt', 'fifu_data_clean')));
4
 
5
  define('FIFU_SLUG', 'featured-image-from-url');
6
 
@@ -39,7 +39,6 @@ function fifu_support_data() {
39
  $enable_social = get_option('fifu_social');
40
  $enable_social_image_only = get_option('fifu_social_image_only');
41
  $enable_lazy = get_option('fifu_lazy');
42
- $enable_jquery = get_option('fifu_jquery');
43
  $enable_media_library = get_option('fifu_media_library');
44
  $enable_content = get_option('fifu_content');
45
  $enable_content_page = get_option('fifu_content_page');
@@ -53,7 +52,6 @@ function fifu_support_data() {
53
  $enable_hide_page = get_option('fifu_hide_page');
54
  $enable_hide_post = get_option('fifu_hide_post');
55
  $enable_hide_cpt = get_option('fifu_hide_cpt');
56
- $enable_class = get_option('fifu_class');
57
  $enable_get_first = get_option('fifu_get_first');
58
  $enable_pop_first = get_option('fifu_pop_first');
59
  $enable_ovw_first = get_option('fifu_ovw_first');
@@ -91,7 +89,6 @@ function fifu_get_menu_html() {
91
  $enable_social = get_option('fifu_social');
92
  $enable_social_image_only = get_option('fifu_social_image_only');
93
  $enable_lazy = get_option('fifu_lazy');
94
- $enable_jquery = get_option('fifu_jquery');
95
  $enable_media_library = get_option('fifu_media_library');
96
  $enable_content = get_option('fifu_content');
97
  $enable_content_page = get_option('fifu_content_page');
@@ -105,7 +102,6 @@ function fifu_get_menu_html() {
105
  $enable_hide_page = get_option('fifu_hide_page');
106
  $enable_hide_post = get_option('fifu_hide_post');
107
  $enable_hide_cpt = get_option('fifu_hide_cpt');
108
- $enable_class = get_option('fifu_class');
109
  $enable_get_first = get_option('fifu_get_first');
110
  $enable_pop_first = get_option('fifu_pop_first');
111
  $enable_ovw_first = get_option('fifu_ovw_first');
@@ -176,7 +172,6 @@ function fifu_update_menu_options() {
176
  fifu_update_option('fifu_input_social', 'fifu_social');
177
  fifu_update_option('fifu_input_social_image_only', 'fifu_social_image_only');
178
  fifu_update_option('fifu_input_lazy', 'fifu_lazy');
179
- fifu_update_option('fifu_input_jquery', 'fifu_jquery');
180
  fifu_update_option('fifu_input_media_library', 'fifu_media_library');
181
  fifu_update_option('fifu_input_content', 'fifu_content');
182
  fifu_update_option('fifu_input_content_page', 'fifu_content_page');
@@ -190,7 +185,6 @@ function fifu_update_menu_options() {
190
  fifu_update_option('fifu_input_hide_page', 'fifu_hide_page');
191
  fifu_update_option('fifu_input_hide_post', 'fifu_hide_post');
192
  fifu_update_option('fifu_input_hide_cpt', 'fifu_hide_cpt');
193
- fifu_update_option('fifu_input_class', 'fifu_class');
194
  fifu_update_option('fifu_input_get_first', 'fifu_get_first');
195
  fifu_update_option('fifu_input_pop_first', 'fifu_pop_first');
196
  fifu_update_option('fifu_input_ovw_first', 'fifu_ovw_first');
1
  <?php
2
 
3
+ define('FIFU_SETTINGS', serialize(array('fifu_social', 'fifu_social_image_only', 'fifu_lazy', 'fifu_media_library', 'fifu_content', 'fifu_content_page', 'fifu_enable_default_url', 'fifu_spinner_db', 'fifu_spinner_nth', 'fifu_fake', 'fifu_default_url', 'fifu_wc_lbox', 'fifu_wc_zoom', 'fifu_hide_page', 'fifu_hide_post', 'fifu_hide_cpt', 'fifu_get_first', 'fifu_pop_first', 'fifu_ovw_first', 'fifu_query_strings', 'fifu_confirm_delete_all', 'fifu_run_delete_all', 'fifu_column_height', 'fifu_grid_category', 'fifu_auto_alt', 'fifu_dynamic_alt', 'fifu_data_clean')));
4
 
5
  define('FIFU_SLUG', 'featured-image-from-url');
6
 
39
  $enable_social = get_option('fifu_social');
40
  $enable_social_image_only = get_option('fifu_social_image_only');
41
  $enable_lazy = get_option('fifu_lazy');
 
42
  $enable_media_library = get_option('fifu_media_library');
43
  $enable_content = get_option('fifu_content');
44
  $enable_content_page = get_option('fifu_content_page');
52
  $enable_hide_page = get_option('fifu_hide_page');
53
  $enable_hide_post = get_option('fifu_hide_post');
54
  $enable_hide_cpt = get_option('fifu_hide_cpt');
 
55
  $enable_get_first = get_option('fifu_get_first');
56
  $enable_pop_first = get_option('fifu_pop_first');
57
  $enable_ovw_first = get_option('fifu_ovw_first');
89
  $enable_social = get_option('fifu_social');
90
  $enable_social_image_only = get_option('fifu_social_image_only');
91
  $enable_lazy = get_option('fifu_lazy');
 
92
  $enable_media_library = get_option('fifu_media_library');
93
  $enable_content = get_option('fifu_content');
94
  $enable_content_page = get_option('fifu_content_page');
102
  $enable_hide_page = get_option('fifu_hide_page');
103
  $enable_hide_post = get_option('fifu_hide_post');
104
  $enable_hide_cpt = get_option('fifu_hide_cpt');
 
105
  $enable_get_first = get_option('fifu_get_first');
106
  $enable_pop_first = get_option('fifu_pop_first');
107
  $enable_ovw_first = get_option('fifu_ovw_first');
172
  fifu_update_option('fifu_input_social', 'fifu_social');
173
  fifu_update_option('fifu_input_social_image_only', 'fifu_social_image_only');
174
  fifu_update_option('fifu_input_lazy', 'fifu_lazy');
 
175
  fifu_update_option('fifu_input_media_library', 'fifu_media_library');
176
  fifu_update_option('fifu_input_content', 'fifu_content');
177
  fifu_update_option('fifu_input_content_page', 'fifu_content_page');
185
  fifu_update_option('fifu_input_hide_page', 'fifu_hide_page');
186
  fifu_update_option('fifu_input_hide_post', 'fifu_hide_post');
187
  fifu_update_option('fifu_input_hide_cpt', 'fifu_hide_cpt');
 
188
  fifu_update_option('fifu_input_get_first', 'fifu_get_first');
189
  fifu_update_option('fifu_input_pop_first', 'fifu_pop_first');
190
  fifu_update_option('fifu_input_ovw_first', 'fifu_ovw_first');
admin/strings.php CHANGED
@@ -178,9 +178,6 @@ function fifu_get_strings_settings() {
178
  $fifu['title']['library'] = function() {
179
  _e("Media Library", FIFU_SLUG);
180
  };
181
- $fifu['title']['jquery'] = function() {
182
- _e("jQuery", FIFU_SLUG);
183
- };
184
  $fifu['title']['reset'] = function() {
185
  _e("Reset Settings", FIFU_SLUG);
186
  };
@@ -211,9 +208,6 @@ function fifu_get_strings_settings() {
211
  $fifu['title']['validation'] = function() {
212
  _e("Image Validation", FIFU_SLUG);
213
  };
214
- $fifu['title']['class'] = function() {
215
- _e("Add Class", FIFU_SLUG);
216
- };
217
  $fifu['title']['configuration'] = function() {
218
  _e("Configuration", FIFU_SLUG);
219
  };
@@ -364,7 +358,7 @@ function fifu_get_strings_settings() {
364
  _e("1) access Performance tab; 2) enable Lazy Load. Important: if you have another lazy load component running, you should disable that to avoid conflicts.", FIFU_SLUG);
365
  };
366
  $fifu['support']['speed-desc'] = function() {
367
- _e("You may mitigate the problem installing Jetpack plugin. After that: 1) access \"Settings\", \"Performance\"; 2) enable \"Speed up image load times\". A better solution will be available soon.", FIFU_SLUG);
368
  };
369
 
370
  // start
@@ -449,14 +443,6 @@ function fifu_get_strings_settings() {
449
  _e("if some external image is not being shown in the media library, run Metadata > Save Image Dimensions.", FIFU_SLUG);
450
  };
451
 
452
- // jquery
453
- $fifu['jquery']['desc'] = function() {
454
- _e("If for some reason jQuery is missing from your site, which is not commom, you can import that from a CDN.", FIFU_SLUG);
455
- };
456
- $fifu['jquery']['cdn'] = function() {
457
- _e("import jQuery from a CDN", FIFU_SLUG);
458
- };
459
-
460
  // reset
461
  $fifu['reset']['desc'] = function() {
462
  _e("Reset FIFU settings to the default configuration.", FIFU_SLUG);
@@ -603,11 +589,6 @@ function fifu_get_strings_settings() {
603
  _e("It checks images addresses and, when an image is not found, its URL is not saved. However, each validation can take some seconds. It is not integrated with Content URL or REST API features.", FIFU_SLUG);
604
  };
605
 
606
- // class
607
- $fifu['class']['desc'] = function() {
608
- _e("Add the class \"fifu-class\" to the featured image tags.", FIFU_SLUG);
609
- };
610
-
611
  // configuration
612
  $fifu['configuration']['desc'] = function() {
613
  _e("It reads the HTML of your post and use the 1st image (or video) URL found as featured image. It happens when you click on Publish (or Update) button.", FIFU_SLUG);
178
  $fifu['title']['library'] = function() {
179
  _e("Media Library", FIFU_SLUG);
180
  };
 
 
 
181
  $fifu['title']['reset'] = function() {
182
  _e("Reset Settings", FIFU_SLUG);
183
  };
208
  $fifu['title']['validation'] = function() {
209
  _e("Image Validation", FIFU_SLUG);
210
  };
 
 
 
211
  $fifu['title']['configuration'] = function() {
212
  _e("Configuration", FIFU_SLUG);
213
  };
358
  _e("1) access Performance tab; 2) enable Lazy Load. Important: if you have another lazy load component running, you should disable that to avoid conflicts.", FIFU_SLUG);
359
  };
360
  $fifu['support']['speed-desc'] = function() {
361
+ _e("You can solve the problem installing Jetpack plugin. After that access \"Jetpack\", \"Settings\", \"Performance\" and enable \"Speed up image load times\".", FIFU_SLUG);
362
  };
363
 
364
  // start
443
  _e("if some external image is not being shown in the media library, run Metadata > Save Image Dimensions.", FIFU_SLUG);
444
  };
445
 
 
 
 
 
 
 
 
 
446
  // reset
447
  $fifu['reset']['desc'] = function() {
448
  _e("Reset FIFU settings to the default configuration.", FIFU_SLUG);
589
  _e("It checks images addresses and, when an image is not found, its URL is not saved. However, each validation can take some seconds. It is not integrated with Content URL or REST API features.", FIFU_SLUG);
590
  };
591
 
 
 
 
 
 
592
  // configuration
593
  $fifu['configuration']['desc'] = function() {
594
  _e("It reads the HTML of your post and use the 1st image (or video) URL found as featured image. It happens when you click on Publish (or Update) button.", FIFU_SLUG);
featured-image-from-url.php CHANGED
@@ -4,11 +4,11 @@
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.9
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
- * WC requires at least: 3.0
11
- * WC tested up to: 4.4.0
12
  * Text Domain: featured-image-from-url
13
  * License: GPLv3
14
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -52,11 +52,6 @@ function fifu_activate($network_wide) {
52
 
53
  function fifu_activate_actions() {
54
  fifu_db_change_url_length();
55
-
56
- if (fifu_is_on('fifu_fake2')) {
57
- update_option('fifu_fake', 'toggleon');
58
- delete_option('fifu_fake2');
59
- }
60
  }
61
 
62
  register_deactivation_hook(__FILE__, 'fifu_deactivation');
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.3.0
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
+ * WC requires at least: 4.0
11
+ * WC tested up to: 4.4.1
12
  * Text Domain: featured-image-from-url
13
  * License: GPLv3
14
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
52
 
53
  function fifu_activate_actions() {
54
  fifu_db_change_url_length();
 
 
 
 
 
55
  }
56
 
57
  register_deactivation_hook(__FILE__, 'fifu_deactivation');
includes/attachment.php CHANGED
@@ -17,11 +17,6 @@ function fifu_process_url($att_url, $att_id) {
17
  if (!$att_post)
18
  return $att_url;
19
 
20
- // jetpack
21
- preg_match("/^http[s]*:\/\/[i][0-9][.]wp.com\//", $att_url, $matches);
22
- if ($matches)
23
- return fifu_process_external_url($att_url, $att_id);
24
-
25
  // internal
26
  if ($att_post->post_author != FIFU_AUTHOR)
27
  return $att_url;
@@ -85,13 +80,6 @@ function fifu_replace_attachment_image_src($image, $att_id, $size) {
85
  if (!$att_post)
86
  return $image;
87
 
88
- // jetpack
89
- preg_match("/^http[s]*:\/\/[i][0-9][.]wp.com\//", $image[0], $matches);
90
- if ($matches) {
91
- $image[0] = fifu_process_external_url($image[0], $att_id);
92
- return $image;
93
- }
94
-
95
  // internal
96
  if ($att_post->post_author != FIFU_AUTHOR)
97
  return $image;
@@ -155,14 +143,10 @@ function fifu_get_photon_url($image, $size, $att_id) {
155
 
156
  $args = array();
157
 
158
- if ($w > 0)
159
  $args['w'] = $w;
160
-
161
- if ($h > 0) {
162
- $args['resize'] = array($w, $h);
163
- $image[3] = true;
164
- } else
165
- $image[3] = $h > 0;
166
 
167
  $image[0] = jetpack_photon_url($image[0], $args, null);
168
  $image[0] = fifu_process_external_url($image[0], $att_id);
17
  if (!$att_post)
18
  return $att_url;
19
 
 
 
 
 
 
20
  // internal
21
  if ($att_post->post_author != FIFU_AUTHOR)
22
  return $att_url;
80
  if (!$att_post)
81
  return $image;
82
 
 
 
 
 
 
 
 
83
  // internal
84
  if ($att_post->post_author != FIFU_AUTHOR)
85
  return $image;
143
 
144
  $args = array();
145
 
146
+ if ($w > 0) {
147
  $args['w'] = $w;
148
+ $args['resize'] = array($w, null);
149
+ }
 
 
 
 
150
 
151
  $image[0] = jetpack_photon_url($image[0], $args, null);
152
  $image[0] = fifu_process_external_url($image[0], $att_id);
includes/genesis.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
-
3
- add_filter('genesis_get_image', 'fifu_genesis_image', 10, 4);
4
-
5
- function fifu_genesis_image($args, $size, $var2, $src) {
6
- return $src ? fifu_replace($args, get_the_ID(), $var2, $size, null) : $args;
7
- }
8
-
 
 
 
 
 
 
 
 
includes/html/js/image.js CHANGED
@@ -1,7 +1,10 @@
1
  jQuery(document).ready(function ($) {
2
  // lazy load
3
- if (fifuImageVars.fifu_lazy)
4
- fifu_lazy();
 
 
 
5
 
6
  // woocommerce lightbox/zoom
7
  disableClick($);
1
  jQuery(document).ready(function ($) {
2
  // lazy load
3
+ if (fifuImageVars.fifu_lazy) {
4
+ setTimeout(function () {
5
+ fifu_lazy();
6
+ }, 1);
7
+ }
8
 
9
  // woocommerce lightbox/zoom
10
  disableClick($);
includes/html/js/lazySizesConfig.js CHANGED
@@ -17,6 +17,7 @@ function fifu_lazy() {
17
  if (!jQuery(this).hasClass('fifu'))
18
  fifu_add_lazyload(this);
19
  });
 
20
  }
21
 
22
  function fifu_add_lazyload($) {
@@ -31,6 +32,28 @@ function fifu_add_placeholder($) {
31
  jQuery($).attr('src', FIFU_PLACEHOLDER);
32
  }
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  document.addEventListener('lazybeforeunveil', function (e) {
35
  // background-image
36
  var url = jQuery(e.target).attr('data-bg');
17
  if (!jQuery(this).hasClass('fifu'))
18
  fifu_add_lazyload(this);
19
  });
20
+ fifu_add_srcset();
21
  }
22
 
23
  function fifu_add_lazyload($) {
32
  jQuery($).attr('src', FIFU_PLACEHOLDER);
33
  }
34
 
35
+ function fifu_add_srcset() {
36
+ types = ['src', 'data-src'];
37
+ for (i = 0; i < types.length; i++) {
38
+ // jetpack
39
+ jQuery('img[' + types[i] + '*=".wp.com/"]').each(function (index) {
40
+ if (jQuery(this).attr('fifu-featured')) {
41
+ src = jQuery(this).attr(types[i])
42
+ srcset = jQuery(this).attr(types[i] + 'set');
43
+
44
+ if (!srcset) {
45
+ srcset = '';
46
+ sizes = [75, 100, 150, 240, 320, 500, 640, 800, 1024, 1280, 1600];
47
+ for (j = 0; j < sizes.length; j++)
48
+ srcset += ((j != 0) ? ', ' : '') + src.replace(src.split('?')[1], 'w=' + sizes[j] + '&resize=' + sizes[j] + '&ssl=1') + ' ' + sizes[j] + 'w';
49
+ jQuery(this).attr(types[i] + 'set', srcset);
50
+ jQuery(this).attr('data-sizes', 'auto');
51
+ }
52
+ }
53
+ });
54
+ }
55
+ }
56
+
57
  document.addEventListener('lazybeforeunveil', function (e) {
58
  // background-image
59
  var url = jQuery(e.target).attr('data-bg');
includes/thumbnail.php CHANGED
@@ -2,7 +2,6 @@
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
 
8
  if (!function_exists('is_plugin_active'))
@@ -77,11 +76,6 @@ function fifu_add_social_tags() {
77
  include 'html/twitter-image.html';
78
  }
79
 
80
- function fifu_add_jquery() {
81
- if (fifu_is_on('fifu_jquery') && !fifu_is_elementor_editor())
82
- wp_enqueue_script('fifu-jquery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js');
83
- }
84
-
85
  function fifu_apply_css() {
86
  if (fifu_is_off('fifu_wc_lbox'))
87
  echo '<style>[class$="woocommerce-product-gallery__trigger"] {display:none !important;}</style>';
@@ -132,17 +126,8 @@ function fifu_replace($html, $post_id, $post_thumbnail_id, $size, $attr) {
132
  }
133
  }
134
 
135
- if ($url) {
136
- if (fifu_is_on('fifu_class')) {
137
- if (strpos($html, 'class=')) {
138
- $delimiter = substr(explode('class=', $html)[1], 0, 1);
139
- $class = explode($delimiter, explode('class=' . $delimiter, $html)[1])[0];
140
- $html = preg_replace('/class=[\'\"][^[\'\"]*[\'\"]/', 'class=' . $delimiter . $class . ' fifu-class' . $delimiter, $html);
141
- } else
142
- $html = str_replace('<img', '<img class="fifu-class"', $html);
143
- }
144
  return $html;
145
- }
146
 
147
  $width = fifu_get_attribute('width', $html);
148
  $height = fifu_get_attribute('height', $html);
2
 
3
  define('FIFU_PLACEHOLDER', 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');
4
 
 
5
  add_filter('wp_head', 'fifu_add_js');
6
 
7
  if (!function_exists('is_plugin_active'))
76
  include 'html/twitter-image.html';
77
  }
78
 
 
 
 
 
 
79
  function fifu_apply_css() {
80
  if (fifu_is_off('fifu_wc_lbox'))
81
  echo '<style>[class$="woocommerce-product-gallery__trigger"] {display:none !important;}</style>';
126
  }
127
  }
128
 
129
+ if ($url)
 
 
 
 
 
 
 
 
130
  return $html;
 
131
 
132
  $width = fifu_get_attribute('width', $html);
133
  $height = fifu_get_attribute('height', $html);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://donorbox.org/fifu
4
  Tags: featured, image, url, woocommerce, thumbnail
5
  Requires at least: 5.3
6
  Tested up to: 5.5
7
- Stable tag: 3.2.9
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -25,7 +25,6 @@ Use an external image as featured image of your post, page or custom post type.
25
  * Default featured image
26
  * Hide featured media
27
  * Featured image in content
28
- * Add class
29
  * Save image dimensions
30
  * Featured image column
31
  * **[Premium]** Giphy image search
@@ -128,15 +127,15 @@ Supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr and Publiti
128
 
129
  = What's the metadata created by FIFU?
130
 
131
- * Database registers that help WordPress components to work with the external images.
132
 
133
  = What are the disadvantages of the external images?
134
 
135
- * No image optimization or thumbnails. You may fix that with Jetpack (performance settings).
136
 
137
  = What are the advantages of the external images?
138
 
139
- * You save money on storage, processing and copyright.
140
 
141
 
142
  == Screenshots ==
@@ -184,20 +183,20 @@ Supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr and Publiti
184
 
185
  == Changelog ==
186
 
 
 
 
187
  = 3.2.9 =
188
  * Improvement: FIFU automatically removes URL spaces on the right; deprecated: CSS Style; bug fix: images may not be shown due js error (jQuery not defined).
189
 
190
  = 3.2.8 =
191
  * Improvement: the translation process is being integrated with WordPress.org (all the strings should be available to the community soon).
192
 
193
- = 3.2.7 =
194
- * Improvement: Save Image Dimensions is a little faster; bug fix: Image Metadata was slow after the last update; bug fix: conflicts with Jetpack plugin; bug fix: images not visible due unregistered theme sizes.
195
-
196
  = others =
197
  * [more](https://fifu.app/changelog/)
198
 
199
 
200
  == Upgrade Notice ==
201
 
202
- = 3.2.9 =
203
- * Improvement: FIFU automatically removes URL spaces on the right; deprecated: CSS Style; bug fix: images may not be shown due js error (jQuery not defined).
4
  Tags: featured, image, url, woocommerce, thumbnail
5
  Requires at least: 5.3
6
  Tested up to: 5.5
7
+ Stable tag: 3.3.0
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
25
  * Default featured image
26
  * Hide featured media
27
  * Featured image in content
 
28
  * Save image dimensions
29
  * Featured image column
30
  * **[Premium]** Giphy image search
127
 
128
  = What's the metadata created by FIFU?
129
 
130
+ * Database registers that help WordPress components to work with the external images. FIFU can generate the metadata of ~30,000 image URLs per minute.
131
 
132
  = What are the disadvantages of the external images?
133
 
134
+ * No image optimization or thumbnails. You can fix that with Jetpack plugin (performance settings).
135
 
136
  = What are the advantages of the external images?
137
 
138
+ * You save money on storage, processing and copyright. And you can have extremely fast import processes.
139
 
140
 
141
  == Screenshots ==
183
 
184
  == Changelog ==
185
 
186
+ = 3.3.0 =
187
+ * Improvement: responsive external images with Jetpack; bug fix: cropped Jetpack images; deprecated: Add Class and jQuery options.
188
+
189
  = 3.2.9 =
190
  * Improvement: FIFU automatically removes URL spaces on the right; deprecated: CSS Style; bug fix: images may not be shown due js error (jQuery not defined).
191
 
192
  = 3.2.8 =
193
  * Improvement: the translation process is being integrated with WordPress.org (all the strings should be available to the community soon).
194
 
 
 
 
195
  = others =
196
  * [more](https://fifu.app/changelog/)
197
 
198
 
199
  == Upgrade Notice ==
200
 
201
+ = 3.3.0 =
202
+ * Improvement: responsive external images with Jetpack; bug fix: cropped Jetpack images; deprecated: Add Class and jQuery options.