/home/vianto5/hidalgoresidences.mx/wp-content/plugins/wp-mail-smtp/src/SiteHealth.php (12967B)
%s
%s
', $mailer_text, esc_html__( 'The WP Mail SMTP plugin mailer setup is complete. You can send a test email, to make sure it\'s working properly.', 'wp-mail-smtp' ) ), 'actions' => sprintf( '', esc_url( add_query_arg( 'tab', 'test', wp_mail_smtp()->get_admin()->get_admin_page_url( Area::SLUG . '-tools' ) ) ), esc_html__( 'Test email sending', 'wp-mail-smtp' ) ), 'test' => 'wp_mail_smtp_mailer_setup_complete', ); if ( $mailer === 'mail' ) { $mailer_text .= sprintf( /* translators: %s - explanation why default mailer is not a valid mailer option. */ '%s
', esc_html__( 'You currently have the default mailer selected, which means that you haven’t set up SMTP yet.', 'wp-mail-smtp' ) ); } if ( $mailer_complete === false ) { $result['label'] = esc_html__( 'WP Mail SMTP mailer setup is incomplete', 'wp-mail-smtp' ); $result['status'] = 'recommended'; $result['badge']['color'] = 'orange'; $result['description'] = sprintf( '%s
%s
', $mailer_text, esc_html__( 'The WP Mail SMTP plugin mailer setup is incomplete. Please click on the link below to access plugin settings and configure the mailer.', 'wp-mail-smtp' ) ); $result['actions'] = sprintf( '', esc_url( wp_mail_smtp()->get_admin()->get_admin_page_url() ), esc_html__( 'Configure mailer', 'wp-mail-smtp' ) ); } return $result; } /** * Perform the test for checking if all custom plugin DB tables exist. * * @since 2.1.2 * * @return array */ public function db_tables_test() { $result = array( 'label' => esc_html__( 'WP Mail SMTP DB tables are created', 'wp-mail-smtp' ), 'status' => 'good', 'badge' => array( 'label' => $this->get_label(), 'color' => self::BADGE_COLOR, ), 'description' => esc_html__( 'WP Mail SMTP is using custom database tables for some of its features. In order to work properly, the custom tables should be created, and it looks like they exist in your database.', 'wp-mail-smtp' ), 'actions' => '', 'test' => 'wp_mail_smtp_db_tables_exist', ); $missing_tables = $this->get_db_tables( 'missing' ); if ( ! empty( $missing_tables ) ) { $missing_tables_create_link = wp_nonce_url( add_query_arg( [ 'create-missing-db-tables' => 1, ], wp_mail_smtp()->get_admin()->get_admin_page_url( Area::SLUG ) ), Area::SLUG . '-create-missing-db-tables' ); $result['label'] = esc_html__( 'WP Mail SMTP DB tables check has failed', 'wp-mail-smtp' ); $result['status'] = 'critical'; $result['badge']['color'] = 'red'; $result['description'] = sprintf( '%s
%s
', sprintf( /* translators: %s - the list of missing tables separated by comma. */ esc_html( _n( 'Missing table: %s', 'Missing tables: %s', count( $missing_tables ), 'wp-mail-smtp' ) ), esc_html( implode( ', ', $missing_tables ) ) ), wp_kses( sprintf( /* translators: %1$s - Settings Page URL; %2$s - The aria label; %3$s - The text that will appear on the link. */ __( 'WP Mail SMTP is using custom database tables for some of its features. In order to work properly, the custom tables should be created, and it seems they are missing. Please try to %3$s. If this issue persists, please contact our support.', 'wp-mail-smtp' ), esc_url( $missing_tables_create_link ), esc_attr__( 'Go to WP Mail SMTP settings page.', 'wp-mail-smtp' ), esc_attr__( 'create the missing DB tables by clicking on this link', 'wp-mail-smtp' ) ), [ 'a' => [ 'href' => [], 'rel' => [], 'target' => [], 'aria-label' => [], ], ] ) ); } return $result; } /** * Perform the test (async) for checking if email domain configured properly. * * @since 2.8.0 */ public function email_domain_check_test() { check_ajax_referer( 'health-check-site-status' ); if ( ! current_user_can( 'view_site_health_checks' ) ) { wp_send_json_error(); } $options = Options::init(); $mailer = $options->get( 'mail', 'mailer' ); $email = $options->get( 'mail', 'from_email' ); $domain = ''; $email_domain_text = sprintf( '%1$s: %2$s', esc_html__( 'Current from email domain', 'wp-mail-smtp' ), esc_html( WP::get_email_domain( $email ) ) ); $result = array( 'label' => esc_html__( 'Email domain is configured correctly', 'wp-mail-smtp' ), 'status' => 'good', 'badge' => array( 'label' => $this->get_label(), 'color' => self::BADGE_COLOR, ), 'description' => sprintf( '%1$s
%2$s
', $email_domain_text, esc_html__( 'All checks for your email domain were successful. It looks like everything is configured correctly.', 'wp-mail-smtp' ) ), 'actions' => sprintf( '', esc_url( add_query_arg( 'tab', 'test', wp_mail_smtp()->get_admin()->get_admin_page_url( Area::SLUG . '-tools' ) ) ), esc_html__( 'Send a Test Email', 'wp-mail-smtp' ) ), 'test' => 'wp_mail_smtp_email_domain_check', ); // Add the optional sending domain parameter. if ( in_array( $mailer, [ 'mailgun', 'sendinblue', 'sendgrid' ], true ) ) { $domain = $options->get( $mailer, 'domain' ); } $domain_checker = new DomainChecker( $mailer, $email, $domain ); if ( ! $domain_checker->no_issues() ) { $result['label'] = esc_html__( 'Email domain issues detected', 'wp-mail-smtp' ); $result['status'] = 'recommended'; $result['description'] = sprintf( '%1$s
%2$s', $email_domain_text, $domain_checker->get_results_html() ); $result['actions'] = sprintf( '', esc_url( wp_mail_smtp()->get_admin()->get_admin_page_url() ), esc_html__( 'Configure mailer', 'wp-mail-smtp' ) ); } wp_send_json_success( $result ); } /** * Get the missing tables from the database. * * @since 3.6.0 * * @return array */ public function get_missing_db_tables() { return $this->get_db_tables( 'missing' ); } /** * Check DB: * - if any required plugin DB table is missing, * - which of the required plugin DB tables exist. * * @since 2.1.2 * * @param string $check Which type of tables to return: 'missing' or 'existing'. * * @return array Missing or existing tables. */ private function get_db_tables( $check = 'missing' ) { global $wpdb; $tables = wp_mail_smtp()->get_custom_db_tables(); $missing_tables = []; $existing_tables = []; foreach ( $tables as $table ) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching $db_result = $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table ) ); if ( is_null( $db_result ) || strtolower( $db_result ) !== strtolower( $table ) ) { $missing_tables[] = $table; } else { $existing_tables[] = $table; } } return ( $check === 'existing' ) ? $existing_tables : $missing_tables; } }