Recent Posts

Field Testing Social Graph Protocol Plugin Version 2.0.0

By: Adam Losier on in General, Plugins - No Comments

I know I said that version 2.0.0 was going to be released last week but I didn’t have quite as much time as I thought I would to work on it but this week I worked hard to iron out some of the bugs that it had and I’m glad to say that Today and Tomorrow I’m going to be testing version 2.0.0 on CodeHooks and making sure that every combination of open graph tags work correctly and most importantly that they all pass Facebook’s open graph debugger, if I don’t find any additional bugs I’ll do my best to push out the release tomorrow afternoon, once I write up the documentation for it but it could be pushed back to early next week sometime.

I would still like to add some additional form validation into the plugin but I think I’ll push out version 2.0.0 with what it has now and do the additional form validation at a later time, it’s not a big deal just as long as you input a URL when it asks you to input a URL or you input a number when it asks you to input a number.

Anyway just thought I’d let everyone know that it’s super close to being done, this update is the biggest one I’ve done to date, its pretty much a complete re-write of the entire plugin and hopefully I wont find any bugs today and early tomorrow so that I can get it out to you.

Read more…

Social Graph Protocol Plugin Update

By: Adam Losier on in General - No Comments

Well I’m almost ready to release version 2.0.0 of the Social Graph Protocol plugin and I’ve got to say this is pretty much a complete rewrite to the plugin, when I originally created the plugin it worked wonders and followed all appropriate methods of inserting the correct meta tags into your site but Facebook has upgraded the Open Graph so much since then that I had to really sit back and re-create a large portion of the plugin.

One of the biggest changes are meta tags that you are not allowed to associate with specific post types, for instance if you have set your type to article then you are not allowed to set any location, product, or business settings which you can do now using my plugin. That’s just one example of a change I had to make and it’s kind of a difficult one because if you’ve been using the plugin and have added location settings under an article type than I have to write code that goes through and removes what’s not allowed in such a way that is automated but at the same time not going to destroy any of the legitimate tags you have already created with a particular post.

Basically before I release this update I’m going to test the plugin as much as possible so when you update it, you won’t have to go back through to all your posts and re-write the settings you have now, it will automatically do everything for you.

I won’t get into too much detail just yet because a lot of the stuff I’m working on updating and fixing is changing quite often but I just wanted to give you a quick heads up that you should be seeing an update to the plugin in the near future, one that will destroy the old version ten times over, one update that is a MUST for you to do. Additionally after the update you’ll be able to use the Facebook Debug Tool to verify that your existing pages and new pages are correctly displaying your meta tags. If you use the tool now with the existing set-up your going to see a lot of errors and warnings, after the update you shouldn’t see any.

After the update and re-writing the documentation on version 2.0.0 I’m also going to do several posts explaining exactly how to use each and every last feature the plugin offers, things like how to get a video to show up on a users news-feed when they click the like button on your website as well as several others, there will be a lot of posts focusing on as much as possible, showing you what you can do with Movies, Tv Shows, Places, People, the list goes on.

So keep in touch and keep an eye out for the update, also if you have any thoughts on what might make the plugin great, please let me know in the comments below or if you just want to toss out any sort of idea’s on better ways to integrate Facebook and your blog let me know I might be able to work some of those idea’s into the plugin and help out a lot more people.

Creating a Facebook Login With WordPress

By: Adam Losier on in Tutorials - No Comments

Today I’m working on a theme that contains a WordPress user login and/or registration flow like the one you would find on Mashable when you click the user profile icon (See Image Below) and I thought it would make a good little tutorial for anyone creating a plugin or attempting to implement this functionality into there current WordPress website. Plus it gives me the opportunity to get another post out on the blog.

Mashable Login

The very first thing were going to do in this process is get acquainted with the Facebook API and documentation. Believe it or not Facebook has improved there documentation a lot over the years and it’s relatively easy to follow. Now before we jump into the WordPress side of thing’s your going to want to create a Facebook Application, for now this application is going to be used on my Localhost so my settings are as follows.

Read more…

My First Production Based Theme

By: Adam Losier on in General, Themes - No Comments

I don’t usually take the time to create and sell my own themes, mainly because for me it’s not very economical, I’m not a designer but I can create good designs it just takes me a long time to do so, my true skills lie in my ability to program. However recently I’ve created a theme that I intended to use on a gaming or movie review based website and now that it’s almost completed I realized that this theme looks and functions just as well if not better than a lot of crappy themes on the market that still sell for $50 bucks a pop.

So with this in mind I figured you know what I think I’m going to take this theme put some more work into it, get it to where it’s super easy for anyone to use but still flexible enough for an advanced WordPress user to find useful and attempt to sell it. So my goal for today is to add a wack load of theme options to it, clean up some of the styles I’m not really pleased with at the moment (The user comment section) and get it to a state where I feel it provides much more value to the person who is buying it than the price I’m asking for it.

I think I’ll put it up for $39.95 or somewhere in that price range, I may have to test some different prices to determine the sweet spot but I think it’ll be well worth the asking price. I also had the thought that with every theme purchase a theme technically looses it’s value because if you sell enough eventually your going to find another website out there using the exact same theme as you are and to me this is very unpleasant. I want to avoid this as much as possible so when I do start to sell it I think I’ll limit the sales to between four and five hundred.

Read more…

Creating Communities With WordPress: Update

By: Adam Losier on in General - No Comments

I just wanted to take a quick minute to update everyone on the “Creating Communities With WordPress” series that I’ve started, I realized I wrote the first post about this a few weeks ago and that may have been a bit early to do so but right now I’m just basically attempting to hack out a design for the website, I’m still in the very early stages and unfortunately have very limited time at the moment so don’t expect to see part two any time soon.

I would suspect that part two of this series is going to come out probably at the start of April if not mid April, part two will focus on the design and functionality of the site and part three will get into the programming of the site. This stage always takes a long time for me, I’m not a designer and hacking out a good solid design takes me far too long but nonetheless after the design is finished the project should pick up in speed.

In the meantime I might try to focus on the concepts behind creating a community with WordPress or I may even take the project on from a theory standpoint instead of working on the site and talking my way through the building process itself, I still need to attempt to hack out a specific theme or topic for Code Hooks as well so I definitely have my work cut out for me but hopefully in the coming weeks and months I’ll be able to focus on certain topics some more and begin to add some real value to the site.

Creating Communities With WordPress – Part 1

By: Adam Losier on in General, Tutorials - 5 Comments

Yesterday I wrote a post stating that I would be doing a series of tutorials about how to create a community driven website with WordPress and today I’ve decided not to waste an ounce of time in doing just that. Last night I was thinking about this quite a lot and I really want to offer a little of something to everyone possible, it doesn’t matter if your completely new to WordPress, building websites, making money on-line, search engine optimization, or programming, throughout this series there will literally be something for everyone.

The Goal

The goal is simple yet complex, build a community driven website. The concept is simple but the implementation can become complex. Basically I plan to take you through all the steps required to build a community driven website using WordPress and by everything I mean everything, from the outline to the design all the way through to making some cash. For the experienced Web Developer there won’t be a whole lot for you to sink your teeth into during the first quarter of this series so you may wish to skip a few parts but for the novice web developer it will probably be in your best interest to follow us from start to finish.

The Idea

All great websites start with an idea but you should know that ideas are a dime a million (not a dime a dozen) in this industry and they don’t mean squat if you can’t follow through and tweak them along the way. But for this series the idea for our website is going to be a community driven website around the car audio industry. Why the car audio industry? Well because I’m cheating, you see I already have experience in the car audio industry and in the past I’ve created a few slightly profitable websites pertaining to this topic so I know the potential is there. However this is not always the case, most times you have to do your research, check out the competition, and use your past failures to determine if your capable enough to gain a foothold in the industry of your choice.

Once you have the generalized idea down for your website it’s time to start making an outline. This is just my own personal thought process to building websites, it’s just how I like to do it and not necessarily how you would do it or how a company would do it and it’s not necessarily the correct way of doing it but it works for me so I stick with it.

Read more…

Creating Communities With WordPress

By: Adam Losier on in General - No Comments

Today I’ve been doing a lot of thinking about my past mistakes and one of the biggest mistakes I’ve probably ever made in developing websites was not building targeted community driven websites all those years ago, you see about 8 years ago (Before the time of Facebook, Pintrest, Social Networks) I always said to myself building websites that interact with a community and giving your website visitors the ability to create the content is going to be one of the best assets in the coming times.

Well guess what I was too stubborn to take my own advice and now I’m behind in the times sticking to my old methodology of being a content creator instead of a content enabler. But it’s never too late to start thinking outside the box again and I’ve decided to create a series of tutorials on how to build a WordPress website that enables user interactions and enables your users to be the main content drivers.

I know what your thinking, your probably saying hey we already have those tools it’s called BuddyPress, well yes and no, you see BuddyPress does some pretty interesting thing’s but I think it falls short of the overall goal, I’m talking about utilizing the core of WordPress to create a socially driven website, by that I mean using nothing more than what WordPress offers with minimal plugins and minimal hacks.

I’ve been experimenting with the WordPress login features and integrating it with Facebook and Twitter as well as handling your own user sign-ups and it’s really not that difficult to accomplish once you wrap your head around a few things.

Anyway this isn’t the start of the series but it’s just a head’s up as to what I’m going to be covering in the coming times, I’ll hopefully start soon I’m going to create it as a case study and provide you all with the ability to help shape the atmosphere of the challenge by giving my ideas on what features to include, ect… I’ll be diving into a lot of programming, seo and marketing along the way. The overall goal is to start from scratch and work my way up to a profitable website and showing all the steps in between.

P.S. I’m also going to be using this time to re-engineer the Social Graph Protocol plugin and to create some more useful tools along the way.

Status Update

By: Adam Losier on in General - No Comments

Well it’s been a little more than a month since I’ve written a post on my poor little website, I’m falling short of my goal of writing at least one article per day but anyhow I just wanted to take a moment and give you all a quick status update on what I’ve been working on. I’m in the process of launching a new website and if you’ve ever done that you know how much work it can be to do it right, it’s taken me away from my work on this website, not to mention that it landed in the middle of the holiday’s so that also put things on this end to a slow crawl.

Every now and again this will happen, but just know I do use the plugins I create on almost all of my websites so work on the Social Graph Protocol Plugin is still under-way but there will not be an patch or bug fix or feature release for at least another month, maybe two, until I get this other website up and off the ground and set aside some time to continue development on the project but if I’m giving the project a good in-depth look while I use it on the new website I’m launching.

Additionally I’m using WordPress again to launch this new site with and have been coming up with a lot of interesting way’s to use the software so hopefully I’ll be able to set aside some time to write up some more tutorials on how to use WordPress in new and interesting ways. But for now nothing new is really going on as I stated I just wanted to give you a little heads up that thing’s might get a little slow around here over the next month or so but I will find the time again to jump back in and start putting out some more articles, plugins, and updates.

How To Add An Image Stored On Another Server To Your WordPress Media Gallery Using A Plugin

By: Adam Losier on in Plugins, Programming, Tutorials - No Comments

Uploading an image to the WordPress media gallery is a pretty straight forward process and with WordPress 3.5 the process just got a whole lot nicer to look at, however, when creating a plugin to handle media uploads you may run into a couple of issues, like how to correctly attach an image programmatically, or how to correctly generate the meta-data for an image, the process becomes even more troublesome if you want to upload an image stored on another server.

That is what I’m going to show you how to do, how to upload an image that is stored on another server using your plugin and how to do it correctly (Well 90% correctly). Anyway let me toss the code at you and then I’ll talk about how each part of it works.

$image_to_upload = file_get_contents( $image_url ); // Downloads the image into a variable
$wp_filetype = wp_check_filetype( basename( $image_url ), null ); // Check image filetype
$wp_upload_dir = wp_upload_dir(); // Your uploads directories
								
// Save the image to the correct folder in the uploads directory
$image_path = $wp_upload_dir['path'] . '/' . $image_name . '.' .$wp_filetype['ext'];
$fh = fopen( $file_path, 'w' );
fwrite( $fh, $image_to_upload );
fclose( $fh );
								
$attachment = array(
    'guid' => $wp_upload_dir['url'] . '/' . $image_name . '.' .$wp_filetype['ext'],
    'post_mime_type' => $wp_filetype['type'],
    'post_title' => preg_replace( '/\.[^.]+$/', '', 'Title Of The Image' ),
    'post_content' => 'A brief description of this image',
    'post_status' => 'inherit'
);

$attach_id = wp_insert_attachment( $attachment, $image_path );
								
// Include the image.php file for the function wp_generate_attachment_metadata() to work
require_once( ABSPATH . 'wp-admin/includes/image.php' );
$attach_data = wp_generate_attachment_metadata( $attach_id, $image_path );
wp_update_attachment_metadata( $attach_id, $attach_data );
								
update_post_meta( $attach_id, '_wp_attachment_image_alt', 'Alt Text Goes Here' ); // Updates image alt text

// Updates image caption
$image_data = array();
$image_data['ID'] = $attach_id;
$image_data['post_excerpt'] = 'Enter a caption for your image.';
wp_update_post( $image_data);

Read more…

How To Login a User With a WordPress Plugin

By: Adam Losier on in Plugins, Tutorials - No Comments

On a recent website I’ve been building I wanted a simple and easy way for my users to sign-in to the site using there Facebook or Twitter accounts and after searching for a viable plugin I decided none of them were for me, so I decided to just build my own plugin to handle this type of login flow. However, after doing a variety of tests I discovered that the wp_signon() function can become a little bit of a pain in the ass and this post is about how to use the wp_signon() function as well as what to look out for.

First off using the wp_signon() function at first seems very straight forward it only takes in two basic arguments, the first is the user credentials like the username and password, the second is whether to use a secure cookie in the authentication process or not. The basic code to get this working is shown below.

$creds = array();
$creds['user_login'] = 'example';
$creds['user_password'] = 'plaintextpw';
$creds['remember'] = true;
$user = wp_signon( $creds, false );
if ( is_wp_error($user) )
   echo $user->get_error_message();

Read more…