Featured Image From URL - Version 2.9.5

Version Description

  • Improvement: next button added to random featured images; Bug fix: style issues on Arabic language sites.
Download this release

Release Info

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

Code changes from version 2.9.4 to 2.9.5

admin/category.php CHANGED
@@ -1,13 +1,22 @@
1
  <?php
2
 
3
- wp_enqueue_script('jquery-block-ui', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.blockUI/2.70/jquery.blockUI.min.js');
4
- wp_enqueue_style('fancy-box-css', 'https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.css');
5
- wp_enqueue_script('fancy-box-js', 'https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js');
 
 
 
 
 
 
 
6
 
7
  add_action('product_cat_edit_form_fields', 'fifu_ctgr_edit_box');
8
  add_action('product_cat_add_form_fields', 'fifu_ctgr_add_box');
9
 
10
  function fifu_ctgr_edit_box($term) {
 
 
11
  $margin = 'margin-top:10px;';
12
  $width = 'width:100%;';
13
  $height = 'height:200px;';
@@ -32,6 +41,8 @@ function fifu_ctgr_edit_box($term) {
32
  }
33
 
34
  function fifu_ctgr_add_box() {
 
 
35
  $margin = 'margin-top:10px;';
36
  $width = 'width:100%;';
37
  $height = 'height:200px;';
1
  <?php
2
 
3
+ function fifu_category_scripts() {
4
+ wp_enqueue_script('jquery-block-ui', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.blockUI/2.70/jquery.blockUI.min.js');
5
+ wp_enqueue_style('fancy-box-css', 'https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.css');
6
+ wp_enqueue_script('fancy-box-js', 'https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js');
7
+
8
+ wp_enqueue_style('fifu-category-css', plugins_url('/html/css/category.css', __FILE__));
9
+
10
+ wp_enqueue_script('fifu-meta-box-js', plugins_url('/html/js/meta-box.js', __FILE__));
11
+ wp_enqueue_script('fifu-convert-url-js', plugins_url('/html/js/convert-url.js', __FILE__));
12
+ }
13
 
14
  add_action('product_cat_edit_form_fields', 'fifu_ctgr_edit_box');
15
  add_action('product_cat_add_form_fields', 'fifu_ctgr_add_box');
16
 
17
  function fifu_ctgr_edit_box($term) {
18
+ fifu_category_scripts();
19
+
20
  $margin = 'margin-top:10px;';
21
  $width = 'width:100%;';
22
  $height = 'height:200px;';
41
  }
42
 
43
  function fifu_ctgr_add_box() {
44
+ fifu_category_scripts();
45
+
46
  $margin = 'margin-top:10px;';
47
  $width = 'width:100%;';
48
  $height = 'height:200px;';
admin/html/css/category.css CHANGED
@@ -17,3 +17,7 @@
17
  font-style: italic;
18
  color: #999;
19
  }
 
 
 
 
17
  font-style: italic;
18
  color: #999;
19
  }
20
+
21
+ #fifu_table_url tr td{
22
+ padding: 0;
23
+ }
admin/html/js/meta-box.js CHANGED
@@ -24,20 +24,20 @@ function previewImage() {
24
  $url = xhr.responseURL;
25
  jQuery("#fifu_input_url").val($url);
26
  runPreview($url);
27
- jQuery("#fifu_next").hide();
28
  if (jQuery("#fifu_input_url").val() && jQuery("#fifu_keywords").val())
29
- jQuery('#fifu_next').parent().parent().block({message: 'Please wait some seconds...', css: {backgroundColor: 'none', border: 'none', color: 'white'}});
30
  }
31
  setTimeout(function () {
32
- if (jQuery("#fifu_input_url").val() && jQuery("#fifu_keywords").val())
33
- jQuery("#fifu_next").show();
34
- jQuery('#fifu_next').parent().parent().unblock();
35
  jQuery('#fifu_button').unblock();
36
  }, 2000);
37
  }
38
  }
39
  xhr.open("GET", 'https://source.unsplash.com/featured/?' + $url, true);
40
  xhr.send();
 
 
41
  } else {
42
  jQuery("#fifu_next").hide();
43
  runPreview($url);
24
  $url = xhr.responseURL;
25
  jQuery("#fifu_input_url").val($url);
26
  runPreview($url);
 
27
  if (jQuery("#fifu_input_url").val() && jQuery("#fifu_keywords").val())
28
+ jQuery('#fifu_meta_box').parent().block({message: 'Please wait some seconds...', css: {backgroundColor: 'none', border: 'none', color: 'white'}});
29
  }
30
  setTimeout(function () {
31
+ jQuery("#fifu_next").show();
32
+ jQuery('#fifu_meta_box').parent().unblock();
 
33
  jQuery('#fifu_button').unblock();
34
  }, 2000);
35
  }
36
  }
37
  xhr.open("GET", 'https://source.unsplash.com/featured/?' + $url, true);
38
  xhr.send();
39
+ if (!$url)
40
+ jQuery("#fifu_keywords").val(' ');
41
  } else {
42
  jQuery("#fifu_next").hide();
43
  runPreview($url);
admin/html/meta-box.html CHANGED
@@ -1,82 +1,92 @@
1
- <script><?php include 'js/meta-box.js' ?></script>
2
- <script><?php include 'js/convert-url.js' ?></script>
3
 
4
- <!-- show alt field, image and link if URL was already provided -->
5
 
6
- <div style="<?php echo $show_ignore ?>">
7
- <input type="checkbox" name="fifu_ignore_auto_set" id="fifu_ignore_auto_set">
8
- <label for="fifu_ignore_auto_set">ignore URL from Post Content</label>
9
- <br>
10
- </div>
11
 
12
- <input id="fifu_input_alt"
13
- type="text"
14
- name="fifu_input_alt"
15
- placeholder="alt/title attribute (optional)"
16
- value="<?php echo $alt; ?>"
17
- style="<?php echo $width, $margin, $show_alt ?>" />
18
 
19
- <div id="fifu_image"
20
- style="<?php echo $height, $margin, $show_image ?>
21
- background:url('<?php echo $url; ?>') no-repeat center center;
22
- background-size:cover;
23
- cursor:zoom-in" >
24
- </div>
25
 
26
- <input id="fifu_input_url"
27
- type="text"
28
- name="fifu_input_url"
29
- placeholder="Image URL or Keywords"
30
- value="<?php echo $url; ?>"
31
- style="<?php echo $width, $margin ?>" />
 
 
 
 
 
 
 
 
 
 
32
 
33
- <center>
34
- <a id="fifu_link"
35
- href="#"
36
- onClick="removeImage();"
37
- style="<?php echo $show_link ?>" >remove external featured image</a>
38
- <span
39
- id="fifu_next"
40
- class="dashicons dashicons-arrow-right-alt"
41
- style="font-size:19px;position:relative;background-color:transparent;cursor:pointer;display:none"
42
- title="Next">
43
- </span>
44
- </center>
45
 
46
- <input
47
- type="hidden"
48
- id="fifu_input_image_width"
49
- name="fifu_input_image_width"
50
- value="" >
51
 
52
- <input
53
- type="hidden"
54
- id="fifu_input_image_height"
55
- name="fifu_input_image_height"
56
- value="" >
 
 
 
 
57
 
58
- <input
59
- type="hidden"
60
- id="fifu_keywords"
61
- name="fifu_keywords"
62
- value="" >
 
63
 
64
- <!-- show preview button if URL was not provided yet -->
 
 
 
 
65
 
66
- <a id="fifu_button"
67
- class="button"
68
- onClick="previewImage();"
69
- style="<?php echo $align, $margin, $show_button ?>" >Preview</a>
 
70
 
71
- <span id="fifu_help"
72
- title="Example of
73
- - image URL: http...
74
- - keywords: sea,sun
 
75
 
76
- To get a random image leave this field empty.
77
 
78
- It's possible to define a size for the auto-generated images:
79
- - Settings > Featured Image > Unsplash Image Sizes"
80
- class="dashicons dashicons-editor-help"
81
- style="<?php echo $show_button . ';float:right' ?>">
82
- </span>
 
1
+ <div id="fifu_meta_box">
 
2
 
3
+ <!-- show alt field, image and link if URL was already provided -->
4
 
5
+ <div style="<?php echo $show_ignore ?>">
6
+ <input type="checkbox" name="fifu_ignore_auto_set" id="fifu_ignore_auto_set">
7
+ <label for="fifu_ignore_auto_set">ignore URL from Post Content</label>
8
+ <br>
9
+ </div>
10
 
11
+ <input id="fifu_input_alt"
12
+ type="text"
13
+ name="fifu_input_alt"
14
+ placeholder="alt/title attribute (optional)"
15
+ value="<?php echo $alt; ?>"
16
+ style="<?php echo $width, $margin, $show_alt ?>" />
17
 
18
+ <div id="fifu_image"
19
+ style="<?php echo $height, $margin, $show_image ?>
20
+ background:url('<?php echo $url; ?>') no-repeat center center;
21
+ background-size:cover;
22
+ cursor:zoom-in" >
23
+ </div>
24
 
25
+ <table id="fifu_table_url" style="width:100%;position:relative;left:-5px">
26
+ <tr>
27
+ <td style="width:100%">
28
+ <input id="fifu_input_url"
29
+ type="text"
30
+ name="fifu_input_url"
31
+ placeholder="Image URL or Keywords"
32
+ value="<?php echo $url; ?>"
33
+ style="<?php echo $width, $margin ?>" />
34
+ </td>
35
+ <td>
36
+ <span id="fifu_help"
37
+ title=
38
+ "Example of
39
+ - image URL: http...
40
+ - keywords: sea,sun
41
 
42
+ To get a random image leave this field empty.
 
 
 
 
 
 
 
 
 
 
 
43
 
44
+ It's possible to define a size for the auto-generated images:
45
+ - Settings > Featured Image > Unsplash Image Sizes"
46
+ class="dashicons dashicons-editor-help"
47
+ style="<?php echo $show_button . ';font-size:25px' ?>">
48
+ </span>
49
 
50
+ <span
51
+ id="fifu_next"
52
+ title="Next"
53
+ class="dashicons dashicons-arrow-right-alt"
54
+ style="font-size:25px;cursor:pointer;display:none">
55
+ </span>
56
+ </td>
57
+ </tr>
58
+ </table>
59
 
60
+ <center>
61
+ <a id="fifu_link"
62
+ href="#"
63
+ onClick="removeImage();"
64
+ style="<?php echo $show_link ?>" >remove external featured image</a>
65
+ </center>
66
 
67
+ <input
68
+ type="hidden"
69
+ id="fifu_input_image_width"
70
+ name="fifu_input_image_width"
71
+ value="" >
72
 
73
+ <input
74
+ type="hidden"
75
+ id="fifu_input_image_height"
76
+ name="fifu_input_image_height"
77
+ value="" >
78
 
79
+ <input
80
+ type="hidden"
81
+ id="fifu_keywords"
82
+ name="fifu_keywords"
83
+ value="" >
84
 
85
+ <!-- show preview button if URL was not provided yet -->
86
 
87
+ <a id="fifu_button"
88
+ class="button"
89
+ onClick="previewImage();"
90
+ style="<?php echo $align, $margin, $show_button ?>" >Preview</a>
91
+
92
+ </div>
admin/meta-box.php CHANGED
@@ -20,6 +20,9 @@ function fifu_insert_meta_box() {
20
  add_meta_box('shortCodeMetaBox', '<span class="dashicons dashicons-editor-code" style="font-size:20px"></span> Featured Shortcode', 'fifu_shortcode_show_elements', $post_type, 'side', 'low');
21
  }
22
  }
 
 
 
23
  }
24
 
25
  add_action('add_meta_boxes', 'fifu_add_css');
20
  add_meta_box('shortCodeMetaBox', '<span class="dashicons dashicons-editor-code" style="font-size:20px"></span> Featured Shortcode', 'fifu_shortcode_show_elements', $post_type, 'side', 'low');
21
  }
22
  }
23
+
24
+ wp_enqueue_script('fifu-meta-box-js', plugins_url('/html/js/meta-box.js', __FILE__));
25
+ wp_enqueue_script('fifu-convert-url-js', plugins_url('/html/js/convert-url.js', __FILE__));
26
  }
27
 
28
  add_action('add_meta_boxes', 'fifu_add_css');
featured-image-from-url.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Featured Image from URL
5
  * Plugin URI: https://fifu.app/
6
  * Description: Use an external image as Featured Image of your post/page/custom post type (WooCommerce). Includes Auto Set (External Post), Product Gallery, Social Tags and more.
7
- * Version: 2.9.4
8
  * Author: Marcel Jacques Machado
9
  * Author URI: https://www.linkedin.com/in/marceljm/
10
  */
4
  * Plugin Name: Featured Image from URL
5
  * Plugin URI: https://fifu.app/
6
  * Description: Use an external image as Featured Image of your post/page/custom post type (WooCommerce). Includes Auto Set (External Post), Product Gallery, Social Tags and more.
7
+ * Version: 2.9.5
8
  * Author: Marcel Jacques Machado
9
  * Author URI: https://www.linkedin.com/in/marceljm/
10
  */
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://donorbox.org/fifu
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, vimeo, 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, auto post thumbnail, link, uri, affiliate, wp, rest, api, wp rest api, lazy, load, google, drive, instagram, validation, jetpack, visual composer, play, pause, crop, resize, zoom, enable, disable, default, automatic, auto set, cloudinary, schedule, event, cron, seo, variable, tumblr, variation, product variation, shortcode, facebook, instagram, imgur, 9gag, wcfm, add-on, scraper, 特色圖片, 图片, 网址, 外部, unsplash, keyword, random, acf
5
  Requires at least: 4.0
6
  Tested up to: 5.4
7
- Stable tag: 2.9.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -162,6 +162,9 @@ Features:
162
 
163
  == Changelog ==
164
 
 
 
 
165
  = 2.9.4 =
166
  * Bug fix: 2.9.3 new features were not working for WooCommerce product categories.
167
 
@@ -714,6 +717,9 @@ was removed. To finish, a Premium version is now been presented.
714
 
715
  == Upgrade Notice ==
716
 
 
 
 
717
  = 2.9.4 =
718
  * Bug fix: 2.9.3 new features were not working for WooCommerce product categories.
719
 
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, vimeo, 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, auto post thumbnail, link, uri, affiliate, wp, rest, api, wp rest api, lazy, load, google, drive, instagram, validation, jetpack, visual composer, play, pause, crop, resize, zoom, enable, disable, default, automatic, auto set, cloudinary, schedule, event, cron, seo, variable, tumblr, variation, product variation, shortcode, facebook, instagram, imgur, 9gag, wcfm, add-on, scraper, 特色圖片, 图片, 网址, 外部, unsplash, keyword, random, acf
5
  Requires at least: 4.0
6
  Tested up to: 5.4
7
+ Stable tag: 2.9.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
162
 
163
  == Changelog ==
164
 
165
+ = 2.9.5 =
166
+ * Improvement: next button added to random featured images; Bug fix: style issues on Arabic language sites.
167
+
168
  = 2.9.4 =
169
  * Bug fix: 2.9.3 new features were not working for WooCommerce product categories.
170
 
717
 
718
  == Upgrade Notice ==
719
 
720
+ = 2.9.5 =
721
+ * Improvement: next button added to random featured images; Bug fix: style issues on Arabic language sites.
722
+
723
  = 2.9.4 =
724
  * Bug fix: 2.9.3 new features were not working for WooCommerce product categories.
725