get_modules()->install( new Csrf\Module() ); jet_form_builder()->get_modules()->install( new Honeypot\Module() ); jet_form_builder()->get_modules()->install( new Wp_Nonce\Module() ); $this->spam_statuses = apply_filters( 'jet-form-builder/security/spam-statuses', array() ); } public function on_uninstall() { jet_form_builder()->get_modules()->uninstall( new Csrf\Module() ); jet_form_builder()->get_modules()->uninstall( new Honeypot\Module() ); jet_form_builder()->get_modules()->uninstall( new Wp_Nonce\Module() ); $this->spam_statuses = array(); } public function condition(): bool { return true; } public function init_hooks() { } public function remove_hooks() { } public function has_spam(): bool { $status = jet_fb_handler()->response_args['status'] ?? ''; return ( in_array( $status, $this->spam_statuses, true ) || Logger\Module::instance()->has_log( Spam_Exception::class ) ); } public static function get_hasher(): \PasswordHash { global $wp_hasher; if ( ! empty( $wp_hasher ) ) { return $wp_hasher; } require_once ABSPATH . WPINC . '/class-phpass.php'; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited $wp_hasher = new \PasswordHash( 8, true ); return $wp_hasher; } }