Changeset 3406676
- Timestamp:
- 12/01/2025 10:16:53 AM (3 months ago)
- Location:
- instawp-connect
- Files:
-
- 20 edited
- 1 copied
-
tags/0.1.2.2 (copied) (copied from instawp-connect/trunk)
-
tags/0.1.2.2/assets/js/common.js (modified) (2 diffs)
-
tags/0.1.2.2/includes/apis/class-instawp-rest-api-manage.php (modified) (2 diffs)
-
tags/0.1.2.2/includes/class-instawp-ajax.php (modified) (1 diff)
-
tags/0.1.2.2/includes/class-instawp-hooks.php (modified) (1 diff)
-
tags/0.1.2.2/includes/class-instawp-tools.php (modified) (3 diffs)
-
tags/0.1.2.2/includes/functions.php (modified) (1 diff)
-
tags/0.1.2.2/instawp-connect.php (modified) (2 diffs)
-
tags/0.1.2.2/iwp-dest/index.php (modified) (18 diffs)
-
tags/0.1.2.2/languages/instawp-connect.pot (modified) (3 diffs)
-
tags/0.1.2.2/readme.txt (modified) (2 diffs)
-
trunk/assets/js/common.js (modified) (2 diffs)
-
trunk/includes/apis/class-instawp-rest-api-manage.php (modified) (2 diffs)
-
trunk/includes/class-instawp-ajax.php (modified) (1 diff)
-
trunk/includes/class-instawp-hooks.php (modified) (1 diff)
-
trunk/includes/class-instawp-tools.php (modified) (3 diffs)
-
trunk/includes/functions.php (modified) (1 diff)
-
trunk/instawp-connect.php (modified) (2 diffs)
-
trunk/iwp-dest/index.php (modified) (18 diffs)
-
trunk/languages/instawp-connect.pot (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
instawp-connect/tags/0.1.2.2/assets/js/common.js
r3252174 r3406676 14 14 success: function (response) { 15 15 console.log(response) 16 if (el.attr('target') === 'cache' ) {16 if (el.attr('target') === 'cache' || el.attr('target') === 'cdn-cache') { 17 17 const urlObj = new URL(window.location.href); 18 18 urlObj.searchParams.delete('instawp-cache-cleared'); … … 25 25 error: function (jqXHR, textStatus, errorThrown) { 26 26 console.log(errorThrown); 27 // Show error for cdn-cache type 28 if (el.attr('target') === 'cdn-cache' && jqXHR.responseJSON?.data?.message) { 29 alert(jqXHR.responseJSON.data.message); 30 } 27 31 } 28 32 }); -
instawp-connect/tags/0.1.2.2/includes/apis/class-instawp-rest-api-manage.php
r3218292 r3406676 21 21 ) ); 22 22 23 register_rest_route( $this->namespace . '/' . $this->version_2 . '/manage', '/purge-cdn-cache', array( 24 'methods' => 'POST', 25 'callback' => array( $this, 'purge_cdn_cache' ), 26 'permission_callback' => '__return_true', 27 ) ); 28 23 29 register_rest_route( $this->namespace . '/' . $this->version_2 . '/manage', '/inventory', array( 24 30 'methods' => 'GET', … … 150 156 151 157 return $this->send_response( $response ); 158 } 159 160 /** 161 * Handle response for CDN cache purge endpoint. 162 * Purges the InstaWP CDN (Bunny) cache for sites hosted with InstaWP. 163 * 164 * @param WP_REST_Request $request 165 * 166 * @return WP_REST_Response 167 */ 168 public function purge_cdn_cache( WP_REST_Request $request ) { 169 170 $response = $this->validate_api_request( $request ); 171 if ( is_wp_error( $response ) ) { 172 return $this->throw_error( $response ); 173 } 174 175 $result = instawp_purge_cdn_cache(); 176 177 if ( is_wp_error( $result ) ) { 178 return $this->send_response( array( 179 'success' => false, 180 'message' => $result->get_error_message(), 181 ) ); 182 } 183 184 return $this->send_response( array( 185 'success' => isset( $result['success'] ) && $result['success'], 186 'message' => $result['message'] ?? __( 'CDN cache purge request sent.', 'instawp-connect' ), 187 ) ); 152 188 } 153 189 -
instawp-connect/tags/0.1.2.2/includes/class-instawp-ajax.php
r3378575 r3406676 86 86 $response = $cache_api->clean(); 87 87 88 // Also purge InstaCDN (silent - don't block on errors) 89 $cdn_result = instawp_purge_cdn_cache(); 90 if ( ! is_wp_error( $cdn_result ) && ! empty( $cdn_result['success'] ) ) { 91 $response[] = array( 'name' => 'InstaCDN' ); 92 } 93 94 set_transient( 'instawp_cache_purged', $response, 300 ); 95 wp_send_json_success( $response ); 96 } elseif ( $type === 'cdn-cache' ) { 97 // InstaCDN-only purge (show error if not InstaSite) 98 $result = instawp_purge_cdn_cache(); 99 100 if ( is_wp_error( $result ) ) { 101 wp_send_json_error( array( 'message' => $result->get_error_message() ) ); 102 } 103 104 if ( ! is_array( $result ) || empty( $result['success'] ) ) { 105 $message = is_array( $result ) && isset( $result['message'] ) 106 ? $result['message'] 107 : __( 'This site is not hosted with InstaWP.', 'instawp-connect' ); 108 wp_send_json_error( array( 'message' => $message ) ); 109 } 110 111 $response = array( array( 'name' => 'InstaCDN' ) ); 88 112 set_transient( 'instawp_cache_purged', $response, 300 ); 89 113 wp_send_json_success( $response ); -
instawp-connect/tags/0.1.2.2/includes/class-instawp-hooks.php
r3394048 r3406676 289 289 array( 290 290 'parent' => 'instawp', 291 'id' => 'instawp-clear-cdn-cache', 292 'title' => __( 'Purge InstaCDN', 'instawp-connect' ), 293 'href' => '#', 294 'meta' => array( 295 'class' => 'instawp-tools', 296 'target' => 'cdn-cache', 297 ), 298 ) 299 ); 300 301 $admin_bar->add_menu( 302 array( 303 'parent' => 'instawp', 291 304 'id' => 'instawp-tools', 292 305 'title' => __( 'Tools', 'instawp-connect' ), -
instawp-connect/tags/0.1.2.2/includes/class-instawp-tools.php
r3397881 r3406676 212 212 213 213 // Validate against protected directories using canonicalized paths 214 if ( $canonical_path === $canonical_wp_content_dir ||214 if ( false === strpos( $canonical_path, 'plugins/iwp-' ) && ( $canonical_path === $canonical_wp_content_dir || 215 215 $canonical_path === $canonical_abspath || 216 216 ( $canonical_plugins_dir !== false && $canonical_path === $canonical_plugins_dir ) || … … 226 226 ( $canonical_uploads_dir !== false && strpos( $canonical_path . '/', $canonical_uploads_dir . '/' ) === 0 ) || 227 227 ( $canonical_wp_admin !== false && strpos( $canonical_path . '/', $canonical_wp_admin . '/' ) === 0 ) || 228 ( $canonical_wp_includes !== false && strpos( $canonical_path . '/', $canonical_wp_includes . '/' ) === 0 ) ) {228 ( $canonical_wp_includes !== false && strpos( $canonical_path . '/', $canonical_wp_includes . '/' ) === 0 ) ) ) { 229 229 $result['message'] = __( 'Cannot remove protected WordPress directories', 'instawp-connect' ); 230 230 Helper::add_error_log( $result ); … … 2182 2182 glob( WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'mu-plugins-*' ), 2183 2183 glob( WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'themes-*' ), 2184 glob( WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'iwp-demo-helper-*' ), 2185 glob( WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'iwp-migration-helper-*' ), 2184 2186 ) as $folder_to_del ) { 2185 2187 $folders[] = $folder_to_del; -
instawp-connect/tags/0.1.2.2/includes/functions.php
r3394048 r3406676 863 863 864 864 return false; 865 } 866 } 867 868 869 if ( ! function_exists( 'instawp_purge_cdn_cache' ) ) { 870 /** 871 * Purge CDN cache for the connected site via InstaWP API. 872 * Only works for sites hosted with InstaWP. 873 * 874 * @return array|WP_Error Response from API or error 875 */ 876 function instawp_purge_cdn_cache() { 877 $connect_id = instawp()->connect_id; 878 879 if ( empty( $connect_id ) ) { 880 return new WP_Error( 'no_connect_id', __( 'Site is not connected to InstaWP.', 'instawp-connect' ) ); 881 } 882 883 $response = Curl::do_curl( 884 "connects/{$connect_id}/purge-cache", 885 array(), 886 array(), 887 'POST' 888 ); 889 890 return $response; 865 891 } 866 892 } -
instawp-connect/tags/0.1.2.2/instawp-connect.php
r3397881 r3406676 9 9 * Plugin Name: InstaWP Connect 10 10 * Description: 1-click WordPress plugin for Staging, Migrations, Management, Sync and Companion plugin for InstaWP. 11 * Version: 0.1.2. 111 * Version: 0.1.2.2 12 12 * Author: InstaWP Team 13 13 * Author URI: https://instawp.com/ … … 29 29 global $wpdb; 30 30 31 defined( 'INSTAWP_PLUGIN_VERSION' ) || define( 'INSTAWP_PLUGIN_VERSION', '0.1.2. 1' );31 defined( 'INSTAWP_PLUGIN_VERSION' ) || define( 'INSTAWP_PLUGIN_VERSION', '0.1.2.2' ); 32 32 defined( 'INSTAWP_API_DOMAIN_PROD' ) || define( 'INSTAWP_API_DOMAIN_PROD', 'https://app.instawp.io' ); 33 33 -
instawp-connect/tags/0.1.2.2/iwp-dest/index.php
r3308480 r3406676 4 4 5 5 if ( ! defined( 'IWP_PLUGIN_DIR' ) ) { 6 define( 'IWP_PLUGIN_DIR', dirname( dirname( __FILE__ )) . DIRECTORY_SEPARATOR );7 } 8 9 include_once IWP_PLUGIN_DIR . 'includes' . DIRECTORY_SEPARATOR . 'functions-pull-push.php';6 define( 'IWP_PLUGIN_DIR', dirname( __DIR__ ) . DIRECTORY_SEPARATOR ); 7 } 8 9 require_once IWP_PLUGIN_DIR . 'includes' . DIRECTORY_SEPARATOR . 'functions-pull-push.php'; 10 10 11 11 if ( ! isset( $_SERVER['HTTP_X_IWP_MIGRATE_KEY'] ) || empty( $migrate_key = $_SERVER['HTTP_X_IWP_MIGRATE_KEY'] ) ) { … … 22 22 header( 'x-iwp-status: false' ); 23 23 header( 'x-iwp-message: Could not find wp-config.php in the parent directories.' ); 24 echo "Could not find wp-config.php in the parent directories.";24 echo 'Could not find wp-config.php in the parent directories.'; 25 25 exit( 2 ); 26 26 } … … 226 226 if ( extension_loaded( 'mysqli' ) ) { 227 227 228 if ( isset( $_SERVER['HTTP_X_IWP_PROGRESS'] ) ) { 229 $log_content = "x-iwp-progress: {$_SERVER['HTTP_X_IWP_PROGRESS']}\n"; 228 $iwp_progress = isset( $_SERVER['HTTP_X_IWP_PROGRESS'] ) ? (int) $_SERVER['HTTP_X_IWP_PROGRESS'] : 0; 229 if ( 0 < $iwp_progress ) { 230 $log_content = "x-iwp-progress: {$iwp_progress}\n"; 230 231 file_put_contents( $log_file_path, $log_content, FILE_APPEND ); 231 232 } 232 233 233 if ( isset( $_SERVER['HTTP_X_IWP_PROGRESS'] ) && $_SERVER['HTTP_X_IWP_PROGRESS'] == 100 ) { 234 235 // Retaining user after migration 236 if ( $retain_user ) { 237 238 $user_details_data = isset( $user_details['data'] ) ? (array) $user_details['data'] : array(); 239 $user_details_caps = isset( $user_details['caps'] ) ? (array) $user_details['caps'] : array(); 240 $user_details_roles = isset( $user_details['roles'] ) ? (array) $user_details['roles'] : array(); 241 242 $user_data = array( 243 'user_login' => isset( $user_details_data['user_login'] ) ? $user_details_data['user_login'] : '', 244 'user_pass' => isset( $user_details_data['user_pass'] ) ? base64_decode( $user_details_data['user_pass'] ) : '', 245 'user_nicename' => isset( $user_details_data['user_nicename'] ) ? $user_details_data['user_nicename'] : '', 246 'user_email' => isset( $user_details_data['user_email'] ) ? $user_details_data['user_email'] : '', 247 'user_url' => isset( $user_details_data['user_url'] ) ? $user_details_data['user_url'] : '', 248 'user_registered' => isset( $user_details_data['user_registered'] ) ? $user_details_data['user_registered'] : '', 249 'user_activation_key' => isset( $user_details_data['user_activation_key'] ) ? $user_details_data['user_activation_key'] : '', 250 'user_status' => isset( $user_details_data['user_status'] ) ? $user_details_data['user_status'] : '', 251 'display_name' => isset( $user_details_data['display_name'] ) ? $user_details_data['display_name'] : '', 252 ); 253 254 $fields = implode( ', ', array_keys( $user_data ) ); 255 $values = "'" . implode( "', '", array_map( array( $mysqli, 'real_escape_string' ), $user_data ) ) . "'"; 256 $query = "INSERT INTO {$table_prefix}users ($fields) VALUES ($values)"; 257 258 $query_response = $mysqli->query( $query ); 259 260 if ( $query_response ) { 261 $user_id = $mysqli->insert_id; 262 263 if ( $user_id ) { 264 // Set user capabilities 265 $caps_key = $mysqli->real_escape_string( $table_prefix . 'capabilities' ); 266 $caps_value = $mysqli->real_escape_string( iwp_maybe_serialize( $user_details_caps ) ); 267 $caps_query = "INSERT INTO {$table_prefix}usermeta (user_id, meta_key, meta_value) VALUES ($user_id, '$caps_key', '$caps_value')"; 268 $mysqli->query( $caps_query ); 269 270 // Set user roles 271 $roles_key = $mysqli->real_escape_string( $table_prefix . 'user_level' ); 272 $roles_value = $mysqli->real_escape_string( max( array_keys( $user_details_roles ) ) ); 273 $roles_query = "INSERT INTO {$table_prefix}usermeta (user_id, meta_key, meta_value) VALUES ($user_id, '$roles_key', '$roles_value')"; 274 $mysqli->query( $roles_query ); 234 if ( 100 === $iwp_progress ) { 235 236 try { 237 // Retaining user after migration 238 if ( isset( $retain_user ) && $retain_user && isset( $user_details ) && is_array( $user_details ) && ! empty( $user_details['data'] ) ) { 239 240 $user_details_data = isset( $user_details['data'] ) ? (array) $user_details['data'] : array(); 241 $user_details_caps = isset( $user_details['caps'] ) ? (array) $user_details['caps'] : array(); 242 $user_details_roles = isset( $user_details['roles'] ) ? (array) $user_details['roles'] : array(); 243 244 $user_data = array( 245 'user_login' => isset( $user_details_data['user_login'] ) ? $user_details_data['user_login'] : '', 246 'user_pass' => isset( $user_details_data['user_pass'] ) ? base64_decode( $user_details_data['user_pass'] ) : '', 247 'user_nicename' => isset( $user_details_data['user_nicename'] ) ? $user_details_data['user_nicename'] : '', 248 'user_email' => isset( $user_details_data['user_email'] ) ? $user_details_data['user_email'] : '', 249 'user_url' => isset( $user_details_data['user_url'] ) ? $user_details_data['user_url'] : '', 250 'user_registered' => isset( $user_details_data['user_registered'] ) ? $user_details_data['user_registered'] : '', 251 'user_activation_key' => isset( $user_details_data['user_activation_key'] ) ? $user_details_data['user_activation_key'] : '', 252 'user_status' => isset( $user_details_data['user_status'] ) ? $user_details_data['user_status'] : '', 253 'display_name' => isset( $user_details_data['display_name'] ) ? $user_details_data['display_name'] : '', 254 ); 255 256 $fields = implode( ', ', array_keys( $user_data ) ); 257 $values = "'" . implode( "', '", array_map( array( $mysqli, 'real_escape_string' ), $user_data ) ) . "'"; 258 $query = "INSERT INTO {$table_prefix}users ($fields) VALUES ($values)"; 259 260 $query_response = $mysqli->query( $query ); 261 262 if ( $query_response ) { 263 $user_id = $mysqli->insert_id; 264 265 if ( $user_id ) { 266 // Set user capabilities 267 $caps_key = $mysqli->real_escape_string( $table_prefix . 'capabilities' ); 268 $caps_value = $mysqli->real_escape_string( iwp_maybe_serialize( $user_details_caps ) ); 269 $caps_query = "INSERT INTO {$table_prefix}usermeta (user_id, meta_key, meta_value) VALUES ($user_id, '$caps_key', '$caps_value')"; 270 $mysqli->query( $caps_query ); 271 272 // Set user roles 273 $roles_key = $mysqli->real_escape_string( $table_prefix . 'user_level' ); 274 $roles_value = $mysqli->real_escape_string( max( array_keys( $user_details_roles ) ) ); 275 $roles_query = "INSERT INTO {$table_prefix}usermeta (user_id, meta_key, meta_value) VALUES ($user_id, '$roles_key', '$roles_value')"; 276 $mysqli->query( $roles_query ); 277 } 275 278 } 276 } 277 278 if ( $mysqli->error ) { 279 file_put_contents( $log_file_path, "insert response: " . $mysqli->error . "\n", FILE_APPEND ); 280 } 279 280 if ( $mysqli->error ) { 281 file_put_contents( $log_file_path, 'insert response: ' . $mysqli->error . "\n", FILE_APPEND ); 282 } 283 } 284 } catch ( \Throwable $th ) { 285 file_put_contents( $log_file_path, 'iwp-dest retain user exception: ' . $th->getMessage() . "\n", FILE_APPEND ); 281 286 } 282 287 … … 284 289 // update instawp_api_options after the push db finished 285 290 if ( ! empty( $instawp_api_options ) ) { 291 file_put_contents( $log_file_path, 'Going to update instawp_api_options' . "\n", FILE_APPEND ); 292 286 293 $is_insert_failed = false; 287 294 … … 294 301 } 295 302 } catch ( Exception $e ) { 296 file_put_contents( $log_file_path, "insert exception: ". $e->getMessage() . "\n", FILE_APPEND );303 file_put_contents( $log_file_path, 'insert exception: ' . $e->getMessage() . "\n", FILE_APPEND ); 297 304 298 305 $is_insert_failed = true; … … 318 325 // Remove trailing index.php 319 326 $mysqli->query( "UPDATE `{$table_prefix}options` SET `option_value` = TRIM(TRAILING '/' FROM REPLACE(option_value, '/index.php', '')) WHERE `option_name` IN ('siteurl', 'home')" ); 327 } else { 328 file_put_contents( $log_file_path, 'instawp_api_options not found to update' . "\n", FILE_APPEND ); 320 329 } 321 330 } … … 323 332 $mysqli->close(); 324 333 } else { 334 335 file_put_contents( $log_file_path, 'mysql extension not loaded. skipping reset instawp_api_options and retain users' . "\n", FILE_APPEND ); 325 336 mysql_close( $connection ); 326 337 } 327 338 328 //if ( file_exists( $file_save_path ) ) {329 //unlink( $file_save_path );330 //}339 // if ( file_exists( $file_save_path ) ) { 340 // unlink( $file_save_path ); 341 // } 331 342 } 332 343 … … 340 351 341 352 if ( $res === true || $zip->status == 0 ) { 342 $extracted_files = [];343 for ( $i = 0; $i < $zip->numFiles; $i ++ ) {353 $extracted_files = array(); 354 for ( $i = 0; $i < $zip->numFiles; $i++ ) { 344 355 $file_name = $zip->getNameIndex( $i ); 345 356 … … 348 359 $extracted_files[] = $file_name; 349 360 } 350 } else if ( ! in_array( $file_name, $excluded_paths ) && ! str_contains( $file_name, 'instawp-autologin' ) ) {361 } elseif ( ! in_array( $file_name, $excluded_paths ) && ! str_contains( $file_name, 'instawp-autologin' ) ) { 351 362 $extracted_files[] = $file_name; 352 363 } … … 366 377 } else { 367 378 echo "Couldn't extract $file_save_path.zip.\n"; 368 echo "ZipArchive Error (status): " . $zip->status . " - ". zipStatusString( $zip->status ) . "\n";369 echo "ZipArchive System Error (statusSys): ". $zip->statusSys . "\n";379 echo 'ZipArchive Error (status): ' . $zip->status . ' - ' . zipStatusString( $zip->status ) . "\n"; 380 echo 'ZipArchive System Error (statusSys): ' . $zip->statusSys . "\n"; 370 381 371 382 header( 'x-iwp-status: false' ); … … 374 385 } 375 386 } catch ( Exception $e ) { 376 echo "Error: ". $e->getMessage();387 echo 'Error: ' . $e->getMessage(); 377 388 378 389 header( 'x-iwp-status: false' ); … … 383 394 try { 384 395 $phar = new PharData( $file_save_path ); 385 $extracted_files = [];396 $extracted_files = array(); 386 397 387 398 try { … … 394 405 $extracted_files[] = $file_name; 395 406 } 396 397 407 } catch ( Throwable $e ) { 398 408 header( 'x-iwp-status: false' ); … … 412 422 } 413 423 } catch ( Exception $e ) { 414 echo "Error: ". $e->getMessage();424 echo 'Error: ' . $e->getMessage(); 415 425 416 426 header( 'x-iwp-status: false' ); … … 479 489 ); 480 490 481 $current_domain = str_replace( [ 'https://', 'http://' ], '', rtrim( $home_url, '/\\' ) );491 $current_domain = str_replace( array( 'https://', 'http://' ), '', rtrim( $home_url, '/\\' ) ); 482 492 $wp_config = preg_replace( 483 493 "/'DOMAIN_CURRENT_SITE',\s*'[^']*'/", … … 499 509 500 510 foreach ( $config_lines as $key => $line ) { 501 if ( str_contains( $line, "DB_COLLATE") ) {511 if ( str_contains( $line, 'DB_COLLATE' ) ) { 502 512 $line_number = $key; 503 513 break; … … 509 519 } 510 520 511 file_put_contents( $wp_config_path, implode( "", $config_lines ) );521 file_put_contents( $wp_config_path, implode( '', $config_lines ) ); 512 522 } 513 523 } … … 515 525 header( 'x-iwp-status: true' ); 516 526 header( 'x-iwp-message: Success! ' . $file_relative_path ); 517 -
instawp-connect/tags/0.1.2.2/languages/instawp-connect.pot
r3397881 r3406676 6 6 "Content-Type: text/plain; charset=UTF-8\n" 7 7 "Content-Transfer-Encoding: 8bit\n" 8 "POT-Creation-Date: 2025-11- 17 09:17+0000\n"8 "POT-Creation-Date: 2025-11-27 14:14+0000\n" 9 9 "X-Poedit-Basepath: ..\n" 10 10 "X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n" … … 18 18 msgstr "" 19 19 20 #: admin/class-instawp-admin.php:76, includes/class-instawp-hooks.php:325, includes/class-instawp-setting.php:38, includes/class-instawp-tools.php:18 5320 #: admin/class-instawp-admin.php:76, includes/class-instawp-hooks.php:325, includes/class-instawp-setting.php:38, includes/class-instawp-tools.php:1847 21 21 msgid "Create Staging" 22 22 msgstr "" … … 794 794 msgstr "" 795 795 796 #: includes/class-instawp-tools.php:11 95796 #: includes/class-instawp-tools.php:1189 797 797 msgid "API key not found" 798 798 msgstr "" 799 799 800 #: includes/class-instawp-tools.php:14 90800 #: includes/class-instawp-tools.php:1484 801 801 msgid "Root directory for this WordPress installation could not find." 802 802 msgstr "" 803 803 804 #: includes/class-instawp-tools.php:15 14804 #: includes/class-instawp-tools.php:1508 805 805 msgid "Tracking database could not found." 806 806 msgstr "" 807 807 808 #: includes/class-instawp-tools.php:15 23808 #: includes/class-instawp-tools.php:1517 809 809 msgid "API Signature and others data could not set properly" 810 810 msgstr "" 811 811 812 #: includes/class-instawp-tools.php:153 9812 #: includes/class-instawp-tools.php:1533 813 813 msgid "InstaWP could not access or read required files from your WordPress directory due to file permission issue." 814 814 msgstr "" 815 815 816 #: includes/class-instawp-tools.php:15 41816 #: includes/class-instawp-tools.php:1535 817 817 msgid "Learn more." 818 818 msgstr "" 819 819 820 #: includes/class-instawp-tools.php:175 7820 #: includes/class-instawp-tools.php:1751 821 821 msgid "Launch %s" 822 822 msgstr "" 823 823 824 #: includes/class-instawp-tools.php:1842 825 msgid "Please create staging sites first." 826 msgstr "" 827 828 #: includes/class-instawp-tools.php:1843 829 msgid "Skip" 830 msgstr "" 831 832 #: includes/class-instawp-tools.php:1844 833 msgid "Do you really want to disconnect the plugin? It will completely remove the existing staging sites from the plugin." 834 msgstr "" 835 836 #: includes/class-instawp-tools.php:1845 837 msgid "Do you still want to disconnect the plugin?" 838 msgstr "" 839 824 840 #: includes/class-instawp-tools.php:1848 825 msgid " Please create staging sites first."841 msgid "Next Step" 826 842 msgstr "" 827 843 828 844 #: includes/class-instawp-tools.php:1849 829 msgid " Skip"845 msgid "Calculating size" 830 846 msgstr "" 831 847 832 848 #: includes/class-instawp-tools.php:1850 833 msgid "Do you really want to disconnect the plugin? It will completely remove the existing staging sites from the plugin."834 msgstr ""835 836 #: includes/class-instawp-tools.php:1851837 msgid "Do you still want to disconnect the plugin?"838 msgstr ""839 840 #: includes/class-instawp-tools.php:1854841 msgid "Next Step"842 msgstr ""843 844 #: includes/class-instawp-tools.php:1855845 msgid "Calculating size"846 msgstr ""847 848 #: includes/class-instawp-tools.php:1856849 849 msgid "Copied" 850 850 msgstr "" 851 851 852 #: includes/class-instawp-tools.php:191 6852 #: includes/class-instawp-tools.php:1910 853 853 msgid "Zip archive is not opening." 854 854 msgstr "" 855 855 856 #: includes/class-instawp-tools.php:196 9856 #: includes/class-instawp-tools.php:1963 857 857 msgid "No compression method find." 858 858 msgstr "" 859 859 860 #: includes/class-instawp-tools.php:201 6860 #: includes/class-instawp-tools.php:2010 861 861 msgid "Site ID not found in site create response." 862 862 msgstr "" 863 863 864 #: includes/class-instawp-tools.php:20 54864 #: includes/class-instawp-tools.php:2048 865 865 msgid "SFTP login failed." 866 866 msgstr "" 867 867 868 #: includes/class-instawp-tools.php:20 65868 #: includes/class-instawp-tools.php:2059 869 869 msgid "SFTP upload failed for files." 870 870 msgstr "" 871 871 872 #: includes/class-instawp-tools.php:20 73872 #: includes/class-instawp-tools.php:2067 873 873 msgid "SFTP upload failed for database." 874 874 msgstr "" -
instawp-connect/tags/0.1.2.2/readme.txt
r3397881 r3406676 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.0 7 Stable tag: 0.1.2. 17 Stable tag: 0.1.2.2 8 8 License: GPLv3 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.en.html … … 99 99 == Changelog == 100 100 101 = 0.1.2.2 - 01 December 2025 = 102 - Fixed: 403 error on migration cleanup API call. 103 - Added: Purge cdn cache 104 101 105 = 0.1.2.1 - 18 November 2025 = 102 106 - Fixed: Cleanup of migration backup files. -
instawp-connect/trunk/assets/js/common.js
r3252174 r3406676 14 14 success: function (response) { 15 15 console.log(response) 16 if (el.attr('target') === 'cache' ) {16 if (el.attr('target') === 'cache' || el.attr('target') === 'cdn-cache') { 17 17 const urlObj = new URL(window.location.href); 18 18 urlObj.searchParams.delete('instawp-cache-cleared'); … … 25 25 error: function (jqXHR, textStatus, errorThrown) { 26 26 console.log(errorThrown); 27 // Show error for cdn-cache type 28 if (el.attr('target') === 'cdn-cache' && jqXHR.responseJSON?.data?.message) { 29 alert(jqXHR.responseJSON.data.message); 30 } 27 31 } 28 32 }); -
instawp-connect/trunk/includes/apis/class-instawp-rest-api-manage.php
r3218292 r3406676 21 21 ) ); 22 22 23 register_rest_route( $this->namespace . '/' . $this->version_2 . '/manage', '/purge-cdn-cache', array( 24 'methods' => 'POST', 25 'callback' => array( $this, 'purge_cdn_cache' ), 26 'permission_callback' => '__return_true', 27 ) ); 28 23 29 register_rest_route( $this->namespace . '/' . $this->version_2 . '/manage', '/inventory', array( 24 30 'methods' => 'GET', … … 150 156 151 157 return $this->send_response( $response ); 158 } 159 160 /** 161 * Handle response for CDN cache purge endpoint. 162 * Purges the InstaWP CDN (Bunny) cache for sites hosted with InstaWP. 163 * 164 * @param WP_REST_Request $request 165 * 166 * @return WP_REST_Response 167 */ 168 public function purge_cdn_cache( WP_REST_Request $request ) { 169 170 $response = $this->validate_api_request( $request ); 171 if ( is_wp_error( $response ) ) { 172 return $this->throw_error( $response ); 173 } 174 175 $result = instawp_purge_cdn_cache(); 176 177 if ( is_wp_error( $result ) ) { 178 return $this->send_response( array( 179 'success' => false, 180 'message' => $result->get_error_message(), 181 ) ); 182 } 183 184 return $this->send_response( array( 185 'success' => isset( $result['success'] ) && $result['success'], 186 'message' => $result['message'] ?? __( 'CDN cache purge request sent.', 'instawp-connect' ), 187 ) ); 152 188 } 153 189 -
instawp-connect/trunk/includes/class-instawp-ajax.php
r3378575 r3406676 86 86 $response = $cache_api->clean(); 87 87 88 // Also purge InstaCDN (silent - don't block on errors) 89 $cdn_result = instawp_purge_cdn_cache(); 90 if ( ! is_wp_error( $cdn_result ) && ! empty( $cdn_result['success'] ) ) { 91 $response[] = array( 'name' => 'InstaCDN' ); 92 } 93 94 set_transient( 'instawp_cache_purged', $response, 300 ); 95 wp_send_json_success( $response ); 96 } elseif ( $type === 'cdn-cache' ) { 97 // InstaCDN-only purge (show error if not InstaSite) 98 $result = instawp_purge_cdn_cache(); 99 100 if ( is_wp_error( $result ) ) { 101 wp_send_json_error( array( 'message' => $result->get_error_message() ) ); 102 } 103 104 if ( ! is_array( $result ) || empty( $result['success'] ) ) { 105 $message = is_array( $result ) && isset( $result['message'] ) 106 ? $result['message'] 107 : __( 'This site is not hosted with InstaWP.', 'instawp-connect' ); 108 wp_send_json_error( array( 'message' => $message ) ); 109 } 110 111 $response = array( array( 'name' => 'InstaCDN' ) ); 88 112 set_transient( 'instawp_cache_purged', $response, 300 ); 89 113 wp_send_json_success( $response ); -
instawp-connect/trunk/includes/class-instawp-hooks.php
r3394048 r3406676 289 289 array( 290 290 'parent' => 'instawp', 291 'id' => 'instawp-clear-cdn-cache', 292 'title' => __( 'Purge InstaCDN', 'instawp-connect' ), 293 'href' => '#', 294 'meta' => array( 295 'class' => 'instawp-tools', 296 'target' => 'cdn-cache', 297 ), 298 ) 299 ); 300 301 $admin_bar->add_menu( 302 array( 303 'parent' => 'instawp', 291 304 'id' => 'instawp-tools', 292 305 'title' => __( 'Tools', 'instawp-connect' ), -
instawp-connect/trunk/includes/class-instawp-tools.php
r3397881 r3406676 212 212 213 213 // Validate against protected directories using canonicalized paths 214 if ( $canonical_path === $canonical_wp_content_dir ||214 if ( false === strpos( $canonical_path, 'plugins/iwp-' ) && ( $canonical_path === $canonical_wp_content_dir || 215 215 $canonical_path === $canonical_abspath || 216 216 ( $canonical_plugins_dir !== false && $canonical_path === $canonical_plugins_dir ) || … … 226 226 ( $canonical_uploads_dir !== false && strpos( $canonical_path . '/', $canonical_uploads_dir . '/' ) === 0 ) || 227 227 ( $canonical_wp_admin !== false && strpos( $canonical_path . '/', $canonical_wp_admin . '/' ) === 0 ) || 228 ( $canonical_wp_includes !== false && strpos( $canonical_path . '/', $canonical_wp_includes . '/' ) === 0 ) ) {228 ( $canonical_wp_includes !== false && strpos( $canonical_path . '/', $canonical_wp_includes . '/' ) === 0 ) ) ) { 229 229 $result['message'] = __( 'Cannot remove protected WordPress directories', 'instawp-connect' ); 230 230 Helper::add_error_log( $result ); … … 2182 2182 glob( WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'mu-plugins-*' ), 2183 2183 glob( WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'themes-*' ), 2184 glob( WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'iwp-demo-helper-*' ), 2185 glob( WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'iwp-migration-helper-*' ), 2184 2186 ) as $folder_to_del ) { 2185 2187 $folders[] = $folder_to_del; -
instawp-connect/trunk/includes/functions.php
r3394048 r3406676 863 863 864 864 return false; 865 } 866 } 867 868 869 if ( ! function_exists( 'instawp_purge_cdn_cache' ) ) { 870 /** 871 * Purge CDN cache for the connected site via InstaWP API. 872 * Only works for sites hosted with InstaWP. 873 * 874 * @return array|WP_Error Response from API or error 875 */ 876 function instawp_purge_cdn_cache() { 877 $connect_id = instawp()->connect_id; 878 879 if ( empty( $connect_id ) ) { 880 return new WP_Error( 'no_connect_id', __( 'Site is not connected to InstaWP.', 'instawp-connect' ) ); 881 } 882 883 $response = Curl::do_curl( 884 "connects/{$connect_id}/purge-cache", 885 array(), 886 array(), 887 'POST' 888 ); 889 890 return $response; 865 891 } 866 892 } -
instawp-connect/trunk/instawp-connect.php
r3397881 r3406676 9 9 * Plugin Name: InstaWP Connect 10 10 * Description: 1-click WordPress plugin for Staging, Migrations, Management, Sync and Companion plugin for InstaWP. 11 * Version: 0.1.2. 111 * Version: 0.1.2.2 12 12 * Author: InstaWP Team 13 13 * Author URI: https://instawp.com/ … … 29 29 global $wpdb; 30 30 31 defined( 'INSTAWP_PLUGIN_VERSION' ) || define( 'INSTAWP_PLUGIN_VERSION', '0.1.2. 1' );31 defined( 'INSTAWP_PLUGIN_VERSION' ) || define( 'INSTAWP_PLUGIN_VERSION', '0.1.2.2' ); 32 32 defined( 'INSTAWP_API_DOMAIN_PROD' ) || define( 'INSTAWP_API_DOMAIN_PROD', 'https://app.instawp.io' ); 33 33 -
instawp-connect/trunk/iwp-dest/index.php
r3308480 r3406676 4 4 5 5 if ( ! defined( 'IWP_PLUGIN_DIR' ) ) { 6 define( 'IWP_PLUGIN_DIR', dirname( dirname( __FILE__ )) . DIRECTORY_SEPARATOR );7 } 8 9 include_once IWP_PLUGIN_DIR . 'includes' . DIRECTORY_SEPARATOR . 'functions-pull-push.php';6 define( 'IWP_PLUGIN_DIR', dirname( __DIR__ ) . DIRECTORY_SEPARATOR ); 7 } 8 9 require_once IWP_PLUGIN_DIR . 'includes' . DIRECTORY_SEPARATOR . 'functions-pull-push.php'; 10 10 11 11 if ( ! isset( $_SERVER['HTTP_X_IWP_MIGRATE_KEY'] ) || empty( $migrate_key = $_SERVER['HTTP_X_IWP_MIGRATE_KEY'] ) ) { … … 22 22 header( 'x-iwp-status: false' ); 23 23 header( 'x-iwp-message: Could not find wp-config.php in the parent directories.' ); 24 echo "Could not find wp-config.php in the parent directories.";24 echo 'Could not find wp-config.php in the parent directories.'; 25 25 exit( 2 ); 26 26 } … … 226 226 if ( extension_loaded( 'mysqli' ) ) { 227 227 228 if ( isset( $_SERVER['HTTP_X_IWP_PROGRESS'] ) ) { 229 $log_content = "x-iwp-progress: {$_SERVER['HTTP_X_IWP_PROGRESS']}\n"; 228 $iwp_progress = isset( $_SERVER['HTTP_X_IWP_PROGRESS'] ) ? (int) $_SERVER['HTTP_X_IWP_PROGRESS'] : 0; 229 if ( 0 < $iwp_progress ) { 230 $log_content = "x-iwp-progress: {$iwp_progress}\n"; 230 231 file_put_contents( $log_file_path, $log_content, FILE_APPEND ); 231 232 } 232 233 233 if ( isset( $_SERVER['HTTP_X_IWP_PROGRESS'] ) && $_SERVER['HTTP_X_IWP_PROGRESS'] == 100 ) { 234 235 // Retaining user after migration 236 if ( $retain_user ) { 237 238 $user_details_data = isset( $user_details['data'] ) ? (array) $user_details['data'] : array(); 239 $user_details_caps = isset( $user_details['caps'] ) ? (array) $user_details['caps'] : array(); 240 $user_details_roles = isset( $user_details['roles'] ) ? (array) $user_details['roles'] : array(); 241 242 $user_data = array( 243 'user_login' => isset( $user_details_data['user_login'] ) ? $user_details_data['user_login'] : '', 244 'user_pass' => isset( $user_details_data['user_pass'] ) ? base64_decode( $user_details_data['user_pass'] ) : '', 245 'user_nicename' => isset( $user_details_data['user_nicename'] ) ? $user_details_data['user_nicename'] : '', 246 'user_email' => isset( $user_details_data['user_email'] ) ? $user_details_data['user_email'] : '', 247 'user_url' => isset( $user_details_data['user_url'] ) ? $user_details_data['user_url'] : '', 248 'user_registered' => isset( $user_details_data['user_registered'] ) ? $user_details_data['user_registered'] : '', 249 'user_activation_key' => isset( $user_details_data['user_activation_key'] ) ? $user_details_data['user_activation_key'] : '', 250 'user_status' => isset( $user_details_data['user_status'] ) ? $user_details_data['user_status'] : '', 251 'display_name' => isset( $user_details_data['display_name'] ) ? $user_details_data['display_name'] : '', 252 ); 253 254 $fields = implode( ', ', array_keys( $user_data ) ); 255 $values = "'" . implode( "', '", array_map( array( $mysqli, 'real_escape_string' ), $user_data ) ) . "'"; 256 $query = "INSERT INTO {$table_prefix}users ($fields) VALUES ($values)"; 257 258 $query_response = $mysqli->query( $query ); 259 260 if ( $query_response ) { 261 $user_id = $mysqli->insert_id; 262 263 if ( $user_id ) { 264 // Set user capabilities 265 $caps_key = $mysqli->real_escape_string( $table_prefix . 'capabilities' ); 266 $caps_value = $mysqli->real_escape_string( iwp_maybe_serialize( $user_details_caps ) ); 267 $caps_query = "INSERT INTO {$table_prefix}usermeta (user_id, meta_key, meta_value) VALUES ($user_id, '$caps_key', '$caps_value')"; 268 $mysqli->query( $caps_query ); 269 270 // Set user roles 271 $roles_key = $mysqli->real_escape_string( $table_prefix . 'user_level' ); 272 $roles_value = $mysqli->real_escape_string( max( array_keys( $user_details_roles ) ) ); 273 $roles_query = "INSERT INTO {$table_prefix}usermeta (user_id, meta_key, meta_value) VALUES ($user_id, '$roles_key', '$roles_value')"; 274 $mysqli->query( $roles_query ); 234 if ( 100 === $iwp_progress ) { 235 236 try { 237 // Retaining user after migration 238 if ( isset( $retain_user ) && $retain_user && isset( $user_details ) && is_array( $user_details ) && ! empty( $user_details['data'] ) ) { 239 240 $user_details_data = isset( $user_details['data'] ) ? (array) $user_details['data'] : array(); 241 $user_details_caps = isset( $user_details['caps'] ) ? (array) $user_details['caps'] : array(); 242 $user_details_roles = isset( $user_details['roles'] ) ? (array) $user_details['roles'] : array(); 243 244 $user_data = array( 245 'user_login' => isset( $user_details_data['user_login'] ) ? $user_details_data['user_login'] : '', 246 'user_pass' => isset( $user_details_data['user_pass'] ) ? base64_decode( $user_details_data['user_pass'] ) : '', 247 'user_nicename' => isset( $user_details_data['user_nicename'] ) ? $user_details_data['user_nicename'] : '', 248 'user_email' => isset( $user_details_data['user_email'] ) ? $user_details_data['user_email'] : '', 249 'user_url' => isset( $user_details_data['user_url'] ) ? $user_details_data['user_url'] : '', 250 'user_registered' => isset( $user_details_data['user_registered'] ) ? $user_details_data['user_registered'] : '', 251 'user_activation_key' => isset( $user_details_data['user_activation_key'] ) ? $user_details_data['user_activation_key'] : '', 252 'user_status' => isset( $user_details_data['user_status'] ) ? $user_details_data['user_status'] : '', 253 'display_name' => isset( $user_details_data['display_name'] ) ? $user_details_data['display_name'] : '', 254 ); 255 256 $fields = implode( ', ', array_keys( $user_data ) ); 257 $values = "'" . implode( "', '", array_map( array( $mysqli, 'real_escape_string' ), $user_data ) ) . "'"; 258 $query = "INSERT INTO {$table_prefix}users ($fields) VALUES ($values)"; 259 260 $query_response = $mysqli->query( $query ); 261 262 if ( $query_response ) { 263 $user_id = $mysqli->insert_id; 264 265 if ( $user_id ) { 266 // Set user capabilities 267 $caps_key = $mysqli->real_escape_string( $table_prefix . 'capabilities' ); 268 $caps_value = $mysqli->real_escape_string( iwp_maybe_serialize( $user_details_caps ) ); 269 $caps_query = "INSERT INTO {$table_prefix}usermeta (user_id, meta_key, meta_value) VALUES ($user_id, '$caps_key', '$caps_value')"; 270 $mysqli->query( $caps_query ); 271 272 // Set user roles 273 $roles_key = $mysqli->real_escape_string( $table_prefix . 'user_level' ); 274 $roles_value = $mysqli->real_escape_string( max( array_keys( $user_details_roles ) ) ); 275 $roles_query = "INSERT INTO {$table_prefix}usermeta (user_id, meta_key, meta_value) VALUES ($user_id, '$roles_key', '$roles_value')"; 276 $mysqli->query( $roles_query ); 277 } 275 278 } 276 } 277 278 if ( $mysqli->error ) { 279 file_put_contents( $log_file_path, "insert response: " . $mysqli->error . "\n", FILE_APPEND ); 280 } 279 280 if ( $mysqli->error ) { 281 file_put_contents( $log_file_path, 'insert response: ' . $mysqli->error . "\n", FILE_APPEND ); 282 } 283 } 284 } catch ( \Throwable $th ) { 285 file_put_contents( $log_file_path, 'iwp-dest retain user exception: ' . $th->getMessage() . "\n", FILE_APPEND ); 281 286 } 282 287 … … 284 289 // update instawp_api_options after the push db finished 285 290 if ( ! empty( $instawp_api_options ) ) { 291 file_put_contents( $log_file_path, 'Going to update instawp_api_options' . "\n", FILE_APPEND ); 292 286 293 $is_insert_failed = false; 287 294 … … 294 301 } 295 302 } catch ( Exception $e ) { 296 file_put_contents( $log_file_path, "insert exception: ". $e->getMessage() . "\n", FILE_APPEND );303 file_put_contents( $log_file_path, 'insert exception: ' . $e->getMessage() . "\n", FILE_APPEND ); 297 304 298 305 $is_insert_failed = true; … … 318 325 // Remove trailing index.php 319 326 $mysqli->query( "UPDATE `{$table_prefix}options` SET `option_value` = TRIM(TRAILING '/' FROM REPLACE(option_value, '/index.php', '')) WHERE `option_name` IN ('siteurl', 'home')" ); 327 } else { 328 file_put_contents( $log_file_path, 'instawp_api_options not found to update' . "\n", FILE_APPEND ); 320 329 } 321 330 } … … 323 332 $mysqli->close(); 324 333 } else { 334 335 file_put_contents( $log_file_path, 'mysql extension not loaded. skipping reset instawp_api_options and retain users' . "\n", FILE_APPEND ); 325 336 mysql_close( $connection ); 326 337 } 327 338 328 //if ( file_exists( $file_save_path ) ) {329 //unlink( $file_save_path );330 //}339 // if ( file_exists( $file_save_path ) ) { 340 // unlink( $file_save_path ); 341 // } 331 342 } 332 343 … … 340 351 341 352 if ( $res === true || $zip->status == 0 ) { 342 $extracted_files = [];343 for ( $i = 0; $i < $zip->numFiles; $i ++ ) {353 $extracted_files = array(); 354 for ( $i = 0; $i < $zip->numFiles; $i++ ) { 344 355 $file_name = $zip->getNameIndex( $i ); 345 356 … … 348 359 $extracted_files[] = $file_name; 349 360 } 350 } else if ( ! in_array( $file_name, $excluded_paths ) && ! str_contains( $file_name, 'instawp-autologin' ) ) {361 } elseif ( ! in_array( $file_name, $excluded_paths ) && ! str_contains( $file_name, 'instawp-autologin' ) ) { 351 362 $extracted_files[] = $file_name; 352 363 } … … 366 377 } else { 367 378 echo "Couldn't extract $file_save_path.zip.\n"; 368 echo "ZipArchive Error (status): " . $zip->status . " - ". zipStatusString( $zip->status ) . "\n";369 echo "ZipArchive System Error (statusSys): ". $zip->statusSys . "\n";379 echo 'ZipArchive Error (status): ' . $zip->status . ' - ' . zipStatusString( $zip->status ) . "\n"; 380 echo 'ZipArchive System Error (statusSys): ' . $zip->statusSys . "\n"; 370 381 371 382 header( 'x-iwp-status: false' ); … … 374 385 } 375 386 } catch ( Exception $e ) { 376 echo "Error: ". $e->getMessage();387 echo 'Error: ' . $e->getMessage(); 377 388 378 389 header( 'x-iwp-status: false' ); … … 383 394 try { 384 395 $phar = new PharData( $file_save_path ); 385 $extracted_files = [];396 $extracted_files = array(); 386 397 387 398 try { … … 394 405 $extracted_files[] = $file_name; 395 406 } 396 397 407 } catch ( Throwable $e ) { 398 408 header( 'x-iwp-status: false' ); … … 412 422 } 413 423 } catch ( Exception $e ) { 414 echo "Error: ". $e->getMessage();424 echo 'Error: ' . $e->getMessage(); 415 425 416 426 header( 'x-iwp-status: false' ); … … 479 489 ); 480 490 481 $current_domain = str_replace( [ 'https://', 'http://' ], '', rtrim( $home_url, '/\\' ) );491 $current_domain = str_replace( array( 'https://', 'http://' ), '', rtrim( $home_url, '/\\' ) ); 482 492 $wp_config = preg_replace( 483 493 "/'DOMAIN_CURRENT_SITE',\s*'[^']*'/", … … 499 509 500 510 foreach ( $config_lines as $key => $line ) { 501 if ( str_contains( $line, "DB_COLLATE") ) {511 if ( str_contains( $line, 'DB_COLLATE' ) ) { 502 512 $line_number = $key; 503 513 break; … … 509 519 } 510 520 511 file_put_contents( $wp_config_path, implode( "", $config_lines ) );521 file_put_contents( $wp_config_path, implode( '', $config_lines ) ); 512 522 } 513 523 } … … 515 525 header( 'x-iwp-status: true' ); 516 526 header( 'x-iwp-message: Success! ' . $file_relative_path ); 517 -
instawp-connect/trunk/languages/instawp-connect.pot
r3397881 r3406676 6 6 "Content-Type: text/plain; charset=UTF-8\n" 7 7 "Content-Transfer-Encoding: 8bit\n" 8 "POT-Creation-Date: 2025-11- 17 09:17+0000\n"8 "POT-Creation-Date: 2025-11-27 14:14+0000\n" 9 9 "X-Poedit-Basepath: ..\n" 10 10 "X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n" … … 18 18 msgstr "" 19 19 20 #: admin/class-instawp-admin.php:76, includes/class-instawp-hooks.php:325, includes/class-instawp-setting.php:38, includes/class-instawp-tools.php:18 5320 #: admin/class-instawp-admin.php:76, includes/class-instawp-hooks.php:325, includes/class-instawp-setting.php:38, includes/class-instawp-tools.php:1847 21 21 msgid "Create Staging" 22 22 msgstr "" … … 794 794 msgstr "" 795 795 796 #: includes/class-instawp-tools.php:11 95796 #: includes/class-instawp-tools.php:1189 797 797 msgid "API key not found" 798 798 msgstr "" 799 799 800 #: includes/class-instawp-tools.php:14 90800 #: includes/class-instawp-tools.php:1484 801 801 msgid "Root directory for this WordPress installation could not find." 802 802 msgstr "" 803 803 804 #: includes/class-instawp-tools.php:15 14804 #: includes/class-instawp-tools.php:1508 805 805 msgid "Tracking database could not found." 806 806 msgstr "" 807 807 808 #: includes/class-instawp-tools.php:15 23808 #: includes/class-instawp-tools.php:1517 809 809 msgid "API Signature and others data could not set properly" 810 810 msgstr "" 811 811 812 #: includes/class-instawp-tools.php:153 9812 #: includes/class-instawp-tools.php:1533 813 813 msgid "InstaWP could not access or read required files from your WordPress directory due to file permission issue." 814 814 msgstr "" 815 815 816 #: includes/class-instawp-tools.php:15 41816 #: includes/class-instawp-tools.php:1535 817 817 msgid "Learn more." 818 818 msgstr "" 819 819 820 #: includes/class-instawp-tools.php:175 7820 #: includes/class-instawp-tools.php:1751 821 821 msgid "Launch %s" 822 822 msgstr "" 823 823 824 #: includes/class-instawp-tools.php:1842 825 msgid "Please create staging sites first." 826 msgstr "" 827 828 #: includes/class-instawp-tools.php:1843 829 msgid "Skip" 830 msgstr "" 831 832 #: includes/class-instawp-tools.php:1844 833 msgid "Do you really want to disconnect the plugin? It will completely remove the existing staging sites from the plugin." 834 msgstr "" 835 836 #: includes/class-instawp-tools.php:1845 837 msgid "Do you still want to disconnect the plugin?" 838 msgstr "" 839 824 840 #: includes/class-instawp-tools.php:1848 825 msgid " Please create staging sites first."841 msgid "Next Step" 826 842 msgstr "" 827 843 828 844 #: includes/class-instawp-tools.php:1849 829 msgid " Skip"845 msgid "Calculating size" 830 846 msgstr "" 831 847 832 848 #: includes/class-instawp-tools.php:1850 833 msgid "Do you really want to disconnect the plugin? It will completely remove the existing staging sites from the plugin."834 msgstr ""835 836 #: includes/class-instawp-tools.php:1851837 msgid "Do you still want to disconnect the plugin?"838 msgstr ""839 840 #: includes/class-instawp-tools.php:1854841 msgid "Next Step"842 msgstr ""843 844 #: includes/class-instawp-tools.php:1855845 msgid "Calculating size"846 msgstr ""847 848 #: includes/class-instawp-tools.php:1856849 849 msgid "Copied" 850 850 msgstr "" 851 851 852 #: includes/class-instawp-tools.php:191 6852 #: includes/class-instawp-tools.php:1910 853 853 msgid "Zip archive is not opening." 854 854 msgstr "" 855 855 856 #: includes/class-instawp-tools.php:196 9856 #: includes/class-instawp-tools.php:1963 857 857 msgid "No compression method find." 858 858 msgstr "" 859 859 860 #: includes/class-instawp-tools.php:201 6860 #: includes/class-instawp-tools.php:2010 861 861 msgid "Site ID not found in site create response." 862 862 msgstr "" 863 863 864 #: includes/class-instawp-tools.php:20 54864 #: includes/class-instawp-tools.php:2048 865 865 msgid "SFTP login failed." 866 866 msgstr "" 867 867 868 #: includes/class-instawp-tools.php:20 65868 #: includes/class-instawp-tools.php:2059 869 869 msgid "SFTP upload failed for files." 870 870 msgstr "" 871 871 872 #: includes/class-instawp-tools.php:20 73872 #: includes/class-instawp-tools.php:2067 873 873 msgid "SFTP upload failed for database." 874 874 msgstr "" -
instawp-connect/trunk/readme.txt
r3397881 r3406676 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.0 7 Stable tag: 0.1.2. 17 Stable tag: 0.1.2.2 8 8 License: GPLv3 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.en.html … … 99 99 == Changelog == 100 100 101 = 0.1.2.2 - 01 December 2025 = 102 - Fixed: 403 error on migration cleanup API call. 103 - Added: Purge cdn cache 104 101 105 = 0.1.2.1 - 18 November 2025 = 102 106 - Fixed: Cleanup of migration backup files.
Note: See TracChangeset
for help on using the changeset viewer.