Completed
Pull Request — master (#893)
by Rami
20:06
created
includes/admin/shortcodes/shortcode-give-profile-editor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 class Give_Shortcode_Profile_Editor extends Give_Shortcode_Generator {
15 15
 
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		$this->shortcode['label'] = esc_html__( 'Profile Editor', 'give' );
21
+		$this->shortcode['label'] = esc_html__('Profile Editor', 'give');
22 22
 
23
-		parent::__construct( 'give_profile_editor' );
23
+		parent::__construct('give_profile_editor');
24 24
 	}
25 25
 }
26 26
 
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-receipt.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 class Give_Shortcode_Donation_Receipt extends Give_Shortcode_Generator {
15 15
 
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		$this->shortcode['title'] = esc_html__( 'Donation Receipt', 'give' );
22
-		$this->shortcode['label'] = esc_html__( 'Donation Receipt', 'give' );
21
+		$this->shortcode['title'] = esc_html__('Donation Receipt', 'give');
22
+		$this->shortcode['label'] = esc_html__('Donation Receipt', 'give');
23 23
 
24
-		parent::__construct( 'give_receipt' );
24
+		parent::__construct('give_receipt');
25 25
 	}
26 26
 
27 27
 	/**
@@ -34,60 +34,60 @@  discard block
 block discarded – undo
34 34
 		return array(
35 35
 			array(
36 36
 				'type' => 'container',
37
-				'html' => sprintf( '<p class="strong">%s</p>', esc_html__( 'Optional settings', 'give' ) ),
37
+				'html' => sprintf('<p class="strong">%s</p>', esc_html__('Optional settings', 'give')),
38 38
 			),
39 39
 			array(
40 40
 				'type'    => 'listbox',
41 41
 				'name'    => 'price',
42
-				'label'   => esc_html__( 'Show Donation Amount:', 'give' ),
42
+				'label'   => esc_html__('Show Donation Amount:', 'give'),
43 43
 				'options' => array(
44
-					'true'  => esc_html__( 'Show', 'give' ),
45
-					'false' => esc_html__( 'Hide', 'give' ),
44
+					'true'  => esc_html__('Show', 'give'),
45
+					'false' => esc_html__('Hide', 'give'),
46 46
 				),
47 47
 			),
48 48
 			array(
49 49
 				'type'    => 'listbox',
50 50
 				'name'    => 'donor',
51
-				'label'   => esc_html__( 'Show Donor Name:', 'give' ),
51
+				'label'   => esc_html__('Show Donor Name:', 'give'),
52 52
 				'options' => array(
53
-					'true'  => esc_html__( 'Show', 'give' ),
54
-					'false' => esc_html__( 'Hide', 'give' ),
53
+					'true'  => esc_html__('Show', 'give'),
54
+					'false' => esc_html__('Hide', 'give'),
55 55
 				),
56 56
 			),
57 57
 			array(
58 58
 				'type'    => 'listbox',
59 59
 				'name'    => 'date',
60
-				'label'   => esc_html__( 'Show Date:', 'give' ),
60
+				'label'   => esc_html__('Show Date:', 'give'),
61 61
 				'options' => array(
62
-					'true'  => esc_html__( 'Show', 'give' ),
63
-					'false' => esc_html__( 'Hide', 'give' ),
62
+					'true'  => esc_html__('Show', 'give'),
63
+					'false' => esc_html__('Hide', 'give'),
64 64
 				),
65 65
 			),
66 66
 			array(
67 67
 				'type'    => 'listbox',
68 68
 				'name'    => 'payment_key',
69
-				'label'   => esc_html__( 'Show Payment Key:', 'give' ),
69
+				'label'   => esc_html__('Show Payment Key:', 'give'),
70 70
 				'options' => array(
71
-					'true'  => esc_html__( 'Show', 'give' ),
72
-					'false' => esc_html__( 'Hide', 'give' ),
71
+					'true'  => esc_html__('Show', 'give'),
72
+					'false' => esc_html__('Hide', 'give'),
73 73
 				),
74 74
 			),
75 75
 			array(
76 76
 				'type'    => 'listbox',
77 77
 				'name'    => 'payment_method',
78
-				'label'   => esc_html__( 'Show Payment Method:', 'give' ),
78
+				'label'   => esc_html__('Show Payment Method:', 'give'),
79 79
 				'options' => array(
80
-					'true'  => esc_html__( 'Show', 'give' ),
81
-					'false' => esc_html__( 'Hide', 'give' ),
80
+					'true'  => esc_html__('Show', 'give'),
81
+					'false' => esc_html__('Hide', 'give'),
82 82
 				),
83 83
 			),
84 84
 			array(
85 85
 				'type'    => 'listbox',
86 86
 				'name'    => 'payment_id',
87
-				'label'   => esc_html__( 'Show Payment ID:', 'give' ),
87
+				'label'   => esc_html__('Show Payment ID:', 'give'),
88 88
 				'options' => array(
89
-					'true'  => esc_html__( 'Show', 'give' ),
90
-					'false' => esc_html__( 'Hide', 'give' ),
89
+					'true'  => esc_html__('Show', 'give'),
90
+					'false' => esc_html__('Hide', 'give'),
91 91
 				),
92 92
 			),
93 93
 		);
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-donation-history.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 class Give_Shortcode_Donation_History extends Give_Shortcode_Generator {
15 15
 
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		$this->shortcode['label'] = esc_html__( 'Donation History', 'give' );
21
+		$this->shortcode['label'] = esc_html__('Donation History', 'give');
22 22
 
23
-		parent::__construct( 'donation_history' );
23
+		parent::__construct('donation_history');
24 24
 	}
25 25
 }
26 26
 
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-register.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 class Give_Shortcode_Register extends Give_Shortcode_Generator {
15 15
 
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		$this->shortcode['title'] = esc_html__( 'Register', 'give' );
22
-		$this->shortcode['label'] = esc_html__( 'Register', 'give' );
21
+		$this->shortcode['title'] = esc_html__('Register', 'give');
22
+		$this->shortcode['label'] = esc_html__('Register', 'give');
23 23
 
24
-		parent::__construct( 'give_register' );
24
+		parent::__construct('give_register');
25 25
 	}
26 26
 
27 27
 	/**
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
 		return array(
35 35
 			array(
36 36
 				'type' => 'container',
37
-				'html' => sprintf( '<p class="no-margin">%s</p>', esc_html__( 'Redirect URL (optional):', 'give' ) ),
37
+				'html' => sprintf('<p class="no-margin">%s</p>', esc_html__('Redirect URL (optional):', 'give')),
38 38
 			),
39 39
 			array(
40 40
 				'type'     => 'textbox',
41 41
 				'name'     => 'redirect',
42 42
 				'minWidth' => 320,
43
-				'tooltip'  => esc_attr__( 'Enter an URL here to redirect to after registering.', 'give' ),
43
+				'tooltip'  => esc_attr__('Enter an URL here to redirect to after registering.', 'give'),
44 44
 			),
45 45
 		);
46 46
 	}
Please login to merge, or discard this patch.
includes/admin/reporting/export/export-functions.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
18
-require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-export.php';
19
-require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/export-actions.php';
18
+require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-export.php';
19
+require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/export-actions.php';
20 20
 
21 21
 /**
22 22
  * Process batch exports via ajax
@@ -26,79 +26,79 @@  discard block
 block discarded – undo
26 26
  */
27 27
 function give_do_ajax_export() {
28 28
 
29
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export.php';
29
+	require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export.php';
30 30
 
31
-	parse_str( $_POST['form'], $form );
31
+	parse_str($_POST['form'], $form);
32 32
 
33 33
 	$_REQUEST = $form = (array) $form;
34 34
 
35
-	if ( ! wp_verify_nonce( $_REQUEST['give_ajax_export'], 'give_ajax_export' ) ) {
36
-		die( '-2' );
35
+	if ( ! wp_verify_nonce($_REQUEST['give_ajax_export'], 'give_ajax_export')) {
36
+		die('-2');
37 37
 	}
38 38
 
39
-	do_action( 'give_batch_export_class_include', $form['give-export-class'] );
39
+	do_action('give_batch_export_class_include', $form['give-export-class']);
40 40
 
41
-	$step   = absint( $_POST['step'] );
42
-	$class  = sanitize_text_field( $form['give-export-class'] );
41
+	$step   = absint($_POST['step']);
42
+	$class  = sanitize_text_field($form['give-export-class']);
43 43
 
44
-	$export = new $class( $step );
44
+	$export = new $class($step);
45 45
 
46
-	if ( ! $export->can_export() ) {
47
-		die( '-1' );
46
+	if ( ! $export->can_export()) {
47
+		die('-1');
48 48
 	}
49 49
 
50
-	if ( ! $export->is_writable ) {
50
+	if ( ! $export->is_writable) {
51 51
 		$json_args = array(
52 52
 			'error'   => true,
53
-			'message' => esc_html__( 'Export location or file not writable.', 'give' )
53
+			'message' => esc_html__('Export location or file not writable.', 'give')
54 54
 		);
55 55
 		echo json_encode($json_args);
56 56
 		exit;
57 57
 	}
58 58
 
59
-	$export->set_properties( $_REQUEST );
59
+	$export->set_properties($_REQUEST);
60 60
 
61 61
 	$export->pre_fetch();
62 62
 
63
-	$ret = $export->process_step( $step );
63
+	$ret = $export->process_step($step);
64 64
 
65 65
 	$percentage = $export->get_percentage_complete();
66 66
 
67
-	if ( $ret ) {
67
+	if ($ret) {
68 68
 
69 69
 		$step += 1;
70
-		echo json_encode( array( 'step' => $step, 'percentage' => $percentage ) );
70
+		echo json_encode(array('step' => $step, 'percentage' => $percentage));
71 71
 		exit;
72 72
 
73
-	} elseif ( true === $export->is_empty ) {
73
+	} elseif (true === $export->is_empty) {
74 74
 
75
-		echo json_encode( array(
75
+		echo json_encode(array(
76 76
 			'error'   => true,
77
-			'message' => esc_html__( 'No data found for export parameters.', 'give' )
78
-		) );
77
+			'message' => esc_html__('No data found for export parameters.', 'give')
78
+		));
79 79
 		exit;
80 80
 
81
-	} elseif ( true === $export->done && true === $export->is_void ) {
81
+	} elseif (true === $export->done && true === $export->is_void) {
82 82
 
83
-		$message = ! empty( $export->message ) ? $export->message : esc_html__( 'Batch Processing Complete', 'give' );
84
-		echo json_encode( array( 'success' => true, 'message' => $message ) );
83
+		$message = ! empty($export->message) ? $export->message : esc_html__('Batch Processing Complete', 'give');
84
+		echo json_encode(array('success' => true, 'message' => $message));
85 85
 		exit;
86 86
 
87 87
 	} else {
88 88
 		
89
-		$args = array_merge( $_REQUEST, array(
89
+		$args = array_merge($_REQUEST, array(
90 90
 			'step'        => $step,
91 91
 			'class'       => $class,
92
-			'nonce'       => wp_create_nonce( 'give-batch-export' ),
92
+			'nonce'       => wp_create_nonce('give-batch-export'),
93 93
 			'give_action' => 'form_batch_export',
94
-		) );
94
+		));
95 95
 
96
-		$download_url = add_query_arg( $args, admin_url() );
96
+		$download_url = add_query_arg($args, admin_url());
97 97
 
98
-		echo json_encode( array( 'step' => 'done', 'url' => $download_url ) );
98
+		echo json_encode(array('step' => 'done', 'url' => $download_url));
99 99
 		exit;
100 100
 
101 101
 	}
102 102
 }
103 103
 
104
-add_action( 'wp_ajax_give_do_ajax_export', 'give_do_ajax_export' );
104
+add_action('wp_ajax_give_do_ajax_export', 'give_do_ajax_export');
Please login to merge, or discard this patch.
includes/admin/reporting/export/export-actions.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
11 11
  */
12 12
 
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -22,20 +22,20 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function give_process_batch_export_form() {
24 24
 
25
-	if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'give-batch-export' ) ) {
26
-		wp_die( esc_html__( 'Nonce verification failed.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
25
+	if ( ! wp_verify_nonce($_REQUEST['nonce'], 'give-batch-export')) {
26
+		wp_die(esc_html__('Nonce verification failed.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
27 27
 	}
28 28
 
29
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export.php';
29
+	require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export.php';
30 30
 
31
-	do_action( 'give_batch_export_class_include', $_REQUEST['class'] );
31
+	do_action('give_batch_export_class_include', $_REQUEST['class']);
32 32
 
33 33
 	$export = new $_REQUEST['class'];
34 34
 	$export->export();
35 35
 
36 36
 }
37 37
 
38
-add_action( 'give_form_batch_export', 'give_process_batch_export_form' );
38
+add_action('give_form_batch_export', 'give_process_batch_export_form');
39 39
 
40 40
 /**
41 41
  * Exports earnings for a specified time period
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
  * @return void
47 47
  */
48 48
 function give_export_earnings() {
49
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-export-earnings.php';
49
+	require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-export-earnings.php';
50 50
 
51 51
 	$earnings_export = new Give_Earnings_Export();
52 52
 
53 53
 	$earnings_export->export();
54 54
 }
55 55
 
56
-add_action( 'give_earnings_export', 'give_export_earnings' );
56
+add_action('give_earnings_export', 'give_export_earnings');
57 57
 
58 58
 
59 59
 /**
@@ -66,14 +66,14 @@  discard block
 block discarded – undo
66 66
  * @return void
67 67
  */
68 68
 function give_export_all_customers() {
69
-	require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-export-customers.php';
69
+	require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-export-customers.php';
70 70
 
71 71
 	$customer_export = new Give_Donors_Export();
72 72
 
73 73
 	$customer_export->export();
74 74
 }
75 75
 
76
-add_action( 'give_email_export', 'give_export_all_customers' );
76
+add_action('give_email_export', 'give_export_all_customers');
77 77
 
78 78
 /**
79 79
  * Add a hook allowing extensions to register a hook on the batch export process
@@ -82,22 +82,22 @@  discard block
 block discarded – undo
82 82
  * @return void
83 83
  */
84 84
 function give_register_batch_exporters() {
85
-	if ( is_admin() ) {
86
-		do_action( 'give_register_batch_exporter' );
85
+	if (is_admin()) {
86
+		do_action('give_register_batch_exporter');
87 87
 	}
88 88
 }
89 89
 
90
-add_action( 'plugins_loaded', 'give_register_batch_exporters' );
90
+add_action('plugins_loaded', 'give_register_batch_exporters');
91 91
 
92 92
 /**
93 93
  * Register the payments batch exporter
94 94
  * @since  1.5
95 95
  */
96 96
 function give_register_payments_batch_export() {
97
-	add_action( 'give_batch_export_class_include', 'give_include_payments_batch_processor', 10, 1 );
97
+	add_action('give_batch_export_class_include', 'give_include_payments_batch_processor', 10, 1);
98 98
 }
99 99
 
100
-add_action( 'give_register_batch_exporter', 'give_register_payments_batch_export', 10 );
100
+add_action('give_register_batch_exporter', 'give_register_payments_batch_export', 10);
101 101
 
102 102
 /**
103 103
  * Loads the payments batch process if needed
@@ -108,10 +108,10 @@  discard block
 block discarded – undo
108 108
  *
109 109
  * @return void
110 110
  */
111
-function give_include_payments_batch_processor( $class ) {
111
+function give_include_payments_batch_processor($class) {
112 112
 
113
-	if ( 'Give_Batch_Payments_Export' === $class ) {
114
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-payments.php';
113
+	if ('Give_Batch_Payments_Export' === $class) {
114
+		require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-payments.php';
115 115
 	}
116 116
 
117 117
 }
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
  * @since  1.5.2
122 122
  */
123 123
 function give_register_customers_batch_export() {
124
-	add_action( 'give_batch_export_class_include', 'give_include_customers_batch_processor', 10, 1 );
124
+	add_action('give_batch_export_class_include', 'give_include_customers_batch_processor', 10, 1);
125 125
 }
126 126
 
127
-add_action( 'give_register_batch_exporter', 'give_register_customers_batch_export', 10 );
127
+add_action('give_register_batch_exporter', 'give_register_customers_batch_export', 10);
128 128
 
129 129
 /**
130 130
  * Loads the customers batch process if needed
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
  *
136 136
  * @return void
137 137
  */
138
-function give_include_customers_batch_processor( $class ) {
138
+function give_include_customers_batch_processor($class) {
139 139
 
140
-	if ( 'Give_Batch_Customers_Export' === $class ) {
141
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-customers.php';
140
+	if ('Give_Batch_Customers_Export' === $class) {
141
+		require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-customers.php';
142 142
 	}
143 143
 
144 144
 }
@@ -149,10 +149,10 @@  discard block
 block discarded – undo
149 149
  * @since  1.5
150 150
  */
151 151
 function give_register_forms_batch_export() {
152
-	add_action( 'give_batch_export_class_include', 'give_include_forms_batch_processor', 10, 1 );
152
+	add_action('give_batch_export_class_include', 'give_include_forms_batch_processor', 10, 1);
153 153
 }
154 154
 
155
-add_action( 'give_register_batch_exporter', 'give_register_forms_batch_export', 10 );
155
+add_action('give_register_batch_exporter', 'give_register_forms_batch_export', 10);
156 156
 
157 157
 /**
158 158
  * Loads the file downloads batch process if needed
@@ -163,10 +163,10 @@  discard block
 block discarded – undo
163 163
  *
164 164
  * @return void
165 165
  */
166
-function give_include_forms_batch_processor( $class ) {
166
+function give_include_forms_batch_processor($class) {
167 167
 
168
-	if ( 'Give_Batch_Forms_Export' === $class ) {
169
-		require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-forms.php';
168
+	if ('Give_Batch_Forms_Export' === $class) {
169
+		require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/export/class-batch-export-forms.php';
170 170
 	}
171 171
 
172 172
 }
173 173
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/reporting/export/class-batch-export-forms.php 1 patch
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -41,20 +41,20 @@  discard block
 block discarded – undo
41 41
 	public function csv_cols() {
42 42
 
43 43
 		$cols = array(
44
-			'ID'                      => esc_html__( 'ID', 'give' ),
45
-			'post_name'               => esc_html__( 'Slug', 'give' ),
46
-			'post_title'              => esc_html__( 'Name', 'give' ),
47
-			'post_date'               => esc_html__( 'Date Created', 'give' ),
48
-			'post_author'             => esc_html__( 'Author', 'give' ),
49
-			'post_content'            => esc_html__( 'Description', 'give' ),
50
-			'post_excerpt'            => esc_html__( 'Excerpt', 'give' ),
51
-			'post_status'             => esc_html__( 'Status', 'give' ),
52
-			'categories'              => esc_html__( 'Categories', 'give' ),
53
-			'tags'                    => esc_html__( 'Tags', 'give' ),
54
-			'give_price'              => esc_html__( 'Price', 'give' ),
55
-			'_thumbnail_id'           => esc_html__( 'Featured Image', 'give' ),
56
-			'_give_form_sales'        => esc_html__( 'Donations', 'give' ),
57
-			'_give_download_earnings' => esc_html__( 'Income', 'give' ),
44
+			'ID'                      => esc_html__('ID', 'give'),
45
+			'post_name'               => esc_html__('Slug', 'give'),
46
+			'post_title'              => esc_html__('Name', 'give'),
47
+			'post_date'               => esc_html__('Date Created', 'give'),
48
+			'post_author'             => esc_html__('Author', 'give'),
49
+			'post_content'            => esc_html__('Description', 'give'),
50
+			'post_excerpt'            => esc_html__('Excerpt', 'give'),
51
+			'post_status'             => esc_html__('Status', 'give'),
52
+			'categories'              => esc_html__('Categories', 'give'),
53
+			'tags'                    => esc_html__('Tags', 'give'),
54
+			'give_price'              => esc_html__('Price', 'give'),
55
+			'_thumbnail_id'           => esc_html__('Featured Image', 'give'),
56
+			'_give_form_sales'        => esc_html__('Donations', 'give'),
57
+			'_give_download_earnings' => esc_html__('Income', 'give'),
58 58
 		);
59 59
 
60 60
 		return $cols;
@@ -86,43 +86,43 @@  discard block
 block discarded – undo
86 86
 			'paged'          => $this->step
87 87
 		);
88 88
 
89
-		$downloads = new WP_Query( $args );
89
+		$downloads = new WP_Query($args);
90 90
 
91
-		if ( $downloads->posts ) {
92
-			foreach ( $downloads->posts as $download ) {
91
+		if ($downloads->posts) {
92
+			foreach ($downloads->posts as $download) {
93 93
 
94 94
 				$row = array();
95 95
 
96
-				foreach ( $this->csv_cols() as $key => $value ) {
96
+				foreach ($this->csv_cols() as $key => $value) {
97 97
 
98 98
 					// Setup default value
99
-					$row[ $key ] = '';
99
+					$row[$key] = '';
100 100
 
101
-					if ( in_array( $key, $meta ) ) {
101
+					if (in_array($key, $meta)) {
102 102
 
103
-						switch ( $key ) {
103
+						switch ($key) {
104 104
 
105 105
 							case '_thumbnail_id' :
106 106
 
107
-								$image_id    = get_post_thumbnail_id( $download->ID );
108
-								$row[ $key ] = wp_get_attachment_url( $image_id );
107
+								$image_id    = get_post_thumbnail_id($download->ID);
108
+								$row[$key] = wp_get_attachment_url($image_id);
109 109
 
110 110
 								break;
111 111
 
112 112
 							case 'give_price' :
113 113
 
114
-								if ( give_has_variable_prices( $download->ID ) ) {
114
+								if (give_has_variable_prices($download->ID)) {
115 115
 
116 116
 									$prices = array();
117
-									foreach ( give_get_variable_prices( $download->ID ) as $price ) {
118
-										$prices[] = $price['name'] . ': ' . $price['amount'];
117
+									foreach (give_get_variable_prices($download->ID) as $price) {
118
+										$prices[] = $price['name'].': '.$price['amount'];
119 119
 									}
120 120
 
121
-									$row[ $key ] = implode( ' | ', $prices );
121
+									$row[$key] = implode(' | ', $prices);
122 122
 
123 123
 								} else {
124 124
 
125
-									$row[ $key ] = give_get_download_price( $download->ID );
125
+									$row[$key] = give_get_download_price($download->ID);
126 126
 
127 127
 								}
128 128
 
@@ -132,54 +132,54 @@  discard block
 block discarded – undo
132 132
 
133 133
 
134 134
 								$files = array();
135
-								foreach ( give_get_download_files( $download->ID ) as $file ) {
135
+								foreach (give_get_download_files($download->ID) as $file) {
136 136
 									$files[] = $file['file'];
137 137
 								}
138 138
 
139
-								$row[ $key ] = implode( ' | ', $files );
139
+								$row[$key] = implode(' | ', $files);
140 140
 
141 141
 								break;
142 142
 
143 143
 							default :
144 144
 
145
-								$row[ $key ] = get_post_meta( $download->ID, $key, true );
145
+								$row[$key] = get_post_meta($download->ID, $key, true);
146 146
 
147 147
 								break;
148 148
 
149 149
 						}
150 150
 
151
-					} elseif ( isset( $download->$key ) ) {
151
+					} elseif (isset($download->$key)) {
152 152
 
153
-						switch ( $key ) {
153
+						switch ($key) {
154 154
 
155 155
 							case 'post_author' :
156 156
 
157
-								$row[ $key ] = get_the_author_meta( 'user_login', $download->post_author );
157
+								$row[$key] = get_the_author_meta('user_login', $download->post_author);
158 158
 
159 159
 								break;
160 160
 
161 161
 							default :
162 162
 
163
-								$row[ $key ] = $download->$key;
163
+								$row[$key] = $download->$key;
164 164
 
165 165
 								break;
166 166
 						}
167 167
 
168
-					} elseif ( 'tags' == $key ) {
168
+					} elseif ('tags' == $key) {
169 169
 
170
-						$terms = get_the_terms( $download->ID, 'download_tag' );
171
-						if ( $terms ) {
172
-							$terms       = wp_list_pluck( $terms, 'name' );
173
-							$row[ $key ] = implode( ' | ', $terms );
170
+						$terms = get_the_terms($download->ID, 'download_tag');
171
+						if ($terms) {
172
+							$terms       = wp_list_pluck($terms, 'name');
173
+							$row[$key] = implode(' | ', $terms);
174 174
 						}
175 175
 
176 176
 
177
-					} elseif ( 'categories' == $key ) {
177
+					} elseif ('categories' == $key) {
178 178
 
179
-						$terms = get_the_terms( $download->ID, 'download_category' );
180
-						if ( $terms ) {
181
-							$terms       = wp_list_pluck( $terms, 'name' );
182
-							$row[ $key ] = implode( ' | ', $terms );
179
+						$terms = get_the_terms($download->ID, 'download_category');
180
+						if ($terms) {
181
+							$terms       = wp_list_pluck($terms, 'name');
182
+							$row[$key] = implode(' | ', $terms);
183 183
 						}
184 184
 
185 185
 					}
@@ -190,8 +190,8 @@  discard block
 block discarded – undo
190 190
 
191 191
 			}
192 192
 
193
-			$data = apply_filters( 'give_export_get_data', $data );
194
-			$data = apply_filters( 'give_export_get_data_' . $this->export_type, $data );
193
+			$data = apply_filters('give_export_get_data', $data);
194
+			$data = apply_filters('give_export_get_data_'.$this->export_type, $data);
195 195
 
196 196
 			return $data;
197 197
 		}
@@ -210,20 +210,20 @@  discard block
 block discarded – undo
210 210
 
211 211
 		$args = array(
212 212
 			'post_type'      => 'give_forms',
213
-			'posts_per_page' => - 1,
213
+			'posts_per_page' => -1,
214 214
 			'post_status'    => 'any',
215 215
 			'fields'         => 'ids',
216 216
 		);
217 217
 
218
-		$downloads  = new WP_Query( $args );
218
+		$downloads  = new WP_Query($args);
219 219
 		$total      = (int) $downloads->post_count;
220 220
 		$percentage = 100;
221 221
 
222
-		if ( $total > 0 ) {
223
-			$percentage = ( ( 30 * $this->step ) / $total ) * 100;
222
+		if ($total > 0) {
223
+			$percentage = ((30 * $this->step) / $total) * 100;
224 224
 		}
225 225
 
226
-		if ( $percentage > 100 ) {
226
+		if ($percentage > 100) {
227 227
 			$percentage = 100;
228 228
 		}
229 229
 
Please login to merge, or discard this patch.
includes/admin/reporting/class-export.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 * @return bool Whether we can export or not
38 38
 	 */
39 39
 	public function can_export() {
40
-		return (bool) apply_filters( 'give_export_capability', current_user_can( 'export_give_reports' ) );
40
+		return (bool) apply_filters('give_export_capability', current_user_can('export_give_reports'));
41 41
 	}
42 42
 
43 43
 	/**
@@ -48,16 +48,16 @@  discard block
 block discarded – undo
48 48
 	 * @return void
49 49
 	 */
50 50
 	public function headers() {
51
-		ignore_user_abort( true );
51
+		ignore_user_abort(true);
52 52
 
53
-		if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) {
54
-			set_time_limit( 0 );
53
+		if ( ! give_is_func_disabled('set_time_limit') && ! ini_get('safe_mode')) {
54
+			set_time_limit(0);
55 55
 		}
56 56
 
57 57
 		nocache_headers();
58
-		header( 'Content-Type: text/csv; charset=utf-8' );
59
-		header( 'Content-Disposition: attachment; filename=give-export-' . $this->export_type . '-' . date( 'm-d-Y' ) . '.csv' );
60
-		header( "Expires: 0" );
58
+		header('Content-Type: text/csv; charset=utf-8');
59
+		header('Content-Disposition: attachment; filename=give-export-'.$this->export_type.'-'.date('m-d-Y').'.csv');
60
+		header("Expires: 0");
61 61
 	}
62 62
 
63 63
 	/**
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
 	 */
70 70
 	public function csv_cols() {
71 71
 		$cols = array(
72
-			'id'   => esc_html__( 'ID', 'give' ),
73
-			'date' => esc_html__( 'Date', 'give' )
72
+			'id'   => esc_html__('ID', 'give'),
73
+			'date' => esc_html__('Date', 'give')
74 74
 		);
75 75
 
76 76
 		return $cols;
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	public function get_csv_cols() {
87 87
 		$cols = $this->csv_cols();
88 88
 
89
-		return apply_filters( 'give_export_csv_cols_' . $this->export_type, $cols );
89
+		return apply_filters('give_export_csv_cols_'.$this->export_type, $cols);
90 90
 	}
91 91
 
92 92
 	/**
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
 	public function csv_cols_out() {
101 101
 		$cols = $this->get_csv_cols();
102 102
 		$i    = 1;
103
-		foreach ( $cols as $col_id => $column ) {
104
-			echo '"' . addslashes( $column ) . '"';
105
-			echo $i == count( $cols ) ? '' : ',';
106
-			$i ++;
103
+		foreach ($cols as $col_id => $column) {
104
+			echo '"'.addslashes($column).'"';
105
+			echo $i == count($cols) ? '' : ',';
106
+			$i++;
107 107
 		}
108 108
 		echo "\r\n";
109 109
 	}
@@ -120,16 +120,16 @@  discard block
 block discarded – undo
120 120
 		$data = array(
121 121
 			0 => array(
122 122
 				'id'   => '',
123
-				'data' => date( 'F j, Y' )
123
+				'data' => date('F j, Y')
124 124
 			),
125 125
 			1 => array(
126 126
 				'id'   => '',
127
-				'data' => date( 'F j, Y' )
127
+				'data' => date('F j, Y')
128 128
 			)
129 129
 		);
130 130
 
131
-		$data = apply_filters( 'give_export_get_data', $data );
132
-		$data = apply_filters( 'give_export_get_data_' . $this->export_type, $data );
131
+		$data = apply_filters('give_export_get_data', $data);
132
+		$data = apply_filters('give_export_get_data_'.$this->export_type, $data);
133 133
 
134 134
 		return $data;
135 135
 	}
@@ -147,14 +147,14 @@  discard block
 block discarded – undo
147 147
 		$cols = $this->get_csv_cols();
148 148
 
149 149
 		// Output each row
150
-		foreach ( $data as $row ) {
150
+		foreach ($data as $row) {
151 151
 			$i = 1;
152
-			foreach ( $row as $col_id => $column ) {
152
+			foreach ($row as $col_id => $column) {
153 153
 				// Make sure the column is valid
154
-				if ( array_key_exists( $col_id, $cols ) ) {
155
-					echo '"' . addslashes( $column ) . '"';
156
-					echo $i == count( $cols ) ? '' : ',';
157
-					$i ++;
154
+				if (array_key_exists($col_id, $cols)) {
155
+					echo '"'.addslashes($column).'"';
156
+					echo $i == count($cols) ? '' : ',';
157
+					$i++;
158 158
 				}
159 159
 			}
160 160
 			echo "\r\n";
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 	 * @return void
174 174
 	 */
175 175
 	public function export() {
176
-		if ( ! $this->can_export() ) {
177
-			wp_die( esc_html__( 'You do not have permission to export data.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
176
+		if ( ! $this->can_export()) {
177
+			wp_die(esc_html__('You do not have permission to export data.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
178 178
 		}
179 179
 
180 180
 		// Set headers
Please login to merge, or discard this patch.
includes/admin/reporting/tools.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -22,80 +22,80 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function give_tools_recount_stats_display() {
24 24
 
25
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
25
+	if ( ! current_user_can('manage_give_settings')) {
26 26
 		return;
27 27
 	}
28 28
 
29
-	do_action( 'give_tools_recount_stats_before' );
29
+	do_action('give_tools_recount_stats_before');
30 30
 	?>
31 31
 	<div id="poststuff">
32 32
 		<div class="postbox">
33 33
 
34
-			<h2 class="hndle ui-sortable-handle"><span><?php esc_html_e( 'Recount Stats', 'give' ); ?></span></h2>
34
+			<h2 class="hndle ui-sortable-handle"><span><?php esc_html_e('Recount Stats', 'give'); ?></span></h2>
35 35
 
36 36
 			<div class="inside recount-stats-controls">
37
-				<p><?php esc_html_e( 'Use these tools to recount stats, delete test transactions, or reset stats.', 'give' ); ?></p>
37
+				<p><?php esc_html_e('Use these tools to recount stats, delete test transactions, or reset stats.', 'give'); ?></p>
38 38
 				<form method="post" id="give-tools-recount-form" class="give-export-form">
39 39
 
40
-					<?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?>
40
+					<?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?>
41 41
 
42 42
 					<select name="give-export-class" id="recount-stats-type">
43
-						<option value="0" selected="selected" disabled="disabled"><?php esc_html_e( 'Please select an option', 'give' ); ?></option>
44
-						<option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e( 'Recalculate Total Donation Income Amount', 'give' ); ?></option>
45
-						<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>
46
-						<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>
47
-						<option data-type="recount-customer-stats" value="Give_Tools_Recount_Customer_Stats"><?php esc_html_e( 'Recalculate Donor Statistics', 'give' ); ?></option>
48
-						<option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e( 'Delete Test Transactions', 'give' ); ?></option>
49
-						<option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e( 'Delete All Data', 'give' ); ?></option>
50
-						<?php do_action( 'give_recount_tool_options' ); ?>
43
+						<option value="0" selected="selected" disabled="disabled"><?php esc_html_e('Please select an option', 'give'); ?></option>
44
+						<option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e('Recalculate Total Donation Income Amount', 'give'); ?></option>
45
+						<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>
46
+						<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>
47
+						<option data-type="recount-customer-stats" value="Give_Tools_Recount_Customer_Stats"><?php esc_html_e('Recalculate Donor Statistics', 'give'); ?></option>
48
+						<option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e('Delete Test Transactions', 'give'); ?></option>
49
+						<option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e('Delete All Data', 'give'); ?></option>
50
+						<?php do_action('give_recount_tool_options'); ?>
51 51
 					</select>
52 52
 
53 53
 					<span id="tools-form-dropdown" style="display: none">
54 54
 						<?php
55 55
 						$args = array(
56 56
 							'name'   => 'form_id',
57
-							'number' => - 1,
57
+							'number' => -1,
58 58
 							'chosen' => true,
59 59
 						);
60
-						echo Give()->html->forms_dropdown( $args );
60
+						echo Give()->html->forms_dropdown($args);
61 61
 						?>
62 62
 					</span>
63 63
 
64
-					<input type="submit" id="recount-stats-submit" value="<?php esc_attr_e( 'Submit', 'give' ); ?>" class="button-secondary"/>
64
+					<input type="submit" id="recount-stats-submit" value="<?php esc_attr_e('Submit', 'give'); ?>" class="button-secondary"/>
65 65
 
66 66
 					<br/>
67 67
 
68 68
 					<span class="give-recount-stats-descriptions">
69
-						<span id="recount-stats"><?php esc_html_e( 'Recalculates the overall donation income amount.', 'give' ); ?></span>
69
+						<span id="recount-stats"><?php esc_html_e('Recalculates the overall donation income amount.', 'give'); ?></span>
70 70
 						<span id="recount-form"><?php
71 71
 							printf(
72 72
 								/* translators: %s: form singular label */
73
-								esc_html__( 'Recalculates the donation and income stats for a specific %s.', 'give' ),
74
-								give_get_forms_label_singular( true )
73
+								esc_html__('Recalculates the donation and income stats for a specific %s.', 'give'),
74
+								give_get_forms_label_singular(true)
75 75
 							);
76 76
 						?></span>
77 77
 						<span id="recount-all"><?php
78 78
 							printf(
79 79
 								/* translators: %s: form plural label */
80
-								esc_html__( 'Recalculates the earnings and sales stats for all %s.', 'give' ),
81
-								give_get_forms_label_plural( true )
80
+								esc_html__('Recalculates the earnings and sales stats for all %s.', 'give'),
81
+								give_get_forms_label_plural(true)
82 82
 							);
83 83
 						?></span>
84
-						<span id="recount-customer-stats"><?php esc_html_e( 'Recalculates the lifetime value and donation counts for all donors.', 'give' ); ?></span>
85
-						<?php do_action( 'give_recount_tool_descriptions' ); ?>
86
-						<span id="delete-test-transactions"><?php _e( '<strong>Deletes</strong> all TEST payment records, donors, and related log entries.', 'give' ); ?></span>
87
-						<span id="reset-stats"><?php _e( '<strong>Deletes</strong> ALL transaction records, donors, and related log entries regardless of test or live mode.', 'give' ); ?></span>
84
+						<span id="recount-customer-stats"><?php esc_html_e('Recalculates the lifetime value and donation counts for all donors.', 'give'); ?></span>
85
+						<?php do_action('give_recount_tool_descriptions'); ?>
86
+						<span id="delete-test-transactions"><?php _e('<strong>Deletes</strong> all TEST payment records, donors, and related log entries.', 'give'); ?></span>
87
+						<span id="reset-stats"><?php _e('<strong>Deletes</strong> ALL transaction records, donors, and related log entries regardless of test or live mode.', 'give'); ?></span>
88 88
 					</span>
89 89
 
90 90
 					<span class="spinner"></span>
91 91
 
92 92
 				</form>
93
-				<?php do_action( 'give_tools_recount_forms' ); ?>
93
+				<?php do_action('give_tools_recount_forms'); ?>
94 94
 			</div><!-- .inside -->
95 95
 		</div><!-- .postbox -->
96 96
 	</div><!-- #poststuff -->
97 97
 	<?php
98
-	do_action( 'give_tools_recount_stats_after' );
98
+	do_action('give_tools_recount_stats_after');
99 99
 }
100 100
 
101
-add_action( 'give_reports_tab_tools', 'give_tools_recount_stats_display' );
101
+add_action('give_reports_tab_tools', 'give_tools_recount_stats_display');
Please login to merge, or discard this patch.