0

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

Rob Myrick
  • 859
  • 11
  • 28
  • 1
    There is no way to protect a plugin. if i can read your source, then it's only a person's honesty when it comes to licensing. – gwillie Oct 21 '13 at 04:59
  • http://stackoverflow.com/questions/1158348/including-a-remote-file-in-php – Prince Singh Oct 21 '13 at 05:00
  • gwille, I guess the idea was to create some work for the person wanting to copy, by me separating pieces of the file and controlling it. I'm always assuming it could be copied in the long run – Rob Myrick Oct 21 '13 at 05:05
  • 1
    What if your server goes down? All plugins tied to your external files are 'down' as well. – Maksida Oct 21 '13 at 05:18
  • Thank you for the thoughts guys - I quickly re-considered my thinking on this. Thanks! – Rob Myrick Oct 21 '13 at 06:38
  • Want to protect your code why chose PHP go for .NET it will compile your code in machine language that no-one can read. Also there are some softwares which can compress your rendered HTML into random letters. Working in Wordpress keep in mind the code is accessible. – Ali Exalter Oct 21 '13 at 08:12

0 Answers0