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
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.0.1] - 2025-07-25

### Fixed
- Added PHPCS inline directives (`phpcs:disable`) to all source, example, and test files for WordPress Plugin Check compatibility
- Framework-agnostic library files now pass WordPress coding standards when bundled as a vendor dependency in WordPress plugins
- Suppressed `WordPress.Security.EscapeOutput.ExceptionNotEscaped` — exceptions are not WordPress output in this library
- Suppressed `WordPress.WP.AlternativeFunctions` — native PHP functions (cURL, json_encode, file_get_contents) are required for framework independence
- Suppressed `WordPress.PHP.DiscouragedPHPFunctions` — base64_encode/urlencode required for OAuth and API operations
- Suppressed `WordPress.PHP.NoSilencedErrors` — @unlink used for temporary file cleanup in HttpClient
- Suppressed `Universal.Operators.DisallowShortTernary` — short ternary intentionally used for concise null/empty handling

## [1.0.0]

### Added
- Framework-agnostic PHP core for social media publishing
- Platform abstractions with `PlatformInterface` and `PlatformResponseInterface`
Expand Down
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "^10.0|^11.0"
"dealerdirect/phpcodesniffer-composer-installer": "^1.2",
"phpunit/phpunit": "^10.0|^11.0",
"wp-coding-standards/wpcs": "^3.3"
},
"autoload": {
"psr-4": {
Expand All @@ -42,6 +44,9 @@
"minimum-stability": "stable",
"prefer-stable": true,
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
1 change: 1 addition & 0 deletions examples/mock/01_creating_posts.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions examples/mock/02_media_handling.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions examples/mock/03_formatting.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions examples/mock/04_platform_config.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions examples/mock/05_platform_registry.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions examples/mock/06_publishing.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions examples/mock/07_error_handling.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions examples/mock/08_events.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions examples/mock/09_support_utilities.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions examples/mock/10_auth_oauth.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions examples/mock/11_delivery_status.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions examples/mock/12_full_workflow.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions examples/mock/platform_discord.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions examples/mock/platform_instagram.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions examples/mock/platform_pinterest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions examples/mock/platform_reddit.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions examples/mock/platform_slack.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

/**
* Slack Platform Integration Example
Expand Down
1 change: 1 addition & 0 deletions examples/mock/platform_tumblr.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

/**
* Tumblr Platform Integration Example
Expand Down
1 change: 1 addition & 0 deletions examples/mock/platform_whatsapp.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

/**
* WhatsApp Platform Integration Example
Expand Down
1 change: 1 addition & 0 deletions examples/real/helpers.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

/**
* Shared helpers for real API examples.
Expand Down
1 change: 1 addition & 0 deletions examples/real/platform_discord.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

/**
* Discord — Real API Example
Expand Down
1 change: 1 addition & 0 deletions examples/real/platform_facebook.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

/**
* Facebook — Real API Example
Expand Down
1 change: 1 addition & 0 deletions examples/real/platform_instagram.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

/**
* Instagram — Real API Example
Expand Down
1 change: 1 addition & 0 deletions examples/real/platform_linkedin.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

/**
* LinkedIn — Real API Example
Expand Down
1 change: 1 addition & 0 deletions examples/real/platform_pinterest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

/**
* Pinterest — Real API Example
Expand Down
1 change: 1 addition & 0 deletions examples/real/platform_reddit.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

/**
* Reddit — Real API Example
Expand Down
1 change: 1 addition & 0 deletions examples/real/platform_slack.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

/**
* Slack — Real API Example
Expand Down
1 change: 1 addition & 0 deletions examples/real/platform_telegram.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

/**
* Telegram — Real API Example
Expand Down
1 change: 1 addition & 0 deletions examples/real/platform_tumblr.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

/**
* Tumblr — Real API Example
Expand Down
1 change: 1 addition & 0 deletions examples/real/platform_twitter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

/**
* Twitter/X — Real API Example
Expand Down
1 change: 1 addition & 0 deletions examples/real/platform_whatsapp.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress,Universal.Operators.DisallowShortTernary -- Example files for framework-agnostic library.

/**
* WhatsApp — Real API Example
Expand Down
2 changes: 2 additions & 0 deletions src/Auth/OAuthHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

declare(strict_types=1);

// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Framework-agnostic library; exceptions are not WordPress output.

namespace Owlstack\Core\Auth;

use Owlstack\Core\Auth\Contracts\OAuthProviderInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Config/ConfigValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

declare(strict_types=1);

// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Framework-agnostic library; exceptions are not WordPress output.

namespace Owlstack\Core\Config;

use Owlstack\Core\Exceptions\OwlstackException;
Expand Down
2 changes: 2 additions & 0 deletions src/Config/PlatformCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

declare(strict_types=1);

// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Framework-agnostic library; exceptions are not WordPress output.

namespace Owlstack\Core\Config;

/**
Expand Down
4 changes: 4 additions & 0 deletions src/Http/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

declare(strict_types=1);

// phpcs:disable WordPress.WP.AlternativeFunctions -- Framework-agnostic HTTP client; uses native cURL/file functions for portability.
// phpcs:disable WordPress.PHP.DiscouragedPHPFunctions -- base64_encode/urlencode required for multipart encoding.
// phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged -- @unlink used for temp file cleanup.

namespace Owlstack\Core\Http;

use Owlstack\Core\Http\Contracts\HttpClientInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Platforms/Discord/DiscordPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

declare(strict_types=1);

// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Framework-agnostic library; exceptions are not WordPress output.

namespace Owlstack\Core\Platforms\Discord;

use Owlstack\Core\Content\Post;
Expand Down
3 changes: 3 additions & 0 deletions src/Platforms/Facebook/FacebookPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

declare(strict_types=1);

// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Framework-agnostic library; exceptions are not WordPress output.
// phpcs:disable WordPress.WP.AlternativeFunctions -- Framework-agnostic library; uses native PHP functions for portability.

namespace Owlstack\Core\Platforms\Facebook;

use Owlstack\Core\Content\Post;
Expand Down
4 changes: 4 additions & 0 deletions src/Platforms/Instagram/InstagramPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

declare(strict_types=1);

// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Framework-agnostic library; exceptions are not WordPress output.
// phpcs:disable Universal.Operators.DisallowShortTernary.Found -- Short ternary used intentionally for concise null/empty fallbacks.
// phpcs:disable WordPress.WP.AlternativeFunctions -- Framework-agnostic library; uses native PHP functions for portability.

namespace Owlstack\Core\Platforms\Instagram;

use Owlstack\Core\Config\PlatformCredentials;
Expand Down
4 changes: 4 additions & 0 deletions src/Platforms/LinkedIn/LinkedInPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

declare(strict_types=1);

// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Framework-agnostic library; exceptions are not WordPress output.
// phpcs:disable WordPress.WP.AlternativeFunctions -- Framework-agnostic library; uses native PHP functions for portability.
// phpcs:disable WordPress.PHP.DiscouragedPHPFunctions -- urlencode required for URN encoding in API calls.

namespace Owlstack\Core\Platforms\LinkedIn;

use Owlstack\Core\Content\Post;
Expand Down
3 changes: 3 additions & 0 deletions src/Platforms/Pinterest/PinterestPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

declare(strict_types=1);

// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Framework-agnostic library; exceptions are not WordPress output.
// phpcs:disable Universal.Operators.DisallowShortTernary.Found -- Short ternary used intentionally for concise null/empty fallbacks.

namespace Owlstack\Core\Platforms\Pinterest;

use Owlstack\Core\Config\PlatformCredentials;
Expand Down
2 changes: 2 additions & 0 deletions src/Platforms/PlatformRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

declare(strict_types=1);

// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Framework-agnostic library; exceptions are not WordPress output.

namespace Owlstack\Core\Platforms;

use Owlstack\Core\Platforms\Contracts\PlatformInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Platforms/Reddit/RedditPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

declare(strict_types=1);

// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Framework-agnostic library; exceptions are not WordPress output.

namespace Owlstack\Core\Platforms\Reddit;

use Owlstack\Core\Content\Post;
Expand Down
3 changes: 3 additions & 0 deletions src/Platforms/Slack/SlackPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

declare(strict_types=1);

// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Framework-agnostic library; exceptions are not WordPress output.
// phpcs:disable Universal.Operators.DisallowShortTernary.Found -- Short ternary used intentionally for concise null/empty fallbacks.

namespace Owlstack\Core\Platforms\Slack;

use DateTimeImmutable;
Expand Down
4 changes: 4 additions & 0 deletions src/Platforms/Telegram/TelegramPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

declare(strict_types=1);

// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Framework-agnostic library; exceptions are not WordPress output.
// phpcs:disable Universal.Operators.DisallowShortTernary.Found -- Short ternary used intentionally for concise null/empty fallbacks.
// phpcs:disable WordPress.WP.AlternativeFunctions -- Framework-agnostic library; uses native PHP functions for portability.

namespace Owlstack\Core\Platforms\Telegram;

use Owlstack\Core\Content\Media;
Expand Down
3 changes: 3 additions & 0 deletions src/Platforms/Tumblr/TumblrPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

declare(strict_types=1);

// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Framework-agnostic library; exceptions are not WordPress output.
// phpcs:disable Universal.Operators.DisallowShortTernary.Found -- Short ternary used intentionally for concise null/empty fallbacks.

namespace Owlstack\Core\Platforms\Tumblr;

use Owlstack\Core\Config\PlatformCredentials;
Expand Down
4 changes: 4 additions & 0 deletions src/Platforms/Twitter/TwitterPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

declare(strict_types=1);

// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Framework-agnostic library; exceptions are not WordPress output.
// phpcs:disable WordPress.WP.AlternativeFunctions -- Framework-agnostic library; uses native PHP functions for portability.
// phpcs:disable WordPress.PHP.DiscouragedPHPFunctions -- base64_encode required for OAuth HMAC-SHA1 signature and media upload.

namespace Owlstack\Core\Platforms\Twitter;

use Owlstack\Core\Content\Media;
Expand Down
3 changes: 3 additions & 0 deletions src/Platforms/WhatsApp/WhatsAppPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

declare(strict_types=1);

// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Framework-agnostic library; exceptions are not WordPress output.
// phpcs:disable Universal.Operators.DisallowShortTernary.Found -- Short ternary used intentionally for concise null/empty fallbacks.

namespace Owlstack\Core\Platforms\WhatsApp;

use Owlstack\Core\Config\PlatformCredentials;
Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Platforms/Discord/DiscordFormatterTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress.WP.AlternativeFunctions -- Test files for framework-agnostic library.

declare(strict_types=1);

Expand Down
1 change: 1 addition & 0 deletions tests/Unit/Platforms/Discord/DiscordPlatformTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
// phpcs:disable WordPress.WP.AlternativeFunctions -- Test files for framework-agnostic library.

declare(strict_types=1);

Expand Down
Loading