Plugin Directory

Changeset 3429290


Ignore:
Timestamp:
12/29/2025 08:45:46 PM (3 months ago)
Author:
surflabtech
Message:

v2.2.7

Location:
surflink
Files:
301 added
10 edited

Legend:

Unmodified
Added
Removed
  • surflink/trunk/assets/css/surfl.css

    r3428366 r3429290  
    39703970
    39713971  .surfl-stat-number {
    3972     color: rgb(0, 98, 98);
     3972    color: rgb(0, 77, 98);
    39733973  }
    39743974  .surfl-success {
  • surflink/trunk/assets/js/surfl.js

    r3428732 r3429290  
    955955              let msg =
    956956                fail_count === total
    957                   ? "No file backed up"
     957                  ? "backup failed"
    958958                  : `Backed up ${total - fail_count} out of ${total}`;
    959959              let status = fail_count === total ? "error" : "warning";
     
    16981698    const files = $(this).data("files");
    16991699
     1700    $("#surfl-restore-checkboxes").show();
     1701
     1702       const statusDivs = {
     1703      database: $("#surfl-restore-dbStatus"),
     1704      uploads: $("#surfl-restore-uploadsStatus"),
     1705      plugins: $("#surfl-restore-pluginsStatus"),
     1706      themes: $("#surfl-restore-themesStatus"),
     1707      others: $("#surfl-restore-othersStatus"),
     1708    };
     1709    // Reset status display before showing new ones
     1710    for (const key in statusDivs) {
     1711      statusDivs[key].removeClass("surfl-show");
     1712    }
     1713
    17001714    const checkboxes = $("#surfl-restore-checkboxes");
    17011715    checkboxes.empty(); // Clear previous checkboxes
     
    18081822          let fail_msg =
    18091823            fail_count === total_files_count
    1810               ? "No file restored."
     1824              ? "Restore failed"
    18111825              : `${
    18121826                  total_files_count - fail_count
     
    18201834          showNotification(fail_status, fail_msg, "#surfl-restore-modal-msg");
    18211835
    1822           setTimeout(function () {
    1823             let completeModal = $("#surfl-upload-restore-complete-modal");
    1824             completeModal.show();
    1825             completeModal.find("p").html(fail_msg);
    1826             scrollToElement("#surfl-upload-restore-complete-modal");
    1827           }, 3000);
     1836          closeBtn.prop("disabled", false);
     1837          closeBtn.css({ cursor: "pointer" });
     1838
     1839          disableBtn(
     1840            $("#surfl-restore-backup-form"),
     1841            "#surfl-restore-backup-modal-btn",
     1842            false
     1843          )
     1844
     1845         
    18281846        } else {
    18291847          showNotification(
     
    18331851          );
    18341852
     1853
     1854         
    18351855          setTimeout(function () {
    18361856            $("#surfl-upload-restore-complete-modal").show();
     
    21712191                let fail_msg =
    21722192                  fail_count === total_files_count
    2173                     ? "No file restored."
     2193                    ? "restored process has failed."
    21742194                    : `${
    21752195                        total_files_count - fail_count
     
    21872207                );
    21882208
    2189                 setTimeout(function () {
    2190                   let completeModal = $("#surfl-upload-restore-complete-modal");
    2191                   completeModal.show();
    2192                   completeModal.find("p").html(fail_msg);
    2193                   scrollToElement("#surfl-upload-restore-complete-modal");
    2194                 }, 3000);
     2209
     2210                 disableBtn(
     2211            $("#surfl-upload-restore-form"),
     2212            ".surfl-gradient-button",
     2213            false
     2214          );
     2215                // setTimeout(function () {
     2216                //   let completeModal = $("#surfl-upload-restore-complete-modal");
     2217                //   completeModal.show();
     2218                //   completeModal.find("p").html(fail_msg);
     2219                //   scrollToElement("#surfl-upload-restore-complete-modal");
     2220                // }, 3000);
    21952221              } else {
    21962222                showNotification(
     
    23282354      button.css({ cursor: "not-allowed" });
    23292355    } else {
    2330       button.html("Restore");
     2356      button.html("Upload & Restore");
    23312357      button.removeClass("surfl-white-button");
    23322358      button.css({ cursor: "pointer" });
  • surflink/trunk/includes/class-surfl-backup-db.php

    r3415642 r3429290  
    1717
    1818   
     19
    1920
    2021    public function backup_database($backup_subdir, $state = null)
  • surflink/trunk/includes/class-surfl-backup-helper.php

    r3428130 r3429290  
    693693    {
    694694        $header = "-- SurfLink\n";
     695        $header .= "-- site_url: " . site_url() . "\n";
    695696        $header .= "-- WordPress Database Backup\n";
    696697        $header .= "-- Version " . get_bloginfo('version') . "\n";
  • surflink/trunk/includes/class-surfl-restore-db.php

    r3428130 r3429290  
    5353        $fp = null;
    5454        $temp_path = WP_CONTENT_DIR . '/surflink/backup/restore/temp';
     55        throw new Exception('Invalid backup file: This backup was not generated by the SurfLink plugin.');
    5556        // Disable query monitor during restore
    5657        add_filter( 'qm/enable', '__return_false', PHP_INT_MAX );
     
    110111                    'current_table_name' => '',
    111112                    'rows_done'          => 0,
     113                    'site_url'           => SURFL_SITE_URL,
     114                    'home_url'           => SURFL_HOME_URL,
    112115                ];
    113116            }
     
    133136                    throw new Exception('Invalid backup file: This backup was not generated by the SurfLink plugin.');
    134137                }
     138                // Read second line
     139                $second_line = fgets( $fp );
     140                // Expected format: -- site_url: https://example.com
     141                if ( preg_match( '/^--\\s*site_url:\\s*(.+)$/', trim( $second_line ), $matches ) ) {
     142                    $backup_site_url = untrailingslashit( trim( $matches[1] ) );
     143                    $current_site_url = untrailingslashit( site_url() );
     144                    // Compare URLs
     145                    if ( $backup_site_url !== $current_site_url ) {
     146                        fclose( $fp );
     147                        throw new Exception('Backup site URL does not match the current site.');
     148                    }
     149                }
     150                $position = ftell( $fp );
    135151            }
    136152            if ( $position > 0 ) {
     
    340356                'current_table_name' => $current_table_name,
    341357                'rows_done'          => $row_count + $rows_done,
     358                'site_url'           => $state['site_url'],
     359                'home_url'           => $state['home_url'],
    342360            ];
    343361            if ( $next_position !== -1 ) {
  • surflink/trunk/readme.txt

    r3428732 r3429290  
    1 == SurfLink - Ultimate Link Manager ==
     1== SurfLink - Redirection, Search Replace, URL Updater, Link Shortener, Auto Linker, Login Security, Backup Restore ==
    22
    33**Contributors:** surflabtech
     
    66**Requires PHP:** 7.4   
    77**Tested up to:** 6.9 
    8 **Stable tag:** 2.2.6
     8**Stable tag:** 2.2.7
    99**License:** GPLv3 or later 
    1010**License URI:** https://opensource.org/licenses/GPL-3.0 
     
    4747* **Selective Restore:** Restore an entire site or just specific components (e.g., restore only the database, keep the themes).
    4848* **Scheduled Auto Backups (Pro):** Set it and forget it. Schedule daily or weekly backups to ensure you never lose data.
    49 * **Upload & Restore (Mix):** Restore backups from external files easily. Unlimited file size support in premium version.
     49* **Upload & Restore (Mix):** Restore backups from external files easily. Unlimited file size support in premium version. 
    5050* **Remote Backups (Upcomimg):** Backup to a remote location (e.g., Google Drive) for long-term storage.
     51* **Cross domain Restore (Upcomimg): Restore backups from a different domain (e.g., staging, localhost, or a new production domain).
    5152
    5253
     
    113114Yes! Database operations are powerful. Entering a wrong search or replace string could break your site. **Always** perform a Backup (using Module 3) before running a Search & Replace operation. Use the "Dry Run" feature first to verify what will be changed.
    114115
     116**Why can’t I restore the database backup on a different domain?**
     117At the moment, SurfLink database restore only works on the same domain where the backup was created.This is a current technical limitation, not a permanent restriction. Support for restoring backups on a different domain (for example: staging, localhost, or a new production domain) is planned for a future release.
     118Current recommendations:
     1191. Restore the database on the original domain
     1202. Use a site migration plugin if you are moving to a new domain
     121
    115122**How does the Login Hider work?**
    116123It intercepts requests to `wp-admin` and `wp-login.php`, then the user is redirected to a custom login form.
     
    133140
    134141== Changelog ==
     142
     143= 2.2.7 =
     144* Improved: Backup & Restore Module UX is improved.
     145* Fixed: Important bug fixed.
    135146
    136147= 2.2.6 =
  • surflink/trunk/surf-link.php

    r3428732 r3429290  
    77 * Author: SurfLab
    88 * Author URI: https://surflabtech.com
    9  * Version: 2.2.6
     9 * Version: 2.2.7
    1010 * Text Domain: surflink
    1111 * License: GPL-3.0-or-later
     
    6767    }
    6868    if ( !defined( 'SURFL_VERSION' ) ) {
    69         define( 'SURFL_VERSION', '2.2.6' );
     69        define( 'SURFL_VERSION', '2.2.7' );
    7070    }
    7171    if ( !defined( 'SURFL_PLUGIN' ) ) {
     
    9999        }
    100100        if ( !defined( 'SURFL_VERSION' ) ) {
    101             define( 'SURFL_VERSION', '2.2.6' );
     101            define( 'SURFL_VERSION', '2.2.7' );
     102        }
     103        if ( !defined( 'SURFL_SITE_URL' ) ) {
     104            define( 'SURFL_SITE_URL', site_url() );
     105        }
     106        if ( !defined( 'SURFL_HOME_URL' ) ) {
     107            define( 'SURFL_HOME_URL', home_url() );
    102108        }
    103109        if ( is_multisite() ) {
  • surflink/trunk/templates/surfl-backup-modals.php

    r3428130 r3429290  
    117117    <!-- Modal for managing restoring backup files START-->
    118118    <div id="surfl-restore-backup-modal" class="surfl-modal" style="display: none;">
    119         <div class="surfl-modal-content surfl-group">
     119        <div class="surfl-modal-content surfl-group" style="min-width: 600px;">
    120120            <span id="surfl-close-restore-backup-modal" class="surfl-modal-cross">&times;</span>
    121121            <div id="surfl-restore-modal-msg"></div>
  • surflink/trunk/templates/surfl-backup.php

    r3428732 r3429290  
    22     <div id="surfl-backup-status"></div>
    33<div class="surfl-section-title">
    4         <h2>Backup Your Important Files</h2>
     4        <h2> <span class="surfl-price-title">
     5            Backup Your Important Files
     6            </span>
     7        </h2>
    58    </div>
    69    <div class="surfl-status-container" style="position: absolute;">
  • surflink/trunk/templates/surfl-restore-backup-html.php

    r3428732 r3429290  
    88            <h2><span class="surfl-price-title">
    99                    <?php esc_html_e('Restore Backup', 'surflink'); ?>
     10                   
    1011                </span></h2>
     12                <?php require SURFL_PATH . 'templates/surfl-backup-warnings.php' ?>
     13            </div>
     14           
    1115
    12             <?php require SURFL_PATH . 'templates/surfl-backup-warnings.php' ?>
    13         </div>
     16            <p class="surfl-flex-center" style="margin-top: 1rem;margin-bottom: 1rem;"> <span class="dashicons dashicons-warning"></span> Database restore works only on the original domain (cross-domain support coming soon).</p>
     17        <?php require_once SURFL_PATH . 'templates/surfl-backup-table.php' ?>
    1418
    15 
    16         <?php require_once SURFL_PATH . 'templates/surfl-backup-table.php' ?>
    1719
    1820        <!-- db file upload  -->
Note: See TracChangeset for help on using the changeset viewer.