'pgcache.configuration_overloaded' ) );
?>
'minify.configuration_overloaded' ) );
?>
'dbcache.configuration_overloaded' ) );
?>
'objectcache.configuration_overloaded' ) );
echo ( ! $this->_config->getf_boolean( 'objectcache.enabled' ) && has_filter( 'w3tc_config_item_objectcache.enabled' ) ? '
' . esc_html__( 'Object Cache is disabled via filter.', 'w3-total-cache' ) . '
' : '' );
?>
'browsercache.configuration_overloaded' ) );
?>
'varnish.configuration_overloaded' ) );
?>
',
''
),
array(
'acronym' => array(
'title' => array(),
),
)
),
'',
'debug'
);
?>
_config->is_extension_active( 'imageservice' )
? Util_UI::admin_url( 'upload.php?page=w3tc_extension_page_imageservice' )
: ''
);
?>
Util_UI::admin_url( 'admin.php?page=w3tc_pagespeed' ) )
);
?>
_config->get_string( 'widget.pagespeed.access_token' ) ) ? $this->_config->get_string( 'widget.pagespeed.access_token' ) : '' );
$w3_pagespeed = new PageSpeed_Api( $access_token_json );
$site_id = Util_Http::generate_site_id();
$return_url = Util_Ui::admin_url( 'admin.php?page=w3tc_general' );
$w3tc_pagespeed_key = ! empty( $this->_config->get_string( 'widget.pagespeed.w3tc_pagespeed_key' ) ) ? $this->_config->get_string( 'widget.pagespeed.w3tc_pagespeed_key' ) : '';
$auth_url = $w3_pagespeed->client->createAuthUrl();
$new_gacode = Util_Request::get( 'w3tc_new_gacode' );
$new_w3tc_pagespeed_key = Util_Request::get( 'w3tc_new_w3tc_pagespeed_key' );
$authorize_error = Util_Request::get( 'w3tc_authorize_error' );
$deauthorize = Util_Request::get( 'w3tc_deauthorize' );
if ( ! empty( $new_gacode ) && ! empty( $new_w3tc_pagespeed_key ) ) {
$response = json_decode( $w3_pagespeed->process_authorization_response( $new_gacode, $new_w3tc_pagespeed_key ), true );
if ( isset( $response['error']['code'] ) && 200 !== $response['error']['code'] ) {
$response_error = sprintf(
// translators: 1 Request response code, 2 Error message.
__(
'Response Code: %1$s
Response Message: %2$s',
'w3-total-cache'
),
! empty( $response['error']['code'] ) ? $response['error']['code'] : 'N/A',
! empty( $response['error']['message'] ) ? $response['error']['message'] : 'N/A'
);
update_option(
'w3tcps_authorize_fail',
__( 'Google PageSpeed Insights API authorization failed.', 'w3-total-cache' )
);
update_option(
'w3tcps_authorize_fail_message',
$response_error
);
} elseif ( ! empty( $response['refresh_token'] ) ) {
update_option(
'w3tcps_authorize_success',
__( 'Google PageSpeed Insights API authorization successful.', 'w3-total-cache' )
);
} else {
update_option(
'w3tcps_authorize_fail',
__( 'Google PageSpeed Insights API authorization failed.', 'w3-total-cache' )
);
update_option(
'w3tcps_authorize_fail_message',
__( 'Missing refresh token.', 'w3-total-cache' )
);
}
wp_safe_redirect( $return_url );
exit;
} elseif ( $deauthorize ) {
$w3_pagespeed->reset();
update_option(
'w3tcps_authorize_success',
__( 'Google PageSpeed Insights API authorization successfully reset.', 'w3-total-cache' )
);
wp_safe_redirect( $return_url );
exit;
} elseif ( ! empty( $authorize_error ) ) {
$authorize_error = json_decode( $authorize_error );
if ( 'authorize-in-missing-site-id' === $authorize_error->error->id ) {
$message = __( 'Unique site ID missing for authorize request!', 'w3-total-cache' );
} elseif ( 'authorize-in-missing-auth-url' === $authorize_error->error->id ) {
$message = __( 'Authorize URL missing for authorize request!', 'w3-total-cache' );
} elseif ( 'authorize-in-missing-return-url' === $authorize_error->error->id ) {
$message = __( 'Return URL missing for authorize request!', 'w3-total-cache' );
} elseif ( 'authorize-in-failed' === $authorize_error->error->id ) {
$message = __( 'Failed to process authorize request!', 'w3-total-cache' );
}
if ( 'authorize-out-code-missing' === $authorize_error->error->id ) {
$message = __( 'No authorize code returned to W3-API from Google!', 'w3-total-cache' );
} elseif ( 'authorize-out-w3tc-pagespeed-key-missing' === $authorize_error->error->id ) {
$message = __( 'No W3Key return to W3-API from Google!', 'w3-total-cache' );
} elseif ( 'authorize-out-not-found' === $authorize_error->error->id ) {
$message = __( 'No W3-API matching record found during Google authorization return processing!', 'w3-total-cache' );
}
update_option(
'w3tcps_authorize_fail',
__( 'Google PageSpeed Insights API authorization failed.', 'w3-total-cache' )
);
update_option(
'w3tcps_authorize_fail_message',
$message
);
wp_safe_redirect( $return_url );
exit;
}
?>