get_defined_tab( $tab ), WP::admin_url( 'admin.php?page=' . Area::SLUG . '-' . $this->slug ) ); } /** * Get the current tab. * * @since 1.5.0 * * @return string Current tab. */ public function get_current_tab() { if ( empty( $_GET['tab'] ) ) { // phpcs:ignore return $this->slug; } return $this->get_defined_tab( $_GET['tab'] ); // phpcs:ignore } /** * Get the defined or default tab. * * @since 1.5.0 * * @param string $tab Tab to check. * * @return string Defined tab. Fallback to default one if it doesn't exist. */ protected function get_defined_tab( $tab ) { $tab = \sanitize_key( $tab ); return \in_array( $tab, $this->tabs, true ) ? $tab : $this->slug; } /** * Get label for a tab. * Process only those that exists. * Defaults to "About Us". * * @since 1.5.0 * * @param string $tab Tab to get label for. * * @return string */ public function get_label( $tab = '' ) { switch ( $this->get_defined_tab( $tab ) ) { case 'versus': $label = \sprintf( /* translators: %s - plugin current license type. */ \esc_html__( '%s vs Pro', 'wp-mail-smtp' ), \ucfirst( \wp_mail_smtp()->get_license_type() ) ); break; case 'about': default: $label = \esc_html__( 'About Us', 'wp-mail-smtp' ); break; } return $label; } /** * @inheritdoc */ public function get_title() { return $this->get_label( $this->get_current_tab() ); } /** * Display About page content based on the current tab. * * @since 1.5.0 */ public function display() { ?>
get_label( 'about' ) ); ?> get_license_type() === 'lite' ) : ?> get_label( 'versus' ) ); ?>

get_label( $this->get_current_tab() ) ); ?>

get_current_tab(); if ( \method_exists( $this, $callback ) ) { $this->{$callback}(); } else { $this->display_about(); } ?>

WPForms, the largest WordPress resource site, WPBeginner, the most popular lead-generation software, OptinMonster, the best WordPress analytics plugin, MonsterInsights, and the most powerful WordPress contest plugin, RafflePress.', 'wp-mail-smtp' ), array( 'a' => array( 'href' => array(), 'rel' => array(), 'target' => array(), ), ) ), 'https://wpforms.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp', 'https://www.wpbeginner.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp', 'https://optinmonster.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp', 'https://www.monsterinsights.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp', 'https://rafflepress.com/?utm_source=wpmailsmtpplugin&utm_medium=pluginaboutpage&utm_campaign=aboutwpmailsmtp' ); ?>

<?php esc_attr_e( 'The WPForms Team photo', 'wp-mail-smtp' ); ?>
display_plugins(); } /** * Display the plugins section. * * @since 2.2.0 */ protected function display_plugins() { ?>
get_am_plugins() as $key => $plugin ) : $is_url_external = false; $data = $this->get_about_plugins_data( $plugin ); if ( isset( $plugin['pro'] ) && \array_key_exists( $plugin['pro']['path'], \get_plugins() ) ) { $is_url_external = true; $plugin = $plugin['pro']; $data = array_merge( $data, $this->get_about_plugins_data( $plugin, true ) ); } // Do not display a plugin which has to be installed and the user can't install it. if ( ! current_user_can( 'install_plugins' ) && $data['status_class'] === 'status-download' ) { continue; } ?>
<?php esc_attr_e( 'Plugin icon', 'wp-mail-smtp' ); ?>

' . $data['status_text'] . '' ); ?>
array( 'path' => 'google-analytics-for-wordpress/googleanalytics.php', 'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-mi.png', 'name' => \esc_html__( 'MonsterInsights', 'wp-mail-smtp' ), 'desc' => \esc_html__( 'MonsterInsights makes it “effortless” to properly connect your WordPress site with Google Analytics, so you can start making data-driven decisions to grow your business.', 'wp-mail-smtp' ), 'url' => 'https://downloads.wordpress.org/plugin/google-analytics-for-wordpress.zip', 'pro' => array( 'path' => 'google-analytics-premium/googleanalytics-premium.php', 'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-mi.png', 'name' => \esc_html__( 'MonsterInsights Pro', 'wp-mail-smtp' ), 'desc' => \esc_html__( 'MonsterInsights makes it “effortless” to properly connect your WordPress site with Google Analytics, so you can start making data-driven decisions to grow your business.', 'wp-mail-smtp' ), 'url' => 'https://www.monsterinsights.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp', ), ), 'om' => array( 'path' => 'optinmonster/optin-monster-wp-api.php', 'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-om.png', 'name' => \esc_html__( 'OptinMonster', 'wp-mail-smtp' ), 'desc' => \esc_html__( 'Our high-converting optin forms like Exit-Intent® popups, Fullscreen Welcome Mats, and Scroll boxes help you dramatically boost conversions and get more email subscribers.', 'wp-mail-smtp' ), 'url' => 'https://downloads.wordpress.org/plugin/optinmonster.zip', ), 'wpforms' => array( 'path' => 'wpforms-lite/wpforms.php', 'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-wpf.png', 'name' => \esc_html__( 'Contact Forms by WPForms', 'wp-mail-smtp' ), 'desc' => \esc_html__( 'The best WordPress contact form plugin. Drag & Drop online form builder that helps you create beautiful contact forms with just a few clicks.', 'wp-mail-smtp' ), 'url' => 'https://downloads.wordpress.org/plugin/wpforms-lite.zip', 'pro' => array( 'path' => 'wpforms/wpforms.php', 'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-wpf.png', 'name' => \esc_html__( 'WPForms Pro', 'wp-mail-smtp' ), 'desc' => \esc_html__( 'The best WordPress contact form plugin. Drag & Drop online form builder that helps you create beautiful contact forms with just a few clicks.', 'wp-mail-smtp' ), 'url' => 'https://wpforms.com/?utm_source=WordPress&utm_medium=about&utm_campaign=smtp', ), ), 'rafflepress' => array( 'path' => 'rafflepress/rafflepress.php', 'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-rp.png', 'name' => \esc_html__( 'RafflePress', 'wp-mail-smtp' ), 'desc' => \esc_html__( 'Turn your visitors into brand ambassadors! Easily grow your email list, website traffic, and social media followers with powerful viral giveaways & contests.', 'wp-mail-smtp' ), 'url' => 'https://downloads.wordpress.org/plugin/rafflepress.zip', 'pro' => array( 'path' => 'rafflepress-pro/rafflepress-pro.php', 'icon' => \wp_mail_smtp()->assets_url . '/images/about/plugin-rp.png', 'name' => \esc_html__( 'RafflePress Pro', 'wp-mail-smtp' ), 'desc' => \esc_html__( 'Turn your visitors into brand ambassadors! Easily grow your email list, website traffic, and social media followers with powerful viral giveaways & contests.', 'wp-mail-smtp' ), 'url' => 'https://rafflepress.com/pricing/', ), ), ); return $data; } /** * Active the given plugin. * * @since 1.5.0 */ public static function ajax_plugin_activate() { // Run a security check. \check_ajax_referer( 'wp-mail-smtp-about', 'nonce' ); $error = \esc_html__( 'Could not activate the plugin. Please activate it from the Plugins page.', 'wp-mail-smtp' ); // Check for permissions. if ( ! \current_user_can( 'activate_plugins' ) ) { \wp_send_json_error( $error ); } if ( isset( $_POST['plugin'] ) ) { $activate = \activate_plugins( $_POST['plugin'] ); // phpcs:ignore if ( ! \is_wp_error( $activate ) ) { \wp_send_json_success( esc_html__( 'Plugin activated.', 'wp-mail-smtp' ) ); } } \wp_send_json_error( $error ); } /** * Install & activate the given plugin. * * @since 1.5.0 */ public static function ajax_plugin_install() { // Run a security check. \check_ajax_referer( 'wp-mail-smtp-about', 'nonce' ); $error = \esc_html__( 'Could not install the plugin.', 'wp-mail-smtp' ); // Check for permissions. if ( ! \current_user_can( 'install_plugins' ) ) { \wp_send_json_error( $error ); } if ( empty( $_POST['plugin'] ) ) { \wp_send_json_error(); } // Set the current screen to avoid undefined notices. \set_current_screen( 'wp-mail-smtp_page_wp-mail-smtp-about' ); // Prepare variables. $url = \esc_url_raw( \add_query_arg( array( 'page' => 'wp-mail-smtp-about', ), \admin_url( 'admin.php' ) ) ); $creds = \request_filesystem_credentials( $url, '', false, false, null ); // Check for file system permissions. if ( false === $creds ) { \wp_send_json_error( $error ); } if ( ! \WP_Filesystem( $creds ) ) { \wp_send_json_error( $error ); } // Do not allow WordPress to search/download translations, as this will break JS output. \remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 ); // Create the plugin upgrader with our custom skin. $installer = new PluginsInstallUpgrader( new PluginsInstallSkin() ); // Error check. if ( ! \method_exists( $installer, 'install' ) || empty( $_POST['plugin'] ) ) { \wp_send_json_error( $error ); } $installer->install( $_POST['plugin'] ); // phpcs:ignore // Flush the cache and return the newly installed plugin basename. \wp_cache_flush(); if ( $installer->plugin_info() ) { $plugin_basename = $installer->plugin_info(); // Activate the plugin silently. $activated = \activate_plugin( $plugin_basename ); if ( ! \is_wp_error( $activated ) ) { \wp_send_json_success( array( 'msg' => \esc_html__( 'Plugin installed & activated.', 'wp-mail-smtp' ), 'is_activated' => true, 'basename' => $plugin_basename, ) ); } else { \wp_send_json_success( array( 'msg' => esc_html__( 'Plugin installed.', 'wp-mail-smtp' ), 'is_activated' => false, 'basename' => $plugin_basename, ) ); } } \wp_send_json_error( $error ); } /** * Display a "Lite vs Pro" tab content. * * @since 1.5.0 */ protected function display_versus() { $license = \wp_mail_smtp()->get_license_type(); ?>

get_license_features() as $slug => $name ) { $current = $this->get_license_data( $slug, $license ); $pro = $this->get_license_data( $slug, 'pro' ); ?>

', $current['text'] ); ?>

', $pro['text'] ); ?>

$50 off regular price, automatically applied at checkout.', 'wp-mail-smtp' ), array( 'span' => array( 'class' => array(), ), ) ); ?>

\esc_html__( 'Email Log', 'wp-mail-smtp' ), 'control' => \esc_html__( 'Email Controls', 'wp-mail-smtp' ), 'mailers' => \esc_html__( 'Additional Mailers', 'wp-mail-smtp' ), 'support' => \esc_html__( 'Customer Support', 'wp-mail-smtp' ), ); } /** * Get the array of data that compared the license data. * * @since 1.5.0 * * @param string $feature Feature name. * @param string $license License type to get data for. * * @return array|false */ private function get_license_data( $feature, $license ) { $data = array( 'log' => array( 'lite' => array( 'status' => 'none', 'text' => array( '' . esc_html__( 'Emails are not logged', 'wp-mail-smtp' ) . '', ), ), 'pro' => array( 'status' => 'full', 'text' => array( '' . esc_html__( 'Complete Email Log management inside WordPress', 'wp-mail-smtp' ) . '', ), ), ), 'control' => array( 'lite' => array( 'status' => 'none', 'text' => array( '' . esc_html__( 'No controls over whether default WordPress emails are sent', 'wp-mail-smtp' ) . '', ), ), 'pro' => array( 'status' => 'full', 'text' => array( '' . esc_html__( 'Complete Email Controls management for most default WordPress emails', 'wp-mail-smtp' ) . '', ), ), ), 'mailers' => array( 'lite' => array( 'status' => 'none', 'text' => array( '' . esc_html__( 'Only default list of mailers', 'wp-mail-smtp' ) . '', ), ), 'pro' => array( 'status' => 'full', 'text' => array( '' . esc_html__( 'Additional mailers: Microsoft Outlook (with Office365 support) and Amazon SES', 'wp-mail-smtp' ) . '', ), ), ), 'support' => array( 'lite' => array( 'status' => 'none', 'text' => array( '' . esc_html__( 'Limited Support', 'wp-mail-smtp' ) . '', ), ), 'pro' => array( 'status' => 'full', 'text' => array( '' . esc_html__( 'Priority Support', 'wp-mail-smtp' ) . '', ), ), ), ); // Wrong feature? if ( ! isset( $data[ $feature ] ) ) { return false; } // Wrong license type? if ( ! isset( $data[ $feature ][ $license ] ) ) { return false; } return $data[ $feature ][ $license ]; } }