In this FAQ we will explore how to protect a plug-in with the ionCube Encoder so that it can be registered by WordPress.
When files are protected with ionCube they are encoded at a binary level, this means WordPress is no longer able to scan the mangled output for the header preamble required to register the plug-in. This issue can be resolved by customising the appearance of your encoded file output to contain a plain text header. If you are using the GUI, custom header preambles for encoded files can be set on the ‘Customisation’ tab of your project settings which include the required WordPress plug-in preamble.
This will apply a custom header to all encoded files within the project, however this would result in the plug-in being registered multiple times within WordPress.
For the plug-in to be registered once by WordPress, encode your file with the plug-in preamble separately from the main project. You should also remove the plug-in preamble from the file itself as the Encoder will include it in the customer header text. Copying this single file into your main encoded project will then result in your WordPress plug-in being successfully registered.
If you are using the command line Encoder, you can add a custom comment to configure your header text with the option –add-comment, for example:
–add-comment “/* Plug-in Name: My Toolset */”
More information for the CLI Encoder can be found in our User-Guide.
Want to test the ionCube Encoder for your project? Download our free trial here.