Stylizing Modifications Tutorial

By popular request via comments and emails, I have created a page with a detailed tutorial on how to effectively use the Stylizing Modifications textboxes in my widgets. Go ahead and take a read, you might find something that interests you!

htmlspecialchars_decode bug in Wordpress 2.7.1

It has been brought to my attention that there is currently a small bug in Wordpress 2.7.1 that affects certain users of my Status Press Widget and Customizable Search Widget.

This bug mainly affects users of PHP4, because the htmlspecialchars_decode function is not included until PHP5, so Wordpress has now integrated a simulation of the same function in the code core of 2.7.

If you are a PHP4 user running Wordpress 2.7.1, you may get this error from a plugin or widget that attempts to access the htmlspecialchars_decode function:

Warning: htmlspecialchars_decode() expects parameter 1 to be string, NULL given in /home/myname/public_html/personal/wp-includes/compat.php on line 105:

PHP5 users already have this function inherint in their repository, so it just bypasses the Wordpress simulation function.

Apparently when 2.7.1 was released, a slight oversight caused the function to be looking for a variable that was not being passed to it because of a misnaming error.

Details about this error are located in the Wordpress bug tracking system, and it looks like a fix has been submitted for the next version.

However, what should I do until the update? I did some looking into the code that is affected, and noticed that basically in the htmlspecialchars_decode function, Wordpress passes the two expected variables (the string, and the quote style) to its own parser called wp_specialchars_decode. Instead of relying on the PHP version, I have updated my plugins to directly call the Wordpress version of the function to ensure compatibility. Scratch that, that’s not going to work. The wp_specialchars_decode function is only included in Wordpress as of 2.7.1, so it is not backwards compatible and not wise to use.

Instead, you should go ahead and fix the problem with the core file if you are using 2.7.1 and PHP4.

  1. Open up /public_html/<WP Directory>/wp-includes/compat.php
  2. Scroll down to line 104:   if ( !is_scalar( $string ) ) {
  3. Change $string to $str
  4. Do the same thing for the line below it, 105.
  5. Save the file back to your server
  6. Update your plugins.

When you have followed these steps, you should be good to go.  If you do not feel comfortable editing the file yourself, you can just download my edited copy of compat.php:

  compat.php (3.4 KiB, 176 hits)
You need to be a registered user to download this file.

Be sure to upload it to the wp-includes directory. Then update the plugins and widgets that have become broken.

You can find the updates to my widgets here:

If you have any questions or concerns, please do not hesitate to let me know. Oh, and if this has helped you, don’t forget to show a little love:

Status Press 1.12

It was brought to my attention that while updating my plugins to be completely 2.7 compatible, something fell by the wayside (as it normally does). This thing that had fallen was indeed the dear Status Press Widget. Apparently in the 1.11 version of the code, my function to simulate a PHP5 function if the user was using PHP4 had been moved to an incorrect placement inside the widget class. This caused the widget to blow up, even when attempting to activate it. Moving this function outside the class at the very beginning (before the class institiation) corrects the problem and allows both PHP4 and PHP5 users to succefully enjoy this widget.

Please accept my apologies for the previous version mishap.

You can download the latest version on the Status Press Widget page.

Plugin Updates

Tonight I decided to update my Wordpress plugins. So, each of my plugins are now officially compatible with Wordpress 2.7(.1). Please take a look at some of the new features and such of each of them.

What to Do with all the Facebook Friends?

(Author’s Note: This post was inspired by a comment on Lifehacker asking which was better when it came to Facebook friends: Quanity or Quality? I personally prefer quality, however, you can’t always enforce that easily)

If you are like me, then you have a Facebook profile (along with most everyone else on the internet in the world) and you have Add as a Friend request from people that you either don’t know, or do not care about. It is these requests that caused me at one point to think twice about adding them. Why? Because I am a quality type of guy when it comes to Facebook friends, and I did not necessarily want everyone who wanted to be my virtual friend to have access to personal information about me (cell phone number, address, current employer, etc).

But I have been burned by people who were offended for denying their request or, doing like I used to do and just keep their request in limbo and not make a decision (which Facebook still allowed them to see your basic profile anyway, and of course they will know eventually if you are not ever among their friends). However, I discovered a way to not offend these people and eat my cake too. Its all about combining the Friends List feature and customizing your Privacy Settings.

  1. Login to Facebook if you have not done so already
  2. Click Friends in the Top Menu (left side)
  3. Create a New Friends List (left sidebar) called Acquaintances (or whatever you want)
  4. Add any current friends you do not want to be able to see all the info on your profile
  5. Click Privacy Settings under the Settings tab in the Top Menu (right side)
  6. Click Profile
  7. Click the drop-down of any of the groups you don’t want these people to see (i.e. Personal Info, Photos Tagged of You, Status updates, etc)
  8. Click Customize
  9. In the “Except These People” textbox, type Acquaintances (or whatever your new friends list name is)
  10. Now any of the sections that you don’t want these people to have access to, they will not be able to see
  11. From now on, whenever you get an Add Friend request from a person you don’t really know, quickly add them to the Acquaintances list before confirming them.

If you ever want one of these persons to have access to your info, go back to your friends list and remove them.

This technique is extremely useful for limiting what those people see about you, however, it does not limit what you see about them. Remember, they can still message you, chat with you, and interact with you via certain third part Facebook applications. However, I have found that it is annoying to still see status and news feed updates about these people that I don’t really care about. I do wish that Facebook allowed you to exempt Friends Lists from the News Feeds.

I hope this little tutorial has helped keep your frienders happy and eat your cake too!

SEO Powered by Platinum SEO from Techblissonline