'https://wpconsent.com/?utm_source=wpmailsmtpplugin&utm_medium=link&utm_campaign=privacy-compliance-page', ]; /** * Hooks. * * Removes WPConsent's onboarding redirect during AJAX to prevent it from * hijacking the status-check JSON response. * * @since 4.9.0 */ public function hooks(): void { if ( wp_doing_ajax() ) { remove_action( 'admin_init', 'wpconsent_maybe_redirect_onboarding', 9999 ); } parent::hooks(); } /** * Get the plugin name for use in IDs, CSS classes, and config keys. * * @since 4.9.0 * * @return string Plugin name. */ protected static function get_plugin_name(): string { return 'wpconsent'; // phpcs:ignore WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement } /** * The plugin this page promotes. * * @since 4.10.0 * * @return PartnerPlugin */ protected function create_plugin(): PartnerPlugin { return new WPConsentPartner(); } /** * Get heading title text. * * @since 4.9.0 * * @return string Heading title. */ protected function get_heading_title(): string { return esc_html__( 'Make Your Website Privacy-Compliant in Minutes', 'wp-mail-smtp' ); // phpcs:ignore WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement } /** * Get heading alt text for logo. * * @since 4.9.0 * * @return string Heading alt text. */ protected function get_heading_alt_text(): string { return esc_attr__( 'WP Mail SMTP ♥ WPConsent', 'wp-mail-smtp' ); // phpcs:ignore WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement } /** * Get heading description strings. * * @since 4.9.0 * * @return array Array of description strings. */ protected function get_heading_strings(): array { return [ // phpcs:ignore WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement esc_html__( 'Build trust with clear, compliant privacy practices. WPConsent adds clean, professional banners and handles the technical side for you.', 'wp-mail-smtp' ), esc_html__( 'Built for transparency. Designed for ease.', 'wp-mail-smtp' ), ]; } /** * Get screenshot features list. * * @since 4.9.0 * * @return array Array of feature strings. */ protected function get_screenshot_features(): array { return [ // phpcs:ignore WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement esc_html__( 'A professional banner that fits your site.', 'wp-mail-smtp' ), esc_html__( 'Tools like Google Analytics and Facebook Pixel paused until consent.', 'wp-mail-smtp' ), esc_html__( 'Peace of mind knowing you’re aligned with global laws.', 'wp-mail-smtp' ), esc_html__( 'Self-hosted. Your data remains on your site.', 'wp-mail-smtp' ), ]; } /** * Get screenshot alt text. * * @since 4.9.0 * * @return string Alt text for screenshot image. */ protected function get_screenshot_alt_text(): string { return esc_attr__( 'WPConsent screenshot', 'wp-mail-smtp' ); // phpcs:ignore WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement } /** * Whether the plugin has nothing left for the user to set up. * * @since 4.9.0 * * @return bool */ protected function is_plugin_finished_setup(): bool { if ( ! $this->is_plugin_configured() ) { return false; } return $this->is_pro_active(); } /** * Generate and output step 'Result' section HTML. * * @since 4.9.0 * * @noinspection HtmlUnknownTarget */ protected function output_section_step_result(): void { $step = $this->get_data_step_result(); if ( empty( $step ) ) { return; } printf( '

%4$s

%5$s

', esc_attr( $step['section_class'] ), esc_url( wp_mail_smtp()->assets_url . '/images/recommendations/' . $step['icon'] ), esc_attr__( 'Step 3', 'wp-mail-smtp' ), esc_html__( 'Get Advanced Cookie Consent Features', 'wp-mail-smtp' ), esc_html__( 'With WPConsent Pro you can access advanced features like geolocation, popup layout, records of consent, multilanguage support, and more.', 'wp-mail-smtp' ), esc_attr( $step['button_class'] ), esc_url( $step['button_url'] ), esc_html( $step['button_text'] ) ); } /** * Step 'Result' data. * * @since 4.9.0 * * @return array Step data. * @noinspection PhpUndefinedFunctionInspection */ protected function get_data_step_result(): array { // phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh $step = []; $step['icon'] = 'plugin-page/step-3.svg'; $step['section_class'] = $this->output_data['plugin_setup'] ? '' : 'grey'; $step['button_text'] = esc_html__( 'Learn More', 'wp-mail-smtp' ); $step['button_class'] = 'grey disabled'; $step['button_url'] = ''; $plugin_license_level = $this->is_pro_active() ? 'pro' : 'lite'; switch ( $plugin_license_level ) { case 'lite': $step['button_url'] = $this->config['wpconsent_addon_page']; $step['button_class'] = $this->output_data['plugin_setup'] ? 'button-primary' : 'grey disabled'; break; case 'pro': $addon_installed = $this->get_plugin()->is_pro_installed(); $step['button_text'] = $addon_installed ? esc_html__( 'WPConsent Pro Installed & Activated', 'wp-mail-smtp' ) : esc_html__( 'Install Now', 'wp-mail-smtp' ); $step['button_class'] = $this->output_data['plugin_setup'] ? 'grey disabled' : 'button-primary'; $step['icon'] = $addon_installed ? 'plugin-page/complete.svg' : 'plugin-page/step-3.svg'; break; } return $step; } /** * Get the heading for the install step. * * @since 4.9.0 * * @return string Install step heading. */ protected function get_install_heading(): string { return esc_html__( 'Install & Activate WPConsent', 'wp-mail-smtp' ); // phpcs:ignore WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement } /** * Get the description for the install step. * * @since 4.9.0 * * @return string Install step description. */ protected function get_install_description(): string { return esc_html__( 'Install WPConsent from the WordPress.org plugin repository.', 'wp-mail-smtp' ); // phpcs:ignore WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement } /** * Get the plugin title. * * @since 4.9.0 * * @return string Plugin title. */ protected function get_plugin_title(): string { return esc_html__( 'WPConsent', 'wp-mail-smtp' ); // phpcs:ignore WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement } /** * Get the install button text. * * @since 4.9.0 * * @return string Install button text. */ protected function get_install_button_text(): string { return esc_html__( 'Install WPConsent', 'wp-mail-smtp' ); // phpcs:ignore WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement } /** * Get the text when a plugin is installed and activated. * * @since 4.9.0 * * @return string Installed & activated text. */ protected function get_installed_activated_text(): string { return esc_html__( 'WPConsent Installed & Activated', 'wp-mail-smtp' ); // phpcs:ignore WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement } /** * Get the activate button text. * * @since 4.9.0 * * @return string Activate button text. */ protected function get_activate_text(): string { return esc_html__( 'Activate WPConsent', 'wp-mail-smtp' ); // phpcs:ignore WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement } /** * Get the heading for the setup step. * * @since 4.9.0 * * @return string Setup step heading. */ protected function get_setup_heading(): string { return esc_html__( 'Set Up WPConsent', 'wp-mail-smtp' ); // phpcs:ignore WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement } /** * Get the description for the setup step. * * @since 4.9.0 * * @return string Setup step description. */ protected function get_setup_description(): string { return esc_html__( 'WPConsent has an intuitive setup wizard to guide you through the cookie consent configuration process.', 'wp-mail-smtp' ); // phpcs:ignore WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement } /** * Get the setup button text. * * @since 4.9.0 * * @return string Setup button text. */ protected function get_setup_button_text(): string { return esc_html__( 'Run Setup Wizard', 'wp-mail-smtp' ); // phpcs:ignore WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement } /** * Get the text when setup is completed. * * @since 4.9.0 * * @return string Setup completed text. */ protected function get_setup_completed_text(): string { return esc_html__( 'Setup Complete', 'wp-mail-smtp' ); // phpcs:ignore WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement } /** * Get the text when a pro-version is installed and activated. * * @since 4.9.0 * * @return string Pro installed and activated text. */ protected function get_pro_installed_activated_text(): string { return esc_html__( 'WPConsent Pro Installed & Activated', 'wp-mail-smtp' ); // phpcs:ignore WPForms.Formatting.EmptyLineBeforeReturn.RemoveEmptyLineBeforeReturnStatement } }