automattic / jetpack-lazy-images
Speed up your site and create a smoother viewing experience by loading images as visitors scroll down the screen, instead of all at once.
Installs: 19 149
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 2
Type:jetpack-library
Requires
Requires (Dev)
- automattic/jetpack-changelogger: ^3.1
- automattic/wordbless: dev-master
- yoast/phpunit-polyfills: 1.0.3
- dev-master / 2.1.x-dev
- v2.1.14
- v2.1.13
- v2.1.12
- v2.1.11
- v2.1.10
- v2.1.9
- v2.1.8
- v2.1.7
- v2.1.6
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.5.1
- v1.5.0
- v1.4.4
- v1.4.3
- 1.4.2
- v1.4.1
- v1.4.0
- v1.3.0
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.0
- dev-fix/slack-workflow-branch-detection
- dev-fix/release-branch-typo
- dev-update/generate-branch-plugin
- dev-release-v1.4.1
- dev-release-v1.4.0
- dev-feature/reorg
- dev-release-v1.3.0
- dev-release-v1.2.2
- dev-release-v1.1.3
- dev-release-v1.1.2
- dev-release-v1.2.1
- dev-release-v1.1.1
- dev-release-v1.2.0
- dev-release-v1.1.0
- dev-release-v1.0.0
This package is auto-updated.
Last update: 2022-05-18 11:12:22 UTC
README
Speed up your site and create a smoother viewing experience by loading images as visitors scroll down the screen, instead of all at once.
Usage
/* * Initialize lazy images on the wp action so that conditional * tags are safe to use. * * As an example, this is important if a theme wants to disable lazy images except * on single posts, pages, or attachments by short-circuiting lazy images when * is_singular() returns false. * * See: https://github.com/Automattic/jetpack/issues/8888 */ add_action( 'wp', array( 'Automattic\\Jetpack\\Jetpack_Lazy_Images', 'instance' ) );
Development
Running tests requires working svn
, composer
and pnpm
commands.
Once these are installed, you install the composer dependencies by running:
$ composer install --ignore-platform-reqs
Generate minified JavaScript
The JavaScript file can be minified from the root of the Jetpack repository:
$ cd ../../
$ pnpm build-packages
Run PHP unit tests
On a local development environment run:
$ composer phpunit
Lint PHP source code
The PHP code can be linted from the root of the Jetpack repository:
$ cd ../../
$ composer phpcs:compatibility packages/lazy-images
$ composer phpcs:lint packages/lazy-images