Skip to content

Commit

Permalink
v0.5.4 (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadavidnelson authored Dec 15, 2023
1 parent 10e9c1e commit 10008ce
Show file tree
Hide file tree
Showing 24 changed files with 1,637 additions and 228 deletions.
5 changes: 4 additions & 1 deletion .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ composer.json
composer.lock
code-of-conduct.md
contributing.md
phpstan.neon.dist
phpstan.neon.dist
package.json
package-lock.json
.wp-env.json
7 changes: 5 additions & 2 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1']
php-versions: ['7.4', '8.0', '8.1', '8.2.']
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
Expand All @@ -34,7 +34,10 @@ jobs:
with:
php-version: "8.1"
- name: "Install PHPCS"
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"
run: |
composer require --no-plugins --dev wp-coding-standards/wpcs
composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer run post-install-cmd
- name: "Run PHPCS"
run: "vendor/bin/phpcs --standard=WordPress-Core *.php includes/"

Expand Down
10 changes: 10 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"config": {
"WP_DEBUG": true,
"WP_DEBUG_LOG": true
},
"phpVersion": "8.2",
"plugins": [
"."
]
}
62 changes: 36 additions & 26 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
### Changelog

#### 0.5.3
# Changelog

## 0.5.4
- Tested up to WordPress 6.4.2.
- Bump minimum WordPress version to 5.3, aligning with minimum PHP support.
- Test to PHP 8.2.
- Update Github actions.
- Add Code Standard fixer Github Action, h/t @szepeviktor
- Fix coding standards and a bunch of typos, h/t @szepeviktor
- Increase accuracy of CSS selector used to hide blog related items in Settings > Reading, closes [#69](https://github.com/joshuadavidnelson/disable-blog/issues/69)
- Add `.wp-env.json` for local development.

## 0.5.3
- Fix `typeof` typo in `disable-blog-customizer.js` from 0.5.2 updates for #59.
- Fix uninstall error to allow for the plugin to be deleted correctly.
- Only fire comment related admin functions if comments are supported.
Expand All @@ -9,7 +19,7 @@
- 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.
- 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.

#### 0.5.2
## 0.5.2
- Test up to WP 6.1.1
- Increase minimum PHP to v7.4
- Test to PHP 8.1
Expand All @@ -18,7 +28,7 @@
- Adds a check to the customizer script to avoid a TypeError. Closes #59
- 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

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

#### 0.5.0
## 0.5.0

**New**
- 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).
Expand Down Expand Up @@ -60,7 +70,7 @@
- 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.

**Improvements/Updates**
- Update admin filters to a common format and removing redundent filters. Filter changes include:
- Update admin filters to a common format and removing redundant filters. Filter changes include:
- New filter: `dwpb_redirect_admin_url` filters the final url used in admin redirects.
- `dwpb_redirect_admin` only accepts 1 parameter, the previous version accepted 3 (dropping `$redirect_url` & `$current_url`).
- `dwpb_redirect_admin_edit_post` is now `dwpb_redirect_admin_edit`.
Expand All @@ -69,7 +79,7 @@
- `dwpb_redirect_edit_tax` has been removed. Use `dwpb_redirect_admin_edit_tags` or `dwpb_redirect_admin_term` instead, depending on the context.
- `dwpb_redirect_edit_comments` has been removed. use `dwpb_redirect_admin_edit_comments` instead.
- `dwpb_redirect_options_discussion` has been removed. Use `dwpb_redirect_admin_options_discussion` instead.
- 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.
- 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.
- `dwpb_redirect_options_tools` has been removed. Use `dwpb_redirect_admin_options_tools` instead.
- New filter: `dwpb_disabled_xmlpc_methods` (see above).
- New filter: `dwpb_author_archive_post_types` (see above).
Expand All @@ -86,10 +96,10 @@
- Updated minimum WP Core version to 4.0.
- Updated translation file for all current plugin strings.

#### 0.4.10
## 0.4.10
- 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.

#### 0.4.9
## 0.4.9
- **Notice:** We've added the minimum PHP version requirement of 5.3, which was not explicitly set before now.
- **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.**
- Disable pingbacks entirely.
Expand All @@ -111,45 +121,45 @@
- The `dwpb_author_post_types` filter is now `dwpb_archive_post_types`, as the query modification now includes all pages passing `is_archive`.
- 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.

#### 0.4.8.1
## 0.4.8.1
- Do'h! Forgot to update the version number in the main plugin file. Bump.

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

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

#### 0.4.6
## 0.4.6
- Added check on disable feed functionality to confirm post type prior to disabling feed.

#### 0.4.5
## 0.4.5
- 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).
- Correct misspelled dwpb_redirect_options_tools filter.

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

#### 0.4.3
## 0.4.3
- 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.
- Add de/activation hooks to clear comment caches
- Cleanup comment count functions.

#### 0.4.2
## 0.4.2
- Disable the REST API for 'post' post type. Props to @shawnhooper.

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

#### 0.4.0
## 0.4.0
- Refactor code to match WP Plugin Boilerplate structure, including:
- Move hooks and filters into loader class.
- Separate Admin and Public hooks.
Expand All @@ -165,22 +175,22 @@
- 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.
- Add uninstall.php to remove plugin version saved in options table on uninstall.

#### 0.3.3
## 0.3.3
- Weird issue with svn, same as version 0.3.2.

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

#### 0.3.1
## 0.3.1
- Add/update readme.txt.

#### 0.3.0
## 0.3.0
- Singleton Class.
- Clean up documentation.
- Add filters.

#### 0.2.0
## 0.2.0
More improvements:

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

#### 0.1.0
## 0.1.0
Initial beta release.
41 changes: 32 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ Disable Blog

[![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)

**Requires at least WordPress:** 4.0
**Tested up to WordPress:** 6.2
**Stable version:** 0.5.3
**Requires at least WordPress:** 5.3
**Tested up to WordPress:** 6.4.2
**Stable version:** 0.5.4
**License:** GPLv2 or later
**Requires PHP:** 7.4
**Tested up to PHP:** 8.1
**Tested up to PHP:** 8.2

All the power of WordPress, without a blog.

Expand Down Expand Up @@ -39,7 +39,7 @@ Activating Disable Blog does the following:
- 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.

- Front-end:
- 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).
- 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).
- Removes posts from all archive pages.
- 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).
- Disables the REST API for 'post' post type, as well as tags & categories (if not used by another custom post type).
Expand All @@ -59,7 +59,7 @@ Activating Disable Blog does the following:
- 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.
- Filters out the 'post' post type from 'Comments' admin page.
- Alters the comment count to remove any comments associated with 'post' post type.
- Optionally remove/redirect the Settings > Writting page via `dwpb_remove_options_writing` filter (default is false).
- Optionally remove/redirect the Settings > Writing page via `dwpb_remove_options_writing` filter (default is false).
- 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).
- Removes Post from '+New' admin bar menu.
- Removes 'Posts' Admin Menu.
Expand All @@ -83,7 +83,7 @@ Activating Disable Blog does the following:

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.

#### FAQ
## FAQ

1. Can I Disable Comments?
- 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.
Expand All @@ -92,10 +92,33 @@ If Settings > Reading > Front Page Displays is not set to show on a page, then s
3. How can I disable author archives?
- 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.

#### Support
## Support

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/).

#### Contributing
## Contributing

All contributions are welcomed and considered, please refer to [contributing.md](contributing.md).

### Pull requests
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.

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`

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.

### Main Branches

The `stable` branch is reserved for releases and intended to be a mirror of the official current release, or `trunk` on wordpress.org.

The `develop` branch is the most current working branch. _Please direct all pull requests to the `develop` branch_

### Developing Disable Blog Locally

**Requirements:**
- Docker
- Node Package Manager (npm)

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/).

Run `npm install` and the `npm run env:start` to boot up a local environment.
7 changes: 3 additions & 4 deletions assets/css/disable-blog-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
.welcome-icon.welcome-write-blog,
.users-php .column-posts,
.disabled-blog.options-reading-php #front-static-pages legend + p,
.disabled-blog.options-reading-php .form-table tr:nth-child(2),
.disabled-blog.options-reading-php .form-table tr:nth-child(3),
.disabled-blog.options-reading-php .form-table tr:nth-child(4),
.disabled-blog.options-reading-php .form-table:first-of-type tr:nth-child(2),
.disabled-blog.options-reading-php .form-table:first-of-type tr:nth-child(3),
.disabled-blog.options-reading-php .form-table:first-of-type tr:nth-child(4),
.disabled-blog.options-discussion-php label[for="default_pingback_flag"],
.disabled-blog.options-discussion-php label[for="default_pingback_flag"] + br,
.disabled-blog.options-discussion-php label[for="default_ping_status"],
.disabled-blog.options-discussion-php label[for="default_ping_status"] + br {
display: none;
}

Loading

0 comments on commit 10008ce

Please sign in to comment.