My Lifestream – PHP, Curl, CA & Certificate Issues

I use my own lifestream plugin to feed my blog page with activity from other sites.

A (long) while ago HTTPS feeds stopped working, basically due to certificate trust issues.

Now the lifestream plugin uses WordPress built in functions to perform HTTP requests…. and this was not something I wanted to change. It’s taken a bit of exploring to work out why the default configuration did not work… and then find the best way to patch it.

Eventually I found out that you can set the PHP_CURL CA Path in php.ini using the curl.cainfo directive. On CentOS the “well known” CAs are stored in /etc/pki/tls/certs/ therefore the fix was quite simple, add the following to /etc/php.ini

curl.cainfo = /etc/pki/tls/certs/

Job done! Now HTTPS only site (like github) lifestream nicely!

Making your WordPress.org/extend/plugin pages look cool!

Whilst browsing what is on offer at wordpress.org/extend I noticed that the plugins by automattic had fancy banners (e.g. jetpack & buddypress)… I wanted in!

Since the text on these pages is generated from the readme.txt in a given plugin’s repo I figured I’d take a look there and see if the automattic guys were doing anything different… oh yeah, there were!

These repo’s had a “assets” folder in the root, and in there was a banner-772×250.png. Simply by generating my own banner (772px wide by 250px high), creating an assets folder in each of my repos and committing did the trick – so secret sauce required! (NOTE:You have to wait a while for wp.org to update, I waited overnight)

I think these are looking rather groovy :)

LINICKX LifeStream Version 0.3

linickx lifestreaam version 0.03 logo
It’s been a very long time since I’ve needed to look at this plugin but since linickx.com has moved to twentyeleven I wanted to take advantage of post formats; this has motivated me to make some minor updates.

New Fetures

  • Post Format Support
    Feeds can be assigned post formats, Standard is the default format if you theme doesn’t support this, twentlyelevn does and I think the link format works quite well.
  • Fail without Bail
    A bug I’d just lived with was if the feed was corrupt then the plugin would simply crash and burn, sometimes a factory reset was required to recover. Now the plugin will detect the error, dump the message and carry on… much better!
  • Admin Page Updates
    I’ve been slowly adding context help to my plugins, you know the little help in the top right hand corner, so help is now even closer. The news feed at the bottom will now take advantage of the fail-without-bail feature for when linickx.com is down. The final change here is a dontate feature, there is a tick box to remove this ;)

All the old features still exist and the same old information applies…

Enjoy!

linickx on github


For your social coding pleasure, linickx code is now in github!

Yesterday I completed the subversion mirror of my WordPress projects – phpbb_recent_topics , root cookie and linickx lifestream – now this isn’t a migration, it is a mirror! For the time being I’m happy using the subversion tools provided by Automattic and the WordPress team but I understand that git is gaining momentum and many are switching, basically I’m hoping this makes it easier for the WP community to get in touch or make suggestions to the code.

I’m also working on uploading some of my old work, I rely heavily on google to broadcast my wares and perhaps there are some old dinosaurs that need resurrecting by a new community of devs? Well if you’re feeling nosey “A is for Abandonware

It’s likely that new code and projects will appear on git hub, I’ve been toying with running subversion on linickx.com but now that Xcode4 has git built in this cloud based social service might be a better option…. I guess only time will tell!

Enjoy!

Dear Edgar, in response to your lifestream questions.

I’ve recently received this message thru my contact form, now it is either a very odd spam/phishing message or Edgar made a mistake on his email address as the domain doesn’t exist. Either way I’ve been asked QU 2 before so here’s my response while I update the FAQ :)

Dear Creator of Plugin, thank you very much for your great job. I am trying to use it in web site.
i am trying to use your plugin LINICKX LifeStream v0.2 and i have 2 questions.
1. I inserted 23 URL of Feeds but plugin loading only 3 of them, why?
2. Could I load also content of posts, if yes than how?
great thanks!
best regards
Edgar

Actually Edgar I’ve only tested with about 5 feeds, so I will load up my test site and see what happens, it could be possible that your feed 4 is corrupt and blocking the rest.

If you wish to create posts from feeds see FeedWordPress by Charles Johnson, I was planning to include this functionality but issues mean that now I’m not bothering, see line L236 of run.php, feel free to submit a patch if you can fix it.

Festive Regards,

LINICKX LifeStream V0.2

Screen-shot of config screen

Screen-shot of config screen

UPDATE: This Plugin has been updated, the below links to the new file, but please comment on the new post, thanks.

Version 0.2 is the first feature update to my LINICKX Lifestream plug-in. This version incorporates all the minor bug fixes from version 0.1 -> 0.1.3 and includes what I call my “Troubleshooting Feature Pack”.

Version 0.1.x was plagued by a hidden multi-post issue, so not only is this fixed in V0.2, but I’ve included the tools used by myself to fix the issue. If you’ve been effected by this, use the factory reset option to clear out the lifestream plug-in, the next time it runs new posts will be created of all your feeds… so yes you will get double posts… but that will then be the last time it happens! :)

Plug-in Features:

  • Admin Feature Pack (NEW)
    Verbose Cron Mode, now you can see what the plug-in is doing!
    View the contents of the Lifestream Feed DB
    View the URLS, Tags & Categories stored in the plugin
    Factory Reset, remove all the settings without having to uninstall -> re-install
  • Stream Any Feed.
    Most internet services like digg, twitter, lastfm and the like support RSS feeds of your activity, so you can stream any service even if I haven’t heard about it yet!
  • Posts are created from the feeds/stream.
    Each Feed item creates a new post, you can tag & categorise your posts to give each stream a different look & feel in your WordPress templates.
  • No dependencies.
    LINICKX LifeStream uses WordPress functions to do it’s work, so yes it’ll work on PHP4 & PHP5 and you don’t need to update simplepie or an-other dependancy.
  • Flexible updating.
    By default LINICKX LifeStream should just work, WordPress will fetch the feeds every 5 minutes and store them in the WP Database, but you can change that. If you want to cron your updates every 1 minute you can, if you want the DB store in a file not in MySQL that’s not a problem either.

Bug Fixes

  • Version 0.2 Multi-Post issue – http://wordpress.org/support/topic/330243
  • Pushed Version 0.1.3 more bug fixes; 0.1.2 broke auto updates, so 0.1.3 fixes it again!
    linickx.com was having execution timeout issues, so theres a patch to fix that for other users
    I’ve also introduced a config.php so that upgrades do not overwrite $WPDIR set by users.
  • Pushed version 0.1.2 to fix error in dashboard reported by Markus .
  • Pushed version 0.1.1 as the directory path changed when wordpress.org created their .zip file… all should be working again.

Right now on LINICKX.com this plugin is streaming Digg, Google Reader and WordPress Commits… keep an eye for new things streamed such as delicious & last fm :cool:

I’m still looking for help.
If you think you can javascript/ajax the admin interface, or my plug-in WordPress MU compatible, please let me know.

Disclaimer
Plug-in development is a hobby, I have a full time job that takes priority. Feel free to leave comments on this post but ask support questions to the WordPress community. I will update this plugin as and when I need features to improve linickx.com and will consider any patches submitted including any good ideas you have.

If you use this plug-in, please consider donating as I give this code away for free and giving something back is good for your kama :cool: