PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3
Jetpack – WP Security, Backup, Speed, & Growth v16.3
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.3, at extensions/blocks/premium-content/_inc/subscription-service/class-unconfigured-subscription-service.php

90 lines 1.9 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 * @param int|null $post_id Unused; accepted for callers that pass a post id.
50 */
51 public function visitor_can_view_content( $valid_plan_ids, $access_level, $post_id = null ) {
52 return false;
53 }
54
55 /**
56 * An unconfigured service cannot establish subscription entitlement.
57 *
58 * @since $$next-version$$
59 *
60 * @param array $valid_plan_ids Required subscription plan IDs.
61 * @param string $access_level Required access level.
62 * @param int|null $post_id Post to check.
63 * @return bool Always false.
64 */
65 public function visitor_has_subscription_access( $valid_plan_ids, $access_level, $post_id = null ) {
66 return false;
67 }
68
69 /**
70 * is the current user a pending subscriber for the current site?
71 *
72 * @return bool
73 */
74 public function is_current_user_pending_subscriber(): bool
75 {
76 return false;
77 }
78
79 /**
80 * The current visitor would like to obtain access. Where do they go?
81 *
82 * @param string $mode .
83 */
84 public function access_url( $mode = 'subscribe' ) {
85 return site_url();
86 }
87
88 }
89 // phpcs:enable
90