Make Wordpress theme copy protected


There have many process to prevent copy of Wordpress theme. Some are using licensing system to activate and some have no enough tracking system. Today we sill discuss a little trick about this. For security reason and make site 100% sure to run you need to cPanel login. For expert person it can be done without cPanel login but sensitive. If any unexpected text input here you must resolve from cPanel file manager.

Lets start. First of all we think an example given below.
Domain name: http://sokriyo.com
Theme name: templateOne
Theme folder: public_html/wp-content/themes/templateOne
Focus file:  public_html/wp-content/themes/templateOne/function.php

Code modification:
In below code sample we can notice that "sokriyo.com" is present in line number two. Replace this word with your allow domain name. If this domain not match with current site url it will show error message and not load site at all.

Now we will edit this file. From the beginning of file we can see "<?php"
after this line we need to add some code according to bellow code sample.


/**********************************************************************/
if (strpos(get_site_url(), 'sokriyo.com') <= 0){
echo "<title>Contact SOKRIYO</title><h1 style='position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%)'>Theme is corupted. Never try to copy this theme.</h1>";
exit();
}

Warning:
Take a backup of function.php file to safety. Before save be sure about your current domain name match with replaced word form code. If error message show in visit site you need to modify this code properly to replace domain name again and save before try again. If fail again and again it can be say that is not for you. Please remove inserted line and restore this file as previous and stay like as previous.