Skip to content

Releases: cameronterry/dark-matter

2.1.8

26 Dec 12:16
6ceb1ce
Compare
Choose a tag to compare

Post-release update (2021-12-27)

An issue with the Webpack build process was missed during this release, causing an error that prevents the admin working with SCRIPT_DEBUG enabled.

If you upgrading from a version prior to 2.1.8, skip this release and use 2.1.9 instead which contains a fix for this problem: https://github.com/cameronterry/dark-matter/releases/tag/2.1.9

Release Notes

  • Added support for wp_cache_get_last_changed( 'dark-matter' ), to quickly and easily detect changes to domain mapping.
    • This change was made to DarkMatter_Domains and DarkMatter_Primary.
    • This is useful as a quick way of determining when changes to domain mapping has occurred.
    • Will update for any domain changes on the WordPress Network.
  • Cache is now updated before the darkmatter_primary_unset hook is fired, which is more consistent with other cache update / hooks.
  • Tested Dark Matter with PHP 8.0.
  • Updated Composer and Node dependencies to newer versions.
  • Removed Husky and pre-commit linting due to on-going issues.

2.1.7

24 Jul 22:30
fb107fe
Compare
Choose a tag to compare
  • Fixed an issue preventing continuous builds failing if using a not Git process, due to Husky throwing an error.
  • Updated Composer and Node dependencies to newer versions.
  • Upped WordPress Core support to 5.8.

2.1.6

06 Jun 15:14
e522ce8
Compare
Choose a tag to compare
  • Change: editors will now see mapped URLs when inserting links to posts. Also, editor will now load with mapped URLs and this will be unmapped on save.
    • This fixes a really annoying issue for editors, who would could see unmapped links in Classic and Block Editors.
    • Usually occurs around linking to another piece of content like a Page, Post or Term.
    • Resolves a problem with SEO plugins such as Rank Math or Yoast SEO which would get confused between the admin and primary domains for counting internal links.
  • Properly resolves an issue of unmapping the primary domain in content on Save Post, which would disengage on POST requests (Classic Editor basically).
    • This issue was introduced in 2.1.4 - sorry!
  • Fixed a problem where WordPress' validation of a "safe" URL didn't always work. This mostly affects the WP HTTP API and wp_safe_redirect() (documentation).
  • "Internal" REST API requests - conducted through rest_do_request() (documentation) - are now treated identically to "external" REST API requests in Dark Matter.
  • Switched out webpack-fix-style-only-entries for webpack-remove-empty-scripts for Webpack 5 compatibility in the build process.
  • Upped WordPress Core support to 5.7.2.

2.1.5

20 May 20:49
f17e137
Compare
Choose a tag to compare
  • Fixed a PHP notice for certain requests in the redirect logic.
  • Fixed an issue with embedding a post from the same site would not work in some circumstances.
    • Essentially the "mapping" process would run too late and WordPress would attempt to embed by the admin domain rather than the primary mapped domain (the domain used to visit the site).
    • The "mapping" process now runs twice; once before the oEmbed processes the post content. And again much later to ensure any dynamic blocks or other plugins have their output mapped to the primary domain.
    • Note: when using domain mapping, it is normal to see a single embed appear twice in post meta with Dark Matter. One embed for the admin domain / editors and another for the primary domain / visitors.

2.1.4

16 May 20:19
74eeb03
Compare
Choose a tag to compare
  • Tweaked some conditional checks to code which is more performant. The logic is identical to before, just utilising a slightly different mechanism to achieve it. This change was applied to:
    • Detecting and executing redirects, such as those from secondary domains to the primary domain as well as login and admin pages to the admin domain.
    • A check for mapping admin-ajax.php and admin-post.php appropriately on the primary domain.
    • URL mapping on the admin side.
    • URL mapping for Home URL and Site URL options.
  • Developing (for working with Dark Matter) updates:
    • Upgrade Composer / NPM dependencies to latest versions.
    • Upgraded Lodash, a dependency of some packages in use, to a new version.
    • Migrated Husky from v4 to v6 - missed in the previous 2.1.3 release.
    • Fixed the Husky integration for the pre-commit hooks ... except it doesn't work in Gitkraken (a git GUI client).
    • Fixed some minor PHPCS issues around the DM_Yoast class that was missed due to the aforementioned Husky / pre-commit issue.
  • Fixed a PHPCS warning when checking AJAX action in domain mapping for admin area.

2.1.3

18 Apr 09:35
Compare
Choose a tag to compare
  • Ensures that the post content stores URLs in their "unmapped" form.
    • This fixes issues with determining "internal links" by SEO plugins such as Yoast and Rank Math.
    • Part of Dark Matter's goal of being as compatible as possible if removed.
    • Also compensates for an issue where Gutenberg can add mapped domains to the post content through the inline link controls.
  • A new fix for Yoast SEO indexables to ensure it stores unmapped domains.
  • Developer notes (this does not alter the functionality of the plugin):
    • Ensured compatibility with Composer 2 for coding standards.
    • Updated NPM packages to the latest versions where applicable.
    • Updated Webpack configuration as part of the update.
  • Rank Math SEO plugin added to the list of compatibility checks.
  • Fixed the copyright year in the license.txt file.
  • Tested with WordPress 5.7.

2.1.2

26 Nov 20:32
067b782
Compare
Choose a tag to compare
  • Added two new filters to allow the override of permission levels.
    • Domain management with dark_matter_domain_permission.
    • Restricted domain management with dark_matter_restricted_permission.
    • This enhancement suggested by @svandragt on #51.
  • Admin page now uses the same permission check as the REST API endpoints which power it.
    • Resolves an issue reported in #51.
  • Fixed the "View [Post Type]" links in Block Editor / Gutenberg by ensuring the home_url is mapped on REST API calls.
  • Fixed an issue where get_preview_post_link() used the mapped domain when called within REST API request.
    • This should also fix a randomly occurring issue where "Sorry, you are not allowed to preview drafts" shows after clicking Preview.
    • For note: due to a quirk of Block Editor / Gutenberg, some times the "Preview in new tab" will show the mapped domain on hover but clicking will now load on admin domain.
  • Fixed the delete notice to use the domain name. Previously it just said " has been deleted." with little context.
  • Removed the warning from the Github readme.

Change permission level for managing domains

The following is a basic example of how to switch the domain management from Super Admin only to Admins (site level).

add_filter( 'dark_matter_domain_permission', function () {
    return 'switch_themes';
}, 10 );

2.1.1

01 Aug 18:40
Compare
Choose a tag to compare
  • Tested with WordPress 5.5's introduction of sitemaps (see https://make.wordpress.org/core/2020/07/22/new-xml-sitemaps-functionality-in-wordpress-5-5/).
  • Removed and reintroduced the home_url hook in certain situations for mapping certain admin links to the primary domain.
    • This fixes an issue where Yoast 14.0+ was storing mapped and unmapped URLs in the indexables table (see https://yoast.com/indexables/).
    • This occurred when Yoast was pre-emptively populating the indexables when navigating the admin area.
  • Updated NPM dependencies.
  • Changed npm run start to build both min and non-min assets. (That said, best to keep your SCRIPT_DEBUG on if developing with Dark Matter).
  • Changed npm run release to use more optimised flags with Composer. (Only affects those developing Dark Matter and not the actual code in releases.)

2.1.0

20 Jun 12:52
Compare
Choose a tag to compare

This release contains the following changes and fixes.

  • Added support and tests for Site Health Checks feature, originally introduced in WordPress 5.2. Tests the following;
    • Ensure the sunrise.php dropin is present.
    • Ensure the sunrise.php matches the version within Dark Matter.
    • Ensure the SUNRISE constant is setup correctly.
    • Checks FORCE_SSL_ADMIN is setup correctly and encourages best practices regarding HTTPS.
    • Checks COOKIE_DOMAIN to ensure it is not set.
    • Recommends a primary domain is set.
  • Changed the behaviour when COOKIE_DOMAIN is set.
    • Now disables SSO (Single-Sign On) and no longer produces in a wp_die() error.
    • The new Site Health check will note an error if COOKIE_DOMAIN is set and state that SSO has been disabled.
  • Added PHPCS through Composer for development.
  • Changed the way the SSO script is included.
    • The script tag is now created within JavaScript. (Prevents; #33)
    • Unix epoch is appended to the URL for cache breaking.
    • Note; it is still recommended to ensure the dark_matter_dmcheck and dark_matter_dmsso is excluded from any request caching solution.
  • When creating a new domain, the protocol field now defaults to HTTPS.
  • Fixed the unmap method doc block.
  • Switch the CSS build from SASS to PostCSS and CSS / Webpack is updated accordingly.
  • Removed an unused property in DM_UI class. (Fixes #42)
  • Changed wp darkmatter dropin check to use the same test method from Site Health.
  • Added localisation to the JavaScript UI components.
  • Tested with WordPress 5.4.x.
  • Contributing notes;
    • Added husky / lint-staged.
    • Pre-commit runs lint checks for JavaScript and PHP files.

2.0.5

15 Dec 14:41
233d53b
Compare
Choose a tag to compare
  • Updated Node dependencies where applicable.
  • Added WebpackBar for a progress bar when building assets.
  • Tested with WordPress 5.3.1.