PluginProbe ʕ •ᴥ•ʔ
Hostinger Reach – AI-Powered Email Marketing for WordPress / 1.5.9
Hostinger Reach – AI-Powered Email Marketing for WordPress v1.5.9
1.6.0 1.5.9 1.5.8 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 trunk 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6
hostinger-reach / src / Api / ResourceIdManager.php
hostinger-reach / src / Api Last commit date
Handlers 2 weeks ago Routes 2 weeks ago Webhooks 8 months ago ApiKeyManager.php 3 months ago ResourceIdManager.php 5 months ago
ResourceIdManager.php
36 lines
1 <?php
2
3 namespace Hostinger\Reach\Api;
4
5 use Hostinger\Reach\Setup\Encrypt;
6
7 if ( ! defined( 'ABSPATH' ) ) {
8 exit;
9 }
10
11 class ResourceIdManager {
12 public const TRANSIENT_NAME = 'hostinger_reach_resource_id';
13 public const TRANSIENT_EXPIRATION_TIME = HOUR_IN_SECONDS;
14 public const NON_EXISTENT_RESOURCE_ID = 'non_existent_resource_id';
15
16 public function store_resource_id( string $resource_id ): bool {
17 return set_transient( self::TRANSIENT_NAME, $this->encrypt_resource_id( $resource_id ), self::TRANSIENT_EXPIRATION_TIME );
18 }
19
20 public function clear_resource_id(): string {
21 return delete_transient( self::TRANSIENT_NAME );
22 }
23
24 public function get_resource_id(): string {
25 return $this->decrypt_resource_id( get_transient( self::TRANSIENT_NAME, '' ) );
26 }
27
28 public function encrypt_resource_id( string $resource_id ): string {
29 return Encrypt::encrypt( $resource_id );
30 }
31
32 public function decrypt_resource_id( string $resource_id ): string {
33 return Encrypt::decrypt( $resource_id );
34 }
35 }
36