About a week ago, I answered my own question on the WP Hackers mailing list by posting some drop-in PHP code (to be used either in a plug-in or a functions.php file). Today, I find out that someone used that code to build a plug-in that's now available on the WordPress repository. I'm a fan of open source and collaboration ... but only when done properly. The plug-in in question contains no attribution remarks whatsoever.

Since I never explicitly said "this code is licensed under the GPL... yadda yadda yadda" when I wrote my message to the Hackers mailing list, I'm not going to hunt the guy down for failing to credit me. But this situation did get me thinking ...

What if someone built a plug-in based on code they found on this site and failed to credit the original author?

Short of calling out the GPL (or BSD, or X-11) every time we post a code snippet, what can we do to protect contributors to the site? Does the Creative Commons license at the bottom of the page apply to code, or just to the prose questions/answers/comments on the site?

Who, if anyone, can a contributor turn to if they find their code has been used in an open source (or even a proprietary) system without acknowledging their contrbution?

  • 1
    We had a little discussion about this in the chat room, you can read the transcript if you want.
    – Jan Fabry
    Commented Nov 2, 2010 at 15:32
  • Just read through. Probably this is not a problem of the license but of what can happen to the code. CC requires attribution in the form specified but as I wrote in my comment below already, I don't think you specified the way of attributing it while posting the code. So it might be even totally valid to just take the code as-is w/o any author remark. If you want to prevent that, add a copyright and/or author credit into your snippets. then the credits need to be taken over. And this requires if they mix and adapt the work to give you credits.
    – hakre
    Commented Nov 7, 2010 at 1:50
  • The GNU GPL is not a superset or the best of all open source licenses. The goal of the GNU GPL is to protect the source code from becoming proprietary. Author interests are secondary, and it is specifically not designed to be an attribution license. It doesn't even contain a stipulation to retain copyright notices as-is; it relies on local copyright laws for that requirement (not always the case).
    – mario
    Commented Nov 13, 2010 at 1:07

3 Answers 3


Hi @EAMann and others:

I've contemplated this question a lot before you raised it and I think this answer is not only is it not something you can really do anything about, I don't think it is something we want to discourage.

Writing code is just one piece of execution; the fact they put up a plugin where you didn't shows they are executing more effectively (note, I struggle with execution all the time, so I'm keenly aware of my own shortcomings in this area.) Remember they also have to document and support a plugin which you do not have to do just by writing the code. So even though I know it feels bad in the gut, I think it's a good thing that it happens.

(As an aside, I hate going to the websites of people who are asking really n00b questions here and on LinkedIn's WordPress group only to find their site boasting about what experts they are. But I digress...)

Another way to look at it is, how are you harmed? If they published something and attributed you and then it failed you might be served as a defendant in a lawsuit (stranger things have happened.) But if they didn't mention you, how can it affect you? Unless of course they competed with you for a project and they won while you lost. But that's so unlikely, and if you know it then maybe you can mention it to the lost client? (dunno if I would though.) And if they get business using your stuff for which you were not in competition, be happy for them and glad you could help! If they didn't attribute you, karma's a bitch and it'll likely come around to bite them.

What's more, I think you'll find that you've learned a tremendous amount from others writings and I'll bet you've written code based on the writings of others. You learn from them and then you internalize the knowledge and you often forget where you learned about it. I know I learn a ton from others but rarely remember where I learned if it's been more than a few months since learning.

The real issue here is if we started to police everyone's usage of code here then we'd all have to be careful of using others code when we were not even realizing we were. I really don't want to have to start worrying about whether I can use a certain technique or not based on where I first read about it.

Better that we all stand on the shoulders of giants and "rise the tide that floats all boats." If you want to claim a spot for your own that is based on your code, such as the publishing of a specific plugin, then by all means do it first and/or do it best. Beyond that maybe you can also learn to take joy in the fact that you've become a very effective catalyst?

Or you can stop publishing code here and then nobody can steal it. But we definitely don't want to see that happen because your contributions are great and loosing you wouldn't really benefit anyone, least of all you. :)



  • 2
    As much as it pains me to admit it, I agree with you. A great man once told me that "an idea without execution is worthless." So posting a code snippet is, in essence, explaining a great idea without explaining its execution. Posting a full plug-in with the copyright/licensing headers intact, however, is demonstrating the execution and thus has inherent value. So while it's still frustrating to see people copy-paste whole chunks of code and claim it was their idea, the fact is that they're still the ones who actually executed the solution.
    – EAMann
    Commented Nov 7, 2010 at 15:02
  • Techniques aren't copyrightable, but specific code is. (Clear as mud, right?)
    – user1546
    Commented Nov 11, 2010 at 11:13

Actually, I take an opposite approach: use the most liberal terms possible and trust the user to do the right thing. If someone "makes money" or otherwise benefits from something I posted freely on the web in my spare time and still felt it wasn't worth mentioning my name — or hiring me at twice my current paygrade to make them even more money — then more power to them. I doubt I'd ever be famous for any SE answers even if they did attribute, though infamous might be a diff'rent story...

To do this, I specifically disclaim copyright on code in my SO profile, quoted below. CC-BY-SA requires attribution in the "manner specified", and that manner is particularly incongruent for software. (It fits fine for a blog or other discussion site on the web, however.)

All original code I post on this site is placed in the public domain. This does not cover code available on other sites and only linked from my posts. If it breaks, you get to keep both pieces. (I do this so you can easily copy the code without worrying about the attribution requirements of the CC license. If you still want to attribute, that is always appreciated!)

I retain copyright on all non-code; however, feel free to use under fair-use or any other provision of copyright law (as you may anyway), including the license mandated by SO (bottom of page), or contact me.

Please don't attribute any magical properties to this wording, it's entirely made up on the spot — and I did that on purpose. In some jurisdictions, you can't disclaim copyright and other subtleties; however, my understanding is an explicit statement of intent does carry some legal weight.

More importantly, I'm explicitly telling users (as opposed to their lawyers) what I expect them to do, and this is why I wrote it freehand: anyone with a tidbit of knowledge in copyright knows this doesn't even approach a license and thus if it ever really mattered in a situation where CC-BY-SA was unusable, they should contact me. But for the vast majority of cases, it won't matter.


Licensing of snippets is elephant in the room for WP community. When mechanics of GPL are a bother it is suddenly easier to ignore them. How many blogs (including high-profile) strive on re-posting snippets that are at best under some blanket license from developer, but usually unspecified - effectively "all rights reserved"...

Applying to here this is also quite messy subject. I assume that CC license applies to all user-submitted content (I neither see code excluded or option to override license for your submissions). And it is explicitly incompatible with GPL.

So something as innocent as asking question about your public plugin and using snippet from an answer sets you up for both breaking CC from this site and GPL from WP.

  • That's one conclusion we came to. Unless you post your code with the explicit statement that it's dual-licensed under the GPL, then it's only licensed under CC and generally disallowed for inclusion into distributable plug-ins and themes. My follow-up question: how readily will this be understood by contributors? What more should be be doing (if at all) to educate site users about how licensing is applied to the code snippets they find on the site? Is the CC link/image in the footer enough?
    – EAMann
    Commented Nov 2, 2010 at 20:18
  • 2
    Just a reminder: CC is not very fitting for software, it's not a software license, something else should be preferred over it. And the CC of this site requires attribution in the form asked for. Did you specify anything specific for attribution? If not, can this be extended up to the fact, that you do not wanted to be attributed?
    – hakre
    Commented Nov 7, 2010 at 1:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .