Remove Paging From WordPress Archives [en]

[fr] Pour supprimer les "pages" de vos archives WordPress, utilisez le code ci-dessous dans le fichier functions.php du thème que vous utilisez.

Thanks a lot to Matt for giving me the code which allows me to remove paging from the archives on this blog. I’ve been wanting to do that for a long time, but didn’t know where to start.

Just add the following code to the functions.php file of your theme.

function yay_nopaging($query) {
if ( !is_home() && !is_feed() && '' === $query->get('nopaging') )
    $query->set('nopaging', 1);
}

add_action('parse_query', 'yay_nopaging');

Unfortunately, this breaks the Recent Posts widget, which starts displaying… all the posts (that’s a lot of them, here). I removed the widget, but if you have a solution, I’d be happy to hear it.

WordPress not Sending Pings Anymore [en]

[fr] WordPress fait des caprices et a arrêté d'envoyer des pings automatiques (trackback, pingback) sans me prévenir. Grinche.

Once upon a time, I loved WordPress because I didn’t have to enter trackback addresses manually anymore — at least, not when I was linking other WordPress blogs, or pingback-enabled blogging tools.

Those days are gone, and I’m not quite sure when it started. I’ve been having a creepy feeling for sometime that I wasn’t getting as many “internal” (CTTS to CTTS) trackbacks as I should. Today, I checked.

Heck.

You know me, I specialize in weird, not-so-reproducible issues. So, it wouldn’t be that WordPress has stopped sending pings altogether, no, that would be too simple.

WordPress has stopped sending pings *most of the time*. But sometimes, every now and again, it sends one. Or a couple. Or three.

What is going on, would you say?

Basic Bilingual and Bunny's Technorati Tags Plugins Updated for WordPress 2.1 [en]

[fr] Mise à jour de mes deux plugins pour WP2.1 qui les cassait gravement. Mises à jour pas testées, à manier avec précaution.

Thanks to Sudar, who took the trouble to fix Bunny’s Technorati Tags so that it worked with WP2.1, here are up-to-date version of these two plugins, Bunny’s Technorati Tags and Basic Bilingual:

The previous, WordPress 2.0-compatible versions are still available:

Warning: these old versions suffer from the empties custom fields problem. Don’t use them with 2.1.

Disclaimer: I’m swamped with work, haven’t upgraded yet, and haven’t tested the new versions of the plugins. Use carefully. Let me know if there are glitches. Bunny’s Technorati Tags is the very version Sudar put online (I’m making it available here mainly as there are links to it out there beyond my control, not the least from the wp-plugins.org wiki which has been closed to editing due to spam.) For Basic Bilingual, however, I adapted the code Sudar had added to Bunny Tags, but I don’t fully understand if it works. Backup, try gingerly, and please leave comments here to let others (and myself) know if it works or breaks.

Thanks.

Invalid argument supplied for foreach() in wp-capabilities.php: Case Cracked! [en]

[fr] Le problème avec wp-capabilities.php qui fait qu'on peut se retrouver "exfermé" (enfermé dehors) de son blog WordPress (typiquement en cas de changement de serveur) semble avoir sa source dans le contenu du champ wp_user_roles dans la table wp_options. En particulier, pour la version française, "Abonné" est un rôle d'utilisateur, et en cas de problèmes d'encodage MySQL, le caractère accentué sera corrompu, causant ainsi l'erreur.

Il suffit de remplacer le caractère fautif dans PhpMyAdmin, et on retrouve l'accès à son blog. Bon, reste ensuite à régler les questions d'encodage... mais c'est déjà ça!

Finally. At last. Endlich. Enfin.

Once more, while trying to transfer a WordPress installation from one server to another, I found myself facing the dreaded problem which locks me out of my WordPress install with a rather cryptic message:

Warning: Invalid argument supplied for foreach() in /home/user/wp/wp-includes/capabilities.php on line 31

(Your lineage may vary.)

What happens is that WordPress cannot read user roles, and therefore, even though your password is accepted, you get a message telling you that you’re not welcome in the wp-admin section:

Vous n’avez pas les droits suffisants pour accéder à cette page.

Or, in English:

You do not have sufficient permissions to access this page.

A quick search on the WordPress forums told me that I was not alone in my fight with wp-capabilities.php, but that many problems had not been resolved, and more importantly, that suggested solutions often did not work for everyone.

I’ve bumped into this problem a couple of times before, and I knew that it was linked to encoding problems in the database. (I’ve had my share of encoding problems: once, twice, thrice — “once” being on of the most-visited posts on this blog, by the way, proof if needed that I’m not alone with mysql encoding issues either.)

I’ll leave the detailed resolution of how to avoid/cure the MySQL problems later (adding
mysql_query("SET NAMES 'utf8'");
to wp-db.php as detailed in this thread, and as zedrdave had already previously told me to do — should have listened! — should prevent them). So anyway, adding that line to my working WordPress install showed me that the problem was not so much in the database dumping process than in the way WordPress itself interacted with the database, because the dreaded wp-capabilities.php problem suddenly appeared on the original blog.

Now, this is where I got lucky. Browsing quickly through the first dozen or so of forum threads about wp-capability.php problems, this response caught my eye. It indicated that the source of the problem was the content of the wp_user_roles field (your prefix may vary). In this case, it had been split on more than one line.

I headed for the database, looked at the field, and didn’t see anything abnormal about it at first. All on one line, no weird characters… just before giving up, I moved the horizontal scrollbar to the end of the line, and there — Eurêka! I saw it.

Abonné

“Contributor”, in French, is “abonné”, with an accent. Accent which got horribly mangled by the MySQL problems which I’ll strive to resolve shorty. Mangled character which caused the foreach() loop to break in wp-capabilities.php, which caused the capabilities to not be loaded, which caused me to be locked out of my blog.

So, in summary: if you’re locked out of your blog and get a warning/error about wp-capabilities and some invalid foreach() loop thingy, head for PhpMyAdmin, and look carefully through the wp_user_roles field in the wp_options table. If it’s split over two or more lines, or contains funky characters, you have probably found the source of your problem.

Good luck!

OpenID at CTTS [en]

[fr] Installé OpenID sur ce blog.

Well, without really knowing what I’m doing, I’ve got myself an OpenID, and installed both the WordPress OpenID Plugin and WordPress OpenID Delagation plugins. Stuck a few links in del.icio.us.

You should normally be able to use OpenID to comment here, and I should normally be able to use OpenID where it’s accepted.

Hairy .htaccess Dreamhost WordPress Problem Solved! [en]

[fr] Résolution d'un problème qui m'a littéralement empoisonné mes vacances. Ouf.

Thanks to grimboy, my “parent” .htaccess now has two extra lines and looks like this (and the problem that has kept me awake for the last week is solved):

AddDefaultCharset OFF
# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/membres.*$ [OR]
RewriteCond %{REQUEST_URI} ^/failed_auth.html$
RewriteRule ^.*$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php

# END WordPress

Thanks so much!

Hairy .htaccess Dreamhost WordPress Problem [en]

[fr] Un des derniers problèmes qui me résistent sur le nouveau serveur.

Here’s roughly what I wrote in a support ticket I sent Dreamhost this morning. If you have any suggestions, I’ll take them.

> Hello,

> I have a site http://cafecafe.ch on which I have installed wordpress
(http://cafecafe.ch/wp/ -> displays as http://cafecafe.ch/blog with
Filosofo Homepage-Control plugin).

> That server has a subdirectory http://cafecafe.ch/membres/ which is
password-protected using .htaccess. Inside is another wordpress
install http://cafecafe.ch/membres/wp.

> I had this set up on my previous host and it worked fine.

> Now, if I go to http://cafecafe.ch/membres/ the request is caught be
the blog installed in http://cafecafe.ch/wp/, and I’m shown the page
http://cafecafe.ch/blog/.

> To make sure it wasn’t a conflict between the two wordpress installs,
I created an empty directory http://cafecafe.ch/test/ which I tried to
password-protect in the same way. The problem is the same (going to
http://cafecafe.ch/test/ displays http://cafecafe.ch/blog). If I
comment out the “request valid-user” line of the .htaccess, I get to
see the directory listing.

> Similarly, if I come back to http://cafecafe.ch/membres and comment
out that line in .htaccess, both wordpress installs work fine, with
permalinks and all (only the private blog isn’t protected anymore,
which won’t do it).

> I’ve tried not doing the password protection manually, and using what
is provided in the panel for that, but the problem remains exactly the
same.

> Weird, isn’t it?

> Hope you can help me out on this. Tried checking error logs but they
were empty.

Michael Hampton is My Hero of the Day [en]

[fr] En principe, les problèmes de serveur sont résolus. Retour à la normale aussi vite que j'arrive à transférer les données avec la connection wifi très approximative que nous avons ici.

Michael Hampton, also known as io_error just saved my life today by solving the encoding problem on my new hosting. It seems something went wrong when I imported my SQL dumps into the new database. Solving the encoding issue seems to have solved the “can log into admin but can’t do anything” WordPress issue (if someone can explain why, I’d be interested).

And danah is my heroine of the day, because after a morning of politicians and WiFi fighting, it was nice to hear an interesting talk.

WordPress DreamHost WiFi Arghl! [en]

[fr] Rah! que de problèmes.

Somebody please tie me up before I start screaming or kill somebody. I can’t stay connected to the wifi network here more than a few minutes. Dreamhost aren’t responding to my support tickets (we’re way past the 24 hour response time). This site (CTTS) is “working” (meaning, it displays more or less, and I can access the admin area and post and do stuff I normally expect to do on a blog). Another of my sites (client site behind password), which is also WordPress, which I transferred the same way (dump database, rsync files, import database) vaguely displays at times, lets me in the admin area, but doesn’t let me do anything once I’m in there (dashboard only).

Add to that I’m not really enthusiastic about the title of the panel I’m on, but unfortunately I don’t have anything better to offer.

Arghl!

Conversation Feeds [en]

A couple of weeks back, I was having a chat with Max, one of our new developers. We were discussing improvements that could be made to the “My Conversations” page, and the conversation drifted towards RSS feeds (well, feeds in general). I started thinking about how feeds could be made more useful for conversations (because, frankly, I don’t know about you, but I have a lot of trouble following conversations through feeds). I’d like to share some of my thoughts with you, and you can let me know what yours are.

  • When they are blog posts, feed items are reasonably independent from one-another. You can read a single feed item and it makes sense on its own.
  • When the elements of a feed are parts of a conversation, however, that changes. Whether the conversation is a comment stream on a blog post or the replies to a forum topic, the different elements in it are closely linked, and it’s difficult to understand one of them without seeing it really in context. Context here is two things: the initial article, forum topic, or even web page which sparked the conversation; the other comments which led the conversation to that point, or at least a number of the comments immediately preceding it in the conversation.

Now, if you keep that in mind, you’ll understand that feeds are pretty adequate for following:

  • a series of loosely joined articles (blog posts)
  • a single conversation

They are not the ideal solution for following multiple conversations simultaneously.

However, the very reason one would want to subscribe to conversation, usually, is because there is more than one to follow. (If you’re just having one conversation, or read only one blog, subscribing becomes less useful.)

So, how could we organise comment/conversation feeds to make them more usable?

The main problem I have with multiple conversation feeds is that the conversations are all mixed up. Unless I check the feed very frequently and have all the ongoing conversations present in my mind, and they’re not too busy, the main function of the feed will be to let me know which conversations have been updated, and give me a handy link to go and check them out on the original webpage.

I think a conversation feed should do more than that. Here’s how I, as a user, would like to see the conversations I’m following.

  • First, make the conversation the feed element, instead of the comment. I know this sounds bad, because we expect a feed element to be atomic, and a conversation is clearly not atomic — a comment or conversation element is. But from the reader’s point of view, the unit of meaning here is the conversation. As I said above, a comment alone usually has little value.
  • Second, provide context. If there are two new comments in a conversation I’m following, give me those two, plus 2-3 older ones to help me remember where I left off. Give me the title of the blog/forum and the post/topic name. And give me a link to the original publication page if I want to read everything.

Obviously, this can’t be done with a traditional RSS/atom implementation. You need something somewhere to count the new comments, distribute them into their respective conversations, and package it all neatly. This is where I see a service like coComment step in.

Do you think that presenting conversation feeds in this way would make them more useful for you? What other ideas would you have?

I’d like to stress that this is just my personal thinking. We’re not planning to replace the current coComment feeds by this system (and if that were to happen, we’d leave the “traditional” ones in too, I’m certain).

So. How would you like to read your conversation feeds?

Initially posted on the coComment blog.