PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.4.6
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.4.6
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 +1 -72 3.6.43.4.6 View file →
@@ -12,9 +12,8 @@
12 12
13 13 use Templately\Admin\API\Settings as APISettings;
14 14 use Templately\Admin\Settings;
15 15 use Templately\API\AIContent;
16 -use Templately\API\LogoGeneration;
17 16 use Templately\API\Conditions;
18 17 use Templately\API\ThemeBuilderApi;
19 18 use Templately\Builder\ThemeBuilder;
20 19 use Templately\Core\Importer\FullSiteImport;
@@ -35,10 +34,8 @@
35 34 use Templately\API\Categories;
36 35 use Templately\API\Dependencies;
37 36 use Templately\API\TemplateTypes;
38 37 use Templately\API\SavedTemplates;
39 -use Templately\API\Sites;
40 -use Templately\API\Tour;
41 38 use Templately\Core\Maintenance;
42 39 use Templately\Core\Migrator;
43 40 use Templately\Core\Platform\Gutenberg;
44 41 use Templately\Core\Platform\Elementor;
@@ -43,9 +40,9 @@
43 40 use Templately\Core\Platform\Gutenberg;
44 41 use Templately\Core\Platform\Elementor;
45 42
46 43 final class Plugin extends Base {
47 - public $version = '3.6.4';
44 + public $version = '3.4.6';
48 45
49 46 public $admin;
50 47 public $settings;
51 48 /**
@@ -85,11 +82,8 @@
85 82 $this->init_developer_functionality();
86 83
87 84 add_action( 'plugins_loaded', [ $this, 'plugins_loaded' ] );
88 85 add_action( 'rest_api_init', [ $this, 'register_routes' ] );
89 -
90 - add_action( 'init', [ $this, 'google_login_handler' ] );
91 -
92 86 /**
93 87 * Initialize.
94 88 */
95 89 do_action( 'templately_init' );
@@ -185,9 +179,8 @@
185 179 Tags::get_instance();
186 180 ThemeBuilderApi::get_instance();
187 181
188 182 AIContent::get_instance();
189 - LogoGeneration::get_instance();
190 183 Items::get_instance();
191 184 SavedTemplates::get_instance();
192 185
193 186 Login::get_instance();
@@ -195,10 +188,8 @@
195 188 Import::get_instance();
196 189 Profile::get_instance();
197 190 MyClouds::get_instance();
198 191 WorkSpaces::get_instance();
199 - Sites::get_instance();
200 - Tour::get_instance();
201 192
202 193 APISettings::get_instance();
203 194 // Note: DeveloperSettings::get_instance() is called in Developer::init_modules() when developer functionality is available and enabled
204 195 }
@@ -260,68 +251,6 @@
260 251 *
261 252 */
262 253 public function load_textdomain() {
263 254 load_plugin_textdomain( 'templately', false, dirname( TEMPLATELY_PLUGIN_BASENAME ) . '/languages' );
264 - }
265 -
266 - public function google_login_handler() {
267 - // Stop if not a templately google login request
268 - if ( empty( $_GET['templately_google_login'] ) ) {
269 - return;
270 - }
271 -
272 - $redirect_url = remove_query_arg( [ 'templately_google_login', 'api_key', 'error', 'state', 'redirect-to' ] );
273 -
274 - if ( ! empty( $_GET['error'] ) ) {
275 - $error_message = sanitize_text_field( $_GET['error'] );
276 - } elseif ( ! empty( $_GET['api_key'] ) ) {
277 - $request = new \WP_REST_Request( 'POST', '/templately/v1/login' );
278 - $request->set_param( 'viaAPI', true );
279 - $request->set_param( 'api_key', sanitize_text_field( $_GET['api_key'] ) );
280 -
281 - /**
282 - * @var Login $login
283 - */
284 - $login = Login::get_instance();
285 - $login->permission_check( $request );
286 - $response = $login->login();
287 -
288 - if ( ! is_wp_error( $response ) && ! empty( $response['user'] ) ) {
289 - $redirect_path = ! empty( $_GET['redirect-to'] ) ? sanitize_text_field( wp_unslash( $_GET['redirect-to'] ) ) : '';
290 - if ( ! empty( $redirect_path ) ) {
291 - if ( filter_var( $redirect_path, FILTER_VALIDATE_URL ) ) {
292 - $redirect_url = $redirect_path;
293 - } else {
294 - $is_templately = strpos( $redirect_url, 'page=templately' ) !== false;
295 - $is_elementor = strpos( $redirect_url, 'action=elementor' ) !== false;
296 - // Gutenberg editor usually has action=edit or is a block editor page
297 - $is_gutenberg = ( strpos( $redirect_url, 'action=edit' ) !== false || strpos( $redirect_url, 'post_type=' ) !== false ) && ! $is_elementor;
298 -
299 - if ( $is_templately || $is_elementor || $is_gutenberg ) {
300 - $redirect_url = add_query_arg( 'path', ltrim( $redirect_path, '/' ), $redirect_url );
301 -
302 - // Always open the modal in editors after google login
303 - if ( $is_elementor || $is_gutenberg ) {
304 - $redirect_url = add_query_arg( 'templately_open_modal', '1', $redirect_url );
305 - }
306 - }
307 - }
308 - }
309 -
310 - wp_safe_redirect( $redirect_url );
311 - exit;
312 - } else {
313 - $error_message = ( is_wp_error( $response ) ) ? $response->get_error_message() : __( 'Login failed.', 'templately' );
314 - }
315 - } else {
316 - $error_message = __( 'Missing API Key.', 'templately' );
317 - }
318 -
319 - $redirect_url = add_query_arg( [
320 - 'templately_error' => 'login_failed',
321 - 'error_message' => urlencode( $error_message ),
322 - ], $redirect_url );
323 -
324 - wp_safe_redirect( $redirect_url );
325 - exit;
326 255 }
327 256 }