index.php
231 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 | |
| 8 | <form class="settings" method="post" action="<?php echo esc_url($this->baseUrl); ?>" enctype="multipart/form-data"> |
| 9 | |
| 10 | <div class="wpallexport-header"> |
| 11 | <div class="wpallexport-logo"></div> |
| 12 | <div class="wpallexport-title"> |
| 13 | <h3><?php esc_html_e('Settings', 'wp-all-export'); ?></h3> |
| 14 | </div> |
| 15 | </div> |
| 16 | <h2 style="padding:0px;"></h2> |
| 17 | |
| 18 | <div class="wpallexport-setting-wrapper"> |
| 19 | <?php if ($this->errors->get_error_codes()): ?> |
| 20 | <?php $this->error() ?> |
| 21 | <?php endif ?> |
| 22 | |
| 23 | <h3><?php esc_html_e('Import/Export Templates', 'wp-all-export') ?></h3> |
| 24 | <?php $templates = new PMXE_Template_List(); $templates->getBy()->convertRecords() ?> |
| 25 | <?php wp_nonce_field('delete-templates', '_wpnonce_delete-templates') ?> |
| 26 | <?php if ($templates->total()): ?> |
| 27 | <table> |
| 28 | <?php foreach ($templates as $t): ?> |
| 29 | <tr> |
| 30 | <td> |
| 31 | <label class="selectit" for="template-<?php echo esc_attr($t->id) ?>"><input id="template-<?php echo esc_attr($t->id) ?>" type="checkbox" name="templates[]" value="<?php echo esc_attr($t->id) ?>" /> <?php echo esc_html(wp_all_export_clear_xss($t->name)); ?></label> |
| 32 | </td> |
| 33 | </tr> |
| 34 | <?php endforeach ?> |
| 35 | </table> |
| 36 | <p class="submit-buttons"> |
| 37 | <input type="submit" class="button-primary" name="delete_templates" value="<?php esc_html_e('Delete Selected', 'wp-all-export') ?>" /> |
| 38 | <input type="submit" class="button-primary" name="export_templates" value="<?php esc_html_e('Export Selected', 'wp-all-export') ?>" /> |
| 39 | </p> |
| 40 | <?php else: ?> |
| 41 | <em><?php esc_html_e('There are no templates saved', 'wp-all-export') ?></em> |
| 42 | <?php endif ?> |
| 43 | <p> |
| 44 | <input type="hidden" name="is_templates_submitted" value="1" /> |
| 45 | <input type="file" name="template_file"/> |
| 46 | <input type="submit" class="button-primary" name="import_templates" value="<?php esc_html_e('Import Templates', 'wp-all-export') ?>" /> |
| 47 | </p> |
| 48 | </div> |
| 49 | |
| 50 | </form> |
| 51 | <br /> |
| 52 | |
| 53 | <form name="settings" class="settings" method="post" action="<?php echo esc_url($this->baseUrl); ?>"> |
| 54 | |
| 55 | <h3><?php esc_html_e('Files', 'wp-all-export') ?></h3> |
| 56 | |
| 57 | <table class="form-table"> |
| 58 | <tbody> |
| 59 | <tr> |
| 60 | <th scope="row"><label><?php esc_html_e('Secure Mode', 'wp-all-export'); ?></label></th> |
| 61 | <td> |
| 62 | <fieldset style="padding:0;"> |
| 63 | <legend class="screen-reader-text"><span><?php esc_html_e('Secure Mode', 'wp-all-export'); ?></span></legend> |
| 64 | <input type="hidden" name="secure" value="0"/> |
| 65 | <label for="secure"><input type="checkbox" value="1" id="secure" name="secure" <?php echo (($post['secure']) ? 'checked="checked"' : ''); ?>><?php esc_html_e('Randomize folder names', 'wp-all-export'); ?></label> |
| 66 | </fieldset> |
| 67 | <p class="description"> |
| 68 | <?php |
| 69 | $wp_uploads = wp_upload_dir(); |
| 70 | ?> |
| 71 | <?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- format string is a hardcoded literal; %s argument is escaped |
| 72 | printf('If enabled, exported files and temporary files will be saved in a folder with a randomized name in %s.<br/><br/>If disabled, exported files will be saved in the Media Library.', esc_html($wp_uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY) ); ?> |
| 73 | </p> |
| 74 | <p class="submit-buttons"> |
| 75 | <?php wp_nonce_field('edit-settings', '_wpnonce_edit-settings') ?> |
| 76 | <input type="hidden" name="is_settings_submitted" value="1" /> |
| 77 | <input type="submit" class="button-primary" value="Save Settings" /> |
| 78 | </p> |
| 79 | </td> |
| 80 | </tr> |
| 81 | </tbody> |
| 82 | </table> |
| 83 | |
| 84 | <h3><?php esc_html_e('Zapier Integration', 'wp-all-export') ?></h3> |
| 85 | |
| 86 | <table class="form-table"> |
| 87 | <tbody> |
| 88 | <tr> |
| 89 | <th scope="row"><label><?php esc_html_e('Getting Started', 'wp-all-export'); ?></label></th> |
| 90 | <td> |
| 91 | <p class="description"><?php printf(wp_kses_post(__('Zapier acts as a middle man between WP All Export and hundreds of other popular apps. To get started go to Zapier.com, create an account, and make a new Zap. Read more: <a target="_blank" href="https://zapier.com/zapbook/wp-all-export-pro/">https://zapier.com/zapbook/wp-all-export-pro/</a>', 'wp-all-export'), "https://zapier.com/zapbook/wp-all-export-pro/")); ?></p> |
| 92 | </td> |
| 93 | </tr> |
| 94 | <tr> |
| 95 | <th scope="row"><label><?php esc_html_e('API Key', 'wp-all-export'); ?></label></th> |
| 96 | <td> |
| 97 | <input type="text" class="regular-text" name="zapier_api_key" readOnly="readOnly" value=""/> |
| 98 | <input type="submit" class="button-secondary generate-zapier-api-key" name="pmxe_generate_zapier_api_key" value="<?php esc_html_e('Generate API Key', 'wp-all-export'); ?>"/> |
| 99 | <p class="description"><?php esc_html_e('Changing the key will require you to update your existing Zaps on Zapier.', 'wp-all-export'); ?></p> |
| 100 | </td> |
| 101 | </tr> |
| 102 | </tbody> |
| 103 | </table> |
| 104 | |
| 105 | <div class="wpallexport-free-edition-notice zapier-upgrade" style="margin: 15px 0; padding: 20px; display: none;"> |
| 106 | <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=zapier"><?php esc_html_e('Upgrade to the Pro edition of WP All Export for Zapier Integration','wp-all-export');?></a> |
| 107 | <p><?php esc_html_e('If you already own it, remove the free edition and install the Pro edition.', 'wp-all-export'); ?></p> |
| 108 | </div> |
| 109 | |
| 110 | <div class="clear"></div> |
| 111 | </form> |
| 112 | |
| 113 | <form name="settings" method="post" action="" class="settings"> |
| 114 | |
| 115 | <table class="form-table"> |
| 116 | <tbody> |
| 117 | |
| 118 | <tr> |
| 119 | <th scope="row"><label><?php esc_html_e('Automatic Scheduling License Key', 'wp-all-export'); ?></label></th> |
| 120 | <td> |
| 121 | <input type="password" class="regular-text" name="scheduling_license" |
| 122 | value="<?php if (!empty($post['scheduling_license'])) echo esc_attr(PMXE_Plugin::decode($post['scheduling_license'])); ?>"/> |
| 123 | <?php if (!empty($post['scheduling_license'])) { ?> |
| 124 | |
| 125 | <?php if (!empty($post['scheduling_license_status']) && $post['scheduling_license_status'] == 'valid') { ?> |
| 126 | <div class="license-status inline updated"><?php esc_html_e('Active', 'wp-all-export'); ?></div> |
| 127 | <?php } else { ?> |
| 128 | <input type="submit" class="button-secondary" name="pmxe_scheduling_license_activate" |
| 129 | value="<?php esc_html_e('Activate License', 'wp-all-export'); ?>"/> |
| 130 | <div class="license-status inline error"><?php echo esc_html($post['scheduling_license_status']); ?></div> |
| 131 | <input type="hidden" name="scheduling_license_limit" value="<?php echo esc_attr(get_option('wpai_wpae_scheduling_license_site_limit', 0)); ?>"> |
| 132 | <?php } ?> |
| 133 | |
| 134 | <?php } ?> |
| 135 | <?php |
| 136 | $scheduling = \Wpae\Scheduling\Scheduling::create(); |
| 137 | if(!($scheduling->checkLicense()['success'] ?? false)){ |
| 138 | require_once(PMXE_Plugin::ROOT_DIR . '/src/Scheduling/views/SchedulingActiveSitesLimitUI.php'); |
| 139 | ?> |
| 140 | <p class="description"><?php echo wp_kses_post(__('A license key is required to use Automatic Scheduling. If you have already subscribed, <a href="https://www.wpallimport.com/portal/automatic-scheduling/" target="_blank">click here to access your license key</a>.<br>If you don\'t have a license, <a class="scheduling-subscribe-link" href="#">click here to subscribe</a>.', 'wp-all-export')); ?></p> |
| 141 | <?php |
| 142 | } |
| 143 | ?> |
| 144 | |
| 145 | <p class="submit-buttons"> |
| 146 | <?php wp_nonce_field('edit-license', '_wpnonce_edit-scheduling-license') ?> |
| 147 | <input type="hidden" name="is_scheduling_license_submitted" value="1"/> |
| 148 | <input type="submit" class="button-primary" value="Save License"/> |
| 149 | </p> |
| 150 | </td> |
| 151 | </tr> |
| 152 | </tbody> |
| 153 | </table> |
| 154 | </form> |
| 155 | <form name="client-mode-settings" method="post" action="" class="client-mode-settings"> |
| 156 | |
| 157 | <div> |
| 158 | <h3>Client Mode</h3> |
| 159 | <div style="float: left; width: 20%;"> |
| 160 | Roles With Access |
| 161 | </div> |
| 162 | <div style="float: left; width: 70%;"> |
| 163 | |
| 164 | <?php foreach ($roles as $key => $role) { |
| 165 | $roleObject = get_role($key); |
| 166 | ?> |
| 167 | <input type="checkbox" id="role-<?php echo esc_attr($key); ?>" |
| 168 | value="<?php echo esc_attr($key); ?>" |
| 169 | <?php if(isset($post['client_mode_roles']) && is_array($post['client_mode_roles']) && in_array($key, $post['client_mode_roles'])) {?> checked="checked" <?php } ?> |
| 170 | <?php if($roleObject->has_cap(PMXE_Plugin::$capabilities)) {?> disabled="disabled" checked="checked" <?php }?> |
| 171 | name="client_mode_roles[]"/> |
| 172 | <label |
| 173 | for="role-<?php echo esc_attr($key); ?>"><?php echo esc_html($role['name']); ?> <br/></label> |
| 174 | <?php } ?> |
| 175 | |
| 176 | <p class="submit-buttons"> |
| 177 | <?php wp_nonce_field('edit-client-mode-settings', '_wpnonce_edit-client_mode_settings') ?> |
| 178 | <div class="input wp_all_export_save_client_mode_container"> |
| 179 | <input type="button" class="button-primary wp_all_export_save_client_mode" value="<?php esc_html_e("Save Client Mode Settings", 'wp-all-export'); ?>"/> |
| 180 | </div> |
| 181 | </p> |
| 182 | </div> |
| 183 | <div class="clear"></div> |
| 184 | <div class="wpallexport-free-edition-notice php-client-mode-upgrade" style="margin: 15px 0; padding: 20px; display: none;"> |
| 185 | <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=client-mode"><?php esc_html_e('Upgrade to the Pro edition of WP All Export to enable 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 | </form> |
| 190 | <div class="wpallexport-overlay"></div> |
| 191 | <div class="wpallexport-loader" |
| 192 | style="border-radius: 5px; z-index: 999999; display:none; position: fixed;top: 200px; left: 50%; width: 100px;height: 100px;background-color: #fff; text-align: center;"> |
| 193 | <img style="margin-top: 45%;" src="<?php echo esc_url( PMXE_ROOT_URL ); ?>/static/img/preloader.gif"/> |
| 194 | </div> |
| 195 | |
| 196 | |
| 197 | <div class="wpallexport-super-overlay"></div> |
| 198 | |
| 199 | <?php |
| 200 | $uploads = wp_upload_dir(); |
| 201 | $functions = $uploads['basedir'] . DIRECTORY_SEPARATOR . WP_ALL_EXPORT_UPLOADS_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'functions.php'; |
| 202 | ?> |
| 203 | <hr /> |
| 204 | <div class="function-editor"> |
| 205 | <h3><?php esc_html_e('Function Editor', 'wp-all-export') ?></h3> |
| 206 | |
| 207 | <textarea id="wp_all_export_code" name="wp_all_export_code"><?php echo "<?php\n\n?>";?></textarea> |
| 208 | <div class="wpallexport-free-edition-notice php-functions-upgrade" style="margin: 15px 0; padding: 20px; display: none;"> |
| 209 | <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=function-editor"><?php esc_html_e('Upgrade to the Pro edition of WP All Export to enable the Function Editor','wp-all-export');?></a> |
| 210 | <p><?php esc_html_e('If you already own it, remove the free edition and install the Pro edition.', 'wp-all-export'); ?></p> |
| 211 | </div> |
| 212 | |
| 213 | <div class="input" style="margin-top: 10px;"> |
| 214 | |
| 215 | <div class="input wp_all_export_save_functions_container" style="display:inline-block; margin-right: 20px;"> |
| 216 | <input type="button" class="button-primary wp_all_export_save_functions" value="<?php esc_html_e("Save Functions", 'wp-all-export'); ?>"/> |
| 217 | <?php /* translators: %s: functions file path */ ?> |
| 218 | <a href="#help" class="wpallexport-help" title="<?php printf(esc_html__("Add functions here for use during your export. You can access this file at %s", "wp-all-export"), esc_attr(preg_replace("%.*wp-content%", "wp-content", $functions)));?>" style="top: 0;">?</a> |
| 219 | <div class="wp_all_export_functions_preloader"></div> |
| 220 | </div> |
| 221 | <div class="input wp_all_export_saving_status"> |
| 222 | |
| 223 | </div> |
| 224 | |
| 225 | </div> |
| 226 | </div> |
| 227 | <div class="wpallexport-negative-margin fifteen"> |
| 228 | <?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- plugin-owned filter output; callback in filters/wpallexport_footer.php returns trusted static HTML |
| 229 | echo apply_filters('wpallexport_footer', ''); ?> |
| 230 | </div> |
| 231 |