I have created a plugin for WordPress although I would like to encrypt it to stop people from viewing the source code. I've heard of Zend Guard and IonCube although is there a free alternative to these?
Looks like the things you choose are not working this way:
- Wordpress is open source
- PHP is not compiled
- any obfuscation can be decoded
If you don't want to share the source, provide the code as a service. You may require the user to enter API key etc.
- Execute the code on your server and send response (e.g. JSON or XML) to the Wordpress part.
- Allow only the users who paid for the service to access the service on your server
- Authenticate the users by selling and then checking the API key
See: SaaS
Try this one: PHP Encoder
This might be the answer you are looking for.
gzdeflate()
or gzinflate()
, another is using base64_encode()
/base64_decode()
and str_rot13()
or hash()
and md5()
functions. –
Unquestionable md5
a non reversable function? How could you obfuscate code with it? $x = 'something'; $h = md5($x);
if you know only $h
how would you revert back to $x
? –
Margalit What your are looking for is an obfuscator for php. This post may be a duplicate to: Is there a code obfuscator for PHP?
However some words. Contributions to the opensource world like contributing a wordpress plugin may help you more while people are able to read your code.
I don't know your plugin code in specific (and obviously you don't want to make me know it), but keep in mind if you re-use parts of the wordpress codebase in your plugin, your must distribute your code under a compatible license. That means compatible to GPL v2 for the current version.
However this GPL license requires you to provide source code, which specifically means non-obfuscated and non-encrypted. Source-code is the form of a software you use to make modifications to it.
So in your case, encrypting your plugin's code and distributing it could result in a termination of usage rights on the wordpress code for you. This includes the right to create derivates (your plugin) and distribute such derivates (sending your plugin to someone else). Naturally those who will get that plugin do not have any license as well to make use of your derivate.
That's not really an ideal situation if you ask me, especially as once termination of rights is in effect, you must get into contact with every single copyright holder of the wordpress package and ask for re-instatement of rights, something you will be hardly able to.
So take care if you re-use existing code or create derivates that you meet the licensing requirements. Especially if it's about your rights.
IANAL and I can only suggest that next to the technical part like obfuscation/encryption there is also the part of software licensing that can play a role. You just should contact a lawyer and clarify that software licensing situation not that your customers one day demand stuff from you, you never thought about you must deal with. In the end you will have a contract with your customers, so better take care.
Since PHP is not compiled. Ioncube and Zend Guard are your only options. Your users will also need to install the loaders for those addons in order to use your code. Which may not be possible in many hosting situations.
Since those plugins are designed to encrypt complete applications, they or may not work with plugins.
© 2022 - 2024 — McMap. All rights reserved.