While working on my plugin, Tango Smileys Extended, I found that my traditional method of programming was not working out very well. I had grown accustomed to having full control over web based content by authoring completely by hand — using a generic text editor (previously Notepad, but more recently EmEditor) — which was becoming very tedious and time consuming. The most time consuming part was having to debug because of a typo or a missing semicolon or curly bracket. The most tedious part was looking through WordPress source trying to find which parameters are passed to a function and what is returned. I was on the lookout for a new editor which could at least help save time and avoid the simple bugs of missing punctuation or mistyped function and variable names. As it turns out, I already had one, except I had never installed it!
If you find yourself in need of a better PHP editor, especially if you’re working on WordPress plugins, I recommend you give phpDesigner 7 a try. It has helped me immensely with every issue I’ve had in creating and editing a WordPress plugin. Here’s how you can get it to help you:
Install phpDesigner 7
You can get a full featured trial version here. I don’t know if the core version has everything needed to follow this instructional, so I recommend getting the full version. The OS requirement is XP, Vista, or Windows 7, and I’ve found that it runs reliably on 64-bit versions. It may only be an issue with 64-bit versions, but I have found that the editor will lose focus after using code completion unless the program is run as Administrator. If you are running 32-bit versions of Windows Vista or Windows 7 and you find that code completion or auto completion causes phpDesigner to lose focus, just run it as Administrator and please leave a comment so I can update this post.
Create a New Project
Before you get started, you should make sure you download the version of WordPress for which you want to develop. I know WordPress 2.8.5 was just released, but for this instructional we will be using WordPress 2.8.4. You can get the current version (2.8.5) here. Once you have WordPress downloaded, extract the zip to an easy to remember location. I’ve chosen to use my desktop, but we’ll get into the reason for this later.
With a fresh copy of WordPress ready, launch phpDesigner and take a look at the start screen. If this is your first time launching phpDesigner, you’ll notice most of the window is blank. From here, we’re going to create a new project. In the menu bar, click Project → Project Manager or press F11. The Project Manager will open and give you several options. By clicking New, the New Project Wizard will open and guide you through the creation of a new project.
The New Project Wizard opens with a General options dialogue. Here, you should give your project a title — I recommend using the name of the plugin you are creating or editing — and provide a description of the project. The description is not required, but I find it helps to remember what the plugins is supposed to do when you haven’t edited it for a while. This should help you keep track of which plugins are updated, as you can later edit the description and add a reminder such as Edited On:
Clicking Next will take you to the Project Root dialogue. You should consider choosing a location and creating a new folder to become the home of your new plugin, unless you are editing an existing plugin — in which case, you should simply select that folder. Any files later added to the selected folder will be automatically included in your project.
Clicking Next takes you to the Libraries dialogue. Libraries are your friend here, as they allow you to access the functions, classes, and objects defined by other source code, such as the fresh copy of WordPress you just downloaded. Click the Add button and select the folder containing the WordPress files you extracted earlier. If you have other plugins or source files you want to be able to interact with, you can also add the folders containing those files and you’ll have access to those functions, classes, and objects as well. Once you’re done adding libraries, click Next.
The FTP Accounts dialogue will allow you to add the information needed for phpDesigner to access an FTP server and quickly update files. Since this isn’t important to what we’re doing right now, I’ve skipped this part. I recommend exploring this option later, since it will prove to be the fastest way to update, upload, and replace existing files on your host server.
The Next button takes you to the Filters dialogue. Filters let you select and/or exclude files that will be analyzed during the parsing of files. The parsed files include those added on the Libraries dialogue, as well as any existing files in the selected folder from the Project Root dialogue. I recommend keeping the default settings. Keep in mind, filters only affect which files are parsed, NOT which files are available to your project. Just because there are no image extensions listed doesn’t mean they won’t be accessible, it just means images won’t be analyzed for useful programming data.
Finally, clicking the Next button will lead you to the Summary dialogue. This will show you a breakdown of all files and libraries included in your new project. You’ll notice the top level item Test Project has two subfolders, Test Project and Libraries, with Libraries having a subfolder of wordpress-2.8.4. If the root folder for the project had contained any files to start with, they would be nested inside the Test Project folder. Clicking Finish will take you to the Edit Project dialogue, which is not important right now, so you can just click Ok and continue with the Project Manager.
Open Your New Project and Start Writing
The Project Manager dialogue now has a new Open button available. Select your new project and click Open to begin working on your new project. You’ll be returned to the start screen, with a few differences. To start with, you will be able to see the name of your opened project at the center of the phpDesigner status bar. Also, if it isn’t already visible, if you click the tab on the right pane labeled with a P, you’ll access the Project pane which should look just like the Summary dialogue from earlier. On the left, you can see a New File header and a list of file types you can create. By double-clicking on PHP, you’ll start a new PHP document which will serve as the base to your plugin. I’m not going to go into detail on how to write a plugin, but I’ll give you some insight as to what you can expect phpDesigner to do for you.
Code Completion
Error Highlighting and Function Insight
The Final Product
Once you’re done writing your new plugin, save the file in your project root folder. The example below is what my Test Project looks like after I’ve finished.
With any luck, you’ll get just as much use out of phpDesigner as I have, and you’ll have an easier time creating WordPress plugins — or programming any PHP — because of it.


















Tags:
Categories:
Related posts:
Leave a Reply
Tango Smileys Extended 2.5.6.1