Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ jobs:
curl --fail http://localhost:8080/wp-json

- name: 'Run Tests: Selfhosted WordPress with JWT-AUTH'
run: dotnet test -l "console;verbosity=detailed" WordPressPCL.Tests.Selfhosted/WordPressPCL.Tests.Selfhosted.csproj -s WordPressPCL.Tests.Selfhosted/jwtauth.runsettings
run: dotnet test -l "console;verbosity=detailed" tests/WordPressPCL.Tests.Selfhosted/WordPressPCL.Tests.Selfhosted.csproj -s tests/WordPressPCL.Tests.Selfhosted/jwtauth.runsettings
2 changes: 1 addition & 1 deletion .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
env:
solution: WordPressPCL.sln
project: WordPressPCL/WordPressPCL.csproj
project: src/WordPressPCL/WordPressPCL.csproj
release_tag: ${{ github.event.release.tag_name }}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,4 @@ WordPressPCL.Tests.Selfhosted/Utility/ApiCredentials.cs
WordPressPCL.Tests.Selfhosted/Utility/ApiCredentials.cs
WordPressPCL.Tests.Hosted/Utility/ApiCredentials.cs
WordPressPCL.Tests.Selfhosted/Utility/ApiCredentials.cs
WordPressPCL.Tests.Selfhosted/Utility/ApiCredentials.cs
WordPressPCL.Tests.Selfhosted/Utility/ApiCredentials.cssite/
81 changes: 81 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Contributing to WordPressPCL

Thank you for your interest in contributing! This guide explains how to set up a development environment, run the tests, and submit changes.

## Repository layout

```
WordPressPCL/
├── src/
│ └── WordPressPCL/ # Library source code
├── tests/
│ ├── WordPressPCL.Tests.Selfhosted/ # Integration tests against a local Docker WordPress
│ └── WordPressPCL.Tests.Hosted/ # Smoke tests against a live WordPress instance
├── docs/
│ ├── v3/ # Reference docs for version 3.x
│ ├── v2/ # Reference docs for version 2.x
│ └── v1/ # Reference docs for version 1.x
├── dev/ # Docker Compose setup for local WordPress
├── WordPressPCL.sln
├── Directory.Build.props
├── Directory.Packages.props
├── CHANGELOG.md
└── mkdocs.yml
```

## Prerequisites

- [.NET 10 SDK](https://dotnet.microsoft.com/download/dotnet/10.0)
- [Docker and Docker Compose](https://docs.docker.com/get-docker/) (for self-hosted integration tests)

## Building

```bash
dotnet restore WordPressPCL.sln --disable-parallel
dotnet build WordPressPCL.sln -c Release --no-restore
```

## Running tests

### Self-hosted integration tests (recommended for most changes)

The self-hosted tests spin up a local WordPress instance via Docker Compose and run the full test suite against it.

```bash
# Start the test environment
cd dev
docker compose up -d

# Wait for WordPress to be ready (the container creates .wp-tests-ready when done)
# Then run the tests from the repository root
cd ..
dotnet test tests/WordPressPCL.Tests.Selfhosted/WordPressPCL.Tests.Selfhosted.csproj \
-s tests/WordPressPCL.Tests.Selfhosted/jwtauth.runsettings \
-l "console;verbosity=detailed"
```

For full setup instructions, including plugin requirements and run-settings options, see [`dev/install.md`](dev/install.md).

### Hosted tests

The hosted tests run against a live WordPress site. They depend on specific content and credentials and may fail for environment reasons unrelated to your change. They are mainly used in CI and are not required for local development.

## Code style

Please follow the [Microsoft C# coding guidelines](https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions). Nullable reference types are enabled solution-wide — do not suppress nullable warnings without a clear justification.

## Submitting a pull request

1. **Open an issue first.** Describe the feature or bug so we can discuss whether it is in scope and avoid duplicate work.
2. Fork the repository and create a branch from `main`.
3. Make your changes. Add or update tests to cover any new or modified behaviour.
4. Run the build and self-hosted tests to verify nothing is broken.
5. Open a pull request against `main`. Reference the related issue in the description.

## Reporting bugs

Please [open an issue](https://github.com/wp-net/WordPressPCL/issues) with a clear description, the version of WordPressPCL you are using, and a minimal reproduction.

## Code of conduct

This project follows the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating you agree to abide by its terms.
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ WordPressPCL uses GitHub Releases as the source of truth for publishing new pack
WordPressPCL 3.0 targets .NET 10 only. Upgrading from 2.x is a breaking change and requires applications and test environments to move to the .NET 10 SDK/runtime before restoring, building, or running tests.

## Versioned Reference Docs
- [Version 3.x reference docs](docs/I%20version%203.x/index.md)
- [Version 2.x reference docs](docs/II%20version%202.x/index.md)
- [Version 1.x reference docs](docs/III%20version%201.x/index.md)
- [Version 3.x reference docs](docs/v3/index.md)
- [Version 2.x reference docs](docs/v2/index.md)
- [Version 1.x reference docs](docs/v1/index.md)

## Supported Platforms
WordPressPCL 3.0 targets .NET 10 and is intended for applications running on the current .NET platform:
Expand Down Expand Up @@ -195,7 +195,7 @@ dynamic searchResults = await client.CustomRequest.GetAsync<dynamic>("search?sea
dynamic customEndpoint = await client.CustomRequest.GetAsync<dynamic>("wc/v3/products", useAuth: true);
```

For a fuller endpoint-by-endpoint summary, see [docs/I version 3.x/endpoint-coverage.md](docs/I%20version%203.x/endpoint-coverage.md).
For a fuller endpoint-by-endpoint summary, see [docs/v3/endpoint-coverage.md](docs/v3/endpoint-coverage.md).


## Additional Features
Expand All @@ -204,12 +204,10 @@ For a fuller endpoint-by-endpoint summary, see [docs/I version 3.x/endpoint-cove
- [HttpResponsePreProcessing](https://github.com/wp-net/WordPressPCL/wiki/HttpResponsePreProcessing): manipulate the API response before deserializing it

## Contribution Guidelines
We're very happy to get input from the community on this project! To keep the code clean we ask you to follow a few simple contribution guidelines.
We're very happy to get input from the community on this project! See [CONTRIBUTING.md](CONTRIBUTING.md) for full details on setting up a development environment, running tests, and submitting pull requests.

First, create an issue describing what feature you want to add or what problem you're trying to solve, just to make sure no one is already working on that. That also gives us a chance to debate whether a feature is within the scope of this project.

Second, please try to stick to the official C# coding guidelines. https://msdn.microsoft.com/en-us/library/ms229002(v=vs.110).aspx

Also, make sure to write some tests covering your new or modified code.

In order to run the tests on local machine please refer to the **install.md** file in the dev directory of the repository. Docker and Docker Compose will be required to run the tests.
In brief:
- Open an issue before starting work so we can discuss scope and avoid duplicate effort.
- Follow the [Microsoft C# coding guidelines](https://learn.microsoft.com/dotnet/csharp/fundamentals/coding-style/coding-conventions).
- Add or update tests to cover your change.
- In order to run the tests locally, refer to the [`dev/install.md`](dev/install.md) file and use Docker Compose.
6 changes: 3 additions & 3 deletions WordPressPCL.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31613.86
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WordPressPCL", "WordPressPCL\WordPressPCL.csproj", "{E34E9B5D-0086-47D8-86A0-359B7D812CFC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WordPressPCL", "src\WordPressPCL\WordPressPCL.csproj", "{E34E9B5D-0086-47D8-86A0-359B7D812CFC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WordPressPCL.Tests.Selfhosted", "WordPressPCL.Tests.Selfhosted\WordPressPCL.Tests.Selfhosted.csproj", "{ECE2EA35-0152-4A27-80A8-567E192832E1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WordPressPCL.Tests.Selfhosted", "tests\WordPressPCL.Tests.Selfhosted\WordPressPCL.Tests.Selfhosted.csproj", "{ECE2EA35-0152-4A27-80A8-567E192832E1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WordPressPCL.Tests.Hosted", "WordPressPCL.Tests.Hosted\WordPressPCL.Tests.Hosted.csproj", "{885149FB-8AE8-42F8-BBFE-59FD5C6B6BBF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WordPressPCL.Tests.Hosted", "tests\WordPressPCL.Tests.Hosted\WordPressPCL.Tests.Hosted.csproj", "{885149FB-8AE8-42F8-BBFE-59FD5C6B6BBF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{58C7E88F-517F-49D0-B9D1-60ABF23B1686}"
ProjectSection(SolutionItems) = preProject
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ The WordPressPCL API Wrapper is avaiable through [NuGet](https://www.nuget.org/p
WordPressPCL 3.0 targets .NET 10 only. Upgrading from 2.x is a breaking change and requires applications and test environments to move to the .NET 10 SDK/runtime before restoring, building, or running tests.

## Versioned Reference Docs
- [Version 3.x reference docs](I%20version%203.x/index.md)
- [Version 2.x reference docs](II%20version%202.x/index.md)
- [Version 1.x reference docs](III%20version%201.x/index.md)
- [Version 3.x reference docs](v3/index.md)
- [Version 2.x reference docs](v2/index.md)
- [Version 1.x reference docs](v1/index.md)

## Supported Platforms
WordPressPCL 3.0 targets .NET 10 and is intended for applications running on the current .NET platform:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
70 changes: 69 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,71 @@
site_name: WordPressPCL
site_url: https://wp-net.github.io/WordPressPCL/
theme: readthedocs
theme: readthedocs
nav:
- Home: index.md
- Version 3.x:
- Overview: v3/index.md
- Breaking Changes: v3/breaking-changes.md
- Endpoint Coverage: v3/endpoint-coverage.md
- Troubleshooting: v3/troubleshooting.md
- Customization:
- Custom HttpClient & DI: v3/customization/customHttpClient.md
- Custom JSON Settings: v3/customization/customJsonSerializationSettings.md
- Custom Request: v3/customization/customRequest.md
- HTTP Response Pre-Processing: v3/customization/httpResponsePreProcessing.md
- Entities:
- Posts: v3/entities/posts.md
- Pages: v3/entities/pages.md
- Comments: v3/entities/comments.md
- Categories: v3/entities/categories.md
- Tags: v3/entities/tags.md
- Users: v3/entities/users.md
- Media: v3/entities/media.md
- Taxonomies: v3/entities/taxonomies.md
- Post Types: v3/entities/posttypes.md
- Post Statuses: v3/entities/poststatuses.md
- Settings: v3/entities/settings.md
- Custom Post Type: v3/entities/customPostType.md
- Version 2.x:
- Overview: v2/index.md
- Breaking Changes: v2/breaking-changes.md
- Troubleshooting: v2/troubleshooting.md
- Customization:
- Custom HttpClient & DI: v2/customization/customHttpClient.md
- Custom JSON Settings: v2/customization/customJsonSerializationSettings.md
- Custom Request: v2/customization/customRequest.md
- HTTP Response Pre-Processing: v2/customization/httpResponsePreProcessing.md
- Entities:
- Posts: v2/entities/posts.md
- Pages: v2/entities/pages.md
- Comments: v2/entities/comments.md
- Categories: v2/entities/categories.md
- Tags: v2/entities/tags.md
- Users: v2/entities/users.md
- Media: v2/entities/media.md
- Taxonomies: v2/entities/taxonomies.md
- Post Types: v2/entities/posttypes.md
- Post Statuses: v2/entities/poststatuses.md
- Settings: v2/entities/settings.md
- Custom Post Type: v2/entities/customPostType.md
- Version 1.x:
- Overview: v1/index.md
- Troubleshooting: v1/troubleshooting.md
- Customization:
- Custom HttpClient: v1/customization/customHttpClient.md
- Custom JSON Settings: v1/customization/customJsonSerializationSettings.md
- Custom Request: v1/customization/customRequest.md
- HTTP Response Pre-Processing: v1/customization/httpResponsePreProcessing.md
- Entities:
- Posts: v1/entities/posts.md
- Pages: v1/entities/pages.md
- Comments: v1/entities/comments.md
- Categories: v1/entities/categories.md
- Tags: v1/entities/tags.md
- Users: v1/entities/users.md
- Media: v1/entities/media.md
- Taxonomies: v1/entities/taxonomies.md
- Post Types: v1/entities/posttypes.md
- Post Statuses: v1/entities/poststatuses.md
- Settings: v1/entities/settings.md
- Custom Post Type: v1/entities/customPostType.md
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
<None Update="icon.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\.editorconfig" Link=".editorconfig" />
<None Include="..\README.md">
<None Include="..\..\editorconfig" Link=".editorconfig" />
<None Include="..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\CHANGELOG.md">
<None Include="..\..\CHANGELOG.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\WordPressPCL\WordPressPCL.csproj" />
<ProjectReference Include="..\..\src\WordPressPCL\WordPressPCL.csproj" />
</ItemGroup>

</Project>
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\WordPressPCL\WordPressPCL.csproj" />
<ProjectReference Include="..\..\src\WordPressPCL\WordPressPCL.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading