@@ -10,7 +10,7 @@ discard block |
||
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 | |
@@ -25,94 +25,94 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @uses give_pdf |
27 | 27 | */ |
28 | -function give_generate_pdf( $data ) { |
|
28 | +function give_generate_pdf($data) { |
|
29 | 29 | |
30 | - if ( ! current_user_can( 'view_give_reports' ) ) { |
|
31 | - wp_die( __( 'You do not have permission to generate PDF sales reports.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
30 | + if ( ! current_user_can('view_give_reports')) { |
|
31 | + wp_die(__('You do not have permission to generate PDF sales reports.', 'give'), __('Error', 'give'), array('response' => 403)); |
|
32 | 32 | } |
33 | 33 | |
34 | - if ( ! wp_verify_nonce( $_GET['_wpnonce'], 'give_generate_pdf' ) ) { |
|
35 | - wp_die( __( 'Nonce verification failed.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
34 | + if ( ! wp_verify_nonce($_GET['_wpnonce'], 'give_generate_pdf')) { |
|
35 | + wp_die(__('Nonce verification failed.', 'give'), __('Error', 'give'), array('response' => 403)); |
|
36 | 36 | } |
37 | 37 | |
38 | - require_once GIVE_PLUGIN_DIR . '/includes/libraries/fpdf/fpdf.php'; |
|
39 | - require_once GIVE_PLUGIN_DIR . '/includes/libraries/fpdf/give_pdf.php'; |
|
38 | + require_once GIVE_PLUGIN_DIR.'/includes/libraries/fpdf/fpdf.php'; |
|
39 | + require_once GIVE_PLUGIN_DIR.'/includes/libraries/fpdf/give_pdf.php'; |
|
40 | 40 | |
41 | 41 | $daterange = utf8_decode( |
42 | 42 | sprintf( |
43 | 43 | /* translators: 1: start date 2: end date */ |
44 | - __( '%1$s to %2$s', 'give' ), |
|
45 | - date_i18n( give_date_format(), mktime( 0, 0, 0, 1, 1, date( 'Y' ) ) ), |
|
46 | - date_i18n( give_date_format() ) |
|
44 | + __('%1$s to %2$s', 'give'), |
|
45 | + date_i18n(give_date_format(), mktime(0, 0, 0, 1, 1, date('Y'))), |
|
46 | + date_i18n(give_date_format()) |
|
47 | 47 | ) |
48 | 48 | ); |
49 | 49 | |
50 | - $categories_enabled = give_is_setting_enabled( give_get_option( 'categories', 'disabled' ) ); |
|
51 | - $tags_enabled = give_is_setting_enabled( give_get_option( 'tags', 'disabled' ) ); |
|
50 | + $categories_enabled = give_is_setting_enabled(give_get_option('categories', 'disabled')); |
|
51 | + $tags_enabled = give_is_setting_enabled(give_get_option('tags', 'disabled')); |
|
52 | 52 | |
53 | 53 | $pdf = new give_pdf(); |
54 | - $pdf->AddPage( 'L', 'A4' ); |
|
54 | + $pdf->AddPage('L', 'A4'); |
|
55 | 55 | |
56 | - $pdf->SetTitle( utf8_decode( __( 'Donation report for the current year for all forms', 'give' ) ) ); |
|
57 | - $pdf->SetAuthor( utf8_decode( __( 'Give - Democratizing Generosity', 'give' ) ) ); |
|
58 | - $pdf->SetCreator( utf8_decode( __( 'Give - Democratizing Generosity', 'give' ) ) ); |
|
56 | + $pdf->SetTitle(utf8_decode(__('Donation report for the current year for all forms', 'give'))); |
|
57 | + $pdf->SetAuthor(utf8_decode(__('Give - Democratizing Generosity', 'give'))); |
|
58 | + $pdf->SetCreator(utf8_decode(__('Give - Democratizing Generosity', 'give'))); |
|
59 | 59 | |
60 | - $pdf->Image( apply_filters( 'give_pdf_export_logo', GIVE_PLUGIN_URL . 'assets/images/give-logo-small.png' ), 247, 8 ); |
|
60 | + $pdf->Image(apply_filters('give_pdf_export_logo', GIVE_PLUGIN_URL.'assets/images/give-logo-small.png'), 247, 8); |
|
61 | 61 | |
62 | - $pdf->SetMargins( 8, 8, 8 ); |
|
63 | - $pdf->SetX( 8 ); |
|
62 | + $pdf->SetMargins(8, 8, 8); |
|
63 | + $pdf->SetX(8); |
|
64 | 64 | |
65 | - $pdf->SetFont( 'Helvetica', '', 16 ); |
|
66 | - $pdf->SetTextColor( 50, 50, 50 ); |
|
67 | - $pdf->Cell( 0, 3, utf8_decode( __( 'Donation report for the current year for all forms', 'give' ) ), 0, 2, 'L', false ); |
|
65 | + $pdf->SetFont('Helvetica', '', 16); |
|
66 | + $pdf->SetTextColor(50, 50, 50); |
|
67 | + $pdf->Cell(0, 3, utf8_decode(__('Donation report for the current year for all forms', 'give')), 0, 2, 'L', false); |
|
68 | 68 | |
69 | - $pdf->SetFont( 'Helvetica', '', 13 ); |
|
69 | + $pdf->SetFont('Helvetica', '', 13); |
|
70 | 70 | $pdf->Ln(); |
71 | - $pdf->SetTextColor( 150, 150, 150 ); |
|
72 | - $pdf->Cell( 0, 6, utf8_decode( __( 'Date Range: ', 'give' ) ) . $daterange, 0, 2, 'L', false ); |
|
71 | + $pdf->SetTextColor(150, 150, 150); |
|
72 | + $pdf->Cell(0, 6, utf8_decode(__('Date Range: ', 'give')).$daterange, 0, 2, 'L', false); |
|
73 | 73 | $pdf->Ln(); |
74 | - $pdf->SetTextColor( 50, 50, 50 ); |
|
75 | - $pdf->SetFont( 'Helvetica', '', 14 ); |
|
76 | - $pdf->Cell( 0, 10, utf8_decode( __( 'Table View', 'give' ) ), 0, 2, 'L', false ); |
|
77 | - $pdf->SetFont( 'Helvetica', '', 12 ); |
|
74 | + $pdf->SetTextColor(50, 50, 50); |
|
75 | + $pdf->SetFont('Helvetica', '', 14); |
|
76 | + $pdf->Cell(0, 10, utf8_decode(__('Table View', 'give')), 0, 2, 'L', false); |
|
77 | + $pdf->SetFont('Helvetica', '', 12); |
|
78 | 78 | |
79 | - $pdf->SetFillColor( 238, 238, 238 ); |
|
80 | - $pdf->Cell( 70, 6, utf8_decode( __( 'Form Name', 'give' ) ), 1, 0, 'L', true ); |
|
81 | - $pdf->Cell( 30, 6, utf8_decode( __( 'Price', 'give' ) ), 1, 0, 'L', true ); |
|
79 | + $pdf->SetFillColor(238, 238, 238); |
|
80 | + $pdf->Cell(70, 6, utf8_decode(__('Form Name', 'give')), 1, 0, 'L', true); |
|
81 | + $pdf->Cell(30, 6, utf8_decode(__('Price', 'give')), 1, 0, 'L', true); |
|
82 | 82 | |
83 | 83 | // Display Categories Heading only, if user has opted for it. |
84 | - if ( $categories_enabled ) { |
|
85 | - $pdf->Cell( 45, 6, utf8_decode( __( 'Categories', 'give' ) ), 1, 0, 'L', true ); |
|
84 | + if ($categories_enabled) { |
|
85 | + $pdf->Cell(45, 6, utf8_decode(__('Categories', 'give')), 1, 0, 'L', true); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | // Display Tags Heading only, if user has opted for it. |
89 | - if ( $tags_enabled ) { |
|
90 | - $pdf->Cell( 45, 6, utf8_decode( __( 'Tags', 'give' ) ), 1, 0, 'L', true ); |
|
89 | + if ($tags_enabled) { |
|
90 | + $pdf->Cell(45, 6, utf8_decode(__('Tags', 'give')), 1, 0, 'L', true); |
|
91 | 91 | } |
92 | 92 | |
93 | - $pdf->Cell( 45, 6, utf8_decode( __( 'Number of Donations', 'give' ) ), 1, 0, 'L', true ); |
|
94 | - $pdf->Cell( 45, 6, utf8_decode( __( 'Income to Date', 'give' ) ), 1, 1, 'L', true ); |
|
93 | + $pdf->Cell(45, 6, utf8_decode(__('Number of Donations', 'give')), 1, 0, 'L', true); |
|
94 | + $pdf->Cell(45, 6, utf8_decode(__('Income to Date', 'give')), 1, 1, 'L', true); |
|
95 | 95 | |
96 | - $year = date( 'Y' ); |
|
97 | - $give_forms = get_posts( array( 'post_type' => 'give_forms', 'year' => $year, 'posts_per_page' => - 1 ) ); |
|
96 | + $year = date('Y'); |
|
97 | + $give_forms = get_posts(array('post_type' => 'give_forms', 'year' => $year, 'posts_per_page' => -1)); |
|
98 | 98 | |
99 | - if ( $give_forms ) { |
|
100 | - $pdf->SetWidths( array( 70, 30, 45, 45, 45, 45 ) ); |
|
99 | + if ($give_forms) { |
|
100 | + $pdf->SetWidths(array(70, 30, 45, 45, 45, 45)); |
|
101 | 101 | |
102 | - foreach ( $give_forms as $form ): |
|
103 | - $pdf->SetFillColor( 255, 255, 255 ); |
|
102 | + foreach ($give_forms as $form): |
|
103 | + $pdf->SetFillColor(255, 255, 255); |
|
104 | 104 | |
105 | 105 | $title = $form->post_title; |
106 | 106 | |
107 | - if ( give_has_variable_prices( $form->ID ) ) { |
|
107 | + if (give_has_variable_prices($form->ID)) { |
|
108 | 108 | |
109 | - $prices = give_get_variable_prices( $form->ID ); |
|
109 | + $prices = give_get_variable_prices($form->ID); |
|
110 | 110 | |
111 | 111 | $first = $prices[0]['_give_amount']; |
112 | - $last = array_pop( $prices ); |
|
112 | + $last = array_pop($prices); |
|
113 | 113 | $last = $last['_give_amount']; |
114 | 114 | |
115 | - if ( $first < $last ) { |
|
115 | + if ($first < $last) { |
|
116 | 116 | $min = $first; |
117 | 117 | $max = $last; |
118 | 118 | } else { |
@@ -120,31 +120,31 @@ discard block |
||
120 | 120 | $max = $first; |
121 | 121 | } |
122 | 122 | |
123 | - $price = give_currency_filter( give_format_amount( $min, array( 'sanitize' => false ) ), '', true ) . ' - ' . give_currency_filter( give_format_amount( $max ), '', true ); |
|
123 | + $price = give_currency_filter(give_format_amount($min, array('sanitize' => false)), '', true).' - '.give_currency_filter(give_format_amount($max), '', true); |
|
124 | 124 | } else { |
125 | - $price = give_currency_filter( give_get_form_price( $form->ID ), '', true ); |
|
125 | + $price = give_currency_filter(give_get_form_price($form->ID), '', true); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | // Display Categories Data only, if user has opted for it. |
129 | - if ( $categories_enabled ) { |
|
130 | - $categories = get_the_term_list( $form->ID, 'give_forms_category', '', ', ', '' ); |
|
131 | - $categories = ! is_wp_error( $categories ) ? strip_tags( $categories ) : ''; |
|
129 | + if ($categories_enabled) { |
|
130 | + $categories = get_the_term_list($form->ID, 'give_forms_category', '', ', ', ''); |
|
131 | + $categories = ! is_wp_error($categories) ? strip_tags($categories) : ''; |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | // Display Tags Data only, if user has opted for it. |
135 | - if ( $tags_enabled ) { |
|
136 | - $tags = get_the_term_list( $form->ID, 'give_forms_tag', '', ', ', '' ); |
|
137 | - $tags = ! is_wp_error( $tags ) ? strip_tags( $tags ) : ''; |
|
135 | + if ($tags_enabled) { |
|
136 | + $tags = get_the_term_list($form->ID, 'give_forms_tag', '', ', ', ''); |
|
137 | + $tags = ! is_wp_error($tags) ? strip_tags($tags) : ''; |
|
138 | 138 | } |
139 | 139 | |
140 | - $sales = give_get_form_sales_stats( $form->ID ); |
|
141 | - $link = get_permalink( $form->ID ); |
|
142 | - $earnings = give_currency_filter( give_get_form_earnings_stats( $form->ID ), '', true ); |
|
140 | + $sales = give_get_form_sales_stats($form->ID); |
|
141 | + $link = get_permalink($form->ID); |
|
142 | + $earnings = give_currency_filter(give_get_form_earnings_stats($form->ID), '', true); |
|
143 | 143 | |
144 | - if ( function_exists( 'iconv' ) ) { |
|
144 | + if (function_exists('iconv')) { |
|
145 | 145 | // Ensure characters like euro; are properly converted. |
146 | - $price = iconv( 'UTF-8', 'windows-1252', utf8_encode( $price ) ); |
|
147 | - $earnings = iconv( 'UTF-8', 'windows-1252', utf8_encode( $earnings ) ); |
|
146 | + $price = iconv('UTF-8', 'windows-1252', utf8_encode($price)); |
|
147 | + $earnings = iconv('UTF-8', 'windows-1252', utf8_encode($earnings)); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | // This will help filter data before appending it to PDF Receipt. |
@@ -153,51 +153,51 @@ discard block |
||
153 | 153 | $prepare_pdf_data[] = $price; |
154 | 154 | |
155 | 155 | // Append Categories Data only, if user has opted for it. |
156 | - if ( $categories_enabled ) { |
|
156 | + if ($categories_enabled) { |
|
157 | 157 | $prepare_pdf_data[] = $categories; |
158 | 158 | } |
159 | 159 | |
160 | 160 | // Append Tags Data only, if user has opted for it. |
161 | - if ( $tags_enabled ) { |
|
161 | + if ($tags_enabled) { |
|
162 | 162 | $prepare_pdf_data[] = $tags; |
163 | 163 | } |
164 | 164 | |
165 | 165 | $prepare_pdf_data[] = $sales; |
166 | 166 | $prepare_pdf_data[] = $earnings; |
167 | 167 | |
168 | - $pdf->Row( $prepare_pdf_data ); |
|
168 | + $pdf->Row($prepare_pdf_data); |
|
169 | 169 | endforeach; |
170 | 170 | } else { |
171 | 171 | |
172 | 172 | // Fix: Minor Styling Alignment Issue for PDF |
173 | - if( $categories_enabled && $tags_enabled ) { |
|
174 | - $pdf->SetWidths( array( 280 ) ); |
|
175 | - } elseif( $categories_enabled || $tags_enabled ) { |
|
176 | - $pdf->SetWidths( array( 235 ) ); |
|
173 | + if ($categories_enabled && $tags_enabled) { |
|
174 | + $pdf->SetWidths(array(280)); |
|
175 | + } elseif ($categories_enabled || $tags_enabled) { |
|
176 | + $pdf->SetWidths(array(235)); |
|
177 | 177 | } else { |
178 | - $pdf->SetWidths( array( 190 ) ); |
|
178 | + $pdf->SetWidths(array(190)); |
|
179 | 179 | } |
180 | 180 | |
181 | - $title = utf8_decode( __( 'No forms found.', 'give' ) ); |
|
182 | - $pdf->Row( array( $title ) ); |
|
181 | + $title = utf8_decode(__('No forms found.', 'give')); |
|
182 | + $pdf->Row(array($title)); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | $pdf->Ln(); |
186 | - $pdf->SetTextColor( 50, 50, 50 ); |
|
187 | - $pdf->SetFont( 'Helvetica', '', 14 ); |
|
188 | - $pdf->Cell( 0, 10, utf8_decode( __( 'Graph View', 'give' ) ), 0, 2, 'L', false ); |
|
189 | - $pdf->SetFont( 'Helvetica', '', 12 ); |
|
190 | - |
|
191 | - $image = html_entity_decode( urldecode( give_draw_chart_image() ) ); |
|
192 | - $image = str_replace( ' ', '%20', $image ); |
|
193 | - |
|
194 | - $pdf->SetX( 25 ); |
|
195 | - $pdf->Image( $image . '&file=.png' ); |
|
196 | - $pdf->Ln( 7 ); |
|
197 | - $pdf->Output( apply_filters( 'give_sales_earnings_pdf_export_filename', 'give-report-' . date_i18n( 'Y-m-d' ) ) . '.pdf', 'D' ); |
|
186 | + $pdf->SetTextColor(50, 50, 50); |
|
187 | + $pdf->SetFont('Helvetica', '', 14); |
|
188 | + $pdf->Cell(0, 10, utf8_decode(__('Graph View', 'give')), 0, 2, 'L', false); |
|
189 | + $pdf->SetFont('Helvetica', '', 12); |
|
190 | + |
|
191 | + $image = html_entity_decode(urldecode(give_draw_chart_image())); |
|
192 | + $image = str_replace(' ', '%20', $image); |
|
193 | + |
|
194 | + $pdf->SetX(25); |
|
195 | + $pdf->Image($image.'&file=.png'); |
|
196 | + $pdf->Ln(7); |
|
197 | + $pdf->Output(apply_filters('give_sales_earnings_pdf_export_filename', 'give-report-'.date_i18n('Y-m-d')).'.pdf', 'D'); |
|
198 | 198 | } |
199 | 199 | |
200 | -add_action( 'give_generate_pdf', 'give_generate_pdf' ); |
|
200 | +add_action('give_generate_pdf', 'give_generate_pdf'); |
|
201 | 201 | |
202 | 202 | /** |
203 | 203 | * Draws Chart for PDF Report. |
@@ -214,38 +214,38 @@ discard block |
||
214 | 214 | * @return string $chart->getUrl() URL for the Google Chart |
215 | 215 | */ |
216 | 216 | function give_draw_chart_image() { |
217 | - require_once GIVE_PLUGIN_DIR . '/includes/libraries/googlechartlib/GoogleChart.php'; |
|
218 | - require_once GIVE_PLUGIN_DIR . '/includes/libraries/googlechartlib/markers/GoogleChartShapeMarker.php'; |
|
219 | - require_once GIVE_PLUGIN_DIR . '/includes/libraries/googlechartlib/markers/GoogleChartTextMarker.php'; |
|
217 | + require_once GIVE_PLUGIN_DIR.'/includes/libraries/googlechartlib/GoogleChart.php'; |
|
218 | + require_once GIVE_PLUGIN_DIR.'/includes/libraries/googlechartlib/markers/GoogleChartShapeMarker.php'; |
|
219 | + require_once GIVE_PLUGIN_DIR.'/includes/libraries/googlechartlib/markers/GoogleChartTextMarker.php'; |
|
220 | 220 | |
221 | - $chart = new GoogleChart( 'lc', 900, 330 ); |
|
221 | + $chart = new GoogleChart('lc', 900, 330); |
|
222 | 222 | |
223 | 223 | $i = 1; |
224 | 224 | $earnings = ""; |
225 | 225 | $sales = ""; |
226 | 226 | |
227 | - while ( $i <= 12 ) : |
|
228 | - $earnings .= give_get_earnings_by_date( null, $i, date( 'Y' ) ) . ","; |
|
229 | - $sales .= give_get_sales_by_date( null, $i, date( 'Y' ) ) . ","; |
|
230 | - $i ++; |
|
227 | + while ($i <= 12) : |
|
228 | + $earnings .= give_get_earnings_by_date(null, $i, date('Y')).","; |
|
229 | + $sales .= give_get_sales_by_date(null, $i, date('Y')).","; |
|
230 | + $i++; |
|
231 | 231 | endwhile; |
232 | 232 | |
233 | - $earnings_array = explode( ",", $earnings ); |
|
234 | - $sales_array = explode( ",", $sales ); |
|
233 | + $earnings_array = explode(",", $earnings); |
|
234 | + $sales_array = explode(",", $sales); |
|
235 | 235 | |
236 | 236 | $i = 0; |
237 | - while ( $i <= 11 ) { |
|
238 | - if ( empty( $sales_array[ $i ] ) ) { |
|
239 | - $sales_array[ $i ] = 0; |
|
237 | + while ($i <= 11) { |
|
238 | + if (empty($sales_array[$i])) { |
|
239 | + $sales_array[$i] = 0; |
|
240 | 240 | } |
241 | - $i ++; |
|
241 | + $i++; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | $min_earnings = 0; |
245 | - $max_earnings = max( $earnings_array ); |
|
246 | - $earnings_scale = round( $max_earnings, - 1 ); |
|
245 | + $max_earnings = max($earnings_array); |
|
246 | + $earnings_scale = round($max_earnings, - 1); |
|
247 | 247 | |
248 | - $data = new GoogleChartData( array( |
|
248 | + $data = new GoogleChartData(array( |
|
249 | 249 | $earnings_array[0], |
250 | 250 | $earnings_array[1], |
251 | 251 | $earnings_array[2], |
@@ -258,25 +258,25 @@ discard block |
||
258 | 258 | $earnings_array[9], |
259 | 259 | $earnings_array[10], |
260 | 260 | $earnings_array[11] |
261 | - ) ); |
|
261 | + )); |
|
262 | 262 | |
263 | - $data->setLegend( __( 'Income', 'give' ) ); |
|
264 | - $data->setColor( '1b58a3' ); |
|
265 | - $chart->addData( $data ); |
|
263 | + $data->setLegend(__('Income', 'give')); |
|
264 | + $data->setColor('1b58a3'); |
|
265 | + $chart->addData($data); |
|
266 | 266 | |
267 | - $shape_marker = new GoogleChartShapeMarker( GoogleChartShapeMarker::CIRCLE ); |
|
268 | - $shape_marker->setColor( '000000' ); |
|
269 | - $shape_marker->setSize( 7 ); |
|
270 | - $shape_marker->setBorder( 2 ); |
|
271 | - $shape_marker->setData( $data ); |
|
272 | - $chart->addMarker( $shape_marker ); |
|
267 | + $shape_marker = new GoogleChartShapeMarker(GoogleChartShapeMarker::CIRCLE); |
|
268 | + $shape_marker->setColor('000000'); |
|
269 | + $shape_marker->setSize(7); |
|
270 | + $shape_marker->setBorder(2); |
|
271 | + $shape_marker->setData($data); |
|
272 | + $chart->addMarker($shape_marker); |
|
273 | 273 | |
274 | - $value_marker = new GoogleChartTextMarker( GoogleChartTextMarker::VALUE ); |
|
275 | - $value_marker->setColor( '000000' ); |
|
276 | - $value_marker->setData( $data ); |
|
277 | - $chart->addMarker( $value_marker ); |
|
274 | + $value_marker = new GoogleChartTextMarker(GoogleChartTextMarker::VALUE); |
|
275 | + $value_marker->setColor('000000'); |
|
276 | + $value_marker->setData($data); |
|
277 | + $chart->addMarker($value_marker); |
|
278 | 278 | |
279 | - $data = new GoogleChartData( array( |
|
279 | + $data = new GoogleChartData(array( |
|
280 | 280 | $sales_array[0], |
281 | 281 | $sales_array[1], |
282 | 282 | $sales_array[2], |
@@ -289,46 +289,46 @@ discard block |
||
289 | 289 | $sales_array[9], |
290 | 290 | $sales_array[10], |
291 | 291 | $sales_array[11] |
292 | - ) ); |
|
293 | - $data->setLegend( __( 'Donations', 'give' ) ); |
|
294 | - $data->setColor( 'ff6c1c' ); |
|
295 | - $chart->addData( $data ); |
|
296 | - |
|
297 | - $chart->setTitle( __( 'Donations by Month for all Give Forms', 'give' ), '336699', 18 ); |
|
298 | - |
|
299 | - $chart->setScale( 0, $max_earnings ); |
|
300 | - |
|
301 | - $y_axis = new GoogleChartAxis( 'y' ); |
|
302 | - $y_axis->setDrawTickMarks( true )->setLabels( array( 0, $max_earnings ) ); |
|
303 | - $chart->addAxis( $y_axis ); |
|
304 | - |
|
305 | - $x_axis = new GoogleChartAxis( 'x' ); |
|
306 | - $x_axis->setTickMarks( 5 ); |
|
307 | - $x_axis->setLabels( array( |
|
308 | - __( 'Jan', 'give' ), |
|
309 | - __( 'Feb', 'give' ), |
|
310 | - __( 'Mar', 'give' ), |
|
311 | - __( 'Apr', 'give' ), |
|
312 | - __( 'May', 'give' ), |
|
313 | - __( 'June', 'give' ), |
|
314 | - __( 'July', 'give' ), |
|
315 | - __( 'Aug', 'give' ), |
|
316 | - __( 'Sept', 'give' ), |
|
317 | - __( 'Oct', 'give' ), |
|
318 | - __( 'Nov', 'give' ), |
|
319 | - __( 'Dec', 'give' ) |
|
320 | - ) ); |
|
321 | - $chart->addAxis( $x_axis ); |
|
322 | - |
|
323 | - $shape_marker = new GoogleChartShapeMarker( GoogleChartShapeMarker::CIRCLE ); |
|
324 | - $shape_marker->setSize( 6 ); |
|
325 | - $shape_marker->setBorder( 2 ); |
|
326 | - $shape_marker->setData( $data ); |
|
327 | - $chart->addMarker( $shape_marker ); |
|
328 | - |
|
329 | - $value_marker = new GoogleChartTextMarker( GoogleChartTextMarker::VALUE ); |
|
330 | - $value_marker->setData( $data ); |
|
331 | - $chart->addMarker( $value_marker ); |
|
292 | + )); |
|
293 | + $data->setLegend(__('Donations', 'give')); |
|
294 | + $data->setColor('ff6c1c'); |
|
295 | + $chart->addData($data); |
|
296 | + |
|
297 | + $chart->setTitle(__('Donations by Month for all Give Forms', 'give'), '336699', 18); |
|
298 | + |
|
299 | + $chart->setScale(0, $max_earnings); |
|
300 | + |
|
301 | + $y_axis = new GoogleChartAxis('y'); |
|
302 | + $y_axis->setDrawTickMarks(true)->setLabels(array(0, $max_earnings)); |
|
303 | + $chart->addAxis($y_axis); |
|
304 | + |
|
305 | + $x_axis = new GoogleChartAxis('x'); |
|
306 | + $x_axis->setTickMarks(5); |
|
307 | + $x_axis->setLabels(array( |
|
308 | + __('Jan', 'give'), |
|
309 | + __('Feb', 'give'), |
|
310 | + __('Mar', 'give'), |
|
311 | + __('Apr', 'give'), |
|
312 | + __('May', 'give'), |
|
313 | + __('June', 'give'), |
|
314 | + __('July', 'give'), |
|
315 | + __('Aug', 'give'), |
|
316 | + __('Sept', 'give'), |
|
317 | + __('Oct', 'give'), |
|
318 | + __('Nov', 'give'), |
|
319 | + __('Dec', 'give') |
|
320 | + )); |
|
321 | + $chart->addAxis($x_axis); |
|
322 | + |
|
323 | + $shape_marker = new GoogleChartShapeMarker(GoogleChartShapeMarker::CIRCLE); |
|
324 | + $shape_marker->setSize(6); |
|
325 | + $shape_marker->setBorder(2); |
|
326 | + $shape_marker->setData($data); |
|
327 | + $chart->addMarker($shape_marker); |
|
328 | + |
|
329 | + $value_marker = new GoogleChartTextMarker(GoogleChartTextMarker::VALUE); |
|
330 | + $value_marker->setData($data); |
|
331 | + $chart->addMarker($value_marker); |
|
332 | 332 | |
333 | 333 | return $chart->getUrl(); |
334 | 334 | } |
@@ -3,11 +3,11 @@ discard block |
||
3 | 3 | * Admin View: Exports |
4 | 4 | */ |
5 | 5 | |
6 | -if ( ! defined( 'ABSPATH' ) ) { |
|
6 | +if ( ! defined('ABSPATH')) { |
|
7 | 7 | exit; |
8 | 8 | } |
9 | 9 | |
10 | -if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
10 | +if ( ! current_user_can('manage_give_settings')) { |
|
11 | 11 | return; |
12 | 12 | } |
13 | 13 | |
@@ -16,28 +16,28 @@ discard block |
||
16 | 16 | * |
17 | 17 | * @since 1.5 |
18 | 18 | */ |
19 | -do_action( 'give_tools_recount_stats_before' ); |
|
19 | +do_action('give_tools_recount_stats_before'); |
|
20 | 20 | ?> |
21 | 21 | <div id="poststuff"> |
22 | 22 | <div class="postbox"> |
23 | 23 | |
24 | - <h2 class="hndle ui-sortable-handle"><span><?php esc_html_e( 'Recount Stats', 'give' ); ?></span></h2> |
|
24 | + <h2 class="hndle ui-sortable-handle"><span><?php esc_html_e('Recount Stats', 'give'); ?></span></h2> |
|
25 | 25 | |
26 | 26 | <div class="inside recount-stats-controls"> |
27 | - <p><?php esc_html_e( 'Use these tools to recount stats, delete test transactions, or reset stats.', 'give' ); ?></p> |
|
27 | + <p><?php esc_html_e('Use these tools to recount stats, delete test transactions, or reset stats.', 'give'); ?></p> |
|
28 | 28 | <form method="post" id="give-tools-recount-form" class="give-export-form"> |
29 | 29 | |
30 | - <?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?> |
|
30 | + <?php wp_nonce_field('give_ajax_export', 'give_ajax_export'); ?> |
|
31 | 31 | |
32 | 32 | <select name="give-export-class" id="recount-stats-type"> |
33 | - <option value="0" selected="selected" disabled="disabled"><?php esc_html_e( 'Please select an option', 'give' ); ?></option> |
|
34 | - <option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e( 'Recalculate Total Donation Income Amount', 'give' ); ?></option> |
|
35 | - <option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php esc_html_e( 'Recalculate Income Amount and Donation Counts for a Form', 'give' ); ?></option> |
|
36 | - <option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php esc_html_e( 'Recalculate Income Amount and Donation Counts for All Forms', 'give' ); ?></option> |
|
37 | - <option data-type="recount-donor-stats" value="Give_Tools_Recount_Donor_Stats"><?php esc_html_e( 'Recalculate Donor Statistics', 'give' ); ?></option> |
|
38 | - <option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e( 'Delete Test Transactions', 'give' ); ?></option> |
|
39 | - <option data-type="delete-test-donors" value="Give_Tools_Delete_Donors"><?php esc_html_e( 'Delete Test Donor', 'give' ); ?></option> |
|
40 | - <option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e( 'Delete All Data', 'give' ); ?></option> |
|
33 | + <option value="0" selected="selected" disabled="disabled"><?php esc_html_e('Please select an option', 'give'); ?></option> |
|
34 | + <option data-type="recount-stats" value="Give_Tools_Recount_Income"><?php esc_html_e('Recalculate Total Donation Income Amount', 'give'); ?></option> |
|
35 | + <option data-type="recount-form" value="Give_Tools_Recount_Form_Stats"><?php esc_html_e('Recalculate Income Amount and Donation Counts for a Form', 'give'); ?></option> |
|
36 | + <option data-type="recount-all" value="Give_Tools_Recount_All_Stats"><?php esc_html_e('Recalculate Income Amount and Donation Counts for All Forms', 'give'); ?></option> |
|
37 | + <option data-type="recount-donor-stats" value="Give_Tools_Recount_Donor_Stats"><?php esc_html_e('Recalculate Donor Statistics', 'give'); ?></option> |
|
38 | + <option data-type="delete-test-transactions" value="Give_Tools_Delete_Test_Transactions"><?php esc_html_e('Delete Test Transactions', 'give'); ?></option> |
|
39 | + <option data-type="delete-test-donors" value="Give_Tools_Delete_Donors"><?php esc_html_e('Delete Test Donor', 'give'); ?></option> |
|
40 | + <option data-type="reset-stats" value="Give_Tools_Reset_Stats"><?php esc_html_e('Delete All Data', 'give'); ?></option> |
|
41 | 41 | <?php |
42 | 42 | /** |
43 | 43 | * Fires in the recount stats selectbox. |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * |
47 | 47 | * @since 1.5 |
48 | 48 | */ |
49 | - do_action( 'give_recount_tool_options' ); |
|
49 | + do_action('give_recount_tool_options'); |
|
50 | 50 | ?> |
51 | 51 | </select> |
52 | 52 | |
@@ -54,22 +54,22 @@ discard block |
||
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> |
|
70 | - <span id="recount-form"><?php esc_html_e( 'Recalculates the donation and income stats for a specific form.', 'give' ); ?></span> |
|
71 | - <span id="recount-all"><?php esc_html_e( 'Recalculates the earnings and sales stats for all forms.', 'give' ); ?></span> |
|
72 | - <span id="recount-customer-stats"><?php esc_html_e( 'Recalculates the lifetime value and donation counts for all donors.', 'give' ); ?></span> |
|
69 | + <span id="recount-stats"><?php esc_html_e('Recalculates the overall donation income amount.', 'give'); ?></span> |
|
70 | + <span id="recount-form"><?php esc_html_e('Recalculates the donation and income stats for a specific form.', 'give'); ?></span> |
|
71 | + <span id="recount-all"><?php esc_html_e('Recalculates the earnings and sales stats for all forms.', 'give'); ?></span> |
|
72 | + <span id="recount-customer-stats"><?php esc_html_e('Recalculates the lifetime value and donation counts for all donors.', 'give'); ?></span> |
|
73 | 73 | <?php |
74 | 74 | /** |
75 | 75 | * Fires in the recount stats description area. |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | * |
79 | 79 | * @since 1.5 |
80 | 80 | */ |
81 | - do_action( 'give_recount_tool_descriptions' ); |
|
81 | + do_action('give_recount_tool_descriptions'); |
|
82 | 82 | ?> |
83 | - <span id="delete-test-transactions"><?php _e( '<strong>Deletes</strong> all TEST donations, donors, and related log entries.', 'give' ); ?></span> |
|
84 | - <span id="reset-stats"><?php _e( '<strong>Deletes</strong> ALL donations, donors, and related log entries regardless of test or live mode.', 'give' ); ?></span> |
|
83 | + <span id="delete-test-transactions"><?php _e('<strong>Deletes</strong> all TEST donations, donors, and related log entries.', 'give'); ?></span> |
|
84 | + <span id="reset-stats"><?php _e('<strong>Deletes</strong> ALL donations, donors, and related log entries regardless of test or live mode.', 'give'); ?></span> |
|
85 | 85 | </span> |
86 | 86 | |
87 | 87 | <span class="spinner"></span> |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * |
96 | 96 | * @since 1.5 |
97 | 97 | */ |
98 | - do_action( 'give_tools_recount_forms' ); |
|
98 | + do_action('give_tools_recount_forms'); |
|
99 | 99 | ?> |
100 | 100 | </div><!-- .inside --> |
101 | 101 | </div><!-- .postbox --> |
@@ -106,4 +106,4 @@ discard block |
||
106 | 106 | * |
107 | 107 | * @since 1.5 |
108 | 108 | */ |
109 | -do_action( 'give_tools_recount_stats_after' ); |
|
109 | +do_action('give_tools_recount_stats_after'); |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | * Admin View: System Info |
4 | 4 | */ |
5 | 5 | |
6 | -if ( ! defined( 'ABSPATH' ) ) { |
|
6 | +if ( ! defined('ABSPATH')) { |
|
7 | 7 | exit; |
8 | 8 | } |
9 | 9 | |
@@ -22,10 +22,10 @@ discard block |
||
22 | 22 | ?> |
23 | 23 | |
24 | 24 | <div class="give-debug-report-wrapper updated"> |
25 | - <p><?php _e( 'Please copy and paste this information in your ticket when contacting support:', 'give' ); ?> </p> |
|
25 | + <p><?php _e('Please copy and paste this information in your ticket when contacting support:', 'give'); ?> </p> |
|
26 | 26 | <p class="submit"> |
27 | - <a class="button-primary js-give-debug-report-button" href="#"><?php _e( 'Get System Report', 'give' ); ?></a> |
|
28 | - <a class="button-secondary docs" href="http://docs.givewp.com/settings-system-info" target="_blank"><?php _e( 'Understanding the System Report', 'give' ); ?></a> |
|
27 | + <a class="button-primary js-give-debug-report-button" href="#"><?php _e('Get System Report', 'give'); ?></a> |
|
28 | + <a class="button-secondary docs" href="http://docs.givewp.com/settings-system-info" target="_blank"><?php _e('Understanding the System Report', 'give'); ?></a> |
|
29 | 29 | </p> |
30 | 30 | <div class="give-debug-report js-give-debug-report"> |
31 | 31 | <textarea readonly="readonly"></textarea> |
@@ -35,55 +35,55 @@ discard block |
||
35 | 35 | <table class="give-status-table widefat" cellspacing="0" id="status"> |
36 | 36 | <thead> |
37 | 37 | <tr> |
38 | - <th colspan="3" data-export-label="WordPress Environment"><h2><?php _e( 'WordPress Environment', 'give' ); ?></h2></th> |
|
38 | + <th colspan="3" data-export-label="WordPress Environment"><h2><?php _e('WordPress Environment', 'give'); ?></h2></th> |
|
39 | 39 | </tr> |
40 | 40 | </thead> |
41 | 41 | <tbody> |
42 | 42 | <tr> |
43 | - <td data-export-label="Home URL"><?php _e( 'Home URL', 'give' ); ?>:</td> |
|
44 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The URL of your site\'s homepage.', 'give' ) ); ?>"></span></td> |
|
45 | - <td><?php form_option( 'home' ); ?></td> |
|
43 | + <td data-export-label="Home URL"><?php _e('Home URL', 'give'); ?>:</td> |
|
44 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The URL of your site\'s homepage.', 'give')); ?>"></span></td> |
|
45 | + <td><?php form_option('home'); ?></td> |
|
46 | 46 | </tr> |
47 | 47 | <tr> |
48 | - <td data-export-label="Site URL"><?php _e( 'Site URL', 'give' ); ?>:</td> |
|
49 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The root URL of your site.', 'give' ) ); ?>"></span></td> |
|
50 | - <td><?php form_option( 'siteurl' ); ?></td> |
|
48 | + <td data-export-label="Site URL"><?php _e('Site URL', 'give'); ?>:</td> |
|
49 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The root URL of your site.', 'give')); ?>"></span></td> |
|
50 | + <td><?php form_option('siteurl'); ?></td> |
|
51 | 51 | </tr> |
52 | 52 | <tr> |
53 | - <td data-export-label="WP Version"><?php _e( 'WP Version', 'give' ); ?>:</td> |
|
54 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of WordPress installed on your site.', 'give' ) ); ?>"></span></td> |
|
53 | + <td data-export-label="WP Version"><?php _e('WP Version', 'give'); ?>:</td> |
|
54 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of WordPress installed on your site.', 'give')); ?>"></span></td> |
|
55 | 55 | <td><?php bloginfo('version'); ?></td> |
56 | 56 | </tr> |
57 | 57 | <tr> |
58 | - <td data-export-label="WP Multisite"><?php _e( 'WP Multisite', 'give' ); ?>:</td> |
|
59 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether or not you have WordPress Multisite enabled.', 'give' ) ); ?>"></span></td> |
|
60 | - <td><?php if ( is_multisite() ) echo '<span class="dashicons dashicons-yes"></span>'; else echo '–'; ?></td> |
|
58 | + <td data-export-label="WP Multisite"><?php _e('WP Multisite', 'give'); ?>:</td> |
|
59 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether or not you have WordPress Multisite enabled.', 'give')); ?>"></span></td> |
|
60 | + <td><?php if (is_multisite()) echo '<span class="dashicons dashicons-yes"></span>'; else echo '–'; ?></td> |
|
61 | 61 | </tr> |
62 | 62 | <tr> |
63 | - <td data-export-label="WP Memory Limit"><?php _e( 'WP Memory Limit', 'give' ); ?>:</td> |
|
64 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The maximum amount of memory (RAM) that your site can use at one time.', 'give' ) ); ?>"></span></td> |
|
63 | + <td data-export-label="WP Memory Limit"><?php _e('WP Memory Limit', 'give'); ?>:</td> |
|
64 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The maximum amount of memory (RAM) that your site can use at one time.', 'give')); ?>"></span></td> |
|
65 | 65 | <td> |
66 | 66 | <?php |
67 | - $memory = give_let_to_num( WP_MEMORY_LIMIT ); |
|
67 | + $memory = give_let_to_num(WP_MEMORY_LIMIT); |
|
68 | 68 | |
69 | - if ( function_exists( 'memory_get_usage' ) ) { |
|
70 | - $system_memory = give_let_to_num( @ini_get( 'memory_limit' ) ); |
|
71 | - $memory = max( $memory, $system_memory ); |
|
69 | + if (function_exists('memory_get_usage')) { |
|
70 | + $system_memory = give_let_to_num(@ini_get('memory_limit')); |
|
71 | + $memory = max($memory, $system_memory); |
|
72 | 72 | } |
73 | 73 | |
74 | - if ( $memory < 67108864 ) { |
|
75 | - echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend setting memory to at least 64 MB. See: %s', 'give' ), size_format( $memory ), '<a href="https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP" target="_blank">' . __( 'Increasing memory allocated to PHP', 'give' ) . '</a>' ) . '</mark>'; |
|
74 | + if ($memory < 67108864) { |
|
75 | + echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('%s - We recommend setting memory to at least 64 MB. See: %s', 'give'), size_format($memory), '<a href="https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP" target="_blank">'.__('Increasing memory allocated to PHP', 'give').'</a>').'</mark>'; |
|
76 | 76 | } else { |
77 | - echo '<mark class="yes">' . size_format( $memory ) . '</mark>'; |
|
77 | + echo '<mark class="yes">'.size_format($memory).'</mark>'; |
|
78 | 78 | } |
79 | 79 | ?> |
80 | 80 | </td> |
81 | 81 | </tr> |
82 | 82 | <tr> |
83 | - <td data-export-label="WP Debug Mode"><?php _e( 'WP Debug Mode', 'give' ); ?>:</td> |
|
84 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Displays whether or not WordPress is in Debug Mode.', 'give' ) ); ?>"></span></td> |
|
83 | + <td data-export-label="WP Debug Mode"><?php _e('WP Debug Mode', 'give'); ?>:</td> |
|
84 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Displays whether or not WordPress is in Debug Mode.', 'give')); ?>"></span></td> |
|
85 | 85 | <td> |
86 | - <?php if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) : ?> |
|
86 | + <?php if (defined('WP_DEBUG') && WP_DEBUG) : ?> |
|
87 | 87 | <mark class="yes"><span class="dashicons dashicons-yes"></span></mark> |
88 | 88 | <?php else : ?> |
89 | 89 | <mark class="no">–</mark> |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | </td> |
92 | 92 | </tr> |
93 | 93 | <tr> |
94 | - <td data-export-label="WP Cron"><?php _e( 'WP Cron', 'give' ); ?>:</td> |
|
95 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Displays whether or not WP Cron Jobs are enabled.', 'give' ) ); ?>"></span></td> |
|
94 | + <td data-export-label="WP Cron"><?php _e('WP Cron', 'give'); ?>:</td> |
|
95 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Displays whether or not WP Cron Jobs are enabled.', 'give')); ?>"></span></td> |
|
96 | 96 | <td> |
97 | - <?php if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) : ?> |
|
97 | + <?php if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON) : ?> |
|
98 | 98 | <mark class="no">–</mark> |
99 | 99 | <?php else : ?> |
100 | 100 | <mark class="yes"><span class="dashicons dashicons-yes"></span></mark> |
@@ -102,55 +102,55 @@ discard block |
||
102 | 102 | </td> |
103 | 103 | </tr> |
104 | 104 | <tr> |
105 | - <td data-export-label="Language"><?php _e( 'Language', 'give' ); ?>:</td> |
|
106 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The current language used by WordPress. Default = English', 'give' ) ); ?>"></span></td> |
|
105 | + <td data-export-label="Language"><?php _e('Language', 'give'); ?>:</td> |
|
106 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The current language used by WordPress. Default = English', 'give')); ?>"></span></td> |
|
107 | 107 | <td><?php echo get_locale(); ?></td> |
108 | 108 | </tr> |
109 | 109 | <tr> |
110 | - <td data-export-label="Permalink Structure"><?php _e( 'Permalink Structure', 'give' ); ?>:</td> |
|
111 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The permalink structure as defined in Settings.', 'give' ) ); ?>"></span></td> |
|
112 | - <td><?php echo esc_html( get_option( 'permalink_structure', __( 'Default', 'give' ) ) ); ?></td> |
|
110 | + <td data-export-label="Permalink Structure"><?php _e('Permalink Structure', 'give'); ?>:</td> |
|
111 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The permalink structure as defined in Settings.', 'give')); ?>"></span></td> |
|
112 | + <td><?php echo esc_html(get_option('permalink_structure', __('Default', 'give'))); ?></td> |
|
113 | 113 | </tr> |
114 | 114 | <tr> |
115 | - <td data-export-label="Show on Front"><?php _e( 'Show on Front', 'give' ); ?>:</td> |
|
116 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether your front page is set to show posts or a static page.', 'give' ) ); ?>"></span></td> |
|
117 | - <td><?php echo esc_html( get_option( 'show_on_front', '–' ) ); ?></td> |
|
115 | + <td data-export-label="Show on Front"><?php _e('Show on Front', 'give'); ?>:</td> |
|
116 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether your front page is set to show posts or a static page.', 'give')); ?>"></span></td> |
|
117 | + <td><?php echo esc_html(get_option('show_on_front', '–')); ?></td> |
|
118 | 118 | </tr> |
119 | - <?php if ( 'page' === get_option( 'show_on_front' ) ) : ?> |
|
119 | + <?php if ('page' === get_option('show_on_front')) : ?> |
|
120 | 120 | <?php |
121 | - $front_page_id = absint( get_option( 'page_on_front' ) ); |
|
122 | - $blog_page_id = absint( get_option( 'page_for_posts' ) ); |
|
121 | + $front_page_id = absint(get_option('page_on_front')); |
|
122 | + $blog_page_id = absint(get_option('page_for_posts')); |
|
123 | 123 | ?> |
124 | 124 | <tr> |
125 | - <td data-export-label="Page on Front"><?php _e( 'Page on Front', 'give' ); ?>:</td> |
|
126 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The page set to display as your front page.', 'give' ) ); ?>"></span></td> |
|
127 | - <td><?php echo 0 !== $front_page_id ? esc_html( get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' ) : __( 'Unset', 'give' ); ?></td> |
|
125 | + <td data-export-label="Page on Front"><?php _e('Page on Front', 'give'); ?>:</td> |
|
126 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The page set to display as your front page.', 'give')); ?>"></span></td> |
|
127 | + <td><?php echo 0 !== $front_page_id ? esc_html(get_the_title($front_page_id).' (#'.$front_page_id.')') : __('Unset', 'give'); ?></td> |
|
128 | 128 | </tr> |
129 | 129 | <tr> |
130 | - <td data-export-label="Page for Posts"><?php _e( 'Page for Posts', 'give' ); ?>:</td> |
|
131 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The page set to display your posts.', 'give' ) ); ?>"></span></td> |
|
132 | - <td><?php echo 0 !== $blog_page_id ? esc_html( get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' ) : __( 'Unset', 'give' ); ?></td> |
|
130 | + <td data-export-label="Page for Posts"><?php _e('Page for Posts', 'give'); ?>:</td> |
|
131 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The page set to display your posts.', 'give')); ?>"></span></td> |
|
132 | + <td><?php echo 0 !== $blog_page_id ? esc_html(get_the_title($blog_page_id).' (#'.$blog_page_id.')') : __('Unset', 'give'); ?></td> |
|
133 | 133 | </tr> |
134 | - <?php endif;?> |
|
134 | + <?php endif; ?> |
|
135 | 135 | <tr> |
136 | - <td data-export-label="Table Prefix Length"><?php _e( 'Table Prefix Length', 'give' ); ?>:</td> |
|
137 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The length of the table prefix used in your WordPress database.', 'give' ) ); ?>"></span></td> |
|
138 | - <td><?php echo esc_html( strlen( $wpdb->prefix ) ); ?></td> |
|
136 | + <td data-export-label="Table Prefix Length"><?php _e('Table Prefix Length', 'give'); ?>:</td> |
|
137 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The length of the table prefix used in your WordPress database.', 'give')); ?>"></span></td> |
|
138 | + <td><?php echo esc_html(strlen($wpdb->prefix)); ?></td> |
|
139 | 139 | </tr> |
140 | 140 | <tr> |
141 | - <td data-export-label="Table Prefix Status"><?php _e( 'Table Prefix Status', 'give' ); ?>:</td> |
|
142 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The status of the table prefix used in your WordPress database.', 'give' ) ); ?>"></span></td> |
|
143 | - <td><?php echo strlen( $wpdb->prefix ) > 16 ? esc_html( 'Error: Too long', 'give' ) : esc_html( 'Acceptable', 'give' ); ?></td> |
|
141 | + <td data-export-label="Table Prefix Status"><?php _e('Table Prefix Status', 'give'); ?>:</td> |
|
142 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The status of the table prefix used in your WordPress database.', 'give')); ?>"></span></td> |
|
143 | + <td><?php echo strlen($wpdb->prefix) > 16 ? esc_html('Error: Too long', 'give') : esc_html('Acceptable', 'give'); ?></td> |
|
144 | 144 | </tr> |
145 | 145 | <tr> |
146 | - <td data-export-label="Admin AJAX"><?php _e( 'Admin AJAX', 'give' ); ?>:</td> |
|
147 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether Admin AJAX is accessible.', 'give' ) ); ?>"></span></td> |
|
148 | - <td><?php echo give_test_ajax_works() ? __( 'Accessible', 'give' ) : __( 'Inaccessible', 'give' ); ?></td> |
|
146 | + <td data-export-label="Admin AJAX"><?php _e('Admin AJAX', 'give'); ?>:</td> |
|
147 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether Admin AJAX is accessible.', 'give')); ?>"></span></td> |
|
148 | + <td><?php echo give_test_ajax_works() ? __('Accessible', 'give') : __('Inaccessible', 'give'); ?></td> |
|
149 | 149 | </tr> |
150 | 150 | <tr> |
151 | - <td data-export-label="Registered Post Stati"><?php _e( 'Registered Post Stati', 'give' ); ?>:</td> |
|
152 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'A list of all registered post stati.', 'give' ) ); ?>"></span></td> |
|
153 | - <td><?php echo esc_html( implode( ', ', get_post_stati() ) ); ?></td> |
|
151 | + <td data-export-label="Registered Post Stati"><?php _e('Registered Post Stati', 'give'); ?>:</td> |
|
152 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('A list of all registered post stati.', 'give')); ?>"></span></td> |
|
153 | + <td><?php echo esc_html(implode(', ', get_post_stati())); ?></td> |
|
154 | 154 | </tr> |
155 | 155 | </tbody> |
156 | 156 | </table> |
@@ -158,90 +158,90 @@ discard block |
||
158 | 158 | <table class="give-status-table widefat" cellspacing="0"> |
159 | 159 | <thead> |
160 | 160 | <tr> |
161 | - <th colspan="3" data-export-label="Server Environment"><h2><?php _e( 'Server Environment', 'give' ); ?></h2></th> |
|
161 | + <th colspan="3" data-export-label="Server Environment"><h2><?php _e('Server Environment', 'give'); ?></h2></th> |
|
162 | 162 | </tr> |
163 | 163 | </thead> |
164 | 164 | <tbody> |
165 | 165 | <tr> |
166 | - <td data-export-label="Hosting Provider"><?php _e( 'Hosting Provider', 'give' ); ?>:</td> |
|
167 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The hosting provider for this WordPress installation.', 'give' ) ); ?>"></span></td> |
|
168 | - <td><?php echo give_get_host() ? esc_html( give_get_host() ) : __( 'Unknown', 'give' ); ?></td> |
|
166 | + <td data-export-label="Hosting Provider"><?php _e('Hosting Provider', 'give'); ?>:</td> |
|
167 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The hosting provider for this WordPress installation.', 'give')); ?>"></span></td> |
|
168 | + <td><?php echo give_get_host() ? esc_html(give_get_host()) : __('Unknown', 'give'); ?></td> |
|
169 | 169 | </tr> |
170 | 170 | <tr> |
171 | - <td data-export-label="TLS Connection"><?php _e( 'TLS Connection', 'give' ); ?>:</td> |
|
172 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Most payment gateway APIs only support connections using the TLS 1.2 security protocol.', 'give' ) ); ?>"></span></td> |
|
171 | + <td data-export-label="TLS Connection"><?php _e('TLS Connection', 'give'); ?>:</td> |
|
172 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Most payment gateway APIs only support connections using the TLS 1.2 security protocol.', 'give')); ?>"></span></td> |
|
173 | 173 | <td><?php |
174 | - $tls_check = wp_remote_post( 'https://www.howsmyssl.com/a/check' ); |
|
175 | - if ( ! is_wp_error( $tls_check ) ) { |
|
176 | - $tls_check = json_decode( wp_remote_retrieve_body( $tls_check ) ); |
|
174 | + $tls_check = wp_remote_post('https://www.howsmyssl.com/a/check'); |
|
175 | + if ( ! is_wp_error($tls_check)) { |
|
176 | + $tls_check = json_decode(wp_remote_retrieve_body($tls_check)); |
|
177 | 177 | /* translators: %s: SSL connection response */ |
178 | - printf( __('Connection uses %s', 'give'), esc_html( $tls_check->tls_version )) ; |
|
178 | + printf(__('Connection uses %s', 'give'), esc_html($tls_check->tls_version)); |
|
179 | 179 | } |
180 | 180 | ?></td> |
181 | 181 | </tr> |
182 | 182 | <tr> |
183 | - <td data-export-label="TLS Connection"><?php _e( 'TLS Rating', 'give' ); ?>:</td> |
|
184 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The server\'s connection as rated by https://www.howsmyssl.com/', 'give' ) ); ?>"></span></td> |
|
185 | - <td><?php if ( ! is_wp_error( $tls_check ) ) { |
|
186 | - esc_html_e( $tls_check->rating); |
|
183 | + <td data-export-label="TLS Connection"><?php _e('TLS Rating', 'give'); ?>:</td> |
|
184 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The server\'s connection as rated by https://www.howsmyssl.com/', 'give')); ?>"></span></td> |
|
185 | + <td><?php if ( ! is_wp_error($tls_check)) { |
|
186 | + esc_html_e($tls_check->rating); |
|
187 | 187 | } ?></td> |
188 | 188 | </tr> |
189 | 189 | <tr> |
190 | - <td data-export-label="Server Info"><?php _e( 'Server Info', 'give' ); ?>:</td> |
|
191 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Information about the web server that is currently hosting your site.', 'give' ) ); ?>"></span></td> |
|
192 | - <td><?php echo esc_html( $_SERVER['SERVER_SOFTWARE'] ); ?></td> |
|
190 | + <td data-export-label="Server Info"><?php _e('Server Info', 'give'); ?>:</td> |
|
191 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Information about the web server that is currently hosting your site.', 'give')); ?>"></span></td> |
|
192 | + <td><?php echo esc_html($_SERVER['SERVER_SOFTWARE']); ?></td> |
|
193 | 193 | </tr> |
194 | 194 | <tr> |
195 | - <td data-export-label="PHP Version"><?php _e( 'PHP Version', 'give' ); ?>:</td> |
|
196 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of PHP installed on your hosting server.', 'give' ) ); ?>"></span></td> |
|
195 | + <td data-export-label="PHP Version"><?php _e('PHP Version', 'give'); ?>:</td> |
|
196 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of PHP installed on your hosting server.', 'give')); ?>"></span></td> |
|
197 | 197 | <td><?php |
198 | 198 | // Check if phpversion function exists. |
199 | - if ( function_exists( 'phpversion' ) ) { |
|
199 | + if (function_exists('phpversion')) { |
|
200 | 200 | $php_version = phpversion(); |
201 | 201 | |
202 | - if ( version_compare( $php_version, '5.6', '<' ) ) { |
|
203 | - echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend a minimum PHP version of 5.6. See: %s', 'give' ), esc_html( $php_version ), '<a href="http://docs.givewp.com/settings-system-info" target="_blank">' . __( 'PHP Requirements in Give', 'give' ) . '</a>' ) . '</mark>'; |
|
202 | + if (version_compare($php_version, '5.6', '<')) { |
|
203 | + echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('%s - We recommend a minimum PHP version of 5.6. See: %s', 'give'), esc_html($php_version), '<a href="http://docs.givewp.com/settings-system-info" target="_blank">'.__('PHP Requirements in Give', 'give').'</a>').'</mark>'; |
|
204 | 204 | } else { |
205 | - echo '<mark class="yes">' . esc_html( $php_version ) . '</mark>'; |
|
205 | + echo '<mark class="yes">'.esc_html($php_version).'</mark>'; |
|
206 | 206 | } |
207 | 207 | } else { |
208 | - _e( "Couldn't determine PHP version because phpversion() doesn't exist.", 'give' ); |
|
208 | + _e("Couldn't determine PHP version because phpversion() doesn't exist.", 'give'); |
|
209 | 209 | } |
210 | 210 | ?></td> |
211 | 211 | </tr> |
212 | - <?php if ( function_exists( 'ini_get' ) ) : ?> |
|
212 | + <?php if (function_exists('ini_get')) : ?> |
|
213 | 213 | <tr> |
214 | - <td data-export-label="PHP Post Max Size"><?php _e( 'PHP Post Max Size', 'give' ); ?>:</td> |
|
215 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The largest filesize that can be contained in one post.', 'give' ) ); ?>"></span></td> |
|
216 | - <td><?php echo size_format( give_let_to_num( ini_get( 'post_max_size' ) ) ); ?></td> |
|
214 | + <td data-export-label="PHP Post Max Size"><?php _e('PHP Post Max Size', 'give'); ?>:</td> |
|
215 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The largest filesize that can be contained in one post.', 'give')); ?>"></span></td> |
|
216 | + <td><?php echo size_format(give_let_to_num(ini_get('post_max_size'))); ?></td> |
|
217 | 217 | </tr> |
218 | 218 | <tr> |
219 | - <td data-export-label="PHP Time Limit"><?php _e( 'PHP Time Limit', 'give' ); ?>:</td> |
|
220 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The amount of time (in seconds) that your site will spend on a single operation before timing out (to avoid server lockups).', 'give' ) ); ?>"></span></td> |
|
221 | - <td><?php echo ini_get( 'max_execution_time' ); ?></td> |
|
219 | + <td data-export-label="PHP Time Limit"><?php _e('PHP Time Limit', 'give'); ?>:</td> |
|
220 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The amount of time (in seconds) that your site will spend on a single operation before timing out (to avoid server lockups).', 'give')); ?>"></span></td> |
|
221 | + <td><?php echo ini_get('max_execution_time'); ?></td> |
|
222 | 222 | </tr> |
223 | 223 | <tr> |
224 | - <td data-export-label="PHP Max Input Vars"><?php _e( 'PHP Max Input Vars', 'give' ); ?>:</td> |
|
225 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The maximum number of variables your server can use for a single function to avoid overloads.', 'give' ) ); ?>"></span></td> |
|
226 | - <td><?php echo ini_get( 'max_input_vars' ); ?></td> |
|
224 | + <td data-export-label="PHP Max Input Vars"><?php _e('PHP Max Input Vars', 'give'); ?>:</td> |
|
225 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The maximum number of variables your server can use for a single function to avoid overloads.', 'give')); ?>"></span></td> |
|
226 | + <td><?php echo ini_get('max_input_vars'); ?></td> |
|
227 | 227 | </tr> |
228 | 228 | <tr> |
229 | - <td data-export-label="PHP Max Upload Size"><?php _e( 'PHP Max Upload Size', 'give' ); ?>:</td> |
|
230 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The largest filesize that can be uploaded to your WordPress installation.', 'give' ) ); ?>"></span></td> |
|
231 | - <td><?php echo size_format( wp_max_upload_size() ); ?></td> |
|
229 | + <td data-export-label="PHP Max Upload Size"><?php _e('PHP Max Upload Size', 'give'); ?>:</td> |
|
230 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The largest filesize that can be uploaded to your WordPress installation.', 'give')); ?>"></span></td> |
|
231 | + <td><?php echo size_format(wp_max_upload_size()); ?></td> |
|
232 | 232 | </tr> |
233 | 233 | <tr> |
234 | - <td data-export-label="cURL Version"><?php _e( 'cURL Version', 'give' ); ?>:</td> |
|
235 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of cURL installed on your server.', 'give' ) ); ?>"></span></td> |
|
234 | + <td data-export-label="cURL Version"><?php _e('cURL Version', 'give'); ?>:</td> |
|
235 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of cURL installed on your server.', 'give')); ?>"></span></td> |
|
236 | 236 | <td> |
237 | 237 | <?php |
238 | - if ( function_exists( 'curl_version' ) ) { |
|
238 | + if (function_exists('curl_version')) { |
|
239 | 239 | $curl_version = curl_version(); |
240 | 240 | |
241 | - if ( version_compare( $curl_version['version'], '7.40', '<' ) ) { |
|
242 | - echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend a minimum cURL version of 7.40.', 'give' ), esc_html( $curl_version['version'] . ', ' . $curl_version['ssl_version'] ) ) . '</mark>'; |
|
241 | + if (version_compare($curl_version['version'], '7.40', '<')) { |
|
242 | + echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('%s - We recommend a minimum cURL version of 7.40.', 'give'), esc_html($curl_version['version'].', '.$curl_version['ssl_version'])).'</mark>'; |
|
243 | 243 | } else { |
244 | - echo '<mark class="yes">' . esc_html( $curl_version['version'] . ', ' . $curl_version['ssl_version'] ) . '</mark>'; |
|
244 | + echo '<mark class="yes">'.esc_html($curl_version['version'].', '.$curl_version['ssl_version']).'</mark>'; |
|
245 | 245 | } |
246 | 246 | } else { |
247 | 247 | echo '&ndash'; |
@@ -250,42 +250,42 @@ discard block |
||
250 | 250 | </td> |
251 | 251 | </tr> |
252 | 252 | <tr> |
253 | - <td data-export-label="SUHOSIN Installed"><?php _e( 'SUHOSIN Installed', 'give' ); ?>:</td> |
|
254 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Suhosin is an advanced protection system for PHP installations. It was designed to protect your servers on the one hand against a number of well known problems in PHP applications and on the other hand against potential unknown vulnerabilities within these applications or the PHP core itself. If enabled on your server, Suhosin may need to be configured to increase its data submission limits.', 'give' ) ); ?>"></span></td> |
|
255 | - <td><?php echo extension_loaded( 'suhosin' ) ? '<span class="dashicons dashicons-yes"></span>' : '–'; ?></td> |
|
253 | + <td data-export-label="SUHOSIN Installed"><?php _e('SUHOSIN Installed', 'give'); ?>:</td> |
|
254 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Suhosin is an advanced protection system for PHP installations. It was designed to protect your servers on the one hand against a number of well known problems in PHP applications and on the other hand against potential unknown vulnerabilities within these applications or the PHP core itself. If enabled on your server, Suhosin may need to be configured to increase its data submission limits.', 'give')); ?>"></span></td> |
|
255 | + <td><?php echo extension_loaded('suhosin') ? '<span class="dashicons dashicons-yes"></span>' : '–'; ?></td> |
|
256 | 256 | </tr> |
257 | 257 | <?php endif; |
258 | 258 | |
259 | - if ( $wpdb->use_mysqli ) { |
|
260 | - $ver = mysqli_get_server_info( $wpdb->dbh ); |
|
259 | + if ($wpdb->use_mysqli) { |
|
260 | + $ver = mysqli_get_server_info($wpdb->dbh); |
|
261 | 261 | } else { |
262 | 262 | $ver = mysql_get_server_info(); |
263 | 263 | } |
264 | 264 | |
265 | - if ( ! empty( $wpdb->is_mysql ) && ! stristr( $ver, 'MariaDB' ) ) : ?> |
|
265 | + if ( ! empty($wpdb->is_mysql) && ! stristr($ver, 'MariaDB')) : ?> |
|
266 | 266 | <tr> |
267 | - <td data-export-label="MySQL Version"><?php _e( 'MySQL Version', 'give' ); ?>:</td> |
|
268 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of MySQL installed on your hosting server.', 'give' ) ); ?>"></span></td> |
|
267 | + <td data-export-label="MySQL Version"><?php _e('MySQL Version', 'give'); ?>:</td> |
|
268 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of MySQL installed on your hosting server.', 'give')); ?>"></span></td> |
|
269 | 269 | <td> |
270 | 270 | <?php |
271 | 271 | $mysql_version = $wpdb->db_version(); |
272 | 272 | |
273 | - if ( version_compare( $mysql_version, '5.6', '<' ) ) { |
|
274 | - echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( '%s - We recommend a minimum MySQL version of 5.6. See: %s', 'give' ), esc_html( $mysql_version ), '<a href="https://wordpress.org/about/requirements/" target="_blank">' . __( 'WordPress Requirements', 'give' ) . '</a>' ) . '</mark>'; |
|
273 | + if (version_compare($mysql_version, '5.6', '<')) { |
|
274 | + echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('%s - We recommend a minimum MySQL version of 5.6. See: %s', 'give'), esc_html($mysql_version), '<a href="https://wordpress.org/about/requirements/" target="_blank">'.__('WordPress Requirements', 'give').'</a>').'</mark>'; |
|
275 | 275 | } else { |
276 | - echo '<mark class="yes">' . esc_html( $mysql_version ) . '</mark>'; |
|
276 | + echo '<mark class="yes">'.esc_html($mysql_version).'</mark>'; |
|
277 | 277 | } |
278 | 278 | ?> |
279 | 279 | </td> |
280 | 280 | </tr> |
281 | 281 | <?php endif; ?> |
282 | 282 | <tr> |
283 | - <td data-export-label="Default Timezone is UTC"><?php _e( 'Default Timezone is UTC', 'give' ); ?>:</td> |
|
284 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The default timezone for your server.', 'give' ) ); ?>"></span></td> |
|
283 | + <td data-export-label="Default Timezone is UTC"><?php _e('Default Timezone is UTC', 'give'); ?>:</td> |
|
284 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The default timezone for your server.', 'give')); ?>"></span></td> |
|
285 | 285 | <td><?php |
286 | 286 | $default_timezone = date_default_timezone_get(); |
287 | - if ( 'UTC' !== $default_timezone ) { |
|
288 | - echo '<mark class="error"><span class="dashicons dashicons-warning"></span> ' . sprintf( __( 'Default timezone is %s - it should be UTC', 'give' ), $default_timezone ) . '</mark>'; |
|
287 | + if ('UTC' !== $default_timezone) { |
|
288 | + echo '<mark class="error"><span class="dashicons dashicons-warning"></span> '.sprintf(__('Default timezone is %s - it should be UTC', 'give'), $default_timezone).'</mark>'; |
|
289 | 289 | } else { |
290 | 290 | echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark>'; |
291 | 291 | } ?> |
@@ -296,118 +296,118 @@ discard block |
||
296 | 296 | |
297 | 297 | // fsockopen/cURL. |
298 | 298 | $posting['fsockopen_curl']['name'] = 'fsockopen/cURL'; |
299 | - $posting['fsockopen_curl']['help'] = __( 'Payment gateways can use cURL to communicate with remote servers to authorize payments, other plugins may also use it when communicating with remote services.', 'give' ); |
|
299 | + $posting['fsockopen_curl']['help'] = __('Payment gateways can use cURL to communicate with remote servers to authorize payments, other plugins may also use it when communicating with remote services.', 'give'); |
|
300 | 300 | |
301 | - if ( function_exists( 'fsockopen' ) || function_exists( 'curl_init' ) ) { |
|
301 | + if (function_exists('fsockopen') || function_exists('curl_init')) { |
|
302 | 302 | $posting['fsockopen_curl']['success'] = true; |
303 | 303 | } else { |
304 | 304 | $posting['fsockopen_curl']['success'] = false; |
305 | - $posting['fsockopen_curl']['note'] = __( 'Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'give' ); |
|
305 | + $posting['fsockopen_curl']['note'] = __('Your server does not have fsockopen or cURL enabled - PayPal IPN and other scripts which communicate with other servers will not work. Contact your hosting provider.', 'give'); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | // SOAP. |
309 | 309 | $posting['soap_client']['name'] = 'SoapClient'; |
310 | - $posting['soap_client']['help'] = __( 'Some webservices like shipping use SOAP to get information from remote servers, for example, live shipping quotes from FedEx require SOAP to be installed.', 'give' ); |
|
310 | + $posting['soap_client']['help'] = __('Some webservices like shipping use SOAP to get information from remote servers, for example, live shipping quotes from FedEx require SOAP to be installed.', 'give'); |
|
311 | 311 | |
312 | - if ( class_exists( 'SoapClient' ) ) { |
|
312 | + if (class_exists('SoapClient')) { |
|
313 | 313 | $posting['soap_client']['success'] = true; |
314 | 314 | } else { |
315 | 315 | $posting['soap_client']['success'] = false; |
316 | - $posting['soap_client']['note'] = sprintf( __( 'Your server does not have the %s class enabled - some gateway plugins which use SOAP may not work as expected.', 'give' ), '<a href="https://php.net/manual/en/class.soapclient.php">SoapClient</a>' ); |
|
316 | + $posting['soap_client']['note'] = sprintf(__('Your server does not have the %s class enabled - some gateway plugins which use SOAP may not work as expected.', 'give'), '<a href="https://php.net/manual/en/class.soapclient.php">SoapClient</a>'); |
|
317 | 317 | } |
318 | 318 | |
319 | 319 | // DOMDocument. |
320 | 320 | $posting['dom_document']['name'] = 'DOMDocument'; |
321 | - $posting['dom_document']['help'] = __( 'HTML/Multipart emails use DOMDocument to generate inline CSS in templates.', 'give' ); |
|
321 | + $posting['dom_document']['help'] = __('HTML/Multipart emails use DOMDocument to generate inline CSS in templates.', 'give'); |
|
322 | 322 | |
323 | - if ( class_exists( 'DOMDocument' ) ) { |
|
323 | + if (class_exists('DOMDocument')) { |
|
324 | 324 | $posting['dom_document']['success'] = true; |
325 | 325 | } else { |
326 | 326 | $posting['dom_document']['success'] = false; |
327 | - $posting['dom_document']['note'] = sprintf( __( 'Your server does not have the %s class enabled - HTML/Multipart emails, and also some extensions, will not work without DOMDocument.', 'give' ), '<a href="https://php.net/manual/en/class.domdocument.php">DOMDocument</a>' ); |
|
327 | + $posting['dom_document']['note'] = sprintf(__('Your server does not have the %s class enabled - HTML/Multipart emails, and also some extensions, will not work without DOMDocument.', 'give'), '<a href="https://php.net/manual/en/class.domdocument.php">DOMDocument</a>'); |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | // gzip. |
331 | 331 | $posting['gzip']['name'] = 'gzip'; |
332 | - $posting['gzip']['help'] = __( 'gzip is used for file compression and decompression.', 'give' ); |
|
332 | + $posting['gzip']['help'] = __('gzip is used for file compression and decompression.', 'give'); |
|
333 | 333 | |
334 | - if ( is_callable( 'gzopen' ) ) { |
|
334 | + if (is_callable('gzopen')) { |
|
335 | 335 | $posting['gzip']['success'] = true; |
336 | 336 | } else { |
337 | 337 | $posting['gzip']['success'] = false; |
338 | - $posting['gzip']['note'] = sprintf( __( 'Your server does not support the %s function - this is used for file compression and decompression.', 'give' ), '<a href="https://php.net/manual/en/zlib.installation.php">gzopen</a>' ); |
|
338 | + $posting['gzip']['note'] = sprintf(__('Your server does not support the %s function - this is used for file compression and decompression.', 'give'), '<a href="https://php.net/manual/en/zlib.installation.php">gzopen</a>'); |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | // GD Graphics Library. |
342 | 342 | $posting['gd']['name'] = 'GD Graphics Library'; |
343 | - $posting['gd']['help'] = __( 'GD Graphics Library is used for dynamically manipulating images.', 'give' ); |
|
344 | - $posting['gd']['success'] = extension_loaded( 'gd' ) && function_exists( 'gd_info' ) ? true : false; |
|
343 | + $posting['gd']['help'] = __('GD Graphics Library is used for dynamically manipulating images.', 'give'); |
|
344 | + $posting['gd']['success'] = extension_loaded('gd') && function_exists('gd_info') ? true : false; |
|
345 | 345 | |
346 | 346 | // Multibyte String. |
347 | 347 | $posting['mbstring']['name'] = 'Multibyte String'; |
348 | - $posting['mbstring']['help'] = __( 'Multibyte String (mbstring) is used to convert character encoding, like for emails or converting characters to lowercase.', 'give' ); |
|
348 | + $posting['mbstring']['help'] = __('Multibyte String (mbstring) is used to convert character encoding, like for emails or converting characters to lowercase.', 'give'); |
|
349 | 349 | |
350 | - if ( extension_loaded( 'mbstring' ) ) { |
|
350 | + if (extension_loaded('mbstring')) { |
|
351 | 351 | $posting['mbstring']['success'] = true; |
352 | 352 | } else { |
353 | 353 | $posting['mbstring']['success'] = false; |
354 | - $posting['mbstring']['note'] = sprintf( __( 'Your server does not support the %s functions - this is required for better character encoding. Some fallbacks will be used instead for it.', 'give' ), '<a href="https://php.net/manual/en/mbstring.installation.php">mbstring</a>' ); |
|
354 | + $posting['mbstring']['note'] = sprintf(__('Your server does not support the %s functions - this is required for better character encoding. Some fallbacks will be used instead for it.', 'give'), '<a href="https://php.net/manual/en/mbstring.installation.php">mbstring</a>'); |
|
355 | 355 | } |
356 | 356 | |
357 | 357 | // WP Remote Post Check. |
358 | - $posting['wp_remote_post']['name'] = __( 'Remote Post', 'give'); |
|
359 | - $posting['wp_remote_post']['help'] = __( 'PayPal uses this method of communicating when sending back transaction information.', 'give' ); |
|
358 | + $posting['wp_remote_post']['name'] = __('Remote Post', 'give'); |
|
359 | + $posting['wp_remote_post']['help'] = __('PayPal uses this method of communicating when sending back transaction information.', 'give'); |
|
360 | 360 | |
361 | - $response = wp_safe_remote_post( 'https://www.paypal.com/cgi-bin/webscr', array( |
|
361 | + $response = wp_safe_remote_post('https://www.paypal.com/cgi-bin/webscr', array( |
|
362 | 362 | 'timeout' => 60, |
363 | - 'user-agent' => 'Give/' . GIVE_VERSION, |
|
363 | + 'user-agent' => 'Give/'.GIVE_VERSION, |
|
364 | 364 | 'httpversion' => '1.1', |
365 | 365 | 'body' => array( |
366 | 366 | 'cmd' => '_notify-validate' |
367 | 367 | ) |
368 | - ) ); |
|
368 | + )); |
|
369 | 369 | |
370 | - if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
370 | + if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) { |
|
371 | 371 | $posting['wp_remote_post']['success'] = true; |
372 | 372 | } else { |
373 | - $posting['wp_remote_post']['note'] = __( 'wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider.', 'give' ); |
|
374 | - if ( is_wp_error( $response ) ) { |
|
375 | - $posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Error: %s', 'give' ), sanitize_text_field( $response->get_error_message() ) ); |
|
373 | + $posting['wp_remote_post']['note'] = __('wp_remote_post() failed. PayPal IPN won\'t work with your server. Contact your hosting provider.', 'give'); |
|
374 | + if (is_wp_error($response)) { |
|
375 | + $posting['wp_remote_post']['note'] .= ' '.sprintf(__('Error: %s', 'give'), sanitize_text_field($response->get_error_message())); |
|
376 | 376 | } else { |
377 | - $posting['wp_remote_post']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'give' ), sanitize_text_field( $response['response']['code'] ) ); |
|
377 | + $posting['wp_remote_post']['note'] .= ' '.sprintf(__('Status code: %s', 'give'), sanitize_text_field($response['response']['code'])); |
|
378 | 378 | } |
379 | 379 | $posting['wp_remote_post']['success'] = false; |
380 | 380 | } |
381 | 381 | |
382 | 382 | // WP Remote Get Check. |
383 | - $posting['wp_remote_get']['name'] = __( 'Remote Get', 'give'); |
|
384 | - $posting['wp_remote_get']['help'] = __( 'Give plugins may use this method of communication when checking for plugin updates.', 'give' ); |
|
383 | + $posting['wp_remote_get']['name'] = __('Remote Get', 'give'); |
|
384 | + $posting['wp_remote_get']['help'] = __('Give plugins may use this method of communication when checking for plugin updates.', 'give'); |
|
385 | 385 | |
386 | - $response = wp_safe_remote_get( 'https://woocommerce.com/wc-api/product-key-api?request=ping&network=' . ( is_multisite() ? '1' : '0' ) ); |
|
386 | + $response = wp_safe_remote_get('https://woocommerce.com/wc-api/product-key-api?request=ping&network='.(is_multisite() ? '1' : '0')); |
|
387 | 387 | |
388 | - if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
388 | + if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) { |
|
389 | 389 | $posting['wp_remote_get']['success'] = true; |
390 | 390 | } else { |
391 | - $posting['wp_remote_get']['note'] = __( 'wp_remote_get() failed. The Give plugin updater won\'t work with your server. Contact your hosting provider.', 'give' ); |
|
392 | - if ( is_wp_error( $response ) ) { |
|
393 | - $posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Error: %s', 'give' ), give_clean( $response->get_error_message() ) ); |
|
391 | + $posting['wp_remote_get']['note'] = __('wp_remote_get() failed. The Give plugin updater won\'t work with your server. Contact your hosting provider.', 'give'); |
|
392 | + if (is_wp_error($response)) { |
|
393 | + $posting['wp_remote_get']['note'] .= ' '.sprintf(__('Error: %s', 'give'), give_clean($response->get_error_message())); |
|
394 | 394 | } else { |
395 | - $posting['wp_remote_get']['note'] .= ' ' . sprintf( __( 'Status code: %s', 'give' ), give_clean( $response['response']['code'] ) ); |
|
395 | + $posting['wp_remote_get']['note'] .= ' '.sprintf(__('Status code: %s', 'give'), give_clean($response['response']['code'])); |
|
396 | 396 | } |
397 | 397 | $posting['wp_remote_get']['success'] = false; |
398 | 398 | } |
399 | 399 | |
400 | - $posting = apply_filters( 'give_debug_posting', $posting ); |
|
400 | + $posting = apply_filters('give_debug_posting', $posting); |
|
401 | 401 | |
402 | - foreach ( $posting as $post ) { |
|
403 | - $mark = ! empty( $post['success'] ) ? 'yes' : 'error'; |
|
402 | + foreach ($posting as $post) { |
|
403 | + $mark = ! empty($post['success']) ? 'yes' : 'error'; |
|
404 | 404 | ?> |
405 | 405 | <tr> |
406 | - <td data-export-label="<?php echo esc_html( $post['name'] ); ?>"><?php echo esc_html( $post['name'] ); ?>:</td> |
|
407 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( isset( $post['help'] ) ? $post['help'] : '' ); ?>"></span></td> |
|
406 | + <td data-export-label="<?php echo esc_html($post['name']); ?>"><?php echo esc_html($post['name']); ?>:</td> |
|
407 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(isset($post['help']) ? $post['help'] : ''); ?>"></span></td> |
|
408 | 408 | <td> |
409 | 409 | <mark class="<?php echo $mark; ?>"> |
410 | - <?php echo ! empty( $post['success'] ) ? '<span class="dashicons dashicons-yes"></span>' : '<span class="dashicons dashicons-no-alt"></span>'; ?> <?php echo ! empty( $post['note'] ) ? wp_kses_data( $post['note'] ) : ''; ?> |
|
410 | + <?php echo ! empty($post['success']) ? '<span class="dashicons dashicons-yes"></span>' : '<span class="dashicons dashicons-no-alt"></span>'; ?> <?php echo ! empty($post['note']) ? wp_kses_data($post['note']) : ''; ?> |
|
411 | 411 | </mark> |
412 | 412 | </td> |
413 | 413 | </tr> |
@@ -420,122 +420,122 @@ discard block |
||
420 | 420 | <table class="give-status-table widefat" cellspacing="0"> |
421 | 421 | <thead> |
422 | 422 | <tr> |
423 | - <th colspan="3" data-export-label="Give Configuration"><h2><?php _e( 'Give Configuration', 'give' ); ?></h2></th> |
|
423 | + <th colspan="3" data-export-label="Give Configuration"><h2><?php _e('Give Configuration', 'give'); ?></h2></th> |
|
424 | 424 | </tr> |
425 | 425 | </thead> |
426 | 426 | <tbody> |
427 | 427 | <tr> |
428 | - <td data-export-label="Give Version"><?php _e( 'Give Version', 'give' ); ?>:</td> |
|
429 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of Give installed on your site.', 'give' ) ); ?>"></span></td> |
|
430 | - <td><?php echo esc_html( GIVE_VERSION ); ?></td> |
|
428 | + <td data-export-label="Give Version"><?php _e('Give Version', 'give'); ?>:</td> |
|
429 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of Give installed on your site.', 'give')); ?>"></span></td> |
|
430 | + <td><?php echo esc_html(GIVE_VERSION); ?></td> |
|
431 | 431 | </tr> |
432 | 432 | <tr> |
433 | - <td data-export-label="Upgraded From"><?php _e( 'Upgraded From', 'give' ); ?>:</td> |
|
434 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The version of Give installed prior to the last update.', 'give' ) ); ?>"></span></td> |
|
435 | - <td><?php echo esc_html( get_option( 'give_version_upgraded_from', '–' ) ); ?></td> |
|
433 | + <td data-export-label="Upgraded From"><?php _e('Upgraded From', 'give'); ?>:</td> |
|
434 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The version of Give installed prior to the last update.', 'give')); ?>"></span></td> |
|
435 | + <td><?php echo esc_html(get_option('give_version_upgraded_from', '–')); ?></td> |
|
436 | 436 | </tr> |
437 | 437 | <tr> |
438 | - <td data-export-label="Test Mode"><?php _e( 'Test Mode', 'give' ); ?>:</td> |
|
439 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether Test Mode is enabled in Give settings.', 'give' ) ); ?>"></span></td> |
|
440 | - <td><?php echo give_is_test_mode() ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
438 | + <td data-export-label="Test Mode"><?php _e('Test Mode', 'give'); ?>:</td> |
|
439 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether Test Mode is enabled in Give settings.', 'give')); ?>"></span></td> |
|
440 | + <td><?php echo give_is_test_mode() ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
441 | 441 | </tr> |
442 | 442 | <tr> |
443 | - <td data-export-label="Currency Code"><?php _e( 'Currency Code', 'give' ); ?>:</td> |
|
444 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The currency code selected in Give settings.', 'give' ) ); ?>"></span></td> |
|
445 | - <td><?php echo esc_html( give_get_currency() ); ?></td> |
|
443 | + <td data-export-label="Currency Code"><?php _e('Currency Code', 'give'); ?>:</td> |
|
444 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The currency code selected in Give settings.', 'give')); ?>"></span></td> |
|
445 | + <td><?php echo esc_html(give_get_currency()); ?></td> |
|
446 | 446 | </tr> |
447 | 447 | <tr> |
448 | - <td data-export-label="Currency Position"><?php _e( 'Currency Position', 'give' ); ?>:</td> |
|
449 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The currency position selected in Give settings.', 'give' ) ); ?>"></span></td> |
|
450 | - <td><?php echo 'before' === give_get_option( 'currency_position' ) ? __( 'Before', 'give' ) : __( 'After', 'give' ); ?></td> |
|
448 | + <td data-export-label="Currency Position"><?php _e('Currency Position', 'give'); ?>:</td> |
|
449 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The currency position selected in Give settings.', 'give')); ?>"></span></td> |
|
450 | + <td><?php echo 'before' === give_get_option('currency_position') ? __('Before', 'give') : __('After', 'give'); ?></td> |
|
451 | 451 | </tr> |
452 | 452 | <tr> |
453 | - <td data-export-label="Decimal Separator"><?php _e( 'Decimal Separator', 'give' ); ?>:</td> |
|
454 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The decimal separator defined in Give settings.', 'give' ) ); ?>"></span></td> |
|
455 | - <td><?php echo esc_html( give_get_price_decimal_separator() ); ?></td> |
|
453 | + <td data-export-label="Decimal Separator"><?php _e('Decimal Separator', 'give'); ?>:</td> |
|
454 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The decimal separator defined in Give settings.', 'give')); ?>"></span></td> |
|
455 | + <td><?php echo esc_html(give_get_price_decimal_separator()); ?></td> |
|
456 | 456 | </tr> |
457 | 457 | <tr> |
458 | - <td data-export-label="Thousands Separator"><?php _e( 'Thousands Separator', 'give' ); ?>:</td> |
|
459 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The thousands separator defined in Give settings.', 'give' ) ); ?>"></span></td> |
|
460 | - <td><?php echo esc_html( give_get_price_thousand_separator() ); ?></td> |
|
458 | + <td data-export-label="Thousands Separator"><?php _e('Thousands Separator', 'give'); ?>:</td> |
|
459 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The thousands separator defined in Give settings.', 'give')); ?>"></span></td> |
|
460 | + <td><?php echo esc_html(give_get_price_thousand_separator()); ?></td> |
|
461 | 461 | </tr> |
462 | 462 | <tr> |
463 | - <td data-export-label="Success Page"><?php _e( 'Success Page', 'give' ); ?>:</td> |
|
464 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The page where donors land following a successful transaction.', 'give' ) ); ?>"></span></td> |
|
465 | - <td><?php echo ! empty( $give_options['success_page'] ) ? esc_url( get_permalink( $give_options['success_page'] ) ) : '–'; ?></td> |
|
463 | + <td data-export-label="Success Page"><?php _e('Success Page', 'give'); ?>:</td> |
|
464 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The page where donors land following a successful transaction.', 'give')); ?>"></span></td> |
|
465 | + <td><?php echo ! empty($give_options['success_page']) ? esc_url(get_permalink($give_options['success_page'])) : '–'; ?></td> |
|
466 | 466 | </tr> |
467 | 467 | <tr> |
468 | - <td data-export-label="Failure Page"><?php _e( 'Failure Page', 'give' ); ?>:</td> |
|
469 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The page where donors land following a failed transaction.', 'give' ) ); ?>"></span></td> |
|
470 | - <td><?php echo ! empty( $give_options['failure_page'] ) ? esc_url( get_permalink( $give_options['failure_page'] ) ) : '–'; ?></td> |
|
468 | + <td data-export-label="Failure Page"><?php _e('Failure Page', 'give'); ?>:</td> |
|
469 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The page where donors land following a failed transaction.', 'give')); ?>"></span></td> |
|
470 | + <td><?php echo ! empty($give_options['failure_page']) ? esc_url(get_permalink($give_options['failure_page'])) : '–'; ?></td> |
|
471 | 471 | </tr> |
472 | 472 | <tr> |
473 | - <td data-export-label="Donation History Page"><?php _e( 'Donation History Page', 'give' ); ?>:</td> |
|
474 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The page where past donations are listed.', 'give' ) ); ?>"></span></td> |
|
475 | - <td><?php echo ! empty( $give_options['history_page'] ) ? esc_url( get_permalink( $give_options['history_page'] ) ) : '–'; ?></td> |
|
473 | + <td data-export-label="Donation History Page"><?php _e('Donation History Page', 'give'); ?>:</td> |
|
474 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The page where past donations are listed.', 'give')); ?>"></span></td> |
|
475 | + <td><?php echo ! empty($give_options['history_page']) ? esc_url(get_permalink($give_options['history_page'])) : '–'; ?></td> |
|
476 | 476 | </tr> |
477 | 477 | <tr> |
478 | - <td data-export-label="Give Forms Slug"><?php _e( 'Give Forms Slug', 'give' ); ?>:</td> |
|
479 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The slug used for Give donation forms.', 'give' ) ); ?>"></span></td> |
|
480 | - <td><?php echo esc_html( defined( 'GIVE_SLUG' ) ? '/' . GIVE_SLUG . '/' : '/donations/' ); ?></td> |
|
478 | + <td data-export-label="Give Forms Slug"><?php _e('Give Forms Slug', 'give'); ?>:</td> |
|
479 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The slug used for Give donation forms.', 'give')); ?>"></span></td> |
|
480 | + <td><?php echo esc_html(defined('GIVE_SLUG') ? '/'.GIVE_SLUG.'/' : '/donations/'); ?></td> |
|
481 | 481 | </tr> |
482 | 482 | <?php |
483 | 483 | $active_gateways = give_get_enabled_payment_gateways(); |
484 | 484 | $enabled_gateways = $default_gateway = ''; |
485 | 485 | |
486 | - if ( $active_gateways ) { |
|
487 | - $default_gateway_is_active = give_is_gateway_active( give_get_default_gateway( null ) ); |
|
486 | + if ($active_gateways) { |
|
487 | + $default_gateway_is_active = give_is_gateway_active(give_get_default_gateway(null)); |
|
488 | 488 | |
489 | - if ( $default_gateway_is_active ) { |
|
490 | - $default_gateway = give_get_default_gateway( null ); |
|
491 | - $default_gateway = $active_gateways[ $default_gateway ]['admin_label']; |
|
489 | + if ($default_gateway_is_active) { |
|
490 | + $default_gateway = give_get_default_gateway(null); |
|
491 | + $default_gateway = $active_gateways[$default_gateway]['admin_label']; |
|
492 | 492 | } else { |
493 | - $default_gateway = __( 'Test Donation', 'give' ); |
|
493 | + $default_gateway = __('Test Donation', 'give'); |
|
494 | 494 | } |
495 | 495 | |
496 | 496 | $gateways = array(); |
497 | 497 | |
498 | - foreach ( $active_gateways as $gateway ) { |
|
498 | + foreach ($active_gateways as $gateway) { |
|
499 | 499 | $gateways[] = $gateway['admin_label']; |
500 | 500 | } |
501 | 501 | |
502 | - $enabled_gateways = implode( ', ', $gateways ); |
|
502 | + $enabled_gateways = implode(', ', $gateways); |
|
503 | 503 | } |
504 | 504 | ?> |
505 | 505 | <tr> |
506 | - <td data-export-label="Enabled Payment Gateways"><?php _e( 'Enabled Payment Gateways', 'give' ); ?>:</td> |
|
507 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'All payment gateways enabled in Give settings.', 'give' ) ); ?>"></span></td> |
|
508 | - <td><?php echo esc_html( ! empty( $enabled_gateways ) ? $enabled_gateways : '–' ); ?></td> |
|
506 | + <td data-export-label="Enabled Payment Gateways"><?php _e('Enabled Payment Gateways', 'give'); ?>:</td> |
|
507 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('All payment gateways enabled in Give settings.', 'give')); ?>"></span></td> |
|
508 | + <td><?php echo esc_html( ! empty($enabled_gateways) ? $enabled_gateways : '–'); ?></td> |
|
509 | 509 | </tr> |
510 | 510 | <tr> |
511 | - <td data-export-label="Default Payment Gateway"><?php _e( 'Default Payment Gateway', 'give' ); ?>:</td> |
|
512 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The default payment gateway selected in Give settings.', 'give' ) ); ?>"></span></td> |
|
513 | - <td><?php echo esc_html( ! empty( $default_gateway ) ? $default_gateway : '–' ); ?></td> |
|
511 | + <td data-export-label="Default Payment Gateway"><?php _e('Default Payment Gateway', 'give'); ?>:</td> |
|
512 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The default payment gateway selected in Give settings.', 'give')); ?>"></span></td> |
|
513 | + <td><?php echo esc_html( ! empty($default_gateway) ? $default_gateway : '–'); ?></td> |
|
514 | 514 | </tr> |
515 | 515 | <tr> |
516 | - <td data-export-label="PayPal IPN Verification"><?php _e( 'PayPal IPN Verification', 'give' ); ?>:</td> |
|
517 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether admins requires verification of IPN notifications with PayPal.', 'give' ) ); ?>"></span></td> |
|
518 | - <td><?php echo 'enabled' === give_get_option( 'paypal_verification' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
516 | + <td data-export-label="PayPal IPN Verification"><?php _e('PayPal IPN Verification', 'give'); ?>:</td> |
|
517 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether admins requires verification of IPN notifications with PayPal.', 'give')); ?>"></span></td> |
|
518 | + <td><?php echo 'enabled' === give_get_option('paypal_verification') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
519 | 519 | </tr> |
520 | 520 | <tr> |
521 | - <td data-export-label="PayPal IPN Notifications"><?php _e( 'PayPal IPN Notifications', 'give' ); ?>:</td> |
|
522 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Displays whether when last PayPal IPN is received with which donation or transaction.', 'give' ) ); ?>"></span></td> |
|
521 | + <td data-export-label="PayPal IPN Notifications"><?php _e('PayPal IPN Notifications', 'give'); ?>:</td> |
|
522 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Displays whether when last PayPal IPN is received with which donation or transaction.', 'give')); ?>"></span></td> |
|
523 | 523 | <td> |
524 | 524 | <?php |
525 | - $last_paypal_ipn_received = get_option( 'give_last_paypal_ipn_received' ); |
|
526 | - if( is_array( $last_paypal_ipn_received ) && count( $last_paypal_ipn_received ) > 0 ) { |
|
525 | + $last_paypal_ipn_received = get_option('give_last_paypal_ipn_received'); |
|
526 | + if (is_array($last_paypal_ipn_received) && count($last_paypal_ipn_received) > 0) { |
|
527 | 527 | $donation_id = $last_paypal_ipn_received['payment_id']; |
528 | - $ipn_timestamp = give_get_meta( $donation_id, 'give_last_paypal_ipn_received', true ); |
|
529 | - $transaction_url = 'https://history.paypal.com/cgi-bin/webscr?cmd=_history-details-from-hub&id=' . $last_paypal_ipn_received['transaction_id']; |
|
530 | - $donation_url = site_url() . '/wp-admin/edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $donation_id; |
|
528 | + $ipn_timestamp = give_get_meta($donation_id, 'give_last_paypal_ipn_received', true); |
|
529 | + $transaction_url = 'https://history.paypal.com/cgi-bin/webscr?cmd=_history-details-from-hub&id='.$last_paypal_ipn_received['transaction_id']; |
|
530 | + $donation_url = site_url().'/wp-admin/edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id='.$donation_id; |
|
531 | 531 | echo sprintf( |
532 | - __( 'IPN received for <a href="%s">#%s</a> ( <a href="%s" target="_blank">%s</a> ) on %s at %s. Status %s', 'give' ), |
|
532 | + __('IPN received for <a href="%s">#%s</a> ( <a href="%s" target="_blank">%s</a> ) on %s at %s. Status %s', 'give'), |
|
533 | 533 | $donation_url, |
534 | 534 | $donation_id, |
535 | 535 | $transaction_url, |
536 | 536 | $last_paypal_ipn_received['transaction_id'], |
537 | - date_i18n( 'm/d/Y', $ipn_timestamp ), |
|
538 | - date_i18n( 'H:i', $ipn_timestamp ), |
|
537 | + date_i18n('m/d/Y', $ipn_timestamp), |
|
538 | + date_i18n('H:i', $ipn_timestamp), |
|
539 | 539 | $last_paypal_ipn_received['auth_status'] |
540 | 540 | ); |
541 | 541 | } else { |
@@ -545,14 +545,14 @@ discard block |
||
545 | 545 | </td> |
546 | 546 | </tr> |
547 | 547 | <tr> |
548 | - <td data-export-label="Admin Email Notifications"><?php _e( 'Admin Email Notifications', 'give' ); ?>:</td> |
|
549 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether admins receive email notifications of transactions.', 'give' ) ); ?>"></span></td> |
|
550 | - <td><?php echo 'enabled' === give_get_option( 'admin_notices' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
548 | + <td data-export-label="Admin Email Notifications"><?php _e('Admin Email Notifications', 'give'); ?>:</td> |
|
549 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether admins receive email notifications of transactions.', 'give')); ?>"></span></td> |
|
550 | + <td><?php echo 'enabled' === give_get_option('admin_notices') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
551 | 551 | </tr> |
552 | 552 | <tr> |
553 | - <td data-export-label="Donor Email Access"><?php _e( 'Donor Email Access', 'give' ); ?>:</td> |
|
554 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether donors can access their donation history using only email.', 'give' ) ); ?>"></span></td> |
|
555 | - <td><?php echo 'enabled' === give_get_option( 'email_access' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
553 | + <td data-export-label="Donor Email Access"><?php _e('Donor Email Access', 'give'); ?>:</td> |
|
554 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether donors can access their donation history using only email.', 'give')); ?>"></span></td> |
|
555 | + <td><?php echo 'enabled' === give_get_option('email_access') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
556 | 556 | </tr> |
557 | 557 | </tbody> |
558 | 558 | </table> |
@@ -560,45 +560,45 @@ discard block |
||
560 | 560 | <table class="give-status-table widefat" cellspacing="0"> |
561 | 561 | <thead> |
562 | 562 | <tr> |
563 | - <th colspan="3" data-export-label="Session Configuration"><h2><?php _e( 'Session Configuration', 'give' ); ?></h2></th> |
|
563 | + <th colspan="3" data-export-label="Session Configuration"><h2><?php _e('Session Configuration', 'give'); ?></h2></th> |
|
564 | 564 | </tr> |
565 | 565 | </thead> |
566 | 566 | <tbody> |
567 | 567 | <tr> |
568 | - <td data-export-label="Give Use Sessions"><?php _e( 'Give Use Sessions', 'give' ); ?>:</td> |
|
569 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether PHP sessions are enforced, enabled, or disabled.', 'give' ) ); ?>"></span></td> |
|
570 | - <td><?php echo defined( 'GIVE_USE_PHP_SESSIONS' ) && GIVE_USE_PHP_SESSIONS ? __( 'Enforced', 'give' ) : ( Give()->session->use_php_sessions() ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ) ); ?></td> |
|
568 | + <td data-export-label="Give Use Sessions"><?php _e('Give Use Sessions', 'give'); ?>:</td> |
|
569 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether PHP sessions are enforced, enabled, or disabled.', 'give')); ?>"></span></td> |
|
570 | + <td><?php echo defined('GIVE_USE_PHP_SESSIONS') && GIVE_USE_PHP_SESSIONS ? __('Enforced', 'give') : (Give()->session->use_php_sessions() ? __('Enabled', 'give') : __('Disabled', 'give')); ?></td> |
|
571 | 571 | </tr> |
572 | 572 | <tr> |
573 | - <td data-export-label="Session"><?php _e( 'Session', 'give' ); ?>:</td> |
|
574 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether a PHP session is currently set.', 'give' ) ); ?>"></span></td> |
|
575 | - <td><?php echo isset( $_SESSION ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
573 | + <td data-export-label="Session"><?php _e('Session', 'give'); ?>:</td> |
|
574 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether a PHP session is currently set.', 'give')); ?>"></span></td> |
|
575 | + <td><?php echo isset($_SESSION) ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
576 | 576 | </tr> |
577 | - <?php if ( isset( $_SESSION ) ) { ?> |
|
577 | + <?php if (isset($_SESSION)) { ?> |
|
578 | 578 | <tr> |
579 | - <td data-export-label="Session Name"><?php _e( 'Session Name', 'give' ); ?>:</td> |
|
580 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The name of the current PHP session.', 'give' ) ); ?>"></span></td> |
|
581 | - <td><?php echo esc_html( ini_get( 'session.name' ) ); ?></td> |
|
579 | + <td data-export-label="Session Name"><?php _e('Session Name', 'give'); ?>:</td> |
|
580 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The name of the current PHP session.', 'give')); ?>"></span></td> |
|
581 | + <td><?php echo esc_html(ini_get('session.name')); ?></td> |
|
582 | 582 | </tr> |
583 | 583 | <tr> |
584 | - <td data-export-label="Cookie Path"><?php _e( 'Cookie Path', 'give' ); ?>:</td> |
|
585 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The cookie path of the current PHP session.', 'give' ) ); ?>"></span></td> |
|
586 | - <td><?php echo esc_html( ini_get( 'session.cookie_path' ) ); ?></td> |
|
584 | + <td data-export-label="Cookie Path"><?php _e('Cookie Path', 'give'); ?>:</td> |
|
585 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The cookie path of the current PHP session.', 'give')); ?>"></span></td> |
|
586 | + <td><?php echo esc_html(ini_get('session.cookie_path')); ?></td> |
|
587 | 587 | </tr> |
588 | 588 | <tr> |
589 | - <td data-export-label="Save Path"><?php _e( 'Save Path', 'give' ); ?>:</td> |
|
590 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The save path of the current PHP session.', 'give' ) ); ?>"></span></td> |
|
591 | - <td><?php echo esc_html( ini_get( 'session.save_path' ) ); ?></td> |
|
589 | + <td data-export-label="Save Path"><?php _e('Save Path', 'give'); ?>:</td> |
|
590 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The save path of the current PHP session.', 'give')); ?>"></span></td> |
|
591 | + <td><?php echo esc_html(ini_get('session.save_path')); ?></td> |
|
592 | 592 | </tr> |
593 | 593 | <tr> |
594 | - <td data-export-label="Use Cookies"><?php _e( 'Use Cookies', 'give' ); ?>:</td> |
|
595 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether the current PHP session is set to use cookies.', 'give' ) ); ?>"></span></td> |
|
596 | - <td><?php echo ini_get( 'session.use_cookies' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
594 | + <td data-export-label="Use Cookies"><?php _e('Use Cookies', 'give'); ?>:</td> |
|
595 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether the current PHP session is set to use cookies.', 'give')); ?>"></span></td> |
|
596 | + <td><?php echo ini_get('session.use_cookies') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
597 | 597 | </tr> |
598 | 598 | <tr> |
599 | - <td data-export-label="Use Only Cookies"><?php _e( 'Use Only Cookies', 'give' ); ?>:</td> |
|
600 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether the current PHP session is set to use only cookies.', 'give' ) ); ?>"></span></td> |
|
601 | - <td><?php echo ini_get( 'session.use_only_cookies' ) ? __( 'Enabled', 'give' ) : __( 'Disabled', 'give' ); ?></td> |
|
599 | + <td data-export-label="Use Only Cookies"><?php _e('Use Only Cookies', 'give'); ?>:</td> |
|
600 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether the current PHP session is set to use only cookies.', 'give')); ?>"></span></td> |
|
601 | + <td><?php echo ini_get('session.use_only_cookies') ? __('Enabled', 'give') : __('Disabled', 'give'); ?></td> |
|
602 | 602 | </tr> |
603 | 603 | <?php } ?> |
604 | 604 | </tbody> |
@@ -607,13 +607,13 @@ discard block |
||
607 | 607 | <table class="give-status-table widefat" cellspacing="0"> |
608 | 608 | <thead> |
609 | 609 | <tr> |
610 | - <th colspan="3" data-export-label="Active Give Add-ons"><h2><?php _e( 'Active Give Add-ons', 'give' ); ?></h2></th> |
|
610 | + <th colspan="3" data-export-label="Active Give Add-ons"><h2><?php _e('Active Give Add-ons', 'give'); ?></h2></th> |
|
611 | 611 | </tr> |
612 | 612 | </thead> |
613 | 613 | <tbody> |
614 | 614 | <?php |
615 | - foreach ( $plugins as $plugin_data ) { |
|
616 | - if ( 'active' != $plugin_data['Status'] || 'add-on' != $plugin_data['Type'] ) { |
|
615 | + foreach ($plugins as $plugin_data) { |
|
616 | + if ('active' != $plugin_data['Status'] || 'add-on' != $plugin_data['Type']) { |
|
617 | 617 | continue; |
618 | 618 | } |
619 | 619 | |
@@ -621,30 +621,30 @@ discard block |
||
621 | 621 | $author_name = $plugin_data['Author']; |
622 | 622 | |
623 | 623 | // Link the plugin name to the plugin URL if available. |
624 | - if ( ! empty( $plugin_data['PluginURI'] ) ) { |
|
625 | - $plugin_name = '<a href="' . esc_url( $plugin_data['PluginURI'] ) . '" title="' . esc_attr__( 'Visit plugin homepage' , 'give' ) . '">' . $plugin_name . '</a>'; |
|
624 | + if ( ! empty($plugin_data['PluginURI'])) { |
|
625 | + $plugin_name = '<a href="'.esc_url($plugin_data['PluginURI']).'" title="'.esc_attr__('Visit plugin homepage', 'give').'">'.$plugin_name.'</a>'; |
|
626 | 626 | } |
627 | 627 | |
628 | 628 | // Link the author name to the author URL if available. |
629 | - if ( ! empty( $plugin_data['AuthorURI'] ) ) { |
|
630 | - $author_name = '<a href="' . esc_url( $plugin_data['AuthorURI'] ) . '" title="' . esc_attr__( 'Visit author homepage' , 'give' ) . '">' . $author_name . '</a>'; |
|
629 | + if ( ! empty($plugin_data['AuthorURI'])) { |
|
630 | + $author_name = '<a href="'.esc_url($plugin_data['AuthorURI']).'" title="'.esc_attr__('Visit author homepage', 'give').'">'.$author_name.'</a>'; |
|
631 | 631 | } |
632 | 632 | ?> |
633 | 633 | <tr> |
634 | - <td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td> |
|
634 | + <td><?php echo wp_kses($plugin_name, wp_kses_allowed_html('post')); ?></td> |
|
635 | 635 | <td class="help"> </td> |
636 | 636 | <td> |
637 | 637 | <?php |
638 | - if ( true === $plugin_data['License'] ) { |
|
639 | - echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark> ' . __( 'Licensed', 'give' ); |
|
638 | + if (true === $plugin_data['License']) { |
|
639 | + echo '<mark class="yes"><span class="dashicons dashicons-yes"></span></mark> '.__('Licensed', 'give'); |
|
640 | 640 | } else { |
641 | - echo '<mark class="error"><span class="dashicons dashicons-no-alt"></span></mark> ' . __( 'Unlicensed', 'give' ); |
|
641 | + echo '<mark class="error"><span class="dashicons dashicons-no-alt"></span></mark> '.__('Unlicensed', 'give'); |
|
642 | 642 | } |
643 | 643 | |
644 | 644 | echo ' – ' |
645 | - . sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) |
|
645 | + . sprintf(_x('by %s', 'by author', 'give'), wp_kses($author_name, wp_kses_allowed_html('post'))) |
|
646 | 646 | . ' – ' |
647 | - . esc_html( $plugin_data['Version'] ); |
|
647 | + . esc_html($plugin_data['Version']); |
|
648 | 648 | ?> |
649 | 649 | </td> |
650 | 650 | </tr> |
@@ -657,18 +657,18 @@ discard block |
||
657 | 657 | <table class="give-status-table widefat" cellspacing="0"> |
658 | 658 | <thead> |
659 | 659 | <tr> |
660 | - <th colspan="3" data-export-label="Other Active Plugins"><h2><?php _e( 'Other Active Plugins', 'give' ); ?></h2></th> |
|
660 | + <th colspan="3" data-export-label="Other Active Plugins"><h2><?php _e('Other Active Plugins', 'give'); ?></h2></th> |
|
661 | 661 | </tr> |
662 | 662 | </thead> |
663 | 663 | <tbody> |
664 | 664 | <?php |
665 | - foreach ( $plugins as $plugin_data ) { |
|
666 | - if ( 'active' != $plugin_data['Status'] || 'other' != $plugin_data['Type'] ) { |
|
665 | + foreach ($plugins as $plugin_data) { |
|
666 | + if ('active' != $plugin_data['Status'] || 'other' != $plugin_data['Type']) { |
|
667 | 667 | continue; |
668 | 668 | } |
669 | 669 | |
670 | 670 | // Do not show Give core plugin. |
671 | - if ( 'Give - Donation Plugin' === $plugin_data['Name'] ) { |
|
671 | + if ('Give - Donation Plugin' === $plugin_data['Name']) { |
|
672 | 672 | continue; |
673 | 673 | } |
674 | 674 | |
@@ -676,19 +676,19 @@ discard block |
||
676 | 676 | $author_name = $plugin_data['Author']; |
677 | 677 | |
678 | 678 | // Link the plugin name to the plugin URL if available. |
679 | - if ( ! empty( $plugin_data['PluginURI'] ) ) { |
|
680 | - $plugin_name = '<a href="' . esc_url( $plugin_data['PluginURI'] ) . '" title="' . esc_attr__( 'Visit plugin homepage' , 'give' ) . '">' . $plugin_name . '</a>'; |
|
679 | + if ( ! empty($plugin_data['PluginURI'])) { |
|
680 | + $plugin_name = '<a href="'.esc_url($plugin_data['PluginURI']).'" title="'.esc_attr__('Visit plugin homepage', 'give').'">'.$plugin_name.'</a>'; |
|
681 | 681 | } |
682 | 682 | |
683 | 683 | // Link the author name to the author URL if available. |
684 | - if ( ! empty( $plugin_data['AuthorURI'] ) ) { |
|
685 | - $author_name = '<a href="' . esc_url( $plugin_data['AuthorURI'] ) . '" title="' . esc_attr__( 'Visit author homepage' , 'give' ) . '">' . $author_name . '</a>'; |
|
684 | + if ( ! empty($plugin_data['AuthorURI'])) { |
|
685 | + $author_name = '<a href="'.esc_url($plugin_data['AuthorURI']).'" title="'.esc_attr__('Visit author homepage', 'give').'">'.$author_name.'</a>'; |
|
686 | 686 | } |
687 | 687 | ?> |
688 | 688 | <tr> |
689 | - <td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td> |
|
689 | + <td><?php echo wp_kses($plugin_name, wp_kses_allowed_html('post')); ?></td> |
|
690 | 690 | <td class="help"> </td> |
691 | - <td><?php echo sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) . ' – ' . esc_html( $plugin_data['Version'] ); ?></td> |
|
691 | + <td><?php echo sprintf(_x('by %s', 'by author', 'give'), wp_kses($author_name, wp_kses_allowed_html('post'))).' – '.esc_html($plugin_data['Version']); ?></td> |
|
692 | 692 | </tr> |
693 | 693 | <?php |
694 | 694 | } |
@@ -699,13 +699,13 @@ discard block |
||
699 | 699 | <table class="give-status-table widefat" cellspacing="0"> |
700 | 700 | <thead> |
701 | 701 | <tr> |
702 | - <th colspan="3" data-export-label="Inactive Plugins"><h2><?php _e( 'Inactive Plugins', 'give' ); ?></h2></th> |
|
702 | + <th colspan="3" data-export-label="Inactive Plugins"><h2><?php _e('Inactive Plugins', 'give'); ?></h2></th> |
|
703 | 703 | </tr> |
704 | 704 | </thead> |
705 | 705 | <tbody> |
706 | 706 | <?php |
707 | - foreach ( $plugins as $plugin_data ) { |
|
708 | - if ( 'inactive' != $plugin_data['Status'] ) { |
|
707 | + foreach ($plugins as $plugin_data) { |
|
708 | + if ('inactive' != $plugin_data['Status']) { |
|
709 | 709 | continue; |
710 | 710 | } |
711 | 711 | |
@@ -713,19 +713,19 @@ discard block |
||
713 | 713 | $author_name = $plugin_data['Author']; |
714 | 714 | |
715 | 715 | // Link the plugin name to the plugin URL if available. |
716 | - if ( ! empty( $plugin_data['PluginURI'] ) ) { |
|
717 | - $plugin_name = '<a href="' . esc_url( $plugin_data['PluginURI'] ) . '" title="' . esc_attr__( 'Visit plugin homepage' , 'give' ) . '">' . $plugin_name . '</a>'; |
|
716 | + if ( ! empty($plugin_data['PluginURI'])) { |
|
717 | + $plugin_name = '<a href="'.esc_url($plugin_data['PluginURI']).'" title="'.esc_attr__('Visit plugin homepage', 'give').'">'.$plugin_name.'</a>'; |
|
718 | 718 | } |
719 | 719 | |
720 | 720 | // Link the author name to the author URL if available. |
721 | - if ( ! empty( $plugin_data['AuthorURI'] ) ) { |
|
722 | - $author_name = '<a href="' . esc_url( $plugin_data['AuthorURI'] ) . '" title="' . esc_attr__( 'Visit author homepage' , 'give' ) . '">' . $author_name . '</a>'; |
|
721 | + if ( ! empty($plugin_data['AuthorURI'])) { |
|
722 | + $author_name = '<a href="'.esc_url($plugin_data['AuthorURI']).'" title="'.esc_attr__('Visit author homepage', 'give').'">'.$author_name.'</a>'; |
|
723 | 723 | } |
724 | 724 | ?> |
725 | 725 | <tr> |
726 | - <td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td> |
|
726 | + <td><?php echo wp_kses($plugin_name, wp_kses_allowed_html('post')); ?></td> |
|
727 | 727 | <td class="help"> </td> |
728 | - <td><?php echo sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ) . ' – ' . esc_html( $plugin_data['Version'] ); ?></td> |
|
728 | + <td><?php echo sprintf(_x('by %s', 'by author', 'give'), wp_kses($author_name, wp_kses_allowed_html('post'))).' – '.esc_html($plugin_data['Version']); ?></td> |
|
729 | 729 | </tr> |
730 | 730 | <?php |
731 | 731 | } |
@@ -735,37 +735,37 @@ discard block |
||
735 | 735 | |
736 | 736 | <?php |
737 | 737 | $active_mu_plugins = (array) get_mu_plugins(); |
738 | -if ( ! empty( $active_mu_plugins ) ) { |
|
738 | +if ( ! empty($active_mu_plugins)) { |
|
739 | 739 | ?> |
740 | 740 | <table class="give-status-table widefat" cellspacing="0"> |
741 | 741 | <thead> |
742 | 742 | <tr> |
743 | - <th colspan="3" data-export-label="Active MU Plugins"><h2><?php _e( 'Active MU Plugins', 'give' ); ?></h2></th> |
|
743 | + <th colspan="3" data-export-label="Active MU Plugins"><h2><?php _e('Active MU Plugins', 'give'); ?></h2></th> |
|
744 | 744 | </tr> |
745 | 745 | </thead> |
746 | 746 | <tbody> |
747 | 747 | <?php |
748 | 748 | |
749 | - foreach ( $active_mu_plugins as $mu_plugin_data ) { |
|
750 | - if ( ! empty( $mu_plugin_data['Name'] ) ) { |
|
749 | + foreach ($active_mu_plugins as $mu_plugin_data) { |
|
750 | + if ( ! empty($mu_plugin_data['Name'])) { |
|
751 | 751 | // Link the plugin name to the plugin URL if available. |
752 | - $plugin_name = esc_html( $mu_plugin_data['Name'] ); |
|
752 | + $plugin_name = esc_html($mu_plugin_data['Name']); |
|
753 | 753 | |
754 | - if ( ! empty( $mu_plugin_data['PluginURI'] ) ) { |
|
755 | - $plugin_name = '<a href="' . esc_url( $mu_plugin_data['PluginURI'] ) . '" title="' . esc_attr__( 'Visit plugin homepage' , 'give' ) . '">' . $plugin_name . '</a>'; |
|
754 | + if ( ! empty($mu_plugin_data['PluginURI'])) { |
|
755 | + $plugin_name = '<a href="'.esc_url($mu_plugin_data['PluginURI']).'" title="'.esc_attr__('Visit plugin homepage', 'give').'">'.$plugin_name.'</a>'; |
|
756 | 756 | } |
757 | 757 | |
758 | 758 | // Link the author name to the author URL if available. |
759 | - $author_name = esc_html( $mu_plugin_data['Author'] ); |
|
759 | + $author_name = esc_html($mu_plugin_data['Author']); |
|
760 | 760 | |
761 | - if ( ! empty( $mu_plugin_data['AuthorURI'] ) ) { |
|
762 | - $author_name = '<a href="' . esc_url( $mu_plugin_data['AuthorURI'] ) . '">' . $author_name . '</a>'; |
|
761 | + if ( ! empty($mu_plugin_data['AuthorURI'])) { |
|
762 | + $author_name = '<a href="'.esc_url($mu_plugin_data['AuthorURI']).'">'.$author_name.'</a>'; |
|
763 | 763 | } |
764 | 764 | ?> |
765 | 765 | <tr> |
766 | 766 | <td><?php echo $plugin_name; ?></td> |
767 | 767 | <td class="help"> </td> |
768 | - <td><?php echo sprintf( _x( 'by %s', 'by author', 'give' ), $author_name ) . ' – ' . esc_html( $mu_plugin_data['Version'] ); ?></td> |
|
768 | + <td><?php echo sprintf(_x('by %s', 'by author', 'give'), $author_name).' – '.esc_html($mu_plugin_data['Version']); ?></td> |
|
769 | 769 | </tr> |
770 | 770 | <?php |
771 | 771 | } |
@@ -778,53 +778,53 @@ discard block |
||
778 | 778 | <table class="give-status-table widefat" cellspacing="0"> |
779 | 779 | <thead> |
780 | 780 | <tr> |
781 | - <th colspan="3" data-export-label="Theme"><h2><?php _e( 'Theme', 'give' ); ?></h2></th> |
|
781 | + <th colspan="3" data-export-label="Theme"><h2><?php _e('Theme', 'give'); ?></h2></th> |
|
782 | 782 | </tr> |
783 | 783 | </thead> |
784 | 784 | <?php |
785 | - include_once( ABSPATH . 'wp-admin/includes/theme-install.php' ); |
|
785 | + include_once(ABSPATH.'wp-admin/includes/theme-install.php'); |
|
786 | 786 | $active_theme = wp_get_theme(); |
787 | 787 | ?> |
788 | 788 | <tbody> |
789 | 789 | <tr> |
790 | - <td data-export-label="Name"><?php _e( 'Name', 'give' ); ?>:</td> |
|
791 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The name of the current active theme.', 'give' ) ); ?>"></span></td> |
|
792 | - <td><?php echo esc_html( $active_theme->Name ); ?></td> |
|
790 | + <td data-export-label="Name"><?php _e('Name', 'give'); ?>:</td> |
|
791 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The name of the current active theme.', 'give')); ?>"></span></td> |
|
792 | + <td><?php echo esc_html($active_theme->Name); ?></td> |
|
793 | 793 | </tr> |
794 | 794 | <tr> |
795 | - <td data-export-label="Version"><?php _e( 'Version', 'give' ); ?>:</td> |
|
796 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The installed version of the current active theme.', 'give' ) ); ?>"></span></td> |
|
797 | - <td><?php echo esc_html( $active_theme->Version ); ?></td> |
|
795 | + <td data-export-label="Version"><?php _e('Version', 'give'); ?>:</td> |
|
796 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The installed version of the current active theme.', 'give')); ?>"></span></td> |
|
797 | + <td><?php echo esc_html($active_theme->Version); ?></td> |
|
798 | 798 | </tr> |
799 | 799 | <tr> |
800 | - <td data-export-label="Author URL"><?php _e( 'Author URL', 'give' ); ?>:</td> |
|
801 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The theme developer\'s URL.', 'give' ) ); ?>"></span></td> |
|
800 | + <td data-export-label="Author URL"><?php _e('Author URL', 'give'); ?>:</td> |
|
801 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The theme developer\'s URL.', 'give')); ?>"></span></td> |
|
802 | 802 | <td><?php echo $active_theme->{'Author URI'}; ?></td> |
803 | 803 | </tr> |
804 | 804 | <tr> |
805 | - <td data-export-label="Child Theme"><?php _e( 'Child Theme', 'give' ); ?>:</td> |
|
806 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'Whether the current theme is a child theme.', 'give' ) ); ?>"></span></td> |
|
805 | + <td data-export-label="Child Theme"><?php _e('Child Theme', 'give'); ?>:</td> |
|
806 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('Whether the current theme is a child theme.', 'give')); ?>"></span></td> |
|
807 | 807 | <td><?php |
808 | - echo is_child_theme() ? __( 'Yes', 'give' ) : __( 'No', 'give' ) . ' – ' . sprintf( __( 'If you\'re modifying Give on a parent theme you didn\'t build personally, then we recommend using a child theme. See: <a href="%s" target="_blank">How to Create a Child Theme</a>', 'give' ), 'https://codex.wordpress.org/Child_Themes' ); |
|
808 | + echo is_child_theme() ? __('Yes', 'give') : __('No', 'give').' – '.sprintf(__('If you\'re modifying Give on a parent theme you didn\'t build personally, then we recommend using a child theme. See: <a href="%s" target="_blank">How to Create a Child Theme</a>', 'give'), 'https://codex.wordpress.org/Child_Themes'); |
|
809 | 809 | ?></td> |
810 | 810 | </tr> |
811 | 811 | <?php |
812 | - if( is_child_theme() ) { |
|
813 | - $parent_theme = wp_get_theme( $active_theme->Template ); |
|
812 | + if (is_child_theme()) { |
|
813 | + $parent_theme = wp_get_theme($active_theme->Template); |
|
814 | 814 | ?> |
815 | 815 | <tr> |
816 | - <td data-export-label="Parent Theme Name"><?php _e( 'Parent Theme Name', 'give' ); ?>:</td> |
|
817 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The name of the parent theme.', 'give' ) ); ?>"></span></td> |
|
818 | - <td><?php echo esc_html( $parent_theme->Name ); ?></td> |
|
816 | + <td data-export-label="Parent Theme Name"><?php _e('Parent Theme Name', 'give'); ?>:</td> |
|
817 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The name of the parent theme.', 'give')); ?>"></span></td> |
|
818 | + <td><?php echo esc_html($parent_theme->Name); ?></td> |
|
819 | 819 | </tr> |
820 | 820 | <tr> |
821 | - <td data-export-label="Parent Theme Version"><?php _e( 'Parent Theme Version', 'give' ); ?>:</td> |
|
822 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The installed version of the parent theme.', 'give' ) ); ?>"></span></td> |
|
823 | - <td><?php echo esc_html( $parent_theme->Version ); ?></td> |
|
821 | + <td data-export-label="Parent Theme Version"><?php _e('Parent Theme Version', 'give'); ?>:</td> |
|
822 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The installed version of the parent theme.', 'give')); ?>"></span></td> |
|
823 | + <td><?php echo esc_html($parent_theme->Version); ?></td> |
|
824 | 824 | </tr> |
825 | 825 | <tr> |
826 | - <td data-export-label="Parent Theme Author URL"><?php _e( 'Parent Theme Author URL', 'give' ); ?>:</td> |
|
827 | - <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr( __( 'The parent theme developers URL.', 'give' ) ); ?>"></span></td> |
|
826 | + <td data-export-label="Parent Theme Author URL"><?php _e('Parent Theme Author URL', 'give'); ?>:</td> |
|
827 | + <td class="help"><span class="give-tooltip give-icon give-icon-question" data-tooltip="<?php echo esc_attr(__('The parent theme developers URL.', 'give')); ?>"></span></td> |
|
828 | 828 | <td><?php echo $parent_theme->{'Author URI'}; ?></td> |
829 | 829 | </tr> |
830 | 830 | <?php } ?> |
@@ -12,7 +12,7 @@ discard block |
||
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 | |
@@ -25,52 +25,52 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function give_do_automatic_upgrades() { |
27 | 27 | $did_upgrade = false; |
28 | - $give_version = preg_replace( '/[^0-9.].*/', '', get_option( 'give_version' ) ); |
|
28 | + $give_version = preg_replace('/[^0-9.].*/', '', get_option('give_version')); |
|
29 | 29 | |
30 | - if ( ! $give_version ) { |
|
30 | + if ( ! $give_version) { |
|
31 | 31 | // 1.0 is the first version to use this option so we must add it. |
32 | 32 | $give_version = '1.0'; |
33 | 33 | } |
34 | 34 | |
35 | - switch ( true ) { |
|
35 | + switch (true) { |
|
36 | 36 | |
37 | - case version_compare( $give_version, '1.6', '<' ) : |
|
37 | + case version_compare($give_version, '1.6', '<') : |
|
38 | 38 | give_v16_upgrades(); |
39 | 39 | $did_upgrade = true; |
40 | 40 | |
41 | - case version_compare( $give_version, '1.7', '<' ) : |
|
41 | + case version_compare($give_version, '1.7', '<') : |
|
42 | 42 | give_v17_upgrades(); |
43 | 43 | $did_upgrade = true; |
44 | 44 | |
45 | - case version_compare( $give_version, '1.8', '<' ) : |
|
45 | + case version_compare($give_version, '1.8', '<') : |
|
46 | 46 | give_v18_upgrades(); |
47 | 47 | $did_upgrade = true; |
48 | 48 | |
49 | - case version_compare( $give_version, '1.8.7', '<' ) : |
|
49 | + case version_compare($give_version, '1.8.7', '<') : |
|
50 | 50 | give_v187_upgrades(); |
51 | 51 | $did_upgrade = true; |
52 | 52 | |
53 | - case version_compare( $give_version, '1.8.8', '<' ) : |
|
53 | + case version_compare($give_version, '1.8.8', '<') : |
|
54 | 54 | give_v188_upgrades(); |
55 | 55 | $did_upgrade = true; |
56 | 56 | |
57 | - case version_compare( $give_version, '1.8.9', '<' ) : |
|
57 | + case version_compare($give_version, '1.8.9', '<') : |
|
58 | 58 | give_v189_upgrades(); |
59 | 59 | $did_upgrade = true; |
60 | 60 | |
61 | - case version_compare( $give_version, '1.8.12', '<' ) : |
|
61 | + case version_compare($give_version, '1.8.12', '<') : |
|
62 | 62 | give_v1812_upgrades(); |
63 | 63 | $did_upgrade = true; |
64 | 64 | |
65 | 65 | } |
66 | 66 | |
67 | - if ( $did_upgrade ) { |
|
68 | - update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) ); |
|
67 | + if ($did_upgrade) { |
|
68 | + update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION)); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | -add_action( 'admin_init', 'give_do_automatic_upgrades' ); |
|
73 | -add_action( 'give_upgrades', 'give_do_automatic_upgrades' ); |
|
72 | +add_action('admin_init', 'give_do_automatic_upgrades'); |
|
73 | +add_action('give_upgrades', 'give_do_automatic_upgrades'); |
|
74 | 74 | |
75 | 75 | /** |
76 | 76 | * Display Upgrade Notices |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * |
83 | 83 | * @return void |
84 | 84 | */ |
85 | -function give_show_upgrade_notices( $give_updates ) { |
|
85 | +function give_show_upgrade_notices($give_updates) { |
|
86 | 86 | // v1.3.2 Upgrades |
87 | 87 | $give_updates->register( |
88 | 88 | array( |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | ); |
140 | 140 | } |
141 | 141 | |
142 | -add_action( 'give_register_updates', 'give_show_upgrade_notices' ); |
|
142 | +add_action('give_register_updates', 'give_show_upgrade_notices'); |
|
143 | 143 | |
144 | 144 | /** |
145 | 145 | * Triggers all upgrade functions |
@@ -151,29 +151,29 @@ discard block |
||
151 | 151 | */ |
152 | 152 | function give_trigger_upgrades() { |
153 | 153 | |
154 | - if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
155 | - wp_die( esc_html__( 'You do not have permission to do Give upgrades.', 'give' ), esc_html__( 'Error', 'give' ), array( |
|
154 | + if ( ! current_user_can('manage_give_settings')) { |
|
155 | + wp_die(esc_html__('You do not have permission to do Give upgrades.', 'give'), esc_html__('Error', 'give'), array( |
|
156 | 156 | 'response' => 403, |
157 | - ) ); |
|
157 | + )); |
|
158 | 158 | } |
159 | 159 | |
160 | - $give_version = get_option( 'give_version' ); |
|
160 | + $give_version = get_option('give_version'); |
|
161 | 161 | |
162 | - if ( ! $give_version ) { |
|
162 | + if ( ! $give_version) { |
|
163 | 163 | // 1.0 is the first version to use this option so we must add it. |
164 | 164 | $give_version = '1.0'; |
165 | - add_option( 'give_version', $give_version ); |
|
165 | + add_option('give_version', $give_version); |
|
166 | 166 | } |
167 | 167 | |
168 | - update_option( 'give_version', GIVE_VERSION ); |
|
169 | - delete_option( 'give_doing_upgrade' ); |
|
168 | + update_option('give_version', GIVE_VERSION); |
|
169 | + delete_option('give_doing_upgrade'); |
|
170 | 170 | |
171 | - if ( DOING_AJAX ) { |
|
172 | - die( 'complete' ); |
|
171 | + if (DOING_AJAX) { |
|
172 | + die('complete'); |
|
173 | 173 | } // End if(). |
174 | 174 | } |
175 | 175 | |
176 | -add_action( 'wp_ajax_give_trigger_upgrades', 'give_trigger_upgrades' ); |
|
176 | +add_action('wp_ajax_give_trigger_upgrades', 'give_trigger_upgrades'); |
|
177 | 177 | |
178 | 178 | |
179 | 179 | /** |
@@ -189,24 +189,24 @@ discard block |
||
189 | 189 | /* @var Give_Updates $give_updates */ |
190 | 190 | $give_updates = Give_Updates::get_instance(); |
191 | 191 | |
192 | - if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
193 | - wp_die( esc_html__( 'You do not have permission to do Give upgrades.', 'give' ), esc_html__( 'Error', 'give' ), array( |
|
192 | + if ( ! current_user_can('manage_give_settings')) { |
|
193 | + wp_die(esc_html__('You do not have permission to do Give upgrades.', 'give'), esc_html__('Error', 'give'), array( |
|
194 | 194 | 'response' => 403, |
195 | - ) ); |
|
195 | + )); |
|
196 | 196 | } |
197 | 197 | |
198 | - ignore_user_abort( true ); |
|
198 | + ignore_user_abort(true); |
|
199 | 199 | |
200 | - if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) { |
|
201 | - @set_time_limit( 0 ); |
|
200 | + if ( ! give_is_func_disabled('set_time_limit') && ! ini_get('safe_mode')) { |
|
201 | + @set_time_limit(0); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | // UPDATE DB METAKEYS. |
205 | 205 | $sql = "UPDATE $wpdb->postmeta SET meta_key = '_give_payment_customer_id' WHERE meta_key = '_give_payment_donor_id'"; |
206 | - $query = $wpdb->query( $sql ); |
|
206 | + $query = $wpdb->query($sql); |
|
207 | 207 | |
208 | 208 | $give_updates->percentage = 100; |
209 | - give_set_upgrade_complete( 'upgrade_give_payment_customer_id' ); |
|
209 | + give_set_upgrade_complete('upgrade_give_payment_customer_id'); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | |
@@ -230,24 +230,24 @@ discard block |
||
230 | 230 | $where .= "AND ( p.post_status = 'abandoned' )"; |
231 | 231 | $where .= "AND ( m.meta_key = '_give_payment_gateway' AND m.meta_value = 'offline' )"; |
232 | 232 | |
233 | - $sql = $select . $join . $where; |
|
234 | - $found_payments = $wpdb->get_col( $sql ); |
|
233 | + $sql = $select.$join.$where; |
|
234 | + $found_payments = $wpdb->get_col($sql); |
|
235 | 235 | |
236 | - foreach ( $found_payments as $payment ) { |
|
236 | + foreach ($found_payments as $payment) { |
|
237 | 237 | |
238 | 238 | // Only change ones marked abandoned since our release last week because the admin may have marked some abandoned themselves. |
239 | - $modified_time = get_post_modified_time( 'U', false, $payment ); |
|
239 | + $modified_time = get_post_modified_time('U', false, $payment); |
|
240 | 240 | |
241 | 241 | // 1450124863 = 12/10/2015 20:42:25. |
242 | - if ( $modified_time >= 1450124863 ) { |
|
242 | + if ($modified_time >= 1450124863) { |
|
243 | 243 | |
244 | - give_update_payment_status( $payment, 'pending' ); |
|
244 | + give_update_payment_status($payment, 'pending'); |
|
245 | 245 | |
246 | 246 | } |
247 | 247 | } |
248 | 248 | |
249 | 249 | $give_updates->percentage = 100; |
250 | - give_set_upgrade_complete( 'upgrade_give_offline_status' ); |
|
250 | + give_set_upgrade_complete('upgrade_give_offline_status'); |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | |
@@ -260,17 +260,17 @@ discard block |
||
260 | 260 | */ |
261 | 261 | function give_v152_cleanup_users() { |
262 | 262 | |
263 | - $give_version = get_option( 'give_version' ); |
|
263 | + $give_version = get_option('give_version'); |
|
264 | 264 | |
265 | - if ( ! $give_version ) { |
|
265 | + if ( ! $give_version) { |
|
266 | 266 | // 1.0 is the first version to use this option so we must add it. |
267 | 267 | $give_version = '1.0'; |
268 | 268 | } |
269 | 269 | |
270 | - $give_version = preg_replace( '/[^0-9.].*/', '', $give_version ); |
|
270 | + $give_version = preg_replace('/[^0-9.].*/', '', $give_version); |
|
271 | 271 | |
272 | 272 | // v1.5.2 Upgrades |
273 | - if ( version_compare( $give_version, '1.5.2', '<' ) || ! give_has_upgrade_completed( 'upgrade_give_user_caps_cleanup' ) ) { |
|
273 | + if (version_compare($give_version, '1.5.2', '<') || ! give_has_upgrade_completed('upgrade_give_user_caps_cleanup')) { |
|
274 | 274 | |
275 | 275 | // Delete all caps with "ss". |
276 | 276 | // Also delete all unused "campaign" roles. |
@@ -317,9 +317,9 @@ discard block |
||
317 | 317 | ); |
318 | 318 | |
319 | 319 | global $wp_roles; |
320 | - foreach ( $delete_caps as $cap ) { |
|
321 | - foreach ( array_keys( $wp_roles->roles ) as $role ) { |
|
322 | - $wp_roles->remove_cap( $role, $cap ); |
|
320 | + foreach ($delete_caps as $cap) { |
|
321 | + foreach (array_keys($wp_roles->roles) as $role) { |
|
322 | + $wp_roles->remove_cap($role, $cap); |
|
323 | 323 | } |
324 | 324 | } |
325 | 325 | |
@@ -329,15 +329,15 @@ discard block |
||
329 | 329 | $roles->add_caps(); |
330 | 330 | |
331 | 331 | // The Update Ran. |
332 | - update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) ); |
|
333 | - give_set_upgrade_complete( 'upgrade_give_user_caps_cleanup' ); |
|
334 | - delete_option( 'give_doing_upgrade' ); |
|
332 | + update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION)); |
|
333 | + give_set_upgrade_complete('upgrade_give_user_caps_cleanup'); |
|
334 | + delete_option('give_doing_upgrade'); |
|
335 | 335 | |
336 | 336 | }// End if(). |
337 | 337 | |
338 | 338 | } |
339 | 339 | |
340 | -add_action( 'admin_init', 'give_v152_cleanup_users' ); |
|
340 | +add_action('admin_init', 'give_v152_cleanup_users'); |
|
341 | 341 | |
342 | 342 | /** |
343 | 343 | * 1.6 Upgrade routine to create the customer meta table. |
@@ -380,53 +380,53 @@ discard block |
||
380 | 380 | |
381 | 381 | // Get addons license key. |
382 | 382 | $addons = array(); |
383 | - foreach ( $give_options as $key => $value ) { |
|
384 | - if ( false !== strpos( $key, '_license_key' ) ) { |
|
385 | - $addons[ $key ] = $value; |
|
383 | + foreach ($give_options as $key => $value) { |
|
384 | + if (false !== strpos($key, '_license_key')) { |
|
385 | + $addons[$key] = $value; |
|
386 | 386 | } |
387 | 387 | } |
388 | 388 | |
389 | 389 | // Bailout: We do not have any addon license data to upgrade. |
390 | - if ( empty( $addons ) ) { |
|
390 | + if (empty($addons)) { |
|
391 | 391 | return false; |
392 | 392 | } |
393 | 393 | |
394 | - foreach ( $addons as $key => $addon_license ) { |
|
394 | + foreach ($addons as $key => $addon_license) { |
|
395 | 395 | |
396 | 396 | // Get addon shortname. |
397 | - $shortname = str_replace( '_license_key', '', $key ); |
|
397 | + $shortname = str_replace('_license_key', '', $key); |
|
398 | 398 | |
399 | 399 | // Addon license option name. |
400 | - $addon_license_option_name = $shortname . '_license_active'; |
|
400 | + $addon_license_option_name = $shortname.'_license_active'; |
|
401 | 401 | |
402 | 402 | // bailout if license is empty. |
403 | - if ( empty( $addon_license ) ) { |
|
404 | - delete_option( $addon_license_option_name ); |
|
403 | + if (empty($addon_license)) { |
|
404 | + delete_option($addon_license_option_name); |
|
405 | 405 | continue; |
406 | 406 | } |
407 | 407 | |
408 | 408 | // Get addon name. |
409 | 409 | $addon_name = array(); |
410 | - $addon_name_parts = explode( '_', str_replace( 'give_', '', $shortname ) ); |
|
411 | - foreach ( $addon_name_parts as $name_part ) { |
|
410 | + $addon_name_parts = explode('_', str_replace('give_', '', $shortname)); |
|
411 | + foreach ($addon_name_parts as $name_part) { |
|
412 | 412 | |
413 | 413 | // Fix addon name |
414 | - switch ( $name_part ) { |
|
414 | + switch ($name_part) { |
|
415 | 415 | case 'authorizenet' : |
416 | 416 | $name_part = 'authorize.net'; |
417 | 417 | break; |
418 | 418 | } |
419 | 419 | |
420 | - $addon_name[] = ucfirst( $name_part ); |
|
420 | + $addon_name[] = ucfirst($name_part); |
|
421 | 421 | } |
422 | 422 | |
423 | - $addon_name = implode( ' ', $addon_name ); |
|
423 | + $addon_name = implode(' ', $addon_name); |
|
424 | 424 | |
425 | 425 | // Data to send to the API |
426 | 426 | $api_params = array( |
427 | 427 | 'edd_action' => 'activate_license', // never change from "edd_" to "give_"! |
428 | 428 | 'license' => $addon_license, |
429 | - 'item_name' => urlencode( $addon_name ), |
|
429 | + 'item_name' => urlencode($addon_name), |
|
430 | 430 | 'url' => home_url(), |
431 | 431 | ); |
432 | 432 | |
@@ -441,17 +441,17 @@ discard block |
||
441 | 441 | ); |
442 | 442 | |
443 | 443 | // Make sure there are no errors. |
444 | - if ( is_wp_error( $response ) ) { |
|
445 | - delete_option( $addon_license_option_name ); |
|
444 | + if (is_wp_error($response)) { |
|
445 | + delete_option($addon_license_option_name); |
|
446 | 446 | continue; |
447 | 447 | } |
448 | 448 | |
449 | 449 | // Tell WordPress to look for updates. |
450 | - set_site_transient( 'update_plugins', null ); |
|
450 | + set_site_transient('update_plugins', null); |
|
451 | 451 | |
452 | 452 | // Decode license data. |
453 | - $license_data = json_decode( wp_remote_retrieve_body( $response ) ); |
|
454 | - update_option( $addon_license_option_name, $license_data ); |
|
453 | + $license_data = json_decode(wp_remote_retrieve_body($response)); |
|
454 | + update_option($addon_license_option_name, $license_data); |
|
455 | 455 | }// End foreach(). |
456 | 456 | } |
457 | 457 | |
@@ -481,9 +481,9 @@ discard block |
||
481 | 481 | ); |
482 | 482 | |
483 | 483 | global $wp_roles; |
484 | - foreach ( $delete_caps as $cap ) { |
|
485 | - foreach ( array_keys( $wp_roles->roles ) as $role ) { |
|
486 | - $wp_roles->remove_cap( $role, $cap ); |
|
484 | + foreach ($delete_caps as $cap) { |
|
485 | + foreach (array_keys($wp_roles->roles) as $role) { |
|
486 | + $wp_roles->remove_cap($role, $cap); |
|
487 | 487 | } |
488 | 488 | } |
489 | 489 | |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | function give_v18_upgrades_core_setting() { |
518 | 518 | // Core settings which changes from checkbox to radio. |
519 | 519 | $core_setting_names = array_merge( |
520 | - array_keys( give_v18_renamed_core_settings() ), |
|
520 | + array_keys(give_v18_renamed_core_settings()), |
|
521 | 521 | array( |
522 | 522 | 'uninstall_on_delete', |
523 | 523 | 'scripts_footer', |
@@ -529,48 +529,48 @@ discard block |
||
529 | 529 | ); |
530 | 530 | |
531 | 531 | // Bailout: If not any setting define. |
532 | - if ( $give_settings = get_option( 'give_settings' ) ) { |
|
532 | + if ($give_settings = get_option('give_settings')) { |
|
533 | 533 | |
534 | 534 | $setting_changed = false; |
535 | 535 | |
536 | 536 | // Loop: check each setting field. |
537 | - foreach ( $core_setting_names as $setting_name ) { |
|
537 | + foreach ($core_setting_names as $setting_name) { |
|
538 | 538 | // New setting name. |
539 | - $new_setting_name = preg_replace( '/^(enable_|disable_)/', '', $setting_name ); |
|
539 | + $new_setting_name = preg_replace('/^(enable_|disable_)/', '', $setting_name); |
|
540 | 540 | |
541 | 541 | // Continue: If setting already set. |
542 | 542 | if ( |
543 | - array_key_exists( $new_setting_name, $give_settings ) |
|
544 | - && in_array( $give_settings[ $new_setting_name ], array( 'enabled', 'disabled' ) ) |
|
543 | + array_key_exists($new_setting_name, $give_settings) |
|
544 | + && in_array($give_settings[$new_setting_name], array('enabled', 'disabled')) |
|
545 | 545 | ) { |
546 | 546 | continue; |
547 | 547 | } |
548 | 548 | |
549 | 549 | // Set checkbox value to radio value. |
550 | - $give_settings[ $setting_name ] = ( ! empty( $give_settings[ $setting_name ] ) && 'on' === $give_settings[ $setting_name ] ? 'enabled' : 'disabled' ); |
|
550 | + $give_settings[$setting_name] = ( ! empty($give_settings[$setting_name]) && 'on' === $give_settings[$setting_name] ? 'enabled' : 'disabled'); |
|
551 | 551 | |
552 | 552 | // @see https://github.com/WordImpress/Give/issues/1063 |
553 | - if ( false !== strpos( $setting_name, 'disable_' ) ) { |
|
553 | + if (false !== strpos($setting_name, 'disable_')) { |
|
554 | 554 | |
555 | - $give_settings[ $new_setting_name ] = ( give_is_setting_enabled( $give_settings[ $setting_name ] ) ? 'disabled' : 'enabled' ); |
|
556 | - } elseif ( false !== strpos( $setting_name, 'enable_' ) ) { |
|
555 | + $give_settings[$new_setting_name] = (give_is_setting_enabled($give_settings[$setting_name]) ? 'disabled' : 'enabled'); |
|
556 | + } elseif (false !== strpos($setting_name, 'enable_')) { |
|
557 | 557 | |
558 | - $give_settings[ $new_setting_name ] = ( give_is_setting_enabled( $give_settings[ $setting_name ] ) ? 'enabled' : 'disabled' ); |
|
558 | + $give_settings[$new_setting_name] = (give_is_setting_enabled($give_settings[$setting_name]) ? 'enabled' : 'disabled'); |
|
559 | 559 | } |
560 | 560 | |
561 | 561 | // Tell bot to update core setting to db. |
562 | - if ( ! $setting_changed ) { |
|
562 | + if ( ! $setting_changed) { |
|
563 | 563 | $setting_changed = true; |
564 | 564 | } |
565 | 565 | } |
566 | 566 | |
567 | 567 | // Update setting only if they changed. |
568 | - if ( $setting_changed ) { |
|
569 | - update_option( 'give_settings', $give_settings ); |
|
568 | + if ($setting_changed) { |
|
569 | + update_option('give_settings', $give_settings); |
|
570 | 570 | } |
571 | 571 | }// End if(). |
572 | 572 | |
573 | - give_set_upgrade_complete( 'v18_upgrades_core_setting' ); |
|
573 | + give_set_upgrade_complete('v18_upgrades_core_setting'); |
|
574 | 574 | } |
575 | 575 | |
576 | 576 | /** |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | $give_updates = Give_Updates::get_instance(); |
585 | 585 | |
586 | 586 | // form query |
587 | - $forms = new WP_Query( array( |
|
587 | + $forms = new WP_Query(array( |
|
588 | 588 | 'paged' => $give_updates->step, |
589 | 589 | 'status' => 'any', |
590 | 590 | 'order' => 'ASC', |
@@ -593,41 +593,41 @@ discard block |
||
593 | 593 | ) |
594 | 594 | ); |
595 | 595 | |
596 | - if ( $forms->have_posts() ) { |
|
597 | - $give_updates->set_percentage( $forms->found_posts, ( $give_updates->step * 20 ) ); |
|
596 | + if ($forms->have_posts()) { |
|
597 | + $give_updates->set_percentage($forms->found_posts, ($give_updates->step * 20)); |
|
598 | 598 | |
599 | - while ( $forms->have_posts() ) { |
|
599 | + while ($forms->have_posts()) { |
|
600 | 600 | $forms->the_post(); |
601 | 601 | |
602 | 602 | // Form content. |
603 | 603 | // Note in version 1.8 display content setting split into display content and content placement setting. |
604 | 604 | // You can delete _give_content_option in future |
605 | - $show_content = give_get_meta( get_the_ID(), '_give_content_option', true ); |
|
606 | - if ( $show_content && ! give_get_meta( get_the_ID(), '_give_display_content', true ) ) { |
|
607 | - $field_value = ( 'none' !== $show_content ? 'enabled' : 'disabled' ); |
|
608 | - give_update_meta( get_the_ID(), '_give_display_content', $field_value ); |
|
605 | + $show_content = give_get_meta(get_the_ID(), '_give_content_option', true); |
|
606 | + if ($show_content && ! give_get_meta(get_the_ID(), '_give_display_content', true)) { |
|
607 | + $field_value = ('none' !== $show_content ? 'enabled' : 'disabled'); |
|
608 | + give_update_meta(get_the_ID(), '_give_display_content', $field_value); |
|
609 | 609 | |
610 | - $field_value = ( 'none' !== $show_content ? $show_content : 'give_pre_form' ); |
|
611 | - give_update_meta( get_the_ID(), '_give_content_placement', $field_value ); |
|
610 | + $field_value = ('none' !== $show_content ? $show_content : 'give_pre_form'); |
|
611 | + give_update_meta(get_the_ID(), '_give_content_placement', $field_value); |
|
612 | 612 | } |
613 | 613 | |
614 | 614 | // "Disable" Guest Donation. Checkbox |
615 | 615 | // See: https://github.com/WordImpress/Give/issues/1470 |
616 | - $guest_donation = give_get_meta( get_the_ID(), '_give_logged_in_only', true ); |
|
617 | - $guest_donation_newval = ( in_array( $guest_donation, array( 'yes', 'on' ) ) ? 'disabled' : 'enabled' ); |
|
618 | - give_update_meta( get_the_ID(), '_give_logged_in_only', $guest_donation_newval ); |
|
616 | + $guest_donation = give_get_meta(get_the_ID(), '_give_logged_in_only', true); |
|
617 | + $guest_donation_newval = (in_array($guest_donation, array('yes', 'on')) ? 'disabled' : 'enabled'); |
|
618 | + give_update_meta(get_the_ID(), '_give_logged_in_only', $guest_donation_newval); |
|
619 | 619 | |
620 | 620 | // Offline Donations |
621 | 621 | // See: https://github.com/WordImpress/Give/issues/1579 |
622 | - $offline_donation = give_get_meta( get_the_ID(), '_give_customize_offline_donations', true ); |
|
623 | - if ( 'no' === $offline_donation ) { |
|
622 | + $offline_donation = give_get_meta(get_the_ID(), '_give_customize_offline_donations', true); |
|
623 | + if ('no' === $offline_donation) { |
|
624 | 624 | $offline_donation_newval = 'global'; |
625 | - } elseif ( 'yes' === $offline_donation ) { |
|
625 | + } elseif ('yes' === $offline_donation) { |
|
626 | 626 | $offline_donation_newval = 'enabled'; |
627 | 627 | } else { |
628 | 628 | $offline_donation_newval = 'disabled'; |
629 | 629 | } |
630 | - give_update_meta( get_the_ID(), '_give_customize_offline_donations', $offline_donation_newval ); |
|
630 | + give_update_meta(get_the_ID(), '_give_customize_offline_donations', $offline_donation_newval); |
|
631 | 631 | |
632 | 632 | // Convert yes/no setting field to enabled/disabled. |
633 | 633 | $form_radio_settings = array( |
@@ -647,15 +647,15 @@ discard block |
||
647 | 647 | '_give_offline_donation_enable_billing_fields_single', |
648 | 648 | ); |
649 | 649 | |
650 | - foreach ( $form_radio_settings as $meta_key ) { |
|
650 | + foreach ($form_radio_settings as $meta_key) { |
|
651 | 651 | // Get value. |
652 | - $field_value = give_get_meta( get_the_ID(), $meta_key, true ); |
|
652 | + $field_value = give_get_meta(get_the_ID(), $meta_key, true); |
|
653 | 653 | |
654 | 654 | // Convert meta value only if it is in yes/no/none. |
655 | - if ( in_array( $field_value, array( 'yes', 'on', 'no', 'none' ) ) ) { |
|
655 | + if (in_array($field_value, array('yes', 'on', 'no', 'none'))) { |
|
656 | 656 | |
657 | - $field_value = ( in_array( $field_value, array( 'yes', 'on' ) ) ? 'enabled' : 'disabled' ); |
|
658 | - give_update_meta( get_the_ID(), $meta_key, $field_value ); |
|
657 | + $field_value = (in_array($field_value, array('yes', 'on')) ? 'enabled' : 'disabled'); |
|
658 | + give_update_meta(get_the_ID(), $meta_key, $field_value); |
|
659 | 659 | } |
660 | 660 | } |
661 | 661 | }// End while(). |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | |
665 | 665 | } else { |
666 | 666 | // No more forms found, finish up. |
667 | - give_set_upgrade_complete( 'v18_upgrades_form_metadata' ); |
|
667 | + give_set_upgrade_complete('v18_upgrades_form_metadata'); |
|
668 | 668 | } |
669 | 669 | } |
670 | 670 | |
@@ -713,7 +713,7 @@ discard block |
||
713 | 713 | '_transient_give_stats_', |
714 | 714 | 'give_cache', |
715 | 715 | '_transient_give_add_ons_feed', |
716 | - '_transient__give_ajax_works' . |
|
716 | + '_transient__give_ajax_works'. |
|
717 | 717 | '_transient_give_total_api_keys', |
718 | 718 | '_transient_give_i18n_give_promo_hide', |
719 | 719 | '_transient_give_contributors', |
@@ -740,24 +740,24 @@ discard block |
||
740 | 740 | ARRAY_A |
741 | 741 | ); |
742 | 742 | |
743 | - if ( ! empty( $user_apikey_options ) ) { |
|
744 | - foreach ( $user_apikey_options as $user ) { |
|
745 | - $cached_options[] = '_transient_' . md5( 'give_api_user_' . $user['meta_key'] ); |
|
746 | - $cached_options[] = '_transient_' . md5( 'give_api_user_public_key' . $user['user_id'] ); |
|
747 | - $cached_options[] = '_transient_' . md5( 'give_api_user_secret_key' . $user['user_id'] ); |
|
743 | + if ( ! empty($user_apikey_options)) { |
|
744 | + foreach ($user_apikey_options as $user) { |
|
745 | + $cached_options[] = '_transient_'.md5('give_api_user_'.$user['meta_key']); |
|
746 | + $cached_options[] = '_transient_'.md5('give_api_user_public_key'.$user['user_id']); |
|
747 | + $cached_options[] = '_transient_'.md5('give_api_user_secret_key'.$user['user_id']); |
|
748 | 748 | } |
749 | 749 | } |
750 | 750 | |
751 | - if ( ! empty( $cached_options ) ) { |
|
752 | - foreach ( $cached_options as $option ) { |
|
753 | - switch ( true ) { |
|
754 | - case ( false !== strpos( $option, 'transient' ) ): |
|
755 | - $option = str_replace( '_transient_', '', $option ); |
|
756 | - delete_transient( $option ); |
|
751 | + if ( ! empty($cached_options)) { |
|
752 | + foreach ($cached_options as $option) { |
|
753 | + switch (true) { |
|
754 | + case (false !== strpos($option, 'transient')): |
|
755 | + $option = str_replace('_transient_', '', $option); |
|
756 | + delete_transient($option); |
|
757 | 757 | break; |
758 | 758 | |
759 | 759 | default: |
760 | - delete_option( $option ); |
|
760 | + delete_option($option); |
|
761 | 761 | } |
762 | 762 | } |
763 | 763 | } |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | global $wp_roles; |
776 | 776 | |
777 | 777 | // Get the role object. |
778 | - $give_worker = get_role( 'give_worker' ); |
|
778 | + $give_worker = get_role('give_worker'); |
|
779 | 779 | |
780 | 780 | // A list of capabilities to add for give workers. |
781 | 781 | $caps_to_add = array( |
@@ -783,9 +783,9 @@ discard block |
||
783 | 783 | 'edit_pages', |
784 | 784 | ); |
785 | 785 | |
786 | - foreach ( $caps_to_add as $cap ) { |
|
786 | + foreach ($caps_to_add as $cap) { |
|
787 | 787 | // Add the capability. |
788 | - $give_worker->add_cap( $cap ); |
|
788 | + $give_worker->add_cap($cap); |
|
789 | 789 | } |
790 | 790 | |
791 | 791 | } |
@@ -802,7 +802,7 @@ discard block |
||
802 | 802 | $give_updates = Give_Updates::get_instance(); |
803 | 803 | |
804 | 804 | // form query |
805 | - $donation_forms = new WP_Query( array( |
|
805 | + $donation_forms = new WP_Query(array( |
|
806 | 806 | 'paged' => $give_updates->step, |
807 | 807 | 'status' => 'any', |
808 | 808 | 'order' => 'ASC', |
@@ -811,10 +811,10 @@ discard block |
||
811 | 811 | ) |
812 | 812 | ); |
813 | 813 | |
814 | - if ( $donation_forms->have_posts() ) { |
|
815 | - $give_updates->set_percentage( $donation_forms->found_posts, ( $give_updates->step * 20 ) ); |
|
814 | + if ($donation_forms->have_posts()) { |
|
815 | + $give_updates->set_percentage($donation_forms->found_posts, ($give_updates->step * 20)); |
|
816 | 816 | |
817 | - while ( $donation_forms->have_posts() ) { |
|
817 | + while ($donation_forms->have_posts()) { |
|
818 | 818 | $donation_forms->the_post(); |
819 | 819 | $form_id = get_the_ID(); |
820 | 820 | |
@@ -822,41 +822,41 @@ discard block |
||
822 | 822 | update_post_meta( |
823 | 823 | $form_id, |
824 | 824 | '_give_set_price', |
825 | - give_sanitize_amount( get_post_meta( $form_id, '_give_set_price', true ) ) |
|
825 | + give_sanitize_amount(get_post_meta($form_id, '_give_set_price', true)) |
|
826 | 826 | ); |
827 | 827 | |
828 | 828 | // Remove formatting from _give_custom_amount_minimum |
829 | 829 | update_post_meta( |
830 | 830 | $form_id, |
831 | 831 | '_give_custom_amount_minimum', |
832 | - give_sanitize_amount( get_post_meta( $form_id, '_give_custom_amount_minimum', true ) ) |
|
832 | + give_sanitize_amount(get_post_meta($form_id, '_give_custom_amount_minimum', true)) |
|
833 | 833 | ); |
834 | 834 | |
835 | 835 | // Bailout. |
836 | - if ( 'set' === get_post_meta( $form_id, '_give_price_option', true ) ) { |
|
836 | + if ('set' === get_post_meta($form_id, '_give_price_option', true)) { |
|
837 | 837 | continue; |
838 | 838 | } |
839 | 839 | |
840 | - $donation_levels = get_post_meta( $form_id, '_give_donation_levels', true ); |
|
840 | + $donation_levels = get_post_meta($form_id, '_give_donation_levels', true); |
|
841 | 841 | |
842 | - if ( ! empty( $donation_levels ) ) { |
|
842 | + if ( ! empty($donation_levels)) { |
|
843 | 843 | |
844 | - foreach ( $donation_levels as $index => $donation_level ) { |
|
845 | - if ( isset( $donation_level['_give_amount'] ) ) { |
|
846 | - $donation_levels[ $index ]['_give_amount'] = give_sanitize_amount( $donation_level['_give_amount'] ); |
|
844 | + foreach ($donation_levels as $index => $donation_level) { |
|
845 | + if (isset($donation_level['_give_amount'])) { |
|
846 | + $donation_levels[$index]['_give_amount'] = give_sanitize_amount($donation_level['_give_amount']); |
|
847 | 847 | } |
848 | 848 | } |
849 | 849 | |
850 | - update_post_meta( $form_id, '_give_donation_levels', $donation_levels ); |
|
850 | + update_post_meta($form_id, '_give_donation_levels', $donation_levels); |
|
851 | 851 | |
852 | - $donation_levels_amounts = wp_list_pluck( $donation_levels, '_give_amount' ); |
|
852 | + $donation_levels_amounts = wp_list_pluck($donation_levels, '_give_amount'); |
|
853 | 853 | |
854 | - $min_amount = min( $donation_levels_amounts ); |
|
855 | - $max_amount = max( $donation_levels_amounts ); |
|
854 | + $min_amount = min($donation_levels_amounts); |
|
855 | + $max_amount = max($donation_levels_amounts); |
|
856 | 856 | |
857 | 857 | // Set Minimum and Maximum amount for Multi Level Donation Forms |
858 | - give_update_meta( $form_id, '_give_levels_minimum_amount', $min_amount ? give_sanitize_amount( $min_amount ) : 0 ); |
|
859 | - give_update_meta( $form_id, '_give_levels_maximum_amount', $max_amount ? give_sanitize_amount( $max_amount ) : 0 ); |
|
858 | + give_update_meta($form_id, '_give_levels_minimum_amount', $min_amount ? give_sanitize_amount($min_amount) : 0); |
|
859 | + give_update_meta($form_id, '_give_levels_maximum_amount', $max_amount ? give_sanitize_amount($max_amount) : 0); |
|
860 | 860 | } |
861 | 861 | |
862 | 862 | } |
@@ -865,7 +865,7 @@ discard block |
||
865 | 865 | wp_reset_postdata(); |
866 | 866 | } else { |
867 | 867 | // The Update Ran. |
868 | - give_set_upgrade_complete( 'v189_upgrades_levels_post_meta' ); |
|
868 | + give_set_upgrade_complete('v189_upgrades_levels_post_meta'); |
|
869 | 869 | } |
870 | 870 | |
871 | 871 | } |
@@ -921,22 +921,22 @@ discard block |
||
921 | 921 | $give_settings = give_get_settings(); |
922 | 922 | $give_setting_updated = false; |
923 | 923 | |
924 | - if ( $give_settings['thousands_separator'] === $give_settings['decimal_separator'] ) { |
|
924 | + if ($give_settings['thousands_separator'] === $give_settings['decimal_separator']) { |
|
925 | 925 | $give_settings['number_decimals'] = 0; |
926 | 926 | $give_settings['decimal_separator'] = ''; |
927 | 927 | $give_setting_updated = true; |
928 | 928 | |
929 | - } elseif ( empty( $give_settings['decimal_separator'] ) ) { |
|
929 | + } elseif (empty($give_settings['decimal_separator'])) { |
|
930 | 930 | $give_settings['number_decimals'] = 0; |
931 | 931 | $give_setting_updated = true; |
932 | 932 | |
933 | - } elseif ( 6 < absint( $give_settings['number_decimals'] ) ) { |
|
933 | + } elseif (6 < absint($give_settings['number_decimals'])) { |
|
934 | 934 | $give_settings['number_decimals'] = 5; |
935 | 935 | $give_setting_updated = true; |
936 | 936 | } |
937 | 937 | |
938 | - if ( $give_setting_updated ) { |
|
939 | - update_option( 'give_settings', $give_settings ); |
|
938 | + if ($give_setting_updated) { |
|
939 | + update_option('give_settings', $give_settings); |
|
940 | 940 | } |
941 | 941 | } |
942 | 942 | |
@@ -955,70 +955,70 @@ discard block |
||
955 | 955 | $give_updates = Give_Updates::get_instance(); |
956 | 956 | |
957 | 957 | // form query |
958 | - $donation_forms = new WP_Query( array( |
|
958 | + $donation_forms = new WP_Query(array( |
|
959 | 959 | 'paged' => $give_updates->step, |
960 | 960 | 'status' => 'any', |
961 | 961 | 'order' => 'ASC', |
962 | - 'post_type' => array( 'give_forms', 'give_payment' ), |
|
962 | + 'post_type' => array('give_forms', 'give_payment'), |
|
963 | 963 | 'posts_per_page' => 20, |
964 | 964 | ) |
965 | 965 | ); |
966 | 966 | |
967 | - if ( $donation_forms->have_posts() ) { |
|
968 | - $give_updates->set_percentage( $donation_forms->found_posts, ( $give_updates->step * 20 ) ); |
|
967 | + if ($donation_forms->have_posts()) { |
|
968 | + $give_updates->set_percentage($donation_forms->found_posts, ($give_updates->step * 20)); |
|
969 | 969 | |
970 | - while ( $donation_forms->have_posts() ) { |
|
970 | + while ($donation_forms->have_posts()) { |
|
971 | 971 | $donation_forms->the_post(); |
972 | 972 | global $post; |
973 | 973 | |
974 | - $meta = get_post_meta( $post->ID ); |
|
974 | + $meta = get_post_meta($post->ID); |
|
975 | 975 | |
976 | - switch ( $post->post_type ) { |
|
976 | + switch ($post->post_type) { |
|
977 | 977 | case 'give_forms': |
978 | 978 | // _give_set_price |
979 | - if( ! empty( $meta['_give_set_price'][0] ) ) { |
|
980 | - update_post_meta( $post->ID, '_give_set_price', give_sanitize_amount_for_db( $meta['_give_set_price'][0] ) ); |
|
979 | + if ( ! empty($meta['_give_set_price'][0])) { |
|
980 | + update_post_meta($post->ID, '_give_set_price', give_sanitize_amount_for_db($meta['_give_set_price'][0])); |
|
981 | 981 | } |
982 | 982 | |
983 | 983 | // _give_custom_amount_minimum |
984 | - if( ! empty( $meta['_give_custom_amount_minimum'][0] ) ) { |
|
985 | - update_post_meta( $post->ID, '_give_custom_amount_minimum', give_sanitize_amount_for_db( $meta['_give_custom_amount_minimum'][0] ) ); |
|
984 | + if ( ! empty($meta['_give_custom_amount_minimum'][0])) { |
|
985 | + update_post_meta($post->ID, '_give_custom_amount_minimum', give_sanitize_amount_for_db($meta['_give_custom_amount_minimum'][0])); |
|
986 | 986 | } |
987 | 987 | |
988 | 988 | // _give_levels_minimum_amount |
989 | - if( ! empty( $meta['_give_levels_minimum_amount'][0] ) ) { |
|
990 | - update_post_meta( $post->ID, '_give_levels_minimum_amount', give_sanitize_amount_for_db( $meta['_give_levels_minimum_amount'][0] ) ); |
|
989 | + if ( ! empty($meta['_give_levels_minimum_amount'][0])) { |
|
990 | + update_post_meta($post->ID, '_give_levels_minimum_amount', give_sanitize_amount_for_db($meta['_give_levels_minimum_amount'][0])); |
|
991 | 991 | } |
992 | 992 | |
993 | 993 | // _give_levels_maximum_amount |
994 | - if( ! empty( $meta['_give_levels_maximum_amount'][0] ) ) { |
|
995 | - update_post_meta( $post->ID, '_give_levels_maximum_amount', give_sanitize_amount_for_db( $meta['_give_levels_maximum_amount'][0] ) ); |
|
994 | + if ( ! empty($meta['_give_levels_maximum_amount'][0])) { |
|
995 | + update_post_meta($post->ID, '_give_levels_maximum_amount', give_sanitize_amount_for_db($meta['_give_levels_maximum_amount'][0])); |
|
996 | 996 | } |
997 | 997 | |
998 | 998 | // _give_set_goal |
999 | - if( ! empty( $meta['_give_set_goal'][0] ) ) { |
|
1000 | - update_post_meta( $post->ID, '_give_set_goal', give_sanitize_amount_for_db( $meta['_give_set_goal'][0] ) ); |
|
999 | + if ( ! empty($meta['_give_set_goal'][0])) { |
|
1000 | + update_post_meta($post->ID, '_give_set_goal', give_sanitize_amount_for_db($meta['_give_set_goal'][0])); |
|
1001 | 1001 | } |
1002 | 1002 | |
1003 | 1003 | // _give_form_earnings |
1004 | - if( ! empty( $meta['_give_form_earnings'][0] ) ) { |
|
1005 | - update_post_meta( $post->ID, '_give_form_earnings', give_sanitize_amount_for_db( $meta['_give_form_earnings'][0] ) ); |
|
1004 | + if ( ! empty($meta['_give_form_earnings'][0])) { |
|
1005 | + update_post_meta($post->ID, '_give_form_earnings', give_sanitize_amount_for_db($meta['_give_form_earnings'][0])); |
|
1006 | 1006 | } |
1007 | 1007 | |
1008 | 1008 | // _give_custom_amount_minimum |
1009 | - if( ! empty( $meta['_give_donation_levels'][0] ) ) { |
|
1010 | - $donation_levels = unserialize( $meta['_give_donation_levels'][0] ); |
|
1009 | + if ( ! empty($meta['_give_donation_levels'][0])) { |
|
1010 | + $donation_levels = unserialize($meta['_give_donation_levels'][0]); |
|
1011 | 1011 | |
1012 | - foreach( $donation_levels as $index => $level ) { |
|
1013 | - if( empty( $level['_give_amount'] ) ) { |
|
1012 | + foreach ($donation_levels as $index => $level) { |
|
1013 | + if (empty($level['_give_amount'])) { |
|
1014 | 1014 | continue; |
1015 | 1015 | } |
1016 | 1016 | |
1017 | - $donation_levels[$index]['_give_amount'] = give_sanitize_amount_for_db( $level['_give_amount'] ); |
|
1017 | + $donation_levels[$index]['_give_amount'] = give_sanitize_amount_for_db($level['_give_amount']); |
|
1018 | 1018 | } |
1019 | 1019 | |
1020 | 1020 | $meta['_give_donation_levels'] = $donation_levels; |
1021 | - update_post_meta( $post->ID, '_give_donation_levels', $meta['_give_donation_levels'] ); |
|
1021 | + update_post_meta($post->ID, '_give_donation_levels', $meta['_give_donation_levels']); |
|
1022 | 1022 | } |
1023 | 1023 | |
1024 | 1024 | |
@@ -1026,8 +1026,8 @@ discard block |
||
1026 | 1026 | |
1027 | 1027 | case 'give_payment': |
1028 | 1028 | // _give_payment_total |
1029 | - if( ! empty( $meta['_give_payment_total'][0] ) ) { |
|
1030 | - update_post_meta( $post->ID, '_give_payment_total', give_sanitize_amount_for_db( $meta['_give_payment_total'][0] ) ); |
|
1029 | + if ( ! empty($meta['_give_payment_total'][0])) { |
|
1030 | + update_post_meta($post->ID, '_give_payment_total', give_sanitize_amount_for_db($meta['_give_payment_total'][0])); |
|
1031 | 1031 | } |
1032 | 1032 | |
1033 | 1033 | break; |
@@ -1038,7 +1038,7 @@ discard block |
||
1038 | 1038 | wp_reset_postdata(); |
1039 | 1039 | } else { |
1040 | 1040 | // The Update Ran. |
1041 | - give_set_upgrade_complete( 'v1812_update_amount_values' ); |
|
1041 | + give_set_upgrade_complete('v1812_update_amount_values'); |
|
1042 | 1042 | } |
1043 | 1043 | } |
1044 | 1044 | |
@@ -1058,21 +1058,21 @@ discard block |
||
1058 | 1058 | $offset = 1 === $give_updates->step ? 0 : $give_updates->step * 20; |
1059 | 1059 | |
1060 | 1060 | // form query |
1061 | - $donors = Give()->donors->get_donors( array( |
|
1061 | + $donors = Give()->donors->get_donors(array( |
|
1062 | 1062 | 'number' => 20, |
1063 | 1063 | 'offset' => $offset, |
1064 | 1064 | ) |
1065 | 1065 | ); |
1066 | 1066 | |
1067 | - if ( ! empty( $donors ) ) { |
|
1068 | - $give_updates->set_percentage( Give()->donors->count(), ( $give_updates->step * 20 ) ); |
|
1067 | + if ( ! empty($donors)) { |
|
1068 | + $give_updates->set_percentage(Give()->donors->count(), ($give_updates->step * 20)); |
|
1069 | 1069 | |
1070 | 1070 | /* @var Object $donor */ |
1071 | - foreach ( $donors as $donor ) { |
|
1072 | - Give()->donors->update( $donor->id, array( 'purchase_value' => give_sanitize_amount_for_db( $donor->purchase_value ) ) ); |
|
1071 | + foreach ($donors as $donor) { |
|
1072 | + Give()->donors->update($donor->id, array('purchase_value' => give_sanitize_amount_for_db($donor->purchase_value))); |
|
1073 | 1073 | } |
1074 | 1074 | } else { |
1075 | 1075 | // The Update Ran. |
1076 | - give_set_upgrade_complete( 'v1812_update_donor_purchase_values' ); |
|
1076 | + give_set_upgrade_complete('v1812_update_donor_purchase_values'); |
|
1077 | 1077 | } |
1078 | 1078 | } |
@@ -70,24 +70,24 @@ discard block |
||
70 | 70 | * |
71 | 71 | * @param array $args |
72 | 72 | */ |
73 | - public function register( $args ) { |
|
73 | + public function register($args) { |
|
74 | 74 | $args_default = array( |
75 | 75 | 'id' => '', |
76 | 76 | 'version' => '', |
77 | 77 | 'callback' => '', |
78 | 78 | ); |
79 | 79 | |
80 | - $args = wp_parse_args( $args, $args_default ); |
|
80 | + $args = wp_parse_args($args, $args_default); |
|
81 | 81 | |
82 | 82 | // You can only register database upgrade. |
83 | 83 | $args['type'] = 'database'; |
84 | 84 | |
85 | 85 | // Bailout. |
86 | - if ( empty( $args['id'] ) || empty( $args['version'] ) || empty( $args['callback'] ) || ! is_callable( $args['callback'] ) ) { |
|
86 | + if (empty($args['id']) || empty($args['version']) || empty($args['callback']) || ! is_callable($args['callback'])) { |
|
87 | 87 | return; |
88 | 88 | } |
89 | 89 | |
90 | - $this->updates[ $args['type'] ][] = $args; |
|
90 | + $this->updates[$args['type']][] = $args; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | |
@@ -102,32 +102,32 @@ discard block |
||
102 | 102 | * |
103 | 103 | * @return array |
104 | 104 | */ |
105 | - public function get_updates( $update_type = '', $status = 'all' ) { |
|
105 | + public function get_updates($update_type = '', $status = 'all') { |
|
106 | 106 | // return all updates. |
107 | - if ( empty( $update_type ) ) { |
|
107 | + if (empty($update_type)) { |
|
108 | 108 | return $this->updates; |
109 | 109 | } |
110 | 110 | |
111 | 111 | // Get specific update. |
112 | - $updates = ! empty( $this->updates[ $update_type ] ) ? $this->updates[ $update_type ] : array(); |
|
112 | + $updates = ! empty($this->updates[$update_type]) ? $this->updates[$update_type] : array(); |
|
113 | 113 | |
114 | 114 | // Bailout. |
115 | - if ( empty( $updates ) ) { |
|
115 | + if (empty($updates)) { |
|
116 | 116 | return $updates; |
117 | 117 | } |
118 | 118 | |
119 | - switch ( $status ) { |
|
119 | + switch ($status) { |
|
120 | 120 | case 'new': |
121 | 121 | // Remove already completed updates. |
122 | 122 | $completed_updates = give_get_completed_upgrades(); |
123 | 123 | |
124 | - if ( ! empty( $completed_updates ) ) { |
|
125 | - foreach ( $updates as $index => $update ) { |
|
126 | - if ( in_array( $update['id'], $completed_updates ) ) { |
|
127 | - unset( $updates[ $index ] ); |
|
124 | + if ( ! empty($completed_updates)) { |
|
125 | + foreach ($updates as $index => $update) { |
|
126 | + if (in_array($update['id'], $completed_updates)) { |
|
127 | + unset($updates[$index]); |
|
128 | 128 | } |
129 | 129 | } |
130 | - $updates = array_values( $updates ); |
|
130 | + $updates = array_values($updates); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | break; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * @return static |
145 | 145 | */ |
146 | 146 | static function get_instance() { |
147 | - if ( is_null( self::$instance ) ) { |
|
147 | + if (is_null(self::$instance)) { |
|
148 | 148 | self::$instance = new self(); |
149 | 149 | } |
150 | 150 | |
@@ -162,16 +162,16 @@ discard block |
||
162 | 162 | /** |
163 | 163 | * Setup hooks. |
164 | 164 | */ |
165 | - add_action( 'init', array( $this, '__register_upgrade' ), 9999 ); |
|
166 | - add_action( 'admin_init', array( $this, '__change_donations_label' ), 9999 ); |
|
167 | - add_action( 'admin_menu', array( $this, '__register_menu' ), 9999 ); |
|
168 | - add_action( 'give_set_upgrade_completed', array( $this, '__flush_resume_updates' ), 9999 ); |
|
169 | - add_action( 'wp_ajax_give_do_ajax_updates', array( $this, '__give_ajax_updates' ) ); |
|
165 | + add_action('init', array($this, '__register_upgrade'), 9999); |
|
166 | + add_action('admin_init', array($this, '__change_donations_label'), 9999); |
|
167 | + add_action('admin_menu', array($this, '__register_menu'), 9999); |
|
168 | + add_action('give_set_upgrade_completed', array($this, '__flush_resume_updates'), 9999); |
|
169 | + add_action('wp_ajax_give_do_ajax_updates', array($this, '__give_ajax_updates')); |
|
170 | 170 | |
171 | 171 | /** |
172 | 172 | * Load file |
173 | 173 | */ |
174 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php'; |
|
174 | + require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/upgrade-functions.php'; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -184,12 +184,12 @@ discard block |
||
184 | 184 | $addons = give_get_plugins(); |
185 | 185 | $plugin_updates = get_plugin_updates(); |
186 | 186 | |
187 | - foreach ( $addons as $key => $info ) { |
|
188 | - if ( 'active' != $info['Status'] || 'add-on' != $info['Type'] || empty( $plugin_updates[ $key ] ) ) { |
|
187 | + foreach ($addons as $key => $info) { |
|
188 | + if ('active' != $info['Status'] || 'add-on' != $info['Type'] || empty($plugin_updates[$key])) { |
|
189 | 189 | continue; |
190 | 190 | } |
191 | 191 | |
192 | - $this->updates['plugin'][] = array_merge( $info, (array) $plugin_updates[ $key ] ); |
|
192 | + $this->updates['plugin'][] = array_merge($info, (array) $plugin_updates[$key]); |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | * @access public |
202 | 202 | */ |
203 | 203 | public function __register_upgrade() { |
204 | - if ( ! is_admin() ) { |
|
204 | + if ( ! is_admin()) { |
|
205 | 205 | return; |
206 | 206 | } |
207 | 207 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | * |
211 | 211 | * @since 1.8.12 |
212 | 212 | */ |
213 | - do_action( 'give_register_updates', $this ); |
|
213 | + do_action('give_register_updates', $this); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | /** |
@@ -224,17 +224,17 @@ discard block |
||
224 | 224 | global $submenu; |
225 | 225 | |
226 | 226 | // Bailout. |
227 | - if ( empty( $menu ) || ! $this->get_update_count() ) { |
|
227 | + if (empty($menu) || ! $this->get_update_count()) { |
|
228 | 228 | return; |
229 | 229 | } |
230 | 230 | |
231 | - foreach ( $menu as $index => $menu_item ) { |
|
232 | - if ( 'edit.php?post_type=give_forms' !== $menu_item[2] ) { |
|
231 | + foreach ($menu as $index => $menu_item) { |
|
232 | + if ('edit.php?post_type=give_forms' !== $menu_item[2]) { |
|
233 | 233 | continue; |
234 | 234 | } |
235 | 235 | |
236 | - $menu[ $index ][0] = sprintf( |
|
237 | - __( 'Donations <span class="update-plugins count-%1$d"><span class="plugin-count">%1$d</span></span>', 'give' ), |
|
236 | + $menu[$index][0] = sprintf( |
|
237 | + __('Donations <span class="update-plugins count-%1$d"><span class="plugin-count">%1$d</span></span>', 'give'), |
|
238 | 238 | $this->get_update_count() |
239 | 239 | ); |
240 | 240 | |
@@ -256,15 +256,15 @@ discard block |
||
256 | 256 | // Bailout. |
257 | 257 | if ( ! $this->get_update_count()) { |
258 | 258 | // Show complete update message if still on update setting page. |
259 | - if ( isset($_GET['page']) && 'give-updates' === $_GET['page'] ) { |
|
259 | + if (isset($_GET['page']) && 'give-updates' === $_GET['page']) { |
|
260 | 260 | // Upgrades |
261 | 261 | add_submenu_page( |
262 | 262 | 'edit.php?post_type=give_forms', |
263 | - esc_html__( 'Give Updates Complete', 'give' ), |
|
264 | - __( 'Updates', 'give' ), |
|
263 | + esc_html__('Give Updates Complete', 'give'), |
|
264 | + __('Updates', 'give'), |
|
265 | 265 | 'manage_give_settings', |
266 | 266 | 'give-updates', |
267 | - array( $this, 'render_complete_page' ) |
|
267 | + array($this, 'render_complete_page') |
|
268 | 268 | ); |
269 | 269 | } |
270 | 270 | |
@@ -274,15 +274,15 @@ discard block |
||
274 | 274 | // Upgrades |
275 | 275 | add_submenu_page( |
276 | 276 | 'edit.php?post_type=give_forms', |
277 | - esc_html__( 'Give Updates', 'give' ), |
|
277 | + esc_html__('Give Updates', 'give'), |
|
278 | 278 | sprintf( |
279 | 279 | '%1$s <span class="update-plugins count-%2$d"><span class="plugin-count">%2$d</span></span>', |
280 | - __( 'Updates', 'give' ), |
|
280 | + __('Updates', 'give'), |
|
281 | 281 | $this->get_update_count() |
282 | 282 | ), |
283 | 283 | 'manage_give_settings', |
284 | 284 | 'give-updates', |
285 | - array( $this, 'render_page' ) |
|
285 | + array($this, 'render_page') |
|
286 | 286 | ); |
287 | 287 | } |
288 | 288 | |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | * @return int |
295 | 295 | */ |
296 | 296 | public function get_db_update_count() { |
297 | - return count( $this->get_updates( 'database', 'new' ) ); |
|
297 | + return count($this->get_updates('database', 'new')); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | /** |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | * @access public |
305 | 305 | */ |
306 | 306 | public function render_complete_page() { |
307 | - include_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/views/upgrades-complete.php'; |
|
307 | + include_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/views/upgrades-complete.php'; |
|
308 | 308 | } |
309 | 309 | |
310 | 310 | /** |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | * @access public |
315 | 315 | */ |
316 | 316 | public function render_page() { |
317 | - include_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/views/upgrades.php'; |
|
317 | + include_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/views/upgrades.php'; |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | /** |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | * @return int |
326 | 326 | */ |
327 | 327 | public function get_plugin_update_count() { |
328 | - return count( $this->get_updates( 'plugin' ) ); |
|
328 | + return count($this->get_updates('plugin')); |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | /** |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | $db_update_count = $this->get_db_update_count(); |
341 | 341 | $plugin_update_count = $this->get_plugin_update_count(); |
342 | 342 | |
343 | - return ( $db_update_count + $plugin_update_count ); |
|
343 | + return ($db_update_count + $plugin_update_count); |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | |
@@ -351,12 +351,12 @@ discard block |
||
351 | 351 | * @access public |
352 | 352 | */ |
353 | 353 | public function __flush_resume_updates() { |
354 | - delete_option( 'give_doing_upgrade' ); |
|
355 | - update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) ); |
|
354 | + delete_option('give_doing_upgrade'); |
|
355 | + update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION)); |
|
356 | 356 | |
357 | 357 | // Reset counter. |
358 | 358 | $this->step = $this->percentage = 0; |
359 | - ++ $this->update; |
|
359 | + ++$this->update; |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | /** |
@@ -367,30 +367,30 @@ discard block |
||
367 | 367 | */ |
368 | 368 | public function __give_ajax_updates() { |
369 | 369 | // Check permission. |
370 | - if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
370 | + if ( ! current_user_can('manage_give_settings')) { |
|
371 | 371 | $this->send_ajax_response( |
372 | 372 | array( |
373 | - 'message' => esc_html__( 'You do not have permission to do Give upgrades.', 'give' ), |
|
373 | + 'message' => esc_html__('You do not have permission to do Give upgrades.', 'give'), |
|
374 | 374 | ), |
375 | 375 | 'error' |
376 | 376 | ); |
377 | 377 | } |
378 | 378 | |
379 | 379 | // Update timeout error. |
380 | - ignore_user_abort( true ); |
|
381 | - if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) { |
|
382 | - @set_time_limit( 0 ); |
|
380 | + ignore_user_abort(true); |
|
381 | + if ( ! give_is_func_disabled('set_time_limit') && ! ini_get('safe_mode')) { |
|
382 | + @set_time_limit(0); |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | // Set params. |
386 | - $this->step = absint( $_POST['step'] ); |
|
387 | - $this->update = absint( $_POST['update'] ); |
|
386 | + $this->step = absint($_POST['step']); |
|
387 | + $this->update = absint($_POST['update']); |
|
388 | 388 | |
389 | 389 | // Bailout: step and update must be positive and greater then zero. |
390 | - if ( ! $this->step ) { |
|
390 | + if ( ! $this->step) { |
|
391 | 391 | $this->send_ajax_response( |
392 | 392 | array( |
393 | - 'message' => __( 'Please reload this page and try again', 'give' ), |
|
393 | + 'message' => __('Please reload this page and try again', 'give'), |
|
394 | 394 | 'heading' => '', |
395 | 395 | 'percentage' => 0, |
396 | 396 | ), |
@@ -399,14 +399,14 @@ discard block |
||
399 | 399 | } |
400 | 400 | |
401 | 401 | // Get updates. |
402 | - $updates = $this->get_updates( 'database', 'new' ); |
|
402 | + $updates = $this->get_updates('database', 'new'); |
|
403 | 403 | |
404 | 404 | // Bailout if we do not have nay updates. |
405 | - if ( empty( $updates ) ) { |
|
405 | + if (empty($updates)) { |
|
406 | 406 | $this->send_ajax_response( |
407 | 407 | array( |
408 | - 'message' => __( 'The database is already up to date.', 'give' ), |
|
409 | - 'heading' => __( 'Updates Completed.', 'give' ), |
|
408 | + 'message' => __('The database is already up to date.', 'give'), |
|
409 | + 'heading' => __('Updates Completed.', 'give'), |
|
410 | 410 | 'percentage' => 0, |
411 | 411 | ), |
412 | 412 | 'success' |
@@ -414,26 +414,26 @@ discard block |
||
414 | 414 | } |
415 | 415 | |
416 | 416 | // Process update. |
417 | - foreach ( $updates as $index => $update ) { |
|
417 | + foreach ($updates as $index => $update) { |
|
418 | 418 | // Check if update depend upon any other update. |
419 | - if ( ! empty( $update['depend'] ) && ! give_has_upgrade_completed( $update['depend'] ) ) { |
|
419 | + if ( ! empty($update['depend']) && ! give_has_upgrade_completed($update['depend'])) { |
|
420 | 420 | continue; |
421 | 421 | } |
422 | 422 | |
423 | 423 | // Run update. |
424 | - if ( is_array( $update['callback'] ) ) { |
|
424 | + if (is_array($update['callback'])) { |
|
425 | 425 | $update['callback'][0]->$update['callback'][1](); |
426 | 426 | } else { |
427 | 427 | $update['callback'](); |
428 | 428 | } |
429 | 429 | |
430 | 430 | // Check if current update completed or not. |
431 | - if ( give_has_upgrade_completed( $update['id'] ) ) { |
|
432 | - if ( 1 === count( $updates ) ) { |
|
431 | + if (give_has_upgrade_completed($update['id'])) { |
|
432 | + if (1 === count($updates)) { |
|
433 | 433 | $this->send_ajax_response( |
434 | 434 | array( |
435 | - 'message' => __( 'Database updated successfully.', 'give' ), |
|
436 | - 'heading' => __( 'Updates Completed.', 'give' ), |
|
435 | + 'message' => __('Database updated successfully.', 'give'), |
|
436 | + 'heading' => __('Updates Completed.', 'give'), |
|
437 | 437 | 'percentage' => 0, |
438 | 438 | ), |
439 | 439 | 'success' |
@@ -443,16 +443,16 @@ discard block |
||
443 | 443 | |
444 | 444 | $doing_upgrade_args = array( |
445 | 445 | 'update_info' => $update, |
446 | - 'step' => ++ $this->step, |
|
446 | + 'step' => ++$this->step, |
|
447 | 447 | 'update' => $this->update, |
448 | - 'heading' => sprintf( 'Update %s of {update_count}', $this->update ), |
|
448 | + 'heading' => sprintf('Update %s of {update_count}', $this->update), |
|
449 | 449 | 'percentage' => $this->percentage, |
450 | 450 | ); |
451 | 451 | |
452 | 452 | // Cache upgrade. |
453 | - update_option( 'give_doing_upgrade', $doing_upgrade_args ); |
|
453 | + update_option('give_doing_upgrade', $doing_upgrade_args); |
|
454 | 454 | |
455 | - $this->send_ajax_response( $doing_upgrade_args ); |
|
455 | + $this->send_ajax_response($doing_upgrade_args); |
|
456 | 456 | }// End foreach(). |
457 | 457 | } |
458 | 458 | |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | * @param $data |
466 | 466 | * @param string $type |
467 | 467 | */ |
468 | - public function send_ajax_response( $data, $type = '' ) { |
|
468 | + public function send_ajax_response($data, $type = '') { |
|
469 | 469 | $default = array( |
470 | 470 | 'message' => '', |
471 | 471 | 'heading' => '', |
@@ -475,21 +475,21 @@ discard block |
||
475 | 475 | ); |
476 | 476 | |
477 | 477 | // Set data. |
478 | - $data = wp_parse_args( $data, $default ); |
|
478 | + $data = wp_parse_args($data, $default); |
|
479 | 479 | |
480 | - switch ( $type ) { |
|
480 | + switch ($type) { |
|
481 | 481 | case 'success': |
482 | - wp_send_json_success( $data ); |
|
482 | + wp_send_json_success($data); |
|
483 | 483 | break; |
484 | 484 | |
485 | 485 | case 'error': |
486 | - wp_send_json_error( $data ); |
|
486 | + wp_send_json_error($data); |
|
487 | 487 | break; |
488 | 488 | |
489 | 489 | default: |
490 | - wp_send_json( array( |
|
490 | + wp_send_json(array( |
|
491 | 491 | 'data' => $data, |
492 | - ) ); |
|
492 | + )); |
|
493 | 493 | break; |
494 | 494 | } |
495 | 495 | } |
@@ -506,8 +506,8 @@ discard block |
||
506 | 506 | public function resume_updates() { |
507 | 507 | $status = false; |
508 | 508 | |
509 | - if ( $update = get_option( 'give_doing_upgrade' ) ) { |
|
510 | - $status = ! empty( $update['step'] ) ? $update['step'] : $status; |
|
509 | + if ($update = get_option('give_doing_upgrade')) { |
|
510 | + $status = ! empty($update['step']) ? $update['step'] : $status; |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | return $status; |
@@ -523,12 +523,12 @@ discard block |
||
523 | 523 | * @param $total |
524 | 524 | * @param $current_total |
525 | 525 | */ |
526 | - public function set_percentage( $total, $current_total ) { |
|
526 | + public function set_percentage($total, $current_total) { |
|
527 | 527 | // Set percentage. |
528 | - $this->percentage = $total ? ( ( $current_total ) / $total ) * 100 : 0; |
|
528 | + $this->percentage = $total ? (($current_total) / $total) * 100 : 0; |
|
529 | 529 | |
530 | 530 | // Verify percentage. |
531 | - $this->percentage = ( 100 < $this->percentage ) ? 100 : $this->percentage; |
|
531 | + $this->percentage = (100 < $this->percentage) ? 100 : $this->percentage; |
|
532 | 532 | } |
533 | 533 | } |
534 | 534 |
@@ -10,15 +10,15 @@ |
||
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 | <div class="wrap" id="poststuff"> |
18 | 18 | <div id="give-updates"> |
19 | - <h1 id="give-updates-h1"><?php esc_html_e( 'Give - Updates Complete', 'give' ); ?></h1> |
|
19 | + <h1 id="give-updates-h1"><?php esc_html_e('Give - Updates Complete', 'give'); ?></h1> |
|
20 | 20 | <div class="give-update-panel-content"> |
21 | - <p><?php esc_html_e( 'Congratulations! You are running the latest versions of Give and it\'s add-ons.', 'give' ); ?></p> |
|
21 | + <p><?php esc_html_e('Congratulations! You are running the latest versions of Give and it\'s add-ons.', 'give'); ?></p> |
|
22 | 22 | </div> |
23 | 23 | |
24 | 24 | </div> |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /* @var Give_Updates $give_updates */ |
3 | -$plugins = $give_updates->get_updates( 'plugin' ); |
|
4 | -if ( empty( $plugins ) ) { |
|
3 | +$plugins = $give_updates->get_updates('plugin'); |
|
4 | +if (empty($plugins)) { |
|
5 | 5 | return; |
6 | 6 | } |
7 | 7 | |
8 | 8 | ob_start(); |
9 | -foreach ( $plugins as $plugin_data ) { |
|
10 | - if ( 'active' != $plugin_data['Status'] || 'add-on' != $plugin_data['Type'] ) { |
|
9 | +foreach ($plugins as $plugin_data) { |
|
10 | + if ('active' != $plugin_data['Status'] || 'add-on' != $plugin_data['Type']) { |
|
11 | 11 | continue; |
12 | 12 | } |
13 | 13 | |
@@ -15,36 +15,36 @@ discard block |
||
15 | 15 | $author_name = $plugin_data['Author']; |
16 | 16 | |
17 | 17 | // Link the plugin name to the plugin URL if available. |
18 | - if ( ! empty( $plugin_data['PluginURI'] ) ) { |
|
18 | + if ( ! empty($plugin_data['PluginURI'])) { |
|
19 | 19 | $plugin_name = sprintf( |
20 | 20 | '<a href="%s" title="%s">%s</a> (%s)', |
21 | - esc_url( $plugin_data['PluginURI'] ), |
|
22 | - esc_attr__( 'Visit plugin homepage', 'give' ), |
|
21 | + esc_url($plugin_data['PluginURI']), |
|
22 | + esc_attr__('Visit plugin homepage', 'give'), |
|
23 | 23 | $plugin_name, |
24 | - esc_html( $plugin_data['Version'] ) |
|
24 | + esc_html($plugin_data['Version']) |
|
25 | 25 | ); |
26 | 26 | } |
27 | 27 | |
28 | 28 | // Link the author name to the author URL if available. |
29 | - if ( ! empty( $plugin_data['AuthorURI'] ) ) { |
|
29 | + if ( ! empty($plugin_data['AuthorURI'])) { |
|
30 | 30 | $author_name = sprintf( |
31 | 31 | '<a href="%s" title="%s">%s</a>', |
32 | - esc_url( $plugin_data['AuthorURI'] ), |
|
33 | - esc_attr__( 'Visit author homepage', 'give' ), |
|
32 | + esc_url($plugin_data['AuthorURI']), |
|
33 | + esc_attr__('Visit author homepage', 'give'), |
|
34 | 34 | $author_name |
35 | 35 | ); |
36 | 36 | } |
37 | 37 | ?> |
38 | - <tr <?php echo( true !== $plugin_data['License'] ? 'data-tooltip="' . __( 'Unlicensed add-ons cannot be updated. Please purchase or renew a valid license.', 'give' ) . '"' : '' ); ?>> |
|
39 | - <td><?php echo wp_kses( $plugin_name, wp_kses_allowed_html( 'post' ) ); ?></td> |
|
38 | + <tr <?php echo(true !== $plugin_data['License'] ? 'data-tooltip="'.__('Unlicensed add-ons cannot be updated. Please purchase or renew a valid license.', 'give').'"' : ''); ?>> |
|
39 | + <td><?php echo wp_kses($plugin_name, wp_kses_allowed_html('post')); ?></td> |
|
40 | 40 | <td> |
41 | 41 | <?php |
42 | - echo ( true === $plugin_data['License'] ) ? '<span class="dashicons dashicons-yes"></span>' . __( 'Licensed', 'give' ) : '<span class="dashicons dashicons-no-alt"></span>' . __( 'Unlicensed', 'give' ); |
|
42 | + echo (true === $plugin_data['License']) ? '<span class="dashicons dashicons-yes"></span>'.__('Licensed', 'give') : '<span class="dashicons dashicons-no-alt"></span>'.__('Unlicensed', 'give'); |
|
43 | 43 | |
44 | 44 | echo sprintf( |
45 | 45 | ' – %s – %s', |
46 | - sprintf( _x( 'by %s', 'by author', 'give' ), wp_kses( $author_name, wp_kses_allowed_html( 'post' ) ) ), |
|
47 | - sprintf( __( '(Latest Version: %s)' ), $plugin_data['update']->new_version ) |
|
46 | + sprintf(_x('by %s', 'by author', 'give'), wp_kses($author_name, wp_kses_allowed_html('post'))), |
|
47 | + sprintf(__('(Latest Version: %s)'), $plugin_data['update']->new_version) |
|
48 | 48 | ); |
49 | 49 | ?> |
50 | 50 | </td> |
@@ -12,13 +12,13 @@ discard block |
||
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 | |
19 | 19 | // Load WP_List_Table if not loaded |
20 | -if ( ! class_exists( 'WP_List_Table' ) ) { |
|
21 | - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; |
|
20 | +if ( ! class_exists('WP_List_Table')) { |
|
21 | + require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php'; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | public function __construct() { |
62 | 62 | |
63 | 63 | // Set parent defaults |
64 | - parent::__construct( array( |
|
65 | - 'singular' => __( 'Donor', 'give' ), // Singular name of the listed records. |
|
66 | - 'plural' => __( 'Donors', 'give' ), // Plural name of the listed records. |
|
67 | - 'ajax' => false,// Does this table support ajax?. |
|
68 | - ) ); |
|
64 | + parent::__construct(array( |
|
65 | + 'singular' => __('Donor', 'give'), // Singular name of the listed records. |
|
66 | + 'plural' => __('Donors', 'give'), // Plural name of the listed records. |
|
67 | + 'ajax' => false, // Does this table support ajax?. |
|
68 | + )); |
|
69 | 69 | |
70 | 70 | } |
71 | 71 | |
@@ -80,22 +80,22 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @return void |
82 | 82 | */ |
83 | - public function search_box( $text, $input_id ) { |
|
84 | - $input_id = $input_id . '-search-input'; |
|
83 | + public function search_box($text, $input_id) { |
|
84 | + $input_id = $input_id.'-search-input'; |
|
85 | 85 | |
86 | - if ( ! empty( $_REQUEST['orderby'] ) ) { |
|
87 | - echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />'; |
|
86 | + if ( ! empty($_REQUEST['orderby'])) { |
|
87 | + echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />'; |
|
88 | 88 | } |
89 | - if ( ! empty( $_REQUEST['order'] ) ) { |
|
90 | - echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />'; |
|
89 | + if ( ! empty($_REQUEST['order'])) { |
|
90 | + echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />'; |
|
91 | 91 | } |
92 | 92 | ?> |
93 | 93 | <p class="search-box" role="search"> |
94 | 94 | <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label> |
95 | 95 | <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>"/> |
96 | - <?php submit_button( $text, 'button', false, false, array( |
|
96 | + <?php submit_button($text, 'button', false, false, array( |
|
97 | 97 | 'ID' => 'search-submit', |
98 | - ) ); ?> |
|
98 | + )); ?> |
|
99 | 99 | </p> |
100 | 100 | <?php |
101 | 101 | } |
@@ -111,27 +111,27 @@ discard block |
||
111 | 111 | * |
112 | 112 | * @return string Column Name. |
113 | 113 | */ |
114 | - public function column_default( $donor, $column_name ) { |
|
115 | - switch ( $column_name ) { |
|
114 | + public function column_default($donor, $column_name) { |
|
115 | + switch ($column_name) { |
|
116 | 116 | |
117 | 117 | case 'num_donations' : |
118 | - $value = '<a href="' . admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&donor=' . urlencode( $donor['id'] ) ) . '&status=publish' . ' ">' . esc_html( $donor['num_donations'] ) . '</a>'; |
|
118 | + $value = '<a href="'.admin_url('edit.php?post_type=give_forms&page=give-payment-history&donor='.urlencode($donor['id'])).'&status=publish'.' ">'.esc_html($donor['num_donations']).'</a>'; |
|
119 | 119 | break; |
120 | 120 | |
121 | 121 | case 'amount_spent' : |
122 | - $value = give_currency_filter( give_format_amount( $donor[ $column_name ], array( 'sanitize' => false ) ) ); |
|
122 | + $value = give_currency_filter(give_format_amount($donor[$column_name], array('sanitize' => false))); |
|
123 | 123 | break; |
124 | 124 | |
125 | 125 | case 'date_created' : |
126 | - $value = date_i18n( give_date_format(), strtotime( $donor['date_created'] ) ); |
|
126 | + $value = date_i18n(give_date_format(), strtotime($donor['date_created'])); |
|
127 | 127 | break; |
128 | 128 | |
129 | 129 | default: |
130 | - $value = isset( $donor[ $column_name ] ) ? $donor[ $column_name ] : null; |
|
130 | + $value = isset($donor[$column_name]) ? $donor[$column_name] : null; |
|
131 | 131 | break; |
132 | 132 | } |
133 | 133 | |
134 | - return apply_filters( "give_report_column_{$column_name}", $value, $donor['id'] ); |
|
134 | + return apply_filters("give_report_column_{$column_name}", $value, $donor['id']); |
|
135 | 135 | |
136 | 136 | } |
137 | 137 | |
@@ -142,13 +142,13 @@ discard block |
||
142 | 142 | * |
143 | 143 | * @return string |
144 | 144 | */ |
145 | - public function column_name( $donor ) { |
|
146 | - $name = '#' . $donor['id'] . ' '; |
|
147 | - $name .= ! empty( $donor['name'] ) ? $donor['name'] : '<em>' . esc_html__( 'Unnamed Donor', 'give' ) . '</em>'; |
|
148 | - $view_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor['id'] ); |
|
149 | - $actions = $this->get_row_actions( $donor ); |
|
145 | + public function column_name($donor) { |
|
146 | + $name = '#'.$donor['id'].' '; |
|
147 | + $name .= ! empty($donor['name']) ? $donor['name'] : '<em>'.esc_html__('Unnamed Donor', 'give').'</em>'; |
|
148 | + $view_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor['id']); |
|
149 | + $actions = $this->get_row_actions($donor); |
|
150 | 150 | |
151 | - return '<a href="' . esc_url( $view_url ) . '">' . $name . '</a>' . $this->row_actions( $actions ); |
|
151 | + return '<a href="'.esc_url($view_url).'">'.$name.'</a>'.$this->row_actions($actions); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | /** |
@@ -160,14 +160,14 @@ discard block |
||
160 | 160 | */ |
161 | 161 | public function get_columns() { |
162 | 162 | $columns = array( |
163 | - 'name' => __( 'Name', 'give' ), |
|
164 | - 'email' => __( 'Email', 'give' ), |
|
165 | - 'num_donations' => __( 'Donations', 'give' ), |
|
166 | - 'amount_spent' => __( 'Total Donated', 'give' ), |
|
167 | - 'date_created' => __( 'Date Created', 'give' ), |
|
163 | + 'name' => __('Name', 'give'), |
|
164 | + 'email' => __('Email', 'give'), |
|
165 | + 'num_donations' => __('Donations', 'give'), |
|
166 | + 'amount_spent' => __('Total Donated', 'give'), |
|
167 | + 'date_created' => __('Date Created', 'give'), |
|
168 | 168 | ); |
169 | 169 | |
170 | - return apply_filters( 'give_list_donors_columns', $columns ); |
|
170 | + return apply_filters('give_list_donors_columns', $columns); |
|
171 | 171 | |
172 | 172 | } |
173 | 173 | |
@@ -181,13 +181,13 @@ discard block |
||
181 | 181 | public function get_sortable_columns() { |
182 | 182 | |
183 | 183 | $columns = array( |
184 | - 'date_created' => array( 'date_created', true ), |
|
185 | - 'name' => array( 'name', true ), |
|
186 | - 'num_donations' => array( 'purchase_count', false ), |
|
187 | - 'amount_spent' => array( 'purchase_value', false ), |
|
184 | + 'date_created' => array('date_created', true), |
|
185 | + 'name' => array('name', true), |
|
186 | + 'num_donations' => array('purchase_count', false), |
|
187 | + 'amount_spent' => array('purchase_value', false), |
|
188 | 188 | ); |
189 | 189 | |
190 | - return apply_filters( 'give_list_donors_sortable_columns', $columns ); |
|
190 | + return apply_filters('give_list_donors_sortable_columns', $columns); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | /** |
@@ -200,19 +200,19 @@ discard block |
||
200 | 200 | * |
201 | 201 | * @return array An array of action links. |
202 | 202 | */ |
203 | - public function get_row_actions( $donor ) { |
|
203 | + public function get_row_actions($donor) { |
|
204 | 204 | |
205 | 205 | $actions = array( |
206 | 206 | |
207 | - 'view' => sprintf( '<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor['id'] ), sprintf( esc_attr__( 'View "%s"', 'give' ), $donor['name'] ), __( 'View Donor', 'give' ) ), |
|
207 | + 'view' => sprintf('<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor['id']), sprintf(esc_attr__('View "%s"', 'give'), $donor['name']), __('View Donor', 'give')), |
|
208 | 208 | |
209 | - 'notes' => sprintf( '<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=notes&id=' . $donor['id'] ), sprintf( esc_attr__( 'Notes for "%s"', 'give' ), $donor['name'] ), __( 'Notes', 'give' ) ), |
|
209 | + 'notes' => sprintf('<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url('edit.php?post_type=give_forms&page=give-donors&view=notes&id='.$donor['id']), sprintf(esc_attr__('Notes for "%s"', 'give'), $donor['name']), __('Notes', 'give')), |
|
210 | 210 | |
211 | - 'delete' => sprintf( '<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $donor['id'] ), sprintf( esc_attr__( 'Delete "%s"', 'give' ), $donor['name'] ), __( 'Delete', 'give' ) ), |
|
211 | + 'delete' => sprintf('<a href="%1$s" aria-label="%2$s">%3$s</a>', admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$donor['id']), sprintf(esc_attr__('Delete "%s"', 'give'), $donor['name']), __('Delete', 'give')), |
|
212 | 212 | |
213 | 213 | ); |
214 | 214 | |
215 | - return apply_filters( 'give_donor_row_actions', $actions, $donor ); |
|
215 | + return apply_filters('give_donor_row_actions', $actions, $donor); |
|
216 | 216 | |
217 | 217 | } |
218 | 218 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | * @since 1.0 |
227 | 227 | * @return void |
228 | 228 | */ |
229 | - public function bulk_actions( $which = '' ) { |
|
229 | + public function bulk_actions($which = '') { |
|
230 | 230 | // These aren't really bulk actions but this outputs the markup in the right place. |
231 | 231 | } |
232 | 232 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | * @return int Current page number. |
239 | 239 | */ |
240 | 240 | public function get_paged() { |
241 | - return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1; |
|
241 | + return isset($_GET['paged']) ? absint($_GET['paged']) : 1; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | /** |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | * @return mixed string If search is present, false otherwise. |
250 | 250 | */ |
251 | 251 | public function get_search() { |
252 | - return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false; |
|
252 | + return ! empty($_GET['s']) ? urldecode(trim($_GET['s'])) : false; |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | /** |
@@ -266,13 +266,13 @@ discard block |
||
266 | 266 | |
267 | 267 | // Get donor query. |
268 | 268 | $args = $this->get_donor_query(); |
269 | - $donors = Give()->donors->get_donors( $args ); |
|
269 | + $donors = Give()->donors->get_donors($args); |
|
270 | 270 | |
271 | - if ( $donors ) { |
|
271 | + if ($donors) { |
|
272 | 272 | |
273 | - foreach ( $donors as $donor ) { |
|
273 | + foreach ($donors as $donor) { |
|
274 | 274 | |
275 | - $user_id = ! empty( $donor->user_id ) ? intval( $donor->user_id ) : 0; |
|
275 | + $user_id = ! empty($donor->user_id) ? intval($donor->user_id) : 0; |
|
276 | 276 | |
277 | 277 | $data[] = array( |
278 | 278 | 'id' => $donor->id, |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | } |
287 | 287 | } |
288 | 288 | |
289 | - return apply_filters( 'give_donors_column_query_data', $data ); |
|
289 | + return apply_filters('give_donors_column_query_data', $data); |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | /** |
@@ -301,9 +301,9 @@ discard block |
||
301 | 301 | |
302 | 302 | $_donor_query['number'] = - 1; |
303 | 303 | $_donor_query['offset'] = 0; |
304 | - $donors = Give()->donors->get_donors( $_donor_query ); |
|
304 | + $donors = Give()->donors->get_donors($_donor_query); |
|
305 | 305 | |
306 | - return count( $donors ); |
|
306 | + return count($donors); |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | /** |
@@ -315,10 +315,10 @@ discard block |
||
315 | 315 | */ |
316 | 316 | public function get_donor_query() { |
317 | 317 | $paged = $this->get_paged(); |
318 | - $offset = $this->per_page * ( $paged - 1 ); |
|
318 | + $offset = $this->per_page * ($paged - 1); |
|
319 | 319 | $search = $this->get_search(); |
320 | - $order = isset( $_GET['order'] ) ? sanitize_text_field( $_GET['order'] ) : 'DESC'; |
|
321 | - $orderby = isset( $_GET['orderby'] ) ? sanitize_text_field( $_GET['orderby'] ) : 'id'; |
|
320 | + $order = isset($_GET['order']) ? sanitize_text_field($_GET['order']) : 'DESC'; |
|
321 | + $orderby = isset($_GET['orderby']) ? sanitize_text_field($_GET['orderby']) : 'id'; |
|
322 | 322 | |
323 | 323 | $args = array( |
324 | 324 | 'number' => $this->per_page, |
@@ -327,10 +327,10 @@ discard block |
||
327 | 327 | 'orderby' => $orderby, |
328 | 328 | ); |
329 | 329 | |
330 | - if ( $search ) { |
|
331 | - if ( is_email( $search ) ) { |
|
330 | + if ($search) { |
|
331 | + if (is_email($search)) { |
|
332 | 332 | $args['email'] = $search; |
333 | - } elseif ( is_numeric( $search ) ) { |
|
333 | + } elseif (is_numeric($search)) { |
|
334 | 334 | $args['id'] = $search; |
335 | 335 | } else { |
336 | 336 | $args['name'] = $search; |
@@ -353,16 +353,16 @@ discard block |
||
353 | 353 | $hidden = array(); // No hidden columns. |
354 | 354 | $sortable = $this->get_sortable_columns(); |
355 | 355 | |
356 | - $this->_column_headers = array( $columns, $hidden, $sortable ); |
|
356 | + $this->_column_headers = array($columns, $hidden, $sortable); |
|
357 | 357 | |
358 | 358 | $this->items = $this->donor_data(); |
359 | 359 | |
360 | 360 | $this->total = $this->get_donor_count(); |
361 | 361 | |
362 | - $this->set_pagination_args( array( |
|
362 | + $this->set_pagination_args(array( |
|
363 | 363 | 'total_items' => $this->total, |
364 | 364 | 'per_page' => $this->per_page, |
365 | - 'total_pages' => ceil( $this->total / $this->per_page ), |
|
366 | - ) ); |
|
365 | + 'total_pages' => ceil($this->total / $this->per_page), |
|
366 | + )); |
|
367 | 367 | } |
368 | 368 | } |
@@ -10,7 +10,7 @@ discard block |
||
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,9 +24,9 @@ discard block |
||
24 | 24 | */ |
25 | 25 | function give_donors_page() { |
26 | 26 | $default_views = give_donor_views(); |
27 | - $requested_view = isset( $_GET['view'] ) ? sanitize_text_field( $_GET['view'] ) : 'donors'; |
|
28 | - if ( array_key_exists( $requested_view, $default_views ) && function_exists( $default_views[ $requested_view ] ) ) { |
|
29 | - give_render_donor_view( $requested_view, $default_views ); |
|
27 | + $requested_view = isset($_GET['view']) ? sanitize_text_field($_GET['view']) : 'donors'; |
|
28 | + if (array_key_exists($requested_view, $default_views) && function_exists($default_views[$requested_view])) { |
|
29 | + give_render_donor_view($requested_view, $default_views); |
|
30 | 30 | } else { |
31 | 31 | give_donors_list(); |
32 | 32 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | $views = array(); |
44 | 44 | |
45 | - return apply_filters( 'give_donor_views', $views ); |
|
45 | + return apply_filters('give_donor_views', $views); |
|
46 | 46 | |
47 | 47 | } |
48 | 48 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | $tabs = array(); |
58 | 58 | |
59 | - return apply_filters( 'give_donor_tabs', $tabs ); |
|
59 | + return apply_filters('give_donor_tabs', $tabs); |
|
60 | 60 | |
61 | 61 | } |
62 | 62 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * @return void |
68 | 68 | */ |
69 | 69 | function give_donors_list() { |
70 | - include dirname( __FILE__ ) . '/class-donor-table.php'; |
|
70 | + include dirname(__FILE__).'/class-donor-table.php'; |
|
71 | 71 | |
72 | 72 | $donors_table = new Give_Donor_List_Table(); |
73 | 73 | $donors_table->prepare_items(); |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @since 1.0 |
82 | 82 | */ |
83 | - do_action( 'give_donors_table_top' ); |
|
83 | + do_action('give_donors_table_top'); |
|
84 | 84 | ?> |
85 | - <form id="give-donors-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors' ); ?>"> |
|
85 | + <form id="give-donors-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors'); ?>"> |
|
86 | 86 | <?php |
87 | - $donors_table->search_box( esc_html__( 'Search Donors', 'give' ), 'give-donors' ); |
|
87 | + $donors_table->search_box(esc_html__('Search Donors', 'give'), 'give-donors'); |
|
88 | 88 | $donors_table->display(); |
89 | 89 | ?> |
90 | 90 | <input type="hidden" name="post_type" value="give_forms" /> |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @since 1.0 |
99 | 99 | */ |
100 | - do_action( 'give_donors_table_bottom' ); |
|
100 | + do_action('give_donors_table_bottom'); |
|
101 | 101 | ?> |
102 | 102 | </div> |
103 | 103 | <?php |
@@ -113,27 +113,27 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @return void |
115 | 115 | */ |
116 | -function give_render_donor_view( $view, $callbacks ) { |
|
116 | +function give_render_donor_view($view, $callbacks) { |
|
117 | 117 | |
118 | 118 | $render = true; |
119 | 119 | |
120 | - $donor_view_role = apply_filters( 'give_view_donors_role', 'view_give_reports' ); |
|
120 | + $donor_view_role = apply_filters('give_view_donors_role', 'view_give_reports'); |
|
121 | 121 | |
122 | - if ( ! current_user_can( $donor_view_role ) ) { |
|
123 | - give_set_error( 'give-no-access', __( 'You are not permitted to view this data.', 'give' ) ); |
|
122 | + if ( ! current_user_can($donor_view_role)) { |
|
123 | + give_set_error('give-no-access', __('You are not permitted to view this data.', 'give')); |
|
124 | 124 | $render = false; |
125 | 125 | } |
126 | 126 | |
127 | - if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { |
|
128 | - give_set_error( 'give-invalid_donor', __( 'Invalid Donor ID.', 'give' ) ); |
|
127 | + if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) { |
|
128 | + give_set_error('give-invalid_donor', __('Invalid Donor ID.', 'give')); |
|
129 | 129 | $render = false; |
130 | 130 | } |
131 | 131 | |
132 | 132 | $donor_id = (int) $_GET['id']; |
133 | - $donor = new Give_Donor( $donor_id ); |
|
133 | + $donor = new Give_Donor($donor_id); |
|
134 | 134 | |
135 | - if ( empty( $donor->id ) ) { |
|
136 | - give_set_error( 'give-invalid_donor', __( 'Invalid Donor ID.', 'give' ) ); |
|
135 | + if (empty($donor->id)) { |
|
136 | + give_set_error('give-invalid_donor', __('Invalid Donor ID.', 'give')); |
|
137 | 137 | $render = false; |
138 | 138 | } |
139 | 139 | |
@@ -142,34 +142,34 @@ discard block |
||
142 | 142 | |
143 | 143 | <div class='wrap'> |
144 | 144 | |
145 | - <?php if ( give_get_errors() ) : ?> |
|
145 | + <?php if (give_get_errors()) : ?> |
|
146 | 146 | <div class="error settings-error"> |
147 | - <?php Give()->notices->render_frontend_notices( 0 ); ?> |
|
147 | + <?php Give()->notices->render_frontend_notices(0); ?> |
|
148 | 148 | </div> |
149 | 149 | <?php endif; ?> |
150 | 150 | |
151 | - <h1 class="screen-reader-text"><?php esc_html_e( 'Donor', 'give' ); ?></h1> |
|
151 | + <h1 class="screen-reader-text"><?php esc_html_e('Donor', 'give'); ?></h1> |
|
152 | 152 | |
153 | - <?php if ( $donor && $render ) : ?> |
|
153 | + <?php if ($donor && $render) : ?> |
|
154 | 154 | |
155 | 155 | <h2 class="nav-tab-wrapper"> |
156 | 156 | <?php |
157 | - foreach ( $donor_tabs as $key => $tab ) : |
|
157 | + foreach ($donor_tabs as $key => $tab) : |
|
158 | 158 | $active = $key === $view ? true : false; |
159 | 159 | $class = $active ? 'nav-tab nav-tab-active' : 'nav-tab'; |
160 | 160 | printf( |
161 | - '<a href="%1$s" class="%2$s"><span class="dashicons %3$s"></span>%4$s</a>' . "\n", |
|
162 | - esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=' . $key . '&id=' . $donor->id ) ), |
|
163 | - esc_attr( $class ), |
|
164 | - sanitize_html_class( $tab['dashicon'] ), |
|
165 | - esc_html( $tab['title'] ) |
|
161 | + '<a href="%1$s" class="%2$s"><span class="dashicons %3$s"></span>%4$s</a>'."\n", |
|
162 | + esc_url(admin_url('edit.php?post_type=give_forms&page=give-donors&view='.$key.'&id='.$donor->id)), |
|
163 | + esc_attr($class), |
|
164 | + sanitize_html_class($tab['dashicon']), |
|
165 | + esc_html($tab['title']) |
|
166 | 166 | ); |
167 | 167 | endforeach; |
168 | 168 | ?> |
169 | 169 | </h2> |
170 | 170 | |
171 | 171 | <div id="give-donor-card-wrapper"> |
172 | - <?php $callbacks[ $view ]( $donor ) ?> |
|
172 | + <?php $callbacks[$view]($donor) ?> |
|
173 | 173 | </div> |
174 | 174 | |
175 | 175 | <?php endif; ?> |
@@ -189,9 +189,9 @@ discard block |
||
189 | 189 | * |
190 | 190 | * @return void |
191 | 191 | */ |
192 | -function give_donor_view( $donor ) { |
|
192 | +function give_donor_view($donor) { |
|
193 | 193 | |
194 | - $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
194 | + $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments'); |
|
195 | 195 | |
196 | 196 | /** |
197 | 197 | * Fires in donor profile screen, above the donor card. |
@@ -200,32 +200,32 @@ discard block |
||
200 | 200 | * |
201 | 201 | * @param object $donor The donor object being displayed. |
202 | 202 | */ |
203 | - do_action( 'give_donor_card_top', $donor ); |
|
203 | + do_action('give_donor_card_top', $donor); |
|
204 | 204 | ?> |
205 | 205 | |
206 | 206 | <div id="donor-summary" class="info-wrapper donor-section postbox"> |
207 | 207 | |
208 | - <form id="edit-donor-info" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); ?>"> |
|
208 | + <form id="edit-donor-info" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); ?>"> |
|
209 | 209 | |
210 | 210 | <div class="donor-info"> |
211 | 211 | |
212 | 212 | <div class="donor-bio-header clearfix"> |
213 | 213 | |
214 | 214 | <div class="avatar-wrap left" id="donor-avatar"> |
215 | - <?php echo get_avatar( $donor->email ); ?> |
|
215 | + <?php echo get_avatar($donor->email); ?> |
|
216 | 216 | </div> |
217 | 217 | |
218 | 218 | <div id="donor-name-wrap" class="left"> |
219 | 219 | <span class="donor-id">#<?php echo $donor->id; ?></span> |
220 | - <span class="donor-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php echo esc_attr( $donor->name ); ?>" placeholder="<?php esc_attr_e( 'Donor Name', 'give' ); ?>" /></span> |
|
220 | + <span class="donor-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php echo esc_attr($donor->name); ?>" placeholder="<?php esc_attr_e('Donor Name', 'give'); ?>" /></span> |
|
221 | 221 | <span class="donor-name info-item editable"><span data-key="name"><?php echo $donor->name; ?></span></span> |
222 | 222 | </div> |
223 | 223 | <p class="donor-since info-item"> |
224 | - <?php esc_html_e( 'Donor since', 'give' ); ?> |
|
225 | - <?php echo date_i18n( give_date_format(), strtotime( $donor->date_created ) ) ?> |
|
224 | + <?php esc_html_e('Donor since', 'give'); ?> |
|
225 | + <?php echo date_i18n(give_date_format(), strtotime($donor->date_created)) ?> |
|
226 | 226 | </p> |
227 | - <?php if ( current_user_can( $donor_edit_role ) ) : ?> |
|
228 | - <a href="#" id="edit-donor" class="button info-item editable donor-edit-link"><?php esc_html_e( 'Edit Donor', 'give' ); ?></a> |
|
227 | + <?php if (current_user_can($donor_edit_role)) : ?> |
|
228 | + <a href="#" id="edit-donor" class="button info-item editable donor-edit-link"><?php esc_html_e('Edit Donor', 'give'); ?></a> |
|
229 | 229 | <?php endif; ?> |
230 | 230 | </div> |
231 | 231 | <!-- /donor-bio-header --> |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | <table class="widefat"> |
236 | 236 | <tbody> |
237 | 237 | <tr class="alternate"> |
238 | - <th scope="col"><label for="tablecell"><?php esc_html_e( 'User:', 'give' ); ?></label></th> |
|
238 | + <th scope="col"><label for="tablecell"><?php esc_html_e('User:', 'give'); ?></label></th> |
|
239 | 239 | <td> |
240 | 240 | <span class="donor-user-id info-item edit-item"> |
241 | 241 | <?php |
@@ -252,37 +252,37 @@ discard block |
||
252 | 252 | 'data' => $data_atts, |
253 | 253 | ); |
254 | 254 | |
255 | - if ( ! empty( $user_id ) ) { |
|
256 | - $userdata = get_userdata( $user_id ); |
|
255 | + if ( ! empty($user_id)) { |
|
256 | + $userdata = get_userdata($user_id); |
|
257 | 257 | $user_args['selected'] = $user_id; |
258 | 258 | } |
259 | 259 | |
260 | - echo Give()->html->ajax_user_search( $user_args ); |
|
260 | + echo Give()->html->ajax_user_search($user_args); |
|
261 | 261 | ?> |
262 | 262 | </span> |
263 | 263 | |
264 | 264 | <span class="donor-user-id info-item editable"> |
265 | - <?php if ( ! empty( $userdata ) ) { ?> |
|
266 | - <span data-key="user_id">#<?php echo $donor->user_id . ' - ' . $userdata->display_name; ?></span> |
|
265 | + <?php if ( ! empty($userdata)) { ?> |
|
266 | + <span data-key="user_id">#<?php echo $donor->user_id.' - '.$userdata->display_name; ?></span> |
|
267 | 267 | <?php } else { ?> |
268 | - <span data-key="user_id"><?php esc_html_e( 'None', 'give' ); ?></span> |
|
268 | + <span data-key="user_id"><?php esc_html_e('None', 'give'); ?></span> |
|
269 | 269 | <?php } ?> |
270 | - <?php if ( current_user_can( $donor_edit_role ) && intval( $donor->user_id ) > 0 ) { ?> |
|
271 | - <span class="disconnect-user"> - <a id="disconnect-donor" href="#disconnect" aria-label="<?php esc_attr_e( 'Disconnects the current user ID from this donor record.', 'give' ); ?>"><?php esc_html_e( 'Disconnect User', 'give' ); ?></a></span> |
|
270 | + <?php if (current_user_can($donor_edit_role) && intval($donor->user_id) > 0) { ?> |
|
271 | + <span class="disconnect-user"> - <a id="disconnect-donor" href="#disconnect" aria-label="<?php esc_attr_e('Disconnects the current user ID from this donor record.', 'give'); ?>"><?php esc_html_e('Disconnect User', 'give'); ?></a></span> |
|
272 | 272 | <?php } ?> |
273 | 273 | </span> |
274 | 274 | </td> |
275 | 275 | </tr> |
276 | - <?php if ( isset( $donor->user_id ) && $donor->user_id > 0 ) : ?> |
|
276 | + <?php if (isset($donor->user_id) && $donor->user_id > 0) : ?> |
|
277 | 277 | |
278 | 278 | <tr> |
279 | - <th scope="col"><?php esc_html_e( 'Address:', 'give' ); ?></th> |
|
279 | + <th scope="col"><?php esc_html_e('Address:', 'give'); ?></th> |
|
280 | 280 | <td class="row-title"> |
281 | 281 | |
282 | 282 | <div class="donor-address-wrapper"> |
283 | 283 | |
284 | 284 | <?php |
285 | - $address = get_user_meta( $donor->user_id, '_give_user_address', true ); |
|
285 | + $address = get_user_meta($donor->user_id, '_give_user_address', true); |
|
286 | 286 | $defaults = array( |
287 | 287 | 'line1' => '', |
288 | 288 | 'line2' => '', |
@@ -292,10 +292,10 @@ discard block |
||
292 | 292 | 'zip' => '', |
293 | 293 | ); |
294 | 294 | |
295 | - $address = wp_parse_args( $address, $defaults ); |
|
295 | + $address = wp_parse_args($address, $defaults); |
|
296 | 296 | ?> |
297 | 297 | |
298 | - <?php if ( ! empty( $address ) ) { ?> |
|
298 | + <?php if ( ! empty($address)) { ?> |
|
299 | 299 | <span class="donor-address info-item editable"> |
300 | 300 | <span class="info-item" data-key="line1"><?php echo $address['line1']; ?></span> |
301 | 301 | <span class="info-item" data-key="line2"><?php echo $address['line2']; ?></span> |
@@ -306,43 +306,43 @@ discard block |
||
306 | 306 | </span> |
307 | 307 | <?php } ?> |
308 | 308 | <span class="donor-address info-item edit-item"> |
309 | - <input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php esc_attr_e( 'Address 1', 'give' ); ?>" value="<?php echo $address['line1']; ?>" /> |
|
310 | - <input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php esc_attr_e( 'Address 2', 'give' ); ?>" value="<?php echo $address['line2']; ?>" /> |
|
311 | - <input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e( 'City', 'give' ); ?>" value="<?php echo $address['city']; ?>" /> |
|
309 | + <input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php esc_attr_e('Address 1', 'give'); ?>" value="<?php echo $address['line1']; ?>" /> |
|
310 | + <input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php esc_attr_e('Address 2', 'give'); ?>" value="<?php echo $address['line2']; ?>" /> |
|
311 | + <input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e('City', 'give'); ?>" value="<?php echo $address['city']; ?>" /> |
|
312 | 312 | <select data-key="country" name="customerinfo[country]" id="billing_country" class="billing_country give-select edit-item"> |
313 | 313 | <?php |
314 | 314 | |
315 | 315 | $selected_country = $address['country']; |
316 | 316 | |
317 | 317 | $countries = give_get_country_list(); |
318 | - foreach ( $countries as $country_code => $country ) { |
|
319 | - echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>'; |
|
318 | + foreach ($countries as $country_code => $country) { |
|
319 | + echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>'; |
|
320 | 320 | } |
321 | 321 | ?> |
322 | 322 | </select> |
323 | 323 | <?php |
324 | 324 | $selected_state = give_get_state(); |
325 | - $states = give_get_states( $selected_country ); |
|
325 | + $states = give_get_states($selected_country); |
|
326 | 326 | |
327 | - $selected_state = isset( $address['state'] ) ? $address['state'] : $selected_state; |
|
327 | + $selected_state = isset($address['state']) ? $address['state'] : $selected_state; |
|
328 | 328 | |
329 | - if ( ! empty( $states ) ) { |
|
329 | + if ( ! empty($states)) { |
|
330 | 330 | ?> |
331 | 331 | <select data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-select info-item"> |
332 | 332 | <?php |
333 | - foreach ( $states as $state_code => $state ) { |
|
334 | - echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>'; |
|
333 | + foreach ($states as $state_code => $state) { |
|
334 | + echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>'; |
|
335 | 335 | } |
336 | 336 | ?> |
337 | 337 | </select> |
338 | 338 | <?php |
339 | 339 | } else { |
340 | 340 | ?> |
341 | - <input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e( 'State / Province / County', 'give' ); ?>" /> |
|
341 | + <input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e('State / Province / County', 'give'); ?>" /> |
|
342 | 342 | <?php |
343 | 343 | } |
344 | 344 | ?> |
345 | - <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e( 'Zip / Postal Code', 'give' ); ?>" value="<?php echo $address['zip']; ?>" /> |
|
345 | + <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e('Zip / Postal Code', 'give'); ?>" value="<?php echo $address['zip']; ?>" /> |
|
346 | 346 | </span> |
347 | 347 | |
348 | 348 | </div> |
@@ -358,10 +358,10 @@ discard block |
||
358 | 358 | |
359 | 359 | <span id="donor-edit-actions" class="edit-item"> |
360 | 360 | <input type="hidden" data-key="id" name="customerinfo[id]" value="<?php echo $donor->id; ?>" /> |
361 | - <?php wp_nonce_field( 'edit-donor', '_wpnonce', false, true ); ?> |
|
361 | + <?php wp_nonce_field('edit-donor', '_wpnonce', false, true); ?> |
|
362 | 362 | <input type="hidden" name="give_action" value="edit-donor" /> |
363 | - <input type="submit" id="give-edit-donor-save" class="button-secondary" value="<?php esc_attr_e( 'Update Donor', 'give' ); ?>" /> |
|
364 | - <a id="give-edit-donor-cancel" href="" class="delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
|
363 | + <input type="submit" id="give-edit-donor-save" class="button-secondary" value="<?php esc_attr_e('Update Donor', 'give'); ?>" /> |
|
364 | + <a id="give-edit-donor-cancel" href="" class="delete"><?php esc_html_e('Cancel', 'give'); ?></a> |
|
365 | 365 | </span> |
366 | 366 | |
367 | 367 | </form> |
@@ -376,24 +376,24 @@ discard block |
||
376 | 376 | * |
377 | 377 | * @param object $donor The donor object being displayed. |
378 | 378 | */ |
379 | - do_action( 'give_donor_before_stats', $donor ); |
|
379 | + do_action('give_donor_before_stats', $donor); |
|
380 | 380 | ?> |
381 | 381 | |
382 | 382 | <div id="donor-stats-wrapper" class="donor-section postbox clear"> |
383 | 383 | <ul> |
384 | 384 | <li> |
385 | - <a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $donor->email ) ); ?>"> |
|
385 | + <a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode($donor->email)); ?>"> |
|
386 | 386 | <span class="dashicons dashicons-heart"></span> |
387 | 387 | <?php |
388 | 388 | // Completed Donations |
389 | - $completed_donations_text = sprintf( _n( '%d Completed Donation', '%d Completed Donations', $donor->purchase_count, 'give' ), $donor->purchase_count ); |
|
390 | - echo apply_filters( 'give_donor_completed_donations', $completed_donations_text, $donor ); |
|
389 | + $completed_donations_text = sprintf(_n('%d Completed Donation', '%d Completed Donations', $donor->purchase_count, 'give'), $donor->purchase_count); |
|
390 | + echo apply_filters('give_donor_completed_donations', $completed_donations_text, $donor); |
|
391 | 391 | ?> |
392 | 392 | </a> |
393 | 393 | </li> |
394 | 394 | <li> |
395 | 395 | <span class="dashicons dashicons-chart-area"></span> |
396 | - <?php echo give_currency_filter( give_format_amount( $donor->purchase_value, array( 'sanitize' => false ) ) ); ?> <?php esc_html_e( 'Lifetime Donations', 'give' ); ?> |
|
396 | + <?php echo give_currency_filter(give_format_amount($donor->purchase_value, array('sanitize' => false))); ?> <?php esc_html_e('Lifetime Donations', 'give'); ?> |
|
397 | 397 | </li> |
398 | 398 | <?php |
399 | 399 | /** |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | * |
406 | 406 | * @param object $donor The donor object being displayed. |
407 | 407 | */ |
408 | - do_action( 'give_donor_stats_list', $donor ); |
|
408 | + do_action('give_donor_stats_list', $donor); |
|
409 | 409 | ?> |
410 | 410 | </ul> |
411 | 411 | </div> |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | * |
419 | 419 | * @param object $donor The donor object being displayed. |
420 | 420 | */ |
421 | - do_action( 'give_donor_before_tables_wrapper', $donor ); |
|
421 | + do_action('give_donor_before_tables_wrapper', $donor); |
|
422 | 422 | ?> |
423 | 423 | |
424 | 424 | <div id="donor-tables-wrapper" class="donor-section"> |
@@ -431,46 +431,46 @@ discard block |
||
431 | 431 | * |
432 | 432 | * @param object $donor The donor object being displayed. |
433 | 433 | */ |
434 | - do_action( 'give_donor_before_tables', $donor ); |
|
434 | + do_action('give_donor_before_tables', $donor); |
|
435 | 435 | ?> |
436 | 436 | |
437 | - <h3><?php _e( 'Donor Emails', 'give' ); ?></h3> |
|
437 | + <h3><?php _e('Donor Emails', 'give'); ?></h3> |
|
438 | 438 | |
439 | 439 | <table class="wp-list-table widefat striped emails"> |
440 | 440 | <thead> |
441 | 441 | <tr> |
442 | - <th><?php _e( 'Email', 'give' ); ?></th> |
|
443 | - <th><?php _e( 'Actions', 'give' ); ?></th> |
|
442 | + <th><?php _e('Email', 'give'); ?></th> |
|
443 | + <th><?php _e('Actions', 'give'); ?></th> |
|
444 | 444 | </tr> |
445 | 445 | </thead> |
446 | 446 | |
447 | 447 | <tbody> |
448 | - <?php if ( ! empty( $donor->emails ) ) { ?> |
|
448 | + <?php if ( ! empty($donor->emails)) { ?> |
|
449 | 449 | |
450 | - <?php foreach ( $donor->emails as $key => $email ) : ?> |
|
450 | + <?php foreach ($donor->emails as $key => $email) : ?> |
|
451 | 451 | <tr data-key="<?php echo $key; ?>"> |
452 | 452 | <td> |
453 | 453 | <?php echo $email; ?> |
454 | - <?php if ( 'primary' === $key ) : ?> |
|
454 | + <?php if ('primary' === $key) : ?> |
|
455 | 455 | <span class="dashicons dashicons-star-filled primary-email-icon"></span> |
456 | 456 | <?php endif; ?> |
457 | 457 | </td> |
458 | 458 | <td> |
459 | - <?php if ( 'primary' !== $key ) : ?> |
|
459 | + <?php if ('primary' !== $key) : ?> |
|
460 | 460 | <?php |
461 | - $base_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); |
|
462 | - $promote_url = wp_nonce_url( add_query_arg( array( |
|
463 | - 'email' => rawurlencode( $email ), |
|
461 | + $base_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); |
|
462 | + $promote_url = wp_nonce_url(add_query_arg(array( |
|
463 | + 'email' => rawurlencode($email), |
|
464 | 464 | 'give_action' => 'set_donor_primary_email', |
465 | - ), $base_url ), 'give-set-donor-primary-email' ); |
|
466 | - $remove_url = wp_nonce_url( add_query_arg( array( |
|
467 | - 'email' => rawurlencode( $email ), |
|
465 | + ), $base_url), 'give-set-donor-primary-email'); |
|
466 | + $remove_url = wp_nonce_url(add_query_arg(array( |
|
467 | + 'email' => rawurlencode($email), |
|
468 | 468 | 'give_action' => 'remove_donor_email', |
469 | - ), $base_url ), 'give-remove-donor-email' ); |
|
469 | + ), $base_url), 'give-remove-donor-email'); |
|
470 | 470 | ?> |
471 | - <a href="<?php echo $promote_url; ?>"><?php _e( 'Make Primary', 'give' ); ?></a> |
|
471 | + <a href="<?php echo $promote_url; ?>"><?php _e('Make Primary', 'give'); ?></a> |
|
472 | 472 | | |
473 | - <a href="<?php echo $remove_url; ?>" class="delete"><?php _e( 'Remove', 'give' ); ?></a> |
|
473 | + <a href="<?php echo $remove_url; ?>" class="delete"><?php _e('Remove', 'give'); ?></a> |
|
474 | 474 | <?php endif; ?> |
475 | 475 | </td> |
476 | 476 | </tr> |
@@ -480,59 +480,59 @@ discard block |
||
480 | 480 | <td colspan="2" class="add-donor-email-td"> |
481 | 481 | <div class="add-donor-email-wrapper"> |
482 | 482 | <input type="hidden" name="donor-id" value="<?php echo $donor->id; ?>" /> |
483 | - <?php wp_nonce_field( 'give_add_donor_email', 'add_email_nonce', false, true ); ?> |
|
484 | - <input type="email" name="additional-email" value="" placeholder="<?php _e( 'Email Address', 'give' ); ?>" /> |
|
485 | - <input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" /> <label for="make-additional-primary"><?php _e( 'Make Primary', 'give' ); ?></label> |
|
486 | - <button class="button-secondary give-add-donor-email" id="add-donor-email"><?php _e( 'Add Email', 'give' ); ?></button> |
|
483 | + <?php wp_nonce_field('give_add_donor_email', 'add_email_nonce', false, true); ?> |
|
484 | + <input type="email" name="additional-email" value="" placeholder="<?php _e('Email Address', 'give'); ?>" /> |
|
485 | + <input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" /> <label for="make-additional-primary"><?php _e('Make Primary', 'give'); ?></label> |
|
486 | + <button class="button-secondary give-add-donor-email" id="add-donor-email"><?php _e('Add Email', 'give'); ?></button> |
|
487 | 487 | <span class="spinner"></span> |
488 | 488 | </div> |
489 | 489 | <div class="notice-wrap"></div> |
490 | 490 | </td> |
491 | 491 | </tr> |
492 | 492 | <?php } else { ?> |
493 | - <tr><td colspan="2"><?php _e( 'No Emails Found', 'give' ); ?></td></tr> |
|
493 | + <tr><td colspan="2"><?php _e('No Emails Found', 'give'); ?></td></tr> |
|
494 | 494 | <?php }// End if(). |
495 | 495 | ?> |
496 | 496 | </tbody> |
497 | 497 | </table> |
498 | 498 | |
499 | - <h3><?php esc_html_e( 'Recent Donations', 'give' ); ?></h3> |
|
499 | + <h3><?php esc_html_e('Recent Donations', 'give'); ?></h3> |
|
500 | 500 | <?php |
501 | - $payment_ids = explode( ',', $donor->payment_ids ); |
|
502 | - $payments = give_get_payments( array( |
|
501 | + $payment_ids = explode(',', $donor->payment_ids); |
|
502 | + $payments = give_get_payments(array( |
|
503 | 503 | 'post__in' => $payment_ids, |
504 | - ) ); |
|
505 | - $payments = array_slice( $payments, 0, 10 ); |
|
504 | + )); |
|
505 | + $payments = array_slice($payments, 0, 10); |
|
506 | 506 | ?> |
507 | 507 | <table class="wp-list-table widefat striped payments"> |
508 | 508 | <thead> |
509 | 509 | <tr> |
510 | - <th scope="col"><?php esc_html_e( 'ID', 'give' ); ?></th> |
|
511 | - <th scope="col"><?php esc_html_e( 'Amount', 'give' ); ?></th> |
|
512 | - <th scope="col"><?php esc_html_e( 'Date', 'give' ); ?></th> |
|
513 | - <th scope="col"><?php esc_html_e( 'Status', 'give' ); ?></th> |
|
514 | - <th scope="col"><?php esc_html_e( 'Actions', 'give' ); ?></th> |
|
510 | + <th scope="col"><?php esc_html_e('ID', 'give'); ?></th> |
|
511 | + <th scope="col"><?php esc_html_e('Amount', 'give'); ?></th> |
|
512 | + <th scope="col"><?php esc_html_e('Date', 'give'); ?></th> |
|
513 | + <th scope="col"><?php esc_html_e('Status', 'give'); ?></th> |
|
514 | + <th scope="col"><?php esc_html_e('Actions', 'give'); ?></th> |
|
515 | 515 | </tr> |
516 | 516 | </thead> |
517 | 517 | <tbody> |
518 | - <?php if ( ! empty( $payments ) ) { ?> |
|
519 | - <?php foreach ( $payments as $payment ) : ?> |
|
518 | + <?php if ( ! empty($payments)) { ?> |
|
519 | + <?php foreach ($payments as $payment) : ?> |
|
520 | 520 | <tr> |
521 | 521 | <td><?php echo $payment->ID; ?></td> |
522 | - <td><?php echo give_payment_amount( $payment->ID ); ?></td> |
|
523 | - <td><?php echo date_i18n( give_date_format(), strtotime( $payment->post_date ) ); ?></td> |
|
524 | - <td><?php echo give_get_payment_status( $payment, true ); ?></td> |
|
522 | + <td><?php echo give_payment_amount($payment->ID); ?></td> |
|
523 | + <td><?php echo date_i18n(give_date_format(), strtotime($payment->post_date)); ?></td> |
|
524 | + <td><?php echo give_get_payment_status($payment, true); ?></td> |
|
525 | 525 | <td> |
526 | 526 | <?php |
527 | 527 | printf( |
528 | 528 | '<a href="%1$s" aria-label="%2$s">%3$s</a>', |
529 | - admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $payment->ID ), |
|
529 | + admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id='.$payment->ID), |
|
530 | 530 | sprintf( |
531 | 531 | /* translators: %s: Donation ID */ |
532 | - esc_attr__( 'View Donation %s.', 'give' ), |
|
532 | + esc_attr__('View Donation %s.', 'give'), |
|
533 | 533 | $payment->ID |
534 | 534 | ), |
535 | - esc_html__( 'View Donation', 'give' ) |
|
535 | + esc_html__('View Donation', 'give') |
|
536 | 536 | ); |
537 | 537 | ?> |
538 | 538 | |
@@ -547,47 +547,47 @@ discard block |
||
547 | 547 | * @param object $donor The donor object being displayed. |
548 | 548 | * @param object $payment The payment object being displayed. |
549 | 549 | */ |
550 | - do_action( 'give_donor_recent_purchases_actions', $donor, $payment ); |
|
550 | + do_action('give_donor_recent_purchases_actions', $donor, $payment); |
|
551 | 551 | ?> |
552 | 552 | </td> |
553 | 553 | </tr> |
554 | 554 | <?php endforeach; ?> |
555 | 555 | <?php } else { ?> |
556 | 556 | <tr> |
557 | - <td colspan="5"><?php esc_html_e( 'No donations found.', 'give' ); ?></td> |
|
557 | + <td colspan="5"><?php esc_html_e('No donations found.', 'give'); ?></td> |
|
558 | 558 | </tr> |
559 | 559 | <?php }// End if(). |
560 | 560 | ?> |
561 | 561 | </tbody> |
562 | 562 | </table> |
563 | 563 | |
564 | - <h3><?php esc_html_e( 'Completed Forms', 'give' ); ?></h3> |
|
564 | + <h3><?php esc_html_e('Completed Forms', 'give'); ?></h3> |
|
565 | 565 | <?php |
566 | - $donations = give_get_users_completed_donations( $donor->email ); |
|
566 | + $donations = give_get_users_completed_donations($donor->email); |
|
567 | 567 | ?> |
568 | 568 | <table class="wp-list-table widefat striped donations"> |
569 | 569 | <thead> |
570 | 570 | <tr> |
571 | - <th scope="col"><?php esc_html_e( 'Form', 'give' ); ?></th> |
|
572 | - <th scope="col" width="120px"><?php esc_html_e( 'Actions', 'give' ); ?></th> |
|
571 | + <th scope="col"><?php esc_html_e('Form', 'give'); ?></th> |
|
572 | + <th scope="col" width="120px"><?php esc_html_e('Actions', 'give'); ?></th> |
|
573 | 573 | </tr> |
574 | 574 | </thead> |
575 | 575 | <tbody> |
576 | - <?php if ( ! empty( $donations ) ) { ?> |
|
577 | - <?php foreach ( $donations as $donation ) : ?> |
|
576 | + <?php if ( ! empty($donations)) { ?> |
|
577 | + <?php foreach ($donations as $donation) : ?> |
|
578 | 578 | <tr> |
579 | 579 | <td><?php echo $donation->post_title; ?></td> |
580 | 580 | <td> |
581 | 581 | <?php |
582 | 582 | printf( |
583 | 583 | '<a href="%1$s" aria-label="%2$s">%3$s</a>', |
584 | - esc_url( admin_url( 'post.php?action=edit&post=' . $donation->ID ) ), |
|
584 | + esc_url(admin_url('post.php?action=edit&post='.$donation->ID)), |
|
585 | 585 | sprintf( |
586 | 586 | /* translators: %s: form name */ |
587 | - esc_attr__( 'View Form %s.', 'give' ), |
|
587 | + esc_attr__('View Form %s.', 'give'), |
|
588 | 588 | $donation->post_title |
589 | 589 | ), |
590 | - esc_html__( 'View Form', 'give' ) |
|
590 | + esc_html__('View Form', 'give') |
|
591 | 591 | ); |
592 | 592 | ?> |
593 | 593 | </td> |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | <?php endforeach; ?> |
596 | 596 | <?php } else { ?> |
597 | 597 | <tr> |
598 | - <td colspan="2"><?php esc_html_e( 'No completed donations found.', 'give' ); ?></td> |
|
598 | + <td colspan="2"><?php esc_html_e('No completed donations found.', 'give'); ?></td> |
|
599 | 599 | </tr> |
600 | 600 | <?php } ?> |
601 | 601 | </tbody> |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | * |
610 | 610 | * @param object $donor The donor object being displayed. |
611 | 611 | */ |
612 | - do_action( 'give_donor_after_tables', $donor ); |
|
612 | + do_action('give_donor_after_tables', $donor); |
|
613 | 613 | ?> |
614 | 614 | |
615 | 615 | </div> |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | * |
623 | 623 | * @param object $donor The donor object being displayed. |
624 | 624 | */ |
625 | - do_action( 'give_donor_card_bottom', $donor ); |
|
625 | + do_action('give_donor_card_bottom', $donor); |
|
626 | 626 | |
627 | 627 | } |
628 | 628 | |
@@ -635,30 +635,30 @@ discard block |
||
635 | 635 | * |
636 | 636 | * @return void |
637 | 637 | */ |
638 | -function give_donor_notes_view( $donor ) { |
|
638 | +function give_donor_notes_view($donor) { |
|
639 | 639 | |
640 | - $paged = isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) ? $_GET['paged'] : 1; |
|
641 | - $paged = absint( $paged ); |
|
640 | + $paged = isset($_GET['paged']) && is_numeric($_GET['paged']) ? $_GET['paged'] : 1; |
|
641 | + $paged = absint($paged); |
|
642 | 642 | $note_count = $donor->get_notes_count(); |
643 | - $per_page = apply_filters( 'give_donor_notes_per_page', 20 ); |
|
644 | - $total_pages = ceil( $note_count / $per_page ); |
|
645 | - $donor_notes = $donor->get_notes( $per_page, $paged ); |
|
643 | + $per_page = apply_filters('give_donor_notes_per_page', 20); |
|
644 | + $total_pages = ceil($note_count / $per_page); |
|
645 | + $donor_notes = $donor->get_notes($per_page, $paged); |
|
646 | 646 | ?> |
647 | 647 | |
648 | 648 | <div id="donor-notes-wrapper"> |
649 | 649 | <div class="donor-notes-header"> |
650 | - <?php echo get_avatar( $donor->email, 30 ); ?> <span><?php echo $donor->name; ?></span> |
|
650 | + <?php echo get_avatar($donor->email, 30); ?> <span><?php echo $donor->name; ?></span> |
|
651 | 651 | </div> |
652 | - <h3><?php esc_html_e( 'Notes', 'give' ); ?></h3> |
|
652 | + <h3><?php esc_html_e('Notes', 'give'); ?></h3> |
|
653 | 653 | |
654 | - <?php if ( 1 == $paged ) : ?> |
|
654 | + <?php if (1 == $paged) : ?> |
|
655 | 655 | <div style="display: block; margin-bottom: 55px;"> |
656 | - <form id="give-add-donor-note" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=notes&id=' . $donor->id ); ?>"> |
|
656 | + <form id="give-add-donor-note" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=notes&id='.$donor->id); ?>"> |
|
657 | 657 | <textarea id="donor-note" name="donor_note" class="donor-note-input" rows="10"></textarea> |
658 | 658 | <br /> |
659 | 659 | <input type="hidden" id="donor-id" name="customer_id" value="<?php echo $donor->id; ?>" /> |
660 | 660 | <input type="hidden" name="give_action" value="add-donor-note" /> |
661 | - <?php wp_nonce_field( 'add-donor-note', 'add_donor_note_nonce', true, true ); ?> |
|
661 | + <?php wp_nonce_field('add-donor-note', 'add_donor_note_nonce', true, true); ?> |
|
662 | 662 | <input id="add-donor-note" class="right button-primary" type="submit" value="Add Note" /> |
663 | 663 | </form> |
664 | 664 | </div> |
@@ -673,26 +673,26 @@ discard block |
||
673 | 673 | 'show_all' => true, |
674 | 674 | ); |
675 | 675 | |
676 | - echo paginate_links( $pagination_args ); |
|
676 | + echo paginate_links($pagination_args); |
|
677 | 677 | ?> |
678 | 678 | |
679 | 679 | <div id="give-donor-notes" class="postbox"> |
680 | - <?php if ( count( $donor_notes ) > 0 ) { ?> |
|
681 | - <?php foreach ( $donor_notes as $key => $note ) : ?> |
|
680 | + <?php if (count($donor_notes) > 0) { ?> |
|
681 | + <?php foreach ($donor_notes as $key => $note) : ?> |
|
682 | 682 | <div class="donor-note-wrapper dashboard-comment-wrap comment-item"> |
683 | 683 | <span class="note-content-wrap"> |
684 | - <?php echo stripslashes( $note ); ?> |
|
684 | + <?php echo stripslashes($note); ?> |
|
685 | 685 | </span> |
686 | 686 | </div> |
687 | 687 | <?php endforeach; ?> |
688 | 688 | <?php } else { ?> |
689 | 689 | <div class="give-no-donor-notes"> |
690 | - <?php esc_html_e( 'No donor notes found.', 'give' ); ?> |
|
690 | + <?php esc_html_e('No donor notes found.', 'give'); ?> |
|
691 | 691 | </div> |
692 | 692 | <?php } ?> |
693 | 693 | </div> |
694 | 694 | |
695 | - <?php echo paginate_links( $pagination_args ); ?> |
|
695 | + <?php echo paginate_links($pagination_args); ?> |
|
696 | 696 | |
697 | 697 | </div> |
698 | 698 | |
@@ -708,9 +708,9 @@ discard block |
||
708 | 708 | * |
709 | 709 | * @return void |
710 | 710 | */ |
711 | -function give_donor_delete_view( $donor ) { |
|
711 | +function give_donor_delete_view($donor) { |
|
712 | 712 | |
713 | - $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
713 | + $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments'); |
|
714 | 714 | |
715 | 715 | /** |
716 | 716 | * Fires in donor delete screen, above the content. |
@@ -719,15 +719,15 @@ discard block |
||
719 | 719 | * |
720 | 720 | * @param object $donor The donor object being displayed. |
721 | 721 | */ |
722 | - do_action( 'give_donor_delete_top', $donor ); |
|
722 | + do_action('give_donor_delete_top', $donor); |
|
723 | 723 | ?> |
724 | 724 | |
725 | 725 | <div class="info-wrapper donor-section"> |
726 | 726 | |
727 | - <form id="delete-donor" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $donor->id ); ?>"> |
|
727 | + <form id="delete-donor" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$donor->id); ?>"> |
|
728 | 728 | |
729 | 729 | <div class="donor-notes-header"> |
730 | - <?php echo get_avatar( $donor->email, 30 ); ?> <span><?php echo $donor->name; ?></span> |
|
730 | + <?php echo get_avatar($donor->email, 30); ?> <span><?php echo $donor->name; ?></span> |
|
731 | 731 | </div> |
732 | 732 | |
733 | 733 | |
@@ -735,20 +735,20 @@ discard block |
||
735 | 735 | |
736 | 736 | <span class="delete-donor-options"> |
737 | 737 | <p> |
738 | - <?php echo Give()->html->checkbox( array( |
|
738 | + <?php echo Give()->html->checkbox(array( |
|
739 | 739 | 'name' => 'give-donor-delete-confirm', |
740 | - ) ); ?> |
|
741 | - <label for="give-donor-delete-confirm"><?php esc_html_e( 'Are you sure you want to delete this donor?', 'give' ); ?></label> |
|
740 | + )); ?> |
|
741 | + <label for="give-donor-delete-confirm"><?php esc_html_e('Are you sure you want to delete this donor?', 'give'); ?></label> |
|
742 | 742 | </p> |
743 | 743 | |
744 | 744 | <p> |
745 | - <?php echo Give()->html->checkbox( array( |
|
745 | + <?php echo Give()->html->checkbox(array( |
|
746 | 746 | 'name' => 'give-donor-delete-records', |
747 | 747 | 'options' => array( |
748 | 748 | 'disabled' => true, |
749 | 749 | ), |
750 | - ) ); ?> |
|
751 | - <label for="give-donor-delete-records"><?php esc_html_e( 'Delete all associated donations and records?', 'give' ); ?></label> |
|
750 | + )); ?> |
|
751 | + <label for="give-donor-delete-records"><?php esc_html_e('Delete all associated donations and records?', 'give'); ?></label> |
|
752 | 752 | </p> |
753 | 753 | |
754 | 754 | <?php |
@@ -761,16 +761,16 @@ discard block |
||
761 | 761 | * |
762 | 762 | * @param object $donor The donor object being displayed. |
763 | 763 | */ |
764 | - do_action( 'give_donor_delete_inputs', $donor ); |
|
764 | + do_action('give_donor_delete_inputs', $donor); |
|
765 | 765 | ?> |
766 | 766 | </span> |
767 | 767 | |
768 | 768 | <span id="donor-edit-actions"> |
769 | 769 | <input type="hidden" name="customer_id" value="<?php echo $donor->id; ?>" /> |
770 | - <?php wp_nonce_field( 'delete-donor', '_wpnonce', false, true ); ?> |
|
770 | + <?php wp_nonce_field('delete-donor', '_wpnonce', false, true); ?> |
|
771 | 771 | <input type="hidden" name="give_action" value="delete-donor" /> |
772 | - <input type="submit" disabled="disabled" id="give-delete-donor" class="button-primary" value="<?php esc_attr_e( 'Delete Donor', 'give' ); ?>" /> |
|
773 | - <a id="give-delete-donor-cancel" href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); ?>" class="delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
|
772 | + <input type="submit" disabled="disabled" id="give-delete-donor" class="button-primary" value="<?php esc_attr_e('Delete Donor', 'give'); ?>" /> |
|
773 | + <a id="give-delete-donor-cancel" href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); ?>" class="delete"><?php esc_html_e('Cancel', 'give'); ?></a> |
|
774 | 774 | </span> |
775 | 775 | |
776 | 776 | </div> |
@@ -786,5 +786,5 @@ discard block |
||
786 | 786 | * |
787 | 787 | * @param object $donor The donor object being displayed. |
788 | 788 | */ |
789 | - do_action( 'give_donor_delete_bottom', $donor ); |
|
789 | + do_action('give_donor_delete_bottom', $donor); |
|
790 | 790 | } |