Skip to content

mejta/wp-accelerate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WordPress Accelerate

This very simple plugin makes WordPress website more performant with following techniques:

  • Lazyload for images and iframes
  • Adding defer attribute to script tag

Installation

  1. Install the plugin from the official plugin directory.
  2. Activate the plugin.
  3. Profit

Contribution

Feel free to improve the plugin and open pull request.

Development

You need to have node.js and yarn installed.

  1. Clone repository git clone git@github.com:mejta/wp-accelerate.git.
  2. Install dependencies with yarn
  3. Start development process with yarn start --output /some/wp/installation/wp-content/plugins/wp-accelerate command. It will start a build in watch mode and after every change copies files to folder of your choice - e.g. plugin folder in existing installation. Output parameter must be an absolute path to the folder with plugin.

Usage

  1. Activate the plugin
  2. To disable lazyload use filter wp_accelerate_lazyload
add_filter('wp_accelerate_lazyload', function($do_lazyload) {
  if (is_cart() || is_checkout() || is_account_page() || is_wc_endpoint_url() || is_ajax()) return false;
  return $do_lazyload;
});

Credits

This plugin was created after training by Martin Michálek and his course Optimization of Load speed.