Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/wp-content/plugins/jetpack/modules/wpcom-tos/ |
Upload File : |
<?php /** * Handles acceptance of WordPress.com Terms of Service for sites connected to WP.com. * * This is auto-loaded as of Jetpack v8.3 for WP.com connected-sites only. * * @package automattic/jetpack */ namespace Automattic\Jetpack\TOS; use Automattic\Jetpack\Connection\Client; /** * Makes a request to the WP.com legal endpoint to mark the Terms of Service as accepted. */ function accept_tos() { check_ajax_referer( 'wp_ajax_action', '_nonce' ); $response = Client::wpcom_json_api_request_as_user( '/legal', '2', array( 'method' => 'POST', ), array( 'action' => 'accept_tos', ) ); if ( is_wp_error( $response ) ) { wp_send_json_error( array( 'message' => __( 'Could not accept the Terms of Service. Please try again later.', 'jetpack' ) ) ); wp_die(); } wp_send_json_success( $response ); wp_die(); } add_action( 'wp_ajax_jetpack_accept_tos', __NAMESPACE__ . '\accept_tos' );