'' . __( 'Settings', 'actstopspam' ) . '', ); return array_merge( $action_links, $links ); } /** * Act Stop Spam Plugin Deactivation function * @since 1.0 */ public static function deactivate (){ self::uninstall(); } /** * Uninstall function Removes ACT_STOP_SPAM_KEY and act_stop_spam table. * @since 1.0 */ private static function uninstall() { global $wpdb; delete_option('ACT_STOP_SPAM_KEY'); $wpdb->hide_errors(); $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}act_stop_spam" ); } /** * Create Database * @since 1.0 */ private static function createdb() { global $wpdb; require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); $wpdb->hide_errors(); dbDelta(self::dbschema()); } /** * Get Table dbschema * @return string */ private static function dbschema() { global $wpdb; $collate = ''; if ( $wpdb->has_cap( 'collation' ) ) { if ( ! empty( $wpdb->charset ) ) { $collate .= "DEFAULT CHARACTER SET $wpdb->charset"; } if ( ! empty( $wpdb->collate ) ) { $collate .= " COLLATE $wpdb->collate"; } } return " CREATE TABLE {$wpdb->prefix}act_stop_spam ( act_id bigint(20) NOT NULL auto_increment, ip_address varchar(200) NOT NULL, first_visit datetime DEFAULT NULL, latest_visit datetime DEFAULT NULL, occurrence bigint(20) NOT NULL, PRIMARY KEY (act_id), KEY ip_address (ip_address) ) $collate;"; } } endif; ACT_STOP_SPAM_Install::init();