Completed
Push — issues/1132 ( 716ec5...9a1477 )
by Ravinder
16:46
created

deprecated-functions.php ➔ give_checkout_button_purchase()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 30 and the first side effect is on line 16.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * Deprecated Functions
4
 *
5
 * All functions that have been deprecated.
6
 *
7
 * @package     Give
8
 * @subpackage  Deprecated
9
 * @copyright   Copyright (c) 2016, WordImpress
10
 * @license     https://opensource.org/licenses/gpl-license GNU Public License
11
 * @since       1.4.1
12
 */
13
14
// Exit if accessed directly.
15
if ( ! defined( 'ABSPATH' ) ) {
16
	exit;
17
}
18
19
20
/**
21
 * Checks if Guest checkout is enabled for a particular donation form
22
 *
23
 * @since 1.0
24
 * @deprecated 1.4.1
25
 *
26
 * @param int $form_id
27
 *
28
 * @return bool $ret True if guest checkout is enabled, false otherwise
29
 */
30
function give_no_guest_checkout( $form_id ) {
31
32
	$backtrace = debug_backtrace();
33
34
	_give_deprecated_function( __FUNCTION__, '1.4.1', null, $backtrace );
35
36
	$ret = give_get_meta( $form_id, '_give_logged_in_only', true );
37
38
	return (bool) apply_filters( 'give_no_guest_checkout', give_is_setting_enabled( $ret ) );
39
}
40
41
42
/**
43
 * Default Log Views
44
 *
45
 * @since      1.0
46
 * @deprecated 1.8
47
 * @return array $views Log Views
48
 */
49
function give_log_default_views() {
50
51
	$backtrace = debug_backtrace();
52
53
	_give_deprecated_function( __FUNCTION__, '1.8', null, $backtrace );
54
55
	$views = array(
56
		'sales'          => __( 'Donations', 'give' ),
57
		'gateway_errors' => __( 'Payment Errors', 'give' ),
58
		'api_requests'   => __( 'API Requests', 'give' ),
59
	);
60
61
	$views = apply_filters( 'give_log_views', $views );
62
63
	return $views;
64
}
65
66
/**
67
 * Donation form validate agree to "Terms and Conditions".
68
 *
69
 * @since      1.0
70
 * @deprecated 1.8.8
71
 */
72
function give_purchase_form_validate_agree_to_terms() {
73
74
	$backtrace = debug_backtrace();
75
76
	_give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_agree_to_terms', $backtrace );
77
78
	// Call new renamed function.
79
	give_donation_form_validate_agree_to_terms();
80
81
}
82
83
/**
84
 * Donation Form Validate Logged In User.
85
 *
86
 * @since      1.0
87
 * @deprecated 1.8.8
88
 */
89
function give_purchase_form_validate_logged_in_user() {
90
91
	$backtrace = debug_backtrace();
92
93
	_give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_logged_in_user', $backtrace );
94
95
	// Call new renamed function.
96
	give_donation_form_validate_logged_in_user();
97
98
}
99
100
/**
101
 * Donation Form Validate Logged In User.
102
 *
103
 * @since      1.0
104
 * @deprecated 1.8.8
105
 */
106
function give_purchase_form_validate_gateway() {
107
108
	$backtrace = debug_backtrace();
109
110
	_give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_gateway', $backtrace );
111
112
	// Call new renamed function.
113
	give_donation_form_validate_gateway();
114
115
}
116
117
/**
118
 * Donation Form Validate Fields.
119
 *
120
 * @since      1.0
121
 * @deprecated 1.8.8
122
 */
123
function give_purchase_form_validate_fields() {
124
125
	$backtrace = debug_backtrace();
126
127
	_give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_fields', $backtrace );
128
129
	// Call new renamed function.
130
	give_donation_form_validate_fields();
131
132
}
133
134
/**
135
 * Validates the credit card info.
136
 *
137
 * @since      1.0
138
 * @deprecated 1.8.8
139
 */
140
function give_purchase_form_validate_cc() {
141
142
	$backtrace = debug_backtrace();
143
144
	_give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_cc', $backtrace );
145
146
	// Call new renamed function.
147
	give_donation_form_validate_cc();
148
149
}
150
151
/**
152
 * Validates the credit card info.
153
 *
154
 * @since      1.0
155
 * @deprecated 1.8.8
156
 */
157
function give_get_purchase_cc_info() {
158
159
	$backtrace = debug_backtrace();
160
161
	_give_deprecated_function( __FUNCTION__, '1.8.8', 'give_get_donation_cc_info', $backtrace );
162
163
	// Call new renamed function.
164
	give_get_donation_cc_info();
165
166
}
167
168
169
/**
170
 * Validates the credit card info.
171
 *
172
 * @since      1.0
173
 * @deprecated 1.8.8
174
 *
175
 * @param int $zip
176
 * @param string $country_code
177
 */
178
function give_purchase_form_validate_cc_zip( $zip = 0, $country_code = '' ) {
179
180
	$backtrace = debug_backtrace();
181
182
	_give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_cc_zip', $backtrace );
183
184
	// Call new renamed function.
185
	give_donation_form_validate_cc_zip( $zip, $country_code );
186
187
}
188
189
/**
190
 * Donation form validate user login.
191
 *
192
 * @since      1.0
193
 * @deprecated 1.8.8
194
 */
195
function give_purchase_form_validate_user_login() {
196
197
	$backtrace = debug_backtrace();
198
199
	_give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_user_login', $backtrace );
200
201
	// Call new renamed function.
202
	give_donation_form_validate_user_login();
203
204
}
205
206
/**
207
 * Donation Form Validate Guest User
208
 *
209
 * @since      1.0
210
 * @deprecated 1.8.8
211
 */
212
function give_purchase_form_validate_guest_user() {
213
214
	$backtrace = debug_backtrace();
215
216
	_give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_guest_user', $backtrace );
217
218
	// Call new renamed function.
219
	give_donation_form_validate_guest_user();
220
221
}
222
223
/**
224
 * Donate Form Validate New User
225
 *
226
 * @since      1.0
227
 * @deprecated 1.8.8
228
 */
229
function give_purchase_form_validate_new_user() {
230
231
	$backtrace = debug_backtrace();
232
233
	_give_deprecated_function( __FUNCTION__, '1.8.8', 'give_donation_form_validate_new_user', $backtrace );
234
235
	// Call new renamed function.
236
	give_donation_form_validate_new_user();
237
238
}
239
240
241
/**
242
 * Get Donation Form User
243
 *
244
 * @since      1.0
245
 * @deprecated 1.8.8
246
 *
247
 * @param array $valid_data
248
 */
249
function give_get_purchase_form_user( $valid_data = array() ) {
250
251
	$backtrace = debug_backtrace();
252
253
	_give_deprecated_function( __FUNCTION__, '1.8.8', 'give_get_donation_form_user', $backtrace );
254
255
	// Call new renamed function.
256
	give_get_donation_form_user( $valid_data );
257
258
}
259
260
/**
261
 * Give Checkout Button.
262
 *
263
 * Renders the button on the Checkout.
264
 *
265
 * @since  1.0
266
 * @deprecated 1.8.8
267
 *
268
 * @param  int $form_id The form ID.
269
 *
270
 * @return string
271
 */
272
function give_checkout_button_purchase( $form_id ) {
273
	$backtrace = debug_backtrace();
274
275
	_give_deprecated_function( __FUNCTION__, '1.8.8', 'give_get_donation_form_submit_button', $backtrace );
276
277
	return give_get_donation_form_submit_button( $form_id );
278
279
}
280