I'm wanting to protect one of my Wordpress plugins by loading part of the plugin code on my server. I would only want to load the vital javascript files from my server, so that if users try and delete the code, the plugin will not work.
The method I'm trying is this:
On the user's website where plugin is located, I'm wanting to include
the file located on my server, like this:
require ('www.example.com/myphpfile.php');
And then I want to use wp_enqueue_script
(from my server) to load the javascript files used on their website. I would need to also extend Wordpress capability to my PHP file (hence the require('wp-config.php')
. Is all of this a possibility?
<?php
require('wp-config.php');
wp_enqueue_script( 'admin.js', 'http://www.myserverdomain.com/admin.js',__FILE__), array('jquery'));
?>
I know there are probably tons of ways to protect plugins, but this one seemed like it could work fairly easy.
Any help is appreciated.
Thanks