Michael Silverman documenting innovation at work


How to Create a WordPress Plugin

Mike Example Plugin admin page.

Before creating a plugin it's helpful to determine the tools you need for your plugin to function and then determine how to integrate them into WordPress. In this guide I will be teaching by example. The plugin we will be creating is a simple post text replacement plugin. In the WP Admin panel we will be able to modify the search and replace parameters. We also will have a replacement color and toggle color. After some planning I've determined this plugin will require the following:

  1. jQuery : We need jQuery to toggle the class on our replacement text when clicked.
  2. Database : We need our settings stored permanently. Of course you already have a database set up for WordPress. We will use that.
  3. CSS : We will use two stylesheets, one for the admin side and one for the client side.
  4. Custom Javascript: We're going to place our code in a separate file to show you how to load JavaScript on the admin side and the client side.

As mentioned before we want the plugin to have an admin panel accessible from the WordPress panel. We also need to hook into posts/pages for our search matching.
The following are WordPress documents that are essential for reference when creating a plugin. It will prove useful to have them bookmarked and opened in your browser at all times.


Website Showcase: IAmMattSilverman.com


I'm becoming very good friends with WordPress. I just finished coding version 1.0 of IAmMattSilverman.com. A website for the talented Matt Silverman. Features of the site include facebook integration and a custom module for showcasing videos. Facebook integration was done using the Graph API and Real Time Updates. The real time updating proved to be a challenge. Facebook's documentation is not the best on this topic. I plan on creating a nice outline of the what you need to know and how to use it so look forward to that in the coming days. Meanwhile check out the website!

Filed under: Web 1 Comment

WordPress Template Design


These days I have been doing more web design and scripting than anything else. I recently finished designing a new website for Hillel at Northeastern University. Hillel is an organization I am very active in. I strongly believe in giving back to the community and this website is one of the ways I am able to do that. I'm currently working on customizing SugarCRM to fit our needs.

The backend of the website is WordPress. The template is fulled integrated into the admin panel. I may at some point outline the steps involved in making a template. In the meantime, you must check out Lynda.com. Their tutorials are amazing. This is the first WordPress template I designed. The video tutorial from Lynda answered many questions I had.

I would be happy to detail any WordPress template questions anyone has.

Check out the website!

Filed under: Web No Comments

Yahoo! Groups – An Outstanding Resource


I wish I had joined Yahoo! Groups earlier. For a while I have been researching Nixie Clocks. Along the way I heard of a newsgroup mentioned a couple times, but I never gave it much thought. I've recently completed many milestones into the design of my clock. And of course, as engineering projects always seem to go, there comes a point where research and implementation don't quite click in my head, and I need some specific help. I started having questions which I couldn't answer on my own and couldn't find asked elsewhere. I decided to give Yahoo Groups a try.

I joined the group NEONIXIE-L. At first I was a bit confused. I requested to join the group but I was not accepted. I got an e-mail from an administrator. He told me that in an effort to avoid spammers, I need to re-request to join, and I need to include a reason why I was joining the group. That was easy: "I'm an EE student building a Nixie clock playing with high voltages. I want to make sure I don't break anything/myself." That in itself was a good sign. You can't just join a million groups for no reason. When I started reading the posts I was even more impressed. I had no idea what these guys were talking about. I understand the terms they were using, but the actual logic, what? This was great! It was reminiscent of the saying, "You always want to surround yourself with people that are smarter than you." It was like reading a textbook, but directed towards the question at hand. For example, I recently asked a question related to reading serial data (tx/rx) on a PIC microcontroller. Not only was I given the abstract process, but also a code example in both C and Assembly. This is a response from member "nixiebunny" in NEONIXIE-L. I feel this is a good representation of the quality answers you will receive:

Re: [NEONIXIE-L] RS232 for GPS on PIC (help!)
 On 6/29/2010 8:12 PM, msilv3r wrote:
 > Now my question to you guys, on the PIC side of things.
 > -From my current understanding, I will have a byte by byte buffer.
 > This means I will have to do some type of compare with each  character.
 > I'm not sure how to do this.

 I've done serial communication with the 18F4520 in MCC18, but not with a
 16F in C. I have programmed a 16F873 in assembly language to do serial I/O.

 The serial port is simply a data register that contains the last byte
 received, and a status bit in the status register indicating that a
 data byte is  available in the data register.

 When the data register is read, then the status flag is automatically
 cleared until another byte is received. So you only have to test the status
 bit and read in the character to move data into your string array.

 Here's a rough idea of the C code:

 char the_char, string[80]; // storage for the string
 char *p; // point to where the next char goes

 p = string[0]; // point at first character's location
 while (!timeout) { // prevent hanging on missing EOL
 if (USART_status_bit) // reads the status register bit
 the_char = *p++ = USART_data_reg; // get the character
 [some timeout code]
 if (the_char == '\n') // detect end of line

 Don't assume that this will compile - it's rather off-the-cuff.

 The timeout code can just increment a counter and trigger the timeout thing
 when the count hits some big value corresponding to more than a second of
 real time. Without a timeout, your code will hang forever if there's a
 communication error.

 David Forbes, Tucson, AZ"

Another group I joined is called Homebrew_PCBs. Have you ever wanted to etch your own circuit board? This a great resource on how you can do that. I will be posting my success story on this process soon.

Here's why you should investigate Yahoo! Groups as a resource for you:

-Each post is moderated to keep out the spammers/nonsense.

-The contributing authors are often experts in the field. It seems to be an older crowd. Some are professionals in fields relating to the topic at hand.

-You will likely get an answer with more information than you need.


How to get your website listed under major search engines: Part I

Do you want your website to be on the first page of Google? Me too. The first step is to get your website submitted to the search engine(s) you want your website to appear on. Some of these "submission URLs" can be found easily while others are difficult. Here are the submission URLs for a few major search engines: Google - Bing!

There is no guarantee that after one submission your page will show up. I check the search engine every few days. If my website does not appear when using the domain name in the search (i.e www.msilverman.me) then I will resubmit the URL.

Now that you have your website indexed you want to increase your ranking. Of course you will attract more visitors being on the first page of Google rather than the tenth. There are many factors that contribute to your ranking.

Is it helpful to have your website linked to from other websites. For example, I'm currently working on Mark's Boxes Now. Now when Google searches my website it will see a link to Mark's Boxes Now. This will give Mark's Boxes Now a few points.

Another contributing factor are meta-tags. Meta-Tags are keywords. When a search engine crawls your website it will look for Meta-Tags. For Mark's Boxes Now I used the meta keywords: moving boxes, massachusetts, westborough, move, mover, moving supplies, book box, apartment move, packing supplies. You also want to include a Meta Description: moving boxes delivered within 24 hours! everything you need for moving! You can view your website's tags and others using this free Meta Tag Analyzer.

Google Webmaster Tools Dashboard shows a summary of your website.

Google Webmaster Tools is a great free service worth checking out. With Google Webmaster Tools you are able to view your website through the eyes of a search engine. You can see what users are searching for when they click your website via the "search queries" tool. It will also show you the most commonly used keywords on your website. As you can see, "boxes" is currently the most commonly used word on my website. That is a result of this post and all of the tags along with it. This is something which I will change because "boxes" aren't really what my site is about. It is important that you ensure that your sitemap is listed in the "site configuration." If not, you can submit it. The sitemap helps Google to index your website. I have my RSS Feed acting as my sitemap.

Another interesting statistic that you can see is what Google calls an impression. To view this, click on "Your site on the web"  and then "search queries."

"Search Queries" page shows extended information on how users are accessing your website.

At this page you can see useful information such as what queries have led to people clicking your website. Impressions are the number of times someone accesses a search page with your website listed. For example, someone typed in mobileme alternative and my website showed up. The avg position is 40 so it probably wasn't listed until a few pages in, lets say page 3. Now if you scroll through onto page 3, my link will show up. Whether or not you click on my link it will count as an impression.