'wpforms-lite' ), 'activate_now' => esc_html__( 'Activate Now', 'wpforms-lite' ), 'download_now' => esc_html__( 'Download Now', 'wpforms-lite' ), 'plugins_page' => esc_html__( 'Go to Plugins page', 'wpforms-lite' ), 'error_could_not_install' => $error_could_not_install, 'error_could_not_activate' => $error_could_not_activate, static::get_plugin_name() . '_manual_install_url' => $this->config['lite_download_url'], static::get_plugin_name() . '_manual_activate_url' => admin_url( 'plugins.php' ), ]; } /** * Get the plugin name for use in IDs, CSS classes, and config keys. * * @since 1.9.8.6 * * @return string Plugin name. */ abstract protected static function get_plugin_name(): string; /** * Generate and output heading section HTML. * * @since 1.9.8.6 * * @noinspection HtmlUnknownTarget */ public function output_section_heading(): void { $strings = $this->get_heading_strings(); // Heading section. printf( '
%2$s

%3$s

%4$s

', esc_url( $this->get_heading_image_url() ), esc_attr( $this->get_heading_alt_text() ), esc_html( $this->get_heading_title() ), esc_html( implode( ' ', $strings ) ) ); } /** * Get heading image URL. * * @since 1.9.8.6 * * @return string Heading image URL. */ protected function get_heading_image_url(): string { return WPFORMS_PLUGIN_URL . 'assets/images/' . static::get_plugin_name() . '/wpforms-' . static::get_plugin_name() . '.svg'; } /** * Get heading title text. * * @since 1.9.8.6 * * @return string Heading title. */ abstract protected function get_heading_title(): string; /** * Get heading alt text for logo. * * @since 1.9.8.6 * * @return string Heading alt text. */ abstract protected function get_heading_alt_text(): string; /** * Get heading description strings. * * @since 1.9.8.6 * * @return array Array of description strings. */ abstract protected function get_heading_strings(): array; /** * Generate and output screenshot section HTML. * * @since 1.9.8.6 */ protected function output_section_screenshot(): void { $features = $this->get_screenshot_features(); $list = ''; foreach ( $features as $feature ) { $list .= '
  • ' . esc_html( $feature ) . '
  • '; } // Screenshot section. printf( '
    %2$s
    ', esc_url( WPFORMS_PLUGIN_URL . 'assets/images/' . static::get_plugin_name() . '/screenshot-tnail.png' ), esc_attr( $this->get_screenshot_alt_text() ), esc_url( WPFORMS_PLUGIN_URL . 'assets/images/' . static::get_plugin_name() . '/screenshot-full@2x.png' ), esc_url( WPFORMS_PLUGIN_URL . 'assets/images/' . static::get_plugin_name() . '/screenshot-tnail@2x.png' ), wp_kses( $list, [ 'li' => [] ] ) ); } /** * Get screenshot features list. * * @since 1.9.8.6 * * @return array Array of feature strings. */ abstract protected function get_screenshot_features(): array; /** * Get screenshot alt text. * * @since 1.9.8.6 * * @return string Alt text for screenshot image. */ abstract protected function get_screenshot_alt_text(): string; /** * Generate and output step 'Result' section HTML. * * @since 1.9.8.6 */ abstract protected function output_section_step_result(): void; /** * Whether a plugin is configured or not. * * @since 1.9.8.6 * * @return bool True if a plugin is configured properly. */ abstract protected function is_plugin_configured(): bool; /** * Whether a plugin is active or not. * * @since 1.9.8.6 * * @return bool True if the plugin is active. */ abstract protected function is_plugin_activated(): bool; /** * Whether a plugin is finished setup or not. * * @since 1.9.8.6 * * @return bool True if the plugin is finished setup. */ abstract protected function is_plugin_finished_setup(): bool; /** * Whether a plugin is available (class/function exists). * * @since 1.9.8.6 * * @return bool True if a plugin is available. */ abstract protected function is_plugin_available(): bool; /** * Whether a pro-version is active. * * @since 1.9.8.6 * * @return bool True if a pro-version is active. */ abstract protected function is_pro_active(): bool; /** * Get the heading for the installation step. * * @since 1.9.8.6 * * @return string Install step heading. */ abstract protected function get_install_heading(): string; /** * Get the description for the installation step. * * @since 1.9.8.6 * * @return string Install step description. */ abstract protected function get_install_description(): string; /** * Get the plugin title. * * @since 1.9.8.6 * * @return string Plugin title. */ abstract protected function get_plugin_title(): string; /** * Get the installation button text. * * @since 1.9.8.6 * * @return string Install button text. */ abstract protected function get_install_button_text(): string; /** * Get the text when a plugin is installed and activated. * * @since 1.9.8.6 * * @return string Installed & activated text. */ abstract protected function get_installed_activated_text(): string; /** * Get the activate button text. * * @since 1.9.8.6 * * @return string Activate button text. */ abstract protected function get_activate_text(): string; /** * Get the heading for the setup step. * * @since 1.9.8.6 * * @return string Setup step heading. */ abstract protected function get_setup_heading(): string; /** * Get the description for the setup step. * * @since 1.9.8.6 * * @return string Setup step description. */ abstract protected function get_setup_description(): string; /** * Get the setup button text. * * @since 1.9.8.6 * * @return string Setup button text. */ abstract protected function get_setup_button_text(): string; /** * Get the text when setup is completed. * * @since 1.9.8.6 * * @return string Setup completed text. */ abstract protected function get_setup_completed_text(): string; /** * Get the text when a pro-version is installed and activated. * * @since 1.9.8.6 * * @return string Pro installed and activated text. */ abstract protected function get_pro_installed_activated_text(): string; }