Featured Image From URL - Version 1.4.5

Version Description

  • Add External Featured Image Slider.

=

Download this release

Release Info

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

Code changes from version 1.4.4 to 1.4.5

admin/html/css/blink.css ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ .blink_me {
2
+ animation: blinker 2s linear infinite;
3
+ }
4
+
5
+ @keyframes blinker {
6
+ 50% { opacity: 0.0; }
7
+ }
admin/html/live-preview.html ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <style><?php include 'css/blink.css' ?></style>
2
+
3
+ <a id="fifu_slider"
4
+ class="blink_me"
5
+ href="http://fifu.marceljm.com/"
6
+ style="<?php echo $show_slider ?>" >Live preview</a>
admin/html/menu.html CHANGED
@@ -22,7 +22,7 @@
22
 
23
  <div class="greybox">
24
 
25
- <p>All functionalities created for external images are now available for <b>external videos</b> (from YouTube), everything in one plugin. And <b>supports the last WooCommerce version</b>. Click <a href="http://marceljm.com/wordpress/featured-image-from-url-premium/" targe="_blank">here</a> to know more. Or here to have a <a href="http://fifu.marceljm.com/product-category/music/" targe="_blank">Live Preview</a>.<p/>
26
 
27
  <iframe src="https://www.youtube.com/embed/LuynS-Y-fZs" height="402" width="715" allowfullscreen="" frameborder="0"></iframe>
28
 
@@ -137,7 +137,7 @@
137
 
138
  <p/>
139
 
140
- <input id="fifu_input_css" type="text" name="fifu_input_css" style="width:675px" disabled>
141
 
142
  <input type="submit" value="Submit" disabled>
143
 
@@ -187,6 +187,28 @@
187
 
188
  <p>Make your front page cool! Choose a hover effect in the plugin settings to be applied to all external featured images of your posts on your main page. <b>Featured Image From URL Premium</b> has 18 hover effects available. <a href="http://marceljm.com/wordpress/featured-image-from-url-premium#hover" targe="_blank">Check it out</a>.<p/>
189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  </div>
191
 
192
  </div>
@@ -197,7 +219,7 @@
197
 
198
  <div class="greybox">
199
 
200
- <p>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 an attempt to cheat your theme that will think that there is an internal image selected. Then when the theme tries to show the image, that doesn't exist, a JavaScript will replace your HTML code on execution time.</p>
201
 
202
  </div>
203
 
22
 
23
  <div class="greybox">
24
 
25
+ <p>All functionalities created for external images are now available for <b>external videos</b> (from YouTube), everything in one plugin. You can still apply your <b>CSS style</b> or <b>18 hover effects</b> to the images and use a <b>slider of images</b> as featured image. Supports the <b>last WooCommerce version</b>. Click <a href="http://marceljm.com/wordpress/featured-image-from-url-premium/" targe="_blank">here</a> to know more. Or you can have a <a href="http://fifu.marceljm.com/" targe="_blank">Live Preview</a>.<p/>
26
 
27
  <iframe src="https://www.youtube.com/embed/LuynS-Y-fZs" height="402" width="715" allowfullscreen="" frameborder="0"></iframe>
28
 
137
 
138
  <p/>
139
 
140
+ <input id="fifu_input_css" type="text" name="fifu_input_css" style="width:675px" disabled>
141
 
142
  <input type="submit" value="Submit" disabled>
143
 
187
 
188
  <p>Make your front page cool! Choose a hover effect in the plugin settings to be applied to all external featured images of your posts on your main page. <b>Featured Image From URL Premium</b> has 18 hover effects available. <a href="http://marceljm.com/wordpress/featured-image-from-url-premium#hover" targe="_blank">Check it out</a>.<p/>
189
 
190
+ <select id="select_hover" style="width:100%">
191
+ <option value=""></option>
192
+ <option value="hover17">315 Degrees</option>
193
+ <option value="hover02">360 Degrees</option>
194
+ <option value="hover07">Blur</option>
195
+ <option value="hover10">Blur Gray Scale</option>
196
+ <option value="hover04">Brighten</option>
197
+ <option value="hover15">Circle</option>
198
+ <option value="hover13">Flashing</option>
199
+ <option value="hover08">Gray Scale</option>
200
+ <option value="hover16">Horizontal Rotation</option>
201
+ <option value="hover12">Opacity Color</option>
202
+ <option value="hover11">Opacity White</option>
203
+ <option value="hover18">Rainbow</option>
204
+ <option value="hover06">Rotate</option>
205
+ <option value="hover09">Sepia</option>
206
+ <option value="hover14">Shine</option>
207
+ <option value="hover05">Vertical Rotation</option>
208
+ <option value="hover01">Zoom In</option>
209
+ <option value="hover03">Zoom Out</option>
210
+ </select>
211
+
212
  </div>
213
 
214
  </div>
219
 
220
  <div class="greybox">
221
 
222
+ <p>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.</p>
223
 
224
  </div>
225
 
admin/html/slider-meta-box.html ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- show URL field and preview button if URL was not provided yet -->
2
+
3
+ <input disabled id="fifu_slider_input_url_<?php echo $i; ?>"
4
+ type="text"
5
+ name="fifu_slider_input_url_<?php echo $i; ?>"
6
+ placeholder="URL"
7
+ value="<?php echo $url[$i]; ?>"
8
+ style="<?php echo $width, $margin, $show_url[$i] ?>" />
9
+
10
+ <a disabled id="fifu_slider_button_<?php echo $i; ?>"
11
+ class="button"
12
+ onClick="sliderPreviewImage(<?php echo $i; ?>);"
13
+ style="<?php echo $align, $margin, $show_button[$i] ?>" >Preview</a>
14
+
admin/meta-box.php CHANGED
@@ -3,51 +3,34 @@
3
  add_action('add_meta_boxes', 'fifu_insert_meta_box');
4
 
5
  function fifu_insert_meta_box() {
6
- $post_types = array('post', 'page', 'product', get_option('fifu_cpt0'), get_option('fifu_cpt1'), get_option('fifu_cpt2'), get_option('fifu_cpt3'), get_option('fifu_cpt4'));
7
-
8
- foreach ($post_types as $post_type) {
9
- if ($post_type == 'product') {
10
- add_meta_box(
11
- 'urlMetaBox',
12
- 'External Product Image',
13
- 'fifu_show_elements',
14
- $post_type,
15
- 'side',
16
- 'low'
17
- );
18
- if (get_option('fifu_woocommerce') == 'toggleon') {
19
- add_meta_box(
20
- 'wooCommerceGalleryMetaBox',
21
- 'External Product Gallery',
22
- 'fifu_wc_show_elements',
23
- $post_type,
24
- 'side',
25
- 'low'
26
- );
27
- }
28
- }
29
- else {
30
- if ($post_type)
31
- add_meta_box(
32
- 'imageUrlMetaBox',
33
- 'External Featured Image',
34
- 'fifu_show_elements',
35
- $post_type,
36
- 'side',
37
- 'low'
38
- );
39
- }
40
-
41
- if ($post_type)
42
- add_meta_box(
43
- 'videoUrlMetaBox',
44
- 'External Featured Video',
45
- 'fifu_show_advertisement',
46
- $post_type,
47
- 'side',
48
- 'low'
49
- );
50
- }
51
  }
52
 
53
  function fifu_show_elements($post) {
@@ -62,86 +45,95 @@ function fifu_show_elements($post) {
62
 
63
  if ($url) {
64
  $show_url = $show_button = $show_sirv = 'display:none;';
65
- $show_alt = $show_image = $show_link = $show_hover = '';
66
  } else {
67
- $show_alt = $show_image = $show_link = $show_hover = 'display:none;';
68
  $show_url = $show_button = '';
69
  $show_sirv = ($is_sirv_active ? '' : 'display:none;');
70
  }
71
 
72
  include 'html/meta-box.html';
73
-
74
- if (get_post_type(get_the_ID()) == 'post')
75
- include 'html/hover.html';
76
  }
77
 
78
  function fifu_show_advertisement($post) {
79
- $margin = 'margin-top:10px;';
80
- $width = 'width:100%;';
81
- $height = 'height:266px;';
82
- $align = 'text-align:left;';
83
 
84
- include 'html/meta-box-advertisement.html';
85
  }
86
 
87
  function fifu_wc_show_elements($post) {
88
- $margin = 'margin-top:1px;';
89
- $width = 'width:70%;';
90
- $height = 'height:266px;';
91
- $align = 'text-align:left;';
92
- $altWidth = 'width:86%;';
93
-
94
- for ($i = 0; $i < 10; $i++) {
95
- $url[$i] = get_post_meta($post->ID, 'fifu_image_url_' . $i, true);
96
- $alt[$i] = get_post_meta($post->ID, 'fifu_image_alt_' . $i, true);
97
-
98
- if ($url[$i]) {
99
- $show_url[$i] = $show_button[$i] = 'display:none;';
100
- $show_alt[$i] = $show_image[$i] = $show_link[$i] = '';
101
- } else {
102
- $show_alt[$i] = $show_image[$i] = $show_link[$i] = 'display:none;';
103
- $show_url[$i] = $show_button[$i] = '';
104
- }
105
-
106
- include 'html/wc-meta-box.html';
107
- }
 
 
 
 
 
 
 
 
 
 
 
 
108
  }
109
 
110
  add_action('save_post', 'fifu_save_properties');
111
 
112
  function fifu_save_properties($post_id) {
113
- if (isset($_POST['fifu_input_url'])) {
114
- update_post_meta($post_id, 'fifu_image_url', esc_url($_POST['fifu_input_url']));
115
-
116
- if (get_option('fifu_attachment_id') && !get_post_thumbnail_id($post_id) && esc_url($_POST['fifu_input_url']))
117
- set_post_thumbnail($post_id, get_option('fifu_attachment_id'));
118
- }
119
-
120
- if (isset($_POST['fifu_input_alt']))
121
- update_post_meta($post_id, 'fifu_image_alt', wp_strip_all_tags($_POST['fifu_input_alt']));
122
-
123
- if (get_post_type(get_the_ID()) == 'product') {
124
- $count = 10;
125
- for ($i = 0; $i < 10; $i++) {
126
- if (isset($_POST['fifu_input_url_' . $i]) && isset($_POST['fifu_input_alt_' . $i])) {
127
- if ($_POST['fifu_input_url_' . $i] != '' && $_POST['fifu_input_alt_' . $i] != '') {
128
- update_post_meta($post_id, 'fifu_image_url_' . $i, esc_url($_POST['fifu_input_url_' . $i]));
129
- update_post_meta($post_id, 'fifu_image_alt_' . $i, wp_strip_all_tags($_POST['fifu_input_alt_' . $i]));
130
- if (get_option('fifu_attachment_id') && !get_post_thumbnail_id($post_id) && esc_url($_POST['fifu_input_url_' . $i]))
131
- set_post_thumbnail($post_id, get_option('fifu_attachment_id'));
132
- } else {
133
- delete_post_meta($post_id, 'fifu_image_url_' . $i);
134
- delete_post_meta($post_id, 'fifu_image_alt_' . $i);
135
- $count--;
136
- }
137
- }
138
- }
139
- if ($count == 0 && (isset($_POST['fifu_input_url']) && !esc_url($_POST['fifu_input_url'])) && get_post_thumbnail_id($post_id) == get_option('fifu_attachment_id'))
140
- delete_post_thumbnail($post_id);
141
- }
142
- else {
143
- if ((isset($_POST['fifu_input_url']) && !esc_url($_POST['fifu_input_url'])) && get_post_thumbnail_id($post_id) == get_option('fifu_attachment_id'))
144
- delete_post_thumbnail($post_id);
145
- }
146
  }
147
 
3
  add_action('add_meta_boxes', 'fifu_insert_meta_box');
4
 
5
  function fifu_insert_meta_box() {
6
+ $post_types = array('post', 'page', 'product', get_option('fifu_cpt0'), get_option('fifu_cpt1'), get_option('fifu_cpt2'), get_option('fifu_cpt3'), get_option('fifu_cpt4'));
7
+
8
+ foreach ($post_types as $post_type) {
9
+ if ($post_type == 'product') {
10
+ add_meta_box(
11
+ 'urlMetaBox', 'External Product Image', 'fifu_show_elements', $post_type, 'side', 'low'
12
+ );
13
+ if (get_option('fifu_woocommerce') == 'toggleon') {
14
+ add_meta_box(
15
+ 'wooCommerceGalleryMetaBox', 'External Product Gallery', 'fifu_wc_show_elements', $post_type, 'side', 'low'
16
+ );
17
+ }
18
+ } else {
19
+ if ($post_type)
20
+ add_meta_box(
21
+ 'imageUrlMetaBox', 'External Featured Image', 'fifu_show_elements', $post_type, 'side', 'low'
22
+ );
23
+ }
24
+
25
+ if ($post_type) {
26
+ add_meta_box(
27
+ 'sliderImageUrlMetaBox', 'External Featured Image Slider', 'fifu_slider_show_elements', $post_type, 'side', 'low'
28
+ );
29
+ add_meta_box(
30
+ 'videoUrlMetaBox', 'External Featured Video', 'fifu_show_advertisement', $post_type, 'side', 'low'
31
+ );
32
+ }
33
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  }
35
 
36
  function fifu_show_elements($post) {
45
 
46
  if ($url) {
47
  $show_url = $show_button = $show_sirv = 'display:none;';
48
+ $show_alt = $show_image = $show_link = '';
49
  } else {
50
+ $show_alt = $show_image = $show_link = 'display:none;';
51
  $show_url = $show_button = '';
52
  $show_sirv = ($is_sirv_active ? '' : 'display:none;');
53
  }
54
 
55
  include 'html/meta-box.html';
 
 
 
56
  }
57
 
58
  function fifu_show_advertisement($post) {
59
+ $margin = 'margin-top:10px;';
60
+ $width = 'width:100%;';
61
+ $height = 'height:266px;';
62
+ $align = 'text-align:left;';
63
 
64
+ include 'html/meta-box-advertisement.html';
65
  }
66
 
67
  function fifu_wc_show_elements($post) {
68
+ $margin = 'margin-top:1px;';
69
+ $width = 'width:70%;';
70
+ $height = 'height:266px;';
71
+ $align = 'text-align:left;';
72
+ $altWidth = 'width:86%;';
73
+
74
+ for ($i = 0; $i < 10; $i++) {
75
+ $url[$i] = get_post_meta($post->ID, 'fifu_image_url_' . $i, true);
76
+ $alt[$i] = get_post_meta($post->ID, 'fifu_image_alt_' . $i, true);
77
+
78
+ if ($url[$i]) {
79
+ $show_url[$i] = $show_button[$i] = 'display:none;';
80
+ $show_alt[$i] = $show_image[$i] = $show_link[$i] = '';
81
+ } else {
82
+ $show_alt[$i] = $show_image[$i] = $show_link[$i] = 'display:none;';
83
+ $show_url[$i] = $show_button[$i] = '';
84
+ }
85
+
86
+ include 'html/wc-meta-box.html';
87
+ }
88
+ }
89
+
90
+ function fifu_slider_show_elements($post) {
91
+ $margin = 'margin-top:1px;';
92
+ $width = 'width:70%;';
93
+ $height = 'height:266px;';
94
+ $align = 'text-align:left;';
95
+ $altWidth = 'width:86%;';
96
+
97
+ for ($i = 1; $i < 5; $i++)
98
+ include 'html/slider-meta-box.html';
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
+
112
+ if (isset($_POST['fifu_input_alt']))
113
+ update_post_meta($post_id, 'fifu_image_alt', wp_strip_all_tags($_POST['fifu_input_alt']));
114
+
115
+ if (get_post_type(get_the_ID()) == 'product') {
116
+ $count = 10;
117
+ for ($i = 0; $i < 10; $i++) {
118
+ if (isset($_POST['fifu_input_url_' . $i]) && isset($_POST['fifu_input_alt_' . $i])) {
119
+ if ($_POST['fifu_input_url_' . $i] != '' && $_POST['fifu_input_alt_' . $i] != '') {
120
+ update_post_meta($post_id, 'fifu_image_url_' . $i, esc_url($_POST['fifu_input_url_' . $i]));
121
+ update_post_meta($post_id, 'fifu_image_alt_' . $i, wp_strip_all_tags($_POST['fifu_input_alt_' . $i]));
122
+ if (get_option('fifu_attachment_id') && !get_post_thumbnail_id($post_id) && esc_url($_POST['fifu_input_url_' . $i]))
123
+ set_post_thumbnail($post_id, get_option('fifu_attachment_id'));
124
+ } else {
125
+ delete_post_meta($post_id, 'fifu_image_url_' . $i);
126
+ delete_post_meta($post_id, 'fifu_image_alt_' . $i);
127
+ $count--;
128
+ }
129
+ }
130
+ }
131
+ if ($count == 0 && (isset($_POST['fifu_input_url']) && !esc_url($_POST['fifu_input_url'])) && get_post_thumbnail_id($post_id) == get_option('fifu_attachment_id'))
132
+ delete_post_thumbnail($post_id);
133
+ }
134
+ else {
135
+ if ((isset($_POST['fifu_input_url']) && !esc_url($_POST['fifu_input_url'])) && get_post_thumbnail_id($post_id) == get_option('fifu_attachment_id'))
136
+ delete_post_thumbnail($post_id);
137
+ }
138
  }
139
 
featured-image-from-url.php CHANGED
@@ -3,7 +3,7 @@
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.4.4
7
  * Author: Marcel Jacques Machado
8
  * Author URI: http://marceljm.com/wordpress/featured-image-from-url-premium/
9
  */
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.4.5
7
  * Author: Marcel Jacques Machado
8
  * Author URI: http://marceljm.com/wordpress/featured-image-from-url-premium/
9
  */
readme.txt CHANGED
@@ -1,7 +1,7 @@
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
5
  Requires at least: 4.0
6
  Tested up to: 4.6.1
7
  Stable tag: 4.6.1
@@ -32,11 +32,19 @@ Features:
32
 
33
  **Premium Version:**
34
 
35
- All functionalities created for external images are now available for **external videos** (from YouTube), everything in one plugin. And you still can apply your **CSS style** or one of the **18 hover effects** to the images. Click <a href="http://marceljm.com/wordpress/featured-image-from-url-premium/" targe="_blank">here</a> to know more.
 
 
 
 
 
 
 
 
36
 
37
  *WooCommerce compatibility: 2.6.X. and later.*
38
 
39
- **<a href="http://fifu.marceljm.com/product-category/music/">Live Preview</a>**
40
 
41
  [youtube https://www.youtube.com/watch?v=LuynS-Y-fZs]
42
 
@@ -253,6 +261,9 @@ was removed. To finish, a Premium version is now been presented.
253
  = 1.4.4 =
254
  * Bug fixes.
255
 
 
 
 
256
  == Upgrade Notice ==
257
 
258
  = 1.0 =
@@ -342,3 +353,6 @@ was removed. To finish, a Premium version is now been presented.
342
 
343
  = 1.4.4 =
344
  * Bug fixes.
 
 
 
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
5
  Requires at least: 4.0
6
  Tested up to: 4.6.1
7
  Stable tag: 4.6.1
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
+
39
+ * use a **slider** of images as featured image;
40
+
41
+ * 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;
42
+
43
+ Click <a href="http://marceljm.com/wordpress/featured-image-from-url-premium/" targe="_blank">here</a> to know more.
44
 
45
  *WooCommerce compatibility: 2.6.X. and later.*
46
 
47
+ **<a href="http://fifu.marceljm.com/">Live Preview</a>**
48
 
49
  [youtube https://www.youtube.com/watch?v=LuynS-Y-fZs]
50
 
261
  = 1.4.4 =
262
  * Bug fixes.
263
 
264
+ = 1.4.5 =
265
+ * Add External Featured Image Slider.
266
+
267
  == Upgrade Notice ==
268
 
269
  = 1.0 =
353
 
354
  = 1.4.4 =
355
  * Bug fixes.
356
+
357
+ = 1.4.5 =
358
+ * Add External Featured Image Slider.