We can test our website speed on website https://webpagetest.org.
If you are developer and what to test your website though coding then checkout below Webpagetest API example.
We send the Webpagetest API rest request to test the site.
<?php | |
if ( ! function_exists( 'prefix_analytics_gtag_config' ) ) : | |
/** | |
* Add/Modify Google tag manager variables | |
* | |
* @param array $args Google analytics arguments | |
*/ | |
function prefix_analytics_gtag_config( $args = [] ) { |
<?php | |
add_filter( 'http_request_args', 'prefix_http_request_args', 10, 2 ); | |
function prefix_http_request_args( $parsed_args, $url ) { | |
if ( false === strpos( $url, 'runPagespeed' ) ) { | |
return $parsed_args; | |
} | |
// Set timeout with 90 seconds. | |
$parsed_args['timeout'] = 90; |
<?php | |
if ( ! function_exists( 'prefix_remove_spaces' ) ) : | |
/** | |
* Remove spaces | |
* | |
* @param array $args Arguments. | |
* @return array | |
* | |
* @see https://wp.me/P4Ams0-9Sn |
<?php | |
if ( ! function_exists( 'prefix_copy_the_code_localize_vars' ) ) : | |
/** | |
* Localize vars. | |
* | |
* @return array | |
*/ | |
function prefix_copy_the_code_localize_vars( $args = array() ) { | |
// Redirect to page url. |
<?php | |
if ( ! function_exists( 'prefix_modify_mime_type' ) ) : | |
/** | |
* Modify the MIME types. | |
* | |
* @since x.x.x | |
* | |
* @param array $args File upload arguments. | |
* @return array. |
We can test our website speed on website https://webpagetest.org.
If you are developer and what to test your website though coding then checkout below Webpagetest API example.
We send the Webpagetest API rest request to test the site.
<?php | |
/** | |
* Change Button Text | |
* | |
* @todo Change the `prefix_` with your own unique string. | |
* | |
* @param string $button_text. | |
* @return string | |
*/ | |
function prefix_change_load_more_text( $button_text = '' ) { |
<?php | |
if( is_callable( 'Astra_Sites_Admin::get_instance' ) ) { | |
remove_action( 'admin_notices', array( Astra_Sites_Admin::get_instance(), 'admin_notices' ) ); | |
} |
__ ____ | |
/ / ____ ________ ____ ___ / _/___ _______ ______ ___ | |
/ / / __ \/ ___/ _ \/ __ `__ \ / // __ \/ ___/ / / / __ `__ \ | |
/ /___/ /_/ / / / __/ / / / / / _/ // /_/ (__ ) /_/ / / / / / / | |
/_____/\____/_/ \___/_/ /_/ /_/ /___/ .___/____/\__,_/_/ /_/ /_/ | |
/_/ | |
Font Info: Slant by Glenn Chappell 3/93 -- based on Standard |