300, 'display' => 'Every 5 Minutes']; } return $schedules; }); // Boot API cron flushers ITK_HP_API::register_cron(); ITK_Bot_API::register_cron(); ITK_Attacks_API::register_cron(); new ITK_Bot_Blocker(); new ITK_Protection(); new ITK_Optimization(); new ITK_Honeypot(); new ITK_WAF(); if (is_admin()) { new ITK_Admin(); } add_filter('plugin_action_links_' . ITK_BASENAME, [$this, 'add_settings_link']); } public function add_settings_link($links) { array_unshift($links, 'Settings'); return $links; } public static function activate() { ITK_Database::install(); // Default security settings if (!get_option('itk_security')) { add_option('itk_security', [ 'block_openai_bots' => 1, 'block_malicious_bots' => 1, 'block_bad_referrers' => 1, 'block_bad_networks' => 1, 'rate_limit_good_bots' => 1, 'protect_wp_login' => 1, 'protect_wp_includes' => 1, 'protect_uploads' => 1, 'block_author_scans' => 1, 'block_malicious_queries'=> 1, 'add_security_headers' => 1, 'block_xmlrpc' => 1, 'enable_custom_login' => 0, 'custom_login_slug' => 'thoushallpass', 'response_code' => '301_custom', 'redirect_url' => 'https://example.com/blocked', 'custom_message' => 'Access denied.', 'log_blocked_attempts' => 1, ]); } // Default optimization settings if (!get_option('itk_optimization')) { add_option('itk_optimization', [ 'remove_wp_version' => 1, 'hide_login_errors' => 1, 'remove_author_class' => 1, 'remove_script_versions' => 1, 'change_author_base' => 1, 'limit_revisions' => 1, 'remove_emoji' => 1, 'remove_default_userfields'=> 1, 'clean_bad_content' => 1, 'remove_wp_head_noise' => 1, 'disable_xml_rpc' => 1, 'deregister_wp_embed' => 1, 'stop_empty_search_redirect'=> 1, 'unregister_default_widgets'=> 1, 'defer_js' => 1, 'limit_heartbeat' => 1, 'disable_dashboard_widgets'=> 1, 'disable_comments_url' => 1, 'disable_floc' => 1, 'lightbox_images' => 1, 'remove_admin_bar_links' => 1, 'admin_branding' => 1, 'use_google_jquery' => 0, 'featured_image_rss' => 1, 'dns_prefetch' => 1, ]); } // Default honeypot settings if (!get_option('itk_honeypot')) { add_option('itk_honeypot', [ 'enabled' => 1, 'protect_comments' => 1, 'protect_login' => 1, 'protect_register' => 1, 'protect_lost_password'=> 1, 'protect_woocommerce' => 1, 'protect_cf7' => 1, 'protect_elementor' => 1, 'protect_gravity' => 1, 'protect_search' => 1, 'min_time' => 3, 'max_time' => 7200, 'retain_days' => 90, 'block_url_in_email' => 1, 'block_links_new_commenters' => 1, 'max_links' => 2, ]); } // Default WAF settings if (!get_option('itk_waf')) { add_option('itk_waf', [ 'enabled' => 1, 'action' => 'block', 'response_code' => '403', 'redirect_url' => '', 'custom_message' => 'Access denied.', 'log_attacks' => 1, 'scan_post' => 1, 'scan_cookies' => 0, 'scan_ua' => 1, 'block_sqli' => 1, 'block_xss' => 1, 'block_lfi' => 1, 'block_rfi' => 1, 'block_cmdi' => 1, 'block_xxe' => 1, 'block_php_inject' => 1, 'block_ssrf' => 1, 'block_wp_specific' => 1, ]); } flush_rewrite_rules(); } public static function deactivate() { ITK_HP_API::clear_cron(); ITK_Bot_API::clear_cron(); ITK_Attacks_API::clear_cron(); flush_rewrite_rules(); } } register_activation_hook(__FILE__, ['InformatiQ_Toolkit', 'activate']); register_deactivation_hook(__FILE__, ['InformatiQ_Toolkit', 'deactivate']); add_action('plugins_loaded', ['InformatiQ_Toolkit', 'instance']);