Featured Image From URL - Version 3.4.9

Version Description

  • 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).
Download this release

Release Info

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

Code changes from version 3.4.8 to 3.4.9

admin/db.php CHANGED
@@ -40,6 +40,21 @@ class FifuDb {
40
  );
41
  }
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  /* attachment metadata */
44
 
45
  // insert 1 _wp_attached_file for each attachment
@@ -1040,3 +1055,10 @@ function fifu_db_get_att_id($post_parent, $url, $is_ctgr) {
1040
  return $db->get_att_id($post_parent, $url, $is_ctgr);
1041
  }
1042
 
 
 
 
 
 
 
 
40
  );
41
  }
42
 
43
+ /* wordpress upgrade */
44
+
45
+ function fix_guid() {
46
+ $this->wpdb->get_results("
47
+ UPDATE " . $this->posts . " p
48
+ INNER JOIN " . $this->postmeta . " pm ON (
49
+ pm.post_id = p.id
50
+ AND pm.meta_key = '_wp_attached_file'
51
+ )
52
+ SET p.guid = pm.meta_value
53
+ WHERE p.post_author = " . $this->author . "
54
+ AND LENGTH(p.guid) = 255"
55
+ );
56
+ }
57
+
58
  /* attachment metadata */
59
 
60
  // insert 1 _wp_attached_file for each attachment
1055
  return $db->get_att_id($post_parent, $url, $is_ctgr);
1056
  }
1057
 
1058
+ /* wordpress upgrade */
1059
+
1060
+ function fifu_db_fix_guid() {
1061
+ $db = new FifuDb();
1062
+ return $db->fix_guid();
1063
+ }
1064
+
admin/html/menu.html CHANGED
@@ -518,6 +518,218 @@
518
  on, off
519
  </th>
520
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
521
  <tr class="color">
522
  <th>
523
  <?php $fifu['tab']['shortcode']() ?>
@@ -3937,7 +4149,7 @@
3937
  <i class="fab fa-facebook" style="font-size:30px"></i>
3938
  </td>
3939
  <td style="width:33%;text-align:center;border-bottom: 1px solid #ddd !important">
3940
- <i class="fab fa-instagram-square" style="font-size:30px"></i>
3941
  </td>
3942
  <td style="width:33%;text-align:center;border-bottom: 1px solid #ddd !important">
3943
  <i class="fas fa-tachometer-alt" style="font-size:30px"></i>
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']['height']() ?>
527
+ </th>
528
+ <th></th>
529
+ <th>
530
+ wp fifu image --height &lt;toggle&gt;
531
+ </th>
532
+ <th>
533
+ on, off
534
+ </th>
535
+ </tr>
536
+ <tr class="color">
537
+ <th>
538
+ <?php $fifu['tab']['image']() ?>
539
+ </th>
540
+ <th>
541
+ <?php $fifu['title']['height']() ?>
542
+ </th>
543
+ <th>
544
+ <?php $fifu['height']['tab']['selector']() ?>
545
+ </th>
546
+ <th>
547
+ wp fifu image --height-sel &lt;integer&gt; --selector &lt;string&gt;
548
+ </th>
549
+ <th>
550
+ 0, 1, 2, 3, 4<br>
551
+ #id, .class, ...
552
+ </th>
553
+ </tr>
554
+ <tr class="color">
555
+ <th>
556
+ <?php $fifu['tab']['image']() ?>
557
+ </th>
558
+ <th>
559
+ <?php $fifu['title']['height']() ?>
560
+ </th>
561
+ <th>
562
+ <?php $fifu['height']['tab']['ratio']() ?>
563
+ </th>
564
+ <th>
565
+ wp fifu image --height-ratio &lt;string&gt;
566
+ </th>
567
+ <th>
568
+ 4:3, 1:1, 3:2...
569
+ </th>
570
+ </tr>
571
+ <tr class="color">
572
+ <th>
573
+ <?php $fifu['tab']['image']() ?>
574
+ </th>
575
+ <th>
576
+ <?php $fifu['title']['height']() ?>
577
+ </th>
578
+ <th>
579
+ <?php $fifu['height']['tab']['fit']() ?>
580
+ </th>
581
+ <th>
582
+ wp fifu image --height-fit &lt;string&gt;
583
+ </th>
584
+ <th>
585
+ cover, contain, fill
586
+ </th>
587
+ </tr>
588
+ <tr class="color">
589
+ <th>
590
+ <?php $fifu['tab']['image']() ?>
591
+ </th>
592
+ <th>
593
+ <?php $fifu['title']['height']() ?>
594
+ </th>
595
+ <th>
596
+ <?php $fifu['height']['tab']['delay']() ?>
597
+ </th>
598
+ <th>
599
+ wp fifu image --height-delay &lt;integer&gt;
600
+ </th>
601
+ <th>
602
+ 0, 100, 1000...
603
+ </th>
604
+ </tr>
605
+ <tr class="color">
606
+ <th>
607
+ <?php $fifu['tab']['image']() ?>
608
+ </th>
609
+ <th>
610
+ <?php $fifu['title']['height']() ?>
611
+ </th>
612
+ <th>
613
+ <?php $fifu['height']['tab']['default']() ?>
614
+ </th>
615
+ <th>
616
+ wp fifu image --height-default &lt;string&gt;
617
+ </th>
618
+ <th>
619
+ #id, .class, ...
620
+ </th>
621
+ </tr>
622
+ <tr class="color">
623
+ <th>
624
+ <?php $fifu['tab']['image']() ?>
625
+ </th>
626
+ <th>
627
+ <?php $fifu['title']['height']() ?>
628
+ </th>
629
+ <th>
630
+ <?php $fifu['height']['tab']['ignore']() ?>
631
+ </th>
632
+ <th>
633
+ wp fifu image --height-ignore &lt;string&gt;
634
+ </th>
635
+ <th>
636
+ #id, .class, ...
637
+ </th>
638
+ </tr>
639
+ <tr class="color">
640
+ <th>
641
+ <?php $fifu['tab']['image']() ?>
642
+ </th>
643
+ <th>
644
+ <?php $fifu['title']['replace']() ?>
645
+ </th>
646
+ <th></th>
647
+ <th>
648
+ wp fifu image --replace &lt;string&gt;
649
+ </th>
650
+ <th>
651
+ https://...
652
+ </th>
653
+ </tr>
654
+ <tr class="color">
655
+ <th>
656
+ <?php $fifu['tab']['image']() ?>
657
+ </th>
658
+ <th>
659
+ <?php $fifu['title']['hover']() ?>
660
+ </th>
661
+ <th>
662
+ <?php $fifu['word']['effect']() ?>
663
+ </th>
664
+ <th>
665
+ wp fifu image --hover-effect &lt;string&gt;
666
+ </th>
667
+ <th>
668
+ hover17, hover02, ..
669
+ </th>
670
+ </tr>
671
+ <tr class="color">
672
+ <th>
673
+ <?php $fifu['tab']['image']() ?>
674
+ </th>
675
+ <th>
676
+ <?php $fifu['title']['hover']() ?>
677
+ </th>
678
+ <th>
679
+ <?php $fifu['hover']['placeholder']() ?>
680
+ </th>
681
+ <th>
682
+ wp fifu image --hover-selectors &lt;string&gt;
683
+ </th>
684
+ <th>
685
+ #id, .class, ...
686
+ </th>
687
+ </tr>
688
+ <tr class="color">
689
+ <th>
690
+ <?php $fifu['tab']['image']() ?>
691
+ </th>
692
+ <th>
693
+ <?php $fifu['title']['giphy']() ?>
694
+ </th>
695
+ <th></th>
696
+ <th>
697
+ wp fifu image --giphy &lt;toggle&gt;
698
+ </th>
699
+ <th>
700
+ on, off
701
+ </th>
702
+ </tr>
703
+ <tr class="color">
704
+ <th>
705
+ <?php $fifu['tab']['image']() ?>
706
+ </th>
707
+ <th>
708
+ <?php $fifu['title']['validation']() ?>
709
+ </th>
710
+ <th></th>
711
+ <th>
712
+ wp fifu image --validation &lt;toggle&gt;
713
+ </th>
714
+ <th>
715
+ on, off
716
+ </th>
717
+ </tr>
718
+ <tr class="color">
719
+ <th>
720
+ <?php $fifu['tab']['image']() ?>
721
+ </th>
722
+ <th>
723
+ <?php $fifu['title']['unsplash']() ?>
724
+ </th>
725
+ <th></th>
726
+ <th>
727
+ wp fifu image --unsplash-size &lt;integer&gt;
728
+ </th>
729
+ <th>
730
+ 300x400, 1920x1080...
731
+ </th>
732
+ </tr>
733
  <tr class="color">
734
  <th>
735
  <?php $fifu['tab']['shortcode']() ?>
4149
  <i class="fab fa-facebook" style="font-size:30px"></i>
4150
  </td>
4151
  <td style="width:33%;text-align:center;border-bottom: 1px solid #ddd !important">
4152
+ <i class="fab fa-instagram" style="font-size:30px"></i>
4153
  </td>
4154
  <td style="width:33%;text-align:center;border-bottom: 1px solid #ddd !important">
4155
  <i class="fas fa-tachometer-alt" style="font-size:30px"></i>
admin/strings.php CHANGED
@@ -88,6 +88,9 @@ function fifu_get_strings_settings() {
88
  $fifu['word']['delimiter'] = function() {
89
  _e("Delimiter", FIFU_SLUG);
90
  };
 
 
 
91
 
92
  // where
93
  $fifu['where']['page'] = function() {
88
  $fifu['word']['delimiter'] = function() {
89
  _e("Delimiter", FIFU_SLUG);
90
  };
91
+ $fifu['word']['effect'] = function() {
92
+ _e("Effect", FIFU_SLUG);
93
+ };
94
 
95
  // where
96
  $fifu['where']['page'] = function() {
featured-image-from-url.php CHANGED
@@ -4,7 +4,7 @@
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.4.8
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
  * WC requires at least: 4.0
@@ -78,6 +78,10 @@ function fifu_upgrade($upgrader_object, $options) {
78
  }
79
  }
80
  }
 
 
 
 
81
  }
82
 
83
  add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'fifu_action_links');
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.4.9
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
  * WC requires at least: 4.0
78
  }
79
  }
80
  }
81
+ if ($options['type'] == 'core') {
82
+ fifu_db_change_url_length();
83
+ fifu_db_fix_guid();
84
+ }
85
  }
86
 
87
  add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'fifu_action_links');
includes/attachment.php CHANGED
@@ -160,7 +160,7 @@ function fifu_add_size($image, $size) {
160
  if (isset(wp_get_registered_image_subsizes()[$size]['crop']))
161
  $crop = wp_get_registered_image_subsizes()[$size]['crop'];
162
 
163
- if (!$width || !$height)
164
  return $image;
165
 
166
  // skip
160
  if (isset(wp_get_registered_image_subsizes()[$size]['crop']))
161
  $crop = wp_get_registered_image_subsizes()[$size]['crop'];
162
 
163
+ if (!$width && !$height)
164
  return $image;
165
 
166
  // skip
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.4.8
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -197,20 +197,20 @@ Supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr and Publiti
197
 
198
  == Changelog ==
199
 
 
 
 
200
  = 3.4.8 =
201
  * Notice: for users with Instagram images; improvement: 20 new WP-CLI commands added; fix: Unsplash random image.
202
 
203
  = 3.4.7 =
204
  * Fix: undefined variables.
205
 
206
- = 3.4.6 =
207
- * Improvement: 35 new WP-CLI commands added; new integration function: fifu_dev_set_image_list(); fix: conflict with AMP + Jetpack; fix: expired Instagram URLs.
208
-
209
  = others =
210
  * [more](https://fifu.app/changelog/)
211
 
212
 
213
  == Upgrade Notice ==
214
 
215
- = 3.4.8 =
216
- * Notice: for users with Instagram images; improvement: 20 new WP-CLI commands added; fix: Unsplash random image.
4
  Tags: featured, image, url, woocommerce, thumbnail
5
  Requires at least: 5.3
6
  Tested up to: 5.6
7
+ Stable tag: 3.4.9
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
197
 
198
  == Changelog ==
199
 
200
+ = 3.4.9 =
201
+ * 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).
202
+
203
  = 3.4.8 =
204
  * Notice: for users with Instagram images; improvement: 20 new WP-CLI commands added; fix: Unsplash random image.
205
 
206
  = 3.4.7 =
207
  * Fix: undefined variables.
208
 
 
 
 
209
  = others =
210
  * [more](https://fifu.app/changelog/)
211
 
212
 
213
  == Upgrade Notice ==
214
 
215
+ = 3.4.9 =
216
+ * 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).