Skip to content

Commit

Permalink
Merge branch 'release/9.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
BracketSpaceWorker committed Oct 23, 2024
2 parents e2a3164 + 82a2d78 commit 5b8c498
Show file tree
Hide file tree
Showing 21 changed files with 486 additions and 461 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"require": {
"php": "^7.4 | ^8.0",
"composer-runtime-api": "^2.0",
"brianhenryie/strauss": "^0.19.1",
"brianhenryie/strauss": "^0.19.4",
"enshrined/svg-sanitize": "^0.16.0",
"micropackage/ajax": "^1.0",
"micropackage/cache": "^1.0",
Expand Down Expand Up @@ -63,7 +63,7 @@
"classmap_prefix": "BracketSpace_Notification_Dependencies_",
"exclude_from_prefix": {
"file_patterns": [
"compat/src-deprecated/helpers.php"
"#compat\/src-deprecated\/helpers.php#"
]
}
}
Expand All @@ -72,7 +72,7 @@
"phpcbf": "phpcbf --parallel=4",
"phpcs": "phpcs --parallel=4",
"phplint": "parallel-lint --exclude node_modules --exclude vendor --exclude dependencies .",
"phpstan": "phpstan analyze --memory-limit=-1",
"phpstan": "phpstan analyze --memory-limit=-1 -v",
"generate-stubs": "generate-stubs --finder=compat/stub-finder.php --out=compat/stubs.php --force",
"prefix-namespaces-dev": [
"strauss",
Expand Down
699 changes: 370 additions & 329 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Description: Customisable email and webhook notifications with powerful developer friendly API for custom triggers and notifications. Send alerts easily.
* Author: BracketSpace
* Author URI: https://bracketspace.com
* Version: 9.0.1
* Version: 9.0.2
* Requires PHP: 7.4
* Requires at least: 5.8
* License: GPL3
Expand Down
25 changes: 0 additions & 25 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -1580,11 +1580,6 @@ parameters:
count: 1
path: src/Repository/MergeTag/Taxonomy/TermSlug.php

-
message: "#^Parameter \\#1 \\$url of function esc_url expects string, mixed given\\.$#"
count: 1
path: src/Repository/MergeTag/UrlTag.php

-
message: "#^Parameter \\#1 \\$triggerPropertyName of method BracketSpace\\\\Notification\\\\Repository\\\\MergeTag\\\\BaseMergeTag\\:\\:setTriggerProp\\(\\) expects string, mixed given\\.$#"
count: 1
Expand Down Expand Up @@ -1915,11 +1910,6 @@ parameters:
count: 1
path: src/Repository/Trigger/User/UserPasswordChanged.php

-
message: "#^Cannot access property \\$data on WP_User\\|false\\.$#"
count: 1
path: src/Repository/Trigger/User/UserPasswordResetRequest.php

-
message: "#^Argument of an invalid type array\\|false supplied for foreach, only iterables are supported\\.$#"
count: 1
Expand Down Expand Up @@ -2020,21 +2010,6 @@ parameters:
count: 1
path: src/Store/Trigger.php

-
message: "#^Cannot access offset 'host' on array\\{scheme\\?\\: string, host\\?\\: string, port\\?\\: int, user\\?\\: string, pass\\?\\: string, path\\?\\: string, query\\?\\: string, fragment\\?\\: string\\}\\|false\\.$#"
count: 1
path: src/Utils/Settings.php

-
message: "#^Cannot access offset 'path' on array\\{scheme\\?\\: string, host\\?\\: string, port\\?\\: int, user\\?\\: string, pass\\?\\: string, path\\?\\: string, query\\?\\: string, fragment\\?\\: string\\}\\|false\\.$#"
count: 3
path: src/Utils/Settings.php

-
message: "#^Cannot access offset 'scheme' on array\\{scheme\\?\\: string, host\\?\\: string, port\\?\\: int, user\\?\\: string, pass\\?\\: string, path\\?\\: string, query\\?\\: string, fragment\\?\\: string\\}\\|false\\.$#"
count: 1
path: src/Utils/Settings.php

-
message: "#^Cannot access offset mixed on mixed\\.$#"
count: 2
Expand Down
10 changes: 9 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: notification, bracketspace, Kubitomakita, tomaszadamowicz, insejn,
Tags: notification, notify, alert, email, mail, webhook, API, developer, framework
Requires at least: 4.9
Tested up to: 6.6
Stable tag: 9.0.1
Stable tag: 9.0.2
Requires PHP: 7.4
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -297,6 +297,14 @@ Yes! We're offering a [custom plugin development](https://bracketspace.com/custo

== Changelog ==

= 9.0.2 =
* [Fixed] WP CLI add command function is not giving warnings anymore.
* [Fixed] Comment author email and display name merge tags.
* [Fixed] Do not escape HTML entities in URL merge tags.
* [Fixed] Fix user password setup link and user password reset link resolvers.
* [Fixed] Post triggers various user merge tags.
* [Fixed] Comment triggers post author merge tags.

= 9.0.1 =
* [Changed] Notification data is now kept in the wp_posts table for easier reverting to previous version.

Expand Down
2 changes: 1 addition & 1 deletion src/Admin/Wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ private function saveOptionToDismissWizard()
if (get_option($this->dismissedOption) !== false) {
update_option($this->dismissedOption, true);
} else {
add_option($this->dismissedOption, true, '', 'no');
add_option($this->dismissedOption, true, '', false);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Repository/MergeTag/UrlTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ public function validate($value)
*/
public function sanitize($value)
{
return esc_url($value);
return is_string($value) ? esc_url_raw($value) : '';
}
}
2 changes: 1 addition & 1 deletion src/Repository/MergeTag/User/UserPasswordResetLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function __construct($params = [])
sprintf(
'wp-login.php?action=rp&key=%s&login=%s',
$trigger->{$this->keyPropertyName},
rawurlencode($trigger->{$this->getTriggerProp()}->data->user_login)
rawurlencode($trigger->{$this->getTriggerProp()}->user_login)
)
);
},
Expand Down
4 changes: 2 additions & 2 deletions src/Repository/Trigger/Comment/CommentReplied.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public function context($commentNewStatus, $commentOldStatus, $comment)
$this->parentCommentUserObject = new \StdClass();
$this->parentCommentUserObject->ID = ($this->parentComment->user_id)
? ($this->parentComment->user_id) : 0;
$this->parentCommentUserObject->displayName = $this->parentComment->comment_author;
$this->parentCommentUserObject->userEmail = $this->parentComment->comment_author_email;
$this->parentCommentUserObject->display_name = $this->parentComment->comment_author;
$this->parentCommentUserObject->user_email = $this->parentComment->comment_author_email;

parent::assignProperties();
}
Expand Down
20 changes: 10 additions & 10 deletions src/Repository/Trigger/Comment/CommentTrigger.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ public function assignProperties()
$this->userObject = new \StdClass();
$this->userObject->ID = ($this->comment->user_id)
? ($this->comment->user_id) : 0;
$this->userObject->displayName = $this->comment->comment_author;
$this->userObject->userEmail = $this->comment->comment_author_email;
$this->userObject->display_name = $this->comment->comment_author;
$this->userObject->user_email = $this->comment->comment_author_email;

$this->post = get_post((int)$this->comment->comment_post_ID);

Expand Down Expand Up @@ -302,7 +302,7 @@ public function mergeTags()
'slug' => 'post_author_user_ID',
// Translators: singular post name.
'name' => sprintf(__('%s author user ID', 'notification'), __('Post', 'notification')),
'property_name' => 'post_author',
'property_name' => 'postAuthor',
// Translators: Post type name.
'group' => sprintf(__('%s author', 'notification'), $postTypeName),
]
Expand All @@ -315,7 +315,7 @@ public function mergeTags()
'slug' => 'post_author_user_login',
// Translators: singular post name.
'name' => sprintf(__('%s author user login', 'notification'), __('Post', 'notification')),
'property_name' => 'post_author',
'property_name' => 'postAuthor',
// Translators: Post type name.
'group' => sprintf(__('%s author', 'notification'), $postTypeName),
]
Expand All @@ -328,7 +328,7 @@ public function mergeTags()
'slug' => 'post_author_user_email',
// Translators: singular post name.
'name' => sprintf(__('%s author user email', 'notification'), __('Post', 'notification')),
'property_name' => 'post_author',
'property_name' => 'postAuthor',
// Translators: Post type name.
'group' => sprintf(__('%s author', 'notification'), $postTypeName),
]
Expand All @@ -341,7 +341,7 @@ public function mergeTags()
'slug' => 'post_author_user_nicename',
// Translators: singular post name.
'name' => sprintf(__('%s author user nicename', 'notification'), __('Post', 'notification')),
'property_name' => 'post_author',
'property_name' => 'postAuthor',
// Translators: Post type name.
'group' => sprintf(__('%s author', 'notification'), $postTypeName),
]
Expand All @@ -354,7 +354,7 @@ public function mergeTags()
'slug' => 'post_author_user_nickname',
// Translators: singular post name.
'name' => sprintf(__('%s author user nickname', 'notification'), __('Post', 'notification')),
'property_name' => 'post_author',
'property_name' => 'postAuthor',
// Translators: Post type name.
'group' => sprintf(__('%s author', 'notification'), $postTypeName),
]
Expand All @@ -367,7 +367,7 @@ public function mergeTags()
'slug' => 'post_author_user_display_name',
// Translators: singular post name.
'name' => sprintf(__('%s author user display name', 'notification'), __('Post', 'notification')),
'property_name' => 'post_author',
'property_name' => 'postAuthor',
// Translators: Post type name.
'group' => sprintf(__('%s author', 'notification'), $postTypeName),
]
Expand All @@ -380,7 +380,7 @@ public function mergeTags()
'slug' => 'post_author_user_firstname',
// Translators: singular post name.
'name' => sprintf(__('%s author user first name', 'notification'), __('Post', 'notification')),
'property_name' => 'post_author',
'property_name' => 'postAuthor',
// Translators: Post type name.
'group' => sprintf(__('%s author', 'notification'), $postTypeName),
]
Expand All @@ -393,7 +393,7 @@ public function mergeTags()
'slug' => 'post_author_user_lastname',
// Translators: singular post name.
'name' => sprintf(__('%s author user last name', 'notification'), __('Post', 'notification')),
'property_name' => 'post_author',
'property_name' => 'postAuthor',
// Translators: Post type name.
'group' => sprintf(__('%s author', 'notification'), $postTypeName),
]
Expand Down
20 changes: 10 additions & 10 deletions src/Repository/Trigger/Post/PostApproved.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function mergeTags()
),
// translators: singular post name.
'name' => sprintf(__('%s approving user ID', 'notification'), $postTypeName),
'property_name' => 'approving_user',
'property_name' => 'approvingUser',
'group' => __('Approving user', 'notification'),
]
)
Expand All @@ -127,7 +127,7 @@ public function mergeTags()
),
// translators: singular post name.
'name' => sprintf(__('%s approving user login', 'notification'), $postTypeName),
'property_name' => 'approving_user',
'property_name' => 'approvingUser',
'group' => __('Approving user', 'notification'),
]
)
Expand All @@ -142,7 +142,7 @@ public function mergeTags()
),
// translators: singular post name.
'name' => sprintf(__('%s approving user email', 'notification'), $postTypeName),
'property_name' => 'approving_user',
'property_name' => 'approvingUser',
'group' => __('Approving user', 'notification'),
]
)
Expand All @@ -157,7 +157,7 @@ public function mergeTags()
),
// translators: singular post name.
'name' => sprintf(__('%s approving user nicename', 'notification'), $postTypeName),
'property_name' => 'approving_user',
'property_name' => 'approvingUser',
'group' => __('Approving user', 'notification'),
]
)
Expand All @@ -172,7 +172,7 @@ public function mergeTags()
),
// translators: singular post name.
'name' => sprintf(__('%s approving user nickname', 'notification'), $postTypeName),
'property_name' => 'approving_user',
'property_name' => 'approvingUser',
'group' => __('Approving user', 'notification'),
]
)
Expand All @@ -187,7 +187,7 @@ public function mergeTags()
),
// translators: singular post name.
'name' => sprintf(__('%s approving user display name', 'notification'), $postTypeName),
'property_name' => 'approving_user',
'property_name' => 'approvingUser',
'group' => __('Approving user', 'notification'),
]
)
Expand All @@ -202,7 +202,7 @@ public function mergeTags()
),
// translators: singular post name.
'name' => sprintf(__('%s approving user first name', 'notification'), $postTypeName),
'property_name' => 'approving_user',
'property_name' => 'approvingUser',
'group' => __('Approving user', 'notification'),
]
)
Expand All @@ -217,7 +217,7 @@ public function mergeTags()
),
// translators: singular post name.
'name' => sprintf(__('%s approving user last name', 'notification'), $postTypeName),
'property_name' => 'approving_user',
'property_name' => 'approvingUser',
'group' => __('Approving user', 'notification'),
]
)
Expand All @@ -232,7 +232,7 @@ public function mergeTags()
),
// translators: singular post name.
'name' => sprintf(__('%s approving user avatar', 'notification'), $postTypeName),
'property_name' => 'approving_user',
'property_name' => 'approvingUser',
'group' => __('Approving user', 'notification'),
]
)
Expand All @@ -247,7 +247,7 @@ public function mergeTags()
),
// translators: singular post name.
'name' => sprintf(__('%s approving user role', 'notification'), $postTypeName),
'property_name' => 'approving_user',
'property_name' => 'approvingUser',
'group' => __('Approving user', 'notification'),
]
)
Expand Down
Loading

0 comments on commit 5b8c498

Please sign in to comment.