Version Description
- New feature: Delete All URLs; Improvement: FIFU column differentiates internal and external images now; Bug fix: conflict with Classified Listing plugin; Bug fix: conflict between Admin->jQuery and Elementor editor.
Download this release
Release Info
Developer | marceljm |
Plugin | Featured Image From URL |
Version | 3.0.1 |
Comparing to | |
See all releases |
Code changes from version 3.0.0 to 3.0.1
- admin/api.php +10 -0
- admin/column.php +12 -4
- admin/db.php +22 -0
- admin/html/js/menu.js +40 -0
- admin/html/menu.html +102 -13
- admin/html/support-data.html +4 -0
- admin/menu.php +20 -2
- featured-image-from-url.php +2 -1
- includes/attachment.php +11 -1
- includes/thumbnail.php +1 -1
- includes/util.php +12 -0
- readme.txt +7 -1
admin/api.php
CHANGED
@@ -18,6 +18,11 @@ function fifu_data_clean_api(WP_REST_Request $request) {
|
|
18 |
update_option('fifu_data_clean', 'toggleoff', 'no');
|
19 |
}
|
20 |
|
|
|
|
|
|
|
|
|
|
|
21 |
function fifu_save_dimensions_all_api(WP_REST_Request $request) {
|
22 |
update_option('fifu_save_dimensions_all', 'toggleoff', 'no');
|
23 |
|
@@ -76,6 +81,11 @@ add_action('rest_api_init', function () {
|
|
76 |
'callback' => 'fifu_data_clean_api',
|
77 |
'permission_callback' => 'fifu_get_private_data_permissions_check',
|
78 |
));
|
|
|
|
|
|
|
|
|
|
|
79 |
register_rest_route('featured-image-from-url/v2', '/save_dimensions_all_api/', array(
|
80 |
'methods' => 'POST',
|
81 |
'callback' => 'fifu_save_dimensions_all_api',
|
18 |
update_option('fifu_data_clean', 'toggleoff', 'no');
|
19 |
}
|
20 |
|
21 |
+
function fifu_run_delete_all_api(WP_REST_Request $request) {
|
22 |
+
fifu_db_delete_all();
|
23 |
+
update_option('fifu_run_delete_all', 'toggleoff', 'no');
|
24 |
+
}
|
25 |
+
|
26 |
function fifu_save_dimensions_all_api(WP_REST_Request $request) {
|
27 |
update_option('fifu_save_dimensions_all', 'toggleoff', 'no');
|
28 |
|
81 |
'callback' => 'fifu_data_clean_api',
|
82 |
'permission_callback' => 'fifu_get_private_data_permissions_check',
|
83 |
));
|
84 |
+
register_rest_route('fifu-premium/v2', '/run_delete_all_api/', array(
|
85 |
+
'methods' => 'POST',
|
86 |
+
'callback' => 'fifu_run_delete_all_api',
|
87 |
+
'permission_callback' => 'fifu_get_private_data_permissions_check',
|
88 |
+
));
|
89 |
register_rest_route('featured-image-from-url/v2', '/save_dimensions_all_api/', array(
|
90 |
'methods' => 'POST',
|
91 |
'callback' => 'fifu_save_dimensions_all_api',
|
admin/column.php
CHANGED
@@ -18,22 +18,30 @@ function fifu_column_head($default) {
|
|
18 |
}
|
19 |
|
20 |
function fifu_ctgr_column_content($internal_image, $column, $term_id) {
|
|
|
21 |
$height = get_option('fifu_column_height');
|
22 |
if ($column == 'featured_image') {
|
23 |
$url = get_term_meta($term_id, 'fifu_image_url', true);
|
24 |
-
if ($url
|
25 |
-
|
|
|
|
|
|
|
|
|
26 |
} else
|
27 |
echo $internal_image;
|
28 |
}
|
29 |
|
30 |
function fifu_column_content($column, $post_id) {
|
|
|
31 |
$height = get_option('fifu_column_height');
|
32 |
if ($column == 'featured_image') {
|
33 |
$url = fifu_main_image_url($post_id);
|
34 |
-
if ($url == '')
|
35 |
$url = wp_get_attachment_url(get_post_thumbnail_id());
|
36 |
-
|
|
|
|
|
37 |
}
|
38 |
}
|
39 |
|
18 |
}
|
19 |
|
20 |
function fifu_ctgr_column_content($internal_image, $column, $term_id) {
|
21 |
+
$border = '';
|
22 |
$height = get_option('fifu_column_height');
|
23 |
if ($column == 'featured_image') {
|
24 |
$url = get_term_meta($term_id, 'fifu_image_url', true);
|
25 |
+
if ($url == '') {
|
26 |
+
$thumb_id = get_woocommerce_term_meta($term_id, 'thumbnail_id', true);
|
27 |
+
$url = wp_get_attachment_url($thumb_id);
|
28 |
+
$border = 'border-color: red !important; border: 1px; border-style: solid;';
|
29 |
+
}
|
30 |
+
echo sprintf('<div style="height:%spx; width:%spx; background:url(\'%s\') no-repeat center center; background-size:cover; %s"/>', $height, $height * 1.5, $url, $border);
|
31 |
} else
|
32 |
echo $internal_image;
|
33 |
}
|
34 |
|
35 |
function fifu_column_content($column, $post_id) {
|
36 |
+
$border = '';
|
37 |
$height = get_option('fifu_column_height');
|
38 |
if ($column == 'featured_image') {
|
39 |
$url = fifu_main_image_url($post_id);
|
40 |
+
if ($url == '') {
|
41 |
$url = wp_get_attachment_url(get_post_thumbnail_id());
|
42 |
+
$border = 'border-color: red !important; border: 1px; border-style: solid;';
|
43 |
+
}
|
44 |
+
echo sprintf('<div style="height:%spx; width:%spx; background:url(\'%s\') no-repeat center center; background-size:cover; %s"/>', $height, $height * 1.5, $url, $border);
|
45 |
}
|
46 |
}
|
47 |
|
admin/db.php
CHANGED
@@ -844,6 +844,21 @@ class FifuDb {
|
|
844 |
update_option('fifu_fake_created', false, 'no');
|
845 |
}
|
846 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
847 |
}
|
848 |
|
849 |
/* fake internal featured image */
|
@@ -921,6 +936,13 @@ function fifu_db_enable_clean() {
|
|
921 |
$db->enable_clean();
|
922 |
}
|
923 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
924 |
/* save post */
|
925 |
|
926 |
function fifu_db_update_fake_attach_id($post_id) {
|
844 |
update_option('fifu_fake_created', false, 'no');
|
845 |
}
|
846 |
|
847 |
+
/* delete all urls */
|
848 |
+
|
849 |
+
function delete_all() {
|
850 |
+
if (fifu_is_on('fifu_confirm_delete_all') &&
|
851 |
+
fifu_is_on('fifu_run_delete_all') &&
|
852 |
+
get_option('fifu_confirm_delete_all_time') &&
|
853 |
+
get_option('fifu_run_delete_all_time') &&
|
854 |
+
FIFU_DELETE_ALL_URLS) {
|
855 |
+
$this->wpdb->get_results("
|
856 |
+
DELETE FROM " . $this->postmeta . "
|
857 |
+
WHERE meta_key LIKE 'fifu_%'"
|
858 |
+
);
|
859 |
+
}
|
860 |
+
}
|
861 |
+
|
862 |
}
|
863 |
|
864 |
/* fake internal featured image */
|
936 |
$db->enable_clean();
|
937 |
}
|
938 |
|
939 |
+
/* delete all urls */
|
940 |
+
|
941 |
+
function fifu_db_delete_all() {
|
942 |
+
$db = new FifuDb();
|
943 |
+
return $db->delete_all();
|
944 |
+
}
|
945 |
+
|
946 |
/* save post */
|
947 |
|
948 |
function fifu_db_update_fake_attach_id($post_id) {
|
admin/html/js/menu.js
CHANGED
@@ -135,6 +135,10 @@ function fifu_clean_js() {
|
|
135 |
if (jQuery("#fifu_toggle_data_clean").attr('class') != 'toggleon')
|
136 |
return;
|
137 |
|
|
|
|
|
|
|
|
|
138 |
jQuery('#tabs-top').block({message: 'Please wait some seconds...', css: {backgroundColor: 'none', border: 'none', color: 'white'}});
|
139 |
|
140 |
jQuery.ajax({
|
@@ -161,6 +165,38 @@ function fifu_clean_js() {
|
|
161 |
});
|
162 |
}
|
163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
function fifu_save_dimensions_all_js() {
|
165 |
if (jQuery("#fifu_toggle_save_dimensions_all").attr('class') != 'toggleon')
|
166 |
return;
|
@@ -200,6 +236,10 @@ function fifu_clean_dimensions_all_js() {
|
|
200 |
if (jQuery("#fifu_toggle_clean_dimensions_all").attr('class') != 'toggleon')
|
201 |
return;
|
202 |
|
|
|
|
|
|
|
|
|
203 |
jQuery('#tabs-top').block({message: 'Please wait some seconds...', css: {backgroundColor: 'none', border: 'none', color: 'white'}});
|
204 |
|
205 |
jQuery.ajax({
|
135 |
if (jQuery("#fifu_toggle_data_clean").attr('class') != 'toggleon')
|
136 |
return;
|
137 |
|
138 |
+
fifu_run_clean_js();
|
139 |
+
}
|
140 |
+
|
141 |
+
function fifu_run_clean_js() {
|
142 |
jQuery('#tabs-top').block({message: 'Please wait some seconds...', css: {backgroundColor: 'none', border: 'none', color: 'white'}});
|
143 |
|
144 |
jQuery.ajax({
|
165 |
});
|
166 |
}
|
167 |
|
168 |
+
function fifu_run_delete_all_js() {
|
169 |
+
if (jQuery("#fifu_toggle_run_delete_all").attr('class') != 'toggleon' || jQuery("#fifu_toggle_confirm_delete_all").attr('class') != 'toggleon')
|
170 |
+
return;
|
171 |
+
|
172 |
+
fifu_run_clean_js();
|
173 |
+
fifu_run_clean_dimensions_all_js();
|
174 |
+
|
175 |
+
jQuery('#tabs-top').block({message: 'Please wait some seconds...', css: {backgroundColor: 'none', border: 'none', color: 'white'}});
|
176 |
+
|
177 |
+
jQuery.ajax({
|
178 |
+
method: "POST",
|
179 |
+
url: restUrl + 'fifu-premium/v2/run_delete_all_api/',
|
180 |
+
async: true,
|
181 |
+
beforeSend: function (xhr) {
|
182 |
+
xhr.setRequestHeader('X-WP-Nonce', fifuScriptVars.nonce);
|
183 |
+
},
|
184 |
+
success: function (data) {
|
185 |
+
},
|
186 |
+
error: function (jqXHR, textStatus, errorThrown) {
|
187 |
+
console.log(jqXHR);
|
188 |
+
console.log(textStatus);
|
189 |
+
console.log(errorThrown);
|
190 |
+
},
|
191 |
+
complete: function () {
|
192 |
+
setTimeout(function () {
|
193 |
+
jQuery("#fifu_toggle_run_delete_all").attr('class', 'toggleoff');
|
194 |
+
jQuery('#tabs-top').unblock();
|
195 |
+
}, 1000);
|
196 |
+
}
|
197 |
+
});
|
198 |
+
}
|
199 |
+
|
200 |
function fifu_save_dimensions_all_js() {
|
201 |
if (jQuery("#fifu_toggle_save_dimensions_all").attr('class') != 'toggleon')
|
202 |
return;
|
236 |
if (jQuery("#fifu_toggle_clean_dimensions_all").attr('class') != 'toggleon')
|
237 |
return;
|
238 |
|
239 |
+
fifu_run_clean_dimensions_all_js();
|
240 |
+
}
|
241 |
+
|
242 |
+
function fifu_run_clean_dimensions_all_js() {
|
243 |
jQuery('#tabs-top').block({message: 'Please wait some seconds...', css: {backgroundColor: 'none', border: 'none', color: 'white'}});
|
244 |
|
245 |
jQuery.ajax({
|
admin/html/menu.html
CHANGED
@@ -27,6 +27,25 @@
|
|
27 |
<br>
|
28 |
<div id="tabs-a">
|
29 |
<a name="top"></a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
<div class="box">
|
31 |
<h2><a href="https://fifu.app/">Featured Image from URL (Premium)</a></h2>
|
32 |
<iframe style="width:100%;height:600px" src="https://fifu.app/"></iframe>
|
@@ -1288,6 +1307,76 @@
|
|
1288 |
</tr>
|
1289 |
</table>
|
1290 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1291 |
</div>
|
1292 |
<div id="tabs-l">
|
1293 |
<div class="box">
|
@@ -1494,7 +1583,7 @@
|
|
1494 |
<h2>Video Image Thumbnail</h2>
|
1495 |
<div class="greybox" id="grad2">
|
1496 |
<b>Premium feature</b><br><br>
|
1497 |
-
Enable the toggle below to show the video image thumbnail instead of the video. Clicking on the play icon, the video will be played in a lightbox.
|
1498 |
</div>
|
1499 |
<br>
|
1500 |
<table style="text-align:left">
|
@@ -1540,6 +1629,17 @@
|
|
1540 |
</table>
|
1541 |
</div>
|
1542 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1543 |
<div class="box">
|
1544 |
<h2>Black Background</h2>
|
1545 |
<div class="greybox" id="grad2">
|
@@ -1555,17 +1655,6 @@
|
|
1555 |
style="display:block;border:none">
|
1556 |
</div>
|
1557 |
|
1558 |
-
<div class="box">
|
1559 |
-
<h2>Minimum Width</h2>
|
1560 |
-
<div class="greybox" id="grad2">
|
1561 |
-
<b>Premium feature</b><br><br>
|
1562 |
-
Minimum width that an available area should have to show a video. Otherwise the thumbnail will be shown.
|
1563 |
-
</div>
|
1564 |
-
<br>
|
1565 |
-
<input id="fifu_input_video_min_width" type="text" name="fifu_input_video_min_width" value="" size="4" style="width:75px">
|
1566 |
-
<input type="submit" value="Submit" disabled>
|
1567 |
-
</div>
|
1568 |
-
|
1569 |
<div class="box">
|
1570 |
<h2>Video Autoplay (mouseover)</h2>
|
1571 |
<div class="greybox" id="grad2">
|
@@ -2652,7 +2741,7 @@
|
|
2652 |
<div class="box">
|
2653 |
<h2>Fast Support</h2>
|
2654 |
<div class="greybox">
|
2655 |
-
If you need help, you can refer to <a href="https://wordpress.org/plugins/featured-image-from-url/screenshots/" target="_blank">screenshots</a>, <a href="admin.php?page=featured-image-from-url#tabs-t" target="_blank">troubleshooting</a> or send an email to <b>marcel@featuredimagefromurl.com</b> (send me this <a href="admin.php?page=fifu-support-data"><button id="opener" onclick="jQuery('#tabs-top').block({message: 'Please wait some seconds...', css: {backgroundColor: 'none', border: 'none', color: 'white'}});">data</button></a
|
2656 |
<br>
|
2657 |
<br>
|
2658 |
<table style="background-color: #fff; border-radius: 13px;">
|
27 |
<br>
|
28 |
<div id="tabs-a">
|
29 |
<a name="top"></a>
|
30 |
+
<div class="box">
|
31 |
+
<h2>Feature of the month</h2>
|
32 |
+
<div class="greybox">
|
33 |
+
<table>
|
34 |
+
<tr>
|
35 |
+
<td style="border-bottom:none;text-align:right;">March</td>
|
36 |
+
<td style="border-bottom:none">embedded video can be replaced by its image thumbnail + play button (drastically decreases the loading time)</td>
|
37 |
+
</tr>
|
38 |
+
<tr>
|
39 |
+
<td style="border-bottom:none;text-align:right;">February</td>
|
40 |
+
<td style="border-bottom:none">support to private videos from Vimeo</td>
|
41 |
+
</tr>
|
42 |
+
<tr>
|
43 |
+
<td style="border-bottom:none;text-align:right;">January</td>
|
44 |
+
<td style="border-bottom:none">integration with WooCoomerce Additional Variation Images plugin</td>
|
45 |
+
</tr>
|
46 |
+
</table>
|
47 |
+
</div>
|
48 |
+
</div>
|
49 |
<div class="box">
|
50 |
<h2><a href="https://fifu.app/">Featured Image from URL (Premium)</a></h2>
|
51 |
<iframe style="width:100%;height:600px" src="https://fifu.app/"></iframe>
|
1307 |
</tr>
|
1308 |
</table>
|
1309 |
</div>
|
1310 |
+
|
1311 |
+
<div class="box">
|
1312 |
+
|
1313 |
+
<h2>Delete All URLs <span class="dashicons dashicons-welcome-comments" style="font-size: 25px;" title="Requirement: access Plugins -> Plugin Editor -> Select plugin to edit -> Featured Image from URL -> Select. Then change the value of FIFU_DELETE_ALL_URLS from false to true."></span></h2>
|
1314 |
+
|
1315 |
+
<div class="greybox">
|
1316 |
+
|
1317 |
+
<b>Important</b>: this plugin doesn't save images in the media library. It means that enabling the two toggles below all post types that have an external featured image will no longer have any featured image. And you can't undo this action later.
|
1318 |
+
|
1319 |
+
</div>
|
1320 |
+
|
1321 |
+
<br>
|
1322 |
+
|
1323 |
+
<table style="text-align:left">
|
1324 |
+
<tr>
|
1325 |
+
<th>
|
1326 |
+
<form
|
1327 |
+
id="fifu_form_confirm_delete_all"
|
1328 |
+
action="javascript:void(0)"
|
1329 |
+
method="post">
|
1330 |
+
<input
|
1331 |
+
type="submit"
|
1332 |
+
href="javascript:void(0)"
|
1333 |
+
id="fifu_toggle_confirm_delete_all"
|
1334 |
+
onclick="invert('confirm_delete_all')"
|
1335 |
+
name="fifu_toggle_confirm_delete_all"
|
1336 |
+
class="<?php echo $enable_confirm_delete_all; ?>"
|
1337 |
+
value=""
|
1338 |
+
style="display:block;border:none">
|
1339 |
+
|
1340 |
+
<input
|
1341 |
+
type="hidden"
|
1342 |
+
id="fifu_input_confirm_delete_all"
|
1343 |
+
name="fifu_input_confirm_delete_all"
|
1344 |
+
value="" >
|
1345 |
+
</form>
|
1346 |
+
</th>
|
1347 |
+
<th>
|
1348 |
+
enable this toggle to confirm that you are ready to lose your featured images
|
1349 |
+
</th>
|
1350 |
+
</tr>
|
1351 |
+
<tr>
|
1352 |
+
<th>
|
1353 |
+
<form
|
1354 |
+
id="fifu_form_run_delete_all"
|
1355 |
+
action="javascript:void(0)"
|
1356 |
+
method="post">
|
1357 |
+
<input
|
1358 |
+
type="submit"
|
1359 |
+
href="javascript:void(0)"
|
1360 |
+
id="fifu_toggle_run_delete_all"
|
1361 |
+
onclick="invert('run_delete_all');fifu_run_delete_all_js();"
|
1362 |
+
name="fifu_toggle_run_delete_all"
|
1363 |
+
class="<?php echo $enable_run_delete_all; ?>"
|
1364 |
+
value=""
|
1365 |
+
style="display:block;border:none">
|
1366 |
+
|
1367 |
+
<input
|
1368 |
+
type="hidden"
|
1369 |
+
id="fifu_input_run_delete_all"
|
1370 |
+
name="fifu_input_run_delete_all"
|
1371 |
+
value="" >
|
1372 |
+
</form>
|
1373 |
+
</th>
|
1374 |
+
<th>
|
1375 |
+
enable this toggle to delete all your URLs now
|
1376 |
+
</th>
|
1377 |
+
</tr>
|
1378 |
+
</table>
|
1379 |
+
</div>
|
1380 |
</div>
|
1381 |
<div id="tabs-l">
|
1382 |
<div class="box">
|
1583 |
<h2>Video Image Thumbnail</h2>
|
1584 |
<div class="greybox" id="grad2">
|
1585 |
<b>Premium feature</b><br><br>
|
1586 |
+
Enable the toggle below to show the video image thumbnail instead of the video. Clicking on the play icon, the video will be played in a lightbox. The other video features do not apply when you are using video image thumbnails.
|
1587 |
</div>
|
1588 |
<br>
|
1589 |
<table style="text-align:left">
|
1629 |
</table>
|
1630 |
</div>
|
1631 |
|
1632 |
+
<div class="box">
|
1633 |
+
<h2>Minimum Width</h2>
|
1634 |
+
<div class="greybox" id="grad2">
|
1635 |
+
<b>Premium feature</b><br><br>
|
1636 |
+
Minimum width that an available area should have to show a video. Otherwise the thumbnail will be shown.
|
1637 |
+
</div>
|
1638 |
+
<br>
|
1639 |
+
<input id="fifu_input_video_min_width" type="text" name="fifu_input_video_min_width" value="" size="4" style="width:75px">
|
1640 |
+
<input type="submit" value="Submit" disabled>
|
1641 |
+
</div>
|
1642 |
+
|
1643 |
<div class="box">
|
1644 |
<h2>Black Background</h2>
|
1645 |
<div class="greybox" id="grad2">
|
1655 |
style="display:block;border:none">
|
1656 |
</div>
|
1657 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1658 |
<div class="box">
|
1659 |
<h2>Video Autoplay (mouseover)</h2>
|
1660 |
<div class="greybox" id="grad2">
|
2741 |
<div class="box">
|
2742 |
<h2>Fast Support</h2>
|
2743 |
<div class="greybox">
|
2744 |
+
If you need help, you can refer to <a href="https://wordpress.org/plugins/featured-image-from-url/screenshots/" target="_blank">screenshots</a>, <a href="admin.php?page=featured-image-from-url#tabs-t" target="_blank">troubleshooting</a> or send an email to <b>marcel@featuredimagefromurl.com</b> (send me this <a href="admin.php?page=fifu-support-data"><button id="opener" onclick="jQuery('#tabs-top').block({message: 'Please wait some seconds...', css: {backgroundColor: 'none', border: 'none', color: 'white'}});">data</button></a>).
|
2745 |
<br>
|
2746 |
<br>
|
2747 |
<table style="background-color: #fff; border-radius: 13px;">
|
admin/html/support-data.html
CHANGED
@@ -25,6 +25,8 @@ fifu_auto_alt:<?php echo $enable_auto_alt ?>;
|
|
25 |
fifu_class:<?php echo $enable_class ?>;
|
26 |
fifu_clean_dimensions_all:<?php echo $enable_clean_dimensions_all ?>;
|
27 |
fifu_column_height:<?php echo $column_height ?>;
|
|
|
|
|
28 |
fifu_content:<?php echo $enable_content ?>;
|
29 |
fifu_content_page:<?php echo $enable_content_page ?>;
|
30 |
fifu_css:<?php echo $css_style ?>;
|
@@ -61,6 +63,8 @@ fifu_original:<?php echo $enable_original ?>;
|
|
61 |
fifu_ovw_first:<?php echo $enable_ovw_first ?>;
|
62 |
fifu_pop_first:<?php echo $enable_pop_first ?>;
|
63 |
fifu_query_strings:<?php echo $enable_query_strings ?>;
|
|
|
|
|
64 |
fifu_save_dimensions:<?php echo $enable_save_dimensions ?>;
|
65 |
fifu_save_dimensions_all:<?php echo $enable_save_dimensions_all ?>;
|
66 |
fifu_save_dimensions_redirect:<?php echo $enable_save_dimensions_redirect ?>;
|
25 |
fifu_class:<?php echo $enable_class ?>;
|
26 |
fifu_clean_dimensions_all:<?php echo $enable_clean_dimensions_all ?>;
|
27 |
fifu_column_height:<?php echo $column_height ?>;
|
28 |
+
fifu_confirm_delete_all:<?php echo $enable_confirm_delete_all ?>;
|
29 |
+
fifu_confirm_delete_all_time:<?php echo $enable_confirm_delete_all_time ?>;
|
30 |
fifu_content:<?php echo $enable_content ?>;
|
31 |
fifu_content_page:<?php echo $enable_content_page ?>;
|
32 |
fifu_css:<?php echo $css_style ?>;
|
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 ?>;
|
67 |
+
fifu_run_delete_all_time:<?php echo $enable_run_delete_all_time ?>;
|
68 |
fifu_save_dimensions:<?php echo $enable_save_dimensions ?>;
|
69 |
fifu_save_dimensions_all:<?php echo $enable_save_dimensions_all ?>;
|
70 |
fifu_save_dimensions_redirect:<?php echo $enable_save_dimensions_redirect ?>;
|
admin/menu.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
define('FIFU_SETTINGS', serialize(array('fifu_social', '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_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 |
|
@@ -57,6 +57,10 @@ function fifu_support_data() {
|
|
57 |
$enable_pop_first = get_option('fifu_pop_first');
|
58 |
$enable_ovw_first = get_option('fifu_ovw_first');
|
59 |
$enable_query_strings = get_option('fifu_query_strings');
|
|
|
|
|
|
|
|
|
60 |
$column_height = get_option('fifu_column_height');
|
61 |
$enable_grid_category = get_option('fifu_grid_category');
|
62 |
$enable_auto_alt = get_option('fifu_auto_alt');
|
@@ -123,6 +127,10 @@ function fifu_get_menu_html() {
|
|
123 |
$enable_pop_first = get_option('fifu_pop_first');
|
124 |
$enable_ovw_first = get_option('fifu_ovw_first');
|
125 |
$enable_query_strings = get_option('fifu_query_strings');
|
|
|
|
|
|
|
|
|
126 |
$column_height = get_option('fifu_column_height');
|
127 |
$enable_grid_category = get_option('fifu_grid_category');
|
128 |
$enable_auto_alt = get_option('fifu_auto_alt');
|
@@ -179,7 +187,7 @@ function fifu_get_setting($type) {
|
|
179 |
$arr100 = array('fifu_spinner_db');
|
180 |
$arrOn = array('fifu_auto_alt', 'fifu_wc_zoom', 'fifu_wc_lbox');
|
181 |
$arrOnNo = array('fifu_fake', 'fifu_social');
|
182 |
-
$arrOffNo = array('fifu_data_clean');
|
183 |
|
184 |
if (!get_option($type)) {
|
185 |
if (in_array($type, $arrEmpty))
|
@@ -227,6 +235,8 @@ function fifu_update_menu_options() {
|
|
227 |
fifu_update_option('fifu_input_pop_first', 'fifu_pop_first');
|
228 |
fifu_update_option('fifu_input_ovw_first', 'fifu_ovw_first');
|
229 |
fifu_update_option('fifu_input_query_strings', 'fifu_query_strings');
|
|
|
|
|
230 |
fifu_update_option('fifu_input_column_height', 'fifu_column_height');
|
231 |
fifu_update_option('fifu_input_grid_category', 'fifu_grid_category');
|
232 |
fifu_update_option('fifu_input_auto_alt', 'fifu_auto_alt');
|
@@ -252,6 +262,14 @@ function fifu_update_menu_options() {
|
|
252 |
fifu_update_option('fifu_input_save_dimensions_redirect', 'fifu_save_dimensions_redirect');
|
253 |
fifu_update_option('fifu_input_save_dimensions_all', 'fifu_save_dimensions_all');
|
254 |
fifu_update_option('fifu_input_clean_dimensions_all', 'fifu_clean_dimensions_all');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
}
|
256 |
|
257 |
function fifu_update_option($input, $type) {
|
1 |
<?php
|
2 |
|
3 |
+
define('FIFU_SETTINGS', serialize(array('fifu_social', '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 |
|
57 |
$enable_pop_first = get_option('fifu_pop_first');
|
58 |
$enable_ovw_first = get_option('fifu_ovw_first');
|
59 |
$enable_query_strings = get_option('fifu_query_strings');
|
60 |
+
$enable_confirm_delete_all = get_option('fifu_confirm_delete_all');
|
61 |
+
$enable_confirm_delete_all_time = get_option('fifu_confirm_delete_all_time');
|
62 |
+
$enable_run_delete_all = get_option('fifu_run_delete_all');
|
63 |
+
$enable_run_delete_all_time = get_option('fifu_run_delete_all_time');
|
64 |
$column_height = get_option('fifu_column_height');
|
65 |
$enable_grid_category = get_option('fifu_grid_category');
|
66 |
$enable_auto_alt = get_option('fifu_auto_alt');
|
127 |
$enable_pop_first = get_option('fifu_pop_first');
|
128 |
$enable_ovw_first = get_option('fifu_ovw_first');
|
129 |
$enable_query_strings = get_option('fifu_query_strings');
|
130 |
+
$enable_confirm_delete_all = get_option('fifu_confirm_delete_all');
|
131 |
+
$enable_confirm_delete_all_time = get_option('fifu_confirm_delete_all_time');
|
132 |
+
$enable_run_delete_all = get_option('fifu_run_delete_all');
|
133 |
+
$enable_run_delete_all_time = get_option('fifu_run_delete_all_time');
|
134 |
$column_height = get_option('fifu_column_height');
|
135 |
$enable_grid_category = get_option('fifu_grid_category');
|
136 |
$enable_auto_alt = get_option('fifu_auto_alt');
|
187 |
$arr100 = array('fifu_spinner_db');
|
188 |
$arrOn = array('fifu_auto_alt', 'fifu_wc_zoom', 'fifu_wc_lbox');
|
189 |
$arrOnNo = array('fifu_fake', 'fifu_social');
|
190 |
+
$arrOffNo = array('fifu_data_clean', 'fifu_confirm_delete_all', 'fifu_run_delete_all');
|
191 |
|
192 |
if (!get_option($type)) {
|
193 |
if (in_array($type, $arrEmpty))
|
235 |
fifu_update_option('fifu_input_pop_first', 'fifu_pop_first');
|
236 |
fifu_update_option('fifu_input_ovw_first', 'fifu_ovw_first');
|
237 |
fifu_update_option('fifu_input_query_strings', 'fifu_query_strings');
|
238 |
+
fifu_update_option('fifu_input_confirm_delete_all', 'fifu_confirm_delete_all');
|
239 |
+
fifu_update_option('fifu_input_run_delete_all', 'fifu_run_delete_all');
|
240 |
fifu_update_option('fifu_input_column_height', 'fifu_column_height');
|
241 |
fifu_update_option('fifu_input_grid_category', 'fifu_grid_category');
|
242 |
fifu_update_option('fifu_input_auto_alt', 'fifu_auto_alt');
|
262 |
fifu_update_option('fifu_input_save_dimensions_redirect', 'fifu_save_dimensions_redirect');
|
263 |
fifu_update_option('fifu_input_save_dimensions_all', 'fifu_save_dimensions_all');
|
264 |
fifu_update_option('fifu_input_clean_dimensions_all', 'fifu_clean_dimensions_all');
|
265 |
+
|
266 |
+
// delete all confirm log
|
267 |
+
if (fifu_is_on('fifu_confirm_delete_all'))
|
268 |
+
update_option('fifu_confirm_delete_all_time', current_time('mysql'), 'no');
|
269 |
+
|
270 |
+
// delete all run log
|
271 |
+
if (fifu_is_on('fifu_run_delete_all'))
|
272 |
+
update_option('fifu_run_delete_all_time', current_time('mysql'), 'no');
|
273 |
}
|
274 |
|
275 |
function fifu_update_option($input, $type) {
|
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://www.linkedin.com/in/marceljm/
|
10 |
*/
|
@@ -12,6 +12,7 @@
|
|
12 |
define('FIFU_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
13 |
define('FIFU_INCLUDES_DIR', FIFU_PLUGIN_DIR . 'includes');
|
14 |
define('FIFU_ADMIN_DIR', FIFU_PLUGIN_DIR . 'admin');
|
|
|
15 |
|
16 |
require_once (FIFU_INCLUDES_DIR . '/attachment.php');
|
17 |
require_once (FIFU_INCLUDES_DIR . '/convert-url.php');
|
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.1
|
8 |
* Author: Marcel Jacques Machado
|
9 |
* Author URI: https://www.linkedin.com/in/marceljm/
|
10 |
*/
|
12 |
define('FIFU_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
13 |
define('FIFU_INCLUDES_DIR', FIFU_PLUGIN_DIR . 'includes');
|
14 |
define('FIFU_ADMIN_DIR', FIFU_PLUGIN_DIR . 'admin');
|
15 |
+
define('FIFU_DELETE_ALL_URLS', false);
|
16 |
|
17 |
require_once (FIFU_INCLUDES_DIR . '/attachment.php');
|
18 |
require_once (FIFU_INCLUDES_DIR . '/convert-url.php');
|
includes/attachment.php
CHANGED
@@ -21,7 +21,7 @@ function fifu_replace_attachment_url($att_url, $att_id) {
|
|
21 |
else {
|
22 |
if (get_post($att_id)) {
|
23 |
$url = get_post($att_id)->guid;
|
24 |
-
if ($url && strpos($url, 'http') === 0 && !
|
25 |
return $url;
|
26 |
}
|
27 |
}
|
@@ -160,9 +160,19 @@ function fifu_amp_url($url, $width, $height) {
|
|
160 |
return array(0 => $url, 1 => $width, 2 => $height);
|
161 |
}
|
162 |
|
|
|
|
|
|
|
|
|
163 |
// plugin: multisite-post-duplicator
|
164 |
|
165 |
function fifu_is_mpd_active() {
|
166 |
return is_plugin_active('multisite-post-duplicator/mpd.php');
|
167 |
}
|
168 |
|
|
|
|
|
|
|
|
|
|
|
|
21 |
else {
|
22 |
if (get_post($att_id)) {
|
23 |
$url = get_post($att_id)->guid;
|
24 |
+
if ($url && strpos($url, 'http') === 0 && !fifu_reject_guid())
|
25 |
return $url;
|
26 |
}
|
27 |
}
|
160 |
return array(0 => $url, 1 => $width, 2 => $height);
|
161 |
}
|
162 |
|
163 |
+
function fifu_reject_guid() {
|
164 |
+
return fifu_is_mpd_active() || fifu_is_classified_listing_active();
|
165 |
+
}
|
166 |
+
|
167 |
// plugin: multisite-post-duplicator
|
168 |
|
169 |
function fifu_is_mpd_active() {
|
170 |
return is_plugin_active('multisite-post-duplicator/mpd.php');
|
171 |
}
|
172 |
|
173 |
+
// plugin: classified-listing
|
174 |
+
|
175 |
+
function fifu_is_classified_listing_active() {
|
176 |
+
return is_plugin_active('classified-listing/classified-listing.php') || is_plugin_active('classified-listing-pro/classified-listing-pro.php');
|
177 |
+
}
|
178 |
+
|
includes/thumbnail.php
CHANGED
@@ -45,7 +45,7 @@ function fifu_add_social_tags() {
|
|
45 |
}
|
46 |
|
47 |
function fifu_add_jquery() {
|
48 |
-
if (fifu_is_on('fifu_jquery'))
|
49 |
wp_enqueue_script('fifu-jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js');
|
50 |
}
|
51 |
|
45 |
}
|
46 |
|
47 |
function fifu_add_jquery() {
|
48 |
+
if (fifu_is_on('fifu_jquery') && !fifu_is_elementor_editor())
|
49 |
wp_enqueue_script('fifu-jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js');
|
50 |
}
|
51 |
|
includes/util.php
CHANGED
@@ -79,3 +79,15 @@ function fifu_get_dimension_backend($url) {
|
|
79 |
return ($width && $height) ? $width . ";" . $height : null;
|
80 |
}
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
return ($width && $height) ? $width . ";" . $height : null;
|
80 |
}
|
81 |
|
82 |
+
// active plugins
|
83 |
+
|
84 |
+
function fifu_is_elementor_active() {
|
85 |
+
return is_plugin_active('elementor/elementor.php') || is_plugin_active('elementor-pro/elementor-pro.php');
|
86 |
+
}
|
87 |
+
|
88 |
+
function fifu_is_elementor_editor() {
|
89 |
+
if (!fifu_is_elementor_active())
|
90 |
+
return false;
|
91 |
+
return \Elementor\Plugin::$instance->editor->is_edit_mode() || \Elementor\Plugin::$instance->preview->is_preview_mode();
|
92 |
+
}
|
93 |
+
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://donorbox.org/fifu
|
|
4 |
Tags: featured image, external featured image, featured image from url, url featured image, featured, image, external, url, 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, instagram, 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
|
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 |
|
@@ -162,6 +162,9 @@ Features:
|
|
162 |
|
163 |
== Changelog ==
|
164 |
|
|
|
|
|
|
|
165 |
= 3.0.0 =
|
166 |
* Improvement (Premium): supports videos from Publitio now; New: donation campaign removed ($ 142.90 raised); New: Premium version has now 5 different annual plans.
|
167 |
|
@@ -732,6 +735,9 @@ was removed. To finish, a Premium version is now been presented.
|
|
732 |
|
733 |
== Upgrade Notice ==
|
734 |
|
|
|
|
|
|
|
735 |
= 3.0.0 =
|
736 |
* Improvement (Premium): supports videos from Publitio now; New: donation campaign removed ($ 142.90 raised); New: Premium version has now 5 different annual plans.
|
737 |
|
4 |
Tags: featured image, external featured image, featured image from url, url featured image, featured, image, external, url, 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, instagram, 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
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 5.4
|
7 |
+
Stable tag: 3.0.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
162 |
|
163 |
== Changelog ==
|
164 |
|
165 |
+
= 3.0.1 =
|
166 |
+
* New feature: Delete All URLs; Improvement: FIFU column differentiates internal and external images now; Bug fix: conflict with Classified Listing plugin; Bug fix: conflict between Admin->jQuery and Elementor editor.
|
167 |
+
|
168 |
= 3.0.0 =
|
169 |
* Improvement (Premium): supports videos from Publitio now; New: donation campaign removed ($ 142.90 raised); New: Premium version has now 5 different annual plans.
|
170 |
|
735 |
|
736 |
== Upgrade Notice ==
|
737 |
|
738 |
+
= 3.0.1 =
|
739 |
+
* New feature: Delete All URLs; Improvement: FIFU column differentiates internal and external images now; Bug fix: conflict with Classified Listing plugin; Bug fix: conflict between Admin->jQuery and Elementor editor.
|
740 |
+
|
741 |
= 3.0.0 =
|
742 |
* Improvement (Premium): supports videos from Publitio now; New: donation campaign removed ($ 142.90 raised); New: Premium version has now 5 different annual plans.
|
743 |
|