@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_Data' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_Data')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Data. |
@@ -35,14 +35,14 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function __construct() { |
37 | 37 | $this->id = 'data'; |
38 | - $this->label = esc_html__( 'Data', 'give' ); |
|
38 | + $this->label = esc_html__('Data', 'give'); |
|
39 | 39 | |
40 | 40 | parent::__construct(); |
41 | 41 | |
42 | 42 | // Do not use main form for this tab. |
43 | - if( give_get_current_setting_tab() === $this->id ) { |
|
44 | - add_action( "give-tools_open_form", '__return_empty_string' ); |
|
45 | - add_action( "give-tools_close_form", '__return_empty_string' ); |
|
43 | + if (give_get_current_setting_tab() === $this->id) { |
|
44 | + add_action("give-tools_open_form", '__return_empty_string'); |
|
45 | + add_action("give-tools_close_form", '__return_empty_string'); |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function get_settings() { |
56 | 56 | // Get settings. |
57 | - $settings = apply_filters( 'give_settings_data', array( |
|
57 | + $settings = apply_filters('give_settings_data', array( |
|
58 | 58 | array( |
59 | 59 | 'id' => 'give_tools_tools', |
60 | 60 | 'type' => 'title', |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | ), |
63 | 63 | array( |
64 | 64 | 'id' => 'api', |
65 | - 'name' => esc_html__( 'Tools', 'give' ), |
|
65 | + 'name' => esc_html__('Tools', 'give'), |
|
66 | 66 | 'type' => 'data', |
67 | 67 | ), |
68 | 68 | array( |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @since 1.8 |
79 | 79 | * @param array $settings |
80 | 80 | */ |
81 | - $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
|
81 | + $settings = apply_filters('give_get_settings_'.$this->id, $settings); |
|
82 | 82 | |
83 | 83 | // Output. |
84 | 84 | return $settings; |
@@ -11,11 +11,11 @@ discard block |
||
11 | 11 | * @since 1.8.17 |
12 | 12 | */ |
13 | 13 | |
14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
14 | +if ( ! defined('ABSPATH')) { |
|
15 | 15 | exit; // Exit if accessed directly |
16 | 16 | } |
17 | 17 | |
18 | -if ( ! class_exists( 'Give_Import_Core_Settings' ) ) { |
|
18 | +if ( ! class_exists('Give_Import_Core_Settings')) { |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * Give_Import_Core_Settings. |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @return static |
69 | 69 | */ |
70 | 70 | public static function get_instance() { |
71 | - if ( null === static::$instance ) { |
|
71 | + if (null === static::$instance) { |
|
72 | 72 | self::$instance = new static(); |
73 | 73 | } |
74 | 74 | |
@@ -95,26 +95,26 @@ discard block |
||
95 | 95 | * @return void |
96 | 96 | */ |
97 | 97 | private function setup_hooks() { |
98 | - if ( ! $this->is_donations_import_page() ) { |
|
98 | + if ( ! $this->is_donations_import_page()) { |
|
99 | 99 | return; |
100 | 100 | } |
101 | 101 | |
102 | 102 | // Do not render main import tools page. |
103 | - remove_action( 'give_admin_field_tools_import', array( 'Give_Settings_Import', 'render_import_field', ) ); |
|
103 | + remove_action('give_admin_field_tools_import', array('Give_Settings_Import', 'render_import_field',)); |
|
104 | 104 | |
105 | 105 | // Render donation import page |
106 | - add_action( 'give_admin_field_tools_import', array( $this, 'render_page' ) ); |
|
106 | + add_action('give_admin_field_tools_import', array($this, 'render_page')); |
|
107 | 107 | |
108 | 108 | // Print the HTML. |
109 | - add_action( 'give_tools_import_core_settings_form_start', array( $this, 'html' ), 10 ); |
|
109 | + add_action('give_tools_import_core_settings_form_start', array($this, 'html'), 10); |
|
110 | 110 | |
111 | 111 | // Run when form submit. |
112 | - add_action( 'give-tools_save_import', array( $this, 'save' ) ); |
|
112 | + add_action('give-tools_save_import', array($this, 'save')); |
|
113 | 113 | |
114 | - add_action( 'give-tools_update_notices', array( $this, 'update_notices' ), 11, 1 ); |
|
114 | + add_action('give-tools_update_notices', array($this, 'update_notices'), 11, 1); |
|
115 | 115 | |
116 | 116 | // Used to add submit button. |
117 | - add_action( 'give_tools_import_core_settings_form_end', array( $this, 'submit' ), 10 ); |
|
117 | + add_action('give_tools_import_core_settings_form_end', array($this, 'submit'), 10); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -126,9 +126,9 @@ discard block |
||
126 | 126 | * |
127 | 127 | * @return mixed |
128 | 128 | */ |
129 | - public function update_notices( $messages ) { |
|
130 | - if ( ! empty( $_GET['tab'] ) && 'import' === give_clean( $_GET['tab'] ) ) { |
|
131 | - unset( $messages['give-setting-updated'] ); |
|
129 | + public function update_notices($messages) { |
|
130 | + if ( ! empty($_GET['tab']) && 'import' === give_clean($_GET['tab'])) { |
|
131 | + unset($messages['give-setting-updated']); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | return $messages; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @since 1.8.17 |
141 | 141 | */ |
142 | 142 | public function submit() { |
143 | - wp_nonce_field( 'give-save-settings', '_give-save-settings' ); |
|
143 | + wp_nonce_field('give-save-settings', '_give-save-settings'); |
|
144 | 144 | ?> |
145 | 145 | <input type="hidden" class="import-step" id="import-step" name="step" value="<?php echo $this->get_step(); ?>"/> |
146 | 146 | <input type="hidden" class="importer-type" value="<?php echo $this->importer_type; ?>"/> |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | id="<?php echo "step-{$step}"; ?>"> |
164 | 164 | <tbody> |
165 | 165 | <?php |
166 | - switch ( $this->get_step() ) { |
|
166 | + switch ($this->get_step()) { |
|
167 | 167 | case 1: |
168 | 168 | $this->render_upload_html(); |
169 | 169 | break; |
@@ -190,14 +190,14 @@ discard block |
||
190 | 190 | public function import_success() { |
191 | 191 | // Imported successfully |
192 | 192 | |
193 | - $success = (bool) ( isset( $_GET['success'] ) ? give_clean( $_GET['success'] ) : false ); |
|
194 | - $undo = (bool) ( isset( $_GET['undo'] ) ? give_clean( $_GET['undo'] ) : false ); |
|
193 | + $success = (bool) (isset($_GET['success']) ? give_clean($_GET['success']) : false); |
|
194 | + $undo = (bool) (isset($_GET['undo']) ? give_clean($_GET['undo']) : false); |
|
195 | 195 | $query_arg_setting = array( |
196 | 196 | 'post_type' => 'give_forms', |
197 | 197 | 'page' => 'give-settings', |
198 | 198 | ); |
199 | 199 | |
200 | - if ( $undo ) { |
|
200 | + if ($undo) { |
|
201 | 201 | $success = false; |
202 | 202 | } |
203 | 203 | |
@@ -210,30 +210,30 @@ discard block |
||
210 | 210 | 'undo' => 'true', |
211 | 211 | ); |
212 | 212 | |
213 | - $title = __( 'Settings Importing Completed!', 'give' ); |
|
214 | - if ( $success ) { |
|
213 | + $title = __('Settings Importing Completed!', 'give'); |
|
214 | + if ($success) { |
|
215 | 215 | $query_arg_success['undo'] = '1'; |
216 | 216 | $query_arg_success['step'] = '3'; |
217 | 217 | $query_arg_success['success'] = '1'; |
218 | - $text = __( 'Undo Importing', 'give' ); |
|
218 | + $text = __('Undo Importing', 'give'); |
|
219 | 219 | } else { |
220 | - if ( $undo ) { |
|
221 | - $host_give_options = get_option( 'give_settings_old', array() ); |
|
222 | - update_option( 'give_settings', $host_give_options ); |
|
223 | - $title = __( 'Undo of Setting Imported Completed!', 'give' ); |
|
220 | + if ($undo) { |
|
221 | + $host_give_options = get_option('give_settings_old', array()); |
|
222 | + update_option('give_settings', $host_give_options); |
|
223 | + $title = __('Undo of Setting Imported Completed!', 'give'); |
|
224 | 224 | } else { |
225 | - $title = __( 'Failed to import', 'give' ); |
|
225 | + $title = __('Failed to import', 'give'); |
|
226 | 226 | } |
227 | 227 | |
228 | - $text = __( 'Importing Again', 'give' ); |
|
228 | + $text = __('Importing Again', 'give'); |
|
229 | 229 | } |
230 | 230 | ?> |
231 | 231 | <tr valign="top" class="give-import-dropdown"> |
232 | 232 | <th colspan="2"> |
233 | 233 | <h2><?php echo $title; ?></h2> |
234 | 234 | <p> |
235 | - <a class="button button-large button-secondary" href="<?php echo add_query_arg( $query_arg_success, admin_url( 'edit.php' ) ); ?>"><?php echo $text; ?></a> |
|
236 | - <a class="button button-large button-secondary" href="<?php echo add_query_arg( $query_arg_setting, admin_url( 'edit.php' ) ); ?>"><?php echo __( 'View Settings', 'give' ); ?></a> |
|
235 | + <a class="button button-large button-secondary" href="<?php echo add_query_arg($query_arg_success, admin_url('edit.php')); ?>"><?php echo $text; ?></a> |
|
236 | + <a class="button button-large button-secondary" href="<?php echo add_query_arg($query_arg_setting, admin_url('edit.php')); ?>"><?php echo __('View Settings', 'give'); ?></a> |
|
237 | 237 | </p> |
238 | 238 | </th> |
239 | 239 | </tr> |
@@ -246,14 +246,14 @@ discard block |
||
246 | 246 | * @since 1.8.17 |
247 | 247 | */ |
248 | 248 | public function start_import() { |
249 | - $type = ( ! empty( $_GET['type'] ) ? give_clean( $_GET['type'] ) : 'replace' ); |
|
250 | - $file_name = ( ! empty( $_GET['file_name'] ) ? give_clean( $_GET['file_name'] ) : '' ); |
|
249 | + $type = ( ! empty($_GET['type']) ? give_clean($_GET['type']) : 'replace'); |
|
250 | + $file_name = ( ! empty($_GET['file_name']) ? give_clean($_GET['file_name']) : ''); |
|
251 | 251 | |
252 | 252 | ?> |
253 | 253 | <tr valign="top" class="give-import-dropdown"> |
254 | 254 | <th colspan="2"> |
255 | - <h2 id="give-import-title"><?php esc_html_e( 'Importing', 'give' ) ?></h2> |
|
256 | - <p class="give-field-description"><?php esc_html_e( 'Your settings are now being imported...', 'give' ) ?></p> |
|
255 | + <h2 id="give-import-title"><?php esc_html_e('Importing', 'give') ?></h2> |
|
256 | + <p class="give-field-description"><?php esc_html_e('Your settings are now being imported...', 'give') ?></p> |
|
257 | 257 | </th> |
258 | 258 | </tr> |
259 | 259 | |
@@ -286,14 +286,14 @@ discard block |
||
286 | 286 | $step = $this->get_step(); |
287 | 287 | ?> |
288 | 288 | <ol class="give-progress-steps"> |
289 | - <li class="<?php echo( 1 === $step ? 'active' : '' ); ?>"> |
|
290 | - <?php esc_html_e( 'Upload JSON file', 'give' ); ?> |
|
289 | + <li class="<?php echo(1 === $step ? 'active' : ''); ?>"> |
|
290 | + <?php esc_html_e('Upload JSON file', 'give'); ?> |
|
291 | 291 | </li> |
292 | - <li class="<?php echo( 2 === $step ? 'active' : '' ); ?>"> |
|
293 | - <?php esc_html_e( 'Import', 'give' ); ?> |
|
292 | + <li class="<?php echo(2 === $step ? 'active' : ''); ?>"> |
|
293 | + <?php esc_html_e('Import', 'give'); ?> |
|
294 | 294 | </li> |
295 | - <li class="<?php echo( 3 === $step ? 'active' : '' ); ?>"> |
|
296 | - <?php esc_html_e( 'Done!', 'give' ); ?> |
|
295 | + <li class="<?php echo(3 === $step ? 'active' : ''); ?>"> |
|
296 | + <?php esc_html_e('Done!', 'give'); ?> |
|
297 | 297 | </li> |
298 | 298 | </ol> |
299 | 299 | <?php |
@@ -307,14 +307,14 @@ discard block |
||
307 | 307 | * @return int $step on which step doest the import is on. |
308 | 308 | */ |
309 | 309 | public function get_step() { |
310 | - $step = (int) ( isset( $_REQUEST['step'] ) ? give_clean( $_REQUEST['step'] ) : 0 ); |
|
310 | + $step = (int) (isset($_REQUEST['step']) ? give_clean($_REQUEST['step']) : 0); |
|
311 | 311 | $on_step = 1; |
312 | 312 | |
313 | - if ( empty( $step ) || 1 === $step ) { |
|
313 | + if (empty($step) || 1 === $step) { |
|
314 | 314 | $on_step = 1; |
315 | - } elseif ( 2 === $step ) { |
|
315 | + } elseif (2 === $step) { |
|
316 | 316 | $on_step = 2; |
317 | - } elseif ( 3 === $step ) { |
|
317 | + } elseif (3 === $step) { |
|
318 | 318 | $on_step = 3; |
319 | 319 | } |
320 | 320 | |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | * @since 1.8.17 |
328 | 328 | */ |
329 | 329 | public function render_page() { |
330 | - include_once GIVE_PLUGIN_DIR . 'includes/admin/tools/views/html-admin-page-import-core-settings.php'; |
|
330 | + include_once GIVE_PLUGIN_DIR.'includes/admin/tools/views/html-admin-page-import-core-settings.php'; |
|
331 | 331 | } |
332 | 332 | |
333 | 333 | /** |
@@ -339,15 +339,15 @@ discard block |
||
339 | 339 | * @return void |
340 | 340 | */ |
341 | 341 | public function render_upload_html() { |
342 | - $json = ( isset( $_POST['json'] ) ? give_clean( $_POST['json'] ) : '' ); |
|
343 | - $type = ( isset( $_POST['type'] ) ? give_clean( $_POST['type'] ) : 'merge' ); |
|
342 | + $json = (isset($_POST['json']) ? give_clean($_POST['json']) : ''); |
|
343 | + $type = (isset($_POST['type']) ? give_clean($_POST['type']) : 'merge'); |
|
344 | 344 | $step = $this->get_step(); |
345 | 345 | |
346 | 346 | ?> |
347 | 347 | <tr valign="top"> |
348 | 348 | <th colspan="2"> |
349 | - <h2 id="give-import-title"><?php esc_html_e( 'Import Core Settings from a JSON file', 'give' ) ?></h2> |
|
350 | - <p class="give-field-description"><?php esc_html_e( 'This tool allows you to merge or replace settings data to your give settings via a JSON file.', 'give' ) ?></p> |
|
349 | + <h2 id="give-import-title"><?php esc_html_e('Import Core Settings from a JSON file', 'give') ?></h2> |
|
350 | + <p class="give-field-description"><?php esc_html_e('This tool allows you to merge or replace settings data to your give settings via a JSON file.', 'give') ?></p> |
|
351 | 351 | </th> |
352 | 352 | </tr> |
353 | 353 | |
@@ -369,20 +369,20 @@ discard block |
||
369 | 369 | $settings = array( |
370 | 370 | array( |
371 | 371 | 'id' => 'type', |
372 | - 'name' => __( 'Merge Type:', 'give' ), |
|
373 | - 'description' => __( 'Import the Setting from the JSON and then merge or replace with the current settings', 'give' ), |
|
372 | + 'name' => __('Merge Type:', 'give'), |
|
373 | + 'description' => __('Import the Setting from the JSON and then merge or replace with the current settings', 'give'), |
|
374 | 374 | 'default' => $type, |
375 | 375 | 'type' => 'radio_inline', |
376 | 376 | 'options' => array( |
377 | - 'merge' => __( 'Merge', 'give' ), |
|
378 | - 'replace' => __( 'Replace', 'give' ), |
|
377 | + 'merge' => __('Merge', 'give'), |
|
378 | + 'replace' => __('Replace', 'give'), |
|
379 | 379 | ), |
380 | 380 | ), |
381 | 381 | ); |
382 | 382 | |
383 | - $settings = apply_filters( 'give_import_core_setting_html', $settings ); |
|
383 | + $settings = apply_filters('give_import_core_setting_html', $settings); |
|
384 | 384 | |
385 | - Give_Admin_Settings::output_fields( $settings, 'give_settings' ); |
|
385 | + Give_Admin_Settings::output_fields($settings, 'give_settings'); |
|
386 | 386 | ?> |
387 | 387 | <tr valign="top"> |
388 | 388 | <th></th> |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | <input type="submit" |
391 | 391 | class="button button-primary button-large button-secondary <?php echo "step-{$step}"; ?>" |
392 | 392 | id="recount-stats-submit" |
393 | - value="<?php esc_attr_e( 'Submit', 'give' ); ?>"/> |
|
393 | + value="<?php esc_attr_e('Submit', 'give'); ?>"/> |
|
394 | 394 | </th> |
395 | 395 | </tr> |
396 | 396 | <?php |
@@ -407,20 +407,20 @@ discard block |
||
407 | 407 | $step = $this->get_step(); |
408 | 408 | |
409 | 409 | // Validation for first step. |
410 | - if ( 1 === $step ) { |
|
411 | - $type = ( ! empty( $_REQUEST['type'] ) ? give_clean( $_REQUEST['type'] ) : 'replace' ); |
|
410 | + if (1 === $step) { |
|
411 | + $type = ( ! empty($_REQUEST['type']) ? give_clean($_REQUEST['type']) : 'replace'); |
|
412 | 412 | $core_settings = self::upload_widget_settings_file(); |
413 | - if ( ! empty( $core_settings['error'] ) ) { |
|
414 | - Give_Admin_Settings::add_error( 'give-import-csv', __( 'Please upload a valid JSON settings file.', 'give' ) ); |
|
413 | + if ( ! empty($core_settings['error'])) { |
|
414 | + Give_Admin_Settings::add_error('give-import-csv', __('Please upload a valid JSON settings file.', 'give')); |
|
415 | 415 | } else { |
416 | - $file_path = explode( '/', $core_settings['file'] ); |
|
417 | - $count = ( count( $file_path ) - 1 ); |
|
418 | - $url = give_import_page_url( (array) apply_filters( 'give_import_core_settings_importing_url', array( |
|
416 | + $file_path = explode('/', $core_settings['file']); |
|
417 | + $count = (count($file_path) - 1); |
|
418 | + $url = give_import_page_url((array) apply_filters('give_import_core_settings_importing_url', array( |
|
419 | 419 | 'step' => '2', |
420 | 420 | 'importer-type' => $this->importer_type, |
421 | 421 | 'type' => $type, |
422 | - 'file_name' => $file_path[ $count ], |
|
423 | - ) ) ); |
|
422 | + 'file_name' => $file_path[$count], |
|
423 | + ))); |
|
424 | 424 | |
425 | 425 | ?> |
426 | 426 | <script type="text/javascript"> |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | * @return bool |
439 | 439 | */ |
440 | 440 | private function is_donations_import_page() { |
441 | - return 'import' === give_get_current_setting_tab() && isset( $_GET['importer-type'] ) && $this->importer_type === give_clean( $_GET['importer-type'] ); |
|
441 | + return 'import' === give_get_current_setting_tab() && isset($_GET['importer-type']) && $this->importer_type === give_clean($_GET['importer-type']); |
|
442 | 442 | } |
443 | 443 | |
444 | 444 | /** |
@@ -447,14 +447,14 @@ discard block |
||
447 | 447 | */ |
448 | 448 | public static function upload_widget_settings_file() { |
449 | 449 | $upload = false; |
450 | - if ( isset( $_FILES['json'] ) ) { |
|
451 | - add_filter( 'upload_mimes', array( __CLASS__, 'json_upload_mimes' ) ); |
|
450 | + if (isset($_FILES['json'])) { |
|
451 | + add_filter('upload_mimes', array(__CLASS__, 'json_upload_mimes')); |
|
452 | 452 | |
453 | - $upload = wp_handle_upload( $_FILES['json'], array( 'test_form' => false ) ); |
|
453 | + $upload = wp_handle_upload($_FILES['json'], array('test_form' => false)); |
|
454 | 454 | |
455 | - remove_filter( 'upload_mimes', array( __CLASS__, 'json_upload_mimes' ) ); |
|
455 | + remove_filter('upload_mimes', array(__CLASS__, 'json_upload_mimes')); |
|
456 | 456 | } else { |
457 | - Give_Admin_Settings::add_error( 'give-import-csv', __( 'Please upload or provide a valid JSON file.', 'give' ) ); |
|
457 | + Give_Admin_Settings::add_error('give-import-csv', __('Please upload or provide a valid JSON file.', 'give')); |
|
458 | 458 | } |
459 | 459 | |
460 | 460 | return $upload; |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | * |
466 | 466 | * @param array $existing_mimes |
467 | 467 | */ |
468 | - public static function json_upload_mimes( $existing_mimes = array() ) { |
|
468 | + public static function json_upload_mimes($existing_mimes = array()) { |
|
469 | 469 | $existing_mimes['json'] = 'application/json'; |
470 | 470 | |
471 | 471 | return $existing_mimes; |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_Import' ) ) { |
|
16 | +if ( ! class_exists('Give_Settings_Import')) { |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_Import. |
@@ -45,23 +45,23 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function __construct() { |
47 | 47 | $this->id = 'import'; |
48 | - $this->label = __( 'Import', 'give' ); |
|
48 | + $this->label = __('Import', 'give'); |
|
49 | 49 | |
50 | 50 | parent::__construct(); |
51 | 51 | |
52 | 52 | // Will display html of the import donation. |
53 | - add_action( 'give_admin_field_tools_import', array( |
|
53 | + add_action('give_admin_field_tools_import', array( |
|
54 | 54 | 'Give_Settings_Import', |
55 | 55 | 'render_import_field', |
56 | - ), 10, 2 ); |
|
56 | + ), 10, 2); |
|
57 | 57 | |
58 | 58 | // Do not use main form for this tab. |
59 | - if ( give_get_current_setting_tab() === $this->id ) { |
|
60 | - add_action( "give-tools_open_form", '__return_empty_string' ); |
|
61 | - add_action( "give-tools_close_form", '__return_empty_string' ); |
|
59 | + if (give_get_current_setting_tab() === $this->id) { |
|
60 | + add_action("give-tools_open_form", '__return_empty_string'); |
|
61 | + add_action("give-tools_close_form", '__return_empty_string'); |
|
62 | 62 | |
63 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/import/class-give-import-donations.php'; |
|
64 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/tools/import/class-give-import-core-settings.php'; |
|
63 | + require_once GIVE_PLUGIN_DIR.'includes/admin/tools/import/class-give-import-donations.php'; |
|
64 | + require_once GIVE_PLUGIN_DIR.'includes/admin/tools/import/class-give-import-core-settings.php'; |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * @param array $settings |
81 | 81 | */ |
82 | 82 | $settings = apply_filters( |
83 | - 'give_get_settings_' . $this->id, |
|
83 | + 'give_get_settings_'.$this->id, |
|
84 | 84 | array( |
85 | 85 | array( |
86 | 86 | 'id' => 'give_tools_import', |
@@ -89,14 +89,14 @@ discard block |
||
89 | 89 | ), |
90 | 90 | array( |
91 | 91 | 'id' => 'import', |
92 | - 'name' => __( 'Import', 'give' ), |
|
92 | + 'name' => __('Import', 'give'), |
|
93 | 93 | 'type' => 'tools_import', |
94 | 94 | ), |
95 | 95 | array( |
96 | - 'name' => esc_html__( 'Import Docs Link', 'give' ), |
|
96 | + 'name' => esc_html__('Import Docs Link', 'give'), |
|
97 | 97 | 'id' => 'import_docs_link', |
98 | - 'url' => esc_url( 'http://docs.givewp.com/tools-importer' ), |
|
99 | - 'title' => __( 'Import Tab', 'give' ), |
|
98 | + 'url' => esc_url('http://docs.givewp.com/tools-importer'), |
|
99 | + 'title' => __('Import Tab', 'give'), |
|
100 | 100 | 'type' => 'give_docs_link', |
101 | 101 | ), |
102 | 102 | array( |
@@ -120,8 +120,8 @@ discard block |
||
120 | 120 | * @param $field |
121 | 121 | * @param $option_value |
122 | 122 | */ |
123 | - public static function render_import_field( $field, $option_value ) { |
|
124 | - include_once GIVE_PLUGIN_DIR . 'includes/admin/tools/views/html-admin-page-imports.php'; |
|
123 | + public static function render_import_field($field, $option_value) { |
|
124 | + include_once GIVE_PLUGIN_DIR.'includes/admin/tools/views/html-admin-page-imports.php'; |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | } |
@@ -3,11 +3,11 @@ discard block |
||
3 | 3 | * Admin View: Import Donations |
4 | 4 | */ |
5 | 5 | |
6 | -if ( ! defined( 'ABSPATH' ) ) { |
|
6 | +if ( ! defined('ABSPATH')) { |
|
7 | 7 | exit; |
8 | 8 | } |
9 | 9 | |
10 | -if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
10 | +if ( ! current_user_can('manage_give_settings')) { |
|
11 | 11 | return; |
12 | 12 | } |
13 | 13 | |
@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | * |
17 | 17 | * @since 1.8.13 |
18 | 18 | */ |
19 | -do_action( 'give_tools_import_donations_main_before' ); |
|
19 | +do_action('give_tools_import_donations_main_before'); |
|
20 | 20 | ?> |
21 | 21 | <div id="poststuff"> |
22 | 22 | <div class="postbox"> |
23 | - <h1 class="give-importer-h1" align="center"><?php esc_html_e( 'Import Donations', 'give' ); ?></h1> |
|
23 | + <h1 class="give-importer-h1" align="center"><?php esc_html_e('Import Donations', 'give'); ?></h1> |
|
24 | 24 | <div class="inside give-tools-setting-page-import give-import-donations"> |
25 | 25 | <?php |
26 | 26 | /** |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @since 1.8.14 |
30 | 30 | */ |
31 | - do_action( 'give_tools_import_donations_form_before_start' ); |
|
31 | + do_action('give_tools_import_donations_form_before_start'); |
|
32 | 32 | ?> |
33 | 33 | <form method="post" id="give-import-donations-form" class="give-import-form tools-setting-page-import tools-setting-page-import"> |
34 | 34 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * |
39 | 39 | * @since 1.8.14 |
40 | 40 | */ |
41 | - do_action( 'give_tools_import_donations_form_start' ); |
|
41 | + do_action('give_tools_import_donations_form_start'); |
|
42 | 42 | ?> |
43 | 43 | |
44 | 44 | <?php |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * |
48 | 48 | * @since 1.8.14 |
49 | 49 | */ |
50 | - do_action( 'give_tools_import_donations_form_end' ); |
|
50 | + do_action('give_tools_import_donations_form_end'); |
|
51 | 51 | ?> |
52 | 52 | </form> |
53 | 53 | <?php |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * |
57 | 57 | * @since 1.8.14 |
58 | 58 | */ |
59 | - do_action( 'give_tools_import_donations_form_after_end' ); |
|
59 | + do_action('give_tools_import_donations_form_after_end'); |
|
60 | 60 | ?> |
61 | 61 | </div><!-- .inside --> |
62 | 62 | </div><!-- .postbox --> |
@@ -67,4 +67,4 @@ discard block |
||
67 | 67 | * |
68 | 68 | * @since 1.8.13 |
69 | 69 | */ |
70 | -do_action( 'give_tools_import_donations_main_after' ); |
|
70 | +do_action('give_tools_import_donations_main_after'); |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | * Admin View: Exports |
4 | 4 | */ |
5 | 5 | |
6 | -if ( ! defined( 'ABSPATH' ) ) { |
|
6 | +if ( ! defined('ABSPATH')) { |
|
7 | 7 | exit; |
8 | 8 | } ?> |
9 | 9 | |
@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | * |
19 | 19 | * @since 1.0 |
20 | 20 | */ |
21 | - do_action( 'give_tools_tab_export_content_top' ); |
|
21 | + do_action('give_tools_tab_export_content_top'); |
|
22 | 22 | ?> |
23 | 23 | |
24 | 24 | <table class="widefat export-options-table give-table striped"> |
25 | 25 | <thead> |
26 | 26 | <tr> |
27 | - <th scope="col"><?php esc_html_e( 'Export Type', 'give' ); ?></th> |
|
28 | - <th scope="col"><?php esc_html_e( 'Export Options', 'give' ); ?></th> |
|
27 | + <th scope="col"><?php esc_html_e('Export Type', 'give'); ?></th> |
|
28 | + <th scope="col"><?php esc_html_e('Export Options', 'give'); ?></th> |
|
29 | 29 | </tr> |
30 | 30 | </thead> |
31 | 31 | <tbody> |
@@ -38,42 +38,42 @@ discard block |
||
38 | 38 | * |
39 | 39 | * @since 1.0 |
40 | 40 | */ |
41 | - do_action( 'give_tools_tab_export_table_top' ); |
|
41 | + do_action('give_tools_tab_export_table_top'); |
|
42 | 42 | ?> |
43 | 43 | <tr class="give-export-pdf-sales-earnings"> |
44 | 44 | <td scope="row" class="row-title"> |
45 | 45 | <h3> |
46 | - <span><?php esc_html_e( 'Export PDF of Donations and Income', 'give' ); ?></span> |
|
46 | + <span><?php esc_html_e('Export PDF of Donations and Income', 'give'); ?></span> |
|
47 | 47 | </h3> |
48 | - <p><?php esc_html_e( 'Download a PDF of Donations and Income reports for all forms for the current year.', 'give' ); ?></p> |
|
48 | + <p><?php esc_html_e('Download a PDF of Donations and Income reports for all forms for the current year.', 'give'); ?></p> |
|
49 | 49 | </td> |
50 | 50 | <td> |
51 | - <a class="button" href="<?php echo wp_nonce_url( add_query_arg( array( 'give-action' => 'generate_pdf' ) ), 'give_generate_pdf' ); ?>"> |
|
52 | - <?php esc_html_e( 'Generate PDF', 'give' ); ?> |
|
51 | + <a class="button" href="<?php echo wp_nonce_url(add_query_arg(array('give-action' => 'generate_pdf')), 'give_generate_pdf'); ?>"> |
|
52 | + <?php esc_html_e('Generate PDF', 'give'); ?> |
|
53 | 53 | </a> |
54 | 54 | </td> |
55 | 55 | </tr> |
56 | 56 | <tr class="give-export-sales-earnings"> |
57 | 57 | <td scope="row" class="row-title"> |
58 | 58 | <h3> |
59 | - <span><?php esc_html_e( 'Export Income and Donation Stats', 'give' ); ?></span> |
|
59 | + <span><?php esc_html_e('Export Income and Donation Stats', 'give'); ?></span> |
|
60 | 60 | </h3> |
61 | - <p><?php esc_html_e( 'Download a CSV of income and donations over time.', 'give' ); ?></p> |
|
61 | + <p><?php esc_html_e('Download a CSV of income and donations over time.', 'give'); ?></p> |
|
62 | 62 | </td> |
63 | 63 | <td> |
64 | 64 | <form method="post"> |
65 | 65 | <?php |
66 | 66 | printf( |
67 | 67 | /* translators: 1: start date dropdown 2: end date dropdown */ |
68 | - esc_html__( '%1$s to %2$s', 'give' ), |
|
69 | - Give()->html->year_dropdown( 'start_year' ) . ' ' . Give()->html->month_dropdown( 'start_month' ), |
|
70 | - Give()->html->year_dropdown( 'end_year' ) . ' ' . Give()->html->month_dropdown( 'end_month' ) |
|
68 | + esc_html__('%1$s to %2$s', 'give'), |
|
69 | + Give()->html->year_dropdown('start_year').' '.Give()->html->month_dropdown('start_month'), |
|
70 | + Give()->html->year_dropdown('end_year').' '.Give()->html->month_dropdown('end_month') |
|
71 | 71 | ); |
72 | 72 | ?> |
73 | 73 | <input type="hidden" name="give-action" |
74 | 74 | value="earnings_export"/> |
75 | 75 | <input type="submit" |
76 | - value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" |
|
76 | + value="<?php esc_attr_e('Generate CSV', 'give'); ?>" |
|
77 | 77 | class="button-secondary"/> |
78 | 78 | </form> |
79 | 79 | </td> |
@@ -81,37 +81,37 @@ discard block |
||
81 | 81 | <tr class="give-export-payment-history"> |
82 | 82 | <td scope="row" class="row-title"> |
83 | 83 | <h3> |
84 | - <span><?php esc_html_e( 'Export Donation History', 'give' ); ?></span> |
|
84 | + <span><?php esc_html_e('Export Donation History', 'give'); ?></span> |
|
85 | 85 | </h3> |
86 | - <p><?php esc_html_e( 'Download a CSV of all donations recorded.', 'give' ); ?></p> |
|
86 | + <p><?php esc_html_e('Download a CSV of all donations recorded.', 'give'); ?></p> |
|
87 | 87 | </td> |
88 | 88 | <td> |
89 | 89 | <form id="give-export-payments" |
90 | 90 | class="give-export-form" method="post"> |
91 | 91 | <?php |
92 | - echo Give()->html->date_field( array( |
|
92 | + echo Give()->html->date_field(array( |
|
93 | 93 | 'id' => 'give-payment-export-start', |
94 | 94 | 'name' => 'start', |
95 | - 'placeholder' => esc_attr__( 'Start date', 'give' ), |
|
96 | - ) ); |
|
95 | + 'placeholder' => esc_attr__('Start date', 'give'), |
|
96 | + )); |
|
97 | 97 | |
98 | - echo Give()->html->date_field( array( |
|
98 | + echo Give()->html->date_field(array( |
|
99 | 99 | 'id' => 'give-payment-export-end', |
100 | 100 | 'name' => 'end', |
101 | - 'placeholder' => esc_attr__( 'End date', 'give' ), |
|
102 | - ) ); |
|
101 | + 'placeholder' => esc_attr__('End date', 'give'), |
|
102 | + )); |
|
103 | 103 | ?> |
104 | 104 | <select name="status"> |
105 | - <option value="any"><?php esc_html_e( 'All Statuses', 'give' ); ?></option> |
|
105 | + <option value="any"><?php esc_html_e('All Statuses', 'give'); ?></option> |
|
106 | 106 | <?php |
107 | 107 | $statuses = give_get_payment_statuses(); |
108 | - foreach ( $statuses as $status => $label ) { |
|
109 | - echo '<option value="' . $status . '">' . $label . '</option>'; |
|
108 | + foreach ($statuses as $status => $label) { |
|
109 | + echo '<option value="'.$status.'">'.$label.'</option>'; |
|
110 | 110 | } |
111 | 111 | ?> |
112 | 112 | </select> |
113 | 113 | <?php |
114 | - if ( give_is_setting_enabled( give_get_option( 'categories' ) ) ) { |
|
114 | + if (give_is_setting_enabled(give_get_option('categories'))) { |
|
115 | 115 | echo Give()->html->category_dropdown( |
116 | 116 | 'give_forms_categories[]', |
117 | 117 | 0, |
@@ -121,12 +121,12 @@ discard block |
||
121 | 121 | 'multiple' => true, |
122 | 122 | 'selected' => array(), |
123 | 123 | 'show_option_all' => false, |
124 | - 'placeholder' => __( 'Choose one or more from categories', 'give' ), |
|
124 | + 'placeholder' => __('Choose one or more from categories', 'give'), |
|
125 | 125 | ) |
126 | 126 | ); |
127 | 127 | } |
128 | 128 | |
129 | - if ( give_is_setting_enabled( give_get_option( 'tags' ) ) ) { |
|
129 | + if (give_is_setting_enabled(give_get_option('tags'))) { |
|
130 | 130 | echo Give()->html->tags_dropdown( |
131 | 131 | 'give_forms_tags[]', |
132 | 132 | 0, |
@@ -136,18 +136,18 @@ discard block |
||
136 | 136 | 'multiple' => true, |
137 | 137 | 'selected' => array(), |
138 | 138 | 'show_option_all' => false, |
139 | - 'placeholder' => __( 'Choose one or more from tags', 'give' ), |
|
139 | + 'placeholder' => __('Choose one or more from tags', 'give'), |
|
140 | 140 | ) |
141 | 141 | ); |
142 | 142 | } |
143 | 143 | |
144 | - wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); |
|
144 | + wp_nonce_field('give_ajax_export', 'give_ajax_export'); |
|
145 | 145 | ?> |
146 | 146 | <input type="hidden" name="give-export-class" |
147 | 147 | value="Give_Batch_Payments_Export"/> |
148 | 148 | <span> |
149 | 149 | <input type="submit" |
150 | - value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" |
|
150 | + value="<?php esc_attr_e('Generate CSV', 'give'); ?>" |
|
151 | 151 | class="button-secondary"/> |
152 | 152 | <span class="spinner"></span> |
153 | 153 | </span> |
@@ -157,9 +157,9 @@ discard block |
||
157 | 157 | <tr class="give-export-donors"> |
158 | 158 | <td scope="row" class="row-title"> |
159 | 159 | <h3> |
160 | - <span><?php esc_html_e( 'Export Donors in CSV', 'give' ); ?></span> |
|
160 | + <span><?php esc_html_e('Export Donors in CSV', 'give'); ?></span> |
|
161 | 161 | </h3> |
162 | - <p><?php esc_html_e( 'Download an export of donors for all donation forms or only those who have given to a particular form.', 'give' ); ?></p> |
|
162 | + <p><?php esc_html_e('Download an export of donors for all donation forms or only those who have given to a particular form.', 'give'); ?></p> |
|
163 | 163 | </td> |
164 | 164 | <td> |
165 | 165 | <form method="post" id="give_donor_export" |
@@ -167,93 +167,93 @@ discard block |
||
167 | 167 | |
168 | 168 | <?php |
169 | 169 | // Start Date form field for donors |
170 | - echo Give()->html->date_field( array( |
|
170 | + echo Give()->html->date_field(array( |
|
171 | 171 | 'id' => 'give_donor_export_start_date', |
172 | 172 | 'name' => 'donor_export_start_date', |
173 | - 'placeholder' => esc_attr__( 'Start date', 'give' ), |
|
174 | - ) ); |
|
173 | + 'placeholder' => esc_attr__('Start date', 'give'), |
|
174 | + )); |
|
175 | 175 | |
176 | 176 | // End Date form field for donors |
177 | - echo Give()->html->date_field( array( |
|
177 | + echo Give()->html->date_field(array( |
|
178 | 178 | 'id' => 'give_donor_export_end_date', |
179 | 179 | 'name' => 'donor_export_end_date', |
180 | - 'placeholder' => esc_attr__( 'End date', 'give' ), |
|
181 | - ) ); |
|
180 | + 'placeholder' => esc_attr__('End date', 'give'), |
|
181 | + )); |
|
182 | 182 | |
183 | 183 | // Donation forms dropdown for donors export |
184 | - echo Give()->html->forms_dropdown( array( |
|
184 | + echo Give()->html->forms_dropdown(array( |
|
185 | 185 | 'name' => 'forms', |
186 | 186 | 'id' => 'give_donor_export_form', |
187 | 187 | 'chosen' => true, |
188 | - ) ); |
|
188 | + )); |
|
189 | 189 | ?> |
190 | - <input type="submit" value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" class="button-secondary"/> |
|
190 | + <input type="submit" value="<?php esc_attr_e('Generate CSV', 'give'); ?>" class="button-secondary"/> |
|
191 | 191 | |
192 | 192 | <div id="export-donor-options-wrap" |
193 | 193 | class="give-clearfix"> |
194 | - <p><?php esc_html_e( 'Export Columns:', 'give' ); ?></p> |
|
194 | + <p><?php esc_html_e('Export Columns:', 'give'); ?></p> |
|
195 | 195 | <ul id="give-export-option-ul"> |
196 | 196 | <li> |
197 | 197 | <label for="give-export-fullname"> |
198 | 198 | <input type="checkbox" checked |
199 | 199 | name="give_export_option[full_name]" |
200 | - id="give-export-fullname"><?php esc_html_e( 'Name', 'give' ); ?> |
|
200 | + id="give-export-fullname"><?php esc_html_e('Name', 'give'); ?> |
|
201 | 201 | </label> |
202 | 202 | </li> |
203 | 203 | <li> |
204 | 204 | <label for="give-export-email"> |
205 | 205 | <input type="checkbox" checked |
206 | 206 | name="give_export_option[email]" |
207 | - id="give-export-email"><?php esc_html_e( 'Email', 'give' ); ?> |
|
207 | + id="give-export-email"><?php esc_html_e('Email', 'give'); ?> |
|
208 | 208 | </label> |
209 | 209 | </li> |
210 | 210 | <li> |
211 | 211 | <label for="give-export-address"> |
212 | 212 | <input type="checkbox" checked |
213 | 213 | name="give_export_option[address]" |
214 | - id="give-export-address"><?php esc_html_e( 'Address', 'give' ); ?> |
|
214 | + id="give-export-address"><?php esc_html_e('Address', 'give'); ?> |
|
215 | 215 | </label> |
216 | 216 | </li> |
217 | 217 | <li> |
218 | 218 | <label for="give-export-userid"> |
219 | 219 | <input type="checkbox" checked |
220 | 220 | name="give_export_option[userid]" |
221 | - id="give-export-userid"><?php esc_html_e( 'User ID', 'give' ); ?> |
|
221 | + id="give-export-userid"><?php esc_html_e('User ID', 'give'); ?> |
|
222 | 222 | </label> |
223 | 223 | </li> |
224 | 224 | <li> |
225 | 225 | <label for="give-export-donation-form"> |
226 | 226 | <input type="checkbox" checked |
227 | 227 | name="give_export_option[donation_form]" |
228 | - id="give-export-donation-form"><?php esc_html_e( 'Donation Form', 'give' ); ?> |
|
228 | + id="give-export-donation-form"><?php esc_html_e('Donation Form', 'give'); ?> |
|
229 | 229 | </label> |
230 | 230 | </li> |
231 | 231 | <li> |
232 | 232 | <label for="give-export-first-donation-date"> |
233 | 233 | <input type="checkbox" checked |
234 | 234 | name="give_export_option[date_first_donated]" |
235 | - id="give-export-first-donation-date"><?php esc_html_e( 'First Donation Date', 'give' ); ?> |
|
235 | + id="give-export-first-donation-date"><?php esc_html_e('First Donation Date', 'give'); ?> |
|
236 | 236 | </label> |
237 | 237 | </li> |
238 | 238 | <li> |
239 | 239 | <label for="give-export-donation-number"> |
240 | 240 | <input type="checkbox" checked |
241 | 241 | name="give_export_option[donations]" |
242 | - id="give-export-donation-number"><?php esc_html_e( 'Number of Donations', 'give' ); ?> |
|
242 | + id="give-export-donation-number"><?php esc_html_e('Number of Donations', 'give'); ?> |
|
243 | 243 | </label> |
244 | 244 | </li> |
245 | 245 | <li> |
246 | 246 | <label for="give-export-donation-sum"> |
247 | 247 | <input type="checkbox" checked |
248 | 248 | name="give_export_option[donation_sum]" |
249 | - id="give-export-donation-sum"><?php esc_html_e( 'Total Donated', 'give' ); ?> |
|
249 | + id="give-export-donation-sum"><?php esc_html_e('Total Donated', 'give'); ?> |
|
250 | 250 | </label> |
251 | 251 | </li> |
252 | 252 | </ul> |
253 | 253 | </div> |
254 | - <?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?> |
|
254 | + <?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?> |
|
255 | 255 | <input type="hidden" name="give-export-class" value="Give_Batch_Donors_Export"/> |
256 | - <input type="hidden" name="give_export_option[query_id]" value="<?php echo uniqid( 'give_' ); ?>"/> |
|
256 | + <input type="hidden" name="give_export_option[query_id]" value="<?php echo uniqid('give_'); ?>"/> |
|
257 | 257 | </form> |
258 | 258 | </td> |
259 | 259 | </tr> |
@@ -261,14 +261,14 @@ discard block |
||
261 | 261 | <tr class="give-export-core-settings"> |
262 | 262 | <td scope="row" class="row-title"> |
263 | 263 | <h3> |
264 | - <span><?php esc_html_e( 'Export Give Settings', 'give' ); ?></span> |
|
264 | + <span><?php esc_html_e('Export Give Settings', 'give'); ?></span> |
|
265 | 265 | </h3> |
266 | - <p><?php esc_html_e( 'Download an export of Give\'s settings and import it in a new WordPress installation.', 'give' ); ?></p> |
|
266 | + <p><?php esc_html_e('Download an export of Give\'s settings and import it in a new WordPress installation.', 'give'); ?></p> |
|
267 | 267 | </td> |
268 | 268 | <td> |
269 | 269 | <form method="post"> |
270 | 270 | <input type="hidden" name="give-action" value="core_settings_export"/> |
271 | - <input type="submit" value="<?php esc_attr_e( 'Export JSON', 'give' ); ?>" class="button-secondary"/> |
|
271 | + <input type="submit" value="<?php esc_attr_e('Export JSON', 'give'); ?>" class="button-secondary"/> |
|
272 | 272 | </form> |
273 | 273 | </td> |
274 | 274 | </tr> |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | * |
282 | 282 | * @since 1.0 |
283 | 283 | */ |
284 | - do_action( 'give_tools_tab_export_table_bottom' ); |
|
284 | + do_action('give_tools_tab_export_table_bottom'); |
|
285 | 285 | ?> |
286 | 286 | </tbody> |
287 | 287 | </table> |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | * |
293 | 293 | * @since 1.0 |
294 | 294 | */ |
295 | - do_action( 'give_tools_tab_export_content_bottom' ); |
|
295 | + do_action('give_tools_tab_export_content_bottom'); |
|
296 | 296 | ?> |
297 | 297 | |
298 | 298 | </div> |
@@ -3,11 +3,11 @@ discard block |
||
3 | 3 | * Admin View: Exports |
4 | 4 | */ |
5 | 5 | |
6 | -if ( ! defined( 'ABSPATH' ) ) { |
|
6 | +if ( ! defined('ABSPATH')) { |
|
7 | 7 | exit; |
8 | 8 | } |
9 | 9 | |
10 | -if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
10 | +if ( ! current_user_can('manage_give_settings')) { |
|
11 | 11 | return; |
12 | 12 | } |
13 | 13 | |
@@ -16,29 +16,29 @@ discard block |
||
16 | 16 | * |
17 | 17 | * @since 1.5 |
18 | 18 | */ |
19 | -do_action( 'give_tools_recount_stats_before' ); |
|
19 | +do_action('give_tools_recount_stats_before'); |
|
20 | 20 | ?> |
21 | 21 | <div id="poststuff"> |
22 | 22 | <div class="postbox"> |
23 | 23 | |
24 | - <h2 class="hndle ui-sortable-handle"><span><?php esc_html_e( 'Recount Stats', 'give' ); ?></span></h2> |
|
24 | + <h2 class="hndle ui-sortable-handle"><span><?php esc_html_e('Recount Stats', 'give'); ?></span></h2> |
|
25 | 25 | |
26 | 26 | <div class="inside recount-stats-controls"> |
27 | - <p><?php esc_html_e( 'Use these tools to recount stats, delete test transactions, or reset stats.', 'give' ); ?></p> |
|
27 | + <p><?php esc_html_e('Use these tools to recount stats, delete test transactions, or reset stats.', 'give'); ?></p> |
|
28 | 28 | <form method="post" id="give-tools-recount-form" class="give-export-form"> |
29 | 29 | |
30 | - <?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?> |
|
30 | + <?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?> |
|
31 | 31 | |
32 | 32 | <select name="give-export-class" id="recount-stats-type"> |
33 | - <option value="0" selected="selected" disabled="disabled"><?php esc_html_e( 'Please select an option', 'give' ); ?></option> |
|
34 | - <option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e( 'Recalculate Total Donation Income Amount', 'give' ); ?></option> |
|
35 | - <option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php esc_html_e( 'Recalculate Income Amount and Donation Counts for a Form', 'give' ); ?></option> |
|
36 | - <option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php esc_html_e( 'Recalculate Income Amount and Donation Counts for All Forms', 'give' ); ?></option> |
|
37 | - <option data-type="recount-donor-stats" value="Give_Tools_Recount_Donor_Stats"><?php esc_html_e( 'Recalculate Donor Statistics', 'give' ); ?></option> |
|
38 | - <option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e( 'Delete Test Payments', 'give' ); ?></option> |
|
39 | - <option data-type="delete-test-donors" value="Give_Tools_Delete_Donors"><?php esc_html_e( 'Delete Test Donors and Payments', 'give' ); ?></option> |
|
40 | - <option data-type="delete-import-donors" value="Give_Tools_Import_Donors"><?php esc_html_e( 'Delete Imported Donors and Payments', 'give' ); ?></option> |
|
41 | - <option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e( 'Delete All Data', 'give' ); ?></option> |
|
33 | + <option value="0" selected="selected" disabled="disabled"><?php esc_html_e('Please select an option', 'give'); ?></option> |
|
34 | + <option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e('Recalculate Total Donation Income Amount', 'give'); ?></option> |
|
35 | + <option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php esc_html_e('Recalculate Income Amount and Donation Counts for a Form', 'give'); ?></option> |
|
36 | + <option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php esc_html_e('Recalculate Income Amount and Donation Counts for All Forms', 'give'); ?></option> |
|
37 | + <option data-type="recount-donor-stats" value="Give_Tools_Recount_Donor_Stats"><?php esc_html_e('Recalculate Donor Statistics', 'give'); ?></option> |
|
38 | + <option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e('Delete Test Payments', 'give'); ?></option> |
|
39 | + <option data-type="delete-test-donors" value="Give_Tools_Delete_Donors"><?php esc_html_e('Delete Test Donors and Payments', 'give'); ?></option> |
|
40 | + <option data-type="delete-import-donors" value="Give_Tools_Import_Donors"><?php esc_html_e('Delete Imported Donors and Payments', 'give'); ?></option> |
|
41 | + <option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e('Delete All Data', 'give'); ?></option> |
|
42 | 42 | <?php |
43 | 43 | /** |
44 | 44 | * Fires in the recount stats selectbox. |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * |
48 | 48 | * @since 1.5 |
49 | 49 | */ |
50 | - do_action( 'give_recount_tool_options' ); |
|
50 | + do_action('give_recount_tool_options'); |
|
51 | 51 | ?> |
52 | 52 | </select> |
53 | 53 | |
@@ -56,34 +56,34 @@ discard block |
||
56 | 56 | $args = array( |
57 | 57 | 'class' => 'tools-form-dropdown-recount-form-select', |
58 | 58 | 'name' => 'form_id', |
59 | - 'number' => - 1, |
|
59 | + 'number' => -1, |
|
60 | 60 | 'chosen' => true, |
61 | - 'placeholder' => __( 'Select Form', 'give' ), |
|
61 | + 'placeholder' => __('Select Form', 'give'), |
|
62 | 62 | ); |
63 | - echo Give()->html->forms_dropdown( $args ); |
|
63 | + echo Give()->html->forms_dropdown($args); |
|
64 | 64 | ?> |
65 | 65 | </span> |
66 | 66 | |
67 | 67 | <span class="tools-form-dropdown tools-form-dropdown-delete-import-donors" style="display: none"> |
68 | 68 | <label for="delete-import-donors"> |
69 | 69 | <?php |
70 | - echo Give()->html->checkbox( array( |
|
70 | + echo Give()->html->checkbox(array( |
|
71 | 71 | 'name' => 'delete-import-donors' |
72 | - ) ); |
|
73 | - _e( 'Delete imported WordPress users', 'give' ); |
|
72 | + )); |
|
73 | + _e('Delete imported WordPress users', 'give'); |
|
74 | 74 | ?> |
75 | 75 | </label> |
76 | 76 | </span> |
77 | 77 | |
78 | - <input type="submit" id="recount-stats-submit" value="<?php esc_attr_e( 'Submit', 'give' ); ?>" class="button-secondary"/> |
|
78 | + <input type="submit" id="recount-stats-submit" value="<?php esc_attr_e('Submit', 'give'); ?>" class="button-secondary"/> |
|
79 | 79 | |
80 | 80 | <br/> |
81 | 81 | |
82 | 82 | <span class="give-recount-stats-descriptions"> |
83 | - <span id="recount-stats"><?php esc_html_e( 'Recalculates the overall donation income amount.', 'give' ); ?></span> |
|
84 | - <span id="recount-form"><?php esc_html_e( 'Recalculates the donation and income stats for a specific form.', 'give' ); ?></span> |
|
85 | - <span id="recount-all"><?php esc_html_e( 'Recalculates the earnings and sales stats for all forms.', 'give' ); ?></span> |
|
86 | - <span id="recount-customer-stats"><?php esc_html_e( 'Recalculates the lifetime value and donation counts for all donors.', 'give' ); ?></span> |
|
83 | + <span id="recount-stats"><?php esc_html_e('Recalculates the overall donation income amount.', 'give'); ?></span> |
|
84 | + <span id="recount-form"><?php esc_html_e('Recalculates the donation and income stats for a specific form.', 'give'); ?></span> |
|
85 | + <span id="recount-all"><?php esc_html_e('Recalculates the earnings and sales stats for all forms.', 'give'); ?></span> |
|
86 | + <span id="recount-customer-stats"><?php esc_html_e('Recalculates the lifetime value and donation counts for all donors.', 'give'); ?></span> |
|
87 | 87 | <?php |
88 | 88 | /** |
89 | 89 | * Fires in the recount stats description area. |
@@ -92,10 +92,10 @@ discard block |
||
92 | 92 | * |
93 | 93 | * @since 1.5 |
94 | 94 | */ |
95 | - do_action( 'give_recount_tool_descriptions' ); |
|
95 | + do_action('give_recount_tool_descriptions'); |
|
96 | 96 | ?> |
97 | - <span id="delete-test-transactions"><?php _e( '<strong>Deletes</strong> all TEST donations, donors, and related log entries.', 'give' ); ?></span> |
|
98 | - <span id="reset-stats"><?php _e( '<strong>Deletes</strong> ALL donations, donors, and related log entries regardless of test or live mode.', 'give' ); ?></span> |
|
97 | + <span id="delete-test-transactions"><?php _e('<strong>Deletes</strong> all TEST donations, donors, and related log entries.', 'give'); ?></span> |
|
98 | + <span id="reset-stats"><?php _e('<strong>Deletes</strong> ALL donations, donors, and related log entries regardless of test or live mode.', 'give'); ?></span> |
|
99 | 99 | </span> |
100 | 100 | |
101 | 101 | <span class="spinner"></span> |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * |
110 | 110 | * @since 1.5 |
111 | 111 | */ |
112 | - do_action( 'give_tools_recount_forms' ); |
|
112 | + do_action('give_tools_recount_forms'); |
|
113 | 113 | ?> |
114 | 114 | </div><!-- .inside --> |
115 | 115 | </div><!-- .postbox --> |
@@ -120,4 +120,4 @@ discard block |
||
120 | 120 | * |
121 | 121 | * @since 1.5 |
122 | 122 | */ |
123 | -do_action( 'give_tools_recount_stats_after' ); |
|
123 | +do_action('give_tools_recount_stats_after'); |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | * Admin View: Imports |
4 | 4 | */ |
5 | 5 | |
6 | -if ( ! defined( 'ABSPATH' ) ) { |
|
6 | +if ( ! defined('ABSPATH')) { |
|
7 | 7 | exit; |
8 | 8 | } ?> |
9 | 9 | |
@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | * |
19 | 19 | * @since 1.8.14 |
20 | 20 | */ |
21 | - do_action( 'give_tools_tab_import_content_top' ); |
|
21 | + do_action('give_tools_tab_import_content_top'); |
|
22 | 22 | ?> |
23 | 23 | |
24 | 24 | <table class="widefat Import-options-table give-table"> |
25 | 25 | <thead> |
26 | 26 | <tr> |
27 | - <th scope="col"><?php esc_html_e( 'Import Type', 'give' ); ?></th> |
|
28 | - <th scope="col"><?php esc_html_e( 'Import Options', 'give' ); ?></th> |
|
27 | + <th scope="col"><?php esc_html_e('Import Type', 'give'); ?></th> |
|
28 | + <th scope="col"><?php esc_html_e('Import Options', 'give'); ?></th> |
|
29 | 29 | </tr> |
30 | 30 | </thead> |
31 | 31 | <tbody> |
@@ -38,19 +38,19 @@ discard block |
||
38 | 38 | * |
39 | 39 | * @since 1.8.14 |
40 | 40 | */ |
41 | - do_action( 'give_tools_tab_import_table_top' ); |
|
41 | + do_action('give_tools_tab_import_table_top'); |
|
42 | 42 | ?> |
43 | 43 | |
44 | 44 | <tr class="give-Import-pdf-sales-earnings"> |
45 | 45 | <td scope="row" class="row-title"> |
46 | 46 | <h3> |
47 | - <span><?php esc_html_e( 'Import Donations', 'give' ); ?></span> |
|
47 | + <span><?php esc_html_e('Import Donations', 'give'); ?></span> |
|
48 | 48 | </h3> |
49 | - <p><?php esc_html_e( 'Import a CSV of Donations.', 'give' ); ?></p> |
|
49 | + <p><?php esc_html_e('Import a CSV of Donations.', 'give'); ?></p> |
|
50 | 50 | </td> |
51 | 51 | <td> |
52 | - <a class="button" href="<?php echo add_query_arg( array( 'importer-type' => 'import_donations' ) ); ?>"> |
|
53 | - <?php esc_html_e( 'Import CSV', 'give' ); ?> |
|
52 | + <a class="button" href="<?php echo add_query_arg(array('importer-type' => 'import_donations')); ?>"> |
|
53 | + <?php esc_html_e('Import CSV', 'give'); ?> |
|
54 | 54 | </a> |
55 | 55 | </td> |
56 | 56 | </tr> |
@@ -58,13 +58,13 @@ discard block |
||
58 | 58 | <tr class="give-import-core-settings"> |
59 | 59 | <td scope="row" class="row-title"> |
60 | 60 | <h3> |
61 | - <span><?php esc_html_e( 'Import Give Settings', 'give' ); ?></span> |
|
61 | + <span><?php esc_html_e('Import Give Settings', 'give'); ?></span> |
|
62 | 62 | </h3> |
63 | - <p><?php esc_html_e( 'Import Give\'s settings in JSON format.', 'give' ); ?></p> |
|
63 | + <p><?php esc_html_e('Import Give\'s settings in JSON format.', 'give'); ?></p> |
|
64 | 64 | </td> |
65 | 65 | <td> |
66 | - <a class="button" href="<?php echo add_query_arg( array( 'importer-type' => 'import_core_setting' ) ); ?>"> |
|
67 | - <?php esc_html_e( 'Import JSON', 'give' ); ?> |
|
66 | + <a class="button" href="<?php echo add_query_arg(array('importer-type' => 'import_core_setting')); ?>"> |
|
67 | + <?php esc_html_e('Import JSON', 'give'); ?> |
|
68 | 68 | </a> |
69 | 69 | </td> |
70 | 70 | </tr> |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * |
79 | 79 | * @since 1.8.14 |
80 | 80 | */ |
81 | - do_action( 'give_tools_tab_import_table_bottom' ); |
|
81 | + do_action('give_tools_tab_import_table_bottom'); |
|
82 | 82 | ?> |
83 | 83 | </tbody> |
84 | 84 | </table> |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * |
90 | 90 | * @since 1.8.14 |
91 | 91 | */ |
92 | - do_action( 'give_tools_tab_import_content_bottom' ); |
|
92 | + do_action('give_tools_tab_import_content_bottom'); |
|
93 | 93 | ?> |
94 | 94 | |
95 | 95 | </div> |
@@ -3,11 +3,11 @@ discard block |
||
3 | 3 | * Admin View: Import Core Settings |
4 | 4 | */ |
5 | 5 | |
6 | -if ( ! defined( 'ABSPATH' ) ) { |
|
6 | +if ( ! defined('ABSPATH')) { |
|
7 | 7 | exit; |
8 | 8 | } |
9 | 9 | |
10 | -if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
10 | +if ( ! current_user_can('manage_give_settings')) { |
|
11 | 11 | return; |
12 | 12 | } |
13 | 13 | |
@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | * |
17 | 17 | * @since 1.8.17 |
18 | 18 | */ |
19 | -do_action( 'give_tools_import_core_settings_main_before' ); |
|
19 | +do_action('give_tools_import_core_settings_main_before'); |
|
20 | 20 | ?> |
21 | 21 | <div id="poststuff"> |
22 | 22 | <div class="postbox"> |
23 | - <h1 class="give-importer-h1" align="center"><?php esc_html_e( 'Import Settings', 'give' ); ?></h1> |
|
23 | + <h1 class="give-importer-h1" align="center"><?php esc_html_e('Import Settings', 'give'); ?></h1> |
|
24 | 24 | <div class="inside give-tools-setting-page-import give-import-core-settings"> |
25 | 25 | <?php |
26 | 26 | /** |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @since 1.8.17 |
30 | 30 | */ |
31 | - do_action( 'give_tools_import_core_settings_form_before_start' ); |
|
31 | + do_action('give_tools_import_core_settings_form_before_start'); |
|
32 | 32 | ?> |
33 | 33 | <form method="post" id="give-import-core-settings-form" |
34 | 34 | class="give-import-form tools-setting-page-import tools-setting-page-import" |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @since 1.8.17 |
42 | 42 | */ |
43 | - do_action( 'give_tools_import_core_settings_form_start' ); |
|
43 | + do_action('give_tools_import_core_settings_form_start'); |
|
44 | 44 | ?> |
45 | 45 | |
46 | 46 | <?php |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * |
50 | 50 | * @since 1.8.17 |
51 | 51 | */ |
52 | - do_action( 'give_tools_import_core_settings_form_end' ); |
|
52 | + do_action('give_tools_import_core_settings_form_end'); |
|
53 | 53 | ?> |
54 | 54 | </form> |
55 | 55 | <?php |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * |
59 | 59 | * @since 1.8.17 |
60 | 60 | */ |
61 | - do_action( 'give_tools_import_core_settings_form_after_end' ); |
|
61 | + do_action('give_tools_import_core_settings_form_after_end'); |
|
62 | 62 | ?> |
63 | 63 | </div><!-- .inside --> |
64 | 64 | </div><!-- .postbox --> |
@@ -69,4 +69,4 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @since 1.8.17 |
71 | 71 | */ |
72 | -do_action( 'give_tools_import_core_settings_main_after' ); |
|
72 | +do_action('give_tools_import_core_settings_main_after'); |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | * @since 1.8 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly |
14 | 14 | } |
15 | 15 | |
16 | -if ( ! class_exists( 'Give_Settings_System_Info' ) ) : |
|
16 | +if ( ! class_exists('Give_Settings_System_Info')) : |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Give_Settings_System_Info. |
@@ -34,14 +34,14 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function __construct() { |
36 | 36 | $this->id = 'system-info'; |
37 | - $this->label = esc_html__( 'System Info', 'give' ); |
|
37 | + $this->label = esc_html__('System Info', 'give'); |
|
38 | 38 | |
39 | 39 | parent::__construct(); |
40 | 40 | |
41 | 41 | // Do not use main form for this tab. |
42 | - if ( give_get_current_setting_tab() === $this->id ) { |
|
43 | - add_action( "give-tools_open_form", '__return_empty_string' ); |
|
44 | - add_action( "give-tools_close_form", '__return_empty_string' ); |
|
42 | + if (give_get_current_setting_tab() === $this->id) { |
|
43 | + add_action("give-tools_open_form", '__return_empty_string'); |
|
44 | + add_action("give-tools_close_form", '__return_empty_string'); |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function output() { |
55 | 55 | $GLOBALS['give_hide_save_button'] = true; |
56 | - include_once( 'views/html-admin-page-system-info.php' ); |
|
56 | + include_once('views/html-admin-page-system-info.php'); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 |