settings.php
203 lines
| 1 | <?php |
| 2 | if(!defined('ABSPATH')) { |
| 3 | die(); |
| 4 | } |
| 5 | // phpcs:ignoreFile WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- variables in template files inherited from controller render() scope |
| 6 | ?> |
| 7 | <div class="wpallexport-collapsed wpallexport-section"> |
| 8 | <div class="wpallexport-content-section" style="margin-top:10px;"> |
| 9 | <div class="wpallexport-collapsed-header" style="padding-left: 25px;"> |
| 10 | <h3><?php esc_html_e('Configure Advanced Settings','wp-all-export');?></h3> |
| 11 | </div> |
| 12 | <div class="wpallexport-collapsed-content" style="padding: 0;"> |
| 13 | <div class="wpallexport-collapsed-content-inner"> |
| 14 | <table class="form-table" style="max-width:none;"> |
| 15 | <tr> |
| 16 | <td colspan="3"> |
| 17 | |
| 18 | <div class="input" style="margin:5px 0px;"> |
| 19 | <label for="records_per_request"><?php esc_html_e('In each iteration, process', 'wp-all-export');?> <input type="text" name="records_per_iteration" class="wp_all_export_sub_input" style="width: 40px;" value="<?php echo esc_attr($post['records_per_iteration']) ?>" /> <?php esc_html_e('records', 'wp-all-export'); ?></label> |
| 20 | <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php esc_attr_e('WP All Export must be able to process this many records in less than your server\'s timeout settings. If your export fails before completion, to troubleshoot you should lower this number.', 'wp-all-export'); ?>">?</a> |
| 21 | </div> |
| 22 | |
| 23 | <?php |
| 24 | |
| 25 | if(empty($post['cpt'])) { |
| 26 | $postTypes = []; |
| 27 | $exportqueryPostType = []; |
| 28 | |
| 29 | if ( isset( $post['exportquery'] ) && ! empty( $post['exportquery']->query['post_type'] ) ) { |
| 30 | $exportqueryPostType = [ $post['exportquery']->query['post_type'] ]; |
| 31 | } |
| 32 | |
| 33 | if ( empty( $postTypes ) ) { |
| 34 | $postTypes = $exportqueryPostType; |
| 35 | } |
| 36 | |
| 37 | $post['cpt'] = $postTypes; |
| 38 | } |
| 39 | |
| 40 | $cpt_initial = $post['cpt']; |
| 41 | $cpt_name = is_array($post['cpt']) ? reset($post['cpt']) : $post['cpt']; |
| 42 | |
| 43 | if ( $cpt_name !== 'taxonomies' ) { |
| 44 | |
| 45 | if ( $cpt_name === 'users' ) { |
| 46 | $cpt_name = 'user'; |
| 47 | } |
| 48 | |
| 49 | $display_verb = 'created'; |
| 50 | $display_cpt_name = $cpt_name; |
| 51 | $tooltip_cpt_name = strtolower( wp_all_export_get_cpt_name( $cpt_initial ) ); |
| 52 | |
| 53 | if ( $display_cpt_name === 'shop_order' ) { |
| 54 | $display_cpt_name = 'WooCommerce Order'; |
| 55 | $display_verb = 'completed'; |
| 56 | } |
| 57 | |
| 58 | if ( $display_cpt_name === 'shop_customer' ) { |
| 59 | $display_cpt_name = 'WooCommerce Customer'; |
| 60 | $display_verb = 'created'; |
| 61 | } |
| 62 | |
| 63 | if ( $display_cpt_name === 'custom_wpae-gf-addon' ) { |
| 64 | $display_cpt_name = 'Gravity Forms Entry'; |
| 65 | } |
| 66 | |
| 67 | if ( $display_cpt_name === 'comments' ) { |
| 68 | $display_cpt_name = 'comment'; |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | |
| 73 | ?> |
| 74 | <div class="input"> |
| 75 | |
| 76 | <input type="hidden" id="wpae-post-name" value="<?php echo esc_attr($display_cpt_name); ?>" /> |
| 77 | <input type="hidden" name="enable_real_time_exports" value="0"/> |
| 78 | <input type="checkbox" |
| 79 | id="enable_real_time_exports" <?php if ((isset($post['xml_template_type']) && $post['xml_template_type'] == XmlExportEngine::EXPORT_TYPE_GOOLE_MERCHANTS) || $cpt_name === 'shop_customer') { ?> disabled="disabled" <?php } ?> |
| 80 | name="enable_real_time_exports" |
| 81 | value="1" /> |
| 82 | <?php /* translators: 1: post type name, 2: action verb (e.g., created/updated) */ ?> |
| 83 | <label for="enable_real_time_exports"><?php printf(esc_html__('Export each %1$s in real time as they are %2$s', 'wp-all-export'), esc_html($display_cpt_name), esc_html($display_verb)); ?></label> |
| 84 | <span> |
| 85 | <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" |
| 86 | <?php |
| 87 | if (isset($post['xml_template_type']) && $post['xml_template_type'] == XmlExportEngine::EXPORT_TYPE_GOOLE_MERCHANTS) { ?> |
| 88 | title="<?php esc_attr_e('This feature it not available for Google Merchants Exports.', 'wp-all-export'); ?>" |
| 89 | <?php } else if ($cpt_name === 'shop_customer') |
| 90 | { |
| 91 | ?> |
| 92 | |
| 93 | title="<?php esc_attr_e('This feature it not available for Customer Exports.', 'wp-all-export'); ?>" |
| 94 | <?php } else { ?> |
| 95 | title="<?php /* translators: 1: post type name, 2: action verb */ printf(esc_html__('This will export %1$s one by one, in real time, as they are %2$s.', 'wp-all-export'), esc_html(strtolower($tooltip_cpt_name)), esc_html($display_verb)); ?> <br/><br/><strong>Upgrade to the Pro edition of WP All Export to use this option.</strong>"> |
| 96 | <?php } ?>>?</a> |
| 97 | </span> |
| 98 | |
| 99 | <div class="wpallexport-free-edition-notice php-rte-upgrade" style="margin: 15px 0; padding: 20px; width: 600px; display: none;"> |
| 100 | <a class="upgrade_link" target="_blank" href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=5839967&discount=welcome-upgrade-99&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=real-time-exports"><?php /* translators: %s: post type name */ printf(esc_html__('Upgrade to the Pro edition of WP All Export to export each %s in real time.', 'wp-all-export'), esc_html($display_cpt_name)); ?></a> |
| 101 | <p><?php esc_html_e('If you already own it, remove the free edition and install the Pro edition.', 'wp-all-export'); ?></p> |
| 102 | </div> |
| 103 | </div> |
| 104 | |
| 105 | |
| 106 | |
| 107 | <div class="input" style="margin:5px 0px;"> |
| 108 | <input type="hidden" name="export_only_new_stuff" value="0" /> |
| 109 | <input type="checkbox" id="export_only_new_stuff" name="export_only_new_stuff" value="1" /> |
| 110 | <?php /* translators: %s: post type name */ ?> |
| 111 | <label for="export_only_new_stuff"><?php printf(esc_html__('Only export %s once', 'wp-all-export'), empty($post['cpt']) ? __('records', 'wp-all-export') : esc_html(wp_all_export_get_cpt_name($post['cpt']))); ?></label> |
| 112 | <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php esc_attr_e('If re-run, this export will only include records that have not been previously exported.<br><br><strong>Upgrade to the Pro edition of WP All Export to use this option.</strong>', 'wp-all-export'); ?>">?</a> |
| 113 | |
| 114 | <div class="wpallexport-free-edition-notice only-export-posts-once" style="margin: 15px 0; padding: 20px; width: 600px; display: none;"> |
| 115 | <a class="upgrade_link" target="_blank" |
| 116 | href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=5839967&discount=welcome-upgrade-99&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=export-only-new-stuff"> |
| 117 | <?php $noun = empty($post['cpt']) ? esc_html__('records', 'wp-all-export') : esc_html(wp_all_export_get_cpt_name($post['cpt'])); ?> |
| 118 | <?php /* translators: %s: post type name */ printf(esc_html__('Upgrade to the Pro edition of WP All Export to only export %s once.', 'wp-all-export'), $noun); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $noun escaped at assignment ?></a> |
| 119 | <p><?php esc_html_e('If you already own it, remove the free edition and install the Pro edition.', 'wp-all-export'); ?></p> |
| 120 | </div> |
| 121 | </div> |
| 122 | <div class="input" style="margin:5px 0px;"> |
| 123 | <input type="hidden" name="export_only_modified_stuff" value="0" /> |
| 124 | <input type="checkbox" id="export_only_modified_stuff" name="export_only_modified_stuff" value="1" <?php echo $post['export_only_modified_stuff'] ? 'checked="checked"': '' ?> <?php if (is_array($post['cpt']) && $post['cpt'][0] === 'users') {?> disabled="disabled" <?php }?> /> |
| 125 | <?php /* translators: %s: post type name */ ?> |
| 126 | <label for="export_only_modified_stuff" disabled="disabled"><?php printf(esc_html__('Only export %s that have been modified since last export', 'wp-all-export'), empty($post['cpt']) ? __('records', 'wp-all-export') : esc_html(wp_all_export_get_cpt_name($post['cpt'], 2, $post))); ?></label> |
| 127 | |
| 128 | <?php |
| 129 | if(is_array($post['cpt']) && $post['cpt'][0] === 'users') { |
| 130 | ?> |
| 131 | <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php esc_attr_e('This feature is not available for user exports.', 'wp-all-export'); ?>">?</a> |
| 132 | |
| 133 | <?php |
| 134 | } else { |
| 135 | ?> |
| 136 | <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php esc_attr_e('If re-run, this export will only include records that have been modified since last export run.<br><br><strong>Upgrade to the Pro edition of WP All Export to use this option.</strong>', 'wp-all-export'); ?>">?</a> |
| 137 | <?php |
| 138 | } |
| 139 | ?> |
| 140 | <div class="wpallexport-free-edition-notice only-export-modified-posts" style="margin: 15px 0; padding: 20px; width: 600px; display: none;"> |
| 141 | <a class="upgrade_link" target="_blank" |
| 142 | href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=5839967&discount=welcome-upgrade-99&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=export-only-modified-stuff"> |
| 143 | <?php $noun = empty($post['cpt']) ? esc_html__('records', 'wp-all-export') : esc_html(wp_all_export_get_cpt_name($post['cpt'])); ?> |
| 144 | <?php /* translators: %s: post type name */ printf(esc_html__('Upgrade to the Pro edition of WP All Export to only export %s that have been modified since last export.', 'wp-all-export'), $noun); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $noun escaped at assignment ?></a> |
| 145 | <p><?php esc_html_e('If you already own it, remove the free edition and install the Pro edition.', 'wp-all-export'); ?></p> |
| 146 | </div> |
| 147 | |
| 148 | </div> |
| 149 | |
| 150 | <div class="input" style="margin:5px 0px;"> |
| 151 | <input type="hidden" name="include_bom" value="0" /> |
| 152 | <input type="checkbox" id="include_bom" name="include_bom" value="1" <?php echo $post['include_bom'] ? 'checked="checked"': '' ?> /> |
| 153 | <label for="include_bom"><?php esc_html_e('Include BOM to enable non-ASCII characters in Excel', 'wp-all-export') ?></label> |
| 154 | <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php esc_attr_e('The BOM will help some programs like Microsoft Excel read your export file if it contains non-ASCII characters. These can include curly quotation marks or non-English characters such as umlauts.', 'wp-all-export'); ?>">?</a> |
| 155 | </div> |
| 156 | <div class="input" style="margin:5px 0px;"> |
| 157 | <input type="hidden" name="creata_a_new_export_file" value="0" /> |
| 158 | <input type="checkbox" id="creata_a_new_export_file" name="creata_a_new_export_file" value="1" <?php echo $post['creata_a_new_export_file'] ? 'checked="checked"': '' ?> /> |
| 159 | <label for="creata_a_new_export_file"><?php esc_html_e('Create a new file each time export is run', 'wp-all-export') ?></label> |
| 160 | <a href="#help" class="wpallexport-help" style="position: relative; top: -2px;" title="<?php esc_attr_e('If disabled, the export file will be overwritten every time this export run.', 'wp-all-export'); ?>">?</a> |
| 161 | </div> |
| 162 | <div class="input" style="margin:5px 0px;"> |
| 163 | <input type="hidden" name="split_large_exports" value="0" /> |
| 164 | <input type="checkbox" id="split_large_exports" name="split_large_exports" class="switcher" value="1" <?php echo $post['split_large_exports'] ? 'checked="checked"': '' ?> /> |
| 165 | <label for="split_large_exports"><?php esc_html_e('Split large exports into multiple files', 'wp-all-export') ?></label> |
| 166 | <span class="switcher-target-split_large_exports pl17" style="display:block; clear: both; width: 100%;"> |
| 167 | <div class="input pl17" style="margin:5px 0px;"> |
| 168 | <label for="records_per_request"><?php esc_html_e('Limit export to', 'wp-all-export');?></label> <input type="text" name="split_large_exports_count" class="wp_all_export_sub_input" style="width: 50px;" value="<?php echo esc_attr($post['split_large_exports_count']) ?>" /> <?php esc_html_e('records per file', 'wp-all-export'); ?> |
| 169 | </div> |
| 170 | </span> |
| 171 | </div> |
| 172 | <div class="input" style="margin:5px 0px;"> |
| 173 | <input type="hidden" name="allow_client_mode" value="0"/> |
| 174 | <input type="checkbox" id="allow_client_mode" name="allow_client_mode" |
| 175 | value="1" /> |
| 176 | <label for="allow_client_mode"><?php esc_html_e('Allow non-admins to run this export in Client Mode', 'wp-all-export') ?></label> |
| 177 | <span> |
| 178 | <a href="#help" class="wpallexport-help" style="position: relative; top: 0;" title="<?php esc_attr_e( 'When enabled, users with access to Client Mode will be able to run this export and download the export file. Go to All Export > Settings to give users access to Client Mode.<br><br><strong>Upgrade to the Pro edition of WP All Export to use this option.</strong>', 'wp-all-export' ); ?>">?</a> |
| 179 | </span> |
| 180 | |
| 181 | <div class="wpallexport-free-edition-notice client-mode-notice" style="margin: 15px 0; padding: 20px; width: 600px; display: none;"> |
| 182 | <a class="upgrade_link" target="_blank" |
| 183 | href="https://www.wpallimport.com/checkout/?edd_action=add_to_cart&download_id=5839967&discount=welcome-upgrade-99&edd_options%5Bprice_id%5D=1&utm_source=export-plugin-free&utm_medium=upgrade-notice&utm_campaign=client-mode"> |
| 184 | <?php $noun = empty($post['cpt']) ? __('records', 'wp-all-export') : esc_html(wp_all_export_get_cpt_name($post['cpt'])); ?> |
| 185 | <?php esc_html_e('Upgrade to the Pro edition of WP All Export to allow non-admins to run this export in Client Mode.','wp-all-export');?></a> |
| 186 | <p><?php esc_html_e('If you already own it, remove the free edition and install the Pro edition.', 'wp-all-export'); ?></p> |
| 187 | </div> |
| 188 | </div> |
| 189 | <br> |
| 190 | <hr> |
| 191 | <p style="text-align:right;"> |
| 192 | <div class="input"> |
| 193 | <label for="save_import_as" style="width: 103px;"><?php esc_html_e('Export Name:','wp-all-export');?></label> |
| 194 | <input type="text" name="friendly_name" title="<?php esc_attr_e('Save Export Name...', 'wp-all-export') ?>" style="vertical-align:middle; background:#fff !important; width: 350px;" value="<?php echo esc_attr(wp_all_export_clear_xss($post['friendly_name'])); ?>" /> |
| 195 | </div> |
| 196 | </p> |
| 197 | </td> |
| 198 | </tr> |
| 199 | </table> |
| 200 | </div> |
| 201 | </div> |
| 202 | </div> |
| 203 | </div> |