Featured Image From URL - Version 1.5.3

Version Description

  • Auto set featured image.

=

Download this release

Release Info

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

Code changes from version 1.5.2 to 1.5.3

admin/html/menu.html CHANGED
@@ -6,15 +6,103 @@
6
 
7
  <div class="box">
8
  <h1>Featured Image From URL</h1>
9
- <div class="fifubox" style="background:#e3ffe2">Free feature</div>
10
- <div class="fifubox" style="background:#ffe2e2">Premium feature</div>
11
- <div class="fifubox" style="background:#ffffbc">Depends on WooCommerce Version</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  </div>
13
 
14
  <div class="box">
15
  <h2>Custom Post Types</h2>
16
  <div class="greybox" style="background:#e3ffe2">
17
- <b>Free feature</b><br><br>
18
  Featured Image from URL is preconfigured to work with only one Custom Post Type (WooCommerce Product). But you also can use this plugin with other ones. For that, you just need to know the correct Custom Post Type names and fill the fields below. Please, let me know if you need more than 5 inputs here.
19
  </div>
20
  <br>
@@ -35,7 +123,6 @@
35
  <div class="box">
36
  <h2>Social Tags</h2>
37
  <div class="greybox" style="background:#e3ffe2">
38
- <b>Free feature</b><br><br>
39
  Featured Image from URL provides social tags to share the external images on the social networks. Here you can enable/disable this feature.
40
  </div>
41
  <br>
@@ -51,7 +138,7 @@
51
  name="fifu_toggle_social"
52
  class="<?php echo $enable_social; ?>"
53
  value=" "
54
- style="<?php echo $show_social_button; ?>">
55
  <input
56
  type="hidden"
57
  id="fifu_input_social"
@@ -63,7 +150,6 @@
63
  <div class="box">
64
  <h2>Featured Image in Content</h2>
65
  <div class="greybox" style="background:#e3ffe2">
66
- <b>Free feature</b><br><br>
67
  It will sound crazy, but some themes don't show the Featured Image on the posts or pages. If it is your case and you would like to show the Featured Image there, just enable the toggle. The Featured Image will appear at the beginning of the content, before the text.
68
  </div>
69
  <br>
@@ -79,7 +165,7 @@
79
  name="fifu_toggle_content"
80
  class="<?php echo $enable_content; ?>"
81
  value=" "
82
- style="<?php echo $show_content_button; ?>">
83
  <input
84
  type="hidden"
85
  id="fifu_input_content"
@@ -91,7 +177,6 @@
91
  <div class="box">
92
  <h2>Hide Featured Media</h2>
93
  <div class="greybox" style="background:#e3ffe2">
94
- <b>Free feature</b><br><br>
95
  Enable the toggle if you want to hide the external featured image/video/slider on posts/pages but keeping its visibility on home.
96
  </div>
97
  <br>
@@ -109,7 +194,7 @@
109
  onclick="invert('hide_page')"
110
  name="fifu_toggle_hide_page"
111
  class="<?php echo $enable_hide_page; ?>"
112
- value=" ">
113
 
114
  <input
115
  type="hidden"
@@ -119,7 +204,7 @@
119
  </form>
120
  </th>
121
  <th>
122
- page
123
  </th>
124
  </tr>
125
  <tr>
@@ -135,7 +220,7 @@
135
  onclick="invert('hide_post')"
136
  name="fifu_toggle_hide_post"
137
  class="<?php echo $enable_hide_post; ?>"
138
- value=" ">
139
 
140
  <input
141
  type="hidden"
@@ -145,7 +230,7 @@
145
  </form>
146
  </th>
147
  <th>
148
- post
149
  </th>
150
  </tr>
151
  </table>
@@ -154,7 +239,6 @@
154
  <div class="box">
155
  <h2>"This Plugin Doesn't Work, Man!"</h2>
156
  <div class="greybox" style="background:#e3ffe2">
157
- <b>Free feature</b><br><br>
158
  If the external featured images of your posts or pages aren't being shown, congratulations: you're using a nonstandard theme! But there is a last hope. Enabling the toggle below, your external featured images will be associated to a symbolic file in your Media Library. It's a desperate attempt to cheat your theme that will think that there is an internal image there. Then when the theme tries to show the image, that doesn't exist, a function will replace the symbolic file by your URL on execution time. It should allow you to use the main feature of this plugin, but secondary ones, such as "External Featured Image Slider" may not work.
159
  </div>
160
  <br>
@@ -182,21 +266,8 @@
182
  <div class="box">
183
  <h2>WooCommerce Full Integration</h2>
184
  <div class="greybox" style="background:#ffffbc">
185
- <div id="tabs">
186
- <ul>
187
- <li><a href="#tabs-1">Full Integration</a></li>
188
- <li><a href="#tabs-2">Compatibility</a></li>
189
- </ul>
190
- <div id="tabs-1">
191
- Would you like to integrate WooCommerce to Featured Image From URL? For that, a script will be executed to overwrite some lines of code from WooCommerce plugin. It's safe and reversible but it will only work if your site is hosted on a Linux server. <br><br>So let me check...<br><br>
192
- <b><?php echo $compatible; ?></b>
193
- </div>
194
- <div id="tabs-2">
195
- <b>Free</b>: supports WooCommerce 2.4.X and 2.5.X.<br><br>
196
- <b>Premium</b>: supports WooCommerce 2.6.X and 3.0.X.
197
- </div>
198
- </div>
199
-
200
  </div>
201
  <br>
202
  <form
@@ -211,7 +282,7 @@
211
  name="fifu_toggle_woocommerce"
212
  class="<?php echo $enable_woocommerce; ?>"
213
  value=" "
214
- style="<?php echo $show_woocommerce_button; ?>">
215
  <input
216
  type="hidden"
217
  id="fifu_input_woocommerce"
@@ -221,7 +292,7 @@
221
  </div>
222
 
223
  <div class="box">
224
- <h2><a href="https://www.flickr.com/">Flickr</a> Integration (External Thumbnails): Your Website Faster Than Ever</h2>
225
  <div class="greybox" style="background:#ffe2e2">
226
  <b>Premium feature</b><br><br>
227
  <div id="accordion">
@@ -423,7 +494,7 @@
423
  id="fifu_toggle_slider_fade"
424
  name="fifu_toggle_slider_fade"
425
  class="toggleoff"
426
- value=" ">
427
  </th>
428
  <th>
429
  fade effect
@@ -437,7 +508,7 @@
437
  id="fifu_toggle_slider_stop"
438
  name="fifu_toggle_slider_stop"
439
  class="toggleoff"
440
- value=" ">
441
  </th>
442
  <th>
443
  pause autoplay on hover
@@ -451,7 +522,7 @@
451
  id="fifu_toggle_slider_ctrl"
452
  name="fifu_toggle_slider_ctrl"
453
  class="toggleoff"
454
- value=" ">
455
  </th>
456
  <th>
457
  show prev/next buttons
@@ -465,7 +536,7 @@
465
  id="fifu_toggle_slider_auto"
466
  name="fifu_toggle_slider_auto"
467
  class="toggleoff"
468
- value=" ">
469
  </th>
470
  <th>
471
  start to play automatically
@@ -771,16 +842,49 @@
771
  <input
772
  type="image"
773
  href="javascript:void(0)"
774
- id="fifu_toggle_wc_lbox"
775
- name="fifu_toggle_wc_lbox"
776
  class="toggleoff"
777
- value=" ">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
778
  </div>
779
 
780
  <div class="box">
781
  <h2>Help</h2>
782
  <div class="greybox">
783
- Featured Image From URL plugin allows you to use an external image (from anywhere) as Featured Image of your Post, Page or Custom Post Type, such as WooCommerce Product. For WooCommerce users, it's also possible to use external images in the Product Category and Product Gallery. All included content still has social tags to facilitate sharing on social networks. And it's compatible with WP All Import, a3 Lazy Load and Sirv plugins. For more information, refer to <a href="https://wordpress.org/plugins/featured-image-from-url/faq/" target="_blank">FAQ</a> and <a href="https://wordpress.org/plugins/featured-image-from-url/screenshots/" target="_blank">screenshots</a>.
784
  </div>
785
  </div>
786
 
@@ -802,63 +906,55 @@
802
  <h2>About Premium Version</h2>
803
  <div class="greybox">
804
  <h3>1) "Is my theme compatible with Featured Image From URL Premium?"</h3>
805
- Compatibility between Featured Image From URL Premium and the 50 most popular themes on WordPress Theme Directory:<br><br>
806
- 01) Twenty Seventeen: yes;<br>
807
- 02) Twenty Sixteen: yes;<br>
808
- 03) Twenty Fifteen: yes;<br>
809
- 04) Twenty Fourteen: yes;<br>
810
- 05) Total: yes;<br>
811
- 06) Twenty Twelve: yes;<br>
812
- 07) Giga Store: no;<br>
813
- 08) modernize: yes;<br>
814
- 09) Sydney: no;<br>
815
- 10) Twenty Eleven: yes;<br>
816
- 11) Twenty Thirteen: yes;<br>
817
- 12) Eleganto: no;<br>
818
- 13) E-Shop: yes;<br>
819
- 14) Twenty Ten: yes;<br>
820
- 15) Shop Isle: no;<br>
821
- 16) ColorMag: yes;<br>
822
- 17) Illdy: yes;<br>
823
- 18) OnePress: yes;<br>
824
- 19) Spacious: yes;<br>
825
- 20) Primer: yes;<br>
826
- 21) Storefront: yes;<br>
827
- 22) Vertex: no;<br>
828
- 23) Astrid: yes;<br>
829
- 24) Fotografo: no;<br>
830
- 25) Poseidon: no;<br>
831
- 26) Silver Platinum: yes;<br>
832
- 27) Peaceful: yes;<br>
833
- 28) Customizr: yes;<br>
834
- 29) Activello: yes;<br>
835
- 30) Vantage: yes;<br>
836
- 31) Maxwell: yes;<br>
837
- 32) Clean Commerce: yes;<br>
838
- 33) Nikkon: yes;<br>
839
- 34) Nisarg: yes;<br>
840
- 35) Vega: yes;<br>
841
- 36) Resortica Lite: yes;<br>
842
- 37) Basic: yes;<br>
843
- 38) Panoramic: no;<br>
844
- 39) Sparkling: yes;<br>
845
- 40) Hueman: yes;<br>
846
- 41) Businessx: yes;<br>
847
- 42) xMag: yes;<br>
848
- 43) Athena: no;<br>
849
- 44) Shopstar: yes;<br>
850
- 45) ajaira: yes;<br>
851
- 46) evolve: no;<br>
852
- 47) Alpha Store: yes;<br>
853
- 48) Virtue: no;<br>
854
- 49) Vogue: yes;<br>
855
- 50) Responsive: yes.<br>
856
  <br>
857
- Other popular themes:<br>
858
- 01) Avada: no;<br>
859
- 02) Porto: no;<br>
860
- 03) Flatsome: no;<br>
861
- 04) Bimber: no.<br>
 
 
 
862
  <br>
863
  And I will continue updating those lists...<br>
864
  <br>
@@ -868,7 +964,7 @@
868
  <h3>3) "How to get support?"</h3>
869
  You can inform any problem related to the Premium version (except theme issues) in the email above. It will be solved as soon as possible and without any cost.<br><br>
870
  <h3>4) "Which plugins are compatible with Premium version?"</h3>
871
- WooCommerce, WP All Import, a3 Lazy Load and others. If you intend to use the Premium version with a specific plugin, please ask me if they are compatible.<br><br>
872
  <h3>5) "Can I get my money back later?"</h3>
873
  With the exception of rare situations, no way. So don't go to the Premium version if you are not sure if your theme is compatible.<br><br>
874
  <h3>6) "How to get the Premium version?"</h3>
6
 
7
  <div class="box">
8
  <h1>Featured Image From URL</h1>
9
+ </div>
10
+
11
+ <div class="box">
12
+
13
+ <h2>Auto Set Featured Image</h2>
14
+ <div class="greybox" style="background:#e3ffe2">
15
+ Perfect for external posts, this option allows to use the first image from a post/page/product content as featured image. It will happen when you click on Publish/Update button.
16
+ </div>
17
+
18
+ <br>
19
+
20
+ <table style="text-align:left">
21
+ <tr>
22
+ <th>
23
+ <form
24
+ id="fifu_form_get_first"
25
+ action="javascript:void(0)"
26
+ method="post">
27
+ <input
28
+ type="image"
29
+ href="javascript:void(0)"
30
+ id="fifu_toggle_get_first"
31
+ onclick="invert('get_first')"
32
+ name="fifu_toggle_get_first"
33
+ class="<?php echo $enable_get_first; ?>"
34
+ value=" " style="display:block">
35
+
36
+ <input
37
+ type="hidden"
38
+ id="fifu_input_get_first"
39
+ name="fifu_input_get_first"
40
+ value="" >
41
+ </form>
42
+ </th>
43
+ <th>
44
+ use the first image as featured image
45
+ </th>
46
+ </tr>
47
+ <tr>
48
+ <th>
49
+ <form
50
+ id="fifu_form_pop_first"
51
+ action="javascript:void(0)"
52
+ method="post">
53
+ <input
54
+ type="image"
55
+ href="javascript:void(0)"
56
+ id="fifu_toggle_pop_first"
57
+ onclick="invert('pop_first')"
58
+ name="fifu_toggle_pop_first"
59
+ class="<?php echo $enable_pop_first; ?>"
60
+ value=" " style="display:block">
61
+
62
+ <input
63
+ type="hidden"
64
+ id="fifu_input_pop_first"
65
+ name="fifu_input_pop_first"
66
+ value="" >
67
+ </form>
68
+ </th>
69
+ <th>
70
+ hide the first image from content
71
+ </th>
72
+ </tr>
73
+ <tr>
74
+ <th>
75
+ <form
76
+ id="fifu_form_ovw_first"
77
+ action="javascript:void(0)"
78
+ method="post">
79
+ <input
80
+ type="image"
81
+ href="javascript:void(0)"
82
+ id="fifu_toggle_ovw_first"
83
+ onclick="invert('ovw_first')"
84
+ name="fifu_toggle_ovw_first"
85
+ class="<?php echo $enable_ovw_first; ?>"
86
+ value=" " style="display:block">
87
+
88
+ <input
89
+ type="hidden"
90
+ id="fifu_input_ovw_first"
91
+ name="fifu_input_ovw_first"
92
+ value="" >
93
+ </form>
94
+ </th>
95
+ <th>
96
+ overwrite the existing external featured image
97
+ </th>
98
+ </tr>
99
+ </table>
100
+
101
  </div>
102
 
103
  <div class="box">
104
  <h2>Custom Post Types</h2>
105
  <div class="greybox" style="background:#e3ffe2">
 
106
  Featured Image from URL is preconfigured to work with only one Custom Post Type (WooCommerce Product). But you also can use this plugin with other ones. For that, you just need to know the correct Custom Post Type names and fill the fields below. Please, let me know if you need more than 5 inputs here.
107
  </div>
108
  <br>
123
  <div class="box">
124
  <h2>Social Tags</h2>
125
  <div class="greybox" style="background:#e3ffe2">
 
126
  Featured Image from URL provides social tags to share the external images on the social networks. Here you can enable/disable this feature.
127
  </div>
128
  <br>
138
  name="fifu_toggle_social"
139
  class="<?php echo $enable_social; ?>"
140
  value=" "
141
+ style="display:block">
142
  <input
143
  type="hidden"
144
  id="fifu_input_social"
150
  <div class="box">
151
  <h2>Featured Image in Content</h2>
152
  <div class="greybox" style="background:#e3ffe2">
 
153
  It will sound crazy, but some themes don't show the Featured Image on the posts or pages. If it is your case and you would like to show the Featured Image there, just enable the toggle. The Featured Image will appear at the beginning of the content, before the text.
154
  </div>
155
  <br>
165
  name="fifu_toggle_content"
166
  class="<?php echo $enable_content; ?>"
167
  value=" "
168
+ style="display:block">
169
  <input
170
  type="hidden"
171
  id="fifu_input_content"
177
  <div class="box">
178
  <h2>Hide Featured Media</h2>
179
  <div class="greybox" style="background:#e3ffe2">
 
180
  Enable the toggle if you want to hide the external featured image/video/slider on posts/pages but keeping its visibility on home.
181
  </div>
182
  <br>
194
  onclick="invert('hide_page')"
195
  name="fifu_toggle_hide_page"
196
  class="<?php echo $enable_hide_page; ?>"
197
+ value=" " style="display:block">
198
 
199
  <input
200
  type="hidden"
204
  </form>
205
  </th>
206
  <th>
207
+ on page
208
  </th>
209
  </tr>
210
  <tr>
220
  onclick="invert('hide_post')"
221
  name="fifu_toggle_hide_post"
222
  class="<?php echo $enable_hide_post; ?>"
223
+ value=" " style="display:block">
224
 
225
  <input
226
  type="hidden"
230
  </form>
231
  </th>
232
  <th>
233
+ on post
234
  </th>
235
  </tr>
236
  </table>
239
  <div class="box">
240
  <h2>"This Plugin Doesn't Work, Man!"</h2>
241
  <div class="greybox" style="background:#e3ffe2">
 
242
  If the external featured images of your posts or pages aren't being shown, congratulations: you're using a nonstandard theme! But there is a last hope. Enabling the toggle below, your external featured images will be associated to a symbolic file in your Media Library. It's a desperate attempt to cheat your theme that will think that there is an internal image there. Then when the theme tries to show the image, that doesn't exist, a function will replace the symbolic file by your URL on execution time. It should allow you to use the main feature of this plugin, but secondary ones, such as "External Featured Image Slider" may not work.
243
  </div>
244
  <br>
266
  <div class="box">
267
  <h2>WooCommerce Full Integration</h2>
268
  <div class="greybox" style="background:#ffffbc">
269
+ The External Featured Image box is already available on Product Editor. However the full integration is required if you want to include the External Product Gallery and use other WooCommerce resources such as Zoom and Lightbox.<br><br>
270
+ <b><?php echo $compatible; ?></b>
 
 
 
 
 
 
 
 
 
 
 
 
 
271
  </div>
272
  <br>
273
  <form
282
  name="fifu_toggle_woocommerce"
283
  class="<?php echo $enable_woocommerce; ?>"
284
  value=" "
285
+ style="display:block">
286
  <input
287
  type="hidden"
288
  id="fifu_input_woocommerce"
292
  </div>
293
 
294
  <div class="box">
295
+ <h2>External Thumbnails (<a href="https://www.flickr.com/">Flickr</a> Integration): Your Website Faster Than Ever</h2>
296
  <div class="greybox" style="background:#ffe2e2">
297
  <b>Premium feature</b><br><br>
298
  <div id="accordion">
494
  id="fifu_toggle_slider_fade"
495
  name="fifu_toggle_slider_fade"
496
  class="toggleoff"
497
+ value=" " style="display:block">
498
  </th>
499
  <th>
500
  fade effect
508
  id="fifu_toggle_slider_stop"
509
  name="fifu_toggle_slider_stop"
510
  class="toggleoff"
511
+ value=" " style="display:block">
512
  </th>
513
  <th>
514
  pause autoplay on hover
522
  id="fifu_toggle_slider_ctrl"
523
  name="fifu_toggle_slider_ctrl"
524
  class="toggleoff"
525
+ value=" " style="display:block">
526
  </th>
527
  <th>
528
  show prev/next buttons
536
  id="fifu_toggle_slider_auto"
537
  name="fifu_toggle_slider_auto"
538
  class="toggleoff"
539
+ value=" " style="display:block">
540
  </th>
541
  <th>
542
  start to play automatically
842
  <input
843
  type="image"
844
  href="javascript:void(0)"
 
 
845
  class="toggleoff"
846
+ value=" " style="display:block">
847
+ </div>
848
+
849
+ <div class="box">
850
+ <h2>Product Categories Grid</h2>
851
+ <div class="greybox" style="background:#ffe2e2">
852
+ <b>Premium feature</b><br><br>
853
+
854
+ Allows you to use use external images/videos on Product Categories Grid.
855
+
856
+ </div>
857
+
858
+ <br>
859
+
860
+ <form
861
+ id="fifu_form_woocommerce"
862
+ action="javascript:void(0)"
863
+ method="post">
864
+
865
+ <input
866
+ type="image"
867
+ href="javascript:void(0)"
868
+ id="fifu_toggle_woocommerce"
869
+ onclick="invert('woocommerce')"
870
+ name="fifu_toggle_woocommerce"
871
+ class="<?php echo $enable_woocommerce; ?>"
872
+ value=" "
873
+ style="display:block">
874
+
875
+ <input
876
+ type="hidden"
877
+ id="fifu_input_woocommerce"
878
+ name="fifu_input_woocommerce"
879
+ value="" >
880
+ </form>
881
+
882
  </div>
883
 
884
  <div class="box">
885
  <h2>Help</h2>
886
  <div class="greybox">
887
+ Featured Image From URL plugin allows you to use an external image (from anywhere) as Featured Image of your Post, Page or Custom Post Type, such as WooCommerce Product. For WooCommerce users, it's also possible to use external images in the Product Category and Product Gallery. All included content still has social tags to facilitate sharing on social networks. And it's compatible with WP All Import plugin using the custom field "fifu_image_url". For more information, refer to <a href="https://wordpress.org/plugins/featured-image-from-url/faq/" target="_blank">FAQ</a> and <a href="https://wordpress.org/plugins/featured-image-from-url/screenshots/" target="_blank">screenshots</a>.
888
  </div>
889
  </div>
890
 
906
  <h2>About Premium Version</h2>
907
  <div class="greybox">
908
  <h3>1) "Is my theme compatible with Featured Image From URL Premium?"</h3>
909
+ Compatibility between Featured Image From URL Premium and the 30 most popular themes on WordPress Theme Directory:<br><br>
910
+ <style>
911
+ th, td {
912
+ padding: 8px;
913
+ text-align: left;
914
+ }
915
+ </style>
916
+ <table style="text-align:left">
917
+ <tr><th>Working as...</th><th>Blog</th><th>Shop (WooCommerce)</th></tr>
918
+ <tr><th>Twenty Seventeen</th><th>yes</th><th>yes</th></tr>
919
+ <tr><th>Twenty Sixteen</th><th>yes</th><th>yes</th></tr>
920
+ <tr><th>Consulting</th><th>no</th><th>no</th></tr>
921
+ <tr><th>Twenty Fifteen</th><th>yes</th><th>yes</th></tr>
922
+ <tr><th>Hestia</th><th>yes</th><th>yes</th></tr>
923
+ <tr><th>Twenty Fourteen</th><th>yes</th><th>yes</th></tr>
924
+ <tr><th>Sydney</th><th>yes</th><th>yes</th></tr>
925
+ <tr><th>Twenty Twelve</th><th>yes</th><th>yes</th></tr>
926
+ <tr><th>Total</th><th>no</th><th>yes</th></tr>
927
+ <tr><th>One Page Express</th><th>yes</th><th>no</th></tr>
928
+ <tr><th>Shapely</th><th>no</th><th>no</th></tr>
929
+ <tr><th>Twenty Eleven</th><th>no</th><th>yes</th></tr>
930
+ <tr><th>Giga Store</th><th>no</th><th>no</th></tr>
931
+ <tr><th>Twenty Thirteen</th><th>yes</th><th>yes</th></tr>
932
+ <tr><th>Flash</th><th>yes</th><th>yes</th></tr>
933
+ <tr><th>Zerif Lite</th><th>no</th><th>yes</th></tr>
934
+ <tr><th>Activation</th><th>no</th><th>no</th></tr>
935
+ <tr><th>Astra</th><th>yes</th><th>no</th></tr>
936
+ <tr><th>Envo Store</th><th>no</th><th>no</th></tr>
937
+ <tr><th>Kale</th><th>no</th><th>yes</th></tr>
938
+ <tr><th>Eleganto</th><th>yes</th><th>no</th></tr>
939
+ <tr><th>ColorMag</th><th>yes</th><th>yes</th></tr>
940
+ <tr><th>OnePress</th><th>no</th><th>yes</th></tr>
941
+ <tr><th>E-Shop</th><th>no</th><th>no</th></tr>
942
+ <tr><th>Twenty Ten</th><th>no</th><th>yes</th></tr>
943
+ <tr><th>Storefront</th><th>yes</th><th>yes</th></tr>
944
+ <tr><th>Shop Isle</th><th>no</th><th>no</th></tr>
945
+ <tr><th>Spacious</th><th>no</th><th>yes</th></tr>
946
+ <tr><th>Anissa</th><th>yes</th><th>no</th></tr>
947
+ <tr><th>Resortica Lite</th><th>no</th><th>no</th></tr>
948
+ </table>
 
 
 
 
 
 
 
 
 
 
 
949
  <br>
950
+ Other popular themes...
951
+ <table style="text-align:left">
952
+ <tr><th>Working as...</th><th>Blog</th><th>Shop (WooCommerce)</th></tr>
953
+ <tr><th>Avada</th><th>no</th><th>no</th></tr>
954
+ <tr><th>Divi</th><th>no</th><th>yes</th></tr>
955
+ <tr><th>Salient</th><th>yes</th><th>yes</th></tr>
956
+ <tr><th>Themify Ultra</th><th>no</th><th>yes</th></tr>
957
+ </table>
958
  <br>
959
  And I will continue updating those lists...<br>
960
  <br>
964
  <h3>3) "How to get support?"</h3>
965
  You can inform any problem related to the Premium version (except theme issues) in the email above. It will be solved as soon as possible and without any cost.<br><br>
966
  <h3>4) "Which plugins are compatible with Premium version?"</h3>
967
+ WooCommerce, WP All Import, Monarch, a3 Lazy Load, AccessPress Anonymous Post and others. If you intend to use the Premium version with a specific plugin, you can ask me if they are compatible.<br><br>
968
  <h3>5) "Can I get my money back later?"</h3>
969
  With the exception of rare situations, no way. So don't go to the Premium version if you are not sure if your theme is compatible.<br><br>
970
  <h3>6) "How to get the Premium version?"</h3>
admin/html/meta-box.html CHANGED
@@ -46,11 +46,23 @@
46
 
47
  <hr>
48
 
49
- <p style="border: 1px solid green; padding: 5px;">New Features 06/2017</p>
50
  <table style="text-align:left; font-weight: normal; font-size: 10px">
 
 
 
 
51
  <tr>
52
  <th>-Free: Hide featured media on page/post</th>
53
  </th>
 
 
 
 
 
 
 
 
54
  <tr>
55
  <th>-Premium: Video ratio/resize</th>
56
  </th>
46
 
47
  <hr>
48
 
49
+ <p style="border: 1px solid blue; padding: 5px;">New Features 06/2017</p>
50
  <table style="text-align:left; font-weight: normal; font-size: 10px">
51
+ <tr>
52
+ <th>-Free: Use the first image as featured image</th>
53
+ </th>
54
+ <tr>
55
  <tr>
56
  <th>-Free: Hide featured media on page/post</th>
57
  </th>
58
+ <tr>
59
+ <tr>
60
+ <th>-Premium: WooCommerce integration (any server)</th>
61
+ </th>
62
+ <tr>
63
+ <tr>
64
+ <th>-Premium: Product Categories Grid</th>
65
+ </th>
66
  <tr>
67
  <th>-Premium: Video ratio/resize</th>
68
  </th>
admin/menu.php CHANGED
@@ -19,26 +19,20 @@ function fifu_get_menu_html() {
19
  $enable_hope = get_option('fifu_hope');
20
  $enable_hide_page = get_option('fifu_hide_page');
21
  $enable_hide_post = get_option('fifu_hide_post');
 
 
 
22
 
23
  $array_cpt = array();
24
  for ($x = 0; $x <= 4; $x++)
25
  $array_cpt[$x] = get_option('fifu_cpt' . $x);
26
 
27
- $show_woocommerce_button = $show_social_button = $show_content_button = "display:block";
28
-
29
- $output = shell_exec('uname -s');
30
- if ($output == "") {
31
- $compatible = "Unfortunatelly, the script and your server system are not compatible. " .
32
- "But we still can do the WooCommerce integration manually. In this case, send an email to <a href='mailto:marceljmachado@gmail.com'>marceljmachado@gmail.com</a>.";
33
- $show_woocommerce_button = "display:none";
34
- } else {
35
- if (strpos($output, "Linux") !== false)
36
- $compatible = "You server is using $output system. Great! The script may work =)";
37
- else
38
- $compatible = "You server is using $output system. The script may work. <p/>" .
39
- "Please, send an email to <a href='mailto:marceljmachado@gmail.com'>marceljmachado@gmail.com</a> " .
40
- "informing your server system and let me know if it worked for you.";
41
- }
42
 
43
  include 'html/menu.html';
44
 
@@ -59,6 +53,9 @@ function fifu_get_menu_settings() {
59
  fifu_get_setting('fifu_hope');
60
  fifu_get_setting('fifu_hide_page');
61
  fifu_get_setting('fifu_hide_post');
 
 
 
62
 
63
  for ($x = 0; $x <= 4; $x++)
64
  fifu_get_setting('fifu_cpt' . $x);
@@ -82,6 +79,9 @@ function fifu_update_menu_options() {
82
  fifu_update_option('fifu_input_hope', 'fifu_hope');
83
  fifu_update_option('fifu_input_hide_page', 'fifu_hide_page');
84
  fifu_update_option('fifu_input_hide_post', 'fifu_hide_post');
 
 
 
85
 
86
  for ($x = 0; $x <= 4; $x++)
87
  fifu_update_option('fifu_input_cpt' . $x, 'fifu_cpt' . $x);
@@ -189,4 +189,3 @@ function fifu_disable_nonstandard_compatibility() {
189
  wp_delete_attachment(get_option('fifu_attachment_id'));
190
  delete_option('fifu_attachment_id');
191
  }
192
-
19
  $enable_hope = get_option('fifu_hope');
20
  $enable_hide_page = get_option('fifu_hide_page');
21
  $enable_hide_post = get_option('fifu_hide_post');
22
+ $enable_get_first = get_option('fifu_get_first');
23
+ $enable_pop_first = get_option('fifu_pop_first');
24
+ $enable_ovw_first = get_option('fifu_ovw_first');
25
 
26
  $array_cpt = array();
27
  for ($x = 0; $x <= 4; $x++)
28
  $array_cpt[$x] = get_option('fifu_cpt' . $x);
29
 
30
+ if (function_exists('WC')) {
31
+ $woo_version = WC()->version;
32
+ if ($woo_version >= 3)
33
+ $compatible = 'Warning: you are using WooCommerce ' . $woo_version . ' and it requires the PREMIUM version of Featured Image From URL. This free version supports WooCommerce 2.4 and 2.5.';
34
+ } else
35
+ $compatible = "Warning: WooCommerce isn't activated/installed.";
 
 
 
 
 
 
 
 
 
36
 
37
  include 'html/menu.html';
38
 
53
  fifu_get_setting('fifu_hope');
54
  fifu_get_setting('fifu_hide_page');
55
  fifu_get_setting('fifu_hide_post');
56
+ fifu_get_setting('fifu_get_first');
57
+ fifu_get_setting('fifu_pop_first');
58
+ fifu_get_setting('fifu_ovw_first');
59
 
60
  for ($x = 0; $x <= 4; $x++)
61
  fifu_get_setting('fifu_cpt' . $x);
79
  fifu_update_option('fifu_input_hope', 'fifu_hope');
80
  fifu_update_option('fifu_input_hide_page', 'fifu_hide_page');
81
  fifu_update_option('fifu_input_hide_post', 'fifu_hide_post');
82
+ fifu_update_option('fifu_input_get_first', 'fifu_get_first');
83
+ fifu_update_option('fifu_input_pop_first', 'fifu_pop_first');
84
+ fifu_update_option('fifu_input_ovw_first', 'fifu_ovw_first');
85
 
86
  for ($x = 0; $x <= 4; $x++)
87
  fifu_update_option('fifu_input_cpt' . $x, 'fifu_cpt' . $x);
189
  wp_delete_attachment(get_option('fifu_attachment_id'));
190
  delete_option('fifu_attachment_id');
191
  }
 
admin/meta-box.php CHANGED
@@ -99,13 +99,39 @@ function fifu_slider_show_elements($post) {
99
  include 'html/live-preview.html';
100
  }
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  add_action('save_post', 'fifu_save_properties');
103
 
104
  function fifu_save_properties($post_id) {
105
  if (isset($_POST['fifu_input_url'])) {
106
- update_post_meta($post_id, 'fifu_image_url', esc_url($_POST['fifu_input_url']));
 
 
 
 
107
 
108
- if (get_option('fifu_attachment_id') && !get_post_thumbnail_id($post_id) && esc_url($_POST['fifu_input_url']))
 
 
109
  set_post_thumbnail($post_id, get_option('fifu_attachment_id'));
110
  }
111
 
@@ -137,4 +163,3 @@ function fifu_save_properties($post_id) {
137
  delete_post_thumbnail($post_id);
138
  }
139
  }
140
-
99
  include 'html/live-preview.html';
100
  }
101
 
102
+ add_filter('wp_insert_post_data', 'fifu_remove_fist_image', 10, 2);
103
+
104
+ function fifu_remove_fist_image($data, $postarr) {
105
+ $content = $postarr['post_content'];
106
+ if (!$content)
107
+ return $data;
108
+
109
+ $contentClean = fifu_show_all_images($content);
110
+ $data = str_replace($content, $contentClean, $data);
111
+
112
+ $img = fifu_first_img_in_content($contentClean);
113
+ if (!$img)
114
+ return $data;
115
+
116
+ if (get_option('fifu_pop_first') == 'toggleoff')
117
+ return str_replace($img, fifu_show_image($img), $data);
118
+
119
+ return str_replace($img, fifu_hide_image($img), $data);
120
+ }
121
+
122
  add_action('save_post', 'fifu_save_properties');
123
 
124
  function fifu_save_properties($post_id) {
125
  if (isset($_POST['fifu_input_url'])) {
126
+ $first = fifu_first_url_in_content($post_id);
127
+ $url = esc_url($_POST['fifu_input_url']);
128
+
129
+ if ($first && get_option('fifu_get_first') == 'toggleon' && (!$url || get_option('fifu_ovw_first') == 'toggleon'))
130
+ $url = $first;
131
 
132
+ update_post_meta($post_id, 'fifu_image_url', $url);
133
+
134
+ if (get_option('fifu_attachment_id') && !get_post_thumbnail_id($post_id) && $url)
135
  set_post_thumbnail($post_id, get_option('fifu_attachment_id'));
136
  }
137
 
163
  delete_post_thumbnail($post_id);
164
  }
165
  }
 
featured-image-from-url.php CHANGED
@@ -2,8 +2,8 @@
2
 
3
  /*
4
  * Plugin Name: Featured Image From URL
5
- * Description: Allows to use an external image as Featured Image of your post, page or Custom Post Type, such as WooCommerce Product (supports Product Gallery also).
6
- * Version: 1.5.2
7
  * Author: Marcel Jacques Machado
8
  * Author URI: http://marceljm.com/wordpress/featured-image-from-url-premium/
9
  */
@@ -14,6 +14,7 @@ define('FIFU_ADMIN_DIR', FIFU_PLUGIN_DIR . '/admin');
14
 
15
  require_once( FIFU_INCLUDES_DIR . '/thumbnail.php' );
16
  require_once( FIFU_INCLUDES_DIR . '/thumbnail-category.php' );
 
17
 
18
  if (is_admin()) {
19
  require_once( FIFU_ADMIN_DIR . '/meta-box.php' );
2
 
3
  /*
4
  * Plugin Name: Featured Image From URL
5
+ * 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.
6
+ * Version: 1.5.3
7
  * Author: Marcel Jacques Machado
8
  * Author URI: http://marceljm.com/wordpress/featured-image-from-url-premium/
9
  */
14
 
15
  require_once( FIFU_INCLUDES_DIR . '/thumbnail.php' );
16
  require_once( FIFU_INCLUDES_DIR . '/thumbnail-category.php' );
17
+ require_once( FIFU_INCLUDES_DIR . '/external-post.php' );
18
 
19
  if (is_admin()) {
20
  require_once( FIFU_ADMIN_DIR . '/meta-box.php' );
includes/external-post.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_filter('wp_insert_post_data', 'fifu_remove_fist_image_ext', 10, 2);
4
+
5
+ function fifu_remove_fist_image_ext($data, $postarr) {
6
+ if (isset($_POST['fifu_input_url']))
7
+ return $data;
8
+
9
+ $content = $postarr['post_content'];
10
+ if (!$content)
11
+ return $data;
12
+
13
+ $contentClean = fifu_show_all_images($content);
14
+ $data = str_replace($content, $contentClean, $data);
15
+
16
+ $img = fifu_first_img_in_content($contentClean);
17
+ if (!$img)
18
+ return $data;
19
+
20
+ if (get_option('fifu_pop_first') == 'toggleoff')
21
+ return str_replace($img, fifu_show_image($img), $data);
22
+
23
+ return str_replace($img, fifu_hide_image($img), $data);
24
+ }
25
+
26
+ add_action('save_post', 'fifu_save_properties_ext');
27
+
28
+ function fifu_save_properties_ext($post_id) {
29
+ if (isset($_POST['fifu_input_url']))
30
+ return;
31
+
32
+ $url = fifu_first_url_in_content($post_id);
33
+
34
+ if ($url && get_option('fifu_get_first') == 'toggleon')
35
+ update_post_meta($post_id, 'fifu_image_url', $url);
36
+
37
+ if (get_option('fifu_attachment_id') && !get_post_thumbnail_id($post_id) && $url)
38
+ set_post_thumbnail($post_id, get_option('fifu_attachment_id'));
39
+ }
40
+
41
+ function fifu_first_img_in_content($content) {
42
+ $matches = array();
43
+ preg_match_all('/<img[^>]*>/', $content, $matches);
44
+ return $matches && $matches[0] ? $matches[0][0] : null;
45
+ }
46
+
47
+ function fifu_show_all_images($content) {
48
+ $matches = array();
49
+ preg_match_all('/<img[^>]*display:[ ]*none[^>]*>/', $content, $matches);
50
+ foreach ($matches[0] as $img) {
51
+ $content = str_replace($img, fifu_show_image($img), $content);
52
+ }
53
+ return $content;
54
+ }
55
+
56
+ function fifu_hide_image($img) {
57
+ if (strpos($img, 'style=\"') !== false)
58
+ return preg_replace('/style=..[^"]*["]/', 'style=\"display:none\"', $img);
59
+ return str_replace('/>', 'style=\"display:none\"/>', $img);
60
+ }
61
+
62
+ function fifu_show_image($img) {
63
+ return preg_replace('/style=..display:[ ]*none../', '', $img);
64
+ }
65
+
66
+ function fifu_first_url_in_content($post_id) {
67
+ $content = get_post_field('post_content', $post_id);
68
+ $matches = array();
69
+ preg_match_all('/<img[^>]*>/', $content, $matches);
70
+ return $matches && $matches[0] ? explode('"', explode('src="', $matches[0][0])[1])[0] : null;
71
+ }
readme.txt CHANGED
@@ -1,38 +1,40 @@
1
  === Plugin Name ===
2
  Contributors: marceljm
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8BLDLZ3HDBGQG
4
- Tags: featured image, external featured image, featured image from url, url featured image, featured, image, external, url, flickr, s3, picasa, woocommerce, product image, product gallery, product, gallery, column, list, page, post, all, content, custom, type, custom post type, category, video, external video, youtube, featured video, hover, effects, hover effects, sirv, wp all import, css, style, slider, thumbnail, social, network, wp all import
5
  Requires at least: 4.0
6
  Tested up to: 4.8
7
  Stable tag: 4.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Allows to use an external image as Featured Image of your post, page or Custom Post Type, such as WooCommerce Product (supports Product Gallery also).
12
 
13
  == Description ==
14
 
15
  Features:
16
 
17
- * allows you to use an external image (from Flickr, Picasa, Amazon S3, anywhere etc) as Featured Image of your post, page and Custom Post Type, such as WooCommerce Product;
 
 
18
 
19
  * it's also possible to use external images in the WooCommerce Product Gallery and WooCommerce Product Category;
20
 
21
- * when you access "All Posts", "All Pages", "Products" or "Product Categories" in admin menu, the Featured Images (internal or external) are shown in a new column;
 
 
22
 
23
- * if your theme didn't show Featured Image (internal or external) in Posts, Pages or Products, it's possible to include that at the beginning of the content automatically;
24
 
25
  * all included content still has social tags to facilitate sharing on social networks;
26
 
27
  * compatible with WP All Import plugin ("Import Products from any XML or CSV to WooCommerce");
28
 
29
- * compatible with Sirv CDN & Image Manager plugin ("Instantly resize and deliver perfectly optimized images to your website").
30
-
31
  *WooCommerce compatibility: 2.4.X and 2.5.X.*
32
 
33
  **Premium Version:**
34
 
35
- All functionalities created for external images are now available for **external videos** (from YouTube), everything in one plugin.
36
 
37
  And you still can:
38
 
@@ -40,11 +42,15 @@ And you still can:
40
 
41
  * use a **slider** of images as featured image;
42
 
 
 
43
  * apply your own **CSS style** or **<a href="http://marceljm.com/wordpress/featured-image-from-url-premium/#hover">18 hover effects</a>** to the images;
44
 
 
 
45
  Click <a href="http://marceljm.com/wordpress/featured-image-from-url-premium/" targe="_blank">here</a> to know more.
46
 
47
- *WooCommerce compatibility: 2.6.X. and later.*
48
 
49
  **<a href="http://fifu.marceljm.com/">Live Preview</a>**
50
 
@@ -105,7 +111,7 @@ Click <a href="http://marceljm.com/wordpress/featured-image-from-url-premium/" t
105
 
106
  = Which WooCommerce versions are supported by Featured Image From URL?
107
 
108
- * The Free version supports 2.4.X and 2.5.X while the Premium version supports 2.6.X and later.
109
 
110
  = Why aren't my external images in WooCommerce Product Gallery being saved? =
111
 
@@ -287,6 +293,9 @@ was removed. To finish, a Premium version is now been presented.
287
  = 1.5.2 =
288
  * Hide external featured media.
289
 
 
 
 
290
  == Upgrade Notice ==
291
 
292
  = 1.0 =
@@ -399,4 +408,7 @@ was removed. To finish, a Premium version is now been presented.
399
  * Genesis Framework integration, external JS minification and WooCommerce 3 note.
400
 
401
  = 1.5.2 =
402
- * Hide external featured media.
 
 
 
1
  === Plugin Name ===
2
  Contributors: marceljm
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8BLDLZ3HDBGQG
4
+ Tags: featured image, external featured image, featured image from url, url featured image, featured, image, external, url, flickr, s3, picasa, woocommerce, product image, product gallery, product, gallery, column, list, page, post, all, content, custom, type, custom post type, category, video, external video, youtube, featured video, hover, effects, hover effects, sirv, wp all import, css, style, slider, thumbnail, social, network, auto, publish, hide, first image, content, lightbox, size, grid
5
  Requires at least: 4.0
6
  Tested up to: 4.8
7
  Stable tag: 4.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Use an external image as Featured Image of your post/page/product (WooCommerce). Includes Auto Set (External Post), Product Gallery, Social Tags and more.
12
 
13
  == Description ==
14
 
15
  Features:
16
 
17
+ * allows you to use an external image (from Flickr, Picasa, Amazon S3, anywhere) as Featured Image of your post, page and Custom Post Type, such as WooCommerce Product;
18
+
19
+ * perfect for external posts, the plugin is able to use the first image as Featured Image;
20
 
21
  * it's also possible to use external images in the WooCommerce Product Gallery and WooCommerce Product Category;
22
 
23
+ * when you access the table of posts/pages/products/categories in admin menu, the Featured Images are shown in a new column;
24
+
25
+ * if your theme doesn't show Featured Image on posts/pages/products, it's possible to include that at the beginning of the content automatically;
26
 
27
+ * but if your theme show the Featured Images on posts/pages/products, there is an option to remove the Featured Image;
28
 
29
  * all included content still has social tags to facilitate sharing on social networks;
30
 
31
  * compatible with WP All Import plugin ("Import Products from any XML or CSV to WooCommerce");
32
 
 
 
33
  *WooCommerce compatibility: 2.4.X and 2.5.X.*
34
 
35
  **Premium Version:**
36
 
37
+ All features created for external images are now available for **external videos** (from YouTube), everything in one plugin.
38
 
39
  And you still can:
40
 
42
 
43
  * use a **slider** of images as featured image;
44
 
45
+ * define the video size for each screen;
46
+
47
  * apply your own **CSS style** or **<a href="http://marceljm.com/wordpress/featured-image-from-url-premium/#hover">18 hover effects</a>** to the images;
48
 
49
+ * disable the WooCommerce lightbox.
50
+
51
  Click <a href="http://marceljm.com/wordpress/featured-image-from-url-premium/" targe="_blank">here</a> to know more.
52
 
53
+ *WooCommerce compatibility: 3.0.X. and later.*
54
 
55
  **<a href="http://fifu.marceljm.com/">Live Preview</a>**
56
 
111
 
112
  = Which WooCommerce versions are supported by Featured Image From URL?
113
 
114
+ * The Free version supports 2.4.X and 2.5.X while the Premium version supports 3.0.X and later.
115
 
116
  = Why aren't my external images in WooCommerce Product Gallery being saved? =
117
 
293
  = 1.5.2 =
294
  * Hide external featured media.
295
 
296
+ = 1.5.3 =
297
+ * Auto set featured image.
298
+
299
  == Upgrade Notice ==
300
 
301
  = 1.0 =
408
  * Genesis Framework integration, external JS minification and WooCommerce 3 note.
409
 
410
  = 1.5.2 =
411
+ * Hide external featured media.
412
+
413
+ = 1.5.3 =
414
+ * Auto set featured image.