Posted January 29th, 2007WordPress Plugins

This site was originally meant to be a place to share family news with an update or two about my WordPress plugins, but the plugins have quickly taken it over. So I’ve decided to move my plugins to their own site with integrated forums, making it easier to track questions and also to find news about each plugin where they will have their own sections and forums.

So update your bookmarks and links. Xinha4WP and any other plugins I write can now be found at:

http://plugins.baptiste.us

Hopefully that means this site will return to it’s original purpose - sharing family news (when I can find the time to post to it!) and not confusing relatives who see Xinha and think I learned a new language!

I’ve transferred over all the Xinha posts and pages to the new site. However, I’m going to leave them here as well along with all the comments that have been posted for future reference. I’ll just be closing the comments and pointing people to the new site. 

Posted January 24th, 2007WordPress Plugins

***NOTICE***

All plugin information has moved to http://plugins.baptiste.us
Comments are now closed. Please use the new forums instead

Now that WordPress 2.1 is out, I’ve had a couple of people note that Xinha4WP breaks after the upgrade. I’m knee deep in the development of another plugin so I haven’t had time to setup a 2.1 text environment and work on it. I hope to get a chance to do that this week. So if you rely on Xinha4WP - you may want to hold off on a WordPress 2.1 upgrade for now. I had checked the know gotchas for 2.1 and it didn’t look like we would hit any. Guess we did.

OK - I got WordPress 2.1 installed and Xinha4WP worked right out of the box. If you are having trouble with Cinha4WP after upgrading to WordPress 2.1, PLEASE post a comment with as much information as you can collect. Right now, it seems to be working fine for me so I can’t really tell what might be going on. I’ve only gotten two reports of problems so I think those may be separate issues. 

Posted December 14th, 2006WordPress Plugins

***NOTICE***

All plugin information has moved to http://plugins.baptiste.us
Comments are now closed. Please use the new forums instead

WordPress 2.1 is coming and there are some changes for plugins to deal with. Looking at what is changing and the Xinha4WP code, I don’t see any reason why Xinha4WP would not work on WordPress 2.1. I haven’t had a chance to install the 2.1 Alpha release and test yet (too busy fighting the spam floods), but I’m 99% sure it’ll be good to go. If any of you happen to be playing with 2.1, let me know if Xinha4WP works for you. I’d like to get it listed on the compatible page.
Posted December 11th, 2006WordPress Plugins

***NOTICE***

All plugin information has moved to http://plugins.baptiste.us
Comments are now closed. Please use the new forums instead

I’m working on a site that will likely have pictures in a lot of posts. I’ve installed Gallery2 and the WPG2 WordPress plugin, but what really makes WPG2 useful is the ability to include gallery pictures with G2Image. WPG2 includes the TinyMCE G2Image plugin by default, so you lose that when you use Xinha4WP.

G2Image was recently setup to be generic so it could be used in other applications. Since Xinha has such a robust plugin architecture, it shouldn’t be too hard to splice G2Image in. The tricky part won’t be inserting the WPG2 tags, it’ll be writing a filter so you SEE the images while editing, yet still save just the WPG2 tag. If I can’t get that going right away I may use G2Image to insert the actual <img src> HTML. We’ll see - my JavaScript is pretty rusty. 

Posted December 11th, 2006Technology

I just resolved a problem on my WordPress blog where anytime a person posted a comment (logged in or not), they got a blank page. I tried all sorts of stuff to fix it. Turned off all the plugins, changed themes, you name it. I quickly discovered that when the comment form was submitted, none of the form variables were available in the wp-comments-post.php script. When this happens, the post can’t be queried from the DB and you fail on Line 11 (comment_id_not_found). A quick bit of debug code and I found NONE of the form variables were in $_POST. Not good.

I figured maybe something was in the theme headers, etc so I created a simple form with a couple variables that would  post to wp-comment-post.php and it worked. Hmm. So I tried the other angle and created a comment post test script that dump the form variables and called it from my theme form file. The variables disappeared. Any theme, the variables vanished in my test script.

This had me totally confused. Why couldn’t I get basic form data into my form. Google returned a variety of ideas, but none that worked. Finally, I stumbled across a ticket for WordPress searching for ‘Blank Page on comments’ and someone had the same problem I did and for the same reason. It’s a doozy.

I’m one of those people who find the ‘www’ in URLs redundant. All my sites support them both, but from an SEO point of view, I’ve started ensuring www.mydomain.com permanently redirects to mydomain.com. When I setup this blog a few years ago, I had put in ‘www.baptiste.us’ in the blog configuration. A few months ago, I added a permanent redirect for www.baptiste.us to always go to baptiste.us. Everything worked as far as I could tell and since I don’t comment on my blog except to respond to new comments, well… That redirect and the blog settings BROKE the comments and I didn’t realize it for quite a while (I just figured nobody had anything to say :) ). Here’s why.

In WordPress theme comment files, the form ‘action’ variable includes the site url in front of wp-comments-post.php. So for my comment form, the action was set to http://www.baptiste.us/wp-comments-post.php, regardless of the theme I used. The problem is, the Permanent Redirect from www.baptiste.us to baptiste.us WIPES OUT the form variables, even though everything else seems to work. Silently. Now this may be due to session conflicts, etc, I’m not 100% sure.

But the solution was easy. I took out the ‘www.’ in my blog’s config so comment posts went to the ‘baptiste.us’ domain right away instead of www.baptiste.us and comments started working again.

Moral of the story - if you have a permanent redirect setup for your WordPress blog, be sure the desired domain is the domain set in the WordPress config. If you want everyone to end up at www.mydomain.com, you better have the ‘www’ in your WordPress config. If you want the www to always go away, make sure it’s not in your config either. Hopefully this post saves someone else the time and aggravation if they stumble into this trap.

So 3 days and nights of debugging on and off and all it took was updating two config variables in WordPress. Problem solved :)

Posted December 11th, 2006Family News
I apologize for comments being knocked out on the site for so long. I’ve fixed the problem - it was pretty obscure.
Posted November 16th, 2006WordPress Plugins

***NOTICE***

All plugin information has moved to http://plugins.baptiste.us
Comments are now closed. Please use the new forums instead

I’ve been working on the next release of Xinha 4 WordPress over the past month and figured I’d release a beta version for folks to try out. I’ve been using this beta for the past few weeks on my sites and it has been working well. I still have a few things to add and fix before a final version is released.

You can download the beta version in zip and tar format. 

Installation is easy:

  1. Move your existing xinha4wp plugin directory to something like xinha4wp_old (just in case)
  2. Unzip/tar the new version into place (/wp-content/plugins/xinha4wp)
  3. Open the Xinha4WP options screen and look for a successful upgrade message.
  4. Clear your browser’s disk cache. 
(more…)
Posted June 6th, 2006WordPress Plugins

***NOTICE***

All plugin information has moved to http://plugins.baptiste.us
Comments are now closed. Please use the new forums instead

A new WordPress plugin called LandingSites came out recently that allows people referred to your site from search engines to see a list of related posts in case the original post wasn’t what they wanted. This is a great feature that has existed on some other CMS products for a while.

If a user searches for something and clicks on a link to your WordPress site, now you can present them with the linked post and also a list of other posts that are related. This is very similar in functionality to the Related Entries Plugin, except it only takes effect if a user was referred from a search engine. This allows you to only take the related search hit for referred users instead of every user. It also lets you greet new users with a friendly message about what they were searching for and what else might interest them based on their search terms.

The plugin installed just fine and I was able to add it to my theme fairly easily. However, the code was loaded with substr() calls and other slow functions. A lot of processing was being done, even if a user was not referred to your site (i.e. they were just browsing around). Instead of using a cascade of if(substr = searchengine) calls, I implemented a match array keyed off known search engine hosts that returns the query delimiter immediately. I also condensed the code into a few functions to remove redundant code.

The updated code can be downloaded here. Note that if you run WordPress 2.0, uncomment the bottom section where ls_install is. WP 1.5 users need to execute the SQL manually (I may add a WP 1.5 init routine if the spirit moves me). I need to add a version check to make this 100% portable, but I’m already nodding off… I may update it tomorrow to add the portability check.

Enjoy!

UPDATE: Now that I got a little sleep, I’ve updated things a bit to keep me from being embarassed for being lazy! The biggest change is the implimentation of static variables for the terms, delimiter, and referer. Since we call these routines multiple times in template code, it was redundant. Now using a static variable, the values are maintained during a page’s processing which eliminates a lot of processing. We process once for each value and reuse it every time we are called. I did not cache the database query since I can’t imagine why you would need to grab the related posts twice in one page.

I also made the DB schema update portable for WP 1.5 and 2.0 so the schema will be updated for you automagically even if you aren’t using WP 2.0.x. Anyone with a WP 1.2 install, please check that it works as well. I used a little trickery and a stored option to ensure the DB schema is only checked during admin interface page views, not main page views and can be checked quickly without a DB query (since options are cached already)

I fixed the problem where SQL queries failed if the post ID wasn’t available (i.e. you used it on a main page, etc) so you won’t see a post in the related list when viewing it.

Finally, I added support for search engines like A9 and Excite which include the search term as a URL path instead of in a query variable.

Posted June 1st, 2006Life, Parenting, Politics, Ramblings

Not many people realize how far down into our society some of these ’security’ laws passed after 9/11 are reaching. We all know about not bring nail clippers and cigarette lighters onto airplanes, but now our children are being turned into passive robots who never will be allowed to try anything themselves for fear of ‘hurting themselves’.

Wired has an astounding article at the absolute paranoia that has driven government agencies to run background checks and fingerprint model rocket enthusiasts and arrest suppliers of minute quantities of chemicals for home experimentation. I used to fire off model rockets all the time as a kid. I recall Boy Scout camporees that were dedicated to building model rockets with a huge launch on Sunday afternoon. I still have the 32 pad launch system in my basement we build for it. I have reloadable rocket engine shells from a company that has now been forced out of business by the US government.

No matter what your political affiliation - you really need to read this article. Our children will have no concept of discovery and curiosity outside the Internet. How can we expect our kids to strive to be scientific luminaries if they aren’t allowed to touch anything until they are in college?

9/11 was a horrific event, but the aftermath on our society and the utter destruction of our country’s institutions in the aftermath by our own government is the saddest thing I’ve ever seen. What kind of message will it send to my children that their father has to be finger printed and have a background check when he wants to show them the excitement of model rocketry.

Posted May 31st, 2006WordPress Plugins

***NOTICE***

All plugin information has moved to http://plugins.baptiste.us
Comments are now closed. Please use the new forums instead

OK, I admit that I had hoped to have Xinha4WP ready for WordPress 2.0, but other projects and life in general kept me from doing that. I had tried out Xinha4WP on Wordpress 2.0.0 and found it would sort of work but it looked like a lot of work was needed.

I did not have a huge desire to move to WordPress 2.0, mostly because 1.5.x was working for my sites and I had other projects I had to take care of. Well, the time was coming to get to v2.0 - too many cool new things were coming up for 2.0 or higher (the Installer plugin is awesome). So I finally found some time to give the Xinha4WP v2.0 changes a go.

First step was updating my test install to WordPress v2.0.2 and poke around. I’m not 100% sure, but the way they structured the Post HTML made it seem like TinyMCE wasn’t so static as it used to be. In fact it was downright gentle. If ‘Rich Editing’ was enabled it included some JavaScript for the toolbar, but otherwise the textarea tag was left alone - this is a good thing. So on a hunch, I installed Xinha4WP v1.1 and disabled Rich Editing for all users. The Admin user still had Rich Editing set for it, so I disabled it and hit ‘Write’

Voila - Xinha4WP came right up and so far seems to be working like a champ! So if you’ve been wanting to get Xinha4WP working on WordPress v2.0, it looks like you can with WP 2.0.2. I’m still working on a Xinha4WP v2.0 that will make installation seamless and take care of disabling TinyMCE for you, but for now, try this….

  1. Make sure you have WordPress v2.0.2 installed.
  2. Disable ‘Rich Editing’ under Options->Writing. Also make sure any users you have created also have it disabled in their profile.
  3. Ignore the warnings about Text-Control for now. I believe WP 2.0.x is handling the line feed issue better than 1.5.x did - still need to test.
  4. Try to write a post. Xinha4WP works just fine for me here. How about you?

Note: The built in upload tools will only work if Xinha4WP is in HTML View mode. Since Xinha4WP has its own Image Manipulation plugin, I’d suggest using that instead. Xinha4WP v2.0 will strip out the image upload stuff from WordPress for simplicity.

Xinha4WP didn’t work for comments, but that is theme related. v2.0 will include CSS overrides to prevent the theme based issues with comment posting we’ve seen before. So it may work for you for comments, it may not. 

So there you have it. It looks like a recent bug fix release of WP made things MUCH easier. I’m off to code. I’m REALLY hoping to have something by this weekend for beta testers. Check the Xinha4WP page for updates. Thanks for your patience!

UPDATE: Make sure you disable toolbar flow!

Posted April 12th, 2006Technology

iFolder is a slick package that allows for seamless file synchronization between computers and a central server. If your computer is offline, you still have access to the files in your iFolder and any changes get synchronized with the server when you get back online. There is a Web Access interface and an easy to use Web Administration interface. iFolder uses SSL/HTTP connections making integration into existing networks and firewalls a snap.

Having just been open sourced, I’m working to compile iFolder-Server RPMs for the x86_64 platform on Fedora Core 4. I’m using 4 instead of 5 simply because iFolder uses mono and I wasn’t able to find FC5 rpms (the Fedora Dev RPMs probably would have worked, but I can always upgrade to FC5 later).

So off we go…

(more…)
Posted March 8th, 2006Parenting

Ah the joy of 3 year olds. Our 3rd child is sitting at the breakfast table enjoying an Eggo Waffle (from freezer to plate in 30 seconds woohoo!)

Dad: “Do you want some milk?”
3rd: “I want some juice please”
Dad: “No juice this morning. You can have milk or water”
3rd: “Water is for dogs!”

OK then! Milk it is!

Yes, we have 3 dogs and #3 enjoys filling their water bowl … and dumping it out … and filling it again … and dumping it out…

Posted February 25th, 2006Family News, Ramblings

accidentI was involved in an accident yesterday morning that highlighted just how far our cars have come in terms of minimizing injury and absorbing the energy of the impact. As I was stopped to make a left turn into my driveway, I was hit from behind by a driver who was distracted and never saw me stopped. We live in the middle of a very long and flat stretch of road with a 45 MPH speed limit so cars are generally moving at a good clip. The person who hit me never saw that I was stopped, waiting for an oncoming car to pass, and drove right into my trunk. I drive (or rather drove Smiley) a late model Chevy Impala sedan which is classified as a ‘Large Sedan’. It is a heavy car (just under 3500 lbs) and as long as our Windstar mini-van. The car that hit me was a Honda Civic - not a huge car (just over 2500 lbs). You’d think that in a high-speed accident where a significantly lighter car hits a heavier car, someone is going to get hurt.

(more…)
Posted January 2nd, 2006Family News, Life

Chewed WindowI’ve lived in the country most of my life and the houses have always backed up to woods. So I often appreciate when nature pays a visit. I often walk out our side door and find deer hanging out near the driveway or roaming through the back woods. OK, I’ll admit that the copperhead’s I’ve encountered have met the sharp end of my hoe, but besides that, nature and I get along. But usually our encounters are OUTdoors.

Many people have had birds fly into their homes and getting them out is always exciting. But you haven’t had TRUE natural fun until a furry woodland creature comes over to visit. A few years ago a squirrel managed to come down a chimney and got stuck in our living room fireplace (which had glass doors on it) You want to talk about one pissed off rodent! We tried coaxing him into a pillowcase with a broom and very heavy gloves but he wasn’t biting (yet) So we opened all the doors and swatted him out of the fireplace. Man can those suckers move. He jumped along the walls (gouging them quite nicely in a few places) and finally dove out the door. Right into our yellow lab. I’m not sure whose heart almost stopped first - the squirrel or our dog who wasn’t expecting a pissed off rodent to come flying out our doorway. My wife & I were rolling on the floor as our lab recovered and chased the squirrel up a tree.

Well today we discovered that we have another ‘guest’ and whatever it is, it wants to check out NOW. It decided to try and chew its way out through a bedroom window. The disconcerting thing is, well, it didn’t quite succeed. It destroyed the window for sure, but didn’t quite get out. So needless to say we have a live animal trap set and ready so we can help our furry friend out the door since we can’t find the little sucker ANYwhere. I expect we’ll be sleeping downstairs tonight since the door to the room with the stairs stays closed - so it’s still up there. Here’s hoping it doesn’t decide to chew its way out anything valuable - replacing a window is going to be expensive enough! No clue what it is - though if you click the thumbnail to view the picture fullsize, you’ll see what looks like a paw print on the left pane of glass.

captured_thumb.jpgUpdate: Only took 12 hours to catch the sucker. He sprang the trap once without getting caught, but a mix of dry cat food and bird seed was too much temptation. In just under 24 hours he totally destroyed two windows (we found he had chewed the top sashes too behind the shades) and took a chuck out of the cherry vanity (he almost got gassed over that) Good thing the windows are due to be replaced during our upcoming renovations or I’m not sure he would have had such a joyful reunion with the wild! Squirrels make the funniest sound when they’re annoyed. He was NOT a happy camper! Now I’m off to seal the fireplace flu since it’s never used except by furry guests. Ah the fun of an old house!

Posted December 8th, 2005WordPress Plugins

***NOTICE***

All plugin information has moved to http://plugins.baptiste.us
Comments are now closed. Please use the new forums instead

I’ve used WP-Stattraq on various blogs I host in addition to AWStats. Stattraq gives a nice compact view of what’s being hit and from where. However as my sites drew more traffic, the Stattraq pages were taking a long time to load. On a hunch, I poked around the database structure and found that certain fields that were being searched by often (time, etc) were not indexed.

I added indexes to the wp_stattraq table for the following fields: ip_address, article_id, and access_time. I used phpMyAdmin, but you can also do it by logging into the mysql console client on your server:

bash>mysql -u (wordpress_db_user) -p -D (wordpress database) -h (database host if not local)

mysql>ALTER TABLE `wp_stattraq` ADD INDEX ( `ip_address` );
mysql>ALTER TABLE `wp_stattraq` ADD INDEX ( `article_id` );
mysql>ALTER TABLE `wp_stattraq` ADD INDEX ( `access_time` );

I’m not 100% sure if MySQL will build the index from all existing records when you create one or if you need to force it. To be safe, I optimized the table:

mysql>OPTIMIZE TABLE `wp_stattraq`;

Now your WP-Stattraq pages should load much faster. For me the difference was amazing. I did this for all my sites a few months ago and have been meaning to blog about it, but never got around to it. I dropped by Randy’s site to see if anything was new, and he posted about the problem and fix as well a couple of days ago. It’ll be included in the next version of WP-Stattraq.

Now if I can just figure out why v1.0b won’t peg hits for individual pages.

UPDATE: Via Paperback Writer, I also found another nice speedup for StatTraq - that will make your pages load faster for viewers. At boakes.org, he suggests you delay the insertion of the ‘hit’. This is a great tweak. Simply change your stattraq.php plugin file by finding the ‘INSERT INTO’ database SQL and change it to INSERT DELAYED INTO. This tell the script to hit the database and not to wait for confirmation of a successful insert, which is good if you care about the data, but these are hit stats. If a DB problem arose, losing a couple hit ticks would be fine.

Next Page »