Featured Image From URL - Version 3.9.3

Version Description

  • Enhancement: Featured Video (supports VideoPress now); fix: Social Tags (were being added to the front page); fix: conflict with Rank Math SEO plugin.
Download this release

Release Info

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

Code changes from version 3.9.2 to 3.9.3

admin/api.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- define('FIFU_SU_ADDRESS', /* fifu_is_local() ? 'http://0.0.0.0:8080' : */ 'https://cloud.featuredimagefromurl.com');
4
  define('FIFU_QUERY_ADDRESS', 'https://query.featuredimagefromurl.com');
5
  define('FIFU_SURVEY_ADDRESS', 'https://survey.featuredimagefromurl.com');
6
 
1
  <?php
2
 
3
+ define('FIFU_SU_ADDRESS', FIFU_CLOUD_DEBUG && fifu_is_local() ? 'http://0.0.0.0:8080' : 'https://cloud.featuredimagefromurl.com');
4
  define('FIFU_QUERY_ADDRESS', 'https://query.featuredimagefromurl.com');
5
  define('FIFU_SURVEY_ADDRESS', 'https://survey.featuredimagefromurl.com');
6
 
admin/column.php CHANGED
@@ -75,7 +75,7 @@ function fifu_column_content($column, $post_id) {
75
  $is_ctgr = false;
76
  $image_url = null;
77
 
78
- $image_url = fifu_main_image_url($post_id);
79
  if ($image_url == '') {
80
  $image_url = wp_get_attachment_url(get_post_thumbnail_id());
81
  $border = 'border-color: #ca4a1f !important; border: 2px; border-style: dashed;';
75
  $is_ctgr = false;
76
  $image_url = null;
77
 
78
+ $image_url = fifu_main_image_url($post_id, true);
79
  if ($image_url == '') {
80
  $image_url = wp_get_attachment_url(get_post_thumbnail_id());
81
  $border = 'border-color: #ca4a1f !important; border: 2px; border-style: dashed;';
admin/db.php CHANGED
@@ -642,7 +642,7 @@ class FifuDb {
642
  $result = $this->get_posts_without_meta();
643
  foreach ($result as $res) {
644
  $ids = ($i == 1) ? $res->post_id : ($ids . "," . $res->post_id);
645
- $url = fifu_main_image_url($res->post_id);
646
  $aux = $this->get_formatted_value($url, get_post_meta($res->post_id, 'fifu_image_alt', true), $res->post_id);
647
  $value = ($i == 1) ? $aux : ($value . "," . $aux);
648
  if ($value && (($i % $this->MAX_INSERT == 0) || ($i % $this->MAX_INSERT != 0 && count($result) == $count))) {
@@ -743,7 +743,7 @@ class FifuDb {
743
 
744
  function update_fake_attach_id($post_id) {
745
  $att_id = get_post_thumbnail_id($post_id);
746
- $url = fifu_main_image_url($post_id);
747
  $has_fifu_attachment = $att_id ? ($this->is_fifu_attachment($att_id) && get_option('fifu_default_attach_id') != $att_id) : false;
748
  // delete
749
  if (!$url || $url == get_option('fifu_default_url')) {
642
  $result = $this->get_posts_without_meta();
643
  foreach ($result as $res) {
644
  $ids = ($i == 1) ? $res->post_id : ($ids . "," . $res->post_id);
645
+ $url = fifu_main_image_url($res->post_id, false);
646
  $aux = $this->get_formatted_value($url, get_post_meta($res->post_id, 'fifu_image_alt', true), $res->post_id);
647
  $value = ($i == 1) ? $aux : ($value . "," . $aux);
648
  if ($value && (($i % $this->MAX_INSERT == 0) || ($i % $this->MAX_INSERT != 0 && count($result) == $count))) {
743
 
744
  function update_fake_attach_id($post_id) {
745
  $att_id = get_post_thumbnail_id($post_id);
746
+ $url = fifu_main_image_url($post_id, false);
747
  $has_fifu_attachment = $att_id ? ($this->is_fifu_attachment($att_id) && get_option('fifu_default_attach_id') != $att_id) : false;
748
  // delete
749
  if (!$url || $url == get_option('fifu_default_url')) {
admin/html/menu.html CHANGED
@@ -5677,7 +5677,7 @@
5677
  <div class="box">
5678
  <h2><?php $fifu['title']['support']() ?></h2>
5679
  <div class="greybox">
5680
- <?php $fifu['support']['email']() ?> <b> marcel@featuredimagefromurl.com</b> (<?php $fifu['support']['with']() ?> <a href="admin.php?page=fifu-support-data"><button id="opener" onclick="jQuery('#tabs-top').block({message: '<?php $fifu['message']['wait']() ?>', css: {backgroundColor: 'none', border: 'none', color: 'white'}});"><?php $fifu['support']['status']() ?></button></a>).
5681
  <br>
5682
  <br>
5683
  <table style="background-color: #fff; border-radius: 13px;">
5677
  <div class="box">
5678
  <h2><?php $fifu['title']['support']() ?></h2>
5679
  <div class="greybox">
5680
+ <?php $fifu['support']['email']() ?> <b> marcel@fifu.app</b> (<?php $fifu['support']['with']() ?> <a href="admin.php?page=fifu-support-data"><button id="opener" onclick="jQuery('#tabs-top').block({message: '<?php $fifu['message']['wait']() ?>', css: {backgroundColor: 'none', border: 'none', color: 'white'}});"><?php $fifu['support']['status']() ?></button></a>).
5681
  <br>
5682
  <br>
5683
  <table style="background-color: #fff; border-radius: 13px;">
admin/html/troubleshooting.html CHANGED
@@ -9,6 +9,21 @@
9
  <div id="tabs-top" style="float:left">
10
  <ul>
11
  <div id="tabs-t" style="padding:1em 1.4em; position: relative; top: -25px;">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  <div class="box">
13
  <table>
14
  <tr>
9
  <div id="tabs-top" style="float:left">
10
  <ul>
11
  <div id="tabs-t" style="padding:1em 1.4em; position: relative; top: -25px;">
12
+ <div class="box">
13
+ <table>
14
+ <tr>
15
+ <td style="border-bottom:none">2022-04-23</td>
16
+ <td style="border-bottom:none"><h3>Rank Math SEO</h3></td>
17
+ <td style="border-bottom:none">plugin</td>
18
+ </tr>
19
+ </table>
20
+ <div class="greybox" style="position: relative; top: -10px">
21
+ Fixing "Add an image with your Focus Keyword as alt text":<br>
22
+ 1) go to "Featured image" meta box and type some text into "alt/title attribute" field<br>
23
+ 2) publish/update the post<br>
24
+ 3) refresh the page (F5)<br>
25
+ </div>
26
+ </div>
27
  <div class="box">
28
  <table>
29
  <tr>
admin/meta-box.php CHANGED
@@ -22,7 +22,8 @@ function remove_metaboxes() {
22
  global $post;
23
  $url = get_post_meta($post->ID, 'fifu_image_url', true);
24
  if ($url) {
25
- remove_meta_box('postimagediv', 'product', 'side');
 
26
  }
27
  }
28
 
22
  global $post;
23
  $url = get_post_meta($post->ID, 'fifu_image_url', true);
24
  if ($url) {
25
+ if (!fifu_is_rank_math_seo_active())
26
+ remove_meta_box('postimagediv', 'product', 'side');
27
  }
28
  }
29
 
admin/strings.php CHANGED
@@ -1310,7 +1310,7 @@ function fifu_get_strings_settings() {
1310
 
1311
  // video
1312
  $fifu['video']['desc'] = function() {
1313
- _e("FIFU supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr, Publitio, JW Player, WordPress.com (Jetpack Video Hosting), Sprout and your media library. Videos hosted elsewhere are not supported.", FIFU_SLUG);
1314
  };
1315
  $fifu['video']['tab']['video'] = function() {
1316
  _e("Featured video", FIFU_SLUG);
@@ -1918,6 +1918,14 @@ function fifu_get_strings_cloud() {
1918
  return _e("Billing", FIFU_SLUG);
1919
  };
1920
 
 
 
 
 
 
 
 
 
1921
  // support
1922
  $fifu['support']['whats'] = function() {
1923
  _e("FIFU Cloud is a cloud service that stores your images in the Google Cloud infrastructure. The images are not only saved, but optimized and quickly served from the global Google's Edge Network. Thumbnails are automatically created for each image and all are served in webp format.", FIFU_SLUG);
@@ -1994,7 +2002,7 @@ function fifu_get_strings_cloud() {
1994
  _e("Total price");
1995
  };
1996
  $fifu['pricing']['table']['ps'] = function() {
1997
- _e("FIFU Cloud cannot be a free service as it uses several paid cloud services, such as storage, processing, caching, delivery, etc. However, its architecture was designed to optimize the use of these resources and, consequently, offer the lowest price (which is possibly not the current price). Our service is being launched now, in May 2022, and only after a few months of operation will we have a real understanding of operating costs, being able to offer fairer prices, especially for those who have more images. With enough monetization, it is possible that pro features of this plugin can become free. Who knows?=)");
1998
  };
1999
 
2000
  // upload
1310
 
1311
  // video
1312
  $fifu['video']['desc'] = function() {
1313
+ _e("FIFU supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr, Publitio, JW Player, VideoPress, Sprout and your media library. Videos hosted elsewhere are not supported.", FIFU_SLUG);
1314
  };
1315
  $fifu['video']['tab']['video'] = function() {
1316
  _e("Featured video", FIFU_SLUG);
1918
  return _e("Billing", FIFU_SLUG);
1919
  };
1920
 
1921
+ // info
1922
+ $fifu['icon']['cancel'] = function() {
1923
+ _e("You'll receive a confirmation link by email.", FIFU_SLUG);
1924
+ };
1925
+ $fifu['icon']['payment'] = function() {
1926
+ _e("You'll receive an access link by email.", FIFU_SLUG);
1927
+ };
1928
+
1929
  // support
1930
  $fifu['support']['whats'] = function() {
1931
  _e("FIFU Cloud is a cloud service that stores your images in the Google Cloud infrastructure. The images are not only saved, but optimized and quickly served from the global Google's Edge Network. Thumbnails are automatically created for each image and all are served in webp format.", FIFU_SLUG);
2002
  _e("Total price");
2003
  };
2004
  $fifu['pricing']['table']['ps'] = function() {
2005
+ _e("FIFU Cloud cannot be a free service as it relies on several paid cloud services, such as storage, processing, caching, delivery, etc. However, its architecture was designed to optimize the use of these resources and, consequently, offer the lowest price (which is possibly not the current price). Our service is being launched now, in May 2022, and only after a few months of operation we will have a real understanding of operating costs, being able to offer fairer prices, especially for those who have more images. With enough monetization, it is possible that pro features of this plugin can become free. Who knows?=)");
2006
  };
2007
 
2008
  // upload
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/video as featured image/video of a post or WooCommerce product.
7
- * Version: 3.9.2
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
  * WC requires at least: 4.0
@@ -19,6 +19,7 @@ define('FIFU_INCLUDES_DIR', FIFU_PLUGIN_DIR . 'includes');
19
  define('FIFU_ADMIN_DIR', FIFU_PLUGIN_DIR . 'admin');
20
  define('FIFU_ELEMENTOR_DIR', FIFU_PLUGIN_DIR . 'elementor');
21
  define('FIFU_DELETE_ALL_URLS', false);
 
22
 
23
  require_once (FIFU_INCLUDES_DIR . '/attachment.php');
24
  require_once (FIFU_INCLUDES_DIR . '/convert-url.php');
@@ -90,7 +91,7 @@ add_filter('network_admin_plugin_action_links_' . plugin_basename(__FILE__), 'fi
90
  function fifu_action_links($links) {
91
  $links[] = '<a href="' . esc_url(get_admin_url(null, 'admin.php?page=featured-image-from-url')) . '">' . __('Settings') . '</a>';
92
  $links[] = '<a style="color:black">' . __('Support') . ':</a>';
93
- $links[] = '<br><center style="width:275px;color:white;background-color:#02a0d2;border-radius:0px 30px">marcel@featuredimagefromurl.com</center>';
94
  return $links;
95
  }
96
 
4
  * Plugin Name: Featured Image from URL (FIFU)
5
  * Plugin URI: https://fifu.app/
6
  * Description: Use an external image/video as featured image/video of a post or WooCommerce product.
7
+ * Version: 3.9.3
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
  * WC requires at least: 4.0
19
  define('FIFU_ADMIN_DIR', FIFU_PLUGIN_DIR . 'admin');
20
  define('FIFU_ELEMENTOR_DIR', FIFU_PLUGIN_DIR . 'elementor');
21
  define('FIFU_DELETE_ALL_URLS', false);
22
+ define('FIFU_CLOUD_DEBUG', true);
23
 
24
  require_once (FIFU_INCLUDES_DIR . '/attachment.php');
25
  require_once (FIFU_INCLUDES_DIR . '/convert-url.php');
91
  function fifu_action_links($links) {
92
  $links[] = '<a href="' . esc_url(get_admin_url(null, 'admin.php?page=featured-image-from-url')) . '">' . __('Settings') . '</a>';
93
  $links[] = '<a style="color:black">' . __('Support') . ':</a>';
94
+ $links[] = '<br><center style="width:200px;color:white;background-color:#02a0d2;border-radius:0px 30px">marcel@fifu.app</center>';
95
  return $links;
96
  }
97
 
includes/attachment.php CHANGED
@@ -82,7 +82,7 @@ function fifu_replace_attachment_image_src($image, $att_id, $size) {
82
 
83
  $image[0] = fifu_process_url($image[0], $att_id);
84
 
85
- if (fifu_should_hide() && fifu_main_image_url(get_queried_object_id()) == $image[0])
86
  return null;
87
 
88
  // photon
82
 
83
  $image[0] = fifu_process_url($image[0], $att_id);
84
 
85
+ if (fifu_should_hide() && fifu_main_image_url(get_queried_object_id(), true) == $image[0])
86
  return null;
87
 
88
  // photon
includes/thumbnail.php CHANGED
@@ -63,25 +63,25 @@ function fifu_add_js() {
63
  function fifu_add_social_tag_yoast() {
64
  if (get_post_meta(get_the_ID(), '_yoast_wpseo_opengraph-image', true) || get_post_meta(get_the_ID(), '_yoast_wpseo_twitter-image', true))
65
  return;
66
- return fifu_main_image_url(get_the_ID());
67
  }
68
 
69
  function fifu_add_social_tag_yoast_list($object) {
70
  if (get_post_meta(get_the_ID(), '_yoast_wpseo_opengraph-image', true) || get_post_meta(get_the_ID(), '_yoast_wpseo_twitter-image', true))
71
  return;
72
- $object->add_image(fifu_main_image_url(get_the_ID()));
73
  }
74
 
75
  function fifu_add_social_tags() {
 
 
 
76
  $post_id = get_the_ID();
77
- $url = fifu_main_image_url($post_id);
78
  $url = $url ? $url : get_the_post_thumbnail_url($post_id);
79
  $title = str_replace("'", "&#39;", get_the_title($post_id));
80
  $description = str_replace("'", "&#39;", wp_strip_all_tags(get_post_field('post_excerpt', $post_id)));
81
 
82
- if (fifu_is_off('fifu_social'))
83
- return;
84
-
85
  if ($url) {
86
  if (fifu_is_on('fifu_cdn_social'))
87
  $url = fifu_jetpack_photon_url($url, null);
@@ -230,7 +230,7 @@ function fifu_is_cpt() {
230
  return in_array(get_post_type(get_the_ID()), array_diff(fifu_get_post_types(), array('post', 'page')));
231
  }
232
 
233
- function fifu_main_image_url($post_id) {
234
  $url = get_post_meta($post_id, 'fifu_image_url', true);
235
 
236
  if (!$url && fifu_no_internal_image($post_id) && (get_option('fifu_default_url') && fifu_is_on('fifu_enable_default_url'))) {
63
  function fifu_add_social_tag_yoast() {
64
  if (get_post_meta(get_the_ID(), '_yoast_wpseo_opengraph-image', true) || get_post_meta(get_the_ID(), '_yoast_wpseo_twitter-image', true))
65
  return;
66
+ return fifu_main_image_url(get_the_ID(), true);
67
  }
68
 
69
  function fifu_add_social_tag_yoast_list($object) {
70
  if (get_post_meta(get_the_ID(), '_yoast_wpseo_opengraph-image', true) || get_post_meta(get_the_ID(), '_yoast_wpseo_twitter-image', true))
71
  return;
72
+ $object->add_image(fifu_main_image_url(get_the_ID(), true));
73
  }
74
 
75
  function fifu_add_social_tags() {
76
+ if (is_front_page() || is_home() || fifu_is_off('fifu_social'))
77
+ return;
78
+
79
  $post_id = get_the_ID();
80
+ $url = fifu_main_image_url($post_id, true);
81
  $url = $url ? $url : get_the_post_thumbnail_url($post_id);
82
  $title = str_replace("'", "&#39;", get_the_title($post_id));
83
  $description = str_replace("'", "&#39;", wp_strip_all_tags(get_post_field('post_excerpt', $post_id)));
84
 
 
 
 
85
  if ($url) {
86
  if (fifu_is_on('fifu_cdn_social'))
87
  $url = fifu_jetpack_photon_url($url, null);
230
  return in_array(get_post_type(get_the_ID()), array_diff(fifu_get_post_types(), array('post', 'page')));
231
  }
232
 
233
+ function fifu_main_image_url($post_id, $front = false) {
234
  $url = get_post_meta($post_id, 'fifu_image_url', true);
235
 
236
  if (!$url && fifu_no_internal_image($post_id) && (get_option('fifu_default_url') && fifu_is_on('fifu_enable_default_url'))) {
includes/util.php CHANGED
@@ -152,6 +152,10 @@ function fifu_is_ol_scrapes_active() {
152
  return is_plugin_active('ol_scrapes/ol_scrapes.php');
153
  }
154
 
 
 
 
 
155
  // active themes
156
 
157
  function fifu_is_flatsome_active() {
152
  return is_plugin_active('ol_scrapes/ol_scrapes.php');
153
  }
154
 
155
+ function fifu_is_rank_math_seo_active() {
156
+ return is_plugin_active('seo-by-rank-math/rank-math.php');
157
+ }
158
+
159
  // active themes
160
 
161
  function fifu_is_flatsome_active() {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://donorbox.org/fifu
4
  Tags: featured, image, url, video, woocommerce
5
  Requires at least: 5.3
6
  Tested up to: 5.9.3
7
- Stable tag: 3.9.2
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -86,7 +86,7 @@ Use an external image as featured image of your post, page or custom post type.
86
  * **[PRO]** Fast Buy
87
 
88
  #### FEATURED VIDEO
89
- Supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr, Publitio, JW Player, WordPress.com (Jetpack Video Hosting), Sprout and media library.
90
 
91
  * **[PRO]** Featured video
92
  * **[PRO]** Video thumbnail
@@ -227,20 +227,20 @@ Featured Image, Figurë e Zgjedhur, Image mise en avant, Uitgelichte afbeelding,
227
 
228
  == Changelog ==
229
 
 
 
 
230
  = 3.9.2 =
231
  * News: FIFU Cloud (Smart Crop, Hotlink Protection and Pricing).
232
 
233
  = 3.9.1 =
234
  * New option: Auto set featured media from post content > skip URLs with.
235
 
236
- = 3.9.0 =
237
- * Enhancement: Autoplay, Loop and Mute (integration with local featured videos); fix: Undefined variable warning.
238
-
239
  = others =
240
  * [more](https://fifu.app/changelog)
241
 
242
 
243
  == Upgrade Notice ==
244
 
245
- = 3.9.2 =
246
- * News: FIFU Cloud (Smart Crop, Hotlink Protection and Pricing).
4
  Tags: featured, image, url, video, woocommerce
5
  Requires at least: 5.3
6
  Tested up to: 5.9.3
7
+ Stable tag: 3.9.3
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
86
  * **[PRO]** Fast Buy
87
 
88
  #### FEATURED VIDEO
89
+ Supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr, Publitio, JW Player, VideoPress, Sprout and media library.
90
 
91
  * **[PRO]** Featured video
92
  * **[PRO]** Video thumbnail
227
 
228
  == Changelog ==
229
 
230
+ = 3.9.3 =
231
+ * Enhancement: Featured Video (supports VideoPress now); fix: Social Tags (were being added to the front page); fix: conflict with Rank Math SEO plugin.
232
+
233
  = 3.9.2 =
234
  * News: FIFU Cloud (Smart Crop, Hotlink Protection and Pricing).
235
 
236
  = 3.9.1 =
237
  * New option: Auto set featured media from post content > skip URLs with.
238
 
 
 
 
239
  = others =
240
  * [more](https://fifu.app/changelog)
241
 
242
 
243
  == Upgrade Notice ==
244
 
245
+ = 3.9.3 =
246
+ * Enhancement: Featured Video (supports VideoPress now); fix: Social Tags (were being added to the front page); fix: conflict with Rank Math SEO plugin.