WordPress Theme Standard

# style.css

  • Theme name must not use keyword like ‘WordPress’, ‘Theme’.
  • Text domain must be mentioned. Example: Text Domain: india
  • Theme URI and Author URI are optional. If used Theme URI link with the page of theme information and Author URI link with the author personal site or project development site. Avoid using ‘wordpress.org’ as Theme or Author URI.
  • License and License URI must be included.
  • Version of theme should be mentioned.
  • Theme Tags should be written.
  • Only three subject tags are allowed.(Example: Blog, Portfolio, Corporate)

# License

  • Always pay extra attention and make sure that the entire theme is GPL, or GPL-Compatible. This will include, fonts, scripts, images etc.
  • Check all given links for GPL license and sure all mentioned URL’s are GPL compatible.
  • External components without GPL license are not allowed.

# Security and Privacy

  • Don’t phone home without informed user consent.
  • Make any collection of user data “opt-in” only and have a theme option that is set to disabled by default.

# Sanitization and Validation

  • Sanitize every theme options used in the theme. You should always escape theme options while output.
  • Escaping URL for ensuring no additional texts & characters are there. Example: <a href=”<?php echo esc_url( home_url( ‘/’ ) ); ?>”>Home</a>
  • Escaping HTML for ensuring no additional texts & characters are there. Example: $html = esc_html( ‘<a href=”http://www.example.com/”>A link</a>’ );
  • Escaping text area & attribute for ensuring no additional texts & characters are there. Example: <?php esc_textarea( $text ); ?>
  • Escaping URL for image source. Example: <img src=”<?php echo esc_url( $image ); ?>

#Content Creation

  • Content Creation like Text area are not allowed on Customizer or Widgets.

# Theme Options

  • Settings API is not allowed on theme for Theme Options. Use Customizer API to implement theme options.
  • Only one subpage is allowed under Appearance menu. And that should contain relevant information about theme like documentation, user guide, etc.

# Language

  • Can use any language for text, but only use the same one for all text.
  • Themes are required to use as string as the text domain in translation functions.
  • Theme must be translation ready. All string need to be translate able. Example: ‘Category:’ it’s translation ready is <?php _e( ‘Category: ‘, ‘textdomain’ ); ?>
  • Text domain must be mentioned on ‘style.css’. It must match with the theme name. If theme name is “My India” its text domain is ‘my-india’.
  • ‘.pot’ must be inside the languages folder and name must be ‘textdomain.pot’.
  • Languages must be load on theme file by ‘load_theme_textdomain(‘textdomain’, get_template_directory() . ‘/languages’);’

# Readme

  • Make sure ‘readme.txt’ in is theme root directory.
  • If other file like ‘readme.md’,’theme-info.txt’ found on theme directory, recommended to use ‘readme.txt’ request to remove other files.
  • ‘readme.txt’ must contain theme info, license info, changelog , short theme description etc.

# Screenshot

  • No logo or mock up, should be of actual theme it appears.
  • Size no bigger than 1200*900px. Any 4:3 image size is accepted.

# Changelog.txt

  • If changelog is not maintained on ‘readme.txt’ it must maintained under the ‘changelog.txt’.

# Favicon

  • This is now core functionality, new theme should not add this feature.

# Site Logo

  • If logo feature is implemented, Logo must be changeable and be disabled by default.

# Plugins

  • No plugins are not allowed to bundle in the theme, but theme can recommend plugins and those plugins must be in dot org repository. Theme should work good without any plugin.

# Post Type

  • Custom Post types and taxonomies are not allowed.

# Shortcode

  • No shortcodes are allowed on theme.

# Style and Scripts

  • Theme must have ‘style.css’.
  • No hard coding of style and scripts are allowed. Style and Scripts need to be enqueued.
  • Use ‘get_template_directory_uri()’ instead of ‘get_stylesheet_directory_uri()’.
  • No minification of style or scripts files are allowed unless original files are provided.
  • If Google font is used, it should be enqueued. No other CDN urls are allowed.
  • Default Scripts Included and Registered by WordPress itself. No need to enqueue, like ‘jquery.js, masonry.js’ etc
  • Use dependencies on scripts to reduce conflicts.

# header.php

  • Proper DOCTYPE is needed.
  • The opening ‘<html>’ tag should include ‘language_attribute’.
  • Use ‘bloginfo()’ to set the ‘<meta>’ charset and description element.
  • Add a call to ‘wp_head()’ before the closing ‘</head>’ tag. Plugins use this action hook to add their own scripts, stylesheets, and other functionality.
  • ‘body_class()’must be inside the opening body tag.

Example: <body <?php body_class(); ?> >

  • Do not link the theme stylesheets in the Header template. Use the ‘wp_enqueue_scripts’ action hook in a theme function instead.

# footer.php

  • Use the ‘wp_footer()’ call, to appear just before closing body tag.

# Customizer API

  • ‘capability’ should be ‘edit_theme_options’ while using Customizer API for theme options.
  • ‘sanitize_callback’ is necessary for sanitizing customizer fields. For example: Sanitizing URL ‘sanitize_callback’ => ‘esc_url_raw’
  • Sanitizing Email ‘sanitize_callback’ => ‘sanitize_email’ etc.

# Code

  • add_theme_support( ‘title-tag’ ); must be included on functions.php. Title tag is not allowed in ‘header.php’. If <title><?php wp_title(‘|’); ?></title> found, it is not allowed because title tag already defined.
  • Prefix theme functions, classes, global variables, image size name, script and style handles, etc with the theme slug.

Example:

‘function textdomain_footer_copyright{

//code goes here

}’

  • No any PHP error & warning, Javascript’s console error, WordPress deprecated errors are allowed. Need to fix them.
  • Functions like ‘the_archive_title’ and ‘the_archive_description’ are now available in WordPress core. And thus, we don’t have to keep the backward compatibility for more than last two major versions. They must not be defined. Mostly they are defined in ‘template-tags.php’.

# Others

  • W and P of WordPress always in uppercase.
  • Remove out unnecessary commented code. If any file or folder is not being used, it should be removed.
  • It is not necessary to provide backward compatibility more the two major versions.
  • No customization in WordPress admin.
  • Redirection is not allowed after theme activated.
  • Custom CSS field is not allowed. It’s now core functionality. (Since WordPress 4.7)
  • It’s not allowed to remove the default functionality of core.

Are you programmer! You should adopt these programming habits

Since past one decade you would have noticed that there have been tremendous changes in the technological world. Everyday there is a new invention in the online technological world. These changes have opened up a vast hub of various options and opportunities to the businessmen. With the advent of internet there are many online businesses which are being established on a daily basis. The small businesses that have just entered the competitive market have got the most advantage of these technological changes. The most apt example is the web Technology.

Nowadays any small or large business needs to have a website in order to promote their products and services. You need to develop a website as per your requirement and needs. In order to develop the right website you need to take the help of a good Website programmer and that good programmer you can easily identify via his/her programming habits.

here I mention some useful points It will be helpful for all fresher programmers and they should adopt these following mention good programming habits.

Always write Comments for your written code

while programming the most important aspect is writing the code. Code readability is considered among the universal aspect in computer programming. It is through this programming the websites are created and shattered. If the programming of the various technical languages is done in the correct manner then you need not look backwards. The first step is proper documentation and commenting – the commenting code has to be proper. The integrated development environment has to be used in the proper manner. Next in coding is the indentation of the codes – there are different styles you can choose according to the requirement of your website. They are not very distinct from one another so they can be mixed and used as per your usage.

Appropriate and related variable name / method name

another sign of good programming habits is that you should use proper name and method in order to program the website. In order to develop the website the programming language used should have the requisite software and coding. Further to this the sub-division has to be set up for the individual project teams. Whenever you use the common code then you should preferably us the reusable components which are placed within a proper package. This package has to be named as per the component used in the programming language. The business objects are easily segregated using different domains and sometimes the product and service offerings which are felt appropriate during the time of programming.

Before start coding you should plan your code

when you decide to launch your business you would be having brilliant ideas for your Business website in your mind – now these ideas have to be formed into a proper website and this is possible by programmers who is perfect coder and have some good programming habits for perfect coding practice. It is always important that you plan your coding project well before you actually start programming the website. There are various stages which has to be followed in order to get the right coding hence planning in advance is very important before you start coding. The first step is to decide what you have to make – then set up a text editor and then the design.

Reading Codes and articles it will always help you

in case you are new to programming then the best idea is to read the codes already done before and also you should go through and review the articles on coding. This will give you better insight on coding the website in a better manner.

Never Stop Learning

the most important and effective programming habits is the process of learning. The process of learning never stops it keeps on increasing as you keep on studying.

hey Guys i hope this article will help you bit for your programming practice. you feel some more good habits you wanna add into above list! please place that all via comments.

Solution Of Common WordPress Problems

WordPress is all about making your life easier as a webmaster and it makes everything from choosing a design to adding new features much faster and more straightforward than it otherwise would be. But just because WordPress is designed to make life easier, that doesn’t always mean it’s completely without it’s issues and it certainly doesn’t mean nothing can ever go wrong. If you’re going to be using WordPress to run your site for the next several years, then in all likelihood you will run into at least one or two snags along the way.

Fortunately, WordPress also has the advantage of a huge community of users and developers. That is to say, that if you’ve encountered some kind of WordPress problem, then there’s a pretty good chance that other users will have as well and that you’ll be able to find instructions online for how to solve the problem.

Here then, we will look at some of the most common problems that WordPress users encounter and at the things you can do to solve them quickly and without incident.

WordPress Isn’t Loading

A problem that commonly affects WordPress users is that their site fails to load all together. This can of course be caused by a number of issues as it’s a pretty broad problem – however a common cause that’s actually very easy to fix is that you have plugins on your site that are not agreeing. Not all plugins are compatible with one another and if one is making a change to your site that the other doesn’t like, this can result in your site failing to load at all.

As you might imagine, the solution to this issue is as straightforward as the cause – it just requires you to uninstall one or more plugins. The easiest way to do this is by uninstalling all your plugins and then reinstalling them one at a time until you manage to reproduce the error and find the culprit.

You Can’t Get Into the Admin Panel

Only problem is, sometimes you won’t be able to reach your admin panel in order to delete plugins. Oh dear! In this case though, a handy solution is to use FTP or the file manager that your hosting service provides and to find a folder called ‘wp-content’. In here is a folder called ‘plugins’. Rename that and you can thus see your site again, plugin free!

Your Theme is Incompatible

Sometimes you can also face the dreaded white screen upon installing a new theme. When this happens, there’s thankfully once again a simple solution which is to rename the folder with the name of your theme, this time found under wp-content/’themes’. When installing new themes, always check that they’re compatible with your version of WordPress before going ahead.

Failed Upgrade

There’s one more possible cause for the ‘white screen of death’ and that’s that your WordPress update has failed mid-way through. When this happens, the solution is to install it manually. You can find how to do that by following these instructions.

You’ve Lost Your Password

If you lose your WordPress password, you can always request that a replacement be sent to your e-mail. However, in some unfortunate cases you’ll find that your e-mail never arrives, leaving you in a bit of a pickle. Thankfully, there’s a relatively easy solution.

That solution is to log in to your cPanel (assuming you’re using a hosting service that provides cPanel, then click on phpMyAdmin under Databases. From here, select your WordPress database, go to wp_users, click on browse and then find your Username. Click ‘edit’ and you’ll be able to add a new password by filing out the ‘user-pass’ form (case sensitive). You’re welcome!

Precautions

These steps can help you through some of the more common WordPress errors but you know what they say

prevention is better than cure

This is very true when running a website as even very brief downtime can be a serious problem when you’re trying to progress online. Not only does this create a bad impression on your visitors, it also negatively affects your Google ranking as Google sees it as a sign that your site isn’t reliable – it doesn’t want to send its users to sites that will be down or not working and risk that way damaging its own reputation!

Some useful precautions to follow then include:

  • Always read reviews of plugins before installing them
  • Try to avoid installing too many plugins whenever possible
  • Keep your version of WordPress up-to-date
  • Keep all your plugins up-to-date
  • Let professionals handle the larger and more complex updates
  • Look for plugins that can help, such as those that keep your database clean
  • Back up your files regularly – both manually and by using plugins and tools

Take these precautions, treat WordPress with a little caution and respect and you should find that problems are rare!