one-click-accessibility/modules/connect/module.php
VasylD 9c9536cbeb
[APP-2130] add elementor one (#433)
* [APP-0000] add elementor one

* [APP-0000] add elementor one

* [APP-2207] add dashboard widget

* [APP-2207] add dashboard widget

* [APP-2207] add dashboard widget

* [APP-2207] add dashboard widget

* [APP-0000] Add slug to the connect config

* [APP-0000] Update connect config

* [APP-0000] Update connect config

* [APP-0000] Update connect config

* [APP-0000] Update connect config

* [APP-0000] Update connect config

* Hide sidebar footer if Elementor One is connected

* fix: import errors on opening the scanner

* [APP-0000] Update connect config

* Update modules/settings/module.php

Co-authored-by: Rami Yushuvaev <92088692+rami-elementor@users.noreply.github.com>

* [APP-2270] Top bar implementation (#458)

* [APP-2270] Top bar implementation

* Update top bar title

* Update packages

* fix: env for top bar

* update: ally menu location

* Fix pointer

* Update

* Update

* Update

* Update

* Update

* Fix design saving

* Add missing pro icon to sidebar menu

* Sidebar icons sizes

* Fix link to "Manage subscription"

* fix: header name

* Update logo icon in the sidebar

* Remove logos from modal/dialog headers

* Update button colors

* Make the "Get started" modal dismissible

* Update crown icon

* Update

* Role attribute

* Update logo icon

* Update list item padding

* [APP-0000] Update connect config

* [ACD-7909] Enable Pro features on One

* Update menu order

* [ACD-7909] Enable Pro features on One

* [ACD-7909] Enable Pro features on One

* Hide pointers from Elementor One users

* [ACD-7909] Enable Pro features on One

* fix: don't show notices in some cases (#466)

* [ACD-7794] Fix subitem color and spacing, info and pro icon size (#464)

* fix: subitem color and spacing, info and pro icon size

* chore: update elementor-one-assets package to 0.4.16

* fix: PLG margin and button style issue (#463)

---------

Co-authored-by: Nirbhay Singh <nirbhayr@elementor.com>
Co-authored-by: vasyldinets <vasyld@elementor.red>
Co-authored-by: Nirbhay Singh <121793120+nirbhayel@users.noreply.github.com>

---------

Co-authored-by: Rami Yushuvaev <ramiy@elementor.com>
Co-authored-by: Nirbhay Singh <nirbhayr@elementor.com>
Co-authored-by: Rami Yushuvaev <92088692+rami-elementor@users.noreply.github.com>
Co-authored-by: Nirbhay Singh <121793120+nirbhayel@users.noreply.github.com>
2026-01-12 12:26:38 +01:00

79 lines
1.8 KiB
PHP

<?php
namespace EA11y\Modules\Connect;
use EA11y\Classes\Module_Base;
use EA11y\Modules\Connect\Classes\Config;
use ElementorOne\Connect\Facade;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* Class Module
*/
class Module extends Module_Base {
/**
* Get module name.
* Retrieve the module name.
* @access public
* @return string Module name.
*/
public function get_name() {
return 'connect';
}
public static function is_connected(): bool {
$facade = self::get_connect();
$access_token = $facade->data()->get_access_token();
return ! ! $access_token && $facade->utils()->is_valid_home_url();
}
public static function get_connect(): Facade {
return Facade::get( Config::PLUGIN_SLUG );
}
public function authorize_url( $authorize_url ) {
$utm_params = [];
$a11y_campaign = get_transient( 'elementor_ea11y_campaign' );
if ( false === $a11y_campaign ) {
return $authorize_url;
}
foreach ( [ 'source', 'medium', 'campaign' ] as $key ) {
if ( ! empty( $a11y_campaign[ $key ] ) ) {
$utm_params[ 'utm_' . $key ] = $a11y_campaign[ $key ];
}
}
if ( ! empty( $utm_params ) ) {
$authorize_url = add_query_arg( $utm_params, $authorize_url );
}
return $authorize_url;
}
public function __construct() {
add_filter( 'elementor_one/ea11y_connect_authorize_url', [ $this, 'authorize_url' ] );
Facade::make([
'app_name' => Config::APP_NAME,
'app_prefix' => Config::APP_PREFIX,
'app_rest_namespace' => Config::APP_REST_NAMESPACE,
'base_url' => Config::BASE_URL,
'admin_page' => Config::ADMIN_PAGE,
'app_type' => Config::APP_TYPE,
'scopes' => Config::SCOPES,
'state_nonce' => Config::STATE_NONCE,
'connect_mode' => Config::CONNECT_MODE,
'plugin_slug' => Config::PLUGIN_SLUG,
]);
}
}