Changeset 2636772
- Timestamp:
- 11/29/2021 11:09:47 AM (4 years ago)
- Location:
- wp-migrate-2-aws/trunk
- Files:
-
- 1 added
- 8 edited
-
admin/classes/apiGlobal.class.php (modified) (10 diffs)
-
admin/classes/apiRemote.class.php (modified) (2 diffs)
-
admin/classes/apiRemoteIam.class.php (modified) (2 diffs)
-
admin/classes/apiRemoteS3.class.php (modified) (6 diffs)
-
admin/includes/adminFunctions.class.php (added)
-
admin/includes/adminFunctions.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
settings.php (modified) (7 diffs)
-
wp-migrate-2-aws.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-migrate-2-aws/trunk/admin/classes/apiGlobal.class.php
r2626222 r2636772 2305 2305 ) 2306 2306 ); 2307 // return $response; 2307 2308 $isError = is_wp_error($response); 2309 if ($isError === true) { 2310 // Alert Error 2311 $adminFunctions = new WPM2AWS_AdminFunctions(); 2312 $errorMessage = $response->get_error_message(); 2313 $adminFunctions->wpm2awsAlertBadRemoteConnection('n/a', $errorMessage, 'getRemoteConsoleData'); 2314 return array('error' => 'An Error Has Occurred (data)<br>Please contact <a href="https://www.seahorse-data.com/wp-on-aws-support-portal/" target="_blank">Seahorse Support</a>', 'code' => 'error'); 2315 } 2316 2308 2317 $responseCode = wp_remote_retrieve_response_code($response); 2309 // wp_die(print_r($response)); 2318 2310 2319 if ('200' !== $responseCode && 200 !== $responseCode) { 2311 2320 $errorMessage = json_decode($response['body'], true); … … 2313 2322 return array('error' => 'Unauthorised Access<br>' . $errorMessage, 'code' => $responseCode); 2314 2323 } else { 2324 // Alert Bad Connection 2325 if ((int)$responseCode >= 500 && (int)$responseCode < 600) { 2326 $adminFunctions = new WPM2AWS_AdminFunctions(); 2327 $adminFunctions->wpm2awsAlertBadRemoteConnection($responseCode, $errorMessage, 'getRemoteConsoleData'); 2328 } 2329 2315 2330 return array('error' => 'An Error Has Occurred (data)<br>' . $errorMessage, 'code' => $responseCode); 2316 2331 } … … 2399 2414 ) 2400 2415 ); 2401 // return $response; 2416 2417 2418 $isError = is_wp_error($response); 2419 if ($isError === true) { 2420 // Alert Error 2421 $adminFunctions = new WPM2AWS_AdminFunctions(); 2422 $errorMessage = $response->get_error_message(); 2423 $adminFunctions->wpm2awsAlertBadRemoteConnection('n/a', $errorMessage, 'remoteAddNewMetricAlarm'); 2424 return array('error' => 'An Error Has Occurred (data)<br>Please contact <a href="https://www.seahorse-data.com/wp-on-aws-support-portal/" target="_blank">Seahorse Support</a>', 'code' => 'error'); 2425 } 2426 2402 2427 $responseCode = wp_remote_retrieve_response_code($response); 2403 // wp_die(print_r($response)); 2428 2404 2429 if ('200' !== $responseCode && 200 !== $responseCode) { 2405 2430 $errorMessage = json_decode($response['body'], true); … … 2407 2432 return array('error' => 'Unauthorised Access<br>' . $errorMessage, 'code' => $responseCode); 2408 2433 } else { 2434 // Alert Bad Connection 2435 if ((int)$responseCode >= 500 && (int)$responseCode < 600) { 2436 $adminFunctions = new WPM2AWS_AdminFunctions(); 2437 $adminFunctions->wpm2awsAlertBadRemoteConnection($responseCode, $errorMessage, 'remoteAddNewMetricAlarm'); 2438 } 2409 2439 return array('error' => 'An Error Has Occurred<br>' . $errorMessage, 'code' => $responseCode); 2410 2440 } … … 2490 2520 ) 2491 2521 ); 2492 // return $response; 2522 2523 $isError = is_wp_error($response); 2524 if ($isError === true) { 2525 // Alert Error 2526 $adminFunctions = new WPM2AWS_AdminFunctions(); 2527 $errorMessage = $response->get_error_message(); 2528 $adminFunctions->wpm2awsAlertBadRemoteConnection('n/a', $errorMessage, 'remoteRebootInstance'); 2529 throw new \Exception('An error has occurred.<br>Please contact <a href="https://www.seahorse-data.com/wp-on-aws-support-portal/" target="_blank">Seahorse Support</a>'); 2530 } 2531 2493 2532 $responseCode = wp_remote_retrieve_response_code($response); 2494 // wp_die(print_r($response)); 2533 2495 2534 if ('200' !== $responseCode && 200 !== $responseCode) { 2496 2535 $errorMessage = json_decode($response['body'], true); … … 2500 2539 return array('error' => 'Unauthorised Access<br>' . $errorMessage, 'code' => $responseCode); 2501 2540 } else { 2502 // wp_die(print_r($errorMessage)); 2541 // Alert Bad Connection 2542 if ((int)$responseCode >= 500 && (int)$responseCode < 600) { 2543 $adminFunctions = new WPM2AWS_AdminFunctions(); 2544 $adminFunctions->wpm2awsAlertBadRemoteConnection($responseCode, $errorMessage, 'remoteRebootInstance'); 2545 } 2546 2503 2547 throw new Exception('Unauthorised Access<br>' . $errorMessage); 2504 2548 return array('error' => 'An Error Has Occurred<br>' . $errorMessage, 'code' => $responseCode); … … 2591 2635 ) 2592 2636 ); 2593 // return $response; 2637 2638 $isError = is_wp_error($response); 2639 if ($isError === true) { 2640 // Alert Error 2641 $adminFunctions = new WPM2AWS_AdminFunctions(); 2642 $errorMessage = $response->get_error_message(); 2643 $adminFunctions->wpm2awsAlertBadRemoteConnection('n/a', $errorMessage, 'remoteCreateManualSnapshot'); 2644 throw new \Exception('An error has occurred.<br>Please contact <a href="https://www.seahorse-data.com/wp-on-aws-support-portal/" target="_blank">Seahorse Support</a>'); 2645 } 2646 2594 2647 $responseCode = wp_remote_retrieve_response_code($response); 2595 // wp_die(print_r($response)); 2648 2596 2649 if ('200' !== $responseCode && 200 !== $responseCode) { 2597 2650 $errorMessage = json_decode($response['body'], true); … … 2601 2654 return array('error' => 'Unauthorised Access<br>' . $errorMessage, 'code' => $responseCode); 2602 2655 } else { 2603 // wp_die(print_r($errorMessage)); 2656 // Alert Bad Connection 2657 if ((int)$responseCode >= 500 && (int)$responseCode < 600) { 2658 $adminFunctions = new WPM2AWS_AdminFunctions(); 2659 $adminFunctions->wpm2awsAlertBadRemoteConnection($responseCode, $errorMessage, 'remoteCreateManualSnapshot'); 2660 } 2661 2604 2662 throw new Exception('Unauthorised Access<br>' . $errorMessage); 2605 2663 return array('error' => 'An Error Has Occurred<br>' . $errorMessage, 'code' => $responseCode); … … 2699 2757 ); 2700 2758 2759 $isError = is_wp_error($response); 2760 if ($isError === true) { 2761 // Alert Error 2762 $adminFunctions = new WPM2AWS_AdminFunctions(); 2763 $errorMessage = $response->get_error_message(); 2764 $adminFunctions->wpm2awsAlertBadRemoteConnection('n/a', $errorMessage, 'remoteChangeInstancePlan'); 2765 throw new \Exception('An error has occurred.<br>Please contact <a href="https://www.seahorse-data.com/wp-on-aws-support-portal/" target="_blank">Seahorse Support</a>'); 2766 } 2767 2701 2768 $responseCode = wp_remote_retrieve_response_code($response); 2702 // wp_die(print_r($response)); 2769 2703 2770 if ('200' !== $responseCode && 200 !== $responseCode) { 2704 2771 $errorMessage = json_decode($response['body'], true); … … 2708 2775 return array('error' => 'Unauthorised Access<br>' . $errorMessage, 'code' => $responseCode); 2709 2776 } else { 2710 // wp_die(print_r($errorMessage)); 2777 // Alert Bad Connection 2778 if ((int)$responseCode >= 500 && (int)$responseCode < 600) { 2779 $adminFunctions = new WPM2AWS_AdminFunctions(); 2780 $adminFunctions->wpm2awsAlertBadRemoteConnection($responseCode, $errorMessage, 'remoteChangeInstancePlan'); 2781 } 2782 2711 2783 throw new Exception('Unauthorised Access<br>' . $errorMessage); 2712 2784 return array('error' => 'An Error Has Occurred<br>' . $errorMessage, 'code' => $responseCode); -
wp-migrate-2-aws/trunk/admin/classes/apiRemote.class.php
r2626222 r2636772 94 94 ) 95 95 ); 96 // die(print_r($response)); 96 97 $isError = is_wp_error($response); 98 if ($isError === true) { 99 // Alert Error 100 $adminFunctions = new WPM2AWS_AdminFunctions(); 101 $errorMessage = $response->get_error_message(); 102 $adminFunctions->wpm2awsAlertBadRemoteConnection('n/a', $errorMessage, 'createLightsailFromZip'); 103 throw new \Exception('An error has occurred.<br>Please contact <a href="https://www.seahorse-data.com/wp-on-aws-support-portal/" target="_blank">Seahorse Support</a>'); 104 } 105 97 106 $responseCode = wp_remote_retrieve_response_code($response); 98 // wp_die(print_r(json_decode($response['body'], true))); 107 99 108 100 109 if ('200' !== $responseCode && 200 !== $responseCode) { … … 104 113 throw new \Exception('Error! This Action Can Not Be Completed. Unauthorised Access<br>' . $errorMessage); 105 114 } elseif ((int)$responseCode >= 500 && (int)$responseCode < 600) { 115 // Alert Bad Connection 116 $adminFunctions = new WPM2AWS_AdminFunctions(); 117 $adminFunctions->wpm2awsAlertBadRemoteConnection($responseCode, $errorMessage, 'createLightsailFromZip'); 118 106 119 throw new \Exception('Error! This Action Can Not Be Completed. Internal Server Error<br>' . $errorMessage); 107 120 } else { -
wp-migrate-2-aws/trunk/admin/classes/apiRemoteIam.class.php
r2626222 r2636772 59 59 ); 60 60 61 $isError = is_wp_error($response); 62 if ($isError === true) { 63 // Alert Error 64 $adminFunctions = new WPM2AWS_AdminFunctions(); 65 $errorMessage = $response->get_error_message(); 66 $adminFunctions->wpm2awsAlertBadRemoteConnection('n/a', $errorMessage, 'getIamUser'); 67 $this->abortWithErrorMessage('An error has occurred.<br>Please contact <a href="https://www.seahorse-data.com/wp-on-aws-support-portal/" target="_blank">Seahorse Support</a>'); 68 } 69 61 70 $responseCode = wp_remote_retrieve_response_code($response); 62 71 … … 67 76 $this->abortWithErrorMessage('Error! This Action Can Not Be Completed. Unauthorised Access<br>' . $errorMessage); 68 77 } elseif ((int)$responseCode >= 500 && (int)$responseCode < 600) { 78 // Alert Bad Connection 79 $adminFunctions = new WPM2AWS_AdminFunctions(); 80 $adminFunctions->wpm2awsAlertBadRemoteConnection($responseCode, $errorMessage, 'getIamUser'); 81 69 82 $this->abortWithErrorMessage('Error! This Action Can Not Be Completed. Internal Server Error.<br>' . $errorMessage); 70 83 } else { -
wp-migrate-2-aws/trunk/admin/classes/apiRemoteS3.class.php
r2626222 r2636772 57 57 ); 58 58 59 $isError = is_wp_error($response); 60 if ($isError === true) { 61 // Alert Error 62 $adminFunctions = new WPM2AWS_AdminFunctions(); 63 $errorMessage = $response->get_error_message(); 64 $adminFunctions->wpm2awsAlertBadRemoteConnection('n/a', $errorMessage, 'checkBucketExists'); 65 throw new \Exception('An error has occurred.<br>Please contact <a href="https://www.seahorse-data.com/wp-on-aws-support-portal/" target="_blank">Seahorse Support</a>'); 66 } 67 59 68 $responseCode = wp_remote_retrieve_response_code($response); 60 69 … … 65 74 throw new \Exception('Error! This Action Can Not Be Completed. Unauthorised Access<br>' . $errorMessage); 66 75 } elseif ((int)$responseCode >= 500 && (int)$responseCode < 600) { 76 // Alert Bad Connection 77 $adminFunctions = new WPM2AWS_AdminFunctions(); 78 $adminFunctions->wpm2awsAlertBadRemoteConnection($responseCode, $errorMessage, 'checkBucketExists'); 79 67 80 throw new \Exception('Error! This Action Can Not Be Completed. Internal Server Error<br>' . $errorMessage); 68 81 } else { … … 97 110 ); 98 111 112 $isError = is_wp_error($response); 113 if ($isError === true) { 114 // Alert Error 115 $adminFunctions = new WPM2AWS_AdminFunctions(); 116 $errorMessage = $response->get_error_message(); 117 $adminFunctions->wpm2awsAlertBadRemoteConnection('n/a', $errorMessage, 'getBucketList'); 118 $this->abortWithErrorMessage('An error has occurred.<br>Please contact <a href="https://www.seahorse-data.com/wp-on-aws-support-portal/" target="_blank">Seahorse Support</a>'); 119 } 120 99 121 $responseCode = wp_remote_retrieve_response_code($response); 100 122 … … 105 127 $this->abortWithErrorMessage('Error! This Action Can Not Be Completed. Unauthorised Access<br>' . $errorMessage); 106 128 } elseif ((int)$responseCode >= 500 && (int)$responseCode < 600) { 129 // Alert Bad Connection 130 $adminFunctions = new WPM2AWS_AdminFunctions(); 131 $adminFunctions->wpm2awsAlertBadRemoteConnection($responseCode, $errorMessage, 'getBucketList'); 132 107 133 $this->abortWithErrorMessage('Error! This Action Can Not Be Completed. Internal Server Error.<br>' . $errorMessage); 108 134 } else { … … 146 172 ); 147 173 174 $isError = is_wp_error($response); 175 if ($isError === true) { 176 // Alert Error 177 $adminFunctions = new WPM2AWS_AdminFunctions(); 178 $errorMessage = $response->get_error_message(); 179 $adminFunctions->wpm2awsAlertBadRemoteConnection('n/a', $errorMessage, 'createBucket'); 180 $this->abortWithErrorMessage('An error has occurred.<br>Please contact <a href="https://www.seahorse-data.com/wp-on-aws-support-portal/" target="_blank">Seahorse Support</a>'); 181 } 182 148 183 $responseCode = wp_remote_retrieve_response_code($response); 149 184 … … 160 195 $this->abortWithErrorMessage('Error! This Action Can Not Be Completed. Unauthorised Access<br>' . $errorMessage); 161 196 } elseif ((int)$responseCode >= 500 && (int)$responseCode < 600) { 197 // Alert Bad Connection 198 $adminFunctions = new WPM2AWS_AdminFunctions(); 199 $adminFunctions->wpm2awsAlertBadRemoteConnection($responseCode, $errorMessage, 'createBucket'); 200 162 201 $this->abortWithErrorMessage('Error! This Action Can Not Be Completed. Internal Server Error.<br>' . $errorMessage); 163 202 } else { -
wp-migrate-2-aws/trunk/admin/includes/adminFunctions.php
r2626222 r2636772 688 688 wpm2awsAddUpdateOptions('wpm2aws_valid_licence_dyck', $responseData['dyck']); 689 689 }