Announcements
In today’s episode, we break done some of the key phrases and terminology in WordPress.
Review of Page Builder Plugins
Is there a plugin for that?
With more than 43,000 plugins in the WordPress repository, it’s hard to find the perfect one. Each week, I will highlight an interesting plugin form the repository.
For more great plugins, download my 50 Most Useful Plugins eBook.
Give allows you to start accepting donations on WordPress with Give.
WordPress from A to Z
WordPress Core Concepts: CMS, Multisite network, plugin, theme.
Content types: attachment, category, page, post, post format, post type, tag, taxonomy, term, revision.
File types: child theme, config file, functions file, include file, stylesheet, template file, template hierarchy, template part.
WordPress Data: database, database table, loop, metadata, query.
Permissions: capability, role.
Security: NONCE keys, SALT keys, sanitization, validation.
WordPress Core Concepts
CMS
A CMS, or Content Management System, is a system that lets users add content to a website without having to directly code that content into web pages. A CMS uses a database to store content and then a set of files which will be used to output that content into a web page.
Multisite Network
A Multisite network is a network of sites sharing one WordPress installation. By activating Multisite you can host as many sites on your WordPress installation as you need, from two to millions.
Plugin
A plugin is a set of code that adds extra functionality to your WordPress site. This could be as simple as changing the login logo or as complex as adding e-commerce functionality.
Theme
A theme is a set of files that WordPress uses to output content. It will always include at least two files: style.css and index.php. The stylesheet is necessary as it includes essential information about the theme and also adds styling to your site. The index.php file includes code such as the loop which is used to fetch data from the database and display it on the page.
Content Types
Attachment
An attachment is a file which you upload to a page or post in your site. It could be an image, video or audio clip which you embed in your content, or it could be a file which is accessed by a clickable link that WordPress creates when you upload the file.
Category
Category is an in-built taxonomy that comes with WordPress, that you can use to classify your posts. Categories are hierarchical, which means they can have parent and child categories.
Page
A page is a post type that comes as default with a standard WordPress installation. Use it for static content that you don’t need to list in your blog page or elsewhere on the site.
Post
This is where things can get confusing. A post is a post type, but can also be used to refer to all post types. For users the term ‘Post’ normally means the post type you use to create blog posts, articles, updates etc. For developers it can be used to describe all posts contained in the wp_posts table, including posts, pages and more.
Post Format
Post format is a taxonomy that you can use to display your posts in different formats. By creating template files for different post formats you can show things like video, quotes, images and text differently. This isn’t used much any more.
Post Type
Post types are different types of content that you use for different purposes. WordPress comes with a number of post types available to you by default. These are:
Posts
Pages
Attachments
Navigation menu items
Revisions
Tag
Tag is a built-in taxonomy within WordPress. Use it to identify posts on specific topics, in more detail than you would with categories.
Taxonomy
A taxonomy is a classification of your posts (of whatever post type). WordPress comes with four built-in taxonomies:
Categories
Tags
Post formats
Link categories (not use anymore)
Term
A term is an item in a taxonomy. So if you’ve added some categories to your posts, each of those categories is a term in the category taxonomy.
Revision
A revision is a version of a post (or page etc.) that’s stored in the database in case you need to revert to it at a later date. This can be useful if you accidentally delete some content for your post or something else goes wrong.
File Types
Child Theme
A child theme is a theme which you use to add extra code to a parent theme. If you want to edit a theme you’ve bought or installed from the theme directory you should always use a child theme to do this, instead of editing the theme directly. This is because any changes you make to the theme will be lost when it’s updated.
Config File
The config file, or wp-config.php, defines how your WordPress installation is configured. It’s sometimes edited by WordPress itself as you make changes in the admin screens, or you can edit it directly (with care!).
Functions File
The functions file, or functions.php, is a file in a theme that doesn’t display content on pages. Instead, you use it to add functionality to your theme.
Include File
An include file is a file you add to a plugin (or sometimes a theme) to hold code separately from the main plugin file. It can be useful to do this when adding a large amount of code to add specific functionality.
Stylesheet
The stylesheet is a theme file which includes all of the CSS styling for the theme or all visuals for your site.
Template File
A template file is a file within your theme that’s used to output content on a page of your site. Every theme must include one template file: index.php.
Template Hierarchy
The template hierarchy is the system WordPress uses to identify which template file to use when displaying a given page on a site.
Template Part
A template part is a theme file that contains the code for just one part of a template file. You use this to store code that you want to use in multiple template files, such as the header (header.php), sidebar (sidebar.php) and footer (footer.php). You can call each of these with getheader(), getsidebar() and get_footer() respectively, in your template files.
WordPress Data
Database
The database stores all of the data relating to your WordPress installation. This will include content (posts, pages, attachments etc.), user data and options such as configurations you’ve made to plugins.
Database Table
A table in the WordPress database holds a specific kind of data. For example, wp_posts holds data relating to posts (which includes all post types, not just Posts).
Loop
The loop is the code in your theme that queries the database and fetches and outputs the current post. For a single post or a page it will run once while on an archive page it will loop repeatedly until all relevant posts have been output.
Metadata
Metadata is data about data. WordPress stores posts (and pages, attachments etc.) in the wp_posts table in the database. Fields in this table are limited to a predefined list including the post title, post content, date it was created, its status and excerpt.
But what if you want to add extra data to your post that isn’t covered by one of those fields? That’s when you need metadata, sometimes referred to as custom fields.
Query
WordPress runs a query every time it access the database and fetches content to output. So every page on your site will be populated by a query, which is coded via the loop.
Permissions
Capability
A capability lets a user perform a given action, such as editing posts (editposts) or installing plugins (installplugins).
Each user role has a defined set of capabilities assigned to it, which define what some with that role can do. You can add or remove capabilities from roles using the addcap() and removecap() functions.
Role
A user role defines what that user is able to do on your site. The default roles that come with WordPress are:
Super Admin – can manage a Multisite network of sites (only relevant if Multisite has been activated).
Administrator – can manage a single site in a standard WordPress installation or a site within a Multisite network..
Editor – can publish and manage posts including other people’s posts. They can’t manage site settings.
Author – can write, publish and manage their own posts but no-one else’s.
Contributor – can write and manage their own posts but cannot publish them. They submit them for an Editor or Administrator to review and publish.
Subscriber – can’t add content but can view content you’ve restricted to subscribers or make comments if that’s restricted too.
Security
Nonce Keys
NONCE stands for Number used ONCE. It’s a number that can only be used once, normally within a URL. So, for example, if someone attempts to reset their password in WordPress they will be sent a link that includes a nonce. Once they’ve clicked on that link they can’t use it again. This means that someone else can’t use the same link to change their password again.
Use nonces to make your code more secure, for example when saving data via a plugin.
SALT Keys
SALT keys are added to your wp-config.php file to add a layer of security to your site. These are secret keys without which WordPress won’t work. There are four of them: AUTHKEY, SECUREAUTHKEY, LOGGEDINKEY, and NONCEKEY.
These work by preventing hackers from accessing the cookies that store data about your site (such as login credentials). You should refresh them on a regular basis – roughly every two months. Our security plugin like Defender makes this easy.
Sanitization
Sanitization is the process of cleaning input data before it’s saved. For example, if you add a meta box in the post editing screen with a text box, you use a sanitization function to ensure any text input to it is stored in the correct format.
So if you’re saving an email address, sanitization will ensure that it’s stored correctly and will come out of the database as an email address when it’s output elsewhere.
Sanitisation follows validation, which is about checking that inputs have been entered correctly.
Validation
Validation is the process of checking that data is valid before it’s saved to the database. You add validation functions whenever you’re coding some sort of input such as a text box.
Thank You!
Thank you to those who use my affiliate links. As you know I make a small commission when someone uses my link and I want to say thank you to the following people. For all my recommended resources, go to my Resources Page
View on YourWebsiteEngineer.com
view more