: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<label class="sui-toggle" for="include-<?php echo esc_attr( $custom_post_type->name ); ?>">
<input type='hidden' value='0' name='include[<?php echo esc_attr( $custom_post_type->name ); ?>]' />
<input type="checkbox" name="include[<?php echo esc_attr( $custom_post_type->name ); ?>]" id="include-<?php echo esc_attr( $custom_post_type->name ); ?>"
<?php checked( ! isset( $settings['include'][ $custom_post_type->name ] ) || $settings['include'][ $custom_post_type->name ] ); ?> />
<span class="sui-toggle-slider"></span>
<div class="sui-form-field">
<strong><?php esc_html_e( 'Post, Pages & URLs', 'wp-smushit' ); ?></strong>
<div class="sui-description">
<?php esc_html_e( 'Add URLs to the posts and/or pages you want to disable lazy loading on.', 'wp-smushit' ); ?>
if ( is_array( $settings['exclude-pages'] ) ) {
$strings = join( PHP_EOL, $settings['exclude-pages'] );
<textarea class="sui-form-control" name="exclude-pages" placeholder="<?php esc_attr_e( 'E.g. /page', 'wp-smushit' ); ?>"><?php echo esc_attr( $strings ); ?></textarea>
<div class="sui-description">
/* translators: %1$s - opening strong tag, %2$s - closing strong tag */
esc_html__( 'Add page or post URLs one per line in relative format. I.e. %1$s/example-page%2$s or %1$s/example-page/sub-page/%2$s.', 'wp-smushit' ),
<div class="sui-form-field">
<strong><?php esc_html_e( 'Keywords', 'wp-smushit' ); ?></strong>
<div class="sui-description">
<?php esc_html_e( 'Specify keywords from the image or iframe code - classes, IDs, filenames, source URLs or any string of characters - to exclude from lazy loading (case-sensitive).', 'wp-smushit' ); ?>
if ( is_array( $settings['exclude-classes'] ) ) {
$strings = join( PHP_EOL, $settings['exclude-classes'] );
<textarea class="sui-form-control" name="exclude-classes" placeholder="<?php esc_attr_e( 'Add keywords, one per line', 'wp-smushit' ); ?>"><?php echo esc_attr( $strings ); ?></textarea>
<div class="sui-description">
/* translators: %1$s - opening strong tag, %2$s - closing strong tag */
esc_html__( 'Add one keyword per line. E.g. %1$s#image-id%2$s or %1$s.image-class%2$s or %1$slogo_image%2$s or %1$sgo_imag%2$s or %1$sx.com/%2$s', 'wp-smushit' ),
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label">
<?php esc_html_e( 'Scripts', 'wp-smushit' ); ?>
<span class="sui-description">
<?php esc_html_e( 'By default we will load the required scripts in your footer for max performance benefits. If you are having issues, you can switch this to the header.', 'wp-smushit' ); ?>
<div class="sui-box-settings-col-2">
<div class="sui-form-field">
<strong><?php esc_attr_e( 'Method', 'wp-smushit' ); ?></strong>
<div class="sui-description">
<?php esc_html_e( 'By default we will load the required scripts in your footer for max performance benefits. If you are having issues, you can switch this to the header.', 'wp-smushit' ); ?>
<div class="sui-side-tabs sui-tabs">
<label for="script-footer" class="sui-tab-item <?php echo $settings['footer'] ? 'active' : ''; ?>">
<input type="radio" name="footer" value="on" id="script-footer" <?php checked( $settings['footer'] ); ?> />
<?php esc_html_e( 'Footer', 'wp-smushit' ); ?>
<label for="script-header" class="sui-tab-item <?php echo $settings['footer'] ? '' : 'active'; ?>">
<input type="radio" name="footer" value="off" id="script-header" <?php checked( $settings['footer'], false ); ?> />
<?php esc_html_e( 'Header', 'wp-smushit' ); ?>
<div class="sui-notice active">
<div class="sui-notice-content">
<div class="sui-notice-message">
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
<p><?php esc_html_e( 'Your theme must be using the wp_footer() function.', 'wp-smushit' ); ?></p>
<div class="sui-notice-content">
<div class="sui-notice-message">
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
<p><?php esc_html_e( 'Your theme must be using the wp_head() function.', 'wp-smushit' ); ?></p>
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label">
<?php esc_html_e( 'Native lazy load', 'wp-smushit' ); ?>
<span class="sui-description">
<?php esc_html_e( 'Enable support for native browser lazy loading.', 'wp-smushit' ); ?>
<div class="sui-box-settings-col-2">
<div class="sui-form-field">
<label for="native" class="sui-toggle">
aria-labelledby="native-label"
aria-describedby="native-description"
<?php checked( isset( $settings['native'] ) && $settings['native'] ); ?>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="native-label" class="sui-toggle-label">
<?php esc_html_e( 'Enable native lazy loading', 'wp-smushit' ); ?>
<span id="native-description" class="sui-description">
/* translators: %1$s - opening a tag, %2$s - closing a tag */
esc_html__( 'In some cases can cause the "Defer offscreen images" Google PageSpeed audit to fail. See browser compatibility %1$shere%2$s.', 'wp-smushit' ),
'<a href="https://caniuse.com/#feat=loading-lazy-attr" target="_blank">',
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label">
<?php esc_html_e( 'Disable Noscript', 'wp-smushit' ); ?>
<span class="sui-description">
<?php esc_html_e( 'Disable NoScript while lazy loading is enabled.', 'wp-smushit' ); ?>
<div class="sui-box-settings-col-2">
<div class="sui-form-field">
<label for="noscript" class="sui-toggle">
aria-labelledby="noscript-label"
aria-describedby="noscript-description"
<?php checked( isset( $settings['noscript'] ) && $settings['noscript'] ); ?>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="noscript-label" class="sui-toggle-label">
<?php esc_html_e( 'Disable Noscript', 'wp-smushit' ); ?>
<span id="noscript-description" class="sui-description">
/* translators: %1$s - opening a tag, %2$s - closing a tag */
esc_html_e( 'Sometimes W3C HTML5 Validation may give error due to No Script.', 'wp-smushit' );
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label">
<?php esc_html_e( 'Deactivate', 'wp-smushit' ); ?>
<span class="sui-description">
'No longer wish to use this feature? Turn it off instantly by hitting Deactivate.',
<div class="sui-box-settings-col-2">
<button class="sui-button sui-button-ghost" id="smush-cancel-lazyload">
<span class="sui-loading-text">
<i class="sui-icon-power-on-off" aria-hidden="true"></i>
<?php esc_html_e( 'Deactivate', 'wp-smushit' ); ?>
<i class="sui-icon-loader sui-loading" aria-hidden="true"></i>