Skip to content

Commit

Permalink
Revert "API: Switch site frame nonce to user+site value (#12095)"
Browse files Browse the repository at this point in the history
This reverts commit 794074f.
  • Loading branch information
kwight authored May 3, 2019
1 parent a2cb104 commit 02d747a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 59 deletions.
1 change: 0 additions & 1 deletion json-endpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@
// **********

require_once( $json_endpoints_dir . 'class.wpcom-json-api-site-settings-v1-3-endpoint.php' );
require_once( $json_endpoints_dir . 'class.wpcom-json-api-get-site-v1-3-endpoint.php' );

// **********
// v1.4
Expand Down
9 changes: 2 additions & 7 deletions json-endpoints/class.wpcom-json-api-get-site-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ class WPCOM_JSON_API_GET_Site_Endpoint extends WPCOM_JSON_API_Endpoint {
'wordads',
'publicize_permanently_disabled',
'frame_nonce',
'frame_nonce_site_only',
'page_on_front',
'page_for_posts',
'headstart',
Expand Down Expand Up @@ -150,12 +149,11 @@ class WPCOM_JSON_API_GET_Site_Endpoint extends WPCOM_JSON_API_Endpoint {
'is_wpcom_store',
'woocommerce_is_active',
'frame_nonce',
'frame_nonce_site_only',
'design_type',
'wordads',
);

protected $site;
private $site;

// protected $compact = null;
protected $fields_to_include = '_all';
Expand Down Expand Up @@ -497,10 +495,7 @@ protected function render_option_keys( &$options_response_keys ) {
$options[ $key ] = $site->is_publicize_permanently_disabled();
break;
case 'frame_nonce' :
$options[ $key ] = $site->get_frame_nonce_site_only();
break;
case 'frame_nonce_site_only' :
$options[ $key ] = $site->get_frame_nonce_site_only();
$options[ $key ] = $site->get_frame_nonce();
break;
case 'page_on_front' :
if ( $custom_front_page ) {
Expand Down
35 changes: 0 additions & 35 deletions json-endpoints/class.wpcom-json-api-get-site-v1-3-endpoint.php

This file was deleted.

16 changes: 0 additions & 16 deletions sal/class.json-api-site-jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,26 +104,10 @@ function has_wordads() {
return Jetpack::is_module_active( 'wordads' );
}

/**
* Creates a nonce to allow an iframed block editor to make authenticated requests to a Jetpack site.
*
* Disabled here in Jetpack because the nonce is only needed when making calls from dotcom domains,
* not when making calls on the same origin as we would be doing from `wp-admin/post.php` and friends.
*/
function get_frame_nonce() {
return false;
}

/**
* Creates a post preview nonce to use if the current user is logged out.
*
* Disabled here in Jetpack because the nonce is only needed when making calls from dotcom domains,
* in the case where users create a post in Calypso but are logged out from their Jetpack site.
*/
function get_frame_nonce_site_only() {
return false;
}

function is_headstart_fresh() {
return false;
}
Expand Down

0 comments on commit 02d747a

Please sign in to comment.