Profiles – Weekly Update 9

Hi Everyone!

As you know, I’m working on enhancing The community site where WordPress code is created and shared by the users. This is where you can download the source code for WordPress core, plugins and themes as well as the central location for community conversations and organization. as a part of GSoC’13 and this is my ninth weekly update regarding how things are going.

Once again, you can find my whole final schedule here:

As you can see from the schedule, the things I was planning to complete by now was as follows:

August 12th – All the known bug fixes should be done by now.

…and it’s done! 🙂

Since I tested the plugins pretty much every single week until the midterm evaluations and fixed the issues I came across, they really seem bug-free in my development environment. Therefore, no changes were made there.

The theme, on the other hand, is the newest piece of the puzzle and naturally it had bugs/unhandled scenarios such as elements overflowing into other elements, missing the code for the Google Plus icon, design of the areas when the user is not logged in, design of the elements that change when the user is displaying his/her own profile but does not have the necessary info on file etc. These are all fixed now.

In addition to these fixes, reorganized the PHPPHP PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. code by removing unnecessary codes and making sure everything complies with WordPress’ PHP Coding Standards. Also, refactored the CSSCSS CSS is an acronym for cascading style sheets. This is what controls the design or look and feel of a site. line-by-line to ensure that it fully complies with WordPress’ CSS Coding Standards which resulted in making too many changes.

Finally, as I mentioned in my previous blog post, I was planning to work on how we can handle props in commit messages better which I also did. Had some time to learn regular expressions so I was able to write a better regular expression for it and handle the matches in a cleaner way. After spending hours staring at my regular expression to find out what’s wrong with it as it was not returning all matches for each sub-expression, I learned that PCRE is only capable of returning the last match of each sub-expression. Therefore, to my knowledge, it is not possible to match usernames solely with a regular expression. I tested my new solution on the last 25 commit messages and successfully extracted usernames from them.

Here is my previous quick and temporary solution:

preg_match('/props ([a-zA-Z0-9, ])*./', $_POST['message'], $matches);
$usernames = substr($matches[0], 6, -1);
$usernames = explode(', ', $usernames);

And here is my new and slightly better solution: (I’m looking forward to your suggestions on enhancing it)

$regex = '/props\s+((?:(?:\w+\b(?<!\bfixes))(?:[,][ ]*)?)+)/i';
preg_match_all( $regex, $_POST['message'], $matches );
$usernames = explode( ',', $matches[1][0] );
$usernames = array_map( 'trim', $usernames );
$usernames = array_filter( $usernames );

So everything I planned for this week has been completed, except the meeting with @jenmylo.

My original plan for the next week was as follows:

August 19th – Another round of feedbacks from the users should be gathered by now.

Since we were not able to evaluate the first round of feedbacks, I think we should start with doing that and ask for another round of feedbacks once the necessary changes/implementations are made.

See you next week!

#gsoc, #profiles, #weekly-update