Import any XML or CSV File to WordPress - Version 3.5.9

Version Description

  • bug fix: call to the non existing function wp_all_import_sanitize_url
Download this release

Release Info

Developer soflyy
Plugin Icon 128x128 Import any XML or CSV File to WordPress
Version 3.5.9
Comparing to
See all releases

Code changes from version 3.5.8 to 3.5.9

helpers/wp_all_import_sanitize_url.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Get correct import URL for Dropbox and Google share URLs
4
+ *
5
+ *
6
+ * @param $link
7
+ * The share URL for your Dropbox or Google Drive/Spreadsheets file.
8
+ * @param $format
9
+ * The type of file, if it's a Spreadsheet file. Acceptable examples: 'csv', 'xls'. Defaults to 'csv'.
10
+ * @return string
11
+ * The direct download URL.
12
+ */
13
+ if ( ! function_exists('wp_all_import_sanitize_url')) {
14
+
15
+ function wp_all_import_sanitize_url( $link, $format = 'csv' ) {
16
+ $link = str_replace(" ", "%20", $link);
17
+ $parse = parse_url( $link );
18
+ preg_match( '/(?<=.com\/).*?(?=\/d)/', $link, $match );
19
+ // Check for 'spreadsheets' or 'file' from Google URL.
20
+ if ( ! empty( $match[0] ) ) {
21
+ // The type is either 'file' or 'spreadsheets' typically.
22
+ $type = $match[0];
23
+ }
24
+ $domain = isset( $parse['host'] ) ? $parse['host'] : '';
25
+ if ( preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $match ) ) {
26
+ // Set the domain - i.e. google.com
27
+ $domain = $match['domain'];
28
+ }
29
+ if ( ! empty( $domain ) ) {
30
+ switch( $domain ) {
31
+ case 'dropbox.com':
32
+ if ( substr( $link, -4 ) == 'dl=0' ) {
33
+ return str_replace( 'dl=0', 'dl=1', $link );
34
+ }
35
+ if ( strpos( $link, '?' ) === false ) {
36
+ return $link . '?dl=1';
37
+ }
38
+ if ( strpos( $link, 'dl=1' ) === false ) {
39
+ return $link . '&dl=1';
40
+ }
41
+ break;
42
+ case 'google.com':
43
+ if ( !empty( $type ) ) {
44
+ switch( $type ) {
45
+ case 'file':
46
+ $pattern = '/(?<=\/file\/d\/).*?(?=\/edit)/';
47
+ preg_match( $pattern, $link, $match );
48
+ $file_id = $match[0];
49
+ if ( !empty( $file_id ) ) {
50
+ return 'https://drive.google.com/uc?export=download&id=' . $file_id;
51
+ }
52
+ break;
53
+ case 'spreadsheets':
54
+ $pattern = '/(?<=\/spreadsheets\/d\/).*?(?=\/edit)/';
55
+ preg_match( $pattern, $link, $match );
56
+ $file_id = $match[0];
57
+ if ( !empty( $file_id ) ) {
58
+ return 'https://docs.google.com/spreadsheets/d/' . $file_id . '/export?format=' . $format;
59
+ }
60
+ break;
61
+ default:
62
+ return $link;
63
+ break;
64
+ }
65
+ }
66
+ default:
67
+ return $link;
68
+ break;
69
+ }
70
+ }
71
+ return $link;
72
+ }
73
+ }
phpunit-free.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <phpunit
2
+ bootstrap="tests/bootstrap-free.php"
3
+ backupGlobals="false"
4
+ colors="true"
5
+ convertErrorsToExceptions="true"
6
+ convertNoticesToExceptions="true"
7
+ convertWarningsToExceptions="true"
8
+ >
9
+ <testsuites>
10
+ <testsuite name="basic">
11
+ <file>tests/free-edition-test-posts.php</file>
12
+ <file>tests/free-edition-test-pages.php</file>
13
+ </testsuite>
14
+ <testsuite name="products">
15
+ <directory prefix="free-edition-test-products-" suffix=".php">tests</directory>
16
+ </testsuite>
17
+ </testsuites>
18
+ </phpunit>
phpunit.xml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <phpunit
2
+ bootstrap="tests/bootstrap.php"
3
+ backupGlobals="false"
4
+ colors="true"
5
+ convertErrorsToExceptions="true"
6
+ convertNoticesToExceptions="true"
7
+ convertWarningsToExceptions="true"
8
+ >
9
+ <testsuites>
10
+ <testsuite name="basic">
11
+ <file>tests/test-posts.php</file>
12
+ <file>tests/test-pages.php</file>
13
+ </testsuite>
14
+ <testsuite name="products">
15
+ <directory prefix="test-products-" suffix=".php">tests</directory>
16
+ </testsuite>
17
+ <testsuite name="simple-products">
18
+ <directory prefix="test-products-simple" suffix=".php">tests</directory>
19
+ </testsuite>
20
+ <testsuite name="external-products">
21
+ <directory prefix="test-products-external" suffix=".php">tests</directory>
22
+ </testsuite>
23
+ <testsuite name="grouped-products">
24
+ <directory prefix="test-products-grouped" suffix=".php">tests</directory>
25
+ </testsuite>
26
+ <testsuite name="variable-products">
27
+ <directory prefix="test-products-variable" suffix=".php">tests</directory>
28
+ </testsuite>
29
+ <testsuite name="images">
30
+ <directory prefix="test-images" suffix=".php">tests</directory>
31
+ </testsuite>
32
+ <!-- <testsuite name="user">
33
+ <file>tests/test-users.php</file>
34
+ </testsuite> -->
35
+ <!--testsuite name="acf">
36
+ <file>tests/test-acf.php</file>
37
+ </testsuite-->
38
+ </testsuites>
39
+ </phpunit>
plugin.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP All Import
4
  Plugin URI: http://www.wpallimport.com/wordpress-xml-csv-import/?utm_source=import-plugin-free&utm_medium=wp-plugins-page&utm_campaign=upgrade-to-pro
5
  Description: The most powerful solution for importing XML and CSV files to WordPress. Create Posts and Pages with content from any XML or CSV file. A paid upgrade to WP All Import Pro is available for support and additional features.
6
- Version: 3.5.8
7
  Author: Soflyy
8
  */
9
 
@@ -25,7 +25,7 @@ define('WP_ALL_IMPORT_ROOT_URL', rtrim(plugin_dir_url(__FILE__), '/'));
25
  */
26
  define('WP_ALL_IMPORT_PREFIX', 'pmxi_');
27
 
28
- define('PMXI_VERSION', '3.5.8');
29
 
30
  define('PMXI_EDITION', 'free');
31
 
3
  Plugin Name: WP All Import
4
  Plugin URI: http://www.wpallimport.com/wordpress-xml-csv-import/?utm_source=import-plugin-free&utm_medium=wp-plugins-page&utm_campaign=upgrade-to-pro
5
  Description: The most powerful solution for importing XML and CSV files to WordPress. Create Posts and Pages with content from any XML or CSV file. A paid upgrade to WP All Import Pro is available for support and additional features.
6
+ Version: 3.5.9
7
  Author: Soflyy
8
  */
9
 
25
  */
26
  define('WP_ALL_IMPORT_PREFIX', 'pmxi_');
27
 
28
+ define('PMXI_VERSION', '3.5.9');
29
 
30
  define('PMXI_EDITION', 'free');
31
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 4.1
4
  Tested up to: 5.7
5
- Stable tag: 3.5.8
6
  Tags: wordpress csv import, wordpress xml import, xml, csv, datafeed, import, migrate, import csv to wordpress, import xml to wordpress, advanced xml import, advanced csv import, bulk csv import, bulk xml import, bulk data import, xml to custom post type, csv to custom post type, woocommerce csv import, woocommerce xml import, csv import, import csv, xml import, import xml, csv importer
7
 
8
  WP All Import is an extremely powerful importer that makes it easy to import any XML or CSV file to WordPress.
@@ -105,6 +105,9 @@ Does it work with special character encoding like Hebrew, Arabic, Chinese, etc?
105
 
106
  == Changelog ==
107
 
 
 
 
108
  = 3.5.8 =
109
  * bug fix: import of taxonomies hierarchy didn't work properly
110
 
2
  Contributors: soflyy, wpallimport
3
  Requires at least: 4.1
4
  Tested up to: 5.7
5
+ Stable tag: 3.5.9
6
  Tags: wordpress csv import, wordpress xml import, xml, csv, datafeed, import, migrate, import csv to wordpress, import xml to wordpress, advanced xml import, advanced csv import, bulk csv import, bulk xml import, bulk data import, xml to custom post type, csv to custom post type, woocommerce csv import, woocommerce xml import, csv import, import csv, xml import, import xml, csv importer
7
 
8
  WP All Import is an extremely powerful importer that makes it easy to import any XML or CSV file to WordPress.
105
 
106
  == Changelog ==
107
 
108
+ = 3.5.9 =
109
+ * bug fix: call to the non existing function wp_all_import_sanitize_url
110
+
111
  = 3.5.8 =
112
  * bug fix: import of taxonomies hierarchy didn't work properly
113