Open anilkumarvs opened 1 year ago
Hi,
Adding more to above issue details, I am including a video link to explain the issues/errors I am facing.
https://1drv.ms/v/s!AjBWHxiL50SrhNZTb6r2zN0SEBD45A?e=HVONYv
Hope this will help you to understand the issues more clearly and suggest the fixes.
Please see below the Key sections in video with time code.
Video Timecodes 0.17: Current WP version 6.0.1 0.29: Site Health - Critical Issue 1.00: Installed plugins issues and errors 2.25: Pages view, only basic WP functionality available 2.15: Settings page - settings 3.55: User page settings 4.10: Tools and Code Problems (detailed list of errors) 6.23: Tools and Code Problems (critical issues) 6.50: Site health passed tests
Thanking you in advance, Anil Kumar
Hi @anilkumarvs, Can you please provide more info on how your project is structured? How does your app configuration look like? Make sure you follow this tutorial when setting things up please. Can you also list the NuGet dependencies and their versions please? Quite often these types of issues are due to version mismatches. Thanks, Ben
Hi Ben,
Thanks for the reply. I have created a snippet of the project with the peachpie structured in it. Could you please use the below link to download the project zip to see the details.
https://1drv.ms/u/s!AjBWHxiL50SrhNcB6q01R5mYcWbrRw?e=G2gjJn
If this is not acceptable, I can provide details of the structure, versions etc.
Please advise.
Thanks & Regards, Anil
@anilkumarvs Thank you, Anil, for all the details and the video! and sorry for the delay.
The Site Health can be ignored for now; as most of the features are overridden by the ASP.NET Core pipeline anyways. It can be improved through various settings though.
The code errors (red ones) are basically "full-stoppers" - nothing will work with those errors. For larger websites with lots of larger plugins and themes, it will be necessary to avoid installing plugins from the WordPress dashboard and follow the .NET approach - compile plugins in the build time. It'll get significantly faster as well.
Please take a look at our example: https://github.com/iolevel/peachpie-wordpress/tree/master/MyContent This is described at https://docs.peachpie.io/scenarios/wordpress/build-php-plugin/
Create a separate project next to your C# ASP.NET Core app, called for example Vlenza.YourHomeOurHome.WpContent
. Vlenza.YourHomeOurHome.WpContent/plugins
folder should contain ALL your plugins, the same way as it would be in WordPress (beaverbuilder, wordpress-seo, etc...)
./Vlenza.YourHomeOurHome.WpContent/
./Vlenza.YourHomeOurHome.WpContent/plugins/
./Vlenza.YourHomeOurHome.WpContent/Vlenza.YourHomeOurHome.WpContent.msbuildproj
// as in exampleCreate <ProjectReference />
from your C# ASP.NET Core Web to Vlenza.YourHomeOurHome.WpContent
project.
<ProjectReference Include="../Vlenza.YourHomeOurHome.WpContent/Vlenza.YourHomeOurHome.WpContent.msbuildproj">
<PrivateAssets>None</PrivateAssets>
</ProjectReference>
Remove the plugins downloaded from within WordPress dashboard somewhere at wordpress/wp-content/plugins/**
.
Disable WPDOTNET_HOTPLUG_ENABLE
option. (https://docs.peachpie.io/scenarios/wordpress/configuration/#extra-settings). Add the following to your appsettings.json
:
"WordPress": {
"Constants": {
"WPDOTNET_HOTPLUG_ENABLE": 0,
}
}
Build your C# project; You're now getting all those errors in build time.
Sadly, those errors (red ones) must be fixed. Most of the erroring code can be removed. I'd recommend adding plugins subsequently.
Please let me know the progress. After the steps above, it is expected to have:
Vlenza.YourHomeOurHome.WpContent
with your WordPress pluginsHi Jakub,
Thank you so much for the detailed instructions. I will try to follow the steps and let you know the progress.
Thanks & Regards, Anil
From: Jakub Míšek @.> Sent: Monday, April 17, 2023 5:58 PM To: iolevel/wpdotnet-sdk @.> Cc: anilkumarvs @.>; Mention @.> Subject: Re: [iolevel/wpdotnet-sdk] .Net Core web | PeachPie wordpress not working fully (Issue #136)
@anilkumarvshttps://github.com/anilkumarvs Thank you, Anil, for all the details and the video! and sorry for the delay.
The Site Health can be ignored for now; as most of the features are overridden by the ASP.NET Core pipeline anyways. It can be improved through various settings though.
The code errors (red ones) are basically "full-stoppers" - nothing will work with those errors. For larger websites with lots of larger plugins and themes, it will be necessary to avoid installing plugins from the WordPress dashboard and follow the .NET approach - compile plugins in the build time. It'll get significantly faster as well.
Please take a look at our example: https://github.com/iolevel/peachpie-wordpress/tree/master/MyContent This is described at https://docs.peachpie.io/scenarios/wordpress/build-php-plugin/
·
·
· "WordPress": {
· "Constants": {
· "WPDOTNET_HOTPLUG_ENABLE": 0,
· }
}
Sadly, those errors (red ones) must be fixed. Most of the erroring code can be removed. I'd recommend adding plugins subsequently.
Please let me know the progress. After the steps above, it is expected to have:
— Reply to this email directly, view it on GitHubhttps://github.com/iolevel/wpdotnet-sdk/issues/136#issuecomment-1511246510, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATWW3GZMIRL4INV3QGANSJDXBUZN3ANCNFSM6AAAAAAVUEVFJQ. You are receiving this because you were mentioned.Message ID: @.**@.>>
Hi Jakub,
Thanks again for your help. I have modified our project as per the directions from your below email and the solution is running without errors.
I can download plugins from wordpress site, and add to Plugins folder in the new plugin project. And when opening the admin dashboard, I can see the newly added plugins in the Plugins list. But now the issue is when trying to activate the plugins from the dashboard, lot of php errors occurs (and not able to completely activate). The plugins I tried are, Yoast SEO, Elementor etc. Can you please advise if this is how we need to add the plugins.
I am attaching the screenshot of the structure of the solution. It would be helpful if you can have a look and suggest if any changes needed.
Also could you please advise how to apply themes using this build method.
Once again thank you so much for the help you are providing.
Regards, Anil
From: Jakub Míšek @.> Sent: Monday, April 17, 2023 5:58 PM To: iolevel/wpdotnet-sdk @.> Cc: anilkumarvs @.>; Mention @.> Subject: Re: [iolevel/wpdotnet-sdk] .Net Core web | PeachPie wordpress not working fully (Issue #136)
@anilkumarvshttps://github.com/anilkumarvs Thank you, Anil, for all the details and the video! and sorry for the delay.
The Site Health can be ignored for now; as most of the features are overridden by the ASP.NET Core pipeline anyways. It can be improved through various settings though.
The code errors (red ones) are basically "full-stoppers" - nothing will work with those errors. For larger websites with lots of larger plugins and themes, it will be necessary to avoid installing plugins from the WordPress dashboard and follow the .NET approach - compile plugins in the build time. It'll get significantly faster as well.
Please take a look at our example: https://github.com/iolevel/peachpie-wordpress/tree/master/MyContent This is described at https://docs.peachpie.io/scenarios/wordpress/build-php-plugin/
·
·
· "WordPress": {
· "Constants": {
· "WPDOTNET_HOTPLUG_ENABLE": 0,
· }
}
Sadly, those errors (red ones) must be fixed. Most of the erroring code can be removed. I'd recommend adding plugins subsequently.
Please let me know the progress. After the steps above, it is expected to have:
— Reply to this email directly, view it on GitHubhttps://github.com/iolevel/wpdotnet-sdk/issues/136#issuecomment-1511246510, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATWW3GZMIRL4INV3QGANSJDXBUZN3ANCNFSM6AAAAAAVUEVFJQ. You are receiving this because you were mentioned.Message ID: @.**@.>>
Hi Anil,
Are you seeing PHP errors in the WP dashboard? You should not have to download any plugins through the dashboard though, have you followed the aforementioned tutorial and added them to your wp-content/plugins
folder one by one? As Jakub mentioned, we recommend adding them one by one to make sure we isolate any issues. Then you can build the solution and activate them in the dashboard.
I can't see any screenshot attached btw.
Yoast SEO is known to have quite a few problems in their source code, so it's quite conceivable that there are PHP bugs that are causing our compiler to throw an exception. Elementor is generally much better.
In terms of themes, the process is very similar to plugins, just add the theme to the wp-content/themes
folder and build.
Best, Ben
Hi Ben,
I can’t see any errors in the dashboard now. Regarding plugin, what I am doing is, directly download the plugin file from the plugin website and add to the new content msbuild project’s plugin folder. And go to dashboard and activate the same from the plugins list. Is this how I should do ? In the dashboard plugin’s list I can see the newly added plugins, which is great.
If the method I am following is correct, I will try some more plugins and also some themes and update you the progress.
Instead of attachment now I am adding the screenshot of the project structure as a drive link.
https://drive.google.com/file/d/162FCSWq96B_37DMsQaHtqcRLLc4cl-XE/view?usp=sharing
Please let me know if the structure is correct and the method I am following is proper. Thank you so much for your kind help.
Thanks & Regards, Anil
Hi Anil, that's exactly how it should be. Nicely done.
Hi Jakub,
Thank you so much for the confirmation. I will contact you again, if I need any further help.
Thanks & Regards, Anil
From: Jakub Míšek @.> Sent: Wednesday, April 19, 2023 12:54 PM To: iolevel/wpdotnet-sdk @.> Cc: anilkumarvs @.>; Mention @.> Subject: Re: [iolevel/wpdotnet-sdk] .Net Core web | PeachPie wordpress not working fully (Issue #136)
Hi Anil, that's exactly how it should be. Nicely done.
— Reply to this email directly, view it on GitHubhttps://github.com/iolevel/wpdotnet-sdk/issues/136#issuecomment-1514254768, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATWW3GZR7WJNWGCR7KSSVADXB6HI5ANCNFSM6AAAAAAVUEVFJQ. You are receiving this because you were mentioned.Message ID: @.**@.>>
Hi Benjamin,
As per your suggestion in your reply email, I am posting my issue with PeachPie here. We have integrated peachpie in one of our .Net Core web app. We have configured routing so that the wordpress content is within a sub folder like, https://localhost:7388/wp/
Most of the functionality is working. But when we install a new plugin or theme it is not fully working. Showing lot of errors. I have prepared a copy of the .Net solution with the peachpie installation. Could you please have a look and provide feedback to resolve the issues.
See below the link to download the source
https://1drv.ms/u/s!AjBWHxiL50SrhNYcnFgLP0pyfDxv-g?e=cFybND
Thanking you in advance. Anil Kumar