Settings', ); return array_merge( $links, $mylinks ); } /** * Function Name: lz_install * Description: Save data to database at the time of plugin install. * */ register_activation_hook(__FILE__, 'lz_install'); function lz_install() { $ifd_pixel = (get_option('ifd_pixel') != '') ? get_option('ifd_pixel') : '0'; update_option('ifd_pixel', $ifd_pixel); $ifd_duration = (get_option('ifd_duration') != '') ? get_option('ifd_duration') : '1000'; update_option('ifd_duration', $ifd_duration); $adlzylad_mobile = (get_option('cb_adlzylad_mobile') != '') ? get_option('cb_adlzylad_mobile') : "on"; update_option('cb_adlzylad_mobile', $adlzylad_mobile); } /** * Function Name: LZ_option_link * Description: Add a submenu under Settings tab. * */ function LZ_option_link() { add_options_page('Advanced lazy load', 'Advanced lazy load', 'manage_options', 'Advanced-lazy-load', 'Advancedlazyload_form'); } //the 'Advanced-lazy-load_form' content function ifmobileison(){ if(get_option('cb_adlzylad_mobile')=="on"){ echo "checked"; } } function Advancedlazyload_form() { /** * Check whether the form submitted or not. */ if (isset($_POST['option-save'])) { echo "

Options saved!

"; $ddsadsa = trim($_POST['ifd_pixel']); update_option('ifd_pixel', $ddsadsa); $duration = trim($_POST['ifd_duration']); update_option('ifd_duration', $duration); $skipclass = trim($_POST['ifd_adlaylad_skipclass']); update_option('ifd_adlaylad_skipclass', $skipclass); $skipURL = trim($_POST['ta_adlaylad_skipurl']); update_option('ta_adlaylad_skipurl', $skipURL); $All_mobile = trim($_POST['cb_adlzylad_mobile']); update_option('cb_adlzylad_mobile', $All_mobile); } ?>

Welcome to Advanced lazy load!

Version: 1.6.0

By using ths plugin for wordpress, it will reduce the loading time while opening your wordpress website

This is initial edition of Advanced lazy load, many features will be added in future versions, compatible with all current browsers.

Important - 1.6.0 - Recompiled the core function. In case you are experiencing any issues, you can roll back to stable version 1.5.1

More Actions

Rating

Like it?
Please help to Rate a Five. Thank you!

Settings

Pixel: px
Fading in duration: millisecond
Skip img class(es):
Separated by comma, example: no-lazy,welcome-image,websitelogo
Skip URL(s):
Separated by newline, if URL contains listed character string above, the plugin will ignore the page. Example:
www.example.com/page-no-lazy-load
category?=abc
Enable on mobile device: />

Message from developer, Kason:

Version 1.6.0 update:
Important: Recompiled the core function, open for feedback. In case you are experiencing any issues, you can roll back to stable version, 1.5.1
New option: Skip img class(es), no lazy load for specified image class(es).
New option: Skip page(s).
New option: Enable on mobile device, default value is enable.

Version 1.5.1 update:
Added new plugin website, three new demo pages in kasonz.com.

Version 1.5 update:
After a year and a half, I am back! Modified broken links, and change the setting page format, add donate button :)

get_option('ifd_pixel'), 'ifd_duration' => get_option('ifd_duration') )); function strposa($haystack, $needle, $offset = 0) { if (!is_array($needle)) $needle = array( $needle ); foreach ($needle as $query) { if (strpos($haystack, $query, $offset) !== false) return true; // stop on first true result } return false; } function Advaced_lazyload($HTMLs) { $dddd = false; $skipclass_value = trim(get_option('ifd_adlaylad_skipclass')); if ($skipclass_value == null or $skipclass_value == "") { $dddd = true; } $plugin_dir_path = plugin_dir_url(__FILE__); $newhtml = str_get_dom($HTMLs); foreach($newhtml('iframe') as $element_iframe) { foreach($element_iframe('img') as $element_img) { $element_img->setTag('IMG_IN_IFRAME_PRE'); } } if ($dddd) { foreach ($newhtml('img') as $element) { //if skip class name is not found $element->addAttribute('ImageHolder', $element->src); $element->src = $plugin_dir_path . 'shade.gif'; } } else { foreach ($newhtml('img') as $element) { //if skip class name is not found if (!strposa($element->class, explode(",", $skipclass_value))) { $element->addAttribute('ImageHolder', $element->src); $element->src = $plugin_dir_path . 'shade.gif'; } } } foreach($newhtml('IMG_IN_IFRAME_PRE') as $element_img_after) { $element_img_after->setTag('img'); } //$newhtml = dom_format($newhtml, array('attributes_case' => CASE_LOWER)); return $newhtml; } function DOMReady() { $skipURL_value = get_option('ta_adlaylad_skipurl'); $skipURL_value_trim = trim($skipURL_value); if ($skipURL_value_trim == null or $skipURL_value_trim == "") { $skipURL_value = "8e51341a06084de10000009b38f83b"; } $currURL = $_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"]; if (!strposa($currURL, explode("\n", $skipURL_value))) { ob_start("Advaced_lazyload"); } } add_action('wp_head', 'DOMReady'); } ?>