Protect wordpress theme with license key validation

后端 未结 2 1921
醉梦人生
醉梦人生 2020-12-16 07:46

I\'m planning to develop some professional Wordpress Themes and would like to protect it using license keys, is it possible?

If so, would any one be willing to link

2条回答
  •  渐次进展
    2020-12-16 08:08

    You could set up a database on your own server, holding the license key and the licensed url for the theme. Then, set up an admin page for your theme. Within, first register a license settings array. Then implement a hidden settings field on that same page that gets updated whenever the license key is being updated by site admin. the update function sends a request to your server passing the license key and the $_SERVER's host and setting the hidden license_settings field to either true or false.

    A really simplified code would look like this:

    functions.php

    
    

    myadminpage.php

    
      
    "> ">

    Now you can, when ever you need/want, get the license options and handle the invalid usage in any way you want. Eg (a rude way):

    header.php

    Administrators can update their license key here.') );
    }
    
    # rest of header.php comes here..    
    

    Finally obfuscate your php code (eg http://www.ioncube.com/sa_encoder.php) and you're done. However, make sure you're not violating any other licenses, such as WP's. If there's one single line of WordPress core functions used within your final code, you can not release it under any other license than WP, which is GPL.

提交回复
热议问题