Version Description
- New Feature (Premium): Giphy search; New option (Premium): Same Height > Delay; Bug Fix: problems due with invalid characters in some fields.
Download this release
Release Info
Developer | marceljm |
Plugin | Featured Image From URL |
Version | 3.1.0 |
Comparing to | |
See all releases |
Code changes from version 3.0.9 to 3.1.0
- admin/db.php +4 -2
- admin/html/js/menu.js +1 -0
- admin/html/js/meta-box.js +1 -0
- admin/html/menu.html +40 -5
- admin/html/meta-box.html +11 -0
- featured-image-from-url.php +1 -1
- includes/attachment.php +4 -1
- includes/thumbnail.php +2 -0
- readme.txt +10 -2
admin/db.php
CHANGED
@@ -511,7 +511,7 @@ class FifuDb {
|
|
511 |
function insert_attachment_by($value) {
|
512 |
$this->wpdb->get_results("
|
513 |
INSERT INTO " . $this->posts . " (post_author, guid, post_title, post_mime_type, post_type, post_status, post_parent, post_date, post_date_gmt, post_modified, post_modified_gmt, post_content, post_excerpt, to_ping, pinged, post_content_filtered)
|
514 |
-
VALUES " . $value);
|
515 |
}
|
516 |
|
517 |
function get_formatted_value($url, $alt, $post_parent) {
|
@@ -544,6 +544,7 @@ class FifuDb {
|
|
544 |
$result = $this->get_category_image_url($res->term_id);
|
545 |
$url = $result[0]->meta_value;
|
546 |
}
|
|
|
547 |
$value = $this->get_formatted_value($url, get_term_meta($res->term_id, 'fifu_image_alt', true), $res->term_id);
|
548 |
$this->insert_attachment_by($value);
|
549 |
$att_id = $this->wpdb->insert_id;
|
@@ -564,7 +565,8 @@ class FifuDb {
|
|
564 |
$result = $this->get_posts_without_meta();
|
565 |
foreach ($result as $res) {
|
566 |
$ids = ($i == 1) ? $res->post_id : ($ids . "," . $res->post_id);
|
567 |
-
$
|
|
|
568 |
$value = ($i == 1) ? $aux : ($value . "," . $aux);
|
569 |
if ($value && (($i % $this->MAX_INSERT == 0) || ($i % $this->MAX_INSERT != 0 && count($result) == $count))) {
|
570 |
wp_cache_flush();
|
511 |
function insert_attachment_by($value) {
|
512 |
$this->wpdb->get_results("
|
513 |
INSERT INTO " . $this->posts . " (post_author, guid, post_title, post_mime_type, post_type, post_status, post_parent, post_date, post_date_gmt, post_modified, post_modified_gmt, post_content, post_excerpt, to_ping, pinged, post_content_filtered)
|
514 |
+
VALUES " . str_replace('\\', '', $value));
|
515 |
}
|
516 |
|
517 |
function get_formatted_value($url, $alt, $post_parent) {
|
544 |
$result = $this->get_category_image_url($res->term_id);
|
545 |
$url = $result[0]->meta_value;
|
546 |
}
|
547 |
+
$url = htmlspecialchars_decode($url);
|
548 |
$value = $this->get_formatted_value($url, get_term_meta($res->term_id, 'fifu_image_alt', true), $res->term_id);
|
549 |
$this->insert_attachment_by($value);
|
550 |
$att_id = $this->wpdb->insert_id;
|
565 |
$result = $this->get_posts_without_meta();
|
566 |
foreach ($result as $res) {
|
567 |
$ids = ($i == 1) ? $res->post_id : ($ids . "," . $res->post_id);
|
568 |
+
$url = fifu_main_image_url($res->post_id);
|
569 |
+
$aux = $this->get_formatted_value($url, get_post_meta($res->post_id, 'fifu_image_alt', true), $res->post_id);
|
570 |
$value = ($i == 1) ? $aux : ($value . "," . $aux);
|
571 |
if ($value && (($i % $this->MAX_INSERT == 0) || ($i % $this->MAX_INSERT != 0 && count($result) == $count))) {
|
572 |
wp_cache_flush();
|
admin/html/js/menu.js
CHANGED
@@ -41,6 +41,7 @@ jQuery(function () {
|
|
41 |
jQuery("#fifu_input_spinner_slider").spinner({min: 0});
|
42 |
jQuery("#fifu_input_slider_speed").spinner({min: 0});
|
43 |
jQuery("#fifu_input_slider_pause").spinner({min: 0});
|
|
|
44 |
jQuery("#tabsApi").tabs();
|
45 |
jQuery("#tabsCrop").tabs();
|
46 |
jQuery("#tabsPremium").tabs();
|
41 |
jQuery("#fifu_input_spinner_slider").spinner({min: 0});
|
42 |
jQuery("#fifu_input_slider_speed").spinner({min: 0});
|
43 |
jQuery("#fifu_input_slider_pause").spinner({min: 0});
|
44 |
+
jQuery("#fifu_input_crop_delay").spinner({min: 0, step: 50});
|
45 |
jQuery("#tabsApi").tabs();
|
46 |
jQuery("#tabsCrop").tabs();
|
47 |
jQuery("#tabsPremium").tabs();
|
admin/html/js/meta-box.js
CHANGED
@@ -10,6 +10,7 @@ function removeImage() {
|
|
10 |
|
11 |
jQuery("#fifu_button").show();
|
12 |
jQuery("#fifu_help").show();
|
|
|
13 |
|
14 |
if (fifuMetaBoxVars.is_sirv_active)
|
15 |
jQuery("#fifu_sirv_button").show();
|
10 |
|
11 |
jQuery("#fifu_button").show();
|
12 |
jQuery("#fifu_help").show();
|
13 |
+
jQuery("#fifu_giphy").show();
|
14 |
|
15 |
if (fifuMetaBoxVars.is_sirv_active)
|
16 |
jQuery("#fifu_sirv_button").show();
|
admin/html/menu.html
CHANGED
@@ -31,6 +31,14 @@
|
|
31 |
<h2>Feature of the month</h2>
|
32 |
<div class="greybox">
|
33 |
<table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
<tr>
|
35 |
<td style="border-bottom:none;text-align:right;">April</td>
|
36 |
<td style="border-bottom:none">embedded video can be replaced by its image thumbnail + play button (drastically decreases the loading time)</td>
|
@@ -450,7 +458,7 @@
|
|
450 |
<h2>Same Height</h2>
|
451 |
<div class="greybox" id="grad2">
|
452 |
<b>Premium feature</b><br><br>
|
453 |
-
If you are not happy with the different sizes of external featured images on your home/shop, enable the toggle below to show them in the same height.
|
454 |
</div>
|
455 |
<br>
|
456 |
|
@@ -461,6 +469,7 @@
|
|
461 |
<li><a href="#tabsCrop-b">Selector</a></li>
|
462 |
<li><a href="#tabsCrop-c">Size Ratio</a></li>
|
463 |
<li><a href="#tabsCrop-d">Object Fit</a></li>
|
|
|
464 |
<br>
|
465 |
<br>
|
466 |
<div id="tabsCrop-a">
|
@@ -474,9 +483,6 @@
|
|
474 |
value=""
|
475 |
style="display:block;border:none">
|
476 |
</th>
|
477 |
-
<th>
|
478 |
-
if it doesn't work, use a Selector to inform where is the group of external images that you want at the same height.
|
479 |
-
</th>
|
480 |
</tr>
|
481 |
</table>
|
482 |
</div>
|
@@ -549,7 +555,23 @@
|
|
549 |
<input type="submit"
|
550 |
value="Submit" disabled>
|
551 |
</form>
|
552 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
553 |
</ul>
|
554 |
</div>
|
555 |
</div>
|
@@ -3020,6 +3042,19 @@
|
|
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>
|
31 |
<h2>Feature of the month</h2>
|
32 |
<div class="greybox">
|
33 |
<table>
|
34 |
+
<tr>
|
35 |
+
<td style="border-bottom:none;text-align:right;">June</td>
|
36 |
+
<td style="border-bottom:none">Giphy search</td>
|
37 |
+
</tr>
|
38 |
+
<tr>
|
39 |
+
<td style="border-bottom:none;text-align:right;">May</td>
|
40 |
+
<td style="border-bottom:none">Media RSS Tags</td>
|
41 |
+
</tr>
|
42 |
<tr>
|
43 |
<td style="border-bottom:none;text-align:right;">April</td>
|
44 |
<td style="border-bottom:none">embedded video can be replaced by its image thumbnail + play button (drastically decreases the loading time)</td>
|
458 |
<h2>Same Height</h2>
|
459 |
<div class="greybox" id="grad2">
|
460 |
<b>Premium feature</b><br><br>
|
461 |
+
If you are not happy with the different sizes of external featured images on your home/shop, enable the toggle below to show them in the same height. Depending on your theme, it will be necessary to use a Selector to inform where is the group of external images that you want at the same height.
|
462 |
</div>
|
463 |
<br>
|
464 |
|
469 |
<li><a href="#tabsCrop-b">Selector</a></li>
|
470 |
<li><a href="#tabsCrop-c">Size Ratio</a></li>
|
471 |
<li><a href="#tabsCrop-d">Object Fit</a></li>
|
472 |
+
<li><a href="#tabsCrop-e">Delay</a></li>
|
473 |
<br>
|
474 |
<br>
|
475 |
<div id="tabsCrop-a">
|
483 |
value=""
|
484 |
style="display:block;border:none">
|
485 |
</th>
|
|
|
|
|
|
|
486 |
</tr>
|
487 |
</table>
|
488 |
</div>
|
555 |
<input type="submit"
|
556 |
value="Submit" disabled>
|
557 |
</form>
|
558 |
+
</div>
|
559 |
+
|
560 |
+
<div id="tabsCrop-e">
|
561 |
+
<table>
|
562 |
+
<tr>
|
563 |
+
<th>
|
564 |
+
<input id="fifu_input_crop_delay"
|
565 |
+
name="fifu_input_crop_delay"
|
566 |
+
step="50"
|
567 |
+
size="5">
|
568 |
+
</th>
|
569 |
+
<th>
|
570 |
+
time (in ms)
|
571 |
+
</th>
|
572 |
+
</tr>
|
573 |
+
</table>
|
574 |
+
</div>
|
575 |
</ul>
|
576 |
</div>
|
577 |
</div>
|
3042 |
From September 2019, always you guys report an issue between FIFU and another plugin or theme, the solution will be posted here.
|
3043 |
</div>
|
3044 |
</div>
|
3045 |
+
<div class="box">
|
3046 |
+
<table>
|
3047 |
+
<tr>
|
3048 |
+
<td style="border-bottom:none">2020-05-31</td>
|
3049 |
+
<td style="border-bottom:none"><h3> Publisher</h3></td>
|
3050 |
+
<td style="border-bottom:none">theme</td>
|
3051 |
+
</tr>
|
3052 |
+
</table>
|
3053 |
+
<div class="greybox" style="position: relative; top: -10px">
|
3054 |
+
The theme lightbox doesn't work:<br>
|
3055 |
+
x) there is no solution for now. It seems the lightbox only works with image addresses (internal or external) that contains "/wp-content/uploads/". You may contact the theme developer and ask him to remove the restriction.<br>
|
3056 |
+
</div>
|
3057 |
+
</div>
|
3058 |
<div class="box">
|
3059 |
<table>
|
3060 |
<tr>
|
admin/html/meta-box.html
CHANGED
@@ -8,6 +8,17 @@
|
|
8 |
<br>
|
9 |
</div>
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
<input id="fifu_input_alt"
|
12 |
type="text"
|
13 |
name="fifu_input_alt"
|
8 |
<br>
|
9 |
</div>
|
10 |
|
11 |
+
<table id="fifu_giphy" style="<?php echo $show_button ?>">
|
12 |
+
<tr>
|
13 |
+
<th style="width:5px;padding:unset">
|
14 |
+
<input type="checkbox" name="fifu_giphy_checkbox" id="fifu_giphy_checkbox" disabled>
|
15 |
+
</th>
|
16 |
+
<th style="padding:unset">
|
17 |
+
<label for="fifu_giphy_checkbox" style="font-weight:normal;color:#cccccc">Giphy search (Premium)</label>
|
18 |
+
</th>
|
19 |
+
</tr>
|
20 |
+
</table>
|
21 |
+
|
22 |
<input id="fifu_input_alt"
|
23 |
type="text"
|
24 |
name="fifu_input_alt"
|
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.0
|
8 |
* Author: Marcel Jacques Machado
|
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.1.0
|
8 |
* Author: Marcel Jacques Machado
|
9 |
* Author URI: https://fifu.app/
|
10 |
* WC requires at least: 3.0
|
includes/attachment.php
CHANGED
@@ -167,9 +167,12 @@ function fifu_callback($buffer) {
|
|
167 |
$imgList = array();
|
168 |
preg_match_all('/<[^>]*background-image[^>]*>/', $buffer, $imgList);
|
169 |
foreach ($imgList[0] as $imgItem) {
|
|
|
170 |
$url = explode(')', explode('url(', $imgItem)[1])[0];
|
|
|
|
|
171 |
$newImgItem = preg_replace("/background-image[^:]*:[^\)]*url[^\)]*[\)]/", "", $imgItem);
|
172 |
-
$attr = 'data-bg=' . $url;
|
173 |
$newImgItem = str_replace('>', ' ' . $attr . '>', $newImgItem);
|
174 |
$buffer = str_replace($imgItem, $newImgItem, $buffer);
|
175 |
}
|
167 |
$imgList = array();
|
168 |
preg_match_all('/<[^>]*background-image[^>]*>/', $buffer, $imgList);
|
169 |
foreach ($imgList[0] as $imgItem) {
|
170 |
+
$mainDelimiter = substr(explode('style=', $imgItem)[1], 0, 1);
|
171 |
$url = explode(')', explode('url(', $imgItem)[1])[0];
|
172 |
+
$url = trim($url, '"');
|
173 |
+
$url = trim($url, "'");
|
174 |
$newImgItem = preg_replace("/background-image[^:]*:[^\)]*url[^\)]*[\)]/", "", $imgItem);
|
175 |
+
$attr = 'data-bg=' . $mainDelimiter . $url . $mainDelimiter;
|
176 |
$newImgItem = str_replace('>', ' ' . $attr . '>', $newImgItem);
|
177 |
$buffer = str_replace($imgItem, $newImgItem, $buffer);
|
178 |
}
|
includes/thumbnail.php
CHANGED
@@ -152,6 +152,8 @@ function fifu_main_image_url($post_id) {
|
|
152 |
if (!$url && fifu_no_internal_image($post_id) && (get_option('fifu_default_url') && fifu_is_on('fifu_enable_default_url')))
|
153 |
$url = get_option('fifu_default_url');
|
154 |
|
|
|
|
|
155 |
return str_replace("'", "", $url);
|
156 |
}
|
157 |
|
152 |
if (!$url && fifu_no_internal_image($post_id) && (get_option('fifu_default_url') && fifu_is_on('fifu_enable_default_url')))
|
153 |
$url = get_option('fifu_default_url');
|
154 |
|
155 |
+
$url = htmlspecialchars_decode($url);
|
156 |
+
|
157 |
return str_replace("'", "", $url);
|
158 |
}
|
159 |
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Plugin Name ===
|
2 |
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.1
|
7 |
-
Stable tag: 3.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -40,6 +40,8 @@ Features:
|
|
40 |
|
41 |
* you can apply your own CSS style or 18 hover effects to the images;
|
42 |
|
|
|
|
|
43 |
* supports WP REST API (**premium feature**);
|
44 |
|
45 |
* allows to schedule an cron event to set all first images as featured images. So it can run hourly, daily etc. (**premium feature**);
|
@@ -166,6 +168,9 @@ Features:
|
|
166 |
|
167 |
== Changelog ==
|
168 |
|
|
|
|
|
|
|
169 |
= 3.0.9 =
|
170 |
* Bug fix: background images might not being shown after the last update.
|
171 |
|
@@ -763,6 +768,9 @@ was removed. To finish, a Premium version is now been presented.
|
|
763 |
|
764 |
== Upgrade Notice ==
|
765 |
|
|
|
|
|
|
|
766 |
= 3.0.9 =
|
767 |
* Bug fix: background images might not being shown after the last update.
|
768 |
|
1 |
=== Plugin Name ===
|
2 |
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, giphy, 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.1.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
40 |
|
41 |
* you can apply your own CSS style or 18 hover effects to the images;
|
42 |
|
43 |
+
* you can search GIFs from Giphy by keywords and use it as featured image (**premium feature**);
|
44 |
+
|
45 |
* supports WP REST API (**premium feature**);
|
46 |
|
47 |
* allows to schedule an cron event to set all first images as featured images. So it can run hourly, daily etc. (**premium feature**);
|
168 |
|
169 |
== Changelog ==
|
170 |
|
171 |
+
= 3.1.0 =
|
172 |
+
* New Feature (Premium): Giphy search; New option (Premium): Same Height > Delay; Bug Fix: problems due with invalid characters in some fields.
|
173 |
+
|
174 |
= 3.0.9 =
|
175 |
* Bug fix: background images might not being shown after the last update.
|
176 |
|
768 |
|
769 |
== Upgrade Notice ==
|
770 |
|
771 |
+
= 3.1.0 =
|
772 |
+
* New Feature (Premium): Giphy search; New option (Premium): Same Height > Delay; Bug Fix: problems due with invalid characters in some fields.
|
773 |
+
|
774 |
= 3.0.9 =
|
775 |
* Bug fix: background images might not being shown after the last update.
|
776 |
|