I would like some advice
Lets say I've made a product eg. Car rental Website/System (PHP & MySQL)
I want to sell it to 40+ Car rental companies
How do I stop eg. 'SA-Rentals' from just copying the code and giving/selling it to 'Cars 4U-Rentals'
Safest way I can think of is using Multitenancy where each client will have a subdomain (eg. cleintname.myproduct.com)
I've also looked at PHP Obfuscation and Encoding but it looks to easy to Decode/Modify
Ideally We want to sell them the product and then let it's out of our hands. (low maintenance)
The best way to "legally" protect you is stating that point clearly in the license the customer will obtain when you sell it (mind that you're actually just selling a license not the software itself!).
To protect your code from non-legal actions (like selling the code no matter the license) your only option is to actually host those websites yourself. Obfuscators provide some protection (aka makes the process of decoding your code slower) but still your software won't be protected from reselling but just from unwanted edits!
As you mentioned, obfuscation isn't fool proof. So, your only options are in licensing. Make sure you distribute the software with the right licensing, the customers sign the agreement with you when you sell them the site. They're bound by the license and if you discover they're in violation of it, you have a case. In my experience, few companies are going to want to take that code and start extending it or altering it and if they've bought the software for the purpose of their business, getting into the software development business is a whole new direction.
As Luca mentioned, your only sure way is to host the service yourself and then the customers never get the code. Unfortunately, you incur infrastructure costs, so your licensing model needs to change accordingly.
One other option would be to offer two different licenses, charging those that want to change it more upfront with the understanding they don't distribute it in the license agreement.
I have the same problem, and thanks to @Brian Fegter, you can use the following working code that searches for your copyright citation.
add_action('template_redirect', 'foobar_explode_if_no_citation');
function foobar_explode_if_no_citation(){
#Get the absolute server path to footer.php
$footer_path = locate_template('footer.php');
#Store the footer file contents in a var
$footer_contents = file_get_contents($footer_path);
#The required string
$citation_string = 'Designed by Foo Bar';
#Set off the nuclear bomb if there is an egregious offense
if(!preg_match("/$citation_string/", $footer_contents))
exit('All your website belongs to me. Make sure this string "Designed by Foo Bar" is included in footer.php');
}
All you need to do is change $citation_string
to match yours, for example: Designed by Foo Bar
The code will search into the file footer.php
(you can change it with any file name) for the string "Designed by Foo Bar"
, if it doesn't find it it will output a warning message, for example
All your website belongs to me. Make sure this string "Designed by Foo
Bar" is included in footer.php
Also if you want to add a link in your citation you just need to replace the preg_match()
by this (credit goes to @Rizier123 )
if(!preg_match("/" . preg_quote($citation_string, "/") . "/", $footer_contents))
I think it will help others who work days and nights coding. Peoples must respect copyrights.