A client asked me to write a WP plugin that is just for their website - it won't be on the repository. Basically it contains a form, place-able with a shortcode, and then sends the collected entry data to a third party private API - essentially nobody except my client has any use for the plugin. Is it mandatory to use the GPL, just because it is a plugin for one specific Wordpress-installation? Is it allowed to use a different license? My problem is, that the client pays for the development and has their customized set-up and doesn't want it to be open source. So is there a different license I could use? If yes which one? Thanks in advance
Wordpress is distributed under GPLv2+, and I'm working on the assumption that Wordpress plugins are sufficiently tightly-integrated with the main program to constitute derivative works (more can be read about the FSF's position on this here).
My recommendation is to go with GPLv3 for your plugin. We discuss elsewhere on this site the much-clearer provision that GPLv3 makes for sharing covered code for the purposes of hosting and ongoing maintenance without having to do so under normal GPLv3 requirements. So the client will be able to share it with both their web admin company, and any future maintainer, without having to "open source" it.
For this kind of code it may be useful to just license the code as GPL, pack it as a zip file and wait for the unlikely event of someone explicitly requesting the code. Most licenses (like GPL) don't require you to make access easy. If it is as customer specific as you say, there's nothing to hide.
BUT (!) Although it might be a fair solution for you, this method is much too often used by companies that just want to use free stuff and never contributing to the community. Open sourcing on paper but then complicating the access as much as possible is just really bad. Don't ever do this if your code contains anything meaningful that might be reused.
ALSO (!) Releasing your code in an readily accessible repo comes with benefits. People will see your code and report potential flaws in it.
Think about publishing it. Source code takes just a few bytes of storage in the cloud and even if just a single person finds something interesting, you may have saved them A LOT of effort. Remember the times when YOU found something obscure that you would never have thought to find on the internet ;)