Featured Image From URL - Version 4.1.4

Version Description

  • Enhancement: Status > Copy to Clipboard; fix: conflict with Web Stories plugin; deprecated: Product Gallery > Number of Fields.
Download this release

Release Info

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

Code changes from version 4.1.3 to 4.1.4

admin/db.php CHANGED
@@ -265,13 +265,13 @@ class FifuDb {
265
  FROM (
266
  SELECT count(post_id) AS id
267
  FROM " . $this->postmeta . " pm
268
- WHERE pm.meta_key LIKE 'fifu%'
269
  AND pm.meta_key LIKE '%url%'
270
  AND pm.meta_key NOT LIKE '%list%'
271
  UNION
272
  SELECT count(term_id) AS id
273
  FROM " . $this->termmeta . " tm
274
- WHERE tm.meta_key LIKE 'fifu%'
275
  AND tm.meta_key LIKE '%url%'
276
  ) x"
277
  );
@@ -284,13 +284,13 @@ class FifuDb {
284
  FROM (
285
  SELECT COUNT(1) AS amount
286
  FROM " . $this->postmeta . " pm
287
- WHERE pm.meta_key LIKE 'fifu%'
288
  AND pm.meta_key LIKE '%url%'
289
  AND pm.meta_key NOT LIKE '%list%'
290
  UNION
291
  SELECT COUNT(1) AS amount
292
  FROM " . $this->termmeta . " tm
293
- WHERE tm.meta_key LIKE 'fifu%'
294
  AND tm.meta_key LIKE '%url%'
295
  UNION
296
  SELECT -COUNT(1) AS amount
265
  FROM (
266
  SELECT count(post_id) AS id
267
  FROM " . $this->postmeta . " pm
268
+ WHERE pm.meta_key LIKE 'fifu_%'
269
  AND pm.meta_key LIKE '%url%'
270
  AND pm.meta_key NOT LIKE '%list%'
271
  UNION
272
  SELECT count(term_id) AS id
273
  FROM " . $this->termmeta . " tm
274
+ WHERE tm.meta_key LIKE 'fifu_%'
275
  AND tm.meta_key LIKE '%url%'
276
  ) x"
277
  );
284
  FROM (
285
  SELECT COUNT(1) AS amount
286
  FROM " . $this->postmeta . " pm
287
+ WHERE pm.meta_key LIKE 'fifu_%'
288
  AND pm.meta_key LIKE '%url%'
289
  AND pm.meta_key NOT LIKE '%list%'
290
  UNION
291
  SELECT COUNT(1) AS amount
292
  FROM " . $this->termmeta . " tm
293
+ WHERE tm.meta_key LIKE 'fifu_%'
294
  AND tm.meta_key LIKE '%url%'
295
  UNION
296
  SELECT -COUNT(1) AS amount
admin/html/js/menu.js CHANGED
@@ -32,8 +32,6 @@ jQuery(function () {
32
  jQuery("#fifu_input_spinner_cron_metadata").spinner({min: 1, step: 1});
33
  jQuery("#fifu_input_spinner_db").spinner({min: 100, step: 100});
34
  jQuery("#fifu_input_spinner_nth").spinner({min: 1});
35
- jQuery("#fifu_input_spinner_image").spinner({min: 0});
36
- jQuery("#fifu_input_spinner_video").spinner({min: 0});
37
  jQuery("#fifu_input_slider_speed").spinner({min: 0});
38
  jQuery("#fifu_input_slider_pause").spinner({min: 0});
39
  jQuery("#fifu_input_auto_set_width").spinner({min: 0});
32
  jQuery("#fifu_input_spinner_cron_metadata").spinner({min: 1, step: 1});
33
  jQuery("#fifu_input_spinner_db").spinner({min: 100, step: 100});
34
  jQuery("#fifu_input_spinner_nth").spinner({min: 1});
 
 
35
  jQuery("#fifu_input_slider_speed").spinner({min: 0});
36
  jQuery("#fifu_input_slider_pause").spinner({min: 0});
37
  jQuery("#fifu_input_auto_set_width").spinner({min: 0});
admin/html/menu.html CHANGED
@@ -2096,40 +2096,6 @@
2096
  on, off
2097
  </th>
2098
  </tr>
2099
- <tr class="color">
2100
- <th>
2101
- <?php $fifu['tab']['woo']() ?>
2102
- </th>
2103
- <th>
2104
- <?php $fifu['title']['fields']() ?>
2105
- </th>
2106
- <th>
2107
- <?php $fifu['fields']['image']() ?>
2108
- </th>
2109
- <th>
2110
- wp fifu woo --images &lt;integer&gt;
2111
- </th>
2112
- <th>
2113
- 3, 4, 5...
2114
- </th>
2115
- </tr>
2116
- <tr class="color">
2117
- <th>
2118
- <?php $fifu['tab']['woo']() ?>
2119
- </th>
2120
- <th>
2121
- <?php $fifu['title']['fields']() ?>
2122
- </th>
2123
- <th>
2124
- <?php $fifu['fields']['video']() ?>
2125
- </th>
2126
- <th>
2127
- wp fifu woo --videos &lt;integer&gt;
2128
- </th>
2129
- <th>
2130
- 3, 4, 5...
2131
- </th>
2132
- </tr>
2133
  <tr class="color">
2134
  <th>
2135
  <?php $fifu['tab']['woo']() ?>
@@ -5628,39 +5594,6 @@
5628
  </div>
5629
  </div>
5630
 
5631
- <div class="box">
5632
- <div class="fifu-pro"><a class="fifu-pro-link" href="https://fifu.app/" target="_blank" title="Unlock all PRO features"><span class="dashicons dashicons-lock fifu-pro-icon"></span></a></div>
5633
- <h2><?php $fifu['title']['fields']() ?></h2>
5634
- <div class="greybox" id="grad2">
5635
- <?php $fifu['fields']['desc']() ?><br><br>
5636
- <table style="text-align:left">
5637
- <tr>
5638
- <th>
5639
- <label for="fifu_input_spinner_image"
5640
- placehold><?php $fifu['fields']['image']() ?></label>
5641
- </th>
5642
- <th>
5643
- <input id="fifu_input_spinner_image"
5644
- name="fifu_input_spinner_image"
5645
- size="4">
5646
- </th>
5647
- </tr>
5648
- <tr>
5649
- <th>
5650
- <label for="fifu_input_spinner_video"><?php $fifu['fields']['video']() ?></label>
5651
- </th>
5652
- <th>
5653
- <input id="fifu_input_spinner_video"
5654
- name="fifu_input_spinner_video"
5655
- size="4">
5656
- </th>
5657
- </tr>
5658
- </table>
5659
- </div>
5660
- <br>
5661
- <input type="submit" value="<?php $fifu['button']['submit']() ?>" disabled>
5662
- </div>
5663
-
5664
  <a name="category"></a>
5665
  <div class="box">
5666
  <div class="fifu-pro"><a class="fifu-pro-link" href="https://fifu.app/" target="_blank" title="Unlock all PRO features"><span class="dashicons dashicons-lock fifu-pro-icon"></span></a></div>
2096
  on, off
2097
  </th>
2098
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2099
  <tr class="color">
2100
  <th>
2101
  <?php $fifu['tab']['woo']() ?>
5594
  </div>
5595
  </div>
5596
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5597
  <a name="category"></a>
5598
  <div class="box">
5599
  <div class="fifu-pro"><a class="fifu-pro-link" href="https://fifu.app/" target="_blank" title="Unlock all PRO features"><span class="dashicons dashicons-lock fifu-pro-icon"></span></a></div>
admin/html/support-data.html CHANGED
@@ -2,6 +2,7 @@
2
 
3
  <div class="header-box">
4
  <h1 style="color:white;padding-left:20px"><span class="dashicons dashicons-info" style="font-size:30px"></span><span style="padding-left:20px"><?php _e('Status') ?></span></h1>
 
5
  </div>
6
 
7
  <div id="tabs-top" style="float:left">
@@ -88,4 +89,10 @@ REST routes:
88
  jQuery('.notice').remove();
89
  jQuery('[id^=wp-admin-bar-_]').remove();
90
  }
 
 
 
 
 
 
91
  </script>
2
 
3
  <div class="header-box">
4
  <h1 style="color:white;padding-left:20px"><span class="dashicons dashicons-info" style="font-size:30px"></span><span style="padding-left:20px"><?php _e('Status') ?></span></h1>
5
+ <button id="fifu-clipboard" style="width:150px;float:right;height:50%;position:relative;top:12px;left:-10px">Copy to clipboard</button>
6
  </div>
7
 
8
  <div id="tabs-top" style="float:left">
89
  jQuery('.notice').remove();
90
  jQuery('[id^=wp-admin-bar-_]').remove();
91
  }
92
+
93
+ jQuery('#fifu-clipboard').on('click', function() {
94
+ jQuery("#bar").select();
95
+ navigator.clipboard.writeText(jQuery("#bar").val());
96
+ jQuery('#fifu-clipboard').text('Copied');
97
+ });
98
  </script>
admin/meta-box.php CHANGED
@@ -3,11 +3,8 @@
3
  add_action('add_meta_boxes', 'fifu_insert_meta_box');
4
 
5
  function fifu_insert_meta_box() {
6
- if (function_exists('get_current_screen')) {
7
- $screen = get_current_screen();
8
- if (isset($screen->post_type) && strpos($screen->post_type, 'web-story') !== false)
9
- return;
10
- }
11
 
12
  $fifu = fifu_get_strings_meta_box_php();
13
  $post_types = fifu_get_post_types();
3
  add_action('add_meta_boxes', 'fifu_insert_meta_box');
4
 
5
  function fifu_insert_meta_box() {
6
+ if (fifu_is_web_story())
7
+ return;
 
 
 
8
 
9
  $fifu = fifu_get_strings_meta_box_php();
10
  $post_types = fifu_get_post_types();
admin/strings.php CHANGED
@@ -213,9 +213,6 @@ function fifu_get_strings_settings() {
213
  $fifu['title']['column'] = function () {
214
  _e("Quick Edit Column", FIFU_SLUG);
215
  };
216
- $fifu['title']['fields'] = function () {
217
- _e("Product Gallery", FIFU_SLUG);
218
- };
219
  $fifu['title']['reset'] = function () {
220
  _e("Reset Settings", FIFU_SLUG);
221
  };
@@ -551,17 +548,6 @@ function fifu_get_strings_settings() {
551
  _e("e.g. (args)", FIFU_SLUG);
552
  };
553
 
554
- // fields
555
- $fifu['fields']['desc'] = function () {
556
- _e("Choose the number of fields in the product editor.", FIFU_SLUG);
557
- };
558
- $fifu['fields']['image'] = function () {
559
- _e("Image gallery", FIFU_SLUG);
560
- };
561
- $fifu['fields']['video'] = function () {
562
- _e("Video gallery", FIFU_SLUG);
563
- };
564
-
565
  // reset
566
  $fifu['reset']['desc'] = function () {
567
  _e("Reset FIFU settings to the default configuration.", FIFU_SLUG);
@@ -655,7 +641,7 @@ function fifu_get_strings_settings() {
655
  _e("Examples of valid size ratios", FIFU_SLUG);
656
  };
657
  $fifu['height']['fit']['cover'] = function () {
658
- _e("crops the images (the options center, top and bottom will be available in the post editor);", FIFU_SLUG);
659
  };
660
  $fifu['height']['fit']['contain'] = function () {
661
  _e("shows full images (in smaller sizes);", FIFU_SLUG);
@@ -1368,12 +1354,12 @@ function fifu_get_strings_settings() {
1368
  };
1369
  // mouseover
1370
  $fifu['mouseover']['desc'] = function () {
1371
- _e("Play a video on \"mouseover\" and pause on \"mouseout\". Requires \"Video Controls\".", FIFU_SLUG);
1372
  };
1373
 
1374
  // autoplay
1375
  $fifu['autoplay']['desc'] = function () {
1376
- _e("Autoplay videos (available for YouTube, Vimeo and local videos).", FIFU_SLUG);
1377
  };
1378
 
1379
  // loop
@@ -1446,7 +1432,7 @@ function fifu_get_strings_settings() {
1446
  _e("Add FIFU fields (featured image and image gallery) to product variations.", FIFU_SLUG);
1447
  };
1448
  $fifu['variable']['important'] = function () {
1449
- _e("variation image gallery requires FIFU Product Gallery or <a href='https://woocommerce.com/products/woocommerce-additional-variation-images/' target='_blank'>WooCommerce Additional Variation Images</a>. Unofficial solutions are not supported.", FIFU_SLUG);
1450
  };
1451
 
1452
  // import
213
  $fifu['title']['column'] = function () {
214
  _e("Quick Edit Column", FIFU_SLUG);
215
  };
 
 
 
216
  $fifu['title']['reset'] = function () {
217
  _e("Reset Settings", FIFU_SLUG);
218
  };
548
  _e("e.g. (args)", FIFU_SLUG);
549
  };
550
 
 
 
 
 
 
 
 
 
 
 
 
551
  // reset
552
  $fifu['reset']['desc'] = function () {
553
  _e("Reset FIFU settings to the default configuration.", FIFU_SLUG);
641
  _e("Examples of valid size ratios", FIFU_SLUG);
642
  };
643
  $fifu['height']['fit']['cover'] = function () {
644
+ _e("crops the images;", FIFU_SLUG);
645
  };
646
  $fifu['height']['fit']['contain'] = function () {
647
  _e("shows full images (in smaller sizes);", FIFU_SLUG);
1354
  };
1355
  // mouseover
1356
  $fifu['mouseover']['desc'] = function () {
1357
+ _e("Play a video on \"mouseover\" and pause on \"mouseout\". Requires \"Video Controls\" and \"Mute\".", FIFU_SLUG);
1358
  };
1359
 
1360
  // autoplay
1361
  $fifu['autoplay']['desc'] = function () {
1362
+ _e("Autoplay videos (available for YouTube, Vimeo and local videos). Requires \"Mute\".", FIFU_SLUG);
1363
  };
1364
 
1365
  // loop
1432
  _e("Add FIFU fields (featured image and image gallery) to product variations.", FIFU_SLUG);
1433
  };
1434
  $fifu['variable']['important'] = function () {
1435
+ _e("variation image gallery requires FIFU Product Gallery.", FIFU_SLUG);
1436
  };
1437
 
1438
  // import
featured-image-from-url.php CHANGED
@@ -4,11 +4,11 @@
4
  * Plugin Name: Featured Image from URL (FIFU)
5
  * Plugin URI: https://fifu.app/
6
  * Description: Use an external image/video/audio as featured image/video/audio of a post or WooCommerce product.
7
- * Version: 4.1.3
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
  * WC requires at least: 4.0
11
- * WC tested up to: 6.9.3
12
  * Text Domain: featured-image-from-url
13
  * License: GPLv3
14
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
4
  * Plugin Name: Featured Image from URL (FIFU)
5
  * Plugin URI: https://fifu.app/
6
  * Description: Use an external image/video/audio as featured image/video/audio of a post or WooCommerce product.
7
+ * Version: 4.1.4
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
  * WC requires at least: 4.0
11
+ * WC tested up to: 6.9.4
12
  * Text Domain: featured-image-from-url
13
  * License: GPLv3
14
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
includes/attachment.php CHANGED
@@ -52,27 +52,15 @@ function fifu_replace_attachment_url($att_url, $att_id) {
52
  add_filter('posts_where', 'fifu_query_attachments');
53
 
54
  function fifu_query_attachments($where) {
55
- $is_web_story = false;
56
- if (function_exists('get_current_screen')) {
57
- $screen = get_current_screen();
58
- $is_web_story = isset($screen->post_type) && strpos($screen->post_type, 'web-story') !== false;
59
- }
60
-
61
  global $wpdb;
62
- if ($is_web_story || (isset($_POST['action']) && ($_POST['action'] == 'query-attachments')))
63
  $where .= ' AND ' . $wpdb->prefix . 'posts.post_author <> ' . FIFU_AUTHOR . ' ';
64
  return $where;
65
  }
66
 
67
  add_filter('posts_where', function ($where, \WP_Query $q) {
68
- $is_web_story = false;
69
- if (function_exists('get_current_screen')) {
70
- $screen = get_current_screen();
71
- $is_web_story = isset($screen->post_type) && strpos($screen->post_type, 'web-story') !== false;
72
- }
73
-
74
  global $wpdb;
75
- if ($is_web_story || (is_admin() && $q->is_main_query() && true))
76
  $where .= ' AND ' . $wpdb->prefix . 'posts.post_author <> ' . FIFU_AUTHOR . ' ';
77
  return $where;
78
  }, 10, 2);
52
  add_filter('posts_where', 'fifu_query_attachments');
53
 
54
  function fifu_query_attachments($where) {
 
 
 
 
 
 
55
  global $wpdb;
56
+ if (fifu_is_web_story() || (isset($_POST['action']) && ($_POST['action'] == 'query-attachments')))
57
  $where .= ' AND ' . $wpdb->prefix . 'posts.post_author <> ' . FIFU_AUTHOR . ' ';
58
  return $where;
59
  }
60
 
61
  add_filter('posts_where', function ($where, \WP_Query $q) {
 
 
 
 
 
 
62
  global $wpdb;
63
+ if (fifu_is_web_story() || (is_admin() && $q->is_main_query() && true))
64
  $where .= ' AND ' . $wpdb->prefix . 'posts.post_author <> ' . FIFU_AUTHOR . ' ';
65
  return $where;
66
  }, 10, 2);
includes/util.php CHANGED
@@ -197,3 +197,18 @@ function fifu_amp_url($url, $width, $height) {
197
  return array(0 => $url, 1 => $width, 2 => $height);
198
  }
199
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  return array(0 => $url, 1 => $width, 2 => $height);
198
  }
199
 
200
+ // plugin: web-stories
201
+
202
+ function fifu_is_web_story() {
203
+ if (function_exists('get_current_screen')) {
204
+ $screen = get_current_screen();
205
+ $is_web_story = isset($screen->post_type) && strpos($screen->post_type, 'web-story') !== false;
206
+ if ($is_web_story)
207
+ return true;
208
+ }
209
+ if (isset($_REQUEST['_web_stories_envelope']))
210
+ return true;
211
+
212
+ return false;
213
+ }
214
+
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://donorbox.org/fifu
4
  Tags: featured, image, url, video, woocommerce
5
  Requires at least: 5.3
6
  Tested up to: 6.0.2
7
- Stable tag: 4.1.3
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -261,20 +261,20 @@ Featured Image, Figurë e Zgjedhur, Image mise en avant, Uitgelichte afbeelding,
261
 
262
  == Changelog ==
263
 
 
 
 
264
  = 4.1.3 =
265
  * New option: Fast Buy > custom field; enhancement: WP All Import add-on (documentation added); fix: Lazy Load (conflict with Slider Revolution plugin); fix: conflict with Web Stories plugin; deprecated: Featured Slider > number of fields; deprecated: Unsplash Image Sizes.
266
 
267
  = 4.1.2 =
268
  * Fix: CDN + Optimized Thumbnails (conflict with Facebook images); fix: Lazy Load (conflict with Image and Video Gallery from Google Drive plugin).
269
 
270
- = 4.1.1 =
271
- * Enhancement: FIFU Cloud (performance optimization for mobile); fix: CDN + Optimized Thumbnails > crop featured images; fix: CDN + Optimized Thumbnails > apply to content images; fix: incompatibility with AMP plugin.
272
-
273
  = others =
274
  * [more](https://fifu.app/changelog)
275
 
276
 
277
  == Upgrade Notice ==
278
 
279
- = 4.1.3 =
280
- * New option: Fast Buy > custom field; enhancement: WP All Import add-on (documentation added); fix: Lazy Load (conflict with Slider Revolution plugin); fix: conflict with Web Stories plugin; deprecated: Featured Slider > number of fields; deprecated: Unsplash Image Sizes.
4
  Tags: featured, image, url, video, woocommerce
5
  Requires at least: 5.3
6
  Tested up to: 6.0.2
7
+ Stable tag: 4.1.4
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
261
 
262
  == Changelog ==
263
 
264
+ = 4.1.4 =
265
+ * Enhancement: Status > Copy to Clipboard; fix: conflict with Web Stories plugin; deprecated: Product Gallery > Number of Fields.
266
+
267
  = 4.1.3 =
268
  * New option: Fast Buy > custom field; enhancement: WP All Import add-on (documentation added); fix: Lazy Load (conflict with Slider Revolution plugin); fix: conflict with Web Stories plugin; deprecated: Featured Slider > number of fields; deprecated: Unsplash Image Sizes.
269
 
270
  = 4.1.2 =
271
  * Fix: CDN + Optimized Thumbnails (conflict with Facebook images); fix: Lazy Load (conflict with Image and Video Gallery from Google Drive plugin).
272
 
 
 
 
273
  = others =
274
  * [more](https://fifu.app/changelog)
275
 
276
 
277
  == Upgrade Notice ==
278
 
279
+ = 4.1.4 =
280
+ * Enhancement: Status > Copy to Clipboard; fix: conflict with Web Stories plugin; deprecated: Product Gallery > Number of Fields.