_description = esc_html__( 'AI-powered spam protection for your forms.', 'activelayer-anti-spam-spam-protection-for-forms-comments' ); } /** * Get addon icon URL. * * @since 1.1.0 * * @return string */ public function get_icon() { return plugin_dir_url( ACTIVELAYER_PLUGIN_FILE ) . 'assets/images/logo-icon.png'; } /** * Get retina icon URL. * * @since 1.1.0 * * @return string */ public function get_icon_x2() { return $this->get_icon(); } /** * Get addon banner URL. * * @since 1.1.0 * * @return string */ public function get_image() { return plugin_dir_url( ACTIVELAYER_PLUGIN_FILE ) . 'assets/images/logo-icon.png'; } /** * Get retina banner URL. * * @since 1.1.0 * * @return string */ public function get_image_x2() { return $this->get_image(); } /** * Global settings wizard. * * Shows connection status based on whether API key is configured. * * @since 1.1.0 * * @return array */ public function settings_wizards() { return [ [ 'callback' => [ $this, 'setup_connect' ], 'is_completed' => [ $this, 'is_connected' ], ], ]; } /** * Setup connect wizard step. * * @since 1.1.0 * * @param array $submitted_data Submitted data. * @param int $form_id Form ID. * * @return array */ public function setup_connect( $submitted_data, $form_id = 0 ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found $is_connected = $this->is_connected(); $is_submit = ! empty( $submitted_data ); $has_errors = false; $buttons = []; $notification = []; if ( $is_submit && ! empty( $submitted_data['connect'] ) ) { if ( ! $is_connected ) { $has_errors = true; } else { if ( ! forminator_addon_is_active( $this->_slug ) ) { Forminator_Integration_Loader::get_instance()->activate_addon( $this->_slug ); } $notification = [ 'type' => 'success', 'text' => '' . esc_html( $this->get_title() ) . ' ' . esc_html__( 'is connected successfully.', 'activelayer-anti-spam-spam-protection-for-forms-comments' ), ]; } } if ( $is_connected ) { $connect_html = '
' . esc_html__( 'AI spam protection is ready. Enable it per form in the Integrations tab.', 'activelayer-anti-spam-spam-protection-for-forms-comments' ) . '
' . '' . sprintf( /* translators: %1$s opening a tag, %2$s closing a tag. */ esc_html__( 'Please configure your API key in %1$sActiveLayer Settings%2$s first.', 'activelayer-anti-spam-spam-protection-for-forms-comments' ), '', '' ) . '
' . '