Trevin Chow

Microsoft Group Program Manager and Seattle Photographer

Archive for the ‘wordpress’ tag

How to add Facebook’s Open Graph social plugins to your site

View Comments

I just finished my initial integration with Facebook’s Open Graph Social plugins for both this blog based on wordpress and my photo blog which is based on PixelPost.

Facebook’s documentation is definitely in it’s early stages because it’s very sparse in some areas, and lacks good cross-links to make the content easy to dig through.  Most of their documentation doesn’t even include a link to their Application center which is required to even get some of the social plugins to work since they require you to have an AppID.

Here’s a quick guide on what I did to get this running for the Like and Comments plugins for my photo blog. For wordpress, it was far easier since there are plugins for it.  I ended up using the FBLike plugin.

Read the rest of this entry »

Written by Trevin

April 25th, 2010 at 9:22 pm

Fix for WordPress “Allowed memory size exhausted” fatal error

View Comments

While trying to upgrade a few WordPress plugins, I got this error message:image

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes)  

After struggling with trying to fix this, I found a really easy solution – increase the WordPress memory allocation size from 32 MB to 64 MB.  To do this, edit your wp-settings.php and change line 13 from:

define('WP_MEMORY_LIMIT', '32M');

to

define('WP_MEMORY_LIMIT', '64M');

Simple, easy and delicious. No more memory issues for any plugin upgrades!

Written by Trevin

May 9th, 2009 at 4:10 pm

Posted in Technology

Tagged with , , , ,

Experimenting with new WordPress template

View Comments

After a rocking the Yaletown wordpress theme for a few years, I’ve decided to try out something different.  I wanted something a little simpler looking, and since I’m blogging mostly about photos these days, I wanted it to be based on a white background.

After digging around for awhile, I stumbled upon the Celeny theme which jumped out at me because it was 2 columns, ad-sense ready and supported widgets.

After installing it and mucking around with customizing it for my liking, I’ve got it in a state I’m reasonably happy with. The theme author didn’t do that great of a job allowing you to customize it through the WordPress UI. Instead, I had to dive into the PHP code and make changes directly which I always hate doing since future upgrades of the theme will cause me to lose all my customizations.

There are some layout problems on the sidebar currently that I still need to fix, but I figure before I invest time in doing that, I’ll rock the theme for a few weeks to see how my loyal blog readers like it, and also how adsense performs with the theme.  I’ve reduced the overall ads on the site to a single 250×250 adblock in the sidebar, so it will be interesting to see if fewer ads that are less intrusive will outperform my previous attempt.

Let me know what you think!

Written by Trevin

September 2nd, 2008 at 9:05 pm

Posted in Technology

Tagged with , , ,

Strange characters after WordPress upgrade

View Comments

After I upgraded my last wordpress installation on my blog and on Green Is Sexy, strange characters were appearing in our content throughout the site. There seemed to have been encoding problems with apostrophes (‘), quotation marks (“) and hyphens (-). They’d be displayed as question marks or ’.

Turns out that the fix is really simple. By default, the WordPress config files now set your character encoding to UTF-8. The solution is to open up wp-config.php file and located these lines:

define(’DB_CHARSET’, ‘utf8′);
define(’DB_COLLATE’, ”);

and either remove the “utf8″ string so the first line becomes:

define(’DB_CHARSET’,'');
define(’DB_COLLATE’, ”);

or you can just comment the lines out completely by prefixing each line with “//”:

//define(’DB_CHARSET’, ‘utf8′);
//define(’DB_COLLATE’, ”);

Problem solved!

Written by Trevin

September 19th, 2007 at 2:55 pm

Posted in Technology

Tagged with , , , ,

Windows Live Writer and 403 Forbidden error

View Comments

At any given time, I have at least 2 blog posts in draft form that I’m waiting to put the finishing touches on before publishing. I wasn’t originally a fan of using a rich blog client since I always wanted to roam the drafts and work on them from whatever computer I happen to be at. When Windows Live Writer (WLW) was first released, like a good Microsoft cog, I jumped on it to give it a try. Truthfully, I already had a huge bias against it due to my love for the roaming drafts.

 

However, to my surprise, I really, really liked Windows Live Writer. It made many of the tasks I struggle with regularly in authoring my posts, like embedding images that aren’t already remotely hosted. Windows Live Writer allowed me to author my posts very intuitively by enabling me to insert local images while I’m writing, and uploading them after I elect to publish the post. The post is then modified to have the image reference the new remote location.

 

Ever since falling in love with WLW, I was hoping they would release an update to fix some bugs I noticed as well as add new features. My wish came true on May 30th when The WLW team announced v2 was available for immediate download.

 

After eagerly downloading and installing it, I ran into a huge problem — I couldn’t even connect to my blog. I kept getting an obscure errror message that claimed I was getting a 403 Forbidden HTTP status code from the XML-RPC interface. I was able to hit the file directly without any trouble and verified that the file permissions were indeed correct. I was stumped. I did a web search and surprisingly I couldn’t find any information on it.

 

I emailed the Program Manager who works on the WLW team (perks of working at Microsoft I guess), and after a few emails, I was told to check if I had the Bad Behavior plugin installed (I do). It seems there is a bug in WLW v2 that makes it incompatible with that plugin.

 

The problem is documented by James McKay, who has a very simple fix. You just have to change the msie.inc.php file for the Bad Behavior plugin from this:

if (!array_key_exists('Accept', $package['headers_mixed'])) {
   return "17566707";
} 

to this:

if (strpos($package['headers_mixed']['User-Agent'], "Windows Live Writer")

    === FALSE && !array_key_exists('Accept', $package['headers_mixed'])) {

return "17566707";

}

After making this quick and painless change, WLW works now with my blog once again. Yipee!

Written by Trevin

June 24th, 2007 at 11:41 pm

Posted in Technology

Tagged with , ,

Get Adobe Flash playerPlugin by wpburn.com wordpress themes