Skip to content

Commit 10008ce

Browse files
v0.5.4 (#77)
1 parent 10e9c1e commit 10008ce

24 files changed

+1637
-228
lines changed

.distignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ composer.json
1010
composer.lock
1111
code-of-conduct.md
1212
contributing.md
13-
phpstan.neon.dist
13+
phpstan.neon.dist
14+
package.json
15+
package-lock.json
16+
.wp-env.json

.github/workflows/integrate.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: "ubuntu-latest"
1313
strategy:
1414
matrix:
15-
php-versions: ['7.4', '8.0', '8.1']
15+
php-versions: ['7.4', '8.0', '8.1', '8.2.']
1616
steps:
1717
- name: "Checkout"
1818
uses: "actions/checkout@v3"
@@ -34,7 +34,10 @@ jobs:
3434
with:
3535
php-version: "8.1"
3636
- name: "Install PHPCS"
37-
run: "composer require --dev wp-coding-standards/wpcs && composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true && composer require --dev dealerdirect/phpcodesniffer-composer-installer"
37+
run: |
38+
composer require --no-plugins --dev wp-coding-standards/wpcs
39+
composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
40+
composer run post-install-cmd
3841
- name: "Run PHPCS"
3942
run: "vendor/bin/phpcs --standard=WordPress-Core *.php includes/"
4043

.wp-env.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"config": {
3+
"WP_DEBUG": true,
4+
"WP_DEBUG_LOG": true
5+
},
6+
"phpVersion": "8.2",
7+
"plugins": [
8+
"."
9+
]
10+
}

CHANGELOG.md

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
### Changelog
2-
3-
#### 0.5.3
1+
# Changelog
2+
3+
## 0.5.4
4+
- Tested up to WordPress 6.4.2.
5+
- Bump minimum WordPress version to 5.3, aligning with minimum PHP support.
6+
- Test to PHP 8.2.
7+
- Update Github actions.
8+
- Add Code Standard fixer Github Action, h/t @szepeviktor
9+
- Fix coding standards and a bunch of typos, h/t @szepeviktor
10+
- Increase accuracy of CSS selector used to hide blog related items in Settings > Reading, closes [#69](https://github.com/joshuadavidnelson/disable-blog/issues/69)
11+
- Add `.wp-env.json` for local development.
12+
13+
## 0.5.3
414
- Fix `typeof` typo in `disable-blog-customizer.js` from 0.5.2 updates for #59.
515
- Fix uninstall error to allow for the plugin to be deleted correctly.
616
- Only fire comment related admin functions if comments are supported.
@@ -9,7 +19,7 @@
919
- Create a plugin integration framework - simple class with "plugin active" checks and related integration functions, including the preexisting WooCommerce (version <= 2.6.2) comment count integration.
1020
- Add a Disable Comments integration, utilizing the `dwpb_post_types_supporting_comments` to turn off all Disable Blog comment-related functions if Disable Comments is active.
1121

12-
#### 0.5.2
22+
## 0.5.2
1323
- Test up to WP 6.1.1
1424
- Increase minimum PHP to v7.4
1525
- Test to PHP 8.1
@@ -18,7 +28,7 @@
1828
- Adds a check to the customizer script to avoid a TypeError. Closes #59
1929
- Increase specificity in permalinks page to correctly target and remove "optional" section when category and post tags are not supported by any post type (default condition). Closes #62
2030

21-
#### 0.5.1
31+
## 0.5.1
2232
- Update to documentation, readmes, and doc blocks.
2333
- Fix `.distignore` to remove itself and .gitignore from WP-dot-org repo.
2434
- Add WP repo assets and deployment action.
@@ -32,7 +42,7 @@
3242
- Alter permalink settings based on if categories and author archives are supported.
3343
- Move `dwpb_disable_feed` filter into a function in the `Disable_Blog_Functions` class.
3444

35-
#### 0.5.0
45+
## 0.5.0
3646

3747
**New**
3848
- New disable author archive functionality via new `dwpb_disable_author_archives` filter. Pass `true` to disable author archives entirely. Default does not disable author archives because numerous other plugins use author archives for other purposes. (A future settings page will provide more flexibility here).
@@ -60,7 +70,7 @@
6070
- In order to account for multiple subpages of a common parent page being removed the `dwpb_menu_subpages_to_remove` param has been updated to support an array of subpages in the format of `$remove_subpages['parent-page-slug.php'] = array( 'subpage-1.php', 'subpage-2.php' );`, though it still supports subpages as strings for backwards compatibility. Fixes bugs were `options-writing.php` and `options-discussion.php` were conflicting.
6171

6272
**Improvements/Updates**
63-
- Update admin filters to a common format and removing redundent filters. Filter changes include:
73+
- Update admin filters to a common format and removing redundant filters. Filter changes include:
6474
- New filter: `dwpb_redirect_admin_url` filters the final url used in admin redirects.
6575
- `dwpb_redirect_admin` only accepts 1 parameter, the previous version accepted 3 (dropping `$redirect_url` & `$current_url`).
6676
- `dwpb_redirect_admin_edit_post` is now `dwpb_redirect_admin_edit`.
@@ -69,7 +79,7 @@
6979
- `dwpb_redirect_edit_tax` has been removed. Use `dwpb_redirect_admin_edit_tags` or `dwpb_redirect_admin_term` instead, depending on the context.
7080
- `dwpb_redirect_edit_comments` has been removed. use `dwpb_redirect_admin_edit_comments` instead.
7181
- `dwpb_redirect_options_discussion` has been removed. Use `dwpb_redirect_admin_options_discussion` instead.
72-
- The filter `dwpb_redirect_admin_options_writing` that would pass a boolean to toggle off the options writing page has been remaned `dwpb_remove_options_writing` and must be passed with `true` in order to have the page redirect _and_ the admin menu item removed. By default the value filtered is false and the options Writing page does not go away, as numerous other plugins use this page for non-blog related settings. Now `dwpb_redirect_admin_options_writing` is used to filter the redirect url itself, replacing the previously named `dwpb_redirect_options_writing` filter.
82+
- The filter `dwpb_redirect_admin_options_writing` that would pass a boolean to toggle off the options writing page has been remained `dwpb_remove_options_writing` and must be passed with `true` in order to have the page redirect _and_ the admin menu item removed. By default the value filtered is false and the options Writing page does not go away, as numerous other plugins use this page for non-blog related settings. Now `dwpb_redirect_admin_options_writing` is used to filter the redirect url itself, replacing the previously named `dwpb_redirect_options_writing` filter.
7383
- `dwpb_redirect_options_tools` has been removed. Use `dwpb_redirect_admin_options_tools` instead.
7484
- New filter: `dwpb_disabled_xmlpc_methods` (see above).
7585
- New filter: `dwpb_author_archive_post_types` (see above).
@@ -86,10 +96,10 @@
8696
- Updated minimum WP Core version to 4.0.
8797
- Updated translation file for all current plugin strings.
8898

89-
#### 0.4.10
99+
## 0.4.10
90100
- Fix a bug from v0.4.9 that caused redirects on custom post type archives, correcting the `modify_query` function to only remove posts from built-in taxonomy archives, as that was the original intent.
91101

92-
#### 0.4.9
102+
## 0.4.9
93103
- **Notice:** We've added the minimum PHP version requirement of 5.3, which was not explicitly set before now.
94104
- **Big change:** the plugin now changes the `post_type` arguments for posts so they are no longer public and removes all post_type support parameters. This disables the post-related admin redirects, as WordPress will now show users an error page stating "Sorry, you are not allowed to edit posts in this post type." It also pulls posts out of a lot of other locations (menus, etc) and is a much more efficient method of "disabling" the post type. This method is also used on built-in taxonomies, unless another post type supports them. **This change may impact other plugins or themes, be sure to back up your site and, if you can, test these changes prior to updating the plugin on a production site.**
95105
- Disable pingbacks entirely.
@@ -111,45 +121,45 @@
111121
- The `dwpb_author_post_types` filter is now `dwpb_archive_post_types`, as the query modification now includes all pages passing `is_archive`.
112122
- Removed filters: `dwpb_disable_rest_api`, `dwpb_remove_post_comment_support`, `dwpb_remove_post_trackback_support`, `dwpb_redirect_admin_edit_single_post`, `dwpb_redirect_single_post_edit`, `dwpb_redirect_admin_edit_post`, `dwpb_redirect_edit`, `dwpb_redirect_admin_post_new`, `dwpb_redirect_post_new` as these are rendered obsolete by above changes.
113123

114-
#### 0.4.8.1
124+
## 0.4.8.1
115125
- Do'h! Forgot to update the version number in the main plugin file. Bump.
116126

117-
#### 0.4.8
127+
## 0.4.8
118128
- Fixed typo in variable name for current vs redirect url check. (h/t @chesio, PR #30)
119129
- Update function names from template to `disable_blog`. (h/t @szepeviktor, PR #31)
120130
- Add WP.org Badge to readme.md. (h/t @szepeviktor, PR #32)
121131
- Change the name of the CI workflow to be specific to deployment. (h/t @szepeviktor, PR #33)
122132
- Some code tidying and inline documentation.
123133

124-
#### 0.4.7
134+
## 0.4.7
125135
- Using GitHub actions publish on WP.org from github releases.
126136
- Cleaned up the Reading settings, adding admin notices if front page is not set.
127137
- Add check for Multisite to avoid network page redirects. Closes #17, props to @Mactory.
128138
- Added Contributing and Code of Conduct documentation.
129139
- Check that `is_singular` works prior to running redirects to avoid non-object errors in feeds.
130140

131-
#### 0.4.6
141+
## 0.4.6
132142
- Added check on disable feed functionality to confirm post type prior to disabling feed.
133143

134-
#### 0.4.5
144+
## 0.4.5
135145
- Remove the functionality hiding the Settings > Writing admin page, allow this option to be re-enabled via the older filter. This page used to be entirely related to posts, but is also used to select the editor type (Gutenberg vs Classic).
136146
- Correct misspelled dwpb_redirect_options_tools filter.
137147

138-
#### 0.4.4
148+
## 0.4.4
139149
- Hide the Settings > Writing menu item, which shows up with Disable Comments enabled everywhere. Thanks to @dater for identifying.
140150

141-
#### 0.4.3
151+
## 0.4.3
142152
- Fix fatal error conflict with WooCommerce versions older than 2.6.3 (props to @Mahjouba91 for the heads up), no returns an array of comments in the filter for those older WooCommerce versions.
143153
- Add de/activation hooks to clear comment caches
144154
- Cleanup comment count functions.
145155

146-
#### 0.4.2
156+
## 0.4.2
147157
- Disable the REST API for 'post' post type. Props to @shawnhooper.
148158

149-
#### 0.4.1
159+
## 0.4.1
150160
- Fix unintended redirect for custom admin pages under tools.php. Props to @greatislander for the catch.
151161

152-
#### 0.4.0
162+
## 0.4.0
153163
- Refactor code to match WP Plugin Boilerplate structure, including:
154164
- Move hooks and filters into loader class.
155165
- Separate Admin and Public hooks.
@@ -165,22 +175,22 @@
165175
- Fix show_on_front pages - now, if it's set to 'posts' it will set the blog page to value 0 (not a valid option) and set the front page to value 1.
166176
- Add uninstall.php to remove plugin version saved in options table on uninstall.
167177

168-
#### 0.3.3
178+
## 0.3.3
169179
- Weird issue with svn, same as version 0.3.2.
170180

171-
#### 0.3.2
181+
## 0.3.2
172182
- Fix potential loop issue with `home_url` in redirection function.
173183
- Fix custom taxonomy save redirect (used to redirect to dashboard, now it saves correctly).
174184

175-
#### 0.3.1
185+
## 0.3.1
176186
- Add/update readme.txt.
177187

178-
#### 0.3.0
188+
## 0.3.0
179189
- Singleton Class.
180190
- Clean up documentation.
181191
- Add filters.
182192

183-
#### 0.2.0
193+
## 0.2.0
184194
More improvements:
185195

186196
- Remove 'post' post type from most queries.
@@ -199,5 +209,5 @@ More improvements:
199209
- Force Reading Settings: show_on_front, pages_for_posts, and posts_on_front, if they are not already set.
200210
- Hide other post-related reading options, except Search Engine Visibility.
201211

202-
#### 0.1.0
212+
## 0.1.0
203213
Initial beta release.

README.md

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ Disable Blog
33

44
[![WordPress Plugin Version](https://img.shields.io/wordpress/plugin/v/disable-blog)](https://wordpress.org/plugins/disable-blog/) ![Downloads](https://img.shields.io/wordpress/plugin/dt/disable-blog.svg) ![Rating](https://img.shields.io/wordpress/plugin/r/disable-blog.svg)
55

6-
**Requires at least WordPress:** 4.0
7-
**Tested up to WordPress:** 6.2
8-
**Stable version:** 0.5.3
6+
**Requires at least WordPress:** 5.3
7+
**Tested up to WordPress:** 6.4.2
8+
**Stable version:** 0.5.4
99
**License:** GPLv2 or later
1010
**Requires PHP:** 7.4
11-
**Tested up to PHP:** 8.1
11+
**Tested up to PHP:** 8.2
1212

1313
All the power of WordPress, without a blog.
1414

@@ -39,7 +39,7 @@ Activating Disable Blog does the following:
3939
- Turns the `post` type into a non-public content type, with support for zero post type features. Any attempts to edit or view posts within the admin screen will be met with a WordPress error page or be redirect to the homepage.
4040

4141
- Front-end:
42-
- Disables the post feed and remoives the feed links from the header (for WP >= 4.4.0) and disables the comment feed/removes comment feed link if 'post' is the only post type supporting comments (note that the default condition pages and attachments support comments).
42+
- Disables the post feed and removes the feed links from the header (for WP >= 4.4.0) and disables the comment feed/removes comment feed link if 'post' is the only post type supporting comments (note that the default condition pages and attachments support comments).
4343
- Removes posts from all archive pages.
4444
- Remove 'post' post type from XML sitemaps and categories/tags from XML sitemaps, if not being used by a custom post type (WP Version 5.5).
4545
- Disables the REST API for 'post' post type, as well as tags & categories (if not used by another custom post type).
@@ -59,7 +59,7 @@ Activating Disable Blog does the following:
5959
- If comments are not supported by other post types (by default comments are supported by pages and attachments), it will hide the menu links for and redirect discussion options page and 'Comments' admin page to the dashboard.
6060
- Filters out the 'post' post type from 'Comments' admin page.
6161
- Alters the comment count to remove any comments associated with 'post' post type.
62-
- Optionally remove/redirect the Settings > Writting page via `dwpb_remove_options_writing` filter (default is false).
62+
- Optionally remove/redirect the Settings > Writing page via `dwpb_remove_options_writing` filter (default is false).
6363
- Removes Available Tools from admin menu and redirects page to the dashboard (this admin page contains Press This and Category/Tag converter, both are no longer neededd without a blog).
6464
- Removes Post from '+New' admin bar menu.
6565
- Removes 'Posts' Admin Menu.
@@ -83,7 +83,7 @@ Activating Disable Blog does the following:
8383

8484
If Settings > Reading > Front Page Displays is not set to show on a page, then some aspects of the plugin won't work, be sure to set your front page to a static page.
8585

86-
#### FAQ
86+
## FAQ
8787

8888
1. Can I Disable Comments?
8989
- Other post types (like Pages) may have comment support and other great plugins exist that can disable comments, so this feature was not part of the initial development of this plugin. A future release will include options to disable comments, but until then if you would like to disable comments, try the [Disable Comments](https://wordpress.org/plugins/disable-comments/) plugin.
@@ -92,10 +92,33 @@ If Settings > Reading > Front Page Displays is not set to show on a page, then s
9292
3. How can I disable author archives?
9393
- If you're not using the built-in WP author archives for other purposes (example url: `example.com/author/author-name`) and would like to disable them entirely, add the following to your theme functions.php file or a custom plugin file: `add_filter( 'dwpb_disable_author_archives', '__return_true' );`. If author archives are not disabled, the plugin adds functionality to support custom post types on author archives by passing an array of post type slugs to `dwpb_author_archive_post_types` filter - however, theme support is usually needed to disable custom content types correctly.
9494

95-
#### Support
95+
## Support
9696

9797
This plugin is maintained for free but **please reach out** and I will assist you as soon as possible. You can visit the [WordPress.org support forums](https://wordpress.org/support/plugin/disable-blog/) or create an [issue](https://github.com/joshuadavidnelson/disable-blog/issues/) on the [GitHub repository](https://github.com/joshuadavidnelson/disable-blog/).
9898

99-
#### Contributing
99+
## Contributing
100100

101101
All contributions are welcomed and considered, please refer to [contributing.md](contributing.md).
102+
103+
### Pull requests
104+
All pull requests should be directed at the `develop` branch, and will be reviewed prior to merging. No pull requests will be merged with failing tests, but it's okay if you don't initially pass tests. Please create a draft pull request for proof of concept code or changes you'd like to have input on prior to review.
105+
106+
Please make on a branch specific to a single issue or feature. For instance, if you are suggest a solution to an issue, please create fork with a branch like `issue-894`. Or if you are proposing a new feature, create a fork with the branch name indicating the feature like `feature-example-bananas`
107+
108+
All improvements are merged into `develop` and then queued up for release before being merged into `stable`. Releases are deployed via github actions to wordpress.org on tagging a new release.
109+
110+
### Main Branches
111+
112+
The `stable` branch is reserved for releases and intended to be a mirror of the official current release, or `trunk` on wordpress.org.
113+
114+
The `develop` branch is the most current working branch. _Please direct all pull requests to the `develop` branch_
115+
116+
### Developing Disable Blog Locally
117+
118+
**Requirements:**
119+
- Docker
120+
- Node Package Manager (npm)
121+
122+
This repo contains the files needed to boot up a local development environment using [wp-env](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/).
123+
124+
Run `npm install` and the `npm run env:start` to boot up a local environment.

assets/css/disable-blog-admin.css

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
.welcome-icon.welcome-write-blog,
1111
.users-php .column-posts,
1212
.disabled-blog.options-reading-php #front-static-pages legend + p,
13-
.disabled-blog.options-reading-php .form-table tr:nth-child(2),
14-
.disabled-blog.options-reading-php .form-table tr:nth-child(3),
15-
.disabled-blog.options-reading-php .form-table tr:nth-child(4),
13+
.disabled-blog.options-reading-php .form-table:first-of-type tr:nth-child(2),
14+
.disabled-blog.options-reading-php .form-table:first-of-type tr:nth-child(3),
15+
.disabled-blog.options-reading-php .form-table:first-of-type tr:nth-child(4),
1616
.disabled-blog.options-discussion-php label[for="default_pingback_flag"],
1717
.disabled-blog.options-discussion-php label[for="default_pingback_flag"] + br,
1818
.disabled-blog.options-discussion-php label[for="default_ping_status"],
1919
.disabled-blog.options-discussion-php label[for="default_ping_status"] + br {
2020
display: none;
2121
}
22-

0 commit comments

Comments
 (0)