Anticipating WordPress 2.5

Posted on 2008.03.16
Categories: PHP; Tagged with: , , , ,

The WordPress Planet has been posting recently about a silently-delayed release of WordPress 2.5, a huge step up from WordPress 2.3.3. It was supposed to have been released March 10, 2008. It is now March 16, 2008.

Similar to the hype with the long-awaited release of Joomla! 1.5 Stable, people all around the world are anticipating WordPress 2.5, which is said to have a much nicer admin backend, a changed plugins system, and dozens of other features.

WordPress logo

The difference between waiting for Joomla! 1.5 Stable and waiting for WordPress 2.5 is that WordPress is used by a huge number of active bloggers around the world. It is said that tens of millions of people read blogs powered by WordPress every day; this is no overestimate. Whether it’s an average Joe blogging about his life, or Yahoo! talking about their latest developments, or even eBay, WordPress is suitable for everyone.

Joomla! is a CMS, and large corporations build their own CMS’s. But WordPress was intended to be a blogging / content platform, and it has been used as that (and many more things) because it’s simply easy to use.

I await WordPress 2.5 as eagerly as anyone else. Sure, the new source code can be obtained via SVN, or the nightly builds, but I’ll wait until the stable.

Get WordPress for your own site, or create a free WordPress blog at PersonalLog.

1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 3.4 out of 5)
Loading ... Loading ...

Compressing JavaScript, CSS, and plain HTML using zlib.output_compression in PHP

Posted on 2008.02.17
Categories: PHP; Tagged with: , , , , ,

Today, a newly-registered user “jcapshaw” noted (on an older blog post about using zlib for output compression in PHP) that he wanted to send JavaScript, CSS, and HTML files through PHP for gzip compression. Clearly, as I pointed out in that blog post, the PHP developers prefer zlib.output_compression over the ob_start(’ob_gzhandler’) method, even though the zlib.output_compression method takes more work to set up. Why shouldn’t we apply it to other text-based files as well?

On one of my developments, RHHSMusic.com, I use several optimization methods recommended by the Yahoo! Developer Network, including:

  • CSS sprites (combining navigational images into one larger file and using CSS to show only part of the image)
  • Expires header (telling the browser how long the file would be valid, and for how long it wouldn’t need to re-fetch the file)
  • Gzipping components of the site, including normal PHP/XHTML documents, ALL CSS stylesheets, and most JavaScript files
  • Placing stylesheets in the <head> section
  • Placing JavaScript includes at the very bottom of the page, just before </body>
  • Not including site-wide CSS & JS in the HTML page
  • Using multiple hostnames (javascript.rhhsmusic.com and media.rhhsmusic.com) to encourage parallel downloading
  • Using ETags to identify when a file has changed

The majority of the above are accomplished through PHP; whether it’s PHP includes, PHP classes, or using PHP to gzip CSS & JS.

This article discusses how that is accomplished.

(more…)

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5 out of 5)
Loading ... Loading ...

PHP coding shortcut: the ternary operator

Posted on 2008.01.28
Categories: PHP; Tagged with: , , , , ,

Many of us coding or able to code in PHP often take the long route to do a simple task. Some completely “reinvent the wheel” with custom string handling functions. Others use complex while loops with simple tasks.

Most use the classic if… (then)… else… style conditional statement. Things such as the following:

<?php
if($_SERVER['REQUEST_URI']=='/index.php') {
	echo('Hello World!');
} else {
	echo('This is some other page');
}
?>

Some may have moved beyond such rudimentary coding to blocks like the following:

<?php
$request_uri = $_SERVER['REQUEST_URI'];
switch($request_uri) {
	case '/index.php':
		echo('Hello World!');
		break;
	default:
		echo('This is some other page');
}
?>

Clearly, the second takes more work. Given something as simple as echo-ing a phrase like “Hello World!” or “This is some other page”, using the switch-case syntax simply doesn’t make sense. Even the if-else syntax is a bit overkill.

That’s why programmers and coders who perform simple tasks should use the ternary operator (available in PHP and JavaScript):

<?php
echo ($_SERVER['REQUEST_URI']=='/index.php') ? 'Hello World!' : 'This is some other page';
?>

Simple, right? Right.

It follows the pattern of (expression 1) ? (expression 2) : (expression 3) where this statement evaluates to expression 2 if expression 1 returns TRUE and the statement will evaluate to expression 3 if expression 1 returns FALSE.

For more information, consult the PHP manual.

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 3 out of 5)
Loading ... Loading ...

Joomla 1.5 Stable Released

Posted on 2008.01.22
Categories: PHP; Tagged with: , , ,

Hello, readers.

Joomla! — a highly popular content management system (CMS) done by thousands of developers around the world, has now released the widely anticipated 1.5 STABLE release. This is an extremely important update because the new version comes with an “improved” templating system, a much better extension system, easier management of content, sections, and categories, and a very different (built-in) SEF URL’s function.

Despite the fact that many templates for the 1.0.x versions of Joomla! are not very good on 1.5 installations, the legacy mode does allow you to use those older templates. In any case, 1.5’s been publicly anticipated for almost half a year, and many templates are out now, for 1.5 in native mode.

Go ahead and download Joomla! 1.5 STABLE to start your own site.

Joomla! logo

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Output Buffering in PHP

Posted on 2007.11.19
Categories: PHP; Tagged with: , , , , , , ,

This article discusses output buffering and some things you can do using the ob_start() / ob_end_flush() functions in PHP. Particularly, it explains how to modify your (X)HTML output on the go using output buffering while utilizing our zlib.output_compression method mentioned in “PHP compression without ob_start“. (Strangely, that article was for not using ob_start, while this article is about using ob_start.) I also talk about some tasks you wouldn’t normally be able to accomplish without output buffering.

(more…)

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Favourite WordPress Plugins

Posted on 2007.11.08
Categories: PHP; Tagged with: , , , ,

A site I recently encountered posted a list of “favorite Wordpress plugins“. Although I do agree with some of the things on there, I disagree with many others. Allow me to post my own list:

  • All in One SEO Pack is a great plugin, which “out-of-the-box” does everything imaginable for your blog. That is, everything from META tags to messages to the search bots, and even automatic META descriptions. (Add META Tags was on the author’s list, but it is not compatible, since it has multiple redundancies already provided by All in One SEO Pack.)
  • OneClick Installer, which takes the pain out of uploading new themes and plugins. I personally don’t upload themes at all, and I often need to use my cPanel File Manager to edit my plugins anyways, so this only saves me time with the plugins that don’t cause errors. (On a host with PHP/CGI installed, the “edit file” command from within WordPress doesn’t work.)
  • Ultimate Google Analytics, which makes it easy to install the Google Analytics code on a blog. It also adds the advanced feature of being able to track external links, mailto links (I never use them), and downloads.
  • Google XML Sitemaps, which creates a new sitemap for Google and Yahoo! whenever a post is made or its functionality is triggered. My only concern is that its “human-readable” version, that is, with the XSL stylesheet, is not validly coded into the main XML file, and doesn’t load properly in Firefox.

My list is quite short, since I don’t feel like slowing down my blog with an excessive amount of redundant plugins. The author of the post listed the following plugins, which I reject:

  • FeedBurner FeedSmith — I do not believe that tracking your feed readers is necessarily a good thing, and even more so when they are unknowingly forwarded to FeedBurner. It’s also questionable to me — why would you want to deliver your RSS/ATOM feeds through an external service?
  • Related Posts — for many blogs, searching through the database for relevant posts is performance-intensive, and overall bad for the user’s experience.
  • Social Bookmark Creator — perhaps, at some time in the future, I shall use something like this, but I don’t like clogging up site design with additional external links or images.
  • Global Translator — Geekie.org and many other blogs are in English; letting Google’s machines, no matter how good they are, translate our work is questionable.
  • WP-ContactForm — the author’s homepage can’t be displayed, so I don’t have much to say about this. Besides, within the FreddyWare Solutions Enterprise Network, we have one centralized location for contact forms. (For instance, you can send me an e-mail through our official form at http://www.freddyware.net/contact.form/frederick.ding.)
  • WordPress Database Backup — WordPress has such nice built-in backup (export) and restore (import) functions that I believe such a plugin is useless to most blog owners.

Of course everyone is entitled to their own opinion. I’m just recommending what I think are best.

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...