Plugin Directory

Changeset 3815997


Ignore:
Timestamp:
11/22/2026 12:58:09 AM (less than one hour ago)
Author:
accessnow
Message:

AccessNow Site Replica 1.2.0

Location:
accessnow-site-replica
Files:
6 added
33 edited
1 copied

Legend:

Unmodified
Added
Removed
  • accessnow-site-replica/tags/1.2.0/accessnow-site-replica.php

    r3736115 r3815997  
    44 * Plugin URI:        https://accessnow.com.au/projects/site-replica/
    55 * Description:       Back up, clone and restore large WordPress sites in small, resumable steps, even on shared hosting with little free disk. Pull a live site to another install, clone it with rollback, and schedule backups to Google Drive or S3-compatible storage.
    6  * Version:           1.1.0
     6 * Version:           1.2.0
    77 * Requires at least: 6.4
    88 * Requires PHP:      7.4
    … …  
    2929}
    3030
    31 define( 'ACCESSNOW_REPLICA_VERSION', '1.1.0' );
     31define( 'ACCESSNOW_REPLICA_VERSION', '1.2.0' );
    3232define( 'ACCESSNOW_REPLICA_PROTOCOL', 1 );
    3333define( 'ACCESSNOW_REPLICA_FILE', __FILE__ );
  • accessnow-site-replica/tags/1.2.0/assets/js/admin.js

    r3726810 r3815997  
    262262                        if (a.removed && a.removed.length) {
    263263                                box.appendChild(el('p', {}, i18n.planRemoved + ' ' + a.removed.join(', ')));
     264                        }
     265                        if (a.replaced && a.replaced.count) {
     266                                var replacedBox = box.appendChild(el('div', { 'class': 'srp-replaced' }));
     267                                replacedBox.appendChild(el('p', {}, i18n.planReplaced));
     268                                var replacedList = replacedBox.appendChild(el('ul', { 'class': 'srp-pairs' }));
     269                                a.replaced.list.forEach(function (f) { replacedList.appendChild(el('li', { 'data-part': f.part }, f.path)); });
     270                                if (a.replaced.count > a.replaced.list.length) {
     271                                        replacedBox.appendChild(el('p', { 'class': 'srp-muted' }, i18n.planMore.replace('%s', Number(a.replaced.count - a.replaced.list.length).toLocaleString())));
     272                                }
    264273                        }
    265274                        box.appendChild(el('p', { 'class': 'description' }, i18n.planKept));
  • accessnow-site-replica/tags/1.2.0/includes/admin/class-admin.php

    r3726810 r3815997  
    119119                                        'planMoved'     => __( 'Tables that exist only on this site and will be removed (kept until you choose Keep):', 'accessnow-site-replica' ),
    120120                                        'planRemoved'   => __( 'Plugins that exist only on this site and will be removed (Roll back returns them):', 'accessnow-site-replica' ),
     121                                        'planReplaced'  => __( 'Files in plugin, theme and must-use plugin folders that the backup also has, which only this site has. Each of those folders is replaced whole, the way an update replaces it, so these will be removed (Roll back returns them):', 'accessnow-site-replica' ),
     122                                        /* translators: %s: number of files not listed. */
     123                                        'planMore'      => __( '…and %s more.', 'accessnow-site-replica' ),
    121124                                        'planKept'      => __( 'Media and must-use plugins that exist only on this site are kept.', 'accessnow-site-replica' ),
    122125                                        'optKeepLogin'  => __( 'Keep me logged in (carry my account over)', 'accessnow-site-replica' ),
    … …  
    172175                                                'clone'    => __( 'Clone into this site', 'accessnow-site-replica' ),
    173176                                                'restore'  => __( 'Restore', 'accessnow-site-replica' ),
     177                                                'check'    => __( 'Check backup', 'accessnow-site-replica' ),
    174178                                                'backup'   => __( 'Back up this site', 'accessnow-site-replica' ),
    175179                                                'cloud'    => __( 'Cloud backup', 'accessnow-site-replica' ),
    … …  
    444448                                                        <?php if ( $complete ) : ?>
    445449                                                                <span class="srp-pill is-on"><?php esc_html_e( 'Complete', 'accessnow-site-replica' ); ?></span>
     450                                                                <?php $checked = \AccessNow\Replica\Jobs\Steps\Check::result( (string) $m['set_id'] ); ?>
     451                                                                <?php if ( $checked && 0 === (int) $checked['bad'] ) : ?>
     452                                                                        <br><span class="srp-muted">
     453                                                                        <?php
     454                                                                        /* translators: %s: date. */
     455                                                                        echo esc_html( sprintf( __( 'Checked %s: intact', 'accessnow-site-replica' ), wp_date( get_option( 'date_format' ), (int) $checked['time'] ) ) );
     456                                                                        ?>
     457                                                                        </span>
     458                                                                <?php elseif ( $checked ) : ?>
     459                                                                        <br><span class="srp-pill is-warn">
     460                                                                        <?php
     461                                                                        /* translators: %s: date. */
     462                                                                        echo esc_html( sprintf( __( 'Damaged (checked %s)', 'accessnow-site-replica' ), wp_date( get_option( 'date_format' ), (int) $checked['time'] ) ) );
     463                                                                        ?>
     464                                                                        </span>
     465                                                                <?php endif; ?>
    446466                                                                <?php if ( ! empty( $m['warnings'] ) ) : ?>
    447467                                                                        <br><span class="srp-muted">
    … …  
    459479                                                        <?php if ( $complete ) : ?>
    460480                                                                <button type="button" class="button" data-srp-start="restore" data-set="<?php echo esc_attr( $m['set_id'] ); ?>" <?php disabled( (bool) $active ); ?>><?php esc_html_e( 'Restore to this site', 'accessnow-site-replica' ); ?></button>
     481                                                                <button type="button" class="button" data-srp-start="check" data-set="<?php echo esc_attr( $m['set_id'] ); ?>" <?php disabled( (bool) $active ); ?> title="<?php esc_attr_e( 'Read the whole backup back and compare every part with what was backed up, to find damage before you need it.', 'accessnow-site-replica' ); ?>"><?php esc_html_e( 'Check', 'accessnow-site-replica' ); ?></button>
    461482                                                        <?php endif; ?>
    462483                                                        <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" class="srp-inline" onsubmit="return confirm('<?php echo esc_js( __( 'Delete this backup permanently?', 'accessnow-site-replica' ) ); ?>');">
    … …  
    657678                                <tr><th scope="row"><label for="srp-excl"><?php esc_html_e( 'Also exclude (on this site as a source)', 'accessnow-site-replica' ); ?></label></th>
    658679                                        <td><textarea id="srp-excl" name="extra_excludes" rows="4" class="large-text code" placeholder="uploads/big-archive&#10;uploads/*.zip"><?php echo esc_textarea( (string) $s['extra_excludes'] ); ?></textarea>
    659                                         <p class="description"><?php esc_html_e( 'One pattern per line, relative to wp-content. Caches, other backup plugins’ folders, .git and node_modules are always excluded.', 'accessnow-site-replica' ); ?></p></td></tr>
     680                                        <p class="description"><?php esc_html_e( 'One pattern per line, relative to wp-content. Start a line with **/ to leave out a name wherever it is, for example **/*.log. Caches, other backup plugins’ folders, .git and node_modules are always excluded.', 'accessnow-site-replica' ); ?></p></td></tr>
     681                                <tr><th scope="row"><?php esc_html_e( 'Developer files', 'accessnow-site-replica' ); ?></th>
     682                                        <td><label><input type="checkbox" name="leave_dev_files" value="1" <?php checked( ! empty( $s['leave_dev_files'] ) ); ?>> <?php esc_html_e( 'Leave developer files out of themes and plugins developed on this site', 'accessnow-site-replica' ); ?></label>
     683                                        <p class="description"><?php esc_html_e( 'For a theme or plugin that is a git working copy (it has a .git folder): its docs, tests, bin, scripts, composer and package files, notes (*.md, CLAUDE.md) and, when composer.json asks only for development packages, vendor. Themes and plugins installed from a ZIP are never touched. Files already sent to another site stay there until you remove them.', 'accessnow-site-replica' ); ?></p></td></tr>
    660684                                <tr><th scope="row"><?php esc_html_e( 'Transients', 'accessnow-site-replica' ); ?></th>
    661685                                        <td><label><input type="checkbox" name="include_transients" value="1" <?php checked( ! empty( $s['include_transients'] ) ); ?>> <?php esc_html_e( 'Include cached transients in the database export (usually not needed)', 'accessnow-site-replica' ); ?></label></td></tr>
    … …  
    681705                        'clone'    => __( 'Clone into this site', 'accessnow-site-replica' ),
    682706                        'restore'  => __( 'Restore', 'accessnow-site-replica' ),
     707                        'check'    => __( 'Check backup', 'accessnow-site-replica' ),
    683708                        'backup'   => __( 'Back up this site', 'accessnow-site-replica' ),
    684709                        'cloud'    => __( 'Cloud backup', 'accessnow-site-replica' ),
  • accessnow-site-replica/tags/1.2.0/includes/class-settings.php

    r3726758 r3815997  
    3232                        'extra_excludes'  => '',       // One pattern per line, relative to wp-content.
    3333                        'include_transients' => false,
     34                        'leave_dev_files' => false,    // Leave notes, scripts and tests out of themes and plugins developed in place (a .git folder).
    3435                        'keep_sets'       => 5,        // Pull sets kept per source (0 = keep all).
    3536                );
    … …  
    7374                        'extra_excludes'     => isset( $input['extra_excludes'] ) ? sanitize_textarea_field( (string) $input['extra_excludes'] ) : $current['extra_excludes'],
    7475                        'include_transients' => ! empty( $input['include_transients'] ),
     76                        'leave_dev_files'    => ! empty( $input['leave_dev_files'] ),
    7577                        'keep_sets'          => isset( $input['keep_sets'] ) ? max( 0, min( 100, (int) $input['keep_sets'] ) ) : $current['keep_sets'],
    7678                );
  • accessnow-site-replica/tags/1.2.0/includes/client/class-remote-site.php

    r3726758 r3815997  
    392392                                if ( 'X' === $frame[0] ) {
    393393                                        $error = json_decode( $frame[1], true );
     394                                        $code  = is_array( $error ) ? (string) ( $error['code'] ?? '' ) : '';
     395                                        if ( in_array( $code, array( 'resend_piece', 'resend_file' ), true ) ) {
     396                                                // Data that failed a checksum on the other site: a temporary failure, sent again.
     397                                                throw new Remote_Exception( $code, sprintf( /* translators: %s: error. */ __( 'Part of the backup arrived damaged on the other site and will be sent again: %s', 'accessnow-site-replica' ), (string) $error['error'] ), true, 3 );
     398                                        }
    394399                                        throw new Remote_Exception( 'remote_error', sprintf( /* translators: %s: error. */ __( 'The source site reported an error: %s', 'accessnow-site-replica' ), is_array( $error ) ? (string) $error['error'] : 'unknown' ) );
    395400                                }
  • accessnow-site-replica/tags/1.2.0/includes/files/class-exclusions.php

    r3736115 r3815997  
    7171
    7272        /**
     73         * Developer files at the top of a theme or plugin folder (fnmatch on the name): notes, scripts,
     74         * tests and tooling that a live site never needs and that would be readable there.
     75         */
     76        const DEV_TOP = array( 'docs', 'tests', 'test', 'bin', '.github', '*.md', 'composer.json', 'composer.lock', 'package.json', 'package-lock.json', 'phpcs.xml*', 'phpunit.xml*', '.phpcs.xml*', '.editorconfig', '.gitignore', '.distignore' );
     77
     78        /**
     79         * Names that show a theme or plugin folder is being developed (not just installed), used to warn.
     80         */
     81        const DEV_MARKERS = array( 'CLAUDE.md', '.github', 'phpcs.xml', 'phpcs.xml.dist', 'phpunit.xml', 'phpunit.xml.dist', 'tests' );
     82
     83        /**
     84         * Whether to leave developer files out of theme and plugin folders that are git working copies.
     85         *
     86         * @var bool
     87         */
     88        private $dev_files = false;
     89
     90        /**
     91         * Per theme/plugin folder: array( has .git, leave vendor out ).
     92         *
     93         * @var array<string, array{0: bool, 1: bool}>
     94         */
     95        private $units = array();
     96
     97        /**
     98         * Name patterns excluded at any depth (extra exclusion lines that start with **\/).
     99         *
     100         * @var string[]
     101         */
     102        private $name_patterns = array();
     103
     104        /**
    73105         * Patterns for one root.
    74106         *
    … …  
    101133                if ( 'content' === $root_key ) {
    102134                        $this->patterns = self::CONTENT_PATTERNS;
     135                        $this->dev_files = (bool) Settings::get( 'leave_dev_files' );
    103136                        foreach ( preg_split( '/\R/', (string) Settings::get( 'extra_excludes' ) ) as $line ) {
    104                                 $line = trim( trim( $line ), '/' );
     137                                $line = trim( $line );
     138                                if ( 0 === strpos( $line, '**/' ) && strlen( $line ) > 3 && false === strpos( substr( $line, 3 ), '/' ) ) {
     139                                        $this->name_patterns[] = substr( $line, 3 ); // A name, wherever it is.
     140                                        continue;
     141                                }
     142                                $line = trim( $line, '/' );
    105143                                if ( '' !== $line && false === strpos( $line, '..' ) ) {
    106144                                        $this->patterns[] = $line;
    … …  
    130168                        }
    131169                }
     170                foreach ( $this->name_patterns as $pattern ) {
     171                        if ( fnmatch( $pattern, $name ) ) {
     172                                return true;
     173                        }
     174                }
    132175                foreach ( $this->patterns as $pattern ) {
    133176                        if ( fnmatch( $pattern, $rel, FNM_PATHNAME ) ) {
    … …  
    135178                        }
    136179                }
     180                if ( $this->dev_files && $this->developer_file( $rel, $name ) ) {
     181                        return true;
     182                }
    137183                if ( '' !== $this->storage && $this->root . $rel === $this->storage ) {
    138184                        return true;
    … …  
    140186                return false;
    141187        }
     188
     189        /**
     190         * Whether a path is a developer file of a theme or plugin folder that is a git working copy.
     191         *
     192         * Only inside themes and plugins, and only in folders with a .git (developed in place): a theme
     193         * or plugin installed from a ZIP keeps everything it came with. CLAUDE.md goes at any depth;
     194         * the rest at the top of the folder. vendor/ goes only when composer.json asks for nothing but
     195         * development packages (its production code, if any, would be in require).
     196         *
     197         * @param string $rel  Path relative to wp-content.
     198         * @param string $name Base name.
     199         */
     200        private function developer_file( $rel, $name ) {
     201                if ( ! preg_match( '#^(themes|plugins)/([^/]+)/(.+)$#', $rel, $m ) ) {
     202                        return false;
     203                }
     204                $unit = $m[1] . '/' . $m[2];
     205                if ( ! isset( $this->units[ $unit ] ) ) {
     206                        $dir                   = $this->root . $unit;
     207                        $this->units[ $unit ] = array( file_exists( $dir . '/.git' ), self::composer_dev_only( $dir . '/composer.json' ) );
     208                }
     209                if ( ! $this->units[ $unit ][0] ) {
     210                        return false;
     211                }
     212                if ( 'CLAUDE.md' === $name ) {
     213                        return true;
     214                }
     215                $inner = $m[3];
     216                $top   = false === strpos( $inner, '/' ) ? $inner : strstr( $inner, '/', true );
     217                if ( 'vendor' === $top && $this->units[ $unit ][1] ) {
     218                        return true;
     219                }
     220                foreach ( self::DEV_TOP as $pattern ) {
     221                        if ( fnmatch( $pattern, $top ) ) {
     222                                return true;
     223                        }
     224                }
     225                return false;
     226        }
     227
     228        /**
     229         * Whether a composer.json has packages only under require-dev (nothing the site runs on).
     230         *
     231         * @param string $file Path.
     232         */
     233        private static function composer_dev_only( $file ) {
     234                if ( ! is_file( $file ) ) {
     235                        return false;
     236                }
     237                $json = json_decode( (string) file_get_contents( $file ), true ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
     238                if ( ! is_array( $json ) || empty( $json['require-dev'] ) ) {
     239                        return false;
     240                }
     241                foreach ( array_keys( (array) ( $json['require'] ?? array() ) ) as $package ) {
     242                        if ( 'php' !== $package && 0 !== strpos( (string) $package, 'ext-' ) ) {
     243                                return false;
     244                        }
     245                }
     246                return true;
     247        }
     248
     249        /**
     250         * Theme and plugin folders in a list of index paths that look developed in place, with their
     251         * developer files, to warn before they are sent. Names only: a backup does not hold .git.
     252         *
     253         * @param string[] $paths Paths relative to wp-content.
     254         * @return array<string, string[]> Folder => developer files (a few).
     255         */
     256        public static function developer_files_in( array $paths ) {
     257                $units   = array();
     258                $marked  = array();
     259                foreach ( $paths as $rel ) {
     260                        if ( ! preg_match( '#^(themes|plugins)/([^/]+)/([^/]+)(/|$)#', $rel, $m ) ) {
     261                                continue;
     262                        }
     263                        $unit = $m[1] . '/' . $m[2];
     264                        $top  = $m[3];
     265                        if ( in_array( $top, self::DEV_MARKERS, true ) ) {
     266                                $marked[ $unit ] = true;
     267                        }
     268                        foreach ( self::DEV_TOP as $pattern ) {
     269                                if ( fnmatch( $pattern, $top ) ) {
     270                                        $units[ $unit ][ $top ] = true;
     271                                        break;
     272                                }
     273                        }
     274                }
     275                $out = array();
     276                foreach ( $units as $unit => $names ) {
     277                        if ( isset( $marked[ $unit ] ) ) {
     278                                $out[ $unit ] = array_slice( array_keys( $names ), 0, 6 );
     279                        }
     280                }
     281                return $out;
     282        }
    142283}
  • accessnow-site-replica/tags/1.2.0/includes/jobs/class-ajax-driver.php

    r3726758 r3815997  
    9999                        list( $job, $token ) = Job_Store::create( 'restore', array(), array( 'set_id' => $set_id ) );
    100100                        Logger::activity( 'restore', 'Restore prepared from backup ' . $set_id, array( 'job' => $job->id() ) );
     101                } elseif ( 'check' === $type ) {
     102                        $set_id = isset( $_POST['set'] ) ? sanitize_text_field( wp_unslash( $_POST['set'] ) ) : '';
     103                        $m      = Set_Store::manifest( $set_id );
     104                        if ( ! $m || 'complete' !== ( $m['status'] ?? '' ) ) {
     105                                wp_send_json_error( array( 'message' => __( 'That backup is missing or incomplete.', 'accessnow-site-replica' ) ), 400 );
     106                        }
     107                        list( $job, $token ) = Job_Store::create( 'check', array(), array( 'set_id' => $set_id ) );
     108                        Logger::activity( 'pull', 'Check of backup ' . $set_id . ' started', array( 'job' => $job->id() ) );
    101109                } elseif ( 'cloud' === $type ) {
    102110                        if ( ! \AccessNow\Replica\Destinations\Destination::current()->ready() ) {
  • accessnow-site-replica/tags/1.2.0/includes/jobs/class-job-runner.php

    r3726810 r3815997  
    186186                } elseif ( 0 === strpos( $step, 'cl_' ) || 0 === strpos( $step, 'ci_' ) ) {
    187187                        $class = Steps\Cloud::class;
     188                } elseif ( 0 === strpos( $step, 'ck_' ) ) {
     189                        $class = Steps\Check::class;
    188190                } else {
    189191                        $class = Steps\Pull::class;
  • accessnow-site-replica/tags/1.2.0/includes/jobs/class-job-store.php

    r3726758 r3815997  
    3737                'import'  => self::IMPORT,
    3838                'restore' => self::RESTORE,
     39                'check'   => array( 'ck_backup' ),
    3940                'clone'   => array( 'preflight', 'db_schema', 'db_data', 'fs_scan', 'fs_transfer', 'verify', 'finalize', 'rs_preflight', 'rs_plan', 'rs_db_create', 'rs_db_import', 'rs_db_bigs', 'rs_db_verify', 'rs_db_fix', 'rs_files_stage', 'rs_swap', 'rs_post', 'rs_confirm', 'rs_cleanup' ),
    4041        );
  • accessnow-site-replica/tags/1.2.0/includes/jobs/steps/class-restore.php

    r3726758 r3815997  
    312312                                'moved'    => $live,
    313313                                'removed'  => Files::plugins_only_here( Set_Store::dir( (string) $job->get( 'set_id' ) ) ),
     314                                // Files this site has inside plugin, theme and must-use plugin folders the backup
     315                                // also has: each folder is replaced whole, as an update replaces it, so they go.
     316                                'replaced' => Files::removed_in_folders( Set_Store::dir( (string) $job->get( 'set_id' ) ) ),
    314317                                'local'    => $local,
    315318                                'opts'     => $job->get( 'restore_opts' ),
    … …  
    561564                        $db->query( 'DELETE FROM %i WHERE ' . $own_cond, $options, ...$own );
    562565                        $db->query( 'INSERT INTO %i (option_name, option_value, autoload) SELECT option_name, option_value, autoload FROM %i WHERE ' . $own_cond, $options, $wpdb->options, ...$own );
     566                        if ( self::keep_freemius_records( $db, $options, $wpdb->options ) ) {
     567                                $job->log( 'Kept this site\'s licence records for plugins sold through Freemius, so they stay activated here instead of asking whether this site is a copy.' );
     568                        }
    563569                        // Caches that must be rebuilt here.
    564570                        $db->query( "DELETE FROM %i WHERE option_name IN ('rewrite_rules') OR option_name LIKE %s OR option_name LIKE %s", $options, $wpdb->esc_like( '_transient_' ) . '%', $wpdb->esc_like( '_site_transient_' ) . '%' );
    … …  
    591597                        self::keep_login( $db, $users, $usermeta, $dst_px, (int) $job->s['user'], $job );
    592598                }
     599                return true;
     600        }
     601
     602        /**
     603         * Keeps this site's Freemius records (licences, installs, clone state) in place of the backup's.
     604         *
     605         * Plugins sold through Freemius keep their licence and install records in the options table.
     606         * Restored from another site, those records name the other site's address, so the SDK treats
     607         * this site as a copy and asks whether to duplicate, migrate or activate again (its "safe mode"),
     608         * which a routine staging-to-live send should never do. Only when this site already has records
     609         * of its own: a fresh site keeps the backup's, so the SDK can offer to duplicate the licence.
     610         *
     611         * @param Connection $db    Connection.
     612         * @param string     $temp  Restored options table, before the swap.
     613         * @param string     $live  This site's options table.
     614         * @return bool Whether this site's records were kept.
     615         */
     616        public static function keep_freemius_records( Connection $db, $temp, $live ) {
     617                global $wpdb;
     618                // The SDK's own option names (config.php, WP_FS___OPTION_PREFIX), in production and development mode.
     619                $exact = array();
     620                $like  = array();
     621                foreach ( array( 'fs_', 'fs_dbg_' ) as $p ) {
     622                        foreach ( array( 'accounts', 'api_cache', 'gdpr', 'options', 'clone_management' ) as $name ) {
     623                                $exact[] = $p . $name;
     624                        }
     625                        $like[] = $wpdb->esc_like( $p . 'cache_' ) . '%';
     626                }
     627                $exact[] = 'fs_active_plugins';
     628                $here    = (int) $db->value( "SELECT COUNT(*) FROM %i WHERE option_name IN ('fs_accounts', 'fs_dbg_accounts')", $live );
     629                if ( 0 === $here ) {
     630                        return false;
     631                }
     632                $cond = 'option_name IN (' . implode( ',', array_fill( 0, count( $exact ), '%s' ) ) . ') OR option_name LIKE %s OR option_name LIKE %s';
     633                $args = array_merge( $exact, $like );
     634                $db->query( 'DELETE FROM %i WHERE ' . $cond, $temp, ...$args );
     635                $db->query( 'INSERT INTO %i (option_name, option_value, autoload) SELECT option_name, option_value, autoload FROM %i WHERE ' . $cond, $temp, $live, ...$args );
    593636                return true;
    594637        }
  • accessnow-site-replica/tags/1.2.0/includes/restore/class-files.php

    r3726758 r3815997  
    1717namespace AccessNow\Replica\Restore;
    1818
     19use AccessNow\Replica\Sets\Damaged_File;
    1920use AccessNow\Replica\Sets\Set_Files;
    2021use AccessNow\Replica\Storage;
    … …  
    4748         */
    4849        const LEGACY_DIRS = array( 'site-replica' );
     50
     51        /**
     52         * Live files up to this size (and every script) are hashed before an unchanged one is reused.
     53         */
     54        const LINK_CHECK_BYTES = 1048576;
    4955
    5056        /**
    … …  
    169175                        @unlink( $target ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.unlink_unlink -- Our own earlier attempt.
    170176                }
    171                 // Unchanged live file: hardlink it instead of copying.
     177                // Unchanged live file: hardlink it instead of copying. Size and time alone can be kept by an
     178                // edit (malware often resets the time), so a script or a small file must also have the bytes
     179                // the backup recorded; large media go by size and time, so a restore doesn't read them all.
    172180                $live = self::dest_root( $row['r'] ) . '/' . $rel;
    173181                clearstatcache( true, $live );
    174                 if ( is_file( $live ) && ! is_link( $live ) && (int) filesize( $live ) === (int) $row['s'] && (int) filemtime( $live ) === (int) $row['m'] && @link( $live, $target ) ) { // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
     182                if ( is_file( $live ) && ! is_link( $live ) && (int) filesize( $live ) === (int) $row['s'] && (int) filemtime( $live ) === (int) $row['m']
     183                        && ( ( (int) $row['s'] > self::LINK_CHECK_BYTES && ! Set_Files::is_script( $row ) ) || Set_Files::matches( $live, $row ) )
     184                        && @link( $live, $target ) ) { // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
    175185                        return 'linked';
    176186                }
    … …  
    178188                try {
    179189                        $copied = Set_Files::copy_out( $set_dir, $row, $target );
     190                } catch ( Damaged_File $e ) {
     191                        // The backup itself is damaged: stop before the swap, with this site untouched.
     192                        throw new \RuntimeException( sprintf( 'The backup is damaged: %s Nothing on this site has been changed. Restore another backup, or make a new one.', $e->getMessage() ) );
    180193                } catch ( \RuntimeException $e ) {
    181194                        return 'skipped'; // A path or checksum that is not allowed.
    … …  
    349362
    350363        /**
     364         * The plugin, theme or must-use plugin folder a path is inside, relative to its root
     365         * (plugins/foo for the content root, foo for the plugins root), or null when it is not inside
     366         * one: a single-file plugin, a top-level must-use plugin, media, or this plugin itself.
     367         *
     368         * The restore replaces each such folder whole, the way a plugin update does, so a file this site
     369         * has inside a folder the backup also has, and the backup doesn't, is removed.
     370         *
     371         * @param string $root Root key.
     372         * @param string $rel  Path relative to the root.
     373         * @return string|null
     374         */
     375        public static function replaced_folder( $root, $rel ) {
     376                $parts = explode( '/', (string) $rel );
     377                if ( 'content' === $root ) {
     378                        if ( count( $parts ) < 3 || ! in_array( $parts[0], array( 'plugins', 'mu-plugins', 'themes' ), true ) || '' === $parts[1] ) {
     379                                return null;
     380                        }
     381                        $folder = $parts[0] . '/' . $parts[1];
     382                } elseif ( in_array( $root, array( 'plugins', 'mu-plugins', 'themes' ), true ) ) {
     383                        if ( count( $parts ) < 2 || '' === $parts[0] ) {
     384                                return null;
     385                        }
     386                        $folder = $parts[0];
     387                } else {
     388                        return null;
     389                }
     390                return null === self::unit( $root, $folder ) ? null : $folder;
     391        }
     392
     393        /**
     394         * Files and folders this site has inside the plugin, theme and must-use plugin folders the backup
     395         * also has, which the backup doesn't: the restore replaces those folders whole, so it removes
     396         * them (Roll back puts them back). A folder the backup has nothing inside is listed once, with a
     397         * trailing slash, instead of file by file.
     398         *
     399         * @param string                     $set_dir Set dir.
     400         * @param int                        $limit   Most entries to list (the count covers them all).
     401         * @param array<string, string>|null $dirs    Root key => live directory (tests); null for this site's.
     402         * @return array{list: array[], count: int} list: {path (from wp-content's point of view), part (the swap unit, as the restore plan's parts name it)}.
     403         */
     404        public static function removed_in_folders( $set_dir, $limit = 200, $dirs = null ) {
     405                $out = array(
     406                        'list'  => array(),
     407                        'count' => 0,
     408                );
     409                $fh  = @fopen( $set_dir . 'index/files.jsonl', 'rb' ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.file_system_operations_fopen
     410                if ( ! $fh ) {
     411                        return $out;
     412                }
     413                // What the backup has inside those folders: every file and folder, and each file's folders.
     414                $folders = array();
     415                $have    = array();
     416                while ( false !== ( $line = fgets( $fh ) ) ) { // phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition
     417                        $row = json_decode( $line, true );
     418                        if ( ! is_array( $row ) || ! isset( $row['r'] ) || ! in_array( $row['t'] ?? '', array( 'f', 'd' ), true ) ) {
     419                                continue; // Links are not recreated, so a link here is removed like any other file.
     420                        }
     421                        $root = (string) $row['r'];
     422                        $rel  = Set_Files::relative( $row );
     423                        $top  = null === $rel ? null : self::replaced_folder( $root, $rel );
     424                        if ( null === $top ) {
     425                                continue;
     426                        }
     427                        $folders[ $root ][ $top ] = true;
     428                        for ( $p = $rel; strlen( $p ) > strlen( $top ) && ! isset( $have[ $root . '/' . $p ] ); $p = dirname( $p ) ) {
     429                                $have[ $root . '/' . $p ] = true;
     430                        }
     431                }
     432                fclose( $fh ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     433                ksort( $folders );
     434                foreach ( $folders as $root => $tops ) {
     435                        $base = null === $dirs ? self::dest_root( $root ) : ( $dirs[ $root ] ?? null );
     436                        if ( null === $base ) {
     437                                continue;
     438                        }
     439                        $tops = array_keys( $tops );
     440                        sort( $tops );
     441                        foreach ( $tops as $top ) {
     442                                $live = untrailingslashit( wp_normalize_path( $base ) ) . '/' . $top;
     443                                if ( is_dir( $live ) && ! is_link( $live ) ) {
     444                                        self::walk_extra( $root, $live, $top, $have, $limit, $out );
     445                                }
     446                        }
     447                }
     448                return $out;
     449        }
     450
     451        /**
     452         * One folder's part of removed_in_folders().
     453         *
     454         * @param string $root  Root key.
     455         * @param string $dir   Live folder.
     456         * @param string $rel   Its path relative to the root.
     457         * @param array  $have  What the backup has (root/rel => true).
     458         * @param int    $limit Most entries to list.
     459         * @param array  $out   Result, added to.
     460         */
     461        private static function walk_extra( $root, $dir, $rel, array $have, $limit, array &$out ) {
     462                foreach ( self::list_dir( $dir ) as $name ) {
     463                        $path   = $dir . '/' . $name;
     464                        $sub    = $rel . '/' . $name;
     465                        $folder = is_dir( $path ) && ! is_link( $path );
     466                        if ( isset( $have[ $root . '/' . $sub ] ) ) {
     467                                if ( $folder ) {
     468                                        self::walk_extra( $root, $path, $sub, $have, $limit, $out );
     469                                }
     470                                continue;
     471                        }
     472                        ++$out['count'];
     473                        if ( count( $out['list'] ) < $limit ) {
     474                                $out['list'][] = array(
     475                                        'path' => ( 'content' === $root ? '' : $root . '/' ) . $sub . ( $folder ? '/' : '' ),
     476                                        'part' => $root . '/' . self::unit( $root, $sub ),
     477                                );
     478                        }
     479                }
     480        }
     481
     482        /**
    351483         * Performs the swap, journalling each rename first. Returns the journal path.
    352484         *
  • accessnow-site-replica/tags/1.2.0/includes/sets/class-set-files.php

    r3726758 r3815997  
    309309
    310310        /**
    311          * Writes a stored file out to $dest, uncompressed.
     311         * Writes a stored file out to $dest, uncompressed, checking it against the checksum the index
     312         * recorded when the backup was made (rows without one, from older backups, are copied as they are).
    312313         *
    313314         * @param string $dir  Set dir.
    314315         * @param array  $row  Index row.
    315316         * @param string $dest Destination path.
    316          * @return bool
     317         * @return bool False when it couldn't be read or written.
     318         * @throws Damaged_File When the stored file no longer matches its checksum ($dest is removed).
    317319         */
    318320        public static function copy_out( $dir, array $row, $dest ) {
    319321                list( $path, $z ) = self::source( $dir, $row );
    320                 return @copy( ( $z ? 'compress.zlib://' : '' ) . $path, $dest ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
     322                $expect = strtolower( (string) ( $row['h'] ?? '' ) );
     323                $in     = @fopen( ( $z ? 'compress.zlib://' : '' ) . $path, 'rb' ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.file_system_operations_fopen
     324                if ( ! $in ) {
     325                        return false;
     326                }
     327                $out = @fopen( $dest, 'wb' ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.file_system_operations_fopen
     328                if ( ! $out ) {
     329                        fclose( $in ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     330                        return false;
     331                }
     332                $ctx = hash_init( 'sha256' );
     333                $ok  = true;
     334                while ( ! feof( $in ) ) {
     335                        $buf = fread( $in, 1048576 ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fread
     336                        if ( false === $buf ) {
     337                                $ok = false; // A compressed object that is cut off or corrupt fails here.
     338                                break;
     339                        }
     340                        hash_update( $ctx, $buf );
     341                        if ( '' !== $buf && fwrite( $out, $buf ) !== strlen( $buf ) ) { // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fwrite
     342                                fclose( $in ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     343                                fclose( $out ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     344                                @unlink( $dest ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.unlink_unlink
     345                                return false; // Disk full.
     346                        }
     347                }
     348                fclose( $in ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     349                fclose( $out ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     350                $sha = hash_final( $ctx );
     351                if ( preg_match( '/^[0-9a-f]{64}$/', $expect ) && ( ! $ok || ! hash_equals( $expect, $sha ) ) ) {
     352                        @unlink( $dest ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.unlink_unlink
     353                        throw new Damaged_File( sprintf( '%s no longer matches the checksum recorded when the backup was made.', (string) self::relative( $row ) ) );
     354                }
     355                if ( ! $ok ) {
     356                        @unlink( $dest ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.unlink_unlink
     357                        return false;
     358                }
     359                return true;
     360        }
     361
     362        /**
     363         * Whether a stored file still has the bytes the index recorded: true, false (missing, unreadable
     364         * or changed), or null when the row has no checksum to compare with (very old backups).
     365         *
     366         * @param string $dir Set dir.
     367         * @param array  $row Index row.
     368         * @return bool|null
     369         */
     370        public static function intact( $dir, array $row ) {
     371                $expect = strtolower( (string) ( $row['h'] ?? '' ) );
     372                if ( ! preg_match( '/^[0-9a-f]{64}$/', $expect ) ) {
     373                        return self::present( $dir, $row ) ? null : false;
     374                }
     375                try {
     376                        list( $path, $z ) = self::source( $dir, $row );
     377                } catch ( \RuntimeException $e ) {
     378                        return false;
     379                }
     380                $in = @fopen( ( $z ? 'compress.zlib://' : '' ) . $path, 'rb' ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.file_system_operations_fopen
     381                if ( ! $in ) {
     382                        return false;
     383                }
     384                $ctx = hash_init( 'sha256' );
     385                while ( ! feof( $in ) ) {
     386                        $buf = fread( $in, 1048576 ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fread
     387                        if ( false === $buf ) {
     388                                fclose( $in ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     389                                return false;
     390                        }
     391                        hash_update( $ctx, $buf );
     392                }
     393                fclose( $in ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     394                return hash_equals( $expect, hash_final( $ctx ) );
     395        }
     396
     397        /**
     398         * Whether a file on this site has exactly the bytes an index row recorded (rows without a checksum: no).
     399         *
     400         * @param string $file File.
     401         * @param array  $row  Index row.
     402         */
     403        public static function matches( $file, array $row ) {
     404                $expect = strtolower( (string) ( $row['h'] ?? '' ) );
     405                if ( ! preg_match( '/^[0-9a-f]{64}$/', $expect ) ) {
     406                        return false;
     407                }
     408                $sha = @hash_file( 'sha256', $file ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
     409                return is_string( $sha ) && hash_equals( $expect, $sha );
    321410        }
    322411
  • accessnow-site-replica/tags/1.2.0/includes/source/class-api.php

    r3726810 r3815997  
    141141                } catch ( \Throwable $e ) {
    142142                        $message = $e instanceof Db_Exception ? 'Database error: ' . $e->getMessage() : $e->getMessage();
    143                         Frame_Codec::add_json( $this->enc, 'X', array( 'error' => $message ) );
     143                        $error   = array( 'error' => $message );
     144                        if ( $e instanceof Resend_Error ) {
     145                                $error['code'] = $e->error_code; // Not the sender's fault: it sends the same data again.
     146                        }
     147                        Frame_Codec::add_json( $this->enc, 'X', $error );
    144148                        Logger::audit( 'Operation failed.', array( 'op' => $op, 'error' => $message ) );
    145149                        $end = array( 'ok' => false );
  • accessnow-site-replica/tags/1.2.0/languages/accessnow-site-replica.pot

    r3736115 r3815997  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: AccessNow Site Replica 1.0.4\n"
     5"Project-Id-Version: AccessNow Site Replica 1.1.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/accessnow-site-replica\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-10-09T04:10:54+00:00\n"
     12"POT-Creation-Date: 2026-11-21T16:13:50+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    4141
    4242#: includes/admin/class-admin.php:63
    43 #: includes/admin/class-admin.php:232
     43#: includes/admin/class-admin.php:236
    4444msgid "Site Replica"
    4545msgstr ""
    … …  
    5050
    5151#: includes/admin/class-admin.php:65
    52 #: includes/admin/class-admin.php:243
    53 #: includes/admin/class-admin.php:275
     52#: includes/admin/class-admin.php:247
     53#: includes/admin/class-admin.php:279
    5454msgid "Pull & Clone"
    5555msgstr ""
    5656
    5757#: includes/admin/class-admin.php:66
    58 #: includes/admin/class-admin.php:264
    59 #: includes/admin/class-admin.php:354
     58#: includes/admin/class-admin.php:268
     59#: includes/admin/class-admin.php:358
    6060msgid "Backups"
    6161msgstr ""
    6262
    6363#: includes/admin/class-admin.php:68
    64 #: includes/admin/class-admin.php:254
    65 #: includes/admin/class-admin.php:482
     64#: includes/admin/class-admin.php:258
     65#: includes/admin/class-admin.php:503
    6666msgid "This Site as a Source"
    6767msgstr ""
    6868
    6969#: includes/admin/class-admin.php:69
    70 #: includes/admin/class-admin.php:608
     70#: includes/admin/class-admin.php:629
    7171msgid "Logs"
    7272msgstr ""
    7373
    7474#: includes/admin/class-admin.php:70
    75 #: includes/admin/class-admin.php:637
     75#: includes/admin/class-admin.php:658
    7676msgid "Settings"
    7777msgstr ""
    … …  
    163163
    164164#: includes/admin/class-admin.php:116
    165 #: includes/admin/class-admin.php:396
     165#: includes/admin/class-admin.php:400
    166166msgid "Database"
    167167msgstr ""
    168168
    169169#: includes/admin/class-admin.php:117
    170 #: includes/admin/class-admin.php:397
     170#: includes/admin/class-admin.php:401
    171171msgid "Files"
    172172msgstr ""
    … …  
    185185
    186186#: includes/admin/class-admin.php:121
     187msgid "Files in plugin, theme and must-use plugin folders that the backup also has, which only this site has. Each of those folders is replaced whole, the way an update replaces it, so these will be removed (Roll back returns them):"
     188msgstr ""
     189
     190#. translators: %s: number of files not listed.
     191#: includes/admin/class-admin.php:123
     192#, php-format
     193msgid "…and %s more."
     194msgstr ""
     195
     196#: includes/admin/class-admin.php:124
    187197msgid "Media and must-use plugins that exist only on this site are kept."
    188198msgstr ""
    189199
    190 #: includes/admin/class-admin.php:122
     200#: includes/admin/class-admin.php:125
    191201msgid "Keep me logged in (carry my account over)"
    192202msgstr ""
    193203
    194 #: includes/admin/class-admin.php:123
     204#: includes/admin/class-admin.php:126
    195205msgid "Discourage search engines from indexing this copy"
    196206msgstr ""
    197207
    198 #: includes/admin/class-admin.php:124
     208#: includes/admin/class-admin.php:127
    199209msgid "Block all outgoing email from this copy"
    200210msgstr ""
    201211
    202 #: includes/admin/class-admin.php:125
     212#: includes/admin/class-admin.php:128
    203213msgid "Deactivate SSL-forcing plugins (this site uses http)"
    204214msgstr ""
    205215
    206 #: includes/admin/class-admin.php:126
     216#: includes/admin/class-admin.php:129
    207217msgid "Leave post GUIDs unchanged (recommended when moving a live site)"
    208218msgstr ""
    209219
    210 #: includes/admin/class-admin.php:127
     220#: includes/admin/class-admin.php:130
    211221msgid "Restore files (uploads, plugins, themes)"
    212222msgstr ""
    213223
    214224#. translators: %s: this site's host name.
    215 #: includes/admin/class-admin.php:129
     225#: includes/admin/class-admin.php:132
    216226#, php-format
    217227msgid "This replaces a live site. Type %s to confirm:"
    218228msgstr ""
    219229
    220 #: includes/admin/class-admin.php:130
     230#: includes/admin/class-admin.php:133
    221231msgid "Replace this site with the backup"
    222232msgstr ""
    223233
    224 #: includes/admin/class-admin.php:131
     234#: includes/admin/class-admin.php:134
    225235msgid "Keep the restored site"
    226236msgstr ""
    227237
    228 #: includes/admin/class-admin.php:132
     238#: includes/admin/class-admin.php:135
    229239msgid "Roll back"
    230240msgstr ""
    231241
    232 #: includes/admin/class-admin.php:133
     242#: includes/admin/class-admin.php:136
    233243msgid "Open the site in a new tab"
    234244msgstr ""
    235245
    236 #: includes/admin/class-admin.php:134
     246#: includes/admin/class-admin.php:137
    237247msgid "Keep the restored site and delete the previous version?"
    238248msgstr ""
    239249
    240 #: includes/admin/class-admin.php:135
     250#: includes/admin/class-admin.php:138
    241251msgid "Put the previous site back exactly as it was?"
    242252msgstr ""
    243253
    244 #: includes/admin/class-admin.php:136
     254#: includes/admin/class-admin.php:139
    245255msgid "rows"
    246256msgstr ""
    247257
    248 #: includes/admin/class-admin.php:137
     258#: includes/admin/class-admin.php:140
    249259msgid "tables"
    250260msgstr ""
    251261
    252262#. translators: %s: size, e.g. 12 MB.
    253 #: includes/admin/class-admin.php:139
     263#: includes/admin/class-admin.php:142
    254264#, php-format
    255265msgid "%s uploaded"
    … …  
    257267
    258268#. translators: %s: size, e.g. 12 MB.
    259 #: includes/admin/class-admin.php:141
     269#: includes/admin/class-admin.php:144
    260270#, php-format
    261271msgid "%s downloaded"
    … …  
    263273
    264274#. translators: 1: current step, 2: number of steps.
    265 #: includes/admin/class-admin.php:143
     275#: includes/admin/class-admin.php:146
    266276#, php-format
    267277msgid "step %1$s of %2$s"
    … …  
    269279
    270280#. translators: %s: number of files.
    271 #: includes/admin/class-admin.php:145
    272 #: includes/admin/class-admin.php:147
     281#: includes/admin/class-admin.php:148
     282#: includes/admin/class-admin.php:150
    273283#, php-format
    274284msgid "%s file"
    … …  
    278288
    279289#. translators: %s: number of rows.
    280 #: includes/admin/class-admin.php:149
    281 #: includes/admin/class-admin.php:151
     290#: includes/admin/class-admin.php:152
     291#: includes/admin/class-admin.php:154
    282292#, php-format
    283293msgid "%s row"
    … …  
    287297
    288298#. translators: %s: number of warnings.
    289 #: includes/admin/class-admin.php:153
    290 #: includes/admin/class-admin.php:155
     299#: includes/admin/class-admin.php:156
     300#: includes/admin/class-admin.php:158
    291301#, php-format
    292302msgid "%s warning"
    … …  
    296306
    297307#. translators: %s: number of unchanged files.
    298 #: includes/admin/class-admin.php:157
     308#: includes/admin/class-admin.php:160
    299309#, php-format
    300310msgid "%s unchanged"
    … …  
    302312
    303313#. translators: %s: seconds.
    304 #: includes/admin/class-admin.php:159
     314#: includes/admin/class-admin.php:162
    305315#, php-format
    306316msgid "retrying in %s s"
    307317msgstr ""
    308318
    309 #: includes/admin/class-admin.php:161
    310 #: includes/admin/class-admin.php:1042
     319#: includes/admin/class-admin.php:164
     320#: includes/admin/class-admin.php:1067
    311321msgid "Starting"
    312322msgstr ""
    313323
    314 #: includes/admin/class-admin.php:162
    315 #: includes/admin/class-admin.php:1043
     324#: includes/admin/class-admin.php:165
     325#: includes/admin/class-admin.php:1068
    316326msgid "Running"
    317327msgstr ""
    318328
    319 #: includes/admin/class-admin.php:163
    320 #: includes/admin/class-admin.php:1044
     329#: includes/admin/class-admin.php:166
     330#: includes/admin/class-admin.php:1069
    321331msgid "Waiting to retry"
    322332msgstr ""
    323333
    324 #: includes/admin/class-admin.php:164
    325 #: includes/admin/class-admin.php:1045
     334#: includes/admin/class-admin.php:167
     335#: includes/admin/class-admin.php:1070
    326336msgid "Paused"
    327337msgstr ""
    328338
    329 #: includes/admin/class-admin.php:165
    330 #: includes/admin/class-admin.php:1046
     339#: includes/admin/class-admin.php:168
     340#: includes/admin/class-admin.php:1071
    331341msgid "Stopped with an error"
    332342msgstr ""
    333343
    334 #: includes/admin/class-admin.php:166
    335 #: includes/admin/class-admin.php:1047
     344#: includes/admin/class-admin.php:169
     345#: includes/admin/class-admin.php:1072
    336346#: includes/admin/class-cloud-page.php:290
    337347msgid "Cancelled"
    338348msgstr ""
    339349
    340 #: includes/admin/class-admin.php:167
    341 #: includes/admin/class-admin.php:1048
     350#: includes/admin/class-admin.php:170
     351#: includes/admin/class-admin.php:1073
    342352msgid "Completed"
    343353msgstr ""
    344354
    345 #: includes/admin/class-admin.php:168
     355#: includes/admin/class-admin.php:171
    346356msgid "Waiting for you"
    347357msgstr ""
    348358
    349 #: includes/admin/class-admin.php:171
    350 #: includes/admin/class-admin.php:680
     359#: includes/admin/class-admin.php:174
     360#: includes/admin/class-admin.php:704
    351361msgid "Pull backup"
    352362msgstr ""
    353363
    354 #: includes/admin/class-admin.php:172
    355 #: includes/admin/class-admin.php:313
    356 #: includes/admin/class-admin.php:681
     364#: includes/admin/class-admin.php:175
     365#: includes/admin/class-admin.php:317
     366#: includes/admin/class-admin.php:705
    357367msgid "Clone into this site"
    358368msgstr ""
    359369
    360 #: includes/admin/class-admin.php:173
    361 #: includes/admin/class-admin.php:682
     370#: includes/admin/class-admin.php:176
     371#: includes/admin/class-admin.php:706
    362372msgid "Restore"
    363373msgstr ""
    364374
    365 #: includes/admin/class-admin.php:174
    366 #: includes/admin/class-admin.php:369
    367 #: includes/admin/class-admin.php:683
     375#: includes/admin/class-admin.php:177
     376#: includes/admin/class-admin.php:707
     377msgid "Check backup"
     378msgstr ""
     379
     380#: includes/admin/class-admin.php:178
     381#: includes/admin/class-admin.php:373
     382#: includes/admin/class-admin.php:708
    368383msgid "Back up this site"
    369384msgstr ""
    370385
    371 #: includes/admin/class-admin.php:175
    372 #: includes/admin/class-admin.php:684
     386#: includes/admin/class-admin.php:179
     387#: includes/admin/class-admin.php:709
    373388msgid "Cloud backup"
    374389msgstr ""
    375390
    376 #: includes/admin/class-admin.php:176
    377 #: includes/admin/class-admin.php:685
     391#: includes/admin/class-admin.php:180
     392#: includes/admin/class-admin.php:710
    378393msgid "Database backup to the cloud"
    379394msgstr ""
    380395
    381 #: includes/admin/class-admin.php:177
    382 #: includes/admin/class-admin.php:686
     396#: includes/admin/class-admin.php:181
     397#: includes/admin/class-admin.php:711
    383398msgid "Download from the cloud"
    384399msgstr ""
    385400
    386 #: includes/admin/class-admin.php:179
     401#: includes/admin/class-admin.php:183
    387402msgid "This backup runs on the server: you can close this page. You will find the result here and, if you chose so, by e-mail."
    388403msgstr ""
    389404
    390 #: includes/admin/class-admin.php:199
     405#: includes/admin/class-admin.php:203
    391406msgid "The backup folder can be downloaded from the web on this server (it ignores the folder’s .htaccess protection). Ask your host to stop serving that folder, or set ACCESSNOW_REPLICA_STORAGE_DIR in wp-config.php to a folder the web server does not serve, before making backups here."
    392407msgstr ""
    393408
    394 #: includes/admin/class-admin.php:218
     409#: includes/admin/class-admin.php:222
    395410msgid "This copy is not sending email. A restore installed a guard so a copied site cannot email the original site’s people. Delete wp-content/mu-plugins/accessnow-replica-mail-guard.php to allow email again."
    396411msgstr ""
    397412
    398 #: includes/admin/class-admin.php:241
     413#: includes/admin/class-admin.php:245
    399414msgid "Back up a live site to this computer"
    400415msgstr ""
    401416
    402 #: includes/admin/class-admin.php:242
     417#: includes/admin/class-admin.php:246
    403418msgid "Pull a complete copy (database and wp-content) from another WordPress site running Site Replica. Nothing large is written on that server."
    404419msgstr ""
    405420
    406 #: includes/admin/class-admin.php:246
     421#: includes/admin/class-admin.php:250
    407422msgid "Let another site pull this one"
    408423msgstr ""
    409424
    410 #: includes/admin/class-admin.php:250
    411 #: includes/admin/class-admin.php:512
     425#: includes/admin/class-admin.php:254
     426#: includes/admin/class-admin.php:533
    412427msgid "Pulling is ON"
    413428msgstr ""
    414429
    415 #: includes/admin/class-admin.php:251
    416 #: includes/admin/class-admin.php:515
     430#: includes/admin/class-admin.php:255
     431#: includes/admin/class-admin.php:536
    417432msgid "Pulling is off"
    418433msgstr ""
    419434
    420 #: includes/admin/class-admin.php:257
     435#: includes/admin/class-admin.php:261
    421436msgid "Backups on this computer"
    422437msgstr ""
    423438
    424439#. translators: %d: number of backup sets.
    425 #: includes/admin/class-admin.php:261
     440#: includes/admin/class-admin.php:265
    426441#, php-format
    427442msgid "%d backup set"
    … …  
    430445msgstr[1] ""
    431446
    432 #: includes/admin/class-admin.php:283
     447#: includes/admin/class-admin.php:287
    433448msgid "Saved connections can no longer be decrypted (the security keys in wp-config.php changed). Add the connections again."
    434449msgstr ""
    435450
    436 #: includes/admin/class-admin.php:286
     451#: includes/admin/class-admin.php:290
    437452msgid "Connected sites"
    438453msgstr ""
    439454
    440 #: includes/admin/class-admin.php:288
     455#: includes/admin/class-admin.php:292
    441456msgid "No sites yet. Add one below with a connection key."
    442457msgstr ""
    443458
    444 #: includes/admin/class-admin.php:292
     459#: includes/admin/class-admin.php:296
    445460msgid "Site"
    446461msgstr ""
    447462
    448 #: includes/admin/class-admin.php:293
    449 #: includes/admin/class-admin.php:735
     463#: includes/admin/class-admin.php:297
     464#: includes/admin/class-admin.php:760
    450465msgid "Details"
    451466msgstr ""
    452467
    453 #: includes/admin/class-admin.php:294
     468#: includes/admin/class-admin.php:298
    454469msgid "Last backup"
    455470msgstr ""
    456471
    457 #: includes/admin/class-admin.php:295
     472#: includes/admin/class-admin.php:299
    458473msgid "Key expires"
    459474msgstr ""
    460475
    461 #: includes/admin/class-admin.php:310
    462 #: includes/admin/class-admin.php:547
    463 #: includes/admin/class-admin.php:590
     476#: includes/admin/class-admin.php:314
     477#: includes/admin/class-admin.php:568
     478#: includes/admin/class-admin.php:611
    464479#: includes/admin/class-cloud-page.php:359
    465480msgid "Never"
    466481msgstr ""
    467482
    468 #: includes/admin/class-admin.php:312
     483#: includes/admin/class-admin.php:316
    469484msgid "Pull backup now"
    470485msgstr ""
    471486
    472 #: includes/admin/class-admin.php:313
     487#: includes/admin/class-admin.php:317
    473488msgid "Pull a fresh backup, then replace this site with it (you review the plan before anything changes)."
    474489msgstr ""
    475490
    476 #: includes/admin/class-admin.php:314
     491#: includes/admin/class-admin.php:318
    477492msgid "Remove this connection? Backups already made are kept."
    478493msgstr ""
    479494
    480 #: includes/admin/class-admin.php:318
     495#: includes/admin/class-admin.php:322
    481496msgid "Remove"
    482497msgstr ""
    483498
    484 #: includes/admin/class-admin.php:327
     499#: includes/admin/class-admin.php:331
    485500msgid "Add a site"
    486501msgstr ""
    487502
    488 #: includes/admin/class-admin.php:329
     503#: includes/admin/class-admin.php:333
    489504msgid "On the site you want to back up, install Site Replica and go to Site Replica → This Site as a Source."
    490505msgstr ""
    491506
    492 #: includes/admin/class-admin.php:330
     507#: includes/admin/class-admin.php:334
    493508msgid "Turn pulling on and generate a connection key."
    494509msgstr ""
    495510
    496 #: includes/admin/class-admin.php:331
     511#: includes/admin/class-admin.php:335
    497512msgid "Paste the key here."
    498513msgstr ""
    499514
    500 #: includes/admin/class-admin.php:336
     515#: includes/admin/class-admin.php:340
    501516msgid "Connection key"
    502517msgstr ""
    503518
    504 #: includes/admin/class-admin.php:338
     519#: includes/admin/class-admin.php:342
    505520msgid "Connect and check"
    506521msgstr ""
    507522
    508523#. translators: %s: storage path.
    509 #: includes/admin/class-admin.php:343
     524#: includes/admin/class-admin.php:347
    510525#, php-format
    511526msgid "Backups are stored in %s"
    … …  
    513528
    514529#. translators: %s: storage path.
    515 #: includes/admin/class-admin.php:365
     530#: includes/admin/class-admin.php:369
    516531#, php-format
    517532msgid "Stored in %s"
    518533msgstr ""
    519534
    520 #: includes/admin/class-admin.php:370
     535#: includes/admin/class-admin.php:374
    521536msgid "Makes a backup of this site, stored on this server. If something goes wrong later, restore it from the list below."
    522537msgstr ""
    523538
    524 #: includes/admin/class-admin.php:373
     539#: includes/admin/class-admin.php:377
    525540msgid "No backups yet."
    526541msgstr ""
    527542
    528 #: includes/admin/class-admin.php:388
     543#: includes/admin/class-admin.php:392
    529544msgid "Delete selected"
    530545msgstr ""
    531546
    532 #: includes/admin/class-admin.php:393
     547#: includes/admin/class-admin.php:397
    533548msgid "Select all backups"
    534549msgstr ""
    535550
    536 #: includes/admin/class-admin.php:394
     551#: includes/admin/class-admin.php:398
    537552#: includes/admin/class-cloud-page.php:433
    538553msgid "Backup"
    539554msgstr ""
    540555
    541 #: includes/admin/class-admin.php:395
     556#: includes/admin/class-admin.php:399
    542557msgid "Source"
    543558msgstr ""
    544559
    545 #: includes/admin/class-admin.php:398
     560#: includes/admin/class-admin.php:402
    546561#: includes/admin/class-cloud-page.php:435
    547562msgid "Status"
    … …  
    549564
    550565#. translators: %s: backup date.
    551 #: includes/admin/class-admin.php:414
     566#: includes/admin/class-admin.php:418
    552567#, php-format
    553568msgid "Select backup of %s"
    … …  
    555570
    556571#. translators: 1: tables, 2: rows.
    557 #: includes/admin/class-admin.php:423
     572#: includes/admin/class-admin.php:427
    558573#, php-format
    559574msgid "%1$d tables, %2$s rows"
    … …  
    561576
    562577#. translators: 1: files, 2: size.
    563 #: includes/admin/class-admin.php:433
     578#: includes/admin/class-admin.php:437
    564579#, php-format
    565580msgid "%1$s files, %2$s"
    … …  
    567582
    568583#. translators: %s: count.
    569 #: includes/admin/class-admin.php:436
     584#: includes/admin/class-admin.php:440
    570585#, php-format
    571586msgid "%s unchanged (linked)"
    572587msgstr ""
    573588
    574 #: includes/admin/class-admin.php:445
     589#: includes/admin/class-admin.php:449
    575590#: includes/admin/class-cloud-page.php:450
    576591msgid "Complete"
    577592msgstr ""
    578593
     594#. translators: %s: date.
     595#: includes/admin/class-admin.php:455
     596#, php-format
     597msgid "Checked %s: intact"
     598msgstr ""
     599
     600#. translators: %s: date.
     601#: includes/admin/class-admin.php:462
     602#, php-format
     603msgid "Damaged (checked %s)"
     604msgstr ""
     605
    579606#. translators: %d: warnings.
    580 #: includes/admin/class-admin.php:450
     607#: includes/admin/class-admin.php:470
    581608#, php-format
    582609msgid "%d warning"
    … …  
    585612msgstr[1] ""
    586613
    587 #: includes/admin/class-admin.php:455
     614#: includes/admin/class-admin.php:475
    588615msgid "Incomplete"
    589616msgstr ""
    590617
    591 #: includes/admin/class-admin.php:460
     618#: includes/admin/class-admin.php:480
    592619msgid "Restore to this site"
    593620msgstr ""
    594621
    595 #: includes/admin/class-admin.php:462
     622#: includes/admin/class-admin.php:481
     623msgid "Read the whole backup back and compare every part with what was backed up, to find damage before you need it."
     624msgstr ""
     625
     626#: includes/admin/class-admin.php:481
     627msgid "Check"
     628msgstr ""
     629
     630#: includes/admin/class-admin.php:483
    596631msgid "Delete this backup permanently?"
    597632msgstr ""
    598633
    599 #: includes/admin/class-admin.php:466
    600 #: includes/admin/class-admin.php:566
     634#: includes/admin/class-admin.php:487
     635#: includes/admin/class-admin.php:587
    601636#: includes/admin/class-cloud-page.php:463
    602637msgid "Delete"
    603638msgstr ""
    604639
    605 #: includes/admin/class-admin.php:491
     640#: includes/admin/class-admin.php:512
    606641msgid "Another site running Site Replica can pull a full copy of this one: the database and wp-content. The copy is streamed in small encrypted pieces, so nothing large is written on this server."
    607642msgstr ""
    608643
    609 #: includes/admin/class-admin.php:493
     644#: includes/admin/class-admin.php:514
    610645msgid "This site is not using HTTPS, so pull requests will be refused. Enable SSL first."
    611646msgstr ""
    612647
    613 #: includes/admin/class-admin.php:498
     648#: includes/admin/class-admin.php:519
    614649msgid "Your new connection key"
    615650msgstr ""
    616651
    617 #: includes/admin/class-admin.php:499
     652#: includes/admin/class-admin.php:520
    618653msgid "Copy it now: it will not be shown again."
    619654msgstr ""
    620655
    621 #: includes/admin/class-admin.php:499
     656#: includes/admin/class-admin.php:520
    622657msgid "Paste it into Site Replica → Pull & Clone on the computer that will make the backup. Anyone with this key can copy this whole site, so keep it private."
    623658msgstr ""
    624659
    625 #: includes/admin/class-admin.php:501
     660#: includes/admin/class-admin.php:522
    626661msgid "Copy key"
    627662msgstr ""
    628663
    629 #: includes/admin/class-admin.php:513
     664#: includes/admin/class-admin.php:534
    630665msgid "Turn off"
    631666msgstr ""
    632667
    633 #: includes/admin/class-admin.php:516
     668#: includes/admin/class-admin.php:537
    634669msgid "Turn on"
    635670msgstr ""
    636671
    637 #: includes/admin/class-admin.php:522
     672#: includes/admin/class-admin.php:543
    638673msgid "Connection keys"
    639674msgstr ""
    640675
    641 #: includes/admin/class-admin.php:526
    642 #: includes/admin/class-admin.php:582
     676#: includes/admin/class-admin.php:547
     677#: includes/admin/class-admin.php:603
    643678msgid "Label"
    644679msgstr ""
    645680
    646 #: includes/admin/class-admin.php:527
     681#: includes/admin/class-admin.php:548
    647682msgid "Created"
    648683msgstr ""
    649684
    650 #: includes/admin/class-admin.php:528
     685#: includes/admin/class-admin.php:549
    651686msgid "Expires"
    652687msgstr ""
    653688
    654 #: includes/admin/class-admin.php:529
     689#: includes/admin/class-admin.php:550
    655690msgid "Allowed IPs"
    656691msgstr ""
    657692
    658 #: includes/admin/class-admin.php:530
     693#: includes/admin/class-admin.php:551
    659694msgid "Last used"
    660695msgstr ""
    661696
    662 #: includes/admin/class-admin.php:543
     697#: includes/admin/class-admin.php:564
    663698msgid "Revoked"
    664699msgstr ""
    665700
    666 #: includes/admin/class-admin.php:545
     701#: includes/admin/class-admin.php:566
    667702msgid "Expired"
    668703msgstr ""
    669704
    670 #: includes/admin/class-admin.php:551
     705#: includes/admin/class-admin.php:572
    671706msgid "Any"
    672707msgstr ""
    673708
    674 #: includes/admin/class-admin.php:559
     709#: includes/admin/class-admin.php:580
    675710msgid "Revoke"
    676711msgstr ""
    677712
    678 #: includes/admin/class-admin.php:575
     713#: includes/admin/class-admin.php:596
    679714msgid "No keys yet."
    680715msgstr ""
    681716
    682 #: includes/admin/class-admin.php:578
     717#: includes/admin/class-admin.php:599
    683718msgid "Generate a key"
    684719msgstr ""
    685720
    686 #: includes/admin/class-admin.php:583
     721#: includes/admin/class-admin.php:604
    687722msgid "e.g. Staging site"
    688723msgstr ""
    689724
    690 #: includes/admin/class-admin.php:584
     725#: includes/admin/class-admin.php:605
    691726msgid "Expires after"
    692727msgstr ""
    693728
    694 #: includes/admin/class-admin.php:586
     729#: includes/admin/class-admin.php:607
    695730msgid "1 day"
    696731msgstr ""
    697732
    698 #: includes/admin/class-admin.php:587
     733#: includes/admin/class-admin.php:608
    699734msgid "7 days"
    700735msgstr ""
    701736
    702 #: includes/admin/class-admin.php:588
     737#: includes/admin/class-admin.php:609
    703738msgid "30 days"
    704739msgstr ""
    705740
    706 #: includes/admin/class-admin.php:589
     741#: includes/admin/class-admin.php:610
    707742msgid "1 year"
    708743msgstr ""
    709744
    710 #: includes/admin/class-admin.php:592
     745#: includes/admin/class-admin.php:613
    711746msgid "Only allow these IP addresses (optional)"
    712747msgstr ""
    713748
    714 #: includes/admin/class-admin.php:594
     749#: includes/admin/class-admin.php:615
    715750msgid "Comma-separated. Leave empty to allow any address. Doesn’t work if the site is behind Cloudflare."
    716751msgstr ""
    717752
    718 #: includes/admin/class-admin.php:595
     753#: includes/admin/class-admin.php:616
    719754msgid "Generate key"
    720755msgstr ""
    721756
    722 #: includes/admin/class-admin.php:598
     757#: includes/admin/class-admin.php:619
    723758msgid "Recent pull activity"
    724759msgstr ""
    725760
    726 #: includes/admin/class-admin.php:609
     761#: includes/admin/class-admin.php:630
    727762msgid "Jobs"
    728763msgstr ""
    729764
    730 #: includes/admin/class-admin.php:612
     765#: includes/admin/class-admin.php:633
    731766msgid "No jobs yet."
    732767msgstr ""
    733768
    734 #: includes/admin/class-admin.php:622
     769#: includes/admin/class-admin.php:643
    735770msgid "Activity"
    736771msgstr ""
    737772
    738 #: includes/admin/class-admin.php:627
     773#: includes/admin/class-admin.php:648
    739774msgid "Pull requests from other sites"
    740775msgstr ""
    741776
    742 #: includes/admin/class-admin.php:644
     777#: includes/admin/class-admin.php:665
    743778msgid "Storage folder"
    744779msgstr ""
    745780
    746 #: includes/admin/class-admin.php:646
     781#: includes/admin/class-admin.php:667
    747782msgid "Set ACCESSNOW_REPLICA_STORAGE_DIR in wp-config.php to choose another folder."
    748783msgstr ""
    749784
    750 #: includes/admin/class-admin.php:647
     785#: includes/admin/class-admin.php:668
    751786msgid "Work in slices of (seconds)"
    752787msgstr ""
    753788
    754 #: includes/admin/class-admin.php:649
     789#: includes/admin/class-admin.php:670
    755790msgid "0 = automatic (below the host’s time limit)."
    756791msgstr ""
    757792
    758 #: includes/admin/class-admin.php:650
     793#: includes/admin/class-admin.php:671
    759794msgid "Source time per request (ms)"
    760795msgstr ""
    761796
    762 #: includes/admin/class-admin.php:652
     797#: includes/admin/class-admin.php:673
    763798msgid "Data per request (bytes)"
    764799msgstr ""
    765800
    766 #: includes/admin/class-admin.php:654
     801#: includes/admin/class-admin.php:675
    767802msgid "Backups to keep per site"
    768803msgstr ""
    769804
    770 #: includes/admin/class-admin.php:656
     805#: includes/admin/class-admin.php:677
    771806msgid "0 = keep all. Unchanged files are shared between backups, so extra backups use little space."
    772807msgstr ""
    773808
    774 #: includes/admin/class-admin.php:657
     809#: includes/admin/class-admin.php:678
    775810msgid "Also exclude (on this site as a source)"
    776811msgstr ""
    777812
    778 #: includes/admin/class-admin.php:659
    779 msgid "One pattern per line, relative to wp-content. Caches, other backup plugins’ folders, .git and node_modules are always excluded."
    780 msgstr ""
    781 
    782 #: includes/admin/class-admin.php:660
     813#: includes/admin/class-admin.php:680
     814msgid "One pattern per line, relative to wp-content. Start a line with **/ to leave out a name wherever it is, for example **/*.log. Caches, other backup plugins’ folders, .git and node_modules are always excluded."
     815msgstr ""
     816
     817#: includes/admin/class-admin.php:681
     818msgid "Developer files"
     819msgstr ""
     820
     821#: includes/admin/class-admin.php:682
     822msgid "Leave developer files out of themes and plugins developed on this site"
     823msgstr ""
     824
     825#: includes/admin/class-admin.php:683
     826msgid "For a theme or plugin that is a git working copy (it has a .git folder): its docs, tests, bin, scripts, composer and package files, notes (*.md, CLAUDE.md) and, when composer.json asks only for development packages, vendor. Themes and plugins installed from a ZIP are never touched. Files already sent to another site stay there until you remove them."
     827msgstr ""
     828
     829#: includes/admin/class-admin.php:684
    783830msgid "Transients"
    784831msgstr ""
    785832
    786 #: includes/admin/class-admin.php:661
     833#: includes/admin/class-admin.php:685
    787834msgid "Include cached transients in the database export (usually not needed)"
    788835msgstr ""
    789836
    790 #: includes/admin/class-admin.php:663
     837#: includes/admin/class-admin.php:687
    791838msgid "Save settings"
    792839msgstr ""
    793840
    794 #: includes/admin/class-admin.php:730
     841#: includes/admin/class-admin.php:755
    795842msgid "Pause"
    796843msgstr ""
    797844
    798 #: includes/admin/class-admin.php:731
     845#: includes/admin/class-admin.php:756
    799846msgid "Resume"
    800847msgstr ""
    801848
    802 #: includes/admin/class-admin.php:732
     849#: includes/admin/class-admin.php:757
    803850msgid "Cancel"
    804851msgstr ""
    805852
    806 #: includes/admin/class-admin.php:733
     853#: includes/admin/class-admin.php:758
    807854msgid "View backups"
    808855msgstr ""
    809856
    810 #: includes/admin/class-admin.php:736
     857#: includes/admin/class-admin.php:761
    811858msgid "Keep this page open while the job runs. If you close it, the job pauses and you can resume it here later."
    812859msgstr ""
    813860
    814 #: includes/admin/class-admin.php:749
     861#: includes/admin/class-admin.php:774
    815862msgid "Nothing logged yet."
    816863msgstr ""
    817864
    818 #: includes/admin/class-admin.php:818
    819 #: includes/admin/class-admin.php:831
    820 #: includes/admin/class-admin.php:857
    821 #: includes/admin/class-admin.php:869
    822 #: includes/admin/class-admin.php:881
    823 #: includes/admin/class-admin.php:928
    824 #: includes/admin/class-admin.php:940
    825 #: includes/admin/class-admin.php:957
    826 #: includes/admin/class-admin.php:990
     865#: includes/admin/class-admin.php:843
     866#: includes/admin/class-admin.php:856
     867#: includes/admin/class-admin.php:882
     868#: includes/admin/class-admin.php:894
     869#: includes/admin/class-admin.php:906
     870#: includes/admin/class-admin.php:953
     871#: includes/admin/class-admin.php:965
     872#: includes/admin/class-admin.php:982
     873#: includes/admin/class-admin.php:1015
    827874#: includes/admin/class-cloud-page.php:482
    828875#: includes/admin/class-cloud-page.php:495
    … …  
    838885msgstr ""
    839886
    840 #: includes/admin/class-admin.php:823
     887#: includes/admin/class-admin.php:848
    841888msgid "Pulling is on. Generate a key for the computer that will make backups."
    842889msgstr ""
    843890
    844 #: includes/admin/class-admin.php:823
     891#: includes/admin/class-admin.php:848
    845892msgid "Pulling is off. Existing keys stop working until you turn it on again."
    846893msgstr ""
    847894
    848895#. translators: %s: address.
    849 #: includes/admin/class-admin.php:841
     896#: includes/admin/class-admin.php:866
    850897#, php-format
    851898msgid "\"%s\" is not a valid IP address or range."
    852899msgstr ""
    853900
    854 #: includes/admin/class-admin.php:849
     901#: includes/admin/class-admin.php:874
    855902msgid "Key created and pulling turned on."
    856903msgstr ""
    857904
    858 #: includes/admin/class-admin.php:861
     905#: includes/admin/class-admin.php:886
    859906msgid "Key revoked. It stops working immediately."
    860907msgstr ""
    861908
    862 #: includes/admin/class-admin.php:873
     909#: includes/admin/class-admin.php:898
    863910msgid "Key deleted."
    864911msgstr ""
    865912
    866 #: includes/admin/class-admin.php:890
     913#: includes/admin/class-admin.php:915
    867914msgid "That key belongs to this site. Paste it into the site that will make the backup."
    868915msgstr ""
    869916
    870917#. translators: %s: site.
    871 #: includes/admin/class-admin.php:917
     918#: includes/admin/class-admin.php:942
    872919#, php-format
    873920msgid "New key saved for %s. You can pull a backup now."
    … …  
    875922
    876923#. translators: %s: site.
    877 #: includes/admin/class-admin.php:919
     924#: includes/admin/class-admin.php:944
    878925#, php-format
    879926msgid "Connected to %s. You can pull a backup now."
    880927msgstr ""
    881928
    882 #: includes/admin/class-admin.php:932
     929#: includes/admin/class-admin.php:957
    883930msgid "Connection removed."
    884931msgstr ""
    885932
    886 #: includes/admin/class-admin.php:946
     933#: includes/admin/class-admin.php:971
    887934msgid "That backup is still being made. Cancel the job first."
    888935msgstr ""
    889936
    890 #: includes/admin/class-admin.php:949
     937#: includes/admin/class-admin.php:974
    891938#: includes/admin/class-cloud-page.php:708
    892939msgid "Backup deleted."
    893940msgstr ""
    894941
    895 #: includes/admin/class-admin.php:963
     942#: includes/admin/class-admin.php:988
    896943msgid "No backups were selected."
    897944msgstr ""
    898945
    899946#. translators: %d: number of backups.
    900 #: includes/admin/class-admin.php:978
     947#: includes/admin/class-admin.php:1003
    901948#, php-format
    902949msgid "%d backup deleted."
    … …  
    905952msgstr[1] ""
    906953
    907 #: includes/admin/class-admin.php:980
     954#: includes/admin/class-admin.php:1005
    908955msgid "One backup was kept because a job is using it."
    909956msgstr ""
    910957
    911 #: includes/admin/class-admin.php:994
     958#: includes/admin/class-admin.php:1019
    912959msgid "Settings saved."
    913960msgstr ""
    914961
    915962#. translators: %s: time difference.
    916 #: includes/admin/class-admin.php:1008
     963#: includes/admin/class-admin.php:1033
    917964#, php-format
    918965msgid "%s ago"
    919966msgstr ""
    920967
    921 #: includes/admin/class-admin.php:1026
     968#: includes/admin/class-admin.php:1051
    922969msgid "(not created yet: a private folder in wp-content, made when the first backup starts)"
    923970msgstr ""
    924971
    925 #: includes/admin/class-admin.php:1031
     972#: includes/admin/class-admin.php:1056
    926973msgid "(unavailable)"
    927974msgstr ""
    … …  
    13691416
    13701417#: includes/admin/class-cloud-page.php:700
    1371 #: includes/jobs/class-ajax-driver.php:111
     1418#: includes/jobs/class-ajax-driver.php:119
    13721419msgid "Unknown backup."
    13731420msgstr ""
    … …  
    15001547
    15011548#: includes/client/class-remote-site.php:297
    1502 #: includes/client/class-remote-site.php:421
     1549#: includes/client/class-remote-site.php:426
    15031550msgid "The clocks on the two servers differ too much."
    15041551msgstr ""
    … …  
    15331580
    15341581#. translators: %s: error.
    1535 #: includes/client/class-remote-site.php:394
     1582#: includes/client/class-remote-site.php:397
     1583#, php-format
     1584msgid "Part of the backup arrived damaged on the other site and will be sent again: %s"
     1585msgstr ""
     1586
     1587#. translators: %s: error.
     1588#: includes/client/class-remote-site.php:399
    15361589#, php-format
    15371590msgid "The source site reported an error: %s"
    15381591msgstr ""
    15391592
    1540 #: includes/client/class-remote-site.php:405
     1593#: includes/client/class-remote-site.php:410
    15411594msgid "The source server stopped part-way through an answer (host limits). Retrying with smaller pieces."
    15421595msgstr ""
    15431596
    15441597#. translators: %s: URL.
    1545 #: includes/client/class-remote-site.php:410
     1598#: includes/client/class-remote-site.php:415
    15461599#, php-format
    15471600msgid "The source site redirects to %s. Generate a new connection key on that address."
    15481601msgstr ""
    15491602
    1550 #: includes/client/class-remote-site.php:423
     1603#: includes/client/class-remote-site.php:428
    15511604msgid "The source site did not accept the connection key. It may have been revoked or have expired: generate a new key on the source."
    15521605msgstr ""
    15531606
    1554 #: includes/client/class-remote-site.php:425
     1607#: includes/client/class-remote-site.php:430
    15551608msgid "The source site has temporarily blocked this computer after failed attempts. Wait 30 minutes."
    15561609msgstr ""
    15571610
    1558 #: includes/client/class-remote-site.php:427
     1611#: includes/client/class-remote-site.php:432
    15591612msgid "The request was too large for the source site."
    15601613msgstr ""
    15611614
    1562 #: includes/client/class-remote-site.php:429
     1615#: includes/client/class-remote-site.php:434
    15631616msgid "The source site is busy with another request for this key."
    15641617msgstr ""
    15651618
    1566 #: includes/client/class-remote-site.php:431
     1619#: includes/client/class-remote-site.php:436
    15671620msgid "The source site only accepts HTTPS. Use its https:// address."
    15681621msgstr ""
    15691622
    1570 #: includes/client/class-remote-site.php:433
     1623#: includes/client/class-remote-site.php:438
    15711624msgid "The two sites run different Site Replica versions. Update the plugin on both."
    15721625msgstr ""
    15731626
    1574 #: includes/client/class-remote-site.php:435
     1627#: includes/client/class-remote-site.php:440
    15751628msgid "Pulling is turned off on the source site (Site Replica → This site as a source)."
    15761629msgstr ""
    15771630
    1578 #: includes/client/class-remote-site.php:442
     1631#: includes/client/class-remote-site.php:447
    15791632msgid "The source host’s resource limit was reached (HTTP 508). Using fewer connections and waiting."
    15801633msgstr ""
    15811634
    15821635#. translators: %d: HTTP status.
    1583 #: includes/client/class-remote-site.php:445
     1636#: includes/client/class-remote-site.php:450
    15841637#, php-format
    15851638msgid "The source server returned HTTP %d (overloaded or timed out). Retrying with smaller pieces."
    15861639msgstr ""
    15871640
    1588 #: includes/client/class-remote-site.php:448
     1641#: includes/client/class-remote-site.php:453
    15891642msgid "The source host is rate-limiting requests. Waiting before retrying."
    15901643msgstr ""
    15911644
    15921645#. translators: 1: firewall name, 2: IP hint.
    1593 #: includes/client/class-remote-site.php:456
     1646#: includes/client/class-remote-site.php:461
    15941647#, php-format
    15951648msgid "The request was blocked by %1$s on the source server. Ask the host (or the firewall settings) to allow requests to this site from your IP address, or allowlist \"accessnow_replica_api\"."
    15961649msgstr ""
    15971650
    1598 #: includes/client/class-remote-site.php:460
     1651#: includes/client/class-remote-site.php:465
    15991652msgid "Site Replica is not active on the source site, or pulling is turned off there."
    16001653msgstr ""
    16011654
    16021655#. translators: %d: HTTP status.
    1603 #: includes/client/class-remote-site.php:463
     1656#: includes/client/class-remote-site.php:468
    16041657#, php-format
    16051658msgid "The source returned a web page instead of data (HTTP %d). A security plugin, cache or firewall may be intercepting the request."
    … …  
    16071660
    16081661#. translators: %d: HTTP status.
    1609 #: includes/client/class-remote-site.php:465
     1662#: includes/client/class-remote-site.php:470
    16101663#, php-format
    16111664msgid "Unexpected answer from the source site (HTTP %d)."
    16121665msgstr ""
    16131666
    1614 #: includes/client/class-remote-site.php:509
     1667#: includes/client/class-remote-site.php:514
    16151668msgid "a firewall"
    16161669msgstr ""
    … …  
    17461799
    17471800#: includes/jobs/class-ajax-driver.php:97
     1801#: includes/jobs/class-ajax-driver.php:105
     1802#: includes/jobs/steps/class-check.php:51
    17481803msgid "That backup is missing or incomplete."
    17491804msgstr ""
    17501805
    1751 #: includes/jobs/class-ajax-driver.php:103
     1806#: includes/jobs/class-ajax-driver.php:111
    17521807msgid "Set up where backups go first."
    17531808msgstr ""
    17541809
    1755 #: includes/jobs/class-ajax-driver.php:126
     1810#: includes/jobs/class-ajax-driver.php:134
    17561811msgid "Unknown job type."
    17571812msgstr ""
    17581813
    1759 #: includes/jobs/class-ajax-driver.php:142
     1814#: includes/jobs/class-ajax-driver.php:150
    17601815msgid "This job link has expired. Reload the page."
    17611816msgstr ""
    17621817
    1763 #: includes/jobs/class-ajax-driver.php:296
     1818#: includes/jobs/class-ajax-driver.php:304
    17641819msgid "The site has already been switched. Choose Keep or Roll back instead."
    17651820msgstr ""
    17661821
    17671822#. translators: %s: host.
    1768 #: includes/jobs/class-ajax-driver.php:317
     1823#: includes/jobs/class-ajax-driver.php:325
    17691824#, php-format
    17701825msgid "Type %s to confirm that this site will be replaced."
    … …  
    18091864msgstr ""
    18101865
    1811 #: includes/jobs/class-job-store.php:74
     1866#: includes/jobs/class-job-store.php:75
    18121867msgid "Starting…"
    18131868msgstr ""
     1869
     1870#: includes/jobs/steps/class-check.php:66
     1871msgid "Checking the database…"
     1872msgstr ""
     1873
     1874#. translators: %s: file.
     1875#: includes/jobs/steps/class-check.php:71
     1876#: includes/jobs/steps/class-pull.php:1716
     1877#, php-format
     1878msgid "Database chunk %s is missing or damaged."
     1879msgstr ""
     1880
     1881#: includes/jobs/steps/class-check.php:83
     1882msgid "Checking large database values…"
     1883msgstr ""
     1884
     1885#. translators: %s: file.
     1886#: includes/jobs/steps/class-check.php:88
     1887#: includes/jobs/steps/class-pull.php:1727
     1888#, php-format
     1889msgid "Large value %s is missing or damaged."
     1890msgstr ""
     1891
     1892#. translators: 1: files checked, 2: files in the backup.
     1893#: includes/jobs/steps/class-check.php:102
     1894#, php-format
     1895msgid "Checking files: %1$s of %2$s…"
     1896msgstr ""
     1897
     1898#. translators: %s: file.
     1899#: includes/jobs/steps/class-check.php:114
     1900#, php-format
     1901msgid "File %s is missing or damaged in the backup."
     1902msgstr ""
     1903
     1904#. translators: %d: problems.
     1905#: includes/jobs/steps/class-check.php:149
     1906#, php-format
     1907msgid "This backup is damaged: %d part no longer matches what was backed up (see the job log). Don't restore it; make a new backup."
     1908msgid_plural "This backup is damaged: %d parts no longer match what was backed up (see the job log). Don't restore it; make a new backup."
     1909msgstr[0] ""
     1910msgstr[1] ""
    18141911
    18151912#. translators: 1: part number, 2: uploaded size, 3: destination.
    … …  
    19102007#. translators: %s: folder.
    19112008#: includes/jobs/steps/class-pull.php:264
    1912 #: includes/sets/class-set-files.php:429
     2009#: includes/sets/class-set-files.php:518
    19132010#, php-format
    19142011msgid "Could not create folder %s."
    … …  
    19192016#: includes/jobs/steps/class-pull.php:864
    19202017#: includes/sets/class-set-files.php:243
    1921 #: includes/sets/class-set-files.php:417
     2018#: includes/sets/class-set-files.php:506
    19222019msgid "Could not write to the backup folder. Is the disk full?"
    19232020msgstr ""
    … …  
    20642161msgstr ""
    20652162
    2066 #. translators: %s: file.
    2067 #: includes/jobs/steps/class-pull.php:1716
    2068 #, php-format
    2069 msgid "Database chunk %s is missing or damaged."
    2070 msgstr ""
    2071 
    20722163#: includes/jobs/steps/class-pull.php:1720
    20732164msgid "Verifying database chunks…"
    … …  
    20752166
    20762167#. translators: %s: file.
    2077 #: includes/jobs/steps/class-pull.php:1727
    2078 #, php-format
    2079 msgid "Large value %s is missing or damaged."
    2080 msgstr ""
    2081 
    2082 #. translators: %s: file.
    20832168#: includes/jobs/steps/class-pull.php:1750
    20842169#, php-format
    … …  
    21502235msgstr ""
    21512236
    2152 #: includes/jobs/steps/class-restore.php:336
     2237#: includes/jobs/steps/class-restore.php:339
    21532238msgid "Waiting for you to review and confirm the restore."
    21542239msgstr ""
    21552240
    21562241#. translators: %s: table.
    2157 #: includes/jobs/steps/class-restore.php:365
     2242#: includes/jobs/steps/class-restore.php:368
    21582243#, php-format
    21592244msgid "Creating table %s…"
    … …  
    21612246
    21622247#. translators: 1: table, 2: chunk, 3: chunks.
    2163 #: includes/jobs/steps/class-restore.php:417
     2248#: includes/jobs/steps/class-restore.php:420
    21642249#, php-format
    21652250msgid "Importing %1$s (part %2$d of %3$d)…"
    … …  
    21672252
    21682253#. translators: %s: file.
    2169 #: includes/jobs/steps/class-restore.php:422
     2254#: includes/jobs/steps/class-restore.php:425
    21702255#, php-format
    21712256msgid "Backup file %s is missing or damaged."
    … …  
    21732258
    21742259#. translators: 1: size, 2: table.
    2175 #: includes/jobs/steps/class-restore.php:495
     2260#: includes/jobs/steps/class-restore.php:498
    21762261#, php-format
    21772262msgid "Writing a large value (%1$s) into %2$s…"
    21782263msgstr ""
    21792264
    2180 #: includes/jobs/steps/class-restore.php:548
     2265#: includes/jobs/steps/class-restore.php:551
    21812266msgid "Adjusting the restored data for this site…"
    21822267msgstr ""
    21832268
    2184 #: includes/jobs/steps/class-restore.php:679
     2269#: includes/jobs/steps/class-restore.php:722
    21852270msgid "Your login could not be carried over (the job was not started by a logged-in user). Log in with an account from the backup."
    21862271msgstr ""
    21872272
    21882273#. translators: %s: login.
    2189 #: includes/jobs/steps/class-restore.php:690
     2274#: includes/jobs/steps/class-restore.php:733
    21902275#, php-format
    21912276msgid "The user \"%s\" exists in the backup but is not an administrator there, so your login was not carried over. Log in with the backup’s credentials."
    21922277msgstr ""
    21932278
    2194 #: includes/jobs/steps/class-restore.php:737
     2279#: includes/jobs/steps/class-restore.php:780
    21952280msgid "The imported data does not match the backup, so nothing was changed on this site: "
    21962281msgstr ""
    21972282
    21982283#. translators: 1: done, 2: total.
    2199 #: includes/jobs/steps/class-restore.php:777
     2284#: includes/jobs/steps/class-restore.php:820
    22002285#, php-format
    22012286msgid "Preparing files: %1$s of %2$s…"
    … …  
    22032288
    22042289#. translators: 1: number of files, 2: examples.
    2205 #: includes/jobs/steps/class-restore.php:805
     2290#: includes/jobs/steps/class-restore.php:848
    22062291#, php-format
    22072292msgid "%1$s files were not restored: this computer's disk ignores upper/lower case, and each has a partner whose name differs only in case (for example %2$s). Pages that use them show the partner image instead. A restore to a Linux server keeps them all."
    22082293msgstr ""
    22092294
    2210 #: includes/jobs/steps/class-restore.php:828
     2295#: includes/jobs/steps/class-restore.php:871
    22112296msgid "Switching to the restored site…"
    22122297msgstr ""
    22132298
    22142299#. translators: %s: view.
    2215 #: includes/jobs/steps/class-restore.php:915
     2300#: includes/jobs/steps/class-restore.php:958
    22162301#, php-format
    22172302msgid "View %s was not recreated: it does not belong to this site."
    … …  
    22192304
    22202305#. translators: 1: view, 2: error.
    2221 #: includes/jobs/steps/class-restore.php:922
     2306#: includes/jobs/steps/class-restore.php:965
    22222307#, php-format
    22232308msgid "View %1$s could not be recreated: %2$s"
    … …  
    22252310
    22262311#. translators: %s: trigger.
    2227 #: includes/jobs/steps/class-restore.php:930
     2312#: includes/jobs/steps/class-restore.php:973
    22282313#, php-format
    22292314msgid "Trigger %s was not recreated: it does not belong to a restored table."
    … …  
    22312316
    22322317#. translators: 1: trigger, 2: error.
    2233 #: includes/jobs/steps/class-restore.php:940
     2318#: includes/jobs/steps/class-restore.php:983
    22342319#, php-format
    22352320msgid "Trigger %1$s could not be recreated: %2$s"
    … …  
    22372322
    22382323#. translators: %s: number of values.
    2239 #: includes/jobs/steps/class-restore.php:965
     2324#: includes/jobs/steps/class-restore.php:1008
    22402325#, php-format
    22412326msgid "%s values could not be searched for addresses (too large for PHP's pattern matcher) and were left unchanged."
    22422327msgstr ""
    22432328
    2244 #: includes/jobs/steps/class-restore.php:972
     2329#: includes/jobs/steps/class-restore.php:1015
    22452330msgid "Check the restored site. Keep it to delete the previous version, or roll back to put the previous site back exactly."
    22462331msgstr ""
    22472332
    2248 #: includes/jobs/steps/class-restore.php:993
     2333#: includes/jobs/steps/class-restore.php:1036
    22492334msgid "Rolling back…"
    22502335msgstr ""
    22512336
    2252 #: includes/jobs/steps/class-restore.php:998
     2337#: includes/jobs/steps/class-restore.php:1041
    22532338msgid "Restored. Keep this version or roll back?"
    22542339msgstr ""
    22552340
    2256 #: includes/jobs/steps/class-restore.php:1051
     2341#: includes/jobs/steps/class-restore.php:1094
    22572342msgid "Cleaning up…"
    22582343msgstr ""
  • accessnow-site-replica/tags/1.2.0/readme.txt

    r3736115 r3815997  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.1.0
     7Stable tag: 1.2.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    130130== Changelog ==
    131131
     132= 1.2.0 =
     133* A restore replaces each plugin, theme and must-use plugin folder the backup has whole, the way an update does: a file this site has inside one of them that the backup doesn't (left over from a copy made by hand, say) is removed, and the restore plan lists each one before you confirm. Roll back returns them. Media and must-use plugins that exist only on this site are still kept.
     134* A new Developer files setting leaves notes, scripts, tests and tooling (docs, tests, bin, .github, *.md, CLAUDE.md, composer and package files) out of themes and plugins that are git working copies, so they are not copied to another site, where they would be readable. And an exclusion line starting with **/ now leaves a name out at any depth.
     135* Check a backup: a new Check button on the Backups page reads the whole backup back and compares every part with the fingerprint recorded when it was made, so a backup damaged in storage is found before you need it. The list shows when each backup was last checked.
     136* A restore compares every file with the backup's fingerprint as it goes and stops, with nothing on the site changed, if one is damaged. A file the site already has is reused only if it really is the same: scripts and files up to 1 MB are compared by content, so a file edited without changing its date is put back from the backup.
     137* A restore keeps this site's licence records for plugins sold through Freemius, the way it keeps Site Replica's own settings, so after sending a staging copy live those plugins stay activated instead of asking whether the site is a copy. A brand-new site with no such records keeps the backup's.
     138
    132139= 1.1.0 =
    133140* A must-use plugin named local-only-* is never copied, like the local Mailpit helper: a convention for helpers that belong to one local copy (a theme preview switch, a test login), so they can't reach a live site.
  • accessnow-site-replica/trunk/accessnow-site-replica.php

    r3736115 r3815997  
    44 * Plugin URI:        https://accessnow.com.au/projects/site-replica/
    55 * Description:       Back up, clone and restore large WordPress sites in small, resumable steps, even on shared hosting with little free disk. Pull a live site to another install, clone it with rollback, and schedule backups to Google Drive or S3-compatible storage.
    6  * Version:           1.1.0
     6 * Version:           1.2.0
    77 * Requires at least: 6.4
    88 * Requires PHP:      7.4
    … …  
    2929}
    3030
    31 define( 'ACCESSNOW_REPLICA_VERSION', '1.1.0' );
     31define( 'ACCESSNOW_REPLICA_VERSION', '1.2.0' );
    3232define( 'ACCESSNOW_REPLICA_PROTOCOL', 1 );
    3333define( 'ACCESSNOW_REPLICA_FILE', __FILE__ );
  • accessnow-site-replica/trunk/assets/js/admin.js

    r3726810 r3815997  
    262262                        if (a.removed && a.removed.length) {
    263263                                box.appendChild(el('p', {}, i18n.planRemoved + ' ' + a.removed.join(', ')));
     264                        }
     265                        if (a.replaced && a.replaced.count) {
     266                                var replacedBox = box.appendChild(el('div', { 'class': 'srp-replaced' }));
     267                                replacedBox.appendChild(el('p', {}, i18n.planReplaced));
     268                                var replacedList = replacedBox.appendChild(el('ul', { 'class': 'srp-pairs' }));
     269                                a.replaced.list.forEach(function (f) { replacedList.appendChild(el('li', { 'data-part': f.part }, f.path)); });
     270                                if (a.replaced.count > a.replaced.list.length) {
     271                                        replacedBox.appendChild(el('p', { 'class': 'srp-muted' }, i18n.planMore.replace('%s', Number(a.replaced.count - a.replaced.list.length).toLocaleString())));
     272                                }
    264273                        }
    265274                        box.appendChild(el('p', { 'class': 'description' }, i18n.planKept));
  • accessnow-site-replica/trunk/includes/admin/class-admin.php

    r3726810 r3815997  
    119119                                        'planMoved'     => __( 'Tables that exist only on this site and will be removed (kept until you choose Keep):', 'accessnow-site-replica' ),
    120120                                        'planRemoved'   => __( 'Plugins that exist only on this site and will be removed (Roll back returns them):', 'accessnow-site-replica' ),
     121                                        'planReplaced'  => __( 'Files in plugin, theme and must-use plugin folders that the backup also has, which only this site has. Each of those folders is replaced whole, the way an update replaces it, so these will be removed (Roll back returns them):', 'accessnow-site-replica' ),
     122                                        /* translators: %s: number of files not listed. */
     123                                        'planMore'      => __( '…and %s more.', 'accessnow-site-replica' ),
    121124                                        'planKept'      => __( 'Media and must-use plugins that exist only on this site are kept.', 'accessnow-site-replica' ),
    122125                                        'optKeepLogin'  => __( 'Keep me logged in (carry my account over)', 'accessnow-site-replica' ),
    … …  
    172175                                                'clone'    => __( 'Clone into this site', 'accessnow-site-replica' ),
    173176                                                'restore'  => __( 'Restore', 'accessnow-site-replica' ),
     177                                                'check'    => __( 'Check backup', 'accessnow-site-replica' ),
    174178                                                'backup'   => __( 'Back up this site', 'accessnow-site-replica' ),
    175179                                                'cloud'    => __( 'Cloud backup', 'accessnow-site-replica' ),
    … …  
    444448                                                        <?php if ( $complete ) : ?>
    445449                                                                <span class="srp-pill is-on"><?php esc_html_e( 'Complete', 'accessnow-site-replica' ); ?></span>
     450                                                                <?php $checked = \AccessNow\Replica\Jobs\Steps\Check::result( (string) $m['set_id'] ); ?>
     451                                                                <?php if ( $checked && 0 === (int) $checked['bad'] ) : ?>
     452                                                                        <br><span class="srp-muted">
     453                                                                        <?php
     454                                                                        /* translators: %s: date. */
     455                                                                        echo esc_html( sprintf( __( 'Checked %s: intact', 'accessnow-site-replica' ), wp_date( get_option( 'date_format' ), (int) $checked['time'] ) ) );
     456                                                                        ?>
     457                                                                        </span>
     458                                                                <?php elseif ( $checked ) : ?>
     459                                                                        <br><span class="srp-pill is-warn">
     460                                                                        <?php
     461                                                                        /* translators: %s: date. */
     462                                                                        echo esc_html( sprintf( __( 'Damaged (checked %s)', 'accessnow-site-replica' ), wp_date( get_option( 'date_format' ), (int) $checked['time'] ) ) );
     463                                                                        ?>
     464                                                                        </span>
     465                                                                <?php endif; ?>
    446466                                                                <?php if ( ! empty( $m['warnings'] ) ) : ?>
    447467                                                                        <br><span class="srp-muted">
    … …  
    459479                                                        <?php if ( $complete ) : ?>
    460480                                                                <button type="button" class="button" data-srp-start="restore" data-set="<?php echo esc_attr( $m['set_id'] ); ?>" <?php disabled( (bool) $active ); ?>><?php esc_html_e( 'Restore to this site', 'accessnow-site-replica' ); ?></button>
     481                                                                <button type="button" class="button" data-srp-start="check" data-set="<?php echo esc_attr( $m['set_id'] ); ?>" <?php disabled( (bool) $active ); ?> title="<?php esc_attr_e( 'Read the whole backup back and compare every part with what was backed up, to find damage before you need it.', 'accessnow-site-replica' ); ?>"><?php esc_html_e( 'Check', 'accessnow-site-replica' ); ?></button>
    461482                                                        <?php endif; ?>
    462483                                                        <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" class="srp-inline" onsubmit="return confirm('<?php echo esc_js( __( 'Delete this backup permanently?', 'accessnow-site-replica' ) ); ?>');">
    … …  
    657678                                <tr><th scope="row"><label for="srp-excl"><?php esc_html_e( 'Also exclude (on this site as a source)', 'accessnow-site-replica' ); ?></label></th>
    658679                                        <td><textarea id="srp-excl" name="extra_excludes" rows="4" class="large-text code" placeholder="uploads/big-archive&#10;uploads/*.zip"><?php echo esc_textarea( (string) $s['extra_excludes'] ); ?></textarea>
    659                                         <p class="description"><?php esc_html_e( 'One pattern per line, relative to wp-content. Caches, other backup plugins’ folders, .git and node_modules are always excluded.', 'accessnow-site-replica' ); ?></p></td></tr>
     680                                        <p class="description"><?php esc_html_e( 'One pattern per line, relative to wp-content. Start a line with **/ to leave out a name wherever it is, for example **/*.log. Caches, other backup plugins’ folders, .git and node_modules are always excluded.', 'accessnow-site-replica' ); ?></p></td></tr>
     681                                <tr><th scope="row"><?php esc_html_e( 'Developer files', 'accessnow-site-replica' ); ?></th>
     682                                        <td><label><input type="checkbox" name="leave_dev_files" value="1" <?php checked( ! empty( $s['leave_dev_files'] ) ); ?>> <?php esc_html_e( 'Leave developer files out of themes and plugins developed on this site', 'accessnow-site-replica' ); ?></label>
     683                                        <p class="description"><?php esc_html_e( 'For a theme or plugin that is a git working copy (it has a .git folder): its docs, tests, bin, scripts, composer and package files, notes (*.md, CLAUDE.md) and, when composer.json asks only for development packages, vendor. Themes and plugins installed from a ZIP are never touched. Files already sent to another site stay there until you remove them.', 'accessnow-site-replica' ); ?></p></td></tr>
    660684                                <tr><th scope="row"><?php esc_html_e( 'Transients', 'accessnow-site-replica' ); ?></th>
    661685                                        <td><label><input type="checkbox" name="include_transients" value="1" <?php checked( ! empty( $s['include_transients'] ) ); ?>> <?php esc_html_e( 'Include cached transients in the database export (usually not needed)', 'accessnow-site-replica' ); ?></label></td></tr>
    … …  
    681705                        'clone'    => __( 'Clone into this site', 'accessnow-site-replica' ),
    682706                        'restore'  => __( 'Restore', 'accessnow-site-replica' ),
     707                        'check'    => __( 'Check backup', 'accessnow-site-replica' ),
    683708                        'backup'   => __( 'Back up this site', 'accessnow-site-replica' ),
    684709                        'cloud'    => __( 'Cloud backup', 'accessnow-site-replica' ),
  • accessnow-site-replica/trunk/includes/class-settings.php

    r3726758 r3815997  
    3232                        'extra_excludes'  => '',       // One pattern per line, relative to wp-content.
    3333                        'include_transients' => false,
     34                        'leave_dev_files' => false,    // Leave notes, scripts and tests out of themes and plugins developed in place (a .git folder).
    3435                        'keep_sets'       => 5,        // Pull sets kept per source (0 = keep all).
    3536                );
    … …  
    7374                        'extra_excludes'     => isset( $input['extra_excludes'] ) ? sanitize_textarea_field( (string) $input['extra_excludes'] ) : $current['extra_excludes'],
    7475                        'include_transients' => ! empty( $input['include_transients'] ),
     76                        'leave_dev_files'    => ! empty( $input['leave_dev_files'] ),
    7577                        'keep_sets'          => isset( $input['keep_sets'] ) ? max( 0, min( 100, (int) $input['keep_sets'] ) ) : $current['keep_sets'],
    7678                );
  • accessnow-site-replica/trunk/includes/client/class-remote-site.php

    r3726758 r3815997  
    392392                                if ( 'X' === $frame[0] ) {
    393393                                        $error = json_decode( $frame[1], true );
     394                                        $code  = is_array( $error ) ? (string) ( $error['code'] ?? '' ) : '';
     395                                        if ( in_array( $code, array( 'resend_piece', 'resend_file' ), true ) ) {
     396                                                // Data that failed a checksum on the other site: a temporary failure, sent again.
     397                                                throw new Remote_Exception( $code, sprintf( /* translators: %s: error. */ __( 'Part of the backup arrived damaged on the other site and will be sent again: %s', 'accessnow-site-replica' ), (string) $error['error'] ), true, 3 );
     398                                        }
    394399                                        throw new Remote_Exception( 'remote_error', sprintf( /* translators: %s: error. */ __( 'The source site reported an error: %s', 'accessnow-site-replica' ), is_array( $error ) ? (string) $error['error'] : 'unknown' ) );
    395400                                }
  • accessnow-site-replica/trunk/includes/files/class-exclusions.php

    r3736115 r3815997  
    7171
    7272        /**
     73         * Developer files at the top of a theme or plugin folder (fnmatch on the name): notes, scripts,
     74         * tests and tooling that a live site never needs and that would be readable there.
     75         */
     76        const DEV_TOP = array( 'docs', 'tests', 'test', 'bin', '.github', '*.md', 'composer.json', 'composer.lock', 'package.json', 'package-lock.json', 'phpcs.xml*', 'phpunit.xml*', '.phpcs.xml*', '.editorconfig', '.gitignore', '.distignore' );
     77
     78        /**
     79         * Names that show a theme or plugin folder is being developed (not just installed), used to warn.
     80         */
     81        const DEV_MARKERS = array( 'CLAUDE.md', '.github', 'phpcs.xml', 'phpcs.xml.dist', 'phpunit.xml', 'phpunit.xml.dist', 'tests' );
     82
     83        /**
     84         * Whether to leave developer files out of theme and plugin folders that are git working copies.
     85         *
     86         * @var bool
     87         */
     88        private $dev_files = false;
     89
     90        /**
     91         * Per theme/plugin folder: array( has .git, leave vendor out ).
     92         *
     93         * @var array<string, array{0: bool, 1: bool}>
     94         */
     95        private $units = array();
     96
     97        /**
     98         * Name patterns excluded at any depth (extra exclusion lines that start with **\/).
     99         *
     100         * @var string[]
     101         */
     102        private $name_patterns = array();
     103
     104        /**
    73105         * Patterns for one root.
    74106         *
    … …  
    101133                if ( 'content' === $root_key ) {
    102134                        $this->patterns = self::CONTENT_PATTERNS;
     135                        $this->dev_files = (bool) Settings::get( 'leave_dev_files' );
    103136                        foreach ( preg_split( '/\R/', (string) Settings::get( 'extra_excludes' ) ) as $line ) {
    104                                 $line = trim( trim( $line ), '/' );
     137                                $line = trim( $line );
     138                                if ( 0 === strpos( $line, '**/' ) && strlen( $line ) > 3 && false === strpos( substr( $line, 3 ), '/' ) ) {
     139                                        $this->name_patterns[] = substr( $line, 3 ); // A name, wherever it is.
     140                                        continue;
     141                                }
     142                                $line = trim( $line, '/' );
    105143                                if ( '' !== $line && false === strpos( $line, '..' ) ) {
    106144                                        $this->patterns[] = $line;
    … …  
    130168                        }
    131169                }
     170                foreach ( $this->name_patterns as $pattern ) {
     171                        if ( fnmatch( $pattern, $name ) ) {
     172                                return true;
     173                        }
     174                }
    132175                foreach ( $this->patterns as $pattern ) {
    133176                        if ( fnmatch( $pattern, $rel, FNM_PATHNAME ) ) {
    … …  
    135178                        }
    136179                }
     180                if ( $this->dev_files && $this->developer_file( $rel, $name ) ) {
     181                        return true;
     182                }
    137183                if ( '' !== $this->storage && $this->root . $rel === $this->storage ) {
    138184                        return true;
    … …  
    140186                return false;
    141187        }
     188
     189        /**
     190         * Whether a path is a developer file of a theme or plugin folder that is a git working copy.
     191         *
     192         * Only inside themes and plugins, and only in folders with a .git (developed in place): a theme
     193         * or plugin installed from a ZIP keeps everything it came with. CLAUDE.md goes at any depth;
     194         * the rest at the top of the folder. vendor/ goes only when composer.json asks for nothing but
     195         * development packages (its production code, if any, would be in require).
     196         *
     197         * @param string $rel  Path relative to wp-content.
     198         * @param string $name Base name.
     199         */
     200        private function developer_file( $rel, $name ) {
     201                if ( ! preg_match( '#^(themes|plugins)/([^/]+)/(.+)$#', $rel, $m ) ) {
     202                        return false;
     203                }
     204                $unit = $m[1] . '/' . $m[2];
     205                if ( ! isset( $this->units[ $unit ] ) ) {
     206                        $dir                   = $this->root . $unit;
     207                        $this->units[ $unit ] = array( file_exists( $dir . '/.git' ), self::composer_dev_only( $dir . '/composer.json' ) );
     208                }
     209                if ( ! $this->units[ $unit ][0] ) {
     210                        return false;
     211                }
     212                if ( 'CLAUDE.md' === $name ) {
     213                        return true;
     214                }
     215                $inner = $m[3];
     216                $top   = false === strpos( $inner, '/' ) ? $inner : strstr( $inner, '/', true );
     217                if ( 'vendor' === $top && $this->units[ $unit ][1] ) {
     218                        return true;
     219                }
     220                foreach ( self::DEV_TOP as $pattern ) {
     221                        if ( fnmatch( $pattern, $top ) ) {
     222                                return true;
     223                        }
     224                }
     225                return false;
     226        }
     227
     228        /**
     229         * Whether a composer.json has packages only under require-dev (nothing the site runs on).
     230         *
     231         * @param string $file Path.
     232         */
     233        private static function composer_dev_only( $file ) {
     234                if ( ! is_file( $file ) ) {
     235                        return false;
     236                }
     237                $json = json_decode( (string) file_get_contents( $file ), true ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
     238                if ( ! is_array( $json ) || empty( $json['require-dev'] ) ) {
     239                        return false;
     240                }
     241                foreach ( array_keys( (array) ( $json['require'] ?? array() ) ) as $package ) {
     242                        if ( 'php' !== $package && 0 !== strpos( (string) $package, 'ext-' ) ) {
     243                                return false;
     244                        }
     245                }
     246                return true;
     247        }
     248
     249        /**
     250         * Theme and plugin folders in a list of index paths that look developed in place, with their
     251         * developer files, to warn before they are sent. Names only: a backup does not hold .git.
     252         *
     253         * @param string[] $paths Paths relative to wp-content.
     254         * @return array<string, string[]> Folder => developer files (a few).
     255         */
     256        public static function developer_files_in( array $paths ) {
     257                $units   = array();
     258                $marked  = array();
     259                foreach ( $paths as $rel ) {
     260                        if ( ! preg_match( '#^(themes|plugins)/([^/]+)/([^/]+)(/|$)#', $rel, $m ) ) {
     261                                continue;
     262                        }
     263                        $unit = $m[1] . '/' . $m[2];
     264                        $top  = $m[3];
     265                        if ( in_array( $top, self::DEV_MARKERS, true ) ) {
     266                                $marked[ $unit ] = true;
     267                        }
     268                        foreach ( self::DEV_TOP as $pattern ) {
     269                                if ( fnmatch( $pattern, $top ) ) {
     270                                        $units[ $unit ][ $top ] = true;
     271                                        break;
     272                                }
     273                        }
     274                }
     275                $out = array();
     276                foreach ( $units as $unit => $names ) {
     277                        if ( isset( $marked[ $unit ] ) ) {
     278                                $out[ $unit ] = array_slice( array_keys( $names ), 0, 6 );
     279                        }
     280                }
     281                return $out;
     282        }
    142283}
  • accessnow-site-replica/trunk/includes/jobs/class-ajax-driver.php

    r3726758 r3815997  
    9999                        list( $job, $token ) = Job_Store::create( 'restore', array(), array( 'set_id' => $set_id ) );
    100100                        Logger::activity( 'restore', 'Restore prepared from backup ' . $set_id, array( 'job' => $job->id() ) );
     101                } elseif ( 'check' === $type ) {
     102                        $set_id = isset( $_POST['set'] ) ? sanitize_text_field( wp_unslash( $_POST['set'] ) ) : '';
     103                        $m      = Set_Store::manifest( $set_id );
     104                        if ( ! $m || 'complete' !== ( $m['status'] ?? '' ) ) {
     105                                wp_send_json_error( array( 'message' => __( 'That backup is missing or incomplete.', 'accessnow-site-replica' ) ), 400 );
     106                        }
     107                        list( $job, $token ) = Job_Store::create( 'check', array(), array( 'set_id' => $set_id ) );
     108                        Logger::activity( 'pull', 'Check of backup ' . $set_id . ' started', array( 'job' => $job->id() ) );
    101109                } elseif ( 'cloud' === $type ) {
    102110                        if ( ! \AccessNow\Replica\Destinations\Destination::current()->ready() ) {
  • accessnow-site-replica/trunk/includes/jobs/class-job-runner.php

    r3726810 r3815997  
    186186                } elseif ( 0 === strpos( $step, 'cl_' ) || 0 === strpos( $step, 'ci_' ) ) {
    187187                        $class = Steps\Cloud::class;
     188                } elseif ( 0 === strpos( $step, 'ck_' ) ) {
     189                        $class = Steps\Check::class;
    188190                } else {
    189191                        $class = Steps\Pull::class;
  • accessnow-site-replica/trunk/includes/jobs/class-job-store.php

    r3726758 r3815997  
    3737                'import'  => self::IMPORT,
    3838                'restore' => self::RESTORE,
     39                'check'   => array( 'ck_backup' ),
    3940                'clone'   => array( 'preflight', 'db_schema', 'db_data', 'fs_scan', 'fs_transfer', 'verify', 'finalize', 'rs_preflight', 'rs_plan', 'rs_db_create', 'rs_db_import', 'rs_db_bigs', 'rs_db_verify', 'rs_db_fix', 'rs_files_stage', 'rs_swap', 'rs_post', 'rs_confirm', 'rs_cleanup' ),
    4041        );
  • accessnow-site-replica/trunk/includes/jobs/steps/class-restore.php

    r3726758 r3815997  
    312312                                'moved'    => $live,
    313313                                'removed'  => Files::plugins_only_here( Set_Store::dir( (string) $job->get( 'set_id' ) ) ),
     314                                // Files this site has inside plugin, theme and must-use plugin folders the backup
     315                                // also has: each folder is replaced whole, as an update replaces it, so they go.
     316                                'replaced' => Files::removed_in_folders( Set_Store::dir( (string) $job->get( 'set_id' ) ) ),
    314317                                'local'    => $local,
    315318                                'opts'     => $job->get( 'restore_opts' ),
    … …  
    561564                        $db->query( 'DELETE FROM %i WHERE ' . $own_cond, $options, ...$own );
    562565                        $db->query( 'INSERT INTO %i (option_name, option_value, autoload) SELECT option_name, option_value, autoload FROM %i WHERE ' . $own_cond, $options, $wpdb->options, ...$own );
     566                        if ( self::keep_freemius_records( $db, $options, $wpdb->options ) ) {
     567                                $job->log( 'Kept this site\'s licence records for plugins sold through Freemius, so they stay activated here instead of asking whether this site is a copy.' );
     568                        }
    563569                        // Caches that must be rebuilt here.
    564570                        $db->query( "DELETE FROM %i WHERE option_name IN ('rewrite_rules') OR option_name LIKE %s OR option_name LIKE %s", $options, $wpdb->esc_like( '_transient_' ) . '%', $wpdb->esc_like( '_site_transient_' ) . '%' );
    … …  
    591597                        self::keep_login( $db, $users, $usermeta, $dst_px, (int) $job->s['user'], $job );
    592598                }
     599                return true;
     600        }
     601
     602        /**
     603         * Keeps this site's Freemius records (licences, installs, clone state) in place of the backup's.
     604         *
     605         * Plugins sold through Freemius keep their licence and install records in the options table.
     606         * Restored from another site, those records name the other site's address, so the SDK treats
     607         * this site as a copy and asks whether to duplicate, migrate or activate again (its "safe mode"),
     608         * which a routine staging-to-live send should never do. Only when this site already has records
     609         * of its own: a fresh site keeps the backup's, so the SDK can offer to duplicate the licence.
     610         *
     611         * @param Connection $db    Connection.
     612         * @param string     $temp  Restored options table, before the swap.
     613         * @param string     $live  This site's options table.
     614         * @return bool Whether this site's records were kept.
     615         */
     616        public static function keep_freemius_records( Connection $db, $temp, $live ) {
     617                global $wpdb;
     618                // The SDK's own option names (config.php, WP_FS___OPTION_PREFIX), in production and development mode.
     619                $exact = array();
     620                $like  = array();
     621                foreach ( array( 'fs_', 'fs_dbg_' ) as $p ) {
     622                        foreach ( array( 'accounts', 'api_cache', 'gdpr', 'options', 'clone_management' ) as $name ) {
     623                                $exact[] = $p . $name;
     624                        }
     625                        $like[] = $wpdb->esc_like( $p . 'cache_' ) . '%';
     626                }
     627                $exact[] = 'fs_active_plugins';
     628                $here    = (int) $db->value( "SELECT COUNT(*) FROM %i WHERE option_name IN ('fs_accounts', 'fs_dbg_accounts')", $live );
     629                if ( 0 === $here ) {
     630                        return false;
     631                }
     632                $cond = 'option_name IN (' . implode( ',', array_fill( 0, count( $exact ), '%s' ) ) . ') OR option_name LIKE %s OR option_name LIKE %s';
     633                $args = array_merge( $exact, $like );
     634                $db->query( 'DELETE FROM %i WHERE ' . $cond, $temp, ...$args );
     635                $db->query( 'INSERT INTO %i (option_name, option_value, autoload) SELECT option_name, option_value, autoload FROM %i WHERE ' . $cond, $temp, $live, ...$args );
    593636                return true;
    594637        }
  • accessnow-site-replica/trunk/includes/restore/class-files.php

    r3726758 r3815997  
    1717namespace AccessNow\Replica\Restore;
    1818
     19use AccessNow\Replica\Sets\Damaged_File;
    1920use AccessNow\Replica\Sets\Set_Files;
    2021use AccessNow\Replica\Storage;
    … …  
    4748         */
    4849        const LEGACY_DIRS = array( 'site-replica' );
     50
     51        /**
     52         * Live files up to this size (and every script) are hashed before an unchanged one is reused.
     53         */
     54        const LINK_CHECK_BYTES = 1048576;
    4955
    5056        /**
    … …  
    169175                        @unlink( $target ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.unlink_unlink -- Our own earlier attempt.
    170176                }
    171                 // Unchanged live file: hardlink it instead of copying.
     177                // Unchanged live file: hardlink it instead of copying. Size and time alone can be kept by an
     178                // edit (malware often resets the time), so a script or a small file must also have the bytes
     179                // the backup recorded; large media go by size and time, so a restore doesn't read them all.
    172180                $live = self::dest_root( $row['r'] ) . '/' . $rel;
    173181                clearstatcache( true, $live );
    174                 if ( is_file( $live ) && ! is_link( $live ) && (int) filesize( $live ) === (int) $row['s'] && (int) filemtime( $live ) === (int) $row['m'] && @link( $live, $target ) ) { // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
     182                if ( is_file( $live ) && ! is_link( $live ) && (int) filesize( $live ) === (int) $row['s'] && (int) filemtime( $live ) === (int) $row['m']
     183                        && ( ( (int) $row['s'] > self::LINK_CHECK_BYTES && ! Set_Files::is_script( $row ) ) || Set_Files::matches( $live, $row ) )
     184                        && @link( $live, $target ) ) { // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
    175185                        return 'linked';
    176186                }
    … …  
    178188                try {
    179189                        $copied = Set_Files::copy_out( $set_dir, $row, $target );
     190                } catch ( Damaged_File $e ) {
     191                        // The backup itself is damaged: stop before the swap, with this site untouched.
     192                        throw new \RuntimeException( sprintf( 'The backup is damaged: %s Nothing on this site has been changed. Restore another backup, or make a new one.', $e->getMessage() ) );
    180193                } catch ( \RuntimeException $e ) {
    181194                        return 'skipped'; // A path or checksum that is not allowed.
    … …  
    349362
    350363        /**
     364         * The plugin, theme or must-use plugin folder a path is inside, relative to its root
     365         * (plugins/foo for the content root, foo for the plugins root), or null when it is not inside
     366         * one: a single-file plugin, a top-level must-use plugin, media, or this plugin itself.
     367         *
     368         * The restore replaces each such folder whole, the way a plugin update does, so a file this site
     369         * has inside a folder the backup also has, and the backup doesn't, is removed.
     370         *
     371         * @param string $root Root key.
     372         * @param string $rel  Path relative to the root.
     373         * @return string|null
     374         */
     375        public static function replaced_folder( $root, $rel ) {
     376                $parts = explode( '/', (string) $rel );
     377                if ( 'content' === $root ) {
     378                        if ( count( $parts ) < 3 || ! in_array( $parts[0], array( 'plugins', 'mu-plugins', 'themes' ), true ) || '' === $parts[1] ) {
     379                                return null;
     380                        }
     381                        $folder = $parts[0] . '/' . $parts[1];
     382                } elseif ( in_array( $root, array( 'plugins', 'mu-plugins', 'themes' ), true ) ) {
     383                        if ( count( $parts ) < 2 || '' === $parts[0] ) {
     384                                return null;
     385                        }
     386                        $folder = $parts[0];
     387                } else {
     388                        return null;
     389                }
     390                return null === self::unit( $root, $folder ) ? null : $folder;
     391        }
     392
     393        /**
     394         * Files and folders this site has inside the plugin, theme and must-use plugin folders the backup
     395         * also has, which the backup doesn't: the restore replaces those folders whole, so it removes
     396         * them (Roll back puts them back). A folder the backup has nothing inside is listed once, with a
     397         * trailing slash, instead of file by file.
     398         *
     399         * @param string                     $set_dir Set dir.
     400         * @param int                        $limit   Most entries to list (the count covers them all).
     401         * @param array<string, string>|null $dirs    Root key => live directory (tests); null for this site's.
     402         * @return array{list: array[], count: int} list: {path (from wp-content's point of view), part (the swap unit, as the restore plan's parts name it)}.
     403         */
     404        public static function removed_in_folders( $set_dir, $limit = 200, $dirs = null ) {
     405                $out = array(
     406                        'list'  => array(),
     407                        'count' => 0,
     408                );
     409                $fh  = @fopen( $set_dir . 'index/files.jsonl', 'rb' ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.file_system_operations_fopen
     410                if ( ! $fh ) {
     411                        return $out;
     412                }
     413                // What the backup has inside those folders: every file and folder, and each file's folders.
     414                $folders = array();
     415                $have    = array();
     416                while ( false !== ( $line = fgets( $fh ) ) ) { // phpcs:ignore WordPress.CodeAnalysis.AssignmentInCondition
     417                        $row = json_decode( $line, true );
     418                        if ( ! is_array( $row ) || ! isset( $row['r'] ) || ! in_array( $row['t'] ?? '', array( 'f', 'd' ), true ) ) {
     419                                continue; // Links are not recreated, so a link here is removed like any other file.
     420                        }
     421                        $root = (string) $row['r'];
     422                        $rel  = Set_Files::relative( $row );
     423                        $top  = null === $rel ? null : self::replaced_folder( $root, $rel );
     424                        if ( null === $top ) {
     425                                continue;
     426                        }
     427                        $folders[ $root ][ $top ] = true;
     428                        for ( $p = $rel; strlen( $p ) > strlen( $top ) && ! isset( $have[ $root . '/' . $p ] ); $p = dirname( $p ) ) {
     429                                $have[ $root . '/' . $p ] = true;
     430                        }
     431                }
     432                fclose( $fh ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     433                ksort( $folders );
     434                foreach ( $folders as $root => $tops ) {
     435                        $base = null === $dirs ? self::dest_root( $root ) : ( $dirs[ $root ] ?? null );
     436                        if ( null === $base ) {
     437                                continue;
     438                        }
     439                        $tops = array_keys( $tops );
     440                        sort( $tops );
     441                        foreach ( $tops as $top ) {
     442                                $live = untrailingslashit( wp_normalize_path( $base ) ) . '/' . $top;
     443                                if ( is_dir( $live ) && ! is_link( $live ) ) {
     444                                        self::walk_extra( $root, $live, $top, $have, $limit, $out );
     445                                }
     446                        }
     447                }
     448                return $out;
     449        }
     450
     451        /**
     452         * One folder's part of removed_in_folders().
     453         *
     454         * @param string $root  Root key.
     455         * @param string $dir   Live folder.
     456         * @param string $rel   Its path relative to the root.
     457         * @param array  $have  What the backup has (root/rel => true).
     458         * @param int    $limit Most entries to list.
     459         * @param array  $out   Result, added to.
     460         */
     461        private static function walk_extra( $root, $dir, $rel, array $have, $limit, array &$out ) {
     462                foreach ( self::list_dir( $dir ) as $name ) {
     463                        $path   = $dir . '/' . $name;
     464                        $sub    = $rel . '/' . $name;
     465                        $folder = is_dir( $path ) && ! is_link( $path );
     466                        if ( isset( $have[ $root . '/' . $sub ] ) ) {
     467                                if ( $folder ) {
     468                                        self::walk_extra( $root, $path, $sub, $have, $limit, $out );
     469                                }
     470                                continue;
     471                        }
     472                        ++$out['count'];
     473                        if ( count( $out['list'] ) < $limit ) {
     474                                $out['list'][] = array(
     475                                        'path' => ( 'content' === $root ? '' : $root . '/' ) . $sub . ( $folder ? '/' : '' ),
     476                                        'part' => $root . '/' . self::unit( $root, $sub ),
     477                                );
     478                        }
     479                }
     480        }
     481
     482        /**
    351483         * Performs the swap, journalling each rename first. Returns the journal path.
    352484         *
  • accessnow-site-replica/trunk/includes/sets/class-set-files.php

    r3726758 r3815997  
    309309
    310310        /**
    311          * Writes a stored file out to $dest, uncompressed.
     311         * Writes a stored file out to $dest, uncompressed, checking it against the checksum the index
     312         * recorded when the backup was made (rows without one, from older backups, are copied as they are).
    312313         *
    313314         * @param string $dir  Set dir.
    314315         * @param array  $row  Index row.
    315316         * @param string $dest Destination path.
    316          * @return bool
     317         * @return bool False when it couldn't be read or written.
     318         * @throws Damaged_File When the stored file no longer matches its checksum ($dest is removed).
    317319         */
    318320        public static function copy_out( $dir, array $row, $dest ) {
    319321                list( $path, $z ) = self::source( $dir, $row );
    320                 return @copy( ( $z ? 'compress.zlib://' : '' ) . $path, $dest ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
     322                $expect = strtolower( (string) ( $row['h'] ?? '' ) );
     323                $in     = @fopen( ( $z ? 'compress.zlib://' : '' ) . $path, 'rb' ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.file_system_operations_fopen
     324                if ( ! $in ) {
     325                        return false;
     326                }
     327                $out = @fopen( $dest, 'wb' ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.file_system_operations_fopen
     328                if ( ! $out ) {
     329                        fclose( $in ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     330                        return false;
     331                }
     332                $ctx = hash_init( 'sha256' );
     333                $ok  = true;
     334                while ( ! feof( $in ) ) {
     335                        $buf = fread( $in, 1048576 ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fread
     336                        if ( false === $buf ) {
     337                                $ok = false; // A compressed object that is cut off or corrupt fails here.
     338                                break;
     339                        }
     340                        hash_update( $ctx, $buf );
     341                        if ( '' !== $buf && fwrite( $out, $buf ) !== strlen( $buf ) ) { // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fwrite
     342                                fclose( $in ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     343                                fclose( $out ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     344                                @unlink( $dest ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.unlink_unlink
     345                                return false; // Disk full.
     346                        }
     347                }
     348                fclose( $in ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     349                fclose( $out ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     350                $sha = hash_final( $ctx );
     351                if ( preg_match( '/^[0-9a-f]{64}$/', $expect ) && ( ! $ok || ! hash_equals( $expect, $sha ) ) ) {
     352                        @unlink( $dest ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.unlink_unlink
     353                        throw new Damaged_File( sprintf( '%s no longer matches the checksum recorded when the backup was made.', (string) self::relative( $row ) ) );
     354                }
     355                if ( ! $ok ) {
     356                        @unlink( $dest ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.unlink_unlink
     357                        return false;
     358                }
     359                return true;
     360        }
     361
     362        /**
     363         * Whether a stored file still has the bytes the index recorded: true, false (missing, unreadable
     364         * or changed), or null when the row has no checksum to compare with (very old backups).
     365         *
     366         * @param string $dir Set dir.
     367         * @param array  $row Index row.
     368         * @return bool|null
     369         */
     370        public static function intact( $dir, array $row ) {
     371                $expect = strtolower( (string) ( $row['h'] ?? '' ) );
     372                if ( ! preg_match( '/^[0-9a-f]{64}$/', $expect ) ) {
     373                        return self::present( $dir, $row ) ? null : false;
     374                }
     375                try {
     376                        list( $path, $z ) = self::source( $dir, $row );
     377                } catch ( \RuntimeException $e ) {
     378                        return false;
     379                }
     380                $in = @fopen( ( $z ? 'compress.zlib://' : '' ) . $path, 'rb' ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged, WordPress.WP.AlternativeFunctions.file_system_operations_fopen
     381                if ( ! $in ) {
     382                        return false;
     383                }
     384                $ctx = hash_init( 'sha256' );
     385                while ( ! feof( $in ) ) {
     386                        $buf = fread( $in, 1048576 ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fread
     387                        if ( false === $buf ) {
     388                                fclose( $in ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     389                                return false;
     390                        }
     391                        hash_update( $ctx, $buf );
     392                }
     393                fclose( $in ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     394                return hash_equals( $expect, hash_final( $ctx ) );
     395        }
     396
     397        /**
     398         * Whether a file on this site has exactly the bytes an index row recorded (rows without a checksum: no).
     399         *
     400         * @param string $file File.
     401         * @param array  $row  Index row.
     402         */
     403        public static function matches( $file, array $row ) {
     404                $expect = strtolower( (string) ( $row['h'] ?? '' ) );
     405                if ( ! preg_match( '/^[0-9a-f]{64}$/', $expect ) ) {
     406                        return false;
     407                }
     408                $sha = @hash_file( 'sha256', $file ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
     409                return is_string( $sha ) && hash_equals( $expect, $sha );
    321410        }
    322411
  • accessnow-site-replica/trunk/includes/source/class-api.php

    r3726810 r3815997  
    141141                } catch ( \Throwable $e ) {
    142142                        $message = $e instanceof Db_Exception ? 'Database error: ' . $e->getMessage() : $e->getMessage();
    143                         Frame_Codec::add_json( $this->enc, 'X', array( 'error' => $message ) );
     143                        $error   = array( 'error' => $message );
     144                        if ( $e instanceof Resend_Error ) {
     145                                $error['code'] = $e->error_code; // Not the sender's fault: it sends the same data again.
     146                        }
     147                        Frame_Codec::add_json( $this->enc, 'X', $error );
    144148                        Logger::audit( 'Operation failed.', array( 'op' => $op, 'error' => $message ) );
    145149                        $end = array( 'ok' => false );
  • accessnow-site-replica/trunk/languages/accessnow-site-replica.pot

    r3736115 r3815997  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: AccessNow Site Replica 1.0.4\n"
     5"Project-Id-Version: AccessNow Site Replica 1.1.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/accessnow-site-replica\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-10-09T04:10:54+00:00\n"
     12"POT-Creation-Date: 2026-11-21T16:13:50+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    4141
    4242#: includes/admin/class-admin.php:63
    43 #: includes/admin/class-admin.php:232
     43#: includes/admin/class-admin.php:236
    4444msgid "Site Replica"
    4545msgstr ""
    … …  
    5050
    5151#: includes/admin/class-admin.php:65
    52 #: includes/admin/class-admin.php:243
    53 #: includes/admin/class-admin.php:275
     52#: includes/admin/class-admin.php:247
     53#: includes/admin/class-admin.php:279
    5454msgid "Pull & Clone"
    5555msgstr ""
    5656
    5757#: includes/admin/class-admin.php:66
    58 #: includes/admin/class-admin.php:264
    59 #: includes/admin/class-admin.php:354
     58#: includes/admin/class-admin.php:268
     59#: includes/admin/class-admin.php:358
    6060msgid "Backups"
    6161msgstr ""
    6262
    6363#: includes/admin/class-admin.php:68
    64 #: includes/admin/class-admin.php:254
    65 #: includes/admin/class-admin.php:482
     64#: includes/admin/class-admin.php:258
     65#: includes/admin/class-admin.php:503
    6666msgid "This Site as a Source"
    6767msgstr ""
    6868
    6969#: includes/admin/class-admin.php:69
    70 #: includes/admin/class-admin.php:608
     70#: includes/admin/class-admin.php:629
    7171msgid "Logs"
    7272msgstr ""
    7373
    7474#: includes/admin/class-admin.php:70
    75 #: includes/admin/class-admin.php:637
     75#: includes/admin/class-admin.php:658
    7676msgid "Settings"
    7777msgstr ""
    … …  
    163163
    164164#: includes/admin/class-admin.php:116
    165 #: includes/admin/class-admin.php:396
     165#: includes/admin/class-admin.php:400
    166166msgid "Database"
    167167msgstr ""
    168168
    169169#: includes/admin/class-admin.php:117
    170 #: includes/admin/class-admin.php:397
     170#: includes/admin/class-admin.php:401
    171171msgid "Files"
    172172msgstr ""
    … …  
    185185
    186186#: includes/admin/class-admin.php:121
     187msgid "Files in plugin, theme and must-use plugin folders that the backup also has, which only this site has. Each of those folders is replaced whole, the way an update replaces it, so these will be removed (Roll back returns them):"
     188msgstr ""
     189
     190#. translators: %s: number of files not listed.
     191#: includes/admin/class-admin.php:123
     192#, php-format
     193msgid "…and %s more."
     194msgstr ""
     195
     196#: includes/admin/class-admin.php:124
    187197msgid "Media and must-use plugins that exist only on this site are kept."
    188198msgstr ""
    189199
    190 #: includes/admin/class-admin.php:122
     200#: includes/admin/class-admin.php:125
    191201msgid "Keep me logged in (carry my account over)"
    192202msgstr ""
    193203
    194 #: includes/admin/class-admin.php:123
     204#: includes/admin/class-admin.php:126
    195205msgid "Discourage search engines from indexing this copy"
    196206msgstr ""
    197207
    198 #: includes/admin/class-admin.php:124
     208#: includes/admin/class-admin.php:127
    199209msgid "Block all outgoing email from this copy"
    200210msgstr ""
    201211
    202 #: includes/admin/class-admin.php:125
     212#: includes/admin/class-admin.php:128
    203213msgid "Deactivate SSL-forcing plugins (this site uses http)"
    204214msgstr ""
    205215
    206 #: includes/admin/class-admin.php:126
     216#: includes/admin/class-admin.php:129
    207217msgid "Leave post GUIDs unchanged (recommended when moving a live site)"
    208218msgstr ""
    209219
    210 #: includes/admin/class-admin.php:127
     220#: includes/admin/class-admin.php:130
    211221msgid "Restore files (uploads, plugins, themes)"
    212222msgstr ""
    213223
    214224#. translators: %s: this site's host name.
    215 #: includes/admin/class-admin.php:129
     225#: includes/admin/class-admin.php:132
    216226#, php-format
    217227msgid "This replaces a live site. Type %s to confirm:"
    218228msgstr ""
    219229
    220 #: includes/admin/class-admin.php:130
     230#: includes/admin/class-admin.php:133
    221231msgid "Replace this site with the backup"
    222232msgstr ""
    223233
    224 #: includes/admin/class-admin.php:131
     234#: includes/admin/class-admin.php:134
    225235msgid "Keep the restored site"
    226236msgstr ""
    227237
    228 #: includes/admin/class-admin.php:132
     238#: includes/admin/class-admin.php:135
    229239msgid "Roll back"
    230240msgstr ""
    231241
    232 #: includes/admin/class-admin.php:133
     242#: includes/admin/class-admin.php:136
    233243msgid "Open the site in a new tab"
    234244msgstr ""
    235245
    236 #: includes/admin/class-admin.php:134
     246#: includes/admin/class-admin.php:137
    237247msgid "Keep the restored site and delete the previous version?"
    238248msgstr ""
    239249
    240 #: includes/admin/class-admin.php:135
     250#: includes/admin/class-admin.php:138
    241251msgid "Put the previous site back exactly as it was?"
    242252msgstr ""
    243253
    244 #: includes/admin/class-admin.php:136
     254#: includes/admin/class-admin.php:139
    245255msgid "rows"
    246256msgstr ""
    247257
    248 #: includes/admin/class-admin.php:137
     258#: includes/admin/class-admin.php:140
    249259msgid "tables"
    250260msgstr ""
    251261
    252262#. translators: %s: size, e.g. 12 MB.
    253 #: includes/admin/class-admin.php:139
     263#: includes/admin/class-admin.php:142
    254264#, php-format
    255265msgid "%s uploaded"
    … …  
    257267
    258268#. translators: %s: size, e.g. 12 MB.
    259 #: includes/admin/class-admin.php:141
     269#: includes/admin/class-admin.php:144
    260270#, php-format
    261271msgid "%s downloaded"
    … …  
    263273
    264274#. translators: 1: current step, 2: number of steps.
    265 #: includes/admin/class-admin.php:143
     275#: includes/admin/class-admin.php:146
    266276#, php-format
    267277msgid "step %1$s of %2$s"
    … …  
    269279
    270280#. translators: %s: number of files.
    271 #: includes/admin/class-admin.php:145
    272 #: includes/admin/class-admin.php:147
     281#: includes/admin/class-admin.php:148
     282#: includes/admin/class-admin.php:150
    273283#, php-format
    274284msgid "%s file"
    … …  
    278288
    279289#. translators: %s: number of rows.
    280 #: includes/admin/class-admin.php:149
    281 #: includes/admin/class-admin.php:151
     290#: includes/admin/class-admin.php:152
     291#: includes/admin/class-admin.php:154
    282292#, php-format
    283293msgid "%s row"
    … …  
    287297
    288298#. translators: %s: number of warnings.
    289 #: includes/admin/class-admin.php:153
    290 #: includes/admin/class-admin.php:155
     299#: includes/admin/class-admin.php:156
     300#: includes/admin/class-admin.php:158
    291301#, php-format
    292302msgid "%s warning"
    … …  
    296306
    297307#. translators: %s: number of unchanged files.
    298 #: includes/admin/class-admin.php:157
     308#: includes/admin/class-admin.php:160
    299309#, php-format
    300310msgid "%s unchanged"
    … …  
    302312
    303313#. translators: %s: seconds.
    304 #: includes/admin/class-admin.php:159
     314#: includes/admin/class-admin.php:162
    305315#, php-format
    306316msgid "retrying in %s s"
    307317msgstr ""
    308318
    309 #: includes/admin/class-admin.php:161
    310 #: includes/admin/class-admin.php:1042
     319#: includes/admin/class-admin.php:164
     320#: includes/admin/class-admin.php:1067
    311321msgid "Starting"
    312322msgstr ""
    313323
    314 #: includes/admin/class-admin.php:162
    315 #: includes/admin/class-admin.php:1043
     324#: includes/admin/class-admin.php:165
     325#: includes/admin/class-admin.php:1068
    316326msgid "Running"
    317327msgstr ""
    318328
    319 #: includes/admin/class-admin.php:163
    320 #: includes/admin/class-admin.php:1044
     329#: includes/admin/class-admin.php:166
     330#: includes/admin/class-admin.php:1069
    321331msgid "Waiting to retry"
    322332msgstr ""
    323333
    324 #: includes/admin/class-admin.php:164
    325 #: includes/admin/class-admin.php:1045
     334#: includes/admin/class-admin.php:167
     335#: includes/admin/class-admin.php:1070
    326336msgid "Paused"
    327337msgstr ""
    328338
    329 #: includes/admin/class-admin.php:165
    330 #: includes/admin/class-admin.php:1046
     339#: includes/admin/class-admin.php:168
     340#: includes/admin/class-admin.php:1071
    331341msgid "Stopped with an error"
    332342msgstr ""
    333343
    334 #: includes/admin/class-admin.php:166
    335 #: includes/admin/class-admin.php:1047
     344#: includes/admin/class-admin.php:169
     345#: includes/admin/class-admin.php:1072
    336346#: includes/admin/class-cloud-page.php:290
    337347msgid "Cancelled"
    338348msgstr ""
    339349
    340 #: includes/admin/class-admin.php:167
    341 #: includes/admin/class-admin.php:1048
     350#: includes/admin/class-admin.php:170
     351#: includes/admin/class-admin.php:1073
    342352msgid "Completed"
    343353msgstr ""
    344354
    345 #: includes/admin/class-admin.php:168
     355#: includes/admin/class-admin.php:171
    346356msgid "Waiting for you"
    347357msgstr ""
    348358
    349 #: includes/admin/class-admin.php:171
    350 #: includes/admin/class-admin.php:680
     359#: includes/admin/class-admin.php:174
     360#: includes/admin/class-admin.php:704
    351361msgid "Pull backup"
    352362msgstr ""
    353363
    354 #: includes/admin/class-admin.php:172
    355 #: includes/admin/class-admin.php:313
    356 #: includes/admin/class-admin.php:681
     364#: includes/admin/class-admin.php:175
     365#: includes/admin/class-admin.php:317
     366#: includes/admin/class-admin.php:705
    357367msgid "Clone into this site"
    358368msgstr ""
    359369
    360 #: includes/admin/class-admin.php:173
    361 #: includes/admin/class-admin.php:682
     370#: includes/admin/class-admin.php:176
     371#: includes/admin/class-admin.php:706
    362372msgid "Restore"
    363373msgstr ""
    364374
    365 #: includes/admin/class-admin.php:174
    366 #: includes/admin/class-admin.php:369
    367 #: includes/admin/class-admin.php:683
     375#: includes/admin/class-admin.php:177
     376#: includes/admin/class-admin.php:707
     377msgid "Check backup"
     378msgstr ""
     379
     380#: includes/admin/class-admin.php:178
     381#: includes/admin/class-admin.php:373
     382#: includes/admin/class-admin.php:708
    368383msgid "Back up this site"
    369384msgstr ""
    370385
    371 #: includes/admin/class-admin.php:175
    372 #: includes/admin/class-admin.php:684
     386#: includes/admin/class-admin.php:179
     387#: includes/admin/class-admin.php:709
    373388msgid "Cloud backup"
    374389msgstr ""
    375390
    376 #: includes/admin/class-admin.php:176
    377 #: includes/admin/class-admin.php:685
     391#: includes/admin/class-admin.php:180
     392#: includes/admin/class-admin.php:710
    378393msgid "Database backup to the cloud"
    379394msgstr ""
    380395
    381 #: includes/admin/class-admin.php:177
    382 #: includes/admin/class-admin.php:686
     396#: includes/admin/class-admin.php:181
     397#: includes/admin/class-admin.php:711
    383398msgid "Download from the cloud"
    384399msgstr ""
    385400
    386 #: includes/admin/class-admin.php:179
     401#: includes/admin/class-admin.php:183
    387402msgid "This backup runs on the server: you can close this page. You will find the result here and, if you chose so, by e-mail."
    388403msgstr ""
    389404
    390 #: includes/admin/class-admin.php:199
     405#: includes/admin/class-admin.php:203
    391406msgid "The backup folder can be downloaded from the web on this server (it ignores the folder’s .htaccess protection). Ask your host to stop serving that folder, or set ACCESSNOW_REPLICA_STORAGE_DIR in wp-config.php to a folder the web server does not serve, before making backups here."
    392407msgstr ""
    393408
    394 #: includes/admin/class-admin.php:218
     409#: includes/admin/class-admin.php:222
    395410msgid "This copy is not sending email. A restore installed a guard so a copied site cannot email the original site’s people. Delete wp-content/mu-plugins/accessnow-replica-mail-guard.php to allow email again."
    396411msgstr ""
    397412
    398 #: includes/admin/class-admin.php:241
     413#: includes/admin/class-admin.php:245
    399414msgid "Back up a live site to this computer"
    400415msgstr ""
    401416
    402 #: includes/admin/class-admin.php:242
     417#: includes/admin/class-admin.php:246
    403418msgid "Pull a complete copy (database and wp-content) from another WordPress site running Site Replica. Nothing large is written on that server."
    404419msgstr ""
    405420
    406 #: includes/admin/class-admin.php:246
     421#: includes/admin/class-admin.php:250
    407422msgid "Let another site pull this one"
    408423msgstr ""
    409424
    410 #: includes/admin/class-admin.php:250
    411 #: includes/admin/class-admin.php:512
     425#: includes/admin/class-admin.php:254
     426#: includes/admin/class-admin.php:533
    412427msgid "Pulling is ON"
    413428msgstr ""
    414429
    415 #: includes/admin/class-admin.php:251
    416 #: includes/admin/class-admin.php:515
     430#: includes/admin/class-admin.php:255
     431#: includes/admin/class-admin.php:536
    417432msgid "Pulling is off"
    418433msgstr ""
    419434
    420 #: includes/admin/class-admin.php:257
     435#: includes/admin/class-admin.php:261
    421436msgid "Backups on this computer"
    422437msgstr ""
    423438
    424439#. translators: %d: number of backup sets.
    425 #: includes/admin/class-admin.php:261
     440#: includes/admin/class-admin.php:265
    426441#, php-format
    427442msgid "%d backup set"
    … …  
    430445msgstr[1] ""
    431446
    432 #: includes/admin/class-admin.php:283
     447#: includes/admin/class-admin.php:287
    433448msgid "Saved connections can no longer be decrypted (the security keys in wp-config.php changed). Add the connections again."
    434449msgstr ""
    435450
    436 #: includes/admin/class-admin.php:286
     451#: includes/admin/class-admin.php:290
    437452msgid "Connected sites"
    438453msgstr ""
    439454
    440 #: includes/admin/class-admin.php:288
     455#: includes/admin/class-admin.php:292
    441456msgid "No sites yet. Add one below with a connection key."
    442457msgstr ""
    443458
    444 #: includes/admin/class-admin.php:292
     459#: includes/admin/class-admin.php:296
    445460msgid "Site"
    446461msgstr ""
    447462
    448 #: includes/admin/class-admin.php:293
    449 #: includes/admin/class-admin.php:735
     463#: includes/admin/class-admin.php:297
     464#: includes/admin/class-admin.php:760
    450465msgid "Details"
    451466msgstr ""
    452467
    453 #: includes/admin/class-admin.php:294
     468#: includes/admin/class-admin.php:298
    454469msgid "Last backup"
    455470msgstr ""
    456471
    457 #: includes/admin/class-admin.php:295
     472#: includes/admin/class-admin.php:299
    458473msgid "Key expires"
    459474msgstr ""
    460475
    461 #: includes/admin/class-admin.php:310
    462 #: includes/admin/class-admin.php:547
    463 #: includes/admin/class-admin.php:590
     476#: includes/admin/class-admin.php:314
     477#: includes/admin/class-admin.php:568
     478#: includes/admin/class-admin.php:611
    464479#: includes/admin/class-cloud-page.php:359
    465480msgid "Never"
    466481msgstr ""
    467482
    468 #: includes/admin/class-admin.php:312
     483#: includes/admin/class-admin.php:316
    469484msgid "Pull backup now"
    470485msgstr ""
    471486
    472 #: includes/admin/class-admin.php:313
     487#: includes/admin/class-admin.php:317
    473488msgid "Pull a fresh backup, then replace this site with it (you review the plan before anything changes)."
    474489msgstr ""
    475490
    476 #: includes/admin/class-admin.php:314
     491#: includes/admin/class-admin.php:318
    477492msgid "Remove this connection? Backups already made are kept."
    478493msgstr ""
    479494
    480 #: includes/admin/class-admin.php:318
     495#: includes/admin/class-admin.php:322
    481496msgid "Remove"
    482497msgstr ""
    483498
    484 #: includes/admin/class-admin.php:327
     499#: includes/admin/class-admin.php:331
    485500msgid "Add a site"
    486501msgstr ""
    487502
    488 #: includes/admin/class-admin.php:329
     503#: includes/admin/class-admin.php:333
    489504msgid "On the site you want to back up, install Site Replica and go to Site Replica → This Site as a Source."
    490505msgstr ""
    491506
    492 #: includes/admin/class-admin.php:330
     507#: includes/admin/class-admin.php:334
    493508msgid "Turn pulling on and generate a connection key."
    494509msgstr ""
    495510
    496 #: includes/admin/class-admin.php:331
     511#: includes/admin/class-admin.php:335
    497512msgid "Paste the key here."
    498513msgstr ""
    499514
    500 #: includes/admin/class-admin.php:336
     515#: includes/admin/class-admin.php:340
    501516msgid "Connection key"
    502517msgstr ""
    503518
    504 #: includes/admin/class-admin.php:338
     519#: includes/admin/class-admin.php:342
    505520msgid "Connect and check"
    506521msgstr ""
    507522
    508523#. translators: %s: storage path.
    509 #: includes/admin/class-admin.php:343
     524#: includes/admin/class-admin.php:347
    510525#, php-format
    511526msgid "Backups are stored in %s"
    … …  
    513528
    514529#. translators: %s: storage path.
    515 #: includes/admin/class-admin.php:365
     530#: includes/admin/class-admin.php:369
    516531#, php-format
    517532msgid "Stored in %s"
    518533msgstr ""
    519534
    520 #: includes/admin/class-admin.php:370
     535#: includes/admin/class-admin.php:374
    521536msgid "Makes a backup of this site, stored on this server. If something goes wrong later, restore it from the list below."
    522537msgstr ""
    523538
    524 #: includes/admin/class-admin.php:373
     539#: includes/admin/class-admin.php:377
    525540msgid "No backups yet."
    526541msgstr ""
    527542
    528 #: includes/admin/class-admin.php:388
     543#: includes/admin/class-admin.php:392
    529544msgid "Delete selected"
    530545msgstr ""
    531546
    532 #: includes/admin/class-admin.php:393
     547#: includes/admin/class-admin.php:397
    533548msgid "Select all backups"
    534549msgstr ""
    535550
    536 #: includes/admin/class-admin.php:394
     551#: includes/admin/class-admin.php:398
    537552#: includes/admin/class-cloud-page.php:433
    538553msgid "Backup"
    539554msgstr ""
    540555
    541 #: includes/admin/class-admin.php:395
     556#: includes/admin/class-admin.php:399
    542557msgid "Source"
    543558msgstr ""
    544559
    545 #: includes/admin/class-admin.php:398
     560#: includes/admin/class-admin.php:402
    546561#: includes/admin/class-cloud-page.php:435
    547562msgid "Status"
    … …  
    549564
    550565#. translators: %s: backup date.
    551 #: includes/admin/class-admin.php:414
     566#: includes/admin/class-admin.php:418
    552567#, php-format
    553568msgid "Select backup of %s"
    … …  
    555570
    556571#. translators: 1: tables, 2: rows.
    557 #: includes/admin/class-admin.php:423
     572#: includes/admin/class-admin.php:427
    558573#, php-format
    559574msgid "%1$d tables, %2$s rows"
    … …  
    561576
    562577#. translators: 1: files, 2: size.
    563 #: includes/admin/class-admin.php:433
     578#: includes/admin/class-admin.php:437
    564579#, php-format
    565580msgid "%1$s files, %2$s"
    … …  
    567582
    568583#. translators: %s: count.
    569 #: includes/admin/class-admin.php:436
     584#: includes/admin/class-admin.php:440
    570585#, php-format
    571586msgid "%s unchanged (linked)"
    572587msgstr ""
    573588
    574 #: includes/admin/class-admin.php:445
     589#: includes/admin/class-admin.php:449
    575590#: includes/admin/class-cloud-page.php:450
    576591msgid "Complete"
    577592msgstr ""
    578593
     594#. translators: %s: date.
     595#: includes/admin/class-admin.php:455
     596#, php-format
     597msgid "Checked %s: intact"
     598msgstr ""
     599
     600#. translators: %s: date.
     601#: includes/admin/class-admin.php:462
     602#, php-format
     603msgid "Damaged (checked %s)"
     604msgstr ""
     605
    579606#. translators: %d: warnings.
    580 #: includes/admin/class-admin.php:450
     607#: includes/admin/class-admin.php:470
    581608#, php-format
    582609msgid "%d warning"
    … …  
    585612msgstr[1] ""
    586613
    587 #: includes/admin/class-admin.php:455
     614#: includes/admin/class-admin.php:475
    588615msgid "Incomplete"
    589616msgstr ""
    590617
    591 #: includes/admin/class-admin.php:460
     618#: includes/admin/class-admin.php:480
    592619msgid "Restore to this site"
    593620msgstr ""
    594621
    595 #: includes/admin/class-admin.php:462
     622#: includes/admin/class-admin.php:481
     623msgid "Read the whole backup back and compare every part with what was backed up, to find damage before you need it."
     624msgstr ""
     625
     626#: includes/admin/class-admin.php:481
     627msgid "Check"
     628msgstr ""
     629
     630#: includes/admin/class-admin.php:483
    596631msgid "Delete this backup permanently?"
    597632msgstr ""
    598633
    599 #: includes/admin/class-admin.php:466
    600 #: includes/admin/class-admin.php:566
     634#: includes/admin/class-admin.php:487
     635#: includes/admin/class-admin.php:587
    601636#: includes/admin/class-cloud-page.php:463
    602637msgid "Delete"
    603638msgstr ""
    604639
    605 #: includes/admin/class-admin.php:491
     640#: includes/admin/class-admin.php:512
    606641msgid "Another site running Site Replica can pull a full copy of this one: the database and wp-content. The copy is streamed in small encrypted pieces, so nothing large is written on this server."
    607642msgstr ""
    608643
    609 #: includes/admin/class-admin.php:493
     644#: includes/admin/class-admin.php:514
    610645msgid "This site is not using HTTPS, so pull requests will be refused. Enable SSL first."
    611646msgstr ""
    612647
    613 #: includes/admin/class-admin.php:498
     648#: includes/admin/class-admin.php:519
    614649msgid "Your new connection key"
    615650msgstr ""
    616651
    617 #: includes/admin/class-admin.php:499
     652#: includes/admin/class-admin.php:520
    618653msgid "Copy it now: it will not be shown again."
    619654msgstr ""
    620655
    621 #: includes/admin/class-admin.php:499
     656#: includes/admin/class-admin.php:520
    622657msgid "Paste it into Site Replica → Pull & Clone on the computer that will make the backup. Anyone with this key can copy this whole site, so keep it private."
    623658msgstr ""
    624659
    625 #: includes/admin/class-admin.php:501
     660#: includes/admin/class-admin.php:522
    626661msgid "Copy key"
    627662msgstr ""
    628663
    629 #: includes/admin/class-admin.php:513
     664#: includes/admin/class-admin.php:534
    630665msgid "Turn off"
    631666msgstr ""
    632667
    633 #: includes/admin/class-admin.php:516
     668#: includes/admin/class-admin.php:537
    634669msgid "Turn on"
    635670msgstr ""
    636671
    637 #: includes/admin/class-admin.php:522
     672#: includes/admin/class-admin.php:543
    638673msgid "Connection keys"
    639674msgstr ""
    640675
    641 #: includes/admin/class-admin.php:526
    642 #: includes/admin/class-admin.php:582
     676#: includes/admin/class-admin.php:547
     677#: includes/admin/class-admin.php:603
    643678msgid "Label"
    644679msgstr ""
    645680
    646 #: includes/admin/class-admin.php:527
     681#: includes/admin/class-admin.php:548
    647682msgid "Created"
    648683msgstr ""
    649684
    650 #: includes/admin/class-admin.php:528
     685#: includes/admin/class-admin.php:549
    651686msgid "Expires"
    652687msgstr ""
    653688
    654 #: includes/admin/class-admin.php:529
     689#: includes/admin/class-admin.php:550
    655690msgid "Allowed IPs"
    656691msgstr ""
    657692
    658 #: includes/admin/class-admin.php:530
     693#: includes/admin/class-admin.php:551
    659694msgid "Last used"
    660695msgstr ""
    661696
    662 #: includes/admin/class-admin.php:543
     697#: includes/admin/class-admin.php:564
    663698msgid "Revoked"
    664699msgstr ""
    665700
    666 #: includes/admin/class-admin.php:545
     701#: includes/admin/class-admin.php:566
    667702msgid "Expired"
    668703msgstr ""
    669704
    670 #: includes/admin/class-admin.php:551
     705#: includes/admin/class-admin.php:572
    671706msgid "Any"
    672707msgstr ""
    673708
    674 #: includes/admin/class-admin.php:559
     709#: includes/admin/class-admin.php:580
    675710msgid "Revoke"
    676711msgstr ""
    677712
    678 #: includes/admin/class-admin.php:575
     713#: includes/admin/class-admin.php:596
    679714msgid "No keys yet."
    680715msgstr ""
    681716
    682 #: includes/admin/class-admin.php:578
     717#: includes/admin/class-admin.php:599
    683718msgid "Generate a key"
    684719msgstr ""
    685720
    686 #: includes/admin/class-admin.php:583
     721#: includes/admin/class-admin.php:604
    687722msgid "e.g. Staging site"
    688723msgstr ""
    689724
    690 #: includes/admin/class-admin.php:584
     725#: includes/admin/class-admin.php:605
    691726msgid "Expires after"
    692727msgstr ""
    693728
    694 #: includes/admin/class-admin.php:586
     729#: includes/admin/class-admin.php:607
    695730msgid "1 day"
    696731msgstr ""
    697732
    698 #: includes/admin/class-admin.php:587
     733#: includes/admin/class-admin.php:608
    699734msgid "7 days"
    700735msgstr ""
    701736
    702 #: includes/admin/class-admin.php:588
     737#: includes/admin/class-admin.php:609
    703738msgid "30 days"
    704739msgstr ""
    705740
    706 #: includes/admin/class-admin.php:589
     741#: includes/admin/class-admin.php:610
    707742msgid "1 year"
    708743msgstr ""
    709744
    710 #: includes/admin/class-admin.php:592
     745#: includes/admin/class-admin.php:613
    711746msgid "Only allow these IP addresses (optional)"
    712747msgstr ""
    713748
    714 #: includes/admin/class-admin.php:594
     749#: includes/admin/class-admin.php:615
    715750msgid "Comma-separated. Leave empty to allow any address. Doesn’t work if the site is behind Cloudflare."
    716751msgstr ""
    717752
    718 #: includes/admin/class-admin.php:595
     753#: includes/admin/class-admin.php:616
    719754msgid "Generate key"
    720755msgstr ""
    721756
    722 #: includes/admin/class-admin.php:598
     757#: includes/admin/class-admin.php:619
    723758msgid "Recent pull activity"
    724759msgstr ""
    725760
    726 #: includes/admin/class-admin.php:609
     761#: includes/admin/class-admin.php:630
    727762msgid "Jobs"
    728763msgstr ""
    729764
    730 #: includes/admin/class-admin.php:612
     765#: includes/admin/class-admin.php:633
    731766msgid "No jobs yet."
    732767msgstr ""
    733768
    734 #: includes/admin/class-admin.php:622
     769#: includes/admin/class-admin.php:643
    735770msgid "Activity"
    736771msgstr ""
    737772
    738 #: includes/admin/class-admin.php:627
     773#: includes/admin/class-admin.php:648
    739774msgid "Pull requests from other sites"
    740775msgstr ""
    741776
    742 #: includes/admin/class-admin.php:644
     777#: includes/admin/class-admin.php:665
    743778msgid "Storage folder"
    744779msgstr ""
    745780
    746 #: includes/admin/class-admin.php:646
     781#: includes/admin/class-admin.php:667
    747782msgid "Set ACCESSNOW_REPLICA_STORAGE_DIR in wp-config.php to choose another folder."
    748783msgstr ""
    749784
    750 #: includes/admin/class-admin.php:647
     785#: includes/admin/class-admin.php:668
    751786msgid "Work in slices of (seconds)"
    752787msgstr ""
    753788
    754 #: includes/admin/class-admin.php:649
     789#: includes/admin/class-admin.php:670
    755790msgid "0 = automatic (below the host’s time limit)."
    756791msgstr ""
    757792
    758 #: includes/admin/class-admin.php:650
     793#: includes/admin/class-admin.php:671
    759794msgid "Source time per request (ms)"
    760795msgstr ""
    761796
    762 #: includes/admin/class-admin.php:652
     797#: includes/admin/class-admin.php:673
    763798msgid "Data per request (bytes)"
    764799msgstr ""
    765800
    766 #: includes/admin/class-admin.php:654
     801#: includes/admin/class-admin.php:675
    767802msgid "Backups to keep per site"
    768803msgstr ""
    769804
    770 #: includes/admin/class-admin.php:656
     805#: includes/admin/class-admin.php:677
    771806msgid "0 = keep all. Unchanged files are shared between backups, so extra backups use little space."
    772807msgstr ""
    773808
    774 #: includes/admin/class-admin.php:657
     809#: includes/admin/class-admin.php:678
    775810msgid "Also exclude (on this site as a source)"
    776811msgstr ""
    777812
    778 #: includes/admin/class-admin.php:659
    779 msgid "One pattern per line, relative to wp-content. Caches, other backup plugins’ folders, .git and node_modules are always excluded."
    780 msgstr ""
    781 
    782 #: includes/admin/class-admin.php:660
     813#: includes/admin/class-admin.php:680
     814msgid "One pattern per line, relative to wp-content. Start a line with **/ to leave out a name wherever it is, for example **/*.log. Caches, other backup plugins’ folders, .git and node_modules are always excluded."
     815msgstr ""
     816
     817#: includes/admin/class-admin.php:681
     818msgid "Developer files"
     819msgstr ""
     820
     821#: includes/admin/class-admin.php:682
     822msgid "Leave developer files out of themes and plugins developed on this site"
     823msgstr ""
     824
     825#: includes/admin/class-admin.php:683
     826msgid "For a theme or plugin that is a git working copy (it has a .git folder): its docs, tests, bin, scripts, composer and package files, notes (*.md, CLAUDE.md) and, when composer.json asks only for development packages, vendor. Themes and plugins installed from a ZIP are never touched. Files already sent to another site stay there until you remove them."
     827msgstr ""
     828
     829#: includes/admin/class-admin.php:684
    783830msgid "Transients"
    784831msgstr ""
    785832
    786 #: includes/admin/class-admin.php:661
     833#: includes/admin/class-admin.php:685
    787834msgid "Include cached transients in the database export (usually not needed)"
    788835msgstr ""
    789836
    790 #: includes/admin/class-admin.php:663
     837#: includes/admin/class-admin.php:687
    791838msgid "Save settings"
    792839msgstr ""
    793840
    794 #: includes/admin/class-admin.php:730
     841#: includes/admin/class-admin.php:755
    795842msgid "Pause"
    796843msgstr ""
    797844
    798 #: includes/admin/class-admin.php:731
     845#: includes/admin/class-admin.php:756
    799846msgid "Resume"
    800847msgstr ""
    801848
    802 #: includes/admin/class-admin.php:732
     849#: includes/admin/class-admin.php:757
    803850msgid "Cancel"
    804851msgstr ""
    805852
    806 #: includes/admin/class-admin.php:733
     853#: includes/admin/class-admin.php:758
    807854msgid "View backups"
    808855msgstr ""
    809856
    810 #: includes/admin/class-admin.php:736
     857#: includes/admin/class-admin.php:761
    811858msgid "Keep this page open while the job runs. If you close it, the job pauses and you can resume it here later."
    812859msgstr ""
    813860
    814 #: includes/admin/class-admin.php:749
     861#: includes/admin/class-admin.php:774
    815862msgid "Nothing logged yet."
    816863msgstr ""
    817864
    818 #: includes/admin/class-admin.php:818
    819 #: includes/admin/class-admin.php:831
    820 #: includes/admin/class-admin.php:857
    821 #: includes/admin/class-admin.php:869
    822 #: includes/admin/class-admin.php:881
    823 #: includes/admin/class-admin.php:928
    824 #: includes/admin/class-admin.php:940
    825 #: includes/admin/class-admin.php:957
    826 #: includes/admin/class-admin.php:990
     865#: includes/admin/class-admin.php:843
     866#: includes/admin/class-admin.php:856
     867#: includes/admin/class-admin.php:882
     868#: includes/admin/class-admin.php:894
     869#: includes/admin/class-admin.php:906
     870#: includes/admin/class-admin.php:953
     871#: includes/admin/class-admin.php:965
     872#: includes/admin/class-admin.php:982
     873#: includes/admin/class-admin.php:1015
    827874#: includes/admin/class-cloud-page.php:482
    828875#: includes/admin/class-cloud-page.php:495
    … …  
    838885msgstr ""
    839886
    840 #: includes/admin/class-admin.php:823
     887#: includes/admin/class-admin.php:848
    841888msgid "Pulling is on. Generate a key for the computer that will make backups."
    842889msgstr ""
    843890
    844 #: includes/admin/class-admin.php:823
     891#: includes/admin/class-admin.php:848
    845892msgid "Pulling is off. Existing keys stop working until you turn it on again."
    846893msgstr ""
    847894
    848895#. translators: %s: address.
    849 #: includes/admin/class-admin.php:841
     896#: includes/admin/class-admin.php:866
    850897#, php-format
    851898msgid "\"%s\" is not a valid IP address or range."
    852899msgstr ""
    853900
    854 #: includes/admin/class-admin.php:849
     901#: includes/admin/class-admin.php:874
    855902msgid "Key created and pulling turned on."
    856903msgstr ""
    857904
    858 #: includes/admin/class-admin.php:861
     905#: includes/admin/class-admin.php:886
    859906msgid "Key revoked. It stops working immediately."
    860907msgstr ""
    861908
    862 #: includes/admin/class-admin.php:873
     909#: includes/admin/class-admin.php:898
    863910msgid "Key deleted."
    864911msgstr ""
    865912
    866 #: includes/admin/class-admin.php:890
     913#: includes/admin/class-admin.php:915
    867914msgid "That key belongs to this site. Paste it into the site that will make the backup."
    868915msgstr ""
    869916
    870917#. translators: %s: site.
    871 #: includes/admin/class-admin.php:917
     918#: includes/admin/class-admin.php:942
    872919#, php-format
    873920msgid "New key saved for %s. You can pull a backup now."
    … …  
    875922
    876923#. translators: %s: site.
    877 #: includes/admin/class-admin.php:919
     924#: includes/admin/class-admin.php:944
    878925#, php-format
    879926msgid "Connected to %s. You can pull a backup now."
    880927msgstr ""
    881928
    882 #: includes/admin/class-admin.php:932
     929#: includes/admin/class-admin.php:957
    883930msgid "Connection removed."
    884931msgstr ""
    885932
    886 #: includes/admin/class-admin.php:946
     933#: includes/admin/class-admin.php:971
    887934msgid "That backup is still being made. Cancel the job first."
    888935msgstr ""
    889936
    890 #: includes/admin/class-admin.php:949
     937#: includes/admin/class-admin.php:974
    891938#: includes/admin/class-cloud-page.php:708
    892939msgid "Backup deleted."
    893940msgstr ""
    894941
    895 #: includes/admin/class-admin.php:963
     942#: includes/admin/class-admin.php:988
    896943msgid "No backups were selected."
    897944msgstr ""
    898945
    899946#. translators: %d: number of backups.
    900 #: includes/admin/class-admin.php:978
     947#: includes/admin/class-admin.php:1003
    901948#, php-format
    902949msgid "%d backup deleted."
    … …  
    905952msgstr[1] ""
    906953
    907 #: includes/admin/class-admin.php:980
     954#: includes/admin/class-admin.php:1005
    908955msgid "One backup was kept because a job is using it."
    909956msgstr ""
    910957
    911 #: includes/admin/class-admin.php:994
     958#: includes/admin/class-admin.php:1019
    912959msgid "Settings saved."
    913960msgstr ""
    914961
    915962#. translators: %s: time difference.
    916 #: includes/admin/class-admin.php:1008
     963#: includes/admin/class-admin.php:1033
    917964#, php-format
    918965msgid "%s ago"
    919966msgstr ""
    920967
    921 #: includes/admin/class-admin.php:1026
     968#: includes/admin/class-admin.php:1051
    922969msgid "(not created yet: a private folder in wp-content, made when the first backup starts)"
    923970msgstr ""
    924971
    925 #: includes/admin/class-admin.php:1031
     972#: includes/admin/class-admin.php:1056
    926973msgid "(unavailable)"
    927974msgstr ""
    … …  
    13691416
    13701417#: includes/admin/class-cloud-page.php:700
    1371 #: includes/jobs/class-ajax-driver.php:111
     1418#: includes/jobs/class-ajax-driver.php:119
    13721419msgid "Unknown backup."
    13731420msgstr ""
    … …  
    15001547
    15011548#: includes/client/class-remote-site.php:297
    1502 #: includes/client/class-remote-site.php:421
     1549#: includes/client/class-remote-site.php:426
    15031550msgid "The clocks on the two servers differ too much."
    15041551msgstr ""
    … …  
    15331580
    15341581#. translators: %s: error.
    1535 #: includes/client/class-remote-site.php:394
     1582#: includes/client/class-remote-site.php:397
     1583#, php-format
     1584msgid "Part of the backup arrived damaged on the other site and will be sent again: %s"
     1585msgstr ""
     1586
     1587#. translators: %s: error.
     1588#: includes/client/class-remote-site.php:399
    15361589#, php-format
    15371590msgid "The source site reported an error: %s"
    15381591msgstr ""
    15391592
    1540 #: includes/client/class-remote-site.php:405
     1593#: includes/client/class-remote-site.php:410
    15411594msgid "The source server stopped part-way through an answer (host limits). Retrying with smaller pieces."
    15421595msgstr ""
    15431596
    15441597#. translators: %s: URL.
    1545 #: includes/client/class-remote-site.php:410
     1598#: includes/client/class-remote-site.php:415
    15461599#, php-format
    15471600msgid "The source site redirects to %s. Generate a new connection key on that address."
    15481601msgstr ""
    15491602
    1550 #: includes/client/class-remote-site.php:423
     1603#: includes/client/class-remote-site.php:428
    15511604msgid "The source site did not accept the connection key. It may have been revoked or have expired: generate a new key on the source."
    15521605msgstr ""
    15531606
    1554 #: includes/client/class-remote-site.php:425
     1607#: includes/client/class-remote-site.php:430
    15551608msgid "The source site has temporarily blocked this computer after failed attempts. Wait 30 minutes."
    15561609msgstr ""
    15571610
    1558 #: includes/client/class-remote-site.php:427
     1611#: includes/client/class-remote-site.php:432
    15591612msgid "The request was too large for the source site."
    15601613msgstr ""
    15611614
    1562 #: includes/client/class-remote-site.php:429
     1615#: includes/client/class-remote-site.php:434
    15631616msgid "The source site is busy with another request for this key."
    15641617msgstr ""
    15651618
    1566 #: includes/client/class-remote-site.php:431
     1619#: includes/client/class-remote-site.php:436
    15671620msgid "The source site only accepts HTTPS. Use its https:// address."
    15681621msgstr ""
    15691622
    1570 #: includes/client/class-remote-site.php:433
     1623#: includes/client/class-remote-site.php:438
    15711624msgid "The two sites run different Site Replica versions. Update the plugin on both."
    15721625msgstr ""
    15731626
    1574 #: includes/client/class-remote-site.php:435
     1627#: includes/client/class-remote-site.php:440
    15751628msgid "Pulling is turned off on the source site (Site Replica → This site as a source)."
    15761629msgstr ""
    15771630
    1578 #: includes/client/class-remote-site.php:442
     1631#: includes/client/class-remote-site.php:447
    15791632msgid "The source host’s resource limit was reached (HTTP 508). Using fewer connections and waiting."
    15801633msgstr ""
    15811634
    15821635#. translators: %d: HTTP status.
    1583 #: includes/client/class-remote-site.php:445
     1636#: includes/client/class-remote-site.php:450
    15841637#, php-format
    15851638msgid "The source server returned HTTP %d (overloaded or timed out). Retrying with smaller pieces."
    15861639msgstr ""
    15871640
    1588 #: includes/client/class-remote-site.php:448
     1641#: includes/client/class-remote-site.php:453
    15891642msgid "The source host is rate-limiting requests. Waiting before retrying."
    15901643msgstr ""
    15911644
    15921645#. translators: 1: firewall name, 2: IP hint.
    1593 #: includes/client/class-remote-site.php:456
     1646#: includes/client/class-remote-site.php:461
    15941647#, php-format
    15951648msgid "The request was blocked by %1$s on the source server. Ask the host (or the firewall settings) to allow requests to this site from your IP address, or allowlist \"accessnow_replica_api\"."
    15961649msgstr ""
    15971650
    1598 #: includes/client/class-remote-site.php:460
     1651#: includes/client/class-remote-site.php:465
    15991652msgid "Site Replica is not active on the source site, or pulling is turned off there."
    16001653msgstr ""
    16011654
    16021655#. translators: %d: HTTP status.
    1603 #: includes/client/class-remote-site.php:463
     1656#: includes/client/class-remote-site.php:468
    16041657#, php-format
    16051658msgid "The source returned a web page instead of data (HTTP %d). A security plugin, cache or firewall may be intercepting the request."
    … …  
    16071660
    16081661#. translators: %d: HTTP status.
    1609 #: includes/client/class-remote-site.php:465
     1662#: includes/client/class-remote-site.php:470
    16101663#, php-format
    16111664msgid "Unexpected answer from the source site (HTTP %d)."
    16121665msgstr ""
    16131666
    1614 #: includes/client/class-remote-site.php:509
     1667#: includes/client/class-remote-site.php:514
    16151668msgid "a firewall"
    16161669msgstr ""
    … …  
    17461799
    17471800#: includes/jobs/class-ajax-driver.php:97
     1801#: includes/jobs/class-ajax-driver.php:105
     1802#: includes/jobs/steps/class-check.php:51
    17481803msgid "That backup is missing or incomplete."
    17491804msgstr ""
    17501805
    1751 #: includes/jobs/class-ajax-driver.php:103
     1806#: includes/jobs/class-ajax-driver.php:111
    17521807msgid "Set up where backups go first."
    17531808msgstr ""
    17541809
    1755 #: includes/jobs/class-ajax-driver.php:126
     1810#: includes/jobs/class-ajax-driver.php:134
    17561811msgid "Unknown job type."
    17571812msgstr ""
    17581813
    1759 #: includes/jobs/class-ajax-driver.php:142
     1814#: includes/jobs/class-ajax-driver.php:150
    17601815msgid "This job link has expired. Reload the page."
    17611816msgstr ""
    17621817
    1763 #: includes/jobs/class-ajax-driver.php:296
     1818#: includes/jobs/class-ajax-driver.php:304
    17641819msgid "The site has already been switched. Choose Keep or Roll back instead."
    17651820msgstr ""
    17661821
    17671822#. translators: %s: host.
    1768 #: includes/jobs/class-ajax-driver.php:317
     1823#: includes/jobs/class-ajax-driver.php:325
    17691824#, php-format
    17701825msgid "Type %s to confirm that this site will be replaced."
    … …  
    18091864msgstr ""
    18101865
    1811 #: includes/jobs/class-job-store.php:74
     1866#: includes/jobs/class-job-store.php:75
    18121867msgid "Starting…"
    18131868msgstr ""
     1869
     1870#: includes/jobs/steps/class-check.php:66
     1871msgid "Checking the database…"
     1872msgstr ""
     1873
     1874#. translators: %s: file.
     1875#: includes/jobs/steps/class-check.php:71
     1876#: includes/jobs/steps/class-pull.php:1716
     1877#, php-format
     1878msgid "Database chunk %s is missing or damaged."
     1879msgstr ""
     1880
     1881#: includes/jobs/steps/class-check.php:83
     1882msgid "Checking large database values…"
     1883msgstr ""
     1884
     1885#. translators: %s: file.
     1886#: includes/jobs/steps/class-check.php:88
     1887#: includes/jobs/steps/class-pull.php:1727
     1888#, php-format
     1889msgid "Large value %s is missing or damaged."
     1890msgstr ""
     1891
     1892#. translators: 1: files checked, 2: files in the backup.
     1893#: includes/jobs/steps/class-check.php:102
     1894#, php-format
     1895msgid "Checking files: %1$s of %2$s…"
     1896msgstr ""
     1897
     1898#. translators: %s: file.
     1899#: includes/jobs/steps/class-check.php:114
     1900#, php-format
     1901msgid "File %s is missing or damaged in the backup."
     1902msgstr ""
     1903
     1904#. translators: %d: problems.
     1905#: includes/jobs/steps/class-check.php:149
     1906#, php-format
     1907msgid "This backup is damaged: %d part no longer matches what was backed up (see the job log). Don't restore it; make a new backup."
     1908msgid_plural "This backup is damaged: %d parts no longer match what was backed up (see the job log). Don't restore it; make a new backup."
     1909msgstr[0] ""
     1910msgstr[1] ""
    18141911
    18151912#. translators: 1: part number, 2: uploaded size, 3: destination.
    … …  
    19102007#. translators: %s: folder.
    19112008#: includes/jobs/steps/class-pull.php:264
    1912 #: includes/sets/class-set-files.php:429
     2009#: includes/sets/class-set-files.php:518
    19132010#, php-format
    19142011msgid "Could not create folder %s."
    … …  
    19192016#: includes/jobs/steps/class-pull.php:864
    19202017#: includes/sets/class-set-files.php:243
    1921 #: includes/sets/class-set-files.php:417
     2018#: includes/sets/class-set-files.php:506
    19222019msgid "Could not write to the backup folder. Is the disk full?"
    19232020msgstr ""
    … …  
    20642161msgstr ""
    20652162
    2066 #. translators: %s: file.
    2067 #: includes/jobs/steps/class-pull.php:1716
    2068 #, php-format
    2069 msgid "Database chunk %s is missing or damaged."
    2070 msgstr ""
    2071 
    20722163#: includes/jobs/steps/class-pull.php:1720
    20732164msgid "Verifying database chunks…"
    … …  
    20752166
    20762167#. translators: %s: file.
    2077 #: includes/jobs/steps/class-pull.php:1727
    2078 #, php-format
    2079 msgid "Large value %s is missing or damaged."
    2080 msgstr ""
    2081 
    2082 #. translators: %s: file.
    20832168#: includes/jobs/steps/class-pull.php:1750
    20842169#, php-format
    … …  
    21502235msgstr ""
    21512236
    2152 #: includes/jobs/steps/class-restore.php:336
     2237#: includes/jobs/steps/class-restore.php:339
    21532238msgid "Waiting for you to review and confirm the restore."
    21542239msgstr ""
    21552240
    21562241#. translators: %s: table.
    2157 #: includes/jobs/steps/class-restore.php:365
     2242#: includes/jobs/steps/class-restore.php:368
    21582243#, php-format
    21592244msgid "Creating table %s…"
    … …  
    21612246
    21622247#. translators: 1: table, 2: chunk, 3: chunks.
    2163 #: includes/jobs/steps/class-restore.php:417
     2248#: includes/jobs/steps/class-restore.php:420
    21642249#, php-format
    21652250msgid "Importing %1$s (part %2$d of %3$d)…"
    … …  
    21672252
    21682253#. translators: %s: file.
    2169 #: includes/jobs/steps/class-restore.php:422
     2254#: includes/jobs/steps/class-restore.php:425
    21702255#, php-format
    21712256msgid "Backup file %s is missing or damaged."
    … …  
    21732258
    21742259#. translators: 1: size, 2: table.
    2175 #: includes/jobs/steps/class-restore.php:495
     2260#: includes/jobs/steps/class-restore.php:498
    21762261#, php-format
    21772262msgid "Writing a large value (%1$s) into %2$s…"
    21782263msgstr ""
    21792264
    2180 #: includes/jobs/steps/class-restore.php:548
     2265#: includes/jobs/steps/class-restore.php:551
    21812266msgid "Adjusting the restored data for this site…"
    21822267msgstr ""
    21832268
    2184 #: includes/jobs/steps/class-restore.php:679
     2269#: includes/jobs/steps/class-restore.php:722
    21852270msgid "Your login could not be carried over (the job was not started by a logged-in user). Log in with an account from the backup."
    21862271msgstr ""
    21872272
    21882273#. translators: %s: login.
    2189 #: includes/jobs/steps/class-restore.php:690
     2274#: includes/jobs/steps/class-restore.php:733
    21902275#, php-format
    21912276msgid "The user \"%s\" exists in the backup but is not an administrator there, so your login was not carried over. Log in with the backup’s credentials."
    21922277msgstr ""
    21932278
    2194 #: includes/jobs/steps/class-restore.php:737
     2279#: includes/jobs/steps/class-restore.php:780
    21952280msgid "The imported data does not match the backup, so nothing was changed on this site: "
    21962281msgstr ""
    21972282
    21982283#. translators: 1: done, 2: total.
    2199 #: includes/jobs/steps/class-restore.php:777
     2284#: includes/jobs/steps/class-restore.php:820
    22002285#, php-format
    22012286msgid "Preparing files: %1$s of %2$s…"
    … …  
    22032288
    22042289#. translators: 1: number of files, 2: examples.
    2205 #: includes/jobs/steps/class-restore.php:805
     2290#: includes/jobs/steps/class-restore.php:848
    22062291#, php-format
    22072292msgid "%1$s files were not restored: this computer's disk ignores upper/lower case, and each has a partner whose name differs only in case (for example %2$s). Pages that use them show the partner image instead. A restore to a Linux server keeps them all."
    22082293msgstr ""
    22092294
    2210 #: includes/jobs/steps/class-restore.php:828
     2295#: includes/jobs/steps/class-restore.php:871
    22112296msgid "Switching to the restored site…"
    22122297msgstr ""
    22132298
    22142299#. translators: %s: view.
    2215 #: includes/jobs/steps/class-restore.php:915
     2300#: includes/jobs/steps/class-restore.php:958
    22162301#, php-format
    22172302msgid "View %s was not recreated: it does not belong to this site."
    … …  
    22192304
    22202305#. translators: 1: view, 2: error.
    2221 #: includes/jobs/steps/class-restore.php:922
     2306#: includes/jobs/steps/class-restore.php:965
    22222307#, php-format
    22232308msgid "View %1$s could not be recreated: %2$s"
    … …  
    22252310
    22262311#. translators: %s: trigger.
    2227 #: includes/jobs/steps/class-restore.php:930
     2312#: includes/jobs/steps/class-restore.php:973
    22282313#, php-format
    22292314msgid "Trigger %s was not recreated: it does not belong to a restored table."
    … …  
    22312316
    22322317#. translators: 1: trigger, 2: error.
    2233 #: includes/jobs/steps/class-restore.php:940
     2318#: includes/jobs/steps/class-restore.php:983
    22342319#, php-format
    22352320msgid "Trigger %1$s could not be recreated: %2$s"
    … …  
    22372322
    22382323#. translators: %s: number of values.
    2239 #: includes/jobs/steps/class-restore.php:965
     2324#: includes/jobs/steps/class-restore.php:1008
    22402325#, php-format
    22412326msgid "%s values could not be searched for addresses (too large for PHP's pattern matcher) and were left unchanged."
    22422327msgstr ""
    22432328
    2244 #: includes/jobs/steps/class-restore.php:972
     2329#: includes/jobs/steps/class-restore.php:1015
    22452330msgid "Check the restored site. Keep it to delete the previous version, or roll back to put the previous site back exactly."
    22462331msgstr ""
    22472332
    2248 #: includes/jobs/steps/class-restore.php:993
     2333#: includes/jobs/steps/class-restore.php:1036
    22492334msgid "Rolling back…"
    22502335msgstr ""
    22512336
    2252 #: includes/jobs/steps/class-restore.php:998
     2337#: includes/jobs/steps/class-restore.php:1041
    22532338msgid "Restored. Keep this version or roll back?"
    22542339msgstr ""
    22552340
    2256 #: includes/jobs/steps/class-restore.php:1051
     2341#: includes/jobs/steps/class-restore.php:1094
    22572342msgid "Cleaning up…"
    22582343msgstr ""
  • accessnow-site-replica/trunk/readme.txt

    r3736115 r3815997  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.1.0
     7Stable tag: 1.2.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    130130== Changelog ==
    131131
     132= 1.2.0 =
     133* A restore replaces each plugin, theme and must-use plugin folder the backup has whole, the way an update does: a file this site has inside one of them that the backup doesn't (left over from a copy made by hand, say) is removed, and the restore plan lists each one before you confirm. Roll back returns them. Media and must-use plugins that exist only on this site are still kept.
     134* A new Developer files setting leaves notes, scripts, tests and tooling (docs, tests, bin, .github, *.md, CLAUDE.md, composer and package files) out of themes and plugins that are git working copies, so they are not copied to another site, where they would be readable. And an exclusion line starting with **/ now leaves a name out at any depth.
     135* Check a backup: a new Check button on the Backups page reads the whole backup back and compares every part with the fingerprint recorded when it was made, so a backup damaged in storage is found before you need it. The list shows when each backup was last checked.
     136* A restore compares every file with the backup's fingerprint as it goes and stops, with nothing on the site changed, if one is damaged. A file the site already has is reused only if it really is the same: scripts and files up to 1 MB are compared by content, so a file edited without changing its date is put back from the backup.
     137* A restore keeps this site's licence records for plugins sold through Freemius, the way it keeps Site Replica's own settings, so after sending a staging copy live those plugins stay activated instead of asking whether the site is a copy. A brand-new site with no such records keeps the backup's.
     138
    132139= 1.1.0 =
    133140* A must-use plugin named local-only-* is never copied, like the local Mailpit helper: a convention for helpers that belong to one local copy (a theme preview switch, a test login), so they can't reach a live site.
Note: See TracChangeset for help on using the changeset viewer.