Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*********************************************************************************************
- **********************************************************************************************
- ** WordPress Theme License Checker **
- ** Author: The Sufi **
- ** Author URI: http://www.thedct.com **
- ** Version: 1.0 **
- **********************************************************************************************
- *********************************************************************************************/
- function check_point($key, $url){
- $file = "http://www.yourserver.com/xmldirectory/05a0e40e81edc455d757dd8b40127581.xml";
- $contents = file_get_contents($file);
- if (!$contents){//file not found
- wp_die('Error! Please contact theme support!');
- exit;
- }
- $xml = new SimpleXMLElement($contents);
- if ( $key == $xml->key && $url == $xml->domain ){
- return true;
- }
- else return false;
- }
- $key = "ejhg789Xdfg";//you should retrieve this using a text box and save to wp_options table
- $domain = $_SERVER['HTTP_HOST'];//current domain
- $status = check_point($key, $domain);
- if (!$status){
- wp_die('invalid theme license');
- }
- else{
- //here goes your original theme functions.php codes
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement