Version Description
- improvement: UI updates
- bug fix: PHP 8 compatibility
Download this release
Release Info
Developer | soflyy |
Plugin | Export WordPress data to XML/CSV |
Version | 1.3.4 |
Comparing to | |
See all releases |
Code changes from version 1.3.3 to 1.3.4
- actions/admin_init.php +0 -0
- actions/admin_menu.php +0 -0
- actions/admin_notices.php +0 -0
- actions/wp_ajax_dismiss_review_modal.php +17 -0
- actions/wp_ajax_send_feedback.php +17 -0
- classes/config.php +0 -0
- classes/download.php +0 -0
- classes/helper.php +0 -0
- classes/input.php +0 -0
- classes/session.php +0 -0
- config/options.php +0 -0
- controllers/admin/export.php +0 -0
- controllers/admin/help.php +0 -0
- controllers/admin/settings.php +0 -0
- controllers/controller.php +0 -0
- controllers/controller/admin.php +0 -0
- helpers/backward.php +0 -0
- helpers/str_getcsv.php +0 -0
- helpers/wp_redirect_or_javascript.php +0 -0
- libraries/XmlCsvExport.php +3 -0
- models/export/list.php +0 -0
- models/export/record.php +0 -0
- models/model.php +0 -0
- models/model/list.php +0 -0
- models/model/record.php +0 -0
- readme.txt +8 -3
- schema.php +0 -0
- src/App/Service/Addons/AddonService.php +0 -1
- src/Reviews/ReviewLogic.php +301 -0
- src/Reviews/ReviewsUI.php +257 -0
- static/css/admin-ie.css +0 -0
- static/css/admin-wp-3.8.css +0 -0
- static/css/admin.css +3 -1
- static/img/date-picker.gif +0 -0
- static/img/down.gif +0 -0
- static/img/drag.png +0 -0
- static/img/ico-add-new.png +0 -0
- static/img/ico-remove.png +0 -0
- static/img/loading.png +0 -0
- static/img/progress_animated.gif +0 -0
- static/img/screen-options-right-up.gif +0 -0
- static/img/screen-options-right.gif +0 -0
- static/img/stars.png +0 -0
- static/js/admin.js +0 -0
- static/js/jquery/css/redmond/images/animated-overlay.gif +0 -0
- static/js/jquery/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- static/js/jquery/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100_1.png +0 -0
- static/js/jquery/css/redmond/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
- static/js/jquery/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
- static/js/jquery/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
- static/js/jquery/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- static/js/jquery/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
- static/js/jquery/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
- static/js/jquery/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
- static/js/jquery/css/redmond/images/ui-icons_217bc0_256x240.png +0 -0
- static/js/jquery/css/redmond/images/ui-icons_2e83ff_256x240.png +0 -0
- static/js/jquery/css/redmond/images/ui-icons_469bdd_256x240.png +0 -0
- static/js/jquery/css/redmond/images/ui-icons_6da8d5_256x240.png +0 -0
- static/js/jquery/css/redmond/images/ui-icons_cd0a0a_256x240.png +0 -0
- static/js/jquery/css/redmond/images/ui-icons_d8e7f3_256x240.png +0 -0
- static/js/jquery/css/redmond/images/ui-icons_f9bd01_256x240.png +0 -0
- static/js/jquery/css/redmond/jquery-ui.css +0 -0
- static/js/jquery/css/select2/select2-bootstrap.css +0 -0
- static/js/jquery/css/select2/select2-spinner.gif +0 -0
- static/js/jquery/css/select2/select2.css +0 -0
- static/js/jquery/css/select2/select2.png +0 -0
- static/js/jquery/css/smoothness/images/tipsy.gif +0 -0
- static/js/jquery/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- static/js/jquery/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- static/js/jquery/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- static/js/jquery/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- static/js/jquery/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- static/js/jquery/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- static/js/jquery/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- static/js/jquery/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- static/js/jquery/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
- static/js/jquery/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- static/js/jquery/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- static/js/jquery/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- static/js/jquery/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- static/js/jquery/css/smoothness/jquery-ui.css +0 -0
- static/js/jquery/css/smoothness/jquery.tipsy.css +0 -0
- static/js/jquery/jquery.mjs.pmxe_nestedSortable.js +7 -2
- static/js/jquery/jquery.tipsy.js +0 -0
- static/js/jquery/select2.min.js +0 -0
- static/js/jquery/ui.autocomplete.js +0 -0
- static/js/jquery/ui.datepicker.js +0 -0
- static/js/pmxe.js +0 -0
- views/admin/export/index.php +0 -0
- views/admin/export/options/settings.php +2 -2
- views/admin/export/process.php +0 -0
- views/admin/help/index.php +0 -0
- views/admin/manage/index.php +0 -7
- views/admin/settings/index.php +0 -0
- views/controller/error.php +0 -0
- wp-all-export.php +67 -60
actions/admin_init.php
CHANGED
File without changes
|
actions/admin_menu.php
CHANGED
File without changes
|
actions/admin_notices.php
CHANGED
File without changes
|
actions/wp_ajax_dismiss_review_modal.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function pmxe_wp_ajax_dismiss_review_modal(){
|
4 |
+
|
5 |
+
if ( ! check_ajax_referer( 'wp_all_export_secure', 'security', false )){
|
6 |
+
exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
|
7 |
+
}
|
8 |
+
|
9 |
+
if ( ! current_user_can( PMXE_Plugin::$capabilities ) ){
|
10 |
+
exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
|
11 |
+
}
|
12 |
+
|
13 |
+
$reviewLogic = new \Wpae\Reviews\ReviewLogic();
|
14 |
+
$reviewLogic->dismissNotice();
|
15 |
+
|
16 |
+
exit(json_encode(array('result' => true)));
|
17 |
+
}
|
actions/wp_ajax_send_feedback.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function pmxe_wp_ajax_send_feedback(){
|
4 |
+
|
5 |
+
if ( ! check_ajax_referer( 'wp_all_export_secure', 'security', false )){
|
6 |
+
exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
|
7 |
+
}
|
8 |
+
|
9 |
+
if ( ! current_user_can( PMXE_Plugin::$capabilities ) ){
|
10 |
+
exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
|
11 |
+
}
|
12 |
+
|
13 |
+
$reviewLogic = new \Wpae\Reviews\ReviewLogic();
|
14 |
+
$reviewLogic->submitFeedback();
|
15 |
+
|
16 |
+
exit(json_encode(array('result' => true)));
|
17 |
+
}
|
classes/config.php
CHANGED
File without changes
|
classes/download.php
CHANGED
File without changes
|
classes/helper.php
CHANGED
File without changes
|
classes/input.php
CHANGED
File without changes
|
classes/session.php
CHANGED
File without changes
|
config/options.php
CHANGED
File without changes
|
controllers/admin/export.php
CHANGED
File without changes
|
controllers/admin/help.php
CHANGED
File without changes
|
controllers/admin/settings.php
CHANGED
File without changes
|
controllers/controller.php
CHANGED
File without changes
|
controllers/controller/admin.php
CHANGED
File without changes
|
helpers/backward.php
CHANGED
File without changes
|
helpers/str_getcsv.php
CHANGED
File without changes
|
helpers/wp_redirect_or_javascript.php
CHANGED
File without changes
|
libraries/XmlCsvExport.php
CHANGED
@@ -802,6 +802,9 @@ final Class XmlCsvExport
|
|
802 |
foreach ($available_sections as $slug => $section) {
|
803 |
if (!empty($section['content']) and !empty($available_data[$section['content']])) {
|
804 |
foreach ($available_data[$section['content']] as $field) {
|
|
|
|
|
|
|
805 |
if (is_array($field) and (isset($field['auto']) or (!in_array('product', $post['cpt']) || !\class_exists('WooCommerce')))) {
|
806 |
$auto_generate['ids'][] = 1;
|
807 |
$auto_generate['cc_label'][] = is_array($field) ? $field['label'] : $field;
|
802 |
foreach ($available_sections as $slug => $section) {
|
803 |
if (!empty($section['content']) and !empty($available_data[$section['content']])) {
|
804 |
foreach ($available_data[$section['content']] as $field) {
|
805 |
+
if(is_string($post['cpt'])) {
|
806 |
+
$post['cpt'] = [$post['cpt']];
|
807 |
+
}
|
808 |
if (is_array($field) and (isset($field['auto']) or (!in_array('product', $post['cpt']) || !\class_exists('WooCommerce')))) {
|
809 |
$auto_generate['ids'][] = 1;
|
810 |
$auto_generate['cc_label'][] = is_array($field) ? $field['label'] : $field;
|
models/export/list.php
CHANGED
File without changes
|
models/export/record.php
CHANGED
File without changes
|
models/model.php
CHANGED
File without changes
|
models/model/list.php
CHANGED
File without changes
|
models/model/record.php
CHANGED
File without changes
|
readme.txt
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
=== Export any WordPress data to XML/CSV ===
|
2 |
Contributors: soflyy, wpallimport
|
3 |
Requires at least: 5.0
|
4 |
-
Tested up to: 5.9
|
5 |
-
Stable tag: 1.3.
|
6 |
Tags: export, wordpress csv export, wordpress xml export, export woocommerce, migrate, export csv from wordpress, export xml from wordpress, advanced xml export, advanced csv export, export data, bulk csv export, export custom post type, export woocommerce products, export woocommerce orders, migrate woocommerce, csv export, export csv, xml export, export xml, csv exporter, datafeed
|
7 |
|
8 |
Easily export any data from WordPress. Drag & drop to create a completely custom spreadsheet, CSV, or XML file.
|
@@ -59,7 +59,7 @@ For technical support from the developers, please consider purchasing WP All Exp
|
|
59 |
|
60 |
= Automatic Scheduling =
|
61 |
|
62 |
-
A new service from Soflyy, Automatic Scheduling provides a simple interface for setting exports to run on a schedule. The service will make sure that your exports start on time and that they successfully complete without the need to set up individual cron jobs.
|
63 |
|
64 |
It costs $9/mo and can be used with WP All Export and WP All Import. You can set up as many exports and imports on as many sites as you like.
|
65 |
|
@@ -91,6 +91,11 @@ Either: -
|
|
91 |
|
92 |
== Changelog ==
|
93 |
|
|
|
|
|
|
|
|
|
|
|
94 |
= 1.3.3 =
|
95 |
* new feature: compatibility with the Gravity Forms Export Add-On
|
96 |
* improvement: fallback to PclZip if ZipArchive isn't available
|
1 |
=== Export any WordPress data to XML/CSV ===
|
2 |
Contributors: soflyy, wpallimport
|
3 |
Requires at least: 5.0
|
4 |
+
Tested up to: 5.9.2
|
5 |
+
Stable tag: 1.3.4
|
6 |
Tags: export, wordpress csv export, wordpress xml export, export woocommerce, migrate, export csv from wordpress, export xml from wordpress, advanced xml export, advanced csv export, export data, bulk csv export, export custom post type, export woocommerce products, export woocommerce orders, migrate woocommerce, csv export, export csv, xml export, export xml, csv exporter, datafeed
|
7 |
|
8 |
Easily export any data from WordPress. Drag & drop to create a completely custom spreadsheet, CSV, or XML file.
|
59 |
|
60 |
= Automatic Scheduling =
|
61 |
|
62 |
+
A new service from Soflyy, Automatic Scheduling provides a simple interface for setting exports to run on a schedule. The service will make sure that your exports start on time and that they successfully complete without the need to set up individual cron jobs.
|
63 |
|
64 |
It costs $9/mo and can be used with WP All Export and WP All Import. You can set up as many exports and imports on as many sites as you like.
|
65 |
|
91 |
|
92 |
== Changelog ==
|
93 |
|
94 |
+
|
95 |
+
= 1.3.4 =
|
96 |
+
* improvement: UI updates
|
97 |
+
* bug fix: PHP 8 compatibility
|
98 |
+
|
99 |
= 1.3.3 =
|
100 |
* new feature: compatibility with the Gravity Forms Export Add-On
|
101 |
* improvement: fallback to PclZip if ZipArchive isn't available
|
schema.php
CHANGED
File without changes
|
src/App/Service/Addons/AddonService.php
CHANGED
@@ -9,7 +9,6 @@ class AddonService
|
|
9 |
return defined('PMUE_EDITION');
|
10 |
}
|
11 |
|
12 |
-
|
13 |
public function isWooCommerceAddonActive() {
|
14 |
return defined('PMWE_EDITION');
|
15 |
}
|
9 |
return defined('PMUE_EDITION');
|
10 |
}
|
11 |
|
|
|
12 |
public function isWooCommerceAddonActive() {
|
13 |
return defined('PMWE_EDITION');
|
14 |
}
|
src/Reviews/ReviewLogic.php
ADDED
@@ -0,0 +1,301 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Wpae\Reviews;
|
4 |
+
|
5 |
+
|
6 |
+
class ReviewLogic
|
7 |
+
{
|
8 |
+
const MAILTO = 'support@wpallimport.com';
|
9 |
+
const SUBJECT = 'New Feedback';
|
10 |
+
|
11 |
+
private $wpdb;
|
12 |
+
|
13 |
+
private $exports = false;
|
14 |
+
|
15 |
+
private $pluginName = '';
|
16 |
+
|
17 |
+
private $pluginReviewLink = '';
|
18 |
+
|
19 |
+
private $modalType;
|
20 |
+
|
21 |
+
private $pluginModalText;
|
22 |
+
|
23 |
+
public function __construct()
|
24 |
+
{
|
25 |
+
global $wpdb;
|
26 |
+
|
27 |
+
$this->wpdb = $wpdb;
|
28 |
+
}
|
29 |
+
|
30 |
+
|
31 |
+
|
32 |
+
public function shouldShowReviewModal()
|
33 |
+
{
|
34 |
+
|
35 |
+
// Only display on the Manage Exports page.
|
36 |
+
if($_GET['page'] !== 'pmxe-admin-manage' || isset($_GET['id']) ){
|
37 |
+
return false;
|
38 |
+
}
|
39 |
+
|
40 |
+
if($this->hasMoreThan4ModalsDismissed()) {
|
41 |
+
return false;
|
42 |
+
}
|
43 |
+
|
44 |
+
if(!$this->hasExportsThatMatch()) {
|
45 |
+
return false;
|
46 |
+
}
|
47 |
+
|
48 |
+
if($this->thereWasAModalInTheLast30Days()) {
|
49 |
+
return false;
|
50 |
+
}
|
51 |
+
|
52 |
+
$modalToShow = $this->getModalToShow();
|
53 |
+
|
54 |
+
$this->modalType = $modalToShow;
|
55 |
+
|
56 |
+
if($modalToShow == 'orders') {
|
57 |
+
$this->pluginName = 'WooCommerce Order Export Add-On';
|
58 |
+
$this->pluginReviewLink = 'https://wordpress.org/plugins/order-export-for-woocommerce/#reviews';
|
59 |
+
$this->pluginModalText ='How was your experience exporting WooCommerce orders with WP All Export?';
|
60 |
+
return true;
|
61 |
+
}
|
62 |
+
|
63 |
+
if($modalToShow == 'users') {
|
64 |
+
$this->pluginName = 'User Export Add-On';
|
65 |
+
$this->pluginReviewLink = 'https://wordpress.org/plugins/export-wp-users-xml-csv/#reviews';
|
66 |
+
$this->pluginModalText ='How was your experience exporting users with WP All Export?';
|
67 |
+
return true;
|
68 |
+
}
|
69 |
+
|
70 |
+
if($modalToShow == 'products') {
|
71 |
+
$this->pluginName = 'WooCommerce Product Export Add-On';
|
72 |
+
$this->pluginReviewLink = 'https://wordpress.org/plugins/product-export-for-woocommerce/#reviews';
|
73 |
+
$this->pluginModalText ='How was your experience exporting WooCommerce products with WP All Export?';
|
74 |
+
return true;
|
75 |
+
}
|
76 |
+
|
77 |
+
if($modalToShow === 'wpae') {
|
78 |
+
|
79 |
+
if(defined('PMXE_EDITION') && PMXE_EDITION === 'free') {
|
80 |
+
$this->pluginName = 'WP All Export';
|
81 |
+
}else{
|
82 |
+
$this->pluginName = 'WP All Export Pro';
|
83 |
+
}
|
84 |
+
$this->pluginReviewLink = 'https://wordpress.org/plugins/wp-all-export/#reviews';
|
85 |
+
$this->pluginModalText = 'How was your experience exporting records with WP All Export?';
|
86 |
+
return true;
|
87 |
+
}
|
88 |
+
|
89 |
+
|
90 |
+
return false;
|
91 |
+
}
|
92 |
+
|
93 |
+
public function dismissNotice()
|
94 |
+
{
|
95 |
+
if (current_user_can('manage_options')) {
|
96 |
+
update_option('wpae_modal_review_dismissed', true, false);
|
97 |
+
update_option('wpae_modal_review_dismissed_time', time(), false);
|
98 |
+
|
99 |
+
$dismissedModals = get_option('wpae_modal_review_dismissed_modals', []);
|
100 |
+
|
101 |
+
$dismissModalType = esc_html($_POST['modal_type']);
|
102 |
+
|
103 |
+
if(!is_array($dismissedModals)) {
|
104 |
+
$dismissedModals = [];
|
105 |
+
}
|
106 |
+
|
107 |
+
$dismissedModals[] = $dismissModalType;
|
108 |
+
update_option('wpae_modal_review_dismissed_modals', $dismissedModals);
|
109 |
+
|
110 |
+
$dismissedTimes = get_option('wpae_modal_review_dismissed_times', 0);
|
111 |
+
$dismissedTimes++;
|
112 |
+
|
113 |
+
update_option('wpae_modal_review_dismissed_times', $dismissedTimes, false);
|
114 |
+
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
public function submitFeedback()
|
119 |
+
{
|
120 |
+
|
121 |
+
$headers = ['Content-Type: text/html; charset=UTF-8'];
|
122 |
+
|
123 |
+
$this->dismissNotice();
|
124 |
+
|
125 |
+
$proInUse = '';
|
126 |
+
|
127 |
+
// Check if WP All Export Pro is installed
|
128 |
+
if( defined('PMXE_EDITION') && PMXE_EDITION === 'paid' ){
|
129 |
+
$proInUse .= 'Installed Pro Plugin: WP All Export Pro <br/><br/>';
|
130 |
+
}
|
131 |
+
|
132 |
+
// Check if the WooCommerce Export Add-On is installed
|
133 |
+
if( class_exists('PMWE_Plugin') and PMWE_EDITION == "paid" ){
|
134 |
+
$proInUse .= 'Installed Pro Plugin: WooCommerce Export Add-On Pro <br/><br/>';
|
135 |
+
}
|
136 |
+
|
137 |
+
// Check if the User Export Add-On is installed.
|
138 |
+
if ( class_exists('PMUE_Plugin') and PMUE_EDITION == "paid"){
|
139 |
+
$proInUse .= 'Installed Pro Plugin: User Export Add-On Pro <br/><br/>';
|
140 |
+
}
|
141 |
+
|
142 |
+
// Prettify the reviewed plugin.
|
143 |
+
$plugin = 'Plugin Reviewed: ';
|
144 |
+
switch( $_POST['plugin'] ){
|
145 |
+
case 'wpae':
|
146 |
+
$plugin .= 'WP All Export';
|
147 |
+
break;
|
148 |
+
case 'orders':
|
149 |
+
$plugin .= 'Order Export Add-On';
|
150 |
+
break;
|
151 |
+
|
152 |
+
case 'users':
|
153 |
+
$plugin .= 'User Export Add-On';
|
154 |
+
break;
|
155 |
+
|
156 |
+
case 'products':
|
157 |
+
$plugin .= 'Product Export Add-On';
|
158 |
+
break;
|
159 |
+
}
|
160 |
+
|
161 |
+
$message = $plugin . " <br/><br/>" . $proInUse . wp_kses_post(stripslashes(wpautop($_POST['message'])));
|
162 |
+
wp_mail( self::MAILTO, self::SUBJECT, $message, $headers );
|
163 |
+
}
|
164 |
+
|
165 |
+
|
166 |
+
public function getPluginName() {
|
167 |
+
return $this->pluginName;
|
168 |
+
}
|
169 |
+
|
170 |
+
public function getReviewLink() {
|
171 |
+
return $this->pluginReviewLink;
|
172 |
+
}
|
173 |
+
|
174 |
+
public function getModalType() {
|
175 |
+
return $this->modalType;
|
176 |
+
}
|
177 |
+
|
178 |
+
public function getModalText() {
|
179 |
+
return $this->pluginModalText;
|
180 |
+
}
|
181 |
+
|
182 |
+
private function getModalToShow()
|
183 |
+
{
|
184 |
+
$exportCount = [
|
185 |
+
'users' => 0,
|
186 |
+
'products' => 0,
|
187 |
+
'orders' => 0
|
188 |
+
];
|
189 |
+
|
190 |
+
// Only show modal for export types that have been on the site for at least two days.
|
191 |
+
$exportOlderThanTwoDays = [
|
192 |
+
'users' => false,
|
193 |
+
'products' => false,
|
194 |
+
'orders' => false
|
195 |
+
];
|
196 |
+
|
197 |
+
$exports = $this->getExports();
|
198 |
+
|
199 |
+
// Go through the exports and find the export count for each export type
|
200 |
+
foreach($exports as $export) {
|
201 |
+
$options = maybe_unserialize($export->options);
|
202 |
+
|
203 |
+
if ($options) {
|
204 |
+
|
205 |
+
$cpt = $options['cpt'];
|
206 |
+
|
207 |
+
if (!is_array($cpt)) {
|
208 |
+
$cpt = [$cpt];
|
209 |
+
}
|
210 |
+
|
211 |
+
// Is user export
|
212 |
+
if (in_array('users', $cpt) || in_array('shop_customer', $cpt)) {
|
213 |
+
$exportCount['users']++;
|
214 |
+
if( strtotime($export->created_at) < time() - 2 * 24 * 3600 ){
|
215 |
+
$exportOlderThanTwoDays['users'] = true;
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
+
// Is product export
|
220 |
+
if (in_array('product', $cpt)) {
|
221 |
+
$exportCount['products']++;
|
222 |
+
if( strtotime($export->created_at) < time() - 2 * 24 * 3600 ){
|
223 |
+
$exportOlderThanTwoDays['products'] = true;
|
224 |
+
}
|
225 |
+
}
|
226 |
+
|
227 |
+
// Is order export
|
228 |
+
if (in_array('shop_order', $cpt)) {
|
229 |
+
$exportCount['orders']++;
|
230 |
+
if( strtotime($export->created_at) < time() - 2 * 24 * 3600 ){
|
231 |
+
$exportOlderThanTwoDays['orders'] = true;
|
232 |
+
}
|
233 |
+
}
|
234 |
+
}
|
235 |
+
}
|
236 |
+
|
237 |
+
// Get the plugin with most exports
|
238 |
+
$max = 0;
|
239 |
+
$plugin = false;
|
240 |
+
|
241 |
+
$dismissedModals = get_option('wpae_modal_review_dismissed_modals', []);
|
242 |
+
|
243 |
+
foreach($exportCount as $key => $exports) {
|
244 |
+
if($exports > $max && !in_array($key, $dismissedModals) && $exportOlderThanTwoDays[$key]) {
|
245 |
+
$plugin = $key;
|
246 |
+
$max = $exports;
|
247 |
+
}
|
248 |
+
}
|
249 |
+
|
250 |
+
if(!$plugin && !in_array('wpae', $dismissedModals)) {
|
251 |
+
$plugin = 'wpae';
|
252 |
+
}
|
253 |
+
|
254 |
+
return $plugin;
|
255 |
+
}
|
256 |
+
|
257 |
+
|
258 |
+
private function thereWasAModalInTheLast30Days()
|
259 |
+
{
|
260 |
+
$lastModalDismissed = get_option('wpae_modal_review_dismissed_time');
|
261 |
+
|
262 |
+
if( $lastModalDismissed > time() - 30 * 24 * 3600 ) {
|
263 |
+
|
264 |
+
return true;
|
265 |
+
}
|
266 |
+
|
267 |
+
return false;
|
268 |
+
}
|
269 |
+
|
270 |
+
private function hasExportsThatMatch(){
|
271 |
+
|
272 |
+
$exportsOlderThan48Hours = $this->wpdb->get_results("SELECT * FROM " . $this->wpdb->prefix . "pmxe_exports WHERE created_at < NOW() - INTERVAL 2 DAY AND created_at <> '0000-00-00 00:00:00' ");
|
273 |
+
|
274 |
+
$exports = $this->getExports();
|
275 |
+
|
276 |
+
return (count($exportsOlderThan48Hours) >= 1 && count($exports) >= 5 );
|
277 |
+
}
|
278 |
+
|
279 |
+
/**
|
280 |
+
* @return exports[]
|
281 |
+
*/
|
282 |
+
private function getExports()
|
283 |
+
{
|
284 |
+
if (!$this->exports) {
|
285 |
+
$this->exports = $this->wpdb->get_results("SELECT * FROM " . $this->wpdb->prefix . "pmxe_exports");
|
286 |
+
}
|
287 |
+
|
288 |
+
return $this->exports;
|
289 |
+
}
|
290 |
+
|
291 |
+
private function hasMoreThan4ModalsDismissed()
|
292 |
+
{
|
293 |
+
$dismissedTimes = get_option('wpae_modal_review_dismissed_times', 0);
|
294 |
+
|
295 |
+
if($dismissedTimes > 4) {
|
296 |
+
return true;
|
297 |
+
}
|
298 |
+
|
299 |
+
return false;
|
300 |
+
}
|
301 |
+
}
|
src/Reviews/ReviewsUI.php
ADDED
@@ -0,0 +1,257 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Wpae\Reviews;
|
4 |
+
|
5 |
+
class ReviewsUI
|
6 |
+
{
|
7 |
+
|
8 |
+
private $reviewLogic;
|
9 |
+
|
10 |
+
public function __construct()
|
11 |
+
{
|
12 |
+
$this->reviewLogic = new ReviewLogic();
|
13 |
+
}
|
14 |
+
|
15 |
+
public function render()
|
16 |
+
{
|
17 |
+
|
18 |
+
if($this->reviewLogic->shouldShowReviewModal()) {
|
19 |
+
|
20 |
+
?>
|
21 |
+
<style type="text/css">
|
22 |
+
.wpallexport-plugin .wpae-reviews-notice {
|
23 |
+
margin-top: 40px;
|
24 |
+
padding-top: 18px;
|
25 |
+
padding-bottom: 22px;
|
26 |
+
}
|
27 |
+
|
28 |
+
.wpae-reviews-notice h1 {
|
29 |
+
color: #435F9A;
|
30 |
+
font-size: 1.4em;
|
31 |
+
font-weight: 500;
|
32 |
+
padding: 0;
|
33 |
+
}
|
34 |
+
|
35 |
+
.wpae-buttons-container {
|
36 |
+
margin-top: 10px;
|
37 |
+
}
|
38 |
+
|
39 |
+
.wpae-reviews-notice .wpae-buttons-container button, #wpae-feedback button {
|
40 |
+
padding: 6px 10px;
|
41 |
+
margin-right: 9px;
|
42 |
+
position: relative;
|
43 |
+
text-decoration: none;
|
44 |
+
border: 1px solid #435F9A;
|
45 |
+
border-radius: 2px;
|
46 |
+
text-shadow: none;
|
47 |
+
font-weight: 500;
|
48 |
+
font-size: 1.1em;
|
49 |
+
line-height: normal;
|
50 |
+
color: #435F9A;
|
51 |
+
cursor: pointer;
|
52 |
+
background-color: white;
|
53 |
+
}
|
54 |
+
|
55 |
+
.wpae-reviews-notice .wpae-buttons-container button:hover, #wpae-feedback button:hover {
|
56 |
+
background: #f0f0f1;
|
57 |
+
border-color: #0a4b78;
|
58 |
+
color: #0a4b78;
|
59 |
+
}
|
60 |
+
.wpae-reviews-notice .wpae-buttons-container button:focus, #wpae-feedback button:focus {
|
61 |
+
border: 1px solid rgba(0, 0, 0, 0.5);
|
62 |
+
outline: none;
|
63 |
+
}
|
64 |
+
|
65 |
+
.wpae-reviews-notice button:hover {
|
66 |
+
background-color: #FAFAFA;
|
67 |
+
}
|
68 |
+
|
69 |
+
#wpae-review {
|
70 |
+
display: none;
|
71 |
+
justify-content: flex-start;
|
72 |
+
align-items: baseline;
|
73 |
+
}
|
74 |
+
|
75 |
+
#wpae-review p, #wpae-feedback p {
|
76 |
+
display: block;
|
77 |
+
font-size: 1.1em;
|
78 |
+
}
|
79 |
+
|
80 |
+
#wpae-review .wpae-buttons-container {
|
81 |
+
justify-content: flex-start;
|
82 |
+
|
83 |
+
}
|
84 |
+
|
85 |
+
#wpae-feedback {
|
86 |
+
display: none;
|
87 |
+
justify-content: flex-start;
|
88 |
+
align-items: baseline;
|
89 |
+
}
|
90 |
+
|
91 |
+
#wpae-feedback textarea {
|
92 |
+
width: 100%;
|
93 |
+
height: 100px;
|
94 |
+
}
|
95 |
+
|
96 |
+
#wpae-feedback .wpae-submit-feedback {
|
97 |
+
display: flex;
|
98 |
+
flex-direction: row;
|
99 |
+
align-items: center;
|
100 |
+
margin-top: 10px;
|
101 |
+
}
|
102 |
+
|
103 |
+
#wpae-feedback .wpae-submit-feedback button {
|
104 |
+
margin-right: 10px;
|
105 |
+
}
|
106 |
+
|
107 |
+
.wpae-reviews-notice .notice-dismiss {
|
108 |
+
position: relative;
|
109 |
+
float: right;
|
110 |
+
top: -15px;
|
111 |
+
right: -10px;
|
112 |
+
}
|
113 |
+
.wpae-reviews-notice .notice-dismiss:focus {
|
114 |
+
border: none;
|
115 |
+
box-shadow: none;
|
116 |
+
}
|
117 |
+
|
118 |
+
|
119 |
+
.wpae-submit-confirmation {
|
120 |
+
padding-top: 20px;
|
121 |
+
padding-bottom: 20px;
|
122 |
+
display: none;
|
123 |
+
}
|
124 |
+
</style>
|
125 |
+
<script type="text/javascript">
|
126 |
+
jQuery(document).ready(function () {
|
127 |
+
jQuery('.wpae-review-buttons button').click(function (e) {
|
128 |
+
|
129 |
+
e.preventDefault();
|
130 |
+
var val = jQuery(this).data('review');
|
131 |
+
|
132 |
+
if (val === 'good') {
|
133 |
+
jQuery('#wpae-ask-for-review').fadeOut(function () {
|
134 |
+
jQuery('#wpae-review').fadeIn();
|
135 |
+
});
|
136 |
+
} else {
|
137 |
+
jQuery('#wpae-ask-for-review').fadeOut(function () {
|
138 |
+
jQuery('#wpae-feedback').fadeIn();
|
139 |
+
});
|
140 |
+
}
|
141 |
+
|
142 |
+
return false;
|
143 |
+
});
|
144 |
+
|
145 |
+
jQuery('.wpae-reviews-notice .notice-dismiss').click(function(e){
|
146 |
+
|
147 |
+
e.preventDefault();
|
148 |
+
e.stopImmediatePropagation();
|
149 |
+
var request = {
|
150 |
+
action: 'dismiss_review_modal',
|
151 |
+
security: wp_all_export_security,
|
152 |
+
modal_type: jQuery('#wpae-modal-type').val()
|
153 |
+
};
|
154 |
+
|
155 |
+
jQuery.ajax({
|
156 |
+
type: 'POST',
|
157 |
+
url: '<?php echo admin_url( "admin-ajax.php" ); ?>',
|
158 |
+
data: request,
|
159 |
+
success: function(response) {},
|
160 |
+
dataType: "json"
|
161 |
+
});
|
162 |
+
|
163 |
+
jQuery('.wpae-reviews-notice').slideUp();
|
164 |
+
});
|
165 |
+
|
166 |
+
jQuery('.review-link').click(function(){
|
167 |
+
|
168 |
+
var request = {
|
169 |
+
action: 'dismiss_review_modal',
|
170 |
+
security: wp_all_export_security,
|
171 |
+
modal_type: jQuery('#wpae-modal-type').val()
|
172 |
+
};
|
173 |
+
|
174 |
+
jQuery.ajax({
|
175 |
+
type: 'POST',
|
176 |
+
url: '<?php echo admin_url( "admin-ajax.php" ); ?>',
|
177 |
+
data: request,
|
178 |
+
success: function(response) {},
|
179 |
+
dataType: "json"
|
180 |
+
});
|
181 |
+
|
182 |
+
jQuery('.wpae-reviews-notice').slideUp();
|
183 |
+
|
184 |
+
});
|
185 |
+
|
186 |
+
jQuery('.wpae-submit-feedback button').click(function(){
|
187 |
+
|
188 |
+
jQuery(this).prop("disabled", true);
|
189 |
+
|
190 |
+
var request = {
|
191 |
+
action: 'send_feedback',
|
192 |
+
modal_type: jQuery('#wpae-modal-type').val(),
|
193 |
+
security: wp_all_export_security,
|
194 |
+
plugin: jQuery('#wpae-modal-type').val(),
|
195 |
+
message: jQuery('#wpae-feedback-message').val()
|
196 |
+
};
|
197 |
+
|
198 |
+
jQuery.ajax({
|
199 |
+
type: 'POST',
|
200 |
+
url: '<?php echo admin_url( "admin-ajax.php" ); ?>',
|
201 |
+
data: request,
|
202 |
+
success: function(response) {
|
203 |
+
jQuery('.wpae-submit-confirmation').show();
|
204 |
+
jQuery('.wpae-review-form').hide();
|
205 |
+
|
206 |
+
},
|
207 |
+
dataType: "json"
|
208 |
+
});
|
209 |
+
|
210 |
+
});
|
211 |
+
});
|
212 |
+
</script>
|
213 |
+
<input type="hidden" id="wpae-modal-type" value="<?php esc_attr_e($this->reviewLogic->getModalType()) ;?>" />
|
214 |
+
<div style="" class="notice notice-info wpae-reviews-notice">
|
215 |
+
<button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button>
|
216 |
+
<div id="wpae-ask-for-review">
|
217 |
+
<h1><?php printf(esc_html_e($this->reviewLogic->getModalText()), 'wp-all-export-plugin'); ?></h1>
|
218 |
+
|
219 |
+
<div class="wpae-buttons-container wpae-review-buttons">
|
220 |
+
<button data-review="good"><?php esc_html_e('Good', 'wp-all-export-plugin'); ?></button>
|
221 |
+
<button data-review="ok"><?php esc_html_e('Just Ok', 'wp-all-export-plugin'); ?></button>
|
222 |
+
<button data-review="bad"><?php esc_html_e('Bad', 'wp-all-export-plugin'); ?></button>
|
223 |
+
</div>
|
224 |
+
</div>
|
225 |
+
<div id="wpae-review">
|
226 |
+
<h1><?php esc_html_e('That is great to hear, thank you for the feedback!', 'wp-all-export-plugin'); ?></h1>
|
227 |
+
<p>
|
228 |
+
<?php esc_html_e("Would you be willing to do us a small favor? Unhappy customers are quick to publicly complain, but happy customers rarely speak up and share their good experiences.", 'wp-all-export-plugin'); ?>
|
229 |
+
</br>
|
230 |
+
<?php esc_html_e("If you have a moment, we would love for you to review our add-on in the WordPress.org plugin repository.", 'wp-all-export-plugin'); ?>
|
231 |
+
</p>
|
232 |
+
<div class="wpae-buttons-container">
|
233 |
+
<a class="review-link" href="<?php echo esc_attr($this->reviewLogic->getReviewLink()); ?>" target="_blank">
|
234 |
+
<button><?php printf(esc_html__('Review the %s', 'wp-all-export-plugin'), $this->reviewLogic->getPluginName() ); ?></button>
|
235 |
+
</a>
|
236 |
+
</div>
|
237 |
+
</div>
|
238 |
+
<div id="wpae-feedback">
|
239 |
+
<div class="wpae-review-form">
|
240 |
+
<h1><?php esc_html_e('Thank you for your feedback, it really helps us improve our products.', 'wp-all-export-plugin'); ?></h1>
|
241 |
+
<p><?php esc_html_e('If you could improve one thing about WP All Export, what would it be?', 'wp-all-export-plugin'); ?></p>
|
242 |
+
<textarea id="wpae-feedback-message"></textarea>
|
243 |
+
<div class="wpae-submit-feedback">
|
244 |
+
<button><?php esc_html_e('Submit', 'wp-all-export-plugin'); ?></button>
|
245 |
+
</div>
|
246 |
+
</div>
|
247 |
+
<div class="wpae-submit-confirmation">
|
248 |
+
Thank you for your feedback. Your message was emailed to support@wpallimport.com from <?php echo get_option('admin_email'); ?>. If you do not receive a confirmation email, it means we didn't receive your message for some reason.
|
249 |
+
</div>
|
250 |
+
|
251 |
+
</div>
|
252 |
+
</div>
|
253 |
+
<?php
|
254 |
+
}
|
255 |
+
}
|
256 |
+
|
257 |
+
}
|
static/css/admin-ie.css
CHANGED
File without changes
|
static/css/admin-wp-3.8.css
CHANGED
File without changes
|
static/css/admin.css
CHANGED
@@ -4492,4 +4492,6 @@ input label {
|
|
4492 |
|
4493 |
.wpallexport-plugin .download-import-templates h2 {
|
4494 |
margin-bottom: 10px;
|
4495 |
-
}
|
|
|
|
4492 |
|
4493 |
.wpallexport-plugin .download-import-templates h2 {
|
4494 |
margin-bottom: 10px;
|
4495 |
+
}
|
4496 |
+
|
4497 |
+
|
static/img/date-picker.gif
CHANGED
File without changes
|
static/img/down.gif
CHANGED
File without changes
|
static/img/drag.png
CHANGED
File without changes
|
static/img/ico-add-new.png
CHANGED
File without changes
|
static/img/ico-remove.png
CHANGED
File without changes
|
static/img/loading.png
CHANGED
File without changes
|
static/img/progress_animated.gif
CHANGED
File without changes
|
static/img/screen-options-right-up.gif
CHANGED
File without changes
|
static/img/screen-options-right.gif
CHANGED
File without changes
|
static/img/stars.png
CHANGED
File without changes
|
static/js/admin.js
CHANGED
File without changes
|
static/js/jquery/css/redmond/images/animated-overlay.gif
CHANGED
File without changes
|
static/js/jquery/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png
CHANGED
File without changes
|
static/js/jquery/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100_1.png
CHANGED
File without changes
|
static/js/jquery/css/redmond/images/ui-bg_flat_55_fbec88_40x100.png
CHANGED
File without changes
|
static/js/jquery/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png
CHANGED
File without changes
|
static/js/jquery/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.png
CHANGED
File without changes
|
static/js/jquery/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.png
CHANGED
File without changes
|
static/js/jquery/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png
CHANGED
File without changes
|
static/js/jquery/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png
CHANGED
File without changes
|
static/js/jquery/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png
CHANGED
File without changes
|
static/js/jquery/css/redmond/images/ui-icons_217bc0_256x240.png
CHANGED
File without changes
|
static/js/jquery/css/redmond/images/ui-icons_2e83ff_256x240.png
CHANGED
File without changes
|
static/js/jquery/css/redmond/images/ui-icons_469bdd_256x240.png
CHANGED
File without changes
|
static/js/jquery/css/redmond/images/ui-icons_6da8d5_256x240.png
CHANGED
File without changes
|
static/js/jquery/css/redmond/images/ui-icons_cd0a0a_256x240.png
CHANGED
File without changes
|
static/js/jquery/css/redmond/images/ui-icons_d8e7f3_256x240.png
CHANGED
File without changes
|
static/js/jquery/css/redmond/images/ui-icons_f9bd01_256x240.png
CHANGED
File without changes
|
static/js/jquery/css/redmond/jquery-ui.css
CHANGED
File without changes
|
static/js/jquery/css/select2/select2-bootstrap.css
CHANGED
File without changes
|
static/js/jquery/css/select2/select2-spinner.gif
CHANGED
File without changes
|
static/js/jquery/css/select2/select2.css
CHANGED
File without changes
|
static/js/jquery/css/select2/select2.png
CHANGED
File without changes
|
static/js/jquery/css/smoothness/images/tipsy.gif
CHANGED
File without changes
|
static/js/jquery/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
CHANGED
File without changes
|
static/js/jquery/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
CHANGED
File without changes
|
static/js/jquery/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
CHANGED
File without changes
|
static/js/jquery/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
CHANGED
File without changes
|
static/js/jquery/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png
CHANGED
File without changes
|
static/js/jquery/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
CHANGED
File without changes
|
static/js/jquery/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
CHANGED
File without changes
|
static/js/jquery/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
CHANGED
File without changes
|
static/js/jquery/css/smoothness/images/ui-icons_222222_256x240.png
CHANGED
File without changes
|
static/js/jquery/css/smoothness/images/ui-icons_2e83ff_256x240.png
CHANGED
File without changes
|
static/js/jquery/css/smoothness/images/ui-icons_454545_256x240.png
CHANGED
File without changes
|
static/js/jquery/css/smoothness/images/ui-icons_888888_256x240.png
CHANGED
File without changes
|
static/js/jquery/css/smoothness/images/ui-icons_cd0a0a_256x240.png
CHANGED
File without changes
|
static/js/jquery/css/smoothness/jquery-ui.css
CHANGED
File without changes
|
static/js/jquery/css/smoothness/jquery.tipsy.css
CHANGED
File without changes
|
static/js/jquery/jquery.mjs.pmxe_nestedSortable.js
CHANGED
@@ -86,6 +86,11 @@
|
|
86 |
$.ui.ddmanager.prepareOffsets(this, event);
|
87 |
}
|
88 |
|
|
|
|
|
|
|
|
|
|
|
89 |
//Regenerate the absolute position used for position checks
|
90 |
this.positionAbs = this._convertPositionTo("absolute");
|
91 |
|
@@ -332,7 +337,7 @@
|
|
332 |
depth --;
|
333 |
}
|
334 |
|
335 |
-
id = ($(item).attr(o.attribute || 'id')).match(o.expression || (/(.+)[-=_](.+)/));
|
336 |
|
337 |
if (depth === sDepth + 1) {
|
338 |
pid = o.rootID;
|
@@ -428,4 +433,4 @@
|
|
428 |
}));
|
429 |
|
430 |
$.mjs.pmxe_nestedSortable.prototype.options = $.extend({}, $.ui.sortable.prototype.options, $.mjs.pmxe_nestedSortable.prototype.options);
|
431 |
-
})(jQuery);
|
86 |
$.ui.ddmanager.prepareOffsets(this, event);
|
87 |
}
|
88 |
|
89 |
+
this.dragDirection = {
|
90 |
+
vertical: this._getDragVerticalDirection(),
|
91 |
+
horizontal: this._getDragHorizontalDirection()
|
92 |
+
};
|
93 |
+
|
94 |
//Regenerate the absolute position used for position checks
|
95 |
this.positionAbs = this._convertPositionTo("absolute");
|
96 |
|
337 |
depth --;
|
338 |
}
|
339 |
|
340 |
+
id = ($(item).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
|
341 |
|
342 |
if (depth === sDepth + 1) {
|
343 |
pid = o.rootID;
|
433 |
}));
|
434 |
|
435 |
$.mjs.pmxe_nestedSortable.prototype.options = $.extend({}, $.ui.sortable.prototype.options, $.mjs.pmxe_nestedSortable.prototype.options);
|
436 |
+
})(jQuery);
|
static/js/jquery/jquery.tipsy.js
CHANGED
File without changes
|
static/js/jquery/select2.min.js
CHANGED
File without changes
|
static/js/jquery/ui.autocomplete.js
CHANGED
File without changes
|
static/js/jquery/ui.datepicker.js
CHANGED
File without changes
|
static/js/pmxe.js
CHANGED
File without changes
|
views/admin/export/index.php
CHANGED
File without changes
|
views/admin/export/options/settings.php
CHANGED
@@ -64,8 +64,8 @@ if(!defined('ABSPATH')) {
|
|
64 |
<hr>
|
65 |
<p style="text-align:right;">
|
66 |
<div class="input">
|
67 |
-
<label for="save_import_as" style="width: 103px;"><?php esc_html_e('
|
68 |
-
<input type="text" name="friendly_name" title="<?php esc_html_e('Save
|
69 |
</div>
|
70 |
</p>
|
71 |
</td>
|
64 |
<hr>
|
65 |
<p style="text-align:right;">
|
66 |
<div class="input">
|
67 |
+
<label for="save_import_as" style="width: 103px;"><?php esc_html_e('Export Name:','wp_all_export_plugin');?></label>
|
68 |
+
<input type="text" name="friendly_name" title="<?php esc_html_e('Save Export Name...', 'pmxi_plugin') ?>" style="vertical-align:middle; background:#fff !important; width: 350px;" value="<?php echo wp_all_export_clear_xss(esc_attr($post['friendly_name'])); ?>" />
|
69 |
</div>
|
70 |
</p>
|
71 |
</td>
|
views/admin/export/process.php
CHANGED
File without changes
|
views/admin/help/index.php
CHANGED
File without changes
|
views/admin/manage/index.php
CHANGED
@@ -297,13 +297,6 @@ $columns = apply_filters('pmxe_manage_imports_columns', $columns);
|
|
297 |
}
|
298 |
}
|
299 |
|
300 |
-
// if ($is_re_import_allowed and wp_all_export_is_compatible() and ! empty($item['options']['import_id'])){
|
301 |
-
// $import = new PMXI_Import_Record();
|
302 |
-
// $import->getById($item['options']['import_id']);
|
303 |
-
// if ($import->isEmpty() or $import->parent_import_id == 0){
|
304 |
-
// $item['options']['import_id'] = 0;
|
305 |
-
// }
|
306 |
-
// }
|
307 |
}
|
308 |
|
309 |
?>
|
297 |
}
|
298 |
}
|
299 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
}
|
301 |
|
302 |
?>
|
views/admin/settings/index.php
CHANGED
File without changes
|
views/controller/error.php
CHANGED
File without changes
|
wp-all-export.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP All Export
|
4 |
Plugin URI: http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=export-plugin-free&utm_medium=wp-plugins-page&utm_campaign=upgrade-to-pro
|
5 |
Description: Export any post type to a CSV or XML file. Edit the exported data, and then re-import it later using WP All Import.
|
6 |
-
Version: 1.3.
|
7 |
Author: Soflyy
|
8 |
*/
|
9 |
|
@@ -33,20 +33,20 @@ define('PMXE_ROOT_URL', rtrim(plugin_dir_url(__FILE__), '/'));
|
|
33 |
if ( class_exists('PMXE_Plugin') and PMXE_EDITION == "paid"){
|
34 |
|
35 |
function pmxe_notice(){
|
36 |
-
|
37 |
?>
|
38 |
<div class="error">
|
39 |
<p>
|
40 |
<?php printf(esc_html__('Please de-activate and remove the free version of the WP All Export before activating the paid version.', 'wp_all_export_plugin')); ?>
|
41 |
</p>
|
42 |
</div>
|
43 |
-
<?php
|
44 |
|
45 |
deactivate_plugins( str_replace('\\', '/', dirname(__FILE__)) . '/wp-all-export.php');
|
46 |
|
47 |
}
|
48 |
|
49 |
-
add_action('admin_notices', 'pmxe_notice');
|
50 |
|
51 |
}
|
52 |
else {
|
@@ -59,7 +59,7 @@ else {
|
|
59 |
*/
|
60 |
define('PMXE_PREFIX', 'pmxe_');
|
61 |
|
62 |
-
define('PMXE_VERSION', '1.3.
|
63 |
|
64 |
define('PMXE_ASSETS_VERSION', '-1.0.2');
|
65 |
|
@@ -69,7 +69,7 @@ else {
|
|
69 |
* Plugin root uploads folder name
|
70 |
* @var string
|
71 |
*/
|
72 |
-
define('WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY', 'wpallexport');
|
73 |
/**
|
74 |
* Plugin uploads folder name
|
75 |
* @var string
|
@@ -80,13 +80,13 @@ else {
|
|
80 |
* Plugin temp folder name
|
81 |
* @var string
|
82 |
*/
|
83 |
-
define('WP_ALL_EXPORT_TEMP_DIRECTORY', WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'temp');
|
84 |
|
85 |
/**
|
86 |
* Plugin temp folder name
|
87 |
* @var string
|
88 |
*/
|
89 |
-
define('WP_ALL_EXPORT_CRON_DIRECTORY', WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'exports');
|
90 |
|
91 |
/**
|
92 |
* Main plugin file, Introduces MVC pattern
|
@@ -131,7 +131,7 @@ else {
|
|
131 |
* Max allowed file size (bytes) to import in default mode
|
132 |
* @var int
|
133 |
*/
|
134 |
-
const LARGE_SIZE = 0; // all files will importing in large import mode
|
135 |
|
136 |
/**
|
137 |
* WP All Import temp folder
|
@@ -190,7 +190,7 @@ else {
|
|
190 |
}
|
191 |
|
192 |
$this->addons = new \Wpae\App\Service\Addons\AddonService();
|
193 |
-
|
194 |
// init plugin options
|
195 |
$option_name = get_class($this) . '_Options';
|
196 |
$options_default = PMXE_Config::createFromFile(self::ROOT_DIR . '/config/options.php')->toArray();
|
@@ -240,7 +240,6 @@ else {
|
|
240 |
add_action('admin_init', array($this, 'adminInit'), 11);
|
241 |
add_action('admin_init', array($this, 'fix_db_schema'), 10);
|
242 |
add_action('init', array($this, 'init'), 10);
|
243 |
-
|
244 |
}
|
245 |
|
246 |
/**
|
@@ -323,7 +322,7 @@ else {
|
|
323 |
*/
|
324 |
public function getTablePrefix() {
|
325 |
global $wpdb;
|
326 |
-
|
327 |
//return ($this->isNetwork() ? $wpdb->base_prefix : $wpdb->prefix) . self::PREFIX;
|
328 |
return $wpdb->prefix . self::PREFIX;
|
329 |
}
|
@@ -367,7 +366,6 @@ else {
|
|
367 |
|
368 |
$addons_not_included = get_option('wp_all_export_free_addons_not_included',false);
|
369 |
|
370 |
-
|
371 |
if ( !get_option('wp_all_export_free_addons_not_included',false) && current_user_can( 'manage_options' ) && (!XmlExportEngine::get_addons_service()->isAcfAddonActive() || !XmlExportEngine::get_addons_service()->isWooCommerceAddonActive())){
|
372 |
|
373 |
$website = get_site_url();
|
@@ -386,16 +384,16 @@ else {
|
|
386 |
// create history folder
|
387 |
$uploads = wp_upload_dir();
|
388 |
|
389 |
-
$wpallimportDirs = array( WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY, self::TEMP_DIRECTORY, self::UPLOADS_DIRECTORY, self::CRON_DIRECTORY);
|
390 |
|
391 |
foreach ($wpallimportDirs as $destination) {
|
392 |
|
393 |
$dir = $uploads['basedir'] . DIRECTORY_SEPARATOR . $destination;
|
394 |
-
|
395 |
-
if ( !is_dir($dir)) wp_mkdir_p($dir);
|
396 |
|
397 |
-
if ( !
|
398 |
-
|
|
|
|
|
399 |
}
|
400 |
|
401 |
if ( ! is_dir($uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY) or ! is_writable($uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY)) {
|
@@ -420,27 +418,26 @@ else {
|
|
420 |
. '<p><a class="button button-primary" href="https://wpallimport.com/portal/downloads" target="_blank">' . __('Download Add-On', PMXE_Plugin::LANGUAGE_DOMAIN) . '</a></p>', 'wpae_acf_addon_not_installed_notice');
|
421 |
}
|
422 |
|
423 |
-
self::$session = new PMXE_Handler();
|
424 |
|
425 |
$input = new PMXE_Input();
|
426 |
-
$page = strtolower($input->getpost('page', ''));
|
427 |
|
428 |
if (preg_match('%^' . preg_quote(str_replace('_', '-', self::PREFIX), '%') . '([\w-]+)$%', $page)) {
|
429 |
-
//$this->adminDispatcher($page, strtolower($input->getpost('action', 'index')));
|
430 |
|
431 |
$action = strtolower($input->getpost('action', 'index'));
|
432 |
|
433 |
-
// capitalize prefix and first letters of class name parts
|
434 |
$controllerName = preg_replace_callback('%(^' . preg_quote(self::PREFIX, '%') . '|_).%', array($this, "replace_callback"),str_replace('-', '_', $page));
|
435 |
$actionName = str_replace('-', '_', $action);
|
436 |
if (method_exists($controllerName, $actionName)) {
|
437 |
|
438 |
if ( ! get_current_user_id() or ! current_user_can(self::$capabilities)) {
|
439 |
// This nonce is not valid.
|
440 |
-
die( 'Security check' );
|
441 |
|
442 |
} else {
|
443 |
-
|
444 |
$this->_admin_current_screen = (object)array(
|
445 |
'id' => $controllerName,
|
446 |
'base' => $controllerName,
|
@@ -461,6 +458,10 @@ else {
|
|
461 |
throw new Exception("Administration page `$page` matches to a wrong controller type.");
|
462 |
}
|
463 |
|
|
|
|
|
|
|
|
|
464 |
if($controller instanceof PMXE_Admin_Manage && ($action == 'update' || $action == 'template' || $action == 'options') && isset($_GET['id'])) {
|
465 |
$addons = new \Wpae\App\Service\Addons\AddonService();
|
466 |
$exportId = intval($_GET['id']);
|
@@ -498,9 +499,9 @@ else {
|
|
498 |
(
|
499 |
( in_array( 'product', $cpt ) && \class_exists('WooCommerce') && ! XmlExportEngine::get_addons_service()->isWooCommerceProductAddonActive() ) ||
|
500 |
( in_array( 'shop_order', $cpt ) && ! XmlExportEngine::get_addons_service()->isWooCommerceOrderAddonActive() ) ||
|
501 |
-
in_array( 'shop_review', $cpt ) ||
|
502 |
-
in_array( 'shop_coupon', $cpt )
|
503 |
-
) && ! $addons->isWooCommerceAddonActive()
|
504 |
) ||
|
505 |
( $export->options['export_type'] == 'advanced' && $export->options['wp_query_selector'] == 'wp_user_query' && ! $addons->isUserAddonActive() )
|
506 |
) {
|
@@ -513,14 +514,14 @@ else {
|
|
513 |
}
|
514 |
|
515 |
|
516 |
-
if ($this->_admin_current_screen->is_ajax) { // ajax request
|
517 |
$controller->$action();
|
518 |
do_action('wpallexport_action_after');
|
519 |
die(); // stop processing since we want to output only what controller is randered, nothing in addition
|
520 |
-
} elseif ( ! $controller->isInline) {
|
521 |
@ob_start();
|
522 |
$controller->$action();
|
523 |
-
self::$buffer = @ob_get_clean();
|
524 |
} else {
|
525 |
self::$buffer_callback = array($controller, $action);
|
526 |
}
|
@@ -566,7 +567,7 @@ else {
|
|
566 |
* @internal param $string [optional] $page When $page set to empty string ealier buffered content is outputted, otherwise controller is called based on $page value
|
567 |
*/
|
568 |
public function adminDispatcher($page = '', $action = 'index') {
|
569 |
-
if ('' === $page) {
|
570 |
if ( ! is_null(self::$buffer)) {
|
571 |
echo '<div class="wrap">';
|
572 |
// Contents are sanitized at a lower level
|
@@ -581,7 +582,7 @@ else {
|
|
581 |
} else {
|
582 |
throw new Exception('There is no previousely buffered content to display.');
|
583 |
}
|
584 |
-
}
|
585 |
}
|
586 |
|
587 |
public function replace_callback($matches){
|
@@ -673,7 +674,7 @@ else {
|
|
673 |
* @throws Exception
|
674 |
*/
|
675 |
public function getOption($option = NULL) {
|
676 |
-
$options = apply_filters('wp_all_export_config_options', $this->options);
|
677 |
if (is_null($option)) {
|
678 |
return $options;
|
679 |
} else if (isset($options[$option])) {
|
@@ -721,7 +722,7 @@ else {
|
|
721 |
global $wpdb;
|
722 |
|
723 |
if (function_exists('is_multisite') && is_multisite()) {
|
724 |
-
// check if it is a network activation - if so, run the activation function for each blog id
|
725 |
if (isset($_GET['networkwide']) && ($_GET['networkwide'] == 1)) {
|
726 |
$old_blog = $wpdb->blogid;
|
727 |
// Get all blog ids
|
@@ -729,14 +730,14 @@ else {
|
|
729 |
foreach ($blogids as $blog_id) {
|
730 |
switch_to_blog($blog_id);
|
731 |
require self::ROOT_DIR . '/schema.php';
|
732 |
-
dbDelta($plugin_queries);
|
733 |
}
|
734 |
switch_to_blog($old_blog);
|
735 |
-
return;
|
736 |
-
}
|
737 |
}
|
738 |
|
739 |
-
dbDelta($plugin_queries);
|
740 |
|
741 |
}
|
742 |
|
@@ -749,11 +750,11 @@ else {
|
|
749 |
* @return void
|
750 |
*/
|
751 |
public function load_plugin_textdomain() {
|
752 |
-
|
753 |
-
$locale = apply_filters( 'plugin_locale', get_locale(), 'wp_all_export_plugin' );
|
754 |
-
|
755 |
load_plugin_textdomain( 'wp_all_export_plugin', false, dirname( plugin_basename( __FILE__ ) ) . "/i18n/languages" );
|
756 |
-
}
|
757 |
|
758 |
public function fix_db_schema(){
|
759 |
|
@@ -806,24 +807,30 @@ else {
|
|
806 |
$tablefields = $wpdb->get_results("DESCRIBE {$table};");
|
807 |
$iteration = false;
|
808 |
$parent_id = false;
|
809 |
-
$export_post_type = false;
|
810 |
-
|
811 |
-
|
|
|
812 |
foreach ($tablefields as $tablefield) {
|
813 |
if ('iteration' == $tablefield->Field) $iteration = true;
|
814 |
if ('parent_id' == $tablefield->Field) $parent_id = true;
|
815 |
if ('export_post_type' == $tablefield->Field) $export_post_type = true;
|
|
|
816 |
}
|
817 |
|
818 |
-
if ( ! $iteration ){
|
819 |
$wpdb->query("ALTER TABLE {$table} ADD `iteration` BIGINT(20) NOT NULL DEFAULT 0;");
|
820 |
}
|
821 |
-
if ( ! $parent_id ){
|
822 |
$wpdb->query("ALTER TABLE {$table} ADD `parent_id` BIGINT(20) NOT NULL DEFAULT 0;");
|
823 |
}
|
824 |
-
if ( ! $export_post_type ){
|
825 |
$wpdb->query("ALTER TABLE {$table} ADD `export_post_type` TEXT NOT NULL DEFAULT '';");
|
826 |
}
|
|
|
|
|
|
|
|
|
827 |
|
828 |
update_option( "wp_all_export_free_db_version", PMXE_VERSION );
|
829 |
}
|
@@ -882,31 +889,31 @@ else {
|
|
882 |
*/
|
883 |
public static function get_default_import_options() {
|
884 |
return array(
|
885 |
-
'cpt' => array(),
|
886 |
'whereclause' => '',
|
887 |
'joinclause' => '',
|
888 |
'filter_rules_hierarhy' => '',
|
889 |
'product_matching_mode' => 'parent',
|
890 |
'order_item_per_row' => 1,
|
891 |
'order_item_fill_empty_columns' => 1,
|
892 |
-
'filepath' => '',
|
893 |
'current_filepath' => '',
|
894 |
'bundlepath' => '',
|
895 |
'export_type' => 'specific',
|
896 |
-
'wp_query' => '',
|
897 |
'wp_query_selector' => 'wp_query',
|
898 |
'is_user_export' => false,
|
899 |
'is_comment_export' => false,
|
900 |
-
'export_to' => 'csv',
|
901 |
'export_to_sheet' => 'csv',
|
902 |
'delimiter' => ',',
|
903 |
'encoding' => 'UTF-8',
|
904 |
-
'is_generate_templates' => 1,
|
905 |
-
'is_generate_import' => 1,
|
906 |
-
'import_id' => 0,
|
907 |
-
'template_name' => '',
|
908 |
'is_scheduled' => 0,
|
909 |
-
'scheduled_period' => '',
|
910 |
'scheduled_email' => '',
|
911 |
'cc_label' => array(),
|
912 |
'cc_type' => array(),
|
@@ -914,7 +921,7 @@ else {
|
|
914 |
'cc_name' => array(),
|
915 |
'cc_php' => array(),
|
916 |
'cc_code' => array(),
|
917 |
-
'cc_sql' => array(),
|
918 |
'cc_options' => array(),
|
919 |
'cc_settings' => array(),
|
920 |
'friendly_name' => '',
|
@@ -946,7 +953,7 @@ else {
|
|
946 |
'custom_xml_template' => '',
|
947 |
'custom_xml_template_header' => '',
|
948 |
'custom_xml_template_loop' => '',
|
949 |
-
'custom_xml_template_footer' => '',
|
950 |
'custom_xml_template_options' => array(),
|
951 |
'custom_xml_cdata_logic' => 'auto',
|
952 |
'show_cdata_in_preview' => 0,
|
@@ -966,7 +973,7 @@ else {
|
|
966 |
'sub_post_type_to_export' => ''
|
967 |
|
968 |
);
|
969 |
-
}
|
970 |
|
971 |
public static function is_ajax(){
|
972 |
return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') ? true : false ;
|
3 |
Plugin Name: WP All Export
|
4 |
Plugin URI: http://www.wpallimport.com/upgrade-to-wp-all-export-pro/?utm_source=export-plugin-free&utm_medium=wp-plugins-page&utm_campaign=upgrade-to-pro
|
5 |
Description: Export any post type to a CSV or XML file. Edit the exported data, and then re-import it later using WP All Import.
|
6 |
+
Version: 1.3.4
|
7 |
Author: Soflyy
|
8 |
*/
|
9 |
|
33 |
if ( class_exists('PMXE_Plugin') and PMXE_EDITION == "paid"){
|
34 |
|
35 |
function pmxe_notice(){
|
36 |
+
|
37 |
?>
|
38 |
<div class="error">
|
39 |
<p>
|
40 |
<?php printf(esc_html__('Please de-activate and remove the free version of the WP All Export before activating the paid version.', 'wp_all_export_plugin')); ?>
|
41 |
</p>
|
42 |
</div>
|
43 |
+
<?php
|
44 |
|
45 |
deactivate_plugins( str_replace('\\', '/', dirname(__FILE__)) . '/wp-all-export.php');
|
46 |
|
47 |
}
|
48 |
|
49 |
+
add_action('admin_notices', 'pmxe_notice');
|
50 |
|
51 |
}
|
52 |
else {
|
59 |
*/
|
60 |
define('PMXE_PREFIX', 'pmxe_');
|
61 |
|
62 |
+
define('PMXE_VERSION', '1.3.4');
|
63 |
|
64 |
define('PMXE_ASSETS_VERSION', '-1.0.2');
|
65 |
|
69 |
* Plugin root uploads folder name
|
70 |
* @var string
|
71 |
*/
|
72 |
+
define('WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY', 'wpallexport');
|
73 |
/**
|
74 |
* Plugin uploads folder name
|
75 |
* @var string
|
80 |
* Plugin temp folder name
|
81 |
* @var string
|
82 |
*/
|
83 |
+
define('WP_ALL_EXPORT_TEMP_DIRECTORY', WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'temp');
|
84 |
|
85 |
/**
|
86 |
* Plugin temp folder name
|
87 |
* @var string
|
88 |
*/
|
89 |
+
define('WP_ALL_EXPORT_CRON_DIRECTORY', WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'exports');
|
90 |
|
91 |
/**
|
92 |
* Main plugin file, Introduces MVC pattern
|
131 |
* Max allowed file size (bytes) to import in default mode
|
132 |
* @var int
|
133 |
*/
|
134 |
+
const LARGE_SIZE = 0; // all files will importing in large import mode
|
135 |
|
136 |
/**
|
137 |
* WP All Import temp folder
|
190 |
}
|
191 |
|
192 |
$this->addons = new \Wpae\App\Service\Addons\AddonService();
|
193 |
+
|
194 |
// init plugin options
|
195 |
$option_name = get_class($this) . '_Options';
|
196 |
$options_default = PMXE_Config::createFromFile(self::ROOT_DIR . '/config/options.php')->toArray();
|
240 |
add_action('admin_init', array($this, 'adminInit'), 11);
|
241 |
add_action('admin_init', array($this, 'fix_db_schema'), 10);
|
242 |
add_action('init', array($this, 'init'), 10);
|
|
|
243 |
}
|
244 |
|
245 |
/**
|
322 |
*/
|
323 |
public function getTablePrefix() {
|
324 |
global $wpdb;
|
325 |
+
|
326 |
//return ($this->isNetwork() ? $wpdb->base_prefix : $wpdb->prefix) . self::PREFIX;
|
327 |
return $wpdb->prefix . self::PREFIX;
|
328 |
}
|
366 |
|
367 |
$addons_not_included = get_option('wp_all_export_free_addons_not_included',false);
|
368 |
|
|
|
369 |
if ( !get_option('wp_all_export_free_addons_not_included',false) && current_user_can( 'manage_options' ) && (!XmlExportEngine::get_addons_service()->isAcfAddonActive() || !XmlExportEngine::get_addons_service()->isWooCommerceAddonActive())){
|
370 |
|
371 |
$website = get_site_url();
|
384 |
// create history folder
|
385 |
$uploads = wp_upload_dir();
|
386 |
|
387 |
+
$wpallimportDirs = array( WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY, self::TEMP_DIRECTORY, self::UPLOADS_DIRECTORY, self::CRON_DIRECTORY);
|
388 |
|
389 |
foreach ($wpallimportDirs as $destination) {
|
390 |
|
391 |
$dir = $uploads['basedir'] . DIRECTORY_SEPARATOR . $destination;
|
|
|
|
|
392 |
|
393 |
+
if ( !is_dir($dir)) wp_mkdir_p($dir);
|
394 |
+
|
395 |
+
if ( ! @file_exists($dir . DIRECTORY_SEPARATOR . 'index.php') ) @touch( $dir . DIRECTORY_SEPARATOR . 'index.php' );
|
396 |
+
|
397 |
}
|
398 |
|
399 |
if ( ! is_dir($uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY) or ! is_writable($uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY)) {
|
418 |
. '<p><a class="button button-primary" href="https://wpallimport.com/portal/downloads" target="_blank">' . __('Download Add-On', PMXE_Plugin::LANGUAGE_DOMAIN) . '</a></p>', 'wpae_acf_addon_not_installed_notice');
|
419 |
}
|
420 |
|
421 |
+
self::$session = new PMXE_Handler();
|
422 |
|
423 |
$input = new PMXE_Input();
|
424 |
+
$page = strtolower($input->getpost('page', ''));
|
425 |
|
426 |
if (preg_match('%^' . preg_quote(str_replace('_', '-', self::PREFIX), '%') . '([\w-]+)$%', $page)) {
|
|
|
427 |
|
428 |
$action = strtolower($input->getpost('action', 'index'));
|
429 |
|
430 |
+
// capitalize prefix and first letters of class name parts
|
431 |
$controllerName = preg_replace_callback('%(^' . preg_quote(self::PREFIX, '%') . '|_).%', array($this, "replace_callback"),str_replace('-', '_', $page));
|
432 |
$actionName = str_replace('-', '_', $action);
|
433 |
if (method_exists($controllerName, $actionName)) {
|
434 |
|
435 |
if ( ! get_current_user_id() or ! current_user_can(self::$capabilities)) {
|
436 |
// This nonce is not valid.
|
437 |
+
die( 'Security check' );
|
438 |
|
439 |
} else {
|
440 |
+
|
441 |
$this->_admin_current_screen = (object)array(
|
442 |
'id' => $controllerName,
|
443 |
'base' => $controllerName,
|
458 |
throw new Exception("Administration page `$page` matches to a wrong controller type.");
|
459 |
}
|
460 |
|
461 |
+
$reviewsUI = new \Wpae\Reviews\ReviewsUI();
|
462 |
+
|
463 |
+
add_action('admin_notices', [$reviewsUI, 'render']);
|
464 |
+
|
465 |
if($controller instanceof PMXE_Admin_Manage && ($action == 'update' || $action == 'template' || $action == 'options') && isset($_GET['id'])) {
|
466 |
$addons = new \Wpae\App\Service\Addons\AddonService();
|
467 |
$exportId = intval($_GET['id']);
|
499 |
(
|
500 |
( in_array( 'product', $cpt ) && \class_exists('WooCommerce') && ! XmlExportEngine::get_addons_service()->isWooCommerceProductAddonActive() ) ||
|
501 |
( in_array( 'shop_order', $cpt ) && ! XmlExportEngine::get_addons_service()->isWooCommerceOrderAddonActive() ) ||
|
502 |
+
in_array( 'shop_review', $cpt ) ||
|
503 |
+
in_array( 'shop_coupon', $cpt )
|
504 |
+
) && ! $addons->isWooCommerceAddonActive()
|
505 |
) ||
|
506 |
( $export->options['export_type'] == 'advanced' && $export->options['wp_query_selector'] == 'wp_user_query' && ! $addons->isUserAddonActive() )
|
507 |
) {
|
514 |
}
|
515 |
|
516 |
|
517 |
+
if ($this->_admin_current_screen->is_ajax) { // ajax request
|
518 |
$controller->$action();
|
519 |
do_action('wpallexport_action_after');
|
520 |
die(); // stop processing since we want to output only what controller is randered, nothing in addition
|
521 |
+
} elseif ( ! $controller->isInline) {
|
522 |
@ob_start();
|
523 |
$controller->$action();
|
524 |
+
self::$buffer = @ob_get_clean();
|
525 |
} else {
|
526 |
self::$buffer_callback = array($controller, $action);
|
527 |
}
|
567 |
* @internal param $string [optional] $page When $page set to empty string ealier buffered content is outputted, otherwise controller is called based on $page value
|
568 |
*/
|
569 |
public function adminDispatcher($page = '', $action = 'index') {
|
570 |
+
if ('' === $page) {
|
571 |
if ( ! is_null(self::$buffer)) {
|
572 |
echo '<div class="wrap">';
|
573 |
// Contents are sanitized at a lower level
|
582 |
} else {
|
583 |
throw new Exception('There is no previousely buffered content to display.');
|
584 |
}
|
585 |
+
}
|
586 |
}
|
587 |
|
588 |
public function replace_callback($matches){
|
674 |
* @throws Exception
|
675 |
*/
|
676 |
public function getOption($option = NULL) {
|
677 |
+
$options = apply_filters('wp_all_export_config_options', $this->options);
|
678 |
if (is_null($option)) {
|
679 |
return $options;
|
680 |
} else if (isset($options[$option])) {
|
722 |
global $wpdb;
|
723 |
|
724 |
if (function_exists('is_multisite') && is_multisite()) {
|
725 |
+
// check if it is a network activation - if so, run the activation function for each blog id
|
726 |
if (isset($_GET['networkwide']) && ($_GET['networkwide'] == 1)) {
|
727 |
$old_blog = $wpdb->blogid;
|
728 |
// Get all blog ids
|
730 |
foreach ($blogids as $blog_id) {
|
731 |
switch_to_blog($blog_id);
|
732 |
require self::ROOT_DIR . '/schema.php';
|
733 |
+
dbDelta($plugin_queries);
|
734 |
}
|
735 |
switch_to_blog($old_blog);
|
736 |
+
return;
|
737 |
+
}
|
738 |
}
|
739 |
|
740 |
+
dbDelta($plugin_queries);
|
741 |
|
742 |
}
|
743 |
|
750 |
* @return void
|
751 |
*/
|
752 |
public function load_plugin_textdomain() {
|
753 |
+
|
754 |
+
$locale = apply_filters( 'plugin_locale', get_locale(), 'wp_all_export_plugin' );
|
755 |
+
|
756 |
load_plugin_textdomain( 'wp_all_export_plugin', false, dirname( plugin_basename( __FILE__ ) ) . "/i18n/languages" );
|
757 |
+
}
|
758 |
|
759 |
public function fix_db_schema(){
|
760 |
|
807 |
$tablefields = $wpdb->get_results("DESCRIBE {$table};");
|
808 |
$iteration = false;
|
809 |
$parent_id = false;
|
810 |
+
$export_post_type = false;
|
811 |
+
$created_at = false;
|
812 |
+
|
813 |
+
// Check if field exists
|
814 |
foreach ($tablefields as $tablefield) {
|
815 |
if ('iteration' == $tablefield->Field) $iteration = true;
|
816 |
if ('parent_id' == $tablefield->Field) $parent_id = true;
|
817 |
if ('export_post_type' == $tablefield->Field) $export_post_type = true;
|
818 |
+
if ('created_at' == $tablefield->Field) $created_at = true;
|
819 |
}
|
820 |
|
821 |
+
if ( ! $iteration ){
|
822 |
$wpdb->query("ALTER TABLE {$table} ADD `iteration` BIGINT(20) NOT NULL DEFAULT 0;");
|
823 |
}
|
824 |
+
if ( ! $parent_id ){
|
825 |
$wpdb->query("ALTER TABLE {$table} ADD `parent_id` BIGINT(20) NOT NULL DEFAULT 0;");
|
826 |
}
|
827 |
+
if ( ! $export_post_type ){
|
828 |
$wpdb->query("ALTER TABLE {$table} ADD `export_post_type` TEXT NOT NULL DEFAULT '';");
|
829 |
}
|
830 |
+
if ( ! $created_at ){
|
831 |
+
$wpdb->query("ALTER TABLE {$table} ADD `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP;");
|
832 |
+
$wpdb->query("UPDATE {$table} SET `created_at` = `registered_on` WHERE 1");
|
833 |
+
}
|
834 |
|
835 |
update_option( "wp_all_export_free_db_version", PMXE_VERSION );
|
836 |
}
|
889 |
*/
|
890 |
public static function get_default_import_options() {
|
891 |
return array(
|
892 |
+
'cpt' => array(),
|
893 |
'whereclause' => '',
|
894 |
'joinclause' => '',
|
895 |
'filter_rules_hierarhy' => '',
|
896 |
'product_matching_mode' => 'parent',
|
897 |
'order_item_per_row' => 1,
|
898 |
'order_item_fill_empty_columns' => 1,
|
899 |
+
'filepath' => '',
|
900 |
'current_filepath' => '',
|
901 |
'bundlepath' => '',
|
902 |
'export_type' => 'specific',
|
903 |
+
'wp_query' => '',
|
904 |
'wp_query_selector' => 'wp_query',
|
905 |
'is_user_export' => false,
|
906 |
'is_comment_export' => false,
|
907 |
+
'export_to' => 'csv',
|
908 |
'export_to_sheet' => 'csv',
|
909 |
'delimiter' => ',',
|
910 |
'encoding' => 'UTF-8',
|
911 |
+
'is_generate_templates' => 1,
|
912 |
+
'is_generate_import' => 1,
|
913 |
+
'import_id' => 0,
|
914 |
+
'template_name' => '',
|
915 |
'is_scheduled' => 0,
|
916 |
+
'scheduled_period' => '',
|
917 |
'scheduled_email' => '',
|
918 |
'cc_label' => array(),
|
919 |
'cc_type' => array(),
|
921 |
'cc_name' => array(),
|
922 |
'cc_php' => array(),
|
923 |
'cc_code' => array(),
|
924 |
+
'cc_sql' => array(),
|
925 |
'cc_options' => array(),
|
926 |
'cc_settings' => array(),
|
927 |
'friendly_name' => '',
|
953 |
'custom_xml_template' => '',
|
954 |
'custom_xml_template_header' => '',
|
955 |
'custom_xml_template_loop' => '',
|
956 |
+
'custom_xml_template_footer' => '',
|
957 |
'custom_xml_template_options' => array(),
|
958 |
'custom_xml_cdata_logic' => 'auto',
|
959 |
'show_cdata_in_preview' => 0,
|
973 |
'sub_post_type_to_export' => ''
|
974 |
|
975 |
);
|
976 |
+
}
|
977 |
|
978 |
public static function is_ajax(){
|
979 |
return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') ? true : false ;
|