Featured Image From URL - Version 3.3.5

Version Description

  • New feature: Featured Image > Auto Set (get images from search engines); bug fix: images not shown in WooCommerce gallery when the dimensions are null.
Download this release

Release Info

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

Code changes from version 3.3.4 to 3.3.5

admin/db.php CHANGED
@@ -353,7 +353,7 @@ class FifuDb {
353
 
354
  function get_posts_without_featured_image() {
355
  return $this->wpdb->get_results("
356
- SELECT id
357
  FROM " . $this->posts . "
358
  WHERE post_type IN ('$this->types')
359
  AND post_status = 'publish'
@@ -362,7 +362,8 @@ class FifuDb {
362
  FROM " . $this->postmeta . "
363
  WHERE post_id = id
364
  AND meta_key IN ('_thumbnail_id', 'fifu_image_url')
365
- )"
 
366
  );
367
  }
368
 
353
 
354
  function get_posts_without_featured_image() {
355
  return $this->wpdb->get_results("
356
+ SELECT id, post_title
357
  FROM " . $this->posts . "
358
  WHERE post_type IN ('$this->types')
359
  AND post_status = 'publish'
362
  FROM " . $this->postmeta . "
363
  WHERE post_id = id
364
  AND meta_key IN ('_thumbnail_id', 'fifu_image_url')
365
+ )
366
+ ORDER BY id DESC"
367
  );
368
  }
369
 
admin/html/js/menu.js CHANGED
@@ -38,6 +38,8 @@ jQuery(function () {
38
  jQuery("#fifu_input_spinner_slider").spinner({min: 0});
39
  jQuery("#fifu_input_slider_speed").spinner({min: 0});
40
  jQuery("#fifu_input_slider_pause").spinner({min: 0});
 
 
41
  jQuery("#fifu_input_crop_delay").spinner({min: 0, step: 50});
42
  jQuery("#tabsApi").tabs();
43
  jQuery("#tabsCrop").tabs();
@@ -45,6 +47,7 @@ jQuery(function () {
45
  jQuery("#tabsWooImport").tabs();
46
  jQuery("#tabsWpAllImport").tabs();
47
  jQuery("#tabsShortcode").tabs();
 
48
 
49
  // show settings
50
  window.scrollTo(0, 0);
38
  jQuery("#fifu_input_spinner_slider").spinner({min: 0});
39
  jQuery("#fifu_input_slider_speed").spinner({min: 0});
40
  jQuery("#fifu_input_slider_pause").spinner({min: 0});
41
+ jQuery("#fifu_input_auto_set_width").spinner({min: 0});
42
+ jQuery("#fifu_input_auto_set_height").spinner({min: 0});
43
  jQuery("#fifu_input_crop_delay").spinner({min: 0, step: 50});
44
  jQuery("#tabsApi").tabs();
45
  jQuery("#tabsCrop").tabs();
47
  jQuery("#tabsWooImport").tabs();
48
  jQuery("#tabsWpAllImport").tabs();
49
  jQuery("#tabsShortcode").tabs();
50
+ jQuery("#tabsAutoSet").tabs();
51
 
52
  // show settings
53
  window.scrollTo(0, 0);
admin/html/menu.html CHANGED
@@ -333,6 +333,88 @@
333
  </div>
334
  </div>
335
  <div id="tabs-g">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
336
  <div class="box">
337
  <div class="fifu-pro"><a href="https://fifu.app" target="_blank" style="color:grey">premium</a></div>
338
  <h2><?php $fifu['title']['height']() ?></h2>
333
  </div>
334
  </div>
335
  <div id="tabs-g">
336
+
337
+ <div class="box">
338
+ <div class="fifu-pro"><a href="https://fifu.app" target="_blank" style="color:grey">premium</a></div>
339
+ <h2><?php $fifu['title']['auto']() ?> </span></h2>
340
+ <div class="greybox" id="grad2">
341
+ <?php $fifu['auto']['desc']() ?>
342
+ </div>
343
+ <br>
344
+ <div id="tabsAutoSet">
345
+ <ul>
346
+ <li><a href="#tabsAutoSet-a"><?php $fifu['auto']['tab']['auto']() ?></a></li>
347
+ <li><a href="#tabsAutoSet-b"><?php $fifu['auto']['tab']['filters']() ?></a></li>
348
+ <li><a href="#tabsAutoSet-c"><?php $fifu['auto']['tab']['blocklist']() ?></a></li>
349
+ <br>
350
+ <br>
351
+ <div id="tabsAutoSet-a">
352
+ <table style="text-align:left">
353
+ <tr>
354
+ <th>
355
+ <input
356
+ type="submit"
357
+ href="javascript:void(0)"
358
+ class="toggleoff"
359
+ value=""
360
+ style="display:block;border:none">
361
+ </th>
362
+ </tr>
363
+ </table>
364
+ </div>
365
+ <div id="tabsAutoSet-b">
366
+ <form
367
+ id="fifu_form_auto_set_dimensions"
368
+ action="javascript:void(0)"
369
+ method="post">
370
+ <table style="text-align:left">
371
+ <tr>
372
+ <th>
373
+ <input id="fifu_input_auto_set_width"
374
+ name="fifu_input_auto_set_width"
375
+ step="10"
376
+ max="10000"
377
+ size="5">
378
+ </th>
379
+ <th>
380
+ <?php $fifu['auto']['filter']['width']() ?>
381
+ </th>
382
+ </tr>
383
+ <tr>
384
+ <th>
385
+ <input id="fifu_input_auto_set_height"
386
+ name="fifu_input_auto_set_height"
387
+ step="10"
388
+ max="10000"
389
+ size="5">
390
+ </th>
391
+ <th>
392
+ <?php $fifu['auto']['filter']['height']() ?>
393
+ </th>
394
+ </tr>
395
+ <tr>
396
+ <th>
397
+ <input type="submit" value="<?php $fifu['button']['submit']() ?>" >
398
+ </th>
399
+ <th></th>
400
+ </tr>
401
+ </table>
402
+ </form>
403
+ </div>
404
+ <div id="tabsAutoSet-c">
405
+ <?php $fifu['auto']['filter']['blocklist']() ?>
406
+ <form
407
+ id="fifu_form_auto_set_blocklist"
408
+ action="javascript:void(0)"
409
+ method="post">
410
+ <textarea id="fifu_input_auto_set_blocklist" name="fifu_input_auto_set_blocklist" style="width:100%;height:400px;resize:none;background-color:white;" placeholder="www.horribleimages.com&#10;inappropriateimages.com&#10;nakedpeopleimages.com&#10;manyadvertisements.com&#10;anysiteyoureallyhate.com"></textarea>
411
+ <input style="float: right;" type="submit" value="<?php $fifu['button']['submit']() ?>" >
412
+ </form>
413
+ </div>
414
+ </ul>
415
+ </div>
416
+ </div>
417
+
418
  <div class="box">
419
  <div class="fifu-pro"><a href="https://fifu.app" target="_blank" style="color:grey">premium</a></div>
420
  <h2><?php $fifu['title']['height']() ?></h2>
admin/strings.php CHANGED
@@ -184,6 +184,9 @@ function fifu_get_strings_settings() {
184
  $fifu['title']['height'] = function() {
185
  _e("Same Height", FIFU_SLUG);
186
  };
 
 
 
187
  $fifu['title']['giphy'] = function() {
188
  _e("Giphy Search", FIFU_SLUG);
189
  };
@@ -456,16 +459,16 @@ function fifu_get_strings_settings() {
456
  _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);
457
  };
458
  $fifu['height']['tab']['height'] = function() {
459
- _e("Same Height", FIFU_SLUG);
460
  };
461
  $fifu['height']['tab']['selector'] = function() {
462
  _e("Selector", FIFU_SLUG);
463
  };
464
  $fifu['height']['tab']['ratio'] = function() {
465
- _e("Size Ratio", FIFU_SLUG);
466
  };
467
  $fifu['height']['tab']['fit'] = function() {
468
- _e("Object Fit", FIFU_SLUG);
469
  };
470
  $fifu['height']['tab']['delay'] = function() {
471
  _e("Delay", FIFU_SLUG);
@@ -492,6 +495,29 @@ function fifu_get_strings_settings() {
492
  _e("time (in ms)", FIFU_SLUG);
493
  };
494
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
495
  // giphy
496
  $fifu['giphy']['desc'] = function() {
497
  _e("Enable keyword gif search at featured image box.", FIFU_SLUG);
@@ -1057,9 +1083,6 @@ function fifu_get_strings_settings() {
1057
  $fifu['key']['domain'] = function() {
1058
  _e("if your domain has changed, please contact the support", FIFU_SLUG);
1059
  };
1060
- $fifu['key']['stage'] = function() {
1061
- _e("if you have activated your license key for a development site before and now you want to activate that for this main site, contact the support too", FIFU_SLUG);
1062
- };
1063
  $fifu['key']['buy'] = function() {
1064
  _e("if you intend to use FIFU in multiple distinct sites you can buy more license keys <a href='https://fifu.app/#price' target='_blank'>here</a>", FIFU_SLUG);
1065
  };
184
  $fifu['title']['height'] = function() {
185
  _e("Same Height", FIFU_SLUG);
186
  };
187
+ $fifu['title']['auto'] = function() {
188
+ _e("Auto Set", FIFU_SLUG);
189
+ };
190
  $fifu['title']['giphy'] = function() {
191
  _e("Giphy Search", FIFU_SLUG);
192
  };
459
  _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);
460
  };
461
  $fifu['height']['tab']['height'] = function() {
462
+ _e("Same height", FIFU_SLUG);
463
  };
464
  $fifu['height']['tab']['selector'] = function() {
465
  _e("Selector", FIFU_SLUG);
466
  };
467
  $fifu['height']['tab']['ratio'] = function() {
468
+ _e("Size ratio", FIFU_SLUG);
469
  };
470
  $fifu['height']['tab']['fit'] = function() {
471
+ _e("Object fit", FIFU_SLUG);
472
  };
473
  $fifu['height']['tab']['delay'] = function() {
474
  _e("Delay", FIFU_SLUG);
495
  _e("time (in ms)", FIFU_SLUG);
496
  };
497
 
498
+ // auto set
499
+ $fifu['auto']['desc'] = function() {
500
+ _e("Set featured images automatically. FIFU will check every minute if there are post types without featured images and will perform web searches based on post titles to get the image URLs. The image searches happen in a FIFU cloud service connected to a search engine and, due the costs involved, for now it's limited to 1,000 posts a day, one search at a time, and available only for license keys purchased/renewed from a year ago.", FIFU_SLUG);
501
+ };
502
+ $fifu['auto']['tab']['auto'] = function() {
503
+ _e("Auto set", FIFU_SLUG);
504
+ };
505
+ $fifu['auto']['tab']['filters'] = function() {
506
+ _e("Filters", FIFU_SLUG);
507
+ };
508
+ $fifu['auto']['tab']['blocklist'] = function() {
509
+ _e("Blocklist", FIFU_SLUG);
510
+ };
511
+ $fifu['auto']['filter']['width'] = function() {
512
+ _e("minimum width (px)", FIFU_SLUG);
513
+ };
514
+ $fifu['auto']['filter']['height'] = function() {
515
+ _e("minimum height (px)", FIFU_SLUG);
516
+ };
517
+ $fifu['auto']['filter']['blocklist'] = function() {
518
+ _e("List of strings that shouldn't be in the image URL:", FIFU_SLUG);
519
+ };
520
+
521
  // giphy
522
  $fifu['giphy']['desc'] = function() {
523
  _e("Enable keyword gif search at featured image box.", FIFU_SLUG);
1083
  $fifu['key']['domain'] = function() {
1084
  _e("if your domain has changed, please contact the support", FIFU_SLUG);
1085
  };
 
 
 
1086
  $fifu['key']['buy'] = function() {
1087
  _e("if you intend to use FIFU in multiple distinct sites you can buy more license keys <a href='https://fifu.app/#price' target='_blank'>here</a>", FIFU_SLUG);
1088
  };
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 a post or WooCommerce product. Includes Image Search, Video, Social Tags, SEO, Lazy Load, Gallery, Automation etc.
7
- * Version: 3.3.4
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
  * WC requires at least: 4.0
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: 3.3.5
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
  * WC requires at least: 4.0
includes/attachment.php CHANGED
@@ -99,6 +99,10 @@ function fifu_replace_attachment_image_src($image, $att_id, $size) {
99
  if ($image[1] > 1 && $image[2] > 1)
100
  return $image;
101
 
 
 
 
 
102
  return fifu_fix_dimensions($image, $size);
103
  }
104
 
99
  if ($image[1] > 1 && $image[2] > 1)
100
  return $image;
101
 
102
+ // fix null height
103
+ if ($image[2] == null)
104
+ $image[2] = 0;
105
+
106
  return fifu_fix_dimensions($image, $size);
107
  }
108
 
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.5
7
- Stable tag: 3.3.4
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -32,6 +32,7 @@ Use an external image as featured image of your post, page or custom post type.
32
  * Elementor widget
33
  * Save image dimensions
34
  * Featured image column
 
35
  * **[Premium]** Giphy image search
36
  * **[Premium]** Unsplash image size
37
  * **[Premium]** Same height
@@ -188,20 +189,20 @@ Supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr and Publiti
188
 
189
  == Changelog ==
190
 
 
 
 
191
  = 3.3.4 =
192
  * Notice: about the "nulled" Premium version; improvement: getting started and examples added to Featured Shortcode; bug fix: empty alt field for internal images.
193
 
194
  = 3.3.3 =
195
  * New option: Content URL > decode HTML entities; conflict fixes: Jetpack + WooCommerce lightbox, Save Image Dimensions + svg images; style issue: Flatsome + WooCommerce gallery.
196
 
197
- = 3.3.2 =
198
- * Fix: notices (due FIFU widget for Elementor).
199
-
200
  = others =
201
  * [more](https://fifu.app/changelog/)
202
 
203
 
204
  == Upgrade Notice ==
205
 
206
- = 3.3.4 =
207
- * Notice: about the "nulled" Premium version; improvement: getting started and examples added to Featured Shortcode; bug fix: empty alt field for internal images.
4
  Tags: featured, image, url, woocommerce, thumbnail
5
  Requires at least: 5.3
6
  Tested up to: 5.5
7
+ Stable tag: 3.3.5
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
32
  * Elementor widget
33
  * Save image dimensions
34
  * Featured image column
35
+ * **[Premium]** Auto set
36
  * **[Premium]** Giphy image search
37
  * **[Premium]** Unsplash image size
38
  * **[Premium]** Same height
189
 
190
  == Changelog ==
191
 
192
+ = 3.3.5 =
193
+ * New feature: Featured Image > Auto Set (get images from search engines); bug fix: images not shown in WooCommerce gallery when the dimensions are null.
194
+
195
  = 3.3.4 =
196
  * Notice: about the "nulled" Premium version; improvement: getting started and examples added to Featured Shortcode; bug fix: empty alt field for internal images.
197
 
198
  = 3.3.3 =
199
  * New option: Content URL > decode HTML entities; conflict fixes: Jetpack + WooCommerce lightbox, Save Image Dimensions + svg images; style issue: Flatsome + WooCommerce gallery.
200
 
 
 
 
201
  = others =
202
  * [more](https://fifu.app/changelog/)
203
 
204
 
205
  == Upgrade Notice ==
206
 
207
+ = 3.3.5 =
208
+ * New feature: Featured Image > Auto Set (get images from search engines); bug fix: images not shown in WooCommerce gallery when the dimensions are null.