-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
128 additions
and
134 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# WP Packages | ||
|
||
Contents: | ||
- [Editor Tools](./editor-tools/index.md) | ||
- [Editor Tools](../packages/editor-tools/README.md) | ||
- [Iconography](./iconography/index.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,53 @@ | ||
# Box WordPress Editor Tools | ||
|
||
A collection of tools for modifying the WordPress Editor. | ||
|
||
## Quick Start! | ||
|
||
All the tools load automatically if you've installed this as a plugin to your WordPress site. If not, you can use each class as needed. | ||
|
||
There's more options for each tool, so checkout the links below: | ||
|
||
## Features | ||
|
||
- [Asset Loader](./docs/AssetLoader.md) - help load assets generated by [wp-scripts](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/). | ||
- [Block Loader](./docs/BlockLoader.md) - auto-loads blocks to the editor. | ||
- [Comment Disablement](./docs/Comments.md) - disables comments. | ||
- [Editor Cleanup](./docs/EditorCleanup.md) - removes some unnecessary bits from the block editor. | ||
- [Post Type Registrations](./docs/PostTypes.md) - speeds up post-type registration with a single JSON file. | ||
- [Template Persistence](./docs/TemplatePersistence.md) - speeds up template modifications by saving to disk instead of the database. | ||
- [Security](./docs/Security.md) - Adds security hardening. | ||
|
||
## Contributing | ||
|
||
# Box WordPress Editor Tools | ||
|
||
A collection of tools for modifying the WordPress Editor. | ||
|
||
## Quick Start! | ||
|
||
All the tools load automatically if you include this plugin in your WP installation, or you can access the classes independently if you don't want to use this library as a plugin. | ||
|
||
There's more options too, so checkout the links below: | ||
|
||
## Features | ||
|
||
- [Asset Loader](./AssetLoader.md) - help load assets generated by [wp-scripts](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/). | ||
- [Block Loader](./BlockLoader.md) - auto-loads blocks to the editor. | ||
- [Comment Disablement](./Comments.md) - disables comments. | ||
- [Editor Cleanup](./EditorCleanup.md) - removes some unnecessary bits from the block editor. | ||
- [Post Type Registrations](./PostTypes.md) - speeds up post-type registration with a single JSON file. | ||
- [Template Persistence](./TemplatePersistence.md) - speeds up template modifications by saving to disk instead of the database. | ||
- [Security](./Security.md) - Adds security hardening. | ||
|
||
## Contributing | ||
|
||
Please do not submit any Pull Requests here. They will be closed. | ||
--- | ||
|
||
Please submit your PR here instead: https://github.com/boxuk/wp-packages | ||
|
||
This repository is what we call a "subtree split": a read-only subset of that main repository. | ||
We're looking forward to your PR there! | ||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Block Loader | ||
|
||
The Block Loader will automatically load all blocks by looking for `block.json` files in a given path. These are loaded with `register_block_type`, see [WordPress Docs](https://developer.wordpress.org/reference/functions/register_block_type/) for more context. | ||
|
||
## Usage | ||
Block loader is included automatically, and defaults to loading from your `wp-content/theme/THEME_NAME/build` folder. | ||
You can change this value using the `boxuk_block_loader_base_path` filter. | ||
|
||
```php | ||
add_filter( | ||
'boxuk_block_loader_base_path', | ||
function ( string $default_path ): string { | ||
return __DIR__ . '/my-special-path'; | ||
} | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Comment Disablement | ||
|
||
This will remove the ability for comments from your WP installation. | ||
|
||
## Usage | ||
|
||
Comments are disbaled by default, but can be enabled by modifing the `boxuk_disable_comments` filter: | ||
|
||
```php | ||
add_filter( 'boxuk_disable_comments', '__return_false' ); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Security | ||
|
||
Some security hardening features are available for you to use. | ||
|
||
## Usage | ||
The security hardening features will load automatically with sensible defaults, but there's a number of filters you can use to configure. | ||
|
||
## Filters | ||
|
||
| Filter Name | Description | Default Value | | ||
| ----------- | ----------- | ------------- | | ||
| `boxuk_prevent_author_enum` | Prevents access to the author-archive pages | `true` | | ||
| `boxuk_prevent_author_rest_endpoint` | Prevents access to the author API endpoint | `true` | | ||
| `boxuk_send_no_sniff_headers` | Sends `nosniff` and `frame_options` headers | `true` | | ||
| `boxuk_remove_vip_headers` | Removes `X-Hacker` and `X-Powered-By` headers | `true` | | ||
| `boxuk_validate_password` | Enforces strong password validations | `true` | | ||
| `boxuk_restrict_http_request_methods` | Restricts HTTP methods to the known list | `true` | | ||
| `boxuk_disable_rss` | Disables the RSS functionality | `true` | | ||
| `boxuk_modify_session_timeout` | Modifies the default session period to 10 hours | `true` | | ||
| `boxuk_restrict_user_creation` | Restricts creating users in the admin interface | `false` | | ||
| `boxuk_restrict_login_by_username` | Restricts logging in by username (allows by email only) | `true` | | ||
|
||
|
||
Filters should be added at the earliest possible point, so avoid adding via a hook (ie don't add to `init` you might be too late). WordPress includes helpful return true/false methods to make it super easy to configure. | ||
|
||
```php | ||
add_filter( 'example_filter', '__return_true' ); | ||
add_filter( 'example_filter', '__return_false' ); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters