Chủ Nhật, 21 tháng 2, 2016

Install wordpress Developer plugin

When you develop scenes or plugins it can be helpful to have WordPress tell you what is going on and when something is not working right. To make this possible, there are a handful of plugins that you can choose to install in your site for debugging purposes. All of these plugins have been bundled into one super plugin called Developer. Now, Developer is quite an unusual plugin. So, let me show you how it works. First, we go to the back-end of our WordPress site. Go to "Plugins" and "Add New". And, from here simply search for "Developer".And the first one you get, the one from Automatic, is the one you want to install.
When you activate the Developer plugin, you get this pop-up that asks you, what kind of development you are going to be doing? Are you developing a plugin? A theme for a self-hosted WordPress installation? Or, a theme for WordPress.com VIP? So, in our case we are building a theme for a self-hosted WordPress installation. Save changes. 

And now the plugin will give you a long list of other plugins that it wants to install for you. And this is the whole purpose of the Developer plugin. Developer, is actually a plugin that prompts you to install a long list of other plugins so you don't have to source them out, one at a time.

These are all optional and you can choose to install them or not. And you can also choose to install them later on. I will not go into great detail about the different Developer plugins in this course, but they are worth installing and experimenting with as you progress through the course. And there are a couple that we're going to install right away. So, at the top here, we are going to install "Debug Bar". So, I will click install. Scrolling down, we are going to install "Monster Widget". Which, we are going to use later on in the course. We'll also use "Regenerate Thumbnails". And finally, "Theme Check".
Now, like I said, you can choose to install any of the other ones, if you want to, but for now let's leave it at these. Now I can click on "Get developing". And I'm just taken back to the plugin page. But, the Developer plugin has added a new feature to my site. So, if I go to "Tools", you will see you have a new option called Developer. And when you go to Developer you will see the same settings as before, only in a different display. So here at the top we can choose the project types. So,we are at "Theme for self-hosted WordPress installation". Then, you see all the plugins.
So here you see the Active ones and the Inactive ones. And at the bottom, you have some other information. Here, it says that " We recommend you set the following constants to true in your wp-config.php file." "WP_DEBUG" and "SAVEQUERIES". Then, under settings it recommends the following settings or configurations, which is "Pretty Permalinks", but this is now set by default in WordPress. So, you don't really have to do anything about it. And finally, you have a link to the Codex. And a link to the underscore starter theme. Which, we are going to be working with.
So, before we wrap up this movie, I'm going to do that one thing we haven't done yet. Which is set up these Constants, or in particular, this one "WP_DEBUG". You see right now WordPress is set to not debug itself. So will never get errors if there are any errors. To fix that we have to go into one of the configuration files in WordPress, in particular this one wp-config.php. To do all of this you need some form of code editor. I'm going to use Atom for this. This is the only time I will use Atom. But, it is currently my preferred simple code editor.
So, I will go to "File". Open the file. Then navigate to my Word Press installation and find "wp-config.php. " I'll open the file. And here you see this is the file that sets up WordPress to communicate with a database. So here I have database name, the username and password, and local host and of that other stuff. And if I scroll all the way to the bottom here, we find " define( 'WP_DEBUG', false) " And this is what I need to change. I'll change that to true. Save the file.
Go back and reload this Developer page. And now you see that WP_DEBUG is set. Now like I said, this is all we need for this course. So, you can also try to set SAVEQUERIES to true if you want to, if you want to see what's happening with the database queries. But, that is beyond the scope of this course. Now, what's actually happened when we installed all of these plugins within Developer, is we've gotten new features in WordPress. So if we run to the front end of the site, you will see up here in the tool bar we now have a Debug Bar that gives us information about what's going on in the site. We also have a direct link to Developer that takes us back to the Developer page.
And, as we move forward you'll see some of the other features we've installed. Having these Developer plugins installed can help you quickly identify and fix problems in your theme as you are developing it. My advice to you is to start with the key ones I pointed out during the install process. And then more later on if you want a more in depth analysis and more information.

Không có nhận xét nào:

Đăng nhận xét