PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.2
Jetpack – WP Security, Backup, Speed, & Growth v16.2
16.3 16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 All 508 releases
jetpack / extensions / blocks / premium-content / _inc / subscription-service / class-unconfigured-subscription-service.php

class-unconfigured-subscription-service.php in Jetpack – WP Security, Backup, Speed, & Growth 16.2, at extensions/blocks/premium-content/_inc/subscription-service/class-unconfigured-subscription-service.php

75 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The environment does not have a subscription service available.
4 * This represents this scenario.
5 *
6 * @package Automattic\Jetpack\Extensions\Premium_Content
7 */
8
9 namespace Automattic\Jetpack\Extensions\Premium_Content\Subscription_Service;
10
11 use function site_url;
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit( 0 );
15 }
16
17 // phpcs:disable
18
19 /**
20 * Class Unconfigured_Subscription_Service
21 *
22 * @package Automattic\Jetpack\Extensions\Premium_Content\Subscription_Service
23 */
24 class Unconfigured_Subscription_Service implements Subscription_Service {
25
26 /**
27 * Is always available because it is the fallback.
28 *
29 * @inheritDoc
30 */
31 public static function available() {
32 return true;
33 }
34
35 /**
36 * Function: initialize()
37 *
38 * @inheritDoc
39 */
40 public function initialize() {
41 // noop.
42 }
43
44 /**
45 * No subscription service available, no users can see this content.
46 *
47 * @param array $valid_plan_ids .
48 * @param string $access_level .
49 */
50 public function visitor_can_view_content( $valid_plan_ids, $access_level ) {
51 return false;
52 }
53
54 /**
55 * is the current user a pending subscriber for the current site?
56 *
57 * @return bool
58 */
59 public function is_current_user_pending_subscriber(): bool
60 {
61 return false;
62 }
63
64 /**
65 * The current visitor would like to obtain access. Where do they go?
66 *
67 * @param string $mode .
68 */
69 public function access_url( $mode = 'subscribe' ) {
70 return site_url();
71 }
72
73 }
74 // phpcs:enable
75