Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #################### activate function ##########################
- function sb_activate_plugin(){ //runs only after MANUAL activation!
- global $wpdb, $sb_ip_log, $sb_banned_message_default;
- add_action('admin_notices', 'sb_activation_notice'); //show activation message
- add_option('sb_plugin_version', sb_get_plugin_version(), '', 'yes');
- add_option('sb_detection_of_spammers_method', '1', '', 'yes');
- add_option('sb_detection_of_spammers_time', '2592000', '', 'yes');
- add_option('sb_banned_message', "$sb_banned_message_default", '', 'yes');
- //v1.4:
- add_option('sb_automatic_ip_address_duplication', '0', '', 'yes');
- add_option('sb_automatic_ip_address_duplication_recurrence', 'twicedaily', '', 'yes');
- add_option('sb_spam_comment_automatic_elimination', '1', '', 'yes');
- add_option('sb_automatic_ip_address_duplication_last_cron_run_time', '', '', 'yes');
- //v1.5
- add_option('sb_access_restrictions', '1', '', 'yes'); //automatic using comments posting restriction
- sb_create_db_table();
- $wpdb->query("INSERT IGNORE INTO $sb_ip_log (id, ip, last_visit, hits) SELECT comment_ID, comment_author_IP, comment_date, 1 FROM $wpdb->comments WHERE comment_approved='spam'"); //copies all IP addresses to $sb_ip_log
- }
Advertisement
Add Comment
Please, Sign In to add comment