Featured Image From URL - Version 1.6.4

Version Description

  • Bug fix.

=

Download this release

Release Info

Developer marceljm
Plugin Icon 128x128 Featured Image From URL
Version 1.6.4
Comparing to
See all releases

Code changes from version 1.6.3 to 1.6.4

featured-image-from-url.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  * Plugin Name: Featured Image From URL
5
  * 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.
6
- * Version: 1.6.3
7
  * Author: Marcel Jacques Machado
8
  * Author URI: http://featuredimagefromurl.com/
9
  */
3
  /*
4
  * Plugin Name: Featured Image From URL
5
  * 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.
6
+ * Version: 1.6.4
7
  * Author: Marcel Jacques Machado
8
  * Author URI: http://featuredimagefromurl.com/
9
  */
includes/thumbnail.php CHANGED
@@ -114,10 +114,6 @@ function fifu_genesis_image($args, $var1, $var2, $src) {
114
 
115
  function fifu_lazy_url($url) {
116
  if (get_option('fifu_lazy') != 'toggleon' || is_ajax_call())
117
- return 'src=' . $url;
118
- return (is_home() || (class_exists('WooCommerce') && is_shop()) ? 'data-src=' : 'src=') . $url;
119
  }
120
-
121
- function fifu_lazy_load() {
122
- return fifu_lazy_url('');
123
- }
114
 
115
  function fifu_lazy_url($url) {
116
  if (get_option('fifu_lazy') != 'toggleon' || is_ajax_call())
117
+ return 'src="' . $url . "'";
118
+ return (is_home() || (class_exists('WooCommerce') && is_shop()) ? 'data-src="' : 'src="') . $url . '"';
119
  }
 
 
 
 
readme.txt CHANGED
@@ -290,6 +290,9 @@ was removed. To finish, a Premium version is now been presented.
290
  = 1.6.3 =
291
  * Lazy load.
292
 
 
 
 
293
  == Upgrade Notice ==
294
 
295
  = 1.0 =
@@ -435,4 +438,7 @@ was removed. To finish, a Premium version is now been presented.
435
  * Bug fix.
436
 
437
  = 1.6.3 =
438
- * Lazy load.
 
 
 
290
  = 1.6.3 =
291
  * Lazy load.
292
 
293
+ = 1.6.4 =
294
+ * Bug fix.
295
+
296
  == Upgrade Notice ==
297
 
298
  = 1.0 =
438
  * Bug fix.
439
 
440
  = 1.6.3 =
441
+ * Lazy load.
442
+
443
+ = 1.6.4 =
444
+ * Bug fix.
trunk/admin/category.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_action('product_cat_edit_form_fields', 'fifu_cat_show_box');
4
+ add_action('product_cat_add_form_fields', 'fifu_cat_show_box');
5
+
6
+ function fifu_cat_show_box($term) {
7
+ $margin = 'margin-top:10px;';
8
+ $width = 'width:100%;';
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
+
14
+ $url = get_term_meta($term->term_id, 'fifu_image_url', true);
15
+ $alt = get_term_meta($term->term_id, 'fifu_image_alt', true);
16
+
17
+ if ($url)
18
+ $show_button = $show_sirv = 'display:none;';
19
+ else {
20
+ $show_alt = $show_image = $show_link = 'display:none;';
21
+ $show_sirv = ($is_sirv_active ? '' : 'display:none;');
22
+ }
23
+
24
+ include 'html/category.html';
25
+ }
26
+
27
+ add_action('edited_product_cat', 'fifu_cat_save_properties', 10, 2);
28
+ add_action('create_product_cat', 'fifu_cat_save_properties', 10, 2);
29
+
30
+ function fifu_cat_save_properties($term_id) {
31
+ if (isset($_POST['fifu_input_url']))
32
+ update_term_meta($term_id, 'fifu_image_url', esc_url($_POST['fifu_input_url']));
33
+
34
+ if (isset($_POST['fifu_input_alt']))
35
+ update_term_meta($term_id, 'fifu_image_alt', wp_strip_all_tags($_POST['fifu_input_alt']));
36
+ }
trunk/admin/column.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_action('admin_init', 'fifu_column');
4
+
5
+ function fifu_column() {
6
+ add_filter('manage_posts_columns', 'fifu_column_head');
7
+ add_filter('manage_pages_columns', 'fifu_column_head');
8
+ add_filter('manage_edit-product_cat_columns', 'fifu_column_head');
9
+ add_action('manage_posts_custom_column', 'fifu_column_content', 10, 2);
10
+ add_action('manage_pages_custom_column', 'fifu_column_content', 10, 2);
11
+ add_action('manage_product_cat_custom_column', 'fifu_cat_column_content', 10, 3);
12
+ }
13
+
14
+ function fifu_column_head($default) {
15
+ $default['featured_image'] = 'FIFU';
16
+ return $default;
17
+ }
18
+
19
+ function fifu_cat_column_content($internal_image, $column, $term_id) {
20
+ if ($column == 'featured_image') {
21
+ $url = get_term_meta($term_id, 'fifu_image_url', true);
22
+ if ($url != '')
23
+ echo sprintf('<img src="%s" height="%s"/>', $url, get_option('fifu_column_height'));
24
+ } else
25
+ echo $internal_image;
26
+ }
27
+
28
+ function fifu_column_content($column, $post_id) {
29
+ if ($column == 'featured_image') {
30
+ $url = get_post_meta($post_id, 'fifu_image_url', true);
31
+ if ($url == '')
32
+ $url = wp_get_attachment_url(get_post_thumbnail_id());
33
+ echo sprintf('<img src="%s" height="%s"/>', $url, get_option('fifu_column_height'));
34
+ }
35
+ }
trunk/admin/html/category.html ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style><?php include 'css/category.css' ?></style>
2
+
3
+ <tr>
4
+ <th>Featured Image from URL</th>
5
+ <td>
6
+ <div class="box">
7
+ <?php include 'meta-box.html' ?>
8
+ </div>
9
+ </td>
10
+ </tr>
11
+
12
+ <br/>
trunk/admin/html/css/category.css ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .box {
2
+ margin: 20px 0 0;
3
+ background: #fff;
4
+ border: 1px solid #dbdbdb;
5
+ padding: 20px;
6
+ width: 92%;
7
+ }
8
+
9
+ .greybox {
10
+ margin: 10px 0 0;
11
+ background: #f9f9f9;
12
+ border: 1px solid #dbdbdb;
13
+ padding: 20px;
14
+ }
15
+
16
+ .greybox p {
17
+ font-style: italic;
18
+ color: #999;
19
+ }
20
+
trunk/admin/html/css/menu.css ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wrap {
2
+ max-width: 800px;
3
+ margin: 20px 20px 20px 15px;
4
+ }
5
+
6
+ .box {
7
+ margin: 20px 0 0;
8
+ background: #fff;
9
+ border: 1px solid #dbdbdb;
10
+ padding: 20px;
11
+ }
12
+
13
+ .greybox {
14
+ margin: 10px 0 0;
15
+ background: #f9f9f9;
16
+ border: 1px solid #dbdbdb;
17
+ padding: 20px;
18
+ }
19
+
20
+ .greybox p {
21
+ font-style: italic;
22
+ color: #000000;
23
+ }
24
+
25
+ .toggleon, .toggleoff {
26
+ padding: 0;
27
+ overflow: hidden;
28
+ width: 72px;
29
+ height: 24px;
30
+ background: url("<?php echo $image_button ?>") 0 0 no-repeat;
31
+ text-align: center !important;
32
+ }
33
+
34
+ .toggleoff {
35
+ background: url("<?php echo $image_button ?>") -72px 0 no-repeat;
36
+ }
37
+
38
+ .fifubox {
39
+ border: 1px;
40
+ color: black;
41
+ padding: 15px 32px;
42
+ text-align: center;
43
+ text-decoration: none;
44
+ display: inline-block;
45
+ font-size: 16px;
46
+ margin: 4px 2px;
47
+ border-style: solid;
48
+ }
49
+
50
+ th, td {
51
+ border-bottom: 1px solid #ddd;
52
+ padding-right: 32px;
53
+ font-weight: normal;
54
+ }
55
+
56
+ th {
57
+ height: 25px;
58
+ }
trunk/admin/html/js/category.js ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function removeImage() {
2
+ jQuery("#fifu_input_alt").hide();
3
+ jQuery("#fifu_image").hide();
4
+ jQuery("#fifu_link").hide();
5
+
6
+ jQuery("#fifu_input_alt").val("");
7
+ jQuery("#fifu_input_url").val("");
8
+
9
+ jQuery("#fifu_input_url").show();
10
+ jQuery("#fifu_button").show();
11
+ }
12
+
13
+ function previewImage() {
14
+ var $url = jQuery("#fifu_input_url").val();
15
+
16
+ if ($url) {
17
+ jQuery("#fifu_input_url").hide();
18
+ jQuery("#fifu_button").hide();
19
+
20
+ jQuery("#fifu_image").css('background-image', "url('" + $url + "')");
21
+
22
+ jQuery("#fifu_input_alt").show();
23
+ jQuery("#fifu_image").show();
24
+ jQuery("#fifu_link").show();
25
+ }
26
+ }
trunk/admin/html/js/menu.js ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function invert(id) {
2
+ if (jQuery("#fifu_toggle_" + id).attr("class") == "toggleon") {
3
+ jQuery("#fifu_toggle_" + id).attr("class", "toggleoff");
4
+ jQuery("#fifu_input_" + id).val('off');
5
+ } else {
6
+ jQuery("#fifu_toggle_" + id).attr("class", "toggleon");
7
+ jQuery("#fifu_input_" + id).val('on');
8
+ }
9
+ }
10
+
11
+ jQuery(function () {
12
+ var url = window.location.href;
13
+
14
+ //forms with id started by...
15
+ jQuery("form[id^=fifu_form]").each(function (i, el) {
16
+ //onsubmit
17
+ jQuery(this).submit(function () {
18
+ save(this);
19
+ });
20
+ });
21
+
22
+ jQuery("#accordion").accordion();
23
+ jQuery("#tabs").tabs();
24
+ jQuery("#fifu_input_spinner_image").spinner({min: 0});
25
+ jQuery("#fifu_input_spinner_video").spinner({min: 0});
26
+ jQuery("#fifu_input_spinner_slider").spinner({min: 0});
27
+ jQuery("#fifu_input_slider_speed").spinner({min: 0});
28
+ jQuery("#fifu_input_slider_pause").spinner({min: 0});
29
+ jQuery("#tabsApi").tabs();
30
+ });
31
+
32
+ function save(formName, url) {
33
+ var frm = jQuery(formName);
34
+ jQuery.ajax({
35
+ type: frm.attr('method'),
36
+ url: url,
37
+ data: frm.serialize(),
38
+ success: function (data) {
39
+ //alert('saved');
40
+ }
41
+ });
42
+ }
trunk/admin/html/js/meta-box.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function removeImage() {
2
+ jQuery("#fifu_input_alt").hide();
3
+ jQuery("#fifu_image").hide();
4
+ jQuery("#fifu_link").hide();
5
+
6
+ jQuery("#fifu_input_alt").val("");
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() {
16
+ var $url = jQuery("#fifu_input_url").val();
17
+
18
+ if ($url) {
19
+ jQuery("#fifu_button").hide();
20
+ jQuery("#sirv-add-featured-image").hide();
21
+
22
+ jQuery("#fifu_image").css('background-image', "url('" + $url + "')");
23
+
24
+ jQuery("#fifu_input_alt").show();
25
+ jQuery("#fifu_image").show();
26
+ jQuery("#fifu_link").show();
27
+ }
28
+ }
trunk/admin/html/js/wc-meta-box.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function wcRemoveImage(i) {
2
+ var inputUrl = "#fifu_input_url_" + i;
3
+ var button = "#fifu_button_" + i;
4
+ var image = "#fifu_image_" + i;
5
+ var inputAlt = "#fifu_input_alt_" + i;
6
+ var link = "#fifu_link_" + i;
7
+
8
+ jQuery(inputAlt).hide();
9
+ jQuery(image).hide();
10
+ jQuery(link).hide();
11
+
12
+ jQuery(inputAlt).val("");
13
+ jQuery(inputUrl).val("");
14
+
15
+ jQuery(inputUrl).show();
16
+ jQuery(button).show();
17
+ }
18
+
19
+ function wcPreviewImage(i) {
20
+ var inputUrl = "#fifu_input_url_" + i;
21
+ var button = "#fifu_button_" + i;
22
+ var image = "#fifu_image_" + i;
23
+ var inputAlt = "#fifu_input_alt_" + i;
24
+ var link = "#fifu_link_" + i;
25
+
26
+ var $url = jQuery(inputUrl).val();
27
+
28
+ if ($url) {
29
+ jQuery(inputUrl).hide();
30
+ jQuery(button).hide();
31
+
32
+ jQuery(image).css('background-image', "url('" + $url + "')");
33
+
34
+ jQuery(inputAlt).show();
35
+ jQuery(image).show();
36
+ jQuery(link).show();
37
+ }
38
+ }
trunk/admin/html/menu.html ADDED
@@ -0,0 +1,1130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style><?php include 'css/menu.css' ?></style>
2
+ <script><?php include 'js/menu.js' ?></script>
3
+ <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.min.css">
4
+ <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
5
+ <div class="wrap">
6
+
7
+ <div class="box">
8
+ <h1>Featured Image From URL</h1>
9
+ </div>
10
+
11
+ <div class="box">
12
+ <h2>Value my work: give this plugin a <a href="https://wordpress.org/support/view/plugin-reviews/featured-image-from-url?filter=5" target="_blank">5-star</a> rating =)</h2>
13
+ </div>
14
+
15
+ <div class="box">
16
+
17
+ <h2>Auto Set Featured Image</h2>
18
+ <div class="greybox" style="background:#e3ffe2">
19
+ Perfect for external posts, this option allows to use the first image from a post/page/product content as featured image. It will happen when you click on Publish/Update button.
20
+ </div>
21
+
22
+ <br>
23
+
24
+ <table style="text-align:left">
25
+ <tr>
26
+ <th>
27
+ <form
28
+ id="fifu_form_get_first"
29
+ action="javascript:void(0)"
30
+ method="post">
31
+ <input
32
+ type="image"
33
+ href="javascript:void(0)"
34
+ id="fifu_toggle_get_first"
35
+ onclick="invert('get_first')"
36
+ name="fifu_toggle_get_first"
37
+ class="<?php echo $enable_get_first; ?>"
38
+ value=" " style="display:block">
39
+
40
+ <input
41
+ type="hidden"
42
+ id="fifu_input_get_first"
43
+ name="fifu_input_get_first"
44
+ value="" >
45
+ </form>
46
+ </th>
47
+ <th>
48
+ use the first image as featured image
49
+ </th>
50
+ </tr>
51
+ <tr>
52
+ <th>
53
+ <form
54
+ id="fifu_form_pop_first"
55
+ action="javascript:void(0)"
56
+ method="post">
57
+ <input
58
+ type="image"
59
+ href="javascript:void(0)"
60
+ id="fifu_toggle_pop_first"
61
+ onclick="invert('pop_first')"
62
+ name="fifu_toggle_pop_first"
63
+ class="<?php echo $enable_pop_first; ?>"
64
+ value=" " style="display:block">
65
+
66
+ <input
67
+ type="hidden"
68
+ id="fifu_input_pop_first"
69
+ name="fifu_input_pop_first"
70
+ value="" >
71
+ </form>
72
+ </th>
73
+ <th>
74
+ hide the first image from content
75
+ </th>
76
+ </tr>
77
+ <tr>
78
+ <th>
79
+ <form
80
+ id="fifu_form_ovw_first"
81
+ action="javascript:void(0)"
82
+ method="post">
83
+ <input
84
+ type="image"
85
+ href="javascript:void(0)"
86
+ id="fifu_toggle_ovw_first"
87
+ onclick="invert('ovw_first')"
88
+ name="fifu_toggle_ovw_first"
89
+ class="<?php echo $enable_ovw_first; ?>"
90
+ value=" " style="display:block">
91
+
92
+ <input
93
+ type="hidden"
94
+ id="fifu_input_ovw_first"
95
+ name="fifu_input_ovw_first"
96
+ value="" >
97
+ </form>
98
+ </th>
99
+ <th>
100
+ overwrite the existing external featured image
101
+ </th>
102
+ </tr>
103
+ </table>
104
+
105
+ </div>
106
+
107
+ <div class="box">
108
+ <h2>Custom Post Types</h2>
109
+ <div class="greybox" style="background:#e3ffe2">
110
+ Featured Image from URL is preconfigured to work with only one Custom Post Type (WooCommerce Product). But you also can use this plugin with other ones. For that, you just need to know the correct Custom Post Type names and fill the fields below. Please, let me know if you need more than 5 inputs here.
111
+ </div>
112
+ <br>
113
+
114
+ <form
115
+ id="fifu_form_cpt"
116
+ action="javascript:void(0)"
117
+ method="post">
118
+ <input id="fifu_input_cpt0" type="text" name="fifu_input_cpt0" style="width:130px" value="<?php echo $array_cpt[0]; ?>">
119
+ <input id="fifu_input_cpt1" type="text" name="fifu_input_cpt1" style="width:130px" value="<?php echo $array_cpt[1]; ?>">
120
+ <input id="fifu_input_cpt2" type="text" name="fifu_input_cpt2" style="width:130px" value="<?php echo $array_cpt[2]; ?>">
121
+ <input id="fifu_input_cpt3" type="text" name="fifu_input_cpt3" style="width:130px" value="<?php echo $array_cpt[3]; ?>">
122
+ <input id="fifu_input_cpt4" type="text" name="fifu_input_cpt4" style="width:130px" value="<?php echo $array_cpt[4]; ?>">
123
+ <input type="submit" value="Submit" >
124
+ </form>
125
+ </div>
126
+
127
+ <div class="box">
128
+ <h2>Featured Image Column</h2>
129
+ <div class="greybox" style="background:#e3ffe2">
130
+ The plugin adds a new column "FIFU" (Featured Image from URL) to your table of posts/pages/products in admin area. Below you can choose the height (px) of the image in the column. To disable that, just uncheck "FIFU" in the Screen Options.
131
+ </div>
132
+ <br>
133
+ <form
134
+ id="fifu_form_column"
135
+ action="javascript:void(0)"
136
+ method="post">
137
+ <input id="fifu_input_column_height" type="text" name="fifu_input_column_height" value="<?php echo $column_height; ?>" placeholder="e.g.: 64" size="4">
138
+ <input type="submit" value="Submit" >
139
+ </form>
140
+ </div>
141
+
142
+ <div class="box">
143
+ <h2>Featured Image in Content</h2>
144
+ <div class="greybox" style="background:#e3ffe2">
145
+ It will sound crazy, but some themes don't show the Featured Image on the posts or pages. If it is your case and you would like to show the Featured Image there, just enable the toggle. The Featured Image will appear at the beginning of the content, before the text.
146
+ </div>
147
+ <br>
148
+ <form
149
+ id="fifu_form_content"
150
+ action="javascript:void(0)"
151
+ method="post">
152
+ <input
153
+ type="image"
154
+ href="javascript:void(0)"
155
+ id="fifu_toggle_content"
156
+ onclick="invert('content')"
157
+ name="fifu_toggle_content"
158
+ class="<?php echo $enable_content; ?>"
159
+ value=" "
160
+ style="display:block">
161
+ <input
162
+ type="hidden"
163
+ id="fifu_input_content"
164
+ name="fifu_input_content"
165
+ value="" >
166
+ </form>
167
+ </div>
168
+
169
+ <div class="box">
170
+ <h2>Hide Featured Media</h2>
171
+ <div class="greybox" style="background:#e3ffe2">
172
+ Enable the toggle if you want to hide the external featured image/video/slider on posts/pages but keeping its visibility on home.
173
+ </div>
174
+ <br>
175
+ <table style="text-align:left">
176
+ <tr>
177
+ <th>
178
+ <form
179
+ id="fifu_form_hide_page"
180
+ action="javascript:void(0)"
181
+ method="post">
182
+ <input
183
+ type="image"
184
+ href="javascript:void(0)"
185
+ id="fifu_toggle_hide_page"
186
+ onclick="invert('hide_page')"
187
+ name="fifu_toggle_hide_page"
188
+ class="<?php echo $enable_hide_page; ?>"
189
+ value=" " style="display:block">
190
+
191
+ <input
192
+ type="hidden"
193
+ id="fifu_input_hide_page"
194
+ name="fifu_input_hide_page"
195
+ value="" >
196
+ </form>
197
+ </th>
198
+ <th>
199
+ on page
200
+ </th>
201
+ </tr>
202
+ <tr>
203
+ <th>
204
+ <form
205
+ id="fifu_form_hide_post"
206
+ action="javascript:void(0)"
207
+ method="post">
208
+ <input
209
+ type="image"
210
+ href="javascript:void(0)"
211
+ id="fifu_toggle_hide_post"
212
+ onclick="invert('hide_post')"
213
+ name="fifu_toggle_hide_post"
214
+ class="<?php echo $enable_hide_post; ?>"
215
+ value=" " style="display:block">
216
+
217
+ <input
218
+ type="hidden"
219
+ id="fifu_input_hide_post"
220
+ name="fifu_input_hide_post"
221
+ value="" >
222
+ </form>
223
+ </th>
224
+ <th>
225
+ on post
226
+ </th>
227
+ </tr>
228
+ </table>
229
+ </div>
230
+
231
+ <div class="box">
232
+ <h2>Lazy Load</h2>
233
+ <div class="greybox" style="background:#e3ffe2">
234
+ Enabling this feature the images/videos won't be loaded until user scrolls to them. So it will make your home/shop load faster.
235
+ </div>
236
+ <br>
237
+ <form
238
+ id="fifu_form_lazy"
239
+ action="javascript:void(0)"
240
+ method="post">
241
+ <input
242
+ type="image"
243
+ href="javascript:void(0)"
244
+ id="fifu_toggle_lazy"
245
+ onclick="invert('lazy')"
246
+ name="fifu_toggle_lazy"
247
+ class="<?php echo $enable_lazy; ?>"
248
+ value=" "
249
+ style="display:block">
250
+ <input
251
+ type="hidden"
252
+ id="fifu_input_lazy"
253
+ name="fifu_input_lazy"
254
+ value="" >
255
+ </form>
256
+ </div>
257
+
258
+ <div class="box">
259
+ <h2>Social Tags</h2>
260
+ <div class="greybox" style="background:#e3ffe2">
261
+ Featured Image from URL provides social tags to share the external images on the social networks. Here you can enable/disable this feature.
262
+ </div>
263
+ <br>
264
+ <form
265
+ id="fifu_form_social"
266
+ action="javascript:void(0)"
267
+ method="post">
268
+ <input
269
+ type="image"
270
+ href="javascript:void(0)"
271
+ id="fifu_toggle_social"
272
+ onclick="invert('social')"
273
+ name="fifu_toggle_social"
274
+ class="<?php echo $enable_social; ?>"
275
+ value=" "
276
+ style="display:block">
277
+ <input
278
+ type="hidden"
279
+ id="fifu_input_social"
280
+ name="fifu_input_social"
281
+ value="" >
282
+ </form>
283
+ </div>
284
+
285
+ <div style="<?php echo show_woocommerce_box() ?>">
286
+ <div class="box">
287
+ <h2>WooCommerce Full Integration</h2>
288
+ <div class="greybox" style="background:#e3ffe2">
289
+ The External Featured Image box is already available on Product Editor. However the full integration is required if you want to include the External Product Gallery and use other WooCommerce resources, such as Lightbox. This free version supports WooCommerce 2.4/2.5 and the Premium version supports WooCommerce 3.
290
+ </div>
291
+ <br>
292
+ <form
293
+ id="fifu_form_woocommerce"
294
+ action="javascript:void(0)"
295
+ method="post">
296
+ <input
297
+ type="image"
298
+ href="javascript:void(0)"
299
+ id="fifu_toggle_woocommerce"
300
+ onclick="invert('woocommerce')"
301
+ name="fifu_toggle_woocommerce"
302
+ class="<?php echo $enable_woocommerce; ?>"
303
+ value=" "
304
+ style="display:block">
305
+ <input
306
+ type="hidden"
307
+ id="fifu_input_woocommerce"
308
+ name="fifu_input_woocommerce"
309
+ value="" >
310
+ </form>
311
+ </div>
312
+ </div>
313
+
314
+ <div class="box">
315
+ <h2>WP All Import</h2>
316
+ <div class="greybox" style="background:#e3ffe2">
317
+ You can use Featured Image from URL with WP All Import plugin. For that, use the custom field <b>fifu_image_url</b>. The other custom fields supported by FIFU are listed below, in the section WP REST API > Plugin Fields.
318
+ </div>
319
+ </div>
320
+
321
+ <div class="box">
322
+ <h2>CSS Style</h2>
323
+ <div class="greybox" style="background:#ffe2e2">
324
+ <b>Premium feature</b><br><br>
325
+ Here you can define a CSS style to be applied to all external featured images. Usage example:<br><br>
326
+ width: 100%; border-radius: 8px; border: 1px solid #ddd; padding: 5px;
327
+ </div>
328
+ <br>
329
+ <input id="fifu_input_css" type="text" name="fifu_input_css" style="width:675px">
330
+ <input type="submit" value="Submit" disabled>
331
+ </div>
332
+
333
+ <div class="box">
334
+ <h2>External Featured Videos</h2>
335
+ <div class="greybox" style="background:#ffe2e2">
336
+ <b>Premium feature</b><br><br>
337
+ The default value applied to the videos is "100%" and it usually works fine. However, here you can define the max size (px, cm etc) of the featured videos at different screens and the ratio for these videos as well.<br><br>
338
+ <table style="text-align:left">
339
+ <tr>
340
+ <th>
341
+ Ratio:
342
+ </th>
343
+ <th>
344
+ <input id="fifu_input_video_width_rtio"
345
+ name="fifu_input_video_width_rtio"
346
+ size="4">
347
+ </th>
348
+ <th>
349
+ <input id="fifu_input_video_height_rtio"
350
+ name="fifu_input_video_height_rtio"
351
+ size="4">
352
+ </th>
353
+ <th>
354
+ <div style="font-style: italic;font-weight:normal;">e.g.: 1, 2, 3...</div>
355
+ </th>
356
+ </tr>
357
+ <tr>
358
+ <th>
359
+ Margin Bottom:
360
+ </th>
361
+ <th>
362
+ <input id="fifu_input_video_margin_bottom"
363
+ name="fifu_input_video_margin_bottom"
364
+ size="4">
365
+ </th>
366
+ <th>
367
+ <div style="font-style: italic;font-weight:normal;">e.g.: 300px, 8cm...</div>
368
+ </th>
369
+ </tr>
370
+ <tr>
371
+ <th>
372
+ Archive:
373
+ </th>
374
+ <th>
375
+ <input id="fifu_input_video_width_arch"
376
+ name="fifu_input_video_width_arch"
377
+ placeholder="max-width"
378
+ size="4">
379
+ </th>
380
+ <th>
381
+ <input id="fifu_input_video_height_arch"
382
+ name="fifu_input_video_height_arch"
383
+ placeholder="max-height"
384
+ size="4">
385
+ </th>
386
+ <th>
387
+ <div style="font-style: italic;font-weight:normal;">e.g.: 300px, 8cm...</div>
388
+ </th>
389
+ </tr>
390
+ <tr>
391
+ <th>
392
+ Category:
393
+ </th>
394
+ <th>
395
+ <input id="fifu_input_video_width_ctgr"
396
+ name="fifu_input_video_width_ctgr"
397
+ placeholder="max-width"
398
+ size="4">
399
+ </th>
400
+ <th>
401
+ <input id="fifu_input_video_height_ctgr"
402
+ name="fifu_input_video_height_ctgr"
403
+ placeholder="max-height"
404
+ size="4">
405
+ </th>
406
+ <th>
407
+ <div style="font-style: italic;font-weight:normal;">e.g.: 300px, 8cm...</div>
408
+ </th>
409
+ </tr>
410
+ <tr>
411
+ <th>
412
+ Home:
413
+ </th>
414
+ <th>
415
+ <input id="fifu_input_video_width_home"
416
+ name="fifu_input_video_width_home"
417
+ placeholder="max-width"
418
+ size="4">
419
+ </th>
420
+ <th>
421
+ <input id="fifu_input_video_height_home"
422
+ name="fifu_input_video_height_home"
423
+ placeholder="max-height"
424
+ size="4">
425
+ </th>
426
+ <th>
427
+ <div style="font-style: italic;font-weight:normal;">e.g.: 300px, 8cm...</div>
428
+ </th>
429
+ </tr>
430
+ <tr>
431
+ <th>
432
+ Page:
433
+ </th>
434
+ <th>
435
+ <input id="fifu_input_video_width_page"
436
+ name="fifu_input_video_width_page"
437
+ placeholder="max-width"
438
+ size="4">
439
+ </th>
440
+ <th>
441
+ <input id="fifu_input_video_height_page"
442
+ name="fifu_input_video_height_page"
443
+ placeholder="max-height"
444
+ size="4">
445
+ </th>
446
+ <th>
447
+ <div style="font-style: italic;font-weight:normal;">e.g.: 300px, 8cm...</div>
448
+ </th>
449
+ </tr>
450
+ <tr>
451
+ <th>
452
+ Post:
453
+ </th>
454
+ <th>
455
+ <input id="fifu_input_video_width_post"
456
+ name="fifu_input_video_width_post"
457
+ placeholder="max-width"
458
+ size="4">
459
+ </th>
460
+ <th>
461
+ <input id="fifu_input_video_height_post"
462
+ name="fifu_input_video_height_post"
463
+ placeholder="max-height"
464
+ size="4">
465
+ </th>
466
+ <th>
467
+ <div style="font-style: italic;font-weight:normal;">e.g.: 300px, 8cm...</div>
468
+ </th>
469
+ </tr>
470
+ <tr>
471
+ <th>
472
+ Product:
473
+ </th>
474
+ <th>
475
+ <input id="fifu_input_video_width_prod"
476
+ name="fifu_input_video_width_prod"
477
+ placeholder="max-width"
478
+ size="4">
479
+ </th>
480
+ <th>
481
+ <input id="fifu_input_video_height_prod"
482
+ name="fifu_input_video_height_prod"
483
+ placeholder="max-height"
484
+ size="4">
485
+ </th>
486
+ <th>
487
+ <div style="font-style: italic;font-weight:normal;">e.g.: 300px, 8cm...</div>
488
+ </th>
489
+ </tr>
490
+ <tr>
491
+ <th>
492
+ Shop:
493
+ </th>
494
+ <th>
495
+ <input id="fifu_input_video_width_shop"
496
+ name="fifu_input_video_width_shop"
497
+ placeholder="max-width"
498
+ size="4">
499
+ </th>
500
+ <th>
501
+ <input id="fifu_input_video_height_shop"
502
+ name="fifu_input_video_height_shop"
503
+ placeholder="max-height"
504
+ size="4">
505
+ </th>
506
+ <th>
507
+ <div style="font-style: italic;font-weight:normal;">e.g.: 300px, 8cm...</div>
508
+ </th>
509
+ </tr>
510
+ </table>
511
+ <br>
512
+ </div>
513
+ <br>
514
+ <input type="submit" value="Submit" disabled>
515
+ </div>
516
+
517
+ <div class="box">
518
+ <h2>External Thumbnails (<a href="https://www.flickr.com/">Flickr</a> Integration): Your Website Faster Than Ever</h2>
519
+ <div class="greybox" style="background:#ffe2e2">
520
+ <b>Premium feature</b><br><br>
521
+ <div id="accordion">
522
+ <h3>Do you know Flickr?</h3>
523
+ <div>
524
+ <ol>
525
+ <li>It's free;</li>
526
+ <li>Offers 1000 GB of space;</li>
527
+ <li>It's dedicated to store and provide images, probably faster than the most of servers;</li>
528
+ <li>Creates automatic copies of your images in <b>many different sizes.</b></li>
529
+ </ol>
530
+ </div>
531
+ <h3>How does Featured Image From URL take advantage of Flickr?</h3>
532
+ <div>
533
+ Smaller the images, faster your site.<br><br> So the plugin will load the images from Flickr in the exactly size your site needs.
534
+ And the result is...<br><br>
535
+ <b>The images will be shown with the best quality and the shortest time possible.</b>
536
+ </div>
537
+ </div>
538
+
539
+ </br>
540
+ <h3>Getting Flickr URL</h3>
541
+ <div>
542
+ You just need to get one URL (Square 75). Use that to fill the External Featured Image field of your post, page or product. The plugin will handle this URL to provide the image in different sizes.<br><br>
543
+ <img src="https://c1.staticflickr.com/1/745/31593837206_8e081be749_z_d.jpg"/>
544
+ <img src="https://c1.staticflickr.com/1/223/30820834393_f869fcff49_z_d.jpg"/>
545
+ </div>
546
+ <h3>Choose the maximum image size for each screen</h3>
547
+ <table style="text-align:left">
548
+ <tr>
549
+ <th>Archive:&nbsp;</th>
550
+ <th>
551
+ <select id="select_flickr_arch" style="font-family:courier;font-size:12px">
552
+ <option value=""></option>
553
+ <option value="s">&nbsp; 75 x 75</option>
554
+ <option value="q">&nbsp;150 x 150</option>
555
+ <option value="t">&nbsp;100&nbsp;on longest side</option>
556
+ <option value="m">&nbsp;240&nbsp;on longest side</option>
557
+ <option value="n">&nbsp;320&nbsp;on longest side</option>
558
+ <option value="-">&nbsp;500&nbsp;on longest side</option>
559
+ <option value="z">&nbsp;640&nbsp;on longest side</option>
560
+ <option value="c">&nbsp;800&nbsp;on longest side</option>
561
+ <option value="b">1024&nbsp;on longest side</option>
562
+ <option value="h">1600&nbsp;on longest side</option>
563
+ </select>
564
+ </th>
565
+ </tr>
566
+ <tr>
567
+ <th>Cart:&nbsp;</th>
568
+ <th>
569
+ <select id="select_flickr_cart" style="font-family:courier;font-size:12px">
570
+ <option value=""></option>
571
+ <option value="s">&nbsp; 75 x 75</option>
572
+ <option value="q">&nbsp;150 x 150</option>
573
+ <option value="t">&nbsp;100&nbsp;on longest side</option>
574
+ <option value="m">&nbsp;240&nbsp;on longest side</option>
575
+ <option value="n">&nbsp;320&nbsp;on longest side</option>
576
+ <option value="-">&nbsp;500&nbsp;on longest side</option>
577
+ <option value="z">&nbsp;640&nbsp;on longest side</option>
578
+ <option value="c">&nbsp;800&nbsp;on longest side</option>
579
+ <option value="b">1024&nbsp;on longest side</option>
580
+ <option value="h">1600&nbsp;on longest side</option>
581
+ </select>
582
+ </th>
583
+ </tr>
584
+ <tr>
585
+ <th>Category:&nbsp;</th>
586
+ <th>
587
+ <select id="select_flickr_ctgr" style="font-family:courier;font-size:12px">
588
+ <option value=""></option>
589
+ <option value="s">&nbsp; 75 x 75</option>
590
+ <option value="q">&nbsp;150 x 150</option>
591
+ <option value="t">&nbsp;100&nbsp;on longest side</option>
592
+ <option value="m">&nbsp;240&nbsp;on longest side</option>
593
+ <option value="n">&nbsp;320&nbsp;on longest side</option>
594
+ <option value="-">&nbsp;500&nbsp;on longest side</option>
595
+ <option value="z">&nbsp;640&nbsp;on longest side</option>
596
+ <option value="c">&nbsp;800&nbsp;on longest side</option>
597
+ <option value="b">1024&nbsp;on longest side</option>
598
+ <option value="h">1600&nbsp;on longest side</option>
599
+ </select>
600
+ </th>
601
+ </tr>
602
+ <tr>
603
+ <th>Home:&nbsp;</th>
604
+ <th>
605
+ <select id="select_flickr_home" style="font-family:courier;font-size:12px">
606
+ <option value=""></option>
607
+ <option value="s">&nbsp; 75 x 75</option>
608
+ <option value="q">&nbsp;150 x 150</option>
609
+ <option value="t">&nbsp;100&nbsp;on longest side</option>
610
+ <option value="m">&nbsp;240&nbsp;on longest side</option>
611
+ <option value="n">&nbsp;320&nbsp;on longest side</option>
612
+ <option value="-">&nbsp;500&nbsp;on longest side</option>
613
+ <option value="z">&nbsp;640&nbsp;on longest side</option>
614
+ <option value="c">&nbsp;800&nbsp;on longest side</option>
615
+ <option value="b">1024&nbsp;on longest side</option>
616
+ <option value="h">1600&nbsp;on longest side</option>
617
+ </select>
618
+ </th>
619
+ </tr>
620
+ <tr>
621
+ <th>Lightbox:&nbsp;</th>
622
+ <th>
623
+ <select id="select_flickr_lbox" style="font-family:courier;font-size:12px">
624
+ <option value=""></option>
625
+ <option value="s">&nbsp; 75 x 75</option>
626
+ <option value="q">&nbsp;150 x 150</option>
627
+ <option value="t">&nbsp;100&nbsp;on longest side</option>
628
+ <option value="m">&nbsp;240&nbsp;on longest side</option>
629
+ <option value="n">&nbsp;320&nbsp;on longest side</option>
630
+ <option value="-">&nbsp;500&nbsp;on longest side</option>
631
+ <option value="z">&nbsp;640&nbsp;on longest side</option>
632
+ <option value="c">&nbsp;800&nbsp;on longest side</option>
633
+ <option value="b">1024&nbsp;on longest side</option>
634
+ <option value="h">1600&nbsp;on longest side</option>
635
+ </select>
636
+ </th>
637
+ </tr>
638
+ <tr>
639
+ <th>Page:&nbsp;</th>
640
+ <th>
641
+ <select id="select_flickr_page" style="font-family:courier;font-size:12px">
642
+ <option value=""></option>
643
+ <option value="s">&nbsp; 75 x 75</option>
644
+ <option value="q">&nbsp;150 x 150</option>
645
+ <option value="t">&nbsp;100&nbsp;on longest side</option>
646
+ <option value="m">&nbsp;240&nbsp;on longest side</option>
647
+ <option value="n">&nbsp;320&nbsp;on longest side</option>
648
+ <option value="-">&nbsp;500&nbsp;on longest side</option>
649
+ <option value="z">&nbsp;640&nbsp;on longest side</option>
650
+ <option value="c">&nbsp;800&nbsp;on longest side</option>
651
+ <option value="b">1024&nbsp;on longest side</option>
652
+ <option value="h">1600&nbsp;on longest side</option>
653
+ </select>
654
+ </th>
655
+ </tr>
656
+ <tr>
657
+ <th>Post:&nbsp;</th>
658
+ <th>
659
+ <select id="select_flickr_post" style="font-family:courier;font-size:12px">
660
+ <option value=""></option>
661
+ <option value="s">&nbsp; 75 x 75</option>
662
+ <option value="q">&nbsp;150 x 150</option>
663
+ <option value="t">&nbsp;100&nbsp;on longest side</option>
664
+ <option value="m">&nbsp;240&nbsp;on longest side</option>
665
+ <option value="n">&nbsp;320&nbsp;on longest side</option>
666
+ <option value="-">&nbsp;500&nbsp;on longest side</option>
667
+ <option value="z">&nbsp;640&nbsp;on longest side</option>
668
+ <option value="c">&nbsp;800&nbsp;on longest side</option>
669
+ <option value="b">1024&nbsp;on longest side</option>
670
+ <option value="h">1600&nbsp;on longest side</option>
671
+ </select>
672
+ </th>
673
+ </tr>
674
+ <tr>
675
+ <th>Product:&nbsp;</th>
676
+ <th>
677
+ <select id="select_flickr_prod" style="font-family:courier;font-size:12px">
678
+ <option value=""></option>
679
+ <option value="s">&nbsp; 75 x 75</option>
680
+ <option value="q">&nbsp;150 x 150</option>
681
+ <option value="t">&nbsp;100&nbsp;on longest side</option>
682
+ <option value="m">&nbsp;240&nbsp;on longest side</option>
683
+ <option value="n">&nbsp;320&nbsp;on longest side</option>
684
+ <option value="-">&nbsp;500&nbsp;on longest side</option>
685
+ <option value="z">&nbsp;640&nbsp;on longest side</option>
686
+ <option value="c">&nbsp;800&nbsp;on longest side</option>
687
+ <option value="b">1024&nbsp;on longest side</option>
688
+ <option value="h">1600&nbsp;on longest side</option>
689
+ </select>
690
+ </th>
691
+ </tr>
692
+ <tr>
693
+ <th>Shop:&nbsp;</th>
694
+ <th>
695
+ <select id="select_flickr_shop" style="font-family:courier;font-size:12px">
696
+ <option value=""></option>
697
+ <option value="s">&nbsp; 75 x 75</option>
698
+ <option value="q">&nbsp;150 x 150</option>
699
+ <option value="t">&nbsp;100&nbsp;on longest side</option>
700
+ <option value="m">&nbsp;240&nbsp;on longest side</option>
701
+ <option value="n">&nbsp;320&nbsp;on longest side</option>
702
+ <option value="-">&nbsp;500&nbsp;on longest side</option>
703
+ <option value="z">&nbsp;640&nbsp;on longest side</option>
704
+ <option value="c">&nbsp;800&nbsp;on longest side</option>
705
+ <option value="b">1024&nbsp;on longest side</option>
706
+ <option value="h">1600&nbsp;on longest side</option>
707
+ </select>
708
+ </th>
709
+ </tr>
710
+ </table><br>
711
+ </div>
712
+ </div>
713
+
714
+ <div class="box">
715
+ <h2>Hover Effects</h2>
716
+ <div class="greybox" style="background:#ffe2e2">
717
+ <b>Premium feature</b><br><br>
718
+ Choose one among 18 hover effects to be applied to all external featured images of your posts on your main page.<br><br>
719
+ </div>
720
+ <br>
721
+ <select id="select_hover" style="width:90%">
722
+ <option value=""></option>
723
+ <option value="hover17">315 Degrees</option>
724
+ <option value="hover02">360 Degrees</option>
725
+ <option value="hover07">Blur</option>
726
+ <option value="hover10">Blur Gray Scale</option>
727
+ <option value="hover04">Brighten</option>
728
+ <option value="hover15">Circle</option>
729
+ <option value="hover13">Flashing</option>
730
+ <option value="hover08">Gray Scale</option>
731
+ <option value="hover16">Horizontal Rotation</option>
732
+ <option value="hover12">Opacity Color</option>
733
+ <option value="hover11">Opacity White</option>
734
+ <option value="hover18">Rainbow</option>
735
+ <option value="hover06">Rotate</option>
736
+ <option value="hover09">Sepia</option>
737
+ <option value="hover14">Shine</option>
738
+ <option value="hover05">Vertical Rotation</option>
739
+ <option value="hover01">Zoom In</option>
740
+ <option value="hover03">Zoom Out</option>
741
+ </select>
742
+ <input type="submit" value="Submit" disabled>
743
+ </div>
744
+
745
+ <div class="box">
746
+ <h2>Meta boxes: External Galleries and Slider</h2>
747
+ <div class="greybox" style="background:#ffe2e2">
748
+ <b>Premium feature</b><br><br>
749
+ Here you can define the number of fields you will have on the editor for galleries and slider. A huge amount of fields can interfere in the save action time.<br><br>
750
+ <table style="text-align:left">
751
+ <tr>
752
+ <th>
753
+ <label for="fifu_input_spinner_image"
754
+ placehold>External Image Gallery:</label>
755
+ </th>
756
+ <th>
757
+ <input id="fifu_input_spinner_image"
758
+ name="fifu_input_spinner_image"
759
+ size="4">
760
+ </th>
761
+ </tr>
762
+ <tr>
763
+ <th>
764
+ <label for="fifu_input_spinner_video">External Video Gallery:</label>
765
+ </th>
766
+ <th>
767
+ <input id="fifu_input_spinner_video"
768
+ name="fifu_input_spinner_video"
769
+ size="4">
770
+ </th>
771
+ </tr>
772
+ <tr>
773
+ <th>
774
+ <label for="fifu_input_spinner_slider">Slider:</label>
775
+ </th>
776
+ <th>
777
+ <input id="fifu_input_spinner_slider"
778
+ name="fifu_input_spinner_slider"
779
+ size="4">
780
+ </th>
781
+ </tr>
782
+ </table>
783
+ </div>
784
+ <br>
785
+ <input type="submit" value="Submit" disabled>
786
+ </div>
787
+
788
+ <div class="box">
789
+ <h2>Product Categories Grid</h2>
790
+ <div class="greybox" style="background:#ffe2e2">
791
+ <b>Premium feature</b><br><br>
792
+ Allows you to use use external images/videos on Product Categories Grid.
793
+ </div>
794
+ <br>
795
+ <form
796
+ id="fifu_form_woocommerce"
797
+ action="javascript:void(0)"
798
+ method="post">
799
+ <input
800
+ type="image"
801
+ href="javascript:void(0)"
802
+ id="fifu_toggle_woocommerce"
803
+ onclick="invert('woocommerce')"
804
+ name="fifu_toggle_woocommerce"
805
+ class="<?php echo $enable_woocommerce; ?>"
806
+ value=" "
807
+ style="display:block">
808
+
809
+ <input
810
+ type="hidden"
811
+ id="fifu_input_woocommerce"
812
+ name="fifu_input_woocommerce"
813
+ value="" >
814
+ </form>
815
+ </div>
816
+
817
+ <div class="box">
818
+ <h2>Slider Settings</h2>
819
+ <div class="greybox" style="background:#ffe2e2">
820
+ <b>Premium feature</b><br><br>
821
+ Once you have added the first external image on a post/page/product, the slider meta box will show up. Adding more external images, you have a slider and you can define its settings here.<br><br>
822
+ <table style="text-align:left">
823
+ <tr>
824
+ <th>
825
+ <input
826
+ type="image"
827
+ href="javascript:void(0)"
828
+ id="fifu_toggle_slider_fade"
829
+ name="fifu_toggle_slider_fade"
830
+ class="toggleoff"
831
+ value=" " style="display:block">
832
+ </th>
833
+ <th>
834
+ fade effect
835
+ </th>
836
+ </tr>
837
+ <tr>
838
+ <th>
839
+ <input
840
+ type="image"
841
+ href="javascript:void(0)"
842
+ id="fifu_toggle_slider_stop"
843
+ name="fifu_toggle_slider_stop"
844
+ class="toggleoff"
845
+ value=" " style="display:block">
846
+ </th>
847
+ <th>
848
+ pause autoplay on hover
849
+ </th>
850
+ </tr>
851
+ <tr>
852
+ <th>
853
+ <input
854
+ type="image"
855
+ href="javascript:void(0)"
856
+ id="fifu_toggle_slider_ctrl"
857
+ name="fifu_toggle_slider_ctrl"
858
+ class="toggleoff"
859
+ value=" " style="display:block">
860
+ </th>
861
+ <th>
862
+ show prev/next buttons
863
+ </th>
864
+ </tr>
865
+ <tr>
866
+ <th>
867
+ <input
868
+ type="image"
869
+ href="javascript:void(0)"
870
+ id="fifu_toggle_slider_auto"
871
+ name="fifu_toggle_slider_auto"
872
+ class="toggleoff"
873
+ value=" " style="display:block">
874
+ </th>
875
+ <th>
876
+ start to play automatically
877
+ </th>
878
+ </tr>
879
+ <tr>
880
+ <th>
881
+ <input id="fifu_input_slider_pause"
882
+ name="fifu_input_slider_pause"
883
+ step="500"
884
+ size="4">
885
+ </th>
886
+ <th>
887
+ time between each transition (in ms)
888
+ </th>
889
+ </tr>
890
+ <tr>
891
+ <th>
892
+ <input id="fifu_input_slider_speed"
893
+ name="fifu_input_slider_speed"
894
+ step="500"
895
+ max="2000"
896
+ size="4">
897
+ </th>
898
+ <th>
899
+ transition duration (in ms)
900
+ </th>
901
+ </tr>
902
+ </table>
903
+ <br>
904
+ </div>
905
+ </div>
906
+
907
+ <div class="box">
908
+ <h2>WooCommerce Lightbox</h2>
909
+ <div class="greybox" style="background:#ffe2e2">
910
+ <b>Premium feature</b><br><br>
911
+ You can enable/disable the WooCommerce lightbox here.<br>
912
+ </div>
913
+ <br>
914
+ <input
915
+ type="image"
916
+ href="javascript:void(0)"
917
+ class="toggleoff"
918
+ value=" " style="display:block">
919
+ </div>
920
+
921
+ <div class="box">
922
+
923
+ <h2>WP REST API</h2>
924
+
925
+ <div class="greybox" style="background:#ffe2e2">
926
+ <b>Premium feature</b><br><br>
927
+ <div id="tabsApi">
928
+ <ul>
929
+ <li><a href="#tabs-1">Endpoints</a></li>
930
+ <li><a href="#tabs-2">Plugin Fields</a></li>
931
+ <li><a href="#tabs-3">Creating your first product...</a></li>
932
+ <li><a href="#tabs-4">Creating your first post...</a></li>
933
+ </ul>
934
+ <div id="tabs-1">
935
+ <table style="text-align:left">
936
+ <tr>
937
+ <th>
938
+ </th>
939
+ <th>
940
+ GET/POST
941
+ </th>
942
+ </tr>
943
+ <tr>
944
+ <th>Shop</th>
945
+ <th>
946
+ http://yourdomain.com/wp-json/wc/v2/products
947
+ </th>
948
+ </tr>
949
+ <tr>
950
+ <th>Blog</th>
951
+ <th>
952
+ http://yourdomain.com/wp-json/wp/v2/posts
953
+ </th>
954
+ </tr>
955
+ </table>
956
+ <br>
957
+ <br>
958
+ <table style="text-align:left">
959
+ <tr>
960
+ <th>
961
+ </th>
962
+ <th>
963
+ GET/PUT/DELETE
964
+ </th>
965
+ </tr>
966
+ <tr>
967
+ <th>Shop</th>
968
+ <th>
969
+ http://yourdomain.com/wp-json/wc/v2/products/{id}
970
+ </th>
971
+ </tr>
972
+ <tr>
973
+ <th>Blog</th>
974
+ <th>
975
+ http://yourdomain.com/wp-json/wp/v2/posts/{id}
976
+ </th>
977
+ </tr>
978
+ </table>
979
+ </div>
980
+
981
+ <div id="tabs-2">
982
+ <table style="text-align:left">
983
+ <tr>
984
+ <th>
985
+ <th>
986
+ Key
987
+ </th>
988
+ <th>
989
+ Key
990
+ </th>
991
+ <th>
992
+ Key
993
+ </th>
994
+ </tr>
995
+ <tr>
996
+ <th>
997
+ Image
998
+ </th>
999
+ <th>
1000
+ fifu_image_url
1001
+ </th>
1002
+ </tr>
1003
+ <tr>
1004
+ <th>
1005
+ Alt
1006
+ </th>
1007
+ <th>
1008
+ fifu_image_alt
1009
+ </th>
1010
+ </tr>
1011
+ <tr>
1012
+ <th>
1013
+ Video
1014
+ </th>
1015
+ <th>
1016
+ fifu_video_url
1017
+ </th>
1018
+ </tr>
1019
+ <tr>
1020
+ <th>
1021
+ Image Gallery
1022
+ </th>
1023
+ <th>
1024
+ fifu_image_url_0
1025
+ </th>
1026
+ <th>
1027
+ fifu_image_url_1
1028
+ </th>
1029
+ <th>
1030
+ ...
1031
+ </th>
1032
+ </tr>
1033
+ <tr>
1034
+ <th>
1035
+ Video Gallery
1036
+ </th>
1037
+ <th>
1038
+ fifu_video_url_0
1039
+ </th>
1040
+ <th>
1041
+ fifu_video_url_1
1042
+ </th>
1043
+ <th>
1044
+ ...
1045
+ </th>
1046
+ </tr>
1047
+ <tr>
1048
+ <th>
1049
+ Slider
1050
+ </th>
1051
+ <th>
1052
+ fifu_slider_image_url_0
1053
+ </th>
1054
+ <th>
1055
+ fifu_slider_image_url_1
1056
+ </th>
1057
+ <th>
1058
+ ...
1059
+ </th>
1060
+ </tr>
1061
+ </table>
1062
+ </div>
1063
+
1064
+ <div id="tabs-3">
1065
+ <p>
1066
+ <iframe src="../wp-content/plugins/featured-image-from-url/admin/html/txt/product.txt"
1067
+ width="800px" height="220px" ></iframe>
1068
+ </p>
1069
+ </div>
1070
+
1071
+ <div id="tabs-4">
1072
+ <p>
1073
+ <iframe src="../wp-content/plugins/featured-image-from-url/admin/html/txt/post.txt"
1074
+ width="800px" height="220px" ></iframe>
1075
+ </p>
1076
+ </div>
1077
+
1078
+ </div>
1079
+
1080
+ </div>
1081
+
1082
+ </div>
1083
+
1084
+ <div class="box">
1085
+ <h2>Help</h2>
1086
+ <div class="greybox">
1087
+ Featured Image From URL plugin allows you to use an external image (from anywhere) as Featured Image of your Post, Page or Custom Post Type, such as WooCommerce Product. For WooCommerce users, it's also possible to use external images in the Product Category and Product Gallery. All included content still has social tags to facilitate sharing on social networks. And it's compatible with WP All Import plugin using the custom field "fifu_image_url". For more information, refer to <a href="https://wordpress.org/plugins/featured-image-from-url/faq/" target="_blank">FAQ</a> and <a href="https://wordpress.org/plugins/featured-image-from-url/screenshots/" target="_blank">screenshots</a>.
1088
+ </div>
1089
+ </div>
1090
+
1091
+ <div class="box">
1092
+ <h2>Report a Bug or Suggest an Improvement</h2>
1093
+ <div class="greybox">
1094
+ Suggestions for improvement are always welcome. Just send an email to <a href="mailto:support@featuredimagefromurl.com">support@featuredimagefromurl.com</a> and your request can be available in the next release.
1095
+ But if you want to report a bug, please provide as many details as possible such as plugin version, screenshots, JS errors on browser console, PHP errors in debug file, domain etc.
1096
+ The most common related problem is that the images aren't shown on public area. And in 90% of times it's caused because of errors in another plugin.
1097
+ </div>
1098
+ </div>
1099
+
1100
+ <div class="box">
1101
+ <h2>About <a href="http://featuredimagefromurl.com/">Featured Image from URL Premium</a></h2>
1102
+ <div class="greybox">
1103
+ <h3>1) "How to get support?"</h3>
1104
+ You can inform any problem related to the Premium version in the email above. It will be solved as soon as possible and without any cost.<br><br>
1105
+ <h3>2) "Which plugins are compatible with Premium version?"</h3>
1106
+ WooCommerce, WP All Import, Monarch, Frontend Publishing and others. If you intend to use the Premium version with a specific plugin, you can ask me if they are compatible.<br><br>
1107
+ <h3>3) "Can I get my money back later?"</h3>
1108
+ 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 may refund you.<br><br>
1109
+ <h3>4) "How to get the Premium version?"</h3>
1110
+ <div style="display:inline-block;">
1111
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
1112
+ <input type="hidden" name="cmd" value="_s-xclick">
1113
+ <input type="hidden" name="hosted_button_id" value="8BLDLZ3HDBGQG">
1114
+ <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG_global.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online!">
1115
+ <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
1116
+ </form>
1117
+ </div>
1118
+ <div style="display:inline-block;top:-20px;position:relative">
1119
+ (US$ 50 or more, please) and receive the Premium version by email within 12 hours.
1120
+ </div>
1121
+ </div>
1122
+ </div>
1123
+
1124
+ <div class="box">
1125
+ <h2>About The Author</h2>
1126
+ <div class="greybox">
1127
+ Hi! I'm Marcel Jacques Machado. Graduated in Computer Science, I work as a Software Engineer for 10 years. I already worked with C, Python, Shell Script and other programming languages and technologies. Nowadays, I develop web applications in Brazil using Java. About PHP, this plugin, Featured Image From URL, has been a great pratical experience.
1128
+ </div>
1129
+ </div>
1130
+ </div>
trunk/admin/html/meta-box.html ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script><?php include 'js/meta-box.js' ?></script>
2
+
3
+ <!-- show alt field, image and link if URL was already provided -->
4
+
5
+ <input id="fifu_input_alt"
6
+ type="text"
7
+ name="fifu_input_alt"
8
+ placeholder="alt attribute (optional)"
9
+ value="<?php echo $alt; ?>"
10
+ style="<?php echo $width, $margin, $show_alt ?>" />
11
+
12
+ <div id="fifu_image"
13
+ style="<?php echo $height, $margin, $show_image ?>
14
+ background:url('<?php echo $url; ?>') no-repeat center center;
15
+ background-size:cover;" >
16
+ </div>
17
+
18
+ <input id="fifu_input_url"
19
+ type="text"
20
+ name="fifu_input_url"
21
+ placeholder="URL"
22
+ value="<?php echo $url; ?>"
23
+ style="<?php echo $width, $margin ?>" />
24
+
25
+ <p/>
26
+ <center>
27
+ <a id="fifu_link"
28
+ href="#"
29
+ onClick="removeImage();"
30
+ style="<?php echo $show_link ?>" >remove external featured image</a>
31
+ </center>
32
+
33
+ <!-- show preview button if URL was not provided yet -->
34
+
35
+ <a id="fifu_button"
36
+ class="button"
37
+ onClick="previewImage();"
38
+ style="<?php echo $align, $margin, $show_button ?>" >Preview</a>
39
+
40
+ <a id="sirv-add-featured-image"
41
+ active="<?php echo $is_sirv_active; ?>"
42
+ data-input-anchor="#fifu_input_url"
43
+ href="#"
44
+ class="button sirv-add-image-modal-click"
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
+ <br>
51
+ <hr>
52
+ <p style="font-size: 12px; padding: 5px; border-left: 6px solid green; color: black;
53
+ background-color: #eee; border-radius: 15px 50px;">New free feature: Lazy Load</p>
54
+ <p style="font-size: 12px; padding: 5px; border-left: 6px solid #ff5400; color: black;
55
+ background-color: #eee; border-radius: 15px 50px;">New premium feature: WP REST API integration</p>
56
+ <p style="font-size: 12px; padding: 5px; border-left: 6px solid #c60013; color: black;
57
+ background-color: #eee; border-radius: 15px 50px;">Allows to set player parameters for YouTube videos now</p>
58
+ <p style="font-size: 12px; padding: 5px; border-left: 6px solid black; color: black;
59
+ background-color: #eee; border-radius: 15px 50px;"><a href="https://goo.gl/forms/TxLdhwXTqsuO5BHg2">Vote</a> on the next free plugin feature</p>
60
+ <center>
61
+ <table>
62
+ <tbody>
63
+ <tr>
64
+ <th>premium live preview:</th>
65
+ <th><a href="http://blog.featuredimagefromurl.com/">blog
66
+ </a></th>
67
+ <th><a href="http://shop.featuredimagefromurl.com/">shop
68
+ </a></th>
69
+ </tr>
70
+ </tbody>
71
+ </table>
72
+ </center>
73
+ </div>
trunk/admin/html/txt/post.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "status": "publish",
3
+ "content": "I'm using WP REST API!",
4
+ "title": "Featured Image from URL",
5
+ "excerpt": "My first post...",
6
+ "fifu_image_url": "http://ps.w.org/featured-image-from-url/assets/icon-256x256.png",
7
+ "fifu_image_alt": "Logo"
8
+ }
trunk/admin/html/txt/product.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "Featured Image from URL",
3
+ "meta_data": [
4
+ {
5
+ "key": "fifu_image_url",
6
+ "value": "http://ps.w.org/featured-image-from-url/assets/icon-256x256.png"
7
+ },
8
+ {
9
+ "key": "fifu_image_alt",
10
+ "value": "Logo"
11
+ }
12
+ ]
13
+ }
trunk/admin/html/wc-meta-box.html ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script><?php include 'js/wc-meta-box.js' ?></script>
2
+
3
+ <!-- show alt field, remove button and image if URL was already provided -->
4
+
5
+ <input id="fifu_input_alt_<?php echo $i; ?>"
6
+ type="text"
7
+ name="fifu_input_alt_<?php echo $i; ?>"
8
+ placeholder="alt attribute (required)"
9
+ value="<?php echo $alt[$i]; ?>"
10
+ style="<?php echo $altWidth, $show_alt[$i] ?>" />
11
+
12
+ <a id="fifu_link_<?php echo $i; ?>"
13
+ class="button"
14
+ href="#"
15
+ onClick="wcRemoveImage(<?php echo $i; ?>);"
16
+ style="<?php echo $show_link[$i] ?>" >x</a>
17
+
18
+ <div id="fifu_image_<?php echo $i; ?>"
19
+ style="<?php echo $height, $margin, $show_image[$i] ?>
20
+ background:url('<?php echo $url[$i]; ?>') no-repeat center center;
21
+ background-size:cover;" >
22
+ </div>
23
+
24
+ <!-- show URL field and preview button if URL was not provided yet -->
25
+
26
+ <input id="fifu_input_url_<?php echo $i; ?>"
27
+ type="text"
28
+ name="fifu_input_url_<?php echo $i; ?>"
29
+ placeholder="URL"
30
+ value="<?php echo $url[$i]; ?>"
31
+ style="<?php echo $width, $margin, $show_url[$i] ?>" />
32
+
33
+ <a id="fifu_button_<?php echo $i; ?>"
34
+ class="button"
35
+ onClick="wcPreviewImage(<?php echo $i; ?>);"
36
+ style="<?php echo $align, $margin, $show_button[$i] ?>" >Preview</a>
trunk/admin/images/favicon.png ADDED
Binary file
trunk/admin/images/onoff.jpg ADDED
Binary file
trunk/admin/menu.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_action('admin_menu', 'fifu_insert_menu');
4
+
5
+ function fifu_insert_menu() {
6
+ add_menu_page(
7
+ 'Featured Image From URL', 'Featured Image From URL', 'administrator', 'featured-image-from-url', 'fifu_get_menu_html', plugins_url() . '/featured-image-from-url/admin/images/favicon.png'
8
+ );
9
+
10
+ add_action('admin_init', 'fifu_get_menu_settings');
11
+ }
12
+
13
+ function fifu_get_menu_html() {
14
+ $image_button = plugins_url() . '/featured-image-from-url/admin/images/onoff.jpg';
15
+
16
+ $enable_woocommerce = get_option('fifu_woocommerce');
17
+ $enable_social = get_option('fifu_social');
18
+ $enable_lazy = get_option('fifu_lazy');
19
+ $enable_content = get_option('fifu_content');
20
+ $enable_hide_page = get_option('fifu_hide_page');
21
+ $enable_hide_post = get_option('fifu_hide_post');
22
+ $enable_get_first = get_option('fifu_get_first');
23
+ $enable_pop_first = get_option('fifu_pop_first');
24
+ $enable_ovw_first = get_option('fifu_ovw_first');
25
+ $column_height = get_option('fifu_column_height');
26
+
27
+ $array_cpt = array();
28
+ for ($x = 0; $x <= 4; $x++)
29
+ $array_cpt[$x] = get_option('fifu_cpt' . $x);
30
+
31
+ include 'html/menu.html';
32
+
33
+ fifu_update_menu_options();
34
+
35
+ fifu_script_woocommerce();
36
+ }
37
+
38
+ function fifu_get_menu_settings() {
39
+ fifu_get_setting('fifu_woocommerce');
40
+ fifu_get_setting('fifu_social');
41
+ fifu_get_setting('fifu_lazy');
42
+ fifu_get_setting('fifu_content');
43
+ fifu_get_setting('fifu_hide_page');
44
+ fifu_get_setting('fifu_hide_post');
45
+ fifu_get_setting('fifu_get_first');
46
+ fifu_get_setting('fifu_pop_first');
47
+ fifu_get_setting('fifu_ovw_first');
48
+ fifu_get_setting('fifu_column_height');
49
+
50
+ for ($x = 0; $x <= 4; $x++)
51
+ fifu_get_setting('fifu_cpt' . $x);
52
+ }
53
+
54
+ function fifu_get_setting($type) {
55
+ register_setting('settings-group', $type);
56
+
57
+ if (!get_option($type)) {
58
+ if (strpos($type, "cpt") !== false)
59
+ update_option($type, '');
60
+ else if (strpos($type, "fifu_column_height") !== false)
61
+ update_option($type, "64");
62
+ else
63
+ update_option($type, 'toggleoff');
64
+ }
65
+ }
66
+
67
+ function fifu_update_menu_options() {
68
+ fifu_update_option('fifu_input_woocommerce', 'fifu_woocommerce');
69
+ fifu_update_option('fifu_input_social', 'fifu_social');
70
+ fifu_update_option('fifu_input_lazy', 'fifu_lazy');
71
+ fifu_update_option('fifu_input_content', 'fifu_content');
72
+ fifu_update_option('fifu_input_hide_page', 'fifu_hide_page');
73
+ fifu_update_option('fifu_input_hide_post', 'fifu_hide_post');
74
+ fifu_update_option('fifu_input_get_first', 'fifu_get_first');
75
+ fifu_update_option('fifu_input_pop_first', 'fifu_pop_first');
76
+ fifu_update_option('fifu_input_ovw_first', 'fifu_ovw_first');
77
+ fifu_update_option('fifu_input_column_height', 'fifu_column_height');
78
+
79
+ for ($x = 0; $x <= 4; $x++)
80
+ fifu_update_option('fifu_input_cpt' . $x, 'fifu_cpt' . $x);
81
+ }
82
+
83
+ function fifu_update_option($input, $type) {
84
+ if (isset($_POST[$input])) {
85
+ if ($_POST[$input] == 'on')
86
+ update_option($type, 'toggleon');
87
+ else if ($_POST[$input] == 'off')
88
+ update_option($type, 'toggleoff');
89
+ else
90
+ update_option($type, wp_strip_all_tags($_POST[$input]));
91
+ }
92
+ }
93
+
94
+ function fifu_script_woocommerce() {
95
+ if (get_option('fifu_woocommerce') == 'toggleon') {
96
+ $command1 = "echo " . get_template_directory() . " > ../wp-content/plugins/featured-image-from-url/scripts/tmp.txt";
97
+ $command2 = "sh ../wp-content/plugins/featured-image-from-url/scripts/enableWoocommerce.sh";
98
+ } else {
99
+ $command1 = "sh ../wp-content/plugins/featured-image-from-url/scripts/disableWoocommerce.sh";
100
+ $command2 = "rm ../wp-content/plugins/featured-image-from-url/scripts/tmp.txt";
101
+ }
102
+ shell_exec($command1);
103
+ shell_exec($command2);
104
+ }
105
+
106
+ function show_woocommerce_box() {
107
+ return function_exists('WC') && WC()->version < 2.6 ? 'display:inline' : 'display:none';
108
+ }
trunk/admin/meta-box.php ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_action('add_meta_boxes', 'fifu_insert_meta_box');
4
+
5
+ function fifu_insert_meta_box() {
6
+ $post_types = array(
7
+ 'post',
8
+ 'page',
9
+ 'product',
10
+ get_option('fifu_cpt0'),
11
+ get_option('fifu_cpt1'),
12
+ get_option('fifu_cpt2'),
13
+ get_option('fifu_cpt3'),
14
+ get_option('fifu_cpt4')
15
+ );
16
+
17
+ foreach ($post_types as $post_type) {
18
+ if ($post_type == 'product') {
19
+ add_meta_box('urlMetaBox', 'Product Image from URL', 'fifu_show_elements', $post_type, 'side', 'low');
20
+ if (get_option('fifu_woocommerce') == 'toggleon')
21
+ add_meta_box('wooCommerceGalleryMetaBox', 'Product Gallery from URL', 'fifu_wc_show_elements', $post_type, 'side', 'low');
22
+ } else if ($post_type)
23
+ add_meta_box('imageUrlMetaBox', 'Featured Image from URL', 'fifu_show_elements', $post_type, 'side', 'low');
24
+ }
25
+ }
26
+
27
+ function fifu_show_elements($post) {
28
+ $margin = 'margin-top:10px;';
29
+ $width = 'width:100%;';
30
+ $height = 'height:200px;';
31
+ $align = 'text-align:left;';
32
+ $show_news = 'display:inline';
33
+ $is_sirv_active = is_plugin_active('sirv/sirv.php');
34
+
35
+ $url = get_post_meta($post->ID, 'fifu_image_url', true);
36
+ $alt = get_post_meta($post->ID, 'fifu_image_alt', true);
37
+
38
+ if ($url) {
39
+ $show_button = $show_sirv = 'display:none;';
40
+ $show_alt = $show_image = $show_link = '';
41
+ } else {
42
+ $show_alt = $show_image = $show_link = 'display:none;';
43
+ $show_button = '';
44
+ $show_sirv = ($is_sirv_active ? '' : 'display:none;');
45
+ }
46
+
47
+ include 'html/meta-box.html';
48
+ }
49
+
50
+ function fifu_wc_show_elements($post) {
51
+ $margin = 'margin-top:1px;';
52
+ $width = 'width:70%;';
53
+ $height = 'height:200px;';
54
+ $align = 'text-align:left;';
55
+ $altWidth = 'width:86%;';
56
+
57
+ for ($i = 0; $i < 10; $i++) {
58
+ $url[$i] = get_post_meta($post->ID, 'fifu_image_url_' . $i, true);
59
+ $alt[$i] = get_post_meta($post->ID, 'fifu_image_alt_' . $i, true);
60
+
61
+ if ($url[$i]) {
62
+ $show_url[$i] = $show_button[$i] = 'display:none;';
63
+ $show_alt[$i] = $show_image[$i] = $show_link[$i] = '';
64
+ } else {
65
+ $show_alt[$i] = $show_image[$i] = $show_link[$i] = 'display:none;';
66
+ $show_url[$i] = $show_button[$i] = '';
67
+ }
68
+
69
+ include 'html/wc-meta-box.html';
70
+ }
71
+ }
72
+
73
+ add_filter('wp_insert_post_data', 'fifu_remove_first_image', 10, 2);
74
+
75
+ function fifu_remove_first_image($data, $postarr) {
76
+ $content = $postarr['post_content'];
77
+ if (!$content)
78
+ return $data;
79
+
80
+ $contentClean = fifu_show_all_images($content);
81
+ $data = str_replace($content, $contentClean, $data);
82
+
83
+ $img = fifu_first_img_in_content($contentClean);
84
+ if (!$img)
85
+ return $data;
86
+
87
+ if (get_option('fifu_pop_first') == 'toggleoff')
88
+ return str_replace($img, fifu_show_image($img), $data);
89
+
90
+ return str_replace($img, fifu_hide_image($img), $data);
91
+ }
92
+
93
+ add_action('save_post', 'fifu_save_properties');
94
+
95
+ function fifu_save_properties($post_id) {
96
+ /* image url */
97
+ if (isset($_POST['fifu_input_url'])) {
98
+ $url = esc_url($_POST['fifu_input_url']);
99
+ $first = fifu_first_url_in_content($post_id);
100
+ if ($first && get_option('fifu_get_first') == 'toggleon' && (!$url || get_option('fifu_ovw_first') == 'toggleon'))
101
+ $url = $first;
102
+ fifu_update_or_delete($post_id, 'fifu_image_url', $url);
103
+ }
104
+
105
+ /* alt */
106
+ if (isset($_POST['fifu_input_alt'])) {
107
+ $alt = wp_strip_all_tags($_POST['fifu_input_alt']);
108
+ fifu_update_or_delete($post_id, 'fifu_image_alt', $alt);
109
+ }
110
+
111
+ /* gallery */
112
+ if (get_post_type(get_the_ID()) == 'product') {
113
+ for ($i = 0; $i < 10; $i++) {
114
+ if (isset($_POST['fifu_input_url_' . $i]) && isset($_POST['fifu_input_alt_' . $i])) {
115
+ $url = esc_url($_POST['fifu_input_url_' . $i]);
116
+ $alt = wp_strip_all_tags($_POST['fifu_input_alt_' . $i]);
117
+ fifu_update_or_delete($post_id, 'fifu_image_url_' . $i, $url);
118
+ fifu_update_or_delete($post_id, 'fifu_image_alt_' . $i, $alt);
119
+ }
120
+ }
121
+ }
122
+ }
123
+
124
+ function fifu_update_or_delete($post_id, $field, $url) {
125
+ if ($url)
126
+ update_post_meta($post_id, $field, $url);
127
+ else
128
+ delete_post_meta($post_id, $field, $url);
129
+ }
trunk/featured-image-from-url.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * Plugin Name: Featured Image From URL
5
+ * 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.
6
+ * Version: 1.6.4
7
+ * Author: Marcel Jacques Machado
8
+ * Author URI: http://featuredimagefromurl.com/
9
+ */
10
+
11
+ define('FIFU_PLUGIN_DIR', plugin_dir_path(__FILE__));
12
+ define('FIFU_INCLUDES_DIR', FIFU_PLUGIN_DIR . '/includes');
13
+ define('FIFU_ADMIN_DIR', FIFU_PLUGIN_DIR . '/admin');
14
+
15
+ require_once( FIFU_INCLUDES_DIR . '/thumbnail.php' );
16
+ require_once( FIFU_INCLUDES_DIR . '/thumbnail-category.php' );
17
+ require_once( FIFU_INCLUDES_DIR . '/external-post.php' );
18
+
19
+ if (is_admin()) {
20
+ require_once( FIFU_ADMIN_DIR . '/meta-box.php' );
21
+ require_once( FIFU_ADMIN_DIR . '/menu.php' );
22
+ require_once( FIFU_ADMIN_DIR . '/column.php' );
23
+ require_once( FIFU_ADMIN_DIR . '/category.php' );
24
+ }
25
+
26
+ register_deactivation_hook(__FILE__, 'fifu_deactivate');
27
+
28
+ function fifu_deactivate() {
29
+ update_option('fifu_woocommerce', 'toggleoff');
30
+ shell_exec('sh ../wp-content/plugins/featured-image-from-url/scripts/disableWoocommerce.sh');
31
+ }
trunk/includes/external-post.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_filter('wp_insert_post_data', 'fifu_remove_first_image_ext', 10, 2);
4
+
5
+ function fifu_remove_first_image_ext($data, $postarr) {
6
+ if (isset($_POST['fifu_input_url']))
7
+ return $data;
8
+
9
+ $content = $postarr['post_content'];
10
+ if (!$content)
11
+ return $data;
12
+
13
+ $contentClean = fifu_show_all_images($content);
14
+ $data = str_replace($content, $contentClean, $data);
15
+
16
+ $img = fifu_first_img_in_content($contentClean);
17
+ if (!$img)
18
+ return $data;
19
+
20
+ if (get_option('fifu_pop_first') == 'toggleoff')
21
+ return str_replace($img, fifu_show_image($img), $data);
22
+
23
+ return str_replace($img, fifu_hide_image($img), $data);
24
+ }
25
+
26
+ add_action('save_post', 'fifu_save_properties_ext');
27
+
28
+ function fifu_save_properties_ext($post_id) {
29
+ if (isset($_POST['fifu_input_url']))
30
+ return;
31
+
32
+ $url = fifu_first_url_in_content($post_id);
33
+
34
+ if ($url && get_option('fifu_get_first') == 'toggleon')
35
+ update_post_meta($post_id, 'fifu_image_url', $url);
36
+ }
37
+
38
+ function fifu_first_img_in_content($content) {
39
+ $matches = array();
40
+ preg_match_all('/<img[^>]*>/', $content, $matches);
41
+ return $matches && $matches[0] ? $matches[0][0] : null;
42
+ }
43
+
44
+ function fifu_show_all_images($content) {
45
+ $matches = array();
46
+ preg_match_all('/<img[^>]*display:[ ]*none[^>]*>/', $content, $matches);
47
+ foreach ($matches[0] as $img) {
48
+ $content = str_replace($img, fifu_show_image($img), $content);
49
+ }
50
+ return $content;
51
+ }
52
+
53
+ function fifu_hide_image($img) {
54
+ if (strpos($img, 'style=\"') !== false)
55
+ return preg_replace('/style=..[^"]*["]/', 'style=\"display:none\"', $img);
56
+ return str_replace('/>', 'style=\"display:none\"/>', $img);
57
+ }
58
+
59
+ function fifu_show_image($img) {
60
+ return preg_replace('/style=..display:[ ]*none../', '', $img);
61
+ }
62
+
63
+ function fifu_first_url_in_content($post_id) {
64
+ $content = get_post_field('post_content', $post_id);
65
+ if (!$content)
66
+ return;
67
+ $matches = array();
68
+ preg_match_all('/<img[^>]*>/', $content, $matches);
69
+ if (!$matches[0])
70
+ return;
71
+ $aux1 = explode('src="', $matches[0][0]);
72
+ $aux2 = explode('"', $aux1[1]);
73
+ return $matches && $matches[0] ? $aux2[0] : null;
74
+ }
trunk/includes/html/js/jquery.lazyloadxt.extra.js ADDED
@@ -0,0 +1,343 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! Lazy Load XT v1.1.0 2016-01-12
2
+ * http://ressio.github.io/lazy-load-xt
3
+ * (C) 2016 RESS.io
4
+ * Licensed under MIT */
5
+
6
+ (function ($, window, document, undefined) {
7
+ // options
8
+ var lazyLoadXT = 'lazyLoadXT',
9
+ dataLazied = 'lazied',
10
+ load_error = 'load error',
11
+ classLazyHidden = 'lazy-hidden',
12
+ docElement = document.documentElement || document.body,
13
+ // force load all images in Opera Mini and some mobile browsers without scroll event or getBoundingClientRect()
14
+ forceLoad = (window.onscroll === undefined || !!window.operamini || !docElement.getBoundingClientRect),
15
+ options = {
16
+ autoInit: true, // auto initialize in $.ready
17
+ selector: 'img[data-src]', // selector for lazyloading elements
18
+ blankImage: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'.concat(Math.random().toString(36).substr(2)),
19
+ throttle: 99, // interval (ms) for changes check
20
+ forceLoad: forceLoad, // force auto load all images
21
+
22
+ //loadEvent: 'pageshow', // check AJAX-loaded content in jQueryMobile
23
+ updateEvent: 'load orientationchange resize scroll touchmove focus', // page-modified events
24
+ forceEvent: 'lazyloadall', // force loading of all elements
25
+
26
+ //onstart: null,
27
+ oninit: {removeClass: 'lazy'}, // init handler
28
+ onshow: {addClass: classLazyHidden}, // start loading handler
29
+ onload: {removeClass: classLazyHidden, addClass: 'lazy-loaded'}, // load success handler
30
+ onerror: {removeClass: classLazyHidden}, // error handler
31
+ //oncomplete: null, // complete handler
32
+
33
+ //scrollContainer: undefined,
34
+ checkDuplicates: true
35
+ },
36
+ elementOptions = {
37
+ srcAttr: 'data-src',
38
+ edgeX: 0,
39
+ edgeY: 512,
40
+ visibleOnly: true
41
+ },
42
+ $window = $(window),
43
+ $isFunction = $.isFunction,
44
+ $extend = $.extend,
45
+ $data = $.data || function (el, name) {
46
+ return $(el).data(name);
47
+ },
48
+ elements = [],
49
+ topLazy = 0,
50
+ /*
51
+ waitingMode=0 : no setTimeout
52
+ waitingMode=1 : setTimeout, no deferred events
53
+ waitingMode=2 : setTimeout, deferred events
54
+ */
55
+ waitingMode = 0;
56
+
57
+ $[lazyLoadXT] = $extend(options, elementOptions, $[lazyLoadXT]);
58
+
59
+ /**
60
+ * Return options.prop if obj.prop is undefined, otherwise return obj.prop
61
+ * @param {*} obj
62
+ * @param {*} prop
63
+ * @returns *
64
+ */
65
+ function getOrDef(obj, prop) {
66
+ return obj[prop] === undefined ? options[prop] : obj[prop];
67
+ }
68
+
69
+ /**
70
+ * @returns {number}
71
+ */
72
+ function scrollTop() {
73
+ var scroll = window.pageYOffset;
74
+ return (scroll === undefined) ? docElement.scrollTop : scroll;
75
+ }
76
+
77
+ /**
78
+ * Add new elements to lazy-load list:
79
+ * $(elements).lazyLoadXT() or $(window).lazyLoadXT()
80
+ *
81
+ * @param {object} [overrides] override global options
82
+ */
83
+ $.fn[lazyLoadXT] = function (overrides) {
84
+ overrides = overrides || {};
85
+
86
+ var blankImage = getOrDef(overrides, 'blankImage'),
87
+ checkDuplicates = getOrDef(overrides, 'checkDuplicates'),
88
+ scrollContainer = getOrDef(overrides, 'scrollContainer'),
89
+ forceShow = getOrDef(overrides, 'show'),
90
+ elementOptionsOverrides = {},
91
+ prop;
92
+
93
+ // empty overrides.scrollContainer is supported by both jQuery and Zepto
94
+ $(scrollContainer).on('scroll', queueCheckLazyElements);
95
+
96
+ for (prop in elementOptions) {
97
+ elementOptionsOverrides[prop] = getOrDef(overrides, prop);
98
+ }
99
+
100
+ return this.each(function (index, el) {
101
+ if (el === window) {
102
+ $(options.selector).lazyLoadXT(overrides);
103
+ } else {
104
+ var duplicate = checkDuplicates && $data(el, dataLazied),
105
+ $el = $(el).data(dataLazied, forceShow ? -1 : 1);
106
+
107
+ // prevent duplicates
108
+ if (duplicate) {
109
+ queueCheckLazyElements();
110
+ return;
111
+ }
112
+
113
+ if (blankImage && el.tagName === 'IMG' && !el.src) {
114
+ el.src = blankImage;
115
+ }
116
+
117
+ // clone elementOptionsOverrides object
118
+ $el[lazyLoadXT] = $extend({}, elementOptionsOverrides);
119
+
120
+ triggerEvent('init', $el);
121
+
122
+ elements.push($el);
123
+ queueCheckLazyElements();
124
+ }
125
+ });
126
+ };
127
+
128
+
129
+ /**
130
+ * Process function/object event handler
131
+ * @param {string} event suffix
132
+ * @param {jQuery} $el
133
+ */
134
+ function triggerEvent(event, $el) {
135
+ var handler = options['on' + event];
136
+ if (handler) {
137
+ if ($isFunction(handler)) {
138
+ handler.call($el[0]);
139
+ } else {
140
+ if (handler.addClass) {
141
+ $el.addClass(handler.addClass);
142
+ }
143
+ if (handler.removeClass) {
144
+ $el.removeClass(handler.removeClass);
145
+ }
146
+ }
147
+ }
148
+
149
+ $el.trigger('lazy' + event, [$el]);
150
+
151
+ // queue next check as images may be resized after loading of actual file
152
+ queueCheckLazyElements();
153
+ }
154
+
155
+
156
+ /**
157
+ * Trigger onload/onerror handler
158
+ * @param {Event} e
159
+ */
160
+ function triggerLoadOrError(e) {
161
+ triggerEvent(e.type, $(this).off(load_error, triggerLoadOrError));
162
+ }
163
+
164
+
165
+ /**
166
+ * Load visible elements
167
+ * @param {bool} [force] loading of all elements
168
+ */
169
+ function checkLazyElements(force) {
170
+ if (!elements.length) {
171
+ return;
172
+ }
173
+
174
+ force = force || options.forceLoad;
175
+
176
+ topLazy = Infinity;
177
+
178
+ var viewportTop = scrollTop(),
179
+ viewportHeight = window.innerHeight || docElement.clientHeight,
180
+ viewportWidth = window.innerWidth || docElement.clientWidth,
181
+ i,
182
+ length;
183
+
184
+ for (i = 0, length = elements.length; i < length; i++) {
185
+ var $el = elements[i],
186
+ el = $el[0],
187
+ objData = $el[lazyLoadXT],
188
+ removeNode = false,
189
+ visible = force || $data(el, dataLazied) < 0,
190
+ topEdge;
191
+
192
+ // remove items that are not in DOM
193
+ if (!$.contains(docElement, el)) {
194
+ removeNode = true;
195
+ } else if (force || !objData.visibleOnly || el.offsetWidth || el.offsetHeight) {
196
+
197
+ if (!visible) {
198
+ var elPos = el.getBoundingClientRect(),
199
+ edgeX = objData.edgeX,
200
+ edgeY = objData.edgeY;
201
+
202
+ topEdge = (elPos.top + viewportTop - edgeY) - viewportHeight;
203
+
204
+ visible = (topEdge <= viewportTop && elPos.bottom > -edgeY &&
205
+ elPos.left <= viewportWidth + edgeX && elPos.right > -edgeX);
206
+ }
207
+
208
+ if (visible) {
209
+ $el.on(load_error, triggerLoadOrError);
210
+
211
+ triggerEvent('show', $el);
212
+
213
+ var srcAttr = objData.srcAttr,
214
+ src = $isFunction(srcAttr) ? srcAttr($el) : el.getAttribute(srcAttr);
215
+
216
+ if (src) {
217
+ el.src = src;
218
+ }
219
+
220
+ removeNode = true;
221
+ } else {
222
+ if (topEdge < topLazy) {
223
+ topLazy = topEdge;
224
+ }
225
+ }
226
+ }
227
+
228
+ if (removeNode) {
229
+ $data(el, dataLazied, 0);
230
+ elements.splice(i--, 1);
231
+ length--;
232
+ }
233
+ }
234
+
235
+ if (!length) {
236
+ triggerEvent('complete', $(docElement));
237
+ }
238
+ }
239
+
240
+
241
+ /**
242
+ * Run check of lazy elements after timeout
243
+ */
244
+ function timeoutLazyElements() {
245
+ if (waitingMode > 1) {
246
+ waitingMode = 1;
247
+ checkLazyElements();
248
+ setTimeout(timeoutLazyElements, options.throttle);
249
+ } else {
250
+ waitingMode = 0;
251
+ }
252
+ }
253
+
254
+
255
+ /**
256
+ * Queue check of lazy elements because of event e
257
+ * @param {Event} [e]
258
+ */
259
+ function queueCheckLazyElements(e) {
260
+ if (!elements.length) {
261
+ return;
262
+ }
263
+
264
+ // fast check for scroll event without new visible elements
265
+ if (e && e.type === 'scroll' && e.currentTarget === window) {
266
+ if (topLazy >= scrollTop()) {
267
+ return;
268
+ }
269
+ }
270
+
271
+ if (!waitingMode) {
272
+ setTimeout(timeoutLazyElements, 0);
273
+ }
274
+ waitingMode = 2;
275
+ }
276
+
277
+
278
+ /**
279
+ * Initialize list of hidden elements
280
+ */
281
+ function initLazyElements() {
282
+ $window.lazyLoadXT();
283
+ }
284
+
285
+
286
+ /**
287
+ * Loading of all elements
288
+ */
289
+ function forceLoadAll() {
290
+ checkLazyElements(true);
291
+ }
292
+
293
+
294
+ /**
295
+ * Initialization
296
+ */
297
+ $(document).ready(function () {
298
+ triggerEvent('start', $window);
299
+
300
+ $window
301
+ .on(options.updateEvent, queueCheckLazyElements)
302
+ .on(options.forceEvent, forceLoadAll);
303
+
304
+ $(document).on(options.updateEvent, queueCheckLazyElements);
305
+
306
+ if (options.autoInit) {
307
+ $window.on(options.loadEvent, initLazyElements);
308
+ initLazyElements(); // standard initialization
309
+ }
310
+ });
311
+
312
+ })(window.jQuery || window.Zepto || window.$, window, document);
313
+
314
+
315
+ (function ($) {
316
+ var options = $.lazyLoadXT;
317
+
318
+ options.selector += ',video,iframe[data-src]';
319
+ options.videoPoster = 'data-poster';
320
+
321
+ $(document).on('lazyshow', 'video', function (e, $el) {
322
+ var srcAttr = $el.lazyLoadXT.srcAttr,
323
+ isFuncSrcAttr = $.isFunction(srcAttr),
324
+ changed = false;
325
+
326
+ $el.attr('poster', $el.attr(options.videoPoster));
327
+ $el.children('source,track')
328
+ .each(function (index, el) {
329
+ var $child = $(el),
330
+ src = isFuncSrcAttr ? srcAttr($child) : $child.attr(srcAttr);
331
+ if (src) {
332
+ $child.attr('src', src);
333
+ changed = true;
334
+ }
335
+ });
336
+
337
+ // reload video
338
+ if (changed) {
339
+ this.load();
340
+ }
341
+ });
342
+
343
+ })(window.jQuery || window.Zepto || window.$);
trunk/includes/html/script.html ADDED
@@ -0,0 +1 @@
 
1
+ <script><?php include 'js/jquery.lazyloadxt.extra.js' ?></script>
trunk/includes/html/sirv.html ADDED
@@ -0,0 +1 @@
 
1
+ <script src="https://scripts.sirv.com/sirv.js"></script>
trunk/includes/html/social.html ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <meta property="og:title" content="<?php echo $title ?>" />
2
+ <meta property="og:description" content="<?php echo $description ?>" />
3
+ <meta property="og:image" content="<?php echo $url ?>" />
4
+
5
+ <meta name="twitter:card" content="summary_large_image" />
6
+ <meta name="twitter:title" content="<?php echo $title ?>" />
7
+ <meta name="twitter:description" content="<?php echo $description ?>" />
8
+ <meta name="twitter:image" content="<?php echo $url ?>" />
trunk/includes/thumbnail-category.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_filter('woocommerce_before_main_content', 'fifu_cat_show_image', 30);
4
+
5
+ function fifu_cat_show_image() {
6
+ $url = fifu_cat_get_url();
7
+ $alt = fifu_cat_get_alt();
8
+
9
+ if ($url)
10
+ echo fifu_get_html($url, $alt);
11
+ }
12
+
13
+ add_filter('wp_head', 'fifu_cat_add_social_tags');
14
+
15
+ function fifu_cat_add_social_tags() {
16
+ $url = fifu_cat_get_url();
17
+ $title = single_cat_title('', false);
18
+
19
+ $term_id = fifu_cat_get_term_id();
20
+ if ($term_id)
21
+ $description = wp_strip_all_tags(category_description($term_id));
22
+
23
+ if ($url && get_option('fifu_social') == 'toggleon')
24
+ include 'html/social.html';
25
+ }
26
+
27
+ function fifu_cat_get_url() {
28
+ $term_id = fifu_cat_get_term_id();
29
+ return get_term_meta($term_id, 'fifu_image_url', true);
30
+ }
31
+
32
+ function fifu_cat_get_alt() {
33
+ $term_id = fifu_cat_get_term_id();
34
+ return get_term_meta($term_id, 'fifu_image_alt', true);
35
+ }
36
+
37
+ function fifu_cat_get_term_id() {
38
+ global $wp_query;
39
+ return $wp_query->get_queried_object_id();
40
+ }
41
+
trunk/includes/thumbnail.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
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
+
7
+ function fifu_add_js() {
8
+ include 'html/script.html';
9
+ }
10
+
11
+ function fifu_add_social_tags() {
12
+ $post_id = get_the_ID();
13
+ $url = get_post_meta($post_id, 'fifu_image_url', true);
14
+ $title = get_the_title($post_id);
15
+ $description = wp_strip_all_tags(get_post_field('post_content', $post_id));
16
+
17
+ if ($url && get_option('fifu_social') == 'toggleon')
18
+ include 'html/social.html';
19
+ }
20
+
21
+ function fifu_add_sirv_js() {
22
+ include_once(ABSPATH . 'wp-admin/includes/plugin.php');
23
+ if (is_plugin_active('sirv/sirv.php')) {
24
+ include 'html/sirv.html';
25
+ }
26
+ }
27
+
28
+ add_action('the_post', 'fifu_choose');
29
+
30
+ function fifu_choose($post) {
31
+ $post_id = $post->ID;
32
+
33
+ $image_url = get_post_meta($post_id, 'fifu_image_url', true);
34
+
35
+ $featured_image = get_post_meta($post_id, '_thumbnail_id', true);
36
+
37
+ if ($image_url) {
38
+ if (!$featured_image)
39
+ update_post_meta($post_id, '_thumbnail_id', -1);
40
+ }
41
+ else {
42
+ if ($featured_image == -1)
43
+ delete_post_meta($post_id, '_thumbnail_id');
44
+ }
45
+ }
46
+
47
+ add_filter('post_thumbnail_html', 'fifu_replace', 10, 2);
48
+
49
+ function fifu_replace($html, $post_id) {
50
+ $url = get_post_meta($post_id, 'fifu_image_url', true);
51
+ $alt = get_post_meta($post_id, 'fifu_image_alt', true);
52
+
53
+ return empty($url) ? $html : fifu_get_html($url, $alt);
54
+ }
55
+
56
+ function is_ajax_call() {
57
+ return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') || wp_doing_ajax();
58
+ }
59
+
60
+ function fifu_get_html($url, $alt) {
61
+ include_once(ABSPATH . 'wp-admin/includes/plugin.php');
62
+ if (is_plugin_active('sirv/sirv.php') && strpos($url, "sirv.com") !== false)
63
+ return sprintf('<!-- Featured Image From URL plugin --> <img class="Sirv" data-src="%s">', $url);
64
+
65
+ return sprintf('<!-- Featured Image From URL plugin --> <img %s alt="%s" style="%s">', fifu_lazy_url($url), $alt, fifu_should_hide() ? 'display:none' : '');
66
+ }
67
+
68
+ add_filter('the_content', 'fifu_add_to_content');
69
+
70
+ function fifu_add_to_content($content) {
71
+ if (is_singular() && has_post_thumbnail() && get_option('fifu_content') == 'toggleon')
72
+ return get_the_post_thumbnail() . $content;
73
+ else
74
+ return $content;
75
+ }
76
+
77
+ add_filter('wp_get_attachment_url', 'fifu_replace_attachment_url', 10, 2);
78
+
79
+ function fifu_replace_attachment_url($att_url, $att_id) {
80
+ if ($att_id == get_post_thumbnail_id(get_the_ID())) {
81
+ $url = get_post_meta(get_the_ID(), 'fifu_image_url', true);
82
+ if ($url)
83
+ $att_url = $url;
84
+ }
85
+ return $att_url;
86
+ }
87
+
88
+ add_filter('wp_get_attachment_image_src', 'fifu_replace_attachment_image_src', 10, 2);
89
+
90
+ function fifu_replace_attachment_image_src($image, $att_id) {
91
+ if ($att_id == get_post_thumbnail_id(get_the_ID())) {
92
+ $url = get_post_meta(get_the_ID(), 'fifu_image_url', true);
93
+ if ($url) {
94
+ return array(
95
+ $url,
96
+ 0,
97
+ 0,
98
+ false
99
+ );
100
+ }
101
+ }
102
+ return $image;
103
+ }
104
+
105
+ function fifu_should_hide() {
106
+ return ((is_singular('post') && get_option('fifu_hide_post') == 'toggleon') || (is_singular('page') && get_option('fifu_hide_page') == 'toggleon'));
107
+ }
108
+
109
+ add_filter('genesis_get_image', 'fifu_genesis_image', 10, 4);
110
+
111
+ function fifu_genesis_image($args, $var1, $var2, $src) {
112
+ return $src ? fifu_replace($args, get_the_ID()) : $args;
113
+ }
114
+
115
+ function fifu_lazy_url($url) {
116
+ if (get_option('fifu_lazy') != 'toggleon' || is_ajax_call())
117
+ return 'src="' . $url . "'";
118
+ return (is_home() || (class_exists('WooCommerce') && is_shop()) ? 'data-src="' : 'src="') . $url . '"';
119
+ }
trunk/readme.txt ADDED
@@ -0,0 +1,444 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Plugin Name ===
2
+ Contributors: marceljm
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8BLDLZ3HDBGQG
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, sirv, 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
5
+ Requires at least: 4.0
6
+ Tested up to: 4.8
7
+ Stable tag: 4.8
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ Use an external image as Featured Image of your post/page/product (WooCommerce). Includes Auto Set (External Post), Product Gallery, Social Tags and more.
12
+
13
+ == Description ==
14
+
15
+ Features:
16
+
17
+ * Featured Image from URL plugin allows you to use an external image as Featured Image of your post, page and Custom Post Type, such as WooCommerce Product;
18
+
19
+ * perfect for external posts, the plugin is able to use the first image as Featured Image;
20
+
21
+ * when you access the table of posts/pages/products/categories in admin menu, the Featured Images are shown in a new column;
22
+
23
+ * if your theme doesn't show Featured Image on posts/pages/products, it's possible to include that at the beginning of the content automatically;
24
+
25
+ * but if your theme show the Featured Images on posts/pages/products, there is an option to remove the Featured Image;
26
+
27
+ * with lazy load feature the images/videos won't be loaded until user scrolls to them making the home/shop page load faster;
28
+
29
+ * all included content still has social tags to facilitate sharing on social networks;
30
+
31
+ * compatible with WP All Import plugin;
32
+
33
+ * supports WP REST API (**premium feature**);
34
+
35
+ * all features created for external images are available for external videos from YouTube and Vimeo. And you can define the video size for each screen type (**premium feature**);
36
+
37
+ * you can use a slider of images as featured image (**premium feature**);
38
+
39
+ * it's also possible to use external images in the WooCommerce Product Gallery and WooCommerce Product Category (**premium feature**);
40
+
41
+ * you can use external thumbnails from Flickr to make your site until 94% faster (**premium feature**);
42
+
43
+ * you can apply your own CSS style or 18 hover effects to the images (**premium feature**);
44
+
45
+ * you can enable/disable the WooCommerce lightbox (**premium feature**);
46
+
47
+ **<a href="http://featuredimagefromurl.com/">Official Site</a>**
48
+ **<a href="http://blog.featuredimagefromurl.com/">Live Preview (Blog)</a>**
49
+ **<a href="http://shop.featuredimagefromurl.com/">Live Preview (Shop)</a>**
50
+
51
+ == Installation ==
52
+
53
+ 1. Install automatically or by uploading the ZIP file.
54
+ 1. Activate the plugin through the 'Plugins' menu in WordPress.
55
+ 1. The plugin settings will be in the left column, between 'Appearance' and 'Collapse menu' icons.
56
+ 1. And a new box will be shown immediately below or above the traditional "Featured Image" box, in the page/post/product editor.
57
+
58
+ == Frequently Asked Questions ==
59
+
60
+ = Where are the "Featured Image from URL" box? =
61
+
62
+ * It will be immediately below or above the traditional "Featured Image" box, in the page/post/product editor.
63
+
64
+ = What's the URL field? =
65
+
66
+ * There you should paste the image URL. For example: https://farm4.staticflickr.com/3761/9944251684_e16fd019c0_b.jpg
67
+
68
+ = What's the preview button? =
69
+
70
+ * This button will show you a preview of the external image.
71
+
72
+ = Why don't I see the image preview? =
73
+
74
+ * Because your URL is invalid.
75
+
76
+ = What's the "alt attribute" field? =
77
+
78
+ * There you can write a short description of the image. It is only for SEO reasons.
79
+
80
+ = What's the "Remove external featured image" link? =
81
+
82
+ * It's used to remove the external image.
83
+
84
+ = What happens if I have two featured images (internal and external)? =
85
+
86
+ * The external image has priority in this case and the internal image won't be shown.
87
+
88
+ = Which WooCommerce versions are supported by Featured Image from URL?
89
+
90
+ * 3.0.X and later.
91
+
92
+ = When accessing "All Pages", "All Posts", "Products" or "Product Categories" in admin menu, how can I enable or disable "FIFU" column? =
93
+
94
+ * Just click on "Screen Options", and check or uncheck "FIFU".
95
+
96
+ = How to show the Featured Image (internal or external) at the beginning of the content of a Post, Page or Product? =
97
+
98
+ * There is a toggle (on/off) in Featured Image from URL settings. This functionality was added to attend some themes that didn't show the Featured Image before the content of Posts, Pages or Products.
99
+
100
+ = How to use Featured Image from URL with my Custom Post Types? =
101
+
102
+ * There are some text fields in Featured Image from URL settings. For now you can define there until 5 Custom Post Types. Just type the correct names and click on Submit button.
103
+
104
+ == Screenshots ==
105
+
106
+ 1. Just fill the URL field with the image address and click on preview button.
107
+
108
+ 2. If the URL is correct, the image will be shown.
109
+
110
+ 3. Premium feature: featured video from URL.
111
+
112
+ 4. Premium feature: featured slider from URL.
113
+
114
+ 5. Featured image column.
115
+
116
+ 6. External featured media on home.
117
+
118
+ 7. External featured image on post (it could be a page or a custom post type).
119
+
120
+ 8. Premium feature: featured video from URL.
121
+
122
+ 9. Premium feature: featured slider from URL.
123
+
124
+ 10. A lot of settings to adapt the plugin to your needs.
125
+
126
+ 11. Premium feature: image gallery from URL.
127
+
128
+ 12. Premium feature: video gallery from URL.
129
+
130
+ 13. External featured media on WooCommerce shop.
131
+
132
+ 14. External featured media on cart.
133
+
134
+ 15. Premium feature: image gallery from URL.
135
+
136
+ 16. External featured image on Lightbox.
137
+
138
+ 17. Lightbox zoom.
139
+
140
+ 18. Premium feature: video gallery from URL.
141
+
142
+ 19. Premium feature: external featured video on Lightbox.
143
+
144
+ 20. Lightbox zoom.
145
+
146
+ == Changelog ==
147
+
148
+ = 1.0 =
149
+ * It's the first and only version so far.
150
+
151
+ = 1.0.1 =
152
+ * The help link in admin menu was wrong. It's fixed now.
153
+
154
+ = 1.0.2 =
155
+ * Now it's possible to use an external image as Featured Image of your WooCommerce products.
156
+
157
+ = 1.1 =
158
+ * Now it's possible to use external images in the WooCommerce Product Gallery (since your site is hosted on a Linux server).
159
+
160
+ = 1.1.1 =
161
+ * Now, when you access "All Posts", "All Pages" or "Products" in admin menu, the Featured Images (internal or external) are shown in a new column.
162
+
163
+ = 1.1.2 =
164
+ * Menu toggles weren't been shown on Firefox. Fixed!
165
+
166
+ = 1.1.3 =
167
+ * If your theme don't show Featured Image (internal or external) in Posts, Pages or Products, now it's possible to include that at the beginning of the content automatically.
168
+
169
+ = 1.1.4 =
170
+ * Now it's possible to use external images as Featured Images of your Custom Post Types. On the menu settings, you can define for now until 5 Custom Post Types.
171
+
172
+ = 1.1.5 =
173
+ * Now it's possible to use an external image as Featured Image of your WooCommerce Product Category. Then an "External Featured Image" box will be shown when you create/edit a Product Category. Depending on your theme, you must enable "WooCommerce Full Integration" on Featured Image from URL settings.
174
+
175
+ = 1.2 =
176
+ * It was included a Featured Image column in Product Categories. Moreover, it was fixed a problem with a toggle (Featured Image in Content) that didn't appear in Firefox. And another toggle, for backlink,
177
+ was removed. To finish, a Premium version is now been presented.
178
+
179
+ = 1.2.1 =
180
+ * Readme fixed.
181
+
182
+ = 1.2.2 =
183
+ * Bug fixed.
184
+
185
+ = 1.2.3 =
186
+ * Bug fixed in WooCommerce Product Category.
187
+
188
+ = 1.2.4 =
189
+ * It's possible to hide the plugin meta boxes now.
190
+
191
+ = 1.2.5 =
192
+ * All the "PHP Notices" shown on "debug.log" file were resolved. So the log will be completely clean.
193
+
194
+ = 1.3 =
195
+ * The plugin should be compatible with any theme now.
196
+
197
+ = 1.3.1 =
198
+ * Bug fixes.
199
+
200
+ = 1.3.2 =
201
+ * Bug fixes.
202
+
203
+ = 1.3.3 =
204
+ * Bug fixes.
205
+
206
+ = 1.3.4 =
207
+ * Bug fixes.
208
+
209
+ = 1.3.5 =
210
+ * Bug fixes.
211
+
212
+ = 1.3.6 =
213
+ * Bug fixes and hover effect presentation.
214
+
215
+ = 1.3.7 =
216
+ * Links and contact info updated.
217
+
218
+ = 1.3.8 =
219
+ * WooCommerce compatibility notice and showcase links.
220
+
221
+ = 1.3.9 =
222
+ * The last toggle wasn't shown in Firefox. Fixed.
223
+
224
+ = 1.4.0 =
225
+ * Compatibility with Sirv CDN & Image Manager plugin.
226
+
227
+ = 1.4.2 =
228
+ * CSS style.
229
+
230
+ = 1.4.3 =
231
+ * Full integration with Sirv plugin.
232
+
233
+ = 1.4.4 =
234
+ * Bug fixes.
235
+
236
+ = 1.4.5 =
237
+ * Add External Featured Image Slider.
238
+
239
+ = 1.4.6 =
240
+ * Bug fixes.
241
+
242
+ = 1.4.7 =
243
+ * Flickr integration advertisement.
244
+
245
+ = 1.4.8 =
246
+ * Bug fix.
247
+
248
+ = 1.4.9 =
249
+ * Add information about theme compatibility.
250
+
251
+ = 1.5.0 =
252
+ * Social tags toggle.
253
+
254
+ = 1.5.1 =
255
+ * Genesis Framework integration, external JS minification and WooCommerce 3 note.
256
+
257
+ = 1.5.2 =
258
+ * Hide external featured media.
259
+
260
+ = 1.5.3 =
261
+ * Auto set featured image.
262
+
263
+ = 1.5.4 =
264
+ * Bug fix: compatibility with old PHP versions.
265
+
266
+ = 1.5.5 =
267
+ * URL field isn't hidden anymore.
268
+
269
+ = 1.5.6 =
270
+ * Compatible with any theme now.
271
+
272
+ = 1.5.7 =
273
+ * Resize featured image column.
274
+
275
+ = 1.5.8 =
276
+ * FAQ update.
277
+
278
+ = 1.5.9 =
279
+ * New support email.
280
+
281
+ = 1.6.0 =
282
+ * WP REST API.
283
+
284
+ = 1.6.1 =
285
+ * Bug fix.
286
+
287
+ = 1.6.2 =
288
+ * Bug fix.
289
+
290
+ = 1.6.3 =
291
+ * Lazy load.
292
+
293
+ = 1.6.4 =
294
+ * Bug fix.
295
+
296
+ == Upgrade Notice ==
297
+
298
+ = 1.0 =
299
+ * No upgraded yet.
300
+
301
+ = 1.0.1 =
302
+ * The help link in admin menu was wrong. It's fixed now.
303
+
304
+ = 1.0.2 =
305
+ * Now it's possible to use an external image as Featured Image of your WooCommerce products.
306
+
307
+ = 1.1 =
308
+ * Now it's possible to use until 10 external images in the WooCommerce Product Gallery (since your site is hosted on a Linux server). Go to Featured Image from URL settings to enable that.
309
+
310
+ = 1.1.1 =
311
+ * Now, when you access "All Posts", "All Pages" or "Products" in admin menu, the Featured Images (internal or external) are shown in a new column. Moreover, now it's possible to use until 10 external images in the WooCommerce Product Gallery (since your site is hosted on a Linux server). Go to Featured Image from URL settings to enable that.
312
+
313
+ = 1.1.2 =
314
+ * Menu toggles weren't been shown on Firefox. Fixed!
315
+
316
+ = 1.1.3 =
317
+ * If your theme don't show Featured Image (internal or external) in Posts, Pages or Products, now it's possible to include that at the beginning of the content automatically.
318
+
319
+ = 1.1.4 =
320
+ * Now it's possible to use external images as Featured Images of your Custom Post Types. On the menu settings, you can define for now until 5 Custom Post Types.
321
+
322
+ = 1.1.5 =
323
+ * Now it's possible to use an external image as Featured Image of your WooCommerce Product Category. Then an "External Featured Image" box will be shown when you create/edit a Product Category. Depending on your theme, you must enable "WooCommerce Full Integration" on Featured Image from URL settings.
324
+
325
+ = 1.2 =
326
+ * It was included a Featured Image column in Product Categories. Moreover, it was fixed a problem with a toggle (Featured Image in Content) that didn't appear in Firefox. And another toggle, for backlink,
327
+ was removed. To finish, a Premium version is now been presented.
328
+
329
+ = 1.2.1 =
330
+ * Readme fixed.
331
+
332
+ = 1.2.2 =
333
+ * Bug fixed.
334
+
335
+ = 1.2.3 =
336
+ * Bug fixed in WooCommerce Product Category.
337
+
338
+ = 1.2.4 =
339
+ * It's possible to hide the plugin meta boxes now.
340
+
341
+ = 1.2.5 =
342
+ * All the "PHP Notices" shown on "debug.log" file were resolved. So the log will be completely clean.
343
+
344
+ = 1.3 =
345
+ * The plugin should be compatible with any theme now.
346
+
347
+ = 1.3.1 =
348
+ * Bug fixes.
349
+
350
+ = 1.3.2 =
351
+ * Bug fixes.
352
+
353
+ = 1.3.3 =
354
+ * Bug fixes.
355
+
356
+ = 1.3.4 =
357
+ * Bug fixes.
358
+
359
+ = 1.3.5 =
360
+ * Bug fixes.
361
+
362
+ = 1.3.6 =
363
+ * Bug fixes and hover effect presentation.
364
+
365
+ = 1.3.7 =
366
+ * Links and contact info updated.
367
+
368
+ = 1.3.8 =
369
+ * WooCommerce compatibility notice and showcase links.
370
+
371
+ = 1.3.9 =
372
+ * The last toggle wasn't shown in Firefox. Fixed.
373
+
374
+ = 1.4.0 =
375
+ * Compatibility with Sirv CDN & Image Manager plugin.
376
+
377
+ = 1.4.2 =
378
+ * CSS style.
379
+
380
+ = 1.4.3 =
381
+ * Full integration with Sirv plugin.
382
+
383
+ = 1.4.4 =
384
+ * Bug fixes.
385
+
386
+ = 1.4.5 =
387
+ * Add External Featured Image Slider.
388
+
389
+ = 1.4.6 =
390
+ * Bug fixes.
391
+
392
+ = 1.4.7 =
393
+ * Flickr integration advertisement.
394
+
395
+ = 1.4.8 =
396
+ * Bug fix.
397
+
398
+ = 1.4.9 =
399
+ * Add information about theme compatibility.
400
+
401
+ = 1.5.0 =
402
+ * Social tags toggle.
403
+
404
+ = 1.5.1 =
405
+ * Genesis Framework integration, external JS minification and WooCommerce 3 note.
406
+
407
+ = 1.5.2 =
408
+ * Hide external featured media.
409
+
410
+ = 1.5.3 =
411
+ * Auto set featured image.
412
+
413
+ = 1.5.4 =
414
+ * Bug fix: compatibility with old PHP versions.
415
+
416
+ = 1.5.5 =
417
+ * URL field isn't hidden anymore.
418
+
419
+ = 1.5.6 =
420
+ * Compatible with any theme now.
421
+
422
+ = 1.5.7 =
423
+ * Resize featured image column.
424
+
425
+ = 1.5.8 =
426
+ * FAQ update.
427
+
428
+ = 1.5.9 =
429
+ * New support email.
430
+
431
+ = 1.6.0 =
432
+ * WP REST API.
433
+
434
+ = 1.6.1 =
435
+ * Bug fix.
436
+
437
+ = 1.6.2 =
438
+ * Bug fix.
439
+
440
+ = 1.6.3 =
441
+ * Lazy load.
442
+
443
+ = 1.6.4 =
444
+ * Bug fix.
trunk/scripts/disableWoocommerce.sh ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ dir='../wp-content/plugins/woocommerce/templates/single-product/'
4
+ themeDir=`cat ../wp-content/plugins/featured-image-from-url/scripts/tmp.txt`
5
+
6
+ restoreProductImage()
7
+ {
8
+ file=$1
9
+ overwrite
10
+ }
11
+
12
+ restoreProductThumbnails()
13
+ {
14
+ file=$1
15
+ overwrite
16
+ }
17
+
18
+ restoreCategory()
19
+ {
20
+ file=$themeDir'/woocommerce.php'
21
+ overwrite
22
+ }
23
+
24
+ overwrite()
25
+ {
26
+ mv $file'.bkp' $file
27
+ }
28
+
29
+ restore()
30
+ {
31
+ restoreProductImage $dir'product-image.php'
32
+ restoreProductImage `find $themeDir . -iname product-thumbnails.php`
33
+ restoreProductThumbnails $dir'product-thumbnails.php'
34
+ restoreProductThumbnails `find $themeDir . -iname product-thumbnails.php`
35
+ restoreCategory
36
+ }
37
+
38
+ restore
trunk/scripts/enableWoocommerce.sh ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ dir='../wp-content/plugins/woocommerce/templates/single-product/'
4
+ themeDir=`cat ../wp-content/plugins/featured-image-from-url/scripts/tmp.txt`
5
+
6
+ featured_image()
7
+ {
8
+ file=$dir'product-image.php'
9
+ old='$image_link.*wp_get_attachment_url.*get_post_thumbnail_id.*;'
10
+ new='$image_link=get_post_meta($post->ID,"fifu_image_url",true);\
11
+ if($image_link=="")\
12
+ $image_link=wp_get_attachment_url(get_post_thumbnail_id());'
13
+ replace
14
+ }
15
+
16
+ gallery()
17
+ {
18
+ file=$1
19
+ old='if.*$attachment_ids.*{'
20
+ new='if(true){'
21
+ replace
22
+
23
+ old='?><\/div>'
24
+ new='\
25
+ for($i=0;$i<10;$i++){\
26
+ $image_link=get_post_meta($post->ID,"fifu_image_url_".$i,true);\
27
+ if($image_link){\
28
+ $image_caption=get_post_meta($post->ID,"fifu_image_alt_".$i,true);\
29
+ $image_class="zoom";\
30
+ $image=fifu_get_html($image_link,$image_caption);\
31
+ $attachment_id=1;\
32
+ echo\ apply_filters("woocommerce_single_product_image_thumbnail_html",\
33
+ sprintf("<a\ href='%s'\ class='%s'\ title='%s'\ data-rel='prettyPhoto[product-gallery]'>%s<\/a>",\
34
+ $image_link,$image_class,$image_caption,$image),$attachment_id,$post->ID,$image_class);\
35
+ }\
36
+ }\
37
+ ?><\/div>'
38
+ replace
39
+ }
40
+
41
+ category()
42
+ {
43
+ file=$themeDir'/woocommerce.php'
44
+ old='woocommerce_content()'
45
+ new='fifu_cat_show_image();woocommerce_content()'
46
+ replace
47
+ }
48
+
49
+ replace()
50
+ {
51
+ integrated=`egrep "fifu_" $file`
52
+ if [[ ! $integrated ]]
53
+ then
54
+ backup
55
+ sed -i "s/$old/$new/" $file
56
+ fi
57
+ }
58
+
59
+ backup()
60
+ {
61
+ cp $file $file'.bkp'
62
+ }
63
+
64
+ featured_image
65
+
66
+ gallery $dir'product-thumbnails.php'
67
+ gallery `find $themeDir . -iname product-thumbnails.php`
68
+
69
+ category