Changeset 3089446
- Timestamp:
- 05/20/2024 01:07:31 PM (20 months ago)
- Location:
- all-in-one-wp-migration/trunk
- Files:
-
- 1 added
- 21 edited
-
all-in-one-wp-migration.php (modified) (1 diff)
-
constants.php (modified) (3 diffs)
-
lib/controller/class-ai1wm-backups-controller.php (modified) (2 diffs)
-
lib/model/class-ai1wm-backups.php (modified) (1 diff)
-
lib/model/export/class-ai1wm-export-config.php (modified) (2 diffs)
-
lib/model/export/class-ai1wm-export-database.php (modified) (4 diffs)
-
lib/model/export/class-ai1wm-export-enumerate-content.php (modified) (1 diff)
-
lib/model/export/class-ai1wm-export-enumerate-plugins.php (modified) (1 diff)
-
lib/model/export/class-ai1wm-export-enumerate-tables.php (modified) (3 diffs)
-
lib/model/import/class-ai1wm-import-clean.php (modified) (1 diff)
-
lib/model/import/class-ai1wm-import-content.php (modified) (1 diff)
-
lib/model/import/class-ai1wm-import-database.php (modified) (9 diffs)
-
lib/model/import/class-ai1wm-import-options.php (modified) (2 diffs)
-
lib/vendor/servmask/database/class-ai1wm-database-mysql.php (modified) (6 diffs)
-
lib/vendor/servmask/database/class-ai1wm-database-mysqli.php (modified) (6 diffs)
-
lib/vendor/servmask/database/class-ai1wm-database-sqlite.php (added)
-
lib/vendor/servmask/database/class-ai1wm-database-utility.php (modified) (1 diff)
-
lib/vendor/servmask/database/class-ai1wm-database.php (modified) (20 diffs)
-
lib/view/assets/javascript/backups.min.js (modified) (5 diffs)
-
lib/view/backups/backups-list.php (modified) (1 diff)
-
loader.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
all-in-one-wp-migration/trunk/all-in-one-wp-migration.php
r3045858 r3089446 6 6 * Author: ServMask 7 7 * Author URI: https://servmask.com/ 8 * Version: 7.8 18 * Version: 7.82 9 9 * Text Domain: all-in-one-wp-migration 10 10 * Domain Path: /languages -
all-in-one-wp-migration/trunk/constants.php
r3045858 r3089446 36 36 // = Plugin Version = 37 37 // ================== 38 define( 'AI1WM_VERSION', '7.8 1' );38 define( 'AI1WM_VERSION', '7.82' ); 39 39 40 40 // =============== … … 208 208 define( 'AI1WM_MUPLUGINS_NAME', 'mu-plugins' ); 209 209 210 // ============================= 211 // = Less Cache Extension Name = 212 // ============================= 213 define( 'AI1WM_LESS_CACHE_NAME', '.less.cache' ); 210 // ======================== 211 // = Less Cache Extension = 212 // ======================== 213 define( 'AI1WM_LESS_CACHE_EXTENSION', '.less.cache' ); 214 215 // ============================= 216 // = SQLite Database Extension = 217 // ============================= 218 define( 'AI1WM_SQLITE_DATABASE_EXTENSION', '.sqlite' ); 214 219 215 220 // ============================ … … 257 262 // =========================== 258 263 define( 'AI1WM_WP_COMSH_HELPER_NAME', 'wpcomsh' ); 264 265 // ==================================== 266 // = SQLite Database Integration Name = 267 // ==================================== 268 define( 'AI1WM_SQLITE_DATABASE_INTEGRATION_NAME', 'sqlite-database-integration' ); 259 269 260 270 // ================================ -
all-in-one-wp-migration/trunk/lib/controller/class-ai1wm-backups-controller.php
r3038703 r3089446 34 34 'backups/index', 35 35 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(), 39 40 ) 40 41 ); … … 217 218 try { 218 219 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 220 228 while ( ! feof( $handle ) && $read < $params['file_size'] ) { 221 229 $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 172 172 } 173 173 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 174 181 public static function are_in_wp_content_folder() { 175 182 static $in_wp_content = null; -
all-in-one-wp-migration/trunk/lib/model/export/class-ai1wm-export-config.php
r3038703 r3089446 40 40 41 41 // Get database client 42 $ mysql= Ai1wm_Database_Utility::create_client();42 $db_client = Ai1wm_Database_Utility::create_client(); 43 43 44 44 $config = array(); … … 133 133 // Set database version 134 134 $config['Database'] = array( 135 'Version' => $ mysql->version(),135 'Version' => $db_client->server_info(), 136 136 'Charset' => defined( 'DB_CHARSET' ) ? DB_CHARSET : 'undefined', 137 137 'Collate' => defined( 'DB_COLLATE' ) ? DB_COLLATE : 'undefined', -
all-in-one-wp-migration/trunk/lib/model/export/class-ai1wm-export-database.php
r3038703 r3089446 90 90 91 91 // Get database client 92 $ mysql= Ai1wm_Database_Utility::create_client();92 $db_client = Ai1wm_Database_Utility::create_client(); 93 93 94 94 // Exclude spam comments 95 95 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'" ) 97 97 ->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' ) ); 98 98 } … … 100 100 // Exclude post revisions 101 101 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'" ); 103 103 } 104 104 … … 128 128 } 129 129 130 $ mysql->set_tables( $tables )130 $db_client->set_tables( $tables ) 131 131 ->set_old_table_prefixes( $old_table_prefixes ) 132 132 ->set_new_table_prefixes( $new_table_prefixes ) … … 135 135 136 136 // 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' ) ); 138 138 139 139 // 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 ) ); 141 141 142 142 // 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' ) ) ) { 144 144 if ( isset( $column_names['option_name'], $column_names['option_value'] ) ) { 145 145 $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 ); 146 146 } 147 147 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 ); 149 149 } 150 150 151 151 // 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' ) ) 153 153 ->set_table_prefix_columns( ai1wm_table_prefix() . 'usermeta', array( 'meta_key' ) ); 154 154 155 155 // 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 ) ) { 157 157 158 158 // Set progress -
all-in-one-wp-migration/trunk/lib/model/export/class-ai1wm-export-enumerate-content.php
r3038703 r3089446 66 66 } 67 67 68 // Exclude SQLite file 69 if ( defined( 'FQDB' ) ) { 70 $exclude_filters[] = FQDB; 71 } 72 68 73 // Exclude selected files 69 74 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 32 32 public static function execute( $params ) { 33 33 34 $exclude_filters = array( );34 $exclude_filters = array( AI1WM_SQLITE_DATABASE_INTEGRATION_NAME ); 35 35 36 36 // Get total plugins files count -
all-in-one-wp-migration/trunk/lib/model/export/class-ai1wm-export-enumerate-tables.php
r3038703 r3089446 30 30 class Ai1wm_Export_Enumerate_Tables { 31 31 32 public static function execute( $params, Ai1wm_Database $ mysql= null ) {32 public static function execute( $params, Ai1wm_Database $db_client = null ) { 33 33 // Set exclude database 34 34 if ( isset( $params['options']['no_database'] ) ) { … … 47 47 48 48 // 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(); 51 51 } 52 52 53 53 // Include table prefixes 54 54 if ( ai1wm_table_prefix() ) { 55 $ mysql->add_table_prefix_filter( ai1wm_table_prefix() );55 $db_client->add_table_prefix_filter( ai1wm_table_prefix() ); 56 56 57 57 // Include table prefixes (Webba Booking) 58 58 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 ); 60 60 } 61 61 } … … 71 71 72 72 // Write table line 73 foreach ( $ mysql->get_tables() as $table_name ) {73 foreach ( $db_client->get_tables() as $table_name ) { 74 74 if ( ! in_array( $table_name, $excluded_db_tables ) && ai1wm_putcsv( $tables_list, array( $table_name ) ) ) { 75 75 $total_tables_count++; -
all-in-one-wp-migration/trunk/lib/model/import/class-ai1wm-import-clean.php
r3038703 r3089446 32 32 public static function execute( $params ) { 33 33 // Get database client 34 $ mysql= Ai1wm_Database_Utility::create_client();34 $db_client = Ai1wm_Database_Utility::create_client(); 35 35 36 36 // 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(); 39 39 40 40 // Delete storage files -
all-in-one-wp-migration/trunk/lib/model/import/class-ai1wm-import-content.php
r3038703 r3089446 187 187 188 188 // Exclude content extensions 189 $exclude_extensions = array( AI1WM_LESS_CACHE_ NAME);189 $exclude_extensions = array( AI1WM_LESS_CACHE_EXTENSION, AI1WM_SQLITE_DATABASE_EXTENSION ); 190 190 191 191 // 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 30 30 class Ai1wm_Import_Database { 31 31 32 public static function execute( $params, Ai1wm_Database $ mysql= null ) {32 public static function execute( $params, Ai1wm_Database $db_client = null ) { 33 33 global $wpdb; 34 34 … … 217 217 218 218 // 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 ); 221 221 222 222 // Get scheme … … 343 343 344 344 // 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 ); 347 347 348 348 // Get scheme … … 458 458 459 459 // 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 ); 462 462 463 463 // Get scheme … … 571 571 572 572 // 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 ); 575 575 576 576 // Get scheme … … 669 669 670 670 // 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 ); 673 673 674 674 // Get scheme … … 756 756 757 757 // 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 ); 760 760 761 761 // Get scheme … … 948 948 949 949 // 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(); 952 952 } 953 953 954 954 // Set database options 955 $ mysql->set_old_table_prefixes( $old_table_prefixes )955 $db_client->set_old_table_prefixes( $old_table_prefixes ) 956 956 ->set_new_table_prefixes( $new_table_prefixes ) 957 957 ->set_old_replace_values( $old_replace_values ) … … 961 961 962 962 // 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' ) ); 964 964 965 965 // 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' ) ); 967 967 968 968 // 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' ) ); 970 970 971 971 // 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' ) ); 973 973 974 974 // 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' ) ); 976 976 977 977 // 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' ) ); 979 979 980 980 // 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' ) ); 982 982 983 983 // Import database 984 if ( $ mysql->import( ai1wm_database_path( $params ), $query_offset ) ) {984 if ( $db_client->import( ai1wm_database_path( $params ), $query_offset ) ) { 985 985 986 986 // Set progress -
all-in-one-wp-migration/trunk/lib/model/import/class-ai1wm-import-options.php
r3038703 r3089446 30 30 class Ai1wm_Import_Options { 31 31 32 public static function execute( $params, Ai1wm_Database $ mysql= null ) {32 public static function execute( $params, Ai1wm_Database $db_client = null ) { 33 33 // Set progress 34 34 Ai1wm_Status::info( __( 'Preparing options...', AI1WM_PLUGIN_NAME ) ); 35 35 36 36 // 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(); 39 39 } 40 40 41 $tables = $ mysql->get_tables();41 $tables = $db_client->get_tables(); 42 42 43 43 // Get base prefix … … 51 51 52 52 // 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 ) ) ) { 55 55 $fs_accounts = get_option( 'fs_accounts', array() ); 56 56 $meta_value = maybe_unserialize( $row['meta_value'] ); -
all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database-mysql.php
r3038703 r3089446 63 63 64 64 /** 65 * Escape string input for mysqlquery65 * Escape string input for MySQL query 66 66 * 67 67 * @param string $input String to escape … … 91 91 92 92 /** 93 * Return server version93 * Return server info 94 94 * 95 95 * @return string 96 96 */ 97 public function version() {97 public function server_info() { 98 98 return mysql_get_server_info( $this->wpdb->dbh ); 99 99 } … … 102 102 * Return the result from MySQL query as associative array 103 103 * 104 * @param resource$result MySQL resource104 * @param mixed $result MySQL resource 105 105 * @return array 106 106 */ 107 public function fetch_assoc( $result ) {107 public function fetch_assoc( &$result ) { 108 108 return mysql_fetch_assoc( $result ); 109 109 } … … 112 112 * Return the result from MySQL query as row 113 113 * 114 * @param resource$result MySQL resource114 * @param mixed $result MySQL resource 115 115 * @return array 116 116 */ 117 public function fetch_row( $result ) {117 public function fetch_row( &$result ) { 118 118 return mysql_fetch_row( $result ); 119 119 } … … 122 122 * Return the number for rows from MySQL results 123 123 * 124 * @param resource$result MySQL resource124 * @param mixed $result MySQL resource 125 125 * @return integer 126 126 */ 127 public function num_rows( $result ) {127 public function num_rows( &$result ) { 128 128 return mysql_num_rows( $result ); 129 129 } … … 132 132 * Free MySQL result memory 133 133 * 134 * @param resource$result MySQL resource134 * @param mixed $result MySQL resource 135 135 * @return boolean 136 136 */ 137 public function free_result( $result ) {137 public function free_result( &$result ) { 138 138 return mysql_free_result( $result ); 139 139 } -
all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database-mysqli.php
r3038703 r3089446 68 68 69 69 /** 70 * Escape string input for mysqlquery70 * Escape string input for MySQL query 71 71 * 72 72 * @param string $input String to escape … … 96 96 97 97 /** 98 * Return server version98 * Return server info 99 99 * 100 100 * @return string 101 101 */ 102 public function version() {102 public function server_info() { 103 103 return mysqli_get_server_info( $this->wpdb->dbh ); 104 104 } … … 107 107 * Return the result from MySQL query as associative array 108 108 * 109 * @param resource$result MySQL resource109 * @param mixed $result MySQL resource 110 110 * @return array 111 111 */ 112 public function fetch_assoc( $result ) {112 public function fetch_assoc( &$result ) { 113 113 return mysqli_fetch_assoc( $result ); 114 114 } … … 117 117 * Return the result from MySQL query as row 118 118 * 119 * @param resource$result MySQL resource119 * @param mixed $result MySQL resource 120 120 * @return array 121 121 */ 122 public function fetch_row( $result ) {122 public function fetch_row( &$result ) { 123 123 return mysqli_fetch_row( $result ); 124 124 } … … 127 127 * Return the number for rows from MySQL results 128 128 * 129 * @param resource$result MySQL resource129 * @param mixed $result MySQL resource 130 130 * @return integer 131 131 */ 132 public function num_rows( $result ) {132 public function num_rows( &$result ) { 133 133 return mysqli_num_rows( $result ); 134 134 } … … 137 137 * Free MySQL result memory 138 138 * 139 * @param resource$result MySQL resource139 * @param mixed $result MySQL resource 140 140 * @return boolean 141 141 */ 142 public function free_result( $result ) {142 public function free_result( &$result ) { 143 143 return mysqli_free_result( $result ); 144 144 } -
all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database-utility.php
r3038703 r3089446 37 37 public static function create_client() { 38 38 global $wpdb; 39 40 if ( $wpdb instanceof WP_SQLite_DB ) { 41 return new Ai1wm_Database_Sqlite( $wpdb ); 42 } 39 43 40 44 if ( PHP_MAJOR_VERSION >= 7 ) { -
all-in-one-wp-migration/trunk/lib/vendor/servmask/database/class-ai1wm-database.php
r3038703 r3089446 717 717 } 718 718 719 // Close result cursor720 719 $this->free_result( $result ); 721 720 } … … 767 766 } 768 767 769 // Close result cursor770 768 $this->free_result( $result ); 771 769 } … … 860 858 $create_view = $this->get_create_view( $table_name ); 861 859 860 // Replace create view quotes 861 $create_view = $this->replace_view_quotes( $create_view ); 862 862 863 // Replace create view name 863 864 $create_view = $this->replace_view_name( $create_view, $table_name, $new_table_name ); … … 896 897 $create_table = $this->get_create_table( $table_name ); 897 898 899 // Replace create table quotes 900 $create_table = $this->replace_table_quotes( $create_table ); 901 898 902 // Replace create table name 899 903 $create_table = $this->replace_table_name( $create_table, $table_name, $new_table_name ); … … 907 911 // Replace create table options 908 912 $create_table = $this->replace_table_options( $create_table ); 913 914 // Replace create table defaults 915 $create_table = $this->replace_table_defaults( $create_table ); 909 916 910 917 // Write create table statement … … 1092 1099 1093 1100 // Start transaction 1094 $this->query( 'START TRANSACTION' ); 1101 if ( $this->use_transactions() ) { 1102 $this->query( 'START TRANSACTION' ); 1103 } 1095 1104 1096 1105 // Read database file line by line … … 1221 1230 1222 1231 // End transaction 1223 $this->query( 'COMMIT' ); 1232 if ( $this->use_transactions() ) { 1233 $this->query( 'COMMIT' ); 1234 } 1224 1235 } 1225 1236 … … 1250 1261 1251 1262 /** 1252 * Get MySQL version1253 *1254 * @return string1255 */1256 protected function get_version() {1257 $result = $this->query( "SHOW VARIABLES LIKE 'version'" );1258 $row = $this->fetch_assoc( $result );1259 1260 // Close result cursor1261 $this->free_result( $result );1262 1263 // Get version1264 if ( isset( $row['Value'] ) ) {1265 return $row['Value'];1266 }1267 }1268 1269 /**1270 1263 * Get MySQL max allowed packet 1271 1264 * … … 1448 1441 $column_names = array(); 1449 1442 1450 // Get column types1443 // Get column names 1451 1444 $result = $this->query( "SHOW COLUMNS FROM `{$table_name}`" ); 1452 1445 while ( $row = $this->fetch_assoc( $result ) ) { … … 1463 1456 1464 1457 /** 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 /** 1465 1468 * Replace table name 1466 1469 * … … 1476 1479 } 1477 1480 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 ) { 1478 1491 return $input; 1479 1492 } … … 1763 1776 '/\s+CONSTRAINT(.+)REFERENCES(.+),/i', 1764 1777 '/,\s+CONSTRAINT(.+)REFERENCES(.+)/i', 1778 '/\s+ON(.+)CONFLICT(.+)(ROLLBACK|ABORT|FAIL|IGNORE|REPLACE)/i', 1779 '/\s+COLLATE(.+)(BINARY|NOCASE|RTRIM)/i', 1765 1780 ); 1766 1781 … … 1796 1811 protected function is_wc_session_query( $input ) { 1797 1812 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; 1798 1823 } 1799 1824 … … 1863 1888 case $this->is_site_transient_query( $input ): 1864 1889 case $this->is_wc_session_query( $input ): 1890 case $this->is_wpallimport_session_query( $input ): 1865 1891 $ignore = true; 1866 1892 break; … … 1907 1933 1908 1934 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; 1909 1945 } 1910 1946 … … 1929 1965 'ROW_FORMAT=FIXED', 1930 1966 'ROW_FORMAT=DYNAMIC', 1967 'AUTOINCREMENT', 1931 1968 ); 1932 1969 $replace = array( … … 1943 1980 '', 1944 1981 '', 1982 'AUTO_INCREMENT', 1945 1983 ); 1946 1984 … … 2060 2098 2061 2099 /** 2100 * Use MySQL transactions 2101 * 2102 * @return bolean 2103 */ 2104 protected function use_transactions() { 2105 return true; 2106 } 2107 2108 /** 2062 2109 * Run MySQL query 2063 2110 * … … 2068 2115 2069 2116 /** 2070 * Escape string input for mysqlquery2117 * Escape string input for MySQL query 2071 2118 * 2072 2119 * @param string $input String to escape … … 2090 2137 2091 2138 /** 2092 * Return server version2093 * 2094 * @return string 2095 */ 2096 abstract public function version();2139 * Return server info 2140 * 2141 * @return string 2142 */ 2143 abstract public function server_info(); 2097 2144 2098 2145 /** 2099 2146 * Return the result from MySQL query as associative array 2100 2147 * 2101 * @param resource$result MySQL resource2102 * @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 ); 2105 2152 2106 2153 /** 2107 2154 * Return the result from MySQL query as row 2108 2155 * 2109 * @param resource$result MySQL resource2110 * @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 ); 2113 2160 2114 2161 /** 2115 2162 * Return the number for rows from MySQL results 2116 2163 * 2117 * @param resource$result MySQL resource2164 * @param mixed $result MySQL resource 2118 2165 * @return integer 2119 2166 */ 2120 abstract public function num_rows( $result );2167 abstract public function num_rows( &$result ); 2121 2168 2122 2169 /** 2123 2170 * Free MySQL result memory 2124 2171 * 2125 * @param resource$result MySQL resource2172 * @param mixed $result MySQL resource 2126 2173 * @return boolean 2127 2174 */ 2128 abstract public function free_result( $result );2175 abstract public function free_result( &$result ); 2129 2176 } -
all-in-one-wp-migration/trunk/lib/view/assets/javascript/backups.min.js
r3038703 r3089446 1918 1918 1919 1919 /* 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& 1921 1921 var render = function render() { 1922 1922 var _vm = this, … … 1987 1987 render._withStripped = true; 1988 1988 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& 1990 1990 1991 1991 ;// 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& … … 2455 2455 event_bus.$on('ai1wm-list-content', this.listContent); 2456 2456 event_bus.$on('ai1wm-download-file', this.downloadFile); 2457 event_bus.$on('ai1wm-download-backup', this.downloadBackup); 2457 2458 }, 2458 2459 methods: { … … 2533 2534 request.send(formData); 2534 2535 }, 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 }, 2535 2566 addFile: function addFile(f) { 2536 2567 var node = this.tree.root; … … 2706 2737 e.preventDefault(); 2707 2738 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; 2708 2746 }); 2709 2747 $('#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 104 104 <?php if ( $downloadable ) : ?> 105 105 <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; ?> 110 117 </li> 111 118 <?php else : ?> -
all-in-one-wp-migration/trunk/loader.php
r3038703 r3089446 192 192 'database' . 193 193 DIRECTORY_SEPARATOR . 194 'class-ai1wm-database-sqlite.php'; 195 196 require_once AI1WM_VENDOR_PATH . 197 DIRECTORY_SEPARATOR . 198 'servmask' . 199 DIRECTORY_SEPARATOR . 200 'database' . 201 DIRECTORY_SEPARATOR . 194 202 'class-ai1wm-database-utility.php'; 195 203 -
all-in-one-wp-migration/trunk/readme.txt
r3076008 r3089446 5 5 Tested up to: 6.5 6 6 Requires PHP: 5.3 7 Stable tag: 7.8 17 Stable tag: 7.82 8 8 License: GPLv2 or later 9 9 … … 25 25 One 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. 26 26 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.27 If 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. 28 28 29 29 **Features Spotlight:** … … 97 97 98 98 == Changelog == 99 = 7.82 = 100 **Added** 101 102 * SQLite support 103 * WordPress Playground support 104 99 105 = 7.81 = 100 106 **Added**
Note: See TracChangeset
for help on using the changeset viewer.