Version Description
- New feature: settings > featured image > original size.
Download this release
Release Info
Developer | marceljm |
Plugin | Featured Image From URL |
Version | 2.2.5 |
Comparing to | |
See all releases |
Code changes from version 2.2.4 to 2.2.5
- admin/html/css/menu.css +74 -0
- admin/html/menu.html +42 -5
- admin/menu.php +19 -9
- featured-image-from-url.php +1 -1
- includes/attachment.php +8 -0
- includes/thumbnail.php +2 -6
- readme.txt +6 -0
admin/html/css/menu.css
CHANGED
@@ -1,6 +1,12 @@
|
|
1 |
.wrap {
|
2 |
max-width: 1000px;
|
3 |
margin: 20px 20px 20px 15px;
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
}
|
5 |
|
6 |
.header-box {
|
@@ -66,3 +72,71 @@ th {
|
|
66 |
border: 1px dashed red;
|
67 |
border-radius: 1px;
|
68 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
.wrap {
|
2 |
max-width: 1000px;
|
3 |
margin: 20px 20px 20px 15px;
|
4 |
+
|
5 |
+
display: block;
|
6 |
+
-webkit-animation: fadeInFromNone 0.25s step-end;
|
7 |
+
-moz-animation: fadeInFromNone 0.25s step-end;
|
8 |
+
-o-animation: fadeInFromNone 0.25s step-end;
|
9 |
+
animation: fadeInFromNone 0.25s step-end;
|
10 |
}
|
11 |
|
12 |
.header-box {
|
72 |
border: 1px dashed red;
|
73 |
border-radius: 1px;
|
74 |
}
|
75 |
+
|
76 |
+
@-webkit-keyframes fadeInFromNone {
|
77 |
+
0% {
|
78 |
+
display: none;
|
79 |
+
opacity: 0;
|
80 |
+
}
|
81 |
+
|
82 |
+
1% {
|
83 |
+
display: block;
|
84 |
+
opacity: 0;
|
85 |
+
}
|
86 |
+
|
87 |
+
100% {
|
88 |
+
display: block;
|
89 |
+
opacity: 1;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
@-moz-keyframes fadeInFromNone {
|
94 |
+
0% {
|
95 |
+
display: none;
|
96 |
+
opacity: 0;
|
97 |
+
}
|
98 |
+
|
99 |
+
1% {
|
100 |
+
display: block;
|
101 |
+
opacity: 0;
|
102 |
+
}
|
103 |
+
|
104 |
+
100% {
|
105 |
+
display: block;
|
106 |
+
opacity: 1;
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
@-o-keyframes fadeInFromNone {
|
111 |
+
0% {
|
112 |
+
display: none;
|
113 |
+
opacity: 0;
|
114 |
+
}
|
115 |
+
|
116 |
+
1% {
|
117 |
+
display: block;
|
118 |
+
opacity: 0;
|
119 |
+
}
|
120 |
+
|
121 |
+
100% {
|
122 |
+
display: block;
|
123 |
+
opacity: 1;
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
@keyframes fadeInFromNone {
|
128 |
+
0% {
|
129 |
+
display: none;
|
130 |
+
opacity: 0;
|
131 |
+
}
|
132 |
+
|
133 |
+
1% {
|
134 |
+
display: block;
|
135 |
+
opacity: 0;
|
136 |
+
}
|
137 |
+
|
138 |
+
100% {
|
139 |
+
display: block;
|
140 |
+
opacity: 1;
|
141 |
+
}
|
142 |
+
}
|
admin/html/menu.html
CHANGED
@@ -75,13 +75,13 @@
|
|
75 |
<h2>About <a href="https://featuredimagefromurl.com/">Featured Image from URL Premium</a></h2>
|
76 |
<div class="greybox">
|
77 |
<h3>1) "How to get support?"</h3>
|
78 |
-
You can inform any problem related to the Premium version
|
79 |
<h3>2) "Which plugins are compatible with Premium version?"</h3>
|
80 |
-
WooCommerce, WP All Import, Monarch, Frontend Publishing and others. If you intend to use the Premium version with a specific plugin, try to test with
|
81 |
-
<h3>3) "Are there
|
82 |
-
Some WooCommerce themes aren’t flexible enough to work with Videos, Sliders and Shortcodes. To know if your theme is compatible with those features, please take a look
|
83 |
<h3>4) "Can I get my money back later?"</h3>
|
84 |
-
With the exception of rare situations, no. But don't worry about that. You will still have the best support and if, after your complete cooperation, I'm not able to solve your issue, I
|
85 |
<h3>5) "How to get the Premium version?"</h3>
|
86 |
<div style="display:inline-block;">
|
87 |
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
|
@@ -373,6 +373,42 @@
|
|
373 |
</div>
|
374 |
</div>
|
375 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
<div class="box">
|
377 |
<h2>Default External Featured Image</h2>
|
378 |
<div class="greybox">
|
@@ -1988,6 +2024,7 @@ fifu_grid_category:<?php echo $enable_grid_category ?>;
|
|
1988 |
fifu_hide_page:<?php echo $enable_hide_page ?>;
|
1989 |
fifu_hide_post:<?php echo $enable_hide_post ?>;
|
1990 |
fifu_lazy:<?php echo $enable_lazy ?>;
|
|
|
1991 |
fifu_ovw_first:<?php echo $enable_ovw_first ?>;
|
1992 |
fifu_pop_first:<?php echo $enable_pop_first ?>;
|
1993 |
fifu_priority:<?php echo $enable_priority ?>;
|
75 |
<h2>About <a href="https://featuredimagefromurl.com/">Featured Image from URL Premium</a></h2>
|
76 |
<div class="greybox">
|
77 |
<h3>1) "How to get support?"</h3>
|
78 |
+
You can inform any problem related to the Premium version by email (support@featuredimagefromurl.com). It will be solved as soon as possible and without any cost.<br><br>
|
79 |
<h3>2) "Which plugins are compatible with Premium version?"</h3>
|
80 |
+
WooCommerce, WP All Import, Monarch, Frontend Publishing and others. If you intend to use the Premium version with a specific plugin, try to test with this free version first. Or you can ask me if they are compatible.<br><br>
|
81 |
+
<h3>3) "Are there known incompatibility issues?"</h3>
|
82 |
+
Some WooCommerce themes aren’t flexible enough to work with Videos, Sliders and Shortcodes. To know if your theme is compatible with those features, please take a look above.<br><br>
|
83 |
<h3>4) "Can I get my money back later?"</h3>
|
84 |
+
With the exception of rare situations, no. But don't worry about that. You will still have the best support and if, after your complete cooperation, I'm not able to solve your issue, I can refund you.<br><br>
|
85 |
<h3>5) "How to get the Premium version?"</h3>
|
86 |
<div style="display:inline-block;">
|
87 |
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
|
373 |
</div>
|
374 |
</div>
|
375 |
|
376 |
+
<div class="box">
|
377 |
+
<h2>Original Size</h2>
|
378 |
+
<div class="greybox">
|
379 |
+
Useful if you have small external images, here you can define if the image will be shown in the original size or if it will be resized to the dimensions of the available area.
|
380 |
+
</div>
|
381 |
+
<br>
|
382 |
+
<table style="text-align:left">
|
383 |
+
<tr>
|
384 |
+
<th>
|
385 |
+
<form
|
386 |
+
id="fifu_form_original"
|
387 |
+
action="javascript:void(0)"
|
388 |
+
method="post">
|
389 |
+
<input
|
390 |
+
type="image"
|
391 |
+
href="javascript:void(0)"
|
392 |
+
id="fifu_toggle_original"
|
393 |
+
onclick="invert('original')"
|
394 |
+
name="fifu_toggle_original"
|
395 |
+
class="<?php echo $enable_original; ?>"
|
396 |
+
value=""
|
397 |
+
style="display:block">
|
398 |
+
<input
|
399 |
+
type="hidden"
|
400 |
+
id="fifu_input_original"
|
401 |
+
name="fifu_input_original"
|
402 |
+
value="" >
|
403 |
+
</form>
|
404 |
+
</th>
|
405 |
+
<th>
|
406 |
+
original size
|
407 |
+
</th>
|
408 |
+
</tr>
|
409 |
+
</table>
|
410 |
+
</div>
|
411 |
+
|
412 |
<div class="box">
|
413 |
<h2>Default External Featured Image</h2>
|
414 |
<div class="greybox">
|
2024 |
fifu_hide_page:<?php echo $enable_hide_page ?>;
|
2025 |
fifu_hide_post:<?php echo $enable_hide_post ?>;
|
2026 |
fifu_lazy:<?php echo $enable_lazy ?>;
|
2027 |
+
fifu_original:<?php echo $enable_original ?>;
|
2028 |
fifu_ovw_first:<?php echo $enable_ovw_first ?>;
|
2029 |
fifu_pop_first:<?php echo $enable_pop_first ?>;
|
2030 |
fifu_priority:<?php echo $enable_priority ?>;
|
admin/menu.php
CHANGED
@@ -15,6 +15,7 @@ function fifu_get_menu_html() {
|
|
15 |
$image_button = plugins_url() . '/featured-image-from-url/admin/images/onoff.jpg';
|
16 |
|
17 |
$enable_social = get_option('fifu_social');
|
|
|
18 |
$enable_lazy = get_option('fifu_lazy');
|
19 |
$enable_content = get_option('fifu_content');
|
20 |
$enable_content_page = get_option('fifu_content_page');
|
@@ -55,7 +56,7 @@ function fifu_get_menu_html() {
|
|
55 |
} else if (fifu_is_off('fifu_fake2')) {
|
56 |
fifu_disable_fake2();
|
57 |
} else
|
58 |
-
update_option('fifu_fake_created', null);
|
59 |
|
60 |
if ($default_url && fifu_is_on('fifu_enable_default_url') && fifu_is_on('fifu_fake2')) {
|
61 |
if (!wp_get_attachment_url(get_option('fifu_default_attach_id'))) {
|
@@ -71,12 +72,13 @@ function fifu_get_menu_html() {
|
|
71 |
|
72 |
if (fifu_is_on('fifu_data_clean')) {
|
73 |
fifu_enable_clean();
|
74 |
-
update_option('fifu_data_clean', 'toggleoff');
|
75 |
}
|
76 |
}
|
77 |
|
78 |
function fifu_get_menu_settings() {
|
79 |
fifu_get_setting('fifu_social');
|
|
|
80 |
fifu_get_setting('fifu_lazy');
|
81 |
fifu_get_setting('fifu_content');
|
82 |
fifu_get_setting('fifu_content_page');
|
@@ -104,13 +106,20 @@ function fifu_get_menu_settings() {
|
|
104 |
function fifu_get_setting($type) {
|
105 |
register_setting('settings-group', $type);
|
106 |
|
|
|
|
|
|
|
|
|
|
|
107 |
if (!get_option($type)) {
|
108 |
-
if (
|
109 |
update_option($type, '');
|
110 |
-
else if (
|
111 |
-
update_option($type, "64");
|
112 |
-
else if (
|
113 |
update_option($type, 'toggleon');
|
|
|
|
|
114 |
else
|
115 |
update_option($type, 'toggleoff');
|
116 |
}
|
@@ -118,6 +127,7 @@ function fifu_get_setting($type) {
|
|
118 |
|
119 |
function fifu_update_menu_options() {
|
120 |
fifu_update_option('fifu_input_social', 'fifu_social');
|
|
|
121 |
fifu_update_option('fifu_input_lazy', 'fifu_lazy');
|
122 |
fifu_update_option('fifu_input_content', 'fifu_content');
|
123 |
fifu_update_option('fifu_input_content_page', 'fifu_content_page');
|
@@ -156,7 +166,7 @@ function fifu_update_option($input, $type) {
|
|
156 |
function fifu_enable_fake2() {
|
157 |
if (get_option('fifu_fake_created') && get_option('fifu_fake_created') != null)
|
158 |
return;
|
159 |
-
update_option('fifu_fake_created', true);
|
160 |
|
161 |
fifu_db_insert_attachment();
|
162 |
fifu_db_insert_attachment_category();
|
@@ -165,7 +175,7 @@ function fifu_enable_fake2() {
|
|
165 |
function fifu_disable_fake2() {
|
166 |
if (!get_option('fifu_fake_created') && get_option('fifu_fake_created') != null)
|
167 |
return;
|
168 |
-
update_option('fifu_fake_created', false);
|
169 |
|
170 |
fifu_db_delete_attachment();
|
171 |
fifu_db_delete_attachment_category();
|
@@ -305,7 +315,7 @@ function fifu_enable_clean() {
|
|
305 |
fifu_disable_fake2();
|
306 |
update_option('fifu_fake', 'toggleoff');
|
307 |
update_option('fifu_fake2', 'toggleoff');
|
308 |
-
update_option('fifu_fake_created', false);
|
309 |
}
|
310 |
|
311 |
function fifu_set_default_url($attach_id) {
|
15 |
$image_button = plugins_url() . '/featured-image-from-url/admin/images/onoff.jpg';
|
16 |
|
17 |
$enable_social = get_option('fifu_social');
|
18 |
+
$enable_original = get_option('fifu_original');
|
19 |
$enable_lazy = get_option('fifu_lazy');
|
20 |
$enable_content = get_option('fifu_content');
|
21 |
$enable_content_page = get_option('fifu_content_page');
|
56 |
} else if (fifu_is_off('fifu_fake2')) {
|
57 |
fifu_disable_fake2();
|
58 |
} else
|
59 |
+
update_option('fifu_fake_created', null, 'no');
|
60 |
|
61 |
if ($default_url && fifu_is_on('fifu_enable_default_url') && fifu_is_on('fifu_fake2')) {
|
62 |
if (!wp_get_attachment_url(get_option('fifu_default_attach_id'))) {
|
72 |
|
73 |
if (fifu_is_on('fifu_data_clean')) {
|
74 |
fifu_enable_clean();
|
75 |
+
update_option('fifu_data_clean', 'toggleoff', 'no');
|
76 |
}
|
77 |
}
|
78 |
|
79 |
function fifu_get_menu_settings() {
|
80 |
fifu_get_setting('fifu_social');
|
81 |
+
fifu_get_setting('fifu_original');
|
82 |
fifu_get_setting('fifu_lazy');
|
83 |
fifu_get_setting('fifu_content');
|
84 |
fifu_get_setting('fifu_content_page');
|
106 |
function fifu_get_setting($type) {
|
107 |
register_setting('settings-group', $type);
|
108 |
|
109 |
+
$arrEmpty = array('fifu_default_url', 'fifu_default_width', 'fifu_css');
|
110 |
+
$arr64 = array('fifu_column_height');
|
111 |
+
$arrOn = array('fifu_fake2', 'fifu_auto_alt', 'fifu_wc_zoom', 'fifu_wc_lbox');
|
112 |
+
$arrOffNo = array('fifu_data_clean');
|
113 |
+
|
114 |
if (!get_option($type)) {
|
115 |
+
if (in_array($type, $arrEmpty))
|
116 |
update_option($type, '');
|
117 |
+
else if (in_array($type, $arr64))
|
118 |
+
update_option($type, "64", 'no');
|
119 |
+
else if (in_array($type, $arrOn))
|
120 |
update_option($type, 'toggleon');
|
121 |
+
else if (in_array($type, $arrOffNo))
|
122 |
+
update_option($type, 'toggleoff', 'no');
|
123 |
else
|
124 |
update_option($type, 'toggleoff');
|
125 |
}
|
127 |
|
128 |
function fifu_update_menu_options() {
|
129 |
fifu_update_option('fifu_input_social', 'fifu_social');
|
130 |
+
fifu_update_option('fifu_input_original', 'fifu_original');
|
131 |
fifu_update_option('fifu_input_lazy', 'fifu_lazy');
|
132 |
fifu_update_option('fifu_input_content', 'fifu_content');
|
133 |
fifu_update_option('fifu_input_content_page', 'fifu_content_page');
|
166 |
function fifu_enable_fake2() {
|
167 |
if (get_option('fifu_fake_created') && get_option('fifu_fake_created') != null)
|
168 |
return;
|
169 |
+
update_option('fifu_fake_created', true, 'no');
|
170 |
|
171 |
fifu_db_insert_attachment();
|
172 |
fifu_db_insert_attachment_category();
|
175 |
function fifu_disable_fake2() {
|
176 |
if (!get_option('fifu_fake_created') && get_option('fifu_fake_created') != null)
|
177 |
return;
|
178 |
+
update_option('fifu_fake_created', false, 'no');
|
179 |
|
180 |
fifu_db_delete_attachment();
|
181 |
fifu_db_delete_attachment_category();
|
315 |
fifu_disable_fake2();
|
316 |
update_option('fifu_fake', 'toggleoff');
|
317 |
update_option('fifu_fake2', 'toggleoff');
|
318 |
+
update_option('fifu_fake_created', false, 'no');
|
319 |
}
|
320 |
|
321 |
function fifu_set_default_url($attach_id) {
|
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: 2.2.
|
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: 2.2.5
|
8 |
* Author: Marcel Jacques Machado
|
9 |
* Author URI: https://www.linkedin.com/in/marceljm/
|
10 |
*/
|
includes/attachment.php
CHANGED
@@ -57,6 +57,14 @@ function fifu_replace_attachment_image_src($image, $att_id, $size) {
|
|
57 |
if (fifu_should_hide())
|
58 |
return null;
|
59 |
$image_size = fifu_get_image_size($size);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
return array(
|
61 |
strpos($image[0], "/wp-content/uploads/") !== false ? get_post($att_id)->guid : $image[0],
|
62 |
isset($image_size['width']) ? $image_size['width'] : (get_option('fifu_default_width') ? get_option('fifu_default_width') : 800),
|
57 |
if (fifu_should_hide())
|
58 |
return null;
|
59 |
$image_size = fifu_get_image_size($size);
|
60 |
+
if (fifu_is_on('fifu_original')) {
|
61 |
+
return array(
|
62 |
+
strpos($image[0], "/wp-content/uploads/") !== false ? get_post($att_id)->guid : $image[0],
|
63 |
+
null,
|
64 |
+
null,
|
65 |
+
null,
|
66 |
+
);
|
67 |
+
}
|
68 |
return array(
|
69 |
strpos($image[0], "/wp-content/uploads/") !== false ? get_post($att_id)->guid : $image[0],
|
70 |
isset($image_size['width']) ? $image_size['width'] : (get_option('fifu_default_width') ? get_option('fifu_default_width') : 800),
|
includes/thumbnail.php
CHANGED
@@ -144,10 +144,6 @@ function fifu_is_main_page() {
|
|
144 |
return is_home() || (class_exists('WooCommerce') && is_shop());
|
145 |
}
|
146 |
|
147 |
-
function fifu_is_fake_disabled() {
|
148 |
-
return fifu_is_off('fifu_fake');
|
149 |
-
}
|
150 |
-
|
151 |
function fifu_has_internal_image($post_id) {
|
152 |
$att_id = get_post_meta($post_id, '_thumbnail_id', true);
|
153 |
return $att_id && $att_id != -1 && $att_id != get_option('fifu_fake_attach_id') && (get_post($att_id) && get_post($att_id)->post_author != 77777);
|
@@ -190,8 +186,8 @@ function fifu_get_image_size($size) {
|
|
190 |
$sizes = fifu_get_image_sizes();
|
191 |
if (is_array($size)) {
|
192 |
$arr_size = array();
|
193 |
-
$arr_size['width'] = $size[0];
|
194 |
-
$arr_size['height'] = $size[1];
|
195 |
return $arr_size;
|
196 |
}
|
197 |
return isset($sizes[$size]) ? $sizes[$size] : false;
|
144 |
return is_home() || (class_exists('WooCommerce') && is_shop());
|
145 |
}
|
146 |
|
|
|
|
|
|
|
|
|
147 |
function fifu_has_internal_image($post_id) {
|
148 |
$att_id = get_post_meta($post_id, '_thumbnail_id', true);
|
149 |
return $att_id && $att_id != -1 && $att_id != get_option('fifu_fake_attach_id') && (get_post($att_id) && get_post($att_id)->post_author != 77777);
|
186 |
$sizes = fifu_get_image_sizes();
|
187 |
if (is_array($size)) {
|
188 |
$arr_size = array();
|
189 |
+
$arr_size['width'] = count($size) > 0 ? $size[0] : null;
|
190 |
+
$arr_size['height'] = count($size) > 1 ? $size[1] : null;
|
191 |
return $arr_size;
|
192 |
}
|
193 |
return isset($sizes[$size]) ? $sizes[$size] : false;
|
readme.txt
CHANGED
@@ -157,6 +157,9 @@ Features:
|
|
157 |
|
158 |
== Changelog ==
|
159 |
|
|
|
|
|
|
|
160 |
= 2.2.4 =
|
161 |
* Bug fix: conflict with internal image sizes.
|
162 |
|
@@ -499,6 +502,9 @@ was removed. To finish, a Premium version is now been presented.
|
|
499 |
|
500 |
== Upgrade Notice ==
|
501 |
|
|
|
|
|
|
|
502 |
= 2.2.4 =
|
503 |
* Bug fix: conflict with internal image sizes.
|
504 |
|
157 |
|
158 |
== Changelog ==
|
159 |
|
160 |
+
= 2.2.5 =
|
161 |
+
* New feature: settings > featured image > original size.
|
162 |
+
|
163 |
= 2.2.4 =
|
164 |
* Bug fix: conflict with internal image sizes.
|
165 |
|
502 |
|
503 |
== Upgrade Notice ==
|
504 |
|
505 |
+
= 2.2.5 =
|
506 |
+
* New feature: settings > featured image > original size.
|
507 |
+
|
508 |
= 2.2.4 =
|
509 |
* Bug fix: conflict with internal image sizes.
|
510 |
|