s returned. We don't need to store the whole thing. * * The regexp check is done to make sure we can detect the string even if the body returns some additional * output, like some caching plugins do when they try to pad the request. */ $regexp = '!' . preg_quote( self::DEDICATED_SYNC_VALIDATION_STRING, '!' ) . '!uis'; if ( preg_match( $regexp, $dedicated_sync_response_body ) ) { $saved_response_body = self::DEDICATED_SYNC_VALIDATION_STRING; } else { $saved_response_body = time(); } set_transient( $dedicated_sync_check_transient, $saved_response_body, HOUR_IN_SECONDS ); // Send a bit more information to WordPress.com to help debugging issues. if ( $saved_response_body !== self::DEDICATED_SYNC_VALIDATION_STRING ) { $data = array( 'timestamp' => microtime( true ), 'response_code' => $dedicated_sync_response_code, 'response_body' => $dedicated_sync_response_body, // Send the flow type that was attempted. 'sync_flow_type' => 'dedicated', ); $sender = Sender::get_instance(); $sender->send_action( 'jetpack_sync_flow_error_enable', $data ); } } return self::DEDICATED_SYNC_VALIDATION_STRING === $dedicated_sync_response_body; } /** * Disable dedicated sync and set a transient to prevent re-enabling it for some time. * * @return void */ public static function on_dedicated_sync_lag_not_sending_threshold_reached() { set_transient( self::DEDICATED_SYNC_TEMPORARY_DISABLE_FLAG, true, 6 * HOUR_IN_SECONDS ); Settings::update_settings( array( 'dedicated_sync_enabled' => 0, ) ); // Inform that we had to temporarily disable Dedicated Sync $data = array( 'timestamp' => microtime( true ), // Send the flow type that was attempted. 'sync_flow_type' => 'dedicated', ); $sender = Sender::get_instance(); $sender->send_action( 'jetpack_sync_flow_error_temp_disable', $data ); } /** * Disable or enable Dedicated Sync sender based on the header value returned from WordPress.com * * @param string $dedicated_sync_header The Dedicated Sync header value - `on` or `off`. * * @return bool Whether Dedicated Sync is going to be enabled or not. */ public static function maybe_change_dedicated_sync_status_from_wpcom_header( $dedicated_sync_header ) { $dedicated_sync_enabled = 'on' === $dedicated_sync_header ? 1 : 0; // Prevent enabling of Dedicated sync via header flag if we're in an autoheal timeout. if ( $dedicated_sync_enabled ) { $check_transient = get_transient( self::DEDICATED_SYNC_TEMPORARY_DISABLE_FLAG ); if ( $check_transient ) { // Something happened and Dedicated Sync should not be automatically re-enabled. return false; } } Settings::update_settings( array( 'dedicated_sync_enabled' => $dedicated_sync_enabled, ) ); return Settings::is_dedicated_sync_enabled(); } } ووردبريس › خطأ

كان هناك خطأ فادح في هذا الموقع.

معرفة المزيد حول استكشاف الأخطاء في ووردبريس.