constants.php
4.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?php
/**
* class-affiliates-options.php
*
* Copyright (c) 2010, 2011 "kento" Karim Rahimpur www.itthinx.com
*
* This code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt.
*
* This code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This header and all notices must be kept intact.
*
* @author Karim Rahimpur
* @package affiliates
* @since affiliates 1.0.0
*/
if ( !defined( 'ABSPATH' ) ) {
exit;
}
define( 'AFFILIATES_DEFAULT_VERSION', '1.0.0' );
/**
* @var string plugin domain
*/
define( 'AFFILIATES_PLUGIN_DOMAIN', 'affiliates' );
/**
* @var string plugin directory on the server
*/
define( 'AFFILIATES_PLUGIN_DIR', AFFILIATES_CORE_DIR );
/**
* @var string plugin url
*/
define( 'AFFILIATES_PLUGIN_URL', plugin_dir_url( AFFILIATES_FILE ) );
/**
* @var int cookie expiration multiplier, 1 day
*/
define( 'AFFILIATES_COOKIE_TIMEOUT_BASE', 86400 );
/**
* @var int default timeout in days
*/
define( 'AFFILIATES_COOKIE_TIMEOUT_DAYS', 30 );
/**
* @var string this cookie stores the affiliate id
*/
define( 'AFFILIATES_COOKIE_NAME', 'wp_affiliates' );
/**
* @var string (default) affiliate URL parameter name
*/
define( 'AFFILIATES_PNAME', 'affiliates' );
/**
* @var string affiliates form nonce name
*/
define( 'AFFILIATES_ADMIN_AFFILIATES_NONCE', 'affiliates-nonce' );
/**
* @var string affiliates table prefix
*/
define( 'AFFILIATES_TP', 'aff_' );
/**
* @var boolean Store robot hits
*/
define( 'AFFILIATES_RECORD_ROBOT_HITS', false );
/**
* @var string expander showing expandable state
*/
define( 'AFFILIATES_EXPANDER_EXPAND', '[+] ' );
/**
* @var string expander showing retractable state
*/
define( 'AFFILIATES_EXPANDER_RETRACT', '[-] ' );
/**
* @var string determines the affiliates part in a URL
*/
define( 'AFFILIATES_REGEX_PATTERN', 'affiliates/([^/]+)/?$' );
/**
* @var string the direct type is used to determine a default pseudo-affiliate, i.e. the site owner
*/
define( 'AFFILIATES_DIRECT_TYPE', 'direct' );
/**
* @var string the name of the pseudo-affiliate
*/
define( 'AFFILIATES_DIRECT_NAME', 'Direct' );
// translators: the name of the pseudo-affiliate
_x( 'Direct', 'pseudo-affiliate name', AFFILIATES_PLUGIN_DOMAIN );
/**
* @var int ids are not encoded
*/
define( 'AFFILIATES_NO_ID_ENCODING', 1 );
/**
* @var string ids are MD5-encoded
*/
define( 'AFFILIATES_MD5_ID_ENCODING', 2 );
// affiliates administrative capabilities
/**
* @var string allows access to the affiliates section
*/
define( 'AFFILIATES_ACCESS_AFFILIATES', 'aff_access' );
/**
* @var string allows to administer affiliates (create, delete, view)
*/
define( 'AFFILIATES_ADMINISTER_AFFILIATES', 'aff_admin_affiliates');
/**
* @var string allows to administer plugin options
*/
define( 'AFFILIATES_ADMINISTER_OPTIONS', 'aff_admin_options');
/**
* @var int generated password length
*/
define( 'AFFILIATES_REGISTRATION_PASSWORD_LENGTH', 12 );
/**
* @var int decimal places for referral amount
*/
define( 'AFFILIATES_REFERRAL_AMOUNT_DECIMALS', apply_filters( 'affiliates_referral_amount_decimals', 2 ) );
/**
* @var int number of characters in currency id
*/
define( 'AFFILIATES_REFERRAL_CURRENCY_ID_LENGTH', 3 );
/**
* @var string referral status pending
*/
define( 'AFFILIATES_REFERRAL_STATUS_PENDING', 'pending' );
/**
* @var string referral status accepted
*/
define( 'AFFILIATES_REFERRAL_STATUS_ACCEPTED', 'accepted' );
/**
* @var string referral status rejected
*/
define( 'AFFILIATES_REFERRAL_STATUS_REJECTED', 'rejected' );
/**
* @var string referral status closed
*/
define( 'AFFILIATES_REFERRAL_STATUS_CLOSED', 'closed' );
/**
* @var string qualifies as affiliate
*/
//define( 'AFFILIATES_IS_AFFILIATE', 'aff_is_affiliate' );
// constants used in affiliates-admin-hits.php & affiliaets-admin-referrals.php
define( 'AFFILIATES_HITS_PER_PAGE', 10 );
define( 'AFFILIATES_ADMIN_OVERVIEW_NONCE', 'affiliates-admin-overview-nonce' );
define( 'AFFILIATES_ADMIN_HITS_NONCE_1', 'affiliates-admin-hits-nonce-1' );
define( 'AFFILIATES_ADMIN_HITS_NONCE_2', 'affiliates-admin-hits-nonce-2' );
define( 'AFFILIATES_ADMIN_HITS_FILTER_NONCE', 'affiliates-admin-hits-filter-nonce' );
define( 'AFFILIATES_ADMIN_REFERRALS_NONCE', 'affiliates-admin-referrals-nonce' );