wordpress

You are currently browsing articles tagged wordpress.

pwnd

Thanks to Janne, who noted that my blog might have been had. The sign for this was that my permalinks were all weirded out with additions like base64_decode ($_SERVER [HTTP-REFERER] ) (code intentionally munged).

  • The quick fix was to edit my permalink settings, removing the funky suffix.
  • I also edited sitemap.xml, created by a plugin for Google (and other index engines’) site maps.
  • Futhermore, i edited my database manually to remove the base64_decode bits from the GUIDs of my last few posts. Older posts seemed unharmed
  • Finally, being very paranoid about the “extra administrators” phenomenon exhibited by this worm, i deleted nearly all of my users. This may include you. So if i did remove you from my system (and i probably did), i’m really sorry and it’s nothing against you. I want you back. It’s all because of that jerk who wrote this Wordpress worm and should be kicked in tar, rolled in feathers and carried around town on a sharp stick.

Oddly enough, i was not able to find more administrators than there should have. Maybe i got lucky. Or maybe i just happened to update my WP just as crap was hitting the fan. Or maybe i just haven’t found the worm lurking inside my code just yet.

In any case, we are back. For now.

Tags: , ,

I changed the root directory of my Wordpress blog according to the instructions in the WP Codex. Along with it, all my images went 404.

Since i couldn’t find a proper fix (or even reason to this failure) i changed it back. Things work again, but are just as ugly on the backstage.

Tags:

A while ago, i caught a jaiku from Jonasl regarding Simple CDN, a Content Delivery Network which is (duh) Simple. Simple to register to, simple to implement and, perhaps most importantly, simple to maintain.

So why use a CDN? Well, basically there are three reasons:

  • Efficiency. Let your back end server do the processing-intensive bits and leave serving out static content to a dedicated workhorse with a phat pipe.
  • Money. It’s/you’re cheap.
  • Geeky. It can be done, so why not. And your next door blogger hasn’t got CDN yet, unless s/he’s on a hosted blog.

Me? I went for the geeky and cheap. And here’s how i enabled CDN for my Wordpress blog:

  1. Register an account at SimpleCDN and jump through the one step confirmation mail hoop.
  2. Register a “bucket” which will represent your stuff served from the CDN. I chose a Mirror bucket with a S3plus back end. A mirror bucket will populate itself and maintain its content without your intervention and the S3plus option is the cheaper one.
  3. Optional fluff: Create a DNS CNAME record to point cdn.yoursite.net to yourbucket-options.simplecdn.net. In my case, cdn.navelfluff.org points to navelfluff-s1.simplecdn.net, where the s1 option enables gzip and fairly sensible expiration headers.
  4. Get and install Yejun Yang’s MyCDN Wordpress plugin. Configure CSS, themes and Javascript with the “pre-url” above, i.e. http://yourbucket-options.simplecdn.net (or the prettier cdn.yoursite.net). No trailing slash in the pre-url!
  5. Hit Reload on your site. View the site’s source code to make sure everything’s in place.
  6. Rejoice.

That’s it. Your CSS, theme files and Javascript will be automagically slurped to SimpleCDN and served from there. Nothing to do further but to rejoice your increased geekdom.

Sure the solution could be improved. I’ve read that Amazon’s Cloudfront is way more efficient than Simple CDN, but with my traffic, who cares. In my world, this is just enough.

Tags: , , , , ,

Navelfluff är en trespråkig blogg. Ibland häller jag ur mej på svenska, ibland på finska och ibland på engelska, lite beroende på vad jag har att säja och till vilken publik jag riktar mej. Språkindelningen annoterar jag med Wordpressens kategorier, vilka jag oxå använder för kategorisering av själva innehållet (geek, Timor-Leste, pynja, osv). Det är en debattfråga huruvida det kan tänkas syntaktiskt korrekt att använda samma slags metadata att annotera både innehållet och språket för inlägget men jag geek och inte lingvist, så jag godkänner mitt beteenede i detta fall.

Wordpress å andra sidan är inte mångspråkig, vilket kanske inte är så konstigt med tanke på att de flesta bloggar skrivs på ett och samma språk. Visst, man kan få WP att tala ett annat språk, men det är fortfarande bara tal om ett annat språk i taget. Vilket jag tyckte var lite trist.

Ända tills lite tidigare idag tyckte nämligen Navelfluff att “please leave a comment” för alla inlägg, oavsett vilket språk inlägget var skrivet på. Och i samband med en kommentar jag fick angående Tarski-temats lite lakoniska “no comments”-statustext i anslutning till inlägg som saknar kommentarer (till skillnad från inlägg som inte önskar kommentarer) så tog jag och gjorde nåt åt saken.

Följande plugin lokaliserar skriv-en-kommentar- eller inga-kommentarer -texten. Pluggaren baserar sej på change_no_comments_text -pluginnen av Tony Trainor. Förklaring följer efter koden.

function change_comments_text($text, $number) {
    global $post;
    $lang = "any" ;

    $cats = wp_get_post_categories( $post->ID );
    $stac = array_flip( $cats );

    if( array_key_exists( 3, $stac )) $lang = "sv";
    if( array_key_exists( 4, $stac )) $lang = "fi";

    $text = Array( "any" => array( 0 => "Please leave a comment! ",
                                  1 => "1 comment ",
                                  2 => "$number comments "),
                  "sv" => array(  0 => "Skriv en kommentar! ",
                                  1 => "1 kommentar ",
                                  2 => "$number kommentarer "),
                  "fi" => array(  0 => "Anna palautetta! ",
                                  1 => "1 palaute ",
                                  2 => "$number palautetta "));
    $num = $number;
    if( $num > 2 ) $num = 2;
    $ret = $text[$lang][$num];

    return $ret;
}

add_filter('comments_number', 'change_comments_text', 10, 2);

Varje postning har ett antal kategorier (noll eller flera) och de representeras som en array vars värden utgör kategori-ID:na. Efter en del reverse-engineering kategori-arrayn (att de facto läsa dokumentationen är tråkigt :) ) insåg jag att mina svenskspråkiga inlägg har en kategori-ID 3 och mina finskspråkiga ID 4. [0] 

I koden används ett lite fult trick, nämligen array_flip samt array_key_exists för att kolla om artikeln har kategori-ID tre eller fyra. Samma sak skulle ja antagligen skrivit elegantare med array_search men av nån orsak fick jag inte den funktionen att funktionera. Men så är jag oxå nybörjare, så jag har en bortförklaring.

Slutligen konstateras att jag har ingen aning vad parametrarna 10 och 2 gör i slutet av alltsammans.

Har du en flerspråkig blogg (hej skrubu! hej nikc!) och språk-kategoriserar dina inlägg så behöver du “bara” gissa fram vilka kategori-ID:n du använder (vink: ersätt return $ret; i koden ovan med return "$ret <!-- $lang $num " . implode( "|", array_values( $cats )) . " -->";), infoga ett kommentarblock i början av koden med de av WP obligerade kommentarfälten, inslut kodsnutten i <?php ... ?>-markering, och slutligen spara hela rasket i ditt wp-content/plugins -direktorat. 

Skulle det mot all vettig förmodan finnas en social beställning på denna pluggare i ett människovänligare format, så … vänligen skriv en kommentar!

[0] Övriga (samt o-språk-kategoriseade) inlägg behandlas som om de vore engelska och de med flera språk-kategoriseringar får den sista lokaliseringen i listan. Det är så sällan jag skriver ett inlägg med flera såpråk att jag inte orkar koda om pluggaren så att den lokaliserar till alla noterade språk.

Tags: , , ,

I’m in a rather clunky update of Wordpress, so things may go bad at any time.

If there is anybody who’d want to tell me the ultimate .htaccess file to do the following, please let me know :)

  • make www.navelfluff.org fetch stuff from {wwwroot}/wordpress 
  • make searches, which are sent from WP as ?s={search_term} to be shown as /search/{search_term}

Previously, my Wordpress installation has been in the root of my www directory (“{wwwroot}”) but i grew tired of that configuration. I might have to become untired of it again, just in case.

My old .htaccess file looked thus:


<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{QUERY_STRING}     ^s=([^\&]*)     [NC]
RewriteRule ^(.*)$              /search/%1/?    [L,R]
</IfModule>

Along with moving my Wordpress stuff to a subdirectory, things aren’t really flying anymore…

Tags: , ,

I added a few bits and pieces to pimp my web experience, and i thought i’d document them here. First stuff that i added to Firefox, then two plugins i added to Wordpress.

Delicious integration

I’m a great fan of server based services. I like to have my data in the cloud so that i can reach them regardless of which computer i’m on, or whichever browser i’m using on that computer — or indeed, whichever operating system. My mail is at GMail and i read my feeds with Google Reader. I also have most of my bookmarks at Google Bookmarks (judging from this, you could also argue that i’m a Google fanboy — oh dear).

The other day, i finally registered to del.icio.us. I’m a bit undecided whether it is a good idea or not for me to use delicious bookmarks, since as i said, my bookmarks-in-the-cloud are on Google. The reason for having them on Google is that there was good browser integration for them using the (kinda scary) Google toolbar if you just remove all other whistles and bells except for the Goog bookmark star. The Google bookmarks will also show up in my goog web search results. But then i realized that an old friend of mine, the Flock browser, had updated and i decided to install it. But alas, while Flock has a bunch of nifty service integrations, Google bookmarks ain’t tere. So i reg’d to Delicious.

Truth is, i’m a bit disappointed. The plugin has a bunch of ways to browse your bookmarks, but the integration doesn’t just feel native. There’s a button to add the page to your local bookmarks and there’s one (well, three) to send your stuff to Delicious. Flock gets by with one button. Firefox could too. And i might be in for a short relationship with Delicious. We’ll have to see.

Sxipper

I stumbled across Sxip a few years ago when i saw Dick Hardt’s (yup) mind-shattering presentation slides on identity. Sxip, which despite the spelling is pronounced “skip”, have a vision involving OpenID, which i too think is way nifty, but never got around implementing. Well, now the sxip guys have released their Sxipper identity manager (effectively, a password manager) as a Firefox plugin. I’m still having it installed just on one box since i’m a bit uneasy about the idea of having a bunch of my passwords syncable on the web. But i’m considering it.

Read it later

This one’s a gem, and does exactly as prescribed. It’s (yet) a kind of a bookmarking service, but with the explicit intent that you put a page on the Read it later list and retrieve it when you have proper time. Read it later also syncs between browsers and computers using the magic of the cloud.

ClaimID

ClaimID isn’t a Firefox plugin, but an Open ID service “for the rest of us”. Basically it’s a melting pot for your OpenID identity and the stuff you claim to be yours.

A big question for me was which provider would be the one to host my online identity. In the end it became ClaimID, but i’m using my domain name so that my “vanity OpenID” actually is based on my name. Of course, i also have a few other OpenIDs from web services that boil it in to their package; technorati and yahoo!. And possibly a few more that i haven’t thought of yet :)

Share This

I installed the Share This plugin for my blog. Should i write anything of interest, you’re now able to send those immortal words to delicious, email, or the moon.  OK, not the moon, but just about anywhere else. Just in case, you know.

WP Mobile Edition

I would have thought that Wordpress in all its word-impressive-ness would have a mobile version of itself built in, but no. Then again, i never noticed it since i’m usually browsing stuff with Opera Mini, which munges any page into a mobile one… and if i’m reading feeds on my cell phone, the page is munged both with Opera mini and the Google mobile proxy.

Mobile Edition is a Wordpress plugin and iIt Should Just Work™ when you browse Navelfluff with a mobile client (or just claim to be one). Please inform me if there are any problems with the Mobile view!

Tags: , , , , , , , , , , ,

Ella arriveth

So, now i too have upgraded to Wordpress 2.1Ella“. It was a remarkably painless operation but i do admit that i was a tad nervous when overwriting my old WP hierarchy with the new one.

I have the WP hierarchy as the root of my html directory, whereas the default WP installation suggests having it in a wordpress directory under the html directory. What i did was to create a foo/ directory under the html/ directory, untar the distribution tarball from there, then from html/foo/, i cp -R wordpress/ ../ and rm -rf foo/ from my html directory.

If the lines above looked like Hebrew to you, either you don’t need to worry, or i’m fluent in Hebrew.

Tags: ,

Finemang!  Sen jag installerade Bad Behavio(u)r-pluggaren i Wordpressen så har min mängd kommentarspam minskat drastiskt.  Då jag tidigare marrat om hundratals kommentar-spammar i min blogg har Akismet (WP:ns “inbyggda” spamfilter) nu bara sexton spammar i kö.  Kalas!

Tags: ,

Damn vikings

After i received notification, no, fifty-eight notifications, about comment spams that even Akismet (the smap filter of this blog) didn’t catch, i decided to raise the protective measures. So i installed Bad Behavio(u)r, a filter for PHP-driven sites that tiest to catch the bad guys based on their http behaviour. I installed it on another project site that i never seem to have the time to really kick off.

I considered a plugin called HashCash, a really nifty-sounding little thing that uses cryptography (an MD5 checksum) that automagically gets verified on both the server and the client side, using AJAX, but i decided against it since i don’t know how well PDAs, web tablets and other exotic paraphernalia handles such technology. But the idea is really nifty and i urge you to look into it if you’re at all interested in user-centred security.

Now it you can’t send comments to Navelfluff (and yer not a spammer), mail me on llauren @ this site, and i’ll see if i should lower the shields just a bit..

Tags: , , ,

Puuuuuuuuuuuuuuuuuuuust! Nu har jag äntligen kopierat vart och ett blogginlägg till denna server. Stuffet på Blogsome gick någorlunda smärtfritt till slut, med hjälp av Qumana (som jag befarade var omöjligt igår), men de drygt hundra inläggen jag hade på Nanobloggen fick jag copy-paste’a för hand. En i sänder. Lite underlättade det att Wordpressens post-editor godkänner färdigformaterad HTML vid copy-paste-ning.

Vad har jag lärt mej under processen?

  • Jag har haft jobb, blivit av med jobb, gått på arbetsintervju jag glömt att jag gått på, fått nytt jobb med UNDP i Östra Timor, slutat med det jobbet, kommit hem till familjen och fått nytt jobb på Tekniska Högskolan. Fast det skrev jag visst aldrig om.
  • Jag har skrivit om tekniska grunkor och attiraljer jag inte fått, om usability, om Kuha. och Marillion, samt en hel del strunt.
  • Jag har inte skrivit om vad jag gjorde på jobbet i Timor. UNV-reglerna förbjöd sånt (och det var knappt att de ville tillåta mej skriva nånting alls).
  • Jag har skrivit uppretade ord om krig, elände och digitala orättvisor.
  • Ett drygt år tillbaka verkade jag skriva under väldigt konstiga tider. Orsaken var först den att serverklockan var rejält ur led, och sedan att jag i ett halvår skrev från Timoresisk tidszon.
  • MTV spelar en massa skit efter midnatt. Hälften av videorna är rappvideon, hälften har sanslöst hotta chickar som sjunger plattityder i stil med “damm-diddi-diddi, that’s the way my heart goes”. Sisådär ett spår på tio är nåt jag skulle ha valt själv.
  • Jag har på senare tiden haft besökare från Hawaii (Paul, is that you?), Island, Sydafrika, Etiopien, halva Europa, en bunt Asien-länder och någon från Australien. Skulle vara kul om ni lämnade en kommentar ibland!
  • Det är två-års-jubíleum på Navelfluff om ett par veckor.

Att på det sättet! Nu är det bara att börja konfigurera sönder den här servern! :)

Tags: , , , ,

« Older entries

Bad Behavior has blocked 648 access attempts in the last 7 days.

Bear