This week on twitter 2009-10-25

Powered by Twitter Tools

This week on twitter 2009-10-18

Powered by Twitter Tools

This week on twitter 2009-10-11

Powered by Twitter Tools

Follow Self Pings

The Problem

Wordpres creates all links to comment author's site or pingbacks/trackbacks with "nofollow external" . This includes links to your own blog. Apparently this is bad for your pagerank according to this post:Pinging Your Own Blog Posts? Good or Bad?

The Solution

On that article mentioned above, the author suggested that you can use a plugin that would make wordpress stop creating pingback links to your own blog. I didn't like that idea so here's mine: a plugin that will make wordpres NOT add "external nofollow" to the pings to your own blog.

The plugin doesn't require any configuration, just download, install , activate and forget about it.

Download

UPDATE: The plugin is now hosted in wordpress plugins directory. That means you can install it dirrectly from  your wordpress admin or go to it's page to download it: Follow Self Pings Plugin

The first version of the plugin had a small bug that prevented it from working on blogs that were installed in one directory and had the home page pointing to something else. This bug is fixed in version 0.2 . You should be able to  update it from the plugin admin.

This week on twitter 2009-10-04

  • RT: @swhitley: Build your own "Twitter" w/ WordPress. A decentralized microblogging network. - "Introducing PopCann" - http://is.gd/3KS0M #
  • bst hex editor for linux , especially if you like VIM http://bvi.sourceforge.net/ #
  • compile with debugging symbols: gcc -g -g2 , make sure there's no ( -s ) in there and gdb will even tell you the line where code crashes 🙂 #
  • wow I surprised by file-roller. Opened file in archive, modified, saved and it asked me if I want to update the archive too. Impressive! 🙂 #
  • what's wrong with wp-e-commerce thickbox.js ? #
  • why are banks, paypal and everybody else who's affected by phishing refusing to use email authentication? http://ff.im/8W7Q6 #
  • actually paypal does use DKIM for email authentication, maybe that's why I didn't get any paypal phishing lately #
  • @brassblogs you can use the WP-PageNavi plugin http://tinyurl.com/59kwmq . Normally it's used on main page but you can use it on single too in reply to brassblogs #
  • @brassblogs do you want to paginate your post or do you want to just display links to the rest of the posts on the post page ? in reply to brassblogs #
  • @brassblogs I think you just have to call wp_pagenavi() in the theme where you want the links in reply to brassblogs #
  • @brassblogs I was wrong , wp-pagenavi can't be used for what you want in reply to brassblogs #
  • The Duct Tape Programmer - Joel on Software http://ff.im/90fh4 #
  • RT @goowaveinvites: we got some google wave invites... you need one? RT this !! #googlewave #wave #
  • @DominiqueGoh What do you mean ? in reply to DominiqueGoh #
  • @kathpay if only 1 in 5 emails never see the inbox and 95% of all email is spam that means the spam filters are almost non existent. in reply to kathpay #
  • @kathpay maybe you mean 1 in 5 legitimate mails ... in reply to kathpay #
  • @DominiqueGoh ah ok. Here (Romania) it's celebrated on June 1'st , but happy Children's Day to you and your family! in reply to DominiqueGoh #
  • Is asynchronous replication still working with @gluster . How? #
  • @khelo nu-i adevarat. Daca nu mergi la scoala nu se pune ca ai inceput scoala 🙂 in reply to khelo #
  • @khelo nici la aia nu se pune 🙂 in reply to khelo #
  • RT: @yoast: Searching without result: Why tracking Zero Result Searches is important, and how to do it in WP and GA: http://yoa.st/qq #
  • fedora seems to accept a 32 bit package as a dependency for a 64 bit package. What a mess! #
  • RT: @f055: Quick Tip: don't do <a name="anchor" />, it breaks layout on Safari. Do <a name="anchor"></a> #
  • RT: @ciorici: I hate Chrome browser for not supporting @font-face. #2009, #fail #
  • @hacool please don't do that. Why does it seem ok if it's biz-to-biz? in reply to hacool #
  • Start your permalink structure with %post_id% if have thousands of pages in #wordpress. It's much faster! http://ff.im/97wL9 #
  • @tvdw maybe not so strange. ssh has compression and maybe better qos from isp. another factor may be the better link between you and ssh srv in reply to tvdw #
  • @dmuth wow, reminds me of recursion gone wild in the dos programming days 🙂 in reply to dmuth #
  • @ScottAllen you don't have to be an expert for this. use g if you want everything to work with it , use n if you want the best speed. n, ... in reply to ScottAllen #
  • @ScottAllen if the router only knows "n" then yes, but some ( most? ) n routers also talk g and even b in reply to ScottAllen #
  • #thunderbird global inbox good or bad? First I hated it now I might use it ... #
  • oh wow, that #thunderbird 3.0 feature is actually called "Smart Folders" and it's pretty cool: http://tinyurl.com/ycqfnf4 #
  • I just disabled follower notifications from twitter. No more bots bothering me now 🙂 #
  • @tvdw nah... removed notifications because I don't want to know anymore. in reply to tvdw #
  • @tvdw yes, that's it 😀 in reply to tvdw #
  • why would #thunderbird want to save the message to the Sent folder when I just want to save it as a draft ? #
  • @alauser maybe bots don't follow you . I'd love to be in that position 🙂 in reply to alauser #
  • did anyone actually get any invites from all those #googlewave invites set up especially for that ? #
  • I mean from all those twitter accounts that promise to give #googlewave invites if you RT #

Powered by Twitter Tools

This week on twitter 2009-09-27

Powered by Twitter Tools

Faster wordpress page admin

In a recent post about wordpress I explained how you can create a lot of pages really fast.  If that went well and you inserted a few thousand pages in your wordpress blog  the page admin became useless. Displaying the list of pages would take 3 minutes for 7000 pages on my test server.

It seems this is not a new problem and there is a bug created in 2007 about it. Although it seems like there was a patch to fix this, the problem still exists in the 2.8.4 version.

Why is this so slow ?

Short story: because wordpress is trying to display and sort pages hierarchically .

At first I thought the problem was caused by the sql queries that fetched all the pages ( even though it doesn't display all of them on a page ) but that was not the case.

After profiling the code with xdebug and Kcachegrind I found there were a few parts of the code that were taking the longest time to complete.

The main problem is that wordpress is trying to find the children for all the pages in an inefficient way. There is this function get_page_children in wp-includes/post.php  which was taking about 2 thirds of the total time to complete ( ~ 2 minutes on my example  ).

The Solution

I rewrote that function to make it a lot more efficient. In my case it reduced the time from 2 minute to 1-2 seconds but on other page hierarchy it might take more, the worst case being when every page is the parent of another page.  The diff is here : [download id="15"]

The second problem is that wordpress updates the page cache every time you list pages. This was taking almost 1 minute to complete. I'm not sure if it's the right thing to just remove that call to update_page_cache in wp-includes/post.php get_pages , but doing that made the page admin load in about 15 seconds.

Now this might still be annoying but it's way better then 3 minutes. Hopefully at least the new get_page_children function will b included in the next wordpress release... maybe you can help promote this ticket by giving it a positive vote although I'm not sure if those votes actually have any influence.

This week on twitter 2009-09-20

Powered by Twitter Tools

Fast page insert in wordpress

You want to create a lot of pages in wordpress using a script to populate a blog with content you might have. To make sure your script will be compatible with future versions of wordpress you want to use wp_insert_post

The Problem

The more pages you add the slower your script will be. With about 700 pages my script took 12 seconds to add a new page.
After digging through the code I found out that wp_insert_code calls $wp_rewrite->flush_rules() every time a new post or page is inserted and that this is what takes the most time to finish.
Now it makes sense, the more pages you have the more rules ( permalinks ) you have and more time it will take to finish that function call.

The Solution

The call to $wp_rewrite->flush_rules() can be disabled by defining WP_IMPORTING. Now inserting a post takes just a second or less. But you still have to call $wp_rewrite->flush_rules() after you're done inserting all posts. This call will take quite a lot depending on the total number of posts/pages you have but it's a lot better to call it only once then a few hundreds or thousand times.

The way wordpress updates it's rules needs to change. Even if we can solve the bulk import problem by calling flush_rules at the end , we end up with a blog with thousands of pages where trying to publish a new post manually might take 30 or more seconds.

This week on twitter 2009-09-13

  • Why Nobody Reads Your Blog http://ff.im/7LDOA #
  • just upgraded an etch ami to lenny, thanks: http://bit.ly/Ynpvl #
  • json_decode was buggy on php 5.2.0 (etch ) #
  • Email Marketing Works Because... http://ff.im/7Peue #
  • I got a lot of followers in the last few minutes. I wonder why... Please drop me a reply if you just started following me. #
  • if you're not a bot, that is 🙂 #
  • @jockr @yosit thanks for letting me know in reply to jockr #
  • Thanks to everyone that let me know about the tweetdeck directory #
  • wow I just noticed I have 31 active plugins in wordpress. Should I be worried ? What's your number? #
  • The big drop off http://ff.im/7TcNL #
  • RT: @elenaplop: Reading Agile vs Waterfall vs Iterative vs Lean Software Development - In Pictures! http://bit.ly/LlAoV #
  • can firefox remember passwords by URL instead of domain name ? #
  • Encrypting Your Dropbox Seamlessly and Automatically & Pragmattica http://ff.im/7U9ro #
  • change firefoxs saved passwords - snarfed.org http://ff.im/7U9rm #
  • RT: @wptavern: LOL reviewing the WordPress Dev Meeting yesterday and saw @westi write Automatic as Automattic. They have him brainwashed! #
  • I used chromium for a few hours yesterday. It really seems faster then FF 3.5 but without Firebug it's almost useless to me #
  • RT: @vladstan: RT @adriana_cocic: Russia's Pres. Medvedev has decreed a new holiday 4 the country: http://bit.ly/e1ao3 (via @bogdanlucaciu) #
  • Programmers top 10 sentences http://ff.im/81jGu #
  • The difference between a unique index and primary key in MySQL http://ff.im/82cLF #
  • Feedback loops being replaced by engagement? | MailChimp Email Marketing Blog http://ff.im/82xKM #
  • http://bit.ly/3rDPjM
    http://ff.im/82Jcx #

Powered by Twitter Tools