Version Description
Release Date - 18th March 2022
- Changed the minimal WordPress version to 5.2.
- Fixed upload file types. Allow just whitelisted import file types.
Download this release
Release Info
Developer | capuderg |
Plugin | One Click Demo Import |
Version | 3.1.0 |
Comparing to | |
See all releases |
Code changes from version 3.0.2 to 3.1.0
- inc/Helpers.php +13 -2
- languages/one-click-demo-import.pot +22 -22
- one-click-demo-import.php +1 -1
- readme.txt +11 -4
inc/Helpers.php
CHANGED
@@ -423,9 +423,20 @@ class Helpers {
|
|
423 |
// Upload settings to disable form and type testing for AJAX uploads.
|
424 |
$upload_overrides = array(
|
425 |
'test_form' => false,
|
426 |
-
'test_type' => false,
|
427 |
);
|
428 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
429 |
// Error data if the demo file was not provided.
|
430 |
$file_not_provided_error = array(
|
431 |
'error' => esc_html__( 'No file provided.', 'one-click-demo-import' )
|
@@ -444,7 +455,7 @@ class Helpers {
|
|
444 |
wp_handle_upload( $_FILES['customizer_file'], $upload_overrides ) :
|
445 |
$file_not_provided_error;
|
446 |
|
447 |
-
$redux_file_info = isset( $_FILES['
|
448 |
wp_handle_upload( $_FILES['redux_file'], $upload_overrides ) :
|
449 |
$file_not_provided_error;
|
450 |
|
423 |
// Upload settings to disable form and type testing for AJAX uploads.
|
424 |
$upload_overrides = array(
|
425 |
'test_form' => false,
|
|
|
426 |
);
|
427 |
|
428 |
+
// Register the import file types and their mime types.
|
429 |
+
add_filter( 'upload_mimes', function ( $defaults ) {
|
430 |
+
$custom = [
|
431 |
+
'xml' => 'text/xml',
|
432 |
+
'json' => 'application/json',
|
433 |
+
'wie' => 'application/json',
|
434 |
+
'dat' => 'text/plain',
|
435 |
+
];
|
436 |
+
|
437 |
+
return array_merge( $custom, $defaults );
|
438 |
+
} );
|
439 |
+
|
440 |
// Error data if the demo file was not provided.
|
441 |
$file_not_provided_error = array(
|
442 |
'error' => esc_html__( 'No file provided.', 'one-click-demo-import' )
|
455 |
wp_handle_upload( $_FILES['customizer_file'], $upload_overrides ) :
|
456 |
$file_not_provided_error;
|
457 |
|
458 |
+
$redux_file_info = isset( $_FILES['redux_file'] ) ?
|
459 |
wp_handle_upload( $_FILES['redux_file'], $upload_overrides ) :
|
460 |
$file_not_provided_error;
|
461 |
|
languages/one-click-demo-import.pot
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
-
"Project-Id-Version: One Click Demo Import 3.0
|
4 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/one-click-demo-import\n"
|
5 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
6 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
7 |
"MIME-Version: 1.0\n"
|
8 |
"Content-Type: text/plain; charset=UTF-8\n"
|
9 |
"Content-Transfer-Encoding: 8bit\n"
|
10 |
-
"POT-Creation-Date:
|
11 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
12 |
"X-Generator: WP-CLI 2.4.0\n"
|
13 |
"X-Domain: one-click-demo-import\n"
|
14 |
|
15 |
#. Plugin Name of the plugin
|
16 |
-
#: inc/Helpers.php:
|
17 |
#: inc/ViewHelpers.php:19
|
18 |
msgid "One Click Demo Import"
|
19 |
msgstr ""
|
@@ -243,65 +243,65 @@ msgstr ""
|
|
243 |
msgid "%1$sYour user role isn't high enough. You don't have permission to import demo data.%2$s"
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: inc/Helpers.php:
|
247 |
msgid "No file provided."
|
248 |
msgstr ""
|
249 |
|
250 |
#. translators: %s - the error message.
|
251 |
-
#: inc/Helpers.php:
|
252 |
msgid "Content file was not uploaded. Error: %s"
|
253 |
msgstr ""
|
254 |
|
255 |
-
#: inc/Helpers.php:
|
256 |
-
#: inc/Helpers.php:
|
257 |
-
#: inc/Helpers.php:498
|
258 |
#: inc/Helpers.php:509
|
259 |
-
#: inc/Helpers.php:
|
260 |
-
#: inc/Helpers.php:
|
|
|
261 |
msgid "Upload files"
|
262 |
msgstr ""
|
263 |
|
264 |
#. translators: %s - the error message.
|
265 |
-
#: inc/Helpers.php:
|
266 |
msgid "Widget file was not uploaded. Error: %s"
|
267 |
msgstr ""
|
268 |
|
269 |
#. translators: %s - the error message.
|
270 |
-
#: inc/Helpers.php:
|
271 |
msgid "Customizer file was not uploaded. Error: %s"
|
272 |
msgstr ""
|
273 |
|
274 |
-
#: inc/Helpers.php:
|
275 |
msgid "Missing Redux option name! Please also enter the Redux option name!"
|
276 |
msgstr ""
|
277 |
|
278 |
#. translators: %s - the error message.
|
279 |
-
#: inc/Helpers.php:
|
280 |
msgid "Redux file was not uploaded. Error: %s"
|
281 |
msgstr ""
|
282 |
|
283 |
-
#: inc/Helpers.php:
|
284 |
msgid "The import files were successfully uploaded!"
|
285 |
msgstr ""
|
286 |
|
287 |
#. translators: %s - the max execution time.
|
288 |
-
#: inc/Helpers.php:
|
289 |
msgid "Initial max execution time = %s"
|
290 |
msgstr ""
|
291 |
|
292 |
#. translators: %1$s - new line break, %2$s - the site URL, %3$s - the file path for content import, %4$s - the file path for widgets import, %5$s - the file path for widgets import, %6$s - the file path for redux import.
|
293 |
-
#: inc/Helpers.php:
|
294 |
msgid "Files info:%1$sSite URL = %2$s%1$sData file = %3$s%1$sWidget file = %4$s%1$sCustomizer file = %5$s%1$sRedux files:%1$s%6$s"
|
295 |
msgstr ""
|
296 |
|
297 |
-
#: inc/Helpers.php:
|
298 |
-
#: inc/Helpers.php:
|
299 |
-
#: inc/Helpers.php:
|
300 |
-
#: inc/Helpers.php:
|
301 |
msgid "not defined!"
|
302 |
msgstr ""
|
303 |
|
304 |
-
#: inc/Helpers.php:
|
305 |
#: views/plugin-page.php:290
|
306 |
msgid "Import Demo Data"
|
307 |
msgstr ""
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: One Click Demo Import 3.1.0\n"
|
4 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/one-click-demo-import\n"
|
5 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
6 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
7 |
"MIME-Version: 1.0\n"
|
8 |
"Content-Type: text/plain; charset=UTF-8\n"
|
9 |
"Content-Transfer-Encoding: 8bit\n"
|
10 |
+
"POT-Creation-Date: 2022-03-18T11:33:12+00:00\n"
|
11 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
12 |
"X-Generator: WP-CLI 2.4.0\n"
|
13 |
"X-Domain: one-click-demo-import\n"
|
14 |
|
15 |
#. Plugin Name of the plugin
|
16 |
+
#: inc/Helpers.php:753
|
17 |
#: inc/ViewHelpers.php:19
|
18 |
msgid "One Click Demo Import"
|
19 |
msgstr ""
|
243 |
msgid "%1$sYour user role isn't high enough. You don't have permission to import demo data.%2$s"
|
244 |
msgstr ""
|
245 |
|
246 |
+
#: inc/Helpers.php:442
|
247 |
msgid "No file provided."
|
248 |
msgstr ""
|
249 |
|
250 |
#. translators: %s - the error message.
|
251 |
+
#: inc/Helpers.php:471
|
252 |
msgid "Content file was not uploaded. Error: %s"
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: inc/Helpers.php:475
|
256 |
+
#: inc/Helpers.php:492
|
|
|
257 |
#: inc/Helpers.php:509
|
258 |
+
#: inc/Helpers.php:520
|
259 |
+
#: inc/Helpers.php:540
|
260 |
+
#: inc/Helpers.php:548
|
261 |
msgid "Upload files"
|
262 |
msgstr ""
|
263 |
|
264 |
#. translators: %s - the error message.
|
265 |
+
#: inc/Helpers.php:488
|
266 |
msgid "Widget file was not uploaded. Error: %s"
|
267 |
msgstr ""
|
268 |
|
269 |
#. translators: %s - the error message.
|
270 |
+
#: inc/Helpers.php:505
|
271 |
msgid "Customizer file was not uploaded. Error: %s"
|
272 |
msgstr ""
|
273 |
|
274 |
+
#: inc/Helpers.php:518
|
275 |
msgid "Missing Redux option name! Please also enter the Redux option name!"
|
276 |
msgstr ""
|
277 |
|
278 |
#. translators: %s - the error message.
|
279 |
+
#: inc/Helpers.php:536
|
280 |
msgid "Redux file was not uploaded. Error: %s"
|
281 |
msgstr ""
|
282 |
|
283 |
+
#: inc/Helpers.php:546
|
284 |
msgid "The import files were successfully uploaded!"
|
285 |
msgstr ""
|
286 |
|
287 |
#. translators: %s - the max execution time.
|
288 |
+
#: inc/Helpers.php:572
|
289 |
msgid "Initial max execution time = %s"
|
290 |
msgstr ""
|
291 |
|
292 |
#. translators: %1$s - new line break, %2$s - the site URL, %3$s - the file path for content import, %4$s - the file path for widgets import, %5$s - the file path for widgets import, %6$s - the file path for redux import.
|
293 |
+
#: inc/Helpers.php:576
|
294 |
msgid "Files info:%1$sSite URL = %2$s%1$sData file = %3$s%1$sWidget file = %4$s%1$sCustomizer file = %5$s%1$sRedux files:%1$s%6$s"
|
295 |
msgstr ""
|
296 |
|
297 |
+
#: inc/Helpers.php:579
|
298 |
+
#: inc/Helpers.php:580
|
299 |
+
#: inc/Helpers.php:581
|
300 |
+
#: inc/Helpers.php:582
|
301 |
msgid "not defined!"
|
302 |
msgstr ""
|
303 |
|
304 |
+
#: inc/Helpers.php:754
|
305 |
#: views/plugin-page.php:290
|
306 |
msgid "Import Demo Data"
|
307 |
msgstr ""
|
one-click-demo-import.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: One Click Demo Import
|
5 |
Plugin URI: https://wordpress.org/plugins/one-click-demo-import/
|
6 |
Description: Import your content, widgets and theme settings with one click. Theme authors! Enable simple demo import for your theme demo data.
|
7 |
-
Version: 3.0
|
8 |
Author: OCDI
|
9 |
Author URI: https://ocdi.com
|
10 |
License: GPL3
|
4 |
Plugin Name: One Click Demo Import
|
5 |
Plugin URI: https://wordpress.org/plugins/one-click-demo-import/
|
6 |
Description: Import your content, widgets and theme settings with one click. Theme authors! Enable simple demo import for your theme demo data.
|
7 |
+
Version: 3.1.0
|
8 |
Author: OCDI
|
9 |
Author URI: https://ocdi.com
|
10 |
License: GPL3
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== One Click Demo Import ===
|
2 |
Contributors: ocdi, smub, jaredatch, capuderg
|
3 |
Tags: import, content, demo, data, widgets, settings, redux, theme options
|
4 |
-
Requires at least:
|
5 |
-
Tested up to: 5.
|
6 |
Requires PHP: 5.6
|
7 |
-
Stable tag: 3.0
|
8 |
License: GPLv3 or later
|
9 |
|
10 |
Import your demo content, widgets and theme settings with one click. Theme authors! Enable simple theme demo import for your users.
|
@@ -224,7 +224,7 @@ add_action( 'ocdi/before_widgets_import', 'ocdi_before_widgets_import' );
|
|
224 |
|
225 |
= How can I import via the WP-CLI? =
|
226 |
|
227 |
-
In the 2.4.0 version of this
|
228 |
|
229 |
* `wp ocdi list` - Which will list any predefined demo imports currently active theme might have,
|
230 |
* `wp ocdi import` - which has a few options that you can use to import the things you want (content/widgets/customizer/predefined demos). Let's look at these options below.
|
@@ -359,6 +359,13 @@ Please visit this [docs page](https://github.com/awesomemotive/one-click-demo-im
|
|
359 |
|
360 |
== Changelog ==
|
361 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
362 |
= 3.0.2 =
|
363 |
|
364 |
*Release Date - 2 April 2021*
|
1 |
=== One Click Demo Import ===
|
2 |
Contributors: ocdi, smub, jaredatch, capuderg
|
3 |
Tags: import, content, demo, data, widgets, settings, redux, theme options
|
4 |
+
Requires at least: 5.2
|
5 |
+
Tested up to: 5.9
|
6 |
Requires PHP: 5.6
|
7 |
+
Stable tag: 3.1.0
|
8 |
License: GPLv3 or later
|
9 |
|
10 |
Import your demo content, widgets and theme settings with one click. Theme authors! Enable simple theme demo import for your users.
|
224 |
|
225 |
= How can I import via the WP-CLI? =
|
226 |
|
227 |
+
In the 2.4.0 version of this plugin we added two WP-CLI commands:
|
228 |
|
229 |
* `wp ocdi list` - Which will list any predefined demo imports currently active theme might have,
|
230 |
* `wp ocdi import` - which has a few options that you can use to import the things you want (content/widgets/customizer/predefined demos). Let's look at these options below.
|
359 |
|
360 |
== Changelog ==
|
361 |
|
362 |
+
= 3.1.0 =
|
363 |
+
|
364 |
+
*Release Date - 18th March 2022*
|
365 |
+
|
366 |
+
* Changed the minimal WordPress version to 5.2.
|
367 |
+
* Fixed upload file types. Allow just whitelisted import file types.
|
368 |
+
|
369 |
= 3.0.2 =
|
370 |
|
371 |
*Release Date - 2 April 2021*
|