Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0.4 - Release - Add back features, bug fixes #339

Merged
merged 7 commits into from
Jan 3, 2025
Merged

3.0.4 - Release - Add back features, bug fixes #339

merged 7 commits into from
Jan 3, 2025

Conversation

rgomezp
Copy link
Contributor

@rgomezp rgomezp commented Jan 2, 2025

One line summary

Release 3.0.4 with new features, bug fixes, and clean-up.

Description

This update introduces several improvements and fixes in preparation for the 3.0.4 release:

New Features

  • Auto-send notifications on post publish: Re-added this feature to restore critical functionality that was mistakenly removed.
  • UTM parameter functionality: Reintroduced support for adding UTM parameters to links for improved tracking.

Bug Fixes

  • Validation fixes on the settings form: Corrected logic to enable the save button on any form change. Previously, it required an API key even if not altering it.
  • API error handling in onesignal-metabox.php: Fixed issues where incorrect App IDs or similar API errors would break the page.

Clean-up

  • Removed the redundant readme.txt file

Release Notes

  • Version: 3.0.4
  • Includes critical features like auto-send notifications and UTM parameters.
  • Fixes key validation and error-handling issues to improve usability and reliability.

This change is Reviewable

Rodrigo Gomez Palacio added 2 commits January 2, 2025 16:39
Motivation: we're unregistering the legacy SW (.php extension) anyway.

Logic led to defaulting to false & using root scope
Motivation: important feature / should not have been removed
Copy link
Contributor

@sherwinski sherwinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ with a couple of non-blocking questions

$onesignal_settings['app_rest_api_key'] = sanitize_text_field($_POST['onesignal_rest_api_key']);
}
// Save the auto send notifications setting
$auto_send = isset($_POST['onesignal_auto_send']) ? 1 : 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Is it enough to check that onesignal_auto_send exists here, or should we ensure that its value is set to 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. It won't come through at all from the POST action if unchecked.

Comment on lines 65 to 70
foreach ($json->segments as $segment) {
$selected = isset($post->os_meta['os_segment']) && $post->os_meta['os_segment'] === $segment->name ? 'selected' : '';
echo '<option value="' . esc_attr($segment->name) . '"' . $selected . '>' . esc_html($segment->name) . '</option>';
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: this might be overly cautious but do we need to add a check for if $segment->name is set?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't hurt

Rodrigo Gomez Palacio added 5 commits January 2, 2025 18:43
Motivation: was previously breaking the page if say, the App ID was incorrect
Motivation: logic was incorrect + required an API key even if not changing it
Motivation: highly requested feature was removed in v3
Motivation: ship 3.0.4

- Added features: auto-send on publish, UTM tags
- Bug fixes: validation issues on settings form
@rgomezp rgomezp merged commit 7483da9 into main Jan 3, 2025
1 check passed
@rgomezp rgomezp deleted the 3.0.4 branch January 3, 2025 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants