Some developers indiscriminately use any script they find on the Internet on their clients’ sites without really checking if they’re free to do so. Just because something is available to download on the Internet doesn’t mean that you can do exactly what you want with it.
Open source doesn’t mean it comes without restrictions. The first thing to do is check the license. If it hasn’t got a license and it’s public domain then you can do pretty much what you like with it. If it’s in the public domain it means whoever created it gave up their copyright making it completely free.
…keep the copyright notice
There are three main licenses known as “permissive free software licences”: MIT, BSD and Apache. Generally speaking you can do anything you want so long as you accept the code comes with no warranty and you leave any copyright messages intact. (Even though it’s free whoever wrote it is still the copyright holder) The BSD license has nice extra clause in it stating the author “may not be used to endorse or promote products derived from this software”.
My favourite is the MIT license as it’s short, simple and easy to understand by people like me who aren’t legal experts. I release all my open source code under the MIT license.
…give any changes back to the community
The LGPL (Lesser General Public License) and MPL (Mozilla Public License) can be used in a similar way to the above permissive licenses. However, any changes you make to that library must be released under the same license. I like the community spirit of these licenses and if you aren’t actually making any changes to the code (which is often the case) then they’re just as permissive as MIT, BSD and Apache.
For example, you build an image gallery and you download a MPL script that facilitates a zoom effect on the images. If you tweak the zoom script you must then release the zoom script under MPL but you can keep your image gallery under whatever license you want. If you don’t make any changes you aren’t compelled to release anything.
…have everything infected by the GPL
GPL (General Public License) is a copyleft license meaning that any changes have to be released under the same conditions. Sounds like LGPL and MIT above, right? GPL has a bigger impact because it “infects” any other libraries it links to. So, in the example above if the image zoom script was released under GPL you would possibly have to open source your entire image gallery and not just the changes to the zoom library you made.