문제

I'm trying to obfuscate the Wordpress plugin that I created using Ioncube since its the requirement of the company.

Things I already tried:

  • directly including the wordpress comment header on the encoded file
  • create another php file that will contain the comments for wordpress to be able to be aware of the plugin and then include it via include_once() in the main plugin file (ecom.php).
  • tried .inc, .txt, no file extension but Wordpress doesn't recognize the plugin

But I'm getting the following errors:

  • The plugin generated 3 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.
  • The plugin is not listed in the Wordpress plugins page

There wasn't any error in the encoding, I'm using the default settings of the most recent version available for evaluation. Any ideas?

도움이 되었습니까?

해결책

To properly encode the Worpdress plugin file, open up the main plugin file. For example the main plugin file is plugger.php

Remove the Wordpress header comment:

/*
Plugin Name: plugger
*/

Encode the files using ioncube. Copy the encoded files into the Wordpress plugin directory. Then rename the main plugin file, for example plugger-file.php. Then create a new file, this will be the main plugin file plugger.php. Inside plugger.php add the Wordpress header comments so that Wordpress will recognize the plugin then include the plugger-file.php

<?php
/*
Plugin Name: plugger
*/
include_once('plugger.php');

다른 팁

As an alternative to the delegation approach described above by the OP, there is a feature to add custom header comments to encoded files during encoding. Using that with the appropriate text will be sufficient for some frameworks to recognise the file as a plugin/module.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top