Submit
Path:
~
/
home
/
getwphos
/
www
/
almajd14
/
wp-content
/
plugins
/
woocommerce
/
vendor
/
automattic
/
jetpack-connection
/
src
/
File Content:
class-terms-of-service.php
<?php /** * A Terms of Service class for Jetpack. * * @package automattic/jetpack-connection */ namespace Automattic\Jetpack; /** * Class Terms_Of_Service * * Helper class that is responsible for the state of agreement of the terms of service. */ class Terms_Of_Service { /** * Jetpack option name where the terms of service state is stored. * * @var string */ const OPTION_NAME = 'tos_agreed'; /** * Allow the site to agree to the terms of service. */ public function agree() { $this->set_agree(); /** * Acton fired when the master user has agreed to the terms of service. * * @since 1.0.4 * @since-jetpack 7.9.0 */ do_action( 'jetpack_agreed_to_terms_of_service' ); } /** * Allow the site to reject to the terms of service. */ public function reject() { $this->set_reject(); /** * Acton fired when the master user has revoked their agreement to the terms of service. * * @since 1.0.4 * @since-jetpack 7.9.1 */ do_action( 'jetpack_reject_terms_of_service' ); } /** * Returns whether the master user has agreed to the terms of service. * * The following conditions have to be met in order to agree to the terms of service. * 1. The master user has gone though the connect flow. * 2. The site is not in dev mode. * 3. The master user of the site is still connected (deprecated @since 1.4.0). * * @return bool */ public function has_agreed() { if ( $this->is_offline_mode() ) { return false; } /** * Before 1.4.0 we used to also check if the master user of the site is connected * by calling the Connection related `is_active` method. * As of 1.4.0 we have removed this check in order to resolve the * circular dependencies it was introducing to composer packages. * * @since 1.4.0 */ return $this->get_raw_has_agreed(); } /** * Abstracted for testing purposes. * Tells us if the site is in dev mode. * * @return bool */ protected function is_offline_mode() { return ( new Status() )->is_offline_mode(); } /** * Gets just the Jetpack Option that contains the terms of service state. * Abstracted for testing purposes. * * @return bool */ protected function get_raw_has_agreed() { return \Jetpack_Options::get_option( self::OPTION_NAME, false ); } /** * Sets the correct Jetpack Option to mark the that the site has agreed to the terms of service. * Abstracted for testing purposes. */ protected function set_agree() { \Jetpack_Options::update_option( self::OPTION_NAME, true ); } /** * Sets the correct Jetpack Option to mark that the site has rejected the terms of service. * Abstracted for testing purposes. */ protected function set_reject() { \Jetpack_Options::update_option( self::OPTION_NAME, false ); } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
identity-crisis
---
0755
sso
---
0755
traits
---
0755
webhooks
---
0755
class-authorize-json-api.php
8900 bytes
0644
class-client.php
16207 bytes
0644
class-connection-assets.php
900 bytes
0644
class-connection-notice.php
8089 bytes
0644
class-error-handler.php
33669 bytes
0644
class-external-storage.php
8256 bytes
0644
class-heartbeat.php
8006 bytes
0644
class-initial-state.php
1935 bytes
0644
class-manager.php
89192 bytes
0644
class-nonce-handler.php
5812 bytes
0644
class-package-version-tracker.php
5686 bytes
0644
class-package-version.php
648 bytes
0644
class-partner-coupon.php
11202 bytes
0644
class-partner.php
5072 bytes
0644
class-plugin-storage.php
7741 bytes
0644
class-plugin.php
2459 bytes
0644
class-rest-authentication.php
6302 bytes
0644
class-rest-connector.php
34784 bytes
0644
class-secrets.php
8608 bytes
0644
class-server-sandbox.php
7863 bytes
0644
class-terms-of-service.php
2798 bytes
0644
class-tokens-locks.php
1745 bytes
0644
class-tokens.php
21301 bytes
0644
class-tracking.php
10100 bytes
0644
class-urls.php
5091 bytes
0644
class-user-account-status.php
3632 bytes
0644
class-users-connection-admin.php
4549 bytes
0644
class-utils.php
3922 bytes
0644
class-webhooks.php
7066 bytes
0644
class-xmlrpc-async-call.php
2685 bytes
0644
class-xmlrpc-connector.php
1918 bytes
0644
interface-manager.php
298 bytes
0644
interface-storage-provider.php
2118 bytes
0644
N4ST4R_ID | Naxtarrr