wpdotnet-sdk
wpdotnet-sdk copied to clipboard
Need help with WPDOTNET_HOTPLUG_ENABLE property
@amira133 at https://github.com/peachpiecompiler/peachpie/issues/1020:
The description of
WPDOTNET_HOTPLUG_ENABLE
in this address is ambiguous. You may explain more. IfWPDOTNET_HOTPLUG_ENABLE
is equal to 1 , effectively disallows downloading plugins from the dashboard Or if it is 0? Also how do I set this utility in ConfigureServices?thanks
you are right, this needs some more explanation.
We are using this internally for our projects, although it deserves more information. Does something like this make sense?
WPDOTNET_HOTPLUG_ENABLE = 1
: plugins can be downloaded on the live website and PHP code will be compiled in-memory once the application starts, and whenever it changes during the application run.
WPDOTNET_HOTPLUG_ENABLE = 0
: any PHP code added after the application is compiled and published won't work; plugins and themes can't be downloaded on the live website. All the PHP code is compiled once during the dotnet build
.
To set this constant within ConfigureServices:
services.AddWordPress(options => {
options.Constants = new Dictionary<string, string>() {
{ "WPDOTNET_HOTPLUG_ENABLE", "0" },
};
});
Thank you @jakubmisek
Yes, this explanation is quite clear.
Apparently this feature does not work. This feature in both cases(means 0,1), it is possible to download and install the plugin and theme.
PeachPied.WordPress 5.8.2-preview12 .netcore 5
and do they work?
yes,
forexample I download and install Twenty Fifteen
theme, and set as my theme. (same for Elementor, but it seems some problem with Elementor in both WPDOTNET HOTPLUG Enabled or Disabled)
my StartUp code :
services.AddWordPress(options =>
{
options.DbHost = _appConfiguration["WordPress:Database:DbHost"];
options.DbPassword = _appConfiguration["WordPress:Database:DbPassword"];
options.DbUser = _appConfiguration["WordPress:Database:DbUser"];
options.DbName = _appConfiguration["WordPress:Database:DbName"];
options.Constants = new Dictionary<string, string>() {
{ "WPDOTNET_HOTPLUG_ENABLE", "0" },
};
});