Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

What is the best way to get an experienced WordPress developer take a look at my plugin and give constructive criticisms? I have written code to solve some of my questions on this site, and I think they could be useful to others too. However, since they would by my first public WordPress plugins, and I have seen many not-so-great examples in the public WordPress directory, I would like to know "where I stand", and how I can improve my plugins. I have read the list of best practices, and still need to apply some of them, but I would also like an answer to the more general question "Is this a good way to solve this problem?"

I just re-read the related discussion on wp-hackers (I did not realize that the participants were also so involved in this site, and that the "best practices" question is a direct result of it). I'm not sure my needs would be covered by such a system, and I agree with Paul's concerns:

When I read the original comments on this thread last week I though the purpose was to put together a peer review process where plugin developer can offer advice to other plugin developers as review of their code. I originally took this advice as something along the lines of "Well, your code works but this set of routines you've written would be better served if you just hooked into this WP filter and tried this technique (see xxx plugin as an example)". The goal I thought was to share WP plugin development knowledge and make any mediocre plugin developer a better developer. Like myself.

This would be a different scope than doing a point-by-point checklist review, it would be more of a "mentorship". It seems there are many people willing to do this, and (even better) many of them participate here on this site, so how can we transform all of that energy into something concrete?

My current example are three plugins I wrote to solve my "image resize" problem. I wrote long introductory comments to each plugin, which (I hope) makes it easier to understand my intentions without reading the full code. Is there anything else I can do to make it easier for others to take a look at it? Please ignore my current concrete request. Not only is it too early for them, but I changed my mind and don't want to spoil the general discussion with my specific situation.

share|improve this question
    
There seem to be some veteran plugin coders here, so why not ask here? –  Raphael Nov 15 '10 at 11:15
2  
@Raphael: I just did, didn't I? :-) But I wanted to generalize my question, so others might find it useful too. Maybe there are some general guidelines that one can follow to make their plugin easier to review. –  Jan Fabry Nov 15 '10 at 11:27
add comment

3 Answers

up vote 4 down vote accepted

The easiest way is a two step approach:

  1. Release your plug-in to the public. Once it's live, you'll start getting feedback from end users in addition to developers. If you want, release it as a "beta" version and heavily emphasize that in the readme file.
  2. Ask. There are veteran WordPress developers everywhere: here, on the WP-Hackers list, at WordPress jobs, stalking @wordpress on Twitter, etc. It's just a matter of throwing your plug-in out there and asking for feedback.

In general, follow the same steps as you would getting a Core patch looked at by a developer:

  • Write it
  • Document it
  • Contact a developer (either broadly through one of the above channels or directly if you can) and ask for feedback

As far as transforming the kind of "mentorship" that occurs on this site into something more concrete, that would be an organic process. As you've already mentioned, efforts to create a kind of plug-in review process before actually reviewing anything seem to have stalled. The only way to get anything off the ground is to actually start doing it. So don't just talk about finding a veteran developer and getting feedback, go out, find one, get your feedback, and write down how the process went.

Then it can be repeated with future plug-ins and future developers. But you've got to start somewhere ...

share|improve this answer
    
Thanks for the reply. One thing that held me back from directly asking you, Mike or other high-profile contributors here is that I don't want to impose on you and "force" you into doing something that you would rather not do, but are too polite to decline. And it might be better to get some feedback before I release the plugin, to prevent me and its' users from possible stupidities. –  Jan Fabry Nov 15 '10 at 21:17
    
1. Did not work for me. I have had some hundreds of downloads but not even a single vote on wordpress.org. –  Raphael Nov 16 '10 at 11:02
    
@Raphael Votes on WordPress.org aren't real feedback to begin with. The fact that you haven't gotten complaints or received any bug reports means that it's most likely working and your end-users are satisfied. Now that it's in the repository, though, it's easier for developers to get and view the source. At this point, you should move on to step 2 and ask a veteran developer to take a look and provide some feedback. –  EAMann Nov 16 '10 at 14:52
add comment

After a quick look at https://gist.github.com/675437 I saw some minor points, mostly about readability:

  • Write good code documentation: Docblocks … and inline comments whenever something isn’t absolutely clear.
  • Split looong functions into shorter separate functions. They are easier to read and to address in reviewer’s comments.
  • Align your assignment operators, add whitespace between parentheses.
  • 80 characters line length, please! Eclipse still cannot wrap long lines. :(
  • Keep your code »left«, save indents. Instead of:

.  

public function checkUrl()
{
    if (is_404()) {
        // code
    }
}

… write …

public function checkUrl()
{
    if ( ! is_404() ) {
        return;
    }
    // code
}

I have written a new plugin just tonight … and I was wondering if I may ask exactly your question. Good timing. :)

share|improve this answer
    
Thanks for your initial comments. Maybe I was a little too early, since I indeed need to do an thorough edit to make the code inline with the coding standards so it's easier to focus on contents. Good point about the "leave early to save indents" rule, but I assume the extra 4 spaces on each line of your second example are unintentional? –  Jan Fabry Nov 15 '10 at 12:39
    
Uhm, yes, Markdown mangled the formatting after the list. I’ll fix it. –  toscho Nov 15 '10 at 12:42
    
Thank you for your comments, but I re-read the original discussion on the wp-hackers list and decided to broaden the scope remove my specific request from the question. This means your answer is not so fitting anymore, perhaps you might want to delete it. –  Jan Fabry Nov 15 '10 at 16:13
add comment

It just made me think of Appscan: http://www01.ibm.com/software/rational/products/appscan/source/ ; http://www-01.ibm.com/software/rational/products/appscan/source/features/ trial of light version: http://www-01.ibm.com/software/awdtools/appscan/express/

This can do php and one can put extra rules in it to check for things. In that way a part can be automated (like some best practices as in the answer from toscho), it can check for security, coding standards, optimizations etc...

I'm just saying: if a tool can check for 80% then the 20% checks for the manual checks for a guru would be less. It would also help to generate compliance reports for use of a plugin within a large company that demands these kinds of things around additional code.

We automate things for other people so why not for ourself?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.