Skip to content

Commit 83f2826

Browse files
Merge branch 'develop'
2 parents 5b9068b + 6ccdcb6 commit 83f2826

File tree

9 files changed

+34
-415
lines changed

9 files changed

+34
-415
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ All notable changes to this project will be documented in this file, per [the Ke
1313
### Security
1414
-->
1515

16+
<!-- ... -->
17+
## [1.13.0] - 2025-06-07
18+
19+
### Fixed
20+
* Platform Script by @michael-sumner in #86
21+
22+
### Changed
23+
* i18n improvements by @michael-sumner in #84 and #85
24+
* Chore updates by @michael-sumner in #87
25+
1626
<!-- ... -->
1727
## [1.12.1] - 2025-03-21
1828

@@ -154,6 +164,7 @@ All notable changes to this project will be documented in this file, per [the Ke
154164
- Initial plugin release
155165

156166
[Unreleased]: https://github.com/scoredetect/timestamps/compare/trunk...develop
167+
[1.13.0]: https://github.com/scoredetect/timestamps/compare/1.12.1...1.13.0
157168
[1.12.1]: https://github.com/scoredetect/timestamps/compare/1.12.0...1.12.1
158169
[1.12.0]: https://github.com/scoredetect/timestamps/compare/1.11.0...1.12.0
159170
[1.11.0]: https://github.com/scoredetect/timestamps/compare/1.10.0...1.11.0

CONTRIBUTING.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,38 +26,36 @@ The `develop` branch is the development branch which means it contains the next
2626

2727
## Release instructions
2828

29-
Open a [new blank issue](https://github.com/scoredetect/timestamps/issues/new) with `[Release] 1.12.1`, then copy and paste the following items, replacing version numbers and links to the milestone.
29+
Open a [new blank issue](https://github.com/scoredetect/timestamps/issues/new) with `[Release] 1.13.0`, then copy and paste the following items, replacing version numbers and links to the milestone.
3030

31-
- [ ] 1. Branch: Starting from `develop`, cut a release branch named `release/1.12.1` for your changes.
31+
- [ ] 1. Branch: Starting from `develop`, cut a release branch named `release/1.13.0` for your changes.
3232
- [ ] 2. Version bump: Bump the version number in `timestamps.php`, `package.json`, `package-lock.json`, `readme.txt`, and any other relevant files if it does not already reflect the version being released. In `timestamps.php` update both the plugin "Version:" property and the plugin `SDCOM_TIMESTAMPS_VERSION` constant.
33-
- [ ] 3. Changelog: Add/update the changelog in `CHANGELOG.md`, ensuring to link the [1.12.1] release reference in the footer of `CHANGELOG.md` (e.g., https://github.com/scoredetect/timestamps/compare/1.12.1-1...1.12.1).
33+
- [ ] 3. Changelog: Add/update the changelog in `CHANGELOG.md`, ensuring to link the [1.13.0] release reference in the footer of `CHANGELOG.md` (e.g., https://github.com/scoredetect/timestamps/compare/1.13.0-1...1.13.0).
3434
- [ ] 4. Props: Update `CREDITS.md` file with any new contributors, confirm maintainers are accurate.
3535
- [ ] 5. Readme updates: Make any other readme changes as necessary. `README.md` is geared toward GitHub and `readme.txt` contains WordPress.org-specific content. The two are slightly different.
3636
- [ ] 6. New files: Check to be sure any new files/paths that are unnecessary in the production version are included in `.distignore`.
37-
- [ ] 7. POT file: Run `wp i18n make-pot . lang/timestamps.pot` and commit the file. In case of errors, try to disable Xdebug.
38-
- [ ] 8. Release date: Double check the release date in the `CHANGELOG.md` file.
39-
- [ ] 9. Merge: Merge the release branch/PR into `develop`, then make a non-fast-forward merge from `develop` into `main` (`git checkout main && git merge --no-ff develop`). `main` contains the stable development version.
40-
- [ ] 10. Test: While still on the `main` branch, test for functionality locally.
41-
- [ ] 11. Push: Push your `main` branch to GitHub (e.g. `git push origin main`).
42-
- [ ] 12. [Check the _Build and Tag_ action](https://github.com/scoredetect/timestamps/actions/workflows/build-and-tag.yml): a new tag named with the version number should've been created. It should contain all the built assets.
43-
- [ ] 13. Release: Create a [new release](https://github.com/scoredetect/timestamps/releases/new):
37+
- [ ] 7. Release date: Double check the release date in the `CHANGELOG.md` file.
38+
- [ ] 8. Merge: Merge the release branch/PR into `develop`, then make a non-fast-forward merge from `develop` into `main` (`git checkout main && git merge --no-ff develop`). `main` contains the stable development version.
39+
- [ ] 9. Test: While still on the `main` branch, test for functionality locally.
40+
- [ ] 10. Push: Push your `main` branch to GitHub (e.g. `git push origin main`).
41+
- [ ] 11. [Check the _Build and Tag_ action](https://github.com/scoredetect/timestamps/actions/workflows/build-and-tag.yml): a new tag named with the version number should've been created. It should contain all the built assets.
42+
- [ ] 12. Release: Create a [new release](https://github.com/scoredetect/timestamps/releases/new):
4443
* **Tag**: The tag created in the previous step
45-
* **Release title**: `Version 1.12.1`
44+
* **Release title**: `Version 1.13.0`
4645
* **Description**: Release changelog from `CHANGELOG.md` + `See: https://github.com/scoredetect/timestamps/milestone/#?closed=1`
47-
- [ ] 14. SVN: Wait for the [GitHub Action](https://github.com/scoredetect/timestamps/actions/workflows/push-deploy.yml) to finish deploying to the WordPress.org repository. If all goes well, users with SVN commit access for that plugin will receive an emailed diff of changes.
48-
- [ ] 15. Check WordPress.org: Ensure that the changes are live on https://wordpress.org/plugins/timestamps/. This may take a few minutes.
46+
- [ ] 13. SVN: Wait for the [GitHub Action](https://github.com/scoredetect/timestamps/actions/workflows/push-deploy.yml) to finish deploying to the WordPress.org repository. If all goes well, users with SVN commit access for that plugin will receive an emailed diff of changes.
47+
- [ ] 14. Check WordPress.org: Ensure that the changes are live on https://wordpress.org/plugins/timestamps/. This may take a few minutes.
4948

5049
## Hotfix release instructions
5150

5251
There may be cases where we have an urgent/important fix that ideally gets into a release quickly without any other changes (e.g., a "hotfix") so as to reduce (1) the amount or testing before being confident in the release and (2) to reduce the chance of unintended side effects from the extraneous non-urgent/important changes. In cases where code has previously been merged into `develop` but that ideally is not part of a hotfix, the normal release instructions above will not suffice as they would release all code merged to `develop` alongside the intended urgent/important "hotfix" change(s). In case of needing to release a "hotfix" the following are the recommended steps to take.
5352

54-
1. Branch: Starting from `main`, cut a hotfix release branch named `hotfix/1.12.1` for your hotfix change(s).
53+
1. Branch: Starting from `main`, cut a hotfix release branch named `hotfix/1.13.0` for your hotfix change(s).
5554
1. Version bump: Bump the version number in `timestamps.php`, `package.json`, `readme.txt`, and any other relevant files if it does not already reflect the version being released. In `timestamps.php` update both the plugin "Version:" property and the plugin `SDCOM_TIMESTAMPS_VERSION` constant.
56-
1. Changelog: Add/update the changelog in `CHANGELOG.md` and `readme.txt`, ensuring to link the [1.12.1] release reference in the footer of `CHANGELOG.md` (e.g., https://github.com/scoredetect/timestamps/compare/1.12.1-1...1.12.1).
55+
1. Changelog: Add/update the changelog in `CHANGELOG.md` and `readme.txt`, ensuring to link the [1.13.0] release reference in the footer of `CHANGELOG.md` (e.g., https://github.com/scoredetect/timestamps/compare/1.13.0-1...1.13.0).
5756
1. Props: Update `CREDITS.md` file with any new contributors, confirm maintainers are accurate.
5857
1. Readme updates: Make any other readme changes as necessary. `README.md` is geared toward GitHub and `readme.txt` contains WordPress.org-specific content. The two are slightly different.
5958
1. New files: Check to be sure any new files/paths that are unnecessary in the production version are included in `.distignore`.
60-
1. POT file: Run `wp i18n make-pot . lang/timestamps.pot` and commit the file.
6159
1. Release date: Double check the release date in both changelog files.
6260
1. Merge: Merge the release branch/PR into `main`. `main` contains the stable development version.
6361
1. Test: While still on the `main` branch, test for functionality locally.

includes/blocks/timestamp-post/register.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77

88
namespace SDCOM_Timestamps\Blocks\TimestampPost;
99

10-
use function SDCOM_Timestamps\Utils\is_block_editor_active;
11-
use function SDCOM_Timestamps\Utils\is_platform_script_in_content;
12-
1310
/**
1411
* Hooks into WordPress lifecycle.
1512
*/
@@ -22,10 +19,7 @@ function setup() {
2219
* Enqueue scripts.
2320
*/
2421
function scripts() {
25-
// Only enqueue the script if the block is being used and the platform script is not already in the content.
26-
if ( ! is_platform_script_in_content() && is_block_editor_active() ) {
27-
wp_enqueue_script( 'sdcom-timestamp-post-block', 'https://platform.scoredetect.com/widgets.js', array(), SDCOM_TIMESTAMPS_VERSION, true );
28-
}
22+
wp_enqueue_script( 'sdcom-timestamp-post-block', 'https://platform.scoredetect.com/widgets.js', array(), SDCOM_TIMESTAMPS_VERSION, true );
2923
}
3024

3125
/**

includes/utils.php

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -49,72 +49,6 @@ function is_authenticated() {
4949
return ! empty( $timestamps_api_key );
5050
}
5151

52-
/**
53-
* Checks if the Block Editor is active.
54-
*
55-
* @since 1.0.0
56-
* @return bool Returns true if the Block Editor is active, false otherwise.
57-
*/
58-
function is_block_editor_active() {
59-
60-
$classic_editor_replace = get_option( 'classic-editor-replace' );
61-
62-
// We assume that the Block Editor is active, whilst the Classic Editor plugin never existed.
63-
if ( empty( $classic_editor_replace ) ) {
64-
return true;
65-
}
66-
67-
// If the Classic Editor plugin is installed and activated, we check the setting.
68-
if ( $classic_editor_replace === 'block' ) {
69-
return true;
70-
}
71-
72-
// If the Classic Editor plugin is installed and activated, we check the setting.
73-
if ( $classic_editor_replace === 'classic' ) {
74-
return false;
75-
}
76-
77-
// We assume that the Block Editor is active by default.
78-
return true;
79-
}
80-
81-
/**
82-
* Checks if the platform script is in the post content.
83-
*
84-
* @since 1.0.0
85-
* @param WP_Post|int|null $post Optional. Post to check. Defaults to the current post.
86-
* @return bool Returns true if the platform script is in the post content, false otherwise.
87-
*/
88-
function is_platform_script_in_content( $post = null ) {
89-
90-
$post = get_post( $post );
91-
92-
if ( empty( $post ) ) {
93-
return false;
94-
}
95-
96-
$content = $post->post_content;
97-
98-
if ( empty( $content ) ) {
99-
return false;
100-
}
101-
102-
$content = new \WP_HTML_Tag_Processor( $content );
103-
104-
$script = $content->next_tag(
105-
array(
106-
'tag_name' => 'script',
107-
'src' => 'https://platform.scoredetect.com/widgets.js',
108-
)
109-
);
110-
111-
if ( ! empty( $script ) ) {
112-
return true;
113-
}
114-
115-
return false;
116-
}
117-
11852
/**
11953
* Checks if the WooCommerce plugin is active.
12054
*

0 commit comments

Comments
 (0)