💥 TRENDING: Changeset/ - Uncensored 2025

Changeset 3089446


Ignore:
Timestamp:
05/20/2024 01:07:31 PM (20 months ago)
Author:
bangelov
Message:

Adding v7.82 to trunk

Location:
all-in-one-wp-migration/trunk
Files:
1 added
21 edited

Legend:

Unmodified
Added
Removed
  • all-in-one-wp-migration/trunk/all-in-one-wp-migration.php

    r3045858 r3089446  
    66 * Author: ServMask
    77 * Author URI: https://servmask.com/
    8  * Version: 7.81
     8 * Version: 7.82
    99 * Text Domain: all-in-one-wp-migration
    1010 * Domain Path: /languages
  • all-in-one-wp-migration/trunk/constants.php

    r3045858 r3089446  
    3636// = Plugin Version =
    3737// ==================
    38 define( 'AI1WM_VERSION', '7.81' );
     38define( 'AI1WM_VERSION', '7.82' );
    3939
    4040// ===============
     
    208208define( 'AI1WM_MUPLUGINS_NAME', 'mu-plugins' );
    209209
    210 // =============================
    211 // = Less Cache Extension Name =
    212 // =============================
    213 define( 'AI1WM_LESS_CACHE_NAME', '.less.cache' );
     210// ========================
     211// = Less Cache Extension =
     212// ========================
     213define( 'AI1WM_LESS_CACHE_EXTENSION', '.less.cache' );
     214
     215// =============================
     216// = SQLite Database Extension =
     217// =============================
     218define( 'AI1WM_SQLITE_DATABASE_EXTENSION', '.sqlite' );
    214219
    215220// ============================
     
    257262// ===========================
    258263define( 'AI1WM_WP_COMSH_HELPER_NAME', 'wpcomsh' );
     264
     265// ====================================
     266// = SQLite Database Integration Name =
     267// ====================================
     268define( 'AI1WM_SQLITE_DATABASE_INTEGRATION_NAME', 'sqlite-database-integration' );
    259269
    260270// ================================
  • all-in-one-wp-migration/trunk/lib/controller/class-ai1wm-backups-controller.php

    r3038703 r3089446  
    3434            'backups/index',
    3535            array(
    36                 'backups'      => Ai1wm_Backups::get_files(),
    37                 'labels'       => Ai1wm_Backups::get_labels(),
    38                 'downloadable' => Ai1wm_Backups::are_downloadable(),
     36                'backups'                   => Ai1wm_Backups::get_files(),
     37                'labels'                    => Ai1wm_Backups::get_labels(),
     38                'direct_download_supported' => Ai1wm_Backups::direct_download_supported(),
     39                'downloadable'              => Ai1wm_Backups::are_downloadable(),
    3940            )
    4041        );
     
    217218        try {
    218219            if ( $handle  = ai1wm_open( ai1wm_backup_path( $params ), 'r' ) ) {
    219                 ai1wm_seek( $handle, $params['offset'] );
     220                if ( ! isset( $params['file_size'] ) ) {
     221                    $params['file_size'] = filesize( ai1wm_backup_path( $params ) );
     222                }
     223
     224                if ( $params['offset'] ) {
     225                    ai1wm_seek( $handle, $params['offset'] );
     226                }
     227
    220228                while ( ! feof( $handle ) && $read < $params['file_size'] ) {
    221229                    $buffer = ai1wm_read( $handle, min( $chunk_size, $params['file_size'] - $read ) );
  • all-in-one-wp-migration/trunk/lib/model/class-ai1wm-backups.php

    r3038703 r3089446  
    172172    }
    173173
     174    /**
     175     * Check if backups are downloadable
     176     */
     177    public static function direct_download_supported() {
     178        return ! ( $_SERVER['SERVER_NAME'] === 'playground.wordpress.net' || $_SERVER['SERVER_SOFTWARE'] === 'PHP.wasm' );
     179    }
     180
    174181    public static function are_in_wp_content_folder() {
    175182        static $in_wp_content = null;
  • all-in-one-wp-migration/trunk/lib/model/export/class-ai1wm-export-config.php

    r3038703 r3089446  
    4040
    4141        // Get database client
    42         $mysql = Ai1wm_Database_Utility::create_client();
     42        $db_client = Ai1wm_Database_Utility::create_client();
    4343
    4444        $config = array();
     
    133133        // Set database version
    134134        $config['Database'] = array(
    135             'Version' => $mysql->version(),
     135            'Version' => $db_client->server_info(),
    136136            'Charset' => defined( 'DB_CHARSET' ) ? DB_CHARSET : 'undefined',
    137137            'Collate' => defined( 'DB_COLLATE' ) ? DB_COLLATE : 'undefined',
  • all-in-one-wp-migration/trunk/lib/model/export/class-ai1wm-export-database.php

    r3038703 r3089446  
    9090
    9191        // Get database client
    92         $mysql = Ai1wm_Database_Utility::create_client();
     92        $db_client = Ai1wm_Database_Utility::create_client();
    9393
    9494        // Exclude spam comments
    9595        if ( isset( $params['options']['no_spam_comments'] ) ) {
    96             $mysql->set_table_where_query( ai1wm_table_prefix() . 'comments', "`comment_approved` != 'spam'" )
     96            $db_client->set_table_where_query( ai1wm_table_prefix() . 'comments', "`comment_approved` != 'spam'" )
    9797                ->set_table_where_query( ai1wm_table_prefix() . 'commentmeta', sprintf( "`comment_ID` IN ( SELECT `comment_ID` FROM `%s` WHERE `comment_approved` != 'spam' )", ai1wm_table_prefix() . 'comments' ) );
    9898        }
     
    100100        // Exclude post revisions
    101101        if ( isset( $params['options']['no_post_revisions'] ) ) {
    102             $mysql->set_table_where_query( ai1wm_table_prefix() . 'posts', "`post_type` != 'revision'" );
     102            $db_client->set_table_where_query( ai1wm_table_prefix() . 'posts', "`post_type` != 'revision'" );
    103103        }
    104104
     
    128128        }
    129129
    130         $mysql->set_tables( $tables )
     130        $db_client->set_tables( $tables )
    131131            ->set_old_table_prefixes( $old_table_prefixes )
    132132            ->set_new_table_prefixes( $new_table_prefixes )
     
    135135
    136136        // Exclude column prefixes
    137         $mysql->set_reserved_column_prefixes( array( 'wp_force_deactivated_plugins', 'wp_page_for_privacy_policy' ) );
     137        $db_client->set_reserved_column_prefixes( array( 'wp_force_deactivated_plugins', 'wp_page_for_privacy_policy' ) );
    138138
    139139        // Exclude site options
    140         $mysql->set_table_where_query( ai1wm_table_prefix() . 'options', sprintf( "`option_name` NOT IN ('%s', '%s', '%s', '%s', '%s', '%s', '%s')", AI1WM_STATUS, AI1WM_SECRET_KEY, AI1WM_AUTH_USER, AI1WM_AUTH_PASSWORD, AI1WM_AUTH_HEADER, AI1WM_BACKUPS_LABELS, AI1WM_SITES_LINKS ) );
     140        $db_client->set_table_where_query( ai1wm_table_prefix() . 'options', sprintf( "`option_name` NOT IN ('%s', '%s', '%s', '%s', '%s', '%s', '%s')", AI1WM_STATUS, AI1WM_SECRET_KEY, AI1WM_AUTH_USER, AI1WM_AUTH_PASSWORD, AI1WM_AUTH_HEADER, AI1WM_BACKUPS_LABELS, AI1WM_SITES_LINKS ) );
    141141
    142142        // Set table select columns
    143         if ( ( $column_names = $mysql->get_column_names( ai1wm_table_prefix() . 'options' ) ) ) {
     143        if ( ( $column_names = $db_client->get_column_names( ai1wm_table_prefix() . 'options' ) ) ) {
    144144            if ( isset( $column_names['option_name'], $column_names['option_value'] ) ) {
    145145                $column_names['option_value'] = sprintf( "(CASE WHEN option_name = '%s' THEN 'a:0:{}' WHEN (option_name = '%s' OR option_name = '%s') THEN '' ELSE option_value END) AS option_value", AI1WM_ACTIVE_PLUGINS, AI1WM_ACTIVE_TEMPLATE, AI1WM_ACTIVE_STYLESHEET );
    146146            }
    147147
    148             $mysql->set_table_select_columns( ai1wm_table_prefix() . 'options', $column_names );
     148            $db_client->set_table_select_columns( ai1wm_table_prefix() . 'options', $column_names );
    149149        }
    150150
    151151        // Set table prefix columns
    152         $mysql->set_table_prefix_columns( ai1wm_table_prefix() . 'options', array( 'option_name' ) )
     152        $db_client->set_table_prefix_columns( ai1wm_table_prefix() . 'options', array( 'option_name' ) )
    153153            ->set_table_prefix_columns( ai1wm_table_prefix() . 'usermeta', array( 'meta_key' ) );
    154154
    155155        // Export database
    156         if ( $mysql->export( ai1wm_database_path( $params ), $query_offset, $table_index, $table_offset, $table_rows ) ) {
     156        if ( $db_client->export( ai1wm_database_path( $params ), $query_offset, $table_index, $table_offset, $table_rows ) ) {
    157157
    158158            // Set progress
  • all-in-one-wp-migration/trunk/lib/model/export/class-ai1wm-export-enumerate-content.php

    r3038703 r3089446  
    6666        }
    6767
     68        // Exclude SQLite file
     69        if ( defined( 'FQDB' ) ) {
     70            $exclude_filters[] = FQDB;
     71        }
     72
    6873        // Exclude selected files
    6974        if ( isset( $params['options']['exclude_files'], $params['excluded_files'] ) ) {
  • all-in-one-wp-migration/trunk/lib/model/export/class-ai1wm-export-enumerate-plugins.php

    r3038703 r3089446  
    3232    public static function execute( $params ) {
    3333
    34         $exclude_filters = array();
     34        $exclude_filters = array( AI1WM_SQLITE_DATABASE_INTEGRATION_NAME );
    3535
    3636        // Get total plugins files count
  • all-in-one-wp-migration/trunk/lib/model/export/class-ai1wm-export-enumerate-tables.php

    r3038703 r3089446  
    3030class Ai1wm_Export_Enumerate_Tables {
    3131
    32     public static function execute( $params, Ai1wm_Database $mysql = null ) {
     32    public static function execute( $params, Ai1wm_Database $db_client = null ) {
    3333        // Set exclude database
    3434        if ( isset( $params['options']['no_database'] ) ) {
     
    4747
    4848        // Get database client
    49         if ( is_null( $mysql ) ) {
    50             $mysql = Ai1wm_Database_Utility::create_client();
     49        if ( is_null( $db_client ) ) {
     50            $db_client = Ai1wm_Database_Utility::create_client();
    5151        }
    5252
    5353        // Include table prefixes
    5454        if ( ai1wm_table_prefix() ) {
    55             $mysql->add_table_prefix_filter( ai1wm_table_prefix() );
     55            $db_client->add_table_prefix_filter( ai1wm_table_prefix() );
    5656
    5757            // Include table prefixes (Webba Booking)
    5858            foreach ( array( 'wbk_services', 'wbk_days_on_off', 'wbk_locked_time_slots', 'wbk_appointments', 'wbk_cancelled_appointments', 'wbk_email_templates', 'wbk_service_categories', 'wbk_gg_calendars', 'wbk_coupons' ) as $table_name ) {
    59                 $mysql->add_table_prefix_filter( $table_name );
     59                $db_client->add_table_prefix_filter( $table_name );
    6060            }
    6161        }
     
    7171
    7272        // Write table line
    73         foreach ( $mysql->get_tables() as $table_name ) {
     73        foreach ( $db_client->get_tables() as $table_name ) {
    7474            if ( ! in_array( $table_name, $excluded_db_tables ) && ai1wm_putcsv( $tables_list, array( $table_name ) ) ) {
    7575                $total_tables_count++;
  • all-in-one-wp-migration/trunk/lib/model/import/class-ai1wm-import-clean.php

    r3038703 r3089446  
    3232    public static function execute( $params ) {
    3333        // Get database client
    34         $mysql = Ai1wm_Database_Utility::create_client();
     34        $db_client = Ai1wm_Database_Utility::create_client();
    3535
    3636        // Flush mainsite tables
    37         $mysql->add_table_prefix_filter( ai1wm_table_prefix( 'mainsite' ) );
    38         $mysql->flush();
     37        $db_client->add_table_prefix_filter( ai1wm_table_prefix( 'mainsite' ) );
     38        $db_client->flush();
    3939
    4040        // Delete storage files
  • all-in-one-wp-migration/trunk/lib/model/import/class-ai1wm-import-content.php

    r3038703 r3089446  
    187187
    188188            // Exclude content extensions
    189             $exclude_extensions = array( AI1WM_LESS_CACHE_NAME );
     189            $exclude_extensions = array( AI1WM_LESS_CACHE_EXTENSION, AI1WM_SQLITE_DATABASE_EXTENSION );
    190190
    191191            // Extract a file from archive to WP_CONTENT_DIR
  • all-in-one-wp-migration/trunk/lib/model/import/class-ai1wm-import-database.php

    r3038703 r3089446  
    3030class Ai1wm_Import_Database {
    3131
    32     public static function execute( $params, Ai1wm_Database $mysql = null ) {
     32    public static function execute( $params, Ai1wm_Database $db_client = null ) {
    3333        global $wpdb;
    3434
     
    217217
    218218                    // Get path
    219                     $old_path = parse_url( $url, PHP_URL_PATH );
    220                     $new_path = parse_url( $blog['New']['SiteURL'], PHP_URL_PATH );
     219                    $old_path = (string) parse_url( $url, PHP_URL_PATH );
     220                    $new_path = (string) parse_url( $blog['New']['SiteURL'], PHP_URL_PATH );
    221221
    222222                    // Get scheme
     
    343343
    344344                    // Get path
    345                     $old_path = parse_url( $url, PHP_URL_PATH );
    346                     $new_path = parse_url( $blog['New']['HomeURL'], PHP_URL_PATH );
     345                    $old_path = (string) parse_url( $url, PHP_URL_PATH );
     346                    $new_path = (string) parse_url( $blog['New']['HomeURL'], PHP_URL_PATH );
    347347
    348348                    // Get scheme
     
    458458
    459459                    // Get path
    460                     $old_path = parse_url( $url, PHP_URL_PATH );
    461                     $new_path = parse_url( $blog['New']['WordPress']['UploadsURL'], PHP_URL_PATH );
     460                    $old_path = (string) parse_url( $url, PHP_URL_PATH );
     461                    $new_path = (string) parse_url( $blog['New']['WordPress']['UploadsURL'], PHP_URL_PATH );
    462462
    463463                    // Get scheme
     
    571571
    572572                // Get path
    573                 $old_path = parse_url( $url, PHP_URL_PATH );
    574                 $new_path = parse_url( site_url(), PHP_URL_PATH );
     573                $old_path = (string) parse_url( $url, PHP_URL_PATH );
     574                $new_path = (string) parse_url( site_url(), PHP_URL_PATH );
    575575
    576576                // Get scheme
     
    669669
    670670                // Get path
    671                 $old_path = parse_url( $url, PHP_URL_PATH );
    672                 $new_path = parse_url( home_url(), PHP_URL_PATH );
     671                $old_path = (string) parse_url( $url, PHP_URL_PATH );
     672                $new_path = (string) parse_url( home_url(), PHP_URL_PATH );
    673673
    674674                // Get scheme
     
    756756
    757757                // Get path
    758                 $old_path = parse_url( $url, PHP_URL_PATH );
    759                 $new_path = parse_url( ai1wm_get_uploads_url(), PHP_URL_PATH );
     758                $old_path = (string) parse_url( $url, PHP_URL_PATH );
     759                $new_path = (string) parse_url( ai1wm_get_uploads_url(), PHP_URL_PATH );
    760760
    761761                // Get scheme
     
    948948
    949949        // Get database client
    950         if ( is_null( $mysql ) ) {
    951             $mysql = Ai1wm_Database_Utility::create_client();
     950        if ( is_null( $db_client ) ) {
     951            $db_client = Ai1wm_Database_Utility::create_client();
    952952        }
    953953
    954954        // Set database options
    955         $mysql->set_old_table_prefixes( $old_table_prefixes )
     955        $db_client->set_old_table_prefixes( $old_table_prefixes )
    956956            ->set_new_table_prefixes( $new_table_prefixes )
    957957            ->set_old_replace_values( $old_replace_values )
     
    961961
    962962        // Set atomic tables (do not stop current request for all listed tables if timeout has been exceeded)
    963         $mysql->set_atomic_tables( array( ai1wm_table_prefix() . 'options' ) );
     963        $db_client->set_atomic_tables( array( ai1wm_table_prefix() . 'options' ) );
    964964
    965965        // Set empty tables (do not populate current data for all listed tables)
    966         $mysql->set_empty_tables( array( ai1wm_table_prefix() . 'eum_logs' ) );
     966        $db_client->set_empty_tables( array( ai1wm_table_prefix() . 'eum_logs' ) );
    967967
    968968        // Set Visual Composer
    969         $mysql->set_visual_composer( ai1wm_validate_plugin_basename( 'js_composer/js_composer.php' ) );
     969        $db_client->set_visual_composer( ai1wm_validate_plugin_basename( 'js_composer/js_composer.php' ) );
    970970
    971971        // Set Oxygen Builder
    972         $mysql->set_oxygen_builder( ai1wm_validate_plugin_basename( 'oxygen/functions.php' ) );
     972        $db_client->set_oxygen_builder( ai1wm_validate_plugin_basename( 'oxygen/functions.php' ) );
    973973
    974974        // Set Optimize Press
    975         $mysql->set_optimize_press( ai1wm_validate_plugin_basename( 'optimizePressPlugin/optimizepress.php' ) );
     975        $db_client->set_optimize_press( ai1wm_validate_plugin_basename( 'optimizePressPlugin/optimizepress.php' ) );
    976976
    977977        // Set Avada Fusion Builder
    978         $mysql->set_avada_fusion_builder( ai1wm_validate_plugin_basename( 'fusion-builder/fusion-builder.php' ) );
     978        $db_client->set_avada_fusion_builder( ai1wm_validate_plugin_basename( 'fusion-builder/fusion-builder.php' ) );
    979979
    980980        // Set BeTheme Responsive
    981         $mysql->set_betheme_responsive( ai1wm_validate_theme_basename( 'betheme/style.css' ) );
     981        $db_client->set_betheme_responsive( ai1wm_validate_theme_basename( 'betheme/style.css' ) );
    982982
    983983        // Import database
    984         if ( $mysql->import( ai1wm_database_path( $params ), $query_offset ) ) {
     984        if ( $db_client->import( ai1wm_database_path( $params ), $query_offset ) ) {
    985985
    986986            // Set progress
  • all-in-one-wp-migration/trunk/lib/model/import/class-ai1wm-import-options.php

    r3038703 r3089446  
    3030class Ai1wm_Import_Options {
    3131
    32     public static function execute( $params, Ai1wm_Database $mysql = null ) {
     32    public static function execute( $params, Ai1wm_Database $db_client = null ) {
    3333        // Set progress
    3434        Ai1wm_Status::info( __( 'Preparing options...', AI1WM_PLUGIN_NAME ) );
    3535
    3636        // Get database client
    37         if ( is_null( $mysql ) ) {
    38             $mysql = Ai1wm_Database_Utility::create_client();
     37        if ( is_null( $db_client ) ) {
     38            $db_client = Ai1wm_Database_Utility::create_client();
    3939        }
    4040
    41         $tables = $mysql->get_tables();
     41        $tables = $db_client->get_tables();
    4242
    4343        // Get base prefix
     
    5151
    5252            // Get fs_accounts option value (Freemius)
    53             $result = $mysql->query( "SELECT meta_value FROM `{$mainsite_prefix}sitemeta` WHERE meta_key = 'fs_accounts'" );
    54             if ( ( $row = $mysql->fetch_assoc( $result ) ) ) {
     53            $result = $db_client->query( "SELECT meta_value FROM `{$mainsite_prefix}sitemeta` WHERE meta_key = 'fs_accounts'" );
     54            if ( ( $row = $db_client->fetch_assoc( $result ) ) ) {
    5555                $fs_accounts = get_option( 'fs_accounts', array() );
    5656                $meta_value  = maybe_unserialize( $row['meta_value'] );
  • all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database-mysql.php

    r3038703 r3089446  
    6363
    6464    /**
    65      * Escape string input for mysql query
     65     * Escape string input for MySQL query
    6666     *
    6767     * @param  string $input String to escape
     
    9191
    9292    /**
    93      * Return server version
     93     * Return server info
    9494     *
    9595     * @return string
    9696     */
    97     public function version() {
     97    public function server_info() {
    9898        return mysql_get_server_info( $this->wpdb->dbh );
    9999    }
     
    102102     * Return the result from MySQL query as associative array
    103103     *
    104      * @param  resource $result MySQL resource
     104     * @param  mixed $result MySQL resource
    105105     * @return array
    106106     */
    107     public function fetch_assoc( $result ) {
     107    public function fetch_assoc( &$result ) {
    108108        return mysql_fetch_assoc( $result );
    109109    }
     
    112112     * Return the result from MySQL query as row
    113113     *
    114      * @param  resource $result MySQL resource
     114     * @param  mixed $result MySQL resource
    115115     * @return array
    116116     */
    117     public function fetch_row( $result ) {
     117    public function fetch_row( &$result ) {
    118118        return mysql_fetch_row( $result );
    119119    }
     
    122122     * Return the number for rows from MySQL results
    123123     *
    124      * @param  resource $result MySQL resource
     124     * @param  mixed $result MySQL resource
    125125     * @return integer
    126126     */
    127     public function num_rows( $result ) {
     127    public function num_rows( &$result ) {
    128128        return mysql_num_rows( $result );
    129129    }
     
    132132     * Free MySQL result memory
    133133     *
    134      * @param  resource $result MySQL resource
     134     * @param  mixed $result MySQL resource
    135135     * @return boolean
    136136     */
    137     public function free_result( $result ) {
     137    public function free_result( &$result ) {
    138138        return mysql_free_result( $result );
    139139    }
  • all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database-mysqli.php

    r3038703 r3089446  
    6868
    6969    /**
    70      * Escape string input for mysql query
     70     * Escape string input for MySQL query
    7171     *
    7272     * @param  string $input String to escape
     
    9696
    9797    /**
    98      * Return server version
     98     * Return server info
    9999     *
    100100     * @return string
    101101     */
    102     public function version() {
     102    public function server_info() {
    103103        return mysqli_get_server_info( $this->wpdb->dbh );
    104104    }
     
    107107     * Return the result from MySQL query as associative array
    108108     *
    109      * @param  resource $result MySQL resource
     109     * @param  mixed $result MySQL resource
    110110     * @return array
    111111     */
    112     public function fetch_assoc( $result ) {
     112    public function fetch_assoc( &$result ) {
    113113        return mysqli_fetch_assoc( $result );
    114114    }
     
    117117     * Return the result from MySQL query as row
    118118     *
    119      * @param  resource $result MySQL resource
     119     * @param  mixed $result MySQL resource
    120120     * @return array
    121121     */
    122     public function fetch_row( $result ) {
     122    public function fetch_row( &$result ) {
    123123        return mysqli_fetch_row( $result );
    124124    }
     
    127127     * Return the number for rows from MySQL results
    128128     *
    129      * @param  resource $result MySQL resource
     129     * @param  mixed $result MySQL resource
    130130     * @return integer
    131131     */
    132     public function num_rows( $result ) {
     132    public function num_rows( &$result ) {
    133133        return mysqli_num_rows( $result );
    134134    }
     
    137137     * Free MySQL result memory
    138138     *
    139      * @param  resource $result MySQL resource
     139     * @param  mixed $result MySQL resource
    140140     * @return boolean
    141141     */
    142     public function free_result( $result ) {
     142    public function free_result( &$result ) {
    143143        return mysqli_free_result( $result );
    144144    }
  • all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database-utility.php

    r3038703 r3089446  
    3737    public static function create_client() {
    3838        global $wpdb;
     39
     40        if ( $wpdb instanceof WP_SQLite_DB ) {
     41            return new Ai1wm_Database_Sqlite( $wpdb );
     42        }
    3943
    4044        if ( PHP_MAJOR_VERSION >= 7 ) {
  • all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database.php

    r3038703 r3089446  
    717717            }
    718718
    719             // Close result cursor
    720719            $this->free_result( $result );
    721720        }
     
    767766            }
    768767
    769             // Close result cursor
    770768            $this->free_result( $result );
    771769        }
     
    860858                        $create_view = $this->get_create_view( $table_name );
    861859
     860                        // Replace create view quotes
     861                        $create_view = $this->replace_view_quotes( $create_view );
     862
    862863                        // Replace create view name
    863864                        $create_view = $this->replace_view_name( $create_view, $table_name, $new_table_name );
     
    896897                        $create_table = $this->get_create_table( $table_name );
    897898
     899                        // Replace create table quotes
     900                        $create_table = $this->replace_table_quotes( $create_table );
     901
    898902                        // Replace create table name
    899903                        $create_table = $this->replace_table_name( $create_table, $table_name, $new_table_name );
     
    907911                        // Replace create table options
    908912                        $create_table = $this->replace_table_options( $create_table );
     913
     914                        // Replace create table defaults
     915                        $create_table = $this->replace_table_defaults( $create_table );
    909916
    910917                        // Write create table statement
     
    10921099
    10931100            // Start transaction
    1094             $this->query( 'START TRANSACTION' );
     1101            if ( $this->use_transactions() ) {
     1102                $this->query( 'START TRANSACTION' );
     1103            }
    10951104
    10961105            // Read database file line by line
     
    12211230
    12221231            // End transaction
    1223             $this->query( 'COMMIT' );
     1232            if ( $this->use_transactions() ) {
     1233                $this->query( 'COMMIT' );
     1234            }
    12241235        }
    12251236
     
    12501261
    12511262    /**
    1252      * Get MySQL version
    1253      *
    1254      * @return string
    1255      */
    1256     protected function get_version() {
    1257         $result = $this->query( "SHOW VARIABLES LIKE 'version'" );
    1258         $row    = $this->fetch_assoc( $result );
    1259 
    1260         // Close result cursor
    1261         $this->free_result( $result );
    1262 
    1263         // Get version
    1264         if ( isset( $row['Value'] ) ) {
    1265             return $row['Value'];
    1266         }
    1267     }
    1268 
    1269     /**
    12701263     * Get MySQL max allowed packet
    12711264     *
     
    14481441        $column_names = array();
    14491442
    1450         // Get column types
     1443        // Get column names
    14511444        $result = $this->query( "SHOW COLUMNS FROM `{$table_name}`" );
    14521445        while ( $row = $this->fetch_assoc( $result ) ) {
     
    14631456
    14641457    /**
     1458     * Replace table quotes
     1459     *
     1460     * @param  string $input Table value
     1461     * @return string
     1462     */
     1463    protected function replace_table_quotes( $input ) {
     1464        return $input;
     1465    }
     1466
     1467    /**
    14651468     * Replace table name
    14661469     *
     
    14761479        }
    14771480
     1481        return $input;
     1482    }
     1483
     1484    /**
     1485     * Replace view quotes
     1486     *
     1487     * @param  string $input View value
     1488     * @return string
     1489     */
     1490    protected function replace_view_quotes( $input ) {
    14781491        return $input;
    14791492    }
     
    17631776            '/\s+CONSTRAINT(.+)REFERENCES(.+),/i',
    17641777            '/,\s+CONSTRAINT(.+)REFERENCES(.+)/i',
     1778            '/\s+ON(.+)CONFLICT(.+)(ROLLBACK|ABORT|FAIL|IGNORE|REPLACE)/i',
     1779            '/\s+COLLATE(.+)(BINARY|NOCASE|RTRIM)/i',
    17651780        );
    17661781
     
    17961811    protected function is_wc_session_query( $input ) {
    17971812        return strpos( $input, "'_wc_session_" ) !== false;
     1813    }
     1814
     1815    /**
     1816     * Check whether input is WP All Import session query
     1817     *
     1818     * @param  string  $input SQL statement
     1819     * @return boolean
     1820     */
     1821    protected function is_wpallimport_session_query( $input ) {
     1822        return strpos( $input, "'_wpallimport_session_" ) !== false;
    17981823    }
    17991824
     
    18631888            case $this->is_site_transient_query( $input ):
    18641889            case $this->is_wc_session_query( $input ):
     1890            case $this->is_wpallimport_session_query( $input ):
    18651891                $ignore = true;
    18661892                break;
     
    19071933
    19081934        return $atomic;
     1935    }
     1936
     1937    /**
     1938     * Replace table definitions
     1939     *
     1940     * @param  string $input SQL statement
     1941     * @return string
     1942     */
     1943    protected function replace_table_defaults( $input ) {
     1944        return $input;
    19091945    }
    19101946
     
    19291965            'ROW_FORMAT=FIXED',
    19301966            'ROW_FORMAT=DYNAMIC',
     1967            'AUTOINCREMENT',
    19311968        );
    19321969        $replace = array(
     
    19431980            '',
    19441981            '',
     1982            'AUTO_INCREMENT',
    19451983        );
    19461984
     
    20602098
    20612099    /**
     2100     * Use MySQL transactions
     2101     *
     2102     * @return bolean
     2103     */
     2104    protected function use_transactions() {
     2105        return true;
     2106    }
     2107
     2108    /**
    20622109     * Run MySQL query
    20632110     *
     
    20682115
    20692116    /**
    2070      * Escape string input for mysql query
     2117     * Escape string input for MySQL query
    20712118     *
    20722119     * @param  string $input String to escape
     
    20902137
    20912138    /**
    2092      * Return server version
    2093      *
    2094      * @return string
    2095      */
    2096     abstract public function version();
     2139     * Return server info
     2140     *
     2141     * @return string
     2142     */
     2143    abstract public function server_info();
    20972144
    20982145    /**
    20992146     * Return the result from MySQL query as associative array
    21002147     *
    2101      * @param  resource $result MySQL resource
    2102      * @return array
    2103      */
    2104     abstract public function fetch_assoc( $result );
     2148     * @param  mixed $result MySQL resource
     2149     * @return array
     2150     */
     2151    abstract public function fetch_assoc( &$result );
    21052152
    21062153    /**
    21072154     * Return the result from MySQL query as row
    21082155     *
    2109      * @param  resource $result MySQL resource
    2110      * @return array
    2111      */
    2112     abstract public function fetch_row( $result );
     2156     * @param  mixed $result MySQL resource
     2157     * @return array
     2158     */
     2159    abstract public function fetch_row( &$result );
    21132160
    21142161    /**
    21152162     * Return the number for rows from MySQL results
    21162163     *
    2117      * @param  resource $result MySQL resource
     2164     * @param  mixed $result MySQL resource
    21182165     * @return integer
    21192166     */
    2120     abstract public function num_rows( $result );
     2167    abstract public function num_rows( &$result );
    21212168
    21222169    /**
    21232170     * Free MySQL result memory
    21242171     *
    2125      * @param  resource $result MySQL resource
     2172     * @param  mixed $result MySQL resource
    21262173     * @return boolean
    21272174     */
    2128     abstract public function free_result( $result );
     2175    abstract public function free_result( &$result );
    21292176}
  • all-in-one-wp-migration/trunk/lib/view/assets/javascript/backups.min.js

    r3038703 r3089446  
    19181918
    19191919/* harmony default export */ var event_bus = (new (vue_common_prod_default())());
    1920 ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./lib/view/assets-development/javascript/vue-components/archive/browser.vue?vue&type=template&id=727e58b0&
     1920;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./lib/view/assets-development/javascript/vue-components/archive/browser.vue?vue&type=template&id=65e99a0e&
    19211921var render = function render() {
    19221922  var _vm = this,
     
    19871987render._withStripped = true;
    19881988
    1989 ;// CONCATENATED MODULE: ./lib/view/assets-development/javascript/vue-components/archive/browser.vue?vue&type=template&id=727e58b0&
     1989;// CONCATENATED MODULE: ./lib/view/assets-development/javascript/vue-components/archive/browser.vue?vue&type=template&id=65e99a0e&
    19901990
    19911991;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./lib/view/assets-development/javascript/vue-components/archive/folder.vue?vue&type=template&id=ceb1e49c&
     
    24552455    event_bus.$on('ai1wm-list-content', this.listContent);
    24562456    event_bus.$on('ai1wm-download-file', this.downloadFile);
     2457    event_bus.$on('ai1wm-download-backup', this.downloadBackup);
    24572458  },
    24582459  methods: {
     
    25332534      request.send(formData);
    25342535    },
     2536    downloadBackup: function downloadBackup(file) {
     2537      var params = {
     2538        secret_key: ai1wm_list.secret_key,
     2539        archive: file
     2540      };
     2541      var request = new XMLHttpRequest();
     2542      request.addEventListener('readystatechange', function () {
     2543        if (request.readyState === 2 && request.status === 200) {// Download is being started
     2544        } else if (request.readyState === 3) {// Download is under progress
     2545        } else if (request.readyState === 4) {
     2546          // Downloading has finished
     2547          if (request.status < 400) {
     2548            (0,FileSaver_min.saveAs)(request.response, Ai1wm.Util.basename(file));
     2549          } else {
     2550            /* eslint-disable no-alert */
     2551            alert(ai1wm_locale.archive_browser_download_error);
     2552            /* eslint-enable no-alert */
     2553          }
     2554        }
     2555      });
     2556      request.responseType = 'blob';
     2557      var formData = new FormData();
     2558
     2559      for (var key in params) {
     2560        formData.append(key, params[key]);
     2561      }
     2562
     2563      request.open('post', ai1wm_list.download.url);
     2564      request.send(formData);
     2565    },
    25352566    addFile: function addFile(f) {
    25362567      var node = this.tree.root;
     
    27062737    e.preventDefault();
    27072738    event_bus.$emit('ai1wm-list-content', $(this).data('archive'));
     2739  }); // Download backup
     2740
     2741  $('#ai1wm-backups-list').on('click', '.ai1wm-backup-download', function (e) {
     2742    e.preventDefault();
     2743    var file = $(this).prop('download');
     2744    event_bus.$emit('ai1wm-download-backup', file);
     2745    return false;
    27082746  });
    27092747  $('#ai1wm-backups-list').on('click', '.ai1wm-backup-label-description, .ai1wm-backup-label-text', function () {
  • all-in-one-wp-migration/trunk/lib/view/backups/backups-list.php

    r3038703 r3089446  
    104104                                    <?php if ( $downloadable ) : ?>
    105105                                        <li>
    106                                             <a tabindex="-1" href="<?php echo esc_url( ai1wm_backup_url( array( 'archive' => $backup['filename'] ) ) ); ?>" role="menuitem" download="<?php echo esc_attr( $backup['filename'] ); ?>" aria-label="<?php _e( 'Download', AI1WM_PLUGIN_NAME ); ?>">
    107                                                 <i class="ai1wm-icon-arrow-down"></i>
    108                                                 <?php _e( 'Download', AI1WM_PLUGIN_NAME ); ?>
    109                                             </a>
     106                                            <?php if ( ! $direct_download_supported ) : ?>
     107                                                <a tabindex="-1" class="ai1wm-backup-download" href="#" role="menuitem" download="<?php echo esc_attr( $backup['filename'] ); ?>" aria-label="<?php _e( 'Download', AI1WM_PLUGIN_NAME ); ?>">
     108                                                    <i class="ai1wm-icon-arrow-down"></i>
     109                                                    <?php _e( 'Download', AI1WM_PLUGIN_NAME ); ?>
     110                                                </a>
     111                                            <?php else : ?>
     112                                                <a tabindex="-1" href="<?php echo esc_url( ai1wm_backup_url( array( 'archive' => $backup['filename'] ) ) ); ?>" role="menuitem" download="<?php echo esc_attr( $backup['filename'] ); ?>" aria-label="<?php _e( 'Download', AI1WM_PLUGIN_NAME ); ?>">
     113                                                    <i class="ai1wm-icon-arrow-down"></i>
     114                                                    <?php _e( 'Download', AI1WM_PLUGIN_NAME ); ?>
     115                                                </a>
     116                                            <?php endif; ?>
    110117                                        </li>
    111118                                    <?php else : ?>
  • all-in-one-wp-migration/trunk/loader.php

    r3038703 r3089446  
    192192            'database' .
    193193            DIRECTORY_SEPARATOR .
     194            'class-ai1wm-database-sqlite.php';
     195
     196require_once AI1WM_VENDOR_PATH .
     197            DIRECTORY_SEPARATOR .
     198            'servmask' .
     199            DIRECTORY_SEPARATOR .
     200            'database' .
     201            DIRECTORY_SEPARATOR .
    194202            'class-ai1wm-database-utility.php';
    195203
  • all-in-one-wp-migration/trunk/readme.txt

    r3076008 r3089446  
    55Tested up to: 6.5
    66Requires PHP: 5.3
    7 Stable tag: 7.81
     7Stable tag: 7.82
    88License: GPLv2 or later
    99
     
    2525One feature that makes All-in-One WP Migration widely loved (to the tune of over 6,000 5-star user reviews) is that the technical requirements for installing the plugin are simple.
    2626
    27 If you have WordPress version between 3.3 and 6.4.2 and PHP version between 5.3 and 8.3, you are good to go. All-in-One WP Migration also supports all versions of MySQL and MariaDB.
     27If you have WordPress version between 3.3 and 6.5.3 and PHP version between 5.3 and 8.3, you are good to go. All-in-One WP Migration also supports all versions of MySQL, MariaDB and SQLite.
    2828
    2929**Features Spotlight:**
     
    9797
    9898== Changelog ==
     99= 7.82 =
     100**Added**
     101
     102* SQLite support
     103* WordPress Playground support
     104
    99105= 7.81 =
    100106**Added**
Note: See TracChangeset for help on using the changeset viewer.