If I quickly scroll to the bottom, the plugin begins loading the photos that were previously stored but not the ones I am now viewing in the viewport.
From: Royo Machinery
]]>Hi,
I just upgrade my site from php7 to php8 and I am getting couple of warnings stating the PHP version of the Plugin is no compatible with the latest.
Here is an example of the error
PHP Deprecated: Required parameter $args follows optional parameter $file in wp-content/plugins/bj-lazy-load/inc/scb/Cron.php on line 23
PHP Deprecated: Required parameter $nonce follows optional parameter $formdata in wp-content/plugins/bj-lazy-load/inc/scb/Forms.php on line 61
]]>
How I can make image printable?
Since all images are lazy loaded, is there any way to hook when user try to print page, so images are switch to non lazy so can be printed?
Hi,
I am using “Image horizontal reel scroll slideshow” plugin for scrolling images but i cant apply lazy load on images coming from above plugin how can i lazy load.
Before footer using slider.
]]>Hello,
We received a report that this plugin is causing issues with the ReCaptcha for Contact Form 7 Plugin as linked below:
https://www.ads-software.com/support/topic/recaptcha-for-contact-form-7/
We believe that the issue is about how this plugin interacts with elements inside <noscript>
tags. We were wondering if your script could skip processing any elements inside these <noscript>
tags since it’s specifically targeting users with Javascript disabled. Should you have any other suggestions on how we could fix this conflict or any questions at all, please let us know, we’re happy to help!
I’ve tried various lazy load plugins and I think this is the best.
It would be great if the developers continued to support it.
]]>Hi,
I would like to exclude images which are used within the twentytwenty shortcode (before and after slider plugin).
How can I achieve this?
At this moment I have checked ‘skip lazyloading for this post’, because otherwise the before after isn’t showing.
Thanks in advance!
Rick
]]>Hi all!
I am have recently updated my WP core and it created an error with the BJ lazy load plugin. in the header of my dashboard I have this error
There is a site error displaying in the backend that says
Deprecated: contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead. in /home1/bwmdentsu/public_html/wp-includes/functions.php on line 5088
after deactivating each plugin one by one I came to realise lazy load was the culprit. I found in the file /BJ lazy load/bj-lazy-load/inc/scb/AdminPage.php the following code. I am not sure how to udpate it to fix the issue, any idea???
add_filter( 'contextual_help', array( $this, '_contextual_help' ), 10, 2 );
then
`function _contextual_help( $help, $screen ) {
if ( is_object( $screen ) )
$screen = $screen->id;
$actual_help = $this->page_help();
if ( $screen == $this->pagehook && $actual_help )
return $actual_help;
return $help;
}`
here is the whole file
<?php
/**
* Administration page base class
*/
abstract class scbAdminPage {
/** Page args
* $page_title string (mandatory)
* $parent (string) (default: options-general.php)
* $capability (string) (default: 'manage_options')
* $menu_title (string) (default: $page_title)
* $submenu_title (string) (default: $menu_title)
* $page_slug (string) (default: sanitized $page_title)
* $toplevel (string) If not empty, will create a new top level menu (for expected values see https://codex.www.ads-software.com/Administration_Menus#Using_add_submenu_page)
* - $icon_url (string) URL to an icon for the top level menu
* - $position (int) Position of the toplevel menu (caution!)
* $screen_icon (string) The icon type to use in the screen header
* $nonce string (default: $page_slug)
* $action_link (string|bool) Text of the action link on the Plugins page (default: 'Settings')
* $admin_action_priority int The priority that the admin_menu action should be executed at (default: 10)
*/
protected $args;
// URL to the current plugin directory.
// Useful for adding css and js files
protected $plugin_url;
// Created at page init
protected $pagehook;
// scbOptions object holder
// Normally, it's used for storing formdata
protected $options;
protected $option_name;
// l10n
protected $textdomain;
// ____________REGISTRATION COMPONENT____________
private static $registered = array();
/**
* @param string $class
* @param string $file
* @param scbOptions $options
*
* @return bool
*/
static function register( $class, $file, $options = null ) {
if ( isset( self::$registered[$class] ) )
return false;
self::$registered[$class] = array( $file, $options );
add_action( '_admin_menu', array( __CLASS__, '_pages_init' ) );
return true;
}
/**
* @param string $old_class
* @param string $new_class
*
* @return bool
*/
static function replace( $old_class, $new_class ) {
if ( ! isset( self::$registered[$old_class] ) )
return false;
self::$registered[$new_class] = self::$registered[$old_class];
unset( self::$registered[$old_class] );
return true;
}
/**
* @param string $class
*
* @return bool
*/
static function remove( $class ) {
if ( ! isset( self::$registered[$class] ) )
return false;
unset( self::$registered[$class] );
return true;
}
static function _pages_init() {
foreach ( self::$registered as $class => $args )
new $class( $args[0], $args[1] );
}
// ____________MAIN METHODS____________
/**
* Constructor
*
* @param string|bool $file
* @param scbOptions $options
*/
function __construct( $file = false, $options = null ) {
if ( is_a( $options, 'scbOptions' ) )
$this->options = $options;
$this->setup();
$this->check_args();
if ( isset( $this->option_name ) ) {
add_action( 'admin_init', array( $this, 'option_init' ) );
if ( function_exists( 'settings_errors' ) )
add_action( 'admin_notices', 'settings_errors' );
}
add_action( 'admin_menu', array( $this, 'page_init' ), $this->args['admin_action_priority'] );
add_filter( 'contextual_help', array( $this, '_contextual_help' ), 10, 2 );
if ( $file ) {
$this->file = $file;
$this->plugin_url = plugin_dir_url( $file );
if ( $this->args['action_link'] )
add_filter( 'plugin_action_links_' . plugin_basename( $file ), array( $this, '_action_link' ) );
}
}
/**
* This is where all the page args can be set
*/
function setup(){}
/**
* Called when the page is loaded, but before any rendering.
*
* Useful for calling $screen->add_help_tab() etc.
*/
function page_loaded() {}
/**
* This is where the css and js go
* Both wp_enqueue_*() and inline code can be added
*/
function page_head(){}
/**
* This is where the contextual help goes
* @return string
*/
function page_help(){}
/**
* A generic page header
*/
function page_header() {
echo "<div class='wrap'>\n";
screen_icon( $this->args['screen_icon'] );
echo html( 'h2', $this->args['page_title'] );
}
/**
* This is where the page content goes
*/
abstract function page_content();
/**
* A generic page footer
*/
function page_footer() {
echo "</div>\n";
}
/**
* This is where the form data should be validated
*
* @param array $new_data
* @param array $old_data
*
* @return array
*/
function validate( $new_data, $old_data ) {
return $new_data;
}
/**
* Manually handle option saving ( use Settings API instead )
*
* @return bool
*/
function form_handler() {
if ( empty( $_POST['submit'] ) && empty( $_POST['action'] ) )
return false;
check_admin_referer( $this->nonce );
if ( !isset($this->options) ) {
trigger_error( 'options handler not set', E_USER_WARNING );
return false;
}
$new_data = wp_array_slice_assoc( $_POST, array_keys( $this->options->get_defaults() ) );
$new_data = stripslashes_deep( $new_data );
$new_data = $this->validate( $new_data, $this->options->get() );
$this->options->set( $new_data );
$this->admin_msg();
return true;
}
/**
* Manually generate a standard admin notice ( use Settings API instead )
*
* @param string $msg
* @param string $class
*/
function admin_msg( $msg = '', $class = 'updated' ) {
if ( empty( $msg ) )
$msg = __( 'Settings <strong>saved</strong>.', $this->textdomain );
echo scb_admin_notice( $msg, $class );
}
// ____________UTILITIES____________
/**
* Generates a form submit button
*
* @param string|array $value button text or array of arguments
* @param string $action
* @param string $class
*
* @return string
*/
function submit_button( $value = '', $action = 'submit', $class = 'button button-primary' ) {
$args = is_array( $value ) ? $value : compact( 'value', 'action', 'class' );
$args = wp_parse_args( $args, array(
'value' => null,
'action' => $action,
'class' => $class,
) );
return get_submit_button( $args['value'], $args['class'], $args['action'] );
}
/**
* Mimics scbForms::form_wrap()
*
* $this->form_wrap( $content ); // generates a form with a default submit button
*
* $this->form_wrap( $content, false ); // generates a form with no submit button
*
* // the second argument is sent to submit_button()
* $this->form_wrap( $content, array(
* 'text' => 'Save changes',
* 'name' => 'action',
* ) );
*
* @see scbForms::form_wrap()
*
* @param string $content
* @param boolean|string|array $submit_button
*
* @return string
*/
function form_wrap( $content, $submit_button = true ) {
if ( is_array( $submit_button ) ) {
$content .= $this->submit_button( $submit_button );
} elseif ( true === $submit_button ) {
$content .= $this->submit_button();
} elseif ( false !== strpos( $submit_button, '<input' ) ) {
$content .= $submit_button;
} elseif ( false !== strpos( $submit_button, '<button' ) ) {
$content .= $submit_button;
} elseif ( false !== $submit_button ) {
$button_args = array_slice( func_get_args(), 1 );
$content .= call_user_func_array( array( $this, 'submit_button' ), $button_args );
}
return scbForms::form_wrap( $content, $this->nonce );
}
/**
* Generates a table wrapped in a form
*
* @param array $rows
* @param array|boolean $formdata
*
* @return string
*/
function form_table( $rows, $formdata = false ) {
$output = '';
foreach ( $rows as $row )
$output .= $this->table_row( $row, $formdata );
$output = $this->form_table_wrap( $output );
return $output;
}
/**
* Wraps the given content in a <form><table>
*
* @param string $content
*
* @return string
*/
function form_table_wrap( $content ) {
$output = $this->table_wrap( $content );
$output = $this->form_wrap( $output );
return $output;
}
/**
* Generates a form table
*
* @param array $rows
* @param array|boolean $formdata
*
* @return string
*/
function table( $rows, $formdata = false ) {
$output = '';
foreach ( $rows as $row )
$output .= $this->table_row( $row, $formdata );
$output = $this->table_wrap( $output );
return $output;
}
/**
* Generates a table row
*
* @param array $args
* @param array|boolean $formdata
*
* @return string
*/
function table_row( $args, $formdata = false ) {
return $this->row_wrap( $args['title'], $this->input( $args, $formdata ) );
}
/**
* Mimic scbForms inheritance
*
* @see scbForms
*
* @param string $method
* @param array $args
*
* @return mixed
*/
function __call( $method, $args ) {
if ( in_array( $method, array( 'input', 'form' ) ) ) {
if ( empty( $args[1] ) && isset( $this->options ) )
$args[1] = $this->options->get();
if ( 'form' == $method )
$args[2] = $this->nonce;
}
return call_user_func_array( array( 'scbForms', $method ), $args );
}
/**
* Wraps a string in a <script> tag
*
* @param string $string
*
* @return string
*/
function js_wrap( $string ) {
return html( "script type='text/javascript'", $string );
}
/**
* Wraps a string in a <style> tag
*
* @param string $string
*
* @return string
*/
function css_wrap( $string ) {
return html( "style type='text/css'", $string );
}
// ____________INTERNAL METHODS____________
/**
* Registers a page
*/
function page_init() {
if ( ! $this->args['toplevel'] ) {
$this->pagehook = add_submenu_page(
$this->args['parent'],
$this->args['page_title'],
$this->args['menu_title'],
$this->args['capability'],
$this->args['page_slug'],
array( $this, '_page_content_hook' )
);
} else {
$func = 'add_' . $this->args['toplevel'] . '_page';
$this->pagehook = $func(
$this->args['page_title'],
$this->args['menu_title'],
$this->args['capability'],
$this->args['page_slug'],
null,
$this->args['icon_url'],
$this->args['position']
);
add_submenu_page(
$this->args['page_slug'],
$this->args['page_title'],
$this->args['submenu_title'],
$this->args['capability'],
$this->args['page_slug'],
array( $this, '_page_content_hook' )
);
}
if ( ! $this->pagehook )
return;
add_action( 'load-' . $this->pagehook, array( $this, 'page_loaded' ) );
add_action( 'admin_print_styles-' . $this->pagehook, array( $this, 'page_head' ) );
}
function option_init() {
register_setting( $this->option_name, $this->option_name, array( $this, 'validate' ) );
}
private function check_args() {
if ( empty( $this->args['page_title'] ) )
trigger_error( 'Page title cannot be empty', E_USER_WARNING );
$this->args = wp_parse_args( $this->args, array(
'toplevel' => '',
'position' => null,
'icon_url' => '',
'screen_icon' => '',
'parent' => 'options-general.php',
'capability' => 'manage_options',
'menu_title' => $this->args['page_title'],
'page_slug' => '',
'nonce' => '',
'action_link' => __( 'Settings', $this->textdomain ),
'admin_action_priority' => 10,
) );
if ( empty( $this->args['submenu_title'] ) )
$this->args['submenu_title'] = $this->args['menu_title'];
if ( empty( $this->args['page_slug'] ) )
$this->args['page_slug'] = sanitize_title_with_dashes( $this->args['menu_title'] );
if ( empty( $this->args['nonce'] ) )
$this->nonce = $this->args['page_slug'];
}
/**
* @param string $help
* @param string|object $screen
*
* @return string
*/
function _contextual_help( $help, $screen ) {
if ( is_object( $screen ) )
$screen = $screen->id;
$actual_help = $this->page_help();
if ( $screen == $this->pagehook && $actual_help )
return $actual_help;
return $help;
}
function _page_content_hook() {
$this->form_handler();
$this->page_header();
$this->page_content();
$this->page_footer();
}
/**
* @param array $links
*
* @return array
*/
function _action_link( $links ) {
$url = add_query_arg( 'page', $this->args['page_slug'], admin_url( $this->args['parent'] ) );
$links[] = html_link( $url, $this->args['action_link'] );
return $links;
}
}
]]>
Hi,
I am facing multiple AMP issue when i am using “BJ Lazy Load” Plugin.
I have checked with disable “BJ Lazy Load” plugin, then all errors will go out.
Issues are below:
1. Incomplete layout attributes specified for tag ‘amp-img’. For example, provide attributes ‘width’ and ‘height’.
2. The parent tag of tag ‘noscript enclosure for boilerplate’ is ‘noscript’, but it can only be ‘head’.
Please check below URL for AMP report:
https://validator.amp.dev/#url=https%3A%2F%2Fwww.expresscomputer.in%2Famp%2Fcolumns%2Fhow-machine-learning-can-give-emotions-to-driverless-cars%2F18753%2F
I discovered if BJ lazy loaded is enabled, when uploading avatar to BuddyPress, only part of image is shown. There is no ability to crop the photo.
Lazy load breaks all functionally of the BuddyPress upload avatar feature, making it impossible to use.
Can you help?
]]>Hi,
After using the plugin for some time I noticed that none of my images below the fold load on Internet Explorer (currently at version 11). They do load well on Chrome and other browsers.
Can you support, please?
Best regards,
Andrejs
Hi!
The plugin conflicts with the H5P plugin: when inserting H5P content with a shortcode, the iframe of the H5P content does not load. Is there a solution for this? Can I somehow add an exception to H5P iframes?
]]>Hi,
We are currently using this plugin on our WordPress site. Everything seems to be working fine but I have noticed that the plugin has not been updated in ~2 years.
Is this plugin still supported or should I be looking for a different lazy load solution?
Thanks for making a great plugin!
Nick
]]>sorry this was a review, Mods please delete
]]>I applied the filter ‘bj_lazy_load_html’ to an img element in the footer.php template.
I can see that in the source code the image contains the ‘data-src’ attribute but it loads when the page loads the instead of lazy loading when scroll down.
Any suggestions about how to fix this.
Thanks.
]]>Hi, i have a counting pixel for vg wort service with img class=”wp-worthy-pixel-img”.
data-lazy-source was masked.
<div id="wp-worthy-pixel"><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-lazy-type="image" data-lazy-src="xxx" class="lazy lazy-hidden wp-worthy-pixel-img" data-no-lazy="1" height="1" width="1" alt=""/>
I entered the class in BJ Lazy Load ettings for skipping it wp-worthy-pixel-img
But the plugin does not skip it.
any advice?
]]>Picture file name is knock-box-sizes.jpg but after uploading it became
https://www.linlin.in.th/wp-content/uploads/knock-box-data-lazy-sizes.jpg
why?..
Hi there,
Since a couple of months, I am facing a weird issue with BJ lazy load plugin. Actually, the plugin works fine for normal visitors but it causes trouble when logged in as admin.
When I visit the homepage or any post as admin, images do not appear (blank square in place of images), only words appear. It’s very irritating because it is disturbing even post preview.
Everything becomes fine after deactivating BJ lazy load plugin.
Right now, I want to stick with BJ Lazy Load, so please help me regarding the issue.
Regards
Rishi
in the last update something has caused errors in my site. Do you know anything?
I think there is a compatibility problem with the “Polylang” translation plugin, because if I keep it active, everything will be broken.
With the deactivated some problems are solved but the images do not load correctly.
Thank you
]]>Hi all,
It seems that with Lazy Load activated, it causes white spaces above every image on AMP pages.I’ve managed to solve the problem with the following code in the functions file
/**
* Stop BJ LazyLoad on AMP Pages
*/
function bj_lazyload_amp() {
if( is_amp_endpoint() ) {
return false;
}
return true;
}
add_filter( 'bjll/enabled', 'bj_lazyload_amp' );
Be great if this could be added as an setting though.
]]>Hello, I downloaded this plugin because I have been told that it is very good to increase the speed of the page but it does not do anything to me and in PageSpeed ??Insights a score of 8 passes only to a 9. Why?
]]>When I activate BJ Lazy Load my login page is a mess and worse. No login is recognized and everyone is blocked from entering.
By conincidence I have social login installed and I managed to login via one of them.
When deactivated – login works again
When activated – Login is broken
etc etc
I have issues with all Lazy Load plugins but BJ is the only one with this level of destruction
]]>Hi,
Does it work with Cloudinary?
]]>The image plugin creates the data-lazy-src attribute, and Yandex support service told me that they can index images only with the data-original or data-src attributes — does the Yandex robot not see the image?
link to the Yandex page https://yandex.ru/support/images/indexing.html
]]>Just wondering if this plugin will ever be updated or is it abandoned?
]]>can it load background images as lazy load?
]]>Hi!
I need betheme images support. Do not working!
Thanks!
]]>Hello, when loading images, a quad image first appears equal to the width of the block, which is then loaded and the height becomes normal. Because of this, the text is constantly shifting on the smartphone as the images load.
https://uspei.com/gadzhety/yandeks-telefon/
Hi! thanks for the plugin. It works very good. I have found a little thing that may be better:
If I have a page with 100 images inside a 4 column grid, when I scroll down if I move fast to the bottom, the plugin starts loading the images that has been left away but not the ones I’m looking on the viewport.
It’s ok but maybe could be good to load only the images on the really-actual viewport and a bit down the viewport (as it does).
Thank you!!
]]>Is the plugin compatible with PHP 7.1?
Thanks