March 23rd, 2007Folding@Home WordPress Plugin
I’ve had a few requests for this in the last 24 hours, so here ya go.
Folding@Home is a distributed computing project with the goal of better understanding protein folding, misfolding and related diseases. I recommend anyone that has some extra clock cycles on their computer to contribute towards this and other worthy distributed computing projects.
Folding@Home Stats is a WordPress plugin that displays just what is promises. Currently, this plugin will display your total score, overall rank, number of processes completed in the last 50 days, number of processes completed in the last week, and the last time any of your computers reported a complete work unit.
You can download the latest version of Folding@Home Stats here.
Requirements:
This plugin has been tested on versions 2.0.4, 2.0.5, 2.0.7 and 2.1. It should (technically) work on anything from 1.5 up, but I can’t promise this. PHP 4.0 to 4.3 or 5.0+ is required.
Installation:
- upload the contents of the zip file to your “wp-content/plugins” directory (be sure to write them to the folding-stats directory)
- ensure your folding-stats directory is writable (required for caching)
- go to the “Plugins” main menu and find “Folding@Home Stats”, then click “Activate”
- go to the “Options / Folding Options” menu and enter your account id, and set the number of hours between stat refreshes
Usage:
- modify the theme file where you wish to display your SETI stats (usually sidebar.php) and type in the following line:
<php get_folding_stats(); ?>
Uninstallation:
- go to the “Plugins” main menu and find “Folding@Home Stats”, then click “Deactivate”
- delete the files from your “wp-content/plugins” directory
Change Log:
0.1 - Initial Release
Bug Reports:
As always with initial releases, I’m sure there will be one or two things that I forgot to check. If you happen to find a bug, please let me know.
Enjoy!















































[...] Folding@Home Stats is a WordPress plugin that displays your total score, overall rank, number of processes completed in the last 50 days. [...]
[...] Jason’s Random Thoughts » Blog Archive » Folding@Home WordPress Plugin (tags: plugin wordpress) [...]
Hi Jason,
Thanks for writing this!
First bug report: This doesn’t work on WP installations which are in their own folder (such as /wordpress/). I fixed this by changing this line in options-folding.php:
Orig: $location = get_option(’foldurl’) . ‘/wp-admin/admin.php?page=folding-stats/options-folding.php’; // Form Action URI
New: $location = get_bloginfo(’wpurl’) . ‘/wp-admin/admin.php?page=folding-stats/options-folding.php’; // Form Action URI
Also, your example code is missing a “?” after it’s opening bracket.
Thanks again!
Also, this doesn’t work if your server doesn’t allow file_get_contents to URL’s such as mine (Dreamhost). You can add this code to the end of foldingstats.php to allow the plugin to work with file_get_contents and cURL. Change your references to file_get_contents to get_contents to use this function.
function get_contents($url)
{
if(ini_get('allow_url_fopen'))
{
return file_get_contents($url);
}
else if(function_exists('curl_init'))
{
$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
return $file_contents;
}
else
{
echo 'This plugin requires you to have either allow_url_fopen or cURL. Please enable allow_url_fopen or install cURL to continue.‘;
}
}
[...] Jason 的 blog 下载这个插件。如果你不能访问作者 Jason 的 [...]
Thanks for that, Trevor. I’ll put this in the 0.2 release for everyone.
[...] Folding@Home Stats es un plugin de WordPress que despliega tu puntuación total, calificación general y número de procesos completados en los últimos 50 días. [...]
[...] Folding@Home Stats is a WordPress plugin that displays your total score, overall rank, number of processes completed in the last 50 days. [...]
[...] Visit [...]