2010-04-22 by pubmed | Cats: Code | Tags: wordpress
Excellent post at PRX on the “bandwidth conundrum.” In a response to a producer’s question re: his WordPress site gettin’ trounced by traffic, PRX’s supreme bit-twister, Andrew daCoder, suggests:
- Setting up site-monitoring at pingdom or montastic.
- Using a Content Delivery Network (try the lo-$s SimpleCDN or pay-as-you-go MaxCDN).
- And links to All-Things-Cache-centric, from plugins to the WP codex.
The whole post is well-worth reading, nay, studying. Thanks to Andrew and PRX.
2010-04-16 by pubmed | Cats: Code | Tags: security, seo, wordpress
Your WordPress engine should be up and running in about five-minutes (famously). A few more moments of fine-tuning the settings will boost its security and SEO.
Security thru obscurity (“Hardening WP“)
- Before install: Makes it hard for evilbots to peek at your underthings. Pick a non-obvious directory name for WP dirs/files. When you unzip WP the resulting folder is named: :
/wordpress. Rename that dir or move is contents to another dir.
- During install: use non-obvious database table prefixes. In file:
wp-config.php, change default wp_ to something stronger, like:
$table_prefix = 'wp_5hYn_';
- After install: WP auto-creates a first user named
admin. That would be an evilbot’s first guess. So create a new user w/ role: Administrator; log out. Log in as this 2nd user; then delete default user named: admin. (Note: WP3 beta-install allows you to name the first user, so this task isn’t necessary: just don’t use name “admin.”
There’s More»
2010-04-03 by pubmed | Cats: Code | Tags: audio, flash, html5, mp3, wordpress
Hearing Voices uses the WPAudioPlayer plug, which, since it’s Flash, the iPhone can’t see. But iPhone Safari is HTML 5 <audio> aware, and supports mp3 play. So here’s our quick&filthy fix. In the file: /plugins/audio-player/audio-player.php, find the: function getPlayer, and w/in that the the variable: $playerCode.
There’s More»
2010-03-24 by pubmed | Cats: Code | Tags: php, wordpress
Remove Blank Lines from XML Feeds
Recently set up this new WP site. All went typically well, until I checked the feed. Got this error:
XML Parsing Error: XML or text declaration not at start of entity
Location: http://pubmedia.us/feed/
Line Number 2, Column 1:
<?xml version=”1.0″ encoding=”UTF-8″?>
^
The prob was a blank line at the top of the feed, which XML will not abide (the XML declaration goes “in the first position of the first line”). That blank was shooting from an addition I’d made to functions.php , written like this:
There’s More»
2010-03-21 by pubmed | Cats: Code | Tags: wordpress
Managing WordPress Post Revisions
WP post “revisions” have saved my ass more than once. Intro-ed in WP 2.6, they let you save, view, and restore past versions of your posts.
But when it comes to database backup, all those revisions can be too much of a good thing. E.g., all my wp tables together weigh in at 18MB right now. Without the revisions, those same tables total 3MB (rev inflation factor of 6).
So, before db backups, I usually delete the revisions (which are a post-type) along w/ those revs’ post meta and terms. To do this, run this sql query (e.g., via phpMyadmin):
There’s More»
2010-03-19 by pubmed | Cats: Code | Tags: wordpress
Several of the WP resources I go to find script solutions have become regular read for me, among them:
There’s More»
2010-03-19 by pubmed | Cats: Code | Tags: wordpress
One Loop File for All WordPress Templates
What made HV’s WP hacks possible was adopting a uni-loop. One file that changes the loop for the entire site — much as a single site-wide CSS stylesheet does.
At first we made so many tweaks in the loop (date format, cat display, etc.). With each alteration, we’d then have to remember to mirror in all the other template files: archive.php, index.php, page.php, single.php, search.php.
Now, in each of the above files, instead of the loop itself we include a single uni-loop file:
There’s More»
2010-03-19 by pubmed | Cats: Code | Tags: wordpress
WordPress as CMS
WordPress is a blog tool that can be coaxed into a Content Management System. Hearing Voices has begun to let WP take over its CMS chores. As we conjure custom WP concoctions, we’ll post them in this series: Pimp My WordPress.
There’s More»