: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
function ampforwp_loading_spinner(){
global $ampforwp_install_config;
$spinner = esc_url(AMPFORWP_PLUGIN_DIR. $ampforwp_install_config['installer_dir']. '/assets/images/spinner.php');
get_template_part( $spinner );
function ampforwp_svg_sprite() {
global $ampforwp_install_config;
// Define SVG sprite file.
$svg = esc_url(AMPFORWP_PLUGIN_DIR. $ampforwp_install_config['installer_dir'] . '/assets/images/sprite.svg') ;
// If it exists, include it.
if ( file_exists( $svg ) ) {
require_once apply_filters( 'merlin_svg_sprite', $svg );
function ampforwp_step_next_link() {
global $ampforwp_install_config;
$step = $ampforwp_install_config['current_step']['step_id'] + 1;
return add_query_arg( 'step', $step );
function ampforwp_install_header() {
global $ampforwp_install_config;
$current_step = strtolower( $ampforwp_install_config['steps'][$ampforwp_install_config['current_step']['step_id']]['title'] ); ?>
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<meta name="viewport" content="width=device-width"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title><?php echo ucwords($current_step); ?></title>
<?php do_action( 'admin_print_styles' ); ?>
<?php do_action( 'admin_print_scripts' ); ?>
<?php do_action( 'admin_head' ); ?>
<body class="merlin__body merlin__body--<?php echo esc_attr( $current_step ); ?>">
function ampforwp_install_footer() {
<?php do_action( 'admin_footer' ); ?>
<?php do_action( 'admin_print_footer_scripts' ); ?>
function ampforwp_makesvg( $args = array() ){
// Make sure $args are an array.
return __( 'Please define default parameters in the form of an array.', 'accelerated-mobile-pages' );
if ( false === array_key_exists( 'icon', $args ) ) {
return __( 'Please define an SVG icon filename.', 'accelerated-mobile-pages' );
'aria_hidden' => true, // Hide from screen readers.
$args = wp_parse_args( $args, $defaults );
if ( true === $args['aria_hidden'] ) {
$aria_hidden = ' aria-hidden="true"';
if ( $args['title'] && $args['desc'] ) {
$aria_labelledby = ' aria-labelledby="title desc"';
$svg = '<svg class="icon icon--' . esc_attr( $args['icon'] ) . '"' . esc_attr($aria_hidden) . esc_attr($aria_labelledby) . ' role="img">';
// If there is a title, display it.
$svg .= '<title>' . esc_html( $args['title'] ) . '</title>';
// If there is a description, display it.
$svg .= '<desc>' . esc_html( $args['desc'] ) . '</desc>';
$svg .= '<use xlink:href="#icon-' . esc_html( $args['icon'] ) . '"></use>';
// Add some markup to use as a fallback for browsers that do not support SVGs.
if ( $args['fallback'] ) {
$svg .= '<span class="svg-fallback icon--' . esc_attr( $args['icon'] ) . '"></span>';
* Adds data attributes to the body, based on Customizer entries.
function ampforwp_svg_allowed_html() {
'aria-hidden' => array(),
function step_output_bottom_dots(){
global $ampforwp_install_config;
<?php for( $i = 1; $i<$ampforwp_install_config['total_steps']; $i++ ) :
if ( $i === $ampforwp_install_config['current_step']['step_id'] ) {
} elseif ( $ampforwp_install_config['current_step']['step_id'] > $i) {
<li class="<?php echo esc_attr( $class_attr ); ?>">
<a href="<?php echo esc_url( add_query_arg( 'step', $i ) ); ?>" title="<?php echo esc_attr( $ampforwp_install_config['current_step']['title'] ); ?>"></a>