Featured Image From URL - Version 4.1.9

Version Description

  • New option: Auto set featured media from post content > post types; enhancement: Featured Video (supports Odysee videos now); fix: CDN + Optimized Thumbnails > apply to content images (low resolution images); deprecated: Gallery Icon.
Download this release

Release Info

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

Code changes from version 4.1.8 to 4.1.9

admin/cli-commands.php CHANGED
@@ -20,6 +20,10 @@ class fifu_cli extends WP_CLI_Command {
20
  update_option('fifu_skip', $args[0], 'no');
21
  return;
22
  }
 
 
 
 
23
  if (!empty($assoc_args['hide'])) {
24
  switch ($args[0]) {
25
  case 'on':
20
  update_option('fifu_skip', $args[0], 'no');
21
  return;
22
  }
23
+ if (!empty($assoc_args['cpt'])) {
24
+ update_option('fifu_html_cpt', $args[0], 'no');
25
+ return;
26
+ }
27
  if (!empty($assoc_args['hide'])) {
28
  switch ($args[0]) {
29
  case 'on':
admin/html/menu.html CHANGED
@@ -266,6 +266,21 @@
266
  </th>
267
  <th>abcd,xyz,...</th>
268
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  <tr class="color">
270
  <th>
271
  <?php $fifu['tab']['auto']() ?>
@@ -1613,38 +1628,6 @@
1613
  on, off
1614
  </th>
1615
  </tr>
1616
- <tr class="color">
1617
- <th>
1618
- <?php $fifu['tab']['video']() ?>
1619
- </th>
1620
- <th>
1621
- <?php $fifu['title']['icon']() ?>
1622
- </th>
1623
- <th></th>
1624
- <th>
1625
- wp fifu video --icon &lt;toggle&gt;
1626
- </th>
1627
- <th>
1628
- on, off
1629
- </th>
1630
- </tr>
1631
- <tr class="color">
1632
- <th>
1633
- <?php $fifu['tab']['video']() ?>
1634
- </th>
1635
- <th>
1636
- <?php $fifu['title']['icon']() ?>
1637
- </th>
1638
- <th>
1639
- <?php $fifu['icon']['css']() ?>
1640
- </th>
1641
- <th>
1642
- wp fifu video --icon-selector &lt;string&gt;
1643
- </th>
1644
- <th>
1645
- #id, .class, ...
1646
- </th>
1647
- </tr>
1648
  <tr class="color">
1649
  <th>
1650
  <?php $fifu['tab']['key']() ?>
@@ -2428,6 +2411,26 @@
2428
  </form>
2429
  </th>
2430
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2431
  </table>
2432
  </div>
2433
 
@@ -4350,41 +4353,6 @@
4350
  </tr>
4351
  </table>
4352
  </div>
4353
-
4354
- <div class="box">
4355
- <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>
4356
- <div class="fifu-cloud-details"><span class="dashicons dashicons-cloud fifu-cloud-details-icon" title="<?php $fifu['cloud']['details']['play']() ?>"></span></div>
4357
- <h2><?php $fifu['title']['icon']() ?></h2>
4358
- <div class="greybox" id="grad2">
4359
- <?php $fifu['icon']['desc']() ?>
4360
- <br>
4361
- <br>
4362
- <input id="fifu_input_gallery_selector"
4363
- type="text"
4364
- name="fifu_input_gallery_selector"
4365
- placeholder="<?php $fifu['icon']['css']() ?>"
4366
- title="<?php $fifu['icon']['css']() ?>"
4367
- value=""
4368
- style="width:50%;min-height:24px;line-height:0;">
4369
-
4370
- <input type="submit" value="<?php $fifu['button']['submit']() ?>" disabled>
4371
-
4372
- <span class="dashicons dashicons-editor-help" style="font-size: 25px;" title="<?php printf($fifu['icon']['info'](), 'ol.flex-control-thumbs'); ?>"></span>
4373
- </div>
4374
- <br>
4375
- <table style="text-align:left">
4376
- <tr>
4377
- <th>
4378
- <input
4379
- type="submit"
4380
- href="javascript:void(0)"
4381
- class="toggleoff"
4382
- value=""
4383
- style="display:block;border:none">
4384
- </th>
4385
- </tr>
4386
- </table>
4387
- </div>
4388
  </div>
4389
  <div id="tabs-m">
4390
  <div class="box">
266
  </th>
267
  <th>abcd,xyz,...</th>
268
  </tr>
269
+ <tr class="color">
270
+ <th>
271
+ <?php $fifu['tab']['auto']() ?>
272
+ </th>
273
+ <th>
274
+ <?php $fifu['title']['html']() ?>
275
+ </th>
276
+ <th>
277
+ <?php $fifu['html']['cpt']['desc']() ?>
278
+ </th>
279
+ <th>
280
+ wp fifu content --cpt &lt;string&gt;
281
+ </th>
282
+ <th>post,page,...</th>
283
+ </tr>
284
  <tr class="color">
285
  <th>
286
  <?php $fifu['tab']['auto']() ?>
1628
  on, off
1629
  </th>
1630
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1631
  <tr class="color">
1632
  <th>
1633
  <?php $fifu['tab']['key']() ?>
2411
  </form>
2412
  </th>
2413
  </tr>
2414
+ <tr>
2415
+ <th>
2416
+ <?php $fifu['html']['cpt']['desc']() ?>
2417
+ </th>
2418
+ <th>
2419
+ <form
2420
+ id="fifu_form_html_cpt"
2421
+ action="javascript:void(0)"
2422
+ method="post">
2423
+ <?php wp_nonce_field(FIFU_ACTION_SETTINGS, 'nonce_fifu_form_html_cpt'); ?>
2424
+ <input id="fifu_input_html_cpt"
2425
+ type="text"
2426
+ name="fifu_input_html_cpt"
2427
+ style="width:358px"
2428
+ value="<?php echo $html_cpt; ?>"
2429
+ placeholder="<?php $fifu['html']['cpt']['placeholder']() ?>">
2430
+ <input type="submit" value="<?php $fifu['button']['ok']() ?>" style="width:72px">
2431
+ </form>
2432
+ </th>
2433
+ </tr>
2434
  </table>
2435
  </div>
2436
 
4353
  </tr>
4354
  </table>
4355
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4356
  </div>
4357
  <div id="tabs-m">
4358
  <div class="box">
admin/html/support-data.html CHANGED
@@ -44,6 +44,7 @@ fifu_grid_category:<?php echo $enable_grid_category ?>;
44
  fifu_hide_cpt:<?php echo $enable_hide_cpt ?>;
45
  fifu_hide_page:<?php echo $enable_hide_page ?>;
46
  fifu_hide_post:<?php echo $enable_hide_post ?>;
 
47
  fifu_lazy:<?php echo $enable_lazy ?>;
48
  fifu_ovw_first:<?php echo $enable_ovw_first ?>;
49
  fifu_photon:<?php echo $enable_photon ?>;
44
  fifu_hide_cpt:<?php echo $enable_hide_cpt ?>;
45
  fifu_hide_page:<?php echo $enable_hide_page ?>;
46
  fifu_hide_post:<?php echo $enable_hide_post ?>;
47
+ fifu_html_cpt:<?php echo $html_cpt ?>;
48
  fifu_lazy:<?php echo $enable_lazy ?>;
49
  fifu_ovw_first:<?php echo $enable_ovw_first ?>;
50
  fifu_photon:<?php echo $enable_photon ?>;
admin/html/troubleshooting.html CHANGED
@@ -940,7 +940,7 @@
940
  </table>
941
  <div class="greybox" style="position: relative; top: -10px">
942
  Showing external images on "Related Posts":<br>
943
- x) there is no local solution. Jetpack Related Posts documentation informs: "we do all the analysis, processing, and serving from our cloud". It means Jetpack would need to adapt its web service to work with the images provided by FIFU. So you may contact Jetpack support or install an alternative plugin for Related Posts, like <a href="https://wordpress.org/plugins/related-posts-thumbnails/">this</a>.<br>
944
  </div>
945
  </div>
946
  <div class="box">
940
  </table>
941
  <div class="greybox" style="position: relative; top: -10px">
942
  Showing external images on "Related Posts":<br>
943
+ x) there is no local solution. Jetpack Related Posts documentation informs: "we do all the analysis, processing, and serving from our cloud". It means Jetpack would need to adapt its web service to work with the images provided by FIFU. So you may contact Jetpack support, install an alternative plugin for Related Posts, like <a href="https://wordpress.org/plugins/related-posts-thumbnails/">this</a>, or try this <a href="https://wordpress.org/support/topic/featured-image-from-url-with-jetpack-related-posts/">snippet</a> (untested).<br>
944
  </div>
945
  </div>
946
  <div class="box">
admin/menu.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- define('FIFU_SETTINGS', serialize(array('fifu_social', 'fifu_social_image_only', 'fifu_skip', 'fifu_lazy', 'fifu_photon', 'fifu_cdn_social', 'fifu_cdn_crop', 'fifu_cdn_content', 'fifu_reset', 'fifu_content', 'fifu_content_page', 'fifu_content_cpt', 'fifu_enable_default_url', 'fifu_spinner_nth', 'fifu_fake', 'fifu_default_url', 'fifu_default_cpt', '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_run_delete_all', 'fifu_decode', 'fifu_check', 'fifu_grid_category', 'fifu_auto_alt', 'fifu_dynamic_alt', 'fifu_data_clean')));
4
  define('FIFU_ACTION_SETTINGS', '/wp-admin/admin.php?page=featured-image-from-url');
5
 
6
  define('FIFU_SLUG', 'featured-image-from-url');
@@ -102,6 +102,7 @@ function fifu_support_data() {
102
  $enable_social = get_option('fifu_social');
103
  $enable_social_image_only = get_option('fifu_social_image_only');
104
  $skip = esc_attr(get_option('fifu_skip'));
 
105
  $enable_lazy = get_option('fifu_lazy');
106
  $enable_photon = get_option('fifu_photon');
107
  $enable_cdn_social = get_option('fifu_cdn_social');
@@ -158,6 +159,7 @@ function fifu_get_menu_html() {
158
  $enable_social = get_option('fifu_social');
159
  $enable_social_image_only = get_option('fifu_social_image_only');
160
  $skip = esc_attr(get_option('fifu_skip'));
 
161
  $enable_lazy = get_option('fifu_lazy');
162
  $enable_photon = get_option('fifu_photon');
163
  $enable_cdn_social = get_option('fifu_cdn_social');
@@ -233,7 +235,7 @@ function fifu_get_setting($type) {
233
  register_setting('settings-group', $type);
234
 
235
  $arr1 = array('fifu_spinner_nth');
236
- $arrEmpty = array('fifu_default_url', 'fifu_skip');
237
  $arrDefaultType = array('fifu_default_cpt');
238
  $arrOn = array('fifu_wc_zoom', 'fifu_wc_lbox');
239
  $arrOnNo = array('fifu_fake', 'fifu_social');
@@ -267,6 +269,9 @@ function fifu_update_menu_options() {
267
  if (fifu_is_valid_nonce('nonce_fifu_form_skip'))
268
  fifu_update_option('fifu_input_skip', 'fifu_skip');
269
 
 
 
 
270
  if (fifu_is_valid_nonce('nonce_fifu_form_lazy'))
271
  fifu_update_option('fifu_input_lazy', 'fifu_lazy');
272
 
@@ -405,7 +410,7 @@ function fifu_update_option($input, $field) {
405
  return;
406
  }
407
 
408
- $arr_text = array('fifu_default_cpt', 'fifu_skip');
409
  if (in_array($field, $arr_text))
410
  update_option($field, sanitize_text_field($value));
411
  }
1
  <?php
2
 
3
+ define('FIFU_SETTINGS', serialize(array('fifu_social', 'fifu_social_image_only', 'fifu_skip', 'fifu_html_cpt', 'fifu_lazy', 'fifu_photon', 'fifu_cdn_social', 'fifu_cdn_crop', 'fifu_cdn_content', 'fifu_reset', 'fifu_content', 'fifu_content_page', 'fifu_content_cpt', 'fifu_enable_default_url', 'fifu_spinner_nth', 'fifu_fake', 'fifu_default_url', 'fifu_default_cpt', '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_run_delete_all', 'fifu_decode', 'fifu_check', 'fifu_grid_category', 'fifu_auto_alt', 'fifu_dynamic_alt', 'fifu_data_clean')));
4
  define('FIFU_ACTION_SETTINGS', '/wp-admin/admin.php?page=featured-image-from-url');
5
 
6
  define('FIFU_SLUG', 'featured-image-from-url');
102
  $enable_social = get_option('fifu_social');
103
  $enable_social_image_only = get_option('fifu_social_image_only');
104
  $skip = esc_attr(get_option('fifu_skip'));
105
+ $html_cpt = esc_attr(get_option('fifu_html_cpt'));
106
  $enable_lazy = get_option('fifu_lazy');
107
  $enable_photon = get_option('fifu_photon');
108
  $enable_cdn_social = get_option('fifu_cdn_social');
159
  $enable_social = get_option('fifu_social');
160
  $enable_social_image_only = get_option('fifu_social_image_only');
161
  $skip = esc_attr(get_option('fifu_skip'));
162
+ $html_cpt = esc_attr(get_option('fifu_html_cpt'));
163
  $enable_lazy = get_option('fifu_lazy');
164
  $enable_photon = get_option('fifu_photon');
165
  $enable_cdn_social = get_option('fifu_cdn_social');
235
  register_setting('settings-group', $type);
236
 
237
  $arr1 = array('fifu_spinner_nth');
238
+ $arrEmpty = array('fifu_default_url', 'fifu_skip', 'fifu_html_cpt');
239
  $arrDefaultType = array('fifu_default_cpt');
240
  $arrOn = array('fifu_wc_zoom', 'fifu_wc_lbox');
241
  $arrOnNo = array('fifu_fake', 'fifu_social');
269
  if (fifu_is_valid_nonce('nonce_fifu_form_skip'))
270
  fifu_update_option('fifu_input_skip', 'fifu_skip');
271
 
272
+ if (fifu_is_valid_nonce('nonce_fifu_form_html_cpt'))
273
+ fifu_update_option('fifu_input_html_cpt', 'fifu_html_cpt');
274
+
275
  if (fifu_is_valid_nonce('nonce_fifu_form_lazy'))
276
  fifu_update_option('fifu_input_lazy', 'fifu_lazy');
277
 
410
  return;
411
  }
412
 
413
+ $arr_text = array('fifu_default_cpt', 'fifu_skip', 'fifu_html_cpt');
414
  if (in_array($field, $arr_text))
415
  update_option($field, sanitize_text_field($value));
416
  }
admin/meta-box.php CHANGED
@@ -117,7 +117,7 @@ function fifu_remove_first_image($data, $postarr) {
117
  return $data;
118
 
119
  $post_id = $postarr['ID'];
120
- if (fifu_has_local_featured_image($post_id))
121
  return $data;
122
 
123
  $content = $postarr['post_content'];
@@ -180,7 +180,7 @@ function fifu_save_properties($post_id) {
180
  $url = esc_url_raw(rtrim($_POST['fifu_input_url']));
181
  if (!$ignore) {
182
  $first = fifu_first_url_in_content($post_id);
183
- if ($first && fifu_is_on('fifu_get_first') && (!$url || fifu_is_on('fifu_ovw_first')) && !fifu_has_local_featured_image($post_id))
184
  $url = $first;
185
  }
186
  fifu_update_or_delete($post_id, 'fifu_image_url', $url);
117
  return $data;
118
 
119
  $post_id = $postarr['ID'];
120
+ if (fifu_has_local_featured_image($post_id) || !fifu_is_valid_cpt($post_id))
121
  return $data;
122
 
123
  $content = $postarr['post_content'];
180
  $url = esc_url_raw(rtrim($_POST['fifu_input_url']));
181
  if (!$ignore) {
182
  $first = fifu_first_url_in_content($post_id);
183
+ if ($first && fifu_is_on('fifu_get_first') && (!$url || fifu_is_on('fifu_ovw_first')) && !fifu_has_local_featured_image($post_id) && fifu_is_valid_cpt($post_id))
184
  $url = $first;
185
  }
186
  fifu_update_or_delete($post_id, 'fifu_image_url', $url);
admin/strings.php CHANGED
@@ -342,9 +342,6 @@ function fifu_get_strings_settings() {
342
  $fifu['title']['privacy'] = function () {
343
  _e("Privacy Enhanced Mode", FIFU_SLUG);
344
  };
345
- $fifu['title']['icon'] = function () {
346
- _e("Gallery Icon", FIFU_SLUG);
347
- };
348
  $fifu['title']['zoom'] = function () {
349
  _e("Lightbox and Zoom", FIFU_SLUG);
350
  };
@@ -904,6 +901,12 @@ function fifu_get_strings_settings() {
904
  $fifu['html']['skip']['placeholder'] = function () {
905
  _e("example.com,anotherexample,onemore", FIFU_SLUG);
906
  };
 
 
 
 
 
 
907
 
908
  // all
909
  $fifu['all']['desc'] = function () {
@@ -1291,7 +1294,7 @@ function fifu_get_strings_settings() {
1291
 
1292
  // video
1293
  $fifu['video']['desc'] = function () {
1294
- _e("FIFU supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr, Publitio, JW Player, VideoPress and Sprout. External and local video files are supported as well.", FIFU_SLUG);
1295
  };
1296
  $fifu['video']['tab']['video'] = function () {
1297
  _e("Featured video", FIFU_SLUG);
@@ -1358,17 +1361,6 @@ function fifu_get_strings_settings() {
1358
  _e("The Privacy Enhanced Mode of the YouTube embedded player prevents the use of views of embedded YouTube content from influencing the viewer’s browsing experience on YouTube.", FIFU_SLUG);
1359
  };
1360
 
1361
- // icon
1362
- $fifu['icon']['desc'] = function () {
1363
- _e("Add icons to the video thumbnails in the WooCommerce gallery.", FIFU_SLUG);
1364
- };
1365
- $fifu['icon']['css'] = function () {
1366
- _e("CSS selector", FIFU_SLUG);
1367
- };
1368
- $fifu['icon']['info'] = function () {
1369
- _e("In order to FIFU identify your gallery, it's necessary to inform its CSS selector here. The default value is ol.flex-control-thumbs, but you may need a different selector if your theme overwrites the original WooCommerce layout.", FIFU_SLUG);
1370
- };
1371
-
1372
  // zoom
1373
  $fifu['zoom']['desc'] = function () {
1374
  _e("Disable lightbox and zoom from image gallery.", FIFU_SLUG);
342
  $fifu['title']['privacy'] = function () {
343
  _e("Privacy Enhanced Mode", FIFU_SLUG);
344
  };
 
 
 
345
  $fifu['title']['zoom'] = function () {
346
  _e("Lightbox and Zoom", FIFU_SLUG);
347
  };
901
  $fifu['html']['skip']['placeholder'] = function () {
902
  _e("example.com,anotherexample,onemore", FIFU_SLUG);
903
  };
904
+ $fifu['html']['cpt']['desc'] = function () {
905
+ _e("post types", FIFU_SLUG);
906
+ };
907
+ $fifu['html']['cpt']['placeholder'] = function () {
908
+ _e("post,page,product", FIFU_SLUG);
909
+ };
910
 
911
  // all
912
  $fifu['all']['desc'] = function () {
1294
 
1295
  // video
1296
  $fifu['video']['desc'] = function () {
1297
+ _e("FIFU supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr, Publitio, JW Player, VideoPress, Sprout and Odysee. External and local video files are supported as well.", FIFU_SLUG);
1298
  };
1299
  $fifu['video']['tab']['video'] = function () {
1300
  _e("Featured video", FIFU_SLUG);
1361
  _e("The Privacy Enhanced Mode of the YouTube embedded player prevents the use of views of embedded YouTube content from influencing the viewer’s browsing experience on YouTube.", FIFU_SLUG);
1362
  };
1363
 
 
 
 
 
 
 
 
 
 
 
 
1364
  // zoom
1365
  $fifu['zoom']['desc'] = function () {
1366
  _e("Disable lightbox and zoom from image gallery.", FIFU_SLUG);
featured-image-from-url.php CHANGED
@@ -3,8 +3,8 @@
3
  /*
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.8
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
  * WC requires at least: 4.0
3
  /*
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 of a post or WooCommerce product.
7
+ * Version: 4.1.9
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 (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
  }
53
 
54
  function fifu_query_attachments($where) {
55
  global $wpdb;
56
+ if (fifu_is_web_story() || (isset($_POST['action']) && ($_POST['action'] == 'query-attachments' || $_POST['action'] == 'get-attachment')))
57
  $where .= ' AND ' . $wpdb->prefix . 'posts.post_author <> ' . FIFU_AUTHOR . ' ';
58
  return $where;
59
  }
includes/external-post.php CHANGED
@@ -8,7 +8,7 @@ function fifu_remove_first_image_ext($data, $postarr) {
8
  return $data;
9
 
10
  $post_id = $postarr['ID'];
11
- if (fifu_has_local_featured_image($post_id))
12
  return $data;
13
 
14
  $content = $postarr['post_content'];
@@ -36,7 +36,7 @@ function fifu_save_properties_ext($post_id) {
36
 
37
  $url = esc_url_raw(rtrim(fifu_first_url_in_content($post_id)));
38
 
39
- if ((!isset($_POST['action']) || $_POST['action'] != 'elementor_ajax') && $url && fifu_is_on('fifu_get_first') && !fifu_has_local_featured_image($post_id)) {
40
  update_post_meta($post_id, 'fifu_image_url', fifu_convert($url));
41
  fifu_db_update_fake_attach_id($post_id);
42
  return;
8
  return $data;
9
 
10
  $post_id = $postarr['ID'];
11
+ if (fifu_has_local_featured_image($post_id) || !fifu_is_valid_cpt($post_id))
12
  return $data;
13
 
14
  $content = $postarr['post_content'];
36
 
37
  $url = esc_url_raw(rtrim(fifu_first_url_in_content($post_id)));
38
 
39
+ if ((!isset($_POST['action']) || $_POST['action'] != 'elementor_ajax') && $url && fifu_is_on('fifu_get_first') && !fifu_has_local_featured_image($post_id) && fifu_is_valid_cpt($post_id)) {
40
  update_post_meta($post_id, 'fifu_image_url', fifu_convert($url));
41
  fifu_db_update_fake_attach_id($post_id);
42
  return;
includes/jetpack.php CHANGED
@@ -31,7 +31,7 @@ function fifu_jetpack_blocked($url) {
31
  if (fifu_is_photon_url($url))
32
  return true;
33
 
34
- $blocklist = array('localhost', 'amazon-adsystem.com', 'sapo.io', 'i.guim.co.uk', 's.yimg.com', 's1.yimg.com', 'www.washingtonpost.com', 'pbs.twimg.com', 'www.aljazeera.com', 'image.influenster.com', 'api.screenshotmachine.com', 'rackcdn.com', 'googleusercontent.com', 'drive.google.com', 'img.brownsfashion.com', 'accounts.parrotproducts.biz', 'www.dropbox.com', 'fbcdn.net', 'teespring.com', 'cdn.fifu.app', 'cloud.fifu.app', 'images.placeholders.dev');
35
  foreach ($blocklist as $domain) {
36
  if (strpos($url, $domain) !== false)
37
  return true;
31
  if (fifu_is_photon_url($url))
32
  return true;
33
 
34
+ $blocklist = array('localhost', 'amazon-adsystem.com', 'sapo.io', 'i.guim.co.uk', 's.yimg.com', 's1.yimg.com', 'www.washingtonpost.com', 'pbs.twimg.com', 'www.aljazeera.com', 'image.influenster.com', 'api.screenshotmachine.com', 'rackcdn.com', 'googleusercontent.com', 'drive.google.com', 'img.brownsfashion.com', 'accounts.parrotproducts.biz', 'www.dropbox.com', 'fbcdn.net', 'teespring.com', 'nitrocdn.com', 'cdn.fifu.app', 'cloud.fifu.app', 'images.placeholders.dev');
35
  foreach ($blocklist as $domain) {
36
  if (strpos($url, $domain) !== false)
37
  return true;
includes/thumbnail.php CHANGED
@@ -264,7 +264,15 @@ function fifu_optimize_content($content) {
264
  $new_url = fifu_jetpack_photon_url($url, null);
265
  $newImgItem = str_replace($url, $new_url, html_entity_decode($imgItem));
266
  $srcset = fifu_jetpack_get_set($new_url, false);
267
- $newImgItem = str_replace(' src=', ' class="lazyload" data-sizes="auto" data-srcset="' . $srcset . '" data-src=', $newImgItem);
 
 
 
 
 
 
 
 
268
  $content = str_replace($imgItem, $newImgItem, $content);
269
  }
270
  return $content;
264
  $new_url = fifu_jetpack_photon_url($url, null);
265
  $newImgItem = str_replace($url, $new_url, html_entity_decode($imgItem));
266
  $srcset = fifu_jetpack_get_set($new_url, false);
267
+
268
+ // fix lazy sizes (conflict with alt)
269
+ $css = 'style="display:block"';
270
+ if (strpos($newImgItem, 'style=') !== false) {
271
+ $newImgItem = str_replace(' style="', ' style="display:block;', $newImgItem);
272
+ $css = '';
273
+ }
274
+
275
+ $newImgItem = str_replace(' src=', ' ' . $css . ' class="lazyload" data-sizes="auto" data-srcset="' . $srcset . '" data-src=', $newImgItem);
276
  $content = str_replace($imgItem, $newImgItem, $content);
277
  }
278
  return $content;
includes/util.php CHANGED
@@ -144,6 +144,21 @@ function fifu_is_amp_request() {
144
  return function_exists('amp_is_request') && amp_is_request();
145
  }
146
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  // developers
148
 
149
  function fifu_dev_set_image($post_id, $image_url) {
144
  return function_exists('amp_is_request') && amp_is_request();
145
  }
146
 
147
+ function fifu_is_valid_cpt($post_id) {
148
+ $types = get_option('fifu_html_cpt');
149
+ if (!$types)
150
+ return true;
151
+
152
+ $types = explode(',', $types);
153
+ $type = get_post_type($post_id);
154
+
155
+ foreach ($types as $t) {
156
+ if ($t == $type)
157
+ return true;
158
+ }
159
+ return false;
160
+ }
161
+
162
  // developers
163
 
164
  function fifu_dev_set_image($post_id, $image_url) {
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: marceljm
3
  Donate link: https://donorbox.org/fifu
4
  Tags: featured, image, url, video, woocommerce
5
  Requires at least: 5.3
6
- Tested up to: 6.1
7
- Stable tag: 4.1.8
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -81,7 +81,7 @@ Use an external image as featured image of your post, page or custom post type.
81
  * **[PRO]** Fast Buy
82
 
83
  #### FEATURED VIDEO
84
- Supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr, Publitio, JW Player, VideoPress and Sprout. External and local video files are supported as well.
85
 
86
  * **[PRO]** Featured video
87
  * **[PRO]** Video thumbnail
@@ -260,20 +260,20 @@ Featured Image, Figurë e Zgjedhur, Image mise en avant, Uitgelichte afbeelding,
260
 
261
  == Changelog ==
262
 
 
 
 
263
  = 4.1.8 =
264
  * Enhancement: Page Redirection (works with local images now); fix: conflict with Search Filter Pro plugin; deprecated: Media RSS Tags > Width; deprecated: Schedule Metadata Generation > Interval; deprecated: Delete All URLs > Confirm.
265
 
266
  = 4.1.7 =
267
  * Enhancement: deactivate itself when the PRO version is activated; fix: Lazy Load (conflict with Oxygen plugin); deprecated: Metadata > Database.
268
 
269
- = 4.1.6 =
270
- * New: feedback form on plugin deactivation; enhancement: Clean Metadata (option added to the new deactivation lightbox); enhancement: WP All Import (more documentation added); fix: Auto set featured media from post content (unduly overwriting local featured images); fix: Social Tags (it was not getting the largest image size for local images); deprecated: Quick Edit Column > height.
271
-
272
  = others =
273
  * [more](https://fifu.app/changelog)
274
 
275
 
276
  == Upgrade Notice ==
277
 
278
- = 4.1.8 =
279
- * Enhancement: Page Redirection (works with local images now); fix: conflict with Search Filter Pro plugin; deprecated: Media RSS Tags > Width; deprecated: Schedule Metadata Generation > Interval; deprecated: Delete All URLs > Confirm.
3
  Donate link: https://donorbox.org/fifu
4
  Tags: featured, image, url, video, woocommerce
5
  Requires at least: 5.3
6
+ Tested up to: 6.1.1
7
+ Stable tag: 4.1.9
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
81
  * **[PRO]** Fast Buy
82
 
83
  #### FEATURED VIDEO
84
+ Supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr, Publitio, JW Player, VideoPress, Sprout and Odysee. External and local video files are supported as well.
85
 
86
  * **[PRO]** Featured video
87
  * **[PRO]** Video thumbnail
260
 
261
  == Changelog ==
262
 
263
+ = 4.1.9 =
264
+ * New option: Auto set featured media from post content > post types; enhancement: Featured Video (supports Odysee videos now); fix: CDN + Optimized Thumbnails > apply to content images (low resolution images); deprecated: Gallery Icon.
265
+
266
  = 4.1.8 =
267
  * Enhancement: Page Redirection (works with local images now); fix: conflict with Search Filter Pro plugin; deprecated: Media RSS Tags > Width; deprecated: Schedule Metadata Generation > Interval; deprecated: Delete All URLs > Confirm.
268
 
269
  = 4.1.7 =
270
  * Enhancement: deactivate itself when the PRO version is activated; fix: Lazy Load (conflict with Oxygen plugin); deprecated: Metadata > Database.
271
 
 
 
 
272
  = others =
273
  * [more](https://fifu.app/changelog)
274
 
275
 
276
  == Upgrade Notice ==
277
 
278
+ = 4.1.9 =
279
+ * New option: Auto set featured media from post content > post types; enhancement: Featured Video (supports Odysee videos now); fix: CDN + Optimized Thumbnails > apply to content images (low resolution images); deprecated: Gallery Icon.