In this development monorepo you'll find many independent packages that will help you to develop testable, maintainable and PSR-compatible enterprise WordPress projects faster than ever before.
All packages in this repo are specifically designed to be usable in distributed WordPress code and are scopable out of the box.
You can find all packages in the src/Snicco
directory.
Here is a brief overview of the repository: (hint: click the links to go to the dedicated documentation for each package)
This directory contains completely decoupled PHP components that you can use in any WordPress (or any other PHP project) .
- BetterWPAPI: A better way to interacts with WordPress core functions in distributed WordPress packages.
- BetterWPCache: A PSR6/PSR16 implementation using
the
WP_Object_Cache
. Supports cache tagging. - BetterWPCLI: The missing parts to the already awesome WP-CLI.
- BetterWPHooks: The WordPress hook system redesign in 2022. (PSR-14 compliant)
- BetterWPMail: The long overdue upgrade to
the
wp_mail
function. - BetterWPDB: Keeps you safe and sane when working with custom tables in WordPress.
- EventDispatcher: A general purpose, PSR-14 compliant event-dispatcher
that powers
snicco/better-wp-hooks
. - HttpRouting: A blazing fast routing system and PSR7/PSR15 middleware dispatcher based on fast-route. Especially build for usage in legacy software where you don't have 100% control over the request-lifecycle.
- Kernel: A minimal and customizable application bootstrapper.
- Psr7ErrorHandler: A powerful, PSR-7/PSR-3 compliant error-handler.
- Session: A custom session implementation for applications where
$_SESSION
can't be used for various reasons. - SignedURL: A standalone package to generate and validate protected urls.
- StrArr: A zero-dependency,type-safe and psalm-compatible implementation of the illuminate/support string and array helpers.
- Templating: A unified, immutable API for using and combining different template engines.
- TestableClock: Helper classes for testing time-dependent code.
This directory contains different implementations for interfaces defined in one of the components.
- Blade: Provides a 100% tested, standalone implementation
of illuminate/view
for
snicco/templating
. - IlluminateContainer: Provides an adapter
for illuminate/container for the usage
with
snicco/kernel
. - Pimple: Provides an adapter
for pimple/pimple for the usage
with
snicco/kernel
. - Session-PSR16: Allows
using
snicco/session
with any PSR16 cache backend. - SessionWP: Allows
using
snicco/session
with a custom table or theWP_Object_Cache
. - SingedURL-PSR15: Provides a PSR15 middleware
for
snicco/signed-url
. - SingedURL-PSR16: Allows using any PSR16 cache as a storage
for
snicco/signed-url
.
This directory contains PSR15-Middleware that can be plugged into the snicco/http-routing
component.
- DefaultHeaders: Add custom headers to all outgoing responses.
- HttpsOnly: Redirects HTTP => HTTPS for all requests
- MethodOverride: Allows treating form submissions
as
PUT|PATCH|DELETE
requests. - Negotiation: Performs content and language negotiation
- NoRobots: Disallows search-engines to index the current request path.
- Payload: Transforms JSON (and other) data to plain PHP arrays.
- Redirect: Redirects requests to configured locations.
- ShareCookies: Transforms cookie objects into response headers.
- TrailingSlash: Redirects
/foo/
to/foo
or vice-versa. - WPAuthOnly: Grants access only to authenticated WordPress users.
- WPCapability: Grants access only to WordPress users with the configured capability.
- WPGuestsOnly: Grants access only to guest WordPress users.
- WPNonce: Will solve all your WordPress Nonces problems once and for all.
A bundle
is a plugin for the snicco/kernel
component and integrates one or
more components
or bridges to provide out of the box functionality.
While all components can absolutely be used without using the snicco/kernel
component, bundles makes usage and configuration effortless.
- BetterWPCacheBundle
- BetterWPHooksBundle
- BetterWPMailBundle
- BetterWPDBBundle
- BladeBundle
- DebugBundle: Integrates filp/whoops
with
snicco/psr7-error-handler
- EncryptionBundle: A tight integration with the defuse/php-encryption library.
- HttpRoutingBundle
- SessionBundle:
Integrates
snicco/session
,snicco/http-routing
andsnicco/session-wp-bridge
- TemplatingBundle
- TestingBundle: A full-stack testing framework for applications build
with
snicco/kernel
based on codeception/codeception and lucatume/wp-browser.
This directory contains testing utilities for components. These packages are only meant to be used as development dependencies.
- BetterWPMailTesting: Provides a testable mail transport for usage in tests.
- EventDispatcherTesting: Provides a testable event dispatcher for usage in tests.
- HttpRoutingTesting: Provides utilities to test your custom Middleware.
- KernelTesting: Contains a test case to test custom dependency-injection adapters
- SessionTesting: Contains test cases to test custom session drivers
for
snicco/session
. - SignedUrlTesting: Contains test cases to test custom storage
for
snicco/signed-url
.
We've set up a separate document for our contribution guidelines.
Our changelog is automatically generated using the wonderful npm package semantic-release.
Please review our security policy on how to securely report vulnerabilities.
This project is licensed under the terms of the GNU LGPLv3 unless otherwise specified in the respective LICENSE.md file of each package. See LICENSE.md
We want to express our special gratitude to:
- @matthiasnoback: For his teachings on PHP package design. It had a lot of influence on how we set up this project.
- @TomasVotruba: For his teachings on managing a PHP monorepo.