@@ -74,27 +74,27 @@ function install_config( $modified_files, $api_key, $cms, $exclusions ){
74
74
// Attention. Backwards order because inserting it step by step
75
75
76
76
$ pass = 'NO PASS ' ;
77
- $ email = '' ;
77
+ $ uni_email = '' ;
78
78
79
79
if ( Post::get ( 'admin_password ' ) ) {
80
80
$ pass = trim ( Post::get ( 'admin_password ' ) );
81
81
File::inject__variable ( $ path_to_config , 'password ' , hash ( 'sha256 ' , trim ( Post::get ( 'admin_password ' ) ) ) );
82
82
}
83
83
84
84
if ( Post::get ( 'email ' ) ) {
85
- $ email = trim ( Post::get ( 'email ' ) );
86
- File::inject__variable ( $ path_to_config , 'email ' , trim ( Post::get ( 'email ' ) ) );
85
+ $ uni_email = trim ( Post::get ( 'email ' ) );
86
+ File::inject__variable ( $ path_to_config , 'uni_email ' , trim ( Post::get ( 'email ' ) ) );
87
87
}
88
88
89
89
if ( Post::get ( 'user_token ' ) )
90
90
File::inject__variable ( $ path_to_config , 'user_token ' , trim ( Post::get ( 'user_token ' ) ) );
91
91
if ( Post::get ( 'account_name_ob ' ) )
92
92
File::inject__variable ( $ path_to_config , 'account_name_ob ' , trim ( Post::get ( 'account_name_ob ' ) ) );
93
93
94
- if ($ email ) {
94
+ if ($ uni_email ) {
95
95
$ host = $ _SERVER ['HTTP_HOST ' ] ?: 'Your Site ' ;
96
- $ to = $ email ;
97
- $ login = $ email ;
96
+ $ to = $ uni_email ;
97
+ $ login = $ uni_email ;
98
98
$ subject = 'Universal Anti-Spam Plugin settings for ' . $ host ;
99
99
$ message = "Hi,<br><br>
100
100
Your credentials to get access to settings of Universal Anti-Spam Plugin by CleanTalk are bellow,<br><br>
@@ -125,6 +125,7 @@ function install_config( $modified_files, $api_key, $cms, $exclusions ){
125
125
if ( $ exclusions )
126
126
File::inject__variable ( $ path_to_config , 'exclusions ' , $ exclusions , true );
127
127
File::inject__variable ( $ path_to_config , 'apikey ' , $ api_key );
128
+ File::inject__variable ( $ path_to_config , 'exclusion_key ' , md5 ($ api_key ) );
128
129
File::inject__variable ( $ path_to_config , 'detected_cms ' , $ cms );
129
130
File::inject__variable ( $ path_to_config , 'is_installed ' , true );
130
131
}
@@ -149,7 +150,8 @@ function uninstall( $files = array() ){
149
150
File::clean__variable ( $ path_to_config , 'password ' );
150
151
File::clean__variable ( $ path_to_config , 'salt ' );
151
152
File::clean__variable ( $ path_to_config , 'apikey ' );
152
- File::clean__variable ( $ path_to_config , 'email ' );
153
+ File::clean__variable ( $ path_to_config , 'exclusion_key ' );
154
+ File::clean__variable ( $ path_to_config , 'uni_email ' );
153
155
File::clean__variable ( $ path_to_config , 'user_token ' );
154
156
File::clean__variable ( $ path_to_config , 'account_name_ob ' );
155
157
File::clean__variable ( $ path_to_config , 'detected_cms ' );
@@ -166,6 +168,7 @@ function uninstall( $files = array() ){
166
168
File::replace__variable ( $ path_to_config , 'registrations_test ' , true );
167
169
File::replace__variable ( $ path_to_config , 'general_postdata_test ' , false );
168
170
File::replace__variable ( $ path_to_config , 'spam_firewall ' , true );
171
+ File::replace__variable ( $ path_to_config , 'general_post_exclusion_usage ' , false );
169
172
170
173
// Deleting cron tasks
171
174
File::replace__variable ( CLEANTALK_CRON_FILE , 'tasks ' , array () );
@@ -229,11 +232,15 @@ function detect_cms( $path_to_index, $out = 'Unknown' ){
229
232
function apbct__plugin_update_message () {
230
233
global $ latest_version ;
231
234
235
+ if (!$ latest_version ) {
236
+ $ latest_version = APBCT_VERSION ;
237
+ }
238
+
232
239
if ( version_compare ( APBCT_VERSION , $ latest_version ) === -1 ){
233
240
echo '<p class="text-center">There is a newer version. Update to the latest ' . $ latest_version . '</p> ' ;
234
241
echo '<p class="text-center"><button id="btn-update" form="none" class="btn btn-setup" value="">Update</button><img class="ajax-preloader" src="img/preloader.gif"></p> ' ;
235
242
}elseif ( version_compare ( APBCT_VERSION , $ latest_version ) === 1 ){
236
- echo '<p class="text-center">You are using more than the latest version ' . APBCT_VERSION . '</p> ' ;
243
+ echo '<p class="text-center">You are using a higher version than the latest version ' . APBCT_VERSION . '</p> ' ;
237
244
}else {
238
245
echo '<p class="text-center">You are using the latest version ' . APBCT_VERSION . '</p> ' ;
239
246
}
0 commit comments