SlideShare a Scribd company logo
1 of 49
Download to read offline
Automating Theme Development Process
@HardeepAsrani
I’m Hardeep Asrani
➤ Pirate at ThemeIsle.com
➤ WordPress Plugin/Theme Developer
➤ Part of WordPress Theme Review & Support Team
➤ Part of Kanpur FOSS Community
And I’m Wapuu Saa!
Are you a developer?
Do you Automate your tasks?
Why Automate?
What can it do for me?
➤ Faster and error-free development
➤ More time to focus on development and logic
➤ More time == More money
➤ Cool lagta hai
What can you Automate?
All the Repetitive Tasks:
➤ Compile SASS, LESS, Stylus, etc.
➤ JSHint/ESLint
➤ Concatenate and Minify Assets
(CSS & JS)
➤ Compress Images
➤ Code Sniffing
➤ Visual Regression
➤ Generate Pro/Lite versions from
the same theme
➤ And more…
What do you need?
Environment + Package Manager
# Update Advanced Package Tool
$ apt-get update
# Install cURL, if not installed
$ apt-get install curl
# Download nodejs Package
$ curl -sL https://deb.nodesource.com/setup_6.x | bash -
# Install nodejs
$ apt-get install -y nodejs
# Initialize Project
$ npm init
Let’s start with…
That SASS!
Why SASS?
Nesting
.footer {
    text-align: center;
    background: #343434;
}
.footer .icons {
    color: #000000;
    float: left;
}
.footer {
    text-align: center;
    background: #343434;
    &.icons {
        color: #000000;
        float: left;
    }
}
Mixins
.btn-blue {
    color: #3FA2F7;
    width: 100px;
    height: 50px;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
}
.btn-black {
    color: #000;
    width: 100px;
    height: 50px;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
}
@mixin button {
    width: 100px;
    height: 50px;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
}
.btn-blue {
    color: #3FA2F7;
    @include button;
}
.btn-black {
    color: #000;
    @include button;
}
And more, like functions and extend.
Installing SASS
# Install Ruby
$ apt-get install ruby-full
# Install SASS
$ gem install sass
# Check SASS Version
$ sass -v
# Compile SASS
$ sass --watch input.scss output.css
Tired of compiling SASS?
Introducing…
Task Runners
# Install Grunt
$ npm install grunt
# Install Grunt CLI
$ npm install -g grunt-cli
# Install SASS Grunt Task
$ npm install grunt-contrib-sass --save-dev
module.exports = function(grunt) {
    
    grunt.initConfig({
        sass: {
            dist: {
                files: {
                    'main.css': 'main.scss',
                }
            },
        }
    });
    
    grunt.loadNpmTasks('grunt-contrib-sass');
    grunt.registerTask('default', [’sass’]);
    
};
Gruntfile.js
JSHint/ESLint
# Install JSHint
$ npm install grunt-contrib-jshint --save-dev
Write error free JavaScript.
module.exports = function(grunt) {
    
    grunt.initConfig({
        jshint: {
            files: ['Gruntfile.js', 'assets/js/*.js'],
            options: {
                globals: {
                    jQuery: true
                },
                ignores: ['assets/library/*.min.js']
            },
        }
    });
    
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.registerTask('default', [‘jshint’]);
    
};
Gruntfile.js
# Install Babel & Babel Grunt Task
$ npm install --save-dev grunt-babel babel-core babel-preset-env
Use next generation JavaScript, today.
module.exports = function(grunt) {
    
    grunt.initConfig({
        babel: {
            options: {
                sourceMap: true,
                presets: ['env']
            },
            dist: {
                files: {
                    'dist/script.js': 'src/script.js'
                }
            }
        }
    });
    grunt.loadNpmTasks('grunt-babel');
    grunt.registerTask('default', 'babel');
    
};
Gruntfile.js
Write Better PHP
➤ PHP Code Sniffer: https://github.com/squizlabs/PHP_CodeSniffer
➤ PHP Code Sniffer Grunt Task: https://github.com/SaschaGalley/grunt-phpcs
➤ WordPress PHPCS Standards: https://github.com/WordPress-Coding-Standards/
WordPress-Coding-Standards
➤ PHPUnit: https://github.com/SaschaGalley/grunt-phpunit
➤ PHP Code Beautifier and Fixer: https://github.com/mducharme/grunt-phpcbf
➤ PHP Lint: https://github.com/jgable/grunt-phplint
Make Your CSS Work on all Browsers
# Install PostCSS
$ npm install grunt-postcss --save-dev
# Install WP-CSS
$ npm install grunt-wp-css —save-dev
➤ Add vendor prefixes to CSS rules using values from Can I Use.
➤ Enforce consistent conventions and avoid errors in your stylesheets with stylelint.
➤ Write stylesheet according to WordPress CSS coding standards.
Compress Images + Minify CSS/JS
Speed-up your WordPress Theme
# Minify images using imagemin
$ npm install --save-dev grunt-contrib-imagemin
# Minify JS with Uglify
$ npm install grunt-contrib-uglify —save-dev
# Minify CSS
$ npm install grunt-contrib-cssmin —save-dev
And the most boring important task…
Generate Translation (POT) File
Make your theme translatable.
# Check your code for missing or incorrect text-domain in gettext functions
$ npm install grunt-checktextdomain --save-dev
# Geenrate POT File
$ npm install grunt-wp-i18n --save-dev
All these tasks with one command.
The Workflow is Reusable
Our Grunt Workflow
https://github.com/Codeinwp/grunt-theme-fleet/
Tired of making different Lite/Pro versions?
PHP 5.6 HHVM
PHP 7.1 PHP 5.3
PHP 7.0 PHP 5.2
Visual Regression
Overview
➤ Find tasks that can be automated.
➤ Setup a grunt/gulp task to automate it.
➤ Build your workflow.
➤ Reuse it.
Resources
➤ nodejs: https://nodejs.org/en/
➤ npm: https://www.npmjs.com/
➤ Grunt: https://gruntjs.com/
➤ Sass: http://sass-lang.com/
➤ Babel: http://babeljs.io/
➤ Grunt Tasks: https://gruntjs.com/plugins
➤ Travis CI: http://travis-ci.com/
Thank you
➤ Twitter: @HardeepAsrani
➤ Github: https://github.com/HardeepAsrani/
➤ Website: http://www.hardeepasrani.com/
You’re welcome.

More Related Content

What's hot

WordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cli
WordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cliWordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cli
WordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cliGetSource
 
Preprocessor Workflow with Grunt
Preprocessor Workflow with GruntPreprocessor Workflow with Grunt
Preprocessor Workflow with GruntVlad Filippov
 
Responsive Design with WordPress
Responsive Design with WordPressResponsive Design with WordPress
Responsive Design with WordPressJoe Casabona
 
Tooling per il tema in Drupal 8
Tooling per il tema in Drupal 8Tooling per il tema in Drupal 8
Tooling per il tema in Drupal 8DrupalDay
 
Let Grunt do the work, focus on the fun!
Let Grunt do the work, focus on the fun!Let Grunt do the work, focus on the fun!
Let Grunt do the work, focus on the fun!Dirk Ginader
 
Introduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsIntroduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsDerek Anderson
 
Node.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash CourseNode.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash CourseAaron Silverman
 
Once upon a time, there were css, js and server-side rendering
Once upon a time, there were css, js and server-side renderingOnce upon a time, there were css, js and server-side rendering
Once upon a time, there were css, js and server-side renderingAndrea Giannantonio
 
Webpack: your final module bundler
Webpack: your final module bundlerWebpack: your final module bundler
Webpack: your final module bundlerAndrea Giannantonio
 
Advanced WordPress Development Environments
Advanced WordPress Development EnvironmentsAdvanced WordPress Development Environments
Advanced WordPress Development EnvironmentsBeau Lebens
 
Responsive Design with WordPress (WCPHX)
Responsive Design with WordPress (WCPHX)Responsive Design with WordPress (WCPHX)
Responsive Design with WordPress (WCPHX)Joe Casabona
 
Tooling, theming, made easy
Tooling, theming, made easyTooling, theming, made easy
Tooling, theming, made easyEvan Butera
 
Forget Grunt and Gulp! Webpack and NPM rule them all!
Forget Grunt and Gulp! Webpack and NPM rule them all!Forget Grunt and Gulp! Webpack and NPM rule them all!
Forget Grunt and Gulp! Webpack and NPM rule them all!Derek Willian Stavis
 
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2Yros
 
Presentation of JSConf.eu
Presentation of JSConf.euPresentation of JSConf.eu
Presentation of JSConf.euFredrik Wendt
 
Cut your hair and get an azure webjob
Cut your hair and get an azure webjobCut your hair and get an azure webjob
Cut your hair and get an azure webjobMark Greenway
 
Complete MVC on NodeJS
Complete MVC on NodeJSComplete MVC on NodeJS
Complete MVC on NodeJSHüseyin BABAL
 

What's hot (19)

WordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cli
WordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cliWordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cli
WordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cli
 
Preprocessor Workflow with Grunt
Preprocessor Workflow with GruntPreprocessor Workflow with Grunt
Preprocessor Workflow with Grunt
 
Responsive Design with WordPress
Responsive Design with WordPressResponsive Design with WordPress
Responsive Design with WordPress
 
Tooling per il tema in Drupal 8
Tooling per il tema in Drupal 8Tooling per il tema in Drupal 8
Tooling per il tema in Drupal 8
 
Let Grunt do the work, focus on the fun!
Let Grunt do the work, focus on the fun!Let Grunt do the work, focus on the fun!
Let Grunt do the work, focus on the fun!
 
Introduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsIntroduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCats
 
Hello npm
Hello npmHello npm
Hello npm
 
Node.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash CourseNode.js & Twitter Bootstrap Crash Course
Node.js & Twitter Bootstrap Crash Course
 
Once upon a time, there were css, js and server-side rendering
Once upon a time, there were css, js and server-side renderingOnce upon a time, there were css, js and server-side rendering
Once upon a time, there were css, js and server-side rendering
 
Webpack: your final module bundler
Webpack: your final module bundlerWebpack: your final module bundler
Webpack: your final module bundler
 
Advanced WordPress Development Environments
Advanced WordPress Development EnvironmentsAdvanced WordPress Development Environments
Advanced WordPress Development Environments
 
Responsive Design with WordPress (WCPHX)
Responsive Design with WordPress (WCPHX)Responsive Design with WordPress (WCPHX)
Responsive Design with WordPress (WCPHX)
 
Tooling, theming, made easy
Tooling, theming, made easyTooling, theming, made easy
Tooling, theming, made easy
 
Forget Grunt and Gulp! Webpack and NPM rule them all!
Forget Grunt and Gulp! Webpack and NPM rule them all!Forget Grunt and Gulp! Webpack and NPM rule them all!
Forget Grunt and Gulp! Webpack and NPM rule them all!
 
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
 
Presentation of JSConf.eu
Presentation of JSConf.euPresentation of JSConf.eu
Presentation of JSConf.eu
 
Cut your hair and get an azure webjob
Cut your hair and get an azure webjobCut your hair and get an azure webjob
Cut your hair and get an azure webjob
 
Complete MVC on NodeJS
Complete MVC on NodeJSComplete MVC on NodeJS
Complete MVC on NodeJS
 
Webpack slides
Webpack slidesWebpack slides
Webpack slides
 

Similar to Automating WordPress Theme Development

Javascript is your (Auto)mate
Javascript is your (Auto)mateJavascript is your (Auto)mate
Javascript is your (Auto)mateCodemotion
 
Get Grulping with JavaScript Task Runners (Matt Gifford)
Get Grulping with JavaScript Task Runners (Matt Gifford)Get Grulping with JavaScript Task Runners (Matt Gifford)
Get Grulping with JavaScript Task Runners (Matt Gifford)Future Insights
 
What makes me "Grunt"?
What makes me "Grunt"? What makes me "Grunt"?
What makes me "Grunt"? Fabien Doiron
 
Single Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StorySingle Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StoryKon Soulianidis
 
Front End Development Automation with Grunt
Front End Development Automation with GruntFront End Development Automation with Grunt
Front End Development Automation with GruntLadies Who Code
 
Tooling per il tema in Drupal 8
Tooling per il tema in Drupal 8Tooling per il tema in Drupal 8
Tooling per il tema in Drupal 8Wellnet srl
 
Grunt & Front-end Workflow
Grunt & Front-end WorkflowGrunt & Front-end Workflow
Grunt & Front-end WorkflowPagepro
 
CoffeeScript: A beginner's presentation for beginners copy
CoffeeScript: A beginner's presentation for beginners copyCoffeeScript: A beginner's presentation for beginners copy
CoffeeScript: A beginner's presentation for beginners copyPatrick Devins
 
Workflow automation for Front-end web applications
Workflow automation for Front-end web applicationsWorkflow automation for Front-end web applications
Workflow automation for Front-end web applicationsMayank Patel
 
The new static resources framework
The new static resources frameworkThe new static resources framework
The new static resources frameworkmarcplmer
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOpsОмские ИТ-субботники
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLP Community
 
Introduction to Express and Grunt
Introduction to Express and GruntIntroduction to Express and Grunt
Introduction to Express and GruntPeter deHaan
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012Carlos Sanchez
 
Web development - technologies and tools
Web development - technologies and toolsWeb development - technologies and tools
Web development - technologies and toolsYoann Gotthilf
 
Practical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails AppPractical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails AppSmartLogic
 
Grunt understanding
Grunt understandingGrunt understanding
Grunt understandingKhalid Khan
 

Similar to Automating WordPress Theme Development (20)

Javascript is your (Auto)mate
Javascript is your (Auto)mateJavascript is your (Auto)mate
Javascript is your (Auto)mate
 
Get Grulping with JavaScript Task Runners (Matt Gifford)
Get Grulping with JavaScript Task Runners (Matt Gifford)Get Grulping with JavaScript Task Runners (Matt Gifford)
Get Grulping with JavaScript Task Runners (Matt Gifford)
 
What makes me "Grunt"?
What makes me "Grunt"? What makes me "Grunt"?
What makes me "Grunt"?
 
Grunt All Day
Grunt All DayGrunt All Day
Grunt All Day
 
Single Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StorySingle Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle Story
 
Front End Development Automation with Grunt
Front End Development Automation with GruntFront End Development Automation with Grunt
Front End Development Automation with Grunt
 
Tooling per il tema in Drupal 8
Tooling per il tema in Drupal 8Tooling per il tema in Drupal 8
Tooling per il tema in Drupal 8
 
Grunt & Front-end Workflow
Grunt & Front-end WorkflowGrunt & Front-end Workflow
Grunt & Front-end Workflow
 
CoffeeScript: A beginner's presentation for beginners copy
CoffeeScript: A beginner's presentation for beginners copyCoffeeScript: A beginner's presentation for beginners copy
CoffeeScript: A beginner's presentation for beginners copy
 
Workflow automation for Front-end web applications
Workflow automation for Front-end web applicationsWorkflow automation for Front-end web applications
Workflow automation for Front-end web applications
 
The new static resources framework
The new static resources frameworkThe new static resources framework
The new static resources framework
 
GruntJS + Wordpress
GruntJS + WordpressGruntJS + Wordpress
GruntJS + Wordpress
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App Development
 
Introduction to Express and Grunt
Introduction to Express and GruntIntroduction to Express and Grunt
Introduction to Express and Grunt
 
From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012From Dev to DevOps - Codemotion ES 2012
From Dev to DevOps - Codemotion ES 2012
 
Web development - technologies and tools
Web development - technologies and toolsWeb development - technologies and tools
Web development - technologies and tools
 
Practical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails AppPractical Chef and Capistrano for Your Rails App
Practical Chef and Capistrano for Your Rails App
 
Grunt understanding
Grunt understandingGrunt understanding
Grunt understanding
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 

Recently uploaded

Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...SUHANI PANDEY
 
( Pune ) VIP Pimpri Chinchwad Call Girls 🎗️ 9352988975 Sizzling | Escorts | G...
( Pune ) VIP Pimpri Chinchwad Call Girls 🎗️ 9352988975 Sizzling | Escorts | G...( Pune ) VIP Pimpri Chinchwad Call Girls 🎗️ 9352988975 Sizzling | Escorts | G...
( Pune ) VIP Pimpri Chinchwad Call Girls 🎗️ 9352988975 Sizzling | Escorts | G...nilamkumrai
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)Delhi Call girls
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445ruhi
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...SUHANI PANDEY
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"growthgrids
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...SUHANI PANDEY
 
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceReal Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceEscorts Call Girls
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceDelhi Call girls
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Delhi Call girls
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...SUHANI PANDEY
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC
 
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...SUHANI PANDEY
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋nirzagarg
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdfMatthew Sinclair
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...SUHANI PANDEY
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirtrahman018755
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...SUHANI PANDEY
 

Recently uploaded (20)

Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
Yerawada ] Independent Escorts in Pune - Book 8005736733 Call Girls Available...
 
( Pune ) VIP Pimpri Chinchwad Call Girls 🎗️ 9352988975 Sizzling | Escorts | G...
( Pune ) VIP Pimpri Chinchwad Call Girls 🎗️ 9352988975 Sizzling | Escorts | G...( Pune ) VIP Pimpri Chinchwad Call Girls 🎗️ 9352988975 Sizzling | Escorts | G...
( Pune ) VIP Pimpri Chinchwad Call Girls 🎗️ 9352988975 Sizzling | Escorts | G...
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceReal Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 

Automating WordPress Theme Development

  • 1. Automating Theme Development Process @HardeepAsrani
  • 2. I’m Hardeep Asrani ➤ Pirate at ThemeIsle.com ➤ WordPress Plugin/Theme Developer ➤ Part of WordPress Theme Review & Support Team ➤ Part of Kanpur FOSS Community And I’m Wapuu Saa!
  • 3. Are you a developer?
  • 4. Do you Automate your tasks?
  • 5. Why Automate? What can it do for me?
  • 6. ➤ Faster and error-free development ➤ More time to focus on development and logic ➤ More time == More money ➤ Cool lagta hai
  • 7. What can you Automate?
  • 8. All the Repetitive Tasks: ➤ Compile SASS, LESS, Stylus, etc. ➤ JSHint/ESLint ➤ Concatenate and Minify Assets (CSS & JS) ➤ Compress Images ➤ Code Sniffing ➤ Visual Regression ➤ Generate Pro/Lite versions from the same theme ➤ And more…
  • 9. What do you need?
  • 11. # Update Advanced Package Tool $ apt-get update # Install cURL, if not installed $ apt-get install curl # Download nodejs Package $ curl -sL https://deb.nodesource.com/setup_6.x | bash - # Install nodejs $ apt-get install -y nodejs # Initialize Project $ npm init
  • 15. Nesting .footer {     text-align: center;     background: #343434; } .footer .icons {     color: #000000;     float: left; } .footer {     text-align: center;     background: #343434;     &.icons {         color: #000000;         float: left;     } }
  • 16. Mixins .btn-blue {     color: #3FA2F7;     width: 100px;     height: 50px;     text-align: center;     text-transform: uppercase;     font-weight: bold; } .btn-black {     color: #000;     width: 100px;     height: 50px;     text-align: center;     text-transform: uppercase;     font-weight: bold; } @mixin button {     width: 100px;     height: 50px;     text-align: center;     text-transform: uppercase;     font-weight: bold; } .btn-blue {     color: #3FA2F7;     @include button; } .btn-black {     color: #000;     @include button; }
  • 17. And more, like functions and extend.
  • 18. Installing SASS # Install Ruby $ apt-get install ruby-full # Install SASS $ gem install sass # Check SASS Version $ sass -v # Compile SASS $ sass --watch input.scss output.css
  • 22. # Install Grunt $ npm install grunt # Install Grunt CLI $ npm install -g grunt-cli # Install SASS Grunt Task $ npm install grunt-contrib-sass --save-dev
  • 23. module.exports = function(grunt) {          grunt.initConfig({         sass: {             dist: {                 files: {                     'main.css': 'main.scss',                 }             },         }     });          grunt.loadNpmTasks('grunt-contrib-sass');     grunt.registerTask('default', [’sass’]);      }; Gruntfile.js
  • 24.
  • 25. JSHint/ESLint # Install JSHint $ npm install grunt-contrib-jshint --save-dev Write error free JavaScript.
  • 26. module.exports = function(grunt) {          grunt.initConfig({         jshint: {             files: ['Gruntfile.js', 'assets/js/*.js'],             options: {                 globals: {                     jQuery: true                 },                 ignores: ['assets/library/*.min.js']             },         }     });          grunt.loadNpmTasks('grunt-contrib-jshint');     grunt.registerTask('default', [‘jshint’]);      }; Gruntfile.js
  • 27.
  • 28. # Install Babel & Babel Grunt Task $ npm install --save-dev grunt-babel babel-core babel-preset-env Use next generation JavaScript, today.
  • 29. module.exports = function(grunt) {          grunt.initConfig({         babel: {             options: {                 sourceMap: true,                 presets: ['env']             },             dist: {                 files: {                     'dist/script.js': 'src/script.js'                 }             }         }     });     grunt.loadNpmTasks('grunt-babel');     grunt.registerTask('default', 'babel');      }; Gruntfile.js
  • 31. ➤ PHP Code Sniffer: https://github.com/squizlabs/PHP_CodeSniffer ➤ PHP Code Sniffer Grunt Task: https://github.com/SaschaGalley/grunt-phpcs ➤ WordPress PHPCS Standards: https://github.com/WordPress-Coding-Standards/ WordPress-Coding-Standards ➤ PHPUnit: https://github.com/SaschaGalley/grunt-phpunit ➤ PHP Code Beautifier and Fixer: https://github.com/mducharme/grunt-phpcbf ➤ PHP Lint: https://github.com/jgable/grunt-phplint
  • 32.
  • 33. Make Your CSS Work on all Browsers # Install PostCSS $ npm install grunt-postcss --save-dev # Install WP-CSS $ npm install grunt-wp-css —save-dev ➤ Add vendor prefixes to CSS rules using values from Can I Use. ➤ Enforce consistent conventions and avoid errors in your stylesheets with stylelint. ➤ Write stylesheet according to WordPress CSS coding standards.
  • 34. Compress Images + Minify CSS/JS Speed-up your WordPress Theme # Minify images using imagemin $ npm install --save-dev grunt-contrib-imagemin # Minify JS with Uglify $ npm install grunt-contrib-uglify —save-dev # Minify CSS $ npm install grunt-contrib-cssmin —save-dev
  • 35. And the most boring important task…
  • 36. Generate Translation (POT) File Make your theme translatable. # Check your code for missing or incorrect text-domain in gettext functions $ npm install grunt-checktextdomain --save-dev # Geenrate POT File $ npm install grunt-wp-i18n --save-dev
  • 37. All these tasks with one command.
  • 38. The Workflow is Reusable
  • 40. Tired of making different Lite/Pro versions?
  • 41.
  • 42.
  • 43. PHP 5.6 HHVM PHP 7.1 PHP 5.3 PHP 7.0 PHP 5.2
  • 44.
  • 46.
  • 47. Overview ➤ Find tasks that can be automated. ➤ Setup a grunt/gulp task to automate it. ➤ Build your workflow. ➤ Reuse it.
  • 48. Resources ➤ nodejs: https://nodejs.org/en/ ➤ npm: https://www.npmjs.com/ ➤ Grunt: https://gruntjs.com/ ➤ Sass: http://sass-lang.com/ ➤ Babel: http://babeljs.io/ ➤ Grunt Tasks: https://gruntjs.com/plugins ➤ Travis CI: http://travis-ci.com/
  • 49. Thank you ➤ Twitter: @HardeepAsrani ➤ Github: https://github.com/HardeepAsrani/ ➤ Website: http://www.hardeepasrani.com/ You’re welcome.