Featured Image From URL - Version 3.2.9

Version Description

  • Improvement: FIFU automatically removes URL spaces on the right; deprecated: CSS Style; bug fix: images may not be shown due js error (jQuery not defined).
Download this release

Release Info

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

Code changes from version 3.2.8 to 3.2.9

admin/category.php CHANGED
@@ -60,7 +60,7 @@ function fifu_ctgr_save_properties($term_id) {
60
  update_term_meta($term_id, 'fifu_image_alt', wp_strip_all_tags($_POST['fifu_input_alt']));
61
 
62
  if (isset($_POST['fifu_input_url'])) {
63
- $url = esc_url_raw($_POST['fifu_input_url']);
64
  update_term_meta($term_id, 'fifu_image_url', fifu_convert($url));
65
  fifu_db_ctgr_update_fake_attach_id($term_id);
66
  }
60
  update_term_meta($term_id, 'fifu_image_alt', wp_strip_all_tags($_POST['fifu_input_alt']));
61
 
62
  if (isset($_POST['fifu_input_url'])) {
63
+ $url = esc_url_raw(rtrim($_POST['fifu_input_url']));
64
  update_term_meta($term_id, 'fifu_image_url', fifu_convert($url));
65
  fifu_db_ctgr_update_fake_attach_id($term_id);
66
  }
admin/html/menu.html CHANGED
@@ -783,29 +783,6 @@
783
  value="" style="display:block;border:none">
784
  </div>
785
 
786
- <div class="box">
787
- <h2><?php $fifu['title']['css']() ?></h2>
788
- <div class="greybox">
789
- <?php $fifu['css']['desc']() ?><br><br>
790
- <b><?php $fifu['detail']['example']() ?></b>: width: 50%; border-radius: 8px; border: 1px solid #ddd; padding: 5px;
791
- </div>
792
- <br>
793
- <form
794
- id="fifu_form_css"
795
- action="javascript:void(0)"
796
- method="post">
797
-
798
- <input id="fifu_input_css"
799
- type="text"
800
- name="fifu_input_css"
801
- style="width:675px"
802
- value="<?php echo $css_style; ?>">
803
-
804
- <input type="submit"
805
- value="<?php $fifu['button']['submit']() ?>" >
806
- </form>
807
- </div>
808
-
809
  <div class="box">
810
  <h2><?php $fifu['title']['class']() ?></h2>
811
  <div class="greybox">
783
  value="" style="display:block;border:none">
784
  </div>
785
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
786
  <div class="box">
787
  <h2><?php $fifu['title']['class']() ?></h2>
788
  <div class="greybox">
admin/html/support-data.html CHANGED
@@ -28,7 +28,6 @@ fifu_confirm_delete_all:<?php echo $enable_confirm_delete_all ?>;
28
  fifu_confirm_delete_all_time:<?php echo $enable_confirm_delete_all_time ?>;
29
  fifu_content:<?php echo $enable_content ?>;
30
  fifu_content_page:<?php echo $enable_content_page ?>;
31
- fifu_css:<?php echo $css_style ?>;
32
  fifu_data_clean:<?php echo $enable_data_clean ?>;
33
  fifu_default_url:<?php echo $default_url ?>;
34
  fifu_dynamic_alt:<?php echo $enable_dynamic_alt ?>;
28
  fifu_confirm_delete_all_time:<?php echo $enable_confirm_delete_all_time ?>;
29
  fifu_content:<?php echo $enable_content ?>;
30
  fifu_content_page:<?php echo $enable_content_page ?>;
 
31
  fifu_data_clean:<?php echo $enable_data_clean ?>;
32
  fifu_default_url:<?php echo $default_url ?>;
33
  fifu_dynamic_alt:<?php echo $enable_dynamic_alt ?>;
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_jquery', 'fifu_media_library', 'fifu_content', 'fifu_content_page', 'fifu_enable_default_url', 'fifu_spinner_db', 'fifu_spinner_nth', 'fifu_fake', 'fifu_css', 'fifu_default_url', 'fifu_wc_lbox', 'fifu_wc_zoom', 'fifu_hide_page', 'fifu_hide_post', 'fifu_hide_cpt', 'fifu_class', 'fifu_get_first', 'fifu_pop_first', 'fifu_ovw_first', 'fifu_query_strings', 'fifu_confirm_delete_all', 'fifu_run_delete_all', 'fifu_column_height', 'fifu_grid_category', 'fifu_auto_alt', 'fifu_dynamic_alt', 'fifu_data_clean')));
4
 
5
  define('FIFU_SLUG', 'featured-image-from-url');
6
 
@@ -14,7 +14,7 @@ function fifu_insert_menu() {
14
  wp_enqueue_script('jquery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js');
15
  wp_enqueue_script('jquery-block-ui', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.blockUI/2.70/jquery.blockUI.min.js');
16
 
17
- wp_enqueue_script('fifu-rest-route-js', plugins_url('/html/js/rest-route.js', __FILE__), array(), fifu_version_number());
18
  }
19
 
20
  add_menu_page('Featured Image from URL', 'Featured Image from URL', 'manage_options', 'featured-image-from-url', 'fifu_get_menu_html', 'dashicons-camera', 57);
@@ -27,7 +27,7 @@ function fifu_insert_menu() {
27
  function fifu_support_data() {
28
  // css
29
  wp_enqueue_style('fifu-menu-css', plugins_url('/html/css/menu.css', __FILE__), array(), fifu_version_number());
30
- wp_enqueue_script('fifu-rest-route-js', plugins_url('/html/js/rest-route.js', __FILE__), array(), fifu_version_number());
31
 
32
  // register custom variables for the AJAX script
33
  wp_localize_script('fifu-rest-route-js', 'fifuScriptVars', [
@@ -44,7 +44,6 @@ function fifu_support_data() {
44
  $enable_content = get_option('fifu_content');
45
  $enable_content_page = get_option('fifu_content_page');
46
  $enable_fake = get_option('fifu_fake');
47
- $css_style = get_option('fifu_css');
48
  $default_url = get_option('fifu_default_url');
49
  $enable_default_url = get_option('fifu_enable_default_url');
50
  $max_db = get_option('fifu_spinner_db');
@@ -79,7 +78,7 @@ function fifu_get_menu_html() {
79
 
80
  // css and js
81
  wp_enqueue_style('fifu-menu-css', plugins_url('/html/css/menu.css', __FILE__), array(), fifu_version_number());
82
- wp_enqueue_script('fifu-menu-js', plugins_url('/html/js/menu.js', __FILE__), array(), fifu_version_number());
83
 
84
  // register custom variables for the AJAX script
85
  wp_localize_script('fifu-menu-js', 'fifuScriptVars', [
@@ -97,7 +96,6 @@ function fifu_get_menu_html() {
97
  $enable_content = get_option('fifu_content');
98
  $enable_content_page = get_option('fifu_content_page');
99
  $enable_fake = get_option('fifu_fake');
100
- $css_style = get_option('fifu_css');
101
  $default_url = get_option('fifu_default_url');
102
  $enable_default_url = get_option('fifu_enable_default_url');
103
  $max_db = get_option('fifu_spinner_db');
@@ -147,7 +145,7 @@ function fifu_get_setting($type) {
147
  register_setting('settings-group', $type);
148
 
149
  $arr1 = array('fifu_spinner_nth');
150
- $arrEmpty = array('fifu_default_url', 'fifu_css');
151
  $arr64 = array('fifu_column_height');
152
  $arr1000 = array('fifu_spinner_db');
153
  $arrOn = array('fifu_auto_alt', 'fifu_wc_zoom', 'fifu_wc_lbox');
@@ -183,7 +181,6 @@ function fifu_update_menu_options() {
183
  fifu_update_option('fifu_input_content', 'fifu_content');
184
  fifu_update_option('fifu_input_content_page', 'fifu_content_page');
185
  fifu_update_option('fifu_input_fake', 'fifu_fake');
186
- fifu_update_option('fifu_input_css', 'fifu_css');
187
  fifu_update_option('fifu_input_default_url', 'fifu_default_url');
188
  fifu_update_option('fifu_input_enable_default_url', 'fifu_enable_default_url');
189
  fifu_update_option('fifu_input_spinner_db', 'fifu_spinner_db');
1
  <?php
2
 
3
+ define('FIFU_SETTINGS', serialize(array('fifu_social', 'fifu_social_image_only', 'fifu_lazy', 'fifu_jquery', '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_class', 'fifu_get_first', 'fifu_pop_first', 'fifu_ovw_first', 'fifu_query_strings', 'fifu_confirm_delete_all', 'fifu_run_delete_all', 'fifu_column_height', 'fifu_grid_category', 'fifu_auto_alt', 'fifu_dynamic_alt', 'fifu_data_clean')));
4
 
5
  define('FIFU_SLUG', 'featured-image-from-url');
6
 
14
  wp_enqueue_script('jquery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js');
15
  wp_enqueue_script('jquery-block-ui', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.blockUI/2.70/jquery.blockUI.min.js');
16
 
17
+ wp_enqueue_script('fifu-rest-route-js', plugins_url('/html/js/rest-route.js', __FILE__), array('jquery'), fifu_version_number());
18
  }
19
 
20
  add_menu_page('Featured Image from URL', 'Featured Image from URL', 'manage_options', 'featured-image-from-url', 'fifu_get_menu_html', 'dashicons-camera', 57);
27
  function fifu_support_data() {
28
  // css
29
  wp_enqueue_style('fifu-menu-css', plugins_url('/html/css/menu.css', __FILE__), array(), fifu_version_number());
30
+ wp_enqueue_script('fifu-rest-route-js', plugins_url('/html/js/rest-route.js', __FILE__), array('jquery'), fifu_version_number());
31
 
32
  // register custom variables for the AJAX script
33
  wp_localize_script('fifu-rest-route-js', 'fifuScriptVars', [
44
  $enable_content = get_option('fifu_content');
45
  $enable_content_page = get_option('fifu_content_page');
46
  $enable_fake = get_option('fifu_fake');
 
47
  $default_url = get_option('fifu_default_url');
48
  $enable_default_url = get_option('fifu_enable_default_url');
49
  $max_db = get_option('fifu_spinner_db');
78
 
79
  // css and js
80
  wp_enqueue_style('fifu-menu-css', plugins_url('/html/css/menu.css', __FILE__), array(), fifu_version_number());
81
+ wp_enqueue_script('fifu-menu-js', plugins_url('/html/js/menu.js', __FILE__), array('jquery'), fifu_version_number());
82
 
83
  // register custom variables for the AJAX script
84
  wp_localize_script('fifu-menu-js', 'fifuScriptVars', [
96
  $enable_content = get_option('fifu_content');
97
  $enable_content_page = get_option('fifu_content_page');
98
  $enable_fake = get_option('fifu_fake');
 
99
  $default_url = get_option('fifu_default_url');
100
  $enable_default_url = get_option('fifu_enable_default_url');
101
  $max_db = get_option('fifu_spinner_db');
145
  register_setting('settings-group', $type);
146
 
147
  $arr1 = array('fifu_spinner_nth');
148
+ $arrEmpty = array('fifu_default_url');
149
  $arr64 = array('fifu_column_height');
150
  $arr1000 = array('fifu_spinner_db');
151
  $arrOn = array('fifu_auto_alt', 'fifu_wc_zoom', 'fifu_wc_lbox');
181
  fifu_update_option('fifu_input_content', 'fifu_content');
182
  fifu_update_option('fifu_input_content_page', 'fifu_content_page');
183
  fifu_update_option('fifu_input_fake', 'fifu_fake');
 
184
  fifu_update_option('fifu_input_default_url', 'fifu_default_url');
185
  fifu_update_option('fifu_input_enable_default_url', 'fifu_enable_default_url');
186
  fifu_update_option('fifu_input_spinner_db', 'fifu_spinner_db');
admin/meta-box.php CHANGED
@@ -23,8 +23,8 @@ function fifu_register_meta_box_script() {
23
  wp_enqueue_style('fancy-box-css', 'https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.css');
24
  wp_enqueue_script('fancy-box-js', 'https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js');
25
 
26
- wp_enqueue_script('fifu-meta-box-js', plugins_url('/html/js/meta-box.js', __FILE__), array(), fifu_version_number());
27
- wp_enqueue_script('fifu-convert-url-js', plugins_url('/html/js/convert-url.js', __FILE__), array(), fifu_version_number());
28
 
29
  if (fifu_is_sirv_active())
30
  wp_enqueue_script('fifu-sirv-js', 'https://scripts.sirv.com/sirv.js');
@@ -103,7 +103,7 @@ function fifu_save_properties($post_id) {
103
  /* image url */
104
  $url = null;
105
  if (isset($_POST['fifu_input_url'])) {
106
- $url = esc_url_raw($_POST['fifu_input_url']);
107
  if (!$ignore) {
108
  $first = fifu_first_url_in_content($post_id);
109
  if ($first && fifu_is_on('fifu_get_first') && (!$url || fifu_is_on('fifu_ovw_first')))
@@ -114,21 +114,21 @@ function fifu_save_properties($post_id) {
114
 
115
  /* image url from wcfm */
116
  if (!$url && fifu_is_wcfm_active() && isset($_POST['wcfm_products_manage_form'])) {
117
- $url = esc_url_raw(fifu_get_wcfm_url($_POST['wcfm_products_manage_form']));
118
  if ($url)
119
  fifu_update_or_delete($post_id, 'fifu_image_url', $url);
120
  }
121
 
122
  /* image url from toolset forms */
123
  if (fifu_is_toolset_active() && isset($_POST['wpcf-fifu_image_url'])) {
124
- $url = esc_url_raw($_POST['wpcf-fifu_image_url']);
125
  if ($url)
126
  fifu_update_or_delete($post_id, 'fifu_image_url', $url);
127
  }
128
 
129
  /* image url from aliplugin */
130
  if (fifu_is_aliplugin_active() && isset($_POST['imageUrl'])) {
131
- $url = esc_url_raw($_POST['imageUrl']);
132
  if ($url)
133
  fifu_update_or_delete($post_id, 'fifu_image_url', $url);
134
  }
23
  wp_enqueue_style('fancy-box-css', 'https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.css');
24
  wp_enqueue_script('fancy-box-js', 'https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js');
25
 
26
+ wp_enqueue_script('fifu-meta-box-js', plugins_url('/html/js/meta-box.js', __FILE__), array('jquery'), fifu_version_number());
27
+ wp_enqueue_script('fifu-convert-url-js', plugins_url('/html/js/convert-url.js', __FILE__), array('jquery'), fifu_version_number());
28
 
29
  if (fifu_is_sirv_active())
30
  wp_enqueue_script('fifu-sirv-js', 'https://scripts.sirv.com/sirv.js');
103
  /* image url */
104
  $url = null;
105
  if (isset($_POST['fifu_input_url'])) {
106
+ $url = esc_url_raw(rtrim($_POST['fifu_input_url']));
107
  if (!$ignore) {
108
  $first = fifu_first_url_in_content($post_id);
109
  if ($first && fifu_is_on('fifu_get_first') && (!$url || fifu_is_on('fifu_ovw_first')))
114
 
115
  /* image url from wcfm */
116
  if (!$url && fifu_is_wcfm_active() && isset($_POST['wcfm_products_manage_form'])) {
117
+ $url = esc_url_raw(rtrim(fifu_get_wcfm_url($_POST['wcfm_products_manage_form'])));
118
  if ($url)
119
  fifu_update_or_delete($post_id, 'fifu_image_url', $url);
120
  }
121
 
122
  /* image url from toolset forms */
123
  if (fifu_is_toolset_active() && isset($_POST['wpcf-fifu_image_url'])) {
124
+ $url = esc_url_raw(rtrim($_POST['wpcf-fifu_image_url']));
125
  if ($url)
126
  fifu_update_or_delete($post_id, 'fifu_image_url', $url);
127
  }
128
 
129
  /* image url from aliplugin */
130
  if (fifu_is_aliplugin_active() && isset($_POST['imageUrl'])) {
131
+ $url = esc_url_raw(rtrim($_POST['imageUrl']));
132
  if ($url)
133
  fifu_update_or_delete($post_id, 'fifu_image_url', $url);
134
  }
admin/strings.php CHANGED
@@ -211,9 +211,6 @@ function fifu_get_strings_settings() {
211
  $fifu['title']['validation'] = function() {
212
  _e("Image Validation", FIFU_SLUG);
213
  };
214
- $fifu['title']['css'] = function() {
215
- _e("CSS Style", FIFU_SLUG);
216
- };
217
  $fifu['title']['class'] = function() {
218
  _e("Add Class", FIFU_SLUG);
219
  };
@@ -364,7 +361,7 @@ function fifu_get_strings_settings() {
364
  _e("You probably have a plugin or theme that sets a default image as the Facebook image (og:image tag). Just find and disable the option.", FIFU_SLUG);
365
  };
366
  $fifu['support']['slow-desc'] = function() {
367
- _e("1) access Performance tab; 2) enable Lazy Load. Important: if you have another lazy load component running, you should disable that to avoid conficts.", FIFU_SLUG);
368
  };
369
  $fifu['support']['speed-desc'] = function() {
370
  _e("You may mitigate the problem installing Jetpack plugin. After that: 1) access \"Settings\", \"Performance\"; 2) enable \"Speed up image load times\". A better solution will be available soon.", FIFU_SLUG);
@@ -606,11 +603,6 @@ function fifu_get_strings_settings() {
606
  _e("It checks images addresses and, when an image is not found, its URL is not saved. However, each validation can take some seconds. It is not integrated with Content URL or REST API features.", FIFU_SLUG);
607
  };
608
 
609
- // css
610
- $fifu['css']['desc'] = function() {
611
- _e("Define a CSS style to be applied to the featured images.", FIFU_SLUG);
612
- };
613
-
614
  // class
615
  $fifu['class']['desc'] = function() {
616
  _e("Add the class \"fifu-class\" to the featured image tags.", FIFU_SLUG);
@@ -814,7 +806,7 @@ function fifu_get_strings_settings() {
814
  _e("This experimental feature allows to input a shortcode instead of an URL. It would allow you to have any content as featured media (a music, a text, a map etc). However, some contents will need a large area of your site to be shown properly. So you should define a minimum width that an area of your site should have to be able to show the shortcode content. Otherwise an icon will be shown.", FIFU_SLUG);
815
  };
816
  $fifu['shortcode']['important'] = function() {
817
- _e("shortcodes can be not compatible with other FIFU features, such as CSS Style, Same Height, Lazy Load etc.", FIFU_SLUG);
818
  };
819
  $fifu['shortcode']['width'] = function() {
820
  _e("minimum width (px)", FIFU_SLUG);
@@ -1129,13 +1121,19 @@ function fifu_get_strings_meta_box() {
1129
 
1130
  // image
1131
  $fifu['image']['show']['center'] = function() {
1132
- _e("show center", FIFU_SLUG);
1133
  };
1134
  $fifu['image']['show']['top'] = function() {
1135
- _e("show top", FIFU_SLUG);
1136
  };
1137
  $fifu['image']['show']['bottom'] = function() {
1138
- _e("show bottom", FIFU_SLUG);
 
 
 
 
 
 
1139
  };
1140
  $fifu['image']['ignore'] = function() {
1141
  _e("ignore Content URL", FIFU_SLUG);
@@ -1264,4 +1262,3 @@ function fifu_get_strings_wai() {
1264
 
1265
  return $fifu;
1266
  }
1267
-
211
  $fifu['title']['validation'] = function() {
212
  _e("Image Validation", FIFU_SLUG);
213
  };
 
 
 
214
  $fifu['title']['class'] = function() {
215
  _e("Add Class", FIFU_SLUG);
216
  };
361
  _e("You probably have a plugin or theme that sets a default image as the Facebook image (og:image tag). Just find and disable the option.", FIFU_SLUG);
362
  };
363
  $fifu['support']['slow-desc'] = function() {
364
+ _e("1) access Performance tab; 2) enable Lazy Load. Important: if you have another lazy load component running, you should disable that to avoid conflicts.", FIFU_SLUG);
365
  };
366
  $fifu['support']['speed-desc'] = function() {
367
  _e("You may mitigate the problem installing Jetpack plugin. After that: 1) access \"Settings\", \"Performance\"; 2) enable \"Speed up image load times\". A better solution will be available soon.", FIFU_SLUG);
603
  _e("It checks images addresses and, when an image is not found, its URL is not saved. However, each validation can take some seconds. It is not integrated with Content URL or REST API features.", FIFU_SLUG);
604
  };
605
 
 
 
 
 
 
606
  // class
607
  $fifu['class']['desc'] = function() {
608
  _e("Add the class \"fifu-class\" to the featured image tags.", FIFU_SLUG);
806
  _e("This experimental feature allows to input a shortcode instead of an URL. It would allow you to have any content as featured media (a music, a text, a map etc). However, some contents will need a large area of your site to be shown properly. So you should define a minimum width that an area of your site should have to be able to show the shortcode content. Otherwise an icon will be shown.", FIFU_SLUG);
807
  };
808
  $fifu['shortcode']['important'] = function() {
809
+ _e("shortcodes can be not compatible with other FIFU features, such as Same Height, Lazy Load etc.", FIFU_SLUG);
810
  };
811
  $fifu['shortcode']['width'] = function() {
812
  _e("minimum width (px)", FIFU_SLUG);
1121
 
1122
  // image
1123
  $fifu['image']['show']['center'] = function() {
1124
+ _e("center", FIFU_SLUG);
1125
  };
1126
  $fifu['image']['show']['top'] = function() {
1127
+ _e("top", FIFU_SLUG);
1128
  };
1129
  $fifu['image']['show']['bottom'] = function() {
1130
+ _e("bottom", FIFU_SLUG);
1131
+ };
1132
+ $fifu['image']['show']['left'] = function() {
1133
+ _e("left", FIFU_SLUG);
1134
+ };
1135
+ $fifu['image']['show']['right'] = function() {
1136
+ _e("right", FIFU_SLUG);
1137
  };
1138
  $fifu['image']['ignore'] = function() {
1139
  _e("ignore Content URL", FIFU_SLUG);
1262
 
1263
  return $fifu;
1264
  }
 
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.2.8
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
  * WC requires at least: 3.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.2.9
8
  * Author: fifu.app
9
  * Author URI: https://fifu.app/
10
  * WC requires at least: 3.0
includes/external-post.php CHANGED
@@ -30,7 +30,7 @@ function fifu_save_properties_ext($post_id) {
30
  if (isset($_POST['fifu_input_url']))
31
  return;
32
 
33
- $url = fifu_first_url_in_content($post_id);
34
 
35
  if ($url && fifu_is_on('fifu_get_first')) {
36
  update_post_meta($post_id, 'fifu_image_url', fifu_convert($url));
30
  if (isset($_POST['fifu_input_url']))
31
  return;
32
 
33
+ $url = esc_url_raw(rtrim(fifu_first_url_in_content($post_id)));
34
 
35
  if ($url && fifu_is_on('fifu_get_first')) {
36
  update_post_meta($post_id, 'fifu_image_url', fifu_convert($url));
includes/thumbnail.php CHANGED
@@ -25,7 +25,7 @@ function fifu_add_js() {
25
 
26
  if (fifu_is_on('fifu_lazy')) {
27
  wp_enqueue_style('lazyload-spinner', plugins_url('/html/css/lazyload.css', __FILE__), array(), fifu_version_number());
28
- wp_enqueue_script('lazysizes-config', plugins_url('/html/js/lazySizesConfig.js', __FILE__), array(), fifu_version_number());
29
  wp_enqueue_script('unveilhooks', 'https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/plugins/unveilhooks/ls.unveilhooks.min.js');
30
  wp_enqueue_script('bgset', 'https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/plugins/bgset/ls.bgset.min.js');
31
  wp_enqueue_script('lazysizes', 'https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/lazysizes.min.js');
@@ -38,7 +38,7 @@ function fifu_add_js() {
38
  }
39
 
40
  // js
41
- wp_enqueue_script('fifu-image-js', plugins_url('/html/js/image.js', __FILE__), array(), fifu_version_number());
42
  wp_localize_script('fifu-image-js', 'fifuImageVars', [
43
  'fifu_lazy' => fifu_is_on("fifu_lazy"),
44
  'fifu_woo_lbox_enabled' => fifu_woo_lbox(),
@@ -132,8 +132,6 @@ function fifu_replace($html, $post_id, $post_thumbnail_id, $size, $attr) {
132
  }
133
  }
134
 
135
- $css = get_option('fifu_css');
136
-
137
  if ($url) {
138
  if (fifu_is_on('fifu_class')) {
139
  if (strpos($html, 'class=')) {
@@ -143,8 +141,7 @@ function fifu_replace($html, $post_id, $post_thumbnail_id, $size, $attr) {
143
  } else
144
  $html = str_replace('<img', '<img class="fifu-class"', $html);
145
  }
146
-
147
- return $css ? str_replace('/>', ' style="' . $css . '"/>', $html) : $html;
148
  }
149
 
150
  $width = fifu_get_attribute('width', $html);
@@ -154,8 +151,7 @@ function fifu_replace($html, $post_id, $post_thumbnail_id, $size, $attr) {
154
  }
155
 
156
  function fifu_get_html($url, $alt, $width, $height) {
157
- $css = get_option('fifu_css');
158
-
159
  if (fifu_should_hide()) {
160
  $css = 'display:none';
161
  }
25
 
26
  if (fifu_is_on('fifu_lazy')) {
27
  wp_enqueue_style('lazyload-spinner', plugins_url('/html/css/lazyload.css', __FILE__), array(), fifu_version_number());
28
+ wp_enqueue_script('lazysizes-config', plugins_url('/html/js/lazySizesConfig.js', __FILE__), array('jquery'), fifu_version_number());
29
  wp_enqueue_script('unveilhooks', 'https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/plugins/unveilhooks/ls.unveilhooks.min.js');
30
  wp_enqueue_script('bgset', 'https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/plugins/bgset/ls.bgset.min.js');
31
  wp_enqueue_script('lazysizes', 'https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/lazysizes.min.js');
38
  }
39
 
40
  // js
41
+ wp_enqueue_script('fifu-image-js', plugins_url('/html/js/image.js', __FILE__), array('jquery'), fifu_version_number());
42
  wp_localize_script('fifu-image-js', 'fifuImageVars', [
43
  'fifu_lazy' => fifu_is_on("fifu_lazy"),
44
  'fifu_woo_lbox_enabled' => fifu_woo_lbox(),
132
  }
133
  }
134
 
 
 
135
  if ($url) {
136
  if (fifu_is_on('fifu_class')) {
137
  if (strpos($html, 'class=')) {
141
  } else
142
  $html = str_replace('<img', '<img class="fifu-class"', $html);
143
  }
144
+ return $html;
 
145
  }
146
 
147
  $width = fifu_get_attribute('width', $html);
151
  }
152
 
153
  function fifu_get_html($url, $alt, $width, $height) {
154
+ $css = '';
 
155
  if (fifu_should_hide()) {
156
  $css = 'display:none';
157
  }
includes/util.php CHANGED
@@ -74,7 +74,7 @@ function fifu_dashboard() {
74
  // developers
75
 
76
  function fifu_dev_set_image($post_id, $image_url) {
77
- fifu_update_or_delete($post_id, 'fifu_image_url', esc_url_raw($image_url));
78
  fifu_update_fake_attach_id($post_id);
79
  }
80
 
74
  // developers
75
 
76
  function fifu_dev_set_image($post_id, $image_url) {
77
+ fifu_update_or_delete($post_id, 'fifu_image_url', esc_url_raw(rtrim($image_url)));
78
  fifu_update_fake_attach_id($post_id);
79
  }
80
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Plugin Name ===
2
  Contributors: marceljm
3
  Donate link: https://donorbox.org/fifu
4
- Tags: featured image, featured, image, url, woocommerce
5
  Requires at least: 5.3
6
  Tested up to: 5.5
7
- Stable tag: 3.2.8
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -25,7 +25,6 @@ Use an external image as featured image of your post, page or custom post type.
25
  * Default featured image
26
  * Hide featured media
27
  * Featured image in content
28
- * CSS style
29
  * Add class
30
  * Save image dimensions
31
  * Featured image column
@@ -185,20 +184,20 @@ Supports videos from YouTube, Vimeo, Imgur, 9GAG, Cloudinary, Tumblr and Publiti
185
 
186
  == Changelog ==
187
 
 
 
 
188
  = 3.2.8 =
189
  * Improvement: the translation process is being integrated with WordPress.org (all the strings should be available to the community soon).
190
 
191
  = 3.2.7 =
192
  * Improvement: Save Image Dimensions is a little faster; bug fix: Image Metadata was slow after the last update; bug fix: conflicts with Jetpack plugin; bug fix: images not visible due unregistered theme sizes.
193
 
194
- = 3.2.6 =
195
- * Improvement: Image Metadata (added counter, savepoint and automatic restart after timeout); improvement: Status (query optimization); bug fix: some style issues (when there is no image dimensions); bug fix: notices and warnings; bug fix: Unsplash Image Search delay.
196
-
197
  = others =
198
  * [more](https://fifu.app/changelog/)
199
 
200
 
201
  == Upgrade Notice ==
202
 
203
- = 3.2.8 =
204
- * Improvement: the translation process is being integrated with WordPress.org (all the strings should be available to the community soon).
1
  === Plugin Name ===
2
  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.2.9
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
25
  * Default featured image
26
  * Hide featured media
27
  * Featured image in content
 
28
  * Add class
29
  * Save image dimensions
30
  * Featured image column
184
 
185
  == Changelog ==
186
 
187
+ = 3.2.9 =
188
+ * Improvement: FIFU automatically removes URL spaces on the right; deprecated: CSS Style; bug fix: images may not be shown due js error (jQuery not defined).
189
+
190
  = 3.2.8 =
191
  * Improvement: the translation process is being integrated with WordPress.org (all the strings should be available to the community soon).
192
 
193
  = 3.2.7 =
194
  * Improvement: Save Image Dimensions is a little faster; bug fix: Image Metadata was slow after the last update; bug fix: conflicts with Jetpack plugin; bug fix: images not visible due unregistered theme sizes.
195
 
 
 
 
196
  = others =
197
  * [more](https://fifu.app/changelog/)
198
 
199
 
200
  == Upgrade Notice ==
201
 
202
+ = 3.2.9 =
203
+ * Improvement: FIFU automatically removes URL spaces on the right; deprecated: CSS Style; bug fix: images may not be shown due js error (jQuery not defined).