Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help with ‍WPDOTNET_HOTPLUG_ENABLE‍‍ property #119

Open
jakubmisek opened this issue Jan 15, 2022 · 5 comments
Open

Need help with ‍WPDOTNET_HOTPLUG_ENABLE‍‍ property #119

jakubmisek opened this issue Jan 15, 2022 · 5 comments

Comments

@jakubmisek
Copy link
Collaborator

@amira133 at peachpiecompiler/peachpie#1020:

The description of WPDOTNET_HOTPLUG_ENABLE in this address is ambiguous. You may explain more. If WPDOTNET_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

@jakubmisek
Copy link
Collaborator Author

jakubmisek commented Jan 15, 2022

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" },
                };
            });

@amira133
Copy link

Thank you @jakubmisek

Yes, this explanation is quite clear.

@amira133
Copy link

amira133 commented Jan 15, 2022

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

@jakubmisek
Copy link
Collaborator Author

and do they work?

@amira133
Copy link

amira133 commented Jan 15, 2022

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)

image

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" },
    };

  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants