Completed
Push — master ( e69c66...699283 )
by Devin
16:32
created
includes/admin/tools/class-settings-logs.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
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_Logs' ) ) :
16
+if ( ! class_exists('Give_Settings_Logs')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Logs.
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
 		 */
44 44
 		public function __construct() {
45 45
 			$this->id    = 'logs';
46
-			$this->label = esc_html__( 'Logs', 'give' );
46
+			$this->label = esc_html__('Logs', 'give');
47 47
 
48 48
 			$this->default_tab = 'sales';
49 49
 
50 50
 			parent::__construct();
51 51
 
52 52
 			// Do not use main form for this tab.
53
-			if ( give_get_current_setting_tab() === $this->id ) {
54
-				add_action( 'give-tools_open_form', '__return_empty_string' );
55
-				add_action( 'give-tools_close_form', '__return_empty_string' );
53
+			if (give_get_current_setting_tab() === $this->id) {
54
+				add_action('give-tools_open_form', '__return_empty_string');
55
+				add_action('give-tools_close_form', '__return_empty_string');
56 56
 			}
57 57
 		}
58 58
 
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 		 *
66 66
 		 * @return array
67 67
 		 */
68
-		public function add_settings_page( $pages ) {
69
-			$pages[ $this->id ] = $this->label;
68
+		public function add_settings_page($pages) {
69
+			$pages[$this->id] = $this->label;
70 70
 
71 71
 			return $pages;
72 72
 		}
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 			$GLOBALS['give_hide_save_button'] = true;
83 83
 
84 84
 			// Get settings.
85
-			$settings = apply_filters( 'give_settings_system', array(
85
+			$settings = apply_filters('give_settings_system', array(
86 86
 				array(
87 87
 					'id'         => 'give_tools_logs',
88 88
 					'type'       => 'title',
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 				),
91 91
 				array(
92 92
 					'id'   => 'api',
93
-					'name' => esc_html__( 'Log', 'give' ),
93
+					'name' => esc_html__('Log', 'give'),
94 94
 					'type' => 'logs',
95 95
 
96 96
 				),
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 					'type'       => 'sectionend',
100 100
 					'table_html' => false,
101 101
 				),
102
-			) );
102
+			));
103 103
 
104 104
 			/**
105 105
 			 * Filter the settings.
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 			 *
109 109
 			 * @param  array $settings
110 110
 			 */
111
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
111
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
112 112
 
113 113
 			// Output.
114 114
 			return $settings;
@@ -122,14 +122,14 @@  discard block
 block discarded – undo
122 122
 		 */
123 123
 		public function get_sections() {
124 124
 			$sections = array(
125
-				'sales'          => esc_html__( 'Donations', 'give' ),
126
-				'gateway_errors' => esc_html__( 'Payment Errors', 'give' ),
127
-				'api_requests'   => esc_html__( 'API Requests', 'give' ),
125
+				'sales'          => esc_html__('Donations', 'give'),
126
+				'gateway_errors' => esc_html__('Payment Errors', 'give'),
127
+				'api_requests'   => esc_html__('API Requests', 'give'),
128 128
 			);
129 129
 
130
-			$sections = apply_filters( 'give_log_views', $sections );
130
+			$sections = apply_filters('give_log_views', $sections);
131 131
 
132
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
132
+			return apply_filters('give_get_sections_'.$this->id, $sections);
133 133
 		}
134 134
 
135 135
 		/**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 		public function output() {
142 142
 			$settings = $this->get_settings();
143 143
 
144
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
144
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
145 145
 		}
146 146
 	}
147 147
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-license.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
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_License' ) ) :
16
+if ( ! class_exists('Give_Settings_License')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_License.
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 		 */
44 44
 		public function __construct() {
45 45
 			$this->id    = 'licenses';
46
-			$this->label = esc_html__( 'Licenses', 'give' );
46
+			$this->label = esc_html__('Licenses', 'give');
47 47
 
48
-			add_filter( 'give-settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
49
-			add_action( "give-settings_settings_{$this->id}_page", array( $this, 'output' ) );
48
+			add_filter('give-settings_tabs_array', array($this, 'add_settings_page'), 20);
49
+			add_action("give-settings_settings_{$this->id}_page", array($this, 'output'));
50 50
 		}
51 51
 
52 52
 		/**
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
 		 * @param  array $pages Lst of pages.
57 57
 		 * @return array
58 58
 		 */
59
-		public function add_settings_page( $pages ) {
59
+		public function add_settings_page($pages) {
60 60
 			$setting = $this->get_settings();
61 61
 			// Bailout: Do not add licenses setting tab if it does not contain any setting fields.
62
-			if( ! empty( $setting ) ) {
63
-				$pages[ $this->id ] = $this->label;
62
+			if ( ! empty($setting)) {
63
+				$pages[$this->id] = $this->label;
64 64
 			}
65 65
 
66 66
 			return $pages;
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 			 * Filter the licenses settings.
80 80
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
81 81
 			 */
82
-			$settings = apply_filters( 'give_settings_licenses', $settings );
82
+			$settings = apply_filters('give_settings_licenses', $settings);
83 83
 
84 84
 			/**
85 85
 			 * Filter the settings.
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 			 * @since  1.8
88 88
 			 * @param  array $settings
89 89
 			 */
90
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
90
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
91 91
 
92 92
 			// Output.
93 93
 			return $settings;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		public function output() {
103 103
 			$settings = $this->get_settings();
104 104
 
105
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
105
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
106 106
 		}
107 107
 	}
108 108
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-addon.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
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_Addon' ) ) :
16
+if ( ! class_exists('Give_Settings_Addon')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Addon.
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 		 */
27 27
 		public function __construct() {
28 28
 			$this->id    = 'addons';
29
-			$this->label = esc_html__( 'Add-ons', 'give' );
29
+			$this->label = esc_html__('Add-ons', 'give');
30 30
 
31 31
 			parent::__construct();
32 32
 		}
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 		 * @param  $setting_tab
39 39
 		 * @return string
40 40
 		 */
41
-		function set_default_setting_tab( $setting_tab ) {
41
+		function set_default_setting_tab($setting_tab) {
42 42
 			$default_tab = '';
43 43
 
44 44
 			// Set default tab to first setting tab.
45
-			if( $sections = array_keys( $this->get_sections() ) ) {
46
-				$default_tab = current( $sections );
45
+			if ($sections = array_keys($this->get_sections())) {
46
+				$default_tab = current($sections);
47 47
 			}
48 48
 			return $default_tab;
49 49
 		}
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
 		 * @param  array $pages Lst of pages.
56 56
 		 * @return array
57 57
 		 */
58
-		public function add_settings_page( $pages ) {
58
+		public function add_settings_page($pages) {
59 59
 			$setting = $this->get_settings();
60 60
 			// Bailout: Do not add addons setting tab if it does not contain any setting fields.
61
-			if( ! empty( $setting ) ) {
62
-				$pages[ $this->id ] = $this->label;
61
+			if ( ! empty($setting)) {
62
+				$pages[$this->id] = $this->label;
63 63
 			}
64 64
 
65 65
 			return $pages;
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 			 * Filter the addons settings.
79 79
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
80 80
 			 */
81
-			$settings = apply_filters( 'give_settings_addons', $settings );
81
+			$settings = apply_filters('give_settings_addons', $settings);
82 82
 
83 83
 			/**
84 84
 			 * Filter the settings.
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 			 * @since  1.8
87 87
 			 * @param  array $settings
88 88
 			 */
89
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
89
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
90 90
 
91 91
 			// Output.
92 92
 			return $settings;
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-form.php 1 patch
Spacing   +30 added lines, -30 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
 
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
 	 */
25 25
 	public function __construct() {
26 26
 
27
-		$this->shortcode['title'] = esc_html__( 'Donation Form', 'give' );
28
-		$this->shortcode['label'] = esc_html__( 'Donation Form', 'give' );
27
+		$this->shortcode['title'] = esc_html__('Donation Form', 'give');
28
+		$this->shortcode['label'] = esc_html__('Donation Form', 'give');
29 29
 
30
-		parent::__construct( 'give_form' );
30
+		parent::__construct('give_form');
31 31
 	}
32 32
 
33 33
 	/**
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 
40 40
 		$create_form_link = sprintf(
41 41
 		/* translators: %s: create new form URL */
42
-			__( '<a href="%s">Create</a> a new Donation Form.', 'give' ),
43
-			admin_url( 'post-new.php?post_type=give_forms' )
42
+			__('<a href="%s">Create</a> a new Donation Form.', 'give'),
43
+			admin_url('post-new.php?post_type=give_forms')
44 44
 		);
45 45
 
46 46
 		return array(
@@ -50,59 +50,59 @@  discard block
 block discarded – undo
50 50
 					'post_type' => 'give_forms',
51 51
 				),
52 52
 				'name'        => 'id',
53
-				'tooltip'     => esc_attr__( 'Select a Donation Form', 'give' ),
54
-				'placeholder' => '- ' . esc_attr__( 'Select a Donation Form', 'give' ) . ' -',
53
+				'tooltip'     => esc_attr__('Select a Donation Form', 'give'),
54
+				'placeholder' => '- '.esc_attr__('Select a Donation Form', 'give').' -',
55 55
 				'required'    => array(
56
-					'alert' => esc_html__( 'You must first select a Form!', 'give' ),
57
-					'error' => sprintf( '<p class="strong">%s</p><p class="no-margin">%s</p>', esc_html__( 'No forms found.', 'give' ), $create_form_link ),
56
+					'alert' => esc_html__('You must first select a Form!', 'give'),
57
+					'error' => sprintf('<p class="strong">%s</p><p class="no-margin">%s</p>', esc_html__('No forms found.', 'give'), $create_form_link),
58 58
 				),
59 59
 			),
60 60
 			array(
61 61
 				'type' => 'container',
62
-				'html' => sprintf( '<p class="strong margin-top">%s</p>', esc_html__( 'Optional settings', 'give' ) ),
62
+				'html' => sprintf('<p class="strong margin-top">%s</p>', esc_html__('Optional settings', 'give')),
63 63
 			),
64 64
 			array(
65 65
 				'type'    => 'listbox',
66 66
 				'name'    => 'show_title',
67
-				'label'   => esc_attr__( 'Show Title:', 'give' ),
68
-				'tooltip' => esc_attr__( 'Do you want to display the form title?', 'give' ),
67
+				'label'   => esc_attr__('Show Title:', 'give'),
68
+				'tooltip' => esc_attr__('Do you want to display the form title?', 'give'),
69 69
 				'options' => array(
70
-					'true'  => esc_html__( 'Show', 'give' ),
71
-					'false' => esc_html__( 'Hide', 'give' ),
70
+					'true'  => esc_html__('Show', 'give'),
71
+					'false' => esc_html__('Hide', 'give'),
72 72
 				),
73 73
 			),
74 74
 			array(
75 75
 				'type'    => 'listbox',
76 76
 				'name'    => 'show_goal',
77
-				'label'   => esc_attr__( 'Show Goal:', 'give' ),
78
-				'tooltip' => esc_attr__( 'Do you want to display the donation goal?', 'give' ),
77
+				'label'   => esc_attr__('Show Goal:', 'give'),
78
+				'tooltip' => esc_attr__('Do you want to display the donation goal?', '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'     => 'show_content',
87 87
 				'minWidth' => 240,
88
-				'label'    => esc_attr__( 'Display Content:', 'give' ),
89
-				'tooltip'  => esc_attr__( 'Do you want to display the form content?', 'give' ),
88
+				'label'    => esc_attr__('Display Content:', 'give'),
89
+				'tooltip'  => esc_attr__('Do you want to display the form content?', 'give'),
90 90
 				'options'  => array(
91
-					'none'  => esc_html__( 'No Content', 'give' ),
92
-					'above' => esc_html__( 'Display content ABOVE the fields', 'give' ),
93
-					'below' => esc_html__( 'Display content BELOW the fields', 'give' ),
91
+					'none'  => esc_html__('No Content', 'give'),
92
+					'above' => esc_html__('Display content ABOVE the fields', 'give'),
93
+					'below' => esc_html__('Display content BELOW the fields', 'give'),
94 94
 				),
95 95
 			),
96 96
 			array(
97 97
 				'type'    => 'listbox',
98 98
 				'name'    => 'display_style',
99
-				'label'   => esc_attr__( 'Donation Options:', 'give' ),
100
-				'tooltip' => esc_attr__( 'How would you like to display donation information?', 'give' ),
99
+				'label'   => esc_attr__('Donation Options:', 'give'),
100
+				'tooltip' => esc_attr__('How would you like to display donation information?', 'give'),
101 101
 				'options' => array(
102
-					'onpage' => esc_html__( 'All Fields', 'give' ),
103
-					'modal'  => esc_html__( 'Modal', 'give' ),
104
-					'reveal' => esc_html__( 'Reveal', 'give' ),
105
-					'button' => esc_html__( 'Button', 'give' ),
102
+					'onpage' => esc_html__('All Fields', 'give'),
103
+					'modal'  => esc_html__('Modal', 'give'),
104
+					'reveal' => esc_html__('Reveal', 'give'),
105
+					'button' => esc_html__('Button', 'give'),
106 106
 				),
107 107
 			),
108 108
 		);
Please login to merge, or discard this patch.
includes/admin/admin-filters.php 1 patch
Spacing   +4 added lines, -4 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
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  *
27 27
  * @return  mixed
28 28
  */
29
-function _give_sanitize_number_decimals_setting_field( $value ) {
30
-	return absint( $value );
29
+function _give_sanitize_number_decimals_setting_field($value) {
30
+	return absint($value);
31 31
 }
32
-add_filter( 'give_admin_settings_sanitize_option_number_decimals', '_give_sanitize_number_decimals_setting_field', 10 );
33 32
\ No newline at end of file
33
+add_filter('give_admin_settings_sanitize_option_number_decimals', '_give_sanitize_number_decimals_setting_field', 10);
34 34
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/forms/metabox.php 1 patch
Spacing   +6 added lines, -6 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,19 +22,19 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function give_add_shortcode_to_publish_metabox() {
24 24
 
25
-	if ( 'give_forms' !== get_post_type() ) {
25
+	if ('give_forms' !== get_post_type()) {
26 26
 		return false;
27 27
 	}
28 28
 	global $post;
29 29
 
30 30
 	//Only enqueue scripts for CPT on post type screen
31
-	if ( 'give_forms' === $post->post_type ) {
31
+	if ('give_forms' === $post->post_type) {
32 32
 		//Shortcode column with select all input
33
-		$shortcode = htmlentities( '[give_form id="' . $post->ID . '"]' );
34
-		echo '<div class="shortcode-wrap box-sizing"><label for="shortcode-input">' . esc_html__( 'Give Form Shortcode:', 'give' ) . '</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" name="shortcode-input" id="shortcode-input" class="shortcode-input" readonly value="' . $shortcode . '"></div>';
33
+		$shortcode = htmlentities('[give_form id="'.$post->ID.'"]');
34
+		echo '<div class="shortcode-wrap box-sizing"><label for="shortcode-input">'.esc_html__('Give Form Shortcode:', 'give').'</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" name="shortcode-input" id="shortcode-input" class="shortcode-input" readonly value="'.$shortcode.'"></div>';
35 35
 
36 36
 	}
37 37
 
38 38
 }
39 39
 
40
-add_action( 'post_submitbox_misc_actions', 'give_add_shortcode_to_publish_metabox' );
40
+add_action('post_submitbox_misc_actions', 'give_add_shortcode_to_publish_metabox');
Please login to merge, or discard this patch.
includes/admin/forms/dashboard-columns.php 1 patch
Spacing   +69 added lines, -69 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
 
@@ -27,34 +27,34 @@  discard block
 block discarded – undo
27 27
  * @return array $form_columns Updated array of forms columns
28 28
  *  Post Type List Table
29 29
  */
30
-function give_form_columns( $give_form_columns ) {
30
+function give_form_columns($give_form_columns) {
31 31
 
32 32
 	// Standard columns
33 33
 	$give_form_columns = array(
34 34
 		'cb'            => '<input type="checkbox"/>',
35
-		'title'         => esc_html__( 'Name', 'give' ),
36
-		'form_category' => esc_html__( 'Categories', 'give' ),
37
-		'form_tag'      => esc_html__( 'Tags', 'give' ),
38
-		'price'         => esc_html__( 'Amount', 'give' ),
39
-		'goal'          => esc_html__( 'Goal', 'give' ),
40
-		'donations'     => esc_html__( 'Donations', 'give' ),
41
-		'earnings'      => esc_html__( 'Income', 'give' ),
42
-		'shortcode'     => esc_html__( 'Shortcode', 'give' ),
43
-		'date'          => esc_html__( 'Date', 'give' ),
35
+		'title'         => esc_html__('Name', 'give'),
36
+		'form_category' => esc_html__('Categories', 'give'),
37
+		'form_tag'      => esc_html__('Tags', 'give'),
38
+		'price'         => esc_html__('Amount', 'give'),
39
+		'goal'          => esc_html__('Goal', 'give'),
40
+		'donations'     => esc_html__('Donations', 'give'),
41
+		'earnings'      => esc_html__('Income', 'give'),
42
+		'shortcode'     => esc_html__('Shortcode', 'give'),
43
+		'date'          => esc_html__('Date', 'give'),
44 44
 	);
45 45
 
46 46
 	// Does the user want categories / tags?
47
-	if ( ! give_is_setting_enabled( give_get_option( 'categories', 'disabled' ) ) ) {
48
-		unset( $give_form_columns['form_category'] );
47
+	if ( ! give_is_setting_enabled(give_get_option('categories', 'disabled'))) {
48
+		unset($give_form_columns['form_category']);
49 49
 	}
50
-	if ( ! give_is_setting_enabled( give_get_option( 'tags', 'disabled' ) ) ) {
51
-		unset( $give_form_columns['form_tag'] );
50
+	if ( ! give_is_setting_enabled(give_get_option('tags', 'disabled'))) {
51
+		unset($give_form_columns['form_tag']);
52 52
 	}
53 53
 
54
-	return apply_filters( 'give_forms_columns', $give_form_columns );
54
+	return apply_filters('give_forms_columns', $give_form_columns);
55 55
 }
56 56
 
57
-add_filter( 'manage_edit-give_forms_columns', 'give_form_columns' );
57
+add_filter('manage_edit-give_forms_columns', 'give_form_columns');
58 58
 
59 59
 /**
60 60
  * Render Give Form Columns
@@ -66,59 +66,59 @@  discard block
 block discarded – undo
66 66
  *
67 67
  * @return void
68 68
  */
69
-function give_render_form_columns( $column_name, $post_id ) {
70
-	if ( get_post_type( $post_id ) == 'give_forms' ) {
69
+function give_render_form_columns($column_name, $post_id) {
70
+	if (get_post_type($post_id) == 'give_forms') {
71 71
 
72
-		switch ( $column_name ) {
72
+		switch ($column_name) {
73 73
 			case 'form_category':
74
-				echo get_the_term_list( $post_id, 'give_forms_category', '', ', ', '' );
74
+				echo get_the_term_list($post_id, 'give_forms_category', '', ', ', '');
75 75
 				break;
76 76
 			case 'form_tag':
77
-				echo get_the_term_list( $post_id, 'give_forms_tag', '', ', ', '' );
77
+				echo get_the_term_list($post_id, 'give_forms_tag', '', ', ', '');
78 78
 				break;
79 79
 			case 'price':
80
-				if ( give_has_variable_prices( $post_id ) ) {
81
-					echo give_price_range( $post_id );
80
+				if (give_has_variable_prices($post_id)) {
81
+					echo give_price_range($post_id);
82 82
 				} else {
83
-					echo give_price( $post_id, false );
84
-					echo '<input type="hidden" class="formprice-' . $post_id . '" value="' . give_get_form_price( $post_id ) . '" />';
83
+					echo give_price($post_id, false);
84
+					echo '<input type="hidden" class="formprice-'.$post_id.'" value="'.give_get_form_price($post_id).'" />';
85 85
 				}
86 86
 				break;
87 87
 			case 'goal':
88
-				if ( give_is_setting_enabled( get_post_meta( $post_id, '_give_goal_option', true ) ) ) {
89
-					echo give_goal( $post_id, false );
88
+				if (give_is_setting_enabled(get_post_meta($post_id, '_give_goal_option', true))) {
89
+					echo give_goal($post_id, false);
90 90
 				} else {
91
-					esc_html_e( 'No Goal Set', 'give' );
91
+					esc_html_e('No Goal Set', 'give');
92 92
 				}
93 93
 
94
-				echo '<input type="hidden" class="formgoal-' . $post_id . '" value="' . give_get_form_goal( $post_id ) . '" />';
94
+				echo '<input type="hidden" class="formgoal-'.$post_id.'" value="'.give_get_form_goal($post_id).'" />';
95 95
 				break;
96 96
 			case 'donations':
97
-				if ( current_user_can( 'view_give_form_stats', $post_id ) ) {
98
-					echo '<a href="' . esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-tools&tab=logs&form=' . $post_id ) ) . '">';
99
-					echo give_get_form_sales_stats( $post_id );
97
+				if (current_user_can('view_give_form_stats', $post_id)) {
98
+					echo '<a href="'.esc_url(admin_url('edit.php?post_type=give_forms&page=give-tools&tab=logs&form='.$post_id)).'">';
99
+					echo give_get_form_sales_stats($post_id);
100 100
 					echo '</a>';
101 101
 				} else {
102 102
 					echo '-';
103 103
 				}
104 104
 				break;
105 105
 			case 'earnings':
106
-				if ( current_user_can( 'view_give_form_stats', $post_id ) ) {
107
-					echo '<a href="' . esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-reports&view=forms&form-id=' . $post_id ) ) . '">';
108
-					echo give_currency_filter( give_format_amount( give_get_form_earnings_stats( $post_id ) ) );
106
+				if (current_user_can('view_give_form_stats', $post_id)) {
107
+					echo '<a href="'.esc_url(admin_url('edit.php?post_type=give_forms&page=give-reports&view=forms&form-id='.$post_id)).'">';
108
+					echo give_currency_filter(give_format_amount(give_get_form_earnings_stats($post_id)));
109 109
 					echo '</a>';
110 110
 				} else {
111 111
 					echo '-';
112 112
 				}
113 113
 				break;
114 114
 			case 'shortcode':
115
-				echo '<input onclick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly="" value="[give_form id=&#34;' . absint( $post_id ) . '&#34;]">';
115
+				echo '<input onclick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly="" value="[give_form id=&#34;'.absint($post_id).'&#34;]">';
116 116
 				break;
117 117
 		}
118 118
 	}
119 119
 }
120 120
 
121
-add_action( 'manage_posts_custom_column', 'give_render_form_columns', 10, 2 );
121
+add_action('manage_posts_custom_column', 'give_render_form_columns', 10, 2);
122 122
 
123 123
 /**
124 124
  * Registers the sortable columns in the list table
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
  *
130 130
  * @return array $columns Array of sortable columns
131 131
  */
132
-function give_sortable_form_columns( $columns ) {
132
+function give_sortable_form_columns($columns) {
133 133
 	$columns['price']     = 'amount';
134 134
 	$columns['sales']     = 'sales';
135 135
 	$columns['earnings']  = 'earnings';
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	return $columns;
140 140
 }
141 141
 
142
-add_filter( 'manage_edit-give_forms_sortable_columns', 'give_sortable_form_columns' );
142
+add_filter('manage_edit-give_forms_sortable_columns', 'give_sortable_form_columns');
143 143
 
144 144
 /**
145 145
  * Sorts Columns in the Forms List Table
@@ -150,13 +150,13 @@  discard block
 block discarded – undo
150 150
  *
151 151
  * @return array $vars Array of all the sort variables
152 152
  */
153
-function give_sort_forms( $vars ) {
153
+function give_sort_forms($vars) {
154 154
 	// Check if we're viewing the "give_forms" post type
155
-	if ( ! isset( $vars['post_type'] ) || ! isset( $vars['orderby'] ) || 'give_forms' !== $vars['post_type'] ) {
155
+	if ( ! isset($vars['post_type']) || ! isset($vars['orderby']) || 'give_forms' !== $vars['post_type']) {
156 156
 		return $vars;
157 157
 	}
158 158
 
159
-	switch ( $vars['orderby'] ) {
159
+	switch ($vars['orderby']) {
160 160
 		// Check if 'orderby' is set to "sales"
161 161
 		case 'sales':
162 162
 			$vars = array_merge(
@@ -225,16 +225,16 @@  discard block
 block discarded – undo
225 225
  *
226 226
  * @return array       Array of all sort variables
227 227
  */
228
-function give_filter_forms( $vars ) {
229
-	if ( isset( $vars['post_type'] ) && 'give_forms' == $vars['post_type'] ) {
228
+function give_filter_forms($vars) {
229
+	if (isset($vars['post_type']) && 'give_forms' == $vars['post_type']) {
230 230
 
231 231
 		// If an author ID was passed, use it
232
-		if ( isset( $_REQUEST['author'] ) && ! current_user_can( 'view_give_reports' ) ) {
232
+		if (isset($_REQUEST['author']) && ! current_user_can('view_give_reports')) {
233 233
 
234 234
 			$author_id = $_REQUEST['author'];
235
-			if ( (int) $author_id !== get_current_user_id() ) {
235
+			if ((int) $author_id !== get_current_user_id()) {
236 236
 				// Tried to view the products of another person, sorry
237
-				wp_die( esc_html__( 'You do not have permission to view this data.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) );
237
+				wp_die(esc_html__('You do not have permission to view this data.', 'give'), esc_html__('Error', 'give'), array('response' => 403));
238 238
 			}
239 239
 			$vars = array_merge(
240 240
 				$vars,
@@ -258,11 +258,11 @@  discard block
 block discarded – undo
258 258
  * @return void
259 259
  */
260 260
 function give_forms_load() {
261
-	add_filter( 'request', 'give_sort_forms' );
262
-	add_filter( 'request', 'give_filter_forms' );
261
+	add_filter('request', 'give_sort_forms');
262
+	add_filter('request', 'give_filter_forms');
263 263
 }
264 264
 
265
-add_action( 'load-edit.php', 'give_forms_load', 9999 );
265
+add_action('load-edit.php', 'give_forms_load', 9999);
266 266
 
267 267
 /**
268 268
  * Remove Forms Month Filter
@@ -276,17 +276,17 @@  discard block
 block discarded – undo
276 276
  * @global      $typenow The post type we are viewing
277 277
  * @return array Empty array disables the dropdown
278 278
  */
279
-function give_remove_month_filter( $dates ) {
279
+function give_remove_month_filter($dates) {
280 280
 	global $typenow;
281 281
 
282
-	if ( $typenow == 'give_forms' ) {
282
+	if ($typenow == 'give_forms') {
283 283
 		$dates = array();
284 284
 	}
285 285
 
286 286
 	return $dates;
287 287
 }
288 288
 
289
-add_filter( 'months_dropdown_results', 'give_remove_month_filter', 99 );
289
+add_filter('months_dropdown_results', 'give_remove_month_filter', 99);
290 290
 
291 291
 /**
292 292
  * Updates price when saving post
@@ -297,23 +297,23 @@  discard block
 block discarded – undo
297 297
  *
298 298
  * @return int|null
299 299
  */
300
-function give_price_save_quick_edit( $post_id ) {
301
-	if ( ! isset( $_POST['post_type'] ) || 'give_forms' !== $_POST['post_type'] ) {
300
+function give_price_save_quick_edit($post_id) {
301
+	if ( ! isset($_POST['post_type']) || 'give_forms' !== $_POST['post_type']) {
302 302
 		return;
303 303
 	}
304
-	if ( ! current_user_can( 'edit_post', $post_id ) ) {
304
+	if ( ! current_user_can('edit_post', $post_id)) {
305 305
 		return $post_id;
306 306
 	}
307
-	if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
307
+	if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
308 308
 		return $post_id;
309 309
 	}
310 310
 
311
-	if ( isset( $_REQUEST['_give_regprice'] ) ) {
312
-		update_post_meta( $post_id, '_give_set_price', strip_tags( stripslashes( $_REQUEST['_give_regprice'] ) ) );
311
+	if (isset($_REQUEST['_give_regprice'])) {
312
+		update_post_meta($post_id, '_give_set_price', strip_tags(stripslashes($_REQUEST['_give_regprice'])));
313 313
 	}
314 314
 }
315 315
 
316
-add_action( 'save_post', 'give_price_save_quick_edit' );
316
+add_action('save_post', 'give_price_save_quick_edit');
317 317
 
318 318
 /**
319 319
  * Process bulk edit actions via AJAX
@@ -323,18 +323,18 @@  discard block
 block discarded – undo
323 323
  */
324 324
 function give_save_bulk_edit() {
325 325
 
326
-	$post_ids = ( isset( $_POST['post_ids'] ) && ! empty( $_POST['post_ids'] ) ) ? $_POST['post_ids'] : array();
326
+	$post_ids = (isset($_POST['post_ids']) && ! empty($_POST['post_ids'])) ? $_POST['post_ids'] : array();
327 327
 
328
-	if ( ! empty( $post_ids ) && is_array( $post_ids ) ) {
329
-		$price = isset( $_POST['price'] ) ? strip_tags( stripslashes( $_POST['price'] ) ) : 0;
330
-		foreach ( $post_ids as $post_id ) {
328
+	if ( ! empty($post_ids) && is_array($post_ids)) {
329
+		$price = isset($_POST['price']) ? strip_tags(stripslashes($_POST['price'])) : 0;
330
+		foreach ($post_ids as $post_id) {
331 331
 
332
-			if ( ! current_user_can( 'edit_post', $post_id ) ) {
332
+			if ( ! current_user_can('edit_post', $post_id)) {
333 333
 				continue;
334 334
 			}
335 335
 
336
-			if ( ! empty( $price ) ) {
337
-				update_post_meta( $post_id, '_give_set_price', give_sanitize_amount( $price ) );
336
+			if ( ! empty($price)) {
337
+				update_post_meta($post_id, '_give_set_price', give_sanitize_amount($price));
338 338
 			}
339 339
 		}
340 340
 	}
@@ -342,4 +342,4 @@  discard block
 block discarded – undo
342 342
 	die();
343 343
 }
344 344
 
345
-add_action( 'wp_ajax_give_save_bulk_edit', 'give_save_bulk_edit' );
345
+add_action('wp_ajax_give_save_bulk_edit', 'give_save_bulk_edit');
Please login to merge, or discard this patch.
includes/admin/admin-footer.php 1 patch
Spacing   +6 added lines, -6 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
 
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
  *
25 25
  * @return      string
26 26
  */
27
-function give_admin_rate_us( $footer_text ) {
27
+function give_admin_rate_us($footer_text) {
28 28
 	global $typenow;
29 29
 
30
-	if ( $typenow == 'give_forms' ) {
30
+	if ($typenow == 'give_forms') {
31 31
 		$rate_text = sprintf(
32 32
 			/* translators: %s: Link to 5 star rating */
33
-			__( 'If you like <strong>Give</strong> please leave us a %s rating. It takes a minute and helps a lot. Thanks in advance!', 'give' ),
34
-			'<a href="https://wordpress.org/support/view/plugin-reviews/give?filter=5#postform" target="_blank" class="give-rating-link" style="text-decoration:none;" data-rated="' . esc_attr__( 'Thanks :)', 'give' ) . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
33
+			__('If you like <strong>Give</strong> please leave us a %s rating. It takes a minute and helps a lot. Thanks in advance!', 'give'),
34
+			'<a href="https://wordpress.org/support/view/plugin-reviews/give?filter=5#postform" target="_blank" class="give-rating-link" style="text-decoration:none;" data-rated="'.esc_attr__('Thanks :)', 'give').'">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
35 35
 		);
36 36
 
37 37
 		return $rate_text;
@@ -40,4 +40,4 @@  discard block
 block discarded – undo
40 40
 	}
41 41
 }
42 42
 
43
-add_filter( 'admin_footer_text', 'give_admin_rate_us' );
43
+add_filter('admin_footer_text', 'give_admin_rate_us');
Please login to merge, or discard this patch.
includes/admin/payments/class-payments-table.php 1 patch
Spacing   +186 added lines, -186 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  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
 
17 17
 // Load WP_List_Table if not loaded.
18
-if ( ! class_exists( 'WP_List_Table' ) ) {
19
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
18
+if ( ! class_exists('WP_List_Table')) {
19
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
20 20
 }
21 21
 
22 22
 /**
@@ -118,15 +118,15 @@  discard block
 block discarded – undo
118 118
 	public function __construct() {
119 119
 
120 120
 		// Set parent defaults.
121
-		parent::__construct( array(
122
-			'singular' => give_get_forms_label_singular(),    // Singular name of the listed records.
123
-			'plural'   => give_get_forms_label_plural(),      // Plural name of the listed records.
124
-			'ajax'     => false,                              // Does this table support ajax?
125
-		) );
121
+		parent::__construct(array(
122
+			'singular' => give_get_forms_label_singular(), // Singular name of the listed records.
123
+			'plural'   => give_get_forms_label_plural(), // Plural name of the listed records.
124
+			'ajax'     => false, // Does this table support ajax?
125
+		));
126 126
 
127 127
 		$this->get_payment_counts();
128 128
 		$this->process_bulk_action();
129
-		$this->base_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' );
129
+		$this->base_url = admin_url('edit.php?post_type=give_forms&page=give-payment-history');
130 130
 	}
131 131
 
132 132
 	/**
@@ -135,25 +135,25 @@  discard block
 block discarded – undo
135 135
 	 * @return void
136 136
 	 */
137 137
 	public function advanced_filters() {
138
-		$start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;
139
-		$end_date   = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : null;
140
-		$status     = isset( $_GET['status'] ) ? $_GET['status'] : '';
138
+		$start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;
139
+		$end_date   = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : null;
140
+		$status     = isset($_GET['status']) ? $_GET['status'] : '';
141 141
 		?>
142 142
 		<div id="give-payment-filters">
143 143
 			<span id="give-payment-date-filters">
144
-				<label for="start-date" class="give-start-date-label"><?php esc_html_e( 'Start Date:', 'give' ); ?></label>
144
+				<label for="start-date" class="give-start-date-label"><?php esc_html_e('Start Date:', 'give'); ?></label>
145 145
 				<input type="text" id="start-date" name="start-date" class="give_datepicker" value="<?php echo $start_date; ?>" placeholder="mm/dd/yyyy"/>
146
-				<label for="end-date" class="give-end-date-label"><?php esc_html_e( 'End Date:', 'give' ); ?></label>
146
+				<label for="end-date" class="give-end-date-label"><?php esc_html_e('End Date:', 'give'); ?></label>
147 147
 				<input type="text" id="end-date" name="end-date" class="give_datepicker" value="<?php echo $end_date; ?>" placeholder="mm/dd/yyyy"/>
148
-				<input type="submit" class="button-secondary" value="<?php esc_attr_e( 'Apply', 'give' ); ?>"/>
148
+				<input type="submit" class="button-secondary" value="<?php esc_attr_e('Apply', 'give'); ?>"/>
149 149
 			</span>
150
-			<?php if ( ! empty( $status ) ) : ?>
151
-				<input type="hidden" name="status" value="<?php echo esc_attr( $status ); ?>"/>
150
+			<?php if ( ! empty($status)) : ?>
151
+				<input type="hidden" name="status" value="<?php echo esc_attr($status); ?>"/>
152 152
 			<?php endif; ?>
153
-			<?php if ( ! empty( $start_date ) || ! empty( $end_date ) ) : ?>
154
-				<a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history' ); ?>" class="button-secondary"><?php esc_html_e( 'Clear Filter', 'give' ); ?></a>
153
+			<?php if ( ! empty($start_date) || ! empty($end_date)) : ?>
154
+				<a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history'); ?>" class="button-secondary"><?php esc_html_e('Clear Filter', 'give'); ?></a>
155 155
 			<?php endif; ?>
156
-			<?php $this->search_box( esc_html__( 'Search', 'give' ), 'give-payments' ); ?>
156
+			<?php $this->search_box(esc_html__('Search', 'give'), 'give-payments'); ?>
157 157
 		</div>
158 158
 
159 159
 		<?php
@@ -170,18 +170,18 @@  discard block
 block discarded – undo
170 170
 	 *
171 171
 	 * @return void
172 172
 	 */
173
-	public function search_box( $text, $input_id ) {
174
-		if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
173
+	public function search_box($text, $input_id) {
174
+		if (empty($_REQUEST['s']) && ! $this->has_items()) {
175 175
 			return;
176 176
 		}
177 177
 
178
-		$input_id = $input_id . '-search-input';
178
+		$input_id = $input_id.'-search-input';
179 179
 
180
-		if ( ! empty( $_REQUEST['orderby'] ) ) {
181
-			echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
180
+		if ( ! empty($_REQUEST['orderby'])) {
181
+			echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />';
182 182
 		}
183
-		if ( ! empty( $_REQUEST['order'] ) ) {
184
-			echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
183
+		if ( ! empty($_REQUEST['order'])) {
184
+			echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />';
185 185
 		}
186 186
 		?>
187 187
 		<p class="search-box" role="search">
@@ -193,11 +193,11 @@  discard block
 block discarded – undo
193 193
 			 *
194 194
 			 * @since 1.7
195 195
 			 */
196
-			do_action( 'give_payment_history_search' );
196
+			do_action('give_payment_history_search');
197 197
 			?>
198 198
 			<label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
199 199
 			<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/>
200
-			<?php submit_button( $text, 'button', false, false, array( 'ID' => 'search-submit' ) ); ?><br/>
200
+			<?php submit_button($text, 'button', false, false, array('ID' => 'search-submit')); ?><br/>
201 201
 		</p>
202 202
 		<?php
203 203
 	}
@@ -211,52 +211,52 @@  discard block
 block discarded – undo
211 211
 	 */
212 212
 	public function get_views() {
213 213
 
214
-		$current         = isset( $_GET['status'] ) ? $_GET['status'] : '';
215
-		$total_count     = '&nbsp;<span class="count">(' . $this->total_count . ')</span>';
216
-		$complete_count  = '&nbsp;<span class="count">(' . $this->complete_count . ')</span>';
217
-		$cancelled_count = '&nbsp;<span class="count">(' . $this->cancelled_count . ')</span>';
218
-		$pending_count   = '&nbsp;<span class="count">(' . $this->pending_count . ')</span>';
219
-		$refunded_count  = '&nbsp;<span class="count">(' . $this->refunded_count . ')</span>';
220
-		$failed_count    = '&nbsp;<span class="count">(' . $this->failed_count . ')</span>';
221
-		$abandoned_count = '&nbsp;<span class="count">(' . $this->abandoned_count . ')</span>';
222
-		$revoked_count   = '&nbsp;<span class="count">(' . $this->revoked_count . ')</span>';
214
+		$current         = isset($_GET['status']) ? $_GET['status'] : '';
215
+		$total_count     = '&nbsp;<span class="count">('.$this->total_count.')</span>';
216
+		$complete_count  = '&nbsp;<span class="count">('.$this->complete_count.')</span>';
217
+		$cancelled_count = '&nbsp;<span class="count">('.$this->cancelled_count.')</span>';
218
+		$pending_count   = '&nbsp;<span class="count">('.$this->pending_count.')</span>';
219
+		$refunded_count  = '&nbsp;<span class="count">('.$this->refunded_count.')</span>';
220
+		$failed_count    = '&nbsp;<span class="count">('.$this->failed_count.')</span>';
221
+		$abandoned_count = '&nbsp;<span class="count">('.$this->abandoned_count.')</span>';
222
+		$revoked_count   = '&nbsp;<span class="count">('.$this->revoked_count.')</span>';
223 223
 
224 224
 		$views = array(
225
-			'all'       => sprintf( '<a href="%s"%s>%s</a>', remove_query_arg( array(
225
+			'all'       => sprintf('<a href="%s"%s>%s</a>', remove_query_arg(array(
226 226
 				'status',
227 227
 				'paged',
228
-			) ), $current === 'all' || $current == '' ? ' class="current"' : '', esc_html__( 'All', 'give' ) . $total_count ),
229
-			'publish'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
228
+			)), $current === 'all' || $current == '' ? ' class="current"' : '', esc_html__('All', 'give').$total_count),
229
+			'publish'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
230 230
 				'status' => 'publish',
231 231
 				'paged'  => false,
232
-			) ) ), $current === 'publish' ? ' class="current"' : '', esc_html__( 'Completed', 'give' ) . $complete_count ),
233
-			'pending'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
232
+			))), $current === 'publish' ? ' class="current"' : '', esc_html__('Completed', 'give').$complete_count),
233
+			'pending'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
234 234
 				'status' => 'pending',
235 235
 				'paged'  => false,
236
-			) ) ), $current === 'pending' ? ' class="current"' : '', esc_html__( 'Pending', 'give' ) . $pending_count ),
237
-			'refunded'  => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
236
+			))), $current === 'pending' ? ' class="current"' : '', esc_html__('Pending', 'give').$pending_count),
237
+			'refunded'  => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
238 238
 				'status' => 'refunded',
239 239
 				'paged'  => false,
240
-			) ) ), $current === 'refunded' ? ' class="current"' : '', esc_html__( 'Refunded', 'give' ) . $refunded_count ),
241
-			'revoked'   => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
240
+			))), $current === 'refunded' ? ' class="current"' : '', esc_html__('Refunded', 'give').$refunded_count),
241
+			'revoked'   => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
242 242
 				'status' => 'revoked',
243 243
 				'paged'  => false,
244
-			) ) ), $current === 'revoked' ? ' class="current"' : '', esc_html__( 'Revoked', 'give' ) . $revoked_count ),
245
-			'failed'    => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
244
+			))), $current === 'revoked' ? ' class="current"' : '', esc_html__('Revoked', 'give').$revoked_count),
245
+			'failed'    => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
246 246
 				'status' => 'failed',
247 247
 				'paged'  => false,
248
-			) ) ), $current === 'failed' ? ' class="current"' : '', esc_html__( 'Failed', 'give' ) . $failed_count ),
249
-			'cancelled' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
248
+			))), $current === 'failed' ? ' class="current"' : '', esc_html__('Failed', 'give').$failed_count),
249
+			'cancelled' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
250 250
 				'status' => 'cancelled',
251 251
 				'paged'  => false,
252
-			) ) ), $current === 'cancelled' ? ' class="current"' : '', esc_html__( 'Cancelled', 'give' ) . $cancelled_count ),
253
-			'abandoned' => sprintf( '<a href="%s"%s>%s</a>', esc_url( add_query_arg( array(
252
+			))), $current === 'cancelled' ? ' class="current"' : '', esc_html__('Cancelled', 'give').$cancelled_count),
253
+			'abandoned' => sprintf('<a href="%s"%s>%s</a>', esc_url(add_query_arg(array(
254 254
 				'status' => 'abandoned',
255 255
 				'paged'  => false,
256
-			) ) ), $current === 'abandoned' ? ' class="current"' : '', esc_html__( 'Abandoned', 'give' ) . $abandoned_count ),
256
+			))), $current === 'abandoned' ? ' class="current"' : '', esc_html__('Abandoned', 'give').$abandoned_count),
257 257
 		);
258 258
 
259
-		return apply_filters( 'give_payments_table_views', $views );
259
+		return apply_filters('give_payments_table_views', $views);
260 260
 	}
261 261
 
262 262
 	/**
@@ -269,15 +269,15 @@  discard block
 block discarded – undo
269 269
 	public function get_columns() {
270 270
 		$columns = array(
271 271
 			'cb'            => '<input type="checkbox" />', // Render a checkbox instead of text.
272
-			'donation'      => esc_html__( 'Donation', 'give' ),
273
-			'donation_form' => esc_html__( 'Donation Form', 'give' ),
274
-			'status'        => esc_html__( 'Status', 'give' ),
275
-			'date'          => esc_html__( 'Date', 'give' ),
276
-			'amount'        => esc_html__( 'Amount', 'give' ),
277
-			'details'       => esc_html__( 'Details', 'give' ),
272
+			'donation'      => esc_html__('Donation', 'give'),
273
+			'donation_form' => esc_html__('Donation Form', 'give'),
274
+			'status'        => esc_html__('Status', 'give'),
275
+			'date'          => esc_html__('Date', 'give'),
276
+			'amount'        => esc_html__('Amount', 'give'),
277
+			'details'       => esc_html__('Details', 'give'),
278 278
 		);
279 279
 
280
-		return apply_filters( 'give_payments_table_columns', $columns );
280
+		return apply_filters('give_payments_table_columns', $columns);
281 281
 	}
282 282
 
283 283
 	/**
@@ -289,14 +289,14 @@  discard block
 block discarded – undo
289 289
 	 */
290 290
 	public function get_sortable_columns() {
291 291
 		$columns = array(
292
-			'donation'      => array( 'ID', true ),
293
-			'donation_form' => array( 'donation_form', false ),
294
-			'status'        => array( 'status', false ),
295
-			'amount'        => array( 'amount', false ),
296
-			'date'          => array( 'date', false ),
292
+			'donation'      => array('ID', true),
293
+			'donation_form' => array('donation_form', false),
294
+			'status'        => array('status', false),
295
+			'amount'        => array('amount', false),
296
+			'date'          => array('date', false),
297 297
 		);
298 298
 
299
-		return apply_filters( 'give_payments_table_sortable_columns', $columns );
299
+		return apply_filters('give_payments_table_sortable_columns', $columns);
300 300
 	}
301 301
 
302 302
 	/**
@@ -322,65 +322,65 @@  discard block
 block discarded – undo
322 322
 	 *
323 323
 	 * @return string Column Name
324 324
 	 */
325
-	public function column_default( $payment, $column_name ) {
325
+	public function column_default($payment, $column_name) {
326 326
 
327
-		$single_donation_url = esc_url( add_query_arg( 'id', $payment->ID, admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details' ) ) );
328
-		$row_actions         = $this->get_row_actions( $payment );
327
+		$single_donation_url = esc_url(add_query_arg('id', $payment->ID, admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details')));
328
+		$row_actions         = $this->get_row_actions($payment);
329 329
 
330
-		switch ( $column_name ) {
330
+		switch ($column_name) {
331 331
 			case 'donation' :
332 332
 				$value = sprintf(
333 333
 					'<a href="%1$s" data-tooltip="%2$s">#%3$s</a>&nbsp;%4$s&nbsp;%5$s<br>',
334 334
 					$single_donation_url,
335
-					sprintf( esc_attr__( 'View Donation %s', 'give' ), $payment->ID ),
335
+					sprintf(esc_attr__('View Donation %s', 'give'), $payment->ID),
336 336
 					$payment->ID,
337
-					esc_html__( 'by', 'give' ),
338
-					$this->get_donor( $payment )
337
+					esc_html__('by', 'give'),
338
+					$this->get_donor($payment)
339 339
 				);
340
-				$value .= $this->get_donor_email( $payment );
341
-				$value .= $this->row_actions( $row_actions );
340
+				$value .= $this->get_donor_email($payment);
341
+				$value .= $this->row_actions($row_actions);
342 342
 				break;
343 343
 
344 344
 			case 'amount' :
345
-				$amount = ! empty( $payment->total ) ? $payment->total : 0;
346
-				$value  = give_currency_filter( give_format_amount( $amount ), give_get_payment_currency_code( $payment->ID ) );
345
+				$amount = ! empty($payment->total) ? $payment->total : 0;
346
+				$value  = give_currency_filter(give_format_amount($amount), give_get_payment_currency_code($payment->ID));
347 347
 				break;
348 348
 
349 349
 			case 'donation_form' :
350
-				$form_title = empty( $payment->form_title ) ? sprintf( __( 'Untitled (#%s)', 'give' ), $payment->form_id ) : $payment->form_title;
351
-				$value      = '<a href="' . admin_url( 'post.php?post=' . $payment->form_id . '&action=edit' ) . '">' . $form_title . '</a>';
352
-				$level      = give_get_payment_form_title( $payment->meta, true );
350
+				$form_title = empty($payment->form_title) ? sprintf(__('Untitled (#%s)', 'give'), $payment->form_id) : $payment->form_title;
351
+				$value      = '<a href="'.admin_url('post.php?post='.$payment->form_id.'&action=edit').'">'.$form_title.'</a>';
352
+				$level      = give_get_payment_form_title($payment->meta, true);
353 353
 
354
-				if ( ! empty( $level ) ) {
354
+				if ( ! empty($level)) {
355 355
 					$value .= $level;
356 356
 				}
357 357
 
358 358
 				break;
359 359
 
360 360
 			case 'date' :
361
-				$date  = strtotime( $payment->date );
362
-				$value = date_i18n( give_date_format(), $date );
361
+				$date  = strtotime($payment->date);
362
+				$value = date_i18n(give_date_format(), $date);
363 363
 				break;
364 364
 
365 365
 			case 'status' :
366
-				$value = $this->get_payment_status( $payment );
366
+				$value = $this->get_payment_status($payment);
367 367
 				break;
368 368
 
369 369
 			case 'details' :
370 370
 				$value = sprintf(
371 371
 					'<div class="give-payment-details-link-wrap"><a href="%1$s" class="give-payment-details-link button button-small" data-tooltip="%2$s" aria-label="%2$s"><span class="dashicons dashicons-visibility"></span></a></div>',
372 372
 					$single_donation_url,
373
-					sprintf( esc_attr__( 'View Donation %s', 'give' ), $payment->ID )
373
+					sprintf(esc_attr__('View Donation %s', 'give'), $payment->ID)
374 374
 				);
375 375
 				break;
376 376
 
377 377
 			default:
378
-				$value = isset( $payment->$column_name ) ? $payment->$column_name : '';
378
+				$value = isset($payment->$column_name) ? $payment->$column_name : '';
379 379
 				break;
380 380
 
381 381
 		}
382 382
 
383
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, $column_name );
383
+		return apply_filters('give_payments_table_column', $value, $payment->ID, $column_name);
384 384
 	}
385 385
 
386 386
 	/**
@@ -393,17 +393,17 @@  discard block
 block discarded – undo
393 393
 	 *
394 394
 	 * @return string                Data shown in the Email column
395 395
 	 */
396
-	public function get_donor_email( $payment ) {
396
+	public function get_donor_email($payment) {
397 397
 
398
-		$email = give_get_payment_user_email( $payment->ID );
398
+		$email = give_get_payment_user_email($payment->ID);
399 399
 
400
-		if ( empty( $email ) ) {
401
-			$email = esc_html__( '(unknown)', 'give' );
400
+		if (empty($email)) {
401
+			$email = esc_html__('(unknown)', 'give');
402 402
 		}
403 403
 
404
-		$value = '<a href="mailto:' . $email . '" data-tooltip="' . esc_attr__( 'Email donor', 'give' ) . '">' . $email . '</a>';
404
+		$value = '<a href="mailto:'.$email.'" data-tooltip="'.esc_attr__('Email donor', 'give').'">'.$email.'</a>';
405 405
 
406
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'email' );
406
+		return apply_filters('give_payments_table_column', $value, $payment->ID, 'email');
407 407
 	}
408 408
 
409 409
 	/**
@@ -415,18 +415,18 @@  discard block
 block discarded – undo
415 415
 	 *
416 416
 	 * @return mixed|void
417 417
 	 */
418
-	function get_row_actions( $payment ) {
418
+	function get_row_actions($payment) {
419 419
 
420 420
 		$actions = array();
421
-		$email   = give_get_payment_user_email( $payment->ID );
421
+		$email   = give_get_payment_user_email($payment->ID);
422 422
 
423 423
 		// Add search term string back to base URL.
424
-		$search_terms = ( isset( $_GET['s'] ) ? trim( $_GET['s'] ) : '' );
425
-		if ( ! empty( $search_terms ) ) {
426
-			$this->base_url = add_query_arg( 's', $search_terms, $this->base_url );
424
+		$search_terms = (isset($_GET['s']) ? trim($_GET['s']) : '');
425
+		if ( ! empty($search_terms)) {
426
+			$this->base_url = add_query_arg('s', $search_terms, $this->base_url);
427 427
 		}
428 428
 
429
-		if ( give_is_payment_complete( $payment->ID ) && ! empty( $email ) ) {
429
+		if (give_is_payment_complete($payment->ID) && ! empty($email)) {
430 430
 
431 431
 			$actions['email_links'] = sprintf(
432 432
 				'<a href="%1$s" aria-label="%2$s">%3$s</a>',
@@ -440,8 +440,8 @@  discard block
 block discarded – undo
440 440
 					),
441 441
 					'give_payment_nonce'
442 442
 				),
443
-				sprintf( esc_attr__( 'Resend Donation %s Receipt', 'give' ), $payment->ID ),
444
-				esc_html__( 'Resend Receipt', 'give' )
443
+				sprintf(esc_attr__('Resend Donation %s Receipt', 'give'), $payment->ID),
444
+				esc_html__('Resend Receipt', 'give')
445 445
 			);
446 446
 
447 447
 		}
@@ -458,11 +458,11 @@  discard block
 block discarded – undo
458 458
 				),
459 459
 				'give_donation_nonce'
460 460
 			),
461
-			sprintf( esc_attr__( 'Delete Donation %s', 'give' ), $payment->ID ),
462
-			esc_html__( 'Delete', 'give' )
461
+			sprintf(esc_attr__('Delete Donation %s', 'give'), $payment->ID),
462
+			esc_html__('Delete', 'give')
463 463
 		);
464 464
 
465
-		return apply_filters( 'give_payment_row_actions', $actions, $payment );
465
+		return apply_filters('give_payment_row_actions', $actions, $payment);
466 466
 	}
467 467
 
468 468
 
@@ -476,10 +476,10 @@  discard block
 block discarded – undo
476 476
 	 *
477 477
 	 * @return string                Data shown in the Email column
478 478
 	 */
479
-	function get_payment_status( $payment ) {
480
-		$value = '<div class="give-donation-status status-' . sanitize_title( give_get_payment_status( $payment, true ) ) . '"><span class="give-donation-status-icon"></span> ' . give_get_payment_status( $payment, true ) . '</div>';
481
-		if ( $payment->mode == 'test' ) {
482
-			$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="' . esc_attr__( 'This donation was made in test mode.', 'give' ) . '">' . esc_html__( 'Test', 'give' ) . '</span>';
479
+	function get_payment_status($payment) {
480
+		$value = '<div class="give-donation-status status-'.sanitize_title(give_get_payment_status($payment, true)).'"><span class="give-donation-status-icon"></span> '.give_get_payment_status($payment, true).'</div>';
481
+		if ($payment->mode == 'test') {
482
+			$value .= ' <span class="give-item-label give-item-label-orange give-test-mode-transactions-label" data-tooltip="'.esc_attr__('This donation was made in test mode.', 'give').'">'.esc_html__('Test', 'give').'</span>';
483 483
 		}
484 484
 
485 485
 		return $value;
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 	 *
496 496
 	 * @return string Displays a checkbox.
497 497
 	 */
498
-	public function column_cb( $payment ) {
498
+	public function column_cb($payment) {
499 499
 		return sprintf(
500 500
 			'<input type="checkbox" name="%1$s[]" value="%2$s" />',
501 501
 			'payment',
@@ -513,8 +513,8 @@  discard block
 block discarded – undo
513 513
 	 *
514 514
 	 * @return string Displays a checkbox.
515 515
 	 */
516
-	public function get_payment_id( $payment ) {
517
-		return '<span class="give-payment-id">' . give_get_payment_number( $payment->ID ) . '</span>';
516
+	public function get_payment_id($payment) {
517
+		return '<span class="give-payment-id">'.give_get_payment_number($payment->ID).'</span>';
518 518
 	}
519 519
 
520 520
 	/**
@@ -527,19 +527,19 @@  discard block
 block discarded – undo
527 527
 	 *
528 528
 	 * @return string Data shown in the User column
529 529
 	 */
530
-	public function get_donor( $payment ) {
530
+	public function get_donor($payment) {
531 531
 
532
-		$customer_id = give_get_payment_customer_id( $payment->ID );
532
+		$customer_id = give_get_payment_customer_id($payment->ID);
533 533
 
534
-		if ( ! empty( $customer_id ) ) {
535
-			$customer = new Give_Customer( $customer_id );
536
-			$value    = '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-donors&view=overview&id=$customer_id" ) ) . '">' . $customer->name . '</a>';
534
+		if ( ! empty($customer_id)) {
535
+			$customer = new Give_Customer($customer_id);
536
+			$value    = '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-donors&view=overview&id=$customer_id")).'">'.$customer->name.'</a>';
537 537
 		} else {
538
-			$email = give_get_payment_user_email( $payment->ID );
539
-			$value = '<a href="' . esc_url( admin_url( "edit.php?post_type=give_forms&page=give-payment-history&s=$email" ) ) . '">' . esc_html__( '(donor missing)', 'give' ) . '</a>';
538
+			$email = give_get_payment_user_email($payment->ID);
539
+			$value = '<a href="'.esc_url(admin_url("edit.php?post_type=give_forms&page=give-payment-history&s=$email")).'">'.esc_html__('(donor missing)', 'give').'</a>';
540 540
 		}
541 541
 
542
-		return apply_filters( 'give_payments_table_column', $value, $payment->ID, 'donor' );
542
+		return apply_filters('give_payments_table_column', $value, $payment->ID, 'donor');
543 543
 	}
544 544
 
545 545
 	/**
@@ -551,18 +551,18 @@  discard block
 block discarded – undo
551 551
 	 */
552 552
 	public function get_bulk_actions() {
553 553
 		$actions = array(
554
-			'delete'               => esc_html__( 'Delete', 'give' ),
555
-			'set-status-publish'   => esc_html__( 'Set To Completed', 'give' ),
556
-			'set-status-pending'   => esc_html__( 'Set To Pending', 'give' ),
557
-			'set-status-refunded'  => esc_html__( 'Set To Refunded', 'give' ),
558
-			'set-status-revoked'   => esc_html__( 'Set To Revoked', 'give' ),
559
-			'set-status-failed'    => esc_html__( 'Set To Failed', 'give' ),
560
-			'set-status-cancelled' => esc_html__( 'Set To Cancelled', 'give' ),
561
-			'set-status-abandoned' => esc_html__( 'Set To Abandoned', 'give' ),
562
-			'resend-receipt'       => esc_html__( 'Resend Email Receipts', 'give' ),
554
+			'delete'               => esc_html__('Delete', 'give'),
555
+			'set-status-publish'   => esc_html__('Set To Completed', 'give'),
556
+			'set-status-pending'   => esc_html__('Set To Pending', 'give'),
557
+			'set-status-refunded'  => esc_html__('Set To Refunded', 'give'),
558
+			'set-status-revoked'   => esc_html__('Set To Revoked', 'give'),
559
+			'set-status-failed'    => esc_html__('Set To Failed', 'give'),
560
+			'set-status-cancelled' => esc_html__('Set To Cancelled', 'give'),
561
+			'set-status-abandoned' => esc_html__('Set To Abandoned', 'give'),
562
+			'resend-receipt'       => esc_html__('Resend Email Receipts', 'give'),
563 563
 		);
564 564
 
565
-		return apply_filters( 'give_payments_table_bulk_actions', $actions );
565
+		return apply_filters('give_payments_table_bulk_actions', $actions);
566 566
 	}
567 567
 
568 568
 	/**
@@ -573,59 +573,59 @@  discard block
 block discarded – undo
573 573
 	 * @return void
574 574
 	 */
575 575
 	public function process_bulk_action() {
576
-		$ids    = isset( $_GET['payment'] ) ? $_GET['payment'] : false;
576
+		$ids    = isset($_GET['payment']) ? $_GET['payment'] : false;
577 577
 		$action = $this->current_action();
578 578
 
579
-		if ( ! is_array( $ids ) ) {
580
-			$ids = array( $ids );
579
+		if ( ! is_array($ids)) {
580
+			$ids = array($ids);
581 581
 		}
582 582
 
583
-		if ( empty( $action ) ) {
583
+		if (empty($action)) {
584 584
 			return;
585 585
 		}
586 586
 
587
-		foreach ( $ids as $id ) {
587
+		foreach ($ids as $id) {
588 588
 
589 589
 			// Detect when a bulk action is being triggered.
590
-			switch ( $this->current_action() ) {
590
+			switch ($this->current_action()) {
591 591
 
592 592
 				case'delete':
593
-					give_delete_purchase( $id );
593
+					give_delete_purchase($id);
594 594
 					break;
595 595
 
596 596
 				case 'set-status-publish':
597
-					give_update_payment_status( $id, 'publish' );
597
+					give_update_payment_status($id, 'publish');
598 598
 					break;
599 599
 
600 600
 				case 'set-status-pending':
601
-					give_update_payment_status( $id, 'pending' );
601
+					give_update_payment_status($id, 'pending');
602 602
 					break;
603 603
 
604 604
 				case 'set-status-refunded':
605
-					give_update_payment_status( $id, 'refunded' );
605
+					give_update_payment_status($id, 'refunded');
606 606
 					break;
607 607
 				case 'set-status-revoked':
608
-					give_update_payment_status( $id, 'revoked' );
608
+					give_update_payment_status($id, 'revoked');
609 609
 					break;
610 610
 
611 611
 				case 'set-status-failed':
612
-					give_update_payment_status( $id, 'failed' );
612
+					give_update_payment_status($id, 'failed');
613 613
 					break;
614 614
 
615 615
 				case 'set-status-cancelled':
616
-					give_update_payment_status( $id, 'cancelled' );
616
+					give_update_payment_status($id, 'cancelled');
617 617
 					break;
618 618
 
619 619
 				case 'set-status-abandoned':
620
-					give_update_payment_status( $id, 'abandoned' );
620
+					give_update_payment_status($id, 'abandoned');
621 621
 					break;
622 622
 
623 623
 				case 'set-status-preapproval':
624
-					give_update_payment_status( $id, 'preapproval' );
624
+					give_update_payment_status($id, 'preapproval');
625 625
 					break;
626 626
 
627 627
 				case 'resend-receipt':
628
-					give_email_donation_receipt( $id, false );
628
+					give_email_donation_receipt($id, false);
629 629
 					break;
630 630
 			}
631 631
 
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
 			 * @param int    $id             The ID of the payment.
638 638
 			 * @param string $current_action The action that is being triggered.
639 639
 			 */
640
-			do_action( 'give_payments_table_do_bulk_action', $id, $this->current_action() );
640
+			do_action('give_payments_table_do_bulk_action', $id, $this->current_action());
641 641
 		}
642 642
 
643 643
 	}
@@ -653,27 +653,27 @@  discard block
 block discarded – undo
653 653
 
654 654
 		$args = array();
655 655
 
656
-		if ( isset( $_GET['user'] ) ) {
657
-			$args['user'] = urldecode( $_GET['user'] );
658
-		} elseif ( isset( $_GET['s'] ) ) {
659
-			$is_user = strpos( $_GET['s'], strtolower( 'user:' ) ) !== false;
660
-			if ( $is_user ) {
661
-				$args['user'] = absint( trim( str_replace( 'user:', '', strtolower( $_GET['s'] ) ) ) );
662
-				unset( $args['s'] );
656
+		if (isset($_GET['user'])) {
657
+			$args['user'] = urldecode($_GET['user']);
658
+		} elseif (isset($_GET['s'])) {
659
+			$is_user = strpos($_GET['s'], strtolower('user:')) !== false;
660
+			if ($is_user) {
661
+				$args['user'] = absint(trim(str_replace('user:', '', strtolower($_GET['s']))));
662
+				unset($args['s']);
663 663
 			} else {
664
-				$args['s'] = sanitize_text_field( $_GET['s'] );
664
+				$args['s'] = sanitize_text_field($_GET['s']);
665 665
 			}
666 666
 		}
667 667
 
668
-		if ( ! empty( $_GET['start-date'] ) ) {
669
-			$args['start-date'] = urldecode( $_GET['start-date'] );
668
+		if ( ! empty($_GET['start-date'])) {
669
+			$args['start-date'] = urldecode($_GET['start-date']);
670 670
 		}
671 671
 
672
-		if ( ! empty( $_GET['end-date'] ) ) {
673
-			$args['end-date'] = urldecode( $_GET['end-date'] );
672
+		if ( ! empty($_GET['end-date'])) {
673
+			$args['end-date'] = urldecode($_GET['end-date']);
674 674
 		}
675 675
 
676
-		$payment_count         = give_count_payments( $args );
676
+		$payment_count         = give_count_payments($args);
677 677
 		$this->complete_count  = $payment_count->publish;
678 678
 		$this->pending_count   = $payment_count->pending;
679 679
 		$this->refunded_count  = $payment_count->refunded;
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 		$this->cancelled_count = $payment_count->cancelled;
683 683
 		$this->abandoned_count = $payment_count->abandoned;
684 684
 
685
-		foreach ( $payment_count as $count ) {
685
+		foreach ($payment_count as $count) {
686 686
 			$this->total_count += $count;
687 687
 		}
688 688
 	}
@@ -697,26 +697,26 @@  discard block
 block discarded – undo
697 697
 	public function payments_data() {
698 698
 
699 699
 		$per_page   = $this->per_page;
700
-		$orderby    = isset( $_GET['orderby'] ) ? urldecode( $_GET['orderby'] ) : 'ID';
701
-		$order      = isset( $_GET['order'] ) ? $_GET['order'] : 'DESC';
702
-		$user       = isset( $_GET['user'] ) ? $_GET['user'] : null;
703
-		$status     = isset( $_GET['status'] ) ? $_GET['status'] : give_get_payment_status_keys();
704
-		$meta_key   = isset( $_GET['meta_key'] ) ? $_GET['meta_key'] : null;
705
-		$year       = isset( $_GET['year'] ) ? $_GET['year'] : null;
706
-		$month      = isset( $_GET['m'] ) ? $_GET['m'] : null;
707
-		$day        = isset( $_GET['day'] ) ? $_GET['day'] : null;
708
-		$search     = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : null;
709
-		$start_date = isset( $_GET['start-date'] ) ? sanitize_text_field( $_GET['start-date'] ) : null;
710
-		$end_date   = isset( $_GET['end-date'] ) ? sanitize_text_field( $_GET['end-date'] ) : $start_date;
711
-
712
-		if ( ! empty( $search ) ) {
700
+		$orderby    = isset($_GET['orderby']) ? urldecode($_GET['orderby']) : 'ID';
701
+		$order      = isset($_GET['order']) ? $_GET['order'] : 'DESC';
702
+		$user       = isset($_GET['user']) ? $_GET['user'] : null;
703
+		$status     = isset($_GET['status']) ? $_GET['status'] : give_get_payment_status_keys();
704
+		$meta_key   = isset($_GET['meta_key']) ? $_GET['meta_key'] : null;
705
+		$year       = isset($_GET['year']) ? $_GET['year'] : null;
706
+		$month      = isset($_GET['m']) ? $_GET['m'] : null;
707
+		$day        = isset($_GET['day']) ? $_GET['day'] : null;
708
+		$search     = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : null;
709
+		$start_date = isset($_GET['start-date']) ? sanitize_text_field($_GET['start-date']) : null;
710
+		$end_date   = isset($_GET['end-date']) ? sanitize_text_field($_GET['end-date']) : $start_date;
711
+
712
+		if ( ! empty($search)) {
713 713
 			$status = 'any'; // Force all payment statuses when searching.
714 714
 		}
715 715
 
716 716
 		$args = array(
717 717
 			'output'     => 'payments',
718 718
 			'number'     => $per_page,
719
-			'page'       => isset( $_GET['paged'] ) ? $_GET['paged'] : null,
719
+			'page'       => isset($_GET['paged']) ? $_GET['paged'] : null,
720 720
 			'orderby'    => $orderby,
721 721
 			'order'      => $order,
722 722
 			'user'       => $user,
@@ -730,14 +730,14 @@  discard block
 block discarded – undo
730 730
 			'end_date'   => $end_date,
731 731
 		);
732 732
 
733
-		if ( is_string( $search ) && false !== strpos( $search, 'txn:' ) ) {
733
+		if (is_string($search) && false !== strpos($search, 'txn:')) {
734 734
 
735 735
 			$args['search_in_notes'] = true;
736
-			$args['s']               = trim( str_replace( 'txn:', '', $args['s'] ) );
736
+			$args['s']               = trim(str_replace('txn:', '', $args['s']));
737 737
 
738 738
 		}
739 739
 
740
-		$p_query = new Give_Payments_Query( $args );
740
+		$p_query = new Give_Payments_Query($args);
741 741
 
742 742
 		return $p_query->get_payments();
743 743
 
@@ -757,17 +757,17 @@  discard block
 block discarded – undo
757 757
 	 */
758 758
 	public function prepare_items() {
759 759
 
760
-		wp_reset_vars( array( 'action', 'payment', 'orderby', 'order', 's' ) );
760
+		wp_reset_vars(array('action', 'payment', 'orderby', 'order', 's'));
761 761
 
762 762
 		$columns  = $this->get_columns();
763 763
 		$hidden   = array(); // No hidden columns.
764 764
 		$sortable = $this->get_sortable_columns();
765 765
 		$data     = $this->payments_data();
766
-		$status   = isset( $_GET['status'] ) ? $_GET['status'] : 'any';
766
+		$status   = isset($_GET['status']) ? $_GET['status'] : 'any';
767 767
 
768
-		$this->_column_headers = array( $columns, $hidden, $sortable );
768
+		$this->_column_headers = array($columns, $hidden, $sortable);
769 769
 
770
-		switch ( $status ) {
770
+		switch ($status) {
771 771
 			case 'publish':
772 772
 				$total_items = $this->complete_count;
773 773
 				break;
@@ -794,19 +794,19 @@  discard block
 block discarded – undo
794 794
 				break;
795 795
 			default:
796 796
 				// Retrieve the count of the non-default-Give status.
797
-				$count       = wp_count_posts( 'give_payment' );
797
+				$count       = wp_count_posts('give_payment');
798 798
 				$total_items = $count->{$status};
799 799
 				break;
800 800
 		}
801 801
 
802 802
 		$this->items = $data;
803 803
 
804
-		$this->set_pagination_args( array(
804
+		$this->set_pagination_args(array(
805 805
 				'total_items' => $total_items,
806 806
 				// We have to calculate the total number of items.
807 807
 				'per_page'    => $this->per_page,
808 808
 				// We have to determine how many items to show on a page.
809
-				'total_pages' => ceil( $total_items / $this->per_page ),
809
+				'total_pages' => ceil($total_items / $this->per_page),
810 810
 				// We have to calculate the total number of pages.
811 811
 			)
812 812
 		);
Please login to merge, or discard this patch.