Trevin Chow

Microsoft Group Program Manager and Seattle Photographer

Archive for the ‘wordpress’ tag

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 , ,

Migrated from Yahoo Mail to GMail

View Comments

Background

In the past I’ve always been a big fan of hosting my own email server and accesing it by IMAP. However, as the years have gone on, my free time to administer the box has dwindled making email hosting very difficult. Luckily the revamped “web 2.0″ email services have gotten so good in the past few years, and with storage space increasing, there was less and less reason for me to do the hosting myself.

I’ve had the same personal yahoo email address for the past 5 years, so I’ve always dreaded the thought of moving to another email provider and managing that transition process. It would also be it especially painful to make the move again if I ever changed my mind to jump ship for yet another email provider.

Planning the move

4 months ago I acquired my own domain name, trevinchow.com, and made it my “new” personal email address along with hosting my own wordpress blog. To make things easier on myself, I ended up forwarding all emails to my yahoo.com account as I maneuvered through the transition process. Gradually, I was able to let all my friends know and update all my mailing list and e-commerce site subscriptions to the new @trevinchow.com email address.

I finally got to a point where I was comfortable abandoning my Yahoo mail since all the dependancies on it were down to either (a) spam or (b) spam. The real catalyst to this whole transition was the support that Google added for a custom/personal domain for email. Google essentially copy-catted the same service that Windows Live released in November 2005 .

Officially dubbed Google Apps, they provide hosted services for any domain you own and provide you a la carte services for email, IM, calendar, docs and spreadsheets and more. Their target market seems to be small and medium-sized businesses where running and maintaining their own local infrastructure would be much more costly. (I know that Google is trying to compete with Microsoft Exchange and Office in one fell swoop here by charging $50/user per year, but realistically I’m not sure how fruitful this will be for them. How many businesses would trust Google to store their sensitive business data?)

The sign-up process

I already had an existing “Google Account” for the same email address I wanted to use for the new Google App account, which was also tied to all sorts of existing services like Google Analytics and Adsense. I definitely expected this to be a troubling sign-up process.

I proceeded to the sign up process and I was pleasantly surprised by how simple and seamless it was. At no time did they give me an error message saying that I already had an existing account; they just processed my registration and everything seemed to be kosher. They gave me instructions on how to setup my MX record to point to their mail server to get hosted email. My webhoster, bluehost.com, makes adjusting MX records very painless through their administration interface so this was a snap.

After the sign-up process completed, I was pleasantly surprised that all my other services were still intact with no notable changes. Everything operated smooth like butter.

Transitioned!

Fast forward 24 hours and I’m fully on Gmail. Yes, it was fast transition process. I was most afraid the entire time about how I would migrate 5 years worth of personal email from Yahoo to Gmail. Turns out that since I’m a Yahoo premium subscriber, they unlock the POP3 interface for me. Gmail provided a really easy way for me to specify my Yahoo credentials and all my email was imported over the course of a few hours as it processed it in chunks of several hundred emails. Slick.

Overall I was extremely pleased at how easy the process was and so far I’m loving it. The obvious question right now is “Why not did you move from Yahoo?” and “Why not Hotmail?”. The biggest reasons:

  • Conversation threading
  • Lightweight interface
    • I love the quick loading and shortcut key driven interface
  • Extensions, extensions, extensions
    • There are so many freaking firefox extensions to modify the behavior of gmail which make it that much more compelling

The good

  • Quick, quick, quick
    • Wow this thing loads fast. Yahoo Mail was just a freakin’ dog when it came to page load times. They made it even worse with the Yaho Mail Beta which was supposed to speed things up with AJAX.
  • Shortcut keys
    • Nearly every operation you can think of has a shortcut key in Gmail. The bummer is that they are different from Hotmail and Yahoo mail so I have to re-learn then all. Let me tell you, it’s painful to not have ALT+S mapped to “send”, which is what it is in both Outlook and Yahoo Mail.
  • Greasemonkey scripts
    • Since I already had the greasemonkey firefox extension, I’m able to leverage some neat Gmail scripts that have been created:
    • Folders4Gmail
      • Create hierarchical labels. Works great with the above tip about using labels+auto-archive for folder emulation.
    • Gmail Beautifier
      • Remove ads (!) and makes the email pane wider
    • Gmail Reply to All
      • Adds “reply to all” button to all emails. Not even sure why Google doesn’t have this by default.
  • Google Talk integration
    • Their integration with Google Talk is VERY cool. Even though I’m still a diehard Windows Live Messenger fan, Google’s lightweight integration allows me to use it alongside of Messenger.
    • I love how the chat sessions are saved and searcheable the same way that email is. Slick.
    • I wish that Gmail was smarter when I imported my contact list. They should have seen all the contacts that has @gmail.com accounts and given me option of adding them to my quick contacts for easier chatting.

The bad

  • Spotty support (No Gmail mobile application support!)
    • As I try to access more and more Google services, I’m seeing the big seams in their support for my new account. I not only have a special login page, but I can’t use the java-based Gmail Mobile Application. When I try to login with my email address on the smartphone rich client, I get the error “Please enter your Gmail username and password, not an email address”. After some digging, I find out that they do in fact support Google App accounts, but only on Blackberries. Yeesh.
    • Among the great things that the Windows Live ID team has done, they go this scenario dead-on with 100% support. All the Live ID accounts created through Windows Live Custom Domains are full fledge Live IDs — in other words, they are completely supported like a non-custom domain. Google still has a lot of growing up to do it seems.
  • Lack of folders
    • Yes I know that you’re supposed to rely only on Labels in the gmail world. However, Google went too far in the other directions by eliminating folders. There are certain classes of emails that I do want to filter to separate folders out of my inbox view. For example, I’m on some mailing lists that I just don’t need to read all the time; once a week is enough. Why have these emails in my inbox? IMO, Google should have did what Outlook did — use labels coupled with folders and let users determine what works best for them. Personally I’d use a combo of both like I do in Outlook.
    • Luckily, my friend pointed out to me that you can effectively get folders by setting up filteres to “auto archive” emails that trip the filter after labelling it. This eliminates it from the inbox view, keeps the unread status but still retains the emails. Although it works, couldn’t Google just give me folders?
  • Lack of context menus and drag-n-drop
    • At some point, I got really used to (and liked) context/right-click menus and drag-n-drop in Yahoo mail and Hotmail. I don’t know when it happened but it did, and I never realized it. That is, until I moved to Gmail. I really miss not having to hunt around with my mouse for an action to click, but instead being able to right-click with my mouse and do that same action.

Gmail — the killer? Nope

Despite the anecdotal success stories you read about Gmail, it’s important to still keep in perspective the overall usage of Gmail compared to other email providers. Gmail’s userbase is paltry compared to the market leaders, Yahoo and Hotmail.

image
(from Mike Torres)
Closing thoughts
Having said all of this, one questoin is whether Gmail is for the masses? In my opinion, it’s a resounding “NO!“. I definitely would not recommend it for my mom, or even my brother for that matter. It is so different than traditional email applications and has features that a lot “regular” user doesn’t need (and missing some they do). My mom doesn’t care about labels and won’t understand (or care for) conversation threading. My entire family uses webmail and relies heavily on folders. I can only imagine trying to explain to them the auto-archive workaround to emulate folders — yikes!Overall I’m very pleased with my transition and probably won’t be moving back (or away) any time soon. If you have any tips on Gmail usage or any other Greasemonkey scripts I should be looking at, drop me an email or leave a comment.To sign-up for Google Apps, you can use the following link (referral):


Written by Trevin

May 14th, 2007 at 9:09 pm

Get Adobe Flash playerPlugin by wpburn.com wordpress themes