Coder Social home page Coder Social logo

bharatkambariya / coding-best-practices Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wptrainingteam/coding-best-practices

0.0 2.0 0.0 19 KB

Focus on good WordPress code, with semantic markup and WordPress. The principles in the lesson are valid for all code.

License: GNU General Public License v3.0

coding-best-practices's Introduction

Coding Best Practices

Description

Teach WordPress Coding Best Practise. Focus on good WordPress code, with semantic markup and WordPress. The principles in the lesson are valid for all code. As a sample the class will code a plugin with a "Hello World" shortcode. The plugins can display an image, and the text strings will be translation ready.  

Prerequisite Skills

The intended target group is undergraduates, with:

  • Basic knowledge of HTML5.
  • CSS3.
  • JavaScript, and
  • PHP

The students should have at least some knowledge about the topics listed above. They don't have to know each and every detail.

Objectives

  • How to plan the markup for a custom WordPress loop?
  • How to add the WordPress PHP snippets, like the_author() etc.
  • How to comment on your markup and your PHP.
  • Learn to write readable, and beautiful code.
  • Link correctly to images.
  • Make translation ready text strings.
  • Knowledge of best practice.

Assets

A bulleted list of linked files/materials the instructor needs to teach the module.

More about WordPress coding standards:

Screening Questions

In order to complete this lesson you need:

  • A local server with Apache, MySQL, and PHP ( read: Xampp, Wamp, Mamp, Lamp or similar )
  • Is your server up and running? ( try: http://localhost/ )
  • Open WordPress in a browser: http://localhost/wordpress ( or whatever localhost address you've used )

If WordPress is up and running it's ok. If not:

  1. Check that Xampp or similar is on.
  2. Check that Apache is running.
  3. Check that MySQL is running.
  4. Try to load http://localhost/wordpress  again.

Mac, Unix and Linux users should make sure, that the wp-config folder is read-and-writable for _everyone. _Otherwise you may not be able to edit your files, or install themes and plugins. I you don't know whether you can read / write or not, try this: open ../wp-config/plugins/ and create a file, give it the name z.txt or similar. If you're allowed to create the file, it's ok. Since you probably don't want the file any more, delete it again. If you can't create the file, check the folder settings.

Teacher Notes

A bulleted list of any handy tips or information for the instructor.

  • In general students with Mac computers have difficulties wih read-write-permissions.
  • Go to the students with a Mac, and make sure that the folder wp-config is readable and writable.
  • Also make sure that all the permissions are redundant ( i.e. the permissions must be valid for all files and folders inside wp-config ).

Hands-on Walkthrough

The lesson, written in script form with screenshots and live demo instructions to be used by the instructor in a live classroom/workshop setting.

Section Heading for Walkthrough

You will likely need to break down the walkthrough into sections.

Exercises

These are short or specific activities that test an understand and help you practice certain components of the lesson. They should not be fully scripted exercises, but rather something that you would do on your own. For example, you can create an exercise based on one step of the hands-on walkthrough. Exercise name Short description of what the exercise does and what skills or knowledge it reinforces.

  • Short point or step of the exercise
  • And another.

Quiz

A short quiz for students to evaluate their retention of the material presented. Write out the question.

  1. Option
  2. Option
  3. Option
  4. Option

Answer: 3. Correct answer

Quiz

What is the best way to use else if condition.

  1. else if
  2. if else
  3. elseif

Answer: 3. Correct answer because else if is not compatible with the colon syntax for if|elseif blocks. For this reason, use elseif for conditionals.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.