Version Description
- New Feature (Premium): Video > Product Gallery Icon; Improvement (Premium): FIFU gets YouTube video image thumbnails without top and bottom black stripes now; Improvement: Lazy Load can work with background images now; Notice: Internal URL Parameters is a FREE feature now.
Download this release
Release Info
Developer | marceljm |
Plugin | Featured Image From URL |
Version | 3.0.8 |
Comparing to | |
See all releases |
Code changes from version 3.0.7 to 3.0.8
- admin/html/menu.html +91 -27
- admin/html/support-data.html +1 -0
- admin/menu.php +4 -1
- featured-image-from-url.php +2 -2
- includes/attachment.php +71 -2
- includes/thumbnail.php +1 -0
- readme.txt +8 -2
admin/html/menu.html
CHANGED
@@ -240,19 +240,29 @@
|
|
240 |
</div>
|
241 |
<div class="box">
|
242 |
<h2>Internal URL Parameters</h2>
|
243 |
-
<div class="greybox"
|
244 |
-
<b>Premium feature</b><br><br>
|
245 |
This option adds some FIFU parameters to your image URLs. It only makes sense when you have a theme/plugin that calls the image URLs in a nonstandard way, what could break some FIFU features, such as "Featured Video", "Featured Slider", "Add Class", "Lazy Load" and "Same Height > Object Fit".
|
246 |
</div>
|
247 |
<br>
|
248 |
-
<
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
</div>
|
257 |
</div>
|
258 |
<div id="tabs-b">
|
@@ -1553,7 +1563,7 @@
|
|
1553 |
<div class="greybox" id="grad2">
|
1554 |
<b>Premium feature</b><br><br>
|
1555 |
|
1556 |
-
FIFU supports videos from YouTube, Vimeo, Facebook,
|
1557 |
|
1558 |
</div>
|
1559 |
|
@@ -1643,22 +1653,6 @@
|
|
1643 |
on custom post type
|
1644 |
</th>
|
1645 |
</tr>
|
1646 |
-
<tr>
|
1647 |
-
<th>
|
1648 |
-
<input
|
1649 |
-
id="fifu_input_video_crop"
|
1650 |
-
type="text"
|
1651 |
-
name="fifu_input_video_crop"
|
1652 |
-
value=""
|
1653 |
-
placeholder="e.g.: 25"
|
1654 |
-
style="width:73px">
|
1655 |
-
<br>
|
1656 |
-
<input type="submit" value="OK" style="width:73px" disabled>
|
1657 |
-
</th>
|
1658 |
-
<th>
|
1659 |
-
crop top and bottom (%)
|
1660 |
-
</th>
|
1661 |
-
</tr>
|
1662 |
</table>
|
1663 |
</div>
|
1664 |
|
@@ -1853,6 +1847,39 @@
|
|
1853 |
</tr>
|
1854 |
</table>
|
1855 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1856 |
</div>
|
1857 |
<div id="tabs-m">
|
1858 |
<div class="box">
|
@@ -2993,6 +3020,43 @@
|
|
2993 |
From September 2019, always you guys report an issue between FIFU and another plugin or theme, the solution will be posted here.
|
2994 |
</div>
|
2995 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2996 |
<div class="box">
|
2997 |
<table>
|
2998 |
<tr>
|
240 |
</div>
|
241 |
<div class="box">
|
242 |
<h2>Internal URL Parameters</h2>
|
243 |
+
<div class="greybox">
|
|
|
244 |
This option adds some FIFU parameters to your image URLs. It only makes sense when you have a theme/plugin that calls the image URLs in a nonstandard way, what could break some FIFU features, such as "Featured Video", "Featured Slider", "Add Class", "Lazy Load" and "Same Height > Object Fit".
|
245 |
</div>
|
246 |
<br>
|
247 |
+
<form
|
248 |
+
id="fifu_form_parameters"
|
249 |
+
action="javascript:void(0)"
|
250 |
+
method="post">
|
251 |
+
<input
|
252 |
+
type="submit"
|
253 |
+
href="javascript:void(0)"
|
254 |
+
id="fifu_toggle_parameters"
|
255 |
+
onclick="invert('parameters')"
|
256 |
+
name="fifu_toggle_parameters"
|
257 |
+
class="<?php echo $enable_parameters; ?>"
|
258 |
+
value=""
|
259 |
+
style="display:block;border:none">
|
260 |
+
<input
|
261 |
+
type="hidden"
|
262 |
+
id="fifu_input_parameters"
|
263 |
+
name="fifu_input_parameters"
|
264 |
+
value="" >
|
265 |
+
</form>
|
266 |
</div>
|
267 |
</div>
|
268 |
<div id="tabs-b">
|
1563 |
<div class="greybox" id="grad2">
|
1564 |
<b>Premium feature</b><br><br>
|
1565 |
|
1566 |
+
FIFU supports videos from YouTube, Vimeo, Facebook, Imgur, 9GAG, Cloudinary, Tumblr and Publitio. You can enable the video meta box here.
|
1567 |
|
1568 |
</div>
|
1569 |
|
1653 |
on custom post type
|
1654 |
</th>
|
1655 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1656 |
</table>
|
1657 |
</div>
|
1658 |
|
1847 |
</tr>
|
1848 |
</table>
|
1849 |
</div>
|
1850 |
+
|
1851 |
+
<div class="box">
|
1852 |
+
<h2>Product Gallery Icon</h2>
|
1853 |
+
<div class="greybox" id="grad2">
|
1854 |
+
This option adds video icons on the video image thumbnails from the WooCommerce product gallery.
|
1855 |
+
<br>
|
1856 |
+
<br>
|
1857 |
+
<input id="fifu_input_gallery_selector"
|
1858 |
+
type="text"
|
1859 |
+
name="fifu_input_gallery_selector"
|
1860 |
+
placeholder="CSS selector"
|
1861 |
+
title="CSS selector"
|
1862 |
+
value=""
|
1863 |
+
style="width:50%;min-height:24px;line-height:0;">
|
1864 |
+
|
1865 |
+
<input type="submit" value="Submit" disabled>
|
1866 |
+
|
1867 |
+
<span class="dashicons dashicons-editor-help" style="font-size: 25px;" title="In order to FIFU identify your product 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."></span>
|
1868 |
+
</div>
|
1869 |
+
<br>
|
1870 |
+
<table style="text-align:left">
|
1871 |
+
<tr>
|
1872 |
+
<th>
|
1873 |
+
<input
|
1874 |
+
type="submit"
|
1875 |
+
href="javascript:void(0)"
|
1876 |
+
class="toggleoff"
|
1877 |
+
value=""
|
1878 |
+
style="display:block;border:none">
|
1879 |
+
</th>
|
1880 |
+
</tr>
|
1881 |
+
</table>
|
1882 |
+
</div>
|
1883 |
</div>
|
1884 |
<div id="tabs-m">
|
1885 |
<div class="box">
|
3020 |
From September 2019, always you guys report an issue between FIFU and another plugin or theme, the solution will be posted here.
|
3021 |
</div>
|
3022 |
</div>
|
3023 |
+
<div class="box">
|
3024 |
+
<table>
|
3025 |
+
<tr>
|
3026 |
+
<td style="border-bottom:none">2020-05-20</td>
|
3027 |
+
<td style="border-bottom:none"><h3> Bimber</h3></td>
|
3028 |
+
<td style="border-bottom:none">theme</td>
|
3029 |
+
</tr>
|
3030 |
+
</table>
|
3031 |
+
<div class="greybox" style="position: relative; top: -10px">
|
3032 |
+
Home page images have different heights:<br>
|
3033 |
+
1) enable "FIFU Settings > Featured Image > Same Height";<br>
|
3034 |
+
2) access "Selector" tab and add two selectors: "ul.g1-featured-items" and "ul.g1-collection-items";<br>
|
3035 |
+
3) access "Size Ratio" tab and set "16:9".<br>
|
3036 |
+
</div>
|
3037 |
+
</div>
|
3038 |
+
<div class="box">
|
3039 |
+
<table>
|
3040 |
+
<tr>
|
3041 |
+
<td style="border-bottom:none">2020-05-17</td>
|
3042 |
+
<td style="border-bottom:none"><h3> BuddyForms</h3></td>
|
3043 |
+
<td style="border-bottom:none">plugin</td>
|
3044 |
+
</tr>
|
3045 |
+
</table>
|
3046 |
+
<div class="greybox" style="position: relative; top: -10px">
|
3047 |
+
Adding "Featured Image from URL" field to the form:<br>
|
3048 |
+
1) open the form editor;<br>
|
3049 |
+
2) select "Form Builder > Select Field Type > Url";<br>
|
3050 |
+
3) click on "+ Add Field" button;<br>
|
3051 |
+
4) a new field "Url" will be shown. Click on "Edit";<br>
|
3052 |
+
5) set "Featured Image from URL" for "Label";<br>
|
3053 |
+
6) set "Image URL" for "Description";<br>
|
3054 |
+
7) click on "Advanced";<br>
|
3055 |
+
8) set "fifu_image_url" for "Slug";<br>
|
3056 |
+
9) update.<br>
|
3057 |
+
* for a "Featured Video from URL" field, use the same steps above, but replacing "image" by "video".
|
3058 |
+
</div>
|
3059 |
+
</div>
|
3060 |
<div class="box">
|
3061 |
<table>
|
3062 |
<tr>
|
admin/html/support-data.html
CHANGED
@@ -61,6 +61,7 @@ fifu_lazy:<?php echo $enable_lazy ?>;
|
|
61 |
fifu_media_library:<?php echo $enable_media_library ?>;
|
62 |
fifu_original:<?php echo $enable_original ?>;
|
63 |
fifu_ovw_first:<?php echo $enable_ovw_first ?>;
|
|
|
64 |
fifu_pop_first:<?php echo $enable_pop_first ?>;
|
65 |
fifu_query_strings:<?php echo $enable_query_strings ?>;
|
66 |
fifu_run_delete_all:<?php echo $enable_run_delete_all ?>;
|
61 |
fifu_media_library:<?php echo $enable_media_library ?>;
|
62 |
fifu_original:<?php echo $enable_original ?>;
|
63 |
fifu_ovw_first:<?php echo $enable_ovw_first ?>;
|
64 |
+
fifu_parameters:<?php echo $enable_parameters ?>;
|
65 |
fifu_pop_first:<?php echo $enable_pop_first ?>;
|
66 |
fifu_query_strings:<?php echo $enable_query_strings ?>;
|
67 |
fifu_run_delete_all:<?php echo $enable_run_delete_all ?>;
|
admin/menu.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
define('FIFU_SETTINGS', serialize(array('fifu_social', 'fifu_social_image_only', 'fifu_original', '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', 'fifu_image_height_shop', 'fifu_image_width_shop', 'fifu_image_height_prod', 'fifu_image_width_prod', 'fifu_image_height_cart', 'fifu_image_width_cart', 'fifu_image_height_ctgr', 'fifu_image_width_ctgr', 'fifu_image_height_arch', 'fifu_image_width_arch', 'fifu_image_height_home', 'fifu_image_width_home', 'fifu_image_height_page', 'fifu_image_width_page', 'fifu_image_height_post', 'fifu_image_width_post', 'fifu_save_dimensions', 'fifu_save_dimensions_redirect', 'fifu_save_dimensions_all', 'fifu_clean_dimensions_all')));
|
4 |
|
5 |
add_action('admin_menu', 'fifu_insert_menu');
|
6 |
|
@@ -40,6 +40,7 @@ function fifu_support_data() {
|
|
40 |
$enable_lazy = get_option('fifu_lazy');
|
41 |
$enable_jquery = get_option('fifu_jquery');
|
42 |
$enable_media_library = get_option('fifu_media_library');
|
|
|
43 |
$enable_content = get_option('fifu_content');
|
44 |
$enable_content_page = get_option('fifu_content_page');
|
45 |
$enable_fake = get_option('fifu_fake');
|
@@ -111,6 +112,7 @@ function fifu_get_menu_html() {
|
|
111 |
$enable_lazy = get_option('fifu_lazy');
|
112 |
$enable_jquery = get_option('fifu_jquery');
|
113 |
$enable_media_library = get_option('fifu_media_library');
|
|
|
114 |
$enable_content = get_option('fifu_content');
|
115 |
$enable_content_page = get_option('fifu_content_page');
|
116 |
$enable_fake = get_option('fifu_fake');
|
@@ -220,6 +222,7 @@ function fifu_update_menu_options() {
|
|
220 |
fifu_update_option('fifu_input_lazy', 'fifu_lazy');
|
221 |
fifu_update_option('fifu_input_jquery', 'fifu_jquery');
|
222 |
fifu_update_option('fifu_input_media_library', 'fifu_media_library');
|
|
|
223 |
fifu_update_option('fifu_input_content', 'fifu_content');
|
224 |
fifu_update_option('fifu_input_content_page', 'fifu_content_page');
|
225 |
fifu_update_option('fifu_input_fake', 'fifu_fake');
|
1 |
<?php
|
2 |
|
3 |
+
define('FIFU_SETTINGS', serialize(array('fifu_social', 'fifu_social_image_only', 'fifu_original', 'fifu_lazy', 'fifu_jquery', 'fifu_media_library', 'fifu_parameters', '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', 'fifu_image_height_shop', 'fifu_image_width_shop', 'fifu_image_height_prod', 'fifu_image_width_prod', 'fifu_image_height_cart', 'fifu_image_width_cart', 'fifu_image_height_ctgr', 'fifu_image_width_ctgr', 'fifu_image_height_arch', 'fifu_image_width_arch', 'fifu_image_height_home', 'fifu_image_width_home', 'fifu_image_height_page', 'fifu_image_width_page', 'fifu_image_height_post', 'fifu_image_width_post', 'fifu_save_dimensions', 'fifu_save_dimensions_redirect', 'fifu_save_dimensions_all', 'fifu_clean_dimensions_all')));
|
4 |
|
5 |
add_action('admin_menu', 'fifu_insert_menu');
|
6 |
|
40 |
$enable_lazy = get_option('fifu_lazy');
|
41 |
$enable_jquery = get_option('fifu_jquery');
|
42 |
$enable_media_library = get_option('fifu_media_library');
|
43 |
+
$enable_parameters = get_option('fifu_parameters');
|
44 |
$enable_content = get_option('fifu_content');
|
45 |
$enable_content_page = get_option('fifu_content_page');
|
46 |
$enable_fake = get_option('fifu_fake');
|
112 |
$enable_lazy = get_option('fifu_lazy');
|
113 |
$enable_jquery = get_option('fifu_jquery');
|
114 |
$enable_media_library = get_option('fifu_media_library');
|
115 |
+
$enable_parameters = get_option('fifu_parameters');
|
116 |
$enable_content = get_option('fifu_content');
|
117 |
$enable_content_page = get_option('fifu_content_page');
|
118 |
$enable_fake = get_option('fifu_fake');
|
222 |
fifu_update_option('fifu_input_lazy', 'fifu_lazy');
|
223 |
fifu_update_option('fifu_input_jquery', 'fifu_jquery');
|
224 |
fifu_update_option('fifu_input_media_library', 'fifu_media_library');
|
225 |
+
fifu_update_option('fifu_input_parameters', 'fifu_parameters');
|
226 |
fifu_update_option('fifu_input_content', 'fifu_content');
|
227 |
fifu_update_option('fifu_input_content_page', 'fifu_content_page');
|
228 |
fifu_update_option('fifu_input_fake', 'fifu_fake');
|
featured-image-from-url.php
CHANGED
@@ -4,11 +4,11 @@
|
|
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.0.
|
8 |
* Author: Marcel Jacques Machado
|
9 |
* Author URI: https://fifu.app/
|
10 |
* WC requires at least: 3.0
|
11 |
-
* WC tested up to: 4.1.
|
12 |
*/
|
13 |
|
14 |
define('FIFU_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
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.0.8
|
8 |
* Author: Marcel Jacques Machado
|
9 |
* Author URI: https://fifu.app/
|
10 |
* WC requires at least: 3.0
|
11 |
+
* WC tested up to: 4.1.1
|
12 |
*/
|
13 |
|
14 |
define('FIFU_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
includes/attachment.php
CHANGED
@@ -16,9 +16,11 @@ add_filter('wp_get_attachment_url', 'fifu_replace_attachment_url', 10, 2);
|
|
16 |
function fifu_replace_attachment_url($att_url, $att_id) {
|
17 |
if ($att_url) {
|
18 |
$url = explode(";", $att_url);
|
19 |
-
if (sizeof($url) > 1)
|
|
|
|
|
20 |
return fifu_has_internal_image_path($url[1]) ? get_post($att_id)->guid : $url[1];
|
21 |
-
else {
|
22 |
$post = get_post($att_id);
|
23 |
if ($post) {
|
24 |
if ($att_url && strpos($att_url, 'http') === 0 && $post->post_author != "77777")
|
@@ -124,6 +126,56 @@ function fifu_has_internal_image_path($url) {
|
|
124 |
return strpos($url, fifu_get_internal_image_path()) !== false || strpos($url, fifu_get_internal_image_path2()) !== false || strpos($url, fifu_get_internal_image_path3()) !== false || strpos($url, fifu_get_internal_image_path4()) !== false;
|
125 |
}
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
add_filter('wp_get_attachment_metadata', 'fifu_filter_wp_get_attachment_metadata', 10, 2);
|
128 |
|
129 |
function fifu_filter_wp_get_attachment_metadata($data, $post_id) {
|
@@ -151,6 +203,23 @@ function fifu_get_width_height($dimension) {
|
|
151 |
return array('width' => $width, 'height' => $height);
|
152 |
}
|
153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
// plugin: accelerated-mobile-pages
|
155 |
|
156 |
function fifu_amp_url($url, $width, $height) {
|
16 |
function fifu_replace_attachment_url($att_url, $att_id) {
|
17 |
if ($att_url) {
|
18 |
$url = explode(";", $att_url);
|
19 |
+
if (sizeof($url) > 1) {
|
20 |
+
if (fifu_is_on('fifu_parameters'))
|
21 |
+
$url[1] = fifu_add_url_parameters($url[1], $att_id);
|
22 |
return fifu_has_internal_image_path($url[1]) ? get_post($att_id)->guid : $url[1];
|
23 |
+
} else {
|
24 |
$post = get_post($att_id);
|
25 |
if ($post) {
|
26 |
if ($att_url && strpos($att_url, 'http') === 0 && $post->post_author != "77777")
|
126 |
return strpos($url, fifu_get_internal_image_path()) !== false || strpos($url, fifu_get_internal_image_path2()) !== false || strpos($url, fifu_get_internal_image_path3()) !== false || strpos($url, fifu_get_internal_image_path4()) !== false;
|
127 |
}
|
128 |
|
129 |
+
add_action('template_redirect', 'fifu_action', 10);
|
130 |
+
|
131 |
+
function fifu_action() {
|
132 |
+
ob_start("fifu_callback");
|
133 |
+
}
|
134 |
+
|
135 |
+
function fifu_callback($buffer) {
|
136 |
+
if (empty($buffer))
|
137 |
+
return;
|
138 |
+
|
139 |
+
if (is_singular('product') && fifu_is_off('fifu_lazy') && fifu_is_off('fifu_parameters'))
|
140 |
+
return $buffer;
|
141 |
+
|
142 |
+
$imgList = array();
|
143 |
+
preg_match_all('/<img[^>]*>/', $buffer, $imgList);
|
144 |
+
$srcArray = array(
|
145 |
+
"src" => "src",
|
146 |
+
"data-src" => "data-src"
|
147 |
+
);
|
148 |
+
foreach ($imgList[0] as $imgItem) {
|
149 |
+
foreach ($srcArray as $srcItem) {
|
150 |
+
preg_match('/(' . $srcItem . ')([^\'\"]*[\'\"]){2}/', $imgItem, $src);
|
151 |
+
if (!$src)
|
152 |
+
continue;
|
153 |
+
$delimiter = substr($src[0], - 1);
|
154 |
+
$url = explode($delimiter, $src[0])[1];
|
155 |
+
if (strpos($url, 'fifu-post-id') === false)
|
156 |
+
continue;
|
157 |
+
$id = explode('&', explode('fifu-post-id=', $url)[1])[0];
|
158 |
+
$featured = explode('&', explode('fifu-featured=', $url)[1])[0];
|
159 |
+
if (!(int) $featured)
|
160 |
+
continue;
|
161 |
+
$buffer = str_replace($imgItem, fifu_replace($imgItem, $id, null, null), $buffer);
|
162 |
+
}
|
163 |
+
}
|
164 |
+
|
165 |
+
// lazy load for background-image
|
166 |
+
$imgList = array();
|
167 |
+
preg_match_all('/<[^>]*background-image[^>]*>/', $buffer, $imgList);
|
168 |
+
foreach ($imgList[0] as $imgItem) {
|
169 |
+
$url = explode(')', explode('url(', $imgItem)[1])[0];
|
170 |
+
$newImgItem = preg_replace("/background-image[^:]*:[^\)]*url[^\)]*[\)]/", "", $imgItem);
|
171 |
+
$attr = 'data-bg=' . $url;
|
172 |
+
$newImgItem = str_replace('>', ' ' . $attr . '>', $newImgItem);
|
173 |
+
$buffer = str_replace($imgItem, $newImgItem, $buffer);
|
174 |
+
}
|
175 |
+
|
176 |
+
return $buffer;
|
177 |
+
}
|
178 |
+
|
179 |
add_filter('wp_get_attachment_metadata', 'fifu_filter_wp_get_attachment_metadata', 10, 2);
|
180 |
|
181 |
function fifu_filter_wp_get_attachment_metadata($data, $post_id) {
|
203 |
return array('width' => $width, 'height' => $height);
|
204 |
}
|
205 |
|
206 |
+
// for themes that dont call post_thumbnail_html
|
207 |
+
|
208 |
+
function fifu_add_url_parameters($url, $att_id) {
|
209 |
+
$post_id = get_post($att_id)->post_parent;
|
210 |
+
if (!$post_id)
|
211 |
+
return $url;
|
212 |
+
|
213 |
+
$symbol = strpos($url, '?') !== false ? '&' : '?';
|
214 |
+
$post_thumbnail_id = get_post_thumbnail_id($post_id);
|
215 |
+
$post_thumbnail_id = $post_thumbnail_id ? $post_thumbnail_id : get_term_meta($post_id, 'thumbnail_id', true);
|
216 |
+
$featured = $post_thumbnail_id == $att_id ? 1 : 0;
|
217 |
+
|
218 |
+
$url .= $symbol . 'fifu-post-id=' . $post_id . '&fifu-featured=' . $featured;
|
219 |
+
|
220 |
+
return $url;
|
221 |
+
}
|
222 |
+
|
223 |
// plugin: accelerated-mobile-pages
|
224 |
|
225 |
function fifu_amp_url($url, $width, $height) {
|
includes/thumbnail.php
CHANGED
@@ -21,6 +21,7 @@ add_filter('wp_head', 'fifu_apply_css');
|
|
21 |
function fifu_add_js() {
|
22 |
if (fifu_is_on('fifu_lazy')) {
|
23 |
wp_enqueue_script('lazyload', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyloadxt/1.1.0/jquery.lazyloadxt.min.js');
|
|
|
24 |
wp_enqueue_script('lazyload-srcset', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyloadxt/1.1.0/jquery.lazyloadxt.srcset.min.js');
|
25 |
wp_enqueue_style('lazyload-spinner', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyloadxt/1.1.0/jquery.lazyloadxt.spinner.min.css');
|
26 |
}
|
21 |
function fifu_add_js() {
|
22 |
if (fifu_is_on('fifu_lazy')) {
|
23 |
wp_enqueue_script('lazyload', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyloadxt/1.1.0/jquery.lazyloadxt.min.js');
|
24 |
+
wp_enqueue_script('lazyload-bg', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyloadxt/1.1.0/jquery.lazyloadxt.bg.min.js');
|
25 |
wp_enqueue_script('lazyload-srcset', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyloadxt/1.1.0/jquery.lazyloadxt.srcset.min.js');
|
26 |
wp_enqueue_style('lazyload-spinner', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyloadxt/1.1.0/jquery.lazyloadxt.spinner.min.css');
|
27 |
}
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: marceljm
|
|
3 |
Donate link: https://donorbox.org/fifu
|
4 |
Tags: featured image, image, featured, url, external, external featured image, featured image from url, url featured image, flickr, s3, picasa, woocommerce, product image, product gallery, product, gallery, column, list, page, post, all, content, custom, type, custom post type, category, video, external video, youtube, vimeo, featured video, hover, effects, hover effects, wp all import, css, style, slider, thumbnail, social, network, auto, publish, hide, first image, content, lightbox, size, grid, auto post thumbnail, link, uri, affiliate, wp, rest, api, wp rest api, lazy, load, google, drive, validation, jetpack, visual composer, play, pause, crop, resize, zoom, enable, disable, default, automatic, auto set, cloudinary, schedule, event, cron, seo, variable, tumblr, variation, product variation, shortcode, facebook, instagram, imgur, publitio, 9gag, wcfm, add-on, scraper, 特色圖片, 图片, 网址, 外部, unsplash, keyword, random, acf, rss, media, tag
|
5 |
Requires at least: 4.0
|
6 |
-
Tested up to: 5.4
|
7 |
-
Stable tag: 3.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -166,6 +166,9 @@ Features:
|
|
166 |
|
167 |
== Changelog ==
|
168 |
|
|
|
|
|
|
|
169 |
= 3.0.7 =
|
170 |
* Bug fix: internal featured images might not being shown in the previous version.
|
171 |
|
@@ -757,6 +760,9 @@ was removed. To finish, a Premium version is now been presented.
|
|
757 |
|
758 |
== Upgrade Notice ==
|
759 |
|
|
|
|
|
|
|
760 |
= 3.0.7 =
|
761 |
* Bug fix: internal featured images might not being shown in the previous version.
|
762 |
|
3 |
Donate link: https://donorbox.org/fifu
|
4 |
Tags: featured image, image, featured, url, external, external featured image, featured image from url, url featured image, flickr, s3, picasa, woocommerce, product image, product gallery, product, gallery, column, list, page, post, all, content, custom, type, custom post type, category, video, external video, youtube, vimeo, featured video, hover, effects, hover effects, wp all import, css, style, slider, thumbnail, social, network, auto, publish, hide, first image, content, lightbox, size, grid, auto post thumbnail, link, uri, affiliate, wp, rest, api, wp rest api, lazy, load, google, drive, validation, jetpack, visual composer, play, pause, crop, resize, zoom, enable, disable, default, automatic, auto set, cloudinary, schedule, event, cron, seo, variable, tumblr, variation, product variation, shortcode, facebook, instagram, imgur, publitio, 9gag, wcfm, add-on, scraper, 特色圖片, 图片, 网址, 外部, unsplash, keyword, random, acf, rss, media, tag
|
5 |
Requires at least: 4.0
|
6 |
+
Tested up to: 5.4.1
|
7 |
+
Stable tag: 3.0.8
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
166 |
|
167 |
== Changelog ==
|
168 |
|
169 |
+
= 3.0.8 =
|
170 |
+
* New Feature (Premium): Video > Product Gallery Icon; Improvement (Premium): FIFU gets YouTube video image thumbnails without top and bottom black stripes now; Improvement: Lazy Load can work with background images now; Notice: Internal URL Parameters is a FREE feature now.
|
171 |
+
|
172 |
= 3.0.7 =
|
173 |
* Bug fix: internal featured images might not being shown in the previous version.
|
174 |
|
760 |
|
761 |
== Upgrade Notice ==
|
762 |
|
763 |
+
= 3.0.8 =
|
764 |
+
* New Feature (Premium): Video > Product Gallery Icon; Improvement (Premium): FIFU gets YouTube video image thumbnails without top and bottom black stripes now; Improvement: Lazy Load can work with background images now; Notice: Internal URL Parameters is a FREE feature now.
|
765 |
+
|
766 |
= 3.0.7 =
|
767 |
* Bug fix: internal featured images might not being shown in the previous version.
|
768 |
|