?MZ?   ?? ? @ ? o !?L!This program cannot be run in DOS mode. $ 3B#?#?#???A#?T??#?騴??#??'??#???t#??T??#?????#???e#?#??{#?sT??#?s???#?Rich#? PE d? ??g e " * o  ?  @     P  ?  `?      P ? ?? ` # @ t P   @ D  .text 1  o  `.rdata j+ D , ? @ @.data PS    @ .pdata # ` $ ? @ @.fptable  ?   @ .rsrc ?? ? ?  @ @.reloc t @  ? /** * Front to the WordPress application. This file doesn't do anything, but loads PK!Lj$@$@SMTP.phpnu[ 'wp-mail-smtp/wp_mail_smtp.php', 'lite_wporg_url' => 'https://wordpress.org/plugins/wp-mail-smtp/', 'lite_download_url' => 'https://downloads.wordpress.org/plugin/wp-mail-smtp.zip', 'pro_plugin' => 'wp-mail-smtp-pro/wp_mail_smtp.php', 'smtp_settings_url' => 'admin.php?page=wp-mail-smtp', 'smtp_wizard_url' => 'admin.php?page=wp-mail-smtp-setup-wizard', ]; /** * Runtime data used for generating page HTML. * * @since 1.5.7 * * @var array */ private $output_data = []; /** * Constructor. * * @since 1.5.7 */ public function __construct() { if ( ! wpforms_current_user_can() ) { return; } $this->hooks(); } /** * Hooks. * * @since 1.5.7 */ public function hooks() { if ( wp_doing_ajax() ) { add_action( 'wp_ajax_wpforms_smtp_page_check_plugin_status', [ $this, 'ajax_check_plugin_status' ] ); add_action( 'wpforms_plugin_activated', [ $this, 'smtp_activated' ] ); } // Check what page we are on. // phpcs:ignore WordPress.Security.NonceVerification.Recommended $page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : ''; // Only load if we are actually on the SMTP page. if ( $page !== self::SLUG ) { return; } add_action( 'admin_init', [ $this, 'redirect_to_smtp_settings' ] ); add_filter( 'wpforms_admin_header', '__return_false' ); add_action( 'wpforms_admin_page', [ $this, 'output' ] ); add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] ); // Hook for addons. do_action( 'wpforms_admin_pages_smtp_hooks' ); } /** * Enqueue JS and CSS files. * * @since 1.5.7 */ public function enqueue_assets() { $min = wpforms_get_min_suffix(); // Lity. wp_enqueue_style( 'wpforms-lity', WPFORMS_PLUGIN_URL . 'assets/lib/lity/lity.min.css', null, '3.0.0' ); wp_enqueue_script( 'wpforms-lity', WPFORMS_PLUGIN_URL . 'assets/lib/lity/lity.min.js', [ 'jquery' ], '3.0.0', true ); wp_enqueue_script( 'wpforms-admin-page-smtp', WPFORMS_PLUGIN_URL . "assets/js/admin/pages/smtp{$min}.js", [ 'jquery' ], WPFORMS_VERSION, true ); wp_localize_script( 'wpforms-admin-page-smtp', 'wpforms_pluginlanding', $this->get_js_strings() ); } /** * Set wp_mail_smtp_source option to 'wpforms' on WP Mail SMTP plugin activation. * * @since 1.8.7 * * @param string $plugin_basename Plugin basename. */ public function smtp_activated( $plugin_basename ) { if ( $plugin_basename !== $this->config['lite_plugin'] ) { return; } // If user came from some certain page to install WP Mail SMTP, we can get the source and write it instead of default one. $source = isset( $_POST['source'] ) ? sanitize_text_field( wp_unslash( $_POST['source'] ) ) : 'wpforms'; // phpcs:ignore WordPress.Security.NonceVerification.Missing update_option( 'wp_mail_smtp_source', $source ); } /** * JS Strings. * * @since 1.5.7 * * @return array Array of strings. */ protected function get_js_strings() { $error_could_not_install = sprintf( wp_kses( /* translators: %s - Lite plugin download URL. */ __( 'Could not install the plugin automatically. Please download it and install it manually.', 'wpforms-lite' ), [ 'a' => [ 'href' => true, ], ] ), esc_url( $this->config['lite_download_url'] ) ); $error_could_not_activate = sprintf( wp_kses( /* translators: %s - Lite plugin download URL. */ __( 'Could not activate the plugin. Please activate it on the Plugins page.', 'wpforms-lite' ), [ 'a' => [ 'href' => true, ], ] ), esc_url( admin_url( 'plugins.php' ) ) ); return [ 'installing' => esc_html__( 'Installing...', 'wpforms-lite' ), 'activating' => esc_html__( 'Activating...', 'wpforms-lite' ), 'activated' => esc_html__( 'WP Mail SMTP Installed & Activated', 'wpforms-lite' ), 'install_now' => esc_html__( 'Install Now', '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, 'manual_install_url' => $this->config['lite_download_url'], 'manual_activate_url' => admin_url( 'plugins.php' ), 'smtp_settings' => esc_html__( 'Go to SMTP settings', 'wpforms-lite' ), 'smtp_wizard' => esc_html__( 'Open Setup Wizard', 'wpforms-lite' ), 'smtp_settings_url' => esc_url( $this->config['smtp_settings_url'] ), 'smtp_wizard_url' => esc_url( $this->config['smtp_wizard_url'] ), ]; } /** * Generate and output page HTML. * * @since 1.5.7 */ public function output() { echo '
'; $this->output_section_heading(); $this->output_section_screenshot(); $this->output_section_step_install(); $this->output_section_step_setup(); echo '
'; } /** * Generate and output heading section HTML. * * @since 1.5.7 */ protected function output_section_heading() { // Heading section. printf( '
%3$s

%4$s

%5$s

', esc_url( WPFORMS_PLUGIN_URL . 'assets/images/smtp/wpforms-wpmailsmtp.png' ), esc_url( WPFORMS_PLUGIN_URL . 'assets/images/smtp/wpforms-wpmailsmtp@2x.png' ), esc_attr__( 'WPForms ♥ WP Mail SMTP', 'wpforms-lite' ), esc_html__( 'Making Email Deliverability Easy for WordPress', 'wpforms-lite' ), esc_html__( 'WP Mail SMTP fixes deliverability problems with your WordPress emails and form notifications. It\'s built by the same folks behind WPForms.', 'wpforms-lite' ) ); } /** * Generate and output screenshot section HTML. * * @since 1.5.7 */ protected function output_section_screenshot() { // Screenshot section. printf( '
%2$s
', esc_url( WPFORMS_PLUGIN_URL . 'assets/images/smtp/screenshot-tnail.png?ver=' . WPFORMS_VERSION ), esc_attr__( 'WP Mail SMTP screenshot', 'wpforms-lite' ), esc_url( WPFORMS_PLUGIN_URL . 'assets/images/smtp/screenshot-full.png?ver=' . WPFORMS_VERSION ), esc_html__( 'Improves email deliverability in WordPress.', 'wpforms-lite' ), esc_html__( 'Used by 2+ million websites.', 'wpforms-lite' ), esc_html__( 'Free mailers: SendLayer, SMTP.com, Brevo, Google Workspace / Gmail, Mailgun, Postmark, SendGrid.', 'wpforms-lite' ), esc_html__( 'Pro mailers: Amazon SES, Microsoft 365 / Outlook.com, Zoho Mail.', 'wpforms-lite' ) ); } /** * Generate and output step 'Install' section HTML. * * @since 1.5.7 */ protected function output_section_step_install() { $step = $this->get_data_step_install(); if ( empty( $step ) ) { return; } $button_format = ''; $button_allowed_html = [ 'button' => [ 'class' => true, 'data-plugin' => true, 'data-action' => true, 'data-source' => true, ], ]; if ( ! $this->output_data['plugin_installed'] && ! $this->output_data['pro_plugin_installed'] && ! wpforms_can_install( 'plugin' ) ) { $button_format = '%2$s '; $button_allowed_html = [ 'a' => [ 'class' => true, 'href' => true, 'target' => true, 'rel' => true, ], 'span' => [ 'class' => true, 'aria-hidden' => true, ], ]; } // phpcs:ignore WordPress.Security.NonceVerification.Recommended $source = isset( $_GET['source'] ) && $_GET['source'] === 'woocommerce' ? 'wpforms-woocommerce' : 'wpforms'; $button = sprintf( $button_format, esc_attr( $step['plugin'] ), esc_html( $step['button_text'] ), esc_attr( $step['button_class'] ), esc_attr( $step['button_action'] ), esc_attr( $source ) ); printf( '

%3$s

%4$s

%5$s
', esc_url( WPFORMS_PLUGIN_URL . 'assets/images/' . $step['icon'] ), esc_attr__( 'Step 1', 'wpforms-lite' ), esc_html( $step['heading'] ), esc_html( $step['description'] ), wp_kses( $button, $button_allowed_html ) ); } /** * Generate and output step 'Setup' section HTML. * * @since 1.5.7 */ protected function output_section_step_setup() { $step = $this->get_data_step_setup(); if ( empty( $step ) ) { return; } printf( '

%4$s

%5$s

', esc_attr( $step['section_class'] ), esc_url( WPFORMS_PLUGIN_URL . 'assets/images/' . $step['icon'] ), esc_attr__( 'Step 2', 'wpforms-lite' ), esc_html__( 'Set Up WP Mail SMTP', 'wpforms-lite' ), esc_html__( 'Select and configure your mailer.', 'wpforms-lite' ), esc_attr( $step['button_class'] ), esc_url( admin_url( $this->config['smtp_wizard_url'] ) ), esc_html( $step['button_text'] ) ); } /** * Step 'Install' data. * * @since 1.5.7 * * @return array Step data. */ protected function get_data_step_install() { $step = []; $step['heading'] = esc_html__( 'Install and Activate WP Mail SMTP', 'wpforms-lite' ); $step['description'] = esc_html__( 'Install WP Mail SMTP from the WordPress.org plugin repository.', 'wpforms-lite' ); $this->output_data['all_plugins'] = get_plugins(); $this->output_data['plugin_installed'] = array_key_exists( $this->config['lite_plugin'], $this->output_data['all_plugins'] ); $this->output_data['pro_plugin_installed'] = array_key_exists( $this->config['pro_plugin'], $this->output_data['all_plugins'] ); $this->output_data['plugin_activated'] = false; $this->output_data['plugin_setup'] = false; if ( ! $this->output_data['plugin_installed'] && ! $this->output_data['pro_plugin_installed'] ) { $step['icon'] = 'step-1.svg'; $step['button_text'] = esc_html__( 'Install WP Mail SMTP', 'wpforms-lite' ); $step['button_class'] = 'button-primary'; $step['button_action'] = 'install'; $step['plugin'] = $this->config['lite_download_url']; if ( ! wpforms_can_install( 'plugin' ) ) { $step['heading'] = esc_html__( 'WP Mail SMTP', 'wpforms-lite' ); $step['description'] = ''; $step['button_text'] = esc_html__( 'WP Mail SMTP on WordPress.org', 'wpforms-lite' ); $step['plugin'] = $this->config['lite_wporg_url']; } } else { $this->output_data['plugin_activated'] = $this->is_smtp_activated(); $this->output_data['plugin_setup'] = $this->is_smtp_configured(); $step['icon'] = $this->output_data['plugin_activated'] ? 'step-complete.svg' : 'step-1.svg'; $step['button_text'] = $this->output_data['plugin_activated'] ? esc_html__( 'WP Mail SMTP Installed & Activated', 'wpforms-lite' ) : esc_html__( 'Activate WP Mail SMTP', 'wpforms-lite' ); $step['button_class'] = $this->output_data['plugin_activated'] ? 'grey disabled' : 'button-primary'; $step['button_action'] = $this->output_data['plugin_activated'] ? '' : 'activate'; $step['plugin'] = $this->output_data['pro_plugin_installed'] ? $this->config['pro_plugin'] : $this->config['lite_plugin']; } return $step; } /** * Step 'Setup' data. * * @since 1.5.7 * * @return array Step data. */ protected function get_data_step_setup() { $step = [ 'icon' => 'step-2.svg', ]; if ( $this->output_data['plugin_activated'] ) { $step['section_class'] = ''; $step['button_class'] = 'button-primary'; $step['button_text'] = esc_html__( 'Open Setup Wizard', 'wpforms-lite' ); } else { $step['section_class'] = 'grey'; $step['button_class'] = 'grey disabled'; $step['button_text'] = esc_html__( 'Start Setup', 'wpforms-lite' ); } if ( $this->output_data['plugin_setup'] ) { $step['icon'] = 'step-complete.svg'; $step['button_text'] = esc_html__( 'Go to SMTP settings', 'wpforms-lite' ); } return $step; } /** * Ajax endpoint. Check plugin setup status. * Used to properly init step 'Setup' section after completing step 'Install'. * * @since 1.5.7 */ public function ajax_check_plugin_status() { // Security checks. if ( ! check_ajax_referer( 'wpforms-admin', 'nonce', false ) || ! wpforms_current_user_can() ) { wp_send_json_error( [ 'error' => esc_html__( 'You do not have permission.', 'wpforms-lite' ), ] ); } $result = []; if ( ! $this->is_smtp_activated() ) { wp_send_json_error( [ 'error' => esc_html__( 'Plugin unavailable.', 'wpforms-lite' ), ] ); } $result['setup_status'] = (int) $this->is_smtp_configured(); $result['license_level'] = wp_mail_smtp()->get_license_type(); // Prevent redirect to the WP Mail SMTP Setup Wizard on the fresh installs. // We need this workaround since WP Mail SMTP doesn't check whether the mailer is already configured when redirecting to the Setup Wizard on the first run. if ( $result['setup_status'] > 0 ) { update_option( 'wp_mail_smtp_activation_prevent_redirect', true ); } wp_send_json_success( $result ); } /** * Get $phpmailer instance. * * @since 1.5.7 * @since 1.6.1.2 Conditionally returns $phpmailer v5 or v6. * @since 1.8.7 Use always $phpmailer v6. * * @return \PHPMailer|\PHPMailer\PHPMailer\PHPMailer Instance of PHPMailer. */ protected function get_phpmailer() { global $phpmailer; if ( ! ( $phpmailer instanceof \PHPMailer\PHPMailer\PHPMailer ) ) { require_once ABSPATH . WPINC . '/PHPMailer/PHPMailer.php'; require_once ABSPATH . WPINC . '/PHPMailer/SMTP.php'; require_once ABSPATH . WPINC . '/PHPMailer/Exception.php'; $phpmailer = new \PHPMailer\PHPMailer\PHPMailer( true ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited } return $phpmailer; } /** * Whether WP Mail SMTP plugin configured or not. * * @since 1.5.7 * * @return bool True if some mailer is selected and configured properly. */ protected function is_smtp_configured() { if ( ! $this->is_smtp_activated() ) { return false; } $phpmailer = $this->get_phpmailer(); $mailer = \WPMailSMTP\Options::init()->get( 'mail', 'mailer' ); return ! empty( $mailer ) && $mailer !== 'mail' && wp_mail_smtp()->get_providers()->get_mailer( $mailer, $phpmailer )->is_mailer_complete(); } /** * Whether WP Mail SMTP plugin active or not. * * @since 1.5.7 * * @return bool True if SMTP plugin is active. */ protected function is_smtp_activated() { return function_exists( 'wp_mail_smtp' ) && ( is_plugin_active( $this->config['lite_plugin'] ) || is_plugin_active( $this->config['pro_plugin'] ) ); } /** * Redirect to SMTP settings page. * * @since 1.5.7 */ public function redirect_to_smtp_settings() { // Redirect to SMTP plugin if it is activated. if ( $this->is_smtp_configured() ) { wp_safe_redirect( admin_url( $this->config['smtp_settings_url'] ) ); exit; } } } PK! *I Community.phpnu[hooks(); } } /** * Hooks. * * @since 1.5.6 */ public function hooks() { // Check what page we are on. // phpcs:ignore WordPress.Security.NonceVerification.Recommended $page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : ''; // Only load if we are actually on the Community page. if ( self::SLUG !== $page ) { return; } add_action( 'wpforms_admin_page', [ $this, 'output' ] ); // Hook for addons. do_action( 'wpforms_admin_community_init' ); } /** * Page data. * * @since 1.5.6 */ public function get_blocks_data() { $type = wpforms()->is_pro() ? 'plugin' : 'liteplugin'; $data = []; $data['vip_circle'] = [ 'title' => esc_html__( 'WPForms VIP Circle Facebook Group', 'wpforms-lite' ), 'description' => esc_html__( 'Powered by the community, for the community. Anything and everything WPForms: Discussions. Questions. Tutorials. Insights and sneak peaks. Also, exclusive giveaways!', 'wpforms-lite' ), 'button_text' => esc_html__( 'Join WPForms VIP Circle', 'wpforms-lite' ), 'button_link' => 'https://www.facebook.com/groups/wpformsvip/', 'cover_bg_color' => '#E4F0F6', 'cover_img' => 'vip-circle.png', 'cover_img2x' => 'vip-circle@2x.png', ]; $data['announcements'] = [ 'title' => esc_html__( 'WPForms Announcements', 'wpforms-lite' ), 'description' => esc_html__( 'Check out the latest releases from WPForms. Our team is always innovating to bring you powerful features and functionality that are simple to use. Every release is designed with you in mind!', 'wpforms-lite' ), 'button_text' => esc_html__( 'View WPForms Announcements', 'wpforms-lite' ), 'button_link' => 'https://wpforms.com/blog/?utm_source=WordPress&utm_medium=Community&utm_campaign=' . esc_attr( $type ) . '&utm_content=Announcements', 'cover_bg_color' => '#EFF8E9', 'cover_img' => 'announcements.png', 'cover_img2x' => 'announcements@2x.png', ]; $data['youtube'] = [ 'title' => esc_html__( 'WPForms YouTube Channel', 'wpforms-lite' ), 'description' => esc_html__( 'Take a visual dive into everything WPForms has to offer. From simple contact forms to advanced payment forms and email marketing integrations, our extensive video collection covers it all.', 'wpforms-lite' ), 'button_text' => esc_html__( 'Visit WPForms YouTube Channel', 'wpforms-lite' ), 'button_link' => 'https://www.youtube.com/c/wpformsplugin', 'cover_bg_color' => '#FFE6E6', 'cover_img' => 'youtube.png', 'cover_img2x' => 'youtube@2x.png', ]; $data['dev_docs'] = [ 'title' => esc_html__( 'WPForms Developer Documentation', 'wpforms-lite' ), 'description' => esc_html__( 'Customize and extend WPForms with code. Our comprehensive developer resources include tutorials, snippets, and documentation on core actions, filters, functions, and more.', 'wpforms-lite' ), 'button_text' => esc_html__( 'View WPForms Dev Docs', 'wpforms-lite' ), 'button_link' => 'https://wpforms.com/developers/?utm_source=WordPress&utm_medium=Community&utm_campaign=' . esc_attr( $type ) . '&utm_content=Developers', 'cover_bg_color' => '#EBEBEB', 'cover_img' => 'dev-docs.png', 'cover_img2x' => 'dev-docs@2x.png', ]; $data['wpbeginner'] = [ 'title' => esc_html__( 'WPBeginner Engage Facebook Group', 'wpforms-lite' ), 'description' => esc_html__( 'Hang out with other WordPress experts and like minded website owners such as yourself! Hosted by WPBeginner, the largest free WordPress site for beginners.', 'wpforms-lite' ), 'button_text' => esc_html__( 'Join WPBeginner Engage', 'wpforms-lite' ), 'button_link' => 'https://www.facebook.com/groups/wpbeginner/', 'cover_bg_color' => '#FCEDE4', 'cover_img' => 'wpbeginner.png', 'cover_img2x' => 'wpbeginner@2x.png', ]; $data['suggest'] = [ 'title' => esc_html__( 'Suggest a Feature', 'wpforms-lite' ), 'description' => esc_html__( 'Do you have an idea or suggestion for WPForms? If you have thoughts on features, integrations, addons, or improvements - we want to hear it! We appreciate all feedback and insight from our users.', 'wpforms-lite' ), 'button_text' => esc_html__( 'Suggest a Feature', 'wpforms-lite' ), 'button_link' => 'https://wpforms.com/features/suggest/?utm_source=WordPress&utm_medium=Community&utm_campaign=' . esc_attr( $type ) . '&utm_content=Feature', 'cover_bg_color' => '#FFF9EF', 'cover_img' => 'suggest.png', 'cover_img2x' => 'suggest@2x.png', ]; return $data; } /** * Generate and output page HTML. * * @since 1.5.6 */ public function output() { ?>

get_blocks_data(); foreach ( $data as $item ) { printf( '
%4$s

%s

%s

', esc_attr( $item['cover_bg_color'] ), esc_url( WPFORMS_PLUGIN_URL . 'assets/images/community/' . $item['cover_img'] ), esc_url( WPFORMS_PLUGIN_URL . 'assets/images/community/' . $item['cover_img2x'] ), esc_html( $item['title'] ), esc_html( $item['description'] ), esc_url( $item['button_link'] ), esc_html( $item['button_text'] ) ); } ?>
'wpconsent-cookies-banner-privacy-suite/wpconsent.php', 'lite_wporg_url' => 'https://wordpress.org/plugins/wpconsent-cookies-banner-privacy-suite/', 'lite_download_url' => 'https://downloads.wordpress.org/plugin/wpconsent-cookies-banner-privacy-suite.zip', 'pro_plugin' => 'wpconsent-premium/wpconsent-premium.php', 'wpconsent_addon' => 'wpconsent-premium/wpconsent-premium.php', 'wpconsent_addon_page' => 'https://wpconsent.com/?utm_source=wpformsplugin&utm_medium=link&utm_campaign=privacy-compliance-page', 'wpconsent_onboarding' => 'admin.php?page=wpconsent', ]; /** * Runtime data used for generating page HTML. * * @since 1.9.7.3 * * @var array */ private $output_data = []; /** * Constructor. * * @since 1.9.7.3 */ public function __construct() { if ( ! wpforms_current_user_can() ) { return; } $this->hooks(); } /** * Hooks. * * @since 1.9.7.3 */ public function hooks(): void { if ( wp_doing_ajax() ) { remove_action( 'admin_init', 'wpconsent_maybe_redirect_onboarding', 9999 ); add_action( 'wp_ajax_wpforms_privacy_compliance_page_check_plugin_status', [ $this, 'ajax_check_plugin_status' ] ); add_action( 'wpforms_plugin_activated', [ $this, 'privacy_compliance_activated' ] ); } // Check what page we are on. // phpcs:ignore WordPress.Security.NonceVerification.Recommended $page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : ''; // Only load if we are actually on the Privacy Compliance page. if ( $page !== self::SLUG ) { return; } add_filter( 'wpforms_admin_header', '__return_false' ); add_action( 'wpforms_admin_page', [ $this, 'output' ] ); add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] ); /** * Hook for addons. * * @since 1.9.7.3 */ do_action( 'wpforms_admin_pages_privacy_compliance_hooks' ); } /** * Enqueue JS and CSS files. * * @since 1.9.7.3 */ public function enqueue_assets(): void { $min = wpforms_get_min_suffix(); // Lity. wp_enqueue_style( 'wpforms-lity', WPFORMS_PLUGIN_URL . 'assets/lib/lity/lity.min.css', null, '3.0.0' ); wp_enqueue_script( 'wpforms-lity', WPFORMS_PLUGIN_URL . 'assets/lib/lity/lity.min.js', [ 'jquery' ], '3.0.0', true ); // Custom styles for Lity image size limitation. wp_add_inline_style( 'wpforms-lity', ' .lity-image .lity-container { max-width: 1040px !important; } .lity-image img { max-width: 1040px !important; width: 100%; height: auto; } ' ); wp_enqueue_script( 'wpforms-admin-page-privacy-compliance', WPFORMS_PLUGIN_URL . "assets/js/admin/pages/privacy-compliance{$min}.js", [ 'jquery' ], WPFORMS_VERSION, true ); wp_localize_script( 'wpforms-admin-page-privacy-compliance', 'wpforms_pluginlanding', $this->get_js_strings() ); } /** * JS Strings. * * @since 1.9.7.3 * * @return array Array of strings. * @noinspection HtmlUnknownTarget */ protected function get_js_strings(): array { $error_could_not_install = sprintf( wp_kses( /* translators: %s - Lite plugin download URL. */ __( 'Could not install the plugin automatically. Please download it and install it manually.', 'wpforms-lite' ), [ 'a' => [ 'href' => true, ], ] ), esc_url( $this->config['lite_download_url'] ) ); $error_could_not_activate = sprintf( wp_kses( /* translators: %s - Lite plugin download URL. */ __( 'Could not activate the plugin. Please activate it on the Plugins page.', 'wpforms-lite' ), [ 'a' => [ 'href' => true, ], ] ), esc_url( admin_url( 'plugins.php' ) ) ); return [ 'installing' => esc_html__( 'Installing...', 'wpforms-lite' ), 'activating' => esc_html__( 'Activating...', 'wpforms-lite' ), 'activated' => esc_html__( 'WPConsent Installed & Activated', 'wpforms-lite' ), 'activated_pro' => esc_html__( 'WPConsent Pro Installed & Activated', 'wpforms-lite' ), 'install_now' => esc_html__( 'Install Now', '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, 'wpconsent_manual_install_url' => $this->config['lite_download_url'], 'wpconsent_manual_activate_url' => admin_url( 'plugins.php' ), ]; } /** * Generate and output page HTML. * * @since 1.9.7.3 */ public function output(): void { echo '
'; $this->output_section_heading(); $this->output_section_screenshot(); $this->output_section_step_install(); $this->output_section_step_setup(); $this->output_section_step_addon(); echo '
'; } /** * Generate and output heading section HTML. * * @since 1.9.7.3 * * @noinspection HtmlUnknownTarget */ public function output_section_heading(): void { // Heading section. printf( '
%2$s

%3$s

%4$s %5$s

', esc_url( WPFORMS_PLUGIN_URL . 'assets/images/privacy-compliance/wpforms-wpconsent.svg' ), esc_attr__( 'WPForms ♥ WPConsent', 'wpforms-lite' ), esc_html__( 'Make Your Website Privacy-Compliant in Minutes', 'wpforms-lite' ), esc_html__( 'Build trust with clear, compliant privacy practices. WPConsent adds clean, professional banners and handles the technical side for you.', 'wpforms-lite' ), esc_html__( 'Built for transparency. Designed for ease.', 'wpforms-lite' ) ); } /** * Generate and output screenshot section HTML. * * @since 1.9.7.3 * * @noinspection HtmlUnknownTarget */ protected function output_section_screenshot(): void { // Screenshot section. printf( '
%2$s
', esc_url( WPFORMS_PLUGIN_URL . 'assets/images/privacy-compliance/screenshot-tnail.png' ), esc_attr__( 'WPConsent screenshot', 'wpforms-lite' ), esc_url( WPFORMS_PLUGIN_URL . 'assets/images/privacy-compliance/screenshot-full.png' ), esc_html__( 'A professional banner that fits your site.', 'wpforms-lite' ), esc_html__( 'Tools like Google Analytics and Facebook Pixel paused until consent.', 'wpforms-lite' ), esc_html__( 'Peace of mind knowing you’re aligned with global laws.', 'wpforms-lite' ), esc_html__( 'Self-hosted. Your data remains on your site.', 'wpforms-lite' ), esc_url( WPFORMS_PLUGIN_URL . 'assets/images/privacy-compliance/screenshot-tnail@2x.png' ) ); } /** * Generate and output step 'Install' section HTML. * * @since 1.9.7.3 * * @noinspection HtmlUnknownTarget */ protected function output_section_step_install(): void { $step = $this->get_data_step_install(); if ( empty( $step ) ) { return; } $button_format = ''; $button_allowed_html = [ 'button' => [ 'class' => true, 'data-plugin' => true, 'data-action' => true, ], ]; if ( ! $this->output_data['plugin_installed'] && ! $this->output_data['pro_plugin_installed'] && ! wpforms_can_install( 'plugin' ) ) { $button_format = '%2$s '; $button_allowed_html = [ 'a' => [ 'class' => true, 'href' => true, 'target' => true, 'rel' => true, ], 'span' => [ 'class' => true, 'aria-hidden' => true, ], ]; } $button = sprintf( $button_format, esc_attr( $step['plugin'] ), esc_html( $step['button_text'] ), esc_attr( $step['button_class'] ), esc_attr( $step['button_action'] ) ); printf( '

%3$s

%4$s

%5$s
', esc_url( WPFORMS_PLUGIN_URL . 'assets/images/' . $step['icon'] ), esc_attr__( 'Step 1', 'wpforms-lite' ), esc_html( $step['heading'] ), esc_html( $step['description'] ), wp_kses( $button, $button_allowed_html ) ); } /** * Generate and output step 'Setup' section HTML. * * @since 1.9.7.3 * * @noinspection HtmlUnknownTarget */ protected function output_section_step_setup(): void { $step = $this->get_data_step_setup(); if ( empty( $step ) ) { return; } printf( '

%4$s

%5$s

', esc_attr( $step['section_class'] ), esc_url( WPFORMS_PLUGIN_URL . 'assets/images/' . $step['icon'] ), esc_attr__( 'Step 2', 'wpforms-lite' ), esc_html__( 'Set Up WPConsent', 'wpforms-lite' ), esc_html__( 'WPConsent has an intuitive setup wizard to guide you through the cookie consent configuration process.', 'wpforms-lite' ), esc_attr( $step['button_class'] ), esc_url( admin_url( $this->config['wpconsent_onboarding'] ) ), esc_html( $step['button_text'] ) ); } /** * Generate and output step 'Addon' section HTML. * * @since 1.9.7.3 * * @noinspection HtmlUnknownTarget */ protected function output_section_step_addon(): void { $step = $this->get_data_step_addon(); if ( empty( $step ) ) { return; } printf( '

%4$s

%5$s

', esc_attr( $step['section_class'] ), esc_url( WPFORMS_PLUGIN_URL . 'assets/images/' . $step['icon'] ), esc_attr__( 'Step 3', 'wpforms-lite' ), esc_html__( 'Get Advanced Cookie Consent Features', 'wpforms-lite' ), esc_html__( 'With WPConsent Pro you can access advanced features like geolocation, popup layout, records of consent, multilanguage support, and more.', 'wpforms-lite' ), esc_attr( $step['button_class'] ), esc_url( $step['button_url'] ), esc_html( $step['button_text'] ) ); } /** * Step 'Install' data. * * @since 1.9.7.3 * * @return array Step data. */ protected function get_data_step_install(): array { $step = []; $step['heading'] = esc_html__( 'Install & Activate WPConsent', 'wpforms-lite' ); $step['description'] = esc_html__( 'Install WPConsent from the WordPress.org plugin repository.', 'wpforms-lite' ); $this->output_data['all_plugins'] = get_plugins(); $this->output_data['plugin_installed'] = array_key_exists( $this->config['lite_plugin'], $this->output_data['all_plugins'] ); $this->output_data['plugin_activated'] = false; $this->output_data['pro_plugin_installed'] = array_key_exists( $this->config['pro_plugin'], $this->output_data['all_plugins'] ); $this->output_data['pro_plugin_activated'] = false; if ( ! $this->output_data['plugin_installed'] && ! $this->output_data['pro_plugin_installed'] ) { $step['icon'] = 'step-1.svg'; $step['button_text'] = esc_html__( 'Install WPConsent', 'wpforms-lite' ); $step['button_class'] = 'button-primary'; $step['button_action'] = 'install'; $step['plugin'] = $this->config['lite_download_url']; if ( ! wpforms_can_install( 'plugin' ) ) { $step['heading'] = esc_html__( 'WPConsent', 'wpforms-lite' ); $step['description'] = ''; $step['button_text'] = esc_html__( 'WPConsent on WordPress.org', 'wpforms-lite' ); $step['plugin'] = $this->config['lite_wporg_url']; } } else { $this->output_data['plugin_activated'] = is_plugin_active( $this->config['lite_plugin'] ) || is_plugin_active( $this->config['pro_plugin'] ); $step['icon'] = $this->output_data['plugin_activated'] ? 'step-complete.svg' : 'step-1.svg'; $step['button_text'] = $this->output_data['plugin_activated'] ? esc_html__( 'WPConsent Installed & Activated', 'wpforms-lite' ) : esc_html__( 'Activate WPConsent', 'wpforms-lite' ); $step['button_class'] = $this->output_data['plugin_activated'] ? 'grey disabled' : 'button-primary'; $step['button_action'] = $this->output_data['plugin_activated'] ? '' : 'activate'; $step['plugin'] = $this->output_data['pro_plugin_installed'] ? $this->config['pro_plugin'] : $this->config['lite_plugin']; } return $step; } /** * Step 'Setup' data. * * @since 1.9.7.3 * * @return array Step data. */ protected function get_data_step_setup(): array { $step = []; $this->output_data['plugin_setup'] = false; if ( $this->output_data['plugin_activated'] ) { $this->output_data['plugin_setup'] = $this->is_wpconsent_configured(); } $step['icon'] = 'step-2.svg'; $step['section_class'] = $this->output_data['plugin_activated'] ? '' : 'grey'; $step['button_text'] = esc_html__( 'Run Setup Wizard', 'wpforms-lite' ); $step['button_class'] = 'grey disabled'; if ( $this->output_data['plugin_setup'] ) { $step['icon'] = 'step-complete.svg'; $step['section_class'] = ''; $step['button_text'] = esc_html__( 'Setup Complete', 'wpforms-lite' ); } else { $step['button_class'] = $this->output_data['plugin_activated'] ? 'button-primary' : 'grey disabled'; } return $step; } /** * Step 'Addon' data. * * @since 1.9.7.3 * * @return array Step data. * @noinspection PhpUndefinedFunctionInspection */ protected function get_data_step_addon(): array { // phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh $step = []; $step['icon'] = 'step-3.svg'; $step['section_class'] = $this->output_data['plugin_setup'] ? '' : 'grey'; $step['button_text'] = esc_html__( 'Learn More', 'wpforms-lite' ); $step['button_class'] = 'grey disabled'; $step['button_url'] = ''; $plugin_license_level = false; if ( $this->output_data['plugin_activated'] ) { $plugin_license_level = 'lite'; // Check if premium features are available. if ( function_exists( 'wpconsent' ) ) { $wpconsent = wpconsent(); if ( isset( $wpconsent->license ) && method_exists( $wpconsent->license, 'is_active' ) ) { $plugin_license_level = $wpconsent->license->is_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'; break; case 'pro': $addon_installed = array_key_exists( $this->config['wpconsent_addon'], $this->output_data['all_plugins'] ); $step['button_text'] = $addon_installed ? esc_html__( 'WPConsent Pro Installed & Activated', 'wpforms-lite' ) : esc_html__( 'Install Now', 'wpforms-lite' ); $step['button_class'] = $this->output_data['plugin_setup'] ? 'grey disabled' : 'button-primary'; $step['icon'] = $addon_installed ? 'step-complete.svg' : 'step-3.svg'; break; } return $step; } /** * Ajax endpoint. Check plugin setup status. * Used to properly init the step 2 section after completing step 1. * * @since 1.9.7.3 * * @noinspection PhpUndefinedFunctionInspection */ public function ajax_check_plugin_status(): void { // Security checks. if ( ! check_ajax_referer( 'wpforms-admin', 'nonce', false ) || ! wpforms_current_user_can() ) { wp_send_json_error( [ 'error' => esc_html__( 'You do not have permission.', 'wpforms-lite' ) ] ); } $result = []; if ( ! function_exists( 'wpconsent' ) ) { wp_send_json_error( [ 'error' => esc_html__( 'Plugin unavailable.', 'wpforms-lite' ) ] ); } $result['setup_status'] = (int) $this->is_wpconsent_configured(); $result['license_level'] = 'lite'; $result['step3_button_url'] = $this->config['wpconsent_addon_page']; $wpconsent = wpconsent(); if ( isset( $wpconsent->license ) && method_exists( $wpconsent->license, 'is_active' ) && $wpconsent->license->is_active() ) { $result['license_level'] = 'pro'; } $result['addon_installed'] = (int) array_key_exists( $this->config['wpconsent_addon'], get_plugins() ); wp_send_json_success( $result ); } /** * Set the source of the plugin installation. * * @since 1.9.8 * * @param string $plugin_basename The basename of the plugin. */ public function privacy_compliance_activated( string $plugin_basename ): void { if ( $plugin_basename !== $this->config['lite_plugin'] ) { return; } $source = wpforms()->is_pro() ? 'WPForms' : 'WPForms Lite'; update_option( 'wpconsent_source', $source ); update_option( 'wpconsent_date', time() ); } /** * Whether WPConsent plugin configured or not. * * @since 1.9.7.3 * * @return bool True if WPConsent is configured properly. * @noinspection PhpUndefinedFunctionInspection */ protected function is_wpconsent_configured(): bool { if ( ! $this->is_wpconsent_activated() ) { return false; } // Check if WPConsent has been configured with basic settings. // The plugin is considered configured if the consent banner is enabled. if ( function_exists( 'wpconsent' ) ) { $wpconsent = wpconsent(); if ( isset( $wpconsent->settings ) ) { $enable_consent_banner = $wpconsent->settings->get_option( 'enable_consent_banner', 0 ); return ! empty( $enable_consent_banner ); } } return false; } /** * Whether WPConsent plugin active or not. * * @since 1.9.7.3 * * @return bool True if WPConsent plugin is active. */ protected function is_wpconsent_activated(): bool { return ( function_exists( 'wpconsent' ) && ( is_plugin_active( $this->config['lite_plugin'] ) || is_plugin_active( $this->config['pro_plugin'] ) ) ); } } PK!j  Templates.phpnu[addons_obj = wpforms()->obj( 'addons' ); $this->hooks(); } /** * Register hooks. * * @since 1.7.7 */ private function hooks() { add_action( 'wpforms_admin_page', [ $this, 'output' ] ); add_action( 'admin_enqueue_scripts', [ $this, 'enqueues' ] ); } /** * Enqueue assets. * * @since 1.7.7 */ public function enqueues() { $min = wpforms_get_min_suffix(); wp_enqueue_style( 'wpforms-form-templates', WPFORMS_PLUGIN_URL . "assets/css/admin/admin-form-templates{$min}.css", [], WPFORMS_VERSION ); wp_enqueue_script( 'wpforms-admin-form-templates', WPFORMS_PLUGIN_URL . "assets/js/admin/pages/form-templates{$min}.js", [ 'underscore', 'wp-util' ], WPFORMS_VERSION, true ); wp_enqueue_style( 'tooltipster', WPFORMS_PLUGIN_URL . 'assets/lib/jquery.tooltipster/jquery.tooltipster.min.css', [], '4.2.6' ); wp_enqueue_script( 'tooltipster', WPFORMS_PLUGIN_URL . 'assets/lib/jquery.tooltipster/jquery.tooltipster.min.js', [ 'jquery', 'wpforms-admin-form-templates' ], '4.2.6', true ); wp_localize_script( 'wpforms-admin-form-templates', 'wpforms_admin_form_templates', [ 'nonce' => wp_create_nonce( 'wpforms-builder' ), 'openAIFormUrl' => admin_url( 'admin.php?page=wpforms-builder&view=setup&ai-form' ), ] ); } /** * Build the output for the Form Templates admin page. * * @since 1.7.7 */ public function output() { ?>

blank form or create your own.
Have a suggestion for a new template? We’d love to hear it!', 'wpforms-lite' ), [ 'strong' => [], 'br' => [], 'a' => [ 'href' => [], 'class' => [], 'target' => [], 'rel' => [], ], ] ), esc_url( wpforms_utm_link( 'https://wpforms.com/docs/how-to-create-a-custom-form-template/', 'Form Templates Subpage', 'Create Your Own Template' ) ), esc_url( wpforms_utm_link( 'https://wpforms.com/form-template-suggestion/', 'Form Templates Subpage', 'Form Template Suggestion' ) ) ); ?>

output_templates_content(); ?>
allow_load() ) { return; } $this->hooks(); } /** * Hooks. * * @since 1.7.3 */ private function hooks() { add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] ); add_action( 'wpforms_admin_page', [ $this, 'view' ] ); } /** * Enqueue JS and CSS files. * * @since 1.7.3 */ public function enqueue_assets() { // Lity. wp_enqueue_style( 'wpforms-lity', WPFORMS_PLUGIN_URL . 'assets/lib/lity/lity.min.css', null, '3.0.0' ); wp_enqueue_script( 'wpforms-lity', WPFORMS_PLUGIN_URL . 'assets/lib/lity/lity.min.js', [ 'jquery' ], '3.0.0', true ); } /** * Page view. * * @since 1.7.3 */ public function view() { $sign_up_link = get_option( 'wpforms_constant_contact_signup', 'https://constant-contact.evyy.net/c/11535/341874/3411?sharedid=wpforms' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo wpforms_render( 'admin/pages/constant-contact', [ 'sign_up_link' => is_string( $sign_up_link ) ? $sign_up_link : '', 'wpbeginners_guide_link' => 'https://www.wpbeginner.com/beginners-guide/why-you-should-start-building-your-email-list-right-away', ], true ); } } PK!Lj$@$@SMTP.phpnu[PK! *I \@Community.phpnu[PK!6J$K$KDYPrivacyCompliance.phpnu[PK!j  Templates.phpnu[PK!zMMiConstantContact.phpnu[PK