Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Tips for productive development in WordPress

Tips for productive development in WordPress

I've taken this talk at Ahmedabad WordPress Meetup to explain how to be productive while doing WordPress development.
- Summary
- WordPress Coding Standards
- General Coding Standards
- PHP Coding Standards
- HTML Coding Standards
- CSS Coding Standards
- Javascript Coding Standards
- Security - Biggest Concern
- Optimize Website
- Productive Tools (My findings)

Avatar for Mehul Gohil

Mehul Gohil

April 23, 2017
Tweet

More Decks by Mehul Gohil

Other Decks in Technology

Transcript

  1. SUMMARY ▪ WordPress Coding Standards – Mix it with blood

    ▪ Be at safer side with added security ▪ Lightweight & Optimized with fabulous speed ▪ Using Productive Tools for development
  2. WORDPRESS CODING STANDARDS ▪ Have you ever referred WordPress Coding

    Standards? ▪ 4 Types of coding standards provided by WordPress ▪ PHP ▪ HTML ▪ CSS ▪ JavaScript ▪ For more details, refer WordPress Coding Standards Guide
  3. GENERAL CODING STANDARDS ▪ Naming Conventions ▪ Always use braces

    for IF, FOR and Functions ▪ Prefer Yoda Conditions ▪ Proper Indentation and Commenting – Don’t Over Use ▪ Effective use of Single & Double Quotes ▪ Avoid Function & Variable Names Collisions
  4. PHP CODING STANDARDS ▪ Use elseif not else if ▪

    Never use PHP Shorthands ▪ Make sure you don’t have Trailing Spaces ▪ Formatting SQL Statements ▪ Ternary Operator – Test with Extra Care ▪ Never use @ and extract() ▪ Source: WordPress PHP Coding Standards
  5. HTML CODING STANDARDS ▪ Self Closing Elements ▪ Must Use

    Clever Attribution ▪ Source: WordPress HTML Coding Standards
  6. CSS CODING STANDARDS ▪ Proper Structuring ▪ Better Use of

    Selectors ▪ Effective use of CSS properties ▪ Improved use of Vendor Prefixes ▪ Use of WordPress defined CSS Classes ▪ Source: WordPress CSS Coding Standards
  7. JAVASCRIPT CODING STANDARDS ▪ Try to use OOPS concept ▪

    Multiline Statements – Use when necessary ▪ Give preference to Chained Method Calls ▪ Source: WordPress Javascript Coding Standards
  8. SECURITY – BIGGEST CONCERN ▪ Why to add security even

    WordPress is having its own Security? ▪ What are the reasons behind WordPress Sites getting hacked? ▪ Use of Predictable Passwords – 10 % Website Hacked ▪ Development of custom functionality in themes and plugins in an insecure way – 70% Website Hacked ▪ Use of Vulnerable Plugin – 22% Website Hacked ▪ Why do hackers target WordPress sites? ▪ How to harden security of WordPress sites? ▪ Follow WordPress Official Security Guide while going LIVE ▪ Use of Nonce for all custom forms ▪ Use of Sanitization functions for all the variables wherever necessary – Guide 1 and Guide 2 ▪ Replacing Default Salt Keys ▪ Use of plugins which are in active development mode
  9. OPTIMIZE WEBSITE ▪ Why to optimize? ▪ How to optimize?

    ▪ Best Standard to optimize – Google Page Speed ▪ Basic Understanding of Google Page Speed – Measurement & Calculations ▪ Points to work upon to optimize website ▪ Source: Google Page Speed - About
  10. PRODUCTIVE TOOLS – MY FINDINGS ▪ Base Theme ▪ Base

    Plugin ▪ How to divide functionality between Theme and Plugins?
  11. THAT’S ALL FROM MY END! Thank you so much Connect

    with me using ▪ Twitter: @mehul_gohil0810 ▪ GitHub: mehul0810 ▪ WordPress: mehul0810 ▪ Email: [email protected]