Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on an internal company application(not built on Wordpress) that needs to have shortcode functionality similar to Wordpress ( Wordpress has a bunch of functions relating to handling short codes but the ones I was looking at were just the ones that handled the regex portion of the process.

Is there something wrong with just using the few functions I need from Wordpress in my application? If it is ok, how do I go about giving credit in those sections.

I did a quick check and Wordpress is licensed under GPLv2. I'm using the Kohana Framework in my application which is licensed under BSD. I'm not sure if that changes anything but I thought I'd include it just in case.

share|improve this question
Can't you just use those code snippets as inspiration and not make a derivative but a new work based on what you learned from that? Afaik the GPL does not cover functionality nor algorithms. Learn the algorithms, make your own implementation and you should be safe. – Pieter B Dec 16 '12 at 23:58

The GPL is a viral license: if you use any GPL code anywhere in your project, the entire thing has to be released under GPL or a compatible license when you publish it.

However, if this is for internal use only and you aren't going to publish it, things get a bit murkier. I think you're OK then, but I'm not 100% certain.

share|improve this answer
Using it internally in your company has never fallen into the "distribution" category so I'm 99% sure your safe. If you ever give it to anyone though, you have to include the source. – Jeff Welling Aug 10 '11 at 8:59
@Jeff Welling is using it as a web app considered distribution? Or is it "distribution" if I decide to actually sell? – iangraham Aug 10 '11 at 16:07
First, I am not a lawyer. If the web app is only used internally, I don't think that is distribution. If it is public, I would lean more the other way. If you sell it, that is distribution. – Jeff Welling Aug 11 '11 at 5:07

The GPL License: If you distribute software derived from other GPL software, then you must also distribute it to under the terms of the GPL. That goes for the code snippets too. If you absolutely must use those snippets, you could go to the copyright holder of the original code and ask for a separate license for your needs. You may need to pay, but it may be worth it.

The BSD LIcense: If you use the BSD-Licensed Kohana Framework, then you must give attribution that you are using or deriving from the Kohana Framework. But you don't have to distribute any of the source code.

If you are using code snippets from the GPL project, it will be very hard to prove that you swiped the code. In fact, if you change function names, variable names, and the order of some statements, no automatic code analyzer will be able to conclusively show that your snippets were originally from the GPLed software. You can check this very quickly by dumping the symbol table of the original software and the symbol table of the derivative work and comparing the two. (e.g. by using the Linux "nm" utility). You should not do this, of course, but if somebody did it to software you owned, but licensed under the GPL, you would find it hard to prove it.

Proving GPL violations in court is very hard. Most companies caught violating the GPL were caught because their developers (often outsourced) brought in open-source components to develop or test the software, but failed to strip out the software, or to strip out the symbol tables from the build, or change method signatures, magic strings, or logs produced by the GPLed software.

share|improve this answer
As far as I know using a snippet does not equal creating a derived work? – Marjan Venema Aug 10 '11 at 6:38
A snippet is a derived work. – Jay Godse Aug 10 '11 at 12:34
Interesting. Would like to know how this definition of a "derived work" would hold up against "fair use" etc. in copyright law? – Marjan Venema Aug 10 '11 at 12:39

Your Answer


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.