Version Description
- Improvement: FIFU column shows the images in the same size now.
Download this release
Release Info
Developer | marceljm |
Plugin | Featured Image From URL |
Version | 2.4.0 |
Comparing to | |
See all releases |
Code changes from version 2.3.9 to 2.4.0
- admin/category.php +3 -7
- admin/column.php +4 -2
- admin/html/css/menu.css +12 -5
- admin/html/js/meta-box.js +2 -5
- admin/html/menu.html +2 -2
- admin/html/meta-box.html +5 -14
- admin/meta-box.php +1 -3
- featured-image-from-url.php +1 -1
- includes/html/js/image.js +0 -1
- includes/html/sirv.html +0 -1
- includes/thumbnail.php +1 -22
- readme.txt +6 -0
admin/category.php
CHANGED
@@ -9,7 +9,6 @@ function fifu_ctgr_edit_box($term) {
|
|
9 |
$height = 'height:200px;';
|
10 |
$align = 'text-align:left;';
|
11 |
$show_news = 'display:none';
|
12 |
-
$is_sirv_active = is_plugin_active('sirv/sirv.php');
|
13 |
$url = $alt = null;
|
14 |
|
15 |
if (is_object($term)) {
|
@@ -18,12 +17,11 @@ function fifu_ctgr_edit_box($term) {
|
|
18 |
}
|
19 |
|
20 |
if ($url) {
|
21 |
-
$show_button =
|
22 |
$show_alt = $show_image = $show_link = '';
|
23 |
} else {
|
24 |
-
$show_button =
|
25 |
$show_alt = $show_image = $show_link = 'display:none;';
|
26 |
-
$show_sirv = ($is_sirv_active ? '' : 'display:none;');
|
27 |
}
|
28 |
|
29 |
include 'html/category.html';
|
@@ -35,11 +33,9 @@ function fifu_ctgr_add_box() {
|
|
35 |
$height = 'height:200px;';
|
36 |
$align = 'text-align:left;';
|
37 |
$show_news = 'display:none';
|
38 |
-
$is_sirv_active = is_plugin_active('sirv/sirv.php');
|
39 |
|
40 |
-
$show_button = $
|
41 |
$show_alt = $show_image = $show_link = 'display:none;';
|
42 |
-
$show_sirv = ($is_sirv_active ? '' : 'display:none;');
|
43 |
|
44 |
include 'html/category.html';
|
45 |
}
|
9 |
$height = 'height:200px;';
|
10 |
$align = 'text-align:left;';
|
11 |
$show_news = 'display:none';
|
|
|
12 |
$url = $alt = null;
|
13 |
|
14 |
if (is_object($term)) {
|
17 |
}
|
18 |
|
19 |
if ($url) {
|
20 |
+
$show_button = 'display:none;';
|
21 |
$show_alt = $show_image = $show_link = '';
|
22 |
} else {
|
23 |
+
$show_button = '';
|
24 |
$show_alt = $show_image = $show_link = 'display:none;';
|
|
|
25 |
}
|
26 |
|
27 |
include 'html/category.html';
|
33 |
$height = 'height:200px;';
|
34 |
$align = 'text-align:left;';
|
35 |
$show_news = 'display:none';
|
|
|
36 |
|
37 |
+
$show_button = $url = $alt = '';
|
38 |
$show_alt = $show_image = $show_link = 'display:none;';
|
|
|
39 |
|
40 |
include 'html/category.html';
|
41 |
}
|
admin/column.php
CHANGED
@@ -18,20 +18,22 @@ function fifu_column_head($default) {
|
|
18 |
}
|
19 |
|
20 |
function fifu_ctgr_column_content($internal_image, $column, $term_id) {
|
|
|
21 |
if ($column == 'featured_image') {
|
22 |
$url = get_term_meta($term_id, 'fifu_image_url', true);
|
23 |
if ($url != '')
|
24 |
-
echo sprintf('<
|
25 |
} else
|
26 |
echo $internal_image;
|
27 |
}
|
28 |
|
29 |
function fifu_column_content($column, $post_id) {
|
|
|
30 |
if ($column == 'featured_image') {
|
31 |
$url = fifu_main_image_url($post_id);
|
32 |
if ($url == '')
|
33 |
$url = wp_get_attachment_url(get_post_thumbnail_id());
|
34 |
-
echo sprintf('<
|
35 |
}
|
36 |
}
|
37 |
|
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 |
+
echo sprintf('<div style="height:%spx; width:%spx; background:url(\'%s\') no-repeat center center; background-size:cover;"/>', $height, $height * 1.5, $url);
|
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 |
+
echo sprintf('<div style="height:%spx; width:%spx; background:url(\'%s\') no-repeat center center; background-size:cover;"/>', $height, $height * 1.5, $url);
|
37 |
}
|
38 |
}
|
39 |
|
admin/html/css/menu.css
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
.wrap {
|
2 |
max-width: 1000px;
|
3 |
-
margin: 20px 20px 20px 15px;
|
4 |
}
|
5 |
|
6 |
.header-box {
|
@@ -9,17 +9,18 @@
|
|
9 |
border: 1px solid #dbdbdb;
|
10 |
padding: 20px;
|
11 |
padding-top: 0px;
|
12 |
-
border-radius: 100px 0px 0px;
|
13 |
height: 25px !important;
|
|
|
14 |
}
|
15 |
|
16 |
.box {
|
17 |
margin: 25px 0 0;
|
18 |
-
background: #
|
19 |
border: 1px solid #dbdbdb;
|
20 |
padding: 20px;
|
21 |
padding-top: 10px;
|
22 |
-
border-radius: 15px
|
23 |
}
|
24 |
|
25 |
.greybox {
|
@@ -27,7 +28,12 @@
|
|
27 |
background: #efefef;
|
28 |
border: 1px solid #dbdbdb;
|
29 |
padding: 20px;
|
30 |
-
border-radius:
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
32 |
|
33 |
.greybox p {
|
@@ -66,6 +72,7 @@ th {
|
|
66 |
#grad2 {
|
67 |
border: 1px dashed red;
|
68 |
border-radius: 1px;
|
|
|
69 |
}
|
70 |
|
71 |
/* table */
|
1 |
.wrap {
|
2 |
max-width: 1000px;
|
3 |
+
margin: 20px 20px 20px 15px;
|
4 |
}
|
5 |
|
6 |
.header-box {
|
9 |
border: 1px solid #dbdbdb;
|
10 |
padding: 20px;
|
11 |
padding-top: 0px;
|
12 |
+
border-radius: 100px 45px 0px 0px;
|
13 |
height: 25px !important;
|
14 |
+
background: repeating-linear-gradient(-55deg,#23282d,#23282d 2px,#32373c 2px,#32373c 5px);
|
15 |
}
|
16 |
|
17 |
.box {
|
18 |
margin: 25px 0 0;
|
19 |
+
background: #ffffff85;
|
20 |
border: 1px solid #dbdbdb;
|
21 |
padding: 20px;
|
22 |
padding-top: 10px;
|
23 |
+
border-radius: 60px 15px 15px 15px;
|
24 |
}
|
25 |
|
26 |
.greybox {
|
28 |
background: #efefef;
|
29 |
border: 1px solid #dbdbdb;
|
30 |
padding: 20px;
|
31 |
+
border-radius: 15px 15px 15px 15px;
|
32 |
+
background: repeating-linear-gradient(-55deg,#efefef,#efefef 2px,#efefefb3 2px,#efefefb3 5px);
|
33 |
+
}
|
34 |
+
|
35 |
+
#tabs-top{
|
36 |
+
border-radius: 0px 0px 15px 15px;
|
37 |
}
|
38 |
|
39 |
.greybox p {
|
72 |
#grad2 {
|
73 |
border: 1px dashed red;
|
74 |
border-radius: 1px;
|
75 |
+
border-radius: 15px 15px 15px 15px;
|
76 |
}
|
77 |
|
78 |
/* table */
|
admin/html/js/meta-box.js
CHANGED
@@ -7,9 +7,6 @@ function removeImage() {
|
|
7 |
jQuery("#fifu_input_url").val("");
|
8 |
|
9 |
jQuery("#fifu_button").show();
|
10 |
-
|
11 |
-
if (jQuery("#sirv-add-featured-image").attr("active"))
|
12 |
-
jQuery("#sirv-add-featured-image").show();
|
13 |
}
|
14 |
|
15 |
function previewImage() {
|
@@ -18,7 +15,7 @@ function previewImage() {
|
|
18 |
|
19 |
if ($url) {
|
20 |
jQuery("#fifu_button").hide();
|
21 |
-
jQuery("#
|
22 |
|
23 |
jQuery("#fifu_image").css('background-image', "url('" + $url + "')");
|
24 |
|
@@ -26,4 +23,4 @@ function previewImage() {
|
|
26 |
jQuery("#fifu_image").show();
|
27 |
jQuery("#fifu_link").show();
|
28 |
}
|
29 |
-
}
|
7 |
jQuery("#fifu_input_url").val("");
|
8 |
|
9 |
jQuery("#fifu_button").show();
|
|
|
|
|
|
|
10 |
}
|
11 |
|
12 |
function previewImage() {
|
15 |
|
16 |
if ($url) {
|
17 |
jQuery("#fifu_button").hide();
|
18 |
+
jQuery("#fifu_news").hide();
|
19 |
|
20 |
jQuery("#fifu_image").css('background-image', "url('" + $url + "')");
|
21 |
|
23 |
jQuery("#fifu_image").show();
|
24 |
jQuery("#fifu_link").show();
|
25 |
}
|
26 |
+
}
|
admin/html/menu.html
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<div class="wrap" style="opacity:0">
|
2 |
|
3 |
<div class="header-box" style="background-color:#23282d">
|
4 |
-
<h1 style="color:white"><img src="wp-content/plugins/featured-image-from-url/admin/images/favicon.png" alt=""> <b>
|
5 |
</div>
|
6 |
|
7 |
<div id="tabs-top">
|
@@ -20,7 +20,7 @@
|
|
20 |
<li><a href="#tabs-c">Video</a></li>
|
21 |
<li><a href="#tabs-o">WooCommerce</a></li>
|
22 |
<li><a href="#tabs-p">WP All Import</a></li>
|
23 |
-
<li><a href="#tabs-a">Premium version <b style="border-radius:2px;padding:3px;background-color
|
24 |
<br>
|
25 |
<br>
|
26 |
<div id="tabs-a">
|
1 |
<div class="wrap" style="opacity:0">
|
2 |
|
3 |
<div class="header-box" style="background-color:#23282d">
|
4 |
+
<h1 style="color:white"><img src="/wp-content/plugins/featured-image-from-url/admin/images/favicon.png" alt=""> <b> featured image from url</b> 2</h1>
|
5 |
</div>
|
6 |
|
7 |
<div id="tabs-top">
|
20 |
<li><a href="#tabs-c">Video</a></li>
|
21 |
<li><a href="#tabs-o">WooCommerce</a></li>
|
22 |
<li><a href="#tabs-p">WP All Import</a></li>
|
23 |
+
<li><a href="#tabs-a">Premium version <b style="border-radius:2px;padding:3px;background-color:#32373c;color:white">30%OFF</b></a></li>
|
24 |
<br>
|
25 |
<br>
|
26 |
<div id="tabs-a">
|
admin/html/meta-box.html
CHANGED
@@ -37,18 +37,9 @@
|
|
37 |
onClick="previewImage();"
|
38 |
style="<?php echo $align, $margin, $show_button ?>" >Preview</a>
|
39 |
|
40 |
-
<
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
title="Add image from Sirv"
|
46 |
-
style="<?php echo $show_sirv ?>">Choose Sirv image</a>
|
47 |
-
|
48 |
-
|
49 |
-
<div style="<?php echo $show_news ?>">
|
50 |
-
<p style="font-size: 12px; padding: 10px; border-left: 3px solid red; color: black;
|
51 |
-
background-color: whitesmoke; border-radius: 100px 5px; position: relative; top: 10px">Please report any problem to <i><b>marcel@featuredimagefromurl.com</b></i><br>It should be fixed in 24 hours.</p>
|
52 |
-
<p style="font-size: 12px; padding: 10px; border-left: 3px solid darkblue; color: black;
|
53 |
-
background-color: whitesmoke; border-radius: 100px 5px; position: relative; top: 10px">Product Gallery, Video and Slider boxes are only available in the <a href="wp-admin/admin.php?page=featured-image-from-url#tabs-a"><i><b>premium</b></i></a> version. Pay with money or bitcoins. <i>*<b>30%OFF</b> in April 2019</i>. </p>
|
54 |
</div>
|
37 |
onClick="previewImage();"
|
38 |
style="<?php echo $align, $margin, $show_button ?>" >Preview</a>
|
39 |
|
40 |
+
<div id="fifu_news" style="top:10px; <?php echo $show_news ?>">
|
41 |
+
<p style="font-size: 12px; padding: 10px; border-bottom: 2px solid red; border-top: 2px solid red; color: black; background: repeating-linear-gradient(-55deg,white,white 2px,whitesmoke 2px,whitesmoke 5px);
|
42 |
+
background-color: whitesmoke; border-radius: 15px 15px 15px 15px; position: relative; top: 10px; box-shadow: 2px 2px 2px #aaaaaa;">Please report any problem to <b>marcel@featuredimagefromurl.com</b><br>It should be fixed in 24 hours.</p>
|
43 |
+
<p style="font-size: 12px; padding: 10px; border-bottom: 2px solid darkblue; border-top: 2px solid darkblue; color: black; background: repeating-linear-gradient(-55deg,white,white 2px,whitesmoke 2px,whitesmoke 5px);
|
44 |
+
background-color: whitesmoke; border-radius: 15px 15px 15px 15px; position: relative; top: 10px; box-shadow: 2px 2px 2px #aaaaaa;">Product Gallery, Video and Slider fields are only available in the <a href="wp-admin/admin.php?page=featured-image-from-url#tabs-a"><b>premium</b></a> version (<b>30%OFF</b> in April 2019).</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
</div>
|
admin/meta-box.php
CHANGED
@@ -26,18 +26,16 @@ function fifu_show_elements($post) {
|
|
26 |
$height = 'height:200px;';
|
27 |
$align = 'text-align:left;';
|
28 |
$show_news = 'display:inline';
|
29 |
-
$is_sirv_active = is_plugin_active('sirv/sirv.php');
|
30 |
|
31 |
$url = get_post_meta($post->ID, 'fifu_image_url', true);
|
32 |
$alt = get_post_meta($post->ID, 'fifu_image_alt', true);
|
33 |
|
34 |
if ($url) {
|
35 |
-
$show_button =
|
36 |
$show_alt = $show_image = $show_link = '';
|
37 |
} else {
|
38 |
$show_alt = $show_image = $show_link = 'display:none;';
|
39 |
$show_button = '';
|
40 |
-
$show_sirv = ($is_sirv_active ? '' : 'display:none;');
|
41 |
}
|
42 |
|
43 |
include 'html/meta-box.html';
|
26 |
$height = 'height:200px;';
|
27 |
$align = 'text-align:left;';
|
28 |
$show_news = 'display:inline';
|
|
|
29 |
|
30 |
$url = get_post_meta($post->ID, 'fifu_image_url', true);
|
31 |
$alt = get_post_meta($post->ID, 'fifu_image_alt', true);
|
32 |
|
33 |
if ($url) {
|
34 |
+
$show_button = 'display:none;';
|
35 |
$show_alt = $show_image = $show_link = '';
|
36 |
} else {
|
37 |
$show_alt = $show_image = $show_link = 'display:none;';
|
38 |
$show_button = '';
|
|
|
39 |
}
|
40 |
|
41 |
include 'html/meta-box.html';
|
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.
|
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.4.0
|
8 |
* Author: Marcel Jacques Machado
|
9 |
* Author URI: https://www.linkedin.com/in/marceljm/
|
10 |
*/
|
includes/html/js/image.js
CHANGED
@@ -6,7 +6,6 @@ jQuery(document).ready(function ($) {
|
|
6 |
visibleOnly: false,
|
7 |
updateEvent: 'load orientationchange resize scroll touchmove focus hover'
|
8 |
});
|
9 |
-
jQuery('img').css('opacity', 1);
|
10 |
}
|
11 |
|
12 |
// woocommerce lightbox/zoom
|
6 |
visibleOnly: false,
|
7 |
updateEvent: 'load orientationchange resize scroll touchmove focus hover'
|
8 |
});
|
|
|
9 |
}
|
10 |
|
11 |
// woocommerce lightbox/zoom
|
includes/html/sirv.html
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
<script src="https://scripts.sirv.com/sirv.js"></script>
|
|
includes/thumbnail.php
CHANGED
@@ -2,7 +2,6 @@
|
|
2 |
|
3 |
add_filter('wp_head', 'fifu_add_js');
|
4 |
add_filter('wp_head', 'fifu_add_social_tags');
|
5 |
-
add_filter('wp_head', 'fifu_add_sirv_js');
|
6 |
add_filter('wp_head', 'fifu_apply_css');
|
7 |
|
8 |
function fifu_add_js() {
|
@@ -25,13 +24,6 @@ function fifu_add_social_tags() {
|
|
25 |
include 'html/social.html';
|
26 |
}
|
27 |
|
28 |
-
function fifu_add_sirv_js() {
|
29 |
-
include_once (ABSPATH . 'wp-admin/includes/plugin.php');
|
30 |
-
if (is_plugin_active('sirv/sirv.php')) {
|
31 |
-
include 'html/sirv.html';
|
32 |
-
}
|
33 |
-
}
|
34 |
-
|
35 |
function fifu_apply_css() {
|
36 |
if (fifu_is_off('fifu_wc_lbox'))
|
37 |
echo '<style>[class$="woocommerce-product-gallery__trigger"] {display:none !important;}</style>';
|
@@ -74,17 +66,8 @@ function fifu_replace($html, $post_id, $post_thumbnail_id, $size) {
|
|
74 |
$width = fifu_get_attribute('width', $html);
|
75 |
$height = fifu_get_attribute('height', $html);
|
76 |
|
77 |
-
if (fifu_is_on('fifu_lazy') && !is_admin())
|
78 |
-
// hide image
|
79 |
-
if (strpos('style=', $html) !== false) {
|
80 |
-
$html = (strpos('style="', $html) !== false) ? str_replace('style="', 'style="opacity:0;', $html) : $html;
|
81 |
-
$html = (strpos("style='", $html) !== false) ? str_replace("style='", "style='opacity:0;", $html) : $html;
|
82 |
-
} else
|
83 |
-
$html = str_replace("<img ", "<img style='opacity:0' ", $html);
|
84 |
-
|
85 |
-
// add data-src
|
86 |
$html = str_replace("src", "data-src", $html);
|
87 |
-
}
|
88 |
|
89 |
$url = get_post_meta($post_id, 'fifu_image_url', true);
|
90 |
$alt = get_post_meta($post_id, 'fifu_image_alt', true);
|
@@ -106,10 +89,6 @@ function is_ajax_call() {
|
|
106 |
}
|
107 |
|
108 |
function fifu_get_html($url, $alt, $width, $height) {
|
109 |
-
include_once (ABSPATH . 'wp-admin/includes/plugin.php');
|
110 |
-
if (is_plugin_active('sirv/sirv.php') && strpos($url, "sirv.com") !== false)
|
111 |
-
return sprintf('<!-- Featured Image from URL plugin --> <img class="Sirv" data-src="%s">', $url);
|
112 |
-
|
113 |
$css = get_option('fifu_css');
|
114 |
|
115 |
if (fifu_should_hide()) {
|
2 |
|
3 |
add_filter('wp_head', 'fifu_add_js');
|
4 |
add_filter('wp_head', 'fifu_add_social_tags');
|
|
|
5 |
add_filter('wp_head', 'fifu_apply_css');
|
6 |
|
7 |
function fifu_add_js() {
|
24 |
include 'html/social.html';
|
25 |
}
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
function fifu_apply_css() {
|
28 |
if (fifu_is_off('fifu_wc_lbox'))
|
29 |
echo '<style>[class$="woocommerce-product-gallery__trigger"] {display:none !important;}</style>';
|
66 |
$width = fifu_get_attribute('width', $html);
|
67 |
$height = fifu_get_attribute('height', $html);
|
68 |
|
69 |
+
if (fifu_is_on('fifu_lazy') && !is_admin())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
$html = str_replace("src", "data-src", $html);
|
|
|
71 |
|
72 |
$url = get_post_meta($post_id, 'fifu_image_url', true);
|
73 |
$alt = get_post_meta($post_id, 'fifu_image_alt', true);
|
89 |
}
|
90 |
|
91 |
function fifu_get_html($url, $alt, $width, $height) {
|
|
|
|
|
|
|
|
|
92 |
$css = get_option('fifu_css');
|
93 |
|
94 |
if (fifu_should_hide()) {
|
readme.txt
CHANGED
@@ -157,6 +157,9 @@ Features:
|
|
157 |
|
158 |
== Changelog ==
|
159 |
|
|
|
|
|
|
|
160 |
= 2.3.9 =
|
161 |
* Offer: premium version + lifetime updates for US$ 35.
|
162 |
|
@@ -544,6 +547,9 @@ was removed. To finish, a Premium version is now been presented.
|
|
544 |
|
545 |
== Upgrade Notice ==
|
546 |
|
|
|
|
|
|
|
547 |
= 2.3.9 =
|
548 |
* Offer: premium version + lifetime updates for US$ 35.
|
549 |
|
157 |
|
158 |
== Changelog ==
|
159 |
|
160 |
+
= 2.4.0 =
|
161 |
+
* Improvement: FIFU column shows the images in the same size now.
|
162 |
+
|
163 |
= 2.3.9 =
|
164 |
* Offer: premium version + lifetime updates for US$ 35.
|
165 |
|
547 |
|
548 |
== Upgrade Notice ==
|
549 |
|
550 |
+
= 2.4.0 =
|
551 |
+
* Improvement: FIFU column shows the images in the same size now.
|
552 |
+
|
553 |
= 2.3.9 =
|
554 |
* Offer: premium version + lifetime updates for US$ 35.
|
555 |
|