Featured Image From URL - Version 3.5.1

Version Description

  • New premium feature: Save External Images in the Media Library; fix: WooCommerce category was keeping a few unnecessary metadata after deleting.
Download this release

Release Info

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

Code changes from version 3.5.0 to 3.5.1

admin/category.php CHANGED
@@ -56,19 +56,27 @@ add_action('edited_product_cat', 'fifu_ctgr_save_properties', 10, 1);
56
  add_action('created_product_cat', 'fifu_ctgr_save_properties', 10, 1);
57
 
58
  function fifu_ctgr_save_properties($term_id) {
59
- if (isset($_POST['fifu_input_alt']))
60
- update_term_meta($term_id, 'fifu_image_alt', wp_strip_all_tags($_POST['fifu_input_alt']));
 
 
 
 
61
 
62
  if (isset($_POST['fifu_input_url'])) {
63
  $url = esc_url_raw(rtrim($_POST['fifu_input_url']));
64
  update_term_meta($term_id, 'fifu_image_url', fifu_convert($url));
65
- fifu_db_ctgr_update_fake_attach_id($term_id);
 
 
 
 
 
 
 
 
 
 
66
  }
67
-
68
- /* dimensions */
69
- $width = fifu_get_width_meta($_POST);
70
- $height = fifu_get_height_meta($_POST);
71
- $att_id = get_term_meta($term_id, 'thumbnail_id', true);
72
- fifu_save_dimensions($att_id, $width, $height);
73
  }
74
 
56
  add_action('created_product_cat', 'fifu_ctgr_save_properties', 10, 1);
57
 
58
  function fifu_ctgr_save_properties($term_id) {
59
+ if (isset($_POST['fifu_input_alt'])) {
60
+ if (empty($_POST['fifu_input_alt']))
61
+ delete_term_meta($term_id, 'fifu_image_alt');
62
+ else
63
+ update_term_meta($term_id, 'fifu_image_alt', wp_strip_all_tags($_POST['fifu_input_alt']));
64
+ }
65
 
66
  if (isset($_POST['fifu_input_url'])) {
67
  $url = esc_url_raw(rtrim($_POST['fifu_input_url']));
68
  update_term_meta($term_id, 'fifu_image_url', fifu_convert($url));
69
+ if (empty($url)) {
70
+ delete_term_meta($term_id, 'fifu_image_url');
71
+ fifu_db_ctgr_update_fake_attach_id($term_id);
72
+ } else {
73
+ fifu_db_ctgr_update_fake_attach_id($term_id);
74
+ /* dimensions */
75
+ $width = fifu_get_width_meta($_POST);
76
+ $height = fifu_get_height_meta($_POST);
77
+ $att_id = get_term_meta($term_id, 'thumbnail_id', true);
78
+ fifu_save_dimensions($att_id, $width, $height);
79
+ }
80
  }
 
 
 
 
 
 
81
  }
82
 
admin/html/js/meta-box.js CHANGED
@@ -1,6 +1,7 @@
1
  function removeImage() {
2
  jQuery("#fifu_input_alt").hide();
3
  jQuery("#fifu_image").hide();
 
4
  jQuery("#fifu_link").hide();
5
  jQuery("#fifu_next").hide();
6
 
@@ -80,6 +81,7 @@ function runPreview($url) {
80
 
81
  jQuery("#fifu_input_alt").show();
82
  jQuery("#fifu_image").show();
 
83
  jQuery("#fifu_link").show();
84
 
85
  if (fifuMetaBoxVars.is_sirv_active)
1
  function removeImage() {
2
  jQuery("#fifu_input_alt").hide();
3
  jQuery("#fifu_image").hide();
4
+ jQuery("#fifu_upload").hide();
5
  jQuery("#fifu_link").hide();
6
  jQuery("#fifu_next").hide();
7
 
81
 
82
  jQuery("#fifu_input_alt").show();
83
  jQuery("#fifu_image").show();
84
+ jQuery("#fifu_upload").show();
85
  jQuery("#fifu_link").show();
86
 
87
  if (fifuMetaBoxVars.is_sirv_active)
admin/html/menu.html CHANGED
@@ -518,6 +518,40 @@
518
  on, off
519
  </th>
520
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
521
  <tr class="color">
522
  <th>
523
  <?php $fifu['tab']['image']() ?>
@@ -2204,6 +2238,48 @@
2204
  </table>
2205
  </div>
2206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2207
  <div class="box">
2208
  <div class="fifu-pro"><a href="https://fifu.app" target="_blank" style="color:grey">premium</a></div>
2209
  <h2><?php $fifu['title']['height']() ?></h2>
@@ -4322,6 +4398,21 @@
4322
  </div>
4323
  </div>
4324
  <div id="tabs-t">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4325
  <div class="box">
4326
  <table>
4327
  <tr>
518
  on, off
519
  </th>
520
  </tr>
521
+ <tr class="color">
522
+ <th>
523
+ <?php $fifu['tab']['image']() ?>
524
+ </th>
525
+ <th>
526
+ <?php $fifu['title']['media']() ?>
527
+ </th>
528
+ <th>
529
+ <?php $fifu['media']['upload']() ?>
530
+ </th>
531
+ <th>
532
+ wp fifu upload --show-button &lt;toggle&gt;
533
+ </th>
534
+ <th>
535
+ on, off
536
+ </th>
537
+ </tr>
538
+ <tr class="color">
539
+ <th>
540
+ <?php $fifu['tab']['image']() ?>
541
+ </th>
542
+ <th>
543
+ <?php $fifu['title']['media']() ?>
544
+ </th>
545
+ <th>
546
+ <?php $fifu['media']['job']() ?>
547
+ </th>
548
+ <th>
549
+ wp fifu upload --job &lt;toggle&gt;
550
+ </th>
551
+ <th>
552
+ on, off
553
+ </th>
554
+ </tr>
555
  <tr class="color">
556
  <th>
557
  <?php $fifu['tab']['image']() ?>
2238
  </table>
2239
  </div>
2240
 
2241
+ <div class="box">
2242
+ <div class="fifu-pro"><a href="https://fifu.app" target="_blank" style="color:grey">premium</a></div>
2243
+
2244
+ <h2><?php $fifu['title']['media']() ?></h2>
2245
+
2246
+ <div class="greybox" id="grad2">
2247
+
2248
+ <?php $fifu['media']['desc']() ?>
2249
+
2250
+ </div>
2251
+
2252
+ <br>
2253
+
2254
+ <table style="text-align:left">
2255
+ <tr>
2256
+ <th>
2257
+ <input
2258
+ type="submit"
2259
+ class="toggleoff"
2260
+ value=""
2261
+ style="display:block;border:none">
2262
+ </th>
2263
+ <th>
2264
+ <?php $fifu['media']['upload']() ?>
2265
+ </th>
2266
+ </tr>
2267
+ <tr>
2268
+ <th>
2269
+ <input
2270
+ type="submit"
2271
+ class="toggleoff"
2272
+ value=""
2273
+ style="display:block;border:none">
2274
+ </th>
2275
+ <th>
2276
+ <?php $fifu['media']['job']() ?>
2277
+ </th>
2278
+ </tr>
2279
+ </table>
2280
+
2281
+ </div>
2282
+
2283
  <div class="box">
2284
  <div class="fifu-pro"><a href="https://fifu.app" target="_blank" style="color:grey">premium</a></div>
2285
  <h2><?php $fifu['title']['height']() ?></h2>
4398
  </div>
4399
  </div>
4400
  <div id="tabs-t">
4401
+ <div class="box">
4402
+ <table>
4403
+ <tr>
4404
+ <td style="border-bottom:none">2021-01-12</td>
4405
+ <td style="border-bottom:none"><h3> Avada</h3></td>
4406
+ <td style="border-bottom:none">theme</td>
4407
+ </tr>
4408
+ </table>
4409
+ <div class="greybox" style="position: relative; top: -10px">
4410
+ Procut gallery has style issues:<br>
4411
+ 1) access "Avada Settings > WooCommerce > WooCommerce Product Images Layout";<br>
4412
+ 2) select "WooCommerce" instead of "Avada";<br>
4413
+ 3) click on "Save Changes".<br>
4414
+ </div>
4415
+ </div>
4416
  <div class="box">
4417
  <table>
4418
  <tr>
admin/html/meta-box.html CHANGED
@@ -13,6 +13,10 @@
13
  </tr>
14
  </table>
15
 
 
 
 
 
16
  <input id="fifu_input_alt"
17
  type="text"
18
  name="fifu_input_alt"
13
  </tr>
14
  </table>
15
 
16
+ <div id="fifu_upload" class="button" style="<?php echo $width, $show_alt, $show_image ?>" disabled>
17
+ <span style="top:3px; position:relative" class="dashicons dashicons-upload"></span><?php $fifu['image']['upload']() ?>
18
+ </div>
19
+
20
  <input id="fifu_input_alt"
21
  type="text"
22
  name="fifu_input_alt"
admin/strings.php CHANGED
@@ -5,7 +5,7 @@ function fifu_get_strings_settings() {
5
 
6
  // php
7
  $fifu['php']['message']['wait'] = function() {
8
- return __("Please wait some seconds...", FIFU_SLUG);
9
  };
10
 
11
  // buttons
@@ -121,7 +121,7 @@ function fifu_get_strings_settings() {
121
 
122
  // messages
123
  $fifu['message']['wait'] = function() {
124
- _e("Please wait some seconds...", FIFU_SLUG);
125
  };
126
 
127
  // tabs
@@ -193,6 +193,9 @@ function fifu_get_strings_settings() {
193
  $fifu['title']['cli'] = function() {
194
  _e("WP-CLI", FIFU_SLUG);
195
  };
 
 
 
196
  $fifu['title']['height'] = function() {
197
  _e("Same Height", FIFU_SLUG);
198
  };
@@ -499,6 +502,17 @@ function fifu_get_strings_settings() {
499
  _e("reset settings", FIFU_SLUG);
500
  };
501
 
 
 
 
 
 
 
 
 
 
 
 
502
  // height
503
  $fifu['height']['desc'] = function() {
504
  _e("If you have different sizes of images on your home (or shop), enable the toggle below to show them in the same height. Depending on your theme, it may be necessary to use a selector to inform where is the group of images that you want to resize.", FIFU_SLUG);
@@ -683,7 +697,7 @@ function fifu_get_strings_settings() {
683
 
684
  // validation
685
  $fifu['validation']['desc'] = function() {
686
- _e("It checks images addresses and, when an image is not found, its URL is not saved. However, each validation can take some seconds.", FIFU_SLUG);
687
  };
688
 
689
  // configuration
@@ -1284,6 +1298,9 @@ function fifu_get_strings_meta_box() {
1284
  $fifu['image']['sirv']['choose'] = function() {
1285
  _e("Choose Sirv image", FIFU_SLUG);
1286
  };
 
 
 
1287
 
1288
  return $fifu;
1289
  }
@@ -1293,7 +1310,7 @@ function fifu_get_strings_meta_box_php() {
1293
 
1294
  // common
1295
  $fifu['common']['wait'] = function() {
1296
- return __("Please wait some seconds...", FIFU_SLUG);
1297
  };
1298
 
1299
  // wait
@@ -1344,6 +1361,9 @@ function fifu_get_strings_meta_box_php() {
1344
  $fifu['variation']['wavi'] = function() {
1345
  return __("Requires WooCommerce Additional Variation Images plugin", FIFU_SLUG);
1346
  };
 
 
 
1347
 
1348
  return $fifu;
1349
  }
5
 
6
  // php
7
  $fifu['php']['message']['wait'] = function() {
8
+ return __("Please wait a few seconds...", FIFU_SLUG);
9
  };
10
 
11
  // buttons
121
 
122
  // messages
123
  $fifu['message']['wait'] = function() {
124
+ _e("Please wait a few seconds...", FIFU_SLUG);
125
  };
126
 
127
  // tabs
193
  $fifu['title']['cli'] = function() {
194
  _e("WP-CLI", FIFU_SLUG);
195
  };
196
+ $fifu['title']['media'] = function() {
197
+ _e("Save in the Media Library", FIFU_SLUG);
198
+ };
199
  $fifu['title']['height'] = function() {
200
  _e("Same Height", FIFU_SLUG);
201
  };
502
  _e("reset settings", FIFU_SLUG);
503
  };
504
 
505
+ // media library
506
+ $fifu['media']['desc'] = function() {
507
+ _e("It's possible to save the external images in the media library. Make a backup before running the cron job, because you can't revert this action later.", FIFU_SLUG);
508
+ };
509
+ $fifu['media']['upload'] = function() {
510
+ _e("show upload button on editor", FIFU_SLUG);
511
+ };
512
+ $fifu['media']['job'] = function() {
513
+ _e("run a cron job that searches for external images and saves them in the media library periodically", FIFU_SLUG);
514
+ };
515
+
516
  // height
517
  $fifu['height']['desc'] = function() {
518
  _e("If you have different sizes of images on your home (or shop), enable the toggle below to show them in the same height. Depending on your theme, it may be necessary to use a selector to inform where is the group of images that you want to resize.", FIFU_SLUG);
697
 
698
  // validation
699
  $fifu['validation']['desc'] = function() {
700
+ _e("It checks images addresses and, when an image is not found, its URL is not saved. However, each validation can take a few seconds.", FIFU_SLUG);
701
  };
702
 
703
  // configuration
1298
  $fifu['image']['sirv']['choose'] = function() {
1299
  _e("Choose Sirv image", FIFU_SLUG);
1300
  };
1301
+ $fifu['image']['upload'] = function() {
1302
+ _e("upload to media library", FIFU_SLUG);
1303
+ };
1304
 
1305
  return $fifu;
1306
  }
1310
 
1311
  // common
1312
  $fifu['common']['wait'] = function() {
1313
+ return __("Please wait a few seconds...", FIFU_SLUG);
1314
  };
1315
 
1316
  // wait
1361
  $fifu['variation']['wavi'] = function() {
1362
  return __("Requires WooCommerce Additional Variation Images plugin", FIFU_SLUG);
1363
  };
1364
+ $fifu['variation']['upload'] = function() {
1365
+ return __("upload to media library", FIFU_SLUG);
1366
+ };
1367
 
1368
  return $fifu;
1369
  }
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 as featured image of a post or WooCommerce product. Includes Image Search, Video, Social Tags, SEO, Lazy Load, Gallery, Automation etc.
7
- * Version: 3.5.0
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
  * WC requires at least: 4.0
11
- * WC tested up to: 4.8
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 as featured image of a post or WooCommerce product. Includes Image Search, Video, Social Tags, SEO, Lazy Load, Gallery, Automation etc.
7
+ * Version: 3.5.1
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
  * WC requires at least: 4.0
11
+ * WC tested up to: 4.9
12
  * Text Domain: featured-image-from-url
13
  * License: GPLv3
14
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://donorbox.org/fifu
4
  Tags: featured, image, url, woocommerce, thumbnail
5
  Requires at least: 5.3
6
  Tested up to: 5.6
7
- Stable tag: 3.5.0
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -30,6 +30,7 @@ Use an external image as featured image of your post, page or custom post type.
30
  * Auto set image title
31
  * Save image dimensions
32
  * Featured image column
 
33
  * **[Premium]** Giphy image search
34
  * **[Premium]** Unsplash image size
35
  * **[Premium]** Same height
@@ -74,6 +75,7 @@ Use an external image as featured image of your post, page or custom post type.
74
  * **[Premium]** Variable product
75
  * **[Premium]** Variation image
76
  * **[Premium]** Variation image gallery
 
77
 
78
  #### FEATURED VIDEO
79
  Supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr and Publitio.
@@ -133,7 +135,7 @@ Supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr and Publiti
133
 
134
  = Does FIFU save the images in the media library? =
135
 
136
- * Never.
137
 
138
  = Is any action necessary before removing FIFU?
139
 
@@ -197,20 +199,20 @@ Supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr and Publiti
197
 
198
  == Changelog ==
199
 
 
 
 
200
  = 3.5.0 =
201
  * Improvement: WP-CLI integration is complete (90 commands).
202
 
203
  = 3.4.9 =
204
  * Improvement: 13 new WP-CLI commands added; fix: missing images after WordPress core updates (affects images with long URLs); bug fix: images not being displayed for Anywhere Elementor plugin (and maybe other components).
205
 
206
- = 3.4.8 =
207
- * Notice: for users with Instagram images; improvement: 20 new WP-CLI commands added; fix: Unsplash random image.
208
-
209
  = others =
210
  * [more](https://fifu.app/changelog/)
211
 
212
 
213
  == Upgrade Notice ==
214
 
215
- = 3.5.0 =
216
- * Improvement: WP-CLI integration is complete (90 commands).
4
  Tags: featured, image, url, woocommerce, thumbnail
5
  Requires at least: 5.3
6
  Tested up to: 5.6
7
+ Stable tag: 3.5.1
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
30
  * Auto set image title
31
  * Save image dimensions
32
  * Featured image column
33
+ * **[Premium]** Save in the media library
34
  * **[Premium]** Giphy image search
35
  * **[Premium]** Unsplash image size
36
  * **[Premium]** Same height
75
  * **[Premium]** Variable product
76
  * **[Premium]** Variation image
77
  * **[Premium]** Variation image gallery
78
+ * **[Premium]** Save images in the media library
79
 
80
  #### FEATURED VIDEO
81
  Supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr and Publitio.
135
 
136
  = Does FIFU save the images in the media library? =
137
 
138
+ * No. Only the Premium version is capable of doing this, but it is optional. The plugin was designed to work with external images.
139
 
140
  = Is any action necessary before removing FIFU?
141
 
199
 
200
  == Changelog ==
201
 
202
+ = 3.5.1 =
203
+ * New premium feature: Save External Images in the Media Library; fix: WooCommerce category was keeping a few unnecessary metadata after deleting.
204
+
205
  = 3.5.0 =
206
  * Improvement: WP-CLI integration is complete (90 commands).
207
 
208
  = 3.4.9 =
209
  * Improvement: 13 new WP-CLI commands added; fix: missing images after WordPress core updates (affects images with long URLs); bug fix: images not being displayed for Anywhere Elementor plugin (and maybe other components).
210
 
 
 
 
211
  = others =
212
  * [more](https://fifu.app/changelog/)
213
 
214
 
215
  == Upgrade Notice ==
216
 
217
+ = 3.5.1 =
218
+ * New premium feature: Save External Images in the Media Library; fix: WooCommerce category was keeping a few unnecessary metadata after deleting.