Changeset 2719005
- Timestamp:
- 05/06/2022 05:26:24 AM (4 years ago)
- Location:
- dynomapper-content-import
- Files:
-
- 1 added
- 4 edited
- 9 copied
-
assets/icon-256x256.png (added)
-
tags/1.0.3 (copied) (copied from dynomapper-content-import/trunk)
-
tags/1.0.3/README.md (copied) (copied from dynomapper-content-import/trunk/README.md) (1 diff)
-
tags/1.0.3/dynomapper.php (copied) (copied from dynomapper-content-import/trunk/dynomapper.php)
-
tags/1.0.3/includes (copied) (copied from dynomapper-content-import/trunk/includes)
-
tags/1.0.3/includes/dynomapper-content-import.php (modified) (7 diffs)
-
tags/1.0.3/index.php (copied) (copied from dynomapper-content-import/trunk/index.php)
-
tags/1.0.3/readme.txt (copied) (copied from dynomapper-content-import/trunk/readme.txt) (2 diffs)
-
tags/1.0.3/uninstall.php (copied) (copied from dynomapper-content-import/trunk/uninstall.php)
-
tags/1.0.3/views (copied) (copied from dynomapper-content-import/trunk/views)
-
tags/1.0.3/views/import.php (copied) (copied from dynomapper-content-import/trunk/views/import.php)
-
trunk/README.md (modified) (1 diff)
-
trunk/includes/dynomapper-content-import.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dynomapper-content-import/tags/1.0.3/README.md
r2716227 r2719005 24 24 ## Changelog 25 25 26 ### 1.0.3 ### 27 * Wordpress 6.0 support 28 26 29 ### 1.0.2 ### 27 30 * Fixed typo -
dynomapper-content-import/tags/1.0.3/includes/dynomapper-content-import.php
r2716223 r2719005 21 21 private $viewsDir; 22 22 private $devMode; 23 private $templateVars = []; 23 24 24 25 public function __construct($pluginId, $pluginName, $viewsDir, $devMode) … … 53 54 public function registerImporter() 54 55 { 56 $this->handleRequest(); 57 55 58 register_importer( 56 59 $this->pluginId, … … 63 66 } 64 67 65 public function initImporter() 66 { 68 private function handleRequest() 69 { 70 if (empty($_GET['import']) || $_GET['import'] != $this->pluginId) { 71 return; 72 } 73 67 74 $this->importJwt(); 75 76 $this->templateVars = []; 68 77 69 78 if (!empty($_GET['runImport']) && !empty($_GET['token'])) { 70 79 //validate import 71 80 $this->validateImport($_GET['token']); 81 return; 82 } 83 84 if ($_SERVER['REQUEST_METHOD'] == 'POST') { 85 check_admin_referer('content-import-credentials'); 86 87 $clientId = isset($_POST['clientId']) ? sanitize_text_field($_POST['clientId']) : ''; 88 $clientSecret = isset($_POST['clientSecret']) ? sanitize_text_field($_POST['clientSecret']) : ''; 89 $authBaseUrl = isset($_POST['authBaseUrl']) ? sanitize_text_field($_POST['authBaseUrl']) : ''; 90 91 update_option($this->pluginId . '.clientId', $clientId); 92 update_option($this->pluginId . '.clientSecret', $clientSecret); 93 update_option($this->pluginId . '.authBaseUrl', $authBaseUrl); 94 95 $this->templateVars['saved'] = true; 96 97 if (!empty($_POST['start'])) { 98 $result = $this->redirectToAuthUrl($clientId, $clientSecret, $this->getAuthBaseUrl()); 99 100 if (is_wp_error($result)) { 101 $this->templateVars['saveError'] = $result; 102 } 103 } 104 } 105 } 106 107 public function initImporter() 108 { 109 $this->importJwt(); 110 111 if (!empty($_GET['runImport']) && !empty($_GET['token'])) { 112 //validate import 113 extract($this->templateVars); 114 include $this->viewsDir . '/validate-import.php'; 72 115 return; 73 116 } … … 81 124 } 82 125 83 if ($_SERVER['REQUEST_METHOD'] == 'POST') {84 check_admin_referer('content-import-credentials');85 86 $clientId = isset($_POST['clientId']) ? sanitize_text_field($_POST['clientId']) : '';87 $clientSecret = isset($_POST['clientSecret']) ? sanitize_text_field($_POST['clientSecret']) : '';88 $authBaseUrl = isset($_POST['authBaseUrl']) ? sanitize_text_field($_POST['authBaseUrl']) : '';89 90 update_option($this->pluginId . '.clientId', $clientId);91 update_option($this->pluginId . '.clientSecret', $clientSecret);92 update_option($this->pluginId . '.authBaseUrl', $authBaseUrl);93 94 $saved = true;95 96 if (!empty($_POST['start'])) {97 $result = $this->redirectToAuthUrl($clientId, $clientSecret, $this->getAuthBaseUrl());98 99 if (is_wp_error($result)) {100 $saveError = $result;101 } else {102 exit;103 }104 }105 }106 107 126 $clientIdValue = get_option($this->pluginId . '.clientId'); 108 127 $clientSecretValue = get_option($this->pluginId . '.clientSecret'); … … 115 134 } 116 135 136 extract($this->templateVars); 117 137 include $this->viewsDir . '/import.php'; 118 138 } … … 168 188 $clientIdValue = get_option($this->pluginId . '.clientId'); 169 189 $clientSecretValue = get_option($this->pluginId . '.clientSecret'); 170 $authBaseUrlValue = $this->getAuthBaseUrl();171 190 172 191 \Dynomapper\Firebase\JWT\JWT::$leeway = 30; … … 194 213 set_transient($this->pluginId . '.accessToken', $decoded->accessToken, 60); 195 214 wp_redirect('admin.php?import=' . $this->pluginId); 196 exit;197 } 198 199 include $this->viewsDir . '/validate-import.php';215 return; 216 } 217 218 $this->templateVars['error'] = $error; 200 219 } 201 220 -
dynomapper-content-import/tags/1.0.3/readme.txt
r2716231 r2719005 4 4 Tags dynomapper, structured content, import, mapping, sitemap, sitemapping 5 5 Requires at least: 5.0.0 6 Tested up to: 5.9.37 Stable tag: 1.0. 26 Tested up to: 6.0.0 7 Stable tag: 1.0.3 8 8 License: GPL-2.0+ 9 9 Requires PHP: 7.0 … … 36 36 == Changelog == 37 37 38 = 1.0.3 = 39 * Wordpress 6.0 support 40 38 41 = 1.0.2 = 39 42 * Fixed typo -
dynomapper-content-import/trunk/README.md
r2716227 r2719005 24 24 ## Changelog 25 25 26 ### 1.0.3 ### 27 * Wordpress 6.0 support 28 26 29 ### 1.0.2 ### 27 30 * Fixed typo -
dynomapper-content-import/trunk/includes/dynomapper-content-import.php
r2716223 r2719005 21 21 private $viewsDir; 22 22 private $devMode; 23 private $templateVars = []; 23 24 24 25 public function __construct($pluginId, $pluginName, $viewsDir, $devMode) … … 53 54 public function registerImporter() 54 55 { 56 $this->handleRequest(); 57 55 58 register_importer( 56 59 $this->pluginId, … … 63 66 } 64 67 65 public function initImporter() 66 { 68 private function handleRequest() 69 { 70 if (empty($_GET['import']) || $_GET['import'] != $this->pluginId) { 71 return; 72 } 73 67 74 $this->importJwt(); 75 76 $this->templateVars = []; 68 77 69 78 if (!empty($_GET['runImport']) && !empty($_GET['token'])) { 70 79 //validate import 71 80 $this->validateImport($_GET['token']); 81 return; 82 } 83 84 if ($_SERVER['REQUEST_METHOD'] == 'POST') { 85 check_admin_referer('content-import-credentials'); 86 87 $clientId = isset($_POST['clientId']) ? sanitize_text_field($_POST['clientId']) : ''; 88 $clientSecret = isset($_POST['clientSecret']) ? sanitize_text_field($_POST['clientSecret']) : ''; 89 $authBaseUrl = isset($_POST['authBaseUrl']) ? sanitize_text_field($_POST['authBaseUrl']) : ''; 90 91 update_option($this->pluginId . '.clientId', $clientId); 92 update_option($this->pluginId . '.clientSecret', $clientSecret); 93 update_option($this->pluginId . '.authBaseUrl', $authBaseUrl); 94 95 $this->templateVars['saved'] = true; 96 97 if (!empty($_POST['start'])) { 98 $result = $this->redirectToAuthUrl($clientId, $clientSecret, $this->getAuthBaseUrl()); 99 100 if (is_wp_error($result)) { 101 $this->templateVars['saveError'] = $result; 102 } 103 } 104 } 105 } 106 107 public function initImporter() 108 { 109 $this->importJwt(); 110 111 if (!empty($_GET['runImport']) && !empty($_GET['token'])) { 112 //validate import 113 extract($this->templateVars); 114 include $this->viewsDir . '/validate-import.php'; 72 115 return; 73 116 } … … 81 124 } 82 125 83 if ($_SERVER['REQUEST_METHOD'] == 'POST') {84 check_admin_referer('content-import-credentials');85 86 $clientId = isset($_POST['clientId']) ? sanitize_text_field($_POST['clientId']) : '';87 $clientSecret = isset($_POST['clientSecret']) ? sanitize_text_field($_POST['clientSecret']) : '';88 $authBaseUrl = isset($_POST['authBaseUrl']) ? sanitize_text_field($_POST['authBaseUrl']) : '';89 90 update_option($this->pluginId . '.clientId', $clientId);91 update_option($this->pluginId . '.clientSecret', $clientSecret);92 update_option($this->pluginId . '.authBaseUrl', $authBaseUrl);93 94 $saved = true;95 96 if (!empty($_POST['start'])) {97 $result = $this->redirectToAuthUrl($clientId, $clientSecret, $this->getAuthBaseUrl());98 99 if (is_wp_error($result)) {100 $saveError = $result;101 } else {102 exit;103 }104 }105 }106 107 126 $clientIdValue = get_option($this->pluginId . '.clientId'); 108 127 $clientSecretValue = get_option($this->pluginId . '.clientSecret'); … … 115 134 } 116 135 136 extract($this->templateVars); 117 137 include $this->viewsDir . '/import.php'; 118 138 } … … 168 188 $clientIdValue = get_option($this->pluginId . '.clientId'); 169 189 $clientSecretValue = get_option($this->pluginId . '.clientSecret'); 170 $authBaseUrlValue = $this->getAuthBaseUrl();171 190 172 191 \Dynomapper\Firebase\JWT\JWT::$leeway = 30; … … 194 213 set_transient($this->pluginId . '.accessToken', $decoded->accessToken, 60); 195 214 wp_redirect('admin.php?import=' . $this->pluginId); 196 exit;197 } 198 199 include $this->viewsDir . '/validate-import.php';215 return; 216 } 217 218 $this->templateVars['error'] = $error; 200 219 } 201 220 -
dynomapper-content-import/trunk/readme.txt
r2716231 r2719005 4 4 Tags dynomapper, structured content, import, mapping, sitemap, sitemapping 5 5 Requires at least: 5.0.0 6 Tested up to: 5.9.37 Stable tag: 1.0. 26 Tested up to: 6.0.0 7 Stable tag: 1.0.3 8 8 License: GPL-2.0+ 9 9 Requires PHP: 7.0 … … 36 36 == Changelog == 37 37 38 = 1.0.3 = 39 * Wordpress 6.0 support 40 38 41 = 1.0.2 = 39 42 * Fixed typo
Note: See TracChangeset
for help on using the changeset viewer.