Featured Image From URL - Version 2.9.6

Version Description

  • Improvement: last posts and URLs added to support data to make the support faster; Improvement: integration with Sirv plugin; Bug fix: some layout issues on image keyword search.
Download this release

Release Info

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

Code changes from version 2.9.5 to 2.9.6

admin/category.php CHANGED
@@ -1,14 +1,9 @@
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');
1
  <?php
2
 
3
  function fifu_category_scripts() {
 
 
 
 
4
  wp_enqueue_style('fifu-category-css', plugins_url('/html/css/category.css', __FILE__));
5
 
6
+ fifu_register_meta_box_script();
 
7
  }
8
 
9
  add_action('product_cat_edit_form_fields', 'fifu_ctgr_edit_box');
admin/db.php CHANGED
@@ -252,6 +252,18 @@ class FifuDb {
252
  );
253
  }
254
 
 
 
 
 
 
 
 
 
 
 
 
 
255
  // get attachments without post
256
  function get_attachments_without_post($post_id) {
257
  $result = $this->wpdb->get_results("
@@ -959,3 +971,10 @@ function fifu_db_number_of_posts() {
959
  return $db->get_number_of_posts();
960
  }
961
 
 
 
 
 
 
 
 
252
  );
253
  }
254
 
255
+ // get last (images/videos/sliders/shortcodes)
256
+ function get_last($meta_key) {
257
+ return $this->wpdb->get_results("
258
+ SELECT p.guid, pm.meta_value
259
+ FROM " . $this->posts . " p
260
+ INNER JOIN " . $this->postmeta . " pm ON p.id = pm.post_id
261
+ WHERE pm.meta_key = '" . $meta_key . "'
262
+ ORDER BY p.post_date DESC
263
+ LIMIT 3"
264
+ );
265
+ }
266
+
267
  // get attachments without post
268
  function get_attachments_without_post($post_id) {
269
  $result = $this->wpdb->get_results("
971
  return $db->get_number_of_posts();
972
  }
973
 
974
+ /* get last urls */
975
+
976
+ function fifu_db_get_last($meta_key) {
977
+ $db = new FifuDb();
978
+ return $db->get_last($meta_key);
979
+ }
980
+
admin/html/category.html CHANGED
@@ -1,12 +1,14 @@
1
- <style><?php include 'css/category.css' ?></style>
2
-
3
  <tr>
4
- <th><b>Featured Image from URL</b></th>
 
 
 
5
  <td>
6
  <div class="box">
7
  <?php include 'meta-box.html' ?>
8
  </div>
9
  </td>
10
  </tr>
11
-
12
- <br/>
1
+ <br>
2
+ <br>
3
  <tr>
4
+ <td>
5
+ <span class="dashicons dashicons-camera" style="font-size:20px"></span>
6
+ Featured Image from URL
7
+ </td>
8
  <td>
9
  <div class="box">
10
  <?php include 'meta-box.html' ?>
11
  </div>
12
  </td>
13
  </tr>
14
+ <br>
 
admin/html/js/meta-box.js CHANGED
@@ -6,17 +6,26 @@ function removeImage() {
6
 
7
  jQuery("#fifu_input_alt").val("");
8
  jQuery("#fifu_input_url").val("");
 
9
 
10
  jQuery("#fifu_button").show();
11
  jQuery("#fifu_help").show();
 
 
 
12
  }
13
 
14
  function previewImage() {
15
  var $url = jQuery("#fifu_input_url").val();
16
 
 
 
 
 
 
17
  if (!$url.startsWith("http")) {
18
  jQuery("#fifu_keywords").val($url);
19
- jQuery('#fifu_button').block({message: '', css: {backgroundColor: 'none', border: 'none', color: 'white'}});
20
  var xhr = new XMLHttpRequest();
21
  xhr.onreadystatechange = function (e) {
22
  if (xhr.status == 200 && xhr.readyState == 4) {
@@ -24,13 +33,10 @@ function previewImage() {
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
  }
@@ -58,6 +64,9 @@ function runPreview($url) {
58
  jQuery("#fifu_input_alt").show();
59
  jQuery("#fifu_image").show();
60
  jQuery("#fifu_link").show();
 
 
 
61
  }
62
  }
63
 
6
 
7
  jQuery("#fifu_input_alt").val("");
8
  jQuery("#fifu_input_url").val("");
9
+ jQuery("#fifu_keywords").val("");
10
 
11
  jQuery("#fifu_button").show();
12
  jQuery("#fifu_help").show();
13
+
14
+ if (fifuMetaBoxVars.is_sirv_active)
15
+ jQuery("#fifu_sirv_button").show();
16
  }
17
 
18
  function previewImage() {
19
  var $url = jQuery("#fifu_input_url").val();
20
 
21
+ if (jQuery("#fifu_input_url").val() && jQuery("#fifu_keywords").val())
22
+ $message = 'Please wait some seconds...';
23
+ else
24
+ $message = '';
25
+
26
  if (!$url.startsWith("http")) {
27
  jQuery("#fifu_keywords").val($url);
28
+ jQuery('#fifu_button').parent().parent().block({message: $message, css: {backgroundColor: 'none', border: 'none', color: 'white'}});
29
  var xhr = new XMLHttpRequest();
30
  xhr.onreadystatechange = function (e) {
31
  if (xhr.status == 200 && xhr.readyState == 4) {
33
  $url = xhr.responseURL;
34
  jQuery("#fifu_input_url").val($url);
35
  runPreview($url);
 
 
36
  }
37
  setTimeout(function () {
38
  jQuery("#fifu_next").show();
39
+ jQuery('#fifu_button').parent().parent().unblock();
 
40
  }, 2000);
41
  }
42
  }
64
  jQuery("#fifu_input_alt").show();
65
  jQuery("#fifu_image").show();
66
  jQuery("#fifu_link").show();
67
+
68
+ if (fifuMetaBoxVars.is_sirv_active)
69
+ jQuery("#fifu_sirv_button").hide();
70
  }
71
  }
72
 
admin/html/menu.html CHANGED
@@ -2775,6 +2775,33 @@
2775
  From September 2019, always you guys report an issue between FIFU and another plugin or theme, the solution will be posted here.
2776
  </div>
2777
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2778
  <div class="box">
2779
  <table>
2780
  <tr>
2775
  From September 2019, always you guys report an issue between FIFU and another plugin or theme, the solution will be posted here.
2776
  </div>
2777
  </div>
2778
+ <div class="box">
2779
+ <table>
2780
+ <tr>
2781
+ <td style="border-bottom:none">2020-03-09</td>
2782
+ <td style="border-bottom:none"><h3> Google Chrome | Firefox</h3></td>
2783
+ <td style="border-bottom:none">browsers</td>
2784
+ </tr>
2785
+ </table>
2786
+ <div class="greybox" style="position: relative; top: -10px">
2787
+ Avoiding "Connection not secure" message:<br>
2788
+ 1) use only https image URLs.<br>
2789
+ </div>
2790
+ </div>
2791
+ <div class="box">
2792
+ <table>
2793
+ <tr>
2794
+ <td style="border-bottom:none">2020-03-04</td>
2795
+ <td style="border-bottom:none"><h3> Essential Grid</h3></td>
2796
+ <td style="border-bottom:none">plugin</td>
2797
+ </tr>
2798
+ </table>
2799
+ <div class="greybox" style="position: relative; top: -10px">
2800
+ Showing external videos:<br>
2801
+ 1) access "Ess. Grid > Editor / Preview";<br>
2802
+ 2) for each video access "Edit Post Meta > Choose Specific Skin", select "YoutubeStream" or "VimeoStream" and click on "Save Post Meta".<br>
2803
+ </div>
2804
+ </div>
2805
  <div class="box">
2806
  <table>
2807
  <tr>
admin/html/meta-box.html CHANGED
@@ -35,14 +35,14 @@
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>
@@ -89,4 +89,13 @@ It's possible to define a size for the auto-generated images:
89
  onClick="previewImage();"
90
  style="<?php echo $align, $margin, $show_button ?>" >Preview</a>
91
 
 
 
 
 
 
 
 
 
 
92
  </div>
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>
89
  onClick="previewImage();"
90
  style="<?php echo $align, $margin, $show_button ?>" >Preview</a>
91
 
92
+ <div id="fifu_sirv_button" style="<?php echo 'float:left;padding-right:8px;' . $align, $margin, fifu_is_sirv_active() ? $show_button : 'display:none' ?>">
93
+ <div class="sirv-modal"></div>
94
+ <a id="sirv-add-featured-image"
95
+ data-input-anchor="#fifu_input_url"
96
+ href="#"
97
+ class="button sirv-add-image-modal-click"
98
+ title="Add image from Sirv">Choose Sirv image</a>
99
+ </div>
100
+
101
  </div>
admin/html/support-data.html CHANGED
@@ -6,12 +6,12 @@
6
 
7
  <div id="tabs-top" style="float:left">
8
  <textarea id="bar" style="width:1020px;height:800px;resize:none;background-color:white;" readonly>
9
- Version:<?php echo fifu_version() ?>;
 
10
  Site:<?php echo get_home_url() ?>;
11
  Theme:<?php echo wp_get_theme() ?><?php echo fifu_woo_theme() ? ' (WooCommerce)' : '' ?>;
12
  PHP:<?php echo phpversion() ?>;
13
  WooCommerce:<?php echo class_exists('WooCommerce') ? WC()->version : '' ?>;
14
- WordPress:<?php echo get_bloginfo('version') ?>;
15
  Pages:<?php echo wp_count_posts('page')->publish ?>;
16
  Posts:<?php echo wp_count_posts('post')->publish ?>;
17
  Products:<?php echo class_exists('WooCommerce') ? wp_count_posts('product')->publish : null ?>;
@@ -69,6 +69,10 @@ fifu_spinner_db:<?php echo $max_db ?>;
69
  fifu_spinner_nth:<?php echo $nth_image ?>;
70
  fifu_wc_lbox:<?php echo $enable_wc_lbox ?>;
71
  fifu_wc_zoom:<?php echo $enable_wc_zoom ?>;
 
 
 
 
72
  REST Routes:
73
  - <?php echo get_rest_url() ?>:PHP;
74
  </textarea>
6
 
7
  <div id="tabs-top" style="float:left">
8
  <textarea id="bar" style="width:1020px;height:800px;resize:none;background-color:white;" readonly>
9
+ <?php echo fifu_version() ?>;
10
+ WordPress:<?php bloginfo('version') ?>;
11
  Site:<?php echo get_home_url() ?>;
12
  Theme:<?php echo wp_get_theme() ?><?php echo fifu_woo_theme() ? ' (WooCommerce)' : '' ?>;
13
  PHP:<?php echo phpversion() ?>;
14
  WooCommerce:<?php echo class_exists('WooCommerce') ? WC()->version : '' ?>;
 
15
  Pages:<?php echo wp_count_posts('page')->publish ?>;
16
  Posts:<?php echo wp_count_posts('post')->publish ?>;
17
  Products:<?php echo class_exists('WooCommerce') ? wp_count_posts('product')->publish : null ?>;
69
  fifu_spinner_nth:<?php echo $nth_image ?>;
70
  fifu_wc_lbox:<?php echo $enable_wc_lbox ?>;
71
  fifu_wc_zoom:<?php echo $enable_wc_zoom ?>;
72
+ Image:<?php echo fifu_get_last('fifu_image_url') ?>;
73
+ Video:<?php echo fifu_get_last('fifu_video_url') ?>;
74
+ Slider:<?php echo fifu_get_last('fifu_slider_image_url_0') ?>;
75
+ Shortcode:<?php echo fifu_get_last('fifu_shortcode') ?>;
76
  REST Routes:
77
  - <?php echo get_rest_url() ?>:PHP;
78
  </textarea>
admin/menu.php CHANGED
@@ -289,6 +289,15 @@ function fifu_version() {
289
  return $plugin_data ? $plugin_data['Name'] . ':' . $plugin_data['Version'] : '';
290
  }
291
 
 
 
 
 
 
 
 
 
 
292
  function fifu_get_plugins_list() {
293
  $list = '';
294
  foreach (get_plugins() as $key => $domain) {
289
  return $plugin_data ? $plugin_data['Name'] . ':' . $plugin_data['Version'] : '';
290
  }
291
 
292
+ function fifu_get_last($meta_key) {
293
+ $list = '';
294
+ foreach (fifu_db_get_last($meta_key) as $key => $row) {
295
+ $aux = $row->meta_value . ' &#10; |__ ' . $row->guid;
296
+ $list .= '&#10; | ' . $aux;
297
+ }
298
+ return $list;
299
+ }
300
+
301
  function fifu_get_plugins_list() {
302
  $list = '';
303
  foreach (get_plugins() as $key => $domain) {
admin/meta-box.php CHANGED
@@ -20,18 +20,29 @@ 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
  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');
29
 
30
  function fifu_add_css() {
31
- wp_enqueue_script('jquery-block-ui', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.blockUI/2.70/jquery.blockUI.min.js');
32
- wp_enqueue_style('fancy-box-css', 'https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.css');
33
- wp_enqueue_script('fancy-box-js', 'https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js');
34
-
35
  wp_register_style('featured-image-from-url', plugins_url('/html/css/editor.css', __FILE__));
36
  wp_enqueue_style('featured-image-from-url');
37
  }
@@ -234,6 +245,12 @@ function fifu_is_aliplugin_active() {
234
  return is_plugin_active('aliplugin/aliplugin.php');
235
  }
236
 
 
 
 
 
 
 
237
  /* woocommerce variation elements */
238
 
239
  add_action('woocommerce_product_after_variable_attributes', 'fifu_variation_settings_fields', 10, 3);
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
+ fifu_register_meta_box_script();
24
+ }
25
+
26
+ function fifu_register_meta_box_script() {
27
+ wp_enqueue_script('jquery-block-ui', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.blockUI/2.70/jquery.blockUI.min.js');
28
+ wp_enqueue_style('fancy-box-css', 'https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.css');
29
+ wp_enqueue_script('fancy-box-js', 'https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js');
30
 
31
  wp_enqueue_script('fifu-meta-box-js', plugins_url('/html/js/meta-box.js', __FILE__));
32
  wp_enqueue_script('fifu-convert-url-js', plugins_url('/html/js/convert-url.js', __FILE__));
33
+
34
+ if (fifu_is_sirv_active())
35
+ wp_enqueue_script('fifu-sirv-js', 'https://scripts.sirv.com/sirv.js');
36
+
37
+ wp_localize_script('fifu-meta-box-js', 'fifuMetaBoxVars', [
38
+ 'get_the_ID' => get_the_ID(),
39
+ 'is_sirv_active' => fifu_is_sirv_active(),
40
+ ]);
41
  }
42
 
43
  add_action('add_meta_boxes', 'fifu_add_css');
44
 
45
  function fifu_add_css() {
 
 
 
 
46
  wp_register_style('featured-image-from-url', plugins_url('/html/css/editor.css', __FILE__));
47
  wp_enqueue_style('featured-image-from-url');
48
  }
245
  return is_plugin_active('aliplugin/aliplugin.php');
246
  }
247
 
248
+ /* plugin: sirv */
249
+
250
+ function fifu_is_sirv_active() {
251
+ return is_plugin_active('sirv/sirv.php');
252
+ }
253
+
254
  /* woocommerce variation elements */
255
 
256
  add_action('woocommerce_product_after_variable_attributes', 'fifu_variation_settings_fields', 10, 3);
featured-image-from-url.php CHANGED
@@ -3,8 +3,8 @@
3
  /*
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
  */
3
  /*
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: 2.9.6
8
  * Author: Marcel Jacques Machado
9
  * Author URI: https://www.linkedin.com/in/marceljm/
10
  */
readme.txt CHANGED
@@ -1,14 +1,14 @@
1
  === Plugin Name ===
2
  Contributors: marceljm
3
  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.5
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
 
@@ -162,6 +162,9 @@ Features:
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
 
@@ -717,6 +720,9 @@ was removed. To finish, a Premium version is now been presented.
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
 
1
  === Plugin Name ===
2
  Contributors: marceljm
3
  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, 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.6
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 a post or WooCommerce product. Includes Image Search, Video, Social Tags, SEO, Lazy Load, Gallery, Automation etc.
12
 
13
  == Description ==
14
 
162
 
163
  == Changelog ==
164
 
165
+ = 2.9.6 =
166
+ * Improvement: last posts and URLs added to support data to make the support faster; Improvement: integration with Sirv plugin; Bug fix: some layout issues on image keyword search.
167
+
168
  = 2.9.5 =
169
  * Improvement: next button added to random featured images; Bug fix: style issues on Arabic language sites.
170
 
720
 
721
  == Upgrade Notice ==
722
 
723
+ = 2.9.6 =
724
+ * Improvement: last posts and URLs added to support data to make the support faster; Improvement: integration with Sirv plugin; Bug fix: some layout issues on image keyword search.
725
+
726
  = 2.9.5 =
727
  * Improvement: next button added to random featured images; Bug fix: style issues on Arabic language sites.
728