|
4 | 4 | Plugin Name: Anti-Spam by CleanTalk |
5 | 5 | Plugin URI: https://cleantalk.org |
6 | 6 | Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms. |
7 | | - Version: 6.77 |
| 7 | + Version: 6.78 |
8 | 8 | Author: CleanTalk - Anti-Spam Protection <welcome@cleantalk.org> |
9 | 9 | Author URI: https://cleantalk.org |
10 | 10 | Text Domain: cleantalk-spam-protect |
@@ -1582,7 +1582,7 @@ function apbct_sfw_update__create_temp_tables($direct_update = false) |
1582 | 1582 | return $result; |
1583 | 1583 | } |
1584 | 1584 |
|
1585 | | - $result__clear_db = AntiCrawler::clearDataTable( |
| 1585 | + $result__clear_db = AntiCrawler::clearUADataTable( |
1586 | 1586 | \Cleantalk\ApbctWP\DB::getInstance(), |
1587 | 1587 | APBCT_TBL_AC_UA_BL |
1588 | 1588 | ); |
@@ -2064,7 +2064,7 @@ function apbct_antiflood__clear_table() |
2064 | 2064 | APBCT_TBL_AC_LOG |
2065 | 2065 | ); |
2066 | 2066 | $anticrawler->setDb(DB::getInstance()); |
2067 | | - $anticrawler->clearTable(); |
| 2067 | + $anticrawler->clearLogTable(); |
2068 | 2068 | unset($anticrawler); |
2069 | 2069 | } |
2070 | 2070 | } |
@@ -2132,11 +2132,18 @@ function apbct_rc__install_plugin($_wp = null, $plugin = null) |
2132 | 2132 | } else { |
2133 | 2133 | die('FAIL ' . json_encode(array('error' => $installer->apbct_result))); |
2134 | 2134 | } |
| 2135 | + } elseif ( $result instanceof \WP_Error ) { |
| 2136 | + die( |
| 2137 | + 'FAIL ' . json_encode(array( |
| 2138 | + 'error' => 'FAIL_TO_GET_LATEST_VERSION', |
| 2139 | + 'details' => $result->get_error_message(), |
| 2140 | + )) |
| 2141 | + ); |
2135 | 2142 | } else { |
2136 | 2143 | die( |
2137 | 2144 | 'FAIL ' . json_encode(array( |
2138 | 2145 | 'error' => 'FAIL_TO_GET_LATEST_VERSION', |
2139 | | - 'details' => $result instanceof WP_Error ? $result->get_error_message() : '', |
| 2146 | + 'details' => 'Unknown error', |
2140 | 2147 | )) |
2141 | 2148 | ); |
2142 | 2149 | } |
@@ -2172,8 +2179,8 @@ function apbct_rc__activate_plugin($plugin) |
2172 | 2179 | $result_array = array('success' => true); |
2173 | 2180 | $error_msg = ''; |
2174 | 2181 |
|
2175 | | - if (!$result || is_wp_error($result)) { |
2176 | | - if ($result instanceof WP_Error) { |
| 2182 | + if ( ! $result || is_wp_error($result) ) { |
| 2183 | + if ( $result instanceof \WP_Error ) { |
2177 | 2184 | $error_msg = ' ' . $result->get_error_message(); |
2178 | 2185 | } |
2179 | 2186 | $result_array = array( |
@@ -2292,8 +2299,8 @@ function apbct_rc__uninstall_plugin($plugin = null) |
2292 | 2299 | $die_string = 'OK'; |
2293 | 2300 | $error_msg = ''; |
2294 | 2301 |
|
2295 | | - if (!$result || is_wp_error($result)) { |
2296 | | - if ($result instanceof WP_Error) { |
| 2302 | + if ( ! $result || is_wp_error($result) ) { |
| 2303 | + if ( $result instanceof \WP_Error ) { |
2297 | 2304 | $error_msg = ' ' . $result->get_error_message(); |
2298 | 2305 | } |
2299 | 2306 | $die_string = 'FAIL ' . json_encode(array( |
|
0 commit comments