Plugin Directory

Changeset 3761969


Ignore:
Timestamp:
10/23/2026 03:48:30 PM (3 days ago)
Author:
1001webca
Message:

Version 2.9.181

Location:
1001web-maintenance-launch-pages
Files:
24 edited
1 copied

Legend:

Unmodified
Added
Removed
  • 1001web-maintenance-launch-pages/tags/2.9.181/1001web-maintenance-launch-pages.php

    r3759890 r3761969  
    44 * Plugin URI: https://maintenancegenius.ca
    55 * Description: Maintenance and coming soon pages for safe updates: suspends cache plugins, checks the 503 visitors get, flags pages that broke.
    6  * Version: 2.9.180
     6 * Version: 2.9.181
    77 * Author: 1001Web.ca
    88 * Author URI: https://www.1001web.ca
    … …  
    3939// CONSTANTES
    4040// ============================================
    41 define('MGENIUS_VERSION', '2.9.180');
     41define('MGENIUS_VERSION', '2.9.181');
    4242define('MGENIUS_PLUGIN_DIR', plugin_dir_path(__FILE__));
    4343define('MGENIUS_PLUGIN_URL', plugin_dir_url(__FILE__));
  • 1001web-maintenance-launch-pages/tags/2.9.181/assets/css/admin.css

    r3759890 r3761969  
    17831783    font-weight: 500;
    17841784    transition: all 0.3s ease;
     1785}
     1786
     1787/* v2.9.181 — bouton « Rouvrir l'assistant » au même aspect que les liens */
     1788button.mg-help-link {
     1789    border: 0;
     1790    font: inherit;
     1791    font-weight: 500;
     1792    cursor: pointer;
    17851793}
    17861794
    … …  
    25412549    font-size: 13px;
    25422550    color: #6b4e00;
     2551}
     2552
     2553/* v2.9.181 — résultat enregistré dans une autre langue */
     2554.mg-diag-lang-note {
     2555    margin: 12px 0 0;
     2556    padding: 8px 10px;
     2557    background: #eef4ff;
     2558    border-radius: 4px;
     2559    font-size: 13px;
     2560    color: #1d3a7a;
    25432561}
    25442562
    … …  
    29232941.mg-health-card-date{font-size:12px;color:#6b7280}
    29242942.mg-health-card-verdict{margin:8px 0 0;font-size:13px;line-height:1.5;color:#374151}
     2943.mg-health-card-lang{margin:6px 0 0;font-size:12px;color:#1d3a7a}
    29252944.mg-health-card-list{margin:8px 0 0;padding:0;list-style:none}
    29262945.mg-health-card-list li{display:flex;gap:10px;flex-wrap:wrap;padding:4px 0;border-top:1px solid #f1f5f9;font-size:12px}
  • 1001web-maintenance-launch-pages/tags/2.9.181/assets/js/admin.js

    r3759890 r3761969  
    312312        var i18n = mgeniusAdmin.i18n || {};
    313313        $card.attr('class', 'mg-health-card is-' + health.status);
     314        $('#mg-health-card-lang').remove(); // v2.9.181 — résultat neuf, dans la langue de l'utilisateur
    314315        $('#mg-health-card-date').text(i18n.hc_just_now || '');
    315316        var $v = $('#mg-health-card-verdict').empty();
    … …  
    28402841    });
    28412842
     2843    // v2.9.181 — rouvrir l'assistant de configuration (rien n'est modifié avant sa dernière étape).
     2844    $(document).on('click', '#mg-wizard-relaunch', function() {
     2845        if (!window.mgConfirmGate(this, mgeniusAdmin.i18n.wizard_relaunch_confirm)) {
     2846            return;
     2847        }
     2848        var $btn = $(this).prop('disabled', true);
     2849        $.post(mgeniusAdmin.ajaxurl, { action: 'mgenius_wizard_reset', nonce: mgeniusAdmin.nonce })
     2850            .done(function(response) {
     2851                if (response && response.success) {
     2852                    window.location.reload();
     2853                } else {
     2854                    showNotice((response && response.data && response.data.message) || mgeniusAdmin.i18n.error_generic, 'error');
     2855                    $btn.prop('disabled', false);
     2856                }
     2857            })
     2858            .fail(function() {
     2859                showNotice(mgeniusAdmin.i18n.connection_error, 'error');
     2860                $btn.prop('disabled', false);
     2861            });
     2862    });
     2863
    28422864    $(document).on('click', '#mg-reset-stats', function() {
    28432865        if (!window.mgConfirmGate(this, mgeniusAdmin.i18n.confirm_reset_stats)) {
    … …  
    33593381            }
    33603382            var results = response.data.results;
     3383            $('#mg-diag-lang-note').remove(); // v2.9.181 — résultat neuf, dans la langue de l'utilisateur
    33613384            var $container = $('#mg-diag-results').empty();
    33623385            $.each(results.checks, function(id, check) {
  • 1001web-maintenance-launch-pages/tags/2.9.181/includes/class-admin.php

    r3759890 r3761969  
    471471                'cancel'                 => __('Cancel', '1001web-maintenance-launch-pages'),
    472472                'confirm_ok'             => __('Continue', '1001web-maintenance-launch-pages'),
     473                'wizard_relaunch_confirm' => __('Open the setup wizard again? Nothing changes until its last step: "Launch maintenance!" and "Save without activating" replace your title, message and style. "Skip wizard" changes nothing.', '1001web-maintenance-launch-pages'),
    473474                'confirm_enable'         => __('Turn on maintenance mode? Your visitors will no longer see your normal site until you turn it off.', '1001web-maintenance-launch-pages'),
    474475                'expert_badge'           => __('Expert setting', '1001web-maintenance-launch-pages'),
  • 1001web-maintenance-launch-pages/tags/2.9.181/includes/class-ajax.php

    r3759890 r3761969  
    5858
    5959        add_action('wp_ajax_mgenius_wizard_save', [__CLASS__, 'wizard_save']);
     60        add_action('wp_ajax_mgenius_wizard_reset', [__CLASS__, 'wizard_reset']);
    6061        add_action('wp_ajax_mgenius_health_recheck', [__CLASS__, 'health_recheck']);
    6162
    … …  
    21272128    }
    21282129
     2130    /**
     2131     * v2.9.181 — Rouvre l'assistant au prochain chargement de la page.
     2132     * Ne touche à aucun réglage : seul l'assistant terminé (« Launch » ou
     2133     * « Save without activating ») enregistre ses choix.
     2134     */
     2135    public static function wizard_reset() {
     2136        check_ajax_referer('mgenius_nonce', 'nonce');
     2137
     2138        if (!current_user_can('manage_options')) {
     2139            wp_send_json_error(['message' => __('Permission denied', '1001web-maintenance-launch-pages')]);
     2140        }
     2141
     2142        delete_option('mgenius_wizard_completed');
     2143        wp_send_json_success();
     2144    }
     2145
    21292146    // WIZARD — Configuration initiale
    21302147    public static function wizard_save() {
  • 1001web-maintenance-launch-pages/tags/2.9.181/includes/class-diagnostic.php

    r3759890 r3761969  
    6464
    6565    /**
     66     * v2.9.181 — Le résultat enregistré a-t-il été rédigé dans une autre langue
     67     * que celle de l'utilisateur ? Avant la 2.9.181, la langue n'était pas
     68     * enregistrée : un résultat sans langue est présumé anglais.
     69     *
     70     * @param array|null $results
     71     * @return bool
     72     */
     73    public static function results_in_other_language($results) {
     74        if (!is_array($results)) {
     75            return false;
     76        }
     77        $current = (string) get_user_locale();
     78        if (!empty($results['locale'])) {
     79            return (string) $results['locale'] !== $current;
     80        }
     81        return 0 !== strpos($current, 'en');
     82    }
     83
     84    /**
    6685     * Statut d'un check individuel depuis le dernier scan.
    6786     * @param string $check_id
    … …  
    168187        $results = [
    169188            'timestamp' => time(),
     189            // v2.9.181 — langue des textes enregistrés : un résultat lu dans
     190            // une autre langue est signalé au lieu d'être affiché tel quel.
     191            'locale'    => get_user_locale(),
    170192            'checks'    => $checks,
    171193            'fails'     => $fails,
    … …  
    563585    private static function check_cron() {
    564586        if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON) {
    565             // Cron système possible — on ne peut pas le prouver d'ici : warn informatif.
     587            // v2.9.181 — preuve par la file d'attente : si aucune tâche n'est
     588            // en retard de plus de 30 minutes, une tâche cron du serveur appelle
     589            // wp-cron.php. Sinon, avertissement (rien ne prouve qu'elle existe).
     590            $mgenius_queue = _get_cron_array();
     591            if (is_array($mgenius_queue) && !empty($mgenius_queue)) {
     592                $mgenius_oldest = (int) min(array_keys($mgenius_queue));
     593                if ($mgenius_oldest >= time() - 30 * MINUTE_IN_SECONDS) {
     594                    return self::result('ok',
     595                        __('Scheduled tasks run through a server cron job', '1001web-maintenance-launch-pages'),
     596                        __('WP-Cron is disabled in wp-config.php, and no scheduled task is more than 30 minutes late: a cron job on your server runs them.', '1001web-maintenance-launch-pages'),
     597                        '',
     598                        __('DISABLE_WP_CRON is true and the task queue is up to date.', '1001web-maintenance-launch-pages')
     599                    );
     600                }
     601            }
    566602            return self::result('warn',
    567603                __('WP-Cron is disabled in wp-config.php', '1001web-maintenance-launch-pages'),
    568                 __('Scheduled tasks rely on a server-side cron job. If none is configured, the background page comparison after a scheduled or countdown end will not run.', '1001web-maintenance-launch-pages'),
     604                __('Some scheduled tasks are more than 30 minutes late, so no server cron job seems to call wp-cron.php. Without one, the background page comparison after a scheduled or countdown end will not run.', '1001web-maintenance-launch-pages'),
    569605                __('Confirm a real cron job calls wp-cron.php every few minutes, or remove DISABLE_WP_CRON.', '1001web-maintenance-launch-pages'),
    570606                __('DISABLE_WP_CRON is true — WordPress will not trigger cron on page loads.', '1001web-maintenance-launch-pages')
  • 1001web-maintenance-launch-pages/tags/2.9.181/includes/class-frontend.php

    r3759890 r3761969  
    5858        $mgenius_mode = isset( $this->settings['page_mode'] ) ? $this->settings['page_mode'] : 'maintenance';
    5959        $mgenius_title = isset( $this->settings['title'] ) ? (string) $this->settings['title'] : '';
    60         if ( '' === $mgenius_title || in_array( $mgenius_title, array( MGENIUS_Settings::default_title_for( 'maintenance' ), MGENIUS_Settings::default_title_for( 'coming_soon' ) ), true ) ) {
     60        $mgenius_en = MGENIUS_Settings::untouched_english_defaults();
     61        if ( '' === $mgenius_title || in_array( $mgenius_title, array( MGENIUS_Settings::default_title_for( 'maintenance' ), MGENIUS_Settings::default_title_for( 'coming_soon' ) ), true ) || in_array( trim( $mgenius_title ), $mgenius_en['title'], true ) ) {
    6162            $this->settings['title'] = MGENIUS_Settings::default_title_for( $mgenius_mode );
     63        }
     64        // v2.9.181 — message par défaut anglais jamais modifié : texte traduit.
     65        $mgenius_msg = isset( $this->settings['message'] ) ? trim( wp_strip_all_tags( (string) $this->settings['message'] ) ) : '';
     66        if ( in_array( $mgenius_msg, $mgenius_en['message'], true ) ) {
     67            $this->settings['message'] = __( 'We are updating our website. We will be back very soon.', '1001web-maintenance-launch-pages' );
    6268        }
    6369    }
  • 1001web-maintenance-launch-pages/tags/2.9.181/includes/class-healthcheck.php

    r3759890 r3761969  
    683683        global $wpdb;
    684684
     685        // v2.9.181 — langue des messages enregistrés (voir health-card.php).
     686        if (self::RESULT_OPTION === $key && is_array($value) && !empty($value)) {
     687            $value['locale'] = get_user_locale();
     688        }
     689
    685690        $serialized = maybe_serialize($value);
    686691
  • 1001web-maintenance-launch-pages/tags/2.9.181/includes/class-settings.php

    r3759890 r3761969  
    4545        /* translators: %s: site name */
    4646        return sprintf( __( '%s is coming soon', '1001web-maintenance-launch-pages' ), $name );
     47    }
     48
     49    /**
     50     * v2.9.181 — Titres et messages par défaut ENGLISH, jamais modifiés.
     51     * Enregistrés avant que la traduction du site soit installée (ou par les
     52     * versions antérieures), ils restaient en anglais sur un site français.
     53     * La page visiteur les remplace par le texte par défaut traduit ; un
     54     * texte écrit par l'administrateur n'est jamais touché.
     55     *
     56     * @return array{title:string[], message:string[]}
     57     */
     58    public static function untouched_english_defaults() {
     59        $name = trim( wp_specialchars_decode( (string) get_bloginfo( 'name' ), ENT_QUOTES ) );
     60        return array(
     61            'title'   => array(
     62                'Site Under Maintenance',
     63                'Coming soon',
     64                $name . ' will be back shortly',
     65                $name . ' is coming soon',
     66            ),
     67            'message' => array(
     68                'We are currently performing maintenance. We will be back soon.',
     69                'We are updating our website. We will be back very soon.',
     70            ),
     71        );
    4772    }
    4873
  • 1001web-maintenance-launch-pages/tags/2.9.181/readme.txt

    r3759890 r3761969  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 2.9.180
     7Stable tag: 2.9.181
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    170170
    171171**7. 1001Web support** (optional, only when you send a support request)
    172 - How: an email is sent to assistance@1001web.ca with your own site's mail configuration. No HTTP request is made to a 1001Web server. The screen also links to client.1001web.ca, our support desk; that is a plain link.
     172- How: an email is sent to the 1001Web support team with your own site's mail configuration. No HTTP request is made to a 1001Web server. The screen also links to client.1001web.ca, our support desk; that is a plain link.
    173173- When: only when you fill in the Request assistance form, confirm your consent and click send.
    174174- Data sent: your message, the email address you enter, and a technical report (site address, WordPress, PHP and MySQL versions, server software and limits, language and time zone, theme, active and must-use plugins, detected cache plugins, plugin settings state, diagnostic results). The report can be read in full before sending.
    … …  
    207207== Changelog ==
    208208
     209= 2.9.181 =
     210* Support tab, Useful Links: a new button opens the setup wizard again. Nothing changes until its last step, and "Skip wizard" changes nothing.
     211* Diagnostic and "Last update check": a result saved in another language is now flagged, with a prompt to run the check again, instead of being shown as is.
     212* Visitor page: a title or message still equal to an English default (never edited) now shows the default text in the site language.
     213* Diagnostic: with WP-Cron disabled, the check now looks at the task queue. If no task is more than 30 minutes late, it confirms that a server cron job runs them, instead of always warning.
     214* Visitor statistics: the numbers no longer overlap their labels, and the "Since" date follows the site date format.
     215* Readme: the support request section no longer shows an internal email address.
     216
    209217= 2.9.180 =
    210218* In Coming Soon mode (and in maintenance without the 503 option), robots.txt now returns a plain "Disallow: /" file and XML sitemaps return 404, instead of the HTML page with a 200 that crawlers read as an invalid file. The 503 maintenance page is unchanged.
  • 1001web-maintenance-launch-pages/tags/2.9.181/templates/admin-page.php

    r3759890 r3761969  
    22192219                                <div style="display: flex; gap: 20px; flex-wrap: wrap;">
    22202220                                    <div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 12px; padding: 20px 30px; text-align: center; flex: 1; min-width: 150px;">
    2221                                         <div style="font-size: 36px; font-weight: bold; color: #fff;" id="mg-stats-visits-count"><?php echo esc_html(number_format_i18n($stats_visits)); ?></div>
     2221                                        <div style="font-size: 36px; line-height: 1.2; margin-bottom: 4px; font-weight: bold; color: #fff;" id="mg-stats-visits-count"><?php echo esc_html(number_format_i18n($stats_visits)); ?></div>
    22222222                                        <div style="font-size: 14px; color: rgba(255,255,255,0.8);"><?php esc_html_e('Total visits', '1001web-maintenance-launch-pages'); ?></div>
    22232223                                    </div>
    22242224                                    <div style="background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); border-radius: 12px; padding: 20px 30px; text-align: center; flex: 1; min-width: 150px;">
    2225                                         <div style="font-size: 36px; font-weight: bold; color: #fff;" id="mg-stats-unique-count"><?php echo esc_html(number_format_i18n($stats_unique)); ?></div>
     2225                                        <div style="font-size: 36px; line-height: 1.2; margin-bottom: 4px; font-weight: bold; color: #fff;" id="mg-stats-unique-count"><?php echo esc_html(number_format_i18n($stats_unique)); ?></div>
    22262226                                        <div style="font-size: 14px; color: rgba(255,255,255,0.8);"><?php esc_html_e('Unique visitors', '1001web-maintenance-launch-pages'); ?></div>
    22272227                                    </div>
    … …  
    22302230                                <?php if ($stats_start): ?>
    22312231                                <p style="margin-top: 15px; color: #666; font-size: 13px; text-align: center;">
    2232                                     📅 <?php esc_html_e('Since', '1001web-maintenance-launch-pages'); ?> <?php echo esc_html( date_i18n('F j, Y H:i', strtotime($stats_start)) ); ?>
     2232                                    📅 <?php esc_html_e('Since', '1001web-maintenance-launch-pages'); ?> <?php
     2233                                    // v2.9.181 — format de date du site ; date locale lue dans le fuseau du site.
     2234                                    $mgenius_stats_ts = MGENIUS_Settings::local_to_timestamp($stats_start);
     2235                                    echo esc_html( $mgenius_stats_ts ? wp_date( get_option('date_format') . ' ' . get_option('time_format'), $mgenius_stats_ts ) : $stats_start );
     2236                                    ?>
    22332237                                </p>
    22342238                                <?php endif; ?>
    … …  
    26702674                            </div>
    26712675
     2676                            <?php if (class_exists('MGENIUS_Diagnostic') && MGENIUS_Diagnostic::results_in_other_language($mgenius_diag_results)) : ?>
     2677                            <p class="mg-diag-lang-note" id="mg-diag-lang-note">ℹ️ <?php esc_html_e('These results come from an analysis run in another language. Click Run analysis to see them in your language.', '1001web-maintenance-launch-pages'); ?></p>
     2678                            <?php endif; ?>
    26722679                            <div class="mg-diag-results" id="mg-diag-results">
    26732680                                <?php
    … …  
    30053012                                            <span><?php esc_html_e('1001Web&trade; Website', '1001web-maintenance-launch-pages'); ?></span>
    30063013                                        </a>
     3014                                        <button type="button" class="mg-help-link" id="mg-wizard-relaunch">
     3015                                            <span class="mg-help-icon">🧭</span>
     3016                                            <span><?php esc_html_e('Open the setup wizard again', '1001web-maintenance-launch-pages'); ?></span>
     3017                                        </button>
    30073018                                    </div>
    30083019                                </div>
  • 1001web-maintenance-launch-pages/tags/2.9.181/templates/health-card.php

    r3759890 r3761969  
    4545        }
    4646        ?></p>
     47        <?php
     48        // v2.9.181 — message enregistré dans une autre langue (avant la 2.9.181 : présumé anglais).
     49        $mgenius_hc_locale = ! empty( $mgenius_hc_result['locale'] ) ? (string) $mgenius_hc_result['locale'] : '';
     50        $mgenius_hc_other  = $mgenius_hc_status && ( '' !== $mgenius_hc_locale ? $mgenius_hc_locale !== get_user_locale() : 0 !== strpos( get_user_locale(), 'en' ) );
     51        if ( $mgenius_hc_other ) :
     52                ?>
     53        <p class="mg-health-card-lang" id="mg-health-card-lang">ℹ️ <?php esc_html_e( 'This result was recorded in another language. Check again to see it in your language.', '1001web-maintenance-launch-pages' ); ?></p>
     54        <?php endif; ?>
    4755        <ul class="mg-health-card-list" id="mg-health-card-list">
    4856                <?php
  • 1001web-maintenance-launch-pages/trunk/1001web-maintenance-launch-pages.php

    r3759890 r3761969  
    44 * Plugin URI: https://maintenancegenius.ca
    55 * Description: Maintenance and coming soon pages for safe updates: suspends cache plugins, checks the 503 visitors get, flags pages that broke.
    6  * Version: 2.9.180
     6 * Version: 2.9.181
    77 * Author: 1001Web.ca
    88 * Author URI: https://www.1001web.ca
    … …  
    3939// CONSTANTES
    4040// ============================================
    41 define('MGENIUS_VERSION', '2.9.180');
     41define('MGENIUS_VERSION', '2.9.181');
    4242define('MGENIUS_PLUGIN_DIR', plugin_dir_path(__FILE__));
    4343define('MGENIUS_PLUGIN_URL', plugin_dir_url(__FILE__));
  • 1001web-maintenance-launch-pages/trunk/assets/css/admin.css

    r3759890 r3761969  
    17831783    font-weight: 500;
    17841784    transition: all 0.3s ease;
     1785}
     1786
     1787/* v2.9.181 — bouton « Rouvrir l'assistant » au même aspect que les liens */
     1788button.mg-help-link {
     1789    border: 0;
     1790    font: inherit;
     1791    font-weight: 500;
     1792    cursor: pointer;
    17851793}
    17861794
    … …  
    25412549    font-size: 13px;
    25422550    color: #6b4e00;
     2551}
     2552
     2553/* v2.9.181 — résultat enregistré dans une autre langue */
     2554.mg-diag-lang-note {
     2555    margin: 12px 0 0;
     2556    padding: 8px 10px;
     2557    background: #eef4ff;
     2558    border-radius: 4px;
     2559    font-size: 13px;
     2560    color: #1d3a7a;
    25432561}
    25442562
    … …  
    29232941.mg-health-card-date{font-size:12px;color:#6b7280}
    29242942.mg-health-card-verdict{margin:8px 0 0;font-size:13px;line-height:1.5;color:#374151}
     2943.mg-health-card-lang{margin:6px 0 0;font-size:12px;color:#1d3a7a}
    29252944.mg-health-card-list{margin:8px 0 0;padding:0;list-style:none}
    29262945.mg-health-card-list li{display:flex;gap:10px;flex-wrap:wrap;padding:4px 0;border-top:1px solid #f1f5f9;font-size:12px}
  • 1001web-maintenance-launch-pages/trunk/assets/js/admin.js

    r3759890 r3761969  
    312312        var i18n = mgeniusAdmin.i18n || {};
    313313        $card.attr('class', 'mg-health-card is-' + health.status);
     314        $('#mg-health-card-lang').remove(); // v2.9.181 — résultat neuf, dans la langue de l'utilisateur
    314315        $('#mg-health-card-date').text(i18n.hc_just_now || '');
    315316        var $v = $('#mg-health-card-verdict').empty();
    … …  
    28402841    });
    28412842
     2843    // v2.9.181 — rouvrir l'assistant de configuration (rien n'est modifié avant sa dernière étape).
     2844    $(document).on('click', '#mg-wizard-relaunch', function() {
     2845        if (!window.mgConfirmGate(this, mgeniusAdmin.i18n.wizard_relaunch_confirm)) {
     2846            return;
     2847        }
     2848        var $btn = $(this).prop('disabled', true);
     2849        $.post(mgeniusAdmin.ajaxurl, { action: 'mgenius_wizard_reset', nonce: mgeniusAdmin.nonce })
     2850            .done(function(response) {
     2851                if (response && response.success) {
     2852                    window.location.reload();
     2853                } else {
     2854                    showNotice((response && response.data && response.data.message) || mgeniusAdmin.i18n.error_generic, 'error');
     2855                    $btn.prop('disabled', false);
     2856                }
     2857            })
     2858            .fail(function() {
     2859                showNotice(mgeniusAdmin.i18n.connection_error, 'error');
     2860                $btn.prop('disabled', false);
     2861            });
     2862    });
     2863
    28422864    $(document).on('click', '#mg-reset-stats', function() {
    28432865        if (!window.mgConfirmGate(this, mgeniusAdmin.i18n.confirm_reset_stats)) {
    … …  
    33593381            }
    33603382            var results = response.data.results;
     3383            $('#mg-diag-lang-note').remove(); // v2.9.181 — résultat neuf, dans la langue de l'utilisateur
    33613384            var $container = $('#mg-diag-results').empty();
    33623385            $.each(results.checks, function(id, check) {
  • 1001web-maintenance-launch-pages/trunk/includes/class-admin.php

    r3759890 r3761969  
    471471                'cancel'                 => __('Cancel', '1001web-maintenance-launch-pages'),
    472472                'confirm_ok'             => __('Continue', '1001web-maintenance-launch-pages'),
     473                'wizard_relaunch_confirm' => __('Open the setup wizard again? Nothing changes until its last step: "Launch maintenance!" and "Save without activating" replace your title, message and style. "Skip wizard" changes nothing.', '1001web-maintenance-launch-pages'),
    473474                'confirm_enable'         => __('Turn on maintenance mode? Your visitors will no longer see your normal site until you turn it off.', '1001web-maintenance-launch-pages'),
    474475                'expert_badge'           => __('Expert setting', '1001web-maintenance-launch-pages'),
  • 1001web-maintenance-launch-pages/trunk/includes/class-ajax.php

    r3759890 r3761969  
    5858
    5959        add_action('wp_ajax_mgenius_wizard_save', [__CLASS__, 'wizard_save']);
     60        add_action('wp_ajax_mgenius_wizard_reset', [__CLASS__, 'wizard_reset']);
    6061        add_action('wp_ajax_mgenius_health_recheck', [__CLASS__, 'health_recheck']);
    6162
    … …  
    21272128    }
    21282129
     2130    /**
     2131     * v2.9.181 — Rouvre l'assistant au prochain chargement de la page.
     2132     * Ne touche à aucun réglage : seul l'assistant terminé (« Launch » ou
     2133     * « Save without activating ») enregistre ses choix.
     2134     */
     2135    public static function wizard_reset() {
     2136        check_ajax_referer('mgenius_nonce', 'nonce');
     2137
     2138        if (!current_user_can('manage_options')) {
     2139            wp_send_json_error(['message' => __('Permission denied', '1001web-maintenance-launch-pages')]);
     2140        }
     2141
     2142        delete_option('mgenius_wizard_completed');
     2143        wp_send_json_success();
     2144    }
     2145
    21292146    // WIZARD — Configuration initiale
    21302147    public static function wizard_save() {
  • 1001web-maintenance-launch-pages/trunk/includes/class-diagnostic.php

    r3759890 r3761969  
    6464
    6565    /**
     66     * v2.9.181 — Le résultat enregistré a-t-il été rédigé dans une autre langue
     67     * que celle de l'utilisateur ? Avant la 2.9.181, la langue n'était pas
     68     * enregistrée : un résultat sans langue est présumé anglais.
     69     *
     70     * @param array|null $results
     71     * @return bool
     72     */
     73    public static function results_in_other_language($results) {
     74        if (!is_array($results)) {
     75            return false;
     76        }
     77        $current = (string) get_user_locale();
     78        if (!empty($results['locale'])) {
     79            return (string) $results['locale'] !== $current;
     80        }
     81        return 0 !== strpos($current, 'en');
     82    }
     83
     84    /**
    6685     * Statut d'un check individuel depuis le dernier scan.
    6786     * @param string $check_id
    … …  
    168187        $results = [
    169188            'timestamp' => time(),
     189            // v2.9.181 — langue des textes enregistrés : un résultat lu dans
     190            // une autre langue est signalé au lieu d'être affiché tel quel.
     191            'locale'    => get_user_locale(),
    170192            'checks'    => $checks,
    171193            'fails'     => $fails,
    … …  
    563585    private static function check_cron() {
    564586        if (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON) {
    565             // Cron système possible — on ne peut pas le prouver d'ici : warn informatif.
     587            // v2.9.181 — preuve par la file d'attente : si aucune tâche n'est
     588            // en retard de plus de 30 minutes, une tâche cron du serveur appelle
     589            // wp-cron.php. Sinon, avertissement (rien ne prouve qu'elle existe).
     590            $mgenius_queue = _get_cron_array();
     591            if (is_array($mgenius_queue) && !empty($mgenius_queue)) {
     592                $mgenius_oldest = (int) min(array_keys($mgenius_queue));
     593                if ($mgenius_oldest >= time() - 30 * MINUTE_IN_SECONDS) {
     594                    return self::result('ok',
     595                        __('Scheduled tasks run through a server cron job', '1001web-maintenance-launch-pages'),
     596                        __('WP-Cron is disabled in wp-config.php, and no scheduled task is more than 30 minutes late: a cron job on your server runs them.', '1001web-maintenance-launch-pages'),
     597                        '',
     598                        __('DISABLE_WP_CRON is true and the task queue is up to date.', '1001web-maintenance-launch-pages')
     599                    );
     600                }
     601            }
    566602            return self::result('warn',
    567603                __('WP-Cron is disabled in wp-config.php', '1001web-maintenance-launch-pages'),
    568                 __('Scheduled tasks rely on a server-side cron job. If none is configured, the background page comparison after a scheduled or countdown end will not run.', '1001web-maintenance-launch-pages'),
     604                __('Some scheduled tasks are more than 30 minutes late, so no server cron job seems to call wp-cron.php. Without one, the background page comparison after a scheduled or countdown end will not run.', '1001web-maintenance-launch-pages'),
    569605                __('Confirm a real cron job calls wp-cron.php every few minutes, or remove DISABLE_WP_CRON.', '1001web-maintenance-launch-pages'),
    570606                __('DISABLE_WP_CRON is true — WordPress will not trigger cron on page loads.', '1001web-maintenance-launch-pages')
  • 1001web-maintenance-launch-pages/trunk/includes/class-frontend.php

    r3759890 r3761969  
    5858        $mgenius_mode = isset( $this->settings['page_mode'] ) ? $this->settings['page_mode'] : 'maintenance';
    5959        $mgenius_title = isset( $this->settings['title'] ) ? (string) $this->settings['title'] : '';
    60         if ( '' === $mgenius_title || in_array( $mgenius_title, array( MGENIUS_Settings::default_title_for( 'maintenance' ), MGENIUS_Settings::default_title_for( 'coming_soon' ) ), true ) ) {
     60        $mgenius_en = MGENIUS_Settings::untouched_english_defaults();
     61        if ( '' === $mgenius_title || in_array( $mgenius_title, array( MGENIUS_Settings::default_title_for( 'maintenance' ), MGENIUS_Settings::default_title_for( 'coming_soon' ) ), true ) || in_array( trim( $mgenius_title ), $mgenius_en['title'], true ) ) {
    6162            $this->settings['title'] = MGENIUS_Settings::default_title_for( $mgenius_mode );
     63        }
     64        // v2.9.181 — message par défaut anglais jamais modifié : texte traduit.
     65        $mgenius_msg = isset( $this->settings['message'] ) ? trim( wp_strip_all_tags( (string) $this->settings['message'] ) ) : '';
     66        if ( in_array( $mgenius_msg, $mgenius_en['message'], true ) ) {
     67            $this->settings['message'] = __( 'We are updating our website. We will be back very soon.', '1001web-maintenance-launch-pages' );
    6268        }
    6369    }
  • 1001web-maintenance-launch-pages/trunk/includes/class-healthcheck.php

    r3759890 r3761969  
    683683        global $wpdb;
    684684
     685        // v2.9.181 — langue des messages enregistrés (voir health-card.php).
     686        if (self::RESULT_OPTION === $key && is_array($value) && !empty($value)) {
     687            $value['locale'] = get_user_locale();
     688        }
     689
    685690        $serialized = maybe_serialize($value);
    686691
  • 1001web-maintenance-launch-pages/trunk/includes/class-settings.php

    r3759890 r3761969  
    4545        /* translators: %s: site name */
    4646        return sprintf( __( '%s is coming soon', '1001web-maintenance-launch-pages' ), $name );
     47    }
     48
     49    /**
     50     * v2.9.181 — Titres et messages par défaut ENGLISH, jamais modifiés.
     51     * Enregistrés avant que la traduction du site soit installée (ou par les
     52     * versions antérieures), ils restaient en anglais sur un site français.
     53     * La page visiteur les remplace par le texte par défaut traduit ; un
     54     * texte écrit par l'administrateur n'est jamais touché.
     55     *
     56     * @return array{title:string[], message:string[]}
     57     */
     58    public static function untouched_english_defaults() {
     59        $name = trim( wp_specialchars_decode( (string) get_bloginfo( 'name' ), ENT_QUOTES ) );
     60        return array(
     61            'title'   => array(
     62                'Site Under Maintenance',
     63                'Coming soon',
     64                $name . ' will be back shortly',
     65                $name . ' is coming soon',
     66            ),
     67            'message' => array(
     68                'We are currently performing maintenance. We will be back soon.',
     69                'We are updating our website. We will be back very soon.',
     70            ),
     71        );
    4772    }
    4873
  • 1001web-maintenance-launch-pages/trunk/readme.txt

    r3759890 r3761969  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 2.9.180
     7Stable tag: 2.9.181
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    170170
    171171**7. 1001Web support** (optional, only when you send a support request)
    172 - How: an email is sent to assistance@1001web.ca with your own site's mail configuration. No HTTP request is made to a 1001Web server. The screen also links to client.1001web.ca, our support desk; that is a plain link.
     172- How: an email is sent to the 1001Web support team with your own site's mail configuration. No HTTP request is made to a 1001Web server. The screen also links to client.1001web.ca, our support desk; that is a plain link.
    173173- When: only when you fill in the Request assistance form, confirm your consent and click send.
    174174- Data sent: your message, the email address you enter, and a technical report (site address, WordPress, PHP and MySQL versions, server software and limits, language and time zone, theme, active and must-use plugins, detected cache plugins, plugin settings state, diagnostic results). The report can be read in full before sending.
    … …  
    207207== Changelog ==
    208208
     209= 2.9.181 =
     210* Support tab, Useful Links: a new button opens the setup wizard again. Nothing changes until its last step, and "Skip wizard" changes nothing.
     211* Diagnostic and "Last update check": a result saved in another language is now flagged, with a prompt to run the check again, instead of being shown as is.
     212* Visitor page: a title or message still equal to an English default (never edited) now shows the default text in the site language.
     213* Diagnostic: with WP-Cron disabled, the check now looks at the task queue. If no task is more than 30 minutes late, it confirms that a server cron job runs them, instead of always warning.
     214* Visitor statistics: the numbers no longer overlap their labels, and the "Since" date follows the site date format.
     215* Readme: the support request section no longer shows an internal email address.
     216
    209217= 2.9.180 =
    210218* In Coming Soon mode (and in maintenance without the 503 option), robots.txt now returns a plain "Disallow: /" file and XML sitemaps return 404, instead of the HTML page with a 200 that crawlers read as an invalid file. The 503 maintenance page is unchanged.
  • 1001web-maintenance-launch-pages/trunk/templates/admin-page.php

    r3759890 r3761969  
    22192219                                <div style="display: flex; gap: 20px; flex-wrap: wrap;">
    22202220                                    <div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 12px; padding: 20px 30px; text-align: center; flex: 1; min-width: 150px;">
    2221                                         <div style="font-size: 36px; font-weight: bold; color: #fff;" id="mg-stats-visits-count"><?php echo esc_html(number_format_i18n($stats_visits)); ?></div>
     2221                                        <div style="font-size: 36px; line-height: 1.2; margin-bottom: 4px; font-weight: bold; color: #fff;" id="mg-stats-visits-count"><?php echo esc_html(number_format_i18n($stats_visits)); ?></div>
    22222222                                        <div style="font-size: 14px; color: rgba(255,255,255,0.8);"><?php esc_html_e('Total visits', '1001web-maintenance-launch-pages'); ?></div>
    22232223                                    </div>
    22242224                                    <div style="background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); border-radius: 12px; padding: 20px 30px; text-align: center; flex: 1; min-width: 150px;">
    2225                                         <div style="font-size: 36px; font-weight: bold; color: #fff;" id="mg-stats-unique-count"><?php echo esc_html(number_format_i18n($stats_unique)); ?></div>
     2225                                        <div style="font-size: 36px; line-height: 1.2; margin-bottom: 4px; font-weight: bold; color: #fff;" id="mg-stats-unique-count"><?php echo esc_html(number_format_i18n($stats_unique)); ?></div>
    22262226                                        <div style="font-size: 14px; color: rgba(255,255,255,0.8);"><?php esc_html_e('Unique visitors', '1001web-maintenance-launch-pages'); ?></div>
    22272227                                    </div>
    … …  
    22302230                                <?php if ($stats_start): ?>
    22312231                                <p style="margin-top: 15px; color: #666; font-size: 13px; text-align: center;">
    2232                                     📅 <?php esc_html_e('Since', '1001web-maintenance-launch-pages'); ?> <?php echo esc_html( date_i18n('F j, Y H:i', strtotime($stats_start)) ); ?>
     2232                                    📅 <?php esc_html_e('Since', '1001web-maintenance-launch-pages'); ?> <?php
     2233                                    // v2.9.181 — format de date du site ; date locale lue dans le fuseau du site.
     2234                                    $mgenius_stats_ts = MGENIUS_Settings::local_to_timestamp($stats_start);
     2235                                    echo esc_html( $mgenius_stats_ts ? wp_date( get_option('date_format') . ' ' . get_option('time_format'), $mgenius_stats_ts ) : $stats_start );
     2236                                    ?>
    22332237                                </p>
    22342238                                <?php endif; ?>
    … …  
    26702674                            </div>
    26712675
     2676                            <?php if (class_exists('MGENIUS_Diagnostic') && MGENIUS_Diagnostic::results_in_other_language($mgenius_diag_results)) : ?>
     2677                            <p class="mg-diag-lang-note" id="mg-diag-lang-note">ℹ️ <?php esc_html_e('These results come from an analysis run in another language. Click Run analysis to see them in your language.', '1001web-maintenance-launch-pages'); ?></p>
     2678                            <?php endif; ?>
    26722679                            <div class="mg-diag-results" id="mg-diag-results">
    26732680                                <?php
    … …  
    30053012                                            <span><?php esc_html_e('1001Web&trade; Website', '1001web-maintenance-launch-pages'); ?></span>
    30063013                                        </a>
     3014                                        <button type="button" class="mg-help-link" id="mg-wizard-relaunch">
     3015                                            <span class="mg-help-icon">🧭</span>
     3016                                            <span><?php esc_html_e('Open the setup wizard again', '1001web-maintenance-launch-pages'); ?></span>
     3017                                        </button>
    30073018                                    </div>
    30083019                                </div>
  • 1001web-maintenance-launch-pages/trunk/templates/health-card.php

    r3759890 r3761969  
    4545        }
    4646        ?></p>
     47        <?php
     48        // v2.9.181 — message enregistré dans une autre langue (avant la 2.9.181 : présumé anglais).
     49        $mgenius_hc_locale = ! empty( $mgenius_hc_result['locale'] ) ? (string) $mgenius_hc_result['locale'] : '';
     50        $mgenius_hc_other  = $mgenius_hc_status && ( '' !== $mgenius_hc_locale ? $mgenius_hc_locale !== get_user_locale() : 0 !== strpos( get_user_locale(), 'en' ) );
     51        if ( $mgenius_hc_other ) :
     52                ?>
     53        <p class="mg-health-card-lang" id="mg-health-card-lang">ℹ️ <?php esc_html_e( 'This result was recorded in another language. Check again to see it in your language.', '1001web-maintenance-launch-pages' ); ?></p>
     54        <?php endif; ?>
    4755        <ul class="mg-health-card-list" id="mg-health-card-list">
    4856                <?php
Note: See TracChangeset for help on using the changeset viewer.