Files
heretek-control-core/includes/modules/class-cloud-module.php
T
Mian Shahzad RazaandClaude Opus 4.8 f57e73a063 feat: Cloud module + Connection-tab card + REST client + bootstrap/uninstall wiring
Registers the free Cloud module, boots the connect/callback/disconnect
admin-post handlers, renders the Connect/Disconnect card on the Connection
tab, adds the authenticated Cloud REST client, and cleans up cloud options on
uninstall.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-29 16:24:14 +05:00

55 lines
1.2 KiB
PHP

<?php
/**
* EMCP Cloud module (free, on by default). Boots the OAuth client admin flow.
*
* @package EMCP_Tools
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class EMCP_Tools_Cloud_Module extends EMCP_Tools_Module {
public function id(): string {
return 'cloud';
}
public function title(): string {
return __( 'EMCP Cloud', 'emcp-tools' );
}
public function description(): string {
return __( 'Connect this site to your EMCP Cloud account to back up and sync your work.', 'emcp-tools' );
}
public function tier(): string {
return 'free';
}
public function default_active(): bool {
return true;
}
public function register(): void {
EMCP_Tools_Cloud_Connect::init();
}
public function render_settings(): void {
echo '<p>' . esc_html__( 'Connect or disconnect on the Connection tab.', 'emcp-tools' ) . '</p>';
}
public function settings_url(): string {
return admin_url( 'admin.php?page=emcp-tools-connection#emcp-conn-main' );
}
/**
* Static gate for the Connection-tab card (runs before init:5).
*
* @return bool
*/
public static function is_enabled(): bool {
$active = (array) get_option( EMCP_Tools_Module::OPTION_ACTIVE, array() );
return in_array( 'cloud', $active, true );
}
}