Changeset 2698910
- Timestamp:
- 03/24/2022 12:08:26 PM (3 years ago)
- Location:
- wp-all-export
- Files:
-
- 10 added
- 16 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
wp-all-export/tags/1.3.4/libraries/XmlCsvExport.php
r2654009 r2698910 803 803 if (!empty($section['content']) and !empty($available_data[$section['content']])) { 804 804 foreach ($available_data[$section['content']] as $field) { 805 if(is_string($post['cpt'])) { 806 $post['cpt'] = [$post['cpt']]; 807 } 805 808 if (is_array($field) and (isset($field['auto']) or (!in_array('product', $post['cpt']) || !\class_exists('WooCommerce')))) { 806 809 $auto_generate['ids'][] = 1; -
wp-all-export/tags/1.3.4/readme.txt
r2681463 r2698910 2 2 Contributors: soflyy, wpallimport 3 3 Requires at least: 5.0 4 Tested up to: 5.9 5 Stable tag: 1.3. 34 Tested up to: 5.9.2 5 Stable tag: 1.3.4 6 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 7 … … 60 60 = Automatic Scheduling = 61 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. 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 63 64 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. … … 91 91 92 92 == Changelog == 93 94 95 = 1.3.4 = 96 * improvement: UI updates 97 * bug fix: PHP 8 compatibility 93 98 94 99 = 1.3.3 = -
wp-all-export/tags/1.3.4/src/App/Service/Addons/AddonService.php
r2615815 r2698910 9 9 return defined('PMUE_EDITION'); 10 10 } 11 12 11 13 12 public function isWooCommerceAddonActive() { -
wp-all-export/tags/1.3.4/static/css/admin.css
r2654009 r2698910 4493 4493 .wpallexport-plugin .download-import-templates h2 { 4494 4494 margin-bottom: 10px; 4495 } 4495 } 4496 4497 -
wp-all-export/tags/1.3.4/static/js/jquery/jquery.mjs.pmxe_nestedSortable.js
r1957754 r2698910 87 87 } 88 88 89 this.dragDirection = { 90 vertical: this._getDragVerticalDirection(), 91 horizontal: this._getDragHorizontalDirection() 92 }; 93 89 94 //Regenerate the absolute position used for position checks 90 95 this.positionAbs = this._convertPositionTo("absolute"); … … 333 338 } 334 339 335 id = ($(item).attr(o.attribute || 'id') ).match(o.expression || (/(.+)[-=_](.+)/));340 id = ($(item).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); 336 341 337 342 if (depth === sDepth + 1) { -
wp-all-export/tags/1.3.4/views/admin/export/options/settings.php
r2654009 r2698910 65 65 <p style="text-align:right;"> 66 66 <div class="input"> 67 <label for="save_import_as" style="width: 103px;"><?php esc_html_e(' FriendlyName:','wp_all_export_plugin');?></label>68 <input type="text" name="friendly_name" title="<?php esc_html_e('Save friendly name...', 'pmxi_plugin') ?>" style="vertical-align:middle; background:#fff !important;" value="<?php echo wp_all_export_clear_xss(esc_attr($post['friendly_name'])); ?>"/>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 69 </div> 70 70 </p> -
wp-all-export/tags/1.3.4/views/admin/manage/index.php
r2654009 r2698910 298 298 } 299 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 300 } 308 301 -
wp-all-export/tags/1.3.4/wp-all-export.php
r2654009 r2698910 4 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 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. 36 Version: 1.3.4 7 7 Author: Soflyy 8 8 */ … … 34 34 35 35 function pmxe_notice(){ 36 36 37 37 ?> 38 38 <div class="error"> … … 41 41 </p> 42 42 </div> 43 <?php 43 <?php 44 44 45 45 deactivate_plugins( str_replace('\\', '/', dirname(__FILE__)) . '/wp-all-export.php'); … … 47 47 } 48 48 49 add_action('admin_notices', 'pmxe_notice'); 49 add_action('admin_notices', 'pmxe_notice'); 50 50 51 51 } … … 60 60 define('PMXE_PREFIX', 'pmxe_'); 61 61 62 define('PMXE_VERSION', '1.3. 3');62 define('PMXE_VERSION', '1.3.4'); 63 63 64 64 define('PMXE_ASSETS_VERSION', '-1.0.2'); … … 70 70 * @var string 71 71 */ 72 define('WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY', 'wpallexport'); 72 define('WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY', 'wpallexport'); 73 73 /** 74 74 * Plugin uploads folder name … … 81 81 * @var string 82 82 */ 83 define('WP_ALL_EXPORT_TEMP_DIRECTORY', WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'temp'); 83 define('WP_ALL_EXPORT_TEMP_DIRECTORY', WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'temp'); 84 84 85 85 /** … … 87 87 * @var string 88 88 */ 89 define('WP_ALL_EXPORT_CRON_DIRECTORY', WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'exports'); 89 define('WP_ALL_EXPORT_CRON_DIRECTORY', WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'exports'); 90 90 91 91 /** … … 132 132 * @var int 133 133 */ 134 const LARGE_SIZE = 0; // all files will importing in large import mode 134 const LARGE_SIZE = 0; // all files will importing in large import mode 135 135 136 136 /** … … 191 191 192 192 $this->addons = new \Wpae\App\Service\Addons\AddonService(); 193 193 194 194 // init plugin options 195 195 $option_name = get_class($this) . '_Options'; … … 241 241 add_action('admin_init', array($this, 'fix_db_schema'), 10); 242 242 add_action('init', array($this, 'init'), 10); 243 244 243 } 245 244 … … 324 323 public function getTablePrefix() { 325 324 global $wpdb; 326 325 327 326 //return ($this->isNetwork() ? $wpdb->base_prefix : $wpdb->prefix) . self::PREFIX; 328 327 return $wpdb->prefix . self::PREFIX; … … 368 367 $addons_not_included = get_option('wp_all_export_free_addons_not_included',false); 369 368 370 371 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())){ 372 370 … … 387 385 $uploads = wp_upload_dir(); 388 386 389 $wpallimportDirs = array( WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY, self::TEMP_DIRECTORY, self::UPLOADS_DIRECTORY, self::CRON_DIRECTORY); 387 $wpallimportDirs = array( WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY, self::TEMP_DIRECTORY, self::UPLOADS_DIRECTORY, self::CRON_DIRECTORY); 390 388 391 389 foreach ($wpallimportDirs as $destination) { 392 390 393 391 $dir = $uploads['basedir'] . DIRECTORY_SEPARATOR . $destination; 394 395 if ( !is_dir($dir)) wp_mkdir_p($dir); 396 397 if ( ! @file_exists($dir . DIRECTORY_SEPARATOR . 'index.php') ) @touch( $dir . DIRECTORY_SEPARATOR . 'index.php' ); 398 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 399 397 } 400 398 … … 421 419 } 422 420 423 self::$session = new PMXE_Handler(); 421 self::$session = new PMXE_Handler(); 424 422 425 423 $input = new PMXE_Input(); 426 $page = strtolower($input->getpost('page', '')); 424 $page = strtolower($input->getpost('page', '')); 427 425 428 426 if (preg_match('%^' . preg_quote(str_replace('_', '-', self::PREFIX), '%') . '([\w-]+)$%', $page)) { 429 //$this->adminDispatcher($page, strtolower($input->getpost('action', 'index')));430 427 431 428 $action = strtolower($input->getpost('action', 'index')); 432 429 433 // capitalize prefix and first letters of class name parts 430 // capitalize prefix and first letters of class name parts 434 431 $controllerName = preg_replace_callback('%(^' . preg_quote(self::PREFIX, '%') . '|_).%', array($this, "replace_callback"),str_replace('-', '_', $page)); 435 432 $actionName = str_replace('-', '_', $action); … … 438 435 if ( ! get_current_user_id() or ! current_user_can(self::$capabilities)) { 439 436 // This nonce is not valid. 440 die( 'Security check' ); 437 die( 'Security check' ); 441 438 442 439 } else { 443 440 444 441 $this->_admin_current_screen = (object)array( 445 442 'id' => $controllerName, … … 462 459 } 463 460 461 $reviewsUI = new \Wpae\Reviews\ReviewsUI(); 462 463 add_action('admin_notices', [$reviewsUI, 'render']); 464 464 465 if($controller instanceof PMXE_Admin_Manage && ($action == 'update' || $action == 'template' || $action == 'options') && isset($_GET['id'])) { 465 466 $addons = new \Wpae\App\Service\Addons\AddonService(); … … 499 500 ( in_array( 'product', $cpt ) && \class_exists('WooCommerce') && ! XmlExportEngine::get_addons_service()->isWooCommerceProductAddonActive() ) || 500 501 ( 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() 502 in_array( 'shop_review', $cpt ) || 503 in_array( 'shop_coupon', $cpt ) 504 ) && ! $addons->isWooCommerceAddonActive() 504 505 ) || 505 506 ( $export->options['export_type'] == 'advanced' && $export->options['wp_query_selector'] == 'wp_user_query' && ! $addons->isUserAddonActive() ) … … 514 515 515 516 516 if ($this->_admin_current_screen->is_ajax) { // ajax request 517 if ($this->_admin_current_screen->is_ajax) { // ajax request 517 518 $controller->$action(); 518 519 do_action('wpallexport_action_after'); 519 520 die(); // stop processing since we want to output only what controller is randered, nothing in addition 520 } elseif ( ! $controller->isInline) { 521 } elseif ( ! $controller->isInline) { 521 522 @ob_start(); 522 523 $controller->$action(); 523 self::$buffer = @ob_get_clean(); 524 self::$buffer = @ob_get_clean(); 524 525 } else { 525 526 self::$buffer_callback = array($controller, $action); … … 567 568 */ 568 569 public function adminDispatcher($page = '', $action = 'index') { 569 if ('' === $page) { 570 if ('' === $page) { 570 571 if ( ! is_null(self::$buffer)) { 571 572 echo '<div class="wrap">'; … … 582 583 throw new Exception('There is no previousely buffered content to display.'); 583 584 } 584 } 585 } 585 586 } 586 587 … … 674 675 */ 675 676 public function getOption($option = NULL) { 676 $options = apply_filters('wp_all_export_config_options', $this->options); 677 $options = apply_filters('wp_all_export_config_options', $this->options); 677 678 if (is_null($option)) { 678 679 return $options; … … 722 723 723 724 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 // check if it is a network activation - if so, run the activation function for each blog id 725 726 if (isset($_GET['networkwide']) && ($_GET['networkwide'] == 1)) { 726 727 $old_blog = $wpdb->blogid; … … 730 731 switch_to_blog($blog_id); 731 732 require self::ROOT_DIR . '/schema.php'; 732 dbDelta($plugin_queries); 733 dbDelta($plugin_queries); 733 734 } 734 735 switch_to_blog($old_blog); 735 return; 736 } 736 return; 737 } 737 738 } 738 739 739 dbDelta($plugin_queries); 740 dbDelta($plugin_queries); 740 741 741 742 } … … 750 751 */ 751 752 public function load_plugin_textdomain() { 752 753 $locale = apply_filters( 'plugin_locale', get_locale(), 'wp_all_export_plugin' ); 754 753 754 $locale = apply_filters( 'plugin_locale', get_locale(), 'wp_all_export_plugin' ); 755 755 756 load_plugin_textdomain( 'wp_all_export_plugin', false, dirname( plugin_basename( __FILE__ ) ) . "/i18n/languages" ); 756 } 757 } 757 758 758 759 public function fix_db_schema(){ … … 807 808 $iteration = false; 808 809 $parent_id = false; 809 $export_post_type = false; 810 811 // Check if field exists 810 $export_post_type = false; 811 $created_at = false; 812 813 // Check if field exists 812 814 foreach ($tablefields as $tablefield) { 813 815 if ('iteration' == $tablefield->Field) $iteration = true; 814 816 if ('parent_id' == $tablefield->Field) $parent_id = true; 815 817 if ('export_post_type' == $tablefield->Field) $export_post_type = true; 816 } 817 818 if ( ! $iteration ){ 818 if ('created_at' == $tablefield->Field) $created_at = true; 819 } 820 821 if ( ! $iteration ){ 819 822 $wpdb->query("ALTER TABLE {$table} ADD `iteration` BIGINT(20) NOT NULL DEFAULT 0;"); 820 823 } 821 if ( ! $parent_id ){ 824 if ( ! $parent_id ){ 822 825 $wpdb->query("ALTER TABLE {$table} ADD `parent_id` BIGINT(20) NOT NULL DEFAULT 0;"); 823 826 } 824 if ( ! $export_post_type ){ 827 if ( ! $export_post_type ){ 825 828 $wpdb->query("ALTER TABLE {$table} ADD `export_post_type` TEXT NOT NULL DEFAULT '';"); 826 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 } 827 834 828 835 update_option( "wp_all_export_free_db_version", PMXE_VERSION ); … … 883 890 public static function get_default_import_options() { 884 891 return array( 885 'cpt' => array(), 892 'cpt' => array(), 886 893 'whereclause' => '', 887 894 'joinclause' => '', … … 890 897 'order_item_per_row' => 1, 891 898 'order_item_fill_empty_columns' => 1, 892 'filepath' => '', 899 'filepath' => '', 893 900 'current_filepath' => '', 894 901 'bundlepath' => '', 895 902 'export_type' => 'specific', 896 'wp_query' => '', 903 'wp_query' => '', 897 904 'wp_query_selector' => 'wp_query', 898 905 'is_user_export' => false, 899 906 'is_comment_export' => false, 900 'export_to' => 'csv', 907 'export_to' => 'csv', 901 908 'export_to_sheet' => 'csv', 902 909 'delimiter' => ',', 903 910 'encoding' => 'UTF-8', 904 'is_generate_templates' => 1, 905 'is_generate_import' => 1, 906 'import_id' => 0, 907 'template_name' => '', 911 'is_generate_templates' => 1, 912 'is_generate_import' => 1, 913 'import_id' => 0, 914 'template_name' => '', 908 915 'is_scheduled' => 0, 909 'scheduled_period' => '', 916 'scheduled_period' => '', 910 917 'scheduled_email' => '', 911 918 'cc_label' => array(), … … 915 922 'cc_php' => array(), 916 923 'cc_code' => array(), 917 'cc_sql' => array(), 924 'cc_sql' => array(), 918 925 'cc_options' => array(), 919 926 'cc_settings' => array(), … … 947 954 'custom_xml_template_header' => '', 948 955 'custom_xml_template_loop' => '', 949 'custom_xml_template_footer' => '', 956 'custom_xml_template_footer' => '', 950 957 'custom_xml_template_options' => array(), 951 958 'custom_xml_cdata_logic' => 'auto', … … 967 974 968 975 ); 969 } 976 } 970 977 971 978 public static function is_ajax(){ -
wp-all-export/trunk/libraries/XmlCsvExport.php
r2654009 r2698910 803 803 if (!empty($section['content']) and !empty($available_data[$section['content']])) { 804 804 foreach ($available_data[$section['content']] as $field) { 805 if(is_string($post['cpt'])) { 806 $post['cpt'] = [$post['cpt']]; 807 } 805 808 if (is_array($field) and (isset($field['auto']) or (!in_array('product', $post['cpt']) || !\class_exists('WooCommerce')))) { 806 809 $auto_generate['ids'][] = 1; -
wp-all-export/trunk/readme.txt
r2681463 r2698910 2 2 Contributors: soflyy, wpallimport 3 3 Requires at least: 5.0 4 Tested up to: 5.9 5 Stable tag: 1.3. 34 Tested up to: 5.9.2 5 Stable tag: 1.3.4 6 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 7 … … 60 60 = Automatic Scheduling = 61 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. 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 63 64 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. … … 91 91 92 92 == Changelog == 93 94 95 = 1.3.4 = 96 * improvement: UI updates 97 * bug fix: PHP 8 compatibility 93 98 94 99 = 1.3.3 = -
wp-all-export/trunk/src/App/Service/Addons/AddonService.php
r2615815 r2698910 9 9 return defined('PMUE_EDITION'); 10 10 } 11 12 11 13 12 public function isWooCommerceAddonActive() { -
wp-all-export/trunk/static/css/admin.css
r2654009 r2698910 4493 4493 .wpallexport-plugin .download-import-templates h2 { 4494 4494 margin-bottom: 10px; 4495 } 4495 } 4496 4497 -
wp-all-export/trunk/static/js/jquery/jquery.mjs.pmxe_nestedSortable.js
r1957754 r2698910 87 87 } 88 88 89 this.dragDirection = { 90 vertical: this._getDragVerticalDirection(), 91 horizontal: this._getDragHorizontalDirection() 92 }; 93 89 94 //Regenerate the absolute position used for position checks 90 95 this.positionAbs = this._convertPositionTo("absolute"); … … 333 338 } 334 339 335 id = ($(item).attr(o.attribute || 'id') ).match(o.expression || (/(.+)[-=_](.+)/));340 id = ($(item).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); 336 341 337 342 if (depth === sDepth + 1) { -
wp-all-export/trunk/views/admin/export/options/settings.php
r2654009 r2698910 65 65 <p style="text-align:right;"> 66 66 <div class="input"> 67 <label for="save_import_as" style="width: 103px;"><?php esc_html_e(' FriendlyName:','wp_all_export_plugin');?></label>68 <input type="text" name="friendly_name" title="<?php esc_html_e('Save friendly name...', 'pmxi_plugin') ?>" style="vertical-align:middle; background:#fff !important;" value="<?php echo wp_all_export_clear_xss(esc_attr($post['friendly_name'])); ?>"/>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 69 </div> 70 70 </p> -
wp-all-export/trunk/views/admin/manage/index.php
r2654009 r2698910 298 298 } 299 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 300 } 308 301 -
wp-all-export/trunk/wp-all-export.php
r2654009 r2698910 4 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 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. 36 Version: 1.3.4 7 7 Author: Soflyy 8 8 */ … … 34 34 35 35 function pmxe_notice(){ 36 36 37 37 ?> 38 38 <div class="error"> … … 41 41 </p> 42 42 </div> 43 <?php 43 <?php 44 44 45 45 deactivate_plugins( str_replace('\\', '/', dirname(__FILE__)) . '/wp-all-export.php'); … … 47 47 } 48 48 49 add_action('admin_notices', 'pmxe_notice'); 49 add_action('admin_notices', 'pmxe_notice'); 50 50 51 51 } … … 60 60 define('PMXE_PREFIX', 'pmxe_'); 61 61 62 define('PMXE_VERSION', '1.3. 3');62 define('PMXE_VERSION', '1.3.4'); 63 63 64 64 define('PMXE_ASSETS_VERSION', '-1.0.2'); … … 70 70 * @var string 71 71 */ 72 define('WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY', 'wpallexport'); 72 define('WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY', 'wpallexport'); 73 73 /** 74 74 * Plugin uploads folder name … … 81 81 * @var string 82 82 */ 83 define('WP_ALL_EXPORT_TEMP_DIRECTORY', WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'temp'); 83 define('WP_ALL_EXPORT_TEMP_DIRECTORY', WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'temp'); 84 84 85 85 /** … … 87 87 * @var string 88 88 */ 89 define('WP_ALL_EXPORT_CRON_DIRECTORY', WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'exports'); 89 define('WP_ALL_EXPORT_CRON_DIRECTORY', WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'exports'); 90 90 91 91 /** … … 132 132 * @var int 133 133 */ 134 const LARGE_SIZE = 0; // all files will importing in large import mode 134 const LARGE_SIZE = 0; // all files will importing in large import mode 135 135 136 136 /** … … 191 191 192 192 $this->addons = new \Wpae\App\Service\Addons\AddonService(); 193 193 194 194 // init plugin options 195 195 $option_name = get_class($this) . '_Options'; … … 241 241 add_action('admin_init', array($this, 'fix_db_schema'), 10); 242 242 add_action('init', array($this, 'init'), 10); 243 244 243 } 245 244 … … 324 323 public function getTablePrefix() { 325 324 global $wpdb; 326 325 327 326 //return ($this->isNetwork() ? $wpdb->base_prefix : $wpdb->prefix) . self::PREFIX; 328 327 return $wpdb->prefix . self::PREFIX; … … 368 367 $addons_not_included = get_option('wp_all_export_free_addons_not_included',false); 369 368 370 371 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())){ 372 370 … … 387 385 $uploads = wp_upload_dir(); 388 386 389 $wpallimportDirs = array( WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY, self::TEMP_DIRECTORY, self::UPLOADS_DIRECTORY, self::CRON_DIRECTORY); 387 $wpallimportDirs = array( WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY, self::TEMP_DIRECTORY, self::UPLOADS_DIRECTORY, self::CRON_DIRECTORY); 390 388 391 389 foreach ($wpallimportDirs as $destination) { 392 390 393 391 $dir = $uploads['basedir'] . DIRECTORY_SEPARATOR . $destination; 394 395 if ( !is_dir($dir)) wp_mkdir_p($dir); 396 397 if ( ! @file_exists($dir . DIRECTORY_SEPARATOR . 'index.php') ) @touch( $dir . DIRECTORY_SEPARATOR . 'index.php' ); 398 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 399 397 } 400 398 … … 421 419 } 422 420 423 self::$session = new PMXE_Handler(); 421 self::$session = new PMXE_Handler(); 424 422 425 423 $input = new PMXE_Input(); 426 $page = strtolower($input->getpost('page', '')); 424 $page = strtolower($input->getpost('page', '')); 427 425 428 426 if (preg_match('%^' . preg_quote(str_replace('_', '-', self::PREFIX), '%') . '([\w-]+)$%', $page)) { 429 //$this->adminDispatcher($page, strtolower($input->getpost('action', 'index')));430 427 431 428 $action = strtolower($input->getpost('action', 'index')); 432 429 433 // capitalize prefix and first letters of class name parts 430 // capitalize prefix and first letters of class name parts 434 431 $controllerName = preg_replace_callback('%(^' . preg_quote(self::PREFIX, '%') . '|_).%', array($this, "replace_callback"),str_replace('-', '_', $page)); 435 432 $actionName = str_replace('-', '_', $action); … … 438 435 if ( ! get_current_user_id() or ! current_user_can(self::$capabilities)) { 439 436 // This nonce is not valid. 440 die( 'Security check' ); 437 die( 'Security check' ); 441 438 442 439 } else { 443 440 444 441 $this->_admin_current_screen = (object)array( 445 442 'id' => $controllerName, … … 462 459 } 463 460 461 $reviewsUI = new \Wpae\Reviews\ReviewsUI(); 462 463 add_action('admin_notices', [$reviewsUI, 'render']); 464 464 465 if($controller instanceof PMXE_Admin_Manage && ($action == 'update' || $action == 'template' || $action == 'options') && isset($_GET['id'])) { 465 466 $addons = new \Wpae\App\Service\Addons\AddonService(); … … 499 500 ( in_array( 'product', $cpt ) && \class_exists('WooCommerce') && ! XmlExportEngine::get_addons_service()->isWooCommerceProductAddonActive() ) || 500 501 ( 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() 502 in_array( 'shop_review', $cpt ) || 503 in_array( 'shop_coupon', $cpt ) 504 ) && ! $addons->isWooCommerceAddonActive() 504 505 ) || 505 506 ( $export->options['export_type'] == 'advanced' && $export->options['wp_query_selector'] == 'wp_user_query' && ! $addons->isUserAddonActive() ) … … 514 515 515 516 516 if ($this->_admin_current_screen->is_ajax) { // ajax request 517 if ($this->_admin_current_screen->is_ajax) { // ajax request 517 518 $controller->$action(); 518 519 do_action('wpallexport_action_after'); 519 520 die(); // stop processing since we want to output only what controller is randered, nothing in addition 520 } elseif ( ! $controller->isInline) { 521 } elseif ( ! $controller->isInline) { 521 522 @ob_start(); 522 523 $controller->$action(); 523 self::$buffer = @ob_get_clean(); 524 self::$buffer = @ob_get_clean(); 524 525 } else { 525 526 self::$buffer_callback = array($controller, $action); … … 567 568 */ 568 569 public function adminDispatcher($page = '', $action = 'index') { 569 if ('' === $page) { 570 if ('' === $page) { 570 571 if ( ! is_null(self::$buffer)) { 571 572 echo '<div class="wrap">'; … … 582 583 throw new Exception('There is no previousely buffered content to display.'); 583 584 } 584 } 585 } 585 586 } 586 587 … … 674 675 */ 675 676 public function getOption($option = NULL) { 676 $options = apply_filters('wp_all_export_config_options', $this->options); 677 $options = apply_filters('wp_all_export_config_options', $this->options); 677 678 if (is_null($option)) { 678 679 return $options; … … 722 723 723 724 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 // check if it is a network activation - if so, run the activation function for each blog id 725 726 if (isset($_GET['networkwide']) && ($_GET['networkwide'] == 1)) { 726 727 $old_blog = $wpdb->blogid; … … 730 731 switch_to_blog($blog_id); 731 732 require self::ROOT_DIR . '/schema.php'; 732 dbDelta($plugin_queries); 733 dbDelta($plugin_queries); 733 734 } 734 735 switch_to_blog($old_blog); 735 return; 736 } 736 return; 737 } 737 738 } 738 739 739 dbDelta($plugin_queries); 740 dbDelta($plugin_queries); 740 741 741 742 } … … 750 751 */ 751 752 public function load_plugin_textdomain() { 752 753 $locale = apply_filters( 'plugin_locale', get_locale(), 'wp_all_export_plugin' ); 754 753 754 $locale = apply_filters( 'plugin_locale', get_locale(), 'wp_all_export_plugin' ); 755 755 756 load_plugin_textdomain( 'wp_all_export_plugin', false, dirname( plugin_basename( __FILE__ ) ) . "/i18n/languages" ); 756 } 757 } 757 758 758 759 public function fix_db_schema(){ … … 807 808 $iteration = false; 808 809 $parent_id = false; 809 $export_post_type = false; 810 811 // Check if field exists 810 $export_post_type = false; 811 $created_at = false; 812 813 // Check if field exists 812 814 foreach ($tablefields as $tablefield) { 813 815 if ('iteration' == $tablefield->Field) $iteration = true; 814 816 if ('parent_id' == $tablefield->Field) $parent_id = true; 815 817 if ('export_post_type' == $tablefield->Field) $export_post_type = true; 816 } 817 818 if ( ! $iteration ){ 818 if ('created_at' == $tablefield->Field) $created_at = true; 819 } 820 821 if ( ! $iteration ){ 819 822 $wpdb->query("ALTER TABLE {$table} ADD `iteration` BIGINT(20) NOT NULL DEFAULT 0;"); 820 823 } 821 if ( ! $parent_id ){ 824 if ( ! $parent_id ){ 822 825 $wpdb->query("ALTER TABLE {$table} ADD `parent_id` BIGINT(20) NOT NULL DEFAULT 0;"); 823 826 } 824 if ( ! $export_post_type ){ 827 if ( ! $export_post_type ){ 825 828 $wpdb->query("ALTER TABLE {$table} ADD `export_post_type` TEXT NOT NULL DEFAULT '';"); 826 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 } 827 834 828 835 update_option( "wp_all_export_free_db_version", PMXE_VERSION ); … … 883 890 public static function get_default_import_options() { 884 891 return array( 885 'cpt' => array(), 892 'cpt' => array(), 886 893 'whereclause' => '', 887 894 'joinclause' => '', … … 890 897 'order_item_per_row' => 1, 891 898 'order_item_fill_empty_columns' => 1, 892 'filepath' => '', 899 'filepath' => '', 893 900 'current_filepath' => '', 894 901 'bundlepath' => '', 895 902 'export_type' => 'specific', 896 'wp_query' => '', 903 'wp_query' => '', 897 904 'wp_query_selector' => 'wp_query', 898 905 'is_user_export' => false, 899 906 'is_comment_export' => false, 900 'export_to' => 'csv', 907 'export_to' => 'csv', 901 908 'export_to_sheet' => 'csv', 902 909 'delimiter' => ',', 903 910 'encoding' => 'UTF-8', 904 'is_generate_templates' => 1, 905 'is_generate_import' => 1, 906 'import_id' => 0, 907 'template_name' => '', 911 'is_generate_templates' => 1, 912 'is_generate_import' => 1, 913 'import_id' => 0, 914 'template_name' => '', 908 915 'is_scheduled' => 0, 909 'scheduled_period' => '', 916 'scheduled_period' => '', 910 917 'scheduled_email' => '', 911 918 'cc_label' => array(), … … 915 922 'cc_php' => array(), 916 923 'cc_code' => array(), 917 'cc_sql' => array(), 924 'cc_sql' => array(), 918 925 'cc_options' => array(), 919 926 'cc_settings' => array(), … … 947 954 'custom_xml_template_header' => '', 948 955 'custom_xml_template_loop' => '', 949 'custom_xml_template_footer' => '', 956 'custom_xml_template_footer' => '', 950 957 'custom_xml_template_options' => array(), 951 958 'custom_xml_cdata_logic' => 'auto', … … 967 974 968 975 ); 969 } 976 } 970 977 971 978 public static function is_ajax(){
Note: See TracChangeset
for help on using the changeset viewer.