An Open Source Model, Insane

Pink: Think about open source software in general—whether it’s Linux or Apache. Suppose I’d gone to an economist or management consultant 25 years ago and said, “I’ve got a cool new business model for making software. Here’s how it works: A bunch of intrinsically motivated people around the world get together to do technically sophisticated stuff for no pay. And then after working really hard, they give away their product for free. Trust me: It’s going to be huge.”

Shirky: He would have thought you were insane.

[link] Cognitive Surplus: Th Great Spare-Time Revolution

Posted in Internet | Leave a comment

Decentralized Social Network

I think the future of the social web lies in decentralized networks. BuddyPress has the opportunity to become a platform for a decentralized social network. Many of the tools required to pull this off already exist. This is how I would go about it.

First of all, I would use WordPress as the underlining platform. This allow people to make posts and comments, and have an identity online. More importantly in the scope of different types of social networks, it allows people to have a unique design if they wish. WordPress and it’s plugins have a ton of features that are critical to easy online publishing.

On top of that I would add the BuddyPress plugin. This allow people to have social contacts, such as friends, co-workers, or family. If you wanted to add a person to your network, you would use one of three methods. Option one is to ping their network from your network. The second option is to visit their website, take advantage a WordPress feature called Press This and ping their network from your network without knowing typing in any information. The third option would be to use a feature built in on their site in which their network would ping your network on your behalf. Every method would activate a contact request between the two parts and be filtered by verifying your identity first.

Your list of contacts would be stored on your website and have a link to each of your contact’s websites. This list could be used to display information about who you know, who can access what on your website, and allow your website to fetch updates about your contacts.

In order to keep information private between known contact, a single-sign-on system would be used, such as OpenID or WebID. This barrier would keep unknown people away from personal information when they visit your site directly. In order to secure the data being sent in between networks a send only system would be used. This means unauthorized websites can not pose as known contacts. A verification process, using keys, would also prevent unauthorized websites from obtaining secure information.

The meta data on your homepage would hold your name, single-sign-on name, avatar, and other information in order to make the connection between new contacts easier. This feature would requested contacts to know who you are by other information other than your website address.

When you click on someone’s name or image you would go to their site. At their site you would be logged in through your single-sign-on system and could comment on their images, post, or other comments. A pingback system would then share you comments with your own website, allowing your hub to be up-to-date on your activities. In this case both sites would own and have copies of the comments.

A push system would allow you to stay up-to-date with other people’s activities. A push system tells all interested parties in your contact list about updates, so contact’s network sent updates to your network as they happen.

Many, if not all the tools exist to make a distributed social network with WordPress and BuddyPress. It’s just a matter of putting it all together and making it easy for people to join in. This would definitely be a cool project to work on and allow more of the information on the internet to be integrated together. When people control their own data, it allow them to be as private as they would like, but it also allows them the opportunity to add their own features and take things where they want to go.

Posted in WordPress | Leave a comment

WordPress Stats Teaser 3

OpenTickets

Since that data takes nearly a dozen hours to mine, I haven’t updated in a week or two. For this preview I didn’t fix the dates, so it counts each through each month since April 2004.

I don’t think this graph shows WordPress Trac as getting worse, rather work comes in waves (each version) and inflates, in general, over time.

Posted in WordPress | Leave a comment

WordPress Stats Teaser 2

Before I start working on the complicated graphs, I thought I would do a few more simple ones. With these simple ones I can quickly check the accuracy of my software and make sure their are no mistakes in the database. In this case an extra character was kept in the majority, but not all, of the type called “enhancement”. This threw me for a loop, because I was missing more than 2,000 tickets.

These graphs were made with a Python program I’m developing, which uses Python Google Charts. It’s lacking a few features or they are hard to find, so some image editing was done for now. Unlike the last teaser post, this one is using a different data-mining script which looks at tickets, instead of comments. Anyway, here are the graphs:

graph_type

graph_priority

Everyone is free to take, use, and republish these images. Just don’t hot-link them for the sake of my sever. I hope they will be useful to the WordPress community.

Posted in WordPress | Leave a comment

How I Would Redo The WordPress Ideas Forum

If I could change three things about the WordPress Ideas Forum, this is what it might be at first glance.

Voting System

I would change the one through five start system to a +1/-1 system. It would show the total votes for and against the idea. The total number of votes made and the percentages for and against it. This would be an improvement, because it shows quantitative results, not qualitative. The current 5-start system fails to show at a glance who is really for, against, or natural to the idea and it what quantity. Does 120 votes and 3 stars mean people are really for or really against the idea equally? Does it mean that most people are kinda for it, but a few people are really against? Or does is it some odd mix that just happens to work out to be 3 out of 5 starts. The +1/-1 system would do away with the middle ground. It’s now a go/no-go type situation. No more were going to kinda-sorta lunch the rocket. Or better yet, were not going to stall at the 10 second mark for two years.

Time-frame

The second change would be to limit the time-frame of ideas. Ideas should last no longer than two development cycles. In other words, the idea is induced in the current development cycle. It is voted on in the next development cycle. Then it is either put in the Go, No-go, or Retry At A Later Date list. The Ideas Forum should direct where development is going in the next couple of releases.

Representation

The third change would be to allow representatives. Basically you would have the power to vote toward any idea, but if you selected someone to represent you, then your vote would automatically copy theirs, unless you went and manually changed it. Meaning, if 99 people selected me as their representative, then any time I voted for something I would add 100 votes my way (99 votes on their behalf and 1 vote on my own behalf). The problem with this third change, however, is the fact that spam accounts or bogus accounts could multiple an individual’s authority. To undermine this cheating, I would suggest their be a minimum amount of account activity before they can elect a representative and that they must either remain active or continually re-elect the representative. The benefit of having representatives is that it should reduce the amount of repeat noise and help focus were development should happen. Not everyone has enough time to vote on every idea in every project their a community of, but they are smart enough to tell who has the same values and goals as their own.

Conclusion

I don’t think every idea I have is the perfect idea that everyone should follow, rather just some food for thought. Maybe this is a preview of things to come!?! WordPress is an Open Source Project and everyone is free to contribute if they wish. One thing I should mention about dreaming of changes is that it isn’t going to happen if we depend on the core developers to do it. They have their hands full and it’s not like it can just magically get done. If you want something done, your going to have to do it yourself. Depending how my schedule unfolds, I may submit some code to improve the WordPress Ideas Forum. What are three things you would change about the Ideas Forum?

Posted in WordPress | Leave a comment

WordPress Stats Teaser

I’ve begun working on a Python program that does data-mining and graphing. It’s not yet completed, but I wanted to do a little teaser of things to come. Below is a bar graph of all of the comments made in WordPress Trac on the weekday they were made. Take from it was you wish.

Day of the week comments were made in WordPress Trac

The data took something like three hours to mine and about 5 minutes to extract and graph. (Graphed in Open Office Calc. for this preview.)

Posted in WordPress | 1 Comment

Project Listing Site

I’m going to slowly change this site over to a project listing site for the most part. seams like the best plan for my schedule.

Posted in Uncategorized | Leave a comment

Technical Art

I thought I’d post a picture of the usage of my hard drive. The Fedora (Linux) Operating System provides a cool picture of how much space each folder takes up.

Fedora Disk Space Usage

Fedora Disk Space Usage

Posted in Uncategorized | Leave a comment

How do WordPress Hooks Work?

Why were WordPress hook created? Why do we need them?

WordPress hooks solve a fundamental problem with dynamic function calls in PHP: How do you insert 3rd party functions with a static function call? But also, how do you use one single call to include an unknown number of functions?

What are functions and function calls?

Looking into this more, PHP has two segments of code that deal with functions: the definition and the call.  Here is an example of the two in the respective order:

<?php
function my_new_code($name) {
  echo "Hello " . $name;
}

my_new_code('World');
?>

In that example, I, as a single author, defined the name in the definition and the call.  That example was also a case of one definition and one call.

What are WordPress Hooks?

In order to include multiple functions with a single function call, which doesn’t know the names of the functions, we need to use an indirect method and this is where the “WordPress Hook” method comes into play. For this case were going to use a predefined call and definition to do the work for us. First were going to call the fetching function.

<?php
do_action('the_location', 'World');
?>

This function call, named do_action, is going to load a function in the same manner as the first example and send it the value “the_location”. The function definition, named do_action, will then call all the 3rd party functions that are in the group “the_location” and insert them into this location in the code.

How does the do_action function find out about 3rd party functions?

The do_action function finds out about the functions it should include by a sibling function named add_action, which creates a list of all functions. You can thing of add_action as the boss and do_action as the worker. This function, like its sibling, is a predefined function in WordPress, so you only need to call it. This function call is often included next to the function definition its mentioning. The following is an example of defining my_new_code and asks WordPress to hook it on:

<?php

function my_new_code($name) {

echo “Hello ” . $name;

}

add_action(‘the_location’, ‘my_new_code’);

?>

To rap it up, you define a function, add it to the list with a given location, then when the location gets called, your function is included. Here is another nice point about WordPess Hooks, the do_action could be written by someone else, such as a theme developer or WordPress its self (Have you heard of wp_head & wp_footer anyone?). The following is the code put all together so you can clearly see what is required:

<?php
function my_new_code($name) {
  echo "Hello " . $name;
}
add_action('the_location', 'my_new_code');
do_action('the_location', 'World');
?>

Both examples out put the same thing: “Hello World”, but here is an example of how the second one could be expanded:

<?php
function my_hello_code($name) { echo "Hello " . $name; }
add_action('the_location', 'my_hello_code');
function my_what_is_up_code($name) { echo " What's up " . $name; }
add_action('the_location', 'my_what_is_up_code');
function my_bye_code($name) { echo " Bye " . $name; }
add_action('the_location', 'my_bye_code');
do_action('the_location', 'World');
?>

This will output: “Hello World What’s up World Bye World”.

This was about action hooks, what about filter hooks?

The difference between actions and filters, is that actions do not return anything, while filters will often return a variable that was passed to them, e.g. return $value;. Filter are also less likely to have print and echo within the functions they include.

Did you know that add_action calls add_filter? Which means they use the same code and create a single list of functions to include. Check it out for your self in Trac.

Related post by other authors: An Introduction to WordPress Action Hooks, Using Action Hooks in WordPress Child-Themes, Using Filter Hooks in WordPess Child-Themes.

Posted in WordPress | Leave a comment

A Bad Tip For Speeding Up Your Site

I take most things with a grain of salt. One thing in particular keeps popping up and because of my web experience I just have to question and test what I’m being told. The tip in question is converting particular PHP tags into static HTML to speed up your site. It was #2 on Pro Blog Design’s post 10 Ways to Speed up Your WordPress Blog, but also an entire post in 13 Tags To Delete From Your Theme, on the same site. At first it seams like a valid tip… less PHP means faster processing and that leads to a faster load time, but I’m a theme developer and I love my code.

To test out this tip, I setup a quick test to see how long each method took. Being a developer, I actually new quite a few ways PHP could be mixed in with HTML, so I setup the four most common methods. They are: only static HTML, echo-ing static HTML, PHP only where needed, and echo-ing everything (static and PHP parts). The results were how it first seamed, static HTML is faster… 200 times faster to be honest. So… I thought it would be faster, it turn out to be faster, and yet I still questioned the tip.

Here’s why I questioned it. A page loading time is made up of a few factors, one of them is the server processing the PHP, but the code is going to be processed at a rate of billions of commands per second. Although one PHP command never equals one command in the CPU, that’s besides the point. Removing these suggested lines of code is not going to change the speed up your website at all, because it’s only a couple of commands.

The truth is, while it may be 200 times faster to use static HTML instead of PHP, the total time of the slowest one is 1/10,000th of one second. If you are worried about that amount of time, I’d like to point out that the human reaction time is 1/10th of one second. But I will not stop there, here is the biggest factor that kills this tip… caching. If you have any caching turned on, such as in Apache or a WordPress Plugin, then it doesn’t matter if your page is a HTML document or generated through PHP, because a static copy is going to be saved in memory and the actual line of code you changed is never going to be processed. Using caching is one of a dozen ways to really speed up your site and doesn’t require hunting through a WordPress Theme.

Nothing against Pro Blog Design, just against that one bad tip that I’ve seen around the web. Sometimes it’s a matter of calling out tips and seeing if they hold up to what they clame.

Posted in Internet | 6 Comments