Featured Image From URL - Version 3.4.4

Version Description

  • New option: Reset Settings; deprecated: option to show the external images in the Media Library.
Download this release

Release Info

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

Code changes from version 3.4.3 to 3.4.4

admin/html/menu.html CHANGED
@@ -41,16 +41,13 @@
41
  </div>
42
 
43
  <div class="box">
44
- <h2><?php $fifu['title']['library']() ?></h2>
45
  <div class="greybox">
46
- <?php $fifu['library']['desc']() ?>
47
- <br>
48
- <br>
49
- <b><?php $fifu['detail']['important']() ?></b>: <?php $fifu['library']['important']() ?>
50
  </div>
51
  <br>
52
  <form
53
- id="fifu_form_media_library"
54
  action="javascript:void(0)"
55
  method="post">
56
  <table>
@@ -59,19 +56,23 @@
59
  <input
60
  type="submit"
61
  href="javascript:void(0)"
62
- id="fifu_toggle_media_library"
63
- onclick="invert('media_library')"
64
- name="fifu_toggle_media_library"
65
- class="<?php echo $enable_media_library; ?>"
 
 
 
 
66
  value=""
67
  style="display:block;border:none">
68
 
69
  <input
70
  type="hidden"
71
- id="fifu_input_media_library"
72
- name="fifu_input_media_library"
73
  value="" ></td>
74
- <td></td>
75
  </tr>
76
  </table>
77
  </form>
41
  </div>
42
 
43
  <div class="box">
44
+ <h2><?php $fifu['title']['reset']() ?></h2>
45
  <div class="greybox">
46
+ <?php $fifu['reset']['desc']() ?>
 
 
 
47
  </div>
48
  <br>
49
  <form
50
+ id="fifu_form_reset"
51
  action="javascript:void(0)"
52
  method="post">
53
  <table>
56
  <input
57
  type="submit"
58
  href="javascript:void(0)"
59
+ id="fifu_toggle_reset"
60
+ onclick="invert('reset');
61
+ jQuery('#tabs-top').block({message: '<?php $fifu['message']['wait']() ?>', css: {backgroundColor: 'none', border: 'none', color: 'white'}});
62
+ setTimeout(function () {
63
+ location.reload()
64
+ }, 5000);";
65
+ name="fifu_toggle_reset"
66
+ class="<?php echo $enable_reset; ?>"
67
  value=""
68
  style="display:block;border:none">
69
 
70
  <input
71
  type="hidden"
72
+ id="fifu_input_reset"
73
+ name="fifu_input_reset"
74
  value="" ></td>
75
+ <td><?php $fifu['reset']['reset']() ?></td>
76
  </tr>
77
  </table>
78
  </form>
admin/html/support-data.html CHANGED
@@ -39,10 +39,10 @@ fifu_hide_cpt:<?php echo $enable_hide_cpt ?>;
39
  fifu_hide_page:<?php echo $enable_hide_page ?>;
40
  fifu_hide_post:<?php echo $enable_hide_post ?>;
41
  fifu_lazy:<?php echo $enable_lazy ?>;
42
- fifu_media_library:<?php echo $enable_media_library ?>;
43
  fifu_ovw_first:<?php echo $enable_ovw_first ?>;
44
  fifu_pop_first:<?php echo $enable_pop_first ?>;
45
  fifu_query_strings:<?php echo $enable_query_strings ?>;
 
46
  fifu_run_delete_all:<?php echo $enable_run_delete_all ?>;
47
  fifu_run_delete_all_time:<?php echo $enable_run_delete_all_time ?>;
48
  fifu_social:<?php echo $enable_social ?>;
39
  fifu_hide_page:<?php echo $enable_hide_page ?>;
40
  fifu_hide_post:<?php echo $enable_hide_post ?>;
41
  fifu_lazy:<?php echo $enable_lazy ?>;
 
42
  fifu_ovw_first:<?php echo $enable_ovw_first ?>;
43
  fifu_pop_first:<?php echo $enable_pop_first ?>;
44
  fifu_query_strings:<?php echo $enable_query_strings ?>;
45
+ fifu_reset:<?php echo $enable_reset ?>;
46
  fifu_run_delete_all:<?php echo $enable_run_delete_all ?>;
47
  fifu_run_delete_all_time:<?php echo $enable_run_delete_all_time ?>;
48
  fifu_social:<?php echo $enable_social ?>;
admin/menu.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- define('FIFU_SETTINGS', serialize(array('fifu_social', 'fifu_social_image_only', 'fifu_lazy', 'fifu_media_library', 'fifu_content', 'fifu_content_page', 'fifu_enable_default_url', 'fifu_spinner_db', 'fifu_spinner_nth', 'fifu_fake', 'fifu_default_url', 'fifu_wc_lbox', 'fifu_wc_zoom', 'fifu_hide_page', 'fifu_hide_post', 'fifu_hide_cpt', 'fifu_get_first', 'fifu_pop_first', 'fifu_ovw_first', 'fifu_query_strings', 'fifu_confirm_delete_all', 'fifu_run_delete_all', 'fifu_column_height', 'fifu_decode', 'fifu_grid_category', 'fifu_auto_alt', 'fifu_dynamic_alt', 'fifu_data_clean')));
4
 
5
  define('FIFU_SLUG', 'featured-image-from-url');
6
 
@@ -42,7 +42,7 @@ function fifu_support_data() {
42
  $enable_social = get_option('fifu_social');
43
  $enable_social_image_only = get_option('fifu_social_image_only');
44
  $enable_lazy = get_option('fifu_lazy');
45
- $enable_media_library = get_option('fifu_media_library');
46
  $enable_content = get_option('fifu_content');
47
  $enable_content_page = get_option('fifu_content_page');
48
  $enable_fake = get_option('fifu_fake');
@@ -94,7 +94,7 @@ function fifu_get_menu_html() {
94
  $enable_social = get_option('fifu_social');
95
  $enable_social_image_only = get_option('fifu_social_image_only');
96
  $enable_lazy = get_option('fifu_lazy');
97
- $enable_media_library = get_option('fifu_media_library');
98
  $enable_content = get_option('fifu_content');
99
  $enable_content_page = get_option('fifu_content_page');
100
  $enable_fake = get_option('fifu_fake');
@@ -136,6 +136,12 @@ function fifu_get_menu_html() {
136
  } else
137
  fifu_db_update_default_url($default_url);
138
  }
 
 
 
 
 
 
139
  }
140
 
141
  function fifu_get_menu_settings() {
@@ -143,6 +149,13 @@ function fifu_get_menu_settings() {
143
  fifu_get_setting($i);
144
  }
145
 
 
 
 
 
 
 
 
146
  function fifu_get_setting($type) {
147
  register_setting('settings-group', $type);
148
 
@@ -152,7 +165,7 @@ function fifu_get_setting($type) {
152
  $arr1000 = array('fifu_spinner_db');
153
  $arrOn = array('fifu_auto_alt', 'fifu_wc_zoom', 'fifu_wc_lbox');
154
  $arrOnNo = array('fifu_fake', 'fifu_social');
155
- $arrOffNo = array('fifu_data_clean', 'fifu_confirm_delete_all', 'fifu_run_delete_all', 'fifu_social_image_only');
156
 
157
  if (!get_option($type)) {
158
  if (in_array($type, $arrEmpty))
@@ -178,7 +191,7 @@ function fifu_update_menu_options() {
178
  fifu_update_option('fifu_input_social', 'fifu_social');
179
  fifu_update_option('fifu_input_social_image_only', 'fifu_social_image_only');
180
  fifu_update_option('fifu_input_lazy', 'fifu_lazy');
181
- fifu_update_option('fifu_input_media_library', 'fifu_media_library');
182
  fifu_update_option('fifu_input_content', 'fifu_content');
183
  fifu_update_option('fifu_input_content_page', 'fifu_content_page');
184
  fifu_update_option('fifu_input_fake', 'fifu_fake');
1
  <?php
2
 
3
+ define('FIFU_SETTINGS', serialize(array('fifu_social', 'fifu_social_image_only', 'fifu_lazy', 'fifu_reset', 'fifu_content', 'fifu_content_page', 'fifu_enable_default_url', 'fifu_spinner_db', 'fifu_spinner_nth', 'fifu_fake', 'fifu_default_url', 'fifu_wc_lbox', 'fifu_wc_zoom', 'fifu_hide_page', 'fifu_hide_post', 'fifu_hide_cpt', 'fifu_get_first', 'fifu_pop_first', 'fifu_ovw_first', 'fifu_query_strings', 'fifu_confirm_delete_all', 'fifu_run_delete_all', 'fifu_column_height', 'fifu_decode', 'fifu_grid_category', 'fifu_auto_alt', 'fifu_dynamic_alt', 'fifu_data_clean')));
4
 
5
  define('FIFU_SLUG', 'featured-image-from-url');
6
 
42
  $enable_social = get_option('fifu_social');
43
  $enable_social_image_only = get_option('fifu_social_image_only');
44
  $enable_lazy = get_option('fifu_lazy');
45
+ $enable_reset = get_option('fifu_reset');
46
  $enable_content = get_option('fifu_content');
47
  $enable_content_page = get_option('fifu_content_page');
48
  $enable_fake = get_option('fifu_fake');
94
  $enable_social = get_option('fifu_social');
95
  $enable_social_image_only = get_option('fifu_social_image_only');
96
  $enable_lazy = get_option('fifu_lazy');
97
+ $enable_reset = get_option('fifu_reset');
98
  $enable_content = get_option('fifu_content');
99
  $enable_content_page = get_option('fifu_content_page');
100
  $enable_fake = get_option('fifu_fake');
136
  } else
137
  fifu_db_update_default_url($default_url);
138
  }
139
+
140
+ // reset
141
+ if (fifu_is_on('fifu_reset')) {
142
+ fifu_reset_settings();
143
+ update_option('fifu_reset', 'toggleoff', 'no');
144
+ }
145
  }
146
 
147
  function fifu_get_menu_settings() {
149
  fifu_get_setting($i);
150
  }
151
 
152
+ function fifu_reset_settings() {
153
+ foreach (unserialize(FIFU_SETTINGS) as $i) {
154
+ if ($i != 'fifu_default_url' && $i != 'fifu_enable_default_url')
155
+ delete_option($i);
156
+ }
157
+ }
158
+
159
  function fifu_get_setting($type) {
160
  register_setting('settings-group', $type);
161
 
165
  $arr1000 = array('fifu_spinner_db');
166
  $arrOn = array('fifu_auto_alt', 'fifu_wc_zoom', 'fifu_wc_lbox');
167
  $arrOnNo = array('fifu_fake', 'fifu_social');
168
+ $arrOffNo = array('fifu_data_clean', 'fifu_confirm_delete_all', 'fifu_run_delete_all', 'fifu_reset', 'fifu_social_image_only');
169
 
170
  if (!get_option($type)) {
171
  if (in_array($type, $arrEmpty))
191
  fifu_update_option('fifu_input_social', 'fifu_social');
192
  fifu_update_option('fifu_input_social_image_only', 'fifu_social_image_only');
193
  fifu_update_option('fifu_input_lazy', 'fifu_lazy');
194
+ fifu_update_option('fifu_input_reset', 'fifu_reset');
195
  fifu_update_option('fifu_input_content', 'fifu_content');
196
  fifu_update_option('fifu_input_content_page', 'fifu_content_page');
197
  fifu_update_option('fifu_input_fake', 'fifu_fake');
admin/strings.php CHANGED
@@ -175,9 +175,6 @@ function fifu_get_strings_settings() {
175
  $fifu['title']['fields'] = function() {
176
  _e("Product Gallery", FIFU_SLUG);
177
  };
178
- $fifu['title']['library'] = function() {
179
- _e("Media Library", FIFU_SLUG);
180
- };
181
  $fifu['title']['reset'] = function() {
182
  _e("Reset Settings", FIFU_SLUG);
183
  };
@@ -447,14 +444,6 @@ function fifu_get_strings_settings() {
447
  _e("number of fields in the post editor", FIFU_SLUG);
448
  };
449
 
450
- // library
451
- $fifu['library']['desc'] = function() {
452
- _e("Show the external images in your media library.", FIFU_SLUG);
453
- };
454
- $fifu['library']['important'] = function() {
455
- _e("if some external image is not being shown in the media library, run Metadata > Save Image Dimensions.", FIFU_SLUG);
456
- };
457
-
458
  // reset
459
  $fifu['reset']['desc'] = function() {
460
  _e("Reset FIFU settings to the default configuration.", FIFU_SLUG);
@@ -775,12 +764,12 @@ function fifu_get_strings_settings() {
775
  _e("With lazy load, images and videos won't be loaded until user scrolls to them. It makes your home (or shop) faster.", FIFU_SLUG);
776
  };
777
  $fifu['lazy']['important'] = function() {
778
- _e("some themes and plugins (Jetpack for instance) have their own lazy load implementations, causing conflicts. Your images may not load if you have more than one lazy load component running at the same time.", FIFU_SLUG);
779
  };
780
 
781
  // flickr
782
  $fifu['flickr']['desc'] = function() {
783
- _e("Flickr images have thumbnails and FIFU is able to load the exactly thumbnail your site needs. The supported sizes are 75, 100, 150, 240, 320, 500, 640, 800 and 1024 px width. Larger sizes can't be used due a different URL pattern.", FIFU_SLUG);
784
  };
785
  $fifu['flickr']['important'] = function() {
786
  _e("the Lazy Load feature should be enabled.", FIFU_SLUG);
@@ -1348,4 +1337,3 @@ function fifu_get_strings_wai() {
1348
 
1349
  return $fifu;
1350
  }
1351
-
175
  $fifu['title']['fields'] = function() {
176
  _e("Product Gallery", FIFU_SLUG);
177
  };
 
 
 
178
  $fifu['title']['reset'] = function() {
179
  _e("Reset Settings", FIFU_SLUG);
180
  };
444
  _e("number of fields in the post editor", FIFU_SLUG);
445
  };
446
 
 
 
 
 
 
 
 
 
447
  // reset
448
  $fifu['reset']['desc'] = function() {
449
  _e("Reset FIFU settings to the default configuration.", FIFU_SLUG);
764
  _e("With lazy load, images and videos won't be loaded until user scrolls to them. It makes your home (or shop) faster.", FIFU_SLUG);
765
  };
766
  $fifu['lazy']['important'] = function() {
767
+ _e("some themes and plugins have their own lazy load implementations, causing conflicts. Your images may not load if you have more than one lazy load component running at the same time.", FIFU_SLUG);
768
  };
769
 
770
  // flickr
771
  $fifu['flickr']['desc'] = function() {
772
+ _e("Flickr images have thumbnails and FIFU is able to load the exact size your site needs. You just need to provide the 1024 px image URL and FIFU will alternate the image size among 75, 100, 150, 240, 320, 500, 640, 800 and 1024 px width. Larger sizes can't be used due a different URL pattern.", FIFU_SLUG);
773
  };
774
  $fifu['flickr']['important'] = function() {
775
  _e("the Lazy Load feature should be enabled.", FIFU_SLUG);
1337
 
1338
  return $fifu;
1339
  }
 
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.3
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
  * WC requires at least: 4.0
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.4
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
  * WC requires at least: 4.0
includes/attachment.php CHANGED
@@ -53,7 +53,7 @@ add_filter('posts_where', 'fifu_query_attachments');
53
 
54
  function fifu_query_attachments($where) {
55
  global $wpdb;
56
- if (isset($_POST['action']) && ($_POST['action'] == 'query-attachments') && fifu_is_off('fifu_media_library')) {
57
  $where .= ' AND ' . $wpdb->prefix . 'posts.post_author <> ' . FIFU_AUTHOR . ' ';
58
  } else
59
  $where .= ' AND (' . $wpdb->prefix . 'posts.post_author <> ' . FIFU_AUTHOR . ' OR (' . $wpdb->prefix . 'posts.post_author = ' . FIFU_AUTHOR . ' AND EXISTS (SELECT 1 FROM ' . $wpdb->prefix . 'postmeta WHERE ' . $wpdb->prefix . 'postmeta.post_id = ' . $wpdb->prefix . 'posts.id AND ' . $wpdb->prefix . 'postmeta.meta_key = "_wp_attachment_metadata")))';
@@ -62,7 +62,7 @@ function fifu_query_attachments($where) {
62
 
63
  add_filter('posts_where', function ($where, \WP_Query $q) {
64
  global $wpdb;
65
- if (is_admin() && $q->is_main_query() && fifu_is_off('fifu_media_library'))
66
  $where .= ' AND ' . $wpdb->prefix . 'posts.post_author <> ' . FIFU_AUTHOR . ' ';
67
  else
68
  $where .= ' AND (' . $wpdb->prefix . 'posts.post_author <> ' . FIFU_AUTHOR . ' OR (' . $wpdb->prefix . 'posts.post_author = ' . FIFU_AUTHOR . ' AND EXISTS (SELECT 1 FROM ' . $wpdb->prefix . 'postmeta WHERE ' . $wpdb->prefix . 'postmeta.post_id = ' . $wpdb->prefix . 'posts.id AND ' . $wpdb->prefix . 'postmeta.meta_key = "_wp_attachment_metadata")))';
53
 
54
  function fifu_query_attachments($where) {
55
  global $wpdb;
56
+ if (isset($_POST['action']) && ($_POST['action'] == 'query-attachments') && true) {
57
  $where .= ' AND ' . $wpdb->prefix . 'posts.post_author <> ' . FIFU_AUTHOR . ' ';
58
  } else
59
  $where .= ' AND (' . $wpdb->prefix . 'posts.post_author <> ' . FIFU_AUTHOR . ' OR (' . $wpdb->prefix . 'posts.post_author = ' . FIFU_AUTHOR . ' AND EXISTS (SELECT 1 FROM ' . $wpdb->prefix . 'postmeta WHERE ' . $wpdb->prefix . 'postmeta.post_id = ' . $wpdb->prefix . 'posts.id AND ' . $wpdb->prefix . 'postmeta.meta_key = "_wp_attachment_metadata")))';
62
 
63
  add_filter('posts_where', function ($where, \WP_Query $q) {
64
  global $wpdb;
65
+ if (is_admin() && $q->is_main_query() && true)
66
  $where .= ' AND ' . $wpdb->prefix . 'posts.post_author <> ' . FIFU_AUTHOR . ' ';
67
  else
68
  $where .= ' AND (' . $wpdb->prefix . 'posts.post_author <> ' . FIFU_AUTHOR . ' OR (' . $wpdb->prefix . 'posts.post_author = ' . FIFU_AUTHOR . ' AND EXISTS (SELECT 1 FROM ' . $wpdb->prefix . 'postmeta WHERE ' . $wpdb->prefix . 'postmeta.post_id = ' . $wpdb->prefix . 'posts.id AND ' . $wpdb->prefix . 'postmeta.meta_key = "_wp_attachment_metadata")))';
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: marceljm
3
  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.4.3
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -195,20 +195,20 @@ Supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr and Publiti
195
 
196
  == Changelog ==
197
 
 
 
 
198
  = 3.4.3 =
199
  * Notice: FIFU Premium has now a 30-day money-back guarantee; notice: support to WooCommerce Import and WP All Import are available only in the Premium version now; improvement: integration with User Submitted Posts plugin.
200
 
201
  = 3.4.2 =
202
  * Fix: conflict with Yoast SEO plugin (FIFU will not add social tags when Yoast have a Facebook/Twitter image on post editor); fix: conflict with Jetpack plugin (FIFU was getting CDN images even when Jetpack performance settings were disabled).
203
 
204
- = 3.4.1 =
205
- * Fix: Instagram URLs.
206
-
207
  = others =
208
  * [more](https://fifu.app/changelog/)
209
 
210
 
211
  == Upgrade Notice ==
212
 
213
- = 3.4.3 =
214
- * Notice: FIFU Premium has now a 30-day money-back guarantee; notice: support to WooCommerce Import and WP All Import are available only in the Premium version now; improvement: integration with User Submitted Posts plugin.
3
  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.4
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
195
 
196
  == Changelog ==
197
 
198
+ = 3.4.4 =
199
+ * New option: Reset Settings; deprecated: option to show the external images in the Media Library.
200
+
201
  = 3.4.3 =
202
  * Notice: FIFU Premium has now a 30-day money-back guarantee; notice: support to WooCommerce Import and WP All Import are available only in the Premium version now; improvement: integration with User Submitted Posts plugin.
203
 
204
  = 3.4.2 =
205
  * Fix: conflict with Yoast SEO plugin (FIFU will not add social tags when Yoast have a Facebook/Twitter image on post editor); fix: conflict with Jetpack plugin (FIFU was getting CDN images even when Jetpack performance settings were disabled).
206
 
 
 
 
207
  = others =
208
  * [more](https://fifu.app/changelog/)
209
 
210
 
211
  == Upgrade Notice ==
212
 
213
+ = 3.4.4 =
214
+ * New option: Reset Settings; deprecated: option to show the external images in the Media Library.