{"id":13595363,"url":"https://github.com/iolevel/peachpie-wordpress","last_synced_at":"2025-05-15T00:08:41.939Z","repository":{"id":44473674,"uuid":"81661034","full_name":"iolevel/peachpie-wordpress","owner":"iolevel","description":"WordPress running on .NET Core.","archived":false,"fork":false,"pushed_at":"2025-02-21T13:40:47.000Z","size":16759,"stargazers_count":310,"open_issues_count":0,"forks_count":866,"subscribers_count":39,"default_branch":"master","last_synced_at":"2025-04-08T14:01:26.571Z","etag":null,"topics":["csharp","dotnet","dotnetcore","implementation","peachpie","peachpie-compiler","php","php-compiler","sample","wordpress"],"latest_commit_sha":null,"homepage":"http://www.wpdotnet.com","language":"C#","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iolevel.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-11T15:16:52.000Z","updated_at":"2025-03-18T02:51:34.000Z","dependencies_parsed_at":"2024-11-06T17:39:14.474Z","dependency_job_id":"cd3eca22-d75f-4873-b271-c0da8f885312","html_url":"https://github.com/iolevel/peachpie-wordpress","commit_stats":null,"previous_names":[],"tags_count":1,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iolevel%2Fpeachpie-wordpress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iolevel%2Fpeachpie-wordpress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iolevel%2Fpeachpie-wordpress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iolevel%2Fpeachpie-wordpress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iolevel","download_url":"https://codeload.github.com/iolevel/peachpie-wordpress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254249202,"owners_count":22039029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","dotnetcore","implementation","peachpie","peachpie-compiler","php","php-compiler","sample","wordpress"],"created_at":"2024-08-01T16:01:48.634Z","updated_at":"2025-05-15T00:08:36.929Z","avatar_url":"https://github.com/iolevel.png","language":"C#","readme":"Chat with the community on Gitter if you need help:  \n  \u003ca href=\"https://gitter.im/iolevel/peachpie\"\u003e\u003cimg src=\"https://badges.gitter.im/iolevel/peachpie.svg\"\u003e\u003c/a\u003e\n\nThis project demonstrates how to start an ASP.NET Core server, integrate WordPress into its pipeline and add additional PHP plugins into it.\n\n# WordPress\n\nEven though the project is noticeably small, it contains the entire WordPress CMS. How? This complex PHP web framework was already compiled into the .NET Standard library (see [wpdotnet-sdk](https://github.com/iolevel/wpdotnet-sdk) for more information) and packed into a NuGet package. This demo may just reference it.\n\nTo find out more about PeachPie, check out our [peachpie.io](https://www.peachpie.io/), which includes tutorials, benchmarks and articles on PeachPie.\n\n## Create MySQL database\n\nWordPress requires you to start your database server with a database in it. By default it expects a database server on localhost, port 3306, with a database named *\"wordpress\"*.\n\nYou can use *docker* to quickly start a database server in virtual environment:\n```\ndocker run -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=wordpress -p 3306:3306 -d mysql\n```\n\n## Build \u0026amp; Run\n\nNote, this is a regular ASP.NET web project. Building, running, debugging, and deploying the site take advantage of `dotnet`, optionally Visual Studio.\n\n```\ndotnet run\n```\n\n# Configuration\n\nThe configuration itself serves as a demonstration of combining a legacy PHP application with .NET. The demo takes advantage of the ASP.NET Core configuration mechanism, namely the files `appsettings.json`, `appsettings.deployment.json` and `appsettings.production.json`. This allows for having a different configuration for each environment without the need of altering the source code of the project.\n\nMore on configuring WpDotNet on https://docs.peachpie.io/scenarios/wordpress/configuration/.\n\n# WordPress PHP Plugin\n\nWith this approach it is possible to have a project containing only the plugin. WordPress itself is already compiled and the plugin has a dependency on it (like any other C# app you would make).\n\nThe build process will do following:\n- compiles `.php` files within the `MyContent` directory. The content is implicitly nested within `wp-content` subdirectory.\n- packs the compiled DLL together with content files (like images, scripts etc.) into a NuGet package.\n- copies the project content into the application output directory, together with WordPress content files extracted from its NuGet.\n\n# WordPress C# plugin\n\nThe project takes advantage of the `WpDotNet SDK` which provides a C# abstraction `IWpPlugin`. Objects of this type can be passed to the WordPress middleware (see `UseWordPress`) and hook onto filters and actions available in the WordPress API.\n\n# Sourceless Distribution\n\nThe WordPress package was already configured, so the original PHP source code is not a part of the NuGet nor of the compiled DLL. In case of additional plugins (see `PeachPied.WordPress.MyPlugin`), it depends what source files are needed in run time. Usually only the main plugin file (containing the WordPress metadata) has to be distributed together with the DLL, so that WordPress can read its content and work properly. The other files can be excluded from the package.\n\nAs a result, this project serves as a demonstration of:\n- distributing the WordPress plugin without its source codes\n- build and maintain plugins separately as separate NuGet packages\n- maintaining/providing plugins with a dependency on a certain WordPress version\n- signing the plugin with a private key\n- possibly obfuscating the DLL\n","funding_links":[],"categories":["C#","C\\#"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiolevel%2Fpeachpie-wordpress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiolevel%2Fpeachpie-wordpress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiolevel%2Fpeachpie-wordpress/lists"}