Changeset 2690043
- Timestamp:
- 03/07/2022 02:17:53 PM (4 years ago)
- Location:
- wp-migrate-2-aws/trunk
- Files:
-
- 2 added
- 13 edited
-
admin/assets/images/launch-illustration.png (added)
-
admin/assets/images/launch-instance.png (added)
-
admin/assets/scripts.js (modified) (11 diffs)
-
admin/assets/styles.css (modified) (1 diff)
-
admin/classes/adminMigrate.class.php (modified) (1 diff)
-
admin/classes/apiGlobal.class.php (modified) (6 diffs)
-
admin/classes/apiRemote.class.php (modified) (2 diffs)
-
admin/classes/apiRemoteIam.class.php (modified) (2 diffs)
-
admin/classes/apiRemoteS3.class.php (modified) (4 diffs)
-
admin/includes/adminFunctions.php (modified) (3 diffs)
-
admin/includes/adminPages.class.php (modified) (4 diffs)
-
admin/includes/welcomePanel.class.php (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
-
settings.php (modified) (3 diffs)
-
wp-migrate-2-aws.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-migrate-2-aws/trunk/admin/assets/scripts.js
r2626222 r2690043 51 51 // } 52 52 // ); 53 53 54 54 // }; 55 55 … … 78 78 // return; 79 79 } 80 80 81 81 if (typeof result.progressComplete !== 'undefined') { 82 82 progressComplete = result.progressComplete; … … 85 85 wpm2aws_changeProgressBarToWarning($); 86 86 } 87 87 88 88 }) 89 89 .fail(function(jqXHR, textStatus, errorThrown) { … … 103 103 let mainProgressBar = $("#wpm2aws-progress-bar-main"); 104 104 let sideProgressBar = $("#wpm2aws-progress-bar"); 105 105 106 106 let progressBars = []; 107 107 … … 152 152 153 153 // Click the re-start button 154 // console.log("Çlick Restart");155 154 reStartBtn.click(); 156 155 } … … 175 174 } 176 175 176 function wpm2aws_launchBuildProgress($) 177 { 178 let progressBarContainer = $('#wpm2aws-launch-build-progress-bar'); 179 180 // If not on a page where the progress bar exists, then cancel this function 181 if (progressBarContainer.length < 1) { 182 return; 183 } 184 185 let buildCompleteBar = $('#wpm2aws-launch-build-completed'); 186 187 let totalTime = buildCompleteBar.data('totalTime'); 188 let timeRemaining = buildCompleteBar.data('remainingTime'); 189 190 let refreshInterval = 10; 191 let timeOutInterval = (refreshInterval * 1000); 192 193 let expendedTime = totalTime - timeRemaining; 194 let expendedTimePercent = expendedTime / totalTime; 195 let progressBarContainerWidth = progressBarContainer.width(); 196 let progressBarWidth = progressBarContainerWidth * expendedTimePercent; 197 let progressBar = progressBarContainer.find('div.wpm2aws-launch-build-completed-progress-bar'); 198 let animationDuration = 1000; 199 200 // Start the progress bar a little larger than non-existant 201 if (expendedTimePercent < 0.02) { 202 progressBarWidth = progressBarContainerWidth * 0.02; 203 } 204 205 progressBar.animate( 206 { 207 width: progressBarWidth 208 }, 209 animationDuration, 210 "linear" 211 ); 212 213 timeRemaining -= refreshInterval; 214 buildCompleteBar.data('remainingTime', timeRemaining); 215 216 if (timeRemaining > 0) { 217 $('.wpm2aws-launch-build-launch-button').hide(); 218 $('.wpm2aws-launch-build-notice').show(); 219 $('.wpm2aws-instance-launch-text-before-launch-complete').show(); 220 $('.wpm2aws-instance-launch-text-after-launch-complete').hide(); 221 $('#wpm2aws-summary-section button').prop('disabled', true); 222 223 setTimeout( 224 function() { 225 wpm2aws_launchBuildProgress($); 226 }, 227 timeOutInterval 228 ); 229 } else { 230 $('.wpm2aws-launch-build-launch-button').show(); 231 $('.wpm2aws-launch-build-notice').hide(); 232 $('.wpm2aws-instance-launch-text-before-launch-complete').hide(); 233 $('.wpm2aws-instance-launch-text-after-launch-complete').show(); 234 $('#wpm2aws-summary-section button').removeAttr('disabled'); 235 } 236 } 237 177 238 let progressBar; 178 239 let progressBarParent; … … 184 245 // On load - bind Functions 185 246 jQuery(document).ready(function($) { 247 248 // Confirmation dialog before reset 249 $("#wpm2aws-reset-form").on('submit', function() { 250 return confirm('Do you really want reset? Upon reset all progress will be lost.'); 251 }); 252 186 253 $(".wpm2aws-edit-inputs-button").on("click", function() { 187 254 wpm2awsEditSettings($(this).attr("data")); … … 234 301 uploadSuccessNotice = null; 235 302 } 236 303 237 304 if (typeof progressBar !== 'undefined' && progressBar !== null && progressBar.length !== 0) { 238 305 progressComplete = progressBar.data('progress'); … … 246 313 function(){ 247 314 wpm2aws_getCurrentProgress($); 248 315 249 316 if (progressComplete >= 100) { 250 317 console.log("Greater than 100"); 251 318 252 319 clearInterval(loop); 253 320 254 321 if (typeof uploadSuccessNotice === 'undefined' || uploadSuccessNotice === null || uploadSuccessNotice.length === 0) { 255 322 location.reload(); 256 323 } 257 324 258 325 } 259 326 }, … … 270 337 function(){ 271 338 wpm2aws_getCurrentProgress($); 272 339 273 340 if (0 === counter) { 274 341 clearInterval(loop); … … 279 346 }); 280 347 348 // Launch Build Progress Bar 349 wpm2aws_launchBuildProgress($); 281 350 }); -
wp-migrate-2-aws/trunk/admin/assets/styles.css
r2603472 r2690043 163 163 } 164 164 165 /* Styles for instance launch screen */ 166 .wpm2aws-instance-launch-graphic { 167 max-width: 100%; 168 background-color: #1a7899; 169 width: 30%; 170 } 171 172 .wpm2aws-instance-launch-graphic img { 173 width:100%; 174 } 175 176 .wpm2aws-instance-launch-graphic-content { 177 color: #fff; 178 text-align: center; 179 padding: 15px; 180 } 181 182 .wpm2aws-instance-launch-graphic-content h3, 183 .wpm2aws-instance-launch-graphic-content h2 { 184 color:#fff; 185 } 186 187 .wpm2aws-instance-launch-graphic-content h2 { 188 font-size:32px; 189 } 190 191 .wpm2aws-launch-instance-details { 192 padding:20px; 193 width: 60%; 194 } 195 196 .wpm2aws-launch-instance-details-right-image { 197 width: 30%; 198 } 199 .wpm2aws-launch-instance-details-right-image img { 200 width: 100%; 201 } 202 203 .wpm2aws-launch-popup-button-container { 204 margin: 5px 0; 205 } 206 207 .wpm2aws-launch-popup-button { 208 background: #fff; 209 padding: 10px 20px; 210 display: inline-block; 211 text-decoration: none; 212 border-radius: 30px; 213 font-weight: 600; 214 font-size: 14px; 215 } 216 217 #wpm2aws-launch-build-progress-bar { 218 width: 100%; 219 margin: 10px 0; 220 height: 22px; 221 background-color: #f0f0f0; 222 border-radius:10px; 223 border:1px solid #1A7899; 224 } 225 226 #wpm2aws-launch-build-completed { 227 height: 100%; 228 text-align: center; 229 width: 0; 230 background-color: #1A7899; 231 box-sizing: border-box; 232 border-radius:10px; 233 border:2px solid #f0f0f0; 234 } 235 236 #wpm2aws-launch-build-progress-bar-background-loop { 237 position: relative; 238 height: 14px; 239 width:100%; 240 background-color: #2ba3ca; 241 animation:wpm2aws-progress-bar-background-loop 2s linear infinite; 242 border-radius:4px; 243 border-top:2px solid #1A7899; 244 border-bottom:2px solid #1A7899; 245 } 246 247 #wpm2aws-launch-build-progress-bar span { 248 text-align: center; 249 color: #fff; 250 } 251 252 @keyframes wpm2aws-progress-bar-background-loop { 253 0% { 254 left:0%; 255 right:100%; 256 width:0%; 257 } 258 10% { 259 left:0%; 260 right:75%; 261 width:25%; 262 } 263 90% { 264 right:0%; 265 left:75%; 266 width:25%; 267 } 268 100% { 269 left:100%; 270 right:0%; 271 width:0%; 272 } 273 } 274 275 /*custom versions of deprecated build-in wordpress css classes*/ 276 .wpm2aws-welcome-panel-content { 277 margin-left: 13px; 278 max-width: 1500px; 279 } 280 281 .wpm2aws-welcome-panel .wpm2aws-welcome-panel-column-container { 282 clear: both; 283 position: relative; 284 } 285 286 .wpm2aws-welcome-panel .wpm2aws-welcome-panel-column { 287 width: 32%; 288 min-width: 200px; 289 float: left; 290 } 291 292 .wpm2aws-welcome-panel .wpm2aws-welcome-panel-close { 293 position: absolute; 294 top: 10px; 295 right: 10px; 296 padding: 10px 15px 10px 21px; 297 font-size: 13px; 298 line-height: 1.23076923; 299 text-decoration: none; 300 } 301 302 .wpm2aws-welcome-panel { 303 position: relative; 304 overflow: auto; 305 margin: 16px 0; 306 padding: 23px 10px 0; 307 border: 1px solid #c3c4c7; 308 box-shadow: 0 1px 1px rgb(0 0 0 / 4%); 309 background: #fff; 310 font-size: 13px; 311 line-height: 1.7; 312 } 313 314 .wpm2aws-welcome-panel .wpm2aws-welcome-panel-close:before { 315 background:0 0; 316 color:#787c82; 317 content:"\f153"; 318 display:block; 319 font:normal 16px/20px dashicons; 320 speak:never; 321 height:20px; 322 text-align:center; 323 width:20px; 324 -webkit-font-smoothing:antialiased; 325 -moz-osx-font-smoothing:grayscale; 326 } -
wp-migrate-2-aws/trunk/admin/classes/adminMigrate.class.php
r2603472 r2690043 701 701 } 702 702 703 $msg = __('Success!<br><br>Lightsail Launched<br><br><a href="http://' . $instance['publicIp'] . '/" target="_blank">' . $instance['publicIp'] . '</a>', 'migrate-2-aws');704 set_transient('wpm2aws_admin_success_notice_' . get_current_user_id(), $msg);703 $msg = __('Success! Site clone is building.', 'migrate-2-aws'); 704 set_transient('wpm2aws_admin_success_notice_' . get_current_user_id(), $msg); 705 705 706 706 exit(wp_redirect(admin_url('/admin.php?page=wpm2aws'))); -
wp-migrate-2-aws/trunk/admin/classes/apiGlobal.class.php
r2636772 r2690043 15 15 class WPM2AWS_ApiGlobal 16 16 { 17 const WPM2AWS_API_TIMEOUT = 180; 18 17 19 private $credentials; 20 18 21 public function __construct() 19 22 { … … 2294 2297 array( 2295 2298 'method' => 'POST', 2296 'timeout' => 45,2299 'timeout' => self::WPM2AWS_API_TIMEOUT, 2297 2300 'redirection' => 10, 2298 2301 'httpversion' => '1.0', … … 2403 2406 array( 2404 2407 'method' => 'PUT', 2405 'timeout' => 45,2408 'timeout' => self::WPM2AWS_API_TIMEOUT, 2406 2409 'redirection' => 10, 2407 2410 'httpversion' => '1.0', … … 2509 2512 array( 2510 2513 'method' => 'POST', 2511 'timeout' => 45,2514 'timeout' => self::WPM2AWS_API_TIMEOUT, 2512 2515 'redirection' => 10, 2513 2516 'httpversion' => '1.0', … … 2624 2627 array( 2625 2628 'method' => 'POST', 2626 'timeout' => 45,2629 'timeout' => self::WPM2AWS_API_TIMEOUT, 2627 2630 'redirection' => 10, 2628 2631 'httpversion' => '1.0', … … 2745 2748 array( 2746 2749 'method' => 'POST', 2747 'timeout' => 45,2750 'timeout' => self::WPM2AWS_API_TIMEOUT, 2748 2751 'redirection' => 10, 2749 2752 'httpversion' => '1.0', -
wp-migrate-2-aws/trunk/admin/classes/apiRemote.class.php
r2636772 r2690043 3 3 class WPM2AWS_ApiRemote 4 4 { 5 const WPM2AWS_API_TIMEOUT = 180; 6 5 7 public function __construct() 6 8 { … … 83 85 array( 84 86 'method' => 'POST', 85 'timeout' => 45,87 'timeout' => self::WPM2AWS_API_TIMEOUT, 86 88 'redirection' => 10, 87 89 'httpversion' => '1.0', -
wp-migrate-2-aws/trunk/admin/classes/apiRemoteIam.class.php
r2636772 r2690043 4 4 class WPM2AWS_ApiRemoteIam 5 5 { 6 const WPM2AWS_API_TIMEOUT = 180; 7 6 8 private $requestData; 7 9 … … 47 49 array( 48 50 'method' => 'POST', 49 'timeout' => 45,51 'timeout' => self::WPM2AWS_API_TIMEOUT, 50 52 'redirection' => 10, 51 53 'httpversion' => '1.0', -
wp-migrate-2-aws/trunk/admin/classes/apiRemoteS3.class.php
r2636772 r2690043 3 3 class WPM2AWS_ApiRemoteS3 4 4 { 5 const WPM2AWS_API_TIMEOUT = 180; 6 5 7 private $requestData; 6 8 private $bucketName; … … 45 47 array( 46 48 'method' => 'POST', 47 'timeout' => 45,49 'timeout' => self::WPM2AWS_API_TIMEOUT, 48 50 'redirection' => 10, 49 51 'httpversion' => '1.0', … … 98 100 array( 99 101 'method' => 'POST', 100 'timeout' => 45,102 'timeout' => self::WPM2AWS_API_TIMEOUT, 101 103 'redirection' => 10, 102 104 'httpversion' => '1.0', … … 160 162 array( 161 163 'method' => 'POST', 162 'timeout' => 45,164 'timeout' => self::WPM2AWS_API_TIMEOUT, 163 165 'redirection' => 10, 164 166 'httpversion' => '1.0', -
wp-migrate-2-aws/trunk/admin/includes/adminFunctions.php
r2636772 r2690043 1 1 <?php 2 3 function wpm2awsGetLogActionApiTimeOut() 4 { 5 return 60; 6 } 7 8 function wpm2awsGetValidateLicenceActionApiTimeOut() 9 { 10 return 60; 11 } 12 2 13 function wpm2awsAddUpdateOptions($optionName, $value) 3 14 { … … 647 658 array( 648 659 'method' => 'POST', 649 'timeout' => 45,660 'timeout' => wpm2awsGetValidateLicenceActionApiTimeOut(), 650 661 'redirection' => 10, 651 662 'httpversion' => '1.0', … … 713 724 array( 714 725 'method' => 'POST', 715 'timeout' => 45,726 'timeout' => wpm2awsGetLogActionApiTimeOut(), 716 727 'redirection' => 10, 717 728 'httpversion' => '1.0', -
wp-migrate-2-aws/trunk/admin/includes/adminPages.class.php
r2583496 r2690043 12 12 public static function loadIAMform() 13 13 { 14 15 16 14 self::makePageHeading(1); 17 15 … … 304 302 'TRIAL' === strtoupper(get_option('wpm2aws_valid_licence_type')) 305 303 ) { 306 304 307 305 } 308 306 else{ … … 2248 2246 2249 2247 $html = ''; 2250 $html .= '<form class="wpm2aws-align-right" method="post" action="' . esc_url(admin_url('admin-post.php')) . '?action=' . $formAction . '">';2248 $html .= '<form id="wpm2aws-reset-form" class="wpm2aws-align-right" method="post" action="' . esc_url(admin_url('admin-post.php')) . '?action=' . $formAction . '">'; 2251 2249 $html .= '<input type="hidden" name="action" value="' . $formAction . '" />'; 2252 2250 $html .= wp_nonce_field($formAction); … … 2593 2591 return $html; 2594 2592 } 2593 2594 /** 2595 * Convert instance created at time to formatted output 2596 */ 2597 private static function formatInstanceLaunchTime($createdAt) 2598 { 2599 try { 2600 $dateTime = new \DateTime($createdAt); 2601 } catch (Exception $exception) { 2602 $exceptionMessage= $exception->getMessage(); 2603 2604 return \sprintf('not available (%s)', $exceptionMessage); 2605 } 2606 2607 return $dateTime->format('Y-m-d H:i:s'); 2608 } 2609 2610 /** 2611 * Function to calculate the time for progress bar 2612 * 2613 * @param int $buildDurationSeconds 2614 * @param string $instanceLaunchTime 2615 * 2616 * @return false|int 2617 */ 2618 private static function remainingTimeInSecondsForProgressBar($buildDurationSeconds, $instanceLaunchTime) 2619 { 2620 $launchTimeUnix = \strtotime($instanceLaunchTime); 2621 2622 if ($launchTimeUnix === false) { 2623 return false; 2624 } 2625 2626 $expectedBuildTime = $launchTimeUnix + $buildDurationSeconds; 2627 $now = \time(); 2628 $timeRemaining = $expectedBuildTime - $now; 2629 2630 if ($timeRemaining < 1) { 2631 return false; 2632 } 2633 2634 return $timeRemaining; 2635 } 2636 2595 2637 // Current Settings Section 2596 2597 2638 private static function makeConfirmedLightsailInfoSection() 2598 2639 { 2599 if (get_option('wpm2aws-lightsail-instance-details') !== false) { 2600 $lightsailDetails = get_option('wpm2aws-lightsail-instance-details'); 2601 // 'name' => $name, 'region' => $region, 'publicIp' 2602 2603 2604 echo '<div class="wpm2aws-inputs-row" style="border-color:#DD6B10;width:97%;padding:15px 10px;display:block;">'; 2605 echo '<h3>AWS Instance Launch Activated Successfully</h3>'; 2606 echo '<h4>Your instance is currently being compiled and will be available shortly.</h4>'; 2607 echo '<h4>An email will be sent to the email address associated with your licence key with further information and active links.</h4>'; 2608 echo '<h4>The details outlined below are for reference only.</h4>'; 2609 echo '<ul>'; 2610 if (defined('WPM2AWS_TESTING')) { 2611 echo '<li> <strong>Instance Name: </strong>' . $lightsailDetails['name'] . '</li>'; 2612 } 2613 echo '<li> ======================================== </li>'; 2614 echo '<li> <strong>Region: </strong>' . $lightsailDetails['region'] . '</li>'; 2615 $instance_datetime = $lightsailDetails['details']['createdAt']; 2616 $instance_datetime = str_replace('T', ' T ', $instance_datetime); 2617 echo '<li> <strong>Launch Time: </strong>' . $instance_datetime . '</li>'; 2618 echo '<li> <strong>Source URL: </strong>' . get_bloginfo('wpurl') . '</li>'; 2619 ///echo '<li> <a href="http://' . $lightsailDetails['publicIp'] . '/wp-admin/admin.php?page=wpm2aws" target="_blank">Site Login</a> <span style="font-size:12px;"><i>(Login with your existing user access details)</i></span></li>'; 2620 echo '<li> ======================================== </li>'; 2621 echo '</ul>'; 2622 2623 /// show this to the review user 2624 if ( 2625 false !== get_option('wpm2aws_valid_licence_type') && 2626 'TRIAL' === strtoupper(get_option('wpm2aws_valid_licence_type')) 2627 ) { 2628 echo '<h3>Clone to AWS Trial</h3>'; 2629 echo '<p>This temporary site will remain active for review for 36 hours after launch.</p>'; 2630 echo '<p>At this point it will be shut-down unless users choose to <a target="_blank" href="https://www.seahorse-data.com/pricing/">purchase a plan or licence</a> for ongoing WordPress Hosting on AWS</p>'; 2631 echo '<p>To migrate a site to your own AWS account <a target="_blank" href="https://www.seahorse-data.com/pricing/">please click here to select a licence</a></p>'; 2632 2633 // echo '<ul>'; 2634 // echo '<li>Tier 1: <a target="_blank" href="https://www.seahorse-data.com/checkout?edd_action=add_to_cart&download_id=1330&edd_options[price_id]=1">Add to Cart</a></li>'; 2635 // echo '<li>Tier 2: <a target="_blank" href="https://www.seahorse-data.com/checkout?edd_action=add_to_cart&download_id=7318&edd_options[price_id]=1">Add to Cart</a></li>'; 2636 // echo '<li>Tier 3: <a target="_blank" href="https://www.seahorse-data.com/checkout?edd_action=add_to_cart&download_id=7320&edd_options[price_id]=2">Add to Cart</a></li>'; 2637 // echo '<li>Tier 4: <a target="_blank" href="https://www.seahorse-data.com/checkout?edd_action=add_to_cart&download_id=7322&edd_options[price_id]=2">Add to Cart</a></li>'; 2638 // echo '<li>Tier 5: <a target="_blank" href="https://www.seahorse-data.com/checkout?edd_action=add_to_cart&download_id=7325&edd_options[price_id]=2">Add to Cart</a></li>'; 2639 // echo '<li>Tier 6: <a target="_blank" href="https://www.seahorse-data.com/checkout?edd_action=add_to_cart&download_id=7327&edd_options[price_id]=2">Add to Cart</a></li>'; 2640 // echo '</ul>'; 2641 2642 } else { 2643 /// show this to a paid user (not review licence) 2644 if (false !== get_option('wpm2aws_lightsail_ssh') && '' !== get_option('wpm2aws_lightsail_ssh')) { 2645 echo '<h3>NB: Download and store this SSH Key securely.</h3>'; 2646 $shhDetails = get_option('wpm2aws_lightsail_ssh'); 2647 if (!empty($shhDetails['prkey'])) { 2648 if (!file_exists(WPM2AWS_KEY_DOWNLOAD_PATH)) { 2649 wpm2aws_makeDownloadKeyFile(); 2650 } 2651 echo self::makeShhKeyDownloadButton(); 2640 if (get_option('wpm2aws-lightsail-instance-details') === false) { 2641 return; 2642 } 2643 2644 $lightsailDetails = get_option('wpm2aws-lightsail-instance-details'); 2645 2646 $instance_datetime = $lightsailDetails['details']['createdAt']; 2647 $formattedLaunchDate = self::formatInstanceLaunchTime($instance_datetime); 2648 2649 $buildDurationSeconds = (15 * 60); // 15 minutes 2650 2651 $remainingTime = self::remainingTimeInSecondsForProgressBar($buildDurationSeconds, $formattedLaunchDate); 2652 2653 echo '<div class="wpm2aws-inputs-row" class="wpm2aws-launch-instance-content" style="border-color:#DD6B10;width:97%;padding:15px 10px;display:flex;align-items: center;">'; 2654 2655 echo self::makeLaunchGraphic($remainingTime); 2656 2657 echo '<div class="wpm2aws-launch-instance-details">'; 2658 2659 if ($remainingTime !== false) { 2660 echo '<div class="wpm2aws-launch-build-notice">'; 2661 echo '<h3>Hold tight, your site is building!</h3>'; 2662 echo '<p>You have successfully created a clone of your website on AWS! The site build is currently in progress.'; 2663 echo '<br>'; 2664 echo 'Links to your cloned site will be displayed once the build has completed. (average build time: 15 minutes approximately)</p>'; 2665 echo '<div id="wpm2aws-launch-build-progress-bar">'; 2666 echo '<div id="wpm2aws-launch-build-completed" class="wpm2aws-launch-build-completed-progress-bar" data-total-time="' . $buildDurationSeconds . '" data-remaining-time="' . $remainingTime . '">'; 2667 echo '<div id="wpm2aws-launch-build-progress-bar-background-loop"></div>'; 2668 echo '</div>'; 2669 echo '</div>'; 2670 echo '</div>'; 2671 } 2672 2673 echo "<a class='wpm2aws-launch-build-launch-button' target='_blank' style='background: #1a7899;padding: 10px 20px;border-radius: 30px;color: #fff;text-decoration: none;font-weight: 600;line-height: 1;margin: 0;' href='" . esc_url($lightsailDetails['publicIp']). "'>Visit Your Clone Site Here</a>"; 2674 2675 echo '<h4 style="font-weight:bold">An email will be sent to the email address associated with your licence key with further information and active links.</h4>'; 2676 echo '<h4>The details outlined below are for reference only.</h4>'; 2677 echo '<ul style="padding:15px;background: #f0f0f0;color:#fff;color: #1a7899;border: 1px solid #e59335;border-radius: 5px;">'; 2678 2679 if (defined('WPM2AWS_TESTING')) { 2680 echo '<li> <strong>Instance Name: </strong>' . $lightsailDetails['name'] . '</li>'; 2681 } 2682 2683 echo '<li> <strong>Region: </strong>' . $lightsailDetails['region'] . ', (Ireland)</li>'; 2684 2685 echo '<li> <strong>Launch Time: </strong>' . $formattedLaunchDate . '</li>'; 2686 echo '<li> <strong>Source URL: </strong>' . get_bloginfo('wpurl') . '</li>'; 2687 echo '<li> <strong>Plan Type: </strong>'; 2688 echo '<a target="_blank" style="color:#e59335;font-weight:600;" href="https://aws.amazon.com/lightsail/pricing/"> $10 per month</a>'; 2689 echo '</li>'; 2690 echo '</ul>'; 2691 2692 // show this to the review user 2693 if ( 2694 false !== get_option('wpm2aws_valid_licence_type') && 2695 'TRIAL' === strtoupper(get_option('wpm2aws_valid_licence_type')) 2696 ) { 2697 echo '<h3>Clone to AWS Trial</h3>'; 2698 echo '<p>This temporary site will remain active for review for 36 hours after launch at which point it will be shut-down.</p>'; 2699 echo '<p>If you are interested in migrating to AWS after this time the Self-Managed option offers the full migration features in the plugin, connected directly to your own AWS account.</p>'; 2700 echo '<p>Would you like to know more? Check out the available options <a target="_blank" href="https://www.seahorse-data.com/pricing/">here</a>.</p>'; 2701 } else { 2702 /// show this to a paid user (not review licence) 2703 if (false !== get_option('wpm2aws_lightsail_ssh') && '' !== get_option('wpm2aws_lightsail_ssh')) { 2704 echo '<h3>NB: Download and store this SSH Key securely.</h3>'; 2705 $shhDetails = get_option('wpm2aws_lightsail_ssh'); 2706 if (!empty($shhDetails['prkey'])) { 2707 if (!file_exists(WPM2AWS_KEY_DOWNLOAD_PATH)) { 2708 wpm2aws_makeDownloadKeyFile(); 2652 2709 } 2710 echo self::makeShhKeyDownloadButton(); 2653 2711 } 2654 2712 } 2655 2656 echo '</div>'; 2657 } 2713 } 2714 2715 echo '</div>'; 2716 2717 echo '<div class="wpm2aws-launch-instance-details-right-image">'; 2718 echo '<img src="' . plugins_url('assets/images/launch-illustration.png', dirname(__FILE__)) . '">'; 2719 echo '</div>'; 2720 2721 echo '</div>'; 2722 } 2723 2724 /** 2725 * Generates the launch card with image. 2726 * 2727 * @return string 2728 */ 2729 private static function makeLaunchGraphic($remainingTime) 2730 { 2731 $html = ''; 2732 2733 $html .= '<div class="wpm2aws-instance-launch-graphic">'; 2734 $html .= '<div class="wpm2aws-instance-launch-graphic-img">'; 2735 $html .= '<img src="' . plugins_url('assets/images/launch-instance.png', dirname(__FILE__)) . '">'; 2736 $html .= '</div>'; 2737 $html .= '<div class="wpm2aws-instance-launch-graphic-content">'; 2738 $html .= '<h2>Congratulations!</h2>'; 2739 2740 if ($remainingTime !== false) { 2741 $html .= '<h3 class="wpm2aws-instance-launch-text-before-launch-complete">Your cloned site is currently building and will be available shortly</h3>'; 2742 $html .= '<h3 style="display:none;" class="wpm2aws-instance-launch-text-after-launch-complete">You have successfully created<br> your site clone instance!</h3>'; 2743 } else { 2744 $html .= '<h3>You have successfully created<br> your site clone instance!</h3>'; 2745 } 2746 2747 $html .= '</div>'; 2748 $html .= '</div>'; 2749 2750 return $html; 2658 2751 } 2659 2752 -
wp-migrate-2-aws/trunk/admin/includes/welcomePanel.class.php
r2626222 r2690043 9 9 10 10 public static function template() 11 { 12 $classes = 'welcome-panel'; 11 { ?> 12 <div id="welcome-panel" class="wpm2aws-welcome-panel"> 13 <?php wp_nonce_field('wpm2aws-welcome-panel-nonce', 'welcomepanelnonce', false); ?> 13 14 14 $vers = (array) get_user_meta( 15 get_current_user_id(), 16 'wpm2aws_hide_welcome_panel_on', 17 true 18 ); 15 <div class="wpm2aws-welcome-panel-content"> 16 <div class="wpm2aws-welcome-panel-column-container"> 19 17 20 // if (wpm2aws_version_grep(wpm2aws_version('only_major=1'), $vers)) { 21 // $classes .= ' hidden'; 22 // } 23 ?> 24 25 <div id="welcome-panel" class="<?php echo esc_attr($classes); ?>"> 26 <?php wp_nonce_field('wpm2aws-welcome-panel-nonce', 'welcomepanelnonce', false); ?> 27 <a class="welcome-panel-close" href="<?php echo esc_url(menu_page_url('wpm2aws', false)); ?>"><?php echo esc_html(__('Dismiss', 'migration-2-aws')); ?></a> 28 29 <div class="welcome-panel-content"> 30 <div class="welcome-panel-column-container"> 31 32 <div style="max-width:25%;" class="welcome-panel-column welcome-panel-first"> 18 <div style="max-width:25%;" class="wpm2aws-welcome-panel-column wpm2aws-welcome-panel-first"> 33 19 34 20 <p> … … 36 22 </p> 37 23 38 <!--39 <h3><span class="dashicons dashicons-shield" aria-hidden="true"></span> <?php echo esc_html(__("Before using this tool", 'migration-2-aws')); ?></h3>40 <ul>41 <li><?php //// echo esc_html(__("Understand the process.", 'migration-2-aws')); ?></li>42 <li><?php /// echo esc_html(__("Read the documentation.", 'migration-2-aws')); ?></li>43 <li><?php /// echo esc_html(__("Contact us if uncertain.", 'migration-2-aws')); ?></li>44 </ul>45 -->46 47 24 </div> 48 25 49 <div style="max-width:25%;border-left:1px solid #d2d2d2;padding-left:25px; margin-top:8px;" class="w elcome-panel-columnwelcome-panel-middle">26 <div style="max-width:25%;border-left:1px solid #d2d2d2;padding-left:25px; margin-top:8px;" class="wpm2aws-welcome-panel-column wpm2aws-welcome-panel-middle"> 50 27 <h3>Licence v.<?php echo constant("WPM2AWS_VERSION"); ?></h3> 51 28 <p> … … 101 78 </div> 102 79 103 <div style="max-width:25%;border-left:1px solid #d2d2d2;padding-left:25px; margin-top:8px;" class="w elcome-panel-columnwelcome-panel-last">80 <div style="max-width:25%;border-left:1px solid #d2d2d2;padding-left:25px; margin-top:8px;" class="wpm2aws-welcome-panel-column wpm2aws-welcome-panel-last"> 104 81 105 82 <h3><?php echo esc_html(__("Tutorial", 'migration-2-aws')); ?></h3> -
wp-migrate-2-aws/trunk/readme.txt
r2636772 r2690043 2 2 Author: Seahorse 3 3 Contributors: wpseahorse, echomedia 4 Tags: migration, AWS, migrate WordPress, manage AWS5 Requires at least: 4. 46 Tested up to: 5. 74 Tags: migration, aws, migrate, manage, clone 5 Requires at least: 4.8 6 Tested up to: 5.9 7 7 Requires PHP: 5.6 8 8 Stable tag: trunk 9 9 10 Easily Clone and Manage sites inAWS from within your WordPress interface without any AWS knowledge! View this site on AWS Now for FREE!10 Easily Migrate, Clone or Transfer sites to AWS from within your WordPress interface without any AWS knowledge! View this site on AWS Now for FREE! 11 11 12 12 == Description == 13 13 14 Migrate, Clone or Transfer sites to AWS in 4 simple steps. Once migrated this software allows you to easily manage AWS Hosting (e.g. scale up/down, roll back etc.) via your WordPress interface. View your site on AWS today absolutely FREE!No AWS Cloud expertise required.15 16 **Get Free Licence Key** Simply [Click Here](https://www.seahorse-data.com/checkout?edd_action=add_to_cart&download_id=8272) to get a licence key to use the plugin today. Clone any site now to see your site in AWS for Free! No license fees or AWS usage charges will apply. Dev sites stay active for 36 hours after launch.17 18 **AWS Trial Tutorial** [Link to AWS Labs](https://aws.amazon.com/getting-started/hands-on/migrating-a-wp-website/)19 20 ** Self Managed Tutorial** [Link to Self Managed Tutorial](https://www.seahorse-data.com/migrating-and-managing-wordpress-with-amazon-lightsail-self-manage/)14 Migrate, Clone or Transfer sites to AWS in 4 simple steps. Once migrated this software allows you to easily manage AWS Hosting via your WordPress interface. View your site on AWS today absolutely **FREE!** No AWS Cloud expertise required. 15 16 **Get Free Licence Key** Simply [Click Here](https://www.seahorse-data.com/checkout?edd_action=add_to_cart&download_id=8272) to get a licence key to use the plugin today. Clone any site now to see your site in AWS for Free! No license fees or AWS usage charges will apply. Trial instances stay active for 36 hours after launch. 17 18 **AWS Trial User Guide** [Link to AWS Labs](https://aws.amazon.com/getting-started/hands-on/migrating-a-wp-website/) 19 20 **AWS User Guide** [Link to Self Managed User Guide](https://www.seahorse-data.com/migrating-and-managing-wordpress-with-amazon-lightsail-self-manage/) 21 21 22 22 ### YOUR WORDPRESS AWS MANAGEMENT ASSISTANT 23 23 24 24 = What does it do? = 25 [WP on AWS](https://www.seahorse-data.com/) provides a data transfer and AWS architecture build solution through a simple to navigate interface **and** a control panel to easily manage the site's AWS infrastructure once transferred. **No AWS Cloud Knowledge Required** 26 27 * Provides an efficient and flexible tool for data transfer 28 * Offers a simplified Architecture Selection / Build interface using Lightsail model 29 * Builds complete AWS architecture using data from source 30 * Presents an interface for Platform / DNS Configuration 31 * Control Panel interface to Manage AWS infrastructure (via WordPress interface or Management Console) 25 [WP on AWS](https://www.seahorse-data.com/) provides an AWS data transfer & architecture build solution through a simple to navigate interface **and** a control panel to easily manage the site's AWS infrastructure once transferred. **No AWS Cloud Knowledge Required** 32 26 33 27 = Who is this plugin for? = 34 This plugin is primarily aimed at WordPress Developers & Agencies who manage their clients hosting and have identified AWS as the solution to their WordPress hosting requirements.28 This plugin is primarily aimed at WordPress Webmasters (Site Owners), Developers & Agencies 35 29 36 30 #### ROADMAP: 37 * Beta Testing Phase 1: Feb 01 - Mar 03, 202038 * Beta Testing Phase 2: Mar 04 - Jun 04, 202039 * Beta Testing Phase 3: Jun 05 - Aug 31, 202040 41 31 * v.1.9.1 Release - Jun 05, 2020 [WCEU](https://2020.europe.wordcamp.org/) 42 32 43 * v.2. 0.1 Managed Solution Release: Sep 07, 2020 [Link to AWS Labs](https://aws.amazon.com/getting-started/hands-on/migrating-a-wp-website/)44 45 * v. 2.3.0 Self-Managed Solution Release: Nov 30, 2020 [Link to Self Managed Tutorial](https://www.seahorse-data.com/migrating-and-managing-wordpress-with-amazon-lightsail-self-manage/)33 * v.2.3.0 v.2 Self-Managed Solution Release: Nov 30, 2020 [Link to Self Managed Tutorial](https://www.seahorse-data.com/migrating-and-managing-wordpress-with-amazon-lightsail-self-manage/) 34 35 * v.3.2.* v.3 Self-Managed Solution Release: Jun 02, 2022 [WCEU](https://europe.wordcamp.org/2022/) 46 36 47 37 == Installation == … … 51 41 2. Activate the plugin through the 'Plugins' menu in WordPress 52 42 53 == Video Guides ==54 **WP on AWS** Explainer Video55 56 https://youtu.be/6OVVGiuTxAg57 58 How to clone a WordPress site to AWS in 3 minutes59 60 https://youtu.be/n7NkrhHRFNw61 62 How to manage AWS hosting from within your WordPress admin console63 64 https://youtu.be/gR61ufldqng65 66 67 43 == Changelog == 44 45 = 3.1.0 = 46 * feature - #32 updated launch-success view layout & contents 47 * bugfix - #35 switch-off multi-site support 48 * feature - #36 updated configuration for remote manage API 49 * fix - #37 removed check for amazon polly plugin conflict 50 * testing - #38 tested to WordPress version 5.9 51 * fix #41 updates to text, image, and external links on launch screen 68 52 69 53 = 3.0.20 = … … 204 188 205 189 = adopting admin migration process as default = 190 191 == Frequently Asked Questions == 192 193 = Do I need my own AWS Account? = 194 195 You do not need an AWS account to run a trial clone. A self-manage licence however requires an AWS account as this is where the instance will be built. Seahorse offers an account creation service for users if required. 196 197 = Where are Trial clones created? = 198 199 Trial instances are created in our Seahorse / AWS environment. 200 201 = Why is there no option to select another Region? = 202 203 Trials are restricted to the eu-west-1 (Ireland) region only. Users have the option to select any of the Lightsail regions however when using a production licence 204 205 = Does your software support multisite networks? = 206 207 No, the software does not currently allow migration or management of WordPress multisite. Multisite support is part of our development roadmap however and will be delivered later in 2021. 208 209 = For how long are trial clones active? = 210 211 Trial instances are active for 36 hours after launch. 212 213 = Can I log into the Trial clone instance and make changes? = 214 215 No, the trial instance is for front-end review only and access to the WordPress admin of the site is restricted. 216 217 = What plan level is the Trial instance running on? = 218 219 Trial instances are launched on the $10 Lightsail plan. More information on plan types can be found here: https://aws.amazon.com/lightsail/pricing/. On production licenses the initial migration is also launched on the $10 plan but users are free from there to scale up/down as they wish -
wp-migrate-2-aws/trunk/settings.php
r2636772 r2690043 15 15 self::client_supported(); 16 16 self::fopen_available(); 17 self::isMultisiteInstallation(); 17 18 self::zip_archive_available(); 18 19 self::zip_archive_disabled(); 19 self::checkAwsforWpPlugin();20 20 self::checkSimplyStaticPlugin(); 21 21 … … 59 59 return $curlExecDisabled; 60 60 } 61 61 62 /** 63 * Check if the current site is a multi-site installation & set an error message. 64 * 65 * @return bool 66 */ 67 private static function isMultisiteInstallation() 68 { 69 $isMultiSiteInstallation = is_multisite(); 70 71 if ($isMultiSiteInstallation === true) { 72 self::$settingsErrors[] = 'We have detected that this site is a multisite installation. WordPress Multisite is not yet supported.'; 73 } 74 75 return $isMultiSiteInstallation; 76 } 77 78 79 62 80 private static function fopen_available() { 63 81 $fopenAllowed = ini_get( 'allow_url_fopen' ); … … 66 84 } 67 85 return $fopenAllowed; 68 }69 70 private static function checkAwsforWpPlugin() {71 $isActive = is_plugin_active( 'amazon-polly/amazonpolly.php' );72 if ($isActive === true) {73 $pluginData = get_plugin_data( WP_PLUGIN_DIR."/amazon-polly/amazonpolly.php");74 if($pluginData['Version'] > '4.2.2') {75 self::$settingsErrors[] = 'AWS for WordPress plugin is active on this site and running a version which coflicts with WP on AWS. Please disable this plugin for the duration of the cloning process.';76 }77 }78 return $isActive;79 86 } 80 87 -
wp-migrate-2-aws/trunk/wp-migrate-2-aws.php
r2636772 r2690043 10 10 Tags: migration, AWS, migrate WordPress, manage AWS 11 11 Requires at least: 4.8 12 Tested up to: 5. 712 Tested up to: 5.9 13 13 Stable tag: 4.8 14 14 Domain Path: /languages/ 15 Version: 3. 0.2015 Version: 3.1.0 16 16 License: GPLv2 or later 17 17 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 25 25 } 26 26 27 define('WPM2AWS_VERSION', '3. 0.20');27 define('WPM2AWS_VERSION', '3.1.0'); 28 28 29 29 define('WPM2AWS_REQUIRED_WP_VERSION', '4.8');
Note: See TracChangeset
for help on using the changeset viewer.