/home/techb158/balacoffee.com/wp-content/plugins/wp-rocket/inc/Addon/Cloudflare/Auth
Edit: /home/techb158/balacoffee.com/wp-content/plugins/wp-rocket/inc/Addon/Cloudflare/Auth/APIKey.php (1679B)
email = $email;
$this->api_key = $api_key;
}
/**
* Gets headers for Cloudflare API request
*
* @return array
*/
public function get_headers(): array {
return [
'X-Auth-Email' => $this->email,
'X-Auth-Key' => $this->api_key,
];
}
/**
* Checks if the credentials are set.
*
* @return bool|WP_Error true if authorized, false if not, WP_Error if either credential is empty.
*/
public function is_valid_credentials() {
if (
empty( $this->email )
||
empty( $this->api_key )
) {
return new WP_Error(
'cloudflare_credentials_empty',
sprintf(
/* translators: %1$s = opening link; %2$s = closing link */
__( 'Cloudflare email and/or API key are not set. Read the %1$sdocumentation%2$s for further guidance.', 'rocket' ),
// translators: Documentation exists in EN, FR; use localized URL if applicable.
'
',
''
)
);
}
return false !== filter_var( $this->email, FILTER_VALIDATE_EMAIL );
}
}