Widget Importer & Exporter - Version 1.5.5

Version Description

Download this release

Release Info

Developer stevengliebe
Plugin Icon 128x128 Widget Importer & Exporter
Version 1.5.5
Comparing to
See all releases

Code changes from version 1.5.3 to 1.5.5

includes/admin.php CHANGED
@@ -6,7 +6,7 @@
6
*
7
* @package Widget_Importer_Exporter
8
* @subpackage Functions
9
- * @copyright Copyright (c) 2017, churchthemes.com
10
* @link https://churchthemes.com/plugins/widget-importer-exporter/
11
* @license GPLv2 or later
12
* @since 1.4
6
*
7
* @package Widget_Importer_Exporter
8
* @subpackage Functions
9
+ * @copyright Copyright (c) 2017, ChurchThemes.com
10
* @link https://churchthemes.com/plugins/widget-importer-exporter/
11
* @license GPLv2 or later
12
* @since 1.4
includes/export.php CHANGED
@@ -4,7 +4,7 @@
4
*
5
* @package Widget_Importer_Exporter
6
* @subpackage Functions
7
- * @copyright Copyright (c) 2013 - 2017, churchthemes.com
8
* @link https://churchthemes.com/plugins/widget-importer-exporter/
9
* @license GPLv2 or later
10
* @since 0.1
4
*
5
* @package Widget_Importer_Exporter
6
* @subpackage Functions
7
+ * @copyright Copyright (c) 2013 - 2017, ChurchThemes.com
8
* @link https://churchthemes.com/plugins/widget-importer-exporter/
9
* @license GPLv2 or later
10
* @since 0.1
includes/import.php CHANGED
@@ -4,7 +4,7 @@
4
*
5
* @package Widget_Importer_Exporter
6
* @subpackage Functions
7
- * @copyright Copyright (c) 2013 - 2017, churchthemes.com
8
* @link https://churchthemes.com/plugins/widget-importer-exporter/
9
* @license GPLv2 or later
10
* @since 0.3
@@ -26,6 +26,9 @@ function wie_upload_import_file() {
26
// check_admin_referer prints fail page and dies.
27
if ( ! empty( $_POST ) && ! empty( $_FILES['wie_import_file'] ) && check_admin_referer( 'wie_import', 'wie_import_nonce' ) ) {
28
29
// Workaround for upload bug in WordPress 4.7.1.
30
// This will only be applied for WordPress 4.7.1. Other versions are not affected.
31
add_filter( 'wp_check_filetype_and_ext', 'wie_disable_real_mime_check', 10, 4 );
4
*
5
* @package Widget_Importer_Exporter
6
* @subpackage Functions
7
+ * @copyright Copyright (c) 2013 - 2018, ChurchThemes.com
8
* @link https://churchthemes.com/plugins/widget-importer-exporter/
9
* @license GPLv2 or later
10
* @since 0.3
26
// check_admin_referer prints fail page and dies.
27
if ( ! empty( $_POST ) && ! empty( $_FILES['wie_import_file'] ) && check_admin_referer( 'wie_import', 'wie_import_nonce' ) ) {
28
29
+ // Workaround for .wie upload issue introduced by WordPress 4.9.9 / 5.0.1.
30
+ add_filter( 'wp_check_filetype_and_ext', 'wie_allow_multiple_mime_types', 10, 4 );
31
+
32
// Workaround for upload bug in WordPress 4.7.1.
33
// This will only be applied for WordPress 4.7.1. Other versions are not affected.
34
add_filter( 'wp_check_filetype_and_ext', 'wie_disable_real_mime_check', 10, 4 );
includes/mime-types.php CHANGED
@@ -4,7 +4,7 @@
4
*
5
* @package Widget_Importer_Exporter
6
* @subpackage Functions
7
- * @copyright Copyright (c) 2013 - 2017, churchthemes.com
8
* @link https://churchthemes.com/plugins/widget-importer-exporter/
9
* @license GPLv2 or later
10
* @since 0.1
@@ -26,7 +26,8 @@ if ( ! defined( 'ABSPATH' ) ) {
26
*/
27
function wie_add_mime_types( $mime_types ) {
28
29
- $mime_types['wie'] = 'application/json';
30
31
return $mime_types;
32
@@ -34,6 +35,51 @@ function wie_add_mime_types( $mime_types ) {
34
35
add_filter( 'upload_mimes', 'wie_add_mime_types' );
36
37
/**
38
* Disable real MIME check on WordPress 4.7.1 and 4.7.2
39
*
4
*
5
* @package Widget_Importer_Exporter
6
* @subpackage Functions
7
+ * @copyright Copyright (c) 2013 - 2018, ChurchThemes.com
8
* @link https://churchthemes.com/plugins/widget-importer-exporter/
9
* @license GPLv2 or later
10
* @since 0.1
26
*/
27
function wie_add_mime_types( $mime_types ) {
28
29
+ //$mime_types['wie'] = 'application/json'; // 5.0.1 breaking change: https://make.wordpress.org/core/2018/12/13/backwards-compatibility-breaks-in-5-0-1/
30
+ $mime_types['wie'] = 'text/plain';
31
32
return $mime_types;
33
35
36
add_filter( 'upload_mimes', 'wie_add_mime_types' );
37
38
+
39
+ /**
40
+ * Allow .wie as text/html for 4.9.9 / 5.0.1
41
+ *
42
+ * This is a workaround for a WordPress 4.9.9 / 5.0.1 update forcing upload mime type to match extension.
43
+ * .wie is usually detected as text/plain but sometimes text/html, so text/html uploads fail.
44
+ *
45
+ * https://make.wordpress.org/core/2018/12/13/backwards-compatibility-breaks-in-5-0-1/
46
+ *
47
+ * The same occurs with .csv uploads in core being text/csv or text/plain:
48
+ * https://core.trac.wordpress.org/ticket/45615
49
+ *
50
+ * This workaround is based on a CSV workaround for core by rmpel:
51
+ * https://gist.github.com/rmpel/e1e2452ca06ab621fe061e0fde7ae150
52
+ *
53
+ * This is called in includes/import.php by wie_upload_import_file() so that it only happens during upload via this
54
+ * plugin. add_filter( 'wp_check_filetype_and_ext', 'wie_allow_multiple_mime_types', 10, 4 );
55
+ */
56
+ function wie_allow_multiple_mime_types( $values, $file, $filename, $mimes ) {
57
+
58
+ if ( extension_loaded( 'fileinfo' ) ) {
59
+
60
+ $finfo = finfo_open( FILEINFO_MIME_TYPE );
61
+ $real_mime = finfo_file( $finfo, $file );
62
+
63
+ finfo_close( $finfo );
64
+
65
+ if ( 'text/html' === $real_mime && preg_match( '/\.(wie)#x2F;i', $filename ) ) {
66
+ $values['ext'] = 'wie';
67
+ $values['type'] = 'text/plain';
68
+ }
69
+
70
+ } else {
71
+
72
+ if ( preg_match( '/\.(wie)#x2F;i', $filename ) ) {
73
+ $values['ext'] = 'wie';
74
+ $values['type'] = 'text/plain';
75
+ }
76
+
77
+ }
78
+
79
+ return $values;
80
+
81
+ }
82
+
83
/**
84
* Disable real MIME check on WordPress 4.7.1 and 4.7.2
85
*
includes/page.php CHANGED
@@ -4,7 +4,7 @@
4
*
5
* @package Widget_Importer_Exporter
6
* @subpackage Functions
7
- * @copyright Copyright (c) 2013 - 2017, churchthemes.com
8
* @link https://churchthemes.com/plugins/widget-importer-exporter/
9
* @license GPLv2 or later
10
* @since 0.1
4
*
5
* @package Widget_Importer_Exporter
6
* @subpackage Functions
7
+ * @copyright Copyright (c) 2013 - 2017, ChurchThemes.com
8
* @link https://churchthemes.com/plugins/widget-importer-exporter/
9
* @license GPLv2 or later
10
* @since 0.1
includes/widgets.php CHANGED
@@ -4,7 +4,7 @@
4
*
5
* @package Widget_Importer_Exporter
6
* @subpackage Functions
7
- * @copyright Copyright (c) 2013 - 2017, churchthemes.com
8
* @link https://churchthemes.com/plugins/widget-importer-exporter/
9
* @license GPLv2 or later
10
* @since 0.4
4
*
5
* @package Widget_Importer_Exporter
6
* @subpackage Functions
7
+ * @copyright Copyright (c) 2013 - 2017, ChurchThemes.com
8
* @link https://churchthemes.com/plugins/widget-importer-exporter/
9
* @license GPLv2 or later
10
* @since 0.4
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
Contributors: churchthemes, stevengliebe, mauryaratan, wido
3
Tags: widgets, widget, importer, exporter, import, export, widget import, widget export, widget importer, widget exporter, backup, migration
4
Requires at least: 3.5
5
- Tested up to: 4.9.2
6
Requires PHP: 5.2.4
7
- Stable tag: 1.5.3
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -12,7 +12,7 @@ Import and export your widgets.
12
13
== Description ==
14
15
- Widget Importer & Exporter is useful for moving widgets from one WordPress site to another, backing up widgets and for theme developers to give users sample widgets. See the [details](https://churchthemes.com/plugins/widget-importer-exporter/) on churchthemes.com.
16
17
= Importing =
18
@@ -24,34 +24,12 @@ Importation takes into consideration widget areas not existing in the current th
24
25
Widget Importer & Exporter can create an export file (in JSON format with .wie extension) out of currently active widgets. This file can be imported into other sites using this plugin or used to restore widgets to the same site later.
26
27
- = Translations =
28
-
29
- The following translations are available.
30
-
31
- * English (default)
32
- * Spanish by [Eduardo Larequi](http://www.labitacoradeltigre.com/)
33
- * French by [French Translation Team](https://make.wordpress.org/polyglots/teams/?locale=fr_FR)
34
- * German by [Alexander Kesting](http://alex-dune.de)
35
- * Italian by [venerdi](https://profiles.wordpress.org/venerdi/)
36
- * Dutch by [Paul Backus](http://backups.nl/)
37
- * Serbian by Borisa Djuraskovic of [Web Hosting Hub](http://www.webhostinghub.com)
38
- * Japanese by [miccweb](https://profiles.wordpress.org/miccweb/)
39
- * Hebrew by [Rami Yushuvaev](https://profiles.wordpress.org/ramiy/)
40
- * Persian by [ekfarshid](https://profiles.wordpress.org/ekfarshid/), [Yousefzadeh](https://profiles.wordpress.org/cg-team/) and [PersianScript](https://profiles.wordpress.org/persianscript/)
41
- * More at [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/widget-importer-exporter)
42
-
43
= Developers =
44
45
The ``wie_before_import`` action fires after a file is uploaded but before the data is imported. ``wie_after_import`` fires after the data is imported. The ``wie_import_data`` filter can be used to filter data before it is imported. Other filters are used throughout. Submit an issue on GitHub if you need more hooks (pull requests encouraged).
46
47
Please jump on [GitHub](https://github.com/churchthemes/widget-importer-exporter) to report issues and follow development.
48
49
- = Follow us =
50
-
51
- * Visit [churchthemes.com](https://churchthemes.com)
52
- * We're on [Twitter](https://twitter.com/churchthemes), [Facebook](https://www.facebook.com/churchthemescom) and have a [Newsletter](http://churchthemes.us5.list-manage.com/subscribe?u=a0fec2c146a67b2dc509154d1&id=8e1ec0c774)
53
- * Developer: [stevengliebe.com](http://stevengliebe.com)
54
-
55
== Installation ==
56
57
Please see [Installing Plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins) in the WordPress Codex.
2
Contributors: churchthemes, stevengliebe, mauryaratan, wido
3
Tags: widgets, widget, importer, exporter, import, export, widget import, widget export, widget importer, widget exporter, backup, migration
4
Requires at least: 3.5
5
+ Tested up to: 5.0.2
6
Requires PHP: 5.2.4
7
+ Stable tag: 1.5.5
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
12
13
== Description ==
14
15
+ Widget Importer & Exporter is useful for moving widgets from one WordPress site to another, backing up widgets and for theme developers to give users sample widgets. See the [details](https://churchthemes.com/plugins/widget-importer-exporter/) on ChurchThemes.com.
16
17
= Importing =
18
24
25
Widget Importer & Exporter can create an export file (in JSON format with .wie extension) out of currently active widgets. This file can be imported into other sites using this plugin or used to restore widgets to the same site later.
26
27
= Developers =
28
29
The ``wie_before_import`` action fires after a file is uploaded but before the data is imported. ``wie_after_import`` fires after the data is imported. The ``wie_import_data`` filter can be used to filter data before it is imported. Other filters are used throughout. Submit an issue on GitHub if you need more hooks (pull requests encouraged).
30
31
Please jump on [GitHub](https://github.com/churchthemes/widget-importer-exporter) to report issues and follow development.
32
33
== Installation ==
34
35
Please see [Installing Plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins) in the WordPress Codex.
widget-importer-exporter.php CHANGED
@@ -3,15 +3,15 @@
3
* Plugin Name: Widget Importer & Exporter
4
* Plugin URI: https://churchthemes.com/plugins/widget-importer-exporter/
5
* Description: Imports and exports widgets.
6
- * Version: 1.5.3
7
- * Author: churchthemes.com
8
* Author URI: https://churchthemes.com
9
* License: GPLv2 or later
10
* Text Domain: widget-importer-exporter
11
* Domain Path: /languages
12
*
13
* @package Widget_Importer_Exporter
14
- * @copyright Copyright (c) 2013 - 2017, churchthemes.com
15
* @link https://churchthemes.com/plugins/widget-importer-exporter/
16
* @license GPLv2 or later
17
*/
3
* Plugin Name: Widget Importer & Exporter
4
* Plugin URI: https://churchthemes.com/plugins/widget-importer-exporter/
5
* Description: Imports and exports widgets.
6
+ * Version: 1.5.5
7
+ * Author: ChurchThemes.com
8
* Author URI: https://churchthemes.com
9
* License: GPLv2 or later
10
* Text Domain: widget-importer-exporter
11
* Domain Path: /languages
12
*
13
* @package Widget_Importer_Exporter
14
+ * @copyright Copyright (c) 2013 - 2018, ChurchThemes.com
15
* @link https://churchthemes.com/plugins/widget-importer-exporter/
16
* @license GPLv2 or later
17
*/