Version Description
- Improvement: supports URLs up to 2048 characters now.
Download this release
Release Info
Developer | marceljm |
Plugin | Featured Image From URL |
Version | 2.2.1 |
Comparing to | |
See all releases |
Code changes from version 2.2.0 to 2.2.1
- admin/db.php +15 -0
- admin/html/js/meta-box.js +1 -1
- admin/html/meta-box.html +1 -1
- admin/html/script.html +0 -1
- admin/meta-box.php +2 -1
- featured-image-from-url.php +26 -1
- readme.txt +6 -0
admin/db.php
CHANGED
@@ -21,6 +21,16 @@ class FifuDb {
|
|
21 |
$this->term_relationships = $wpdb->prefix . 'term_relationships';
|
22 |
$this->author = 77777;
|
23 |
$this->MAX_INSERT = 100;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
}
|
25 |
|
26 |
/* attachment meta data */
|
@@ -405,3 +415,8 @@ function fifu_db_delete_attachment() {
|
|
405 |
$db->delete_attachment();
|
406 |
}
|
407 |
|
|
|
|
|
|
|
|
|
|
21 |
$this->term_relationships = $wpdb->prefix . 'term_relationships';
|
22 |
$this->author = 77777;
|
23 |
$this->MAX_INSERT = 100;
|
24 |
+
$this->MAX_URL_LENGTH = 2048;
|
25 |
+
}
|
26 |
+
|
27 |
+
/* alter table */
|
28 |
+
|
29 |
+
function change_url_length() {
|
30 |
+
$this->wpdb->get_results("
|
31 |
+
ALTER TABLE " . $this->posts . "
|
32 |
+
MODIFY COLUMN guid VARCHAR(" . $this->MAX_URL_LENGTH . ")"
|
33 |
+
);
|
34 |
}
|
35 |
|
36 |
/* attachment meta data */
|
415 |
$db->delete_attachment();
|
416 |
}
|
417 |
|
418 |
+
function fifu_db_change_url_length() {
|
419 |
+
$db = new FifuDb();
|
420 |
+
$db->change_url_length();
|
421 |
+
}
|
422 |
+
|
admin/html/js/meta-box.js
CHANGED
@@ -26,4 +26,4 @@ function previewImage() {
|
|
26 |
jQuery("#fifu_image").show();
|
27 |
jQuery("#fifu_link").show();
|
28 |
}
|
29 |
-
}
|
26 |
jQuery("#fifu_image").show();
|
27 |
jQuery("#fifu_link").show();
|
28 |
}
|
29 |
+
}
|
admin/html/meta-box.html
CHANGED
@@ -49,7 +49,7 @@
|
|
49 |
<div style="<?php echo $show_news ?>">
|
50 |
<hr>
|
51 |
<p style="font-size: 12px; padding: 10px; border-left: 3px solid red; color: black;
|
52 |
-
background-color: whitesmoke; border-radius:
|
53 |
<!--p style="font-size: 12px; padding: 5px; border-left: 6px solid red; color: black;
|
54 |
background-color: #eee; border-radius: 25px 5px;">Please report any problem to <a href="mailto:marcel@featuredimagefromurl.com">marcel@featuredimagefromurl.com</a></p-->
|
55 |
<!--p style="font-size: 12px; padding: 5px; border-left: 6px solid #b20ab8; color: black;
|
49 |
<div style="<?php echo $show_news ?>">
|
50 |
<hr>
|
51 |
<p style="font-size: 12px; padding: 10px; border-left: 3px solid red; color: black;
|
52 |
+
background-color: whitesmoke; border-radius: 100px 5px;">Please report any problem to <a href="mailto:marcel@featuredimagefromurl.com">marcel@featuredimagefromurl.com</a></p>
|
53 |
<!--p style="font-size: 12px; padding: 5px; border-left: 6px solid red; color: black;
|
54 |
background-color: #eee; border-radius: 25px 5px;">Please report any problem to <a href="mailto:marcel@featuredimagefromurl.com">marcel@featuredimagefromurl.com</a></p-->
|
55 |
<!--p style="font-size: 12px; padding: 5px; border-left: 6px solid #b20ab8; color: black;
|
admin/html/script.html
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
<style><?php include 'css/editor.css' ?></style>
|
|
admin/meta-box.php
CHANGED
@@ -30,7 +30,8 @@ function fifu_insert_meta_box() {
|
|
30 |
add_action('add_meta_boxes', 'fifu_add_css');
|
31 |
|
32 |
function fifu_add_css() {
|
33 |
-
|
|
|
34 |
}
|
35 |
|
36 |
function fifu_show_elements($post) {
|
30 |
add_action('add_meta_boxes', 'fifu_add_css');
|
31 |
|
32 |
function fifu_add_css() {
|
33 |
+
wp_register_style('fifu-premium', plugins_url('/html/css/editor.css', __FILE__));
|
34 |
+
wp_enqueue_style('fifu-premium');
|
35 |
}
|
36 |
|
37 |
function fifu_show_elements($post) {
|
featured-image-from-url.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Featured Image from URL
|
5 |
* Plugin URI: https://featuredimagefromurl.com/
|
6 |
* Description: Use an external image as Featured Image of your post/page/custom post type (WooCommerce). Includes Auto Set (External Post), Product Gallery, Social Tags and more.
|
7 |
-
* Version: 2.2.
|
8 |
* Author: Marcel Jacques Machado
|
9 |
* Author URI: https://www.linkedin.com/in/marceljm/
|
10 |
*/
|
@@ -29,3 +29,28 @@ if (is_admin()) {
|
|
29 |
require_once (FIFU_ADMIN_DIR . '/db.php');
|
30 |
require_once( FIFU_ADMIN_DIR . '/meta-box.php' );
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
* Plugin Name: Featured Image from URL
|
5 |
* Plugin URI: https://featuredimagefromurl.com/
|
6 |
* Description: Use an external image as Featured Image of your post/page/custom post type (WooCommerce). Includes Auto Set (External Post), Product Gallery, Social Tags and more.
|
7 |
+
* Version: 2.2.1
|
8 |
* Author: Marcel Jacques Machado
|
9 |
* Author URI: https://www.linkedin.com/in/marceljm/
|
10 |
*/
|
29 |
require_once (FIFU_ADMIN_DIR . '/db.php');
|
30 |
require_once( FIFU_ADMIN_DIR . '/meta-box.php' );
|
31 |
|
32 |
+
register_activation_hook(__FILE__, 'fifu_activate');
|
33 |
+
|
34 |
+
function fifu_activate($network_wide) {
|
35 |
+
if (is_multisite() && $network_wide) {
|
36 |
+
global $wpdb;
|
37 |
+
foreach ($wpdb->get_col("SELECT blog_id FROM $wpdb->blogs") as $blog_id) {
|
38 |
+
switch_to_blog($blog_id);
|
39 |
+
fifu_db_change_url_length();
|
40 |
+
}
|
41 |
+
} else
|
42 |
+
fifu_db_change_url_length();
|
43 |
+
}
|
44 |
+
|
45 |
+
add_action('upgrader_process_complete', 'fifu_upgrade', 10, 2);
|
46 |
+
|
47 |
+
function fifu_upgrade($upgrader_object, $options) {
|
48 |
+
$current_plugin_path_name = plugin_basename(__FILE__);
|
49 |
+
if ($options['action'] == 'update' && $options['type'] == 'plugin') {
|
50 |
+
foreach ($options['plugins'] as $each_plugin) {
|
51 |
+
if ($each_plugin == $current_plugin_path_name)
|
52 |
+
fifu_db_change_url_length();
|
53 |
+
}
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
readme.txt
CHANGED
@@ -161,6 +161,9 @@ Features:
|
|
161 |
|
162 |
== Changelog ==
|
163 |
|
|
|
|
|
|
|
164 |
= 2.2.0 =
|
165 |
* Improvement: hide inconvenient notices from other plugins/themes in FIFU settings.
|
166 |
|
@@ -491,6 +494,9 @@ was removed. To finish, a Premium version is now been presented.
|
|
491 |
|
492 |
== Upgrade Notice ==
|
493 |
|
|
|
|
|
|
|
494 |
= 2.2.0 =
|
495 |
* Improvement: hide inconvenient notices from other plugins/themes in FIFU settings.
|
496 |
|
161 |
|
162 |
== Changelog ==
|
163 |
|
164 |
+
= 2.2.1 =
|
165 |
+
* Improvement: supports URLs up to 2048 characters now.
|
166 |
+
|
167 |
= 2.2.0 =
|
168 |
* Improvement: hide inconvenient notices from other plugins/themes in FIFU settings.
|
169 |
|
494 |
|
495 |
== Upgrade Notice ==
|
496 |
|
497 |
+
= 2.2.1 =
|
498 |
+
* Improvement: supports URLs up to 2048 characters now.
|
499 |
+
|
500 |
= 2.2.0 =
|
501 |
* Improvement: hide inconvenient notices from other plugins/themes in FIFU settings.
|
502 |
|