Advanced PHP Error Handling via PHP

by Jeff Starr on Wednesday, January 30, 2008

[ ~{*}~ ] In my previous articles on PHP error handling, I explain the process whereby PHP error handling may be achieved using htaccess. Handling (logging, reporting) PHP errors via htaccess requires the following:

  • Access/editing privileges for htaccess files
  • A server running PHP via Apache, not CGI (e.g., phpSuExec1
  • Ability to edit/change permissions for files on your server

If you are having trouble handling PHP errors using htaccess, these three items are the first things to check. If it turns out that you are unable to use htaccess to work with PHP errors, don’t despair — this article explains how to achieve the same goals using local php.ini files. To implement this strategy, the following is required:

Read more

Have You Seen Endgame?

by Jeff Starr on Wednesday, January 30, 2008

[ Screenshot: Clip taken from Endgame ]

Here is a non-design/non-blogging question for readers:

Have you seen the documentary called “Endgame”, and if so, what do you think about it? Is it real or just another game?

Here is a link to the video on Google »

Read more

Minimalist Web Design Showcase: Equivocality

by Jeff Starr on Monday, January 28, 2008

“Exploring Minimalist Thought and Expression in Contemporary Web Design”

Welcome to a new series of articles exploring minimalism in modern web (and graphic) design. With this post, we begin our exploration of the Web’s most inspiring and intriguing minimalist presentations. Staying true to the spirit of minimalism, each showcase will be kept as clear and concise as possible, focusing on tangible and practical aspects of each featured site. We will discuss aesthetics and functionality on both sides of the browser, examining elegance and simplicity within a Web-Standards context..

[ Screenshot: Jeff Ngan's Equivocality ]

For our premier review, I have chosen Jeff Ngan’s recently redesigned site, Equivocality. I have been reading Jeff’s suspenseful, introspective offerings for many months now, sharing in his consistent openness and sincerity, wit and insight. Upon reading about his site’s recent redesign, I immediately dropped by to check it out..

Read more

Laser-Focused Feeds and Smarter Feed Management

by Jeff Starr on Monday, January 28, 2008

[ ~{*}~ ] My current adventure into the fascinating realms of site redesign and optimization has yielded several chunks of fruit related to managing and delivering feed content. One of my primary concerns regarding the overhaul of Perishable Press is streamlined content delivery and rights management. An important area of convergence for these two factors involves the management and delivery of a site’s syndicated content. In this article, I explain the shortcomings of many default feed configurations and present an effective overall strategy for better feed management.

When it comes to managing syndicated content, most blogging platforms enable bloggers to provide a multitude of feeds to their readers. For example, WordPress (as well as many other blogging platforms) automatically generates feeds for each of the following channels:

  • Main content feed (includes all posts)
  • Main comments feed (includes all comments)
  • Unlimited number of individual category feeds
  • Any combination of individual category feeds as a single feed
  • A feed for each the comments given for any particular post
  • A feed for each blog author or contributor
  • A feed comprised of virtually any combination of the above feeds

Then, as you consider this astronomical number of feeds, multiply each possibility by a factor of at least three: feeds generated via RSS 2.0, RSS 0.92, and Atom formats. Then, as if that were not enough, some bloggers throw third party services such as Feedburner into the mix and link directly to those feeds as well. Now add a zillion non-canonical URL variations into the mix. Eventually, your eyes begin to bug out and you go a little bonkers trying to keep track of them all.

Read more

What is the Difference Between XHTML 1.0 Strict and XHTML 1.1?

by Jeff Starr on Sunday, January 27, 2008

As some of you (e.g., Louis) may have noticed during the recent site redesign, I decided to switch the default doctype from XHTML 1.0 Strict to XHTML 1.1. Just in case you were wondering, XHTML 1.1 is different than XHTML 1.0 in three important ways 1:

  1. On every element, the lang attribute has been removed in favor of the xml:lang attribute
  2. On the a and map elements, the name attribute has been removed in favor of the id attribute
  3. The “ruby” collection of elements has been added

Beyond these three differences, XHTML 1.1 is identical to XHTML 1.0. Personally, I chose to markup my current design with XHTML 1.1 because of its advancement of the web-standards paradigm: complete separation of structure, behavior, and presentation.

References

Read more

Serve Yourself: Why Feedburner Needs a Feed Fix

by Jeff Starr on Wednesday, January 23, 2008

[ Image: anonymous junkie shooting up heroin ] If you are using Feedburner to deliver your feeds, chances are high that most — if not all — of your loyal readers have subscribed to the Feedburner-specific version of your feed’s URL. This is not a good idea for a couple of important reasons:

  • Complete content-delivery failure if/when the Feedburner service goes down
  • Cohesive branding strategy impossible because visitors see Feedburner’s name in feed URL instead of your own

At this point, millions of feed subscribers have Feedburner-branded feed URLs listed in their feed readers. If/when the venerable Feedburner service should ever fail, the results would be disastrous. Feedburner needs to provide a comprehensive way for content producers to deliver their feeds through user-specified channels. Currently, Feedburner demonstrates that this is possible by enabling a partial method of redirecting feed traffic to custom URLs.

Read more

1-Minute Tutorial: Permanent (301) Redirect via PHP or htaccess

by Jeff Starr on Wednesday, January 23, 2008

Here is an example of one of the most frequently asked PHP/htaccess-related questions I receive here at Perishable Press:

How do I redirect a specific page/URL using PHP/htaccess?

So common is this inquiry that I have decided to just post a quick, “one-minute” tutorial describing the technique.

Read more

6 Ways to Customize WordPress Post Order

by Jeff Starr on Tuesday, January 22, 2008

[ Graphic: Inverted Triangular Fractal ] Recently, reader Luke Knowles asked how to customize the sort order of his posts in WordPress. Looking into a solution to this question proved quite enlightening. Within moments I was able to discern 4 methods for modifying post order, and then several days later I discovered 2 additional custom sorting techniques. After updating the reply to Luke’s comment, it seemed like some good information that other WordPressers may find useful. So, here are six ways to customize the sort order of posts in WordPress..

Read more

Important Note for Your Custom Error Pages

by Jeff Starr on Monday, January 21, 2008

Just a note to web designers and code-savvy bloggers: make sure your custom error pages are big enough for the ever-amazing <cough> Internet Explorer browser. If your custom error pages are too small, IE will take the liberty of serving its own proprietary web page, replete with corporate linkage and poor grammar.

How big, baby?

Well, that’s a good question. In order for users of Internet Explorer to enjoy your carefully crafted custom error pages, they need to exceed 512 bytes in size. Using proper doctype markup, your custom pages should include more than around 10 lines (roughly) of additional markup and/or content. A good rule of thumb is to throw down at least a couple of decent-sized chunks of code. If you are going for a minimalist set of custom error pages and need a way to increase overall page size, you can always add a paragraph or two of good ‘ol Lorem Ipsum text as a comment in the markup:

Read more

First 30 Days without Bad Behavior

by Jeff Starr on Sunday, January 20, 2008

Approximately 30 days ago, I completely uninstalled the Bad Behavior plugin from Perishable Press. As you may recall, many Bad Behavior users were unexpectedly locked out of their own sites and forced to either uninstall or upgrade in order to fix the problem. Of course, in my perpetual battle to optimize and streamline everything, I decided to drop Bad Behavior from the otherwise obligatory WordPress anti-spam trinity.

30 days later..

I am happy to report that Perishable Press has not seen a noticeable increase in comment spam since the removal of the Bad Behavior plugin. Of course, during the past month, two or three trackback spam turds managed to slide through, however, even Bad Behavior failed to stop everything. This is great news because I prefer to avoid unnecessary plugins whenever possible — especially those of the resource-intensive variety.

Read more

Comprehensive URL Canonicalization via htaccess for WordPress-Powered Sites

by Jeff Starr on Wednesday, January 16, 2008

[ Image: Decorative Icon ] Permalink URL canonicalization is automated via PHP in WordPress 2.3+, however, for those of us running sites on pre-2.3 versions or preferring to deal with rewrites directly via Apache, comprehensive WordPress URL canonicalization via htaccess may seem impossible. While there are several common methods that are partially effective, there has not yet been available a complete, user-friendly solution designed specifically for WordPress. Until now..

In this article, I share my “secret” htaccess URL canonicalization formula. I originally developed this method in July of 2007, and have been using it successfully on a variety of WordPress-powered sites since that time. Thus, having verified the effective performance of this technique, I feel confident in sharing it with the open-source community. But first, a bit of context..

Read more

Coldskins: Custom CSS Skins for Contact Coldform

by Jeff Starr on Tuesday, January 15, 2008

[ Icon: Contact Coldform ] With the recent release of my latest WordPress plugin, Contact Coldform, I am also creating a series of free, “drop-in” CSS skins for easy, “plug-n-play” customization. These skins employ valid, optimized CSS code designed for the following browsers:

  • Firefox 2 (mac & pc)
  • Internet Explorer 6
  • Internet Explorer 7
  • Opera 9 (mac & pc)
  • Netscape
  • Camino
  • Safari

The goal for these skins involves minimizing the amount of CSS code while simultaneously maximizing its universal effectiveness. Thus, while these skins may not appear identical in every browser tested, I am able to keep CSS code sizes to a minimum by focusing on overall design proximity as opposed to pixel perfect precision, which is possible, but would require additional code. In other words, the balance between presentational fidelity and relative code quantity may require further manipulation, depending on your particular design requirements.

Read more

Advanced PHP Error Handling via htaccess

by Jeff Starr on Monday, January 14, 2008

In my previous article on logging PHP errors, How to Enable PHP Error Logging via htaccess, we observed three fundamental aspects of preventing, preserving, and protecting your site’s PHP errors:

Prevent public display of PHP errors via htaccess

# supress php errors
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_value docref_root 0
php_value docref_ext 0

Preserve (log) your site’s PHP errors via htaccess

# enable PHP error logging
php_flag  log_errors on
php_value error_log  /home/path/public_html/domain/PHP_errors.log

Protect your site’s PHP error log via htaccess

# prevent access to PHP error log
<Files PHP_errors.log>
 Order allow,deny
 Deny from all
 Satisfy All
</Files>

Now, in this article, we will explore these operations 2 in greater depth, provide additional functionality, and examine various implications. First we will explore PHP error handling for production environments (i.e., for websites and applications that are online, active, and public), then we will consider error handling for development environments (i.e., for projects that are under development, testing, private, etc.).

Read more

WordPress Plugin: Contact Coldform

by Jeff Starr on Tuesday, January 8, 2008

[ Image: Coldform Icon ] Welcome to the homepage for Contact Coldform, a free contact-form plugin for WordPress. Contact Coldform is designed with a sharp focus on clean code, solid performance, and ease of use. No frills, no gimmicks, only pure contact-form satisfaction. If you are looking for a solid, well-designed, user-friendly, fully customizable contact form, look no further: Coldform is perfect for any WordPress blogger. The comprehensive Options panel makes Coldform easy for beginners to take full control, while the consistent, logical PHP/(X)HTML code makes Coldform ideal for advanced users desiring customized functionality. The best of both worlds: a “clean-slate” contact form that provides everything you want and nothing you don’t! :)

Coldform Features:

  • Compatible with WordPress versions 1.5 - 2.8 and beyond.
  • Plug-n-play: add Coldform to any WordPress page or post.
  • Simple installation — upload, activate, and customize.
  • Complete WordPress Administrative Options panel for full control.
  • Ultra-clean code output: standards-compliant, valid (X)HTML.
  • Customizable anti-spam challenge question to protect against spam.
  • Secure form processing and protection against malicious attacks.
  • Same-page error messages to help users complete required fields.
  • No obtrusive markup or code added to your <head>.
  • Includes option to enable users to send carbon copies to themselves.
  • Coldform message includes IP, host, agent, and much more.
  • Customizable form-field captions, error messages, and success message.
  • Customizable drop-in CSS skins for easy styling.
  • Customizable CSS attributes.
  • Customizable everything!

Read more

Blacklist Candidate Number 2008-01-02

by Jeff Starr on Wednesday, January 2, 2008

Come one, come all — today we officially begin a new series of posts here at Perishable Press: the public exposure, humiliation, and banishment of spammers, crackers, and other site attackers. Kicking things off for 2008: blacklist candidate number 2008-01-02!

[ Photo: Bob Barker makes a fist ] Every Wednesday, I take a little time to investigate my 404 error logs. In addition to spam, crack attacks, and other deliberate mischief, the 404 logs for Perishable Press contain errors due to missing resources, mistyped URLs, and the occasional bizarre or even suspicious behavior of the search-engine robots. Whenever possible, I attempt to resolve a majority of the “fixable” errors, either by restoring missing resources, adding an htaccess redirect, or by any other means available.

Having exercised this rigorous maintenance practice for well over a year now, my 404 error logs are almost completely devoid of all “fixable” 404 errors, and are filled almost exclusively with spam attacks, XSS attempts, and other miscellaneous cracker nonsense. Fortunately, my site has only fallen victim to such espionage on one occasion, and on a different server.

Read more


Attention: Do NOT follow this link!