PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.5.3
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.5.3
3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 All 111 releases
← All changes | includes/Plugin.php +3 -42 3.7.13.5.3 View file →
@@ -18,9 +18,8 @@
18 18 use Templately\API\ThemeBuilderApi;
19 19 use Templately\Builder\ThemeBuilder;
20 20 use Templately\Core\Importer\FullSiteImport;
21 21 use Templately\Utils\Base;
22 -use Templately\Utils\Database;
23 22 use Templately\Utils\Enqueue;
24 23
25 24 use Templately\Core\Admin;
26 25 use Templately\Core\Module;
@@ -27,9 +26,8 @@
27 26
28 27 use Templately\API\Tags;
29 28 use Templately\API\Items;
30 29 use Templately\API\Login;
31 -use Templately\API\Checkout;
32 30 use Templately\API\SignUp;
33 31 use Templately\API\Profile;
34 32 use Templately\API\Import;
35 33 use Templately\API\MyClouds;
@@ -38,9 +36,8 @@
38 36 use Templately\API\Dependencies;
39 37 use Templately\API\TemplateTypes;
40 38 use Templately\API\SavedTemplates;
41 39 use Templately\API\Sites;
42 -use Templately\API\Tour;
43 40 use Templately\Core\Maintenance;
44 41 use Templately\Core\Migrator;
45 42 use Templately\Core\Platform\Gutenberg;
46 43 use Templately\Core\Platform\Elementor;
@@ -45,9 +42,9 @@
45 42 use Templately\Core\Platform\Gutenberg;
46 43 use Templately\Core\Platform\Elementor;
47 44
48 45 final class Plugin extends Base {
49 - public $version = '3.7.1';
46 + public $version = '3.5.3';
50 47
51 48 public $admin;
52 49 public $settings;
53 50 /**
@@ -192,9 +189,8 @@
192 189 Items::get_instance();
193 190 SavedTemplates::get_instance();
194 191
195 192 Login::get_instance();
196 - Checkout::get_instance();
197 193 SignUp::get_instance();
198 194 Import::get_instance();
199 195 Profile::get_instance();
200 196 MyClouds::get_instance();
@@ -199,9 +195,8 @@
199 195 Profile::get_instance();
200 196 MyClouds::get_instance();
201 197 WorkSpaces::get_instance();
202 198 Sites::get_instance();
203 - Tour::get_instance();
204 199
205 200 APISettings::get_instance();
206 201 // Note: DeveloperSettings::get_instance() is called in Developer::init_modules() when developer functionality is available and enabled
207 202 }
@@ -271,42 +266,11 @@
271 266 if ( empty( $_GET['templately_google_login'] ) ) {
272 267 return;
273 268 }
274 269
275 - if ( wp_doing_ajax() || wp_doing_cron() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) {
276 - return;
277 - }
270 + $redirect_url = remove_query_arg( [ 'templately_google_login', 'api_key', 'error', 'state', 'redirect-to' ] );
278 271
279 - // Checked before the token is consumed: the callback can land while the
280 - // auth cookie is missing (expired session, cookie not yet set), and WP
281 - // will bounce the user through wp-login and back to this same URL.
282 - // Burning the token here would fail that legitimate retry.
283 - if ( ! is_user_logged_in() ) {
284 - return;
285 - }
286 -
287 - $state = '';
288 - if ( ! empty( $_GET['templately_state'] ) ) {
289 - $state = sanitize_text_field( wp_unslash( $_GET['templately_state'] ) );
290 - } elseif ( ! empty( $_GET['state'] ) ) {
291 - $state = sanitize_text_field( wp_unslash( $_GET['state'] ) );
292 - }
293 -
294 - $state_user_id = false;
295 - if ( ! empty( $state ) ) {
296 - $state_user_id = Database::get_transient( 'google_state_' . $state );
297 - Database::delete_transient( 'google_state_' . $state );
298 - }
299 -
300 - $is_authorized = false !== $state_user_id
301 - && intval( $state_user_id ) === get_current_user_id()
302 - && current_user_can( 'delete_posts' );
303 -
304 - $redirect_url = remove_query_arg( [ 'templately_google_login', 'templately_state', 'api_key', 'error', 'state', 'redirect-to' ] );
305 -
306 - if ( ! $is_authorized ) {
307 - $error_message = __( 'This sign-in link is no longer valid. Please try signing in again.', 'templately' );
308 - } elseif ( ! empty( $_GET['error'] ) ) {
272 + if ( ! empty( $_GET['error'] ) ) {
309 273 $error_message = sanitize_text_field( $_GET['error'] );
310 274 } elseif ( ! empty( $_GET['api_key'] ) ) {
311 275 $request = new \WP_REST_Request( 'POST', '/templately/v1/login' );
312 276 $request->set_param( 'viaAPI', true );
@@ -316,11 +280,8 @@
316 280 * @var Login $login
317 281 */
318 282 $login = Login::get_instance();
319 283 $login->permission_check( $request );
320 -
321 - // login() pins the write target to the acting user itself — no pin
322 - // here, or its finally would release ours mid-request.
323 284 $response = $login->login();
324 285
325 286 if ( ! is_wp_error( $response ) && ! empty( $response['user'] ) ) {
326 287 $redirect_path = ! empty( $_GET['redirect-to'] ) ? sanitize_text_field( wp_unslash( $_GET['redirect-to'] ) ) : '';