Version Description
- Improvement: clean meta data feature.
Download this release
Release Info
Developer | marceljm |
Plugin | Featured Image From URL |
Version | 1.9.13 |
Comparing to | |
See all releases |
Code changes from version 1.9.12 to 1.9.13
- admin/html/js/menu.js +1 -0
- admin/html/menu.html +67 -1
- admin/menu.php +47 -1
- featured-image-from-url.php +1 -1
- includes/thumbnail.php +3 -0
- readme.txt +6 -0
admin/html/js/menu.js
CHANGED
@@ -21,6 +21,7 @@ jQuery(function () {
|
|
21 |
|
22 |
jQuery("#accordion").accordion();
|
23 |
jQuery("#accordionCrop").accordion();
|
|
|
24 |
jQuery("#tabs").tabs();
|
25 |
jQuery("#fifu_input_spinner_image").spinner({min: 0});
|
26 |
jQuery("#fifu_input_spinner_video").spinner({min: 0});
|
21 |
|
22 |
jQuery("#accordion").accordion();
|
23 |
jQuery("#accordionCrop").accordion();
|
24 |
+
jQuery("#accordionClean").accordion();
|
25 |
jQuery("#tabs").tabs();
|
26 |
jQuery("#fifu_input_spinner_image").spinner({min: 0});
|
27 |
jQuery("#fifu_input_spinner_video").spinner({min: 0});
|
admin/html/menu.html
CHANGED
@@ -1577,7 +1577,71 @@
|
|
1577 |
</form>
|
1578 |
</div>
|
1579 |
<div style="display:inline-block;top:-20px;position:relative">
|
1580 |
-
(US$ 50 or more, please) and receive the download link and your license key by email within 12 hours
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1581 |
</div>
|
1582 |
</div>
|
1583 |
</div>
|
@@ -1606,6 +1670,8 @@ fifu_cpt7:<?php echo $array_cpt[7] ?>;
|
|
1606 |
fifu_cpt8:<?php echo $array_cpt[8] ?>;
|
1607 |
fifu_cpt9:<?php echo $array_cpt[9] ?>;
|
1608 |
fifu_css:<?php echo $css_style ?>;
|
|
|
|
|
1609 |
fifu_default_url:<?php echo $default_url ?>;
|
1610 |
fifu_fake:<?php echo $enable_fake ?>;
|
1611 |
fifu_get_first:<?php echo $enable_get_first ?>;
|
1577 |
</form>
|
1578 |
</div>
|
1579 |
<div style="display:inline-block;top:-20px;position:relative">
|
1580 |
+
(<b>US$ 50</b> or more, please) and receive the download link and your license key by email within 12 hours.<br> After that, you'll need to inform your domain to activate your license key and receive <b>lifetime automatic updates</b>.
|
1581 |
+
</div>
|
1582 |
+
</div>
|
1583 |
+
</div>
|
1584 |
+
|
1585 |
+
<div class="box">
|
1586 |
+
|
1587 |
+
<h2>Clean meta data</h2>
|
1588 |
+
|
1589 |
+
<div class="greybox">
|
1590 |
+
|
1591 |
+
This option might be necessary if you intend to deactivate the plugin and use only internal featured images again. It will clean the fake internal featured images generated by FIFU, but not the URLs.
|
1592 |
+
|
1593 |
+
</div>
|
1594 |
+
|
1595 |
+
<br>
|
1596 |
+
|
1597 |
+
<div id="accordionClean">
|
1598 |
+
|
1599 |
+
<h3> meta data generation</h3>
|
1600 |
+
<div>
|
1601 |
+
<form
|
1602 |
+
id="fifu_form_data_generation"
|
1603 |
+
action="javascript:void(0)"
|
1604 |
+
method="post">
|
1605 |
+
<input
|
1606 |
+
type="image"
|
1607 |
+
href="javascript:void(0)"
|
1608 |
+
id="fifu_toggle_data_generation"
|
1609 |
+
onclick="invert('data_generation')"
|
1610 |
+
name="fifu_toggle_data_generation"
|
1611 |
+
class="<?php echo $enable_data_generation; ?>"
|
1612 |
+
value=""
|
1613 |
+
style="display:block">
|
1614 |
+
|
1615 |
+
<input
|
1616 |
+
type="hidden"
|
1617 |
+
id="fifu_input_data_generation"
|
1618 |
+
name="fifu_input_data_generation"
|
1619 |
+
value="" >
|
1620 |
+
</form>
|
1621 |
+
</div>
|
1622 |
+
|
1623 |
+
<h3> clean meta data</h3>
|
1624 |
+
<div>
|
1625 |
+
<form
|
1626 |
+
id="fifu_form_data_clean"
|
1627 |
+
action="javascript:void(0)"
|
1628 |
+
method="post">
|
1629 |
+
<input
|
1630 |
+
type="image"
|
1631 |
+
href="javascript:void(0)"
|
1632 |
+
id="fifu_toggle_data_clean"
|
1633 |
+
onclick="invert('data_clean')"
|
1634 |
+
name="fifu_toggle_data_clean"
|
1635 |
+
class="<?php echo $enable_data_clean; ?>"
|
1636 |
+
value=""
|
1637 |
+
style="display:block">
|
1638 |
+
|
1639 |
+
<input
|
1640 |
+
type="hidden"
|
1641 |
+
id="fifu_input_data_clean"
|
1642 |
+
name="fifu_input_data_clean"
|
1643 |
+
value="" >
|
1644 |
+
</form>
|
1645 |
</div>
|
1646 |
</div>
|
1647 |
</div>
|
1670 |
fifu_cpt8:<?php echo $array_cpt[8] ?>;
|
1671 |
fifu_cpt9:<?php echo $array_cpt[9] ?>;
|
1672 |
fifu_css:<?php echo $css_style ?>;
|
1673 |
+
fifu_data_clean:<?php echo $enable_data_clean ?>;
|
1674 |
+
fifu_data_generation:<?php echo $enable_data_generation ?>;
|
1675 |
fifu_default_url:<?php echo $default_url ?>;
|
1676 |
fifu_fake:<?php echo $enable_fake ?>;
|
1677 |
fifu_get_first:<?php echo $enable_get_first ?>;
|
admin/menu.php
CHANGED
@@ -30,6 +30,8 @@ function fifu_get_menu_html() {
|
|
30 |
$column_height = get_option('fifu_column_height');
|
31 |
$enable_priority = get_option('fifu_priority');
|
32 |
$enable_auto_alt = get_option('fifu_auto_alt');
|
|
|
|
|
33 |
|
34 |
$array_cpt = array();
|
35 |
for ($x = 0; $x < 10; $x++)
|
@@ -43,6 +45,11 @@ function fifu_get_menu_html() {
|
|
43 |
fifu_enable_fake();
|
44 |
else
|
45 |
fifu_disable_fake();
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
|
48 |
function fifu_get_menu_settings() {
|
@@ -63,6 +70,8 @@ function fifu_get_menu_settings() {
|
|
63 |
fifu_get_setting('fifu_column_height');
|
64 |
fifu_get_setting('fifu_priority');
|
65 |
fifu_get_setting('fifu_auto_alt');
|
|
|
|
|
66 |
|
67 |
for ($x = 0; $x < 10; $x++)
|
68 |
fifu_get_setting('fifu_cpt' . $x);
|
@@ -76,7 +85,7 @@ function fifu_get_setting($type) {
|
|
76 |
update_option($type, '');
|
77 |
else if (strpos($type, "fifu_column_height") !== false)
|
78 |
update_option($type, "64");
|
79 |
-
else if (strpos($type, "wc") !== false || strpos($type, "fifu_auto_alt") !== false)
|
80 |
update_option($type, 'toggleon');
|
81 |
else
|
82 |
update_option($type, 'toggleoff');
|
@@ -101,6 +110,8 @@ function fifu_update_menu_options() {
|
|
101 |
fifu_update_option('fifu_input_column_height', 'fifu_column_height');
|
102 |
fifu_update_option('fifu_input_priority', 'fifu_priority');
|
103 |
fifu_update_option('fifu_input_auto_alt', 'fifu_auto_alt');
|
|
|
|
|
104 |
|
105 |
for ($x = 0; $x < 10; $x++)
|
106 |
fifu_update_option('fifu_input_cpt' . $x, 'fifu_cpt' . $x);
|
@@ -197,3 +208,38 @@ function fifu_disable_fake() {
|
|
197 |
delete_option('fifu_fake_attach_id');
|
198 |
}
|
199 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
$column_height = get_option('fifu_column_height');
|
31 |
$enable_priority = get_option('fifu_priority');
|
32 |
$enable_auto_alt = get_option('fifu_auto_alt');
|
33 |
+
$enable_data_generation = get_option('fifu_data_generation');
|
34 |
+
$enable_data_clean = get_option('fifu_data_clean');
|
35 |
|
36 |
$array_cpt = array();
|
37 |
for ($x = 0; $x < 10; $x++)
|
45 |
fifu_enable_fake();
|
46 |
else
|
47 |
fifu_disable_fake();
|
48 |
+
|
49 |
+
if (fifu_is_on('fifu_data_clean')) {
|
50 |
+
fifu_enable_clean();
|
51 |
+
update_option('fifu_data_clean', 'toggleoff');
|
52 |
+
}
|
53 |
}
|
54 |
|
55 |
function fifu_get_menu_settings() {
|
70 |
fifu_get_setting('fifu_column_height');
|
71 |
fifu_get_setting('fifu_priority');
|
72 |
fifu_get_setting('fifu_auto_alt');
|
73 |
+
fifu_get_setting('fifu_data_generation');
|
74 |
+
fifu_get_setting('fifu_data_clean');
|
75 |
|
76 |
for ($x = 0; $x < 10; $x++)
|
77 |
fifu_get_setting('fifu_cpt' . $x);
|
85 |
update_option($type, '');
|
86 |
else if (strpos($type, "fifu_column_height") !== false)
|
87 |
update_option($type, "64");
|
88 |
+
else if (strpos($type, "wc") !== false || strpos($type, "fifu_data_generation") !== false || strpos($type, "fifu_auto_alt") !== false)
|
89 |
update_option($type, 'toggleon');
|
90 |
else
|
91 |
update_option($type, 'toggleoff');
|
110 |
fifu_update_option('fifu_input_column_height', 'fifu_column_height');
|
111 |
fifu_update_option('fifu_input_priority', 'fifu_priority');
|
112 |
fifu_update_option('fifu_input_auto_alt', 'fifu_auto_alt');
|
113 |
+
fifu_update_option('fifu_input_data_generation', 'fifu_data_generation');
|
114 |
+
fifu_update_option('fifu_input_data_clean', 'fifu_data_clean');
|
115 |
|
116 |
for ($x = 0; $x < 10; $x++)
|
117 |
fifu_update_option('fifu_input_cpt' . $x, 'fifu_cpt' . $x);
|
208 |
delete_option('fifu_fake_attach_id');
|
209 |
}
|
210 |
|
211 |
+
function fifu_enable_clean() {
|
212 |
+
global $wpdb;
|
213 |
+
|
214 |
+
$table = $wpdb->prefix . 'postmeta';
|
215 |
+
$table_posts = $wpdb->prefix . 'posts';
|
216 |
+
|
217 |
+
$where = array('meta_key' => '_thumbnail_id', 'meta_value' => -1);
|
218 |
+
$wpdb->delete($table, $where);
|
219 |
+
|
220 |
+
$where = array('meta_key' => '_thumbnail_id', 'meta_value' => get_option('fifu_fake_attach_id'));
|
221 |
+
$wpdb->delete($table, $where);
|
222 |
+
|
223 |
+
$where = array('meta_key' => '_thumbnail_id', 'meta_value' => get_option('fifu_default_attach_id'));
|
224 |
+
$wpdb->delete($table, $where);
|
225 |
+
|
226 |
+
$where = array('meta_key' => '_product_image_gallery', 'meta_value' => -1);
|
227 |
+
$wpdb->delete($table, $where);
|
228 |
+
|
229 |
+
$where = array('meta_key' => '_product_image_gallery', 'meta_value' => get_option('fifu_fake_attach_id'));
|
230 |
+
$wpdb->delete($table, $where);
|
231 |
+
|
232 |
+
$where = array('meta_key' => '_wp_attached_file', 'meta_value' => 'Featured Image from URL');
|
233 |
+
$wpdb->delete($table, $where);
|
234 |
+
|
235 |
+
$where = array('meta_key' => '_wp_attached_file', 'meta_value' => 'fifu.png');
|
236 |
+
$wpdb->delete($table, $where);
|
237 |
+
|
238 |
+
wp_delete_attachment(get_option('fifu_fake_attach_id'));
|
239 |
+
wp_delete_attachment(get_option('fifu_default_attach_id'));
|
240 |
+
delete_option('fifu_fake_attach_id');
|
241 |
+
fifu_disable_fake();
|
242 |
+
update_option('fifu_fake', 'toggleoff');
|
243 |
+
update_option('fifu_fake_created', false);
|
244 |
+
}
|
245 |
+
|
featured-image-from-url.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Featured Image From URL
|
5 |
* Plugin URI: https://featuredimagefromurl.com/
|
6 |
* Description: Use an external image as Featured Image of your post/page/custom post type (WooCommerce). Includes Auto Set (External Post), Product Gallery, Social Tags and more.
|
7 |
-
* Version: 1.9.
|
8 |
* Author: Marcel Jacques Machado
|
9 |
* Author URI: https://www.linkedin.com/in/marceljm/
|
10 |
*/
|
4 |
* Plugin Name: Featured Image From URL
|
5 |
* Plugin URI: https://featuredimagefromurl.com/
|
6 |
* Description: Use an external image as Featured Image of your post/page/custom post type (WooCommerce). Includes Auto Set (External Post), Product Gallery, Social Tags and more.
|
7 |
+
* Version: 1.9.13
|
8 |
* Author: Marcel Jacques Machado
|
9 |
* Author URI: https://www.linkedin.com/in/marceljm/
|
10 |
*/
|
includes/thumbnail.php
CHANGED
@@ -36,6 +36,9 @@ function fifu_apply_css() {
|
|
36 |
add_action('the_post', 'fifu_choose');
|
37 |
|
38 |
function fifu_choose($post) {
|
|
|
|
|
|
|
39 |
$post_id = $post->ID;
|
40 |
|
41 |
$image_url = fifu_main_image_url($post_id);
|
36 |
add_action('the_post', 'fifu_choose');
|
37 |
|
38 |
function fifu_choose($post) {
|
39 |
+
if (fifu_is_off('fifu_data_generation'))
|
40 |
+
return;
|
41 |
+
|
42 |
$post_id = $post->ID;
|
43 |
|
44 |
$image_url = fifu_main_image_url($post_id);
|
readme.txt
CHANGED
@@ -161,6 +161,9 @@ Features:
|
|
161 |
|
162 |
== Changelog ==
|
163 |
|
|
|
|
|
|
|
164 |
= 1.9.12 =
|
165 |
* Improvement: 10 fields for Custom Post Types.
|
166 |
|
@@ -425,6 +428,9 @@ was removed. To finish, a Premium version is now been presented.
|
|
425 |
|
426 |
== Upgrade Notice ==
|
427 |
|
|
|
|
|
|
|
428 |
= 1.9.12 =
|
429 |
* Improvement: 10 fields for Custom Post Types.
|
430 |
|
161 |
|
162 |
== Changelog ==
|
163 |
|
164 |
+
= 1.9.13 =
|
165 |
+
* Improvement: clean meta data feature.
|
166 |
+
|
167 |
= 1.9.12 =
|
168 |
* Improvement: 10 fields for Custom Post Types.
|
169 |
|
428 |
|
429 |
== Upgrade Notice ==
|
430 |
|
431 |
+
= 1.9.13 =
|
432 |
+
* Improvement: clean meta data feature.
|
433 |
+
|
434 |
= 1.9.12 =
|
435 |
* Improvement: 10 fields for Custom Post Types.
|
436 |
|