Better Notifications for WordPress - Version 1.8.7

Version Description

  • 27th January 2022 =
  • IMPORTANT! It is recommended that you update this plugin to the latest version.
  • Fixed: A security issue affecting select2 fields when searching for a user or user role.
Download this release

Release Info

Developer voltronik
Plugin Icon 128x128 Better Notifications for WordPress
Version 1.8.7
Comparing to
See all releases

Code changes from version 1.8.6 to 1.8.7

README.txt CHANGED
@@ -3,11 +3,12 @@ Contributors: voltronik
3
  Donate link: https://betternotificationsforwp.com/donate/
4
  Tags: notification, email, alert, message, notify, send, HTML, customize, bulk, trigger, CC, BCC
5
  Requires at least: 4.8
6
- Tested up to: 5.7.2
7
- Requires PHP: 5.6
8
- Stable tag: 1.8.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
 
11
 
12
  Supercharge your WordPress email notifications using a WYSIWYG editor and shortcodes. Default and new notifications available. Increase power with Add-ons.
13
 
@@ -21,7 +22,7 @@ Here's a quick walkthrough of the plugin in action:
21
  = An Example: =
22
  You want all the users in the Editor role to be notified via email when a new post is published and you'd like to customise it to include your logo along with the author's name and date / time it was published - with this plugin, that's easy.
23
 
24
- > A handy list of shortcodes you can use is available [here](https://betternotificationsforwp.com/shortcodes/ "Shortcodes for use in Better Notifications for WP").
25
 
26
  = Premium Add-ons =
27
  Power-up your notifications using add-ons:
@@ -163,8 +164,8 @@ If you want to let users create their own email notifications, check out my othe
163
  1. Upload the 'bnfw' plugin folder to the '/wp-content/plugins/' directory or install it via your WordPress Admin.
164
  2. Activate the plugin through the 'Plugins' menu in WordPress.
165
  3. Use the settings in the new 'Notifications' Menu item in the sidebar to configure the plugin.
166
- 4. (Optional) Install a plugin to use SMTP instead of `wp_mail()`. I recommend [Post SMTP Mailer/Email Log](https://wordpress.org/plugins/post-smtp/).
167
- 5. Test by creating a notification with some [shortcodes](https://betternotificationsforwp.com/shortcodes/ "Shortcodes for use in Better Notifications for WP").
168
 
169
 
170
 
@@ -182,7 +183,7 @@ Shortcodes are text in square brackets that output content of some kind. For exa
182
 
183
  Shortcodes can be used in the 'Subject' and 'Message Body' of your notifications, except for a select few (due to a restriction in WordPress).
184
 
185
- > A handy list of shortcodes you can use is available [here](https://betternotificationsforwp.com/shortcodes/ "Shortcodes for use in Better Notifications for WP").
186
 
187
  = What are some scenarios this plugin could be used for? =
188
 
@@ -241,6 +242,10 @@ Yes, of course! The plugin is completely translation-friendly and if you send me
241
 
242
  == Changelog ==
243
 
 
 
 
 
244
  = 1.8.6 - 26th April 2021 =
245
  * Fixed: Post Author and Update Author shortcodes now work as expected again following an issue introduced in WordPress 5.7.
246
  * Fixed: User Lost Password notifications now work correctly if users only log in with their email address.
3
  Donate link: https://betternotificationsforwp.com/donate/
4
  Tags: notification, email, alert, message, notify, send, HTML, customize, bulk, trigger, CC, BCC
5
  Requires at least: 4.8
6
+ Tested up to: 5.9
7
+ Requires PHP: 7.0
8
+ Stable tag: 1.8.7
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
+ Update URI: https://wordpress.org/plugins/bnfw/
12
 
13
  Supercharge your WordPress email notifications using a WYSIWYG editor and shortcodes. Default and new notifications available. Increase power with Add-ons.
14
 
22
  = An Example: =
23
  You want all the users in the Editor role to be notified via email when a new post is published and you'd like to customise it to include your logo along with the author's name and date / time it was published - with this plugin, that's easy.
24
 
25
+ > A handy list of shortcodes you can use is available [here](https://betternotificationsforwp.com/documentation/notifications/shortcodes/ "Shortcodes for use in Better Notifications for WP").
26
 
27
  = Premium Add-ons =
28
  Power-up your notifications using add-ons:
164
  1. Upload the 'bnfw' plugin folder to the '/wp-content/plugins/' directory or install it via your WordPress Admin.
165
  2. Activate the plugin through the 'Plugins' menu in WordPress.
166
  3. Use the settings in the new 'Notifications' Menu item in the sidebar to configure the plugin.
167
+ 4. (Optional) Read our article on [how to improve email delivery in WordPress](https://betternotificationsforwp.com/guides/how-to-improve-email-delivery-wordpress/).
168
+ 5. Test by creating a notification with some [shortcodes](https://betternotificationsforwp.com/documentation/notifications/shortcodes/ "Shortcodes for use in Better Notifications for WP").
169
 
170
 
171
 
183
 
184
  Shortcodes can be used in the 'Subject' and 'Message Body' of your notifications, except for a select few (due to a restriction in WordPress).
185
 
186
+ > A handy list of shortcodes you can use is available [here](https://betternotificationsforwp.com/documentation/notifications/shortcodes/ "Shortcodes for use in Better Notifications for WP").
187
 
188
  = What are some scenarios this plugin could be used for? =
189
 
242
 
243
  == Changelog ==
244
 
245
+ = 1.8.7 - 27th January 2022 =
246
+ * IMPORTANT! It is recommended that you update this plugin to the latest version.
247
+ * Fixed: A security issue affecting select2 fields when searching for a user or user role.
248
+
249
  = 1.8.6 - 26th April 2021 =
250
  * Fixed: Post Author and Update Author shortcodes now work as expected again following an issue introduced in WordPress 5.7.
251
  * Fixed: User Lost Password notifications now work correctly if users only log in with their email address.
assets/css/bnfw.css CHANGED
@@ -1,180 +1,180 @@
1
- /* Generic classes */
2
- .hidden {
3
- display: none;
4
- }
5
-
6
- .show {
7
- display: block;
8
- }
9
-
10
- #user-password-msg {
11
- display: none;
12
- }
13
-
14
- #user-password-msg div {
15
- background: #FFFFE1;
16
- padding: 15px;
17
- }
18
-
19
- #users-count-msg div {
20
- background: #F79C2D;
21
- padding: 15px;
22
- }
23
-
24
- #users-count-msg div p {
25
- margin-top: 0;
26
- }
27
-
28
- .manage-column.column-disabled {
29
- width: 8% !important;
30
- }
31
-
32
- /* Fix 'jump' when hovering over 'x' in select2 box */
33
- /*ul.select2-choices li.select2-search-choice a {
34
- -webkit-transition-property: none;
35
- transition-property: none;
36
- -webkit-transition-duration: 0s;
37
- transition-duration: 0s;
38
- -webkit-transition-timing-function: initial;
39
- transition-timing-function: initial;
40
- }*/
41
-
42
- /* Select2 4.0 */
43
- .select2-container--default .select2-selection--multiple {
44
- line-height: 0;
45
- }
46
-
47
- ul.select2-selection__rendered {
48
- line-height: 1.3;
49
- }
50
-
51
-
52
- /* Help Tip Positioning */
53
- .bnfw-help-tip-container,
54
- body.post-type-bnfw_notification #poststuff th,
55
- body.post-type-bnfw_notification #poststuff td,
56
- .bnfw-form th,
57
- .bnfw-form td {
58
- position: relative;
59
- }
60
-
61
- #bnfw-post-notification th[scope="row"],
62
- .bnfw-form th[scope="row"] {
63
- padding-right: 24px;
64
- }
65
-
66
- /* Inline Help Tips */
67
- .bnfw-help-tip {
68
- position: absolute;
69
- top: 22px;
70
- right: 8px;
71
- background-color: #73daeb;
72
- border-radius: 50%;
73
- width: 15px;
74
- height: 15px;
75
- font-size: 12px;
76
- line-height: 16px;
77
- text-align: center;
78
- cursor: default;
79
- }
80
-
81
- .bnfw-help-tip-container .bnfw-help-tip {
82
- top: 8px;
83
- }
84
-
85
- /* Left Align Elements on Right of Screen */
86
- #bnfw_override_optout .bnfw-help-tip p,
87
- #bnfw_submitdiv .bnfw-help-tip p {
88
- left: auto;
89
- right: -8px;
90
- }
91
-
92
- #bnfw_override_optout .bnfw-help-tip p:before,
93
- #bnfw_submitdiv .bnfw-help-tip p:before {
94
- left: auto;
95
- right: 10px;
96
- top: -12px;
97
- }
98
-
99
-
100
- .bnfw-help-tip:hover:before {
101
- color: #444;
102
- }
103
-
104
- .bnfw-help-tip:before {
105
- content: '?';
106
- font-weight: bold;
107
- color: #fff;
108
- }
109
-
110
- .bnfw-help-tip:hover p {
111
- display: block;
112
- transform-origin: 100% 0%;
113
- -webkit-animation: fadeIn 0.3s ease-in-out;
114
- animation: fadeIn 0.3s ease-in-out;
115
- }
116
-
117
- .bnfw-help-tip p {
118
- display: none;
119
- position: absolute;
120
- left: -8px;
121
- z-index: 9991;
122
- width: 300px;
123
- box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
124
- border-radius: 3px;
125
- background-color: #1E2021;
126
- padding: 20px;
127
- font-size: 13px;
128
- line-height: 1.4;
129
- color: #FFF;
130
- text-align: left;
131
- }
132
-
133
- .bnfw-help-tip p:before {
134
- position: absolute;
135
- content: '';
136
- width: 0;
137
- height: 0;
138
- border: 6px solid transparent;
139
- border-bottom-color: #1E2021;
140
- left: 10px;
141
- top: -12px;
142
- }
143
-
144
- .bnfw-help-tip p:after {
145
- content: '';
146
- position: absolute;
147
- top: -40px;
148
- left: 0;
149
- width: 100%;
150
- height: 40px;
151
- }
152
-
153
- .bnfw-help-tip p a {
154
- color: #73daeb;
155
- }
156
-
157
- .bnfw-help-tip p a:hover {
158
- color: #a0e6f1;
159
- }
160
-
161
- .bnfw-help-tip + .wp-ui-text-highlight {
162
- color: #1fbfd9;
163
- }
164
-
165
- @-webkit-keyframes fadeIn {
166
- 0% {
167
- opacity: 0;
168
- transform: scale(0.6);
169
- }
170
-
171
- 100% {
172
- opacity:1 00%;
173
- transform: scale(1);
174
- }
175
- }
176
-
177
- @keyframes fadeIn {
178
- 0% { opacity: 0; }
179
- 100% { opacity: 100%; }
180
  }
1
+ /* Generic classes */
2
+ .hidden {
3
+ display: none;
4
+ }
5
+
6
+ .show {
7
+ display: block;
8
+ }
9
+
10
+ #user-password-msg {
11
+ display: none;
12
+ }
13
+
14
+ #user-password-msg div {
15
+ background: #FFFFE1;
16
+ padding: 15px;
17
+ }
18
+
19
+ #users-count-msg div {
20
+ background: #F79C2D;
21
+ padding: 15px;
22
+ }
23
+
24
+ #users-count-msg div p {
25
+ margin-top: 0;
26
+ }
27
+
28
+ .manage-column.column-disabled {
29
+ width: 8% !important;
30
+ }
31
+
32
+ /* Fix 'jump' when hovering over 'x' in select2 box */
33
+ /*ul.select2-choices li.select2-search-choice a {
34
+ -webkit-transition-property: none;
35
+ transition-property: none;
36
+ -webkit-transition-duration: 0s;
37
+ transition-duration: 0s;
38
+ -webkit-transition-timing-function: initial;
39
+ transition-timing-function: initial;
40
+ }*/
41
+
42
+ /* Select2 4.0 */
43
+ .select2-container--default .select2-selection--multiple {
44
+ line-height: 0;
45
+ }
46
+
47
+ ul.select2-selection__rendered {
48
+ line-height: 1.3;
49
+ }
50
+
51
+
52
+ /* Help Tip Positioning */
53
+ .bnfw-help-tip-container,
54
+ body.post-type-bnfw_notification #poststuff th,
55
+ body.post-type-bnfw_notification #poststuff td,
56
+ .bnfw-form th,
57
+ .bnfw-form td {
58
+ position: relative;
59
+ }
60
+
61
+ #bnfw-post-notification th[scope="row"],
62
+ .bnfw-form th[scope="row"] {
63
+ padding-right: 24px;
64
+ }
65
+
66
+ /* Inline Help Tips */
67
+ .bnfw-help-tip {
68
+ position: absolute;
69
+ top: 22px;
70
+ right: 8px;
71
+ background-color: #73daeb;
72
+ border-radius: 50%;
73
+ width: 15px;
74
+ height: 15px;
75
+ font-size: 12px;
76
+ line-height: 16px;
77
+ text-align: center;
78
+ cursor: default;
79
+ }
80
+
81
+ .bnfw-help-tip-container .bnfw-help-tip {
82
+ top: 8px;
83
+ }
84
+
85
+ /* Left Align Elements on Right of Screen */
86
+ #bnfw_override_optout .bnfw-help-tip p,
87
+ #bnfw_submitdiv .bnfw-help-tip p {
88
+ left: auto;
89
+ right: -8px;
90
+ }
91
+
92
+ #bnfw_override_optout .bnfw-help-tip p:before,
93
+ #bnfw_submitdiv .bnfw-help-tip p:before {
94
+ left: auto;
95
+ right: 10px;
96
+ top: -12px;
97
+ }
98
+
99
+
100
+ .bnfw-help-tip:hover:before {
101
+ color: #444;
102
+ }
103
+
104
+ .bnfw-help-tip:before {
105
+ content: '?';
106
+ font-weight: bold;
107
+ color: #fff;
108
+ }
109
+
110
+ .bnfw-help-tip:hover p {
111
+ display: block;
112
+ transform-origin: 100% 0%;
113
+ -webkit-animation: fadeIn 0.3s ease-in-out;
114
+ animation: fadeIn 0.3s ease-in-out;
115
+ }
116
+
117
+ .bnfw-help-tip p {
118
+ display: none;
119
+ position: absolute;
120
+ left: -8px;
121
+ z-index: 9991;
122
+ width: 300px;
123
+ box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
124
+ border-radius: 3px;
125
+ background-color: #1E2021;
126
+ padding: 20px;
127
+ font-size: 13px;
128
+ line-height: 1.4;
129
+ color: #FFF;
130
+ text-align: left;
131
+ }
132
+
133
+ .bnfw-help-tip p:before {
134
+ position: absolute;
135
+ content: '';
136
+ width: 0;
137
+ height: 0;
138
+ border: 6px solid transparent;
139
+ border-bottom-color: #1E2021;
140
+ left: 10px;
141
+ top: -12px;
142
+ }
143
+
144
+ .bnfw-help-tip p:after {
145
+ content: '';
146
+ position: absolute;
147
+ top: -40px;
148
+ left: 0;
149
+ width: 100%;
150
+ height: 40px;
151
+ }
152
+
153
+ .bnfw-help-tip p a {
154
+ color: #73daeb;
155
+ }
156
+
157
+ .bnfw-help-tip p a:hover {
158
+ color: #a0e6f1;
159
+ }
160
+
161
+ .bnfw-help-tip + .wp-ui-text-highlight {
162
+ color: #1fbfd9;
163
+ }
164
+
165
+ @-webkit-keyframes fadeIn {
166
+ 0% {
167
+ opacity: 0;
168
+ transform: scale(0.6);
169
+ }
170
+
171
+ 100% {
172
+ opacity:1 00%;
173
+ transform: scale(1);
174
+ }
175
+ }
176
+
177
+ @keyframes fadeIn {
178
+ 0% { opacity: 0; }
179
+ 100% { opacity: 100%; }
180
  }
assets/img/icon-256x256.png CHANGED
File without changes
assets/js/bnfw.js CHANGED
@@ -1,642 +1,643 @@
1
- jQuery(document).ready(function($) {
2
- var multisiteNotifications = [
3
- 'multisite-site-created',
4
- 'multisite-new-user-created',
5
- 'multisite-network-admin-email-change-attempted',
6
- 'multisite-network-admin-email-changed',
7
- 'multisite-site-welcome',
8
- 'multisite-site-deleted',
9
- 'multisite-site-admin-email-change-attempted',
10
- 'multisite-site-admin-email-changed',
11
- 'multisite-site-registered',
12
- 'multisite-new-user-welcome',
13
- 'multisite-new-user-invited'
14
- ];
15
-
16
- function toggle_fields() {
17
- var show_fields = $('#show-fields').is(":checked");
18
- var notification = $( "#notification" ).val();
19
- if('user-login' === notification){
20
- if ( show_fields ) {
21
- $('#email, #reply').show();
22
- } else {
23
- $('#email, #reply').hide();
24
- }
25
- }else{
26
- if ( show_fields ) {
27
- $('#email, #cc, #bcc, #reply').show();
28
- } else {
29
- $('#email, #cc, #bcc, #reply').hide();
30
- }
31
- }
32
- $( '#subject-wrapper' ).show();
33
- }
34
-
35
- function toggle_users() {
36
- if ( $( '#only-post-author' ).is( ':checked' ) ) {
37
- $( '#current-user' ).hide();
38
- } else {
39
- $( '#current-user' ).show();
40
- }
41
-
42
- var notification = $( '#notification' ).val();
43
- var check_comment = notification.split('-');
44
- if ( 'new-comment' === notification || 'approve' === check_comment[0] || 'moderate-comment' === notification ) {
45
- $( '#current-user' ).show();
46
- }
47
- }
48
-
49
- function init() {
50
- var notification = $('#notification').val();
51
-
52
- $("#notification, .bnfw-select2").select2();
53
-
54
- $(".user-select2").select2({
55
- tags: BNFW.enableTags,
56
- tokenSeparators: BNFW.enabletokenSeparators
57
- } );
58
-
59
- $(".user-ajax-select2").select2( {
60
- ajax: {
61
- url: ajaxurl,
62
- dataType: 'json',
63
- data: function( params ) {
64
- return {
65
- action: 'bnfw_search_users',
66
- query: params.term,
67
- page: params.page
68
- };
69
- },
70
- processResults: function( data, page ) {
71
- return {
72
- results: data
73
- };
74
- }
75
- },
76
- minimumInputLength: 1,
77
- tags: BNFW.enableTags
78
- } );
79
-
80
- if ( ! $( '#notification' ).length ) {
81
- return;
82
- }
83
-
84
- toggle_fields();
85
-
86
- var check_comment = notification.split('-');
87
-
88
- if ( 'reply-comment' === notification || notification.startsWith( 'commentreply-' ) ||
89
- 'new-user' === notification || 'welcome-email' === notification || 'user-password' === notification ||
90
- 'password-changed' === notification || 'email-changed' === notification || 'email-changing' === notification || 'user-role' === notification ||
91
- 'ca-export-data' === notification || 'ca-erase-data' === notification ||
92
- 'uc-export-data' === notification || 'uc-erase-data' === notification ||
93
- 'data-export' === notification || 'data-erased' === notification ||
94
- 'multisite-new-user-invited' === notification || 'multisite-new-user-created' === notification || 'multisite-new-user-welcome' === notification ||
95
- 'multisite-site-registered' === notification || 'multisite-site-welcome' === notification ||
96
- 'multisite-site-created' === notification || 'multisite-site-deleted' === notification ||
97
- 'multisite-site-admin-email-change-attempted' === notification || 'multisite-site-admin-email-changed' === notification ||
98
- 'multisite-network-admin-email-change-attempted' === notification || 'multisite-network-admin-email-changed' === notification) {
99
-
100
- $('#toggle-fields, #email, #cc, #bcc, #reply, #users, #exclude-users, #current-user, #post-author').hide();
101
- $('#user-password-msg, #disable-autop, #email-formatting').show();
102
-
103
- $( '#subject-wrapper' ).show();
104
- if ( 'multisite-new-user-created' === notification || 'multisite-site-created' === notification || 'multisite-site-deleted' === notification ||
105
- 'multisite-site-admin-email-change-attempted' === notification || 'multisite-network-admin-email-change-attempted' === notification ||
106
- 'uc-export-data' === notification || 'uc-erase-data' === notification || 'data-export' === notification ||
107
- 'ca-export-data' === notification || 'ca-erase-data' === notification || 'email-changing' === notification ) {
108
-
109
- $( '#subject-wrapper' ).hide();
110
- }
111
-
112
- if ( 'uc-export-data' === notification || 'uc-erase-data' === notification || 'data-export' === notification ||
113
- 'ca-export-data' === notification || 'ca-erase-data' === notification || 'data-erased' === notification || ( -1 !== multisiteNotifications.indexOf( notification ) ) ) {
114
-
115
- $( '#email-formatting' ).hide();
116
- }
117
- } else if ( 'new-comment' === notification || 'approve' === check_comment[0] || notification.startsWith( 'moderate-comment-' ) || 'new-trackback' === notification || 'new-pingback' === notification ||
118
- 'admin-password' === notification || 'admin-user' === notification || 'admin-role' === notification ) {
119
-
120
- if ( 'new-comment' === notification || 'approve' === check_comment[0] || notification.startsWith( 'moderate-comment-' ) || 'new-trackback' === notification || 'new-pingback' === notification ) {
121
- $('#post-author').show();
122
- } else {
123
- $('#post-author').hide();
124
- }
125
-
126
- $('#toggle-fields, #users, #exclude-users, #email-formatting, #disable-autop, #current-user').show();
127
- toggle_fields();
128
- toggle_users();
129
- $( '#user-password-msg' ).hide();
130
- } else if ( 'admin-password-changed' === notification || 'admin-email-changed' === notification || 'core-updated' === notification ) {
131
- $( '#toggle-fields, #users, #exclude-users, #email-formatting, #disable-autop' ).show();
132
- toggle_fields();
133
- toggle_users();
134
- $( '#user-password-msg, #current-user, #post-author' ).hide();
135
- } else if ('user-login' === notification){
136
- $('#cc, #bcc, #users, #exclude-users, #current-user, #post-author').hide();
137
- $('#toggle-fields').show();
138
- } else {
139
- $('#toggle-fields, #users, #exclude-users, #email-formatting, #disable-autop, #current-user, #post-author').show();
140
- toggle_fields();
141
- toggle_users();
142
- $('#user-password-msg').hide();
143
- }
144
- }
145
-
146
- init();
147
-
148
- /**
149
- * Show a warning message if a notification is configured for more than 200 emails.
150
- */
151
- $( '#users-select' ).on( 'change', function () {
152
- var emailCount = $( '#users-select' ).find( ':selected' ).length,
153
- $msg = $( '#users-count-msg' );
154
-
155
- if ( emailCount > 200 ) {
156
- $msg.show();
157
- } else {
158
- $msg.hide();
159
- }
160
- } );
161
-
162
- $('#notification').on('change', function() {
163
- var $this = $(this),
164
- notification = $this.val();
165
-
166
- var check_comment = notification.split('-');
167
-
168
- if ( 'reply-comment' === notification || notification.startsWith( 'commentreply-' ) ||
169
- 'new-user' === notification || 'welcome-email' === notification || 'user-password' === notification ||
170
- 'password-changed' === notification || 'email-changed' === notification || 'email-changing' === notification || 'user-role' === notification ||
171
- 'ca-export-data' === notification || 'ca-erase-data' === notification ||
172
- 'uc-export-data' === notification || 'uc-erase-data' === notification ||
173
- 'data-export' === notification || 'data-erased' === notification ||
174
- 'multisite-new-user-invited' === notification || 'multisite-new-user-created' === notification || 'multisite-new-user-welcome' === notification ||
175
- 'multisite-site-registered' === notification || 'multisite-site-welcome' === notification ||
176
- 'multisite-site-created' === notification || 'multisite-site-deleted' === notification ||
177
- 'multisite-site-admin-email-change-attempted' === notification || 'multisite-site-admin-email-changed' === notification ||
178
- 'multisite-network-admin-email-change-attempted' === notification || 'multisite-network-admin-email-changed' === notification) {
179
-
180
- $('#toggle-fields, #email, #cc, #bcc, #reply, #users, #exclude-users, #current-user, #post-author').hide();
181
- $('#user-password-msg, #disable-autop, #email-formatting').show();
182
-
183
- $( '#subject-wrapper' ).show();
184
- if ( 'multisite-new-user-created' === notification || 'multisite-site-created' === notification || 'multisite-site-deleted' === notification ||
185
- 'multisite-site-admin-email-change-attempted' === notification || 'multisite-network-admin-email-change-attempted' === notification ||
186
- 'uc-export-data' === notification || 'uc-erase-data' === notification || 'data-export' === notification ||
187
- 'ca-export-data' === notification || 'ca-erase-data' === notification || 'email-changing' === notification ) {
188
-
189
- $( '#subject-wrapper' ).hide();
190
- }
191
-
192
- if ( 'uc-export-data' === notification || 'uc-erase-data' === notification || 'data-export' === notification ||
193
- 'ca-export-data' === notification || 'ca-erase-data' === notification || 'data-erased' === notification || ( -1 !== multisiteNotifications.indexOf( notification ) ) ) {
194
-
195
- $( '#email-formatting' ).hide();
196
- }
197
- } else if ( 'new-comment' === notification || 'approve' === check_comment[0] ||
198
- notification.startsWith( 'moderate-comment-' ) || 'new-trackback' === notification || 'new-pingback' === notification ||
199
- 'admin-password' === notification || 'admin-user' === notification || 'admin-role' === notification ) {
200
-
201
- if ( 'new-comment' === notification || 'approve' === check_comment[0] || notification.startsWith( 'moderate-comment-' ) || 'new-trackback' === notification || 'new-pingback' === notification ) {
202
- $('#post-author').show();
203
- } else {
204
- $('#post-author').hide();
205
- }
206
-
207
- $('#toggle-fields, #users, #exclude-users, #email-formatting, #disable-autop, #current-user').show();
208
- $('#user-password-msg').hide();
209
- toggle_fields();
210
- toggle_users();
211
- } else if ( 'admin-password-changed' === notification || 'admin-email-changed' === notification || 'core-updated' === notification ) {
212
- $( '#toggle-fields, #users, #exclude-users, #email-formatting, #disable-autop' ).show();
213
- toggle_fields();
214
- toggle_users();
215
- $( '#user-password-msg, #current-user, #post-author' ).hide();
216
- } else if ('user-login' === notification){
217
- $('#cc, #bcc, #users, #exclude-users, #current-user, #post-author').hide();
218
- $('#toggle-fields').show();
219
- } else {
220
- $('#toggle-fields, #users, #exclude-users, #email-formatting, #disable-autop, #current-user, #post-author').show();
221
- $('#user-password-msg').hide();
222
- toggle_fields();
223
- toggle_users();
224
- }
225
- });
226
-
227
- $('#show-fields').change(function() {
228
- toggle_fields();
229
- });
230
-
231
- $( '#only-post-author' ).change(function() {
232
- toggle_users();
233
- } );
234
-
235
- // send test email
236
- $( '#test-email' ).click(function() {
237
- $( '#send-test-email' ).val( 'true' );
238
- });
239
-
240
- // Validate before saving notification
241
- $( '#publish' ).click(function() {
242
- if ( $('#users').is(':visible') ) {
243
- if ( null === $(BNFW.validation_element).val() && $('#only-post-author:checked').length <= 0 ) {
244
- $('#bnfw_error').remove();
245
- $('.wrap h1').after('<div class="error" id="bnfw_error"><p>' + BNFW.empty_user + '</p></div>');
246
- return false;
247
- }
248
- }
249
-
250
- return true;
251
- });
252
-
253
- $( '#shortcode-help' ).on( 'click', function() {
254
- var notification = $( '#notification' ).val(),
255
- notification_slug = '',
256
- splited;
257
-
258
- switch( notification ) {
259
- case 'new-comment':
260
- case 'new-trackback':
261
- case 'new-pingback':
262
- case 'reply-comment':
263
- case 'commentreply-page':
264
- case 'user-password':
265
- case 'admin-password':
266
- case 'admin-password-changed':
267
- case 'admin-email-changed':
268
- case 'password-changed':
269
- case 'email-changed':
270
- case 'email-changing':
271
- case 'new-user':
272
- case 'user-login':
273
- case 'admin-user-login':
274
- case 'welcome-email':
275
- case 'user-role':
276
- case 'admin-role':
277
- case 'admin-user':
278
- case 'new-post':
279
- case 'core-updated':
280
- case 'update-post':
281
- case 'pending-post':
282
- case 'future-post':
283
- case 'newterm-category':
284
- case 'new-media':
285
- case 'comment-attachment':
286
- case 'update-media':
287
- case 'newterm-post_tag':
288
- notification_slug = notification;
289
- break;
290
-
291
- default:
292
- splited = notification.split( '-' );
293
- switch( splited[0] ) {
294
- case 'new':
295
- notification_slug = 'new-post';
296
- break;
297
- case 'update':
298
- notification_slug = 'update-post';
299
- break;
300
- case 'pending':
301
- notification_slug = 'pending-post';
302
- break;
303
- case 'private':
304
- notification_slug = 'private-post';
305
- break;
306
- case 'future':
307
- notification_slug = 'future-post';
308
- break;
309
- case 'comment':
310
- notification_slug = 'new-comment';
311
- break;
312
- case 'approve':
313
- notification_slug = 'approve-comment';
314
- break;
315
- case 'moderate':
316
- notification_slug = 'moderate-comment';
317
- break;
318
- case 'commentreply':
319
- notification_slug = 'reply-comment';
320
- break;
321
- case 'newterm':
322
- notification_slug = 'newterm-category';
323
- break;
324
- // ideally these should be in the add-ons. But hardcoding them here for now
325
- case 'customfield':
326
- notification_slug = 'customfield-post';
327
- break;
328
- case 'updatereminder':
329
- notification_slug = 'updatereminder-post';
330
- break;
331
-
332
- default:
333
- notification_slug = notification;
334
- break;
335
- }
336
-
337
- break;
338
- }
339
-
340
- $(this).attr( 'href', 'https://betternotificationsforwp.com/documentation/notifications/shortcodes/?notification=' + notification_slug + '&utm_source=WP%20Admin%20Notification%20Editor%20-%20"Shortcode%20Help"&utm_medium=referral' );
341
- });
342
-
343
- /**
344
- * Insert Default Message for notification.
345
- */
346
- $( '#insert-default-msg' ).on( 'click', function() {
347
- var notification = $( '#notification' ).val(),
348
- subject = '',
349
- body = '';
350
-
351
- switch ( notification ) {
352
- case 'new-comment':
353
- case 'moderate-comment':
354
- case 'new-trackback':
355
- case 'new-pingback':
356
- case 'reply-comment':
357
- subject = '[[global_site_title]] Comment: "[post_title]"';
358
- body = 'New comment on your post "[post_title]"<br>' +
359
- 'Author: [comment_author] (IP address: [comment_author_IP]) <br>' +
360
- 'Email: [comment_author_email] <br>' +
361
- 'URL: [comment_author_url] <br>' +
362
- 'Comment: <br> ' +
363
- '[comment_content] <br>' +
364
- '<br>' +
365
- 'You can see all comments on this post here: <br>' +
366
- '[permalink]#comments';
367
-
368
- break;
369
-
370
- case 'admin-user':
371
- subject = '[[global_site_title]] New User Registration';
372
- body = 'New user registration on your site [global_site_title]: <br>' +
373
- 'Username: [user_login] <br>' +
374
- 'E-mail: [user_email]';
375
-
376
- break;
377
-
378
- case 'admin-password-changed':
379
- subject = '[[global_site_title]] Password Changed';
380
- body = 'Password changed for user: [user_login] <br>';
381
-
382
- break;
383
-
384
- case 'user-password':
385
- subject = '[[global_site_title]] Password Reset';
386
- body = 'Someone has requested a password reset for the following account: <br>' +
387
- 'Site Name: [global_site_title] <br>' +
388
- 'Username: [email_user_login] <br>' +
389
- 'If this was a mistake, just ignore this email and nothing will happen. <br>' +
390
- 'To reset your password, visit the following address: [password_reset_link]';
391
-
392
- break;
393
-
394
- case 'password-changed':
395
- subject = '[[global_site_title]] Notice of Password Change';
396
- body = 'Hi [email_user_login], <br>' +
397
- '<br>' +
398
- 'This notice confirms that your password was changed on [global_site_title].' +
399
- '<br><br>' +
400
- 'If you did not change your password, please contact the Site Administrator at [admin_email] <br>' +
401
- '<br>' +
402
- 'This email has been sent to [global_user_email]' +
403
- '<br>' +
404
- 'Regards, <br>' +
405
- 'All at [global_site_title] <br>' +
406
- '[global_site_url]';
407
- break;
408
-
409
- case 'email-changing':
410
- subject = '[[global_site_title]] New Email Address';
411
- body = 'Hi [user_nicename], <br>' +
412
- '<br>' +
413
- 'You recently requested to have the email address on your account changed.' +
414
- '<br>' +
415
- 'If this is correct, please click on the following link to change it:' +
416
- '<br>' +
417
- '[global_site_url]/wp-admin/profile.php' +
418
- '<br>' +
419
- 'You can safely ignore and delete this email if you do not want to take this action.' +
420
- '<br>' +
421
- 'This email has been sent to [global_user_email]' +
422
- '<br>' +
423
- 'Regards, <br>' +
424
- 'All at [global_site_title] <br>' +
425
- '[global_site_url]';
426
- break;
427
-
428
- case 'email-changed':
429
- subject = '[[global_site_title]] Notice of Email Change';
430
- body = 'Hi [user_nicename], <br>' +
431
- '<br>' +
432
- 'This notice confirms that your email address on [global_site_title] was changed to [user_email].' +
433
- '<br>' +
434
- 'If you did not change your email, please contact the Site Administrator at [admin_email] <br>' +
435
- '<br>' +
436
- 'This email has been sent to [global_user_email]' +
437
- '<br>' +
438
- 'Regards, <br>' +
439
- 'All at [global_site_title] <br>' +
440
- '[global_site_url]';
441
- break;
442
-
443
- case 'new-user':
444
- subject = '[[global_site_title]] Your username and password info';
445
- body = 'Username: [user_login] <br>' +
446
- 'To set your password, visit the following address: [password_url]';
447
-
448
- break;
449
-
450
- case 'multisite-new-user-invited':
451
- subject = '[[network_name] Activate [user_login]';
452
- body = 'To activate your user, please click the following link:' +
453
- '<br>' +
454
- '[activation_link]' +
455
- '<br>' +
456
- 'After you activate, you will receive *another email* with your login.';
457
-
458
- break;
459
-
460
- case 'ca-export-data':
461
- subject = '[[global_site_title]] Confirm Action: Export Personal Data';
462
- body = 'Howdy,' +
463
- '<br>' +
464
- '<br>' +
465
- 'A request has been made to perform the following action on your account:' +
466
- '<br>' +
467
- '<br>' +
468
- '[data_request_type]' +
469
- '<br>' +
470
- '<br>' +
471
- 'To confirm this, please click on the following link:' +
472
- '<br>' +
473
- '<br>' +
474
- '[request_confirmation_link]' +
475
- '<br>' +
476
- '<br>' +
477
- 'You can safely ignore and delete this email if you do not want to' +
478
- '<br>' +
479
- 'take this action.' +
480
- '<br>' +
481
- '<br>' +
482
- 'This email has been sent to [global_user_email].' +
483
- '<br>' +
484
- '<br>' +
485
- 'Regards,' +
486
- '<br>' +
487
- 'All at [global_site_title]' +
488
- '<br>' +
489
- '[global_site_url]';
490
-
491
- break;
492
-
493
- case 'ca-erase-data':
494
- subject = '[[global_site_title]] Confirm Action: Erase Personal Data';
495
- body = 'Howdy,' +
496
- '<br>' +
497
- '<br>' +
498
- 'A request has been made to perform the following action on your account:' +
499
- '<br>' +
500
- '<br>' +
501
- '[data_request_type]' +
502
- '<br>' +
503
- '<br>' +
504
- 'To confirm this, please click on the following link:' +
505
- '<br>' +
506
- '<br>' +
507
- '[request_confirmation_link]' +
508
- '<br>' +
509
- '<br>' +
510
- 'You can safely ignore and delete this email if you do not want to' +
511
- '<br>' +
512
- 'take this action.' +
513
- '<br>' +
514
- '<br>' +
515
- 'This email has been sent to [global_user_email].' +
516
- '<br>' +
517
- '<br>' +
518
- 'Regards,' +
519
- '<br>' +
520
- 'All at [global_site_title]' +
521
- '<br>' +
522
- '[global_site_url]';
523
-
524
- break;
525
-
526
- case 'uc-export-data':
527
- subject = 'Action Confirmed';
528
-
529
- body = 'Howdy,' +
530
- '<br>' +
531
- '<br>' +
532
- 'A user data privacy request has been confirmed on [global_site_title]:' +
533
- '<br>' +
534
- '<br>' +
535
- 'User: [email_user_email]' +
536
- '<br>' +
537
- 'Request: [data_request_type]' +
538
- '<br>' +
539
- '<br>' +
540
- 'You can view and manage these data privacy requests here:' +
541
- '<br>' +
542
- '<br>' +
543
- '[data_privacy_requests_url]' +
544
- '<br>' +
545
- '<br>' +
546
- 'Regards,' +
547
- '<br>' +
548
- 'All at [global_site_title]' +
549
- '<br>' +
550
- '[global_site_url]';
551
- break;
552
-
553
- case 'uc-erase-data':
554
- subject = 'Action Confirmed';
555
-
556
- body = 'Howdy,' +
557
- '<br>' +
558
- '<br>' +
559
- 'A user data privacy request has been confirmed on [global_site_title]:' +
560
- '<br>' +
561
- '<br>' +
562
- 'User: [email_user_email]' +
563
- '<br>' +
564
- 'Request: [data_request_type]' +
565
- '<br>' +
566
- '<br>' +
567
- 'You can view and manage these data privacy requests here:' +
568
- '<br>' +
569
- '<br>' +
570
- '[data_privacy_requests_url]' +
571
- '<br>' +
572
- '<br>' +
573
- 'Regards,' +
574
- '<br>' +
575
- 'All at [global_site_title]' +
576
- '<br>' +
577
- '[global_site_title]';
578
- break;
579
-
580
- case 'data-export':
581
- subject = 'Personal Data Export';
582
-
583
- body = 'Howdy,' +
584
- '<br>' +
585
- '<br>' +
586
- 'Your request for an export of personal data has been completed. You may' +
587
- '<br>' +
588
- 'download your personal data by clicking on the link below. For privacy' +
589
- '<br>' +
590
- 'and security, we will automatically delete the file on [data_privacy_download_expiry],' +
591
- '<br>' +
592
- 'so please download it before then.' +
593
- '<br>' +
594
- '<br>' +
595
- '[data_privacy_download_url]' +
596
- '<br>' +
597
- '<br>' +
598
- 'This email has been sent to [global_user_email].' +
599
- '<br>' +
600
- '<br>' +
601
- 'Regards,' +
602
- '<br>' +
603
- 'All at [global_site_title]' +
604
- '<br>' +
605
- '[global_site_url]';
606
- break;
607
-
608
- case 'data-erased':
609
- subject = '[sitename] Erasure Request Fulfilled';
610
-
611
- body = 'Howdy,' +
612
- '<br>' +
613
- '<br>' +
614
- 'Your request to erase your personal data on [sitename] has been completed.' +
615
- '<br>' +
616
- 'If you have any follow-up questions or concerns, please contact the site administrator.' +
617
- '<br>' +
618
- '<br>' +
619
- 'Regards,' +
620
- '<br>' +
621
- 'All at [global_site_title]' +
622
- '<br>' +
623
- '[global_site_url]';
624
- break;
625
- default:
626
- alert( "This is a new notification that is not available in WordPress by default and has been added by Better Notifications for WP. As such, it doesn't have any default content." );
627
- break;
628
- }
629
-
630
- if ( subject !== '' ) {
631
- $( '#subject' ).val( subject );
632
- }
633
-
634
- if ( body !== '' ) {
635
- if ( tinyMCE && tinyMCE.editors && tinyMCE.editors['notification_message'] ) {
636
- tinyMCE.editors['notification_message'].selection.setContent( body );
637
- }
638
- }
639
-
640
- return false;
641
- } );
642
- });
 
1
+ jQuery(document).ready(function($) {
2
+ var multisiteNotifications = [
3
+ 'multisite-site-created',
4
+ 'multisite-new-user-created',
5
+ 'multisite-network-admin-email-change-attempted',
6
+ 'multisite-network-admin-email-changed',
7
+ 'multisite-site-welcome',
8
+ 'multisite-site-deleted',
9
+ 'multisite-site-admin-email-change-attempted',
10
+ 'multisite-site-admin-email-changed',
11
+ 'multisite-site-registered',
12
+ 'multisite-new-user-welcome',
13
+ 'multisite-new-user-invited'
14
+ ];
15
+
16
+ function toggle_fields() {
17
+ var show_fields = $('#show-fields').is(":checked");
18
+ var notification = $( "#notification" ).val();
19
+ if('user-login' === notification){
20
+ if ( show_fields ) {
21
+ $('#email, #reply').show();
22
+ } else {
23
+ $('#email, #reply').hide();
24
+ }
25
+ }else{
26
+ if ( show_fields ) {
27
+ $('#email, #cc, #bcc, #reply').show();
28
+ } else {
29
+ $('#email, #cc, #bcc, #reply').hide();
30
+ }
31
+ }
32
+ $( '#subject-wrapper' ).show();
33
+ }
34
+
35
+ function toggle_users() {
36
+ if ( $( '#only-post-author' ).is( ':checked' ) ) {
37
+ $( '#current-user' ).hide();
38
+ } else {
39
+ $( '#current-user' ).show();
40
+ }
41
+
42
+ var notification = $( '#notification' ).val();
43
+ var check_comment = notification.split('-');
44
+ if ( 'new-comment' === notification || 'approve' === check_comment[0] || 'moderate-comment' === notification ) {
45
+ $( '#current-user' ).show();
46
+ }
47
+ }
48
+
49
+ function init() {
50
+ var notification = $('#notification').val();
51
+
52
+ $("#notification, .bnfw-select2").select2();
53
+
54
+ $(".user-select2").select2({
55
+ tags: BNFW.enableTags,
56
+ tokenSeparators: BNFW.enabletokenSeparators
57
+ } );
58
+
59
+ $(".user-ajax-select2").select2( {
60
+ ajax: {
61
+ url: ajaxurl,
62
+ dataType: 'json',
63
+ data: function( params ) {
64
+ return {
65
+ action: 'bnfw_search_users',
66
+ query: params.term,
67
+ bnfw_security: BNFW.bnfw_users_search_ajax_nonce,
68
+ page: params.page
69
+ };
70
+ },
71
+ processResults: function( data, page ) {
72
+ return {
73
+ results: data
74
+ };
75
+ }
76
+ },
77
+ minimumInputLength: 1,
78
+ tags: BNFW.enableTags
79
+ } );
80
+
81
+ if ( ! $( '#notification' ).length ) {
82
+ return;
83
+ }
84
+
85
+ toggle_fields();
86
+
87
+ var check_comment = notification.split('-');
88
+
89
+ if ( 'reply-comment' === notification || notification.startsWith( 'commentreply-' ) ||
90
+ 'new-user' === notification || 'welcome-email' === notification || 'user-password' === notification ||
91
+ 'password-changed' === notification || 'email-changed' === notification || 'email-changing' === notification || 'user-role' === notification ||
92
+ 'ca-export-data' === notification || 'ca-erase-data' === notification ||
93
+ 'uc-export-data' === notification || 'uc-erase-data' === notification ||
94
+ 'data-export' === notification || 'data-erased' === notification ||
95
+ 'multisite-new-user-invited' === notification || 'multisite-new-user-created' === notification || 'multisite-new-user-welcome' === notification ||
96
+ 'multisite-site-registered' === notification || 'multisite-site-welcome' === notification ||
97
+ 'multisite-site-created' === notification || 'multisite-site-deleted' === notification ||
98
+ 'multisite-site-admin-email-change-attempted' === notification || 'multisite-site-admin-email-changed' === notification ||
99
+ 'multisite-network-admin-email-change-attempted' === notification || 'multisite-network-admin-email-changed' === notification) {
100
+
101
+ $('#toggle-fields, #email, #cc, #bcc, #reply, #users, #exclude-users, #current-user, #post-author').hide();
102
+ $('#user-password-msg, #disable-autop, #email-formatting').show();
103
+
104
+ $( '#subject-wrapper' ).show();
105
+ if ( 'multisite-new-user-created' === notification || 'multisite-site-created' === notification || 'multisite-site-deleted' === notification ||
106
+ 'multisite-site-admin-email-change-attempted' === notification || 'multisite-network-admin-email-change-attempted' === notification ||
107
+ 'uc-export-data' === notification || 'uc-erase-data' === notification || 'data-export' === notification ||
108
+ 'ca-export-data' === notification || 'ca-erase-data' === notification || 'email-changing' === notification ) {
109
+
110
+ $( '#subject-wrapper' ).hide();
111
+ }
112
+
113
+ if ( 'uc-export-data' === notification || 'uc-erase-data' === notification || 'data-export' === notification ||
114
+ 'ca-export-data' === notification || 'ca-erase-data' === notification || 'data-erased' === notification || ( -1 !== multisiteNotifications.indexOf( notification ) ) ) {
115
+
116
+ $( '#email-formatting' ).hide();
117
+ }
118
+ } else if ( 'new-comment' === notification || 'approve' === check_comment[0] || notification.startsWith( 'moderate-comment-' ) || 'new-trackback' === notification || 'new-pingback' === notification ||
119
+ 'admin-password' === notification || 'admin-user' === notification || 'admin-role' === notification ) {
120
+
121
+ if ( 'new-comment' === notification || 'approve' === check_comment[0] || notification.startsWith( 'moderate-comment-' ) || 'new-trackback' === notification || 'new-pingback' === notification ) {
122
+ $('#post-author').show();
123
+ } else {
124
+ $('#post-author').hide();
125
+ }
126
+
127
+ $('#toggle-fields, #users, #exclude-users, #email-formatting, #disable-autop, #current-user').show();
128
+ toggle_fields();
129
+ toggle_users();
130
+ $( '#user-password-msg' ).hide();
131
+ } else if ( 'admin-password-changed' === notification || 'admin-email-changed' === notification || 'core-updated' === notification ) {
132
+ $( '#toggle-fields, #users, #exclude-users, #email-formatting, #disable-autop' ).show();
133
+ toggle_fields();
134
+ toggle_users();
135
+ $( '#user-password-msg, #current-user, #post-author' ).hide();
136
+ } else if ('user-login' === notification){
137
+ $('#cc, #bcc, #users, #exclude-users, #current-user, #post-author').hide();
138
+ $('#toggle-fields').show();
139
+ } else {
140
+ $('#toggle-fields, #users, #exclude-users, #email-formatting, #disable-autop, #current-user, #post-author').show();
141
+ toggle_fields();
142
+ toggle_users();
143
+ $('#user-password-msg').hide();
144
+ }
145
+ }
146
+
147
+ init();
148
+
149
+ /**
150
+ * Show a warning message if a notification is configured for more than 200 emails.
151
+ */
152
+ $( '#users-select' ).on( 'change', function () {
153
+ var emailCount = $( '#users-select' ).find( ':selected' ).length,
154
+ $msg = $( '#users-count-msg' );
155
+
156
+ if ( emailCount > 200 ) {
157
+ $msg.show();
158
+ } else {
159
+ $msg.hide();
160
+ }
161
+ } );
162
+
163
+ $('#notification').on('change', function() {
164
+ var $this = $(this),
165
+ notification = $this.val();
166
+
167
+ var check_comment = notification.split('-');
168
+
169
+ if ( 'reply-comment' === notification || notification.startsWith( 'commentreply-' ) ||
170
+ 'new-user' === notification || 'welcome-email' === notification || 'user-password' === notification ||
171
+ 'password-changed' === notification || 'email-changed' === notification || 'email-changing' === notification || 'user-role' === notification ||
172
+ 'ca-export-data' === notification || 'ca-erase-data' === notification ||
173
+ 'uc-export-data' === notification || 'uc-erase-data' === notification ||
174
+ 'data-export' === notification || 'data-erased' === notification ||
175
+ 'multisite-new-user-invited' === notification || 'multisite-new-user-created' === notification || 'multisite-new-user-welcome' === notification ||
176
+ 'multisite-site-registered' === notification || 'multisite-site-welcome' === notification ||
177
+ 'multisite-site-created' === notification || 'multisite-site-deleted' === notification ||
178
+ 'multisite-site-admin-email-change-attempted' === notification || 'multisite-site-admin-email-changed' === notification ||
179
+ 'multisite-network-admin-email-change-attempted' === notification || 'multisite-network-admin-email-changed' === notification) {
180
+
181
+ $('#toggle-fields, #email, #cc, #bcc, #reply, #users, #exclude-users, #current-user, #post-author').hide();
182
+ $('#user-password-msg, #disable-autop, #email-formatting').show();
183
+
184
+ $( '#subject-wrapper' ).show();
185
+ if ( 'multisite-new-user-created' === notification || 'multisite-site-created' === notification || 'multisite-site-deleted' === notification ||
186
+ 'multisite-site-admin-email-change-attempted' === notification || 'multisite-network-admin-email-change-attempted' === notification ||
187
+ 'uc-export-data' === notification || 'uc-erase-data' === notification || 'data-export' === notification ||
188
+ 'ca-export-data' === notification || 'ca-erase-data' === notification || 'email-changing' === notification ) {
189
+
190
+ $( '#subject-wrapper' ).hide();
191
+ }
192
+
193
+ if ( 'uc-export-data' === notification || 'uc-erase-data' === notification || 'data-export' === notification ||
194
+ 'ca-export-data' === notification || 'ca-erase-data' === notification || 'data-erased' === notification || ( -1 !== multisiteNotifications.indexOf( notification ) ) ) {
195
+
196
+ $( '#email-formatting' ).hide();
197
+ }
198
+ } else if ( 'new-comment' === notification || 'approve' === check_comment[0] ||
199
+ notification.startsWith( 'moderate-comment-' ) || 'new-trackback' === notification || 'new-pingback' === notification ||
200
+ 'admin-password' === notification || 'admin-user' === notification || 'admin-role' === notification ) {
201
+
202
+ if ( 'new-comment' === notification || 'approve' === check_comment[0] || notification.startsWith( 'moderate-comment-' ) || 'new-trackback' === notification || 'new-pingback' === notification ) {
203
+ $('#post-author').show();
204
+ } else {
205
+ $('#post-author').hide();
206
+ }
207
+
208
+ $('#toggle-fields, #users, #exclude-users, #email-formatting, #disable-autop, #current-user').show();
209
+ $('#user-password-msg').hide();
210
+ toggle_fields();
211
+ toggle_users();
212
+ } else if ( 'admin-password-changed' === notification || 'admin-email-changed' === notification || 'core-updated' === notification ) {
213
+ $( '#toggle-fields, #users, #exclude-users, #email-formatting, #disable-autop' ).show();
214
+ toggle_fields();
215
+ toggle_users();
216
+ $( '#user-password-msg, #current-user, #post-author' ).hide();
217
+ } else if ('user-login' === notification){
218
+ $('#cc, #bcc, #users, #exclude-users, #current-user, #post-author').hide();
219
+ $('#toggle-fields').show();
220
+ } else {
221
+ $('#toggle-fields, #users, #exclude-users, #email-formatting, #disable-autop, #current-user, #post-author').show();
222
+ $('#user-password-msg').hide();
223
+ toggle_fields();
224
+ toggle_users();
225
+ }
226
+ });
227
+
228
+ $('#show-fields').change(function() {
229
+ toggle_fields();
230
+ });
231
+
232
+ $( '#only-post-author' ).change(function() {
233
+ toggle_users();
234
+ } );
235
+
236
+ // send test email
237
+ $( '#test-email' ).click(function() {
238
+ $( '#send-test-email' ).val( 'true' );
239
+ });
240
+
241
+ // Validate before saving notification
242
+ $( '#publish' ).click(function() {
243
+ if ( $('#users').is(':visible') ) {
244
+ if ( null === $(BNFW.validation_element).val() && $('#only-post-author:checked').length <= 0 ) {
245
+ $('#bnfw_error').remove();
246
+ $('.wrap h1').after('<div class="error" id="bnfw_error"><p>' + BNFW.empty_user + '</p></div>');
247
+ return false;
248
+ }
249
+ }
250
+
251
+ return true;
252
+ });
253
+
254
+ $( '#shortcode-help' ).on( 'click', function() {
255
+ var notification = $( '#notification' ).val(),
256
+ notification_slug = '',
257
+ splited;
258
+
259
+ switch( notification ) {
260
+ case 'new-comment':
261
+ case 'new-trackback':
262
+ case 'new-pingback':
263
+ case 'reply-comment':
264
+ case 'commentreply-page':
265
+ case 'user-password':
266
+ case 'admin-password':
267
+ case 'admin-password-changed':
268
+ case 'admin-email-changed':
269
+ case 'password-changed':
270
+ case 'email-changed':
271
+ case 'email-changing':
272
+ case 'new-user':
273
+ case 'user-login':
274
+ case 'admin-user-login':
275
+ case 'welcome-email':
276
+ case 'user-role':
277
+ case 'admin-role':
278
+ case 'admin-user':
279
+ case 'new-post':
280
+ case 'core-updated':
281
+ case 'update-post':
282
+ case 'pending-post':
283
+ case 'future-post':
284
+ case 'newterm-category':
285
+ case 'new-media':
286
+ case 'comment-attachment':
287
+ case 'update-media':
288
+ case 'newterm-post_tag':
289
+ notification_slug = notification;
290
+ break;
291
+
292
+ default:
293
+ splited = notification.split( '-' );
294
+ switch( splited[0] ) {
295
+ case 'new':
296
+ notification_slug = 'new-post';
297
+ break;
298
+ case 'update':
299
+ notification_slug = 'update-post';
300
+ break;
301
+ case 'pending':
302
+ notification_slug = 'pending-post';
303
+ break;
304
+ case 'private':
305
+ notification_slug = 'private-post';
306
+ break;
307
+ case 'future':
308
+ notification_slug = 'future-post';
309
+ break;
310
+ case 'comment':
311
+ notification_slug = 'new-comment';
312
+ break;
313
+ case 'approve':
314
+ notification_slug = 'approve-comment';
315
+ break;
316
+ case 'moderate':
317
+ notification_slug = 'moderate-comment';
318
+ break;
319
+ case 'commentreply':
320
+ notification_slug = 'reply-comment';
321
+ break;
322
+ case 'newterm':
323
+ notification_slug = 'newterm-category';
324
+ break;
325
+ // ideally these should be in the add-ons. But hardcoding them here for now
326
+ case 'customfield':
327
+ notification_slug = 'customfield-post';
328
+ break;
329
+ case 'updatereminder':
330
+ notification_slug = 'updatereminder-post';
331
+ break;
332
+
333
+ default:
334
+ notification_slug = notification;
335
+ break;
336
+ }
337
+
338
+ break;
339
+ }
340
+
341
+ $(this).attr( 'href', 'https://betternotificationsforwp.com/documentation/notifications/shortcodes/?notification=' + notification_slug + '&utm_source=WP%20Admin%20Notification%20Editor%20-%20"Shortcode%20Help"&utm_medium=referral' );
342
+ });
343
+
344
+ /**
345
+ * Insert Default Message for notification.
346
+ */
347
+ $( '#insert-default-msg' ).on( 'click', function() {
348
+ var notification = $( '#notification' ).val(),
349
+ subject = '',
350
+ body = '';
351
+
352
+ switch ( notification ) {
353
+ case 'new-comment':
354
+ case 'moderate-comment':
355
+ case 'new-trackback':
356
+ case 'new-pingback':
357
+ case 'reply-comment':
358
+ subject = '[[global_site_title]] Comment: "[post_title]"';
359
+ body = 'New comment on your post "[post_title]"<br>' +
360
+ 'Author: [comment_author] (IP address: [comment_author_IP]) <br>' +
361
+ 'Email: [comment_author_email] <br>' +
362
+ 'URL: [comment_author_url] <br>' +
363
+ 'Comment: <br> ' +
364
+ '[comment_content] <br>' +
365
+ '<br>' +
366
+ 'You can see all comments on this post here: <br>' +
367
+ '[permalink]#comments';
368
+
369
+ break;
370
+
371
+ case 'admin-user':
372
+ subject = '[[global_site_title]] New User Registration';
373
+ body = 'New user registration on your site [global_site_title]: <br>' +
374
+ 'Username: [user_login] <br>' +
375
+ 'E-mail: [user_email]';
376
+
377
+ break;
378
+
379
+ case 'admin-password-changed':
380
+ subject = '[[global_site_title]] Password Changed';
381
+ body = 'Password changed for user: [user_login] <br>';
382
+
383
+ break;
384
+
385
+ case 'user-password':
386
+ subject = '[[global_site_title]] Password Reset';
387
+ body = 'Someone has requested a password reset for the following account: <br>' +
388
+ 'Site Name: [global_site_title] <br>' +
389
+ 'Username: [email_user_login] <br>' +
390
+ 'If this was a mistake, just ignore this email and nothing will happen. <br>' +
391
+ 'To reset your password, visit the following address: [password_reset_link]';
392
+
393
+ break;
394
+
395
+ case 'password-changed':
396
+ subject = '[[global_site_title]] Notice of Password Change';
397
+ body = 'Hi [email_user_login], <br>' +
398
+ '<br>' +
399
+ 'This notice confirms that your password was changed on [global_site_title].' +
400
+ '<br><br>' +
401
+ 'If you did not change your password, please contact the Site Administrator at [admin_email] <br>' +
402
+ '<br>' +
403
+ 'This email has been sent to [global_user_email]' +
404
+ '<br>' +
405
+ 'Regards, <br>' +
406
+ 'All at [global_site_title] <br>' +
407
+ '[global_site_url]';
408
+ break;
409
+
410
+ case 'email-changing':
411
+ subject = '[[global_site_title]] New Email Address';
412
+ body = 'Hi [user_nicename], <br>' +
413
+ '<br>' +
414
+ 'You recently requested to have the email address on your account changed.' +
415
+ '<br>' +
416
+ 'If this is correct, please click on the following link to change it:' +
417
+ '<br>' +
418
+ '[global_site_url]/wp-admin/profile.php' +
419
+ '<br>' +
420
+ 'You can safely ignore and delete this email if you do not want to take this action.' +
421
+ '<br>' +
422
+ 'This email has been sent to [global_user_email]' +
423
+ '<br>' +
424
+ 'Regards, <br>' +
425
+ 'All at [global_site_title] <br>' +
426
+ '[global_site_url]';
427
+ break;
428
+
429
+ case 'email-changed':
430
+ subject = '[[global_site_title]] Notice of Email Change';
431
+ body = 'Hi [user_nicename], <br>' +
432
+ '<br>' +
433
+ 'This notice confirms that your email address on [global_site_title] was changed to [user_email].' +
434
+ '<br>' +
435
+ 'If you did not change your email, please contact the Site Administrator at [admin_email] <br>' +
436
+ '<br>' +
437
+ 'This email has been sent to [global_user_email]' +
438
+ '<br>' +
439
+ 'Regards, <br>' +
440
+ 'All at [global_site_title] <br>' +
441
+ '[global_site_url]';
442
+ break;
443
+
444
+ case 'new-user':
445
+ subject = '[[global_site_title]] Your username and password info';
446
+ body = 'Username: [user_login] <br>' +
447
+ 'To set your password, visit the following address: [password_url]';
448
+
449
+ break;
450
+
451
+ case 'multisite-new-user-invited':
452
+ subject = '[[network_name] Activate [user_login]';
453
+ body = 'To activate your user, please click the following link:' +
454
+ '<br>' +
455
+ '[activation_link]' +
456
+ '<br>' +
457
+ 'After you activate, you will receive *another email* with your login.';
458
+
459
+ break;
460
+
461
+ case 'ca-export-data':
462
+ subject = '[[global_site_title]] Confirm Action: Export Personal Data';
463
+ body = 'Howdy,' +
464
+ '<br>' +
465
+ '<br>' +
466
+ 'A request has been made to perform the following action on your account:' +
467
+ '<br>' +
468
+ '<br>' +
469
+ '[data_request_type]' +
470
+ '<br>' +
471
+ '<br>' +
472
+ 'To confirm this, please click on the following link:' +
473
+ '<br>' +
474
+ '<br>' +
475
+ '[request_confirmation_link]' +
476
+ '<br>' +
477
+ '<br>' +
478
+ 'You can safely ignore and delete this email if you do not want to' +
479
+ '<br>' +
480
+ 'take this action.' +
481
+ '<br>' +
482
+ '<br>' +
483
+ 'This email has been sent to [global_user_email].' +
484
+ '<br>' +
485
+ '<br>' +
486
+ 'Regards,' +
487
+ '<br>' +
488
+ 'All at [global_site_title]' +
489
+ '<br>' +
490
+ '[global_site_url]';
491
+
492
+ break;
493
+
494
+ case 'ca-erase-data':
495
+ subject = '[[global_site_title]] Confirm Action: Erase Personal Data';
496
+ body = 'Howdy,' +
497
+ '<br>' +
498
+ '<br>' +
499
+ 'A request has been made to perform the following action on your account:' +
500
+ '<br>' +
501
+ '<br>' +
502
+ '[data_request_type]' +
503
+ '<br>' +
504
+ '<br>' +
505
+ 'To confirm this, please click on the following link:' +
506
+ '<br>' +
507
+ '<br>' +
508
+ '[request_confirmation_link]' +
509
+ '<br>' +
510
+ '<br>' +
511
+ 'You can safely ignore and delete this email if you do not want to' +
512
+ '<br>' +
513
+ 'take this action.' +
514
+ '<br>' +
515
+ '<br>' +
516
+ 'This email has been sent to [global_user_email].' +
517
+ '<br>' +
518
+ '<br>' +
519
+ 'Regards,' +
520
+ '<br>' +
521
+ 'All at [global_site_title]' +
522
+ '<br>' +
523
+ '[global_site_url]';
524
+
525
+ break;
526
+
527
+ case 'uc-export-data':
528
+ subject = 'Action Confirmed';
529
+
530
+ body = 'Howdy,' +
531
+ '<br>' +
532
+ '<br>' +
533
+ 'A user data privacy request has been confirmed on [global_site_title]:' +
534
+ '<br>' +
535
+ '<br>' +
536
+ 'User: [email_user_email]' +
537
+ '<br>' +
538
+ 'Request: [data_request_type]' +
539
+ '<br>' +
540
+ '<br>' +
541
+ 'You can view and manage these data privacy requests here:' +
542
+ '<br>' +
543
+ '<br>' +
544
+ '[data_privacy_requests_url]' +
545
+ '<br>' +
546
+ '<br>' +
547
+ 'Regards,' +
548
+ '<br>' +
549
+ 'All at [global_site_title]' +
550
+ '<br>' +
551
+ '[global_site_url]';
552
+ break;
553
+
554
+ case 'uc-erase-data':
555
+ subject = 'Action Confirmed';
556
+
557
+ body = 'Howdy,' +
558
+ '<br>' +
559
+ '<br>' +
560
+ 'A user data privacy request has been confirmed on [global_site_title]:' +
561
+ '<br>' +
562
+ '<br>' +
563
+ 'User: [email_user_email]' +
564
+ '<br>' +
565
+ 'Request: [data_request_type]' +
566
+ '<br>' +
567
+ '<br>' +
568
+ 'You can view and manage these data privacy requests here:' +
569
+ '<br>' +
570
+ '<br>' +
571
+ '[data_privacy_requests_url]' +
572
+ '<br>' +
573
+ '<br>' +
574
+ 'Regards,' +
575
+ '<br>' +
576
+ 'All at [global_site_title]' +
577
+ '<br>' +
578
+ '[global_site_title]';
579
+ break;
580
+
581
+ case 'data-export':
582
+ subject = 'Personal Data Export';
583
+
584
+ body = 'Howdy,' +
585
+ '<br>' +
586
+ '<br>' +
587
+ 'Your request for an export of personal data has been completed. You may' +
588
+ '<br>' +
589
+ 'download your personal data by clicking on the link below. For privacy' +
590
+ '<br>' +
591
+ 'and security, we will automatically delete the file on [data_privacy_download_expiry],' +
592
+ '<br>' +
593
+ 'so please download it before then.' +
594
+ '<br>' +
595
+ '<br>' +
596
+ '[data_privacy_download_url]' +
597
+ '<br>' +
598
+ '<br>' +
599
+ 'This email has been sent to [global_user_email].' +
600
+ '<br>' +
601
+ '<br>' +
602
+ 'Regards,' +
603
+ '<br>' +
604
+ 'All at [global_site_title]' +
605
+ '<br>' +
606
+ '[global_site_url]';
607
+ break;
608
+
609
+ case 'data-erased':
610
+ subject = '[sitename] Erasure Request Fulfilled';
611
+
612
+ body = 'Howdy,' +
613
+ '<br>' +
614
+ '<br>' +
615
+ 'Your request to erase your personal data on [sitename] has been completed.' +
616
+ '<br>' +
617
+ 'If you have any follow-up questions or concerns, please contact the site administrator.' +
618
+ '<br>' +
619
+ '<br>' +
620
+ 'Regards,' +
621
+ '<br>' +
622
+ 'All at [global_site_title]' +
623
+ '<br>' +
624
+ '[global_site_url]';
625
+ break;
626
+ default:
627
+ alert( "This is a new notification that is not available in WordPress by default and has been added by Better Notifications for WP. As such, it doesn't have any default content." );
628
+ break;
629
+ }
630
+
631
+ if ( subject !== '' ) {
632
+ $( '#subject' ).val( subject );
633
+ }
634
+
635
+ if ( body !== '' ) {
636
+ if ( tinyMCE && tinyMCE.editors && tinyMCE.editors['notification_message'] ) {
637
+ tinyMCE.editors['notification_message'].selection.setContent( body );
638
+ }
639
+ }
640
+
641
+ return false;
642
+ } );
643
+ });
bnfw.php CHANGED
@@ -1,1519 +1,1519 @@
1
- <?php
2
-
3
- /**
4
- * Plugin Name: Better Notifications for WP
5
- * Plugin URI: https://wordpress.org/plugins/bnfw/
6
- * Description: Supercharge your WordPress notifications using a WYSIWYG editor and shortcodes. Default and new notifications available. Add more power with Add-ons.
7
- * Version: 1.8.6
8
- * Requires at least: 4.8
9
- * Requires PHP: 5.6
10
- * Author: Made with Fuel
11
- * Author URI: https://madewithfuel.com/
12
- * License: GPLv2 or later
13
- * License URI: http://www.gnu.org/licenses/gpl-2.0.html
14
- * Text Domain: bnfw
15
- * Domain Path: /languages
16
- */
17
-
18
- /**
19
- * Copyright © 2021 Made with Fuel Ltd. (hello@betternotificationsforwp.com)
20
- * This program is free software; you can redistribute it and/or modify
21
- * it under the terms of the GNU General Public License, version 2, as
22
- * published by the Free Software Foundation.
23
- * This program is distributed in the hope that it will be useful,
24
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
25
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26
- * GNU General Public License for more details.
27
- * You should have received a copy of the GNU General Public License
28
- * along with this program; if not, write to the Free Software
29
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30
- */
31
- class BNFW {
32
-
33
- /**
34
- * Constructor.
35
- *
36
- * @since 1.0
37
- */
38
- function __construct() {
39
- $this->load_textdomain();
40
- $this->includes();
41
- $this->hooks();
42
-
43
- /**
44
- * BNFW Notification.
45
- *
46
- * @var \BNFW_Notification
47
- */
48
- $this->notifier = new BNFW_Notification;
49
-
50
- /**
51
- * BNFW Engine.
52
- *
53
- * @var \BNFW_Engine
54
- */
55
- $this->engine = new BNFW_Engine;
56
- }
57
-
58
- /**
59
- * Factory method to return the instance of the class.
60
- *
61
- * Makes sure that only one instance is created.
62
- *
63
- * @return \BNFW Instance of the class.
64
- */
65
- public static function factory() {
66
- static $instance = false;
67
- if ( ! $instance ) {
68
- $instance = new self();
69
- }
70
- return $instance;
71
- }
72
-
73
- /**
74
- * Loads the plugin language files
75
- *
76
- * @since 1.0
77
- */
78
- public function load_textdomain() {
79
- // Load localization domain
80
- $this->translations = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
81
- load_plugin_textdomain( 'bnfw', false, $this->translations );
82
- }
83
-
84
- /**
85
- * Include required files.
86
- *
87
- * @since 1.0
88
- */
89
- public function includes() {
90
-
91
- // Load license related classes
92
- if ( ! class_exists( 'EDD_SL_Plugin_Updater' ) ) {
93
- require_once 'includes/libraries/EDD_SL_Plugin_Updater.php';
94
- }
95
-
96
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
97
-
98
- require_once 'vendor/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php';
99
-
100
- require_once 'includes/license/class-bnfw-license.php';
101
- require_once 'includes/license/class-bnfw-license-setting.php';
102
-
103
- // Load Engine
104
- require_once 'includes/engine/class-bnfw-engine.php';
105
- require_once 'includes/overrides.php';
106
-
107
- // Load notification post type and notification helpers
108
- require_once 'includes/admin/class-bnfw-notification.php';
109
- require_once 'includes/notification/post-notification.php';
110
-
111
- // Helpers
112
- require_once 'includes/helpers/helpers.php';
113
- require_once 'includes/helpers/ajax-helpers.php';
114
-
115
- // Load Admin Pages
116
- if ( is_admin() ) {
117
- require_once 'includes/admin/bnfw-settings.php';
118
- }
119
- }
120
-
121
- /**
122
- * Register Hooks.
123
- *
124
- * @since 1.0
125
- */
126
- public function hooks() {
127
- global $wp_version;
128
-
129
- register_activation_hook( __FILE__, array( $this, 'activate' ) );
130
-
131
- add_action( 'admin_init', array( 'PAnD', 'init' ) );
132
- add_action( 'admin_init', array( $this, 'add_capability_to_admin' ) );
133
-
134
- add_action( 'draft_to_private', array( $this, 'private_post' ) );
135
- add_action( 'future_to_private', array( $this, 'private_post' ) );
136
- add_action( 'pending_to_private', array( $this, 'private_post' ) );
137
- add_action( 'publish_to_private', array( $this, 'private_post' ) );
138
-
139
- add_action( 'wp_insert_post', array( $this, 'insert_post' ), 10, 3 );
140
-
141
- add_action( 'publish_to_trash', array( $this, 'trash_post' ) );
142
-
143
- add_action( 'auto-draft_to_publish', array( $this, 'publish_post' ) );
144
- add_action( 'draft_to_publish', array( $this, 'publish_post' ) );
145
- add_action( 'future_to_publish', array( $this, 'publish_post' ) );
146
- add_action( 'pending_to_publish', array( $this, 'publish_post' ) );
147
- add_action( 'private_to_publish', array( $this, 'publish_post' ) );
148
- // add_action( 'acf/submit_form' , array( $this, 'acf_submit_form' ), 10, 2 );
149
-
150
- add_action( 'publish_to_publish', array( $this, 'update_post' ) );
151
- add_action( 'private_to_private', array( $this, 'update_post' ) );
152
-
153
- add_action( 'add_attachment', array( $this, 'new_publish_media_notification' ), 10, 1 );
154
- add_action( 'edit_attachment', array( $this, 'media_attachment_data_update_notification' ), 10 );
155
-
156
- add_action( 'transition_post_status', array( $this, 'on_post_transition' ), 10, 3 );
157
-
158
- add_action( 'init', array( $this, 'custom_post_type_hooks' ), 100 );
159
- add_action( 'create_term', array( $this, 'create_term' ), 10, 3 );
160
-
161
- add_action( 'transition_comment_status', array( $this, 'on_comment_status_change' ), 10, 3 );
162
- add_action( 'comment_post', array( $this, 'comment_post' ) );
163
- add_action( 'trackback_post', array( $this, 'trackback_post' ) );
164
- add_action( 'pingback_post', array( $this, 'pingback_post' ) );
165
-
166
- add_action( 'user_register', array( $this, 'user_register' ) );
167
-
168
- add_action( 'user_register', array( $this, 'welcome_email' ) );
169
-
170
- if ( is_plugin_active( 'members/members.php' ) ) {
171
-
172
- add_action('add_user_role', array($this,'user_role_added_from_member_plugin'), 10, 2);
173
- add_action('remove_user_role', array($this,'user_role_removed_from_member_plugin'), 10, 2);
174
- add_action('set_user_role', array( $this, 'user_role_changed' ), 10, 3 );
175
-
176
- add_action( 'profile_update', array( $this, 'user_role_added' ), 10, 2 );
177
- } else {
178
- add_action( 'set_user_role', array( $this, 'user_role_changed' ), 10, 3 );
179
- }
180
-
181
-
182
-
183
- add_action( 'wp_login', array( $this, 'user_login' ), 10, 2 );
184
-
185
- if ( version_compare( $wp_version, '4.4', '>=' ) ) {
186
- add_filter( 'retrieve_password_title', array( $this, 'change_password_email_title' ), 10, 3 );
187
- } else {
188
- add_filter( 'retrieve_password_title', array( $this, 'change_password_email_title' ) );
189
- }
190
- add_action( 'lostpassword_post', array( $this, 'on_lost_password' ) );
191
- add_filter( 'retrieve_password_message', array( $this, 'change_password_email_message' ), 10, 4 );
192
-
193
- add_action( 'after_password_reset', array( $this, 'on_password_reset' ) );
194
-
195
- add_filter( 'send_password_change_email', array( $this, 'should_password_changed_email_be_sent' ), 10, 3 );
196
- add_filter( 'password_change_email', array( $this, 'on_password_changed' ), 10, 2 );
197
-
198
- add_filter( 'send_email_change_email', array( $this, 'should_email_changed_email_be_sent' ), 10, 3 );
199
- add_filter( 'email_change_email', array( $this, 'on_email_changed' ), 10, 3 );
200
- add_filter( 'new_user_email_content', array( $this, 'on_email_changing' ), 10, 2 );
201
-
202
- add_filter( 'auto_core_update_email', array( $this, 'on_core_updated' ), 10, 4 );
203
-
204
- add_filter( 'user_request_action_email_content', array( $this, 'handle_user_request_email_content' ), 10, 2 );
205
- add_filter( 'user_request_action_email_subject', array( $this, 'handle_user_request_email_subject' ), 10, 3 );
206
-
207
- add_filter( 'user_confirmed_action_email_content', array( $this, 'handle_user_confirmed_action_email_content' ), 10, 2 );
208
-
209
- add_filter( 'wp_privacy_personal_data_email_content', array( $this, 'handle_data_export_email_content' ), 10, 3 );
210
-
211
- add_filter( 'user_erasure_complete_email_subject', array( $this, 'handle_erasure_complete_email_subject' ), 10, 3 );
212
- add_filter( 'user_confirmed_action_email_content', array( $this, 'handle_erasure_complete_email_content' ), 10, 2 );
213
-
214
- add_filter( 'plugin_action_links', array( $this, 'plugin_action_links' ), 10, 4 );
215
- add_action( 'shutdown', array( $this, 'on_shutdown' ) );
216
- }
217
-
218
- /**
219
- * Add 'bnfw' capability to admin.
220
- */
221
- public function add_capability_to_admin() {
222
- $admins = get_role( 'administrator' );
223
-
224
- if ( is_null( $admins ) ) {
225
- return;
226
- }
227
-
228
- if ( ! $admins->has_cap( 'bnfw' ) ) {
229
- $admins->add_cap( 'bnfw' );
230
- }
231
- }
232
-
233
- /**
234
- * On post transition.
235
- *
236
- * @param string $new_status New post status.
237
- * @param string $old_status Old post status.
238
- * @param \WP_Post $post Post object.
239
- */
240
- public function on_post_transition( $new_status, $old_status, $post ) {
241
- if ( ! is_a( $post, 'WP_Post' ) ) {
242
- return;
243
- }
244
-
245
- if ( 'pending' === $old_status ) {
246
- return;
247
- }
248
-
249
- if ( 'pending' !== $new_status ) {
250
- return;
251
- }
252
-
253
- $this->on_post_pending( $post->ID, $post );
254
- }
255
-
256
- /**
257
- * Setup hooks for custom post types.
258
- *
259
- * @since 1.2
260
- */
261
- function custom_post_type_hooks() {
262
- $post_types = get_post_types( array( 'public' => true ), 'names' );
263
- $post_types = array_diff( $post_types, array( BNFW_Notification::POST_TYPE ) );
264
-
265
- foreach ( $post_types as $post_type ) {
266
- add_action( 'future_' . $post_type, array( $this, 'on_post_scheduled' ), 10, 2 );
267
- }
268
- }
269
-
270
- /**
271
- * importer
272
- */
273
- public function activate() {
274
- require_once dirname( __FILE__ ) . '/includes/import.php';
275
- $importer = new BNFW_Import;
276
- $importer->import();
277
- }
278
-
279
- /**
280
- * Add 'Settings' link below BNFW in Plugins list.
281
- *
282
- * @since 1.0
283
- * @param unknown $links
284
- * @param unknown $file
285
- * @return unknown
286
- */
287
- public function plugin_action_links( $links, $file ) {
288
- $plugin_file = 'bnfw/bnfw.php';
289
- if ( $file == $plugin_file ) {
290
- $settings_link = '<a href="' . esc_url( admin_url( 'edit.php?post_type=bnfw_notification&page=bnfw-settings' ) ) . '">' . esc_html__( 'Settings', 'bnfw' ) . '</a>';
291
- array_unshift( $links, $settings_link );
292
- }
293
- return $links;
294
- }
295
-
296
- /**
297
- * When a new term is created.
298
- *
299
- * @since 1.0
300
- * @param int $term_id
301
- * @param int $tt_id
302
- * @param string $taxonomy
303
- */
304
- public function create_term( $term_id, $tt_id, $taxonomy ) {
305
- $this->send_notification( 'newterm-' . $taxonomy, $term_id );
306
- }
307
-
308
- /**
309
- * Fires when a post is created for the first time.
310
- *
311
- * @param int $post_id Post ID
312
- * @param object $post Post object
313
- * @param bool $update Whether this is an existing post being updated or not.
314
- *
315
- * @since 1.3.1
316
- */
317
- public function insert_post( $post_id, $post, $update ) {
318
- // Some themes like P2, directly insert posts into DB.
319
- $insert_post_themes = apply_filters( 'bnfw_insert_post_themes', array( 'P2', 'Syncope' ) );
320
- $current_theme = wp_get_theme();
321
-
322
- /**
323
- * Whether to trigger insert post hook.
324
- *
325
- * @since 1.4
326
- */
327
- $trigger_insert_post = apply_filters( 'bnfw_trigger_insert_post', false, $post_id, $update );
328
-
329
- if ( in_array( $current_theme->get( 'Name' ), $insert_post_themes ) || $trigger_insert_post ) {
330
- $this->handle_inserted_post( $post_id, $update );
331
- }
332
- }
333
-
334
- /**
335
- * Trigger New Post published notification for ACF forms.
336
- *
337
- * @param string $form ACF Form.
338
- * @param int $post_id Post ID.
339
- */
340
- public function acf_submit_form( $form, $post_id ) {
341
- $this->handle_inserted_post( $post_id );
342
- }
343
-
344
- /**
345
- * Trigger correct notifications for inserted posts.
346
- *
347
- * @param int $post_id Post id.
348
- * @param bool $update Whether the post was updated.
349
- *
350
- * @since 1.6.7
351
- */
352
- private function handle_inserted_post( $post_id, $update ) {
353
- $post = get_post( $post_id );
354
-
355
- if ( ! is_a( $post, 'WP_Post' ) ) {
356
- return;
357
- }
358
-
359
- switch ( $post->post_status ) {
360
- case 'publish':
361
- if ( $update ) {
362
- $this->update_post( $post );
363
- } else {
364
- $this->publish_post( $post );
365
- }
366
- break;
367
-
368
- case 'private':
369
- $this->private_post( $post );
370
- break;
371
-
372
- case 'pending':
373
- $this->on_post_pending( $post_id, $post );
374
- break;
375
-
376
- case 'future':
377
- $this->on_post_scheduled( $post_id, $post );
378
- break;
379
- }
380
- }
381
-
382
- /**
383
- * Fires when a post is created for the first time.
384
- *
385
- * @since 1.0
386
- * @param object $post Post Object
387
- */
388
- function publish_post( $post ) {
389
- $post_id = $post->ID;
390
- $post_type = $post->post_type;
391
-
392
- if ( BNFW_Notification::POST_TYPE != $post_type ) {
393
- $this->send_notification_async( 'new-' . $post_type, $post_id );
394
- }
395
- }
396
-
397
- /**
398
- * Fires when a private post is created.
399
- *
400
- * @since 1.6
401
- * @param object $post Post Object
402
- */
403
- public function private_post( $post ) {
404
- $post_id = $post->ID;
405
- $post_type = $post->post_type;
406
-
407
- if ( BNFW_Notification::POST_TYPE != $post_type ) {
408
- $this->send_notification_async( 'private-' . $post_type, $post_id );
409
- }
410
- }
411
-
412
- /**
413
- * Fires when a post is updated.
414
- *
415
- * @since 1.0
416
- * @param unknown $post
417
- */
418
- public function update_post( $post ) {
419
- if ( $this->is_metabox_request() ) {
420
- return;
421
- }
422
-
423
- $post_id = $post->ID;
424
- $post_type = $post->post_type;
425
-
426
- if ( BNFW_Notification::POST_TYPE != $post_type ) {
427
- $this->send_notification_async( 'update-' . $post_type, $post_id );
428
- }
429
- }
430
-
431
- /**
432
- * Fires when a post is moved publish to trash.
433
- *
434
- */
435
- public function trash_post( $post ) {
436
- if ( $this->is_metabox_request() ) {
437
- return;
438
- }
439
- $post_id = $post->ID;
440
- $post_type = $post->post_type;
441
-
442
- if ( BNFW_Notification::POST_TYPE != $post_type ) {
443
- $this->send_notification_async( 'trash-' . $post_type, $post_id );
444
- }
445
- }
446
-
447
- /**
448
- * Fires when a post is pending for review.
449
- *
450
- * @since 1.1
451
- * @param int $post_id Post ID
452
- * @param object $post Post object
453
- */
454
- public function on_post_pending( $post_id, $post ) {
455
- if ( $this->is_metabox_request() ) {
456
- return;
457
- }
458
-
459
- $post_type = $post->post_type;
460
-
461
- if ( BNFW_Notification::POST_TYPE != $post_type ) {
462
- $this->send_notification_async( 'pending-' . $post_type, $post_id );
463
- }
464
- }
465
-
466
- /**
467
- * On Media Published.
468
- *
469
- * @param int $post_id Attachment post id.
470
- */
471
- public function new_publish_media_notification( $post_id ) {
472
- $post_type = get_post_type( $post_id );
473
-
474
- if ( BNFW_Notification::POST_TYPE != $post_type && $post_type == 'attachment' ) {
475
- $this->send_notification_async( 'new-media', $post_id );
476
- }
477
- }
478
-
479
- /**
480
- * On Media Attachment Data Update.
481
- *
482
- * @param int $post_id Attachment post id.
483
- */
484
- public function media_attachment_data_update_notification( $post_id ) {
485
- $post_type = get_post_type( $post_id );
486
- if ( BNFW_Notification::POST_TYPE != $post_type && $post_type == 'attachment' ) {
487
- $this->send_notification_async( 'update-media', $post_id );
488
- }
489
- }
490
-
491
- /**
492
- * Fires when a post is scheduled.
493
- *
494
- * @since 1.1.5
495
- * @param int $post_id Post ID
496
- * @param object $post Post object
497
- */
498
- function on_post_scheduled( $post_id, $post ) {
499
- // Rest request also triggers the same hook. We can ignore it.
500
- if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
501
- return;
502
- }
503
-
504
- $post_type = $post->post_type;
505
-
506
- if ( BNFW_Notification::POST_TYPE != $post_type ) {
507
- $this->send_notification_async( 'future-' . $post_type, $post_id );
508
- }
509
- }
510
-
511
- /**
512
- * When the status of a comment is changed.
513
- *
514
- * @param string $new_status New status.
515
- * @param string $old_status Old status.
516
- * @param \WP_Comment $comment Comment.
517
- */
518
- public function on_comment_status_change( $new_status, $old_status, $comment ) {
519
- if ( 'approved' !== $new_status ) {
520
- return;
521
- }
522
-
523
- $post = get_post( $comment->comment_post_ID );
524
-
525
- $notification_type = 'approve-' . $post->post_type . '-comment';
526
-
527
- $this->send_notification( $notification_type, $comment->comment_ID, false );
528
-
529
- // Send new comment notification after comment approve
530
- $notification_type = 'new-comment'; // old notification name
531
-
532
- if ( 'post' != $post->post_type ) {
533
- $notification_type = 'comment-' . $post->post_type;
534
- }
535
-
536
- $this->send_notification( $notification_type, $comment->comment_ID );
537
-
538
- // Send comment reply notification after comment approve.
539
- $this->commentsReply( $comment->comment_ID );
540
- }
541
-
542
- /**
543
- * Send notification for new comments
544
- *
545
- * @since 1.0
546
- * @param int $comment_id
547
- */
548
- public function comment_post( $comment_id ) {
549
- $the_comment = get_comment( $comment_id );
550
- $post = get_post( $the_comment->comment_post_ID );
551
-
552
- if ( '1' !== $the_comment->comment_approved ) {
553
- if ( $this->can_send_comment_notification( $the_comment ) ) {
554
- $notification_type = 'moderate-' . $post->post_type . '-comment';
555
- $this->send_notification( $notification_type, $comment_id );
556
- }
557
- } else {
558
- $notification_type = 'new-comment'; // old notification name
559
-
560
- if ( 'post' != $post->post_type ) {
561
- $notification_type = 'comment-' . $post->post_type;
562
- }
563
-
564
- $this->send_notification( $notification_type, $comment_id );
565
-
566
- // comment reply notification.
567
- $this->commentsReply( $comment_id );
568
- }
569
- }
570
-
571
- /**
572
- * Send notification for comments reply
573
- *
574
- * @since 1.0
575
- * @param int $comment_id
576
- */
577
- public function commentsReply( $comment_id ) {
578
- $the_comment = get_comment( $comment_id );
579
- $post = get_post( $the_comment->comment_post_ID );
580
-
581
- // comment reply notification.
582
- if ( $this->can_send_comment_notification( $the_comment ) ) {
583
- if ( $the_comment->comment_parent > 0 ) {
584
- $notification_type = 'reply-comment'; // old notification name
585
- if ( 'post' != $post->post_type ) {
586
- $notification_type = 'commentreply-' . $post->post_type;
587
- }
588
- $notifications = $this->notifier->get_notifications( $notification_type );
589
- if ( count( $notifications ) > 0 ) {
590
- $parent = get_comment( $the_comment->comment_parent );
591
- if ( $parent->comment_author_email != $the_comment->comment_author_email ) {
592
- foreach ( $notifications as $notification ) {
593
- $this->engine->send_comment_reply_email( $this->notifier->read_settings( $notification->ID ), $the_comment, $parent );
594
- }
595
- }
596
- }
597
- }
598
- }
599
- }
600
-
601
- /**
602
- * Send notification for new trackback
603
- *
604
- * @since 1.0
605
- * @param unknown $comment_id
606
- */
607
- function trackback_post( $comment_id ) {
608
- $the_comment = get_comment( $comment_id );
609
- if ( $this->can_send_comment_notification( $the_comment ) ) {
610
- $this->send_notification( 'new-trackback', $comment_id );
611
- }
612
- }
613
-
614
- /**
615
- * Send notification for new pingbacks
616
- *
617
- * @since 1.0
618
- * @param unknown $comment_id
619
- */
620
- function pingback_post( $comment_id ) {
621
- $the_comment = get_comment( $comment_id );
622
- if ( $this->can_send_comment_notification( $the_comment ) ) {
623
- $this->send_notification( 'new-pingback', $comment_id );
624
- }
625
- }
626
-
627
- /**
628
- * Send notification for lost password.
629
- *
630
- * @since 1.0
631
- */
632
- function on_lost_password() {
633
- $user_login = sanitize_text_field( $_POST[ 'user_login' ] );
634
- $user = get_user_by( 'login', $user_login ) ?: get_user_by( 'email', $user_login );
635
- if ( $user ) {
636
- $this->send_notification( 'admin-password', $user->ID );
637
- }
638
- }
639
-
640
- /**
641
- * Change the title of the password reset email that is sent to the user.
642
- *
643
- * @since 1.1
644
- *
645
- * @param string $title
646
- * @param string $user_login
647
- * @param string $user_data
648
- *
649
- * @return string
650
- */
651
- public function change_password_email_title( $title, $user_login = '',
652
- $user_data = '' ) {
653
- $notifications = $this->notifier->get_notifications( 'user-password' );
654
- if ( count( $notifications ) > 0 ) {
655
- // Ideally there should be only one notification for this type.
656
- // If there are multiple notification then we will read data about only the last one
657
- $setting = $this->notifier->read_settings( end( $notifications )->ID );
658
-
659
- if ( '' === $user_data ) {
660
- return $this->engine->handle_shortcodes( $setting[ 'subject' ], 'user-password', $user_data->ID );
661
- } else {
662
- return $this->engine->handle_shortcodes( $setting[ 'subject' ], 'user-password', $user_data->ID );
663
- }
664
- }
665
-
666
- return $title;
667
- }
668
-
669
- /**
670
- * Change the message of the password reset email.
671
- *
672
- * @since 1.1
673
- *
674
- * @param string $message
675
- * @param string $key
676
- * @param string $user_login
677
- * @param string $user_data
678
- *
679
- * @return string
680
- */
681
- public function change_password_email_message( $message, $key,
682
- $user_login = '',
683
- $user_data = '' ) {
684
- $notifications = $this->notifier->get_notifications( 'user-password' );
685
- if ( count( $notifications ) > 0 ) {
686
- // Ideally there should be only one notification for this type.
687
- // If there are multiple notification then we will read data about only the last one
688
- $setting = $this->notifier->read_settings( end( $notifications )->ID );
689
-
690
- $message = $this->engine->handle_password_reset_shortcodes( $setting, $key, $user_login, $user_data );
691
-
692
- if ( 'html' == $setting[ 'email-formatting' ] ) {
693
- add_filter( 'wp_mail_content_type', array( $this, 'set_html_content_type' ) );
694
- if ( 'true' !== $setting[ 'disable-autop' ] ) {
695
- $message = wpautop( $message );
696
- }
697
- } else {
698
- add_filter( 'wp_mail_content_type', array( $this, 'set_text_content_type' ) );
699
- if ( 'text' == $setting[ 'email-formatting' ] ) {
700
- $message = strip_tags( $message );
701
- }
702
- }
703
- } else {
704
- if ( $this->notifier->notification_exists( 'user-password', false ) ) {
705
- // disabled notification exists, so disable the email by returning empty string.
706
- return '';
707
- }
708
- }
709
-
710
- return $message;
711
- }
712
-
713
- /**
714
- * On Password reset.
715
- *
716
- * @param WP_User $user User who's password was changed.
717
- */
718
- public function on_password_reset( $user ) {
719
- $notifications = $this->notifier->get_notifications( 'password-changed' );
720
- foreach ( $notifications as $notification ) {
721
- $this->engine->send_password_changed_email( $this->notifier->read_settings( $notification->ID ), $user );
722
- }
723
- }
724
-
725
- /**
726
- * Should the password changed email be sent?
727
- *
728
- * @param $send
729
- * @param $user
730
- * @param $userdata
731
- *
732
- * @return bool
733
- */
734
- public function should_password_changed_email_be_sent( $send, $user,
735
- $userdata ) {
736
- $bnfw = BNFW::factory();
737
-
738
- if ( ! $send ) {
739
- return $send;
740
- }
741
-
742
- return ! $bnfw->notifier->is_notification_disabled( 'password-changed' );
743
- }
744
-
745
- /**
746
- * On Password Changed.
747
- *
748
- * @since 1.6
749
- *
750
- * @param array $email_data Email Data.
751
- * @param array $user User data.
752
- *
753
- * @return array Modified Email Data
754
- */
755
- public function on_password_changed( $email_data, $user ) {
756
- return $this->handle_filtered_data_notification( 'password-changed', $email_data, $user[ 'ID' ] );
757
- }
758
-
759
- /**
760
- * Should the email changed email be sent?
761
- *
762
- * @param $send
763
- * @param $user
764
- * @param $userdata
765
- *
766
- * @return bool
767
- */
768
- public function should_email_changed_email_be_sent( $send, $user_old_data,
769
- $user_new_data ) {
770
- $bnfw = BNFW::factory();
771
-
772
- if ( $bnfw->notifier->notification_exists( 'admin-email-changed', false ) ) {
773
- $notifications = $bnfw->notifier->get_notifications( 'admin-email-changed' );
774
-
775
- if ( count( $notifications ) > 0 ) {
776
- // Ideally there should be only one notification for this type.
777
- // If there are multiple notification then we will read data about only the last one
778
- $setting = $bnfw->notifier->read_settings( end( $notifications )->ID );
779
- $notification_disabled = apply_filters( 'bnfw_notification_disabled', ( 'true' === $setting[ 'disabled' ] ), $id, $setting );
780
-
781
- if ( ! $notification_disabled ) {
782
-
783
- $setting[ 'message' ] = str_replace( '[user_old_email]', $user_old_data[ 'user_email' ], $setting[ 'message' ] );
784
- $setting[ 'message' ] = str_replace( '[user_new_email]', $user_new_data[ 'user_email' ], $setting[ 'message' ] );
785
- $bnfw->engine->send_notification( $setting, $user_old_data[ 'ID' ] );
786
- }
787
- }
788
- }
789
-
790
- if ( ! $send ) {
791
- return $send;
792
- }
793
-
794
- return ! $bnfw->notifier->is_notification_disabled( 'email-changed' );
795
- }
796
-
797
- /**
798
- * On Email Changed.
799
- *
800
- * @since 1.6
801
- *
802
- * @param array $email_data Email Data.
803
- * @param array $user User data.
804
- *
805
- * @return array Modified Email Data
806
- */
807
- public function on_email_changed( $email_data, $user_old_data,
808
- $user_new_data ) {
809
-
810
- $email = $this->handle_filtered_data_notification( 'email-changed', $email_data, $user_old_data[ 'ID' ] );
811
- $email[ 'message' ] = str_replace( '[user_old_email]', $user_old_data[ 'user_email' ], $email[ 'message' ] );
812
- $email[ 'message' ] = str_replace( '[user_new_email]', $user_new_data[ 'user_email' ], $email[ 'message' ] );
813
- return $email;
814
- }
815
-
816
- public function on_email_changing( $email_text, $new_user_details ) {
817
- $notification_name = 'email-changing';
818
-
819
- $notifications = $this->notifier->get_notifications( $notification_name );
820
- if ( count( $notifications ) > 0 ) {
821
- // Ideally there should be only one notification for this type.
822
- // If there are multiple notification then we will read data about only the last one
823
- $setting = $this->notifier->read_settings( end( $notifications )->ID );
824
-
825
- $email_text = $this->engine->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $new_user_details[ 'newemail' ] );
826
- $email_text = $this->engine->handle_global_user_shortcodes( $email_text, $new_user_details[ 'newemail' ] );
827
- $email_text = str_replace( '[email_change_confirmation_link]', esc_url( admin_url( 'profile.php?newuseremail=' . $new_user_details[ 'hash' ] ) ), $email_text );
828
- }
829
-
830
- return $email_text;
831
- }
832
-
833
- /**
834
- * Send notification on core updated event.
835
- *
836
- * @since 1.6
837
- *
838
- * @param array $email_data Email Data.
839
- * @param string $type The type of email being sent. Can be one of
840
- * 'success', 'fail', 'manual', 'critical'.
841
- * @param object $core_update The update offer that was attempted.
842
- * @param mixed $result The result for the core update. Can be WP_Error.
843
- *
844
- * @return array Modified Email Data.
845
- */
846
- public function on_core_updated( $email_data, $type, $core_update, $result ) {
847
- $notifications = $this->notifier->get_notifications( 'core-updated' );
848
- if ( count( $notifications ) > 0 ) {
849
- // Ideally there should be only one notification for this type.
850
- // If there are multiple notification then we will read data about only the last one
851
- $setting = $this->notifier->read_settings( end( $notifications )->ID );
852
-
853
- $email_data = $this->engine->handle_core_updated_notification( $email_data, $setting, $type );
854
- }
855
-
856
- return $email_data;
857
- }
858
-
859
- /**
860
- * Process User update notifications.
861
- *
862
- * @since 1.6
863
- *
864
- * @param string $notification_name Notification Name.
865
- * @param array $email_data Email Data.
866
- * @param string|int $extra_data User Id.
867
- *
868
- * @return array Modified Email Data.
869
- */
870
- private function handle_filtered_data_notification( $notification_name,
871
- $email_data, $extra_data ) {
872
- $notifications = $this->notifier->get_notifications( $notification_name );
873
- if ( count( $notifications ) > 0 ) {
874
- // Ideally there should be only one notification for this type.
875
- // If there are multiple notification then we will read data about only the last one
876
- $setting = $this->notifier->read_settings( end( $notifications )->ID );
877
-
878
- $email_data = $this->engine->handle_filtered_data_notification( $email_data, $setting, $extra_data );
879
- }
880
-
881
- return $email_data;
882
- }
883
-
884
- /**
885
- * Set the email formatting to HTML.
886
- *
887
- * @since 1.4
888
- */
889
- public function set_html_content_type() {
890
- return 'text/html';
891
- }
892
-
893
- /**
894
- * Set the email formatting to text.
895
- *
896
- * @since 1.4
897
- */
898
- public function set_text_content_type() {
899
- return 'text/plain';
900
- }
901
-
902
- /**
903
- * Send notification for new users.
904
- *
905
- * @since 1.0
906
- * @param int $user_id
907
- */
908
- public function user_register( $user_id ) {
909
- $this->send_notification( 'admin-user', $user_id );
910
- }
911
-
912
- /**
913
- * Send notification for user when user login.
914
- *
915
- * @since 1.0
916
- * @param string $user_name
917
- * @param object $user_data User object.
918
- */
919
- public function user_login( $user_name, $user_data ) {
920
- $user_id = $user_data->ID;
921
- $notifications = $this->notifier->get_notifications( 'user-login' );
922
-
923
- foreach ( $notifications as $notification ) {
924
- $this->engine->send_user_login_email( $this->notifier->read_settings( $notification->ID ), get_userdata( $user_id ) );
925
- }
926
-
927
- $this->user_login_admin_notification( $user_id );
928
- }
929
-
930
- /**
931
- * Send notification for admin when user login.
932
- *
933
- * @since 1.0
934
- * @param int $user_id
935
- */
936
- public function user_login_admin_notification( $user_id ) {
937
- $notifications = $this->notifier->get_notifications( 'admin-user-login' );
938
-
939
- foreach ( $notifications as $notification ) {
940
- $this->engine->send_user_login_email_for_admin( $this->notifier->read_settings( $notification->ID ), get_userdata( $user_id ) );
941
- }
942
- }
943
-
944
- /**
945
- * Send notification about new users to site admin.
946
- *
947
- * @since 1.7.1
948
- *
949
- * @param array $email_data Email details.
950
- * @param WP_User $user User object.
951
- * @param string $blogname Blog name.
952
- *
953
- * @return array Modified email details.
954
- */
955
- public function handle_user_registered_admin_email( $email_data, $user,
956
- $blogname ) {
957
- return $this->handle_filtered_data_notification( 'admin-user', $email_data, $user->ID );
958
- }
959
-
960
- /**
961
- * New User - Post-registration Email
962
- *
963
- * @since 1.1
964
- * @param int $user_id New user id
965
- */
966
- public function welcome_email( $user_id ) {
967
- $notifications = $this->notifier->get_notifications( 'welcome-email' );
968
- foreach ( $notifications as $notification ) {
969
- $this->engine->send_registration_email( $this->notifier->read_settings( $notification->ID ), get_userdata( $user_id ) );
970
- }
971
- }
972
-
973
- /**
974
- * Send notification when a user role changes.
975
- *
976
- * @since 1.3.9
977
- *
978
- * @param int $user_id User ID
979
- * @param string $new_role New User role
980
- * @param array $old_roles Old User role
981
- */
982
- public function user_role_changed( $user_id, $new_role, $old_roles ) {
983
- if ( ! empty( $old_roles ) ) {
984
- $notifications = $this->notifier->get_notifications( 'user-role' );
985
- foreach ( $notifications as $notification ) {
986
-
987
- /**
988
- * Trigger User Role Changed - For User notification.
989
- *
990
- * @since 1.6.5
991
- */
992
- if ( apply_filters( 'bnfw_trigger_user-role_notification', true, $notification, $new_role, $old_roles ) ) {
993
- $this->engine->send_user_role_changed_email(
994
- $this->notifier->read_settings( $notification->ID ),
995
- $user_id,
996
- $old_roles[ 0 ],
997
- $new_role
998
- );
999
- }
1000
- }
1001
-
1002
- $notifications = $this->notifier->get_notifications( 'admin-role' );
1003
- foreach ( $notifications as $notification ) {
1004
-
1005
- /**
1006
- * Trigger User Role Changed - For User notification.
1007
- *
1008
- * @since 1.6.5
1009
- */
1010
- if ( apply_filters( 'bnfw_trigger_admin-role_notification', true, $notification, $new_role, $old_roles ) ) {
1011
- $setting = $this->notifier->read_settings( $notification->ID );
1012
- $setting[ 'message' ] = $this->engine->handle_user_role_shortcodes( $setting[ 'message' ], $old_roles[ 0 ], $new_role );
1013
- $setting[ 'subject' ] = $this->engine->handle_user_role_shortcodes( $setting[ 'subject' ], $old_roles[ 0 ], $new_role );
1014
-
1015
- $this->engine->send_notification( $setting, $user_id );
1016
- }
1017
- }
1018
- }
1019
- }
1020
-
1021
- /**
1022
- * Send notification when a user role added through Members Plugin.
1023
- *
1024
- * @since 1.8.4
1025
- *
1026
- * @param int $user_id User ID
1027
- * @param string $new_role New User role
1028
- *
1029
- */
1030
- public function user_role_added_from_member_plugin($user_id, $new_role){
1031
-
1032
- global $pagenow;
1033
-
1034
- if($pagenow != 'users.php')
1035
- return;
1036
-
1037
- if(!$user_id)
1038
- return;
1039
-
1040
- $notifications = $this->notifier->get_notifications( 'user-role' );
1041
-
1042
- foreach ( $notifications as $notification ) {
1043
-
1044
- if ( apply_filters( 'bnfw_trigger_user-role_notification', true, $notification, $new_role, null ) ) {
1045
- $this->engine->send_user_role_changed_email(
1046
- $this->notifier->read_settings( $notification->ID ),
1047
- $user_id,
1048
- null,
1049
- $new_role
1050
- );
1051
- }
1052
- }
1053
-
1054
- $notifications_admin = $this->notifier->get_notifications( 'admin-role' );
1055
- foreach ( $notifications_admin as $notification ) {
1056
- if ( apply_filters( 'bnfw_trigger_admin-role_notification', true, $notification, $new_role, null ) ) {
1057
- $setting = $this->notifier->read_settings( $notification->ID );
1058
- $setting[ 'message' ] = $this->engine->handle_user_role_shortcodes( $setting[ 'message' ], null, $new_role );
1059
- $setting[ 'subject' ] = $this->engine->handle_user_role_shortcodes( $setting[ 'subject' ], null, $new_role );
1060
-
1061
- $this->engine->send_notification( $setting, $user_id );
1062
- }
1063
- }
1064
-
1065
- }
1066
-
1067
- /**
1068
- * Send notification when a user role removed through Members Plugin.
1069
- *
1070
- * @since 1.8.4
1071
- *
1072
- * @param int $user_id User ID
1073
- * @param string $old_role New User role
1074
- *
1075
- */
1076
- public function user_role_removed_from_member_plugin($user_id, $old_role){
1077
- global $pagenow;
1078
-
1079
- if($pagenow != 'users.php')
1080
- return;
1081
-
1082
- if(!$user_id)
1083
- return;
1084
-
1085
- $notifications = $this->notifier->get_notifications( 'user-role' );
1086
-
1087
- foreach ( $notifications as $notification ) {
1088
- if ( apply_filters( 'bnfw_trigger_user-role_notification', true, $notification, null, array($old_role) ) ) {
1089
- $this->engine->send_user_role_changed_email(
1090
- $this->notifier->read_settings( $notification->ID ),
1091
- $user_id,
1092
- $old_role,
1093
- null
1094
- );
1095
- }
1096
- }
1097
-
1098
- $notifications_admin = $this->notifier->get_notifications( 'admin-role' );
1099
- foreach ( $notifications_admin as $notification ) {
1100
- if ( apply_filters( 'bnfw_trigger_admin-role_notification', true, $notification, null, array($old_role) ) ) {
1101
- $setting = $this->notifier->read_settings( $notification->ID );
1102
- $setting[ 'message' ] = $this->engine->handle_user_role_shortcodes( $setting[ 'message' ], $old_role, null );
1103
- $setting[ 'subject' ] = $this->engine->handle_user_role_shortcodes( $setting[ 'subject' ], $old_role, null );
1104
-
1105
-
1106
-
1107
- $this->engine->send_notification( $setting, $user_id );
1108
- }
1109
- }
1110
-
1111
- }
1112
-
1113
- /**
1114
- * Send notification when a user role added support User Role Editor by Members Plugin.
1115
- *
1116
- * @since 1.3.9
1117
- *
1118
- * @param int $user_id User ID
1119
- * @param string $new_role New User role
1120
- * @param array $old_roles Old User role
1121
- */
1122
- public function user_role_added( $user_id, $old_user_data ) {
1123
-
1124
- if ( isset( $_POST[ 'members_user_roles' ] ) && ! empty( $_POST[ 'members_user_roles' ] ) ) {
1125
- // Get the current user roles.
1126
- $old_roles = (array) $old_user_data->roles;
1127
-
1128
- // Sanitize the posted roles.
1129
- $new_roles = array_map( 'members_sanitize_role', $_POST[ 'members_user_roles' ] );
1130
-
1131
- sort( $old_roles );
1132
- sort( $new_roles );
1133
- $old_roles_str = implode( '', $old_roles );
1134
- $new_roles_str = implode( '', $new_roles );
1135
- if ( ! empty( $old_roles ) && $old_roles_str !== $new_roles_str ) {
1136
- $notifications = $this->notifier->get_notifications( 'user-role' );
1137
- foreach ( $notifications as $notification ) {
1138
-
1139
- /**
1140
- * Trigger User Role Changed - For User notification.
1141
- *
1142
- * @since 1.6.5
1143
- */
1144
- if ( apply_filters( 'bnfw_trigger_user-role-added_notification', true, $notification, $new_roles, $old_roles ) ) {
1145
- $this->engine->send_user_role_added_email(
1146
- $this->notifier->read_settings( $notification->ID ),
1147
- $user_id,
1148
- $old_roles,
1149
- $new_roles
1150
- );
1151
- }
1152
- }
1153
-
1154
- $notifications = $this->notifier->get_notifications( 'admin-role' );
1155
- foreach ( $notifications as $notification ) {
1156
-
1157
- /**
1158
- * Trigger User Role Changed - For User notification.
1159
- *
1160
- * @since 1.6.5
1161
- */
1162
- if ( apply_filters( 'bnfw_trigger_user-role-added_notification', true, $notification, $new_roles, $old_roles ) ) {
1163
- $setting = $this->notifier->read_settings( $notification->ID );
1164
- $setting[ 'message' ] = $this->engine->handle_user_added_role_shortcodes( $setting[ 'message' ], $old_roles, $new_roles );
1165
- $setting[ 'subject' ] = $this->engine->handle_user_added_role_shortcodes( $setting[ 'subject' ], $old_roles, $new_roles );
1166
-
1167
- $this->engine->send_notification( $setting, $user_id );
1168
- }
1169
- }
1170
- }
1171
- }
1172
- }
1173
-
1174
- /**
1175
- * Sanitizes a role name. This is a wrapper for the `sanitize_key()` WordPress function. Only
1176
- * alphanumeric characters and underscores are allowed. Hyphens are also replaced with underscores.
1177
- *
1178
- * @since 1.0.0
1179
- * @access public
1180
- * @return int
1181
- */
1182
- function members_sanitize_role( $role ) {
1183
-
1184
- $_role = strtolower( $role );
1185
- $_role = preg_replace( '/[^a-z0-9_\-\s]/', '', $_role );
1186
-
1187
- return apply_filters( 'members_sanitize_role', str_replace( ' ', '_', $_role ), $role );
1188
- }
1189
-
1190
- /**
1191
- * Send notification based on type and ref id
1192
- *
1193
- * @since 1.0
1194
- * @param string $type Notification type.
1195
- * @param mixed $ref_id Reference data.
1196
- */
1197
- public function send_notification( $type, $ref_id, $include_disabled = true ) {
1198
- $notifications = $this->notifier->get_notifications( $type , $include_disabled);
1199
- foreach ( $notifications as $notification ) {
1200
- $this->engine->send_notification( $this->notifier->read_settings( $notification->ID ), $ref_id );
1201
- }
1202
- }
1203
-
1204
- /**
1205
- * Send notification async based on type and ref id.
1206
- *
1207
- * @param string $type Notification type.
1208
- * @param mixed $ref_id Reference data.
1209
- */
1210
- public function send_notification_async( $type, $ref_id ) {
1211
- $notifications = $this->notifier->get_notifications( $type, false );
1212
- foreach ( $notifications as $notification ) {
1213
- $transient = get_transient( 'bnfw-async-notifications' );
1214
- if ( ! is_array( $transient ) ) {
1215
- $transient = array();
1216
- }
1217
-
1218
- $notification_data = array(
1219
- 'ref_id' => $ref_id,
1220
- 'notification_id' => $notification->ID,
1221
- 'notification_type' => $type,
1222
- );
1223
-
1224
- if ( ! in_array( $notification_data, $transient ) ) {
1225
- $transient[] = $notification_data;
1226
- set_transient( 'bnfw-async-notifications', $transient, 600 );
1227
- }
1228
- }
1229
- }
1230
-
1231
- /**
1232
- * Can send comment notification or not
1233
- *
1234
- * @since 1.0
1235
- * @param unknown $comment
1236
- * @return unknown
1237
- */
1238
- private function can_send_comment_notification( $comment ) {
1239
- // Returns false if the comment is marked as spam AND admin has enabled suppression of spam
1240
- $suppress_spam = get_option( 'bnfw_suppress_spam' );
1241
- if ( '1' === $suppress_spam && ( 0 === strcmp( $comment->comment_approved, 'spam' ) ) ) {
1242
- return false;
1243
- }
1244
- return true;
1245
- }
1246
-
1247
- /**
1248
- * Handle user request email content.
1249
- *
1250
- * @param string $content Content.
1251
- * @param array $email_data Email data.
1252
- *
1253
- * @return string Modified content.
1254
- */
1255
- public function handle_user_request_email_content( $content, $email_data ) {
1256
- $field = 'message';
1257
- $new_content = '';
1258
-
1259
- switch ( $email_data[ 'description' ] ) {
1260
- case 'Export Personal Data':
1261
- $notification_name = 'ca-export-data';
1262
- $new_content = $this->handle_user_request_notification( $notification_name, $field, $email_data );
1263
- break;
1264
- case 'Erase Personal Data':
1265
- $notification_name = 'ca-erase-data';
1266
- $new_content = $this->handle_user_request_notification( $notification_name, $field, $email_data );
1267
- break;
1268
- }
1269
-
1270
- if ( ! empty( $new_content ) ) {
1271
- return $new_content;
1272
- } else {
1273
- return $content;
1274
- }
1275
- }
1276
-
1277
- /**
1278
- * Handle user request email subject.
1279
- *
1280
- * @param string $subject Subject
1281
- * @param string $blogname Blog name
1282
- * @param array $email_data Email data.
1283
- *
1284
- * @return string Modified subject.
1285
- */
1286
- public function handle_user_request_email_subject( $subject, $blogname,
1287
- $email_data ) {
1288
- $field = 'subject';
1289
- $new_subject = '';
1290
-
1291
- switch ( $email_data[ 'description' ] ) {
1292
- case 'Export Personal Data':
1293
- $notification_name = 'ca-export-data';
1294
- $new_subject = $this->handle_user_request_notification( $notification_name, $field, $email_data );
1295
- break;
1296
- case 'Erase Personal Data':
1297
- $notification_name = 'ca-erase-data';
1298
- $new_subject = $this->handle_user_request_notification( $notification_name, $field, $email_data );
1299
- break;
1300
- }
1301
- if ( ! empty( $new_subject ) ) {
1302
- return $new_subject;
1303
- } else {
1304
- return $subject;
1305
- }
1306
- }
1307
-
1308
- /**
1309
- * Handle user confirmed action email content.
1310
- *
1311
- * @param string $content Content.
1312
- * @param array $email_data Email data.
1313
- *
1314
- * @return string Modified content.
1315
- */
1316
- public function handle_user_confirmed_action_email_content( $content,
1317
- $email_data ) {
1318
- $field = 'message';
1319
- $new_content = '';
1320
-
1321
- switch ( $email_data[ 'description' ] ) {
1322
- case 'Export Personal Data':
1323
- $notification_name = 'uc-export-data';
1324
- $new_content = $this->handle_user_confirmed_action_notification( $notification_name, $field, $email_data );
1325
- break;
1326
- case 'Erase Personal Data':
1327
- $notification_name = 'uc-erase-data';
1328
- $new_content = $this->handle_user_confirmed_action_notification( $notification_name, $field, $email_data );
1329
- break;
1330
- }
1331
-
1332
- if ( ! empty( $new_content ) ) {
1333
- return $new_content;
1334
- } else {
1335
- return $content;
1336
- }
1337
- }
1338
-
1339
- /**
1340
- * Handle data exported email content.
1341
- *
1342
- * @param string $content Content.
1343
- * @param int $request_id
1344
- *
1345
- * @return string Modified content.
1346
- */
1347
- public function handle_data_export_email_content( $content, $request_id,$email_data ) {
1348
-
1349
- $field = 'message';
1350
- $notification_name = 'data-export';
1351
- $new_content = '';
1352
-
1353
- $notifications = $this->notifier->get_notifications( $notification_name );
1354
- if ( count( $notifications ) > 0 ) {
1355
- // Ideally there should be only one notification for this type.
1356
- // If there are multiple notification then we will read data about only the last one
1357
- $setting = $this->notifier->read_settings( end( $notifications )->ID );
1358
-
1359
- $new_content = $this->engine->handle_data_export_email_shortcodes( $setting[ $field ], $setting, $request_id );
1360
- $new_content = $this->engine->handle_global_user_shortcodes( $new_content, $email_data['message_recipient'] );
1361
- }
1362
-
1363
- if ( ! empty( $new_content ) ) {
1364
- return $new_content;
1365
- } else {
1366
- return $content;
1367
- }
1368
- }
1369
-
1370
- public function handle_erasure_complete_email_subject( $subject, $sitename,
1371
- $email_data ) {
1372
- return $this->handle_erasure_complete_email_notification( 'subject', $subject, $email_data );
1373
- }
1374
-
1375
- public function handle_erasure_complete_email_content( $content, $email_data ) {
1376
- if ( isset( $email_data[ 'privacy_policy_url' ] ) ) {
1377
- return $this->handle_erasure_complete_email_notification( 'message', $content, $email_data );
1378
- }
1379
-
1380
- return $content;
1381
- }
1382
-
1383
- protected function handle_erasure_complete_email_notification( $field,
1384
- $content,
1385
- $email_data ) {
1386
- $notification_name = 'data-erased';
1387
- $new_content = '';
1388
- $notifications = $this->notifier->get_notifications( $notification_name );
1389
- if ( count( $notifications ) > 0 ) {
1390
- // Ideally there should be only one notification for this type.
1391
- // If there are multiple notification then we will read data about only the last one
1392
- $setting = $this->notifier->read_settings( end( $notifications )->ID );
1393
- $new_content = $this->engine->handle_shortcodes( $setting[ $field ], $notification_name, $email_data );
1394
- }
1395
- if ( ! empty( $new_content ) ) {
1396
- return $new_content;
1397
- } else {
1398
- return $content;
1399
- }
1400
- }
1401
-
1402
- /**
1403
- * Send notification emails on shutdown.
1404
- */
1405
- public function on_shutdown() {
1406
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
1407
- return;
1408
- }
1409
-
1410
- $transient = get_transient( 'bnfw-async-notifications' );
1411
- if ( is_array( $transient ) ) {
1412
- delete_transient( 'bnfw-async-notifications' );
1413
- foreach ( $transient as $id_pairs ) {
1414
- $this->engine->send_notification( $this->notifier->read_settings( $id_pairs[ 'notification_id' ] ), $id_pairs[ 'ref_id' ] );
1415
- }
1416
- }
1417
- }
1418
-
1419
- /**
1420
- * Handle user request notification.
1421
- *
1422
- * @param string $notification_name Notification name.
1423
- * @param string $field Field name.
1424
- * @param array $email_data Email data.
1425
- *
1426
- * @return string Content.
1427
- */
1428
- protected function handle_user_request_notification( $notification_name,
1429
- $field, $email_data ) {
1430
- $notifications = $this->notifier->get_notifications( $notification_name );
1431
- if ( count( $notifications ) > 0 ) {
1432
- // Ideally there should be only one notification for this type.
1433
- // If there are multiple notification then we will read data about only the last one
1434
- $setting = $this->notifier->read_settings( end( $notifications )->ID );
1435
-
1436
- return $this->engine->handle_user_request_email_shortcodes( $setting[ $field ], $setting, $email_data );
1437
- }
1438
-
1439
- return '';
1440
- }
1441
-
1442
- /**
1443
- * Handle user confirmed action notification.
1444
- *
1445
- * @param string $notification_name Notification name.
1446
- * @param string $field Field name.
1447
- * @param array $email_data Email data.
1448
- *
1449
- * @return string Content.
1450
- */
1451
- protected function handle_user_confirmed_action_notification( $notification_name,
1452
- $field,
1453
- $email_data ) {
1454
- $notifications = $this->notifier->get_notifications( $notification_name );
1455
- if ( count( $notifications ) > 0 ) {
1456
- // Ideally there should be only one notification for this type.
1457
- // If there are multiple notification then we will read data about only the last one
1458
- $setting = $this->notifier->read_settings( end( $notifications )->ID );
1459
-
1460
- return $this->engine->handle_user_confirmed_action_email_shortcodes( $setting[ $field ], $setting, $email_data );
1461
- }
1462
-
1463
- return '';
1464
- }
1465
-
1466
- /**
1467
- * Is this a metabox request?
1468
- *
1469
- * Block editor sends duplicate requests on post update.
1470
- *
1471
- * @return bool True if metabox request, False otherwise.
1472
- */
1473
- protected function is_metabox_request() {
1474
- return ( isset( $_GET[ 'meta-box-loader' ] ) || isset( $_GET[ 'meta_box' ] ) );
1475
- }
1476
-
1477
-
1478
- /**
1479
- * Check if Gutenberg is active.
1480
- *
1481
- *
1482
- * @return bool
1483
- * @since 1.3
1484
- */
1485
- public function is_gutenberg_active() {
1486
- $gutenberg = false;
1487
- $block_editor = false;
1488
-
1489
- if ( has_filter( 'replace_editor', 'gutenberg_init' ) ) {
1490
- // Gutenberg is installed and activated.
1491
- $gutenberg = true;
1492
- }
1493
-
1494
- if ( version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' ) ) {
1495
- // Block editor.
1496
- $block_editor = true;
1497
- }
1498
-
1499
- if ( ! $gutenberg && ! $block_editor ) {
1500
- return false;
1501
- }
1502
-
1503
- include_once ABSPATH . 'wp-admin/includes/plugin.php';
1504
-
1505
- if ( ! is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
1506
- return true;
1507
- }
1508
-
1509
- $use_block_editor = ( get_option( 'classic-editor-replace' ) === 'no-replace' );
1510
-
1511
- return $use_block_editor;
1512
- }
1513
-
1514
- }
1515
-
1516
- /* ------------------------------------------------------------------------ *
1517
- * Fire up the plugin
1518
- * ------------------------------------------------------------------------ */
1519
- BNFW::factory();
1
+ <?php
2
+
3
+ /**
4
+ * Plugin Name: Better Notifications for WP
5
+ * Plugin URI: https://wordpress.org/plugins/bnfw/
6
+ * Description: Supercharge your WordPress notifications using a WYSIWYG editor and shortcodes. Default and new notifications available. Add more power with Add-ons.
7
+ * Version: 1.8.7
8
+ * Requires at least: 4.8
9
+ * Requires PHP: 7.0
10
+ * Author: Made with Fuel
11
+ * Author URI: https://madewithfuel.com/
12
+ * License: GPLv2 or later
13
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.html
14
+ * Text Domain: bnfw
15
+ * Domain Path: /languages
16
+ */
17
+
18
+ /**
19
+ * Copyright © 2022 Made with Fuel Ltd. (hello@betternotificationsforwp.com)
20
+ * This program is free software; you can redistribute it and/or modify
21
+ * it under the terms of the GNU General Public License, version 2, as
22
+ * published by the Free Software Foundation.
23
+ * This program is distributed in the hope that it will be useful,
24
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
25
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26
+ * GNU General Public License for more details.
27
+ * You should have received a copy of the GNU General Public License
28
+ * along with this program; if not, write to the Free Software
29
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30
+ */
31
+ class BNFW {
32
+
33
+ /**
34
+ * Constructor.
35
+ *
36
+ * @since 1.0
37
+ */
38
+ function __construct() {
39
+ $this->load_textdomain();
40
+ $this->includes();
41
+ $this->hooks();
42
+
43
+ /**
44
+ * BNFW Notification.
45
+ *
46
+ * @var \BNFW_Notification
47
+ */
48
+ $this->notifier = new BNFW_Notification;
49
+
50
+ /**
51
+ * BNFW Engine.
52
+ *
53
+ * @var \BNFW_Engine
54
+ */
55
+ $this->engine = new BNFW_Engine;
56
+ }
57
+
58
+ /**
59
+ * Factory method to return the instance of the class.
60
+ *
61
+ * Makes sure that only one instance is created.
62
+ *
63
+ * @return \BNFW Instance of the class.
64
+ */
65
+ public static function factory() {
66
+ static $instance = false;
67
+ if ( ! $instance ) {
68
+ $instance = new self();
69
+ }
70
+ return $instance;
71
+ }
72
+
73
+ /**
74
+ * Loads the plugin language files
75
+ *
76
+ * @since 1.0
77
+ */
78
+ public function load_textdomain() {
79
+ // Load localization domain
80
+ $this->translations = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
81
+ load_plugin_textdomain( 'bnfw', false, $this->translations );
82
+ }
83
+
84
+ /**
85
+ * Include required files.
86
+ *
87
+ * @since 1.0
88
+ */
89
+ public function includes() {
90
+
91
+ // Load license related classes
92
+ if ( ! class_exists( 'EDD_SL_Plugin_Updater' ) ) {
93
+ require_once 'includes/libraries/EDD_SL_Plugin_Updater.php';
94
+ }
95
+
96
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
97
+
98
+ require_once 'vendor/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php';
99
+
100
+ require_once 'includes/license/class-bnfw-license.php';
101
+ require_once 'includes/license/class-bnfw-license-setting.php';
102
+
103
+ // Load Engine
104
+ require_once 'includes/engine/class-bnfw-engine.php';
105
+ require_once 'includes/overrides.php';
106
+
107
+ // Load notification post type and notification helpers
108
+ require_once 'includes/admin/class-bnfw-notification.php';
109
+ require_once 'includes/notification/post-notification.php';
110
+
111
+ // Helpers
112
+ require_once 'includes/helpers/helpers.php';
113
+ require_once 'includes/helpers/ajax-helpers.php';
114
+
115
+ // Load Admin Pages
116
+ if ( is_admin() ) {
117
+ require_once 'includes/admin/bnfw-settings.php';
118
+ }
119
+ }
120
+
121
+ /**
122
+ * Register Hooks.
123
+ *
124
+ * @since 1.0
125
+ */
126
+ public function hooks() {
127
+ global $wp_version;
128
+
129
+ register_activation_hook( __FILE__, array( $this, 'activate' ) );
130
+
131
+ add_action( 'admin_init', array( 'PAnD', 'init' ) );
132
+ add_action( 'admin_init', array( $this, 'add_capability_to_admin' ) );
133
+
134
+ add_action( 'draft_to_private', array( $this, 'private_post' ) );
135
+ add_action( 'future_to_private', array( $this, 'private_post' ) );
136
+ add_action( 'pending_to_private', array( $this, 'private_post' ) );
137
+ add_action( 'publish_to_private', array( $this, 'private_post' ) );
138
+
139
+ add_action( 'wp_insert_post', array( $this, 'insert_post' ), 10, 3 );
140
+
141
+ add_action( 'publish_to_trash', array( $this, 'trash_post' ) );
142
+
143
+ add_action( 'auto-draft_to_publish', array( $this, 'publish_post' ) );
144
+ add_action( 'draft_to_publish', array( $this, 'publish_post' ) );
145
+ add_action( 'future_to_publish', array( $this, 'publish_post' ) );
146
+ add_action( 'pending_to_publish', array( $this, 'publish_post' ) );
147
+ add_action( 'private_to_publish', array( $this, 'publish_post' ) );
148
+ // add_action( 'acf/submit_form' , array( $this, 'acf_submit_form' ), 10, 2 );
149
+
150
+ add_action( 'publish_to_publish', array( $this, 'update_post' ) );
151
+ add_action( 'private_to_private', array( $this, 'update_post' ) );
152
+
153
+ add_action( 'add_attachment', array( $this, 'new_publish_media_notification' ), 10, 1 );
154
+ add_action( 'edit_attachment', array( $this, 'media_attachment_data_update_notification' ), 10 );
155
+
156
+ add_action( 'transition_post_status', array( $this, 'on_post_transition' ), 10, 3 );
157
+
158
+ add_action( 'init', array( $this, 'custom_post_type_hooks' ), 100 );
159
+ add_action( 'create_term', array( $this, 'create_term' ), 10, 3 );
160
+
161
+ add_action( 'transition_comment_status', array( $this, 'on_comment_status_change' ), 10, 3 );
162
+ add_action( 'comment_post', array( $this, 'comment_post' ) );
163
+ add_action( 'trackback_post', array( $this, 'trackback_post' ) );
164
+ add_action( 'pingback_post', array( $this, 'pingback_post' ) );
165
+
166
+ add_action( 'user_register', array( $this, 'user_register' ) );
167
+
168
+ add_action( 'user_register', array( $this, 'welcome_email' ) );
169
+
170
+ if ( is_plugin_active( 'members/members.php' ) ) {
171
+
172
+ add_action('add_user_role', array($this,'user_role_added_from_member_plugin'), 10, 2);
173
+ add_action('remove_user_role', array($this,'user_role_removed_from_member_plugin'), 10, 2);
174
+ add_action('set_user_role', array( $this, 'user_role_changed' ), 10, 3 );
175
+
176
+ add_action( 'profile_update', array( $this, 'user_role_added' ), 10, 2 );
177
+ } else {
178
+ add_action( 'set_user_role', array( $this, 'user_role_changed' ), 10, 3 );
179
+ }
180
+
181
+
182
+
183
+ add_action( 'wp_login', array( $this, 'user_login' ), 10, 2 );
184
+
185
+ if ( version_compare( $wp_version, '4.4', '>=' ) ) {
186
+ add_filter( 'retrieve_password_title', array( $this, 'change_password_email_title' ), 10, 3 );
187
+ } else {
188
+ add_filter( 'retrieve_password_title', array( $this, 'change_password_email_title' ) );
189
+ }
190
+ add_action( 'lostpassword_post', array( $this, 'on_lost_password' ) );
191
+ add_filter( 'retrieve_password_message', array( $this, 'change_password_email_message' ), 10, 4 );
192
+
193
+ add_action( 'after_password_reset', array( $this, 'on_password_reset' ) );
194
+
195
+ add_filter( 'send_password_change_email', array( $this, 'should_password_changed_email_be_sent' ), 10, 3 );
196
+ add_filter( 'password_change_email', array( $this, 'on_password_changed' ), 10, 2 );
197
+
198
+ add_filter( 'send_email_change_email', array( $this, 'should_email_changed_email_be_sent' ), 10, 3 );
199
+ add_filter( 'email_change_email', array( $this, 'on_email_changed' ), 10, 3 );
200
+ add_filter( 'new_user_email_content', array( $this, 'on_email_changing' ), 10, 2 );
201
+
202
+ add_filter( 'auto_core_update_email', array( $this, 'on_core_updated' ), 10, 4 );
203
+
204
+ add_filter( 'user_request_action_email_content', array( $this, 'handle_user_request_email_content' ), 10, 2 );
205
+ add_filter( 'user_request_action_email_subject', array( $this, 'handle_user_request_email_subject' ), 10, 3 );
206
+
207
+ add_filter( 'user_confirmed_action_email_content', array( $this, 'handle_user_confirmed_action_email_content' ), 10, 2 );
208
+
209
+ add_filter( 'wp_privacy_personal_data_email_content', array( $this, 'handle_data_export_email_content' ), 10, 3 );
210
+
211
+ add_filter( 'user_erasure_complete_email_subject', array( $this, 'handle_erasure_complete_email_subject' ), 10, 3 );
212
+ add_filter( 'user_confirmed_action_email_content', array( $this, 'handle_erasure_complete_email_content' ), 10, 2 );
213
+
214
+ add_filter( 'plugin_action_links', array( $this, 'plugin_action_links' ), 10, 4 );
215
+ add_action( 'shutdown', array( $this, 'on_shutdown' ) );
216
+ }
217
+
218
+ /**
219
+ * Add 'bnfw' capability to admin.
220
+ */
221
+ public function add_capability_to_admin() {
222
+ $admins = get_role( 'administrator' );
223
+
224
+ if ( is_null( $admins ) ) {
225
+ return;
226
+ }
227
+
228
+ if ( ! $admins->has_cap( 'bnfw' ) ) {
229
+ $admins->add_cap( 'bnfw' );
230
+ }
231
+ }
232
+
233
+ /**
234
+ * On post transition.
235
+ *
236
+ * @param string $new_status New post status.
237
+ * @param string $old_status Old post status.
238
+ * @param \WP_Post $post Post object.
239
+ */
240
+ public function on_post_transition( $new_status, $old_status, $post ) {
241
+ if ( ! is_a( $post, 'WP_Post' ) ) {
242
+ return;
243
+ }
244
+
245
+ if ( 'pending' === $old_status ) {
246
+ return;
247
+ }
248
+
249
+ if ( 'pending' !== $new_status ) {
250
+ return;
251
+ }
252
+
253
+ $this->on_post_pending( $post->ID, $post );
254
+ }
255
+
256
+ /**
257
+ * Setup hooks for custom post types.
258
+ *
259
+ * @since 1.2
260
+ */
261
+ function custom_post_type_hooks() {
262
+ $post_types = get_post_types( array( 'public' => true ), 'names' );
263
+ $post_types = array_diff( $post_types, array( BNFW_Notification::POST_TYPE ) );
264
+
265
+ foreach ( $post_types as $post_type ) {
266
+ add_action( 'future_' . $post_type, array( $this, 'on_post_scheduled' ), 10, 2 );
267
+ }
268
+ }
269
+
270
+ /**
271
+ * importer
272
+ */
273
+ public function activate() {
274
+ require_once dirname( __FILE__ ) . '/includes/import.php';
275
+ $importer = new BNFW_Import;
276
+ $importer->import();
277
+ }
278
+
279
+ /**
280
+ * Add 'Settings' link below BNFW in Plugins list.
281
+ *
282
+ * @since 1.0
283
+ * @param unknown $links
284
+ * @param unknown $file
285
+ * @return unknown
286
+ */
287
+ public function plugin_action_links( $links, $file ) {
288
+ $plugin_file = 'bnfw/bnfw.php';
289
+ if ( $file == $plugin_file ) {
290
+ $settings_link = '<a href="' . esc_url( admin_url( 'edit.php?post_type=bnfw_notification&page=bnfw-settings' ) ) . '">' . esc_html__( 'Settings', 'bnfw' ) . '</a>';
291
+ array_unshift( $links, $settings_link );
292
+ }
293
+ return $links;
294
+ }
295
+
296
+ /**
297
+ * When a new term is created.
298
+ *
299
+ * @since 1.0
300
+ * @param int $term_id
301
+ * @param int $tt_id
302
+ * @param string $taxonomy
303
+ */
304
+ public function create_term( $term_id, $tt_id, $taxonomy ) {
305
+ $this->send_notification( 'newterm-' . $taxonomy, $term_id );
306
+ }
307
+
308
+ /**
309
+ * Fires when a post is created for the first time.
310
+ *
311
+ * @param int $post_id Post ID
312
+ * @param object $post Post object
313
+ * @param bool $update Whether this is an existing post being updated or not.
314
+ *
315
+ * @since 1.3.1
316
+ */
317
+ public function insert_post( $post_id, $post, $update ) {
318
+ // Some themes like P2, directly insert posts into DB.
319
+ $insert_post_themes = apply_filters( 'bnfw_insert_post_themes', array( 'P2', 'Syncope' ) );
320
+ $current_theme = wp_get_theme();
321
+
322
+ /**
323
+ * Whether to trigger insert post hook.
324
+ *
325
+ * @since 1.4
326
+ */
327
+ $trigger_insert_post = apply_filters( 'bnfw_trigger_insert_post', false, $post_id, $update );
328
+
329
+ if ( in_array( $current_theme->get( 'Name' ), $insert_post_themes ) || $trigger_insert_post ) {
330
+ $this->handle_inserted_post( $post_id, $update );
331
+ }
332
+ }
333
+
334
+ /**
335
+ * Trigger New Post published notification for ACF forms.
336
+ *
337
+ * @param string $form ACF Form.
338
+ * @param int $post_id Post ID.
339
+ */
340
+ public function acf_submit_form( $form, $post_id ) {
341
+ $this->handle_inserted_post( $post_id );
342
+ }
343
+
344
+ /**
345
+ * Trigger correct notifications for inserted posts.
346
+ *
347
+ * @param int $post_id Post id.
348
+ * @param bool $update Whether the post was updated.
349
+ *
350
+ * @since 1.6.7
351
+ */
352
+ private function handle_inserted_post( $post_id, $update ) {
353
+ $post = get_post( $post_id );
354
+
355
+ if ( ! is_a( $post, 'WP_Post' ) ) {
356
+ return;
357
+ }
358
+
359
+ switch ( $post->post_status ) {
360
+ case 'publish':
361
+ if ( $update ) {
362
+ $this->update_post( $post );
363
+ } else {
364
+ $this->publish_post( $post );
365
+ }
366
+ break;
367
+
368
+ case 'private':
369
+ $this->private_post( $post );
370
+ break;
371
+
372
+ case 'pending':
373
+ $this->on_post_pending( $post_id, $post );
374
+ break;
375
+
376
+ case 'future':
377
+ $this->on_post_scheduled( $post_id, $post );
378
+ break;
379
+ }
380
+ }
381
+
382
+ /**
383
+ * Fires when a post is created for the first time.
384
+ *
385
+ * @since 1.0
386
+ * @param object $post Post Object
387
+ */
388
+ function publish_post( $post ) {
389
+ $post_id = $post->ID;
390
+ $post_type = $post->post_type;
391
+
392
+ if ( BNFW_Notification::POST_TYPE != $post_type ) {
393
+ $this->send_notification_async( 'new-' . $post_type, $post_id );
394
+ }
395
+ }
396
+
397
+ /**
398
+ * Fires when a private post is created.
399
+ *
400
+ * @since 1.6
401
+ * @param object $post Post Object
402
+ */
403
+ public function private_post( $post ) {
404
+ $post_id = $post->ID;
405
+ $post_type = $post->post_type;
406
+
407
+ if ( BNFW_Notification::POST_TYPE != $post_type ) {
408
+ $this->send_notification_async( 'private-' . $post_type, $post_id );
409
+ }
410
+ }
411
+
412
+ /**
413
+ * Fires when a post is updated.
414
+ *
415
+ * @since 1.0
416
+ * @param unknown $post
417
+ */
418
+ public function update_post( $post ) {
419
+ if ( $this->is_metabox_request() ) {
420
+ return;
421
+ }
422
+
423
+ $post_id = $post->ID;
424
+ $post_type = $post->post_type;
425
+
426
+ if ( BNFW_Notification::POST_TYPE != $post_type ) {
427
+ $this->send_notification_async( 'update-' . $post_type, $post_id );
428
+ }
429
+ }
430
+
431
+ /**
432
+ * Fires when a post is moved publish to trash.
433
+ *
434
+ */
435
+ public function trash_post( $post ) {
436
+ if ( $this->is_metabox_request() ) {
437
+ return;
438
+ }
439
+ $post_id = $post->ID;
440
+ $post_type = $post->post_type;
441
+
442
+ if ( BNFW_Notification::POST_TYPE != $post_type ) {
443
+ $this->send_notification_async( 'trash-' . $post_type, $post_id );
444
+ }
445
+ }
446
+
447
+ /**
448
+ * Fires when a post is pending for review.
449
+ *
450
+ * @since 1.1
451
+ * @param int $post_id Post ID
452
+ * @param object $post Post object
453
+ */
454
+ public function on_post_pending( $post_id, $post ) {
455
+ if ( $this->is_metabox_request() ) {
456
+ return;
457
+ }
458
+
459
+ $post_type = $post->post_type;
460
+
461
+ if ( BNFW_Notification::POST_TYPE != $post_type ) {
462
+ $this->send_notification_async( 'pending-' . $post_type, $post_id );
463
+ }
464
+ }
465
+
466
+ /**
467
+ * On Media Published.
468
+ *
469
+ * @param int $post_id Attachment post id.
470
+ */
471
+ public function new_publish_media_notification( $post_id ) {
472
+ $post_type = get_post_type( $post_id );
473
+
474
+ if ( BNFW_Notification::POST_TYPE != $post_type && $post_type == 'attachment' ) {
475
+ $this->send_notification_async( 'new-media', $post_id );
476
+ }
477
+ }
478
+
479
+ /**
480
+ * On Media Attachment Data Update.
481
+ *
482
+ * @param int $post_id Attachment post id.
483
+ */
484
+ public function media_attachment_data_update_notification( $post_id ) {
485
+ $post_type = get_post_type( $post_id );
486
+ if ( BNFW_Notification::POST_TYPE != $post_type && $post_type == 'attachment' ) {
487
+ $this->send_notification_async( 'update-media', $post_id );
488
+ }
489
+ }
490
+
491
+ /**
492
+ * Fires when a post is scheduled.
493
+ *
494
+ * @since 1.1.5
495
+ * @param int $post_id Post ID
496
+ * @param object $post Post object
497
+ */
498
+ function on_post_scheduled( $post_id, $post ) {
499
+ // Rest request also triggers the same hook. We can ignore it.
500
+ if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
501
+ return;
502
+ }
503
+
504
+ $post_type = $post->post_type;
505
+
506
+ if ( BNFW_Notification::POST_TYPE != $post_type ) {
507
+ $this->send_notification_async( 'future-' . $post_type, $post_id );
508
+ }
509
+ }
510
+
511
+ /**
512
+ * When the status of a comment is changed.
513
+ *
514
+ * @param string $new_status New status.
515
+ * @param string $old_status Old status.
516
+ * @param \WP_Comment $comment Comment.
517
+ */
518
+ public function on_comment_status_change( $new_status, $old_status, $comment ) {
519
+ if ( 'approved' !== $new_status ) {
520
+ return;
521
+ }
522
+
523
+ $post = get_post( $comment->comment_post_ID );
524
+
525
+ $notification_type = 'approve-' . $post->post_type . '-comment';
526
+
527
+ $this->send_notification( $notification_type, $comment->comment_ID, false );
528
+
529
+ // Send new comment notification after comment approve
530
+ $notification_type = 'new-comment'; // old notification name
531
+
532
+ if ( 'post' != $post->post_type ) {
533
+ $notification_type = 'comment-' . $post->post_type;
534
+ }
535
+
536
+ $this->send_notification( $notification_type, $comment->comment_ID );
537
+
538
+ // Send comment reply notification after comment approve.
539
+ $this->commentsReply( $comment->comment_ID );
540
+ }
541
+
542
+ /**
543
+ * Send notification for new comments
544
+ *
545
+ * @since 1.0
546
+ * @param int $comment_id
547
+ */
548
+ public function comment_post( $comment_id ) {
549
+ $the_comment = get_comment( $comment_id );
550
+ $post = get_post( $the_comment->comment_post_ID );
551
+
552
+ if ( '1' !== $the_comment->comment_approved ) {
553
+ if ( $this->can_send_comment_notification( $the_comment ) ) {
554
+ $notification_type = 'moderate-' . $post->post_type . '-comment';
555
+ $this->send_notification( $notification_type, $comment_id );
556
+ }
557
+ } else {
558
+ $notification_type = 'new-comment'; // old notification name
559
+
560
+ if ( 'post' != $post->post_type ) {
561
+ $notification_type = 'comment-' . $post->post_type;
562
+ }
563
+
564
+ $this->send_notification( $notification_type, $comment_id );
565
+
566
+ // comment reply notification.
567
+ $this->commentsReply( $comment_id );
568
+ }
569
+ }
570
+
571
+ /**
572
+ * Send notification for comments reply
573
+ *
574
+ * @since 1.0
575
+ * @param int $comment_id
576
+ */
577
+ public function commentsReply( $comment_id ) {
578
+ $the_comment = get_comment( $comment_id );
579
+ $post = get_post( $the_comment->comment_post_ID );
580
+
581
+ // comment reply notification.
582
+ if ( $this->can_send_comment_notification( $the_comment ) ) {
583
+ if ( $the_comment->comment_parent > 0 ) {
584
+ $notification_type = 'reply-comment'; // old notification name
585
+ if ( 'post' != $post->post_type ) {
586
+ $notification_type = 'commentreply-' . $post->post_type;
587
+ }
588
+ $notifications = $this->notifier->get_notifications( $notification_type );
589
+ if ( count( $notifications ) > 0 ) {
590
+ $parent = get_comment( $the_comment->comment_parent );
591
+ if ( $parent->comment_author_email != $the_comment->comment_author_email ) {
592
+ foreach ( $notifications as $notification ) {
593
+ $this->engine->send_comment_reply_email( $this->notifier->read_settings( $notification->ID ), $the_comment, $parent );
594
+ }
595
+ }
596
+ }
597
+ }
598
+ }
599
+ }
600
+
601
+ /**
602
+ * Send notification for new trackback
603
+ *
604
+ * @since 1.0
605
+ * @param unknown $comment_id
606
+ */
607
+ function trackback_post( $comment_id ) {
608
+ $the_comment = get_comment( $comment_id );
609
+ if ( $this->can_send_comment_notification( $the_comment ) ) {
610
+ $this->send_notification( 'new-trackback', $comment_id );
611
+ }
612
+ }
613
+
614
+ /**
615
+ * Send notification for new pingbacks
616
+ *
617
+ * @since 1.0
618
+ * @param unknown $comment_id
619
+ */
620
+ function pingback_post( $comment_id ) {
621
+ $the_comment = get_comment( $comment_id );
622
+ if ( $this->can_send_comment_notification( $the_comment ) ) {
623
+ $this->send_notification( 'new-pingback', $comment_id );
624
+ }
625
+ }
626
+
627
+ /**
628
+ * Send notification for lost password.
629
+ *
630
+ * @since 1.0
631
+ */
632
+ function on_lost_password() {
633
+ $user_login = sanitize_text_field( $_POST[ 'user_login' ] );
634
+ $user = get_user_by( 'login', $user_login ) ?: get_user_by( 'email', $user_login );
635
+ if ( $user ) {
636
+ $this->send_notification( 'admin-password', $user->ID );
637
+ }
638
+ }
639
+
640
+ /**
641
+ * Change the title of the password reset email that is sent to the user.
642
+ *
643
+ * @since 1.1
644
+ *
645
+ * @param string $title
646
+ * @param string $user_login
647
+ * @param string $user_data
648
+ *
649
+ * @return string
650
+ */
651
+ public function change_password_email_title( $title, $user_login = '',
652
+ $user_data = '' ) {
653
+ $notifications = $this->notifier->get_notifications( 'user-password' );
654
+ if ( count( $notifications ) > 0 ) {
655
+ // Ideally there should be only one notification for this type.
656
+ // If there are multiple notification then we will read data about only the last one
657
+ $setting = $this->notifier->read_settings( end( $notifications )->ID );
658
+
659
+ if ( '' === $user_data ) {
660
+ return $this->engine->handle_shortcodes( $setting[ 'subject' ], 'user-password', $user_data->ID );
661
+ } else {
662
+ return $this->engine->handle_shortcodes( $setting[ 'subject' ], 'user-password', $user_data->ID );
663
+ }
664
+ }
665
+
666
+ return $title;
667
+ }
668
+
669
+ /**
670
+ * Change the message of the password reset email.
671
+ *
672
+ * @since 1.1
673
+ *
674
+ * @param string $message
675
+ * @param string $key
676
+ * @param string $user_login
677
+ * @param string $user_data
678
+ *
679
+ * @return string
680
+ */
681
+ public function change_password_email_message( $message, $key,
682
+ $user_login = '',
683
+ $user_data = '' ) {
684
+ $notifications = $this->notifier->get_notifications( 'user-password' );
685
+ if ( count( $notifications ) > 0 ) {
686
+ // Ideally there should be only one notification for this type.
687
+ // If there are multiple notification then we will read data about only the last one
688
+ $setting = $this->notifier->read_settings( end( $notifications )->ID );
689
+
690
+ $message = $this->engine->handle_password_reset_shortcodes( $setting, $key, $user_login, $user_data );
691
+
692
+ if ( 'html' == $setting[ 'email-formatting' ] ) {
693
+ add_filter( 'wp_mail_content_type', array( $this, 'set_html_content_type' ) );
694
+ if ( 'true' !== $setting[ 'disable-autop' ] ) {
695
+ $message = wpautop( $message );
696
+ }
697
+ } else {
698
+ add_filter( 'wp_mail_content_type', array( $this, 'set_text_content_type' ) );
699
+ if ( 'text' == $setting[ 'email-formatting' ] ) {
700
+ $message = strip_tags( $message );
701
+ }
702
+ }
703
+ } else {
704
+ if ( $this->notifier->notification_exists( 'user-password', false ) ) {
705
+ // disabled notification exists, so disable the email by returning empty string.
706
+ return '';
707
+ }
708
+ }
709
+
710
+ return $message;
711
+ }
712
+
713
+ /**
714
+ * On Password reset.
715
+ *
716
+ * @param WP_User $user User who's password was changed.
717
+ */
718
+ public function on_password_reset( $user ) {
719
+ $notifications = $this->notifier->get_notifications( 'password-changed' );
720
+ foreach ( $notifications as $notification ) {
721
+ $this->engine->send_password_changed_email( $this->notifier->read_settings( $notification->ID ), $user );
722
+ }
723
+ }
724
+
725
+ /**
726
+ * Should the password changed email be sent?
727
+ *
728
+ * @param $send
729
+ * @param $user
730
+ * @param $userdata
731
+ *
732
+ * @return bool
733
+ */
734
+ public function should_password_changed_email_be_sent( $send, $user,
735
+ $userdata ) {
736
+ $bnfw = BNFW::factory();
737
+
738
+ if ( ! $send ) {
739
+ return $send;
740
+ }
741
+
742
+ return ! $bnfw->notifier->is_notification_disabled( 'password-changed' );
743
+ }
744
+
745
+ /**
746
+ * On Password Changed.
747
+ *
748
+ * @since 1.6
749
+ *
750
+ * @param array $email_data Email Data.
751
+ * @param array $user User data.
752
+ *
753
+ * @return array Modified Email Data
754
+ */
755
+ public function on_password_changed( $email_data, $user ) {
756
+ return $this->handle_filtered_data_notification( 'password-changed', $email_data, $user[ 'ID' ] );
757
+ }
758
+
759
+ /**
760
+ * Should the email changed email be sent?
761
+ *
762
+ * @param $send
763
+ * @param $user
764
+ * @param $userdata
765
+ *
766
+ * @return bool
767
+ */
768
+ public function should_email_changed_email_be_sent( $send, $user_old_data,
769
+ $user_new_data ) {
770
+ $bnfw = BNFW::factory();
771
+
772
+ if ( $bnfw->notifier->notification_exists( 'admin-email-changed', false ) ) {
773
+ $notifications = $bnfw->notifier->get_notifications( 'admin-email-changed' );
774
+
775
+ if ( count( $notifications ) > 0 ) {
776
+ // Ideally there should be only one notification for this type.
777
+ // If there are multiple notification then we will read data about only the last one
778
+ $setting = $bnfw->notifier->read_settings( end( $notifications )->ID );
779
+ $notification_disabled = apply_filters( 'bnfw_notification_disabled', ( 'true' === $setting[ 'disabled' ] ), $id, $setting );
780
+
781
+ if ( ! $notification_disabled ) {
782
+
783
+ $setting[ 'message' ] = str_replace( '[user_old_email]', $user_old_data[ 'user_email' ], $setting[ 'message' ] );
784
+ $setting[ 'message' ] = str_replace( '[user_new_email]', $user_new_data[ 'user_email' ], $setting[ 'message' ] );
785
+ $bnfw->engine->send_notification( $setting, $user_old_data[ 'ID' ] );
786
+ }
787
+ }
788
+ }
789
+
790
+ if ( ! $send ) {
791
+ return $send;
792
+ }
793
+
794
+ return ! $bnfw->notifier->is_notification_disabled( 'email-changed' );
795
+ }
796
+
797
+ /**
798
+ * On Email Changed.
799
+ *
800
+ * @since 1.6
801
+ *
802
+ * @param array $email_data Email Data.
803
+ * @param array $user User data.
804
+ *
805
+ * @return array Modified Email Data
806
+ */
807
+ public function on_email_changed( $email_data, $user_old_data,
808
+ $user_new_data ) {
809
+
810
+ $email = $this->handle_filtered_data_notification( 'email-changed', $email_data, $user_old_data[ 'ID' ] );
811
+ $email[ 'message' ] = str_replace( '[user_old_email]', $user_old_data[ 'user_email' ], $email[ 'message' ] );
812
+ $email[ 'message' ] = str_replace( '[user_new_email]', $user_new_data[ 'user_email' ], $email[ 'message' ] );
813
+ return $email;
814
+ }
815
+
816
+ public function on_email_changing( $email_text, $new_user_details ) {
817
+ $notification_name = 'email-changing';
818
+
819
+ $notifications = $this->notifier->get_notifications( $notification_name );
820
+ if ( count( $notifications ) > 0 ) {
821
+ // Ideally there should be only one notification for this type.
822
+ // If there are multiple notification then we will read data about only the last one
823
+ $setting = $this->notifier->read_settings( end( $notifications )->ID );
824
+
825
+ $email_text = $this->engine->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $new_user_details[ 'newemail' ] );
826
+ $email_text = $this->engine->handle_global_user_shortcodes( $email_text, $new_user_details[ 'newemail' ] );
827
+ $email_text = str_replace( '[email_change_confirmation_link]', esc_url( admin_url( 'profile.php?newuseremail=' . $new_user_details[ 'hash' ] ) ), $email_text );
828
+ }
829
+
830
+ return $email_text;
831
+ }
832
+
833
+ /**
834
+ * Send notification on core updated event.
835
+ *
836
+ * @since 1.6
837
+ *
838
+ * @param array $email_data Email Data.
839
+ * @param string $type The type of email being sent. Can be one of
840
+ * 'success', 'fail', 'manual', 'critical'.
841
+ * @param object $core_update The update offer that was attempted.
842
+ * @param mixed $result The result for the core update. Can be WP_Error.
843
+ *
844
+ * @return array Modified Email Data.
845
+ */
846
+ public function on_core_updated( $email_data, $type, $core_update, $result ) {
847
+ $notifications = $this->notifier->get_notifications( 'core-updated' );
848
+ if ( count( $notifications ) > 0 ) {
849
+ // Ideally there should be only one notification for this type.
850
+ // If there are multiple notification then we will read data about only the last one
851
+ $setting = $this->notifier->read_settings( end( $notifications )->ID );
852
+
853
+ $email_data = $this->engine->handle_core_updated_notification( $email_data, $setting, $type );
854
+ }
855
+
856
+ return $email_data;
857
+ }
858
+
859
+ /**
860
+ * Process User update notifications.
861
+ *
862
+ * @since 1.6
863
+ *
864
+ * @param string $notification_name Notification Name.
865
+ * @param array $email_data Email Data.
866
+ * @param string|int $extra_data User Id.
867
+ *
868
+ * @return array Modified Email Data.
869
+ */
870
+ private function handle_filtered_data_notification( $notification_name,
871
+ $email_data, $extra_data ) {
872
+ $notifications = $this->notifier->get_notifications( $notification_name );
873
+ if ( count( $notifications ) > 0 ) {
874
+ // Ideally there should be only one notification for this type.
875
+ // If there are multiple notification then we will read data about only the last one
876
+ $setting = $this->notifier->read_settings( end( $notifications )->ID );
877
+
878
+ $email_data = $this->engine->handle_filtered_data_notification( $email_data, $setting, $extra_data );
879
+ }
880
+
881
+ return $email_data;
882
+ }
883
+
884
+ /**
885
+ * Set the email formatting to HTML.
886
+ *
887
+ * @since 1.4
888
+ */
889
+ public function set_html_content_type() {
890
+ return 'text/html';
891
+ }
892
+
893
+ /**
894
+ * Set the email formatting to text.
895
+ *
896
+ * @since 1.4
897
+ */
898
+ public function set_text_content_type() {
899
+ return 'text/plain';
900
+ }
901
+
902
+ /**
903
+ * Send notification for new users.
904
+ *
905
+ * @since 1.0
906
+ * @param int $user_id
907
+ */
908
+ public function user_register( $user_id ) {
909
+ $this->send_notification( 'admin-user', $user_id );
910
+ }
911
+
912
+ /**
913
+ * Send notification for user when user login.
914
+ *
915
+ * @since 1.0
916
+ * @param string $user_name
917
+ * @param object $user_data User object.
918
+ */
919
+ public function user_login( $user_name, $user_data ) {
920
+ $user_id = $user_data->ID;
921
+ $notifications = $this->notifier->get_notifications( 'user-login' );
922
+
923
+ foreach ( $notifications as $notification ) {
924
+ $this->engine->send_user_login_email( $this->notifier->read_settings( $notification->ID ), get_userdata( $user_id ) );
925
+ }
926
+
927
+ $this->user_login_admin_notification( $user_id );
928
+ }
929
+
930
+ /**
931
+ * Send notification for admin when user login.
932
+ *
933
+ * @since 1.0
934
+ * @param int $user_id
935
+ */
936
+ public function user_login_admin_notification( $user_id ) {
937
+ $notifications = $this->notifier->get_notifications( 'admin-user-login' );
938
+
939
+ foreach ( $notifications as $notification ) {
940
+ $this->engine->send_user_login_email_for_admin( $this->notifier->read_settings( $notification->ID ), get_userdata( $user_id ) );
941
+ }
942
+ }
943
+
944
+ /**
945
+ * Send notification about new users to site admin.
946
+ *
947
+ * @since 1.7.1
948
+ *
949
+ * @param array $email_data Email details.
950
+ * @param WP_User $user User object.
951
+ * @param string $blogname Blog name.
952
+ *
953
+ * @return array Modified email details.
954
+ */
955
+ public function handle_user_registered_admin_email( $email_data, $user,
956
+ $blogname ) {
957
+ return $this->handle_filtered_data_notification( 'admin-user', $email_data, $user->ID );
958
+ }
959
+
960
+ /**
961
+ * New User - Post-registration Email
962
+ *
963
+ * @since 1.1
964
+ * @param int $user_id New user id
965
+ */
966
+ public function welcome_email( $user_id ) {
967
+ $notifications = $this->notifier->get_notifications( 'welcome-email' );
968
+ foreach ( $notifications as $notification ) {
969
+ $this->engine->send_registration_email( $this->notifier->read_settings( $notification->ID ), get_userdata( $user_id ) );
970
+ }
971
+ }
972
+
973
+ /**
974
+ * Send notification when a user role changes.
975
+ *
976
+ * @since 1.3.9
977
+ *
978
+ * @param int $user_id User ID
979
+ * @param string $new_role New User role
980
+ * @param array $old_roles Old User role
981
+ */
982
+ public function user_role_changed( $user_id, $new_role, $old_roles ) {
983
+ if ( ! empty( $old_roles ) ) {
984
+ $notifications = $this->notifier->get_notifications( 'user-role' );
985
+ foreach ( $notifications as $notification ) {
986
+
987
+ /**
988
+ * Trigger User Role Changed - For User notification.
989
+ *
990
+ * @since 1.6.5
991
+ */
992
+ if ( apply_filters( 'bnfw_trigger_user-role_notification', true, $notification, $new_role, $old_roles ) ) {
993
+ $this->engine->send_user_role_changed_email(
994
+ $this->notifier->read_settings( $notification->ID ),
995
+ $user_id,
996
+ $old_roles[ 0 ],
997
+ $new_role
998
+ );
999
+ }
1000
+ }
1001
+
1002
+ $notifications = $this->notifier->get_notifications( 'admin-role' );
1003
+ foreach ( $notifications as $notification ) {
1004
+
1005
+ /**
1006
+ * Trigger User Role Changed - For User notification.
1007
+ *
1008
+ * @since 1.6.5
1009
+ */
1010
+ if ( apply_filters( 'bnfw_trigger_admin-role_notification', true, $notification, $new_role, $old_roles ) ) {
1011
+ $setting = $this->notifier->read_settings( $notification->ID );
1012
+ $setting[ 'message' ] = $this->engine->handle_user_role_shortcodes( $setting[ 'message' ], $old_roles[ 0 ], $new_role );
1013
+ $setting[ 'subject' ] = $this->engine->handle_user_role_shortcodes( $setting[ 'subject' ], $old_roles[ 0 ], $new_role );
1014
+
1015
+ $this->engine->send_notification( $setting, $user_id );
1016
+ }
1017
+ }
1018
+ }
1019
+ }
1020
+
1021
+ /**
1022
+ * Send notification when a user role added through Members Plugin.
1023
+ *
1024
+ * @since 1.8.4
1025
+ *
1026
+ * @param int $user_id User ID
1027
+ * @param string $new_role New User role
1028
+ *
1029
+ */
1030
+ public function user_role_added_from_member_plugin($user_id, $new_role){
1031
+
1032
+ global $pagenow;
1033
+
1034
+ if($pagenow != 'users.php')
1035
+ return;
1036
+
1037
+ if(!$user_id)
1038
+ return;
1039
+
1040
+ $notifications = $this->notifier->get_notifications( 'user-role' );
1041
+
1042
+ foreach ( $notifications as $notification ) {
1043
+
1044
+ if ( apply_filters( 'bnfw_trigger_user-role_notification', true, $notification, $new_role, null ) ) {
1045
+ $this->engine->send_user_role_changed_email(
1046
+ $this->notifier->read_settings( $notification->ID ),
1047
+ $user_id,
1048
+ null,
1049
+ $new_role
1050
+ );
1051
+ }
1052
+ }
1053
+
1054
+ $notifications_admin = $this->notifier->get_notifications( 'admin-role' );
1055
+ foreach ( $notifications_admin as $notification ) {
1056
+ if ( apply_filters( 'bnfw_trigger_admin-role_notification', true, $notification, $new_role, null ) ) {
1057
+ $setting = $this->notifier->read_settings( $notification->ID );
1058
+ $setting[ 'message' ] = $this->engine->handle_user_role_shortcodes( $setting[ 'message' ], null, $new_role );
1059
+ $setting[ 'subject' ] = $this->engine->handle_user_role_shortcodes( $setting[ 'subject' ], null, $new_role );
1060
+
1061
+ $this->engine->send_notification( $setting, $user_id );
1062
+ }
1063
+ }
1064
+
1065
+ }
1066
+
1067
+ /**
1068
+ * Send notification when a user role removed through Members Plugin.
1069
+ *
1070
+ * @since 1.8.4
1071
+ *
1072
+ * @param int $user_id User ID
1073
+ * @param string $old_role New User role
1074
+ *
1075
+ */
1076
+ public function user_role_removed_from_member_plugin($user_id, $old_role){
1077
+ global $pagenow;
1078
+
1079
+ if($pagenow != 'users.php')
1080
+ return;
1081
+
1082
+ if(!$user_id)
1083
+ return;
1084
+
1085
+ $notifications = $this->notifier->get_notifications( 'user-role' );
1086
+
1087
+ foreach ( $notifications as $notification ) {
1088
+ if ( apply_filters( 'bnfw_trigger_user-role_notification', true, $notification, null, array($old_role) ) ) {
1089
+ $this->engine->send_user_role_changed_email(
1090
+ $this->notifier->read_settings( $notification->ID ),
1091
+ $user_id,
1092
+ $old_role,
1093
+ null
1094
+ );
1095
+ }
1096
+ }
1097
+
1098
+ $notifications_admin = $this->notifier->get_notifications( 'admin-role' );
1099
+ foreach ( $notifications_admin as $notification ) {
1100
+ if ( apply_filters( 'bnfw_trigger_admin-role_notification', true, $notification, null, array($old_role) ) ) {
1101
+ $setting = $this->notifier->read_settings( $notification->ID );
1102
+ $setting[ 'message' ] = $this->engine->handle_user_role_shortcodes( $setting[ 'message' ], $old_role, null );
1103
+ $setting[ 'subject' ] = $this->engine->handle_user_role_shortcodes( $setting[ 'subject' ], $old_role, null );
1104
+
1105
+
1106
+
1107
+ $this->engine->send_notification( $setting, $user_id );
1108
+ }
1109
+ }
1110
+
1111
+ }
1112
+
1113
+ /**
1114
+ * Send notification when a user role added support User Role Editor by Members Plugin.
1115
+ *
1116
+ * @since 1.3.9
1117
+ *
1118
+ * @param int $user_id User ID
1119
+ * @param string $new_role New User role
1120
+ * @param array $old_roles Old User role
1121
+ */
1122
+ public function user_role_added( $user_id, $old_user_data ) {
1123
+
1124
+ if ( isset( $_POST[ 'members_user_roles' ] ) && ! empty( $_POST[ 'members_user_roles' ] ) ) {
1125
+ // Get the current user roles.
1126
+ $old_roles = (array) $old_user_data->roles;
1127
+
1128
+ // Sanitize the posted roles.
1129
+ $new_roles = array_map( 'members_sanitize_role', $_POST[ 'members_user_roles' ] );
1130
+
1131
+ sort( $old_roles );
1132
+ sort( $new_roles );
1133
+ $old_roles_str = implode( '', $old_roles );
1134
+ $new_roles_str = implode( '', $new_roles );
1135
+ if ( ! empty( $old_roles ) && $old_roles_str !== $new_roles_str ) {
1136
+ $notifications = $this->notifier->get_notifications( 'user-role' );
1137
+ foreach ( $notifications as $notification ) {
1138
+
1139
+ /**
1140
+ * Trigger User Role Changed - For User notification.
1141
+ *
1142
+ * @since 1.6.5
1143
+ */
1144
+ if ( apply_filters( 'bnfw_trigger_user-role-added_notification', true, $notification, $new_roles, $old_roles ) ) {
1145
+ $this->engine->send_user_role_added_email(
1146
+ $this->notifier->read_settings( $notification->ID ),
1147
+ $user_id,
1148
+ $old_roles,
1149
+ $new_roles
1150
+ );
1151
+ }
1152
+ }
1153
+
1154
+ $notifications = $this->notifier->get_notifications( 'admin-role' );
1155
+ foreach ( $notifications as $notification ) {
1156
+
1157
+ /**
1158
+ * Trigger User Role Changed - For User notification.
1159
+ *
1160
+ * @since 1.6.5
1161
+ */
1162
+ if ( apply_filters( 'bnfw_trigger_user-role-added_notification', true, $notification, $new_roles, $old_roles ) ) {
1163
+ $setting = $this->notifier->read_settings( $notification->ID );
1164
+ $setting[ 'message' ] = $this->engine->handle_user_added_role_shortcodes( $setting[ 'message' ], $old_roles, $new_roles );
1165
+ $setting[ 'subject' ] = $this->engine->handle_user_added_role_shortcodes( $setting[ 'subject' ], $old_roles, $new_roles );
1166
+
1167
+ $this->engine->send_notification( $setting, $user_id );
1168
+ }
1169
+ }
1170
+ }
1171
+ }
1172
+ }
1173
+
1174
+ /**
1175
+ * Sanitizes a role name. This is a wrapper for the `sanitize_key()` WordPress function. Only
1176
+ * alphanumeric characters and underscores are allowed. Hyphens are also replaced with underscores.
1177
+ *
1178
+ * @since 1.0.0
1179
+ * @access public
1180
+ * @return int
1181
+ */
1182
+ function members_sanitize_role( $role ) {
1183
+
1184
+ $_role = strtolower( $role );
1185
+ $_role = preg_replace( '/[^a-z0-9_\-\s]/', '', $_role );
1186
+
1187
+ return apply_filters( 'members_sanitize_role', str_replace( ' ', '_', $_role ), $role );
1188
+ }
1189
+
1190
+ /**
1191
+ * Send notification based on type and ref id
1192
+ *
1193
+ * @since 1.0
1194
+ * @param string $type Notification type.
1195
+ * @param mixed $ref_id Reference data.
1196
+ */
1197
+ public function send_notification( $type, $ref_id, $include_disabled = true ) {
1198
+ $notifications = $this->notifier->get_notifications( $type , $include_disabled);
1199
+ foreach ( $notifications as $notification ) {
1200
+ $this->engine->send_notification( $this->notifier->read_settings( $notification->ID ), $ref_id );
1201
+ }
1202
+ }
1203
+
1204
+ /**
1205
+ * Send notification async based on type and ref id.
1206
+ *
1207
+ * @param string $type Notification type.
1208
+ * @param mixed $ref_id Reference data.
1209
+ */
1210
+ public function send_notification_async( $type, $ref_id ) {
1211
+ $notifications = $this->notifier->get_notifications( $type, false );
1212
+ foreach ( $notifications as $notification ) {
1213
+ $transient = get_transient( 'bnfw-async-notifications' );
1214
+ if ( ! is_array( $transient ) ) {
1215
+ $transient = array();
1216
+ }
1217
+
1218
+ $notification_data = array(
1219
+ 'ref_id' => $ref_id,
1220
+ 'notification_id' => $notification->ID,
1221
+ 'notification_type' => $type,
1222
+ );
1223
+
1224
+ if ( ! in_array( $notification_data, $transient ) ) {
1225
+ $transient[] = $notification_data;
1226
+ set_transient( 'bnfw-async-notifications', $transient, 600 );
1227
+ }
1228
+ }
1229
+ }
1230
+
1231
+ /**
1232
+ * Can send comment notification or not
1233
+ *
1234
+ * @since 1.0
1235
+ * @param unknown $comment
1236
+ * @return unknown
1237
+ */
1238
+ private function can_send_comment_notification( $comment ) {
1239
+ // Returns false if the comment is marked as spam AND admin has enabled suppression of spam
1240
+ $suppress_spam = get_option( 'bnfw_suppress_spam' );
1241
+ if ( '1' === $suppress_spam && ( 0 === strcmp( $comment->comment_approved, 'spam' ) ) ) {
1242
+ return false;
1243
+ }
1244
+ return true;
1245
+ }
1246
+
1247
+ /**
1248
+ * Handle user request email content.
1249
+ *
1250
+ * @param string $content Content.
1251
+ * @param array $email_data Email data.
1252
+ *
1253
+ * @return string Modified content.
1254
+ */
1255
+ public function handle_user_request_email_content( $content, $email_data ) {
1256
+ $field = 'message';
1257
+ $new_content = '';
1258
+
1259
+ switch ( $email_data[ 'description' ] ) {
1260
+ case 'Export Personal Data':
1261
+ $notification_name = 'ca-export-data';
1262
+ $new_content = $this->handle_user_request_notification( $notification_name, $field, $email_data );
1263
+ break;
1264
+ case 'Erase Personal Data':
1265
+ $notification_name = 'ca-erase-data';
1266
+ $new_content = $this->handle_user_request_notification( $notification_name, $field, $email_data );
1267
+ break;
1268
+ }
1269
+
1270
+ if ( ! empty( $new_content ) ) {
1271
+ return $new_content;
1272
+ } else {
1273
+ return $content;
1274
+ }
1275
+ }
1276
+
1277
+ /**
1278
+ * Handle user request email subject.
1279
+ *
1280
+ * @param string $subject Subject
1281
+ * @param string $blogname Blog name
1282
+ * @param array $email_data Email data.
1283
+ *
1284
+ * @return string Modified subject.
1285
+ */
1286
+ public function handle_user_request_email_subject( $subject, $blogname,
1287
+ $email_data ) {
1288
+ $field = 'subject';
1289
+ $new_subject = '';
1290
+
1291
+ switch ( $email_data[ 'description' ] ) {
1292
+ case 'Export Personal Data':
1293
+ $notification_name = 'ca-export-data';
1294
+ $new_subject = $this->handle_user_request_notification( $notification_name, $field, $email_data );
1295
+ break;
1296
+ case 'Erase Personal Data':
1297
+ $notification_name = 'ca-erase-data';
1298
+ $new_subject = $this->handle_user_request_notification( $notification_name, $field, $email_data );
1299
+ break;
1300
+ }
1301
+ if ( ! empty( $new_subject ) ) {
1302
+ return $new_subject;
1303
+ } else {
1304
+ return $subject;
1305
+ }
1306
+ }
1307
+
1308
+ /**
1309
+ * Handle user confirmed action email content.
1310
+ *
1311
+ * @param string $content Content.
1312
+ * @param array $email_data Email data.
1313
+ *
1314
+ * @return string Modified content.
1315
+ */
1316
+ public function handle_user_confirmed_action_email_content( $content,
1317
+ $email_data ) {
1318
+ $field = 'message';
1319
+ $new_content = '';
1320
+
1321
+ switch ( $email_data[ 'description' ] ) {
1322
+ case 'Export Personal Data':
1323
+ $notification_name = 'uc-export-data';
1324
+ $new_content = $this->handle_user_confirmed_action_notification( $notification_name, $field, $email_data );
1325
+ break;
1326
+ case 'Erase Personal Data':
1327
+ $notification_name = 'uc-erase-data';
1328
+ $new_content = $this->handle_user_confirmed_action_notification( $notification_name, $field, $email_data );
1329
+ break;
1330
+ }
1331
+
1332
+ if ( ! empty( $new_content ) ) {
1333
+ return $new_content;
1334
+ } else {
1335
+ return $content;
1336
+ }
1337
+ }
1338
+
1339
+ /**
1340
+ * Handle data exported email content.
1341
+ *
1342
+ * @param string $content Content.
1343
+ * @param int $request_id
1344
+ *
1345
+ * @return string Modified content.
1346
+ */
1347
+ public function handle_data_export_email_content( $content, $request_id,$email_data ) {
1348
+
1349
+ $field = 'message';
1350
+ $notification_name = 'data-export';
1351
+ $new_content = '';
1352
+
1353
+ $notifications = $this->notifier->get_notifications( $notification_name );
1354
+ if ( count( $notifications ) > 0 ) {
1355
+ // Ideally there should be only one notification for this type.
1356
+ // If there are multiple notification then we will read data about only the last one
1357
+ $setting = $this->notifier->read_settings( end( $notifications )->ID );
1358
+
1359
+ $new_content = $this->engine->handle_data_export_email_shortcodes( $setting[ $field ], $setting, $request_id );
1360
+ $new_content = $this->engine->handle_global_user_shortcodes( $new_content, $email_data['message_recipient'] );
1361
+ }
1362
+
1363
+ if ( ! empty( $new_content ) ) {
1364
+ return $new_content;
1365
+ } else {
1366
+ return $content;
1367
+ }
1368
+ }
1369
+
1370
+ public function handle_erasure_complete_email_subject( $subject, $sitename,
1371
+ $email_data ) {
1372
+ return $this->handle_erasure_complete_email_notification( 'subject', $subject, $email_data );
1373
+ }
1374
+
1375
+ public function handle_erasure_complete_email_content( $content, $email_data ) {
1376
+ if ( isset( $email_data[ 'privacy_policy_url' ] ) ) {
1377
+ return $this->handle_erasure_complete_email_notification( 'message', $content, $email_data );
1378
+ }
1379
+
1380
+ return $content;
1381
+ }
1382
+
1383
+ protected function handle_erasure_complete_email_notification( $field,
1384
+ $content,
1385
+ $email_data ) {
1386
+ $notification_name = 'data-erased';
1387
+ $new_content = '';
1388
+ $notifications = $this->notifier->get_notifications( $notification_name );
1389
+ if ( count( $notifications ) > 0 ) {
1390
+ // Ideally there should be only one notification for this type.
1391
+ // If there are multiple notification then we will read data about only the last one
1392
+ $setting = $this->notifier->read_settings( end( $notifications )->ID );
1393
+ $new_content = $this->engine->handle_shortcodes( $setting[ $field ], $notification_name, $email_data );
1394
+ }
1395
+ if ( ! empty( $new_content ) ) {
1396
+ return $new_content;
1397
+ } else {
1398
+ return $content;
1399
+ }
1400
+ }
1401
+
1402
+ /**
1403
+ * Send notification emails on shutdown.
1404
+ */
1405
+ public function on_shutdown() {
1406
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
1407
+ return;
1408
+ }
1409
+
1410
+ $transient = get_transient( 'bnfw-async-notifications' );
1411
+ if ( is_array( $transient ) ) {
1412
+ delete_transient( 'bnfw-async-notifications' );
1413
+ foreach ( $transient as $id_pairs ) {
1414
+ $this->engine->send_notification( $this->notifier->read_settings( $id_pairs[ 'notification_id' ] ), $id_pairs[ 'ref_id' ] );
1415
+ }
1416
+ }
1417
+ }
1418
+
1419
+ /**
1420
+ * Handle user request notification.
1421
+ *
1422
+ * @param string $notification_name Notification name.
1423
+ * @param string $field Field name.
1424
+ * @param array $email_data Email data.
1425
+ *
1426
+ * @return string Content.
1427
+ */
1428
+ protected function handle_user_request_notification( $notification_name,
1429
+ $field, $email_data ) {
1430
+ $notifications = $this->notifier->get_notifications( $notification_name );
1431
+ if ( count( $notifications ) > 0 ) {
1432
+ // Ideally there should be only one notification for this type.
1433
+ // If there are multiple notification then we will read data about only the last one
1434
+ $setting = $this->notifier->read_settings( end( $notifications )->ID );
1435
+
1436
+ return $this->engine->handle_user_request_email_shortcodes( $setting[ $field ], $setting, $email_data );
1437
+ }
1438
+
1439
+ return '';
1440
+ }
1441
+
1442
+ /**
1443
+ * Handle user confirmed action notification.
1444
+ *
1445
+ * @param string $notification_name Notification name.
1446
+ * @param string $field Field name.
1447
+ * @param array $email_data Email data.
1448
+ *
1449
+ * @return string Content.
1450
+ */
1451
+ protected function handle_user_confirmed_action_notification( $notification_name,
1452
+ $field,
1453
+ $email_data ) {
1454
+ $notifications = $this->notifier->get_notifications( $notification_name );
1455
+ if ( count( $notifications ) > 0 ) {
1456
+ // Ideally there should be only one notification for this type.
1457
+ // If there are multiple notification then we will read data about only the last one
1458
+ $setting = $this->notifier->read_settings( end( $notifications )->ID );
1459
+
1460
+ return $this->engine->handle_user_confirmed_action_email_shortcodes( $setting[ $field ], $setting, $email_data );
1461
+ }
1462
+
1463
+ return '';
1464
+ }
1465
+
1466
+ /**
1467
+ * Is this a metabox request?
1468
+ *
1469
+ * Block editor sends duplicate requests on post update.
1470
+ *
1471
+ * @return bool True if metabox request, False otherwise.
1472
+ */
1473
+ protected function is_metabox_request() {
1474
+ return ( isset( $_GET[ 'meta-box-loader' ] ) || isset( $_GET[ 'meta_box' ] ) );
1475
+ }
1476
+
1477
+
1478
+ /**
1479
+ * Check if Gutenberg is active.
1480
+ *
1481
+ *
1482
+ * @return bool
1483
+ * @since 1.3
1484
+ */
1485
+ public function is_gutenberg_active() {
1486
+ $gutenberg = false;
1487
+ $block_editor = false;
1488
+
1489
+ if ( has_filter( 'replace_editor', 'gutenberg_init' ) ) {
1490
+ // Gutenberg is installed and activated.
1491
+ $gutenberg = true;
1492
+ }
1493
+
1494
+ if ( version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' ) ) {
1495
+ // Block editor.
1496
+ $block_editor = true;
1497
+ }
1498
+
1499
+ if ( ! $gutenberg && ! $block_editor ) {
1500
+ return false;
1501
+ }
1502
+
1503
+ include_once ABSPATH . 'wp-admin/includes/plugin.php';
1504
+
1505
+ if ( ! is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
1506
+ return true;
1507
+ }
1508
+
1509
+ $use_block_editor = ( get_option( 'classic-editor-replace' ) === 'no-replace' );
1510
+
1511
+ return $use_block_editor;
1512
+ }
1513
+
1514
+ }
1515
+
1516
+ /* ------------------------------------------------------------------------ *
1517
+ * Fire up the plugin
1518
+ * ------------------------------------------------------------------------ */
1519
+ BNFW::factory();
includes/admin/bnfw-settings.php CHANGED
@@ -1,287 +1,287 @@
1
- <?php
2
- /**
3
- * Register the Admin pages and load the scripts action
4
- */
5
-
6
- /**
7
- * Sub-menu pages
8
- */
9
- function bnfw_admin_menu() {
10
-
11
- // New Notifications Sub-menu
12
- add_submenu_page(
13
- 'edit.php?post_type=bnfw_notification',
14
- esc_html__( 'Notification Settings', 'bnfw' ),
15
- esc_html__( 'Settings', 'bnfw' ),
16
- 'bnfw',
17
- 'bnfw-settings',
18
- 'bnfw_settings_page'
19
- );
20
- }
21
-
22
- // Add the Admin pages to the WordPress menu
23
- add_action( 'admin_menu', 'bnfw_admin_menu' );
24
- add_action( 'admin_menu', 'bnfw_menu_item_links', 12 );
25
- add_action( 'admin_head', 'bnfw_menu_item_link_targets' );
26
-
27
- /* ------------------------------------------------------------------------ *
28
- * Menu Pages
29
- * ------------------------------------------------------------------------ */
30
-
31
- /**
32
- * Settings Page
33
- */
34
- function bnfw_settings_page() {
35
- ob_start(); ?>
36
-
37
- <div class="wrap">
38
- <h2><?php esc_html_e( 'BNFW Settings', 'bnfw' ); ?></h2>
39
-
40
- <form method="post" action="options.php" class="bnfw-form">
41
- <?php
42
- settings_errors();
43
- settings_fields( 'bnfw-settings' );
44
- do_settings_sections( 'bnfw-settings' );
45
-
46
- submit_button( __( 'Save Settings', 'bnfw' ) );
47
- ?>
48
- </form>
49
- </div>
50
-
51
- <?php echo ob_get_clean();
52
- }
53
-
54
- /**
55
- * External Menu Item Links
56
- */
57
- function bnfw_menu_item_links() {
58
- global $submenu;
59
-
60
- if ( current_user_can( 'bnfw' ) ) {
61
- $doc_url = 'https://betternotificationsforwp.com/documentation/';
62
- $store_url = 'https://betternotificationsforwp.com/downloads/';
63
- $support_url = 'https://betternotificationsforwp.com/priority-support/';
64
-
65
- if ( bnfw_is_tracking_allowed() ) {
66
- $doc_url .= '?utm_source=WP%20Admin%20Submenu%20Item%20-%20"Documentation"&amp;utm_medium=referral';
67
- $store_url .= '?utm_source=WP%20Admin%20Submenu%20Item%20-%20"Add-on"&amp;utm_medium=referral';
68
- $support_url .= '?utm_source=WP%20Admin%20Submenu%20Item%20-%20"Priority%20Support"&amp;utm_medium=referral';
69
- }
70
-
71
- // Documentation Link
72
- $submenu['edit.php?post_type=bnfw_notification'][500] = array(
73
- '<div id="bnfw-menu-item-documentation" style="color: #73daeb;">' . __( 'Documentation', 'bnfw' ) . '</div>',
74
- 'bnfw',
75
- $doc_url,
76
- );
77
-
78
- // Add-ons Link
79
- $submenu['edit.php?post_type=bnfw_notification'][600] = array(
80
- '<div id="bnfw-menu-item-addons" style="color: #ff6f59;">' . __( 'Premium Add-ons', 'bnfw' ) . '</div>',
81
- 'bnfw',
82
- $store_url,
83
- );
84
-
85
- // Add-ons Link
86
- $submenu['edit.php?post_type=bnfw_notification'][700] = array(
87
- '<div id="bnfw-menu-item-support" style="color: #f00001;">' . __( 'Priority Support', 'bnfw' ) . '</div>',
88
- 'bnfw',
89
- $support_url,
90
- );
91
- }
92
- }
93
-
94
- function bnfw_menu_item_link_targets() {
95
- ?>
96
- <script type="text/javascript">
97
- jQuery( document ).ready( function ( $ ) {
98
- // Documentation Link
99
- $( '#bnfw-menu-item-documentation' ).parent().attr( 'target', '_blank' );
100
- $( '#bnfw-menu-item-documentation' ).hover( function () {
101
- $( this ).css( 'color', '#a0e6f1' );
102
- }, function () {
103
- $( this ).css( 'color', '#73daeb' );
104
- } );
105
-
106
- // Add-ons Link
107
- $( '#bnfw-menu-item-addons' ).parent().attr( 'target', '_blank' );
108
- $( '#bnfw-menu-item-addons' ).hover( function () {
109
- $( this ).css( 'color', '#ff9b8c' );
110
- }, function () {
111
- $( this ).css( 'color', '#ff6f59' );
112
- } );
113
-
114
- // Priority Support Link
115
- $( '#bnfw-menu-item-support' ).parent().attr( 'target', '_blank' );
116
- $( '#bnfw-menu-item-support' ).hover( function () {
117
- $( this ).css( 'color', '#ff3536' );
118
- }, function () {
119
- $( this ).css( 'color', '#f00001' );
120
- } );
121
- } );
122
- </script>
123
- <?php }
124
-
125
- /* ------------------------------------------------------------------------ *
126
- * Settings Page - Setting Registration
127
- * ------------------------------------------------------------------------ */
128
-
129
- /**
130
- *
131
- */
132
- function bnfw_general_options() {
133
- // Set-up - General Options Section
134
- add_settings_section(
135
- 'bnfw_general_options_section', // Section ID
136
- '', // Title above settings section
137
- 'bnfw_general_options_callback', // Name of function that renders a description of the settings section
138
- 'bnfw-settings' // Page to show on
139
- );
140
-
141
- // Register - Suppress SPAM Checkbox
142
- register_setting(
143
- 'bnfw-settings',
144
- 'bnfw_suppress_spam'
145
- );
146
-
147
- // Suppress notifications for SPAM comments
148
- add_settings_field(
149
- 'bnfw_suppress_spam', // Field ID
150
- esc_html__( 'Suppress SPAM comment notification', 'bnfw' ) . '<div class="bnfw-help-tip"><p>' . esc_html__( 'Comments that are correctly marked as SPAM by a 3rd party plugin (such as Akismet) will not generate a notification if this is ticked.', 'bnfw' ) . '</p></div>', // Label to the left
151
- 'bnfw_suppress_spam_checkbox', // Name of function that renders options on the page
152
- 'bnfw-settings', // Page to show on
153
- 'bnfw_general_options_section', // Associate with which settings section?
154
- array(
155
- esc_html__( 'Don\'t send notifications for comments marked as SPAM', 'bnfw' )
156
- )
157
- );
158
-
159
- // Register - Email Format setting
160
- register_setting(
161
- 'bnfw-settings',
162
- 'bnfw_email_format'
163
- );
164
-
165
- add_settings_field(
166
- 'bnfw_email_format', // Field ID
167
- esc_html__( 'Default Email Format', 'bnfw' ) . '<div class="bnfw-help-tip"><p>' . esc_html__( 'This will apply to all emails sent out via WordPress, even those from other plugins. For more details, please see the ', 'bnfw' ) . '<a href="https://wordpress.org/plugins/bnfw/faq/" target="_blank">FAQ</a>.</p></div>', // Label to the left
168
- 'bnfw_email_format_radio', // Name of function that renders options on the page
169
- 'bnfw-settings', // Page to show on
170
- 'bnfw_general_options_section' // Associate with which settings section?
171
- );
172
-
173
- // Register - Email Format setting
174
- register_setting(
175
- 'bnfw-settings',
176
- 'bnfw_enable_shortcodes'
177
- );
178
-
179
- add_settings_field(
180
- 'bnfw_enable_shortcodes', // Field ID
181
- esc_html__( 'Enable Content Shortcodes?', 'bnfw' ) . '<div class="bnfw-help-tip"><p>' . esc_html__( 'Shortcodes in the post/page content are disabled by default.', 'bnfw' ) . '</p></div>', // Label to the left
182
- 'bnfw_enable_shortcodes_checkbox', // Name of function that renders options on the page
183
- 'bnfw-settings', // Page to show on
184
- 'bnfw_general_options_section', // Associate with which settings section?
185
- array(
186
- esc_html__( 'Enable shortcode output in the page/post content', 'bnfw' ),
187
- )
188
- );
189
-
190
- // Register - Allow tracking setting
191
- register_setting(
192
- 'bnfw-settings',
193
- 'bnfw_allow_tracking'
194
- );
195
-
196
- add_settings_field(
197
- 'bnfw_allow_tracking', // Field ID
198
- esc_html__( 'Allow Usage Tracking?', 'bnfw' ), // Label to the left
199
- 'bnfw_render_allow_tracking', // Name of function that renders options on the page
200
- 'bnfw-settings', // Page to show on
201
- 'bnfw_general_options_section', // Associate with which settings section?
202
- array(
203
- esc_html__( 'Allow Better Notifications for WP to anonymously track how this plugin is used and help make the plugin better.', 'bnfw' )
204
- )
205
- );
206
- }
207
-
208
- add_action( 'admin_init', 'bnfw_general_options', 10 );
209
-
210
- /* ------------------------------------------------------------------------ *
211
- * Settings Page - Settings Section Callbacks
212
- * ------------------------------------------------------------------------ */
213
-
214
- /**
215
- *
216
- */
217
- function bnfw_general_options_callback() {
218
- }
219
-
220
- /* ------------------------------------------------------------------------ *
221
- * Settings Page - Settings Field Callbacks
222
- * ------------------------------------------------------------------------ */
223
-
224
- /**
225
- * Suppress SPAM checkbox.
226
- *
227
- * @since 1.0
228
- *
229
- * @param $args
230
- */
231
- function bnfw_suppress_spam_checkbox( $args ) {
232
- ?>
233
- <input type="checkbox" id="bnfw_suppress_spam" name="bnfw_suppress_spam"
234
- value="1" <?php checked( 1, get_option( 'bnfw_suppress_spam' ), true ); ?>>
235
- <label for="bnfw_suppress_spam"><?php echo esc_html( $args[0] ); ?></label>
236
- <?php
237
- }
238
-
239
- /**
240
- * Show email format radio
241
- *
242
- * @since 1.4
243
- *
244
- * @param array $args
245
- */
246
- function bnfw_email_format_radio( $args ) {
247
- $email_format = get_option( 'bnfw_email_format', 'html' );
248
- ?>
249
- <label>
250
- <input type="radio" value="html"
251
- name="bnfw_email_format" <?php checked( $email_format, 'html', true ); ?>><?php esc_html_e( 'HTML Formatting', 'bnfw' ); ?>
252
- </label>
253
- <br/>
254
- <label>
255
- <input type="radio" value="text"
256
- name="bnfw_email_format" <?php checked( $email_format, 'text', true ); ?>><?php esc_html_e( 'Plain Text', 'bnfw' ); ?>
257
- </label>
258
- <?php
259
- }
260
-
261
- /**
262
- * Render allow tracking checkbox.
263
- *
264
- * @since 1.6
265
- *
266
- * @param array $args
267
- */
268
- function bnfw_render_allow_tracking( $args ) {
269
- ?>
270
- <input type="checkbox" id="bnfw_allow_tracking" name="bnfw_allow_tracking"
271
- value="on" <?php checked( 'on', get_option( 'bnfw_allow_tracking' ), true ); ?>>
272
- <label for="bnfw_allow_tracking"><?php echo esc_html( $args[0] ); ?></label>
273
- <?php
274
- }
275
-
276
- /**
277
- * Render Enable shortcode checkbox.
278
- *
279
- * @param array $args
280
- */
281
- function bnfw_enable_shortcodes_checkbox( $args ) {
282
- ?>
283
- <input type="checkbox" id="bnfw_enable_shortcodes" name="bnfw_enable_shortcodes"
284
- value="1" <?php checked( 1, get_option( 'bnfw_enable_shortcodes' ), true ); ?>>
285
- <label for="bnfw_enable_shortcodes"><?php echo esc_html( $args[0] ); ?></label>
286
- <?php
287
- }
1
+ <?php
2
+ /**
3
+ * Register the Admin pages and load the scripts action
4
+ */
5
+
6
+ /**
7
+ * Sub-menu pages
8
+ */
9
+ function bnfw_admin_menu() {
10
+
11
+ // New Notifications Sub-menu
12
+ add_submenu_page(
13
+ 'edit.php?post_type=bnfw_notification',
14
+ esc_html__( 'Notification Settings', 'bnfw' ),
15
+ esc_html__( 'Settings', 'bnfw' ),
16
+ 'bnfw',
17
+ 'bnfw-settings',
18
+ 'bnfw_settings_page'
19
+ );
20
+ }
21
+
22
+ // Add the Admin pages to the WordPress menu
23
+ add_action( 'admin_menu', 'bnfw_admin_menu' );
24
+ add_action( 'admin_menu', 'bnfw_menu_item_links', 12 );
25
+ add_action( 'admin_head', 'bnfw_menu_item_link_targets' );
26
+
27
+ /* ------------------------------------------------------------------------ *
28
+ * Menu Pages
29
+ * ------------------------------------------------------------------------ */
30
+
31
+ /**
32
+ * Settings Page
33
+ */
34
+ function bnfw_settings_page() {
35
+ ob_start(); ?>
36
+
37
+ <div class="wrap">
38
+ <h2><?php esc_html_e( 'BNFW Settings', 'bnfw' ); ?></h2>
39
+
40
+ <form method="post" action="options.php" class="bnfw-form">
41
+ <?php
42
+ settings_errors();
43
+ settings_fields( 'bnfw-settings' );
44
+ do_settings_sections( 'bnfw-settings' );
45
+
46
+ submit_button( __( 'Save Settings', 'bnfw' ) );
47
+ ?>
48
+ </form>
49
+ </div>
50
+
51
+ <?php echo ob_get_clean();
52
+ }
53
+
54
+ /**
55
+ * External Menu Item Links
56
+ */
57
+ function bnfw_menu_item_links() {
58
+ global $submenu;
59
+
60
+ if ( current_user_can( 'bnfw' ) ) {
61
+ $doc_url = 'https://betternotificationsforwp.com/documentation/';
62
+ $store_url = 'https://betternotificationsforwp.com/downloads/';
63
+ $support_url = 'https://betternotificationsforwp.com/priority-support/';
64
+
65
+ if ( bnfw_is_tracking_allowed() ) {
66
+ $doc_url .= '?utm_source=WP%20Admin%20Submenu%20Item%20-%20"Documentation"&amp;utm_medium=referral';
67
+ $store_url .= '?utm_source=WP%20Admin%20Submenu%20Item%20-%20"Add-on"&amp;utm_medium=referral';
68
+ $support_url .= '?utm_source=WP%20Admin%20Submenu%20Item%20-%20"Priority%20Support"&amp;utm_medium=referral';
69
+ }
70
+
71
+ // Documentation Link
72
+ $submenu['edit.php?post_type=bnfw_notification'][500] = array(
73
+ '<div id="bnfw-menu-item-documentation" style="color: #73daeb;">' . __( 'Documentation', 'bnfw' ) . '</div>',
74
+ 'bnfw',
75
+ $doc_url,
76
+ );
77
+
78
+ // Add-ons Link
79
+ $submenu['edit.php?post_type=bnfw_notification'][600] = array(
80
+ '<div id="bnfw-menu-item-addons" style="color: #ff6f59;">' . __( 'Premium Add-ons', 'bnfw' ) . '</div>',
81
+ 'bnfw',
82
+ $store_url,
83
+ );
84
+
85
+ // Add-ons Link
86
+ $submenu['edit.php?post_type=bnfw_notification'][700] = array(
87
+ '<div id="bnfw-menu-item-support" style="color: #f00001;">' . __( 'Priority Support', 'bnfw' ) . '</div>',
88
+ 'bnfw',
89
+ $support_url,
90
+ );
91
+ }
92
+ }
93
+
94
+ function bnfw_menu_item_link_targets() {
95
+ ?>
96
+ <script type="text/javascript">
97
+ jQuery( document ).ready( function ( $ ) {
98
+ // Documentation Link
99
+ $( '#bnfw-menu-item-documentation' ).parent().attr( 'target', '_blank' );
100
+ $( '#bnfw-menu-item-documentation' ).hover( function () {
101
+ $( this ).css( 'color', '#a0e6f1' );
102
+ }, function () {
103
+ $( this ).css( 'color', '#73daeb' );
104
+ } );
105
+
106
+ // Add-ons Link
107
+ $( '#bnfw-menu-item-addons' ).parent().attr( 'target', '_blank' );
108
+ $( '#bnfw-menu-item-addons' ).hover( function () {
109
+ $( this ).css( 'color', '#ff9b8c' );
110
+ }, function () {
111
+ $( this ).css( 'color', '#ff6f59' );
112
+ } );
113
+
114
+ // Priority Support Link
115
+ $( '#bnfw-menu-item-support' ).parent().attr( 'target', '_blank' );
116
+ $( '#bnfw-menu-item-support' ).hover( function () {
117
+ $( this ).css( 'color', '#ff3536' );
118
+ }, function () {
119
+ $( this ).css( 'color', '#f00001' );
120
+ } );
121
+ } );
122
+ </script>
123
+ <?php }
124
+
125
+ /* ------------------------------------------------------------------------ *
126
+ * Settings Page - Setting Registration
127
+ * ------------------------------------------------------------------------ */
128
+
129
+ /**
130
+ *
131
+ */
132
+ function bnfw_general_options() {
133
+ // Set-up - General Options Section
134
+ add_settings_section(
135
+ 'bnfw_general_options_section', // Section ID
136
+ '', // Title above settings section
137
+ 'bnfw_general_options_callback', // Name of function that renders a description of the settings section
138
+ 'bnfw-settings' // Page to show on
139
+ );
140
+
141
+ // Register - Suppress SPAM Checkbox
142
+ register_setting(
143
+ 'bnfw-settings',
144
+ 'bnfw_suppress_spam'
145
+ );
146
+
147
+ // Suppress notifications for SPAM comments
148
+ add_settings_field(
149
+ 'bnfw_suppress_spam', // Field ID
150
+ esc_html__( 'Suppress SPAM comment notification', 'bnfw' ) . '<div class="bnfw-help-tip"><p>' . esc_html__( 'Comments that are correctly marked as SPAM by a 3rd party plugin (such as Akismet) will not generate a notification if this is ticked.', 'bnfw' ) . '</p></div>', // Label to the left
151
+ 'bnfw_suppress_spam_checkbox', // Name of function that renders options on the page
152
+ 'bnfw-settings', // Page to show on
153
+ 'bnfw_general_options_section', // Associate with which settings section?
154
+ array(
155
+ esc_html__( 'Don\'t send notifications for comments marked as SPAM', 'bnfw' )
156
+ )
157
+ );
158
+
159
+ // Register - Email Format setting
160
+ register_setting(
161
+ 'bnfw-settings',
162
+ 'bnfw_email_format'
163
+ );
164
+
165
+ add_settings_field(
166
+ 'bnfw_email_format', // Field ID
167
+ esc_html__( 'Default Email Format', 'bnfw' ) . '<div class="bnfw-help-tip"><p>' . esc_html__( 'This will apply to all emails sent out via WordPress, even those from other plugins. For more details, please see the ', 'bnfw' ) . '<a href="https://wordpress.org/plugins/bnfw/faq/" target="_blank">FAQ</a>.</p></div>', // Label to the left
168
+ 'bnfw_email_format_radio', // Name of function that renders options on the page
169
+ 'bnfw-settings', // Page to show on
170
+ 'bnfw_general_options_section' // Associate with which settings section?
171
+ );
172
+
173
+ // Register - Email Format setting
174
+ register_setting(
175
+ 'bnfw-settings',
176
+ 'bnfw_enable_shortcodes'
177
+ );
178
+
179
+ add_settings_field(
180
+ 'bnfw_enable_shortcodes', // Field ID
181
+ esc_html__( 'Enable Content Shortcodes?', 'bnfw' ) . '<div class="bnfw-help-tip"><p>' . esc_html__( 'Shortcodes in the post/page content are disabled by default.', 'bnfw' ) . '</p></div>', // Label to the left
182
+ 'bnfw_enable_shortcodes_checkbox', // Name of function that renders options on the page
183
+ 'bnfw-settings', // Page to show on
184
+ 'bnfw_general_options_section', // Associate with which settings section?
185
+ array(
186
+ esc_html__( 'Enable shortcode output in the page/post content', 'bnfw' ),
187
+ )
188
+ );
189
+
190
+ // Register - Allow tracking setting
191
+ register_setting(
192
+ 'bnfw-settings',
193
+ 'bnfw_allow_tracking'
194
+ );
195
+
196
+ add_settings_field(
197
+ 'bnfw_allow_tracking', // Field ID
198
+ esc_html__( 'Allow Usage Tracking?', 'bnfw' ), // Label to the left
199
+ 'bnfw_render_allow_tracking', // Name of function that renders options on the page
200
+ 'bnfw-settings', // Page to show on
201
+ 'bnfw_general_options_section', // Associate with which settings section?
202
+ array(
203
+ esc_html__( 'Allow Better Notifications for WP to anonymously track how this plugin is used and help make the plugin better.', 'bnfw' )
204
+ )
205
+ );
206
+ }
207
+
208
+ add_action( 'admin_init', 'bnfw_general_options', 10 );
209
+
210
+ /* ------------------------------------------------------------------------ *
211
+ * Settings Page - Settings Section Callbacks
212
+ * ------------------------------------------------------------------------ */
213
+
214
+ /**
215
+ *
216
+ */
217
+ function bnfw_general_options_callback() {
218
+ }
219
+
220
+ /* ------------------------------------------------------------------------ *
221
+ * Settings Page - Settings Field Callbacks
222
+ * ------------------------------------------------------------------------ */
223
+
224
+ /**
225
+ * Suppress SPAM checkbox.
226
+ *
227
+ * @since 1.0
228
+ *
229
+ * @param $args
230
+ */
231
+ function bnfw_suppress_spam_checkbox( $args ) {
232
+ ?>
233
+ <input type="checkbox" id="bnfw_suppress_spam" name="bnfw_suppress_spam"
234
+ value="1" <?php checked( 1, get_option( 'bnfw_suppress_spam' ), true ); ?>>
235
+ <label for="bnfw_suppress_spam"><?php echo esc_html( $args[0] ); ?></label>
236
+ <?php
237
+ }
238
+
239
+ /**
240
+ * Show email format radio
241
+ *
242
+ * @since 1.4
243
+ *
244
+ * @param array $args
245
+ */
246
+ function bnfw_email_format_radio( $args ) {
247
+ $email_format = get_option( 'bnfw_email_format', 'html' );
248
+ ?>
249
+ <label>
250
+ <input type="radio" value="html"
251
+ name="bnfw_email_format" <?php checked( $email_format, 'html', true ); ?>><?php esc_html_e( 'HTML Formatting', 'bnfw' ); ?>
252
+ </label>
253
+ <br/>
254
+ <label>
255
+ <input type="radio" value="text"
256
+ name="bnfw_email_format" <?php checked( $email_format, 'text', true ); ?>><?php esc_html_e( 'Plain Text', 'bnfw' ); ?>
257
+ </label>
258
+ <?php
259
+ }
260
+
261
+ /**
262
+ * Render allow tracking checkbox.
263
+ *
264
+ * @since 1.6
265
+ *
266
+ * @param array $args
267
+ */
268
+ function bnfw_render_allow_tracking( $args ) {
269
+ ?>
270
+ <input type="checkbox" id="bnfw_allow_tracking" name="bnfw_allow_tracking"
271
+ value="on" <?php checked( 'on', get_option( 'bnfw_allow_tracking' ), true ); ?>>
272
+ <label for="bnfw_allow_tracking"><?php echo esc_html( $args[0] ); ?></label>
273
+ <?php
274
+ }
275
+
276
+ /**
277
+ * Render Enable shortcode checkbox.
278
+ *
279
+ * @param array $args
280
+ */
281
+ function bnfw_enable_shortcodes_checkbox( $args ) {
282
+ ?>
283
+ <input type="checkbox" id="bnfw_enable_shortcodes" name="bnfw_enable_shortcodes"
284
+ value="1" <?php checked( 1, get_option( 'bnfw_enable_shortcodes' ), true ); ?>>
285
+ <label for="bnfw_enable_shortcodes"><?php echo esc_html( $args[0] ); ?></label>
286
+ <?php
287
+ }
includes/admin/class-bnfw-notification.php CHANGED
@@ -1,1650 +1,1651 @@
1
- <?php
2
-
3
- /**
4
- * BNFW Notification.
5
- *
6
- * @since 1.0
7
- */
8
- class BNFW_Notification {
9
-
10
- const POST_TYPE = 'bnfw_notification';
11
- const META_KEY_PREFIX = 'bnfw_';
12
- const TEST_MAIL_ARG = 'test-mail';
13
-
14
- /**
15
- *
16
- */
17
- public function __construct() {
18
- add_action( 'init', array( $this, 'register_post_type' ) );
19
- add_action( 'do_meta_boxes', array( $this, 'remove_meta_boxes' ) );
20
- add_action( 'add_meta_boxes_' . self::POST_TYPE, array( $this, 'add_meta_boxes' ) );
21
- add_action( 'save_post', array( $this, 'save_meta_data' ) );
22
- add_action( 'edit_form_top', array( $this, 'admin_notices' ) );
23
- add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
24
-
25
- add_filter( 'use_block_editor_for_post_type', array( $this, 'disable_gutenberg_for_notification' ), 10, 2 );
26
-
27
- add_filter( 'bulk_actions-edit-bnfw_notification', array( $this, 'add_custom_edit_action' ) );
28
- add_filter( 'handle_bulk_actions-edit-bnfw_notification', array( $this, 'handle_custom_edit_action' ), 10, 3 );
29
-
30
- // Custom row actions.
31
- add_filter( 'post_row_actions', array( $this, 'custom_row_actions' ), 10, 2 );
32
- add_action( 'admin_init', array( $this, 'handle_actions' ) );
33
-
34
- // Custom columns
35
- add_filter( sprintf( 'manage_%s_posts_columns', self::POST_TYPE ), array( $this, 'columns_header' ) );
36
- add_action( sprintf( 'manage_%s_posts_custom_column', self::POST_TYPE ), array( $this, 'custom_column_row' ), 10, 2 );
37
-
38
- // Enqueue scripts/styles and disables autosave for this post type.
39
- add_action( 'admin_enqueue_scripts', array( $this, 'is_assets_needed' ) );
40
-
41
- add_action( 'admin_notices', array( $this, 'show_help_notice' ) );
42
-
43
- add_action('admin_print_scripts',array($this,'gutenberg_flag'));
44
- }
45
-
46
- /**
47
- * Flag variable to check if gutenberge is active
48
- * added fix for gutenberge
49
- *
50
- * @since 1.3
51
- */
52
- public function gutenberg_flag(){
53
- $bnfw = BNFW::Factory();
54
- ?>
55
- <script type="text/javascript">
56
- var bnfw_gutenberge_is_active = <?php echo ($bnfw->is_gutenberg_active())? 'true;' : 'false;'; ?>
57
- </script>
58
- <?php
59
- }
60
-
61
-
62
- /**
63
- * Register bnfw_notification custom post type.
64
- *
65
- * @since 1.0
66
- */
67
- public function register_post_type() {
68
- register_post_type( self::POST_TYPE, array(
69
- 'labels' => array(
70
- 'name' => esc_html__( 'Notifications', 'bnfw' ),
71
- 'singular_name' => esc_html__( 'Notification', 'bnfw' ),
72
- 'add_new' => esc_html__( 'Add New', 'bnfw' ),
73
- 'menu_name' => esc_html__( 'Notifications', 'bnfw' ),
74
- 'name_admin_bar' => esc_html__( 'Notifications', 'bnfw' ),
75
- 'add_new_item' => esc_html__( 'Add New Notification', 'bnfw' ),
76
- 'edit_item' => esc_html__( 'Edit Notification', 'bnfw' ),
77
- 'new_item' => esc_html__( 'New Notification', 'bnfw' ),
78
- 'view_item' => esc_html__( 'View Notification', 'bnfw' ),
79
- 'search_items' => esc_html__( 'Search Notifications', 'bnfw' ),
80
- 'not_found' => esc_html__( 'No Notifications found', 'bnfw' ),
81
- 'not_found_in_trash' => esc_html__( 'No Notifications found in trash', 'bnfw' ),
82
- 'all_items' => esc_html__( 'All Notifications', 'bnfw' ),
83
- ),
84
- 'public' => false,
85
- 'show_in_nav_menus' => true,
86
- 'show_in_admin_bar' => true,
87
- 'has_archive' => false,
88
- 'show_ui' => true,
89
- 'show_in_menu' => true,
90
- 'menu_icon' => 'dashicons-email-alt',
91
- 'menu_position' => 101,
92
- 'rewrite' => false,
93
- 'map_meta_cap' => false,
94
- 'capabilities' => array(
95
-
96
- // meta caps (don't assign these to roles)
97
- 'edit_post' => 'bnfw',
98
- 'read_post' => 'bnfw',
99
- 'delete_post' => 'bnfw',
100
-
101
- // primitive/meta caps
102
- 'create_posts' => 'bnfw',
103
-
104
- // primitive caps used outside of map_meta_cap()
105
- 'edit_posts' => 'bnfw',
106
- 'edit_others_posts' => 'bnfw',
107
- 'publish_posts' => 'bnfw',
108
- 'read_private_posts' => 'bnfw',
109
-
110
- // primitive caps used inside of map_meta_cap()
111
- 'read' => 'bnfw',
112
- 'delete_posts' => 'bnfw',
113
- 'delete_private_posts' => 'bnfw',
114
- 'delete_published_posts' => 'bnfw',
115
- 'delete_others_posts' => 'bnfw',
116
- 'edit_private_posts' => 'bnfw',
117
- 'edit_published_posts' => 'bnfw',
118
- ),
119
-
120
- // What features the post type supports.
121
- 'supports' => array(
122
- 'title',
123
- ),
124
- ) );
125
- }
126
-
127
- /**
128
- * Remove unwanted meta boxes.
129
- *
130
- * @since 1.0
131
- */
132
- public function remove_meta_boxes() {
133
- remove_meta_box( 'submitdiv', self::POST_TYPE, 'side' );
134
- remove_meta_box( 'slugdiv', self::POST_TYPE, 'normal' );
135
- }
136
-
137
- /**
138
- * Add meta box to the post editor screen.
139
- *
140
- * @since 1.0
141
- */
142
- public function add_meta_boxes() {
143
- global $post;
144
-
145
- add_meta_box(
146
- 'bnfw-post-notification', // Unique ID
147
- esc_html__( 'Notification Settings', 'bnfw' ), // Title
148
- array( $this, 'render_settings_meta_box' ), // Callback function
149
- self::POST_TYPE, // Admin page (or post type)
150
- 'normal', // Context
151
- 'default'
152
- );
153
-
154
- add_meta_box(
155
- 'bnfw_submitdiv',
156
- __( 'Save Notification', 'bnfw' ),
157
- array( $this, 'render_submitdiv' ),
158
- self::POST_TYPE,
159
- 'side',
160
- 'core'
161
- );
162
-
163
- if ( self::POST_TYPE !== get_post_type( $post ) ) {
164
- return;
165
- }
166
-
167
- do_action( 'bnfw_after_metaboxes', $this->read_settings( $post->ID ) );
168
- }
169
-
170
- /**
171
- * Disable Gutenberg for notifications.
172
- *
173
- * @param bool $is_enabled Is Gutenberg enabled?
174
- * @param string $post_type Post Type.
175
- *
176
- * @return bool Should Gutenberg be enabled?
177
- */
178
- public function disable_gutenberg_for_notification( $is_enabled, $post_type ) {
179
- if ( self::POST_TYPE === $post_type ) {
180
- return false;
181
- }
182
-
183
- return $is_enabled;
184
- }
185
-
186
- /**
187
- * Render the settings meta box.
188
- *
189
- * @since 1.0
190
- *
191
- * @param WP_Post $post
192
- */
193
- public function render_settings_meta_box( $post ) {
194
- global $wp_version;
195
-
196
- wp_nonce_field( self::POST_TYPE, self::POST_TYPE . '_nonce' );
197
-
198
- $setting = $this->read_settings( $post->ID );
199
- ?>
200
- <table class="form-table">
201
- <tbody>
202
- <tr valign="top">
203
- <th scope="row">
204
- <label for="notification"><?php esc_html_e( 'Notification For', 'bnfw' ); ?></label>
205
- <div class="bnfw-help-tip"><p><?php esc_html_e( 'E.g. If you select "New Post Published" from the list on the right, this notification will be sent when a new post is published.', 'bnfw' ); ?></p></div>
206
- </th>
207
- <td>
208
- <select name="notification" id="notification" class="select2"
209
- data-placeholder="<?php _e( 'Select the notification type', 'bnfw' ); ?>" style="width:75%">
210
- <optgroup label="<?php _e( 'Admin', 'bnfw' ); ?>">
211
- <option
212
- value="admin-user" <?php selected( 'admin-user', $setting['notification'] ); ?>><?php esc_html_e( 'New User Registration - For Admin', 'bnfw' ); ?></option>
213
- <option
214
- value="admin-password" <?php selected( 'admin-password', $setting['notification'] ); ?>><?php esc_html_e( 'User Lost Password - For Admin', 'bnfw' ); ?></option>
215
- <option
216
- value="admin-password-changed" <?php selected( 'admin-password-changed', $setting['notification'] ); ?>><?php esc_html_e( 'Password Changed - For Admin', 'bnfw' ); ?></option>
217
- <option
218
- value="admin-email-changed" <?php selected( 'admin-email-changed', $setting['notification'] ); ?>><?php esc_html_e( 'User Email Changed - For Admin', 'bnfw' ); ?></option>
219
- <option
220
- value="admin-role" <?php selected( 'admin-role', $setting['notification'] ); ?>><?php esc_html_e( 'User Role Changed - For Admin', 'bnfw' ); ?></option>
221
- <option
222
- value="admin-user-login" <?php selected( 'admin-user-login', $setting['notification'] ); ?>><?php esc_html_e( 'User Logged In - For Admin', 'bnfw' ); ?></option>
223
- <option
224
- value="core-updated" <?php selected( 'core-updated', $setting['notification'] ); ?>><?php esc_html_e( 'WordPress Core Automatic Background Updates', 'bnfw' ); ?></option>
225
-
226
- <?php if ( version_compare( $wp_version, '4.9.6' ) >= 0 ) : ?>
227
- <option value="uc-export-data" <?php selected( 'uc-export-data', $setting['notification'] ); ?>>
228
- <?php esc_html_e( 'Privacy - Confirm Action: Export Data Request - For Admin', 'bnfw' ); ?>
229
- </option>
230
-
231
- <option value="uc-erase-data" <?php selected( 'uc-erase-data', $setting['notification'] ); ?>>
232
- <?php esc_html_e( 'Privacy - Confirm Action: Erase Data Request - For Admin', 'bnfw' ); ?>
233
- </option>
234
- <?php endif; ?>
235
-
236
- <?php do_action( 'bnfw_after_default_notifications', $setting ); ?>
237
- </optgroup>
238
- <?php do_action( 'bnfw_after_default_notifications_optgroup', $setting ); ?>
239
-
240
- <optgroup label="<?php _e( 'Transactional', 'bnfw' ); ?>">
241
- <option
242
- value="new-user" <?php selected( 'new-user', $setting['notification'] ); ?>><?php esc_html_e( 'New User Registration - For User', 'bnfw' ); ?></option>
243
- <option
244
- value="welcome-email" <?php selected( 'welcome-email', $setting['notification'] ); ?>><?php esc_html_e( 'New User - Post-registration Email', 'bnfw' ); ?></option>
245
- <option
246
- value="user-password" <?php selected( 'user-password', $setting['notification'] ); ?>><?php esc_html_e( 'User Lost Password - For User', 'bnfw' ); ?></option>
247
- <option
248
- value="password-changed" <?php selected( 'password-changed', $setting['notification'] ); ?>><?php esc_html_e( 'Password Changed - For User', 'bnfw' ); ?></option>
249
- <option value="email-changing" <?php selected( 'email-changing', $setting['notification'] ); ?>>
250
- <?php esc_html_e( 'User Email Changed Confirmation - For User', 'bnfw' ); ?>
251
- </option>
252
- <option
253
- value="email-changed" <?php selected( 'email-changed', $setting['notification'] ); ?>><?php esc_html_e( 'User Email Changed - For User', 'bnfw' ); ?></option>
254
- <option
255
- value="user-role" <?php selected( 'user-role', $setting['notification'] ); ?>><?php esc_html_e( 'User Role Changed - For User', 'bnfw' ); ?></option>
256
- <option
257
- value="user-login" <?php selected( 'user-login', $setting['notification'] ); ?>><?php esc_html_e( 'User Logged In - For User', 'bnfw' ); ?></option>
258
- <option
259
- value="reply-comment" <?php selected( 'reply-comment', $setting['notification'] ); ?>><?php esc_html_e( 'Comment Reply', 'bnfw' ); ?></option>
260
-
261
- <?php if ( version_compare( $wp_version, '4.9.6' ) >= 0 ) : ?>
262
- <option value="ca-export-data" <?php selected( 'ca-export-data', $setting['notification'] ); ?>>
263
- <?php esc_html_e( 'Privacy - Confirm Action: Export Data Request - For User', 'bnfw' ); ?>
264
- </option>
265
-
266
- <option value="ca-erase-data" <?php selected( 'ca-erase-data', $setting['notification'] ); ?>>
267
- <?php esc_html_e( 'Privacy - Confirm Action: Erase Data Request - For User', 'bnfw' ); ?>
268
- </option>
269
-
270
- <option value="data-export" <?php selected( 'data-export', $setting['notification'] ); ?>>
271
- <?php esc_html_e( 'Privacy - Data Export - For User', 'bnfw' ); ?>
272
- </option>
273
-
274
- <option value="data-erased" <?php selected( 'data-erased', $setting['notification'] ); ?>>
275
- <?php esc_html_e( 'Privacy - Data Erased - For User', 'bnfw' ); ?>
276
- </option>
277
- <?php endif; ?>
278
-
279
- <?php do_action( 'bnfw_after_transactional_notifications', $setting ); ?>
280
- </optgroup>
281
- <?php do_action( 'bnfw_after_transactional_notifications_optgroup', $setting ); ?>
282
-
283
- <optgroup label="Posts">
284
- <option
285
- value="new-post" <?php selected( 'new-post', $setting['notification'] ); ?>><?php esc_html_e( 'New Post Published', 'bnfw' ); ?></option>
286
- <option
287
- value="update-post" <?php selected( 'update-post', $setting['notification'] ); ?>><?php esc_html_e( 'Post Updated', 'bnfw' ); ?></option>
288
- <option
289
- value="pending-post" <?php selected( 'pending-post', $setting['notification'] ); ?>><?php esc_html_e( 'Post Pending Review', 'bnfw' ); ?></option>
290
- <option
291
- value="private-post" <?php selected( 'private-post', $setting['notification'] ); ?>><?php esc_html_e( 'New Private Post', 'bnfw' ); ?></option>
292
- <option
293
- value="future-post" <?php selected( 'future-post', $setting['notification'] ); ?>><?php esc_html_e( 'Post Scheduled', 'bnfw' ); ?></option>
294
- <option
295
- value="trash-post" <?php selected( 'trash-post', $setting['notification'] ); ?>><?php esc_html_e( 'Published Post Moved to Trash', 'bnfw' ); ?></option>
296
- <option value="new-comment" <?php selected( 'new-comment', $setting['notification'] ); ?>>
297
- <?php esc_html_e( 'New Comment', 'bnfw' ); ?>
298
- </option>
299
- <option value="moderate-post-comment" <?php selected( 'moderate-post-comment', $setting['notification'] ); ?>>
300
- <?php esc_html_e( 'New Comment Awaiting Moderation', 'bnfw' ); ?>
301
- </option>
302
- <option value="approve-post-comment" <?php selected( 'approve-post-comment', $setting['notification'] ); ?>>
303
- <?php esc_html_e( 'Post - Comment Approved', 'bnfw' ); ?>
304
- </option>
305
- <option
306
- value="newterm-category" <?php selected( 'newterm-category', $setting['notification'] ); ?>><?php esc_html_e( 'New Category', 'bnfw' ); ?></option>
307
- <option
308
- value="newterm-post_tag" <?php selected( 'newterm-post_tag', $setting['notification'] ); ?>><?php esc_html_e( 'New Tag', 'bnfw' ); ?></option>
309
- <option
310
- value="new-trackback" <?php selected( 'new-trackback', $setting['notification'] ); ?>><?php esc_html_e( 'New Trackback', 'bnfw' ); ?></option>
311
- <option
312
- value="new-pingback" <?php selected( 'new-pingback', $setting['notification'] ); ?>><?php esc_html_e( 'New Pingback', 'bnfw' ); ?></option>
313
- <?php do_action( 'bnfw_after_notification_options', 'post', 'Post', $setting ); ?>
314
- </optgroup>
315
- <?php do_action( 'bnfw_after_notification_options_optgroup', 'post', 'Post', $setting ); ?>
316
-
317
- <optgroup label="Page">
318
- <option
319
- value="new-page" <?php selected( 'new-page', $setting['notification'] ); ?>><?php esc_html_e( 'New Page Published', 'bnfw' ); ?></option>
320
- <option
321
- value="update-page" <?php selected( 'update-page', $setting['notification'] ); ?>><?php esc_html_e( 'Page Updated', 'bnfw' ); ?></option>
322
- <option
323
- value="pending-page" <?php selected( 'pending-page', $setting['notification'] ); ?>><?php esc_html_e( 'Page Pending Review', 'bnfw' ); ?></option>
324
- <option
325
- value="private-page" <?php selected( 'private-page', $setting['notification'] ); ?>><?php esc_html_e( 'New Private Page', 'bnfw' ); ?></option>
326
- <option
327
- value="future-page" <?php selected( 'future-page', $setting['notification'] ); ?>><?php esc_html_e( 'Page Scheduled', 'bnfw' ); ?></option>
328
- <option
329
- value="comment-page" <?php selected( 'comment-page', $setting['notification'] ); ?>><?php esc_html_e( 'Page - New Comment', 'bnfw' ); ?></option>
330
- <option value="moderate-page-comment" <?php selected( 'moderate-page-comment', $setting['notification'] ); ?>>
331
- <?php esc_html_e( 'Page - New Comment Awaiting Moderation', 'bnfw' ); ?>
332
- </option>
333
- <option value="approve-page-comment" <?php selected( 'approve-page-comment', $setting['notification'] ); ?>>
334
- <?php esc_html_e( 'Page - Comment Approved', 'bnfw' ); ?>
335
- </option>
336
- <option
337
- value="commentreply-page" <?php selected( 'commentreply-page', $setting['notification'] ); ?>><?php esc_html_e( 'Page - Comment Reply', 'bnfw' ); ?></option>
338
- <?php do_action( 'bnfw_after_notification_options', 'page', 'Page', $setting ); ?>
339
- </optgroup>
340
- <?php do_action( 'bnfw_after_notification_options_optgroup', 'page', 'Page', $setting ); ?>
341
-
342
- <optgroup label="Media">
343
- <option
344
- value="new-media" <?php selected( 'new-media', $setting['notification'] ); ?>><?php esc_html_e( 'New Media Published', 'bnfw' ); ?></option>
345
- <option
346
- value="update-media" <?php selected( 'update-media', $setting['notification'] ); ?>><?php esc_html_e( 'Media Updated', 'bnfw' ); ?></option>
347
- <option
348
- value="comment-attachment" <?php selected( 'comment-attachment', $setting['notification'] ); ?>><?php esc_html_e( 'Media - New Comment', 'bnfw' ); ?></option>
349
- <option value="approve-attachment-comment" <?php selected( 'approve-attachment-comment', $setting['notification'] ); ?>>
350
- <?php esc_html_e( 'Media - Comment Approved', 'bnfw' ); ?>
351
- </option>
352
- <option value="moderate-attachment-comment" <?php selected( 'moderate-attachment-comment', $setting['notification'] ); ?>>
353
- <?php esc_html_e( 'Media - New Comment Awaiting Moderation', 'bnfw' ); ?></option>
354
- <option
355
- value="commentreply-attachment" <?php selected( 'commentreply-attachment', $setting['notification'] ); ?>><?php esc_html_e( 'Media - Comment Reply', 'bnfw' ); ?></option>
356
- <?php do_action( 'bnfw_after_notification_options', 'media', 'Media', $setting ); ?>
357
- </optgroup>
358
- <?php do_action( 'bnfw_after_notification_options_optgroup', 'media', 'Media', $setting ); ?>
359
-
360
- <?php
361
- $types = apply_filters( 'bnfw_notification_dropdown_posttypes', get_post_types( array(
362
- 'public' => true,
363
- '_builtin' => false,
364
- ), 'names'
365
- ) );
366
-
367
- foreach ( $types as $type ) {
368
- if ( $type != self::POST_TYPE ) {
369
- $post_obj = get_post_type_object( $type );
370
- $label = $post_obj->labels->singular_name;
371
- ?>
372
- <optgroup
373
- label="<?php esc_attr( printf( "%s - '%s'", esc_html__( 'Custom Post Type', 'bnfw' ), $label ) ); ?>">
374
- <option
375
- value="new-<?php echo esc_attr( $type ); ?>" <?php selected( 'new-' . $type, $setting['notification'] ); ?>><?php echo esc_html__( 'New ', 'bnfw' ), "'$label'", esc_html__( ' Published', 'bnfw' ); ?></option>
376
- <option
377
- value="update-<?php echo esc_attr( $type ); ?>" <?php selected( 'update-' . $type, $setting['notification'] ); ?>><?php echo "'$label' " . esc_html__( 'Updated', 'bnfw' ); ?></option>
378
- <option
379
- value="pending-<?php echo esc_attr( $type ); ?>" <?php selected( 'pending-' . $type, $setting['notification'] ); ?>><?php echo "'$label' ", esc_html__( 'Pending Review', 'bnfw' ); ?></option>
380
- <option
381
- value="private-<?php echo esc_attr( $type ); ?>" <?php selected( 'private-' . $type, $setting['notification'] ); ?>><?php echo esc_html__( 'New Private ', 'bnfw' ), "'$label'"; ?></option>
382
- <option
383
- value="future-<?php echo esc_attr( $type ); ?>" <?php selected( 'future-' . $type, $setting['notification'] ); ?>><?php echo "'$label' ", esc_html__( 'Scheduled', 'bnfw' ); ?></option>
384
- <option
385
- value="comment-<?php echo esc_attr( $type ); ?>" <?php selected( 'comment-' . $type, $setting['notification'] ); ?>><?php echo "'$label' ", esc_html__( 'New Comment', 'bnfw' ); ?></option>
386
- <option value="moderate-<?php echo esc_attr( $type ); ?>-comment" <?php selected( 'moderate-' . $type . '-comment', $setting['notification'] ); ?>>
387
- <?php echo "'$label' - ", esc_html__( 'New Comment Awaiting Moderation', 'bnfw' ); ?>
388
- </option>
389
- <option value="approve-<?php echo esc_attr( $type ); ?>-comment" <?php selected( 'approve-' . $type . '-comment', $setting['notification'] ); ?>>
390
- <?php echo "'$label' - ", esc_html__( 'Comment Approved', 'bnfw' ); ?>
391
- </option>
392
- <option
393
- value="commentreply-<?php echo esc_attr( $type ); ?>" <?php selected( 'commentreply-' . $type, $setting['notification'] ); ?>><?php echo "'$label' ", esc_html__( 'Comment Reply', 'bnfw' ); ?></option>
394
- <?php do_action( 'bnfw_after_notification_options', $type, $label, $setting ); ?>
395
- </optgroup>
396
- <?php do_action( 'bnfw_after_notification_options_optgroup', $type, $label, $setting ); ?>
397
-
398
- <?php
399
- }
400
- }
401
-
402
- $taxs = apply_filters( 'bnfw_notification_dropdown_taxonomies', get_taxonomies(
403
- array(
404
- 'public' => true,
405
- '_builtin' => false,
406
- ),
407
- 'objects'
408
- ) );
409
-
410
- if ( count( $taxs ) > 0 ) {
411
- ?>
412
- <optgroup label="<?php esc_html_e( 'Custom Taxonomy', 'bnfw' ); ?>">
413
- <?php
414
- foreach ( $taxs as $tax ) {
415
- $tax_name = 'newterm-' . $tax->name;
416
- ?>
417
- <option
418
- value="<?php echo esc_attr( $tax_name ); ?>" <?php selected( $tax_name, $setting['notification'] ); ?>><?php printf( "%s '%s'", esc_html__( 'New', 'bnfw' ), $tax->labels->name ); ?></option>
419
- <?php
420
- }
421
- ?>
422
- </optgroup>
423
- <?php
424
- }
425
- do_action( 'bnfw_after_notification_optgroups', $setting );
426
- ?>
427
- </select>
428
- </td>
429
- </tr>
430
-
431
- <?php do_action( 'bnfw_after_notification_dropdown', $setting ); ?>
432
-
433
- <tr valign="top" id="user-password-msg">
434
- <td>&nbsp;</td>
435
- <td>
436
- <div>
437
- <p style="margin-top: 0;"><?php esc_html_e( "This notification doesn't support additional email fields due to a limitation in WordPress.", 'bnfw' ); ?></p>
438
- </div>
439
- </td>
440
- </tr>
441
-
442
- <tr valign="top" id="email-formatting">
443
- <th>
444
- <?php esc_html_e( 'Email Formatting', 'bnfw' ); ?>
445
- <div class="bnfw-help-tip"><p><?php esc_html_e( 'How do you want to format the sent email? HTML is recommended as it\'ll show images and links correctly.', 'bnfw' ); ?></p></div>
446
- </th>
447
- <td>
448
- <label style="margin-right: 20px;">
449
- <input type="radio" name="email-formatting"
450
- value="html" <?php checked( 'html', $setting['email-formatting'] ); ?>>
451
- <?php esc_html_e( 'HTML Formatting', 'bnfw' ); ?>
452
- </label>
453
-
454
- <label>
455
- <input type="radio" name="email-formatting"
456
- value="text" <?php checked( 'text', $setting['email-formatting'] ); ?>>
457
- <?php esc_html_e( 'Plain Text', 'bnfw' ); ?>
458
- </label>
459
- </td>
460
- </tr>
461
-
462
- <?php do_action( 'bnfw_after_email_formatting', $setting ); ?>
463
-
464
- <tr valign="top" id="toggle-fields">
465
- <th>
466
- <?php esc_html_e( 'Additional Email Fields', 'bnfw' ); ?>
467
- <div class="bnfw-help-tip"><p><?php esc_html_e( 'This should be fairly self explanatory but if you\'re unsure, tick this checkbox and have a look at the available options. You can always untick it again should you decide you don\'t need to use it.', 'bnfw' ); ?></p></div>
468
- </th>
469
- <td>
470
- <input type="checkbox" id="show-fields" name="show-fields"
471
- value="true" <?php checked( $setting['show-fields'], 'true', true ); ?>>
472
- <label for="show-fields"><?php esc_html_e( 'Set "From" Name & Email, Reply To, CC, BCC', 'bnfw' ); ?></label>
473
- </td>
474
- </tr>
475
-
476
-
477
- <tr valign="top" id="email">
478
- <th scope="row">
479
- <?php esc_html_e( 'From Name and Email', 'bnfw' ); ?>
480
- <div class="bnfw-help-tip"><p><?php esc_html_e( 'If you want to send the email from your site name and email address instead of the default "WordPress" from "wordpress@domain.com", this is where you can do it.', 'bnfw' ); ?></p></div>
481
- </th>
482
- <td>
483
- <input type="text" name="from-name" value="<?php echo esc_attr( $setting['from-name'] ); ?>"
484
- placeholder="<?php _e( 'Site Name', 'bnfw' ); ?>" style="width: 37.35%">
485
- <input type="text" name="from-email" value="<?php echo esc_attr( $setting['from-email'] ); ?>"
486
- placeholder="<?php _e( 'Site Email', 'bnfw' ); ?>" style="width: 37.3%">
487
- </td>
488
- </tr>
489
-
490
-
491
- <tr valign="top" id="reply">
492
- <th scope="row">
493
- <?php esc_html_e( 'Reply To', 'bnfw' ); ?>
494
- <div class="bnfw-help-tip"><p><?php esc_html_e( 'If you want any replies to your email notification to go to another person, fill in this box with their name and email address.', 'bnfw' ); ?></p></div>
495
- </th>
496
- <td>
497
- <input type="text" name="reply-name" value="<?php echo esc_attr( $setting['reply-name'] ); ?>"
498
- placeholder="<?php _e( 'Name', 'bnfw' ); ?>" style="width: 37.35%">
499
- <input type="text" name="reply-email" value="<?php echo esc_attr( $setting['reply-email'] ); ?>"
500
- placeholder="<?php _e( 'Email', 'bnfw' ); ?>" style="width: 37.3%">
501
- </td>
502
- </tr>
503
-
504
- <tr valign="top" id="cc">
505
- <th scope="row">
506
- <?php esc_html_e( 'CC', 'bnfw' ); ?>
507
- <div class="bnfw-help-tip"><p><?php esc_html_e( 'Publicly copy in any other users or user roles to this email.', 'bnfw' ); ?></p></div>
508
- </th>
509
-
510
- <td>
511
- <select multiple name="cc[]" class="<?php echo sanitize_html_class( bnfw_get_user_select_class() ); ?>"
512
- data-placeholder="<?php echo apply_filters( 'bnfw_email_dropdown_placeholder', __( 'Select User Roles / Users', 'bnfw' ) ); ?>" style="width:75%">
513
- <?php bnfw_render_users_dropdown( $setting['cc'] ); ?>
514
- </select>
515
- </td>
516
- </tr>
517
-
518
- <tr valign="top" id="bcc">
519
- <th scope="row">
520
- <?php esc_html_e( 'BCC', 'bnfw' ); ?>
521
- <div class="bnfw-help-tip"><p><?php esc_html_e( 'Privately copy in any other users or user roles to this email.', 'bnfw' ); ?></p></div>
522
- </th>
523
-
524
- <td>
525
- <select multiple name="bcc[]" class="<?php echo sanitize_html_class( bnfw_get_user_select_class() ); ?>"
526
- data-placeholder="<?php echo apply_filters( 'bnfw_email_dropdown_placeholder', __( 'Select User Roles / Users', 'bnfw' ) ); ?>" style="width:75%">
527
- <?php bnfw_render_users_dropdown( $setting['bcc'] ); ?>
528
- </select>
529
- </td>
530
- </tr>
531
-
532
- <?php do_action( 'bnfw_after_additional_email_fields', $setting ); ?>
533
-
534
- <tr valign="top" id="post-author">
535
- <th>
536
- <?php esc_html_e( 'Send to Author', 'bnfw' ); ?>
537
- <div class="bnfw-help-tip"><p><?php esc_html_e( 'E.g. If you want a new post published notification to go to the post author, tick this box.', 'bnfw' ); ?></p></div>
538
- </th>
539
-
540
- <td>
541
- <label>
542
- <input type="checkbox" id="only-post-author" name="only-post-author"
543
- value="true" <?php checked( 'true', $setting['only-post-author'] ); ?>>
544
- <?php esc_html_e( 'Send this notification to the Author', 'bnfw' ); ?>
545
- </label>
546
- </td>
547
- </tr>
548
-
549
- <?php do_action( 'bnfw_after_only_post_author', $setting ); ?>
550
-
551
- <tr valign="top" id="current-user">
552
- <th>
553
- &nbsp;
554
- <div class="bnfw-help-tip"><p><?php esc_html_e( 'E.g. If you\'re an editor and regularly update your posts, you might not want to be emailed about this all the time. Ticking this box will prevent you from receiving emails about your own changes.', 'bnfw' ); ?></p></div>
555
- </th>
556
- <td>
557
- <label>
558
- <input type="checkbox" name="disable-current-user"
559
- value="true" <?php checked( 'true', $setting['disable-current-user'] ); ?>>
560
- <?php esc_html_e( 'Do not send this Notification to the User that triggered it', 'bnfw' ); ?>
561
- </label>
562
- </td>
563
- </tr>
564
-
565
- <?php do_action( 'bnfw_after_disable_current_user', $setting ); ?>
566
-
567
- <tr valign="top" id="users">
568
- <th scope="row">
569
- <?php esc_html_e( 'Send To', 'bnfw' ); ?>
570
- <div class="bnfw-help-tip"><p><?php esc_html_e( 'Choose the users and/or user roles to send this email notification to.', 'bnfw' ); ?></p></div>
571
- </th>
572
- <td>
573
- <select multiple id="users-select" name="users[]"
574
- class="<?php echo sanitize_html_class( bnfw_get_user_select_class() ); ?>"
575
- data-placeholder="<?php echo apply_filters( 'bnfw_email_dropdown_placeholder', __( 'Select User Roles / Users', 'bnfw' ) ); ?>" style="width:75%">
576
- <?php bnfw_render_users_dropdown( $setting['users'] ); ?>
577
- </select>
578
- </td>
579
- </tr>
580
-
581
- <tr valign="top" id="exclude-users">
582
- <th scope="row">
583
- <?php esc_html_e( 'Except For', 'bnfw' ); ?>
584
- <div class="bnfw-help-tip">
585
- <p>
586
- <?php esc_html_e( 'Choose the users and/or user roles that this notification should not be sent to.', 'bnfw' ); ?>
587
- </p>
588
- </div>
589
- </th>
590
- <td>
591
- <select multiple id="exclude-users-select" name="exclude-users[]"
592
- class="<?php echo sanitize_html_class( bnfw_get_user_select_class() ); ?>"
593
- data-placeholder="<?php echo apply_filters( 'bnfw_email_dropdown_placeholder', __( 'Select User Roles / Users', 'bnfw' ) ); ?>" style="width:75%">
594
- <?php bnfw_render_users_dropdown( $setting['exclude-users'] ); ?>
595
- </select>
596
- </td>
597
- </tr>
598
-
599
- <?php
600
- $display = 'none';
601
-
602
- if ( $this->should_show_users_count_msg( $setting ) ) {
603
- $display = 'table-row';
604
- }
605
- ?>
606
- <tr valign="top" id="users-count-msg" style="display: <?php echo esc_attr( $display ); ?>">
607
- <th scope="row">&nbsp;</th>
608
- <td>
609
- <div>
610
- <p>
611
- <?php _e( 'You have chosen to send this notification to over 200 users. Please check the email sending rate limit at your host before sending.', 'bnfw' ); ?>
612
- </p>
613
- </div>
614
- </td>
615
- </tr>
616
-
617
- <?php do_action( 'bnfw_after_send_to', $setting ); ?>
618
-
619
- <tr valign="top" id="subject-wrapper">
620
- <th scope="row">
621
- <?php esc_html_e( 'Subject', 'bnfw' ); ?>
622
- <div class="bnfw-help-tip"><p><?php esc_html_e( 'Notification subject. You can use ', 'bnfw' ); ?><a href="https://betternotificationsforwp.com/documentation/notifications/shortcodes/" target="_blank">shortcodes</a><?php esc_html_e(' here.', 'bnfw' ); ?></p></div>
623
- </th>
624
- <td>
625
- <input type="text" name="subject" id="subject" value="<?php echo esc_attr( $setting['subject'] ); ?>"
626
- style="width:75%;">
627
- </td>
628
- </tr>
629
-
630
- <?php do_action( 'bnfw_after_user_dropdown', $setting ); ?>
631
-
632
- <?php do_action( 'bnfw_before_message_body', $setting ); ?>
633
- <tr valign="top">
634
- <th scope="row">
635
- <?php esc_html_e( 'Message Body', 'bnfw' ); ?>
636
- <div class="bnfw-help-tip"><p><?php esc_html_e( 'Notification message. You can use ', 'bnfw' ); ?><a href="https://betternotificationsforwp.com/documentation/notifications/shortcodes/" target="_blank">shortcodes</a><?php esc_html_e(' here.', 'bnfw' ); ?></p></div>
637
-
638
- <div class="wp-ui-text-highlight">
639
- <p>
640
- <br>
641
- <br>
642
- <br>
643
- <br>
644
- <?php esc_html_e( 'Need some more help?', 'bnfw' ); ?>
645
- </p>
646
- <?php
647
- $doc_url = 'https://betternotificationsforwp.com/documentation/';
648
-
649
- if ( bnfw_is_tracking_allowed() ) {
650
- $doc_url .= "?utm_source=WP%20Admin%20Notification%20Editor%20-%20'Documentation'&amp;utm_medium=referral";
651
- }
652
- ?>
653
- <p>
654
- <a href="#" class="button-secondary" id="insert-default-msg"><?php esc_html_e( 'Insert Default Content', 'bnfw' ); ?></a>
655
- </p>
656
- <p>
657
- <a href="<?php echo $doc_url; ?>"
658
- target="_blank" class="button-secondary"><?php esc_html_e( 'Read Documentation', 'bnfw' ); ?></a>
659
- </p>
660
- <p>
661
- <a href="" target="_blank" id="shortcode-help"
662
- class="button-secondary"><?php esc_html_e( 'Find Shortcodes', 'bnfw' ); ?></a>
663
- </p>
664
- </div>
665
- </th>
666
- <td>
667
- <?php wp_editor( $setting['message'], 'notification_message', array( 'media_buttons' => true ) ); ?>
668
- <p> &nbsp; </p>
669
- <div id="disable-autop">
670
- <label>
671
- <input type="checkbox" name="disable-autop"
672
- value="true" <?php checked( 'true', $setting['disable-autop'] ); ?>>
673
- <?php esc_html_e( 'Stop additional paragraph and line break HTML from being inserted into my notifications', 'bnfw' ); ?>
674
- </label>
675
- </div>
676
- </td>
677
- </tr>
678
-
679
- </tbody>
680
- </table>
681
- <?php
682
- }
683
-
684
- /**
685
- * Should we enqueue assets?
686
- *
687
- * @since 1.0
688
- *
689
- * @param $hook_suffix
690
- */
691
- public function is_assets_needed( $hook_suffix ) {
692
- if ( self::POST_TYPE === get_post_type() || 'bnfw_notification_page_bnfw-settings' === $hook_suffix ) {
693
- // The enqueue assets function may be included from addons.
694
- // We want to disable autosave only for notifications
695
- wp_dequeue_script( 'autosave' );
696
-
697
- $this->enqueue_assets();
698
-
699
- do_action( 'bnfw_after_enqueue_scripts' );
700
- }
701
- }
702
-
703
- /**
704
- * Enqueue assets.
705
- *
706
- * @since 1.4
707
- */
708
- public function enqueue_assets() {
709
- wp_deregister_script( 'select2' );
710
- wp_dequeue_script( 'select2' );
711
- wp_deregister_style( 'select2' );
712
- wp_dequeue_style( 'select2' );
713
-
714
- // Ultimate Member plugin is giving us problems. They should upgrade
715
- wp_deregister_script( 'um_minified' );
716
- wp_dequeue_script( 'um_minified' );
717
- wp_deregister_script( 'um_admin_scripts' );
718
- wp_dequeue_script( 'um_admin_scripts' );
719
-
720
- wp_enqueue_style( 'select2', '//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css', array(), '4.0.3' );
721
- wp_enqueue_script( 'select2', '//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.full.min.js', array( 'jquery' ), '4.0.3', true );
722
-
723
- wp_enqueue_script( 'bnfw', plugins_url( '../assets/js/bnfw.js', dirname( __FILE__ ) ), array( 'select2' ), '0.1', true );
724
- wp_enqueue_style( 'bnfw', plugins_url( '../assets/css/bnfw.css', dirname( __FILE__ ) ), array( 'dashicons', 'select2' ), '0.1' );
725
-
726
- $strings = array(
727
- 'validation_element' => apply_filters( 'bnfw_validation_element', '#users-select' ),
728
- 'empty_user' => esc_html__( 'You must choose at least one User or User Role to send the notification to before you can save', 'bnfw' ),
729
- 'enableTags' => false,
730
- );
731
-
732
- /**
733
- * Filter the localized array that is sent to scripts.
734
- *
735
- * @since 1.7.0
736
- */
737
- $strings = apply_filters( 'bnfw_localize_script', $strings );
738
-
739
- wp_localize_script( 'bnfw', 'BNFW', $strings );
740
- }
741
-
742
- /**
743
- * Save the meta box's post metadata.
744
- *
745
- * @since 1.0
746
- *
747
- * @param int $post_id The ID of the post being saved.
748
- */
749
- public function save_meta_data( $post_id ) {
750
- if ( self::POST_TYPE !== get_post_type( $post_id ) ) {
751
- return;
752
- }
753
-
754
- // Check nonce.
755
- if ( empty( $_POST[ self::POST_TYPE . '_nonce' ] ) ) {
756
- return;
757
- }
758
-
759
- // Verify nonce.
760
- if ( ! wp_verify_nonce( $_POST[ self::POST_TYPE . '_nonce' ], self::POST_TYPE ) ) {
761
- return;
762
- }
763
-
764
- if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
765
- return;
766
- }
767
-
768
- if ( ! current_user_can( 'bnfw' ) ) {
769
- return;
770
- }
771
-
772
- if ( isset( $_POST['digest-interval'] ) && 'no' != $_POST['digest-interval']) {
773
- $subject = $_POST['subject'];
774
- }else{
775
- $subject = sanitize_text_field( $_POST['subject'] );
776
- }
777
-
778
- $setting = array(
779
- 'notification' => sanitize_text_field( $_POST['notification'] ),
780
- 'subject' => $subject,
781
- 'message' => $_POST['notification_message'],
782
- 'disabled' => isset( $_POST['disabled'] ) ? sanitize_text_field( $_POST['disabled'] ) : 'false',
783
- 'email-formatting' => isset( $_POST['email-formatting'] ) ? sanitize_text_field( $_POST['email-formatting'] ) : 'html',
784
- 'disable-current-user' => isset( $_POST['disable-current-user'] ) ? sanitize_text_field( $_POST['disable-current-user'] ) : 'false',
785
- 'disable-autop' => isset( $_POST['disable-autop'] ) ? sanitize_text_field( $_POST['disable-autop'] ) : 'false',
786
- 'only-post-author' => isset( $_POST['only-post-author'] ) ? sanitize_text_field( $_POST['only-post-author'] ) : 'false',
787
- 'users' => array(),
788
- 'exclude-users' => array(),
789
- );
790
-
791
- if ( isset( $_POST['users'] ) ) {
792
- $setting['users'] = array_map( 'sanitize_text_field', $_POST['users'] );
793
- }
794
-
795
- if ( isset( $_POST['exclude-users'] ) ) {
796
- $setting['exclude-users'] = array_map( 'sanitize_text_field', $_POST['exclude-users'] );
797
- }
798
-
799
- if ( isset( $_POST['show-fields'] ) && 'true' == $_POST['show-fields'] ) {
800
- $setting['show-fields'] = 'true';
801
- $setting['from-name'] = sanitize_text_field( $_POST['from-name'] );
802
- $setting['from-email'] = sanitize_text_field( $_POST['from-email'] );
803
- $setting['reply-name'] = sanitize_text_field( $_POST['reply-name'] );
804
- $setting['reply-email'] = sanitize_text_field( $_POST['reply-email'] );
805
- $setting['cc'] = isset( $_POST['cc'] ) ? array_map( 'sanitize_text_field', $_POST['cc'] ) : '';
806
- $setting['bcc'] = isset( $_POST['bcc'] ) ? array_map( 'sanitize_text_field', $_POST['bcc'] ) : '';
807
- } else {
808
- $setting['show-fields'] = 'false';
809
- }
810
-
811
- $setting = apply_filters( 'bnfw_notification_setting', $setting, $_POST );
812
-
813
- $this->save_settings( $post_id, $setting );
814
-
815
- if ( isset( $_POST['send-test-email'] ) ) {
816
- if ( 'true' == sanitize_text_field( $_POST['send-test-email'] ) ) {
817
- BNFW::factory()->engine->send_test_email( $setting );
818
- add_filter( 'redirect_post_location', array( $this, 'test_mail_sent' ) );
819
- }
820
- }
821
- }
822
-
823
- /**
824
- * Add a query parameter to url if test email was sent.
825
- *
826
- * @since 1.3
827
- */
828
- public function test_mail_sent( $loc ) {
829
- return add_query_arg( self::TEST_MAIL_ARG, 1, $loc );
830
- }
831
-
832
- /**
833
- * Add a notification if a test email was sent.
834
- *
835
- * @since 1.3
836
- */
837
- public function admin_notices() {
838
- if ( isset( $_GET[ self::TEST_MAIL_ARG ] ) ) {
839
- $screen = get_current_screen();
840
- if ( in_array( $screen->post_type, array( self::POST_TYPE ) ) ) {
841
- ?>
842
- <div class="updated below-h2">
843
- <p><?php echo esc_html__( 'Test Notification Sent.', 'bnfw' ); ?></p>
844
- </div>
845
- <?php
846
- }
847
- }
848
- }
849
-
850
- /**
851
- * Save settings in post meta.
852
- *
853
- * @since 1.0
854
- * @access private
855
- *
856
- * @param $post_id
857
- * @param $setting
858
- */
859
- private function save_settings( $post_id, $setting ) {
860
- foreach ( $setting as $key => $value ) {
861
- update_post_meta( $post_id, self::META_KEY_PREFIX . $key, $value );
862
- }
863
- }
864
-
865
- /**
866
- * Read settings from post meta.
867
- *
868
- * @since 1.0
869
- *
870
- * @param int $post_id
871
- *
872
- * @return array
873
- */
874
- public function read_settings( $post_id ) {
875
- $setting = array();
876
- $default = array(
877
- 'notification' => '',
878
- 'from-name' => '',
879
- 'from-email' => '',
880
- 'reply-name' => '',
881
- 'reply-email' => '',
882
- 'cc' => array(),
883
- 'bcc' => array(),
884
- 'users' => array(),
885
- 'exclude-users' => array(),
886
- 'subject' => '',
887
- 'email-formatting' => get_option( 'bnfw_email_format', 'html' ),
888
- 'message' => '',
889
- 'show-fields' => 'false',
890
- 'disable-current-user' => 'false',
891
- 'disable-autop' => 'false',
892
- 'only-post-author' => 'false',
893
- 'disabled' => 'false',
894
- );
895
-
896
- $default = apply_filters( 'bnfw_notification_setting_fields', $default );
897
-
898
- foreach ( $default as $key => $default_value ) {
899
- $value = get_post_meta( $post_id, self::META_KEY_PREFIX . $key, true );
900
- if ( ! empty( $value ) ) {
901
- $setting[ $key ] = $value;
902
- } else {
903
- $setting[ $key ] = $default_value;
904
- }
905
- }
906
-
907
- // compatibility code. This will be removed subsequently
908
- $user_roles = get_post_meta( $post_id, self::META_KEY_PREFIX . 'user-roles', true );
909
- if ( ! empty( $user_roles ) && is_array( $user_roles ) ) {
910
- foreach ( $user_roles as $role ) {
911
- $setting['users'][] = 'role-' . $role;
912
- }
913
-
914
- update_post_meta( $post_id, self::META_KEY_PREFIX . 'users', $setting['users'] );
915
- delete_post_meta( $post_id, self::META_KEY_PREFIX . 'user-roles' );
916
- }
917
-
918
- $setting['id'] = $post_id;
919
-
920
- return $setting;
921
- }
922
-
923
- /**
924
- * Change the post updated message for notification post type.
925
- *
926
- * @since 1.0
927
- *
928
- * @param $messages
929
- *
930
- * @return mixed
931
- */
932
- public function post_updated_messages( $messages ) {
933
- $messages[ self::POST_TYPE ] = array_fill( 0, 11, esc_html__( 'Notification saved.', 'bnfw' ) );
934
-
935
- return $messages;
936
- }
937
-
938
- /**
939
- * Render submit div meta box.
940
- *
941
- * @since 1.0
942
- *
943
- * @param $post
944
- */
945
- public function render_submitdiv( $post ) {
946
- global $post;
947
- ?>
948
- <div class="submitbox" id="submitpost">
949
-
950
- <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
951
- <div style="display:none;">
952
- <?php submit_button( esc_html__( 'Save', 'bnfw' ), 'button', 'save' ); ?>
953
- </div>
954
-
955
- <?php // Always publish. ?>
956
- <div class="disable-notification-checkbox" style="padding: 5px 0 10px 0;">
957
- <div class="bnfw-help-tip-container">
958
- <input type="hidden" name="post_status" id="hidden_post_status" value="publish">
959
-
960
- <div class="bnfw-help-tip"><p><?php esc_html_e( 'Use this to enable or disable notifications. If you want to disable a default WordPress notification, just create it on the left, then disable it here.', 'bnfw' ); ?></p></div>
961
-
962
- <?php
963
- $setting = $this->read_settings( $post->ID );
964
- ?>
965
- <label>
966
- <input type="radio" name="disabled"
967
- value="false" <?php checked( $setting['disabled'], 'false', true ); ?>><?php esc_html_e( 'Notification Enabled', 'bnfw' ); ?>
968
- </label>
969
-
970
- <br>
971
-
972
- <label>
973
- <input type="radio" name="disabled"
974
- value="true" <?php checked( $setting['disabled'], 'true', true ); ?>><?php esc_html_e( 'Notification Disabled', 'bnfw' ); ?>
975
- </label>
976
- </div>
977
-
978
- <br>
979
- <br>
980
-
981
- <?php if ( 'publish' == $post->post_status ) { ?>
982
- <div class="bnfw-help-tip-container">
983
- <input type="hidden" name="send-test-email" id="send-test-email" value="false">
984
- <input name="test-email" type="submit" class="button button-secondary button-large" id="test-email"
985
- value="<?php esc_attr_e( 'Send Me a Test Email', 'bnfw' ); ?>">
986
-
987
- <div class="bnfw-help-tip"><p><?php esc_html_e( 'This will send you (the currently logged in user) a notification so that you can check for any issues with formatting – it’s doesn\'t mean that a notification will send correctly in the future. You can read about how to improve email delivery', 'bnfw'); ?> <a href="https://betternotificationsforwp.com/documentation/getting-started/how-to-improve-email-delivery/" target="_blank"><?php esc_html_e( 'here', 'bnfw'); ?></a><?php esc_html_e( '. Shortcodes will not be replaced with content.', 'bnfw' ); ?></p></div>
988
- </div>
989
- <?php } ?>
990
-
991
- </div>
992
-
993
- <div id="major-publishing-actions">
994
-
995
- <div id="delete-action">
996
- <?php
997
- if ( ! EMPTY_TRASH_DAYS ) {
998
- $delete_text = esc_html__( 'Delete Permanently', 'bnfw' );
999
- } else {
1000
- $delete_text = esc_html__( 'Move to Trash', 'bnfw' );
1001
- }
1002
- ?>
1003
- <a class="submitdelete deletion"
1004
- href="<?php echo esc_url( get_delete_post_link( $post->ID ) ); ?>"><?php echo esc_html( $delete_text ); ?></a>
1005
- </div>
1006
-
1007
- <div id="publishing-action">
1008
- <span class="spinner"></span>
1009
- <input name="original_publish" type="hidden" id="original_publish"
1010
- value="<?php esc_attr_e( 'Save', 'bnfw' ); ?>">
1011
- <input name="save" type="submit" class="button button-primary button-large" id="publish"
1012
- accesskey="p" value="<?php esc_attr_e( 'Save', 'bnfw' ); ?>">
1013
- </div>
1014
- <div class="clear"></div>
1015
-
1016
- </div>
1017
- <!-- #major-publishing-actions -->
1018
-
1019
- <div class="clear"></div>
1020
- </div>
1021
- <!-- #submitpost -->
1022
- <?php
1023
- }
1024
-
1025
- /**
1026
- * Get notifications based on type.
1027
- *
1028
- * @since 1.0
1029
- *
1030
- * @param array|string $types
1031
- * @param bool $exclude_disabled (optional) Whether to exclude disabled notifications or not. True by default.
1032
- *
1033
- * @return array WP_Post objects
1034
- */
1035
- public function get_notifications( $types = array(), $exclude_disabled = true ) {
1036
- if ( ! is_array( $types ) ) {
1037
- $types = array( $types );
1038
- }
1039
-
1040
- $args = array(
1041
- 'post_type' => self::POST_TYPE,
1042
- );
1043
-
1044
- $meta_query = array();
1045
-
1046
- if ( ! empty( $types ) ) {
1047
- $meta_query[] = array(
1048
- 'key' => self::META_KEY_PREFIX . 'notification',
1049
- 'value' => $types,
1050
- 'compare' => 'IN',
1051
- );
1052
- }
1053
-
1054
- if ( $exclude_disabled ) {
1055
- $meta_query[] = array(
1056
- 'key' => self::META_KEY_PREFIX . 'disabled',
1057
- 'value' => 'true',
1058
- 'compare' => '!=',
1059
- );
1060
- }
1061
-
1062
- if ( ! empty( $meta_query ) ) {
1063
- $args['meta_query'] = $meta_query;
1064
- }
1065
-
1066
- $args['posts_per_page'] = -1;
1067
- $args['nopagging'] = true;
1068
-
1069
- $args = apply_filters( 'bnfw_get_notifications_args', $args, $types, $exclude_disabled );
1070
-
1071
- $wp_query = new WP_Query();
1072
- $posts = $wp_query->query( $args );
1073
-
1074
- $posts = apply_filters( 'bnfw_get_notifications_posts', $posts, $args, $types, $exclude_disabled );
1075
-
1076
- return $posts;
1077
- }
1078
-
1079
- /**
1080
- * Are there any disabled notifications for a particular notification type.
1081
- *
1082
- * @param string $type Notification type.
1083
- *
1084
- * @return bool True if disabled, False otherwise.
1085
- */
1086
- public function is_notification_disabled( $type ) {
1087
- $args = array(
1088
- 'post_type' => self::POST_TYPE,
1089
- 'posts_per_page' => - 1,
1090
- 'nopagging' => true,
1091
- 'fields' => 'ids',
1092
- 'meta_query' => array(
1093
- array(
1094
- 'key' => self::META_KEY_PREFIX . 'notification',
1095
- 'value' => $type,
1096
- ),
1097
- array(
1098
- 'key' => self::META_KEY_PREFIX . 'disabled',
1099
- 'value' => 'true',
1100
- ),
1101
- )
1102
- );
1103
-
1104
- $args = apply_filters( 'bnfw_is_notification_disabled_args', $args, $type );
1105
-
1106
- $wp_query = new WP_Query();
1107
- $posts = $wp_query->query( $args );
1108
-
1109
- $posts = apply_filters( 'bnfw_is_notification_disabled_posts', $posts, $args, $type );
1110
-
1111
- return count( $posts ) > 0;
1112
- }
1113
-
1114
- /**
1115
- * Does a particular type of notification exists or not.
1116
- *
1117
- * @since 1.1
1118
- *
1119
- * @param string $type Notification Type.
1120
- * @param bool $exclude_disabled (optional) Whether to exclude disabled notifications or not. True by default.
1121
- *
1122
- * @return bool True if present, False otherwise
1123
- */
1124
- public function notification_exists( $type, $exclude_disabled = true ) {
1125
- $notifications = $this->get_notifications( $type, $exclude_disabled );
1126
-
1127
- if ( count( $notifications ) > 0 ) {
1128
- return true;
1129
- } else {
1130
- return false;
1131
- }
1132
- }
1133
-
1134
- /**
1135
- * Custom columns for this post type.
1136
- *
1137
- * @since 1.0
1138
- * @filter manage_{post_type}_posts_columns
1139
- *
1140
- * @param array $columns
1141
- *
1142
- * @return array
1143
- */
1144
- public function columns_header( $columns ) {
1145
- $columns['type'] = esc_html__( 'Notification Type', 'bnfw' );
1146
- $columns['disabled'] = esc_html__( 'Enabled?', 'bnfw' );
1147
- $columns['subject'] = esc_html__( 'Subject', 'bnfw' );
1148
- $columns['users'] = esc_html__( 'User Roles / Users', 'bnfw' );
1149
- $columns['excluded'] = esc_html__( 'Excluded User Roles / Users', 'bnfw' );
1150
-
1151
- return $columns;
1152
- }
1153
-
1154
- /**
1155
- * Custom column appears in each row.
1156
- *
1157
- * @since 1.0
1158
- * @action manage_{post_type}_posts_custom_column
1159
- *
1160
- * @param string $column Column name
1161
- * @param int $post_id Post ID
1162
- */
1163
- public function custom_column_row( $column, $post_id ) {
1164
- $setting = $this->read_settings( $post_id );
1165
- switch ( $column ) {
1166
- case 'disabled':
1167
- if ( 'true' != $setting['disabled'] ) {
1168
- printf( '<span class="dashicons dashicons-yes"></span>' );
1169
- }
1170
- break;
1171
- case 'type':
1172
- echo $this->get_notification_name( $setting['notification'] );
1173
- break;
1174
- case 'subject':
1175
- echo ! empty( $setting['subject'] ) ? $setting['subject'] : '';
1176
- break;
1177
- case 'users':
1178
- $users = $this->get_names_from_users( $setting['users'] );
1179
- if (!empty($users)) {
1180
- echo implode( ', ', $users );
1181
- }
1182
- else {
1183
- if(isset($setting['new-user-role'])){
1184
- $users = $this->get_names_from_users( $setting['new-user-role'] );
1185
- echo implode( ', ', $users );
1186
- }
1187
- }
1188
-
1189
- if ( 'true' === $setting['only-post-author'] ) {
1190
- echo esc_html__( ', Post Author', 'bnfw' );
1191
- }
1192
-
1193
- break;
1194
- case 'excluded':
1195
- $excluded_users = $this->get_names_from_users( $setting['exclude-users'] );
1196
- echo implode( ', ', $excluded_users );
1197
-
1198
- break;
1199
- }
1200
-
1201
- /**
1202
- * Invoked while displaying a custom column in notification table.
1203
- *
1204
- * @since 1.3.9
1205
- *
1206
- * @param string $column Column name
1207
- * @param int $post_id Post ID
1208
- */
1209
- do_action( 'bnfw_notification_table_column', $column, $post_id );
1210
- }
1211
-
1212
- /**
1213
- * Get names from users.
1214
- *
1215
- * @since 1.2
1216
- */
1217
- private function get_names_from_users( $users ) {
1218
- $user_ids = array();
1219
- $user_roles = array();
1220
- $emails = array();
1221
- $names_from_user_ids = array();
1222
-
1223
- if ( is_array( $users ) ) {
1224
- foreach ( $users as $user ) {
1225
- if ( $this->starts_with( $user, 'role-' ) ) {
1226
- $user_roles[] = ucfirst( str_replace( 'role-', '', $user ) );
1227
- } elseif ( strpos( $user, '@' ) !== false ) {
1228
- $emails[] = $user;
1229
- } elseif ( absint( $user ) > 0 ) {
1230
- $user_ids[] = absint( $user );
1231
- } else {
1232
- $emails[] = $user;
1233
- }
1234
- }
1235
- }
1236
- else {
1237
- // User Roles not associated with a To/CC/BCC field
1238
- $role = get_role( $users );
1239
-
1240
- if ( !empty( $role ) ) {
1241
- $user_roles = array( $role->name );
1242
- }
1243
- }
1244
-
1245
- if ( ! empty( $user_ids ) ) {
1246
- $user_query = new WP_User_Query( array( 'include' => $user_ids ) );
1247
- foreach ( $user_query->results as $user ) {
1248
- $names_from_user_ids[] = $user->user_login;
1249
- }
1250
- }
1251
-
1252
- return array_merge( $user_roles, $names_from_user_ids, $emails );
1253
- }
1254
-
1255
- /**
1256
- * Get name of the notification based on slug.
1257
- *
1258
- * @param string $slug Notification Slug.
1259
- *
1260
- * @return string Notification Name.
1261
- */
1262
- private function get_notification_name( $slug ) {
1263
- $name = '';
1264
- switch ( $slug ) {
1265
- case 'new-comment':
1266
- $name = esc_html__( 'New Comment', 'bnfw' );
1267
- break;
1268
- case 'approve-post-comment':
1269
- $name = esc_html__( 'Post - Comment Approved', 'bnfw' );
1270
- break;
1271
- case 'moderate-comment':
1272
- $name = esc_html__( 'New Comment Awaiting Moderation', 'bnfw' );
1273
- break;
1274
- case 'new-trackback':
1275
- $name = esc_html__( 'New Trackback', 'bnfw' );
1276
- break;
1277
- case 'new-pingback':
1278
- $name = esc_html__( 'New Pingback', 'bnfw' );
1279
- break;
1280
- case 'reply-comment':
1281
- $name = esc_html__( 'Comment Reply', 'bnfw' );
1282
- break;
1283
- case 'user-password':
1284
- $name = esc_html__( 'User Lost Password - For User', 'bnfw' );
1285
- break;
1286
- case 'admin-password':
1287
- $name = esc_html__( 'User Lost Password - For Admin', 'bnfw' );
1288
- break;
1289
- case 'admin-password-changed':
1290
- $name = esc_html__( 'Password Changed - For Admin', 'bnfw' );
1291
- break;
1292
- case 'admin-email-changed':
1293
- $name = esc_html__( 'User Email Changed - For Admin', 'bnfw' );
1294
- break;
1295
- case 'password-changed':
1296
- $name = esc_html__( 'Password Changed - For User', 'bnfw' );
1297
- break;
1298
- case 'email-changing':
1299
- $name = esc_html__( 'User Email Changed Confirmation - For User', 'bnfw' );
1300
- break;
1301
- case 'email-changed':
1302
- $name = esc_html__( 'User Email Changed - For User', 'bnfw' );
1303
- break;
1304
- case 'core-updated':
1305
- $name = esc_html__( 'WordPress Core Automatic Background Updates', 'bnfw' );
1306
- break;
1307
- case 'new-user':
1308
- $name = esc_html__( 'New User Registration - For User', 'bnfw' );
1309
- break;
1310
- case 'user-login':
1311
- $name = esc_html__( 'User Logged In - For User', 'bnfw' );
1312
- break;
1313
- case 'admin-user-login':
1314
- $name = esc_html__( 'User Logged In - For Admin', 'bnfw' );
1315
- break;
1316
- case 'welcome-email':
1317
- $name = esc_html__( 'New User - Post-registration Email', 'bnfw' );
1318
- break;
1319
- case 'admin-user':
1320
- $name = esc_html__( 'New User Registration - For Admin', 'bnfw' );
1321
- break;
1322
- case 'user-role':
1323
- $name = esc_html__( 'User Role Changed - For User', 'bnfw' );
1324
- break;
1325
- case 'admin-role':
1326
- $name = esc_html__( 'User Role Changed - For Admin', 'bnfw' );
1327
- break;
1328
- case 'new-post':
1329
- $name = esc_html__( 'New Post Published', 'bnfw' );
1330
- break;
1331
- case 'update-post':
1332
- $name = esc_html__( 'Post Updated', 'bnfw' );
1333
- break;
1334
- case 'pending-post':
1335
- $name = esc_html__( 'Post Pending Review', 'bnfw' );
1336
- break;
1337
- case 'private-post':
1338
- $name = esc_html__( 'New Private Post', 'bnfw' );
1339
- break;
1340
- case 'future-post':
1341
- $name = esc_html__( 'Post Scheduled', 'bnfw' );
1342
- break;
1343
- case 'trash-post':
1344
- $name = esc_html__( 'Published Post Moved to Trash', 'bnfw' );
1345
- break;
1346
- case 'new-page':
1347
- $name = esc_html__( 'New Page Published', 'bnfw' );
1348
- break;
1349
- case 'newterm-category':
1350
- $name = esc_html__( 'New Category', 'bnfw' );
1351
- break;
1352
- case 'newterm-post_tag':
1353
- $name = esc_html__( 'New Tag', 'bnfw' );
1354
- break;
1355
- case 'ca-export-data':
1356
- $name = esc_html__( 'Privacy – Confirm Action: Export Data Request – For User', 'bnfw' );
1357
- break;
1358
- case 'ca-erase-data':
1359
- $name = esc_html__( 'Privacy – Confirm Action: Erase Data Request – For User', 'bnfw' );
1360
- break;
1361
- case 'uc-export-data':
1362
- $name = esc_html__( 'Privacy - Confirm Action: Export Data Request - For Admin', 'bnfw' );
1363
- break;
1364
- case 'uc-erase-data':
1365
- $name = esc_html__( 'Privacy - Confirm Action: Erase Data Request - For Admin', 'bnfw' );
1366
- break;
1367
- case 'data-export':
1368
- $name = esc_html__( 'Privacy - Data Export - For User', 'bnfw' );
1369
- break;
1370
- case 'data-erased':
1371
- $name = esc_html__( 'Privacy - Data Erased - For User', 'bnfw' );
1372
- break;
1373
- case 'new-media':
1374
- $name = esc_html__( 'New Media Published', 'bnfw' );
1375
- break;
1376
- case 'update-media':
1377
- $name = esc_html__( 'Media Updated', 'bnfw' );
1378
- break;
1379
- case 'comment-attachment':
1380
- $name = esc_html__( 'Media - New Comment', 'bnfw' );
1381
- break;
1382
- case 'approve-page-comment':
1383
- $name = esc_html__( 'Page - Comment Approved', 'bnfw' );
1384
- break;
1385
- case 'approve-attachment-comment':
1386
- $name = esc_html__( 'Media - Comment Approved', 'bnfw' );
1387
- break;
1388
- case 'moderate-attachment-comment':
1389
- $name = esc_html__( 'Media - New Comment Awaiting Moderation', 'bnfw' );
1390
- break;
1391
- case 'commentreply-attachment':
1392
- $name = esc_html__( 'Media - Comment Reply', 'bnfw' );
1393
- break;
1394
-
1395
-
1396
- default:
1397
- $splited = explode( '-', $slug );
1398
- $label = $splited[1];
1399
- $post_obj = get_post_type_object( $splited[1] );
1400
-
1401
- if ( null != $post_obj ) {
1402
- $label = $post_obj->labels->singular_name;
1403
- }
1404
-
1405
- switch ( $splited[0] ) {
1406
- case 'new':
1407
- $name = esc_html__( 'New ', 'bnfw' ) . $label . ' ' . esc_html__( 'Published', 'bnfw' );
1408
- break;
1409
- case 'update':
1410
- $name = esc_html__( 'Updated ', 'bnfw' ) . $label;
1411
- break;
1412
- case 'pending':
1413
- $name = $label . esc_html__( ' Pending Review', 'bnfw' );
1414
- break;
1415
- case 'future':
1416
- $name = $label . esc_html__( ' Scheduled', 'bnfw' );
1417
- break;
1418
- case 'private':
1419
- $name = esc_html__( 'New Private ', 'bnfw' ) . $label;
1420
- break;
1421
- case 'comment':
1422
- $name = $label . esc_html__( ' Comment', 'bnfw' );
1423
- break;
1424
- case 'moderate':
1425
- $name = $label . ' - ' . esc_html__( 'New Comment Awaiting Moderation', 'bnfw' );
1426
- break;
1427
- case 'commentreply':
1428
- $name = $label . esc_html__( ' Comment Reply', 'bnfw' );
1429
- break;
1430
- case 'approve':
1431
- $name = $label . esc_html__( ' Comment Approved', 'bnfw' );
1432
- break;
1433
- case 'newterm':
1434
- $tax = get_taxonomy( $splited[1] );
1435
- if ( ! $tax ) {
1436
- $name = esc_html__( 'New Term', 'bnfw' );
1437
- } else {
1438
- $name = esc_html__( 'New Term in ', 'bnfw' ) . $tax->labels->name;
1439
- }
1440
- break;
1441
- }
1442
- break;
1443
- }
1444
-
1445
- $name = apply_filters( 'bnfw_notification_name', $name, $slug );
1446
-
1447
- return $name;
1448
- }
1449
-
1450
- /**
1451
- * Add additional custom edit actions for enabling and disabling notifications in bulk.
1452
- *
1453
- * @param array $bulk_actions Bulk Actions.
1454
- *
1455
- * @return array Modified list of Bulk Actions.
1456
- */
1457
- public function add_custom_edit_action( $bulk_actions ) {
1458
- $bulk_actions['enable_notifications'] = __( 'Enable Notifications', 'bnfw' );
1459
- $bulk_actions['disable_notifications'] = __( 'Disable Notifications', 'bnfw' );
1460
-
1461
- return $bulk_actions;
1462
- }
1463
-
1464
- /**
1465
- * Handle custom edit actions.
1466
- *
1467
- * @param $redirect_to
1468
- * @param $doaction
1469
- * @param $post_ids
1470
- *
1471
- * @return string
1472
- */
1473
- public function handle_custom_edit_action( $redirect_to, $doaction, $post_ids ) {
1474
- if ( 'enable_notifications' !== $doaction && 'disable_notifications' !== $doaction ) {
1475
- return $redirect_to;
1476
- }
1477
-
1478
- $redirect_to = remove_query_arg( array( 'bulk_enable_notifications', 'bulk_disable_notifications', 'bnfw_action' ), $redirect_to );
1479
-
1480
- $meta_value = 'true';
1481
-
1482
- if ( 'enable_notifications' === $doaction ) {
1483
- $meta_value = 'false';
1484
- }
1485
-
1486
- foreach ( $post_ids as $post_id ) {
1487
- update_post_meta( $post_id, self::META_KEY_PREFIX . 'disabled', $meta_value );
1488
- }
1489
-
1490
- $redirect_to = add_query_arg( 'bulk_' . $doaction, count( $post_ids ), $redirect_to );
1491
-
1492
- return $redirect_to;
1493
- }
1494
-
1495
- /**
1496
- * Custom row actions for this post type.
1497
- *
1498
- * @since 1.0
1499
- * @filter post_row_actions
1500
- *
1501
- * @param array $actions
1502
- * @param \WP_Post $post
1503
- *
1504
- * @return array
1505
- */
1506
- public function custom_row_actions( $actions, $post ) {
1507
- if ( self::POST_TYPE === get_post_type( $post ) ) {
1508
- unset( $actions['inline hide-if-no-js'] );
1509
- unset( $actions['view'] );
1510
-
1511
- $notification_disabled = get_post_meta( $post->ID, self::META_KEY_PREFIX . 'disabled', true );
1512
-
1513
- if ( 'true' === $notification_disabled ) {
1514
- $url = add_query_arg(
1515
- array(
1516
- 'notification_id' => $post->ID,
1517
- 'bnfw_action' => 'enable_notification',
1518
- )
1519
- );
1520
- $actions['enable_notification'] = '<a href="' . esc_url( $url ) . '">' . __( 'Enable Notification', 'bnfw' ) . '</a>';
1521
- } else {
1522
- $url = add_query_arg(
1523
- array(
1524
- 'notification_id' => $post->ID,
1525
- 'bnfw_action' => 'disable_notification',
1526
- )
1527
- );
1528
- $actions['disable_notification'] = '<a href="' . esc_url( $url ) . '">' . __( 'Disable Notification', 'bnfw' ) . '</a>';
1529
- }
1530
- }
1531
-
1532
- return $actions;
1533
- }
1534
-
1535
- /**
1536
- * Handle custom actions.
1537
- */
1538
- public function handle_actions() {
1539
- if ( ! isset( $_GET['bnfw_action'] ) || ! isset( $_GET['notification_id'] ) ) {
1540
- return;
1541
- }
1542
-
1543
- $post_id = absint( $_GET['notification_id'] );
1544
- if ( 0 === $post_id ) {
1545
- return;
1546
- }
1547
-
1548
- $action = sanitize_text_field( $_GET['bnfw_action'] );
1549
-
1550
- if ( 'enable_notification' === $action ) {
1551
- update_post_meta( $post_id, self::META_KEY_PREFIX . 'disabled', 'false' );
1552
- }
1553
-
1554
- if ( 'disable_notification' === $action ) {
1555
- update_post_meta( $post_id, self::META_KEY_PREFIX . 'disabled', 'true' );
1556
- }
1557
- }
1558
-
1559
- /**
1560
- * Find if a string starts with another string.
1561
- *
1562
- * @since 1.2
1563
- *
1564
- * @param $haystack
1565
- * @param $needle
1566
- *
1567
- * @return bool
1568
- */
1569
- public function starts_with( $haystack, $needle ) {
1570
- // search backwards starting from haystack length characters from the end
1571
- return '' === $needle || strrpos( $haystack, $needle, - strlen( $haystack ) ) !== false;
1572
- }
1573
-
1574
- /**
1575
- * Display a help notice.
1576
- *
1577
- * @since 1.7
1578
- */
1579
- public function show_help_notice() {
1580
- $screen = get_current_screen();
1581
- if ( ! in_array( $screen->post_type, array( self::POST_TYPE ) ) ) {
1582
- return;
1583
- }
1584
-
1585
- if ( ! empty( $_REQUEST['bnfw_action'] ) && 'enable_notification' === $_REQUEST['bnfw_action'] ) {
1586
- echo '<div id="message" class="updated fade"><p>' . __( 'Enabled 1 Notification.', 'bnfw' ) . '</p></div>';
1587
- }
1588
-
1589
- if ( ! empty( $_REQUEST['bnfw_action'] ) && 'disable_notification' === $_REQUEST['bnfw_action'] ) {
1590
- echo '<div id="message" class="updated fade"><p>' . __( 'Disabled 1 Notification.', 'bnfw' ) . '</p></div>';
1591
- }
1592
-
1593
- if ( ! empty( $_REQUEST['bulk_enable_notifications'] ) ) {
1594
- $enabled_count = intval( $_REQUEST['bulk_enable_notifications'] );
1595
- printf( '<div id="message" class="updated fade"><p>' .
1596
- _n( 'Enabled %s Notification.',
1597
- 'Enabled %s Notifications.',
1598
- $enabled_count,
1599
- 'bnfw'
1600
- ) . '</p></div>', $enabled_count );
1601
- }
1602
-
1603
- if ( ! empty( $_REQUEST['bulk_disable_notifications'] ) ) {
1604
- $disabled_count = intval( $_REQUEST['bulk_disable_notifications'] );
1605
- printf( '<div id="message" class="updated fade"><p>' .
1606
- _n( 'Disabled %s Notification.',
1607
- 'Disabled %s Notifications.',
1608
- $disabled_count,
1609
- 'bnfw'
1610
- ) . '</p></div>', $disabled_count );
1611
- }
1612
-
1613
- if ( ! PAnD::is_admin_notice_active( 'disable-bnfw-help-notice-forever' ) ) {
1614
- return;
1615
- }
1616
-
1617
- ?>
1618
- <div data-dismissible="disable-bnfw-help-notice-forever" class="updated notice notice-success is-dismissible">
1619
- <p>
1620
- <?php _e( 'If you send out notifications with BNFW but don\'t receive them, you may need to install an SMTP plugin to <a href="https://betternotificationsforwp.com/documentation/getting-started/how-to-improve-email-delivery/" target="_blank">improve email deliverability</a>. I recommend using <a href="https://wordpress.org/plugins/post-smtp/" target="_blank">Post SMTP</a> as it\'s easy to set-up or <a href="https://wordpress.org/plugins/email-log/" target="_blank">Email Log</a> to just log and view emails that are sent.', 'bnfw' ); ?>
1621
- </p>
1622
- </div>
1623
- <?php
1624
- }
1625
-
1626
- /**
1627
- * Should the users count message be shown?
1628
- *
1629
- * @since 1.7
1630
- *
1631
- * @param array $setting Notification Setting.
1632
- *
1633
- * @return bool True if message should be shown.
1634
- */
1635
- protected function should_show_users_count_msg( $setting ) {
1636
- $users = $setting['users'];
1637
-
1638
- if ( count( $users ) > 200 ) {
1639
- return true;
1640
- }
1641
-
1642
- $emails = BNFW::factory()->engine->get_emails_from_users( $users );
1643
-
1644
- if ( count( $emails ) > 200 ) {
1645
- return true;
1646
- }
1647
-
1648
- return false;
1649
- }
1650
- }
 
1
+ <?php
2
+
3
+ /**
4
+ * BNFW Notification.
5
+ *
6
+ * @since 1.0
7
+ */
8
+ class BNFW_Notification {
9
+
10
+ const POST_TYPE = 'bnfw_notification';
11
+ const META_KEY_PREFIX = 'bnfw_';
12
+ const TEST_MAIL_ARG = 'test-mail';
13
+
14
+ /**
15
+ *
16
+ */
17
+ public function __construct() {
18
+ add_action( 'init', array( $this, 'register_post_type' ) );
19
+ add_action( 'do_meta_boxes', array( $this, 'remove_meta_boxes' ) );
20
+ add_action( 'add_meta_boxes_' . self::POST_TYPE, array( $this, 'add_meta_boxes' ) );
21
+ add_action( 'save_post', array( $this, 'save_meta_data' ) );
22
+ add_action( 'edit_form_top', array( $this, 'admin_notices' ) );
23
+ add_filter( 'post_updated_messages', array( $this, 'post_updated_messages' ) );
24
+
25
+ add_filter( 'use_block_editor_for_post_type', array( $this, 'disable_gutenberg_for_notification' ), 10, 2 );
26
+
27
+ add_filter( 'bulk_actions-edit-bnfw_notification', array( $this, 'add_custom_edit_action' ) );
28
+ add_filter( 'handle_bulk_actions-edit-bnfw_notification', array( $this, 'handle_custom_edit_action' ), 10, 3 );
29
+
30
+ // Custom row actions.
31
+ add_filter( 'post_row_actions', array( $this, 'custom_row_actions' ), 10, 2 );
32
+ add_action( 'admin_init', array( $this, 'handle_actions' ) );
33
+
34
+ // Custom columns
35
+ add_filter( sprintf( 'manage_%s_posts_columns', self::POST_TYPE ), array( $this, 'columns_header' ) );
36
+ add_action( sprintf( 'manage_%s_posts_custom_column', self::POST_TYPE ), array( $this, 'custom_column_row' ), 10, 2 );
37
+
38
+ // Enqueue scripts/styles and disables autosave for this post type.
39
+ add_action( 'admin_enqueue_scripts', array( $this, 'is_assets_needed' ) );
40
+
41
+ add_action( 'admin_notices', array( $this, 'show_help_notice' ) );
42
+
43
+ add_action('admin_print_scripts',array($this,'gutenberg_flag'));
44
+ }
45
+
46
+ /**
47
+ * Flag variable to check if gutenberge is active
48
+ * added fix for gutenberge
49
+ *
50
+ * @since 1.3
51
+ */
52
+ public function gutenberg_flag(){
53
+ $bnfw = BNFW::Factory();
54
+ ?>
55
+ <script type="text/javascript">
56
+ var bnfw_gutenberge_is_active = <?php echo ($bnfw->is_gutenberg_active())? 'true;' : 'false;'; ?>
57
+ </script>
58
+ <?php
59
+ }
60
+
61
+
62
+ /**
63
+ * Register bnfw_notification custom post type.
64
+ *
65
+ * @since 1.0
66
+ */
67
+ public function register_post_type() {
68
+ register_post_type( self::POST_TYPE, array(
69
+ 'labels' => array(
70
+ 'name' => esc_html__( 'Notifications', 'bnfw' ),
71
+ 'singular_name' => esc_html__( 'Notification', 'bnfw' ),
72
+ 'add_new' => esc_html__( 'Add New', 'bnfw' ),
73
+ 'menu_name' => esc_html__( 'Notifications', 'bnfw' ),
74
+ 'name_admin_bar' => esc_html__( 'Notifications', 'bnfw' ),
75
+ 'add_new_item' => esc_html__( 'Add New Notification', 'bnfw' ),
76
+ 'edit_item' => esc_html__( 'Edit Notification', 'bnfw' ),
77
+ 'new_item' => esc_html__( 'New Notification', 'bnfw' ),
78
+ 'view_item' => esc_html__( 'View Notification', 'bnfw' ),
79
+ 'search_items' => esc_html__( 'Search Notifications', 'bnfw' ),
80
+ 'not_found' => esc_html__( 'No Notifications found', 'bnfw' ),
81
+ 'not_found_in_trash' => esc_html__( 'No Notifications found in trash', 'bnfw' ),
82
+ 'all_items' => esc_html__( 'All Notifications', 'bnfw' ),
83
+ ),
84
+ 'public' => false,
85
+ 'show_in_nav_menus' => true,
86
+ 'show_in_admin_bar' => true,
87
+ 'has_archive' => false,
88
+ 'show_ui' => true,
89
+ 'show_in_menu' => true,
90
+ 'menu_icon' => 'dashicons-email-alt',
91
+ 'menu_position' => 101,
92
+ 'rewrite' => false,
93
+ 'map_meta_cap' => false,
94
+ 'capabilities' => array(
95
+
96
+ // meta caps (don't assign these to roles)
97
+ 'edit_post' => 'bnfw',
98
+ 'read_post' => 'bnfw',
99
+ 'delete_post' => 'bnfw',
100
+
101
+ // primitive/meta caps
102
+ 'create_posts' => 'bnfw',
103
+
104
+ // primitive caps used outside of map_meta_cap()
105
+ 'edit_posts' => 'bnfw',
106
+ 'edit_others_posts' => 'bnfw',
107
+ 'publish_posts' => 'bnfw',
108
+ 'read_private_posts' => 'bnfw',
109
+
110
+ // primitive caps used inside of map_meta_cap()
111
+ 'read' => 'bnfw',
112
+ 'delete_posts' => 'bnfw',
113
+ 'delete_private_posts' => 'bnfw',
114
+ 'delete_published_posts' => 'bnfw',
115
+ 'delete_others_posts' => 'bnfw',
116
+ 'edit_private_posts' => 'bnfw',
117
+ 'edit_published_posts' => 'bnfw',
118
+ ),
119
+
120
+ // What features the post type supports.
121
+ 'supports' => array(
122
+ 'title',
123
+ ),
124
+ ) );
125
+ }
126
+
127
+ /**
128
+ * Remove unwanted meta boxes.
129
+ *
130
+ * @since 1.0
131
+ */
132
+ public function remove_meta_boxes() {
133
+ remove_meta_box( 'submitdiv', self::POST_TYPE, 'side' );
134
+ remove_meta_box( 'slugdiv', self::POST_TYPE, 'normal' );
135
+ }
136
+
137
+ /**
138
+ * Add meta box to the post editor screen.
139
+ *
140
+ * @since 1.0
141
+ */
142
+ public function add_meta_boxes() {
143
+ global $post;
144
+
145
+ add_meta_box(
146
+ 'bnfw-post-notification', // Unique ID
147
+ esc_html__( 'Notification Settings', 'bnfw' ), // Title
148
+ array( $this, 'render_settings_meta_box' ), // Callback function
149
+ self::POST_TYPE, // Admin page (or post type)
150
+ 'normal', // Context
151
+ 'default'
152
+ );
153
+
154
+ add_meta_box(
155
+ 'bnfw_submitdiv',
156
+ __( 'Save Notification', 'bnfw' ),
157
+ array( $this, 'render_submitdiv' ),
158
+ self::POST_TYPE,
159
+ 'side',
160
+ 'core'
161
+ );
162
+
163
+ if ( self::POST_TYPE !== get_post_type( $post ) ) {
164
+ return;
165
+ }
166
+
167
+ do_action( 'bnfw_after_metaboxes', $this->read_settings( $post->ID ) );
168
+ }
169
+
170
+ /**
171
+ * Disable Gutenberg for notifications.
172
+ *
173
+ * @param bool $is_enabled Is Gutenberg enabled?
174
+ * @param string $post_type Post Type.
175
+ *
176
+ * @return bool Should Gutenberg be enabled?
177
+ */
178
+ public function disable_gutenberg_for_notification( $is_enabled, $post_type ) {
179
+ if ( self::POST_TYPE === $post_type ) {
180
+ return false;
181
+ }
182
+
183
+ return $is_enabled;
184
+ }
185
+
186
+ /**
187
+ * Render the settings meta box.
188
+ *
189
+ * @since 1.0
190
+ *
191
+ * @param WP_Post $post
192
+ */
193
+ public function render_settings_meta_box( $post ) {
194
+ global $wp_version;
195
+
196
+ wp_nonce_field( self::POST_TYPE, self::POST_TYPE . '_nonce' );
197
+
198
+ $setting = $this->read_settings( $post->ID );
199
+ ?>
200
+ <table class="form-table">
201
+ <tbody>
202
+ <tr valign="top">
203
+ <th scope="row">
204
+ <label for="notification"><?php esc_html_e( 'Notification For', 'bnfw' ); ?></label>
205
+ <div class="bnfw-help-tip"><p><?php esc_html_e( 'E.g. If you select "New Post Published" from the list on the right, this notification will be sent when a new post is published.', 'bnfw' ); ?></p></div>
206
+ </th>
207
+ <td>
208
+ <select name="notification" id="notification" class="select2"
209
+ data-placeholder="<?php _e( 'Select the notification type', 'bnfw' ); ?>" style="width:75%">
210
+ <optgroup label="<?php _e( 'Admin', 'bnfw' ); ?>">
211
+ <option
212
+ value="admin-user" <?php selected( 'admin-user', $setting['notification'] ); ?>><?php esc_html_e( 'New User Registration - For Admin', 'bnfw' ); ?></option>
213
+ <option
214
+ value="admin-password" <?php selected( 'admin-password', $setting['notification'] ); ?>><?php esc_html_e( 'User Lost Password - For Admin', 'bnfw' ); ?></option>
215
+ <option
216
+ value="admin-password-changed" <?php selected( 'admin-password-changed', $setting['notification'] ); ?>><?php esc_html_e( 'Password Changed - For Admin', 'bnfw' ); ?></option>
217
+ <option
218
+ value="admin-email-changed" <?php selected( 'admin-email-changed', $setting['notification'] ); ?>><?php esc_html_e( 'User Email Changed - For Admin', 'bnfw' ); ?></option>
219
+ <option
220
+ value="admin-role" <?php selected( 'admin-role', $setting['notification'] ); ?>><?php esc_html_e( 'User Role Changed - For Admin', 'bnfw' ); ?></option>
221
+ <option
222
+ value="admin-user-login" <?php selected( 'admin-user-login', $setting['notification'] ); ?>><?php esc_html_e( 'User Logged In - For Admin', 'bnfw' ); ?></option>
223
+ <option
224
+ value="core-updated" <?php selected( 'core-updated', $setting['notification'] ); ?>><?php esc_html_e( 'WordPress Core Automatic Background Updates', 'bnfw' ); ?></option>
225
+
226
+ <?php if ( version_compare( $wp_version, '4.9.6' ) >= 0 ) : ?>
227
+ <option value="uc-export-data" <?php selected( 'uc-export-data', $setting['notification'] ); ?>>
228
+ <?php esc_html_e( 'Privacy - Confirm Action: Export Data Request - For Admin', 'bnfw' ); ?>
229
+ </option>
230
+
231
+ <option value="uc-erase-data" <?php selected( 'uc-erase-data', $setting['notification'] ); ?>>
232
+ <?php esc_html_e( 'Privacy - Confirm Action: Erase Data Request - For Admin', 'bnfw' ); ?>
233
+ </option>
234
+ <?php endif; ?>
235
+
236
+ <?php do_action( 'bnfw_after_default_notifications', $setting ); ?>
237
+ </optgroup>
238
+ <?php do_action( 'bnfw_after_default_notifications_optgroup', $setting ); ?>
239
+
240
+ <optgroup label="<?php _e( 'Transactional', 'bnfw' ); ?>">
241
+ <option
242
+ value="new-user" <?php selected( 'new-user', $setting['notification'] ); ?>><?php esc_html_e( 'New User Registration - For User', 'bnfw' ); ?></option>
243
+ <option
244
+ value="welcome-email" <?php selected( 'welcome-email', $setting['notification'] ); ?>><?php esc_html_e( 'New User - Post-registration Email', 'bnfw' ); ?></option>
245
+ <option
246
+ value="user-password" <?php selected( 'user-password', $setting['notification'] ); ?>><?php esc_html_e( 'User Lost Password - For User', 'bnfw' ); ?></option>
247
+ <option
248
+ value="password-changed" <?php selected( 'password-changed', $setting['notification'] ); ?>><?php esc_html_e( 'Password Changed - For User', 'bnfw' ); ?></option>
249
+ <option value="email-changing" <?php selected( 'email-changing', $setting['notification'] ); ?>>
250
+ <?php esc_html_e( 'User Email Changed Confirmation - For User', 'bnfw' ); ?>
251
+ </option>
252
+ <option
253
+ value="email-changed" <?php selected( 'email-changed', $setting['notification'] ); ?>><?php esc_html_e( 'User Email Changed - For User', 'bnfw' ); ?></option>
254
+ <option
255
+ value="user-role" <?php selected( 'user-role', $setting['notification'] ); ?>><?php esc_html_e( 'User Role Changed - For User', 'bnfw' ); ?></option>
256
+ <option
257
+ value="user-login" <?php selected( 'user-login', $setting['notification'] ); ?>><?php esc_html_e( 'User Logged In - For User', 'bnfw' ); ?></option>
258
+ <option
259
+ value="reply-comment" <?php selected( 'reply-comment', $setting['notification'] ); ?>><?php esc_html_e( 'Comment Reply', 'bnfw' ); ?></option>
260
+
261
+ <?php if ( version_compare( $wp_version, '4.9.6' ) >= 0 ) : ?>
262
+ <option value="ca-export-data" <?php selected( 'ca-export-data', $setting['notification'] ); ?>>
263
+ <?php esc_html_e( 'Privacy - Confirm Action: Export Data Request - For User', 'bnfw' ); ?>
264
+ </option>
265
+
266
+ <option value="ca-erase-data" <?php selected( 'ca-erase-data', $setting['notification'] ); ?>>
267
+ <?php esc_html_e( 'Privacy - Confirm Action: Erase Data Request - For User', 'bnfw' ); ?>
268
+ </option>
269
+
270
+ <option value="data-export" <?php selected( 'data-export', $setting['notification'] ); ?>>
271
+ <?php esc_html_e( 'Privacy - Data Export - For User', 'bnfw' ); ?>
272
+ </option>
273
+
274
+ <option value="data-erased" <?php selected( 'data-erased', $setting['notification'] ); ?>>
275
+ <?php esc_html_e( 'Privacy - Data Erased - For User', 'bnfw' ); ?>
276
+ </option>
277
+ <?php endif; ?>
278
+
279
+ <?php do_action( 'bnfw_after_transactional_notifications', $setting ); ?>
280
+ </optgroup>
281
+ <?php do_action( 'bnfw_after_transactional_notifications_optgroup', $setting ); ?>
282
+
283
+ <optgroup label="Posts">
284
+ <option
285
+ value="new-post" <?php selected( 'new-post', $setting['notification'] ); ?>><?php esc_html_e( 'New Post Published', 'bnfw' ); ?></option>
286
+ <option
287
+ value="update-post" <?php selected( 'update-post', $setting['notification'] ); ?>><?php esc_html_e( 'Post Updated', 'bnfw' ); ?></option>
288
+ <option
289
+ value="pending-post" <?php selected( 'pending-post', $setting['notification'] ); ?>><?php esc_html_e( 'Post Pending Review', 'bnfw' ); ?></option>
290
+ <option
291
+ value="private-post" <?php selected( 'private-post', $setting['notification'] ); ?>><?php esc_html_e( 'New Private Post', 'bnfw' ); ?></option>
292
+ <option
293
+ value="future-post" <?php selected( 'future-post', $setting['notification'] ); ?>><?php esc_html_e( 'Post Scheduled', 'bnfw' ); ?></option>
294
+ <option
295
+ value="trash-post" <?php selected( 'trash-post', $setting['notification'] ); ?>><?php esc_html_e( 'Published Post Moved to Trash', 'bnfw' ); ?></option>
296
+ <option value="new-comment" <?php selected( 'new-comment', $setting['notification'] ); ?>>
297
+ <?php esc_html_e( 'New Comment', 'bnfw' ); ?>
298
+ </option>
299
+ <option value="moderate-post-comment" <?php selected( 'moderate-post-comment', $setting['notification'] ); ?>>
300
+ <?php esc_html_e( 'New Comment Awaiting Moderation', 'bnfw' ); ?>
301
+ </option>
302
+ <option value="approve-post-comment" <?php selected( 'approve-post-comment', $setting['notification'] ); ?>>
303
+ <?php esc_html_e( 'Post - Comment Approved', 'bnfw' ); ?>
304
+ </option>
305
+ <option
306
+ value="newterm-category" <?php selected( 'newterm-category', $setting['notification'] ); ?>><?php esc_html_e( 'New Category', 'bnfw' ); ?></option>
307
+ <option
308
+ value="newterm-post_tag" <?php selected( 'newterm-post_tag', $setting['notification'] ); ?>><?php esc_html_e( 'New Tag', 'bnfw' ); ?></option>
309
+ <option
310
+ value="new-trackback" <?php selected( 'new-trackback', $setting['notification'] ); ?>><?php esc_html_e( 'New Trackback', 'bnfw' ); ?></option>
311
+ <option
312
+ value="new-pingback" <?php selected( 'new-pingback', $setting['notification'] ); ?>><?php esc_html_e( 'New Pingback', 'bnfw' ); ?></option>
313
+ <?php do_action( 'bnfw_after_notification_options', 'post', 'Post', $setting ); ?>
314
+ </optgroup>
315
+ <?php do_action( 'bnfw_after_notification_options_optgroup', 'post', 'Post', $setting ); ?>
316
+
317
+ <optgroup label="Page">
318
+ <option
319
+ value="new-page" <?php selected( 'new-page', $setting['notification'] ); ?>><?php esc_html_e( 'New Page Published', 'bnfw' ); ?></option>
320
+ <option
321
+ value="update-page" <?php selected( 'update-page', $setting['notification'] ); ?>><?php esc_html_e( 'Page Updated', 'bnfw' ); ?></option>
322
+ <option
323
+ value="pending-page" <?php selected( 'pending-page', $setting['notification'] ); ?>><?php esc_html_e( 'Page Pending Review', 'bnfw' ); ?></option>
324
+ <option
325
+ value="private-page" <?php selected( 'private-page', $setting['notification'] ); ?>><?php esc_html_e( 'New Private Page', 'bnfw' ); ?></option>
326
+ <option
327
+ value="future-page" <?php selected( 'future-page', $setting['notification'] ); ?>><?php esc_html_e( 'Page Scheduled', 'bnfw' ); ?></option>
328
+ <option
329
+ value="comment-page" <?php selected( 'comment-page', $setting['notification'] ); ?>><?php esc_html_e( 'Page - New Comment', 'bnfw' ); ?></option>
330
+ <option value="moderate-page-comment" <?php selected( 'moderate-page-comment', $setting['notification'] ); ?>>
331
+ <?php esc_html_e( 'Page - New Comment Awaiting Moderation', 'bnfw' ); ?>
332
+ </option>
333
+ <option value="approve-page-comment" <?php selected( 'approve-page-comment', $setting['notification'] ); ?>>
334
+ <?php esc_html_e( 'Page - Comment Approved', 'bnfw' ); ?>
335
+ </option>
336
+ <option
337
+ value="commentreply-page" <?php selected( 'commentreply-page', $setting['notification'] ); ?>><?php esc_html_e( 'Page - Comment Reply', 'bnfw' ); ?></option>
338
+ <?php do_action( 'bnfw_after_notification_options', 'page', 'Page', $setting ); ?>
339
+ </optgroup>
340
+ <?php do_action( 'bnfw_after_notification_options_optgroup', 'page', 'Page', $setting ); ?>
341
+
342
+ <optgroup label="Media">
343
+ <option
344
+ value="new-media" <?php selected( 'new-media', $setting['notification'] ); ?>><?php esc_html_e( 'New Media Published', 'bnfw' ); ?></option>
345
+ <option
346
+ value="update-media" <?php selected( 'update-media', $setting['notification'] ); ?>><?php esc_html_e( 'Media Updated', 'bnfw' ); ?></option>
347
+ <option
348
+ value="comment-attachment" <?php selected( 'comment-attachment', $setting['notification'] ); ?>><?php esc_html_e( 'Media - New Comment', 'bnfw' ); ?></option>
349
+ <option value="approve-attachment-comment" <?php selected( 'approve-attachment-comment', $setting['notification'] ); ?>>
350
+ <?php esc_html_e( 'Media - Comment Approved', 'bnfw' ); ?>
351
+ </option>
352
+ <option value="moderate-attachment-comment" <?php selected( 'moderate-attachment-comment', $setting['notification'] ); ?>>
353
+ <?php esc_html_e( 'Media - New Comment Awaiting Moderation', 'bnfw' ); ?></option>
354
+ <option
355
+ value="commentreply-attachment" <?php selected( 'commentreply-attachment', $setting['notification'] ); ?>><?php esc_html_e( 'Media - Comment Reply', 'bnfw' ); ?></option>
356
+ <?php do_action( 'bnfw_after_notification_options', 'media', 'Media', $setting ); ?>
357
+ </optgroup>
358
+ <?php do_action( 'bnfw_after_notification_options_optgroup', 'media', 'Media', $setting ); ?>
359
+
360
+ <?php
361
+ $types = apply_filters( 'bnfw_notification_dropdown_posttypes', get_post_types( array(
362
+ 'public' => true,
363
+ '_builtin' => false,
364
+ ), 'names'
365
+ ) );
366
+
367
+ foreach ( $types as $type ) {
368
+ if ( $type != self::POST_TYPE ) {
369
+ $post_obj = get_post_type_object( $type );
370
+ $label = $post_obj->labels->singular_name;
371
+ ?>
372
+ <optgroup
373
+ label="<?php esc_attr( printf( "%s - '%s'", esc_html__( 'Custom Post Type', 'bnfw' ), $label ) ); ?>">
374
+ <option
375
+ value="new-<?php echo esc_attr( $type ); ?>" <?php selected( 'new-' . $type, $setting['notification'] ); ?>><?php echo esc_html__( 'New ', 'bnfw' ), "'$label'", esc_html__( ' Published', 'bnfw' ); ?></option>
376
+ <option
377
+ value="update-<?php echo esc_attr( $type ); ?>" <?php selected( 'update-' . $type, $setting['notification'] ); ?>><?php echo "'$label' " . esc_html__( 'Updated', 'bnfw' ); ?></option>
378
+ <option
379
+ value="pending-<?php echo esc_attr( $type ); ?>" <?php selected( 'pending-' . $type, $setting['notification'] ); ?>><?php echo "'$label' ", esc_html__( 'Pending Review', 'bnfw' ); ?></option>
380
+ <option
381
+ value="private-<?php echo esc_attr( $type ); ?>" <?php selected( 'private-' . $type, $setting['notification'] ); ?>><?php echo esc_html__( 'New Private ', 'bnfw' ), "'$label'"; ?></option>
382
+ <option
383
+ value="future-<?php echo esc_attr( $type ); ?>" <?php selected( 'future-' . $type, $setting['notification'] ); ?>><?php echo "'$label' ", esc_html__( 'Scheduled', 'bnfw' ); ?></option>
384
+ <option
385
+ value="comment-<?php echo esc_attr( $type ); ?>" <?php selected( 'comment-' . $type, $setting['notification'] ); ?>><?php echo "'$label' ", esc_html__( 'New Comment', 'bnfw' ); ?></option>
386
+ <option value="moderate-<?php echo esc_attr( $type ); ?>-comment" <?php selected( 'moderate-' . $type . '-comment', $setting['notification'] ); ?>>
387
+ <?php echo "'$label' - ", esc_html__( 'New Comment Awaiting Moderation', 'bnfw' ); ?>
388
+ </option>
389
+ <option value="approve-<?php echo esc_attr( $type ); ?>-comment" <?php selected( 'approve-' . $type . '-comment', $setting['notification'] ); ?>>
390
+ <?php echo "'$label' - ", esc_html__( 'Comment Approved', 'bnfw' ); ?>
391
+ </option>
392
+ <option
393
+ value="commentreply-<?php echo esc_attr( $type ); ?>" <?php selected( 'commentreply-' . $type, $setting['notification'] ); ?>><?php echo "'$label' ", esc_html__( 'Comment Reply', 'bnfw' ); ?></option>
394
+ <?php do_action( 'bnfw_after_notification_options', $type, $label, $setting ); ?>
395
+ </optgroup>
396
+ <?php do_action( 'bnfw_after_notification_options_optgroup', $type, $label, $setting ); ?>
397
+
398
+ <?php
399
+ }
400
+ }
401
+
402
+ $taxs = apply_filters( 'bnfw_notification_dropdown_taxonomies', get_taxonomies(
403
+ array(
404
+ 'public' => true,
405
+ '_builtin' => false,
406
+ ),
407
+ 'objects'
408
+ ) );
409
+
410
+ if ( count( $taxs ) > 0 ) {
411
+ ?>
412
+ <optgroup label="<?php esc_html_e( 'Custom Taxonomy', 'bnfw' ); ?>">
413
+ <?php
414
+ foreach ( $taxs as $tax ) {
415
+ $tax_name = 'newterm-' . $tax->name;
416
+ ?>
417
+ <option
418
+ value="<?php echo esc_attr( $tax_name ); ?>" <?php selected( $tax_name, $setting['notification'] ); ?>><?php printf( "%s '%s'", esc_html__( 'New', 'bnfw' ), $tax->labels->name ); ?></option>
419
+ <?php
420
+ }
421
+ ?>
422
+ </optgroup>
423
+ <?php
424
+ }
425
+ do_action( 'bnfw_after_notification_optgroups', $setting );
426
+ ?>
427
+ </select>
428
+ </td>
429
+ </tr>
430
+
431
+ <?php do_action( 'bnfw_after_notification_dropdown', $setting ); ?>
432
+
433
+ <tr valign="top" id="user-password-msg">
434
+ <td>&nbsp;</td>
435
+ <td>
436
+ <div>
437
+ <p style="margin-top: 0;"><?php esc_html_e( "This notification doesn't support additional email fields due to a limitation in WordPress.", 'bnfw' ); ?></p>
438
+ </div>
439
+ </td>
440
+ </tr>
441
+
442
+ <tr valign="top" id="email-formatting">
443
+ <th>
444
+ <?php esc_html_e( 'Email Formatting', 'bnfw' ); ?>
445
+ <div class="bnfw-help-tip"><p><?php esc_html_e( 'How do you want to format the sent email? HTML is recommended as it\'ll show images and links correctly.', 'bnfw' ); ?></p></div>
446
+ </th>
447
+ <td>
448
+ <label style="margin-right: 20px;">
449
+ <input type="radio" name="email-formatting"
450
+ value="html" <?php checked( 'html', $setting['email-formatting'] ); ?>>
451
+ <?php esc_html_e( 'HTML Formatting', 'bnfw' ); ?>
452
+ </label>
453
+
454
+ <label>
455
+ <input type="radio" name="email-formatting"
456
+ value="text" <?php checked( 'text', $setting['email-formatting'] ); ?>>
457
+ <?php esc_html_e( 'Plain Text', 'bnfw' ); ?>
458
+ </label>
459
+ </td>
460
+ </tr>
461
+
462
+ <?php do_action( 'bnfw_after_email_formatting', $setting ); ?>
463
+
464
+ <tr valign="top" id="toggle-fields">
465
+ <th>
466
+ <?php esc_html_e( 'Additional Email Fields', 'bnfw' ); ?>
467
+ <div class="bnfw-help-tip"><p><?php esc_html_e( 'This should be fairly self explanatory but if you\'re unsure, tick this checkbox and have a look at the available options. You can always untick it again should you decide you don\'t need to use it.', 'bnfw' ); ?></p></div>
468
+ </th>
469
+ <td>
470
+ <input type="checkbox" id="show-fields" name="show-fields"
471
+ value="true" <?php checked( $setting['show-fields'], 'true', true ); ?>>
472
+ <label for="show-fields"><?php esc_html_e( 'Set "From" Name & Email, Reply To, CC, BCC', 'bnfw' ); ?></label>
473
+ </td>
474
+ </tr>
475
+
476
+
477
+ <tr valign="top" id="email">
478
+ <th scope="row">
479
+ <?php esc_html_e( 'From Name and Email', 'bnfw' ); ?>
480
+ <div class="bnfw-help-tip"><p><?php esc_html_e( 'If you want to send the email from your site name and email address instead of the default "WordPress" from "wordpress@domain.com", this is where you can do it.', 'bnfw' ); ?></p></div>
481
+ </th>
482
+ <td>
483
+ <input type="text" name="from-name" value="<?php echo esc_attr( $setting['from-name'] ); ?>"
484
+ placeholder="<?php _e( 'Site Name', 'bnfw' ); ?>" style="width: 37.35%">
485
+ <input type="text" name="from-email" value="<?php echo esc_attr( $setting['from-email'] ); ?>"
486
+ placeholder="<?php _e( 'Site Email', 'bnfw' ); ?>" style="width: 37.3%">
487
+ </td>
488
+ </tr>
489
+
490
+
491
+ <tr valign="top" id="reply">
492
+ <th scope="row">
493
+ <?php esc_html_e( 'Reply To', 'bnfw' ); ?>
494
+ <div class="bnfw-help-tip"><p><?php esc_html_e( 'If you want any replies to your email notification to go to another person, fill in this box with their name and email address.', 'bnfw' ); ?></p></div>
495
+ </th>
496
+ <td>
497
+ <input type="text" name="reply-name" value="<?php echo esc_attr( $setting['reply-name'] ); ?>"
498
+ placeholder="<?php _e( 'Name', 'bnfw' ); ?>" style="width: 37.35%">
499
+ <input type="text" name="reply-email" value="<?php echo esc_attr( $setting['reply-email'] ); ?>"
500
+ placeholder="<?php _e( 'Email', 'bnfw' ); ?>" style="width: 37.3%">
501
+ </td>
502
+ </tr>
503
+
504
+ <tr valign="top" id="cc">
505
+ <th scope="row">
506
+ <?php esc_html_e( 'CC', 'bnfw' ); ?>
507
+ <div class="bnfw-help-tip"><p><?php esc_html_e( 'Publicly copy in any other users or user roles to this email.', 'bnfw' ); ?></p></div>
508
+ </th>
509
+
510
+ <td>
511
+ <select multiple name="cc[]" class="<?php echo sanitize_html_class( bnfw_get_user_select_class() ); ?>"
512
+ data-placeholder="<?php echo apply_filters( 'bnfw_email_dropdown_placeholder', __( 'Select User Roles / Users', 'bnfw' ) ); ?>" style="width:75%">
513
+ <?php bnfw_render_users_dropdown( $setting['cc'] ); ?>
514
+ </select>
515
+ </td>
516
+ </tr>
517
+
518
+ <tr valign="top" id="bcc">
519
+ <th scope="row">
520
+ <?php esc_html_e( 'BCC', 'bnfw' ); ?>
521
+ <div class="bnfw-help-tip"><p><?php esc_html_e( 'Privately copy in any other users or user roles to this email.', 'bnfw' ); ?></p></div>
522
+ </th>
523
+
524
+ <td>
525
+ <select multiple name="bcc[]" class="<?php echo sanitize_html_class( bnfw_get_user_select_class() ); ?>"
526
+ data-placeholder="<?php echo apply_filters( 'bnfw_email_dropdown_placeholder', __( 'Select User Roles / Users', 'bnfw' ) ); ?>" style="width:75%">
527
+ <?php bnfw_render_users_dropdown( $setting['bcc'] ); ?>
528
+ </select>
529
+ </td>
530
+ </tr>
531
+
532
+ <?php do_action( 'bnfw_after_additional_email_fields', $setting ); ?>
533
+
534
+ <tr valign="top" id="post-author">
535
+ <th>
536
+ <?php esc_html_e( 'Send to Author', 'bnfw' ); ?>
537
+ <div class="bnfw-help-tip"><p><?php esc_html_e( 'E.g. If you want a new post published notification to go to the post author, tick this box.', 'bnfw' ); ?></p></div>
538
+ </th>
539
+
540
+ <td>
541
+ <label>
542
+ <input type="checkbox" id="only-post-author" name="only-post-author"
543
+ value="true" <?php checked( 'true', $setting['only-post-author'] ); ?>>
544
+ <?php esc_html_e( 'Send this notification to the Author', 'bnfw' ); ?>
545
+ </label>
546
+ </td>
547
+ </tr>
548
+
549
+ <?php do_action( 'bnfw_after_only_post_author', $setting ); ?>
550
+
551
+ <tr valign="top" id="current-user">
552
+ <th>
553
+ &nbsp;
554
+ <div class="bnfw-help-tip"><p><?php esc_html_e( 'E.g. If you\'re an editor and regularly update your posts, you might not want to be emailed about this all the time. Ticking this box will prevent you from receiving emails about your own changes.', 'bnfw' ); ?></p></div>
555
+ </th>
556
+ <td>
557
+ <label>
558
+ <input type="checkbox" name="disable-current-user"
559
+ value="true" <?php checked( 'true', $setting['disable-current-user'] ); ?>>
560
+ <?php esc_html_e( 'Do not send this Notification to the User that triggered it', 'bnfw' ); ?>
561
+ </label>
562
+ </td>
563
+ </tr>
564
+
565
+ <?php do_action( 'bnfw_after_disable_current_user', $setting ); ?>
566
+
567
+ <tr valign="top" id="users">
568
+ <th scope="row">
569
+ <?php esc_html_e( 'Send To', 'bnfw' ); ?>
570
+ <div class="bnfw-help-tip"><p><?php esc_html_e( 'Choose the users and/or user roles to send this email notification to.', 'bnfw' ); ?></p></div>
571
+ </th>
572
+ <td>
573
+ <select multiple id="users-select" name="users[]"
574
+ class="<?php echo sanitize_html_class( bnfw_get_user_select_class() ); ?>"
575
+ data-placeholder="<?php echo apply_filters( 'bnfw_email_dropdown_placeholder', __( 'Select User Roles / Users', 'bnfw' ) ); ?>" style="width:75%">
576
+ <?php bnfw_render_users_dropdown( $setting['users'] ); ?>
577
+ </select>
578
+ </td>
579
+ </tr>
580
+
581
+ <tr valign="top" id="exclude-users">
582
+ <th scope="row">
583
+ <?php esc_html_e( 'Except For', 'bnfw' ); ?>
584
+ <div class="bnfw-help-tip">
585
+ <p>
586
+ <?php esc_html_e( 'Choose the users and/or user roles that this notification should not be sent to.', 'bnfw' ); ?>
587
+ </p>
588
+ </div>
589
+ </th>
590
+ <td>
591
+ <select multiple id="exclude-users-select" name="exclude-users[]"
592
+ class="<?php echo sanitize_html_class( bnfw_get_user_select_class() ); ?>"
593
+ data-placeholder="<?php echo apply_filters( 'bnfw_email_dropdown_placeholder', __( 'Select User Roles / Users', 'bnfw' ) ); ?>" style="width:75%">
594
+ <?php bnfw_render_users_dropdown( $setting['exclude-users'] ); ?>
595
+ </select>
596
+ </td>
597
+ </tr>
598
+
599
+ <?php
600
+ $display = 'none';
601
+
602
+ if ( $this->should_show_users_count_msg( $setting ) ) {
603
+ $display = 'table-row';
604
+ }
605
+ ?>
606
+ <tr valign="top" id="users-count-msg" style="display: <?php echo esc_attr( $display ); ?>">
607
+ <th scope="row">&nbsp;</th>
608
+ <td>
609
+ <div>
610
+ <p>
611
+ <?php _e( 'You have chosen to send this notification to over 200 users. Please check the email sending rate limit at your host before sending.', 'bnfw' ); ?>
612
+ </p>
613
+ </div>
614
+ </td>
615
+ </tr>
616
+
617
+ <?php do_action( 'bnfw_after_send_to', $setting ); ?>
618
+
619
+ <tr valign="top" id="subject-wrapper">
620
+ <th scope="row">
621
+ <?php esc_html_e( 'Subject', 'bnfw' ); ?>
622
+ <div class="bnfw-help-tip"><p><?php esc_html_e( 'Notification subject. You can use ', 'bnfw' ); ?><a href="https://betternotificationsforwp.com/documentation/notifications/shortcodes/" target="_blank">shortcodes</a><?php esc_html_e(' here.', 'bnfw' ); ?></p></div>
623
+ </th>
624
+ <td>
625
+ <input type="text" name="subject" id="subject" value="<?php echo esc_attr( $setting['subject'] ); ?>"
626
+ style="width:75%;">
627
+ </td>
628
+ </tr>
629
+
630
+ <?php do_action( 'bnfw_after_user_dropdown', $setting ); ?>
631
+
632
+ <?php do_action( 'bnfw_before_message_body', $setting ); ?>
633
+ <tr valign="top">
634
+ <th scope="row">
635
+ <?php esc_html_e( 'Message Body', 'bnfw' ); ?>
636
+ <div class="bnfw-help-tip"><p><?php esc_html_e( 'Notification message. You can use ', 'bnfw' ); ?><a href="https://betternotificationsforwp.com/documentation/notifications/shortcodes/" target="_blank">shortcodes</a><?php esc_html_e(' here.', 'bnfw' ); ?></p></div>
637
+
638
+ <div class="wp-ui-text-highlight">
639
+ <p>
640
+ <br>
641
+ <br>
642
+ <br>
643
+ <br>
644
+ <?php esc_html_e( 'Need some more help?', 'bnfw' ); ?>
645
+ </p>
646
+ <?php
647
+ $doc_url = 'https://betternotificationsforwp.com/documentation/';
648
+
649
+ if ( bnfw_is_tracking_allowed() ) {
650
+ $doc_url .= "?utm_source=WP%20Admin%20Notification%20Editor%20-%20'Documentation'&amp;utm_medium=referral";
651
+ }
652
+ ?>
653
+ <p>
654
+ <a href="#" class="button-secondary" id="insert-default-msg"><?php esc_html_e( 'Insert Default Content', 'bnfw' ); ?></a>
655
+ </p>
656
+ <p>
657
+ <a href="<?php echo $doc_url; ?>"
658
+ target="_blank" class="button-secondary"><?php esc_html_e( 'Read Documentation', 'bnfw' ); ?></a>
659
+ </p>
660
+ <p>
661
+ <a href="" target="_blank" id="shortcode-help"
662
+ class="button-secondary"><?php esc_html_e( 'Find Shortcodes', 'bnfw' ); ?></a>
663
+ </p>
664
+ </div>
665
+ </th>
666
+ <td>
667
+ <?php wp_editor( $setting['message'], 'notification_message', array( 'media_buttons' => true ) ); ?>
668
+ <p> &nbsp; </p>
669
+ <div id="disable-autop">
670
+ <label>
671
+ <input type="checkbox" name="disable-autop"
672
+ value="true" <?php checked( 'true', $setting['disable-autop'] ); ?>>
673
+ <?php esc_html_e( 'Stop additional paragraph and line break HTML from being inserted into my notifications', 'bnfw' ); ?>
674
+ </label>
675
+ </div>
676
+ </td>
677
+ </tr>
678
+
679
+ </tbody>
680
+ </table>
681
+ <?php
682
+ }
683
+
684
+ /**
685
+ * Should we enqueue assets?
686
+ *
687
+ * @since 1.0
688
+ *
689
+ * @param $hook_suffix
690
+ */
691
+ public function is_assets_needed( $hook_suffix ) {
692
+ if ( self::POST_TYPE === get_post_type() || 'bnfw_notification_page_bnfw-settings' === $hook_suffix ) {
693
+ // The enqueue assets function may be included from addons.
694
+ // We want to disable autosave only for notifications
695
+ wp_dequeue_script( 'autosave' );
696
+
697
+ $this->enqueue_assets();
698
+
699
+ do_action( 'bnfw_after_enqueue_scripts' );
700
+ }
701
+ }
702
+
703
+ /**
704
+ * Enqueue assets.
705
+ *
706
+ * @since 1.4
707
+ */
708
+ public function enqueue_assets() {
709
+ wp_deregister_script( 'select2' );
710
+ wp_dequeue_script( 'select2' );
711
+ wp_deregister_style( 'select2' );
712
+ wp_dequeue_style( 'select2' );
713
+
714
+ // Ultimate Member plugin is giving us problems. They should upgrade
715
+ wp_deregister_script( 'um_minified' );
716
+ wp_dequeue_script( 'um_minified' );
717
+ wp_deregister_script( 'um_admin_scripts' );
718
+ wp_dequeue_script( 'um_admin_scripts' );
719
+
720
+ wp_enqueue_style( 'select2', '//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css', array(), '4.0.3' );
721
+ wp_enqueue_script( 'select2', '//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.full.min.js', array( 'jquery' ), '4.0.3', true );
722
+
723
+ wp_enqueue_script( 'bnfw', plugins_url( '../assets/js/bnfw.js', dirname( __FILE__ ) ), array( 'select2' ), '0.1', true );
724
+ wp_enqueue_style( 'bnfw', plugins_url( '../assets/css/bnfw.css', dirname( __FILE__ ) ), array( 'dashicons', 'select2' ), '0.1' );
725
+
726
+ $strings = array(
727
+ 'validation_element' => apply_filters( 'bnfw_validation_element', '#users-select' ),
728
+ 'empty_user' => esc_html__( 'You must choose at least one User or User Role to send the notification to before you can save', 'bnfw' ),
729
+ 'enableTags' => false,
730
+ 'bnfw_users_search_ajax_nonce' => wp_create_nonce( 'bnfw_users_search_ajax_nonce' ),
731
+ );
732
+
733
+ /**
734
+ * Filter the localized array that is sent to scripts.
735
+ *
736
+ * @since 1.7.0
737
+ */
738
+ $strings = apply_filters( 'bnfw_localize_script', $strings );
739
+
740
+ wp_localize_script( 'bnfw', 'BNFW', $strings );
741
+ }
742
+
743
+ /**
744
+ * Save the meta box's post metadata.
745
+ *
746
+ * @since 1.0
747
+ *
748
+ * @param int $post_id The ID of the post being saved.
749
+ */
750
+ public function save_meta_data( $post_id ) {
751
+ if ( self::POST_TYPE !== get_post_type( $post_id ) ) {
752
+ return;
753
+ }
754
+
755
+ // Check nonce.
756
+ if ( empty( $_POST[ self::POST_TYPE . '_nonce' ] ) ) {
757
+ return;
758
+ }
759
+
760
+ // Verify nonce.
761
+ if ( ! wp_verify_nonce( $_POST[ self::POST_TYPE . '_nonce' ], self::POST_TYPE ) ) {
762
+ return;
763
+ }
764
+
765
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
766
+ return;
767
+ }
768
+
769
+ if ( ! current_user_can( 'bnfw' ) ) {
770
+ return;
771
+ }
772
+
773
+ if ( isset( $_POST['digest-interval'] ) && 'no' != $_POST['digest-interval']) {
774
+ $subject = $_POST['subject'];
775
+ }else{
776
+ $subject = sanitize_text_field( $_POST['subject'] );
777
+ }
778
+
779
+ $setting = array(
780
+ 'notification' => sanitize_text_field( $_POST['notification'] ),
781
+ 'subject' => $subject,
782
+ 'message' => $_POST['notification_message'],
783
+ 'disabled' => isset( $_POST['disabled'] ) ? sanitize_text_field( $_POST['disabled'] ) : 'false',
784
+ 'email-formatting' => isset( $_POST['email-formatting'] ) ? sanitize_text_field( $_POST['email-formatting'] ) : 'html',
785
+ 'disable-current-user' => isset( $_POST['disable-current-user'] ) ? sanitize_text_field( $_POST['disable-current-user'] ) : 'false',
786
+ 'disable-autop' => isset( $_POST['disable-autop'] ) ? sanitize_text_field( $_POST['disable-autop'] ) : 'false',
787
+ 'only-post-author' => isset( $_POST['only-post-author'] ) ? sanitize_text_field( $_POST['only-post-author'] ) : 'false',
788
+ 'users' => array(),
789
+ 'exclude-users' => array(),
790
+ );
791
+
792
+ if ( isset( $_POST['users'] ) ) {
793
+ $setting['users'] = array_map( 'sanitize_text_field', $_POST['users'] );
794
+ }
795
+
796
+ if ( isset( $_POST['exclude-users'] ) ) {
797
+ $setting['exclude-users'] = array_map( 'sanitize_text_field', $_POST['exclude-users'] );
798
+ }
799
+
800
+ if ( isset( $_POST['show-fields'] ) && 'true' == $_POST['show-fields'] ) {
801
+ $setting['show-fields'] = 'true';
802
+ $setting['from-name'] = sanitize_text_field( $_POST['from-name'] );
803
+ $setting['from-email'] = sanitize_text_field( $_POST['from-email'] );
804
+ $setting['reply-name'] = sanitize_text_field( $_POST['reply-name'] );
805
+ $setting['reply-email'] = sanitize_text_field( $_POST['reply-email'] );
806
+ $setting['cc'] = isset( $_POST['cc'] ) ? array_map( 'sanitize_text_field', $_POST['cc'] ) : '';
807
+ $setting['bcc'] = isset( $_POST['bcc'] ) ? array_map( 'sanitize_text_field', $_POST['bcc'] ) : '';
808
+ } else {
809
+ $setting['show-fields'] = 'false';
810
+ }
811
+
812
+ $setting = apply_filters( 'bnfw_notification_setting', $setting, $_POST );
813
+
814
+ $this->save_settings( $post_id, $setting );
815
+
816
+ if ( isset( $_POST['send-test-email'] ) ) {
817
+ if ( 'true' == sanitize_text_field( $_POST['send-test-email'] ) ) {
818
+ BNFW::factory()->engine->send_test_email( $setting );
819
+ add_filter( 'redirect_post_location', array( $this, 'test_mail_sent' ) );
820
+ }
821
+ }
822
+ }
823
+
824
+ /**
825
+ * Add a query parameter to url if test email was sent.
826
+ *
827
+ * @since 1.3
828
+ */
829
+ public function test_mail_sent( $loc ) {
830
+ return add_query_arg( self::TEST_MAIL_ARG, 1, $loc );
831
+ }
832
+
833
+ /**
834
+ * Add a notification if a test email was sent.
835
+ *
836
+ * @since 1.3
837
+ */
838
+ public function admin_notices() {
839
+ if ( isset( $_GET[ self::TEST_MAIL_ARG ] ) ) {
840
+ $screen = get_current_screen();
841
+ if ( in_array( $screen->post_type, array( self::POST_TYPE ) ) ) {
842
+ ?>
843
+ <div class="updated below-h2">
844
+ <p><?php echo esc_html__( 'Test Notification Sent.', 'bnfw' ); ?></p>
845
+ </div>
846
+ <?php
847
+ }
848
+ }
849
+ }
850
+
851
+ /**
852
+ * Save settings in post meta.
853
+ *
854
+ * @since 1.0
855
+ * @access private
856
+ *
857
+ * @param $post_id
858
+ * @param $setting
859
+ */
860
+ private function save_settings( $post_id, $setting ) {
861
+ foreach ( $setting as $key => $value ) {
862
+ update_post_meta( $post_id, self::META_KEY_PREFIX . $key, $value );
863
+ }
864
+ }
865
+
866
+ /**
867
+ * Read settings from post meta.
868
+ *
869
+ * @since 1.0
870
+ *
871
+ * @param int $post_id
872
+ *
873
+ * @return array
874
+ */
875
+ public function read_settings( $post_id ) {
876
+ $setting = array();
877
+ $default = array(
878
+ 'notification' => '',
879
+ 'from-name' => '',
880
+ 'from-email' => '',
881
+ 'reply-name' => '',
882
+ 'reply-email' => '',
883
+ 'cc' => array(),
884
+ 'bcc' => array(),
885
+ 'users' => array(),
886
+ 'exclude-users' => array(),
887
+ 'subject' => '',
888
+ 'email-formatting' => get_option( 'bnfw_email_format', 'html' ),
889
+ 'message' => '',
890
+ 'show-fields' => 'false',
891
+ 'disable-current-user' => 'false',
892
+ 'disable-autop' => 'false',
893
+ 'only-post-author' => 'false',
894
+ 'disabled' => 'false',
895
+ );
896
+
897
+ $default = apply_filters( 'bnfw_notification_setting_fields', $default );
898
+
899
+ foreach ( $default as $key => $default_value ) {
900
+ $value = get_post_meta( $post_id, self::META_KEY_PREFIX . $key, true );
901
+ if ( ! empty( $value ) ) {
902
+ $setting[ $key ] = $value;
903
+ } else {
904
+ $setting[ $key ] = $default_value;
905
+ }
906
+ }
907
+
908
+ // compatibility code. This will be removed subsequently
909
+ $user_roles = get_post_meta( $post_id, self::META_KEY_PREFIX . 'user-roles', true );
910
+ if ( ! empty( $user_roles ) && is_array( $user_roles ) ) {
911
+ foreach ( $user_roles as $role ) {
912
+ $setting['users'][] = 'role-' . $role;
913
+ }
914
+
915
+ update_post_meta( $post_id, self::META_KEY_PREFIX . 'users', $setting['users'] );
916
+ delete_post_meta( $post_id, self::META_KEY_PREFIX . 'user-roles' );
917
+ }
918
+
919
+ $setting['id'] = $post_id;
920
+
921
+ return $setting;
922
+ }
923
+
924
+ /**
925
+ * Change the post updated message for notification post type.
926
+ *
927
+ * @since 1.0
928
+ *
929
+ * @param $messages
930
+ *
931
+ * @return mixed
932
+ */
933
+ public function post_updated_messages( $messages ) {
934
+ $messages[ self::POST_TYPE ] = array_fill( 0, 11, esc_html__( 'Notification saved.', 'bnfw' ) );
935
+
936
+ return $messages;
937
+ }
938
+
939
+ /**
940
+ * Render submit div meta box.
941
+ *
942
+ * @since 1.0
943
+ *
944
+ * @param $post
945
+ */
946
+ public function render_submitdiv( $post ) {
947
+ global $post;
948
+ ?>
949
+ <div class="submitbox" id="submitpost">
950
+
951
+ <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
952
+ <div style="display:none;">
953
+ <?php submit_button( esc_html__( 'Save', 'bnfw' ), 'button', 'save' ); ?>
954
+ </div>
955
+
956
+ <?php // Always publish. ?>
957
+ <div class="disable-notification-checkbox" style="padding: 5px 0 10px 0;">
958
+ <div class="bnfw-help-tip-container">
959
+ <input type="hidden" name="post_status" id="hidden_post_status" value="publish">
960
+
961
+ <div class="bnfw-help-tip"><p><?php esc_html_e( 'Use this to enable or disable notifications. If you want to disable a default WordPress notification, just create it on the left, then disable it here.', 'bnfw' ); ?></p></div>
962
+
963
+ <?php
964
+ $setting = $this->read_settings( $post->ID );
965
+ ?>
966
+ <label>
967
+ <input type="radio" name="disabled"
968
+ value="false" <?php checked( $setting['disabled'], 'false', true ); ?>><?php esc_html_e( 'Notification Enabled', 'bnfw' ); ?>
969
+ </label>
970
+
971
+ <br>
972
+
973
+ <label>
974
+ <input type="radio" name="disabled"
975
+ value="true" <?php checked( $setting['disabled'], 'true', true ); ?>><?php esc_html_e( 'Notification Disabled', 'bnfw' ); ?>
976
+ </label>
977
+ </div>
978
+
979
+ <br>
980
+ <br>
981
+
982
+ <?php if ( 'publish' == $post->post_status ) { ?>
983
+ <div class="bnfw-help-tip-container">
984
+ <input type="hidden" name="send-test-email" id="send-test-email" value="false">
985
+ <input name="test-email" type="submit" class="button button-secondary button-large" id="test-email"
986
+ value="<?php esc_attr_e( 'Send Me a Test Email', 'bnfw' ); ?>">
987
+
988
+ <div class="bnfw-help-tip"><p><?php esc_html_e( 'This will send you (the currently logged in user) a notification so that you can check for any issues with formatting – it’s doesn\'t mean that a notification will send correctly in the future. You can read about how to improve email delivery', 'bnfw'); ?> <a href="https://betternotificationsforwp.com/documentation/getting-started/how-to-improve-email-delivery/" target="_blank"><?php esc_html_e( 'here', 'bnfw'); ?></a><?php esc_html_e( '. Shortcodes will not be replaced with content.', 'bnfw' ); ?></p></div>
989
+ </div>
990
+ <?php } ?>
991
+
992
+ </div>
993
+
994
+ <div id="major-publishing-actions">
995
+
996
+ <div id="delete-action">
997
+ <?php
998
+ if ( ! EMPTY_TRASH_DAYS ) {
999
+ $delete_text = esc_html__( 'Delete Permanently', 'bnfw' );
1000
+ } else {
1001
+ $delete_text = esc_html__( 'Move to Trash', 'bnfw' );
1002
+ }
1003
+ ?>
1004
+ <a class="submitdelete deletion"
1005
+ href="<?php echo esc_url( get_delete_post_link( $post->ID ) ); ?>"><?php echo esc_html( $delete_text ); ?></a>
1006
+ </div>
1007
+
1008
+ <div id="publishing-action">
1009
+ <span class="spinner"></span>
1010
+ <input name="original_publish" type="hidden" id="original_publish"
1011
+ value="<?php esc_attr_e( 'Save', 'bnfw' ); ?>">
1012
+ <input name="save" type="submit" class="button button-primary button-large" id="publish"
1013
+ accesskey="p" value="<?php esc_attr_e( 'Save', 'bnfw' ); ?>">
1014
+ </div>
1015
+ <div class="clear"></div>
1016
+
1017
+ </div>
1018
+ <!-- #major-publishing-actions -->
1019
+
1020
+ <div class="clear"></div>
1021
+ </div>
1022
+ <!-- #submitpost -->
1023
+ <?php
1024
+ }
1025
+
1026
+ /**
1027
+ * Get notifications based on type.
1028
+ *
1029
+ * @since 1.0
1030
+ *
1031
+ * @param array|string $types
1032
+ * @param bool $exclude_disabled (optional) Whether to exclude disabled notifications or not. True by default.
1033
+ *
1034
+ * @return array WP_Post objects
1035
+ */
1036
+ public function get_notifications( $types = array(), $exclude_disabled = true ) {
1037
+ if ( ! is_array( $types ) ) {
1038
+ $types = array( $types );
1039
+ }
1040
+
1041
+ $args = array(
1042
+ 'post_type' => self::POST_TYPE,
1043
+ );
1044
+
1045
+ $meta_query = array();
1046
+
1047
+ if ( ! empty( $types ) ) {
1048
+ $meta_query[] = array(
1049
+ 'key' => self::META_KEY_PREFIX . 'notification',
1050
+ 'value' => $types,
1051
+ 'compare' => 'IN',
1052
+ );
1053
+ }
1054
+
1055
+ if ( $exclude_disabled ) {
1056
+ $meta_query[] = array(
1057
+ 'key' => self::META_KEY_PREFIX . 'disabled',
1058
+ 'value' => 'true',
1059
+ 'compare' => '!=',
1060
+ );
1061
+ }
1062
+
1063
+ if ( ! empty( $meta_query ) ) {
1064
+ $args['meta_query'] = $meta_query;
1065
+ }
1066
+
1067
+ $args['posts_per_page'] = -1;
1068
+ $args['nopagging'] = true;
1069
+
1070
+ $args = apply_filters( 'bnfw_get_notifications_args', $args, $types, $exclude_disabled );
1071
+
1072
+ $wp_query = new WP_Query();
1073
+ $posts = $wp_query->query( $args );
1074
+
1075
+ $posts = apply_filters( 'bnfw_get_notifications_posts', $posts, $args, $types, $exclude_disabled );
1076
+
1077
+ return $posts;
1078
+ }
1079
+
1080
+ /**
1081
+ * Are there any disabled notifications for a particular notification type.
1082
+ *
1083
+ * @param string $type Notification type.
1084
+ *
1085
+ * @return bool True if disabled, False otherwise.
1086
+ */
1087
+ public function is_notification_disabled( $type ) {
1088
+ $args = array(
1089
+ 'post_type' => self::POST_TYPE,
1090
+ 'posts_per_page' => - 1,
1091
+ 'nopagging' => true,
1092
+ 'fields' => 'ids',
1093
+ 'meta_query' => array(
1094
+ array(
1095
+ 'key' => self::META_KEY_PREFIX . 'notification',
1096
+ 'value' => $type,
1097
+ ),
1098
+ array(
1099
+ 'key' => self::META_KEY_PREFIX . 'disabled',
1100
+ 'value' => 'true',
1101
+ ),
1102
+ )
1103
+ );
1104
+
1105
+ $args = apply_filters( 'bnfw_is_notification_disabled_args', $args, $type );
1106
+
1107
+ $wp_query = new WP_Query();
1108
+ $posts = $wp_query->query( $args );
1109
+
1110
+ $posts = apply_filters( 'bnfw_is_notification_disabled_posts', $posts, $args, $type );
1111
+
1112
+ return count( $posts ) > 0;
1113
+ }
1114
+
1115
+ /**
1116
+ * Does a particular type of notification exists or not.
1117
+ *
1118
+ * @since 1.1
1119
+ *
1120
+ * @param string $type Notification Type.
1121
+ * @param bool $exclude_disabled (optional) Whether to exclude disabled notifications or not. True by default.
1122
+ *
1123
+ * @return bool True if present, False otherwise
1124
+ */
1125
+ public function notification_exists( $type, $exclude_disabled = true ) {
1126
+ $notifications = $this->get_notifications( $type, $exclude_disabled );
1127
+
1128
+ if ( count( $notifications ) > 0 ) {
1129
+ return true;
1130
+ } else {
1131
+ return false;
1132
+ }
1133
+ }
1134
+
1135
+ /**
1136
+ * Custom columns for this post type.
1137
+ *
1138
+ * @since 1.0
1139
+ * @filter manage_{post_type}_posts_columns
1140
+ *
1141
+ * @param array $columns
1142
+ *
1143
+ * @return array
1144
+ */
1145
+ public function columns_header( $columns ) {
1146
+ $columns['type'] = esc_html__( 'Notification Type', 'bnfw' );
1147
+ $columns['disabled'] = esc_html__( 'Enabled?', 'bnfw' );
1148
+ $columns['subject'] = esc_html__( 'Subject', 'bnfw' );
1149
+ $columns['users'] = esc_html__( 'User Roles / Users', 'bnfw' );
1150
+ $columns['excluded'] = esc_html__( 'Excluded User Roles / Users', 'bnfw' );
1151
+
1152
+ return $columns;
1153
+ }
1154
+
1155
+ /**
1156
+ * Custom column appears in each row.
1157
+ *
1158
+ * @since 1.0
1159
+ * @action manage_{post_type}_posts_custom_column
1160
+ *
1161
+ * @param string $column Column name
1162
+ * @param int $post_id Post ID
1163
+ */
1164
+ public function custom_column_row( $column, $post_id ) {
1165
+ $setting = $this->read_settings( $post_id );
1166
+ switch ( $column ) {
1167
+ case 'disabled':
1168
+ if ( 'true' != $setting['disabled'] ) {
1169
+ printf( '<span class="dashicons dashicons-yes"></span>' );
1170
+ }
1171
+ break;
1172
+ case 'type':
1173
+ echo $this->get_notification_name( $setting['notification'] );
1174
+ break;
1175
+ case 'subject':
1176
+ echo ! empty( $setting['subject'] ) ? $setting['subject'] : '';
1177
+ break;
1178
+ case 'users':
1179
+ $users = $this->get_names_from_users( $setting['users'] );
1180
+ if (!empty($users)) {
1181
+ echo implode( ', ', $users );
1182
+ }
1183
+ else {
1184
+ if(isset($setting['new-user-role'])){
1185
+ $users = $this->get_names_from_users( $setting['new-user-role'] );
1186
+ echo implode( ', ', $users );
1187
+ }
1188
+ }
1189
+
1190
+ if ( 'true' === $setting['only-post-author'] ) {
1191
+ echo esc_html__( ', Post Author', 'bnfw' );
1192
+ }
1193
+
1194
+ break;
1195
+ case 'excluded':
1196
+ $excluded_users = $this->get_names_from_users( $setting['exclude-users'] );
1197
+ echo implode( ', ', $excluded_users );
1198
+
1199
+ break;
1200
+ }
1201
+
1202
+ /**
1203
+ * Invoked while displaying a custom column in notification table.
1204
+ *
1205
+ * @since 1.3.9
1206
+ *
1207
+ * @param string $column Column name
1208
+ * @param int $post_id Post ID
1209
+ */
1210
+ do_action( 'bnfw_notification_table_column', $column, $post_id );
1211
+ }
1212
+
1213
+ /**
1214
+ * Get names from users.
1215
+ *
1216
+ * @since 1.2
1217
+ */
1218
+ private function get_names_from_users( $users ) {
1219
+ $user_ids = array();
1220
+ $user_roles = array();
1221
+ $emails = array();
1222
+ $names_from_user_ids = array();
1223
+
1224
+ if ( is_array( $users ) ) {
1225
+ foreach ( $users as $user ) {
1226
+ if ( $this->starts_with( $user, 'role-' ) ) {
1227
+ $user_roles[] = ucfirst( str_replace( 'role-', '', $user ) );
1228
+ } elseif ( strpos( $user, '@' ) !== false ) {
1229
+ $emails[] = $user;
1230
+ } elseif ( absint( $user ) > 0 ) {
1231
+ $user_ids[] = absint( $user );
1232
+ } else {
1233
+ $emails[] = $user;
1234
+ }
1235
+ }
1236
+ }
1237
+ else {
1238
+ // User Roles not associated with a To/CC/BCC field
1239
+ $role = get_role( $users );
1240
+
1241
+ if ( !empty( $role ) ) {
1242
+ $user_roles = array( $role->name );
1243
+ }
1244
+ }
1245
+
1246
+ if ( ! empty( $user_ids ) ) {
1247
+ $user_query = new WP_User_Query( array( 'include' => $user_ids ) );
1248
+ foreach ( $user_query->results as $user ) {
1249
+ $names_from_user_ids[] = $user->user_login;
1250
+ }
1251
+ }
1252
+
1253
+ return array_merge( $user_roles, $names_from_user_ids, $emails );
1254
+ }
1255
+
1256
+ /**
1257
+ * Get name of the notification based on slug.
1258
+ *
1259
+ * @param string $slug Notification Slug.
1260
+ *
1261
+ * @return string Notification Name.
1262
+ */
1263
+ private function get_notification_name( $slug ) {
1264
+ $name = '';
1265
+ switch ( $slug ) {
1266
+ case 'new-comment':
1267
+ $name = esc_html__( 'New Comment', 'bnfw' );
1268
+ break;
1269
+ case 'approve-post-comment':
1270
+ $name = esc_html__( 'Post - Comment Approved', 'bnfw' );
1271
+ break;
1272
+ case 'moderate-comment':
1273
+ $name = esc_html__( 'New Comment Awaiting Moderation', 'bnfw' );
1274
+ break;
1275
+ case 'new-trackback':
1276
+ $name = esc_html__( 'New Trackback', 'bnfw' );
1277
+ break;
1278
+ case 'new-pingback':
1279
+ $name = esc_html__( 'New Pingback', 'bnfw' );
1280
+ break;
1281
+ case 'reply-comment':
1282
+ $name = esc_html__( 'Comment Reply', 'bnfw' );
1283
+ break;
1284
+ case 'user-password':
1285
+ $name = esc_html__( 'User Lost Password - For User', 'bnfw' );
1286
+ break;
1287
+ case 'admin-password':
1288
+ $name = esc_html__( 'User Lost Password - For Admin', 'bnfw' );
1289
+ break;
1290
+ case 'admin-password-changed':
1291
+ $name = esc_html__( 'Password Changed - For Admin', 'bnfw' );
1292
+ break;
1293
+ case 'admin-email-changed':
1294
+ $name = esc_html__( 'User Email Changed - For Admin', 'bnfw' );
1295
+ break;
1296
+ case 'password-changed':
1297
+ $name = esc_html__( 'Password Changed - For User', 'bnfw' );
1298
+ break;
1299
+ case 'email-changing':
1300
+ $name = esc_html__( 'User Email Changed Confirmation - For User', 'bnfw' );
1301
+ break;
1302
+ case 'email-changed':
1303
+ $name = esc_html__( 'User Email Changed - For User', 'bnfw' );
1304
+ break;
1305
+ case 'core-updated':
1306
+ $name = esc_html__( 'WordPress Core Automatic Background Updates', 'bnfw' );
1307
+ break;
1308
+ case 'new-user':
1309
+ $name = esc_html__( 'New User Registration - For User', 'bnfw' );
1310
+ break;
1311
+ case 'user-login':
1312
+ $name = esc_html__( 'User Logged In - For User', 'bnfw' );
1313
+ break;
1314
+ case 'admin-user-login':
1315
+ $name = esc_html__( 'User Logged In - For Admin', 'bnfw' );
1316
+ break;
1317
+ case 'welcome-email':
1318
+ $name = esc_html__( 'New User - Post-registration Email', 'bnfw' );
1319
+ break;
1320
+ case 'admin-user':
1321
+ $name = esc_html__( 'New User Registration - For Admin', 'bnfw' );
1322
+ break;
1323
+ case 'user-role':
1324
+ $name = esc_html__( 'User Role Changed - For User', 'bnfw' );
1325
+ break;
1326
+ case 'admin-role':
1327
+ $name = esc_html__( 'User Role Changed - For Admin', 'bnfw' );
1328
+ break;
1329
+ case 'new-post':
1330
+ $name = esc_html__( 'New Post Published', 'bnfw' );
1331
+ break;
1332
+ case 'update-post':
1333
+ $name = esc_html__( 'Post Updated', 'bnfw' );
1334
+ break;
1335
+ case 'pending-post':
1336
+ $name = esc_html__( 'Post Pending Review', 'bnfw' );
1337
+ break;
1338
+ case 'private-post':
1339
+ $name = esc_html__( 'New Private Post', 'bnfw' );
1340
+ break;
1341
+ case 'future-post':
1342
+ $name = esc_html__( 'Post Scheduled', 'bnfw' );
1343
+ break;
1344
+ case 'trash-post':
1345
+ $name = esc_html__( 'Published Post Moved to Trash', 'bnfw' );
1346
+ break;
1347
+ case 'new-page':
1348
+ $name = esc_html__( 'New Page Published', 'bnfw' );
1349
+ break;
1350
+ case 'newterm-category':
1351
+ $name = esc_html__( 'New Category', 'bnfw' );
1352
+ break;
1353
+ case 'newterm-post_tag':
1354
+ $name = esc_html__( 'New Tag', 'bnfw' );
1355
+ break;
1356
+ case 'ca-export-data':
1357
+ $name = esc_html__( 'Privacy – Confirm Action: Export Data Request – For User', 'bnfw' );
1358
+ break;
1359
+ case 'ca-erase-data':
1360
+ $name = esc_html__( 'Privacy – Confirm Action: Erase Data Request – For User', 'bnfw' );
1361
+ break;
1362
+ case 'uc-export-data':
1363
+ $name = esc_html__( 'Privacy - Confirm Action: Export Data Request - For Admin', 'bnfw' );
1364
+ break;
1365
+ case 'uc-erase-data':
1366
+ $name = esc_html__( 'Privacy - Confirm Action: Erase Data Request - For Admin', 'bnfw' );
1367
+ break;
1368
+ case 'data-export':
1369
+ $name = esc_html__( 'Privacy - Data Export - For User', 'bnfw' );
1370
+ break;
1371
+ case 'data-erased':
1372
+ $name = esc_html__( 'Privacy - Data Erased - For User', 'bnfw' );
1373
+ break;
1374
+ case 'new-media':
1375
+ $name = esc_html__( 'New Media Published', 'bnfw' );
1376
+ break;
1377
+ case 'update-media':
1378
+ $name = esc_html__( 'Media Updated', 'bnfw' );
1379
+ break;
1380
+ case 'comment-attachment':
1381
+ $name = esc_html__( 'Media - New Comment', 'bnfw' );
1382
+ break;
1383
+ case 'approve-page-comment':
1384
+ $name = esc_html__( 'Page - Comment Approved', 'bnfw' );
1385
+ break;
1386
+ case 'approve-attachment-comment':
1387
+ $name = esc_html__( 'Media - Comment Approved', 'bnfw' );
1388
+ break;
1389
+ case 'moderate-attachment-comment':
1390
+ $name = esc_html__( 'Media - New Comment Awaiting Moderation', 'bnfw' );
1391
+ break;
1392
+ case 'commentreply-attachment':
1393
+ $name = esc_html__( 'Media - Comment Reply', 'bnfw' );
1394
+ break;
1395
+
1396
+
1397
+ default:
1398
+ $splited = explode( '-', $slug );
1399
+ $label = $splited[1];
1400
+ $post_obj = get_post_type_object( $splited[1] );
1401
+
1402
+ if ( null != $post_obj ) {
1403
+ $label = $post_obj->labels->singular_name;
1404
+ }
1405
+
1406
+ switch ( $splited[0] ) {
1407
+ case 'new':
1408
+ $name = esc_html__( 'New ', 'bnfw' ) . $label . ' ' . esc_html__( 'Published', 'bnfw' );
1409
+ break;
1410
+ case 'update':
1411
+ $name = esc_html__( 'Updated ', 'bnfw' ) . $label;
1412
+ break;
1413
+ case 'pending':
1414
+ $name = $label . esc_html__( ' Pending Review', 'bnfw' );
1415
+ break;
1416
+ case 'future':
1417
+ $name = $label . esc_html__( ' Scheduled', 'bnfw' );
1418
+ break;
1419
+ case 'private':
1420
+ $name = esc_html__( 'New Private ', 'bnfw' ) . $label;
1421
+ break;
1422
+ case 'comment':
1423
+ $name = $label . esc_html__( ' Comment', 'bnfw' );
1424
+ break;
1425
+ case 'moderate':
1426
+ $name = $label . ' - ' . esc_html__( 'New Comment Awaiting Moderation', 'bnfw' );
1427
+ break;
1428
+ case 'commentreply':
1429
+ $name = $label . esc_html__( ' Comment Reply', 'bnfw' );
1430
+ break;
1431
+ case 'approve':
1432
+ $name = $label . esc_html__( ' Comment Approved', 'bnfw' );
1433
+ break;
1434
+ case 'newterm':
1435
+ $tax = get_taxonomy( $splited[1] );
1436
+ if ( ! $tax ) {
1437
+ $name = esc_html__( 'New Term', 'bnfw' );
1438
+ } else {
1439
+ $name = esc_html__( 'New Term in ', 'bnfw' ) . $tax->labels->name;
1440
+ }
1441
+ break;
1442
+ }
1443
+ break;
1444
+ }
1445
+
1446
+ $name = apply_filters( 'bnfw_notification_name', $name, $slug );
1447
+
1448
+ return $name;
1449
+ }
1450
+
1451
+ /**
1452
+ * Add additional custom edit actions for enabling and disabling notifications in bulk.
1453
+ *
1454
+ * @param array $bulk_actions Bulk Actions.
1455
+ *
1456
+ * @return array Modified list of Bulk Actions.
1457
+ */
1458
+ public function add_custom_edit_action( $bulk_actions ) {
1459
+ $bulk_actions['enable_notifications'] = __( 'Enable Notifications', 'bnfw' );
1460
+ $bulk_actions['disable_notifications'] = __( 'Disable Notifications', 'bnfw' );
1461
+
1462
+ return $bulk_actions;
1463
+ }
1464
+
1465
+ /**
1466
+ * Handle custom edit actions.
1467
+ *
1468
+ * @param $redirect_to
1469
+ * @param $doaction
1470
+ * @param $post_ids
1471
+ *
1472
+ * @return string
1473
+ */
1474
+ public function handle_custom_edit_action( $redirect_to, $doaction, $post_ids ) {
1475
+ if ( 'enable_notifications' !== $doaction && 'disable_notifications' !== $doaction ) {
1476
+ return $redirect_to;
1477
+ }
1478
+
1479
+ $redirect_to = remove_query_arg( array( 'bulk_enable_notifications', 'bulk_disable_notifications', 'bnfw_action' ), $redirect_to );
1480
+
1481
+ $meta_value = 'true';
1482
+
1483
+ if ( 'enable_notifications' === $doaction ) {
1484
+ $meta_value = 'false';
1485
+ }
1486
+
1487
+ foreach ( $post_ids as $post_id ) {
1488
+ update_post_meta( $post_id, self::META_KEY_PREFIX . 'disabled', $meta_value );
1489
+ }
1490
+
1491
+ $redirect_to = add_query_arg( 'bulk_' . $doaction, count( $post_ids ), $redirect_to );
1492
+
1493
+ return $redirect_to;
1494
+ }
1495
+
1496
+ /**
1497
+ * Custom row actions for this post type.
1498
+ *
1499
+ * @since 1.0
1500
+ * @filter post_row_actions
1501
+ *
1502
+ * @param array $actions
1503
+ * @param \WP_Post $post
1504
+ *
1505
+ * @return array
1506
+ */
1507
+ public function custom_row_actions( $actions, $post ) {
1508
+ if ( self::POST_TYPE === get_post_type( $post ) ) {
1509
+ unset( $actions['inline hide-if-no-js'] );
1510
+ unset( $actions['view'] );
1511
+
1512
+ $notification_disabled = get_post_meta( $post->ID, self::META_KEY_PREFIX . 'disabled', true );
1513
+
1514
+ if ( 'true' === $notification_disabled ) {
1515
+ $url = add_query_arg(
1516
+ array(
1517
+ 'notification_id' => $post->ID,
1518
+ 'bnfw_action' => 'enable_notification',
1519
+ )
1520
+ );
1521
+ $actions['enable_notification'] = '<a href="' . esc_url( $url ) . '">' . __( 'Enable Notification', 'bnfw' ) . '</a>';
1522
+ } else {
1523
+ $url = add_query_arg(
1524
+ array(
1525
+ 'notification_id' => $post->ID,
1526
+ 'bnfw_action' => 'disable_notification',
1527
+ )
1528
+ );
1529
+ $actions['disable_notification'] = '<a href="' . esc_url( $url ) . '">' . __( 'Disable Notification', 'bnfw' ) . '</a>';
1530
+ }
1531
+ }
1532
+
1533
+ return $actions;
1534
+ }
1535
+
1536
+ /**
1537
+ * Handle custom actions.
1538
+ */
1539
+ public function handle_actions() {
1540
+ if ( ! isset( $_GET['bnfw_action'] ) || ! isset( $_GET['notification_id'] ) ) {
1541
+ return;
1542
+ }
1543
+
1544
+ $post_id = absint( $_GET['notification_id'] );
1545
+ if ( 0 === $post_id ) {
1546
+ return;
1547
+ }
1548
+
1549
+ $action = sanitize_text_field( $_GET['bnfw_action'] );
1550
+
1551
+ if ( 'enable_notification' === $action ) {
1552
+ update_post_meta( $post_id, self::META_KEY_PREFIX . 'disabled', 'false' );
1553
+ }
1554
+
1555
+ if ( 'disable_notification' === $action ) {
1556
+ update_post_meta( $post_id, self::META_KEY_PREFIX . 'disabled', 'true' );
1557
+ }
1558
+ }
1559
+
1560
+ /**
1561
+ * Find if a string starts with another string.
1562
+ *
1563
+ * @since 1.2
1564
+ *
1565
+ * @param $haystack
1566
+ * @param $needle
1567
+ *
1568
+ * @return bool
1569
+ */
1570
+ public function starts_with( $haystack, $needle ) {
1571
+ // search backwards starting from haystack length characters from the end
1572
+ return '' === $needle || strrpos( $haystack, $needle, - strlen( $haystack ) ) !== false;
1573
+ }
1574
+
1575
+ /**
1576
+ * Display a help notice.
1577
+ *
1578
+ * @since 1.7
1579
+ */
1580
+ public function show_help_notice() {
1581
+ $screen = get_current_screen();
1582
+ if ( ! in_array( $screen->post_type, array( self::POST_TYPE ) ) ) {
1583
+ return;
1584
+ }
1585
+
1586
+ if ( ! empty( $_REQUEST['bnfw_action'] ) && 'enable_notification' === $_REQUEST['bnfw_action'] ) {
1587
+ echo '<div id="message" class="updated fade"><p>' . __( 'Enabled 1 Notification.', 'bnfw' ) . '</p></div>';
1588
+ }
1589
+
1590
+ if ( ! empty( $_REQUEST['bnfw_action'] ) && 'disable_notification' === $_REQUEST['bnfw_action'] ) {
1591
+ echo '<div id="message" class="updated fade"><p>' . __( 'Disabled 1 Notification.', 'bnfw' ) . '</p></div>';
1592
+ }
1593
+
1594
+ if ( ! empty( $_REQUEST['bulk_enable_notifications'] ) ) {
1595
+ $enabled_count = intval( $_REQUEST['bulk_enable_notifications'] );
1596
+ printf( '<div id="message" class="updated fade"><p>' .
1597
+ _n( 'Enabled %s Notification.',
1598
+ 'Enabled %s Notifications.',
1599
+ $enabled_count,
1600
+ 'bnfw'
1601
+ ) . '</p></div>', $enabled_count );
1602
+ }
1603
+
1604
+ if ( ! empty( $_REQUEST['bulk_disable_notifications'] ) ) {
1605
+ $disabled_count = intval( $_REQUEST['bulk_disable_notifications'] );
1606
+ printf( '<div id="message" class="updated fade"><p>' .
1607
+ _n( 'Disabled %s Notification.',
1608
+ 'Disabled %s Notifications.',
1609
+ $disabled_count,
1610
+ 'bnfw'
1611
+ ) . '</p></div>', $disabled_count );
1612
+ }
1613
+
1614
+ if ( ! PAnD::is_admin_notice_active( 'disable-bnfw-help-notice-forever' ) ) {
1615
+ return;
1616
+ }
1617
+
1618
+ ?>
1619
+ <div data-dismissible="disable-bnfw-help-notice-forever" class="updated notice notice-success is-dismissible">
1620
+ <p>
1621
+ <?php _e( 'If you send out notifications with BNFW but don\'t receive them, you may need to install an SMTP plugin to <a href="https://betternotificationsforwp.com/documentation/getting-started/how-to-improve-email-delivery/" target="_blank">improve email deliverability</a>. I recommend using <a href="https://wordpress.org/plugins/post-smtp/" target="_blank">Post SMTP</a> as it\'s easy to set-up or <a href="https://wordpress.org/plugins/email-log/" target="_blank">Email Log</a> to just log and view emails that are sent.', 'bnfw' ); ?>
1622
+ </p>
1623
+ </div>
1624
+ <?php
1625
+ }
1626
+
1627
+ /**
1628
+ * Should the users count message be shown?
1629
+ *
1630
+ * @since 1.7
1631
+ *
1632
+ * @param array $setting Notification Setting.
1633
+ *
1634
+ * @return bool True if message should be shown.
1635
+ */
1636
+ protected function should_show_users_count_msg( $setting ) {
1637
+ $users = $setting['users'];
1638
+
1639
+ if ( count( $users ) > 200 ) {
1640
+ return true;
1641
+ }
1642
+
1643
+ $emails = BNFW::factory()->engine->get_emails_from_users( $users );
1644
+
1645
+ if ( count( $emails ) > 200 ) {
1646
+ return true;
1647
+ }
1648
+
1649
+ return false;
1650
+ }
1651
+ }
includes/engine/class-bnfw-engine.php CHANGED
@@ -1,1598 +1,1598 @@
1
- <?php
2
-
3
- /**
4
- * BNFW Engine
5
- *
6
- * @since 1.0
7
- */
8
- class BNFW_Engine {
9
-
10
- /**
11
- * Send test email.
12
- *
13
- * @since 1.2
14
- *
15
- * @param array $setting
16
- */
17
- public function send_test_email( $setting ) {
18
- $subject = __( 'Test Email:', 'bnfw' ) . ' ' . $setting[ 'subject' ];
19
- $message = '<p><strong>' . __( 'This is a test email. All shortcodes below will show in place but not be replaced with content.', 'bnfw' ) . '</strong></p>' . stripslashes( $setting[ 'message' ] );
20
-
21
- if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
22
- $message = wpautop( $message );
23
- }
24
-
25
- $current_user = wp_get_current_user();
26
- $email = $current_user->user_email;
27
-
28
- $headers = array();
29
- if ( 'html' == $setting[ 'email-formatting' ] ) {
30
- $headers[] = 'Content-type: text/html';
31
- $message = apply_filters( 'bnfw_test_email_message', $message, $setting );
32
- } elseif ( 'text' == $setting[ 'email-formatting' ] ) {
33
- $message = strip_tags( $message );
34
- }
35
-
36
- wp_mail( $email, stripslashes( $subject ), $message, $headers );
37
- }
38
-
39
- /**
40
- * Send the notification email.
41
- *
42
- * @since 1.0
43
- * @param array $setting
44
- * @param int $id
45
- */
46
- public function send_notification( $setting, $id ) {
47
- /**
48
- * BNFW - Whether notification is disabled?
49
- *
50
- * @since 1.3.6
51
- */
52
-
53
- $notification_disabled = apply_filters( 'bnfw_notification_disabled', ( 'true' === $setting[ 'disabled' ] ), $id, $setting );
54
-
55
- if ( ! $notification_disabled ) {
56
-
57
- $subject = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $id );
58
- $message = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $id );
59
- $emails = $this->get_emails( $setting, $id );
60
- $headers = $this->get_headers( $emails );
61
-
62
- if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
63
- $message = wpautop( $message );
64
- }
65
-
66
- if ( 'html' == $setting[ 'email-formatting' ] ) {
67
- $headers[] = 'Content-type: text/html';
68
- $message = apply_filters( 'bnfw_notification_message', $message, $setting );
69
- } else {
70
- $headers[] = 'Content-type: text/plain';
71
- if ( 'text' == $setting[ 'email-formatting' ] ) {
72
- $message = strip_tags( $message );
73
- }
74
- }
75
-
76
- $emails = apply_filters( 'bnfw_emails', $emails, $setting, $id );
77
-
78
- $send = apply_filters( 'bnfw_can_send_email', true, $setting, $emails, $subject, $message, $headers );
79
-
80
- if ( ! $send ) {
81
- return;
82
- }
83
-
84
- if ( isset( $emails[ 'to' ] ) && is_array( $emails[ 'to' ] ) ) {
85
- foreach ( $emails[ 'to' ] as $email ) {
86
- wp_mail( $email, stripslashes( $this->handle_global_user_shortcodes( $subject, $email ) ), $this->handle_global_user_shortcodes( $message, $email ), $headers );
87
- }
88
- }
89
- }
90
- }
91
-
92
- /**
93
- * Send new user registration notification email.
94
- *
95
- * @since 1.1
96
- * @param array $setting Notification setting
97
- * @param object $user User object
98
- * @param string $password_url Plain text password in WP < 4.3 and password url in WP > 4.3
99
- */
100
- public function send_registration_email( $setting, $user, $password_url = '' ) {
101
- /**
102
- * Whether to trigger welcome email notification or not.
103
- *
104
- * @since 1.7
105
- */
106
- $trigger_notification = apply_filters( 'bnfw_trigger_welcome-email_notification', true, $setting, $user );
107
-
108
- if ( ! $trigger_notification ) {
109
- return;
110
- }
111
-
112
- $user_id = $user->ID;
113
-
114
- $subject = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $user_id );
115
- $message = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $user_id );
116
-
117
- $subject = str_replace( '[password]', $password_url, $subject );
118
- $message = str_replace( '[password]', $password_url, $message );
119
-
120
- $subject = str_replace( '[password_url]', $password_url, $subject );
121
- $message = str_replace( '[password_url]', $password_url, $message );
122
-
123
- $subject = str_replace( '[login_url]', wp_login_url(), $subject );
124
- $message = str_replace( '[login_url]', wp_login_url(), $message );
125
-
126
- if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
127
- $message = wpautop( $message );
128
- }
129
-
130
- $headers = array();
131
- if ( 'html' == $setting[ 'email-formatting' ] ) {
132
- $headers[] = 'Content-type: text/html';
133
- $message = apply_filters( 'bnfw_registration_email_message', $message, $setting );
134
- } elseif ( 'text' == $setting[ 'email-formatting' ] ) {
135
- $message = strip_tags( $message );
136
- }
137
-
138
- $subject = $this->handle_global_user_shortcodes( $subject, $user->user_email );
139
- $message = $this->handle_global_user_shortcodes( $message, $user->user_email );
140
- wp_mail( $user->user_email, stripslashes( $subject ), $message, $headers );
141
- }
142
-
143
- /**
144
- * Send user login notification email.
145
- *
146
- * @since 1.1
147
- * @param array $setting Notification setting
148
- * @param object $user User object
149
- */
150
- public function send_user_login_email( $setting, $user ) {
151
-
152
- $trigger_notification = apply_filters( 'bnfw_trigger_user-login_notification', true, $setting, $user );
153
-
154
- if ( ! $trigger_notification ) {
155
- return;
156
- }
157
-
158
- $user_id = $user->ID;
159
-
160
- $subject = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $user_id );
161
- $message = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $user_id );
162
- $emails = $this->get_emails( $setting, $user_id );
163
- $headers = $this->get_headers( $emails );
164
-
165
- if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
166
- $message = wpautop( $message );
167
- }
168
-
169
- if ( 'html' == $setting[ 'email-formatting' ] ) {
170
- $headers[] = 'Content-type: text/html';
171
- $message = apply_filters( 'bnfw_notification_message', $message, $setting );
172
- } elseif ( 'text' == $setting[ 'email-formatting' ] ) {
173
- $message = strip_tags( $message );
174
- }
175
-
176
- $subject = $this->handle_global_user_shortcodes( $subject, $user->user_email );
177
- $message = $this->handle_global_user_shortcodes( $message, $user->user_email );
178
-
179
- wp_mail( $user->user_email, stripslashes( $subject ), $message, $headers );
180
- }
181
-
182
- /**
183
- * Send user login notification email for admin.
184
- *
185
- * @since 1.1
186
- * @param array $setting Notification setting
187
- * @param object $user User object
188
- */
189
- public function send_user_login_email_for_admin( $setting, $user ) {
190
-
191
- $trigger_notification = apply_filters( 'bnfw_trigger_user-login_notification', true, $setting, $user );
192
-
193
- if ( ! $trigger_notification ) {
194
- return;
195
- }
196
- $user_id = $user->ID;
197
-
198
- $this->send_notification( $setting, $user_id );
199
- }
200
-
201
- /**
202
- * Send comment reply notification email.
203
- *
204
- * @since 1.3
205
- * @param array $setting Notification setting
206
- * @param object $comment Comment object
207
- * @param object $parent_comment Parent comment object
208
- */
209
- public function send_comment_reply_email( $setting, $comment,
210
- $parent_comment ) {
211
- $comment_id = $comment->comment_ID;
212
-
213
- /**
214
- * BNFW - Whether notification is disabled?
215
- *
216
- * @since 1.3.6
217
- */
218
- $notification_disabled = apply_filters( 'bnfw_notification_disabled', false, $comment_id, $setting );
219
-
220
- if ( ! $notification_disabled ) {
221
- $subject = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $comment_id );
222
- $message = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $comment_id );
223
-
224
- $headers = array();
225
- if ( 'html' == $setting[ 'email-formatting' ] ) {
226
- $headers[] = 'Content-type: text/html';
227
- } elseif ( 'text' == $setting[ 'email-formatting' ] ) {
228
- $message = strip_tags( $message );
229
- }
230
-
231
- if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
232
- $message = wpautop( $message );
233
- $message = apply_filters( 'bnfw_comment_reply_email_message', $message, $setting );
234
- }
235
-
236
- $subject = $this->handle_global_user_shortcodes( $subject, $parent_comment->comment_author_email );
237
- $message = $this->handle_global_user_shortcodes( $message, $parent_comment->comment_author_email );
238
- wp_mail( $parent_comment->comment_author_email, stripslashes( $subject ), $message, $headers );
239
- }
240
- }
241
-
242
- /**
243
- * Send user role changed email.
244
- *
245
- * @since 1.3.9
246
- *
247
- * @param array $setting Notification setting
248
- * @param int $user_id User ID
249
- * @param array $old_role Old User Role.
250
- * @param array $new_role New User Role.
251
- */
252
- public function send_user_role_changed_email( $setting, $user_id, $old_role,
253
- $new_role ) {
254
- $subject = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $user_id );
255
- $message = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $user_id );
256
-
257
- $subject = $this->handle_user_role_shortcodes( $subject, $old_role, $new_role );
258
- $message = $this->handle_user_role_shortcodes( $message, $old_role, $new_role );
259
-
260
- $headers = array();
261
- if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
262
- $message = wpautop( $message );
263
- }
264
-
265
- if ( 'html' == $setting[ 'email-formatting' ] ) {
266
- $headers[] = 'Content-type: text/html';
267
- $message = apply_filters( 'bnfw_user_role_changed_email_message', $message, $setting );
268
- } elseif ( 'text' == $setting[ 'email-formatting' ] ) {
269
- $message = strip_tags( $message );
270
- }
271
-
272
- $user = get_user_by( 'id', $user_id );
273
-
274
- $subject = $this->handle_global_user_shortcodes( $subject, $user->user_email );
275
- $message = $this->handle_global_user_shortcodes( $message, $user->user_email );
276
- wp_mail( $user->user_email, stripslashes( $subject ), $message, $headers );
277
- }
278
-
279
- /**
280
- * Send user role added support User Role Editor by Members Plugin.
281
- *
282
- * @since 1.3.9
283
- *
284
- * @param array $setting Notification setting
285
- * @param int $user_id User ID
286
- * @param array $old_role Old User Role.
287
- * @param array $new_role New User Role.
288
- */
289
- public function send_user_role_added_email( $setting, $user_id, $old_role,
290
- $new_role ) {
291
- $subject = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $user_id );
292
- $message = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $user_id );
293
-
294
- $subject = $this->handle_user_added_role_shortcodes( $subject, $old_role, $new_role );
295
- $message = $this->handle_user_added_role_shortcodes( $message, $old_role, $new_role );
296
-
297
- $headers = array();
298
- if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
299
- $message = wpautop( $message );
300
- }
301
-
302
- if ( 'html' == $setting[ 'email-formatting' ] ) {
303
- $headers[] = 'Content-type: text/html';
304
- $message = apply_filters( 'bnfw_user_role_changed_email_message', $message, $setting );
305
- } elseif ( 'text' == $setting[ 'email-formatting' ] ) {
306
- $message = strip_tags( $message );
307
- }
308
-
309
- $user = get_user_by( 'id', $user_id );
310
-
311
- $subject = $this->handle_global_user_shortcodes( $subject, $user->user_email );
312
- $message = $this->handle_global_user_shortcodes( $message, $user->user_email );
313
- wp_mail( $user->user_email, stripslashes( $subject ), $message, $headers );
314
- }
315
-
316
- /**
317
- * Handle User Role shortcodes.
318
- *
319
- * @param string $message String that needs shortcode processing.
320
- * @param array $old_role Old User Role.
321
- * @param array $new_role New User Role.
322
- *
323
- * @return string Processed string.
324
- */
325
- public function handle_user_role_shortcodes( $message, $old_role, $new_role ) {
326
- $roles = wp_roles();
327
-
328
- $old_role_name = '';
329
- $new_role_name = '';
330
-
331
- if ( isset( $roles->role_names[ $old_role ] ) ) {
332
- $old_role_name = $roles->role_names[ $old_role ];
333
- }
334
-
335
- if ( isset( $roles->role_names[ $new_role ] ) ) {
336
- $new_role_name = $roles->role_names[ $new_role ];
337
- }
338
-
339
- $message = str_replace( '[user_role_old]', $old_role_name, $message );
340
- $message = str_replace( '[user_role_new]', $new_role_name, $message );
341
-
342
- return $message;
343
- }
344
-
345
- /**
346
- * Handle User Added Role shortcodes.
347
- *
348
- * @param string $message String that needs shortcode processing.
349
- * @param array $old_role Old User Role.
350
- * @param array $new_role New User Role.
351
- *
352
- * @return string Processed string.
353
- */
354
- public function handle_user_added_role_shortcodes( $message, $old_roles,
355
- $new_roles ) {
356
- $roles = wp_roles();
357
-
358
- $old_role_name = array();
359
- $new_role_name = array();
360
-
361
- foreach ( $old_roles as $key => $old_role ) {
362
- if ( isset( $roles->role_names[ $old_role ] ) ) {
363
- $old_role_name[] = $roles->role_names[ $old_role ];
364
- }
365
- }
366
- foreach ( $new_roles as $key => $new_role ) {
367
- if ( isset( $roles->role_names[ $new_role ] ) ) {
368
- $new_role_name[] = $roles->role_names[ $new_role ];
369
- }
370
- }
371
-
372
- $message = str_replace( '[user_role_old]', implode( ',', $old_role_name ), $message );
373
- $message = str_replace( '[user_role_new]', implode( ',', $new_role_name ), $message );
374
-
375
- return $message;
376
- }
377
-
378
- /**
379
- * Handle shortcodes for filtered data notifications like `password_changed` and `email_changed`.
380
- *
381
- * @since 1.6
382
- *
383
- * @param array $email_data Email data.
384
- * @param array $setting Notification settings.
385
- * @param string|int $extra_data Extra data.
386
- *
387
- * @return array Modified email data.
388
- */
389
- public function handle_filtered_data_notification( $email_data, $setting,
390
- $extra_data ) {
391
- $email_data[ 'message' ] = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $extra_data );
392
- $email_data[ 'subject' ] = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $extra_data );
393
-
394
- $email_data[ 'message' ] = $this->handle_global_user_shortcodes( $email_data[ 'message' ], $email_data[ 'to' ] );
395
- $email_data[ 'subject' ] = $this->handle_global_user_shortcodes( $email_data[ 'subject' ], $email_data[ 'to' ] );
396
-
397
- if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
398
- $email_data[ 'message' ] = wpautop( $email_data[ 'message' ] );
399
- }
400
-
401
- if ( 'html' == $setting[ 'email-formatting' ] ) {
402
- $headers[] = 'Content-type: text/html';
403
- } else {
404
- $headers[] = 'Content-type: text/plain';
405
- if ( 'text' == $setting[ 'email-formatting' ] ) {
406
- $message = strip_tags( $message );
407
- }
408
- }
409
-
410
- $email_data[ 'headers' ] = $headers;
411
-
412
- return $email_data;
413
- }
414
-
415
- /**
416
- * Handle shortcodes for core updated notification.
417
- *
418
- * @since 1.6
419
- *
420
- * @param array $email_data Email data.
421
- * @param array $setting Notification settings.
422
- * @param string $type Result of update.
423
- *
424
- * @return array Modified email data.
425
- */
426
- public function handle_core_updated_notification( $email_data, $setting,
427
- $type ) {
428
- $email_data[ 'body' ] = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $type );
429
- $email_data[ 'subject' ] = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $type );
430
-
431
- $emails = $this->get_emails( $setting, $type );
432
- $headers = $this->get_headers( $emails );
433
-
434
- $email_data[ 'body' ] = $this->handle_global_user_shortcodes( $email_data[ 'body' ], $emails[ 'to' ][ 0 ] );
435
- $email_data[ 'subject' ] = $this->handle_global_user_shortcodes( $email_data[ 'subject' ], $emails[ 'to' ][ 0 ] );
436
-
437
- if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
438
- $email_data[ 'body' ] = wpautop( $email_data[ 'body' ] );
439
- }
440
-
441
- if ( 'html' == $setting[ 'email-formatting' ] ) {
442
- $headers[] = 'Content-type: text/html';
443
- } else {
444
- $headers[] = 'Content-type: text/plain';
445
- if ( 'text' == $setting[ 'email-formatting' ] ) {
446
- $message = strip_tags( $message );
447
- }
448
- }
449
-
450
- $email_data[ 'headers' ] = $headers;
451
-
452
- return $email_data;
453
- }
454
-
455
- /**
456
- * Handle shortcode for password reset email message.
457
- *
458
- * @since 1.1
459
- *
460
- * @param $setting
461
- * @param $key
462
- * @param $user_login
463
- * @param $user_data
464
- *
465
- * @return mixed|string
466
- */
467
- public function handle_password_reset_shortcodes( $setting, $key,
468
- $user_login, $user_data ) {
469
- $message = '';
470
-
471
- if ( '' != $user_login ) {
472
- // For WordPress version 4.1.0 or less, we could have empty user_login
473
- $message = $this->handle_shortcodes( $setting[ 'message' ], 'user-password', $user_data->ID );
474
- $message = $this->handle_global_user_shortcodes( $message, $user_data->user_email );
475
-
476
- $reset_link = network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user_login ), 'login' );
477
- $message = str_replace( '[password_reset_link]', $reset_link, $message );
478
- }
479
-
480
- return $message;
481
- }
482
-
483
- /**
484
- * Send Password Changed email.
485
- *
486
- * @param array $setting Notification Setting.
487
- * @param WP_User $user User for whom the password has changed.
488
- */
489
- public function send_password_changed_email( $setting, $user ) {
490
- $user_id = $user->ID;
491
-
492
- $subject = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $user_id );
493
- $message = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $user_id );
494
-
495
- if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
496
- $message = wpautop( $message );
497
- }
498
-
499
- $headers = array();
500
- if ( 'html' == $setting[ 'email-formatting' ] ) {
501
- $headers[] = 'Content-type: text/html';
502
- } elseif ( 'text' == $setting[ 'email-formatting' ] ) {
503
- $message = strip_tags( $message );
504
- }
505
-
506
- $subject = $this->handle_global_user_shortcodes( $subject, $user->user_email );
507
- $message = $this->handle_global_user_shortcodes( $message, $user->user_email );
508
- wp_mail( $user->user_email, stripslashes( $subject ), $message, $headers );
509
- }
510
-
511
- /**
512
- * Generate message for notification.
513
- *
514
- * @since 1.0
515
- * public since @since 1.6
516
- *
517
- * @param string $message String may have shortcode.
518
- * @param string $notification Notification name.
519
- * @param string|int $extra_data Additional data for shortcode.
520
- *
521
- * @return string Processed string.
522
- */
523
- public function handle_shortcodes( $message, $notification, $extra_data ) {
524
-
525
- switch ( $notification ) {
526
- case 'new-comment':
527
- case 'new-trackback':
528
- case 'new-pingback':
529
- case 'reply-comment':
530
- // handle new comments, trackbacks and pingbacks
531
- $message = $this->comment_shortcodes( $message, $extra_data );
532
- $comment = get_comment( $extra_data );
533
- $message = $this->post_shortcodes( $message, $comment->comment_post_ID );
534
- if ( 0 != $comment->user_id ) {
535
- $message = $this->user_shortcodes( $message, $comment->user_id );
536
- }
537
- break;
538
-
539
- case 'admin-password':
540
- case 'admin-password-changed':
541
- case 'admin-email-changed':
542
- case 'admin-user':
543
- case 'welcome-email':
544
- case 'user-login':
545
- $message = $this->user_shortcodes( $message, $extra_data );
546
- break;
547
- case 'admin-user-login':
548
- $message = $this->user_shortcodes( $message, $extra_data );
549
- break;
550
- case 'new-user':
551
- case 'user-role':
552
- case 'admin-role':
553
- case 'password-changed':
554
- // handle users (lost password and new user registration)
555
- $message = $this->user_shortcodes( $message, $extra_data );
556
- break;
557
-
558
- case 'email-changed':
559
- case 'user-password':
560
- // handle users (lost password and new user registration)
561
- $message = $this->user_shortcodes( $message, $extra_data, 'email_' );
562
- break;
563
-
564
- case 'new-category':
565
- // handle new category
566
- $message = $this->taxonomy_shortcodes( $message, 'category', $extra_data );
567
- break;
568
-
569
- case 'new-post_tag':
570
- // handle new tag
571
- $message = $this->taxonomy_shortcodes( $message, 'post_tag', $extra_data );
572
- break;
573
-
574
- case 'core-updated':
575
- // handle core updated type
576
- $message = $this->core_updated_shortcodes( $message, $extra_data );
577
- break;
578
-
579
- case 'data-export':
580
- // handle data export email
581
- $message = $this->data_export_shortcodes( $message, $extra_data );
582
- break;
583
-
584
- case 'data-erased':
585
- // handle data export email
586
- $message = $this->data_erased_shortcodes( $message, $extra_data );
587
- break;
588
-
589
- case 'new-media':
590
- case 'update-media':
591
- $message = $this->post_shortcodes( $message, $extra_data );
592
- $post = get_post( $extra_data );
593
- if ( $post instanceof WP_Post ) {
594
- $message = $this->user_shortcodes( $message, $post->post_author );
595
- }
596
- break;
597
-
598
- default:
599
- $type = explode( '-', $notification, 2 );
600
- if ( 'newterm' == $type[ 0 ] ) {
601
- // handle new terms
602
- $message = $this->taxonomy_shortcodes( $message, $type[ 1 ], $extra_data );
603
- } elseif ( 'new' == $type[ 0 ] || 'update' == $type[ 0 ] || 'pending' == $type[ 0 ] || 'future' == $type[ 0 ] || 'private' == $type[ 0 ] || 'trash' == $type[ 0 ] ) {
604
- // handle new, update and pending posts
605
- $post_types = get_post_types( array( 'public' => true ), 'names' );
606
- $post_types = array_diff( $post_types, array( BNFW_Notification::POST_TYPE ) );
607
-
608
- if ( in_array( $type[ 1 ], $post_types ) ) {
609
- $message = $this->post_shortcodes( $message, $extra_data );
610
- $post = get_post( $extra_data );
611
- if ( $post instanceof WP_Post ) {
612
- $message = $this->user_shortcodes( $message, $post->post_author );
613
- }
614
- }
615
- } elseif ( 'comment' == $type[ 0 ] || 'moderate' == $type[ 0 ] || 'commentreply' == $type[ 0 ] ) {
616
- $message = $this->comment_shortcodes( $message, $extra_data );
617
- $comment = get_comment( $extra_data );
618
- $message = $this->post_shortcodes( $message, $comment->comment_post_ID );
619
- if ( 0 != $comment->user_id ) {
620
- $message = $this->user_shortcodes( $message, $comment->user_id );
621
- }
622
- } elseif ( 'approve' === $type[ 0 ] ) {
623
- // handle Approve comments notification
624
- $message = $this->comment_shortcodes( $message, $extra_data );
625
- $comment = get_comment( $extra_data );
626
- $message = $this->post_shortcodes( $message, $comment->comment_post_ID );
627
- if ( 0 != $comment->user_id ) {
628
- $message = $this->user_shortcodes( $message, $comment->user_id );
629
- }
630
- break;
631
- } elseif ( 'ca' === $type[ 0 ] ) {
632
- $message = $this->confirm_action_shortcodes( $message, $extra_data );
633
- $message = $this->handle_global_user_shortcodes( $message, $extra_data[ 'email' ] );
634
- } elseif ( 'uc' === $type[ 0 ] ) {
635
- $message = $this->confirmed_action_shortcodes( $message, $extra_data );
636
- $message = $this->handle_global_user_shortcodes( $message, $extra_data[ 'admin_email' ] );
637
- }
638
- break;
639
- }
640
-
641
- $message = $this->global_shortcodes( $message );
642
-
643
- $message = apply_filters( 'bnfw_shortcodes', $message, $notification, $extra_data, $this );
644
- return $message;
645
- }
646
-
647
- /**
648
- * Handle Global shortcodes.
649
- *
650
- * @since 1.5
651
- *
652
- * @param string $message String with shortcodes.
653
- *
654
- * @return string String after processing global shortcodes.
655
- */
656
- private function global_shortcodes( $message ) {
657
- $message = str_replace( '[global_site_title]', get_bloginfo( 'name' ), $message );
658
- $message = str_replace( '[global_site_tagline]', get_bloginfo( 'description' ), $message );
659
- $message = str_replace( '[global_site_url]', get_bloginfo( 'url' ), $message );
660
-
661
- $message = str_replace( '[current_time]', current_time( get_option( 'time_format' ) ), $message );
662
- $message = str_replace( '[current_date]', date_i18n( get_option( 'date_format' ), current_time( 'timestamp' ) ), $message );
663
- $message = str_replace( '[admin_email]', get_option( 'admin_email' ), $message );
664
-
665
- return $message;
666
- }
667
-
668
- /**
669
- * Handle Global shortcodes.
670
- *
671
- * @param string $message Message.
672
- * @param string $email Email.
673
- *
674
- * @return string
675
- */
676
- public function handle_global_shortcodes( $message, $email ) {
677
- $message = $this->global_shortcodes( $message );
678
-
679
- return $this->handle_global_user_shortcodes( $message, $email );
680
- }
681
-
682
- /**
683
- * Handle Global User Shortcodes.
684
- *
685
- * @param string $message String to be processed.
686
- * @param string $email Email of the user.
687
- *
688
- * @return string Processed string.
689
- */
690
- public function handle_global_user_shortcodes( $message, $email ) {
691
- $user = get_user_by( 'email', $email );
692
-
693
- if ( false === $user ) {
694
- $message = str_replace( '[global_user_firstname]', $email, $message );
695
- $message = str_replace( '[global_user_lastname]', $email, $message );
696
- $message = str_replace( '[global_user_username]', $email, $message );
697
- } else {
698
- $message = str_replace( '[global_user_firstname]', $user->first_name, $message );
699
- $message = str_replace( '[global_user_lastname]', $user->last_name, $message );
700
- $message = str_replace( '[global_user_username]', $user->user_login, $message );
701
-
702
- $message = $this->user_shortcodes( $message, $user->ID, 'email_' );
703
- }
704
-
705
- $message = str_replace( '[privacy_policy_url]', get_privacy_policy_url(), $message );
706
-
707
- $message = str_replace( array('[global_user_email]','[user_email]'), $email, $message );
708
-
709
- return $message;
710
- }
711
-
712
- /**
713
- * Handle media post shortcodes.
714
- *
715
- * @since 1.0
716
- * @param string $message
717
- * @param int $post_id
718
- * @return string
719
- */
720
- public function media_post_shortcodes( $message, $post ) {
721
- $post_content = $this->may_be_strip_shortcode( $post->post_content );
722
- $post_content = apply_filters( 'the_content', $post_content );
723
- $post_content = str_replace( ']]>', ']]&gt;', $post_content );
724
- $message = str_replace( '[ID]', $post->ID, $message );
725
- $message = str_replace( '[media_date]', bnfw_format_date( $post->post_date ), $message );
726
- $message = str_replace( '[media_date_gmt]', bnfw_format_date( $post->post_date_gmt ), $message );
727
- $message = str_replace( '[media_description]', $post_content, $message );
728
- $message = str_replace( '[media_title]', $post->post_title, $message );
729
- $message = str_replace( '[media_alt_text]', get_post_meta( $post->ID, '_wp_attachment_image_alt', true ), $message );
730
- $message = str_replace( '[media_caption]', $this->may_be_strip_shortcode( get_the_excerpt( $post ) ), $message );
731
- $message = str_replace( '[media_status]', $post->post_status, $message );
732
- $message = str_replace( '[media_modified]', bnfw_format_date( $post->post_modified ), $message );
733
- $message = str_replace( '[media_modified_gmt]', bnfw_format_date( $post->post_modified_gmt ), $message );
734
- $message = str_replace( '[media_content_filtered]', $post->post_content_filtered, $message );
735
- $message = str_replace( '[media_type]', $post->post_type, $message );
736
- $message = str_replace( '[media_mime_type]', $post->post_mime_type, $message );
737
- $message = str_replace( '[media_slug]', $post->post_name, $message );
738
- $dimensions = get_post_meta( $post->ID, '_wp_attachment_metadata', true );
739
- $media_dimensions = $dimensions[ 'width' ] . ' x ' . $dimensions[ 'height' ];
740
- $message = str_replace( '[media_dimensions]', $media_dimensions, $message );
741
- $user_info = get_userdata( $post->post_author );
742
- $message = str_replace( '[media_author]', $user_info->display_name, $message );
743
-
744
- return $message;
745
- }
746
-
747
- /**
748
- * Handle post shortcodes.
749
- *
750
- * @since 1.0
751
- * @param string $message
752
- * @param int $post_id
753
- * @return string
754
- */
755
- public function post_shortcodes( $message, $post_id ) {
756
- $post = get_post( $post_id );
757
-
758
- if ( ! $post instanceof WP_Post ) {
759
- return $message;
760
- }
761
-
762
- if ( $post->post_type == 'attachment' ) {
763
- $message = $this->media_post_shortcodes( $message, $post );
764
- }
765
-
766
- $post_content = $this->may_be_strip_shortcode( $post->post_content );
767
- $post_content = apply_filters( 'the_content', $post_content );
768
- $post_content = str_replace( ']]>', ']]&gt;', $post_content );
769
-
770
- $message = str_replace( '[ID]', $post->ID, $message );
771
- $message = str_replace( '[post_date]', bnfw_format_date( $post->post_date ), $message );
772
- $message = str_replace( '[post_date_gmt]', bnfw_format_date( $post->post_date_gmt ), $message );
773
- $message = str_replace( '[post_content]', $post_content, $message );
774
- $message = str_replace( '[post_title]', $post->post_title, $message );
775
- $message = str_replace( '[post_excerpt]', $this->may_be_strip_shortcode( get_the_excerpt( $post ) ), $message );
776
- $message = str_replace( '[post_status]', $post->post_status, $message );
777
- $message = str_replace( '[comment_status]', $post->comment_status, $message );
778
- $message = str_replace( '[ping_status]', $post->ping_status, $message );
779
- $message = str_replace( '[post_password]', $post->post_password, $message );
780
- $message = str_replace( '[post_name]', $post->post_name, $message );
781
- $message = str_replace( '[post_slug]', $post->post_name, $message );
782
- $message = str_replace( '[to_ping]', $post->to_ping, $message );
783
- $message = str_replace( '[pinged]', $post->pinged, $message );
784
- $message = str_replace( '[post_modified]', bnfw_format_date( $post->post_modified ), $message );
785
- $message = str_replace( '[post_modified_gmt]', bnfw_format_date( $post->post_modified_gmt ), $message );
786
- $message = str_replace( '[post_content_filtered]', $post->post_content_filtered, $message );
787
- $message = str_replace( '[post_parent]', $post->post_parent, $message );
788
- $message = str_replace( '[post_parent_permalink]', get_permalink( $post->post_parent ), $message );
789
- $message = str_replace( '[guid]', $post->guid, $message );
790
- $message = str_replace( '[menu_order]', $post->menu_order, $message );
791
- $message = str_replace( '[post_type]', $post->post_type, $message );
792
- $message = str_replace( '[post_mime_type]', $post->post_mime_type, $message );
793
- $message = str_replace( '[comment_count]', $post->comment_count, $message );
794
- $message = str_replace( '[permalink]', get_permalink( $post->ID ), $message );
795
- $message = str_replace( '[post_type_archive]', get_post_type_archive_link( $post->post_type ), $message );
796
-
797
- $message = str_replace( '[edit_post]', $this->get_edit_post_link( $post->ID, 'return' ), $message );
798
-
799
- $featured_image = '';
800
- if ( has_post_thumbnail( $post->ID ) ) {
801
- $image_url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
802
- if ( is_array( $image_url ) ) {
803
- $featured_image = $image_url[ 0 ];
804
- }
805
- }
806
- $message = str_replace( '[featured_image]', $featured_image, $message );
807
-
808
- $message = str_replace( '[first_image]', $this->get_first_image( $post->post_content ), $message );
809
-
810
- if ( 'future' == $post->post_status ) {
811
- $message = str_replace( '[post_scheduled_date]', bnfw_format_date( $post->post_date ), $message );
812
- $message = str_replace( '[post_scheduled_date_gmt]', bnfw_format_date( $post->post_date_gmt ), $message );
813
- } else {
814
- $message = str_replace( '[post_scheduled_date]', 'Published', $message );
815
- $message = str_replace( '[post_scheduled_date_gmt]', 'Published', $message );
816
- }
817
-
818
- $categories = wp_get_post_categories( $post_id, array( 'fields' => 'all' ) );
819
-
820
- $message = str_replace( '[post_category]', implode( ', ', wp_list_pluck( $categories, 'name' ) ), $message );
821
-
822
- if ( count( $categories ) > 0 ) {
823
- $message = str_replace(
824
- array(
825
- '[post_category_slug]',
826
- '[post_category_description]',
827
- ),
828
- array(
829
- $categories[ 0 ]->slug,
830
- $categories[ 0 ]->description,
831
- ),
832
- $message
833
- );
834
- }
835
-
836
- $tag_list = implode( ', ', wp_get_post_tags( $post_id, array( 'fields' => 'names' ) ) );
837
- $message = str_replace( '[post_tag]', $tag_list, $message );
838
-
839
- $user_info = get_userdata( $post->post_author );
840
- $message = str_replace( '[post_author]', $user_info->display_name, $message );
841
-
842
- $message = str_replace( '[author_link]', get_author_posts_url( $post->post_author ), $message );
843
-
844
- if ( $last_id = get_post_meta( $post->ID, '_edit_lock', true ) ) {
845
-
846
- $last_id = explode(':',$last_id);
847
- if(count($last_id) > 1){
848
- $last_id = end($last_id);
849
- }
850
-
851
- if ( $post->post_author != $last_id ) {
852
- $last_user_info = get_userdata( $last_id );
853
- } else {
854
- $last_user_info = $user_info;
855
- }
856
-
857
- $message = str_replace( '[post_update_author]', $last_user_info->display_name, $message );
858
- }
859
-
860
- $message = str_replace( '[post_term', '[post_term id="' . $post_id . '"', $message );
861
- add_shortcode( 'post_term', array( $this, 'post_term_shortcode_handler' ) );
862
- $message = do_shortcode( $message );
863
- remove_shortcode( 'post_term', array( $this, 'post_term_shortcode_handler' ) );
864
-
865
- return apply_filters( 'bnfw_shortcodes_post', $message, $post_id );
866
- }
867
-
868
- /**
869
- * Retrieves the edit post link for post.
870
- *
871
- * This is a copy of the built-in function without the user check.
872
- *
873
- * Can be used within the WordPress loop or outside of it. Can be used with
874
- * pages, posts, attachments, and revisions.
875
- *
876
- * @param int|WP_Post $id Optional. Post ID or post object. Default is the global `$post`.
877
- * @param string $context Optional. How to output the '&' character. Default '&amp;'.
878
- * @return string|null The edit post link for the given post. null if the post type is invalid or does
879
- * not allow an editing UI.
880
- */
881
- public function get_edit_post_link( $id = 0, $context = 'display' ) {
882
- if ( ! $post = get_post( $id ) )
883
- return;
884
-
885
- if ( 'revision' === $post->post_type )
886
- $action = '';
887
- elseif ( 'display' == $context )
888
- $action = '&amp;action=edit';
889
- else
890
- $action = '&action=edit';
891
-
892
- $post_type_object = get_post_type_object( $post->post_type );
893
- if ( ! $post_type_object )
894
- return;
895
-
896
- if ( $post_type_object->_edit_link ) {
897
- $link = admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) );
898
- } else {
899
- $link = '';
900
- }
901
-
902
- /**
903
- * Filters the post edit link.
904
- *
905
- * @since 2.3.0
906
- *
907
- * @param string $link The edit link.
908
- * @param int $post_id Post ID.
909
- * @param string $context The link context. If set to 'display' then ampersands
910
- * are encoded.
911
- */
912
- return apply_filters( 'get_edit_post_link', $link, $post->ID, $context );
913
- }
914
-
915
- /**
916
- * Handle post term shortcode.
917
- *
918
- * @param array $atts Shortocde attributes.
919
- *
920
- * @return string Processed string.
921
- */
922
- public function post_term_shortcode_handler( $atts ) {
923
- $atts = shortcode_atts( array(
924
- 'taxonomy' => '',
925
- 'id' => 0,
926
- ), $atts );
927
-
928
- $terms = wp_get_post_terms( $atts[ 'id' ], $atts[ 'taxonomy' ], array( 'fields' => 'names' ) );
929
-
930
- if ( ! is_wp_error( $terms ) ) {
931
- return implode( ', ', $terms );
932
- }
933
-
934
- return '';
935
- }
936
-
937
- /**
938
- * Strip shortcodes, unless disabled.
939
- *
940
- * @param string $content Content who's shortcodes should be stripped.
941
- *
942
- * @return string Processed content.
943
- */
944
- private function may_be_strip_shortcode( $content ) {
945
- $enable_shortcode = get_option( 'bnfw_enable_shortcodes' );
946
-
947
- if ( '1' == $enable_shortcode ) {
948
- return $content;
949
- }
950
-
951
- return strip_shortcodes( $content );
952
- }
953
-
954
- /**
955
- * Handle comment shortcodes.
956
- *
957
- * @since 1.0
958
- *
959
- * @param string $message String to be processed.
960
- * @param int $comment_id Comment id.
961
- *
962
- * @return string Processed string.
963
- */
964
- private function comment_shortcodes( $message, $comment_id ) {
965
- $comment = get_comment( $comment_id );
966
-
967
- $message = str_replace( '[comment_ID]', $comment->comment_ID, $message );
968
- $message = str_replace( '[comment_post_ID]', $comment->comment_post_ID, $message );
969
- $message = str_replace( '[comment_author]', $comment->comment_author, $message );
970
- $message = str_replace( '[comment_author_email]', $comment->comment_author_email, $message );
971
- $message = str_replace( '[comment_author_url]', $comment->comment_author_url, $message );
972
- $message = str_replace( '[comment_author_IP]', $comment->comment_author_IP, $message );
973
- $message = str_replace( '[comment_date]', bnfw_format_date( $comment->comment_date ), $message );
974
- $message = str_replace( '[comment_date_gmt]', bnfw_format_date( $comment->comment_date_gmt ), $message );
975
- $message = str_replace( '[comment_content]', get_comment_text( $comment->comment_ID ), $message );
976
- $message = str_replace( '[comment_karma]', $comment->comment_karma, $message );
977
- $message = str_replace( '[comment_approved]', str_replace( array( '0', '1', 'spam' ), array( 'Awaiting Moderation', 'Approved', 'Spam' ), $comment->comment_approved ), $message );
978
- $message = str_replace( '[comment_agent]', $comment->comment_agent, $message );
979
- $message = str_replace( '[comment_type]', $comment->comment_type, $message );
980
- $message = str_replace( '[comment_parent]', $comment->comment_parent, $message );
981
- $message = str_replace( '[user_id]', $comment->user_id, $message );
982
- $message = str_replace( '[permalink]', get_comment_link( $comment->comment_ID ), $message );
983
- $message = str_replace( '[comment_moderation_link]', admin_url( 'comment.php?action=editcomment&c=' ) . $comment->comment_ID, $message );
984
- $message = str_replace( '[comment_moderation_approve]', '<a href="' . wp_nonce_url( admin_url( "comment.php?action=approve&c={$comment->comment_ID}#wpbody-content" ) ) . '">Approve</a>', $message );
985
- $message = str_replace( '[comment_moderation_spam]', '<a href="' . wp_nonce_url( admin_url( "comment.php?action=spam&c={$comment->comment_ID}#wpbody-content" ) ) . '">Spam</a>', $message );
986
- $message = str_replace( '[comment_moderation_delete]', '<a href="' . wp_nonce_url( admin_url( "comment.php?action=trash&c={$comment->comment_ID}#wpbody-content" ) ) . '">Delete</a>', $message );
987
-
988
- $parent_comment = get_comment( $comment->comment_parent );
989
- if ( $parent_comment instanceof WP_Comment ) {
990
- $message = str_replace( '[comment_parent_content]', $parent_comment->comment_content, $message );
991
- }
992
-
993
- return $message;
994
- }
995
-
996
- /**
997
- * Handle user shortcodes.
998
- *
999
- * @since 1.0
1000
- *
1001
- * @param string $message String to be processed.
1002
- * @param int $user_id User id.
1003
- *
1004
- * @return string Processed string.
1005
- */
1006
- public function user_shortcodes( $message, $user_id, $prefix = '' ) {
1007
- global $wp_roles;
1008
-
1009
- $user_info = get_userdata( $user_id );
1010
-
1011
- if ( ! $user_info instanceof WP_User ) {
1012
- return $message;
1013
- }
1014
-
1015
- // deprecated
1016
- $message = str_replace( '[ID]', $user_info->ID, $message );
1017
- $message = str_replace( '[display_name]', $user_info->display_name, $message );
1018
- $message = str_replace( '[nickname]', $user_info->nickname, $message );
1019
- $message = str_replace( '[commenter_avatar]', get_avatar_url( $user_id ), $message );
1020
-
1021
- $message = str_replace( '[' . $prefix . 'user_id]', $user_info->ID, $message );
1022
- $message = str_replace( '[' . $prefix . 'user_login]', $user_info->user_login, $message );
1023
- $message = str_replace( '[' . $prefix . 'user_nicename]', $user_info->user_nicename, $message );
1024
- $message = str_replace( '[' . $prefix . 'user_email]', $user_info->user_email, $message );
1025
- $message = str_replace( '[' . $prefix . 'user_url]', $user_info->user_url, $message );
1026
- $message = str_replace( '[' . $prefix . 'user_registered]', $user_info->user_registered, $message );
1027
- $message = str_replace( '[' . $prefix . 'user_display_name]', $user_info->display_name, $message );
1028
- $message = str_replace( '[' . $prefix . 'user_firstname]', $user_info->user_firstname, $message );
1029
- $message = str_replace( '[' . $prefix . 'user_lastname]', $user_info->user_lastname, $message );
1030
- $message = str_replace( '[' . $prefix . 'user_nickname]', $user_info->nickname, $message );
1031
- $message = str_replace( '[' . $prefix . 'user_description]', $user_info->user_description, $message );
1032
- $message = str_replace( '[' . $prefix . 'user_avatar]', get_avatar_url( $user_id ), $message );
1033
-
1034
- $roles = array_map( array( $this, 'get_role_label_by_name' ), $user_info->roles );
1035
- $message = str_replace( '[' . $prefix . 'user_role]', implode( ', ', $roles ), $message );
1036
-
1037
- $user_capabilities = bnfw_format_user_capabilities( $user_info->wp_capabilities );
1038
- if ( ! empty( $user_capabilities ) ) {
1039
- $message = str_replace( '[wp_capabilities]', $user_capabilities, $message );
1040
- $message = str_replace( '[' . $prefix . 'user_wp_capabilities]', $user_capabilities, $message );
1041
- }
1042
-
1043
- $message = apply_filters( 'bnfw_shortcodes_user', $message, $user_id, $prefix );
1044
- return $message;
1045
- }
1046
-
1047
- /**
1048
- * Handle taxonomy shortcodes.
1049
- *
1050
- * @access private
1051
- * @since 1.1
1052
- *
1053
- * @param string $message
1054
- * @param string $taxonomy
1055
- * @param int $term_id
1056
- * @return string
1057
- */
1058
- private function taxonomy_shortcodes( $message, $taxonomy, $term_id ) {
1059
- $term_info = get_term( $term_id, $taxonomy );
1060
-
1061
- $message = str_replace( '[slug]', $term_info->slug, $message );
1062
- $message = str_replace( '[name]', $term_info->name, $message );
1063
- $message = str_replace( '[description]', $term_info->description, $message );
1064
-
1065
- return $message;
1066
- }
1067
-
1068
- /**
1069
- * Handle Core Updated Shortcodes.
1070
- *
1071
- * @since 1.6
1072
- *
1073
- * @param string $message Original message with shortcodes.
1074
- * @param string $type The type of email being sent. Can be one of
1075
- * 'success', 'fail', 'manual', 'critical'.
1076
- *
1077
- * @return string Modified content.
1078
- */
1079
- private function core_updated_shortcodes( $message, $type ) {
1080
- $message = str_replace( '[core_update_status]', $type, $message );
1081
-
1082
- return $message;
1083
- }
1084
-
1085
- /**
1086
- * Get the list of emails from the notification settings.
1087
- *
1088
- * @since 1.0
1089
- *
1090
- * @param array $setting Notification settings
1091
- * @param int $id
1092
- * @param bool $process_post_authors
1093
- * @param bool $process_exclude_current_user
1094
- *
1095
- * @return array Emails
1096
- */
1097
- public function get_emails( $setting, $id, $process_post_authors = true,
1098
- $process_exclude_current_user = true ) {
1099
- global $current_user;
1100
-
1101
- $emails = array();
1102
-
1103
- $exclude = null;
1104
- if ( $process_exclude_current_user && 'true' == $setting[ 'disable-current-user' ] ) {
1105
- if ( isset( $current_user->ID ) ) {
1106
- $exclude = $current_user->ID;
1107
- }
1108
- }
1109
-
1110
- $emails[ 'to' ] = array();
1111
-
1112
- if ( ! empty( $setting[ 'users' ] ) ) {
1113
- $emails[ 'to' ] = $this->get_emails_from_users( $setting[ 'users' ], $exclude, $id, $setting );
1114
- }
1115
-
1116
- /**
1117
- * BNFW get to emails.
1118
- */
1119
- if ( $process_post_authors && 'true' === $setting[ 'only-post-author' ] ) {
1120
- $post_id = $id;
1121
-
1122
- if ( bnfw_is_comment_notification( $setting[ 'notification' ] ) ) {
1123
- $comment = get_comment( $id );
1124
- $post_id = $comment->comment_post_ID;
1125
- }
1126
-
1127
- $type = explode( '-', $setting[ 'notification' ], 2 );
1128
- if ( 'approve' == $type[ 0 ] ) {
1129
- if ( ! in_array( $comment->comment_author_email, $emails[ 'to' ] ) ) {
1130
- $emails[ 'to' ][] = $comment->comment_author_email;
1131
- }
1132
- } else {
1133
- if ( $setting[ 'notification' ] == 'user-customfield' || $setting[ 'notification' ] == 'user-customfieldvalue' ) {
1134
- $post_author = $post_id;
1135
- } else {
1136
- $post_author = get_post_field( 'post_author', $post_id );
1137
- }
1138
- $author = get_user_by( 'id', $post_author );
1139
- if ( false !== $author && $post_author != $exclude ) {
1140
- if ( ! in_array( $author->user_email, $emails[ 'to' ] ) ) {
1141
- $emails[ 'to' ][] = $author->user_email;
1142
- }
1143
- }
1144
- }
1145
- }
1146
-
1147
- if ( 'true' == $setting[ 'show-fields' ] ) {
1148
- $default_from_field = get_option( 'blogname' ) . ' <' . get_option( 'admin_email' ) . '>';
1149
-
1150
- if ( ! empty( $setting[ 'from-name' ] ) && ! empty( $setting[ 'from-email' ] ) && is_email( $setting[ 'from-email' ] ) ) {
1151
- $default_from_field = $setting[ 'from-name' ] . ' <' . $setting[ 'from-email' ] . '>';
1152
- }
1153
-
1154
- /**
1155
- * Filter Email From Field.
1156
- */
1157
- $emails[ 'from' ] = apply_filters( 'bnfw_from_field', $default_from_field, $setting, $id, $emails[ 'to' ] );
1158
-
1159
- /**
1160
- * Filter Reply Name Field.
1161
- */
1162
- $emails[ 'reply-name' ] = apply_filters( 'bnfw_reply_name_field', $setting[ 'reply-name' ], $setting, $id, $emails[ 'to' ] );
1163
-
1164
- /**
1165
- * Filter Reply Email Field.
1166
- */
1167
- $emails[ 'reply-email' ] = apply_filters( 'bnfw_reply_email_field', $setting[ 'reply-email' ], $setting, $id, $emails[ 'to' ] );
1168
-
1169
- if ( ! empty( $setting[ 'cc' ] ) ) {
1170
- $emails[ 'cc' ] = $this->get_emails_from_users( $setting[ 'cc' ], $exclude, $id, $setting );
1171
- }
1172
-
1173
- if ( ! empty( $setting[ 'bcc' ] ) ) {
1174
- $emails[ 'bcc' ] = $this->get_emails_from_users( $setting[ 'bcc' ], $exclude, $id, $setting );
1175
- }
1176
- }
1177
-
1178
- $excluded_emails = array();
1179
-
1180
- if ( ! empty( $setting[ 'exclude-users' ] ) ) {
1181
- $excluded_emails = $this->get_emails_from_users( $setting[ 'exclude-users' ] );
1182
- }
1183
-
1184
- if ( ! empty( $excluded_emails ) ) {
1185
- $emails[ 'to' ] = array_diff( $emails[ 'to' ], $excluded_emails );
1186
-
1187
- if ( ! empty( $emails[ 'cc' ] ) ) {
1188
- $emails[ 'cc' ] = array_diff( $emails[ 'cc' ], $excluded_emails );
1189
- }
1190
-
1191
- if ( ! empty( $emails[ 'bcc' ] ) ) {
1192
- $emails[ 'bcc' ] = array_diff( $emails[ 'bcc' ], $excluded_emails );
1193
- }
1194
- }
1195
- $emails[ 'to' ] = apply_filters( 'bnfw_to_emails', $emails[ 'to' ], $setting, $id );
1196
-
1197
- return $emails;
1198
- }
1199
-
1200
- /**
1201
- * Get emails from users.
1202
- *
1203
- * @since 1.2
1204
- *
1205
- * @param array $users Users Array
1206
- * @param int $exclude User id to exclude
1207
- * @param int $post_id Post id.
1208
- * @param array $setting Notification setting.
1209
- *
1210
- * @return array
1211
- */
1212
- public function get_emails_from_users( $users, $exclude = null,
1213
- $post_id = 0, $setting = array() ) {
1214
- $user_ids = array();
1215
- $user_roles = array();
1216
- $non_wp_users = array();
1217
-
1218
- if ( empty( $users ) ) {
1219
- return array();
1220
- }
1221
-
1222
- foreach ( $users as $user ) {
1223
- if ( $this->starts_with( $user, 'role-' ) ) {
1224
- $user_roles[] = str_replace( 'role-', '', $user );
1225
- } elseif ( strpos( $user, '@' ) !== false ) {
1226
- $non_wp_users[] = $user;
1227
- continue;
1228
- } elseif ( absint( $user ) > 0 ) {
1229
- $user_ids[] = absint( $user );
1230
- } else {
1231
- $non_wp_users[] = $user;
1232
- }
1233
- }
1234
-
1235
- if ( null != $exclude ) {
1236
- $user_ids = array_diff( $user_ids, array( $exclude ) );
1237
- }
1238
-
1239
- $emails_from_user_ids = $this->get_emails_from_id( $user_ids );
1240
- $emails_from_user_roles = $this->get_emails_from_role( $user_roles, $exclude );
1241
-
1242
- if ( ! empty( $setting ) ) {
1243
- // for new comment notifications, we need to use post id instead of comment id.
1244
- if ( bnfw_is_comment_notification( $setting[ 'notification' ] ) && $post_id ) {
1245
- $comment = get_comment( $post_id );
1246
- $post_id = $comment->comment_post_ID;
1247
- }
1248
- }
1249
-
1250
- $non_wp_emails = apply_filters( 'bnfw_non_wp_emails', array(), $non_wp_users, $post_id );
1251
-
1252
- return array_merge( $emails_from_user_roles, $emails_from_user_ids, $non_wp_emails );
1253
- }
1254
-
1255
- /**
1256
- * Get user emails by user ids.
1257
- *
1258
- * @since 1.0
1259
- *
1260
- * @param array $user_ids.
1261
- *
1262
- * @return array Emails.
1263
- */
1264
- private function get_emails_from_id( $user_ids ) {
1265
- $email_list = array();
1266
- if ( is_array( $user_ids ) && count( $user_ids ) > 0 ) {
1267
- $user_query = new WP_User_Query( array( 'include' => $user_ids ) );
1268
- foreach ( $user_query->results as $user ) {
1269
- $email_list[] = $user->user_email;
1270
- }
1271
- }
1272
- return $email_list;
1273
- }
1274
-
1275
- /**
1276
- * Get emails of users based on role.
1277
- *
1278
- * @since 1.0
1279
- * @param array $roles User Roles
1280
- * @param int $exclude User id to exclude
1281
- * @return array Email ids
1282
- */
1283
- private function get_emails_from_role( $roles, $exclude = null ) {
1284
- if ( ! is_array( $roles ) ) {
1285
- $roles = array( $roles );
1286
- }
1287
-
1288
- $email_list = array();
1289
- foreach ( $roles as $role ) {
1290
- $role_name = $this->get_role_name_by_label( $role );
1291
- $users = get_users(
1292
- array(
1293
- 'role' => $role_name,
1294
- 'fields' => array( 'user_email', 'ID' ),
1295
- )
1296
- );
1297
-
1298
- foreach ( $users as $user ) {
1299
- if ( null != $exclude ) {
1300
- if ( $user->ID == $exclude ) {
1301
- continue;
1302
- }
1303
- }
1304
-
1305
- if ( ! in_array( $user->user_email, $email_list ) ) {
1306
- $email_list[] = $user->user_email;
1307
- }
1308
- }
1309
- }
1310
-
1311
- return $email_list;
1312
- }
1313
-
1314
- /**
1315
- * Find if a string starts with another string.
1316
- *
1317
- * @since 1.2
1318
- *
1319
- * @param $haystack
1320
- * @param $needle
1321
- *
1322
- * @return bool
1323
- */
1324
- private function starts_with( $haystack, $needle ) {
1325
- // search backwards starting from haystack length characters from the end
1326
- return '' === $needle || strrpos( $haystack, $needle, -strlen( $haystack ) ) !== false;
1327
- }
1328
-
1329
- /**
1330
- * Get User role name by label.
1331
- *
1332
- * @param mixed $role_label
1333
- *
1334
- * @return int|string
1335
- */
1336
- protected function get_role_name_by_label( $role_label ) {
1337
- global $wp_roles;
1338
- foreach ( $wp_roles->roles as $role_name => $role_info ) {
1339
- if ( $role_label == $role_info[ 'name' ] || $role_name == $role_label ) {
1340
- return $role_name;
1341
- }
1342
- }
1343
-
1344
- // There is something wrong
1345
- return '';
1346
- }
1347
-
1348
- /**
1349
- * Get the lable for a user role from name.
1350
- *
1351
- * @param string $role_name Role name
1352
- *
1353
- * @return string Role Label.
1354
- */
1355
- public function get_role_label_by_name( $role_name ) {
1356
- global $wp_roles;
1357
-
1358
- if ( ! isset( $wp_roles->roles[ $role_name ] ) ) {
1359
- return '';
1360
- }
1361
-
1362
- return translate_user_role( $wp_roles->roles[ $role_name ][ 'name' ] );
1363
- }
1364
-
1365
- /**
1366
- * Get first image in post.
1367
- *
1368
- * @param mixed $post_content
1369
- *
1370
- * @return string
1371
- */
1372
- protected function get_first_image( $post_content ) {
1373
- if ( preg_match_all( '/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post_content, $matches ) ) {
1374
- return $matches[ 1 ][ 0 ];
1375
- }
1376
- }
1377
-
1378
- /**
1379
- * Generate email headers based on the emails.
1380
- *
1381
- * @since 1.0
1382
- * @param array $emails
1383
- * @return array
1384
- */
1385
- public function get_headers( $emails ) {
1386
- $headers = array();
1387
-
1388
- if ( ! empty( $emails[ 'from' ] ) ) {
1389
- $headers[] = 'From:' . $emails[ 'from' ];
1390
- }
1391
-
1392
- if ( ! empty( $emails[ 'reply-email' ] ) && is_email( $emails[ 'reply-email' ] ) ) {
1393
- $headers[] = 'Reply-To:' . $emails[ 'reply-name' ] . '<' . $emails[ 'reply-email' ] . '>';
1394
- }
1395
-
1396
- if ( ! empty( $emails[ 'cc' ] ) ) {
1397
- $headers[] = 'Cc:' . implode( ',', $emails[ 'cc' ] );
1398
- }
1399
- if ( ! empty( $emails[ 'bcc' ] ) ) {
1400
- $headers[] = 'Bcc:' . implode( ',', $emails[ 'bcc' ] );
1401
- }
1402
-
1403
- /**
1404
- * Filter out mail headers.
1405
- *
1406
- * @param array $headers Headers.
1407
- * @param array $emails Emails.
1408
- */
1409
- return apply_filters( 'bnfw_mail_headers', $headers, $emails );
1410
- }
1411
-
1412
- public function handle_user_request_email_shortcodes( $message, $setting,
1413
- $email_data ) {
1414
- $message = $this->handle_shortcodes( $message, $setting[ 'notification' ], $email_data );
1415
-
1416
- return $message;
1417
- }
1418
-
1419
- public function handle_user_confirmed_action_email_shortcodes( $message,
1420
- $setting,
1421
- $email_data ) {
1422
- $message = $this->handle_shortcodes( $message, $setting[ 'notification' ], $email_data );
1423
-
1424
- return $message;
1425
- }
1426
-
1427
- public function handle_data_export_email_shortcodes( $message, $setting,
1428
- $request_id ) {
1429
- $message = $this->handle_shortcodes( $message, $setting[ 'notification' ], $request_id );
1430
-
1431
- return $message;
1432
- }
1433
-
1434
- protected function confirm_action_shortcodes( $message, $extra_data ) {
1435
- $message = $this->data_request_shortcodes( $message, $extra_data );
1436
- $message = str_replace( '[request_confirmation_link]', $extra_data[ 'confirm_url' ], $message );
1437
- if ( isset( $extra_data[ 'email' ] ) ) {
1438
- $message = str_replace( '[request_email]', $extra_data[ 'email' ], $message );
1439
- }
1440
-
1441
- if ( isset( $extra_data[ 'user_email' ] ) ) {
1442
- $message = str_replace( '[request_email]', $extra_data[ 'user_email' ], $message );
1443
- }
1444
-
1445
- return $message;
1446
- }
1447
-
1448
- protected function confirmed_action_shortcodes( $message, $extra_data ) {
1449
- $message = $this->data_request_shortcodes( $message, $extra_data );
1450
- $message = str_replace( '[data_privacy_requests_url]', $extra_data[ 'manage_url' ], $message );
1451
- $message = str_replace( '[request_email]', $extra_data[ 'user_email' ], $message );
1452
-
1453
- return $message;
1454
- }
1455
-
1456
- protected function data_request_shortcodes( $message, $extra_data ) {
1457
- $message = str_replace( '[data_request_type]', $extra_data[ 'description' ], $message );
1458
-
1459
- return $message;
1460
- }
1461
-
1462
- protected function data_export_shortcodes( $message, $request_id ) {
1463
- $export_file_url = get_post_meta( $request_id, '_export_file_url', true );
1464
-
1465
- $export_file_url = 'Download File: '.$this->get_export_downloadable_url($request_id);
1466
-
1467
- $message = str_replace( '[data_privacy_download_url]', $export_file_url, $message );
1468
-
1469
- $expiration = apply_filters( 'wp_privacy_export_expiration', 3 * DAY_IN_SECONDS );
1470
- $expiration_date = date_i18n( get_option( 'date_format' ), time() + $expiration );
1471
- $message = str_replace( '[data_privacy_download_expiry]', $expiration_date, $message );
1472
-
1473
- return $message;
1474
- }
1475
-
1476
- protected function data_erased_shortcodes( $message, $extra_data ) {
1477
- $privacy_policy_url = (!isset($extra_data[ 'privacy_policy_url' ]))? get_privacy_policy_url() : $extra_data[ 'privacy_policy_url' ];
1478
-
1479
- $message = str_replace( '[privacy_policy_url]', $privacy_policy_url, $message );
1480
- $message = str_replace( '[sitename]', $extra_data[ 'sitename' ], $message );
1481
-
1482
- return $message;
1483
- }
1484
-
1485
- /**
1486
- * Process shortcodes in email.
1487
- *
1488
- * @param $email
1489
- * @param $post_id
1490
- * @param $setting
1491
- *
1492
- * @return string
1493
- */
1494
- public function process_shortcodes_in_email( $email, $post_id, $setting,
1495
- $to_emails ) {
1496
- if ( ! empty( $setting ) ) {
1497
- if ( $this->starts_with( $setting[ 'notification' ], 'comment-' ) || $this->starts_with( $setting[ 'notification' ], 'moderate-' ) ) {
1498
- // for new comment notifications, we need to use post id instead of comment id.
1499
- $post_id = bnfw_get_post_id_from_comment( $post_id );
1500
- }
1501
- }
1502
-
1503
- $email = $this->handle_shortcodes( $email, $setting[ 'notification' ], $post_id );
1504
-
1505
- if ( is_array( $to_emails ) && ! empty( $to_emails ) ) {
1506
- $to_email = $to_emails[ 0 ];
1507
-
1508
- $email = $this->handle_global_user_shortcodes( $email, $to_email );
1509
- }
1510
-
1511
- $processed_emails = array();
1512
- if ( is_email( $email ) ) {
1513
- $processed_emails[] = $email;
1514
- }
1515
-
1516
- $emails = apply_filters( 'bnfw_non_wp_emails', $processed_emails, array( $email ), $post_id );
1517
-
1518
- if ( empty( $emails ) ) {
1519
- return '';
1520
- }
1521
-
1522
- return $emails[ 0 ];
1523
- }
1524
-
1525
- /**
1526
- * Check email content type.
1527
- *
1528
- * @param string $setting Setting.
1529
- * @param string $content Content.
1530
- *
1531
- * @return string Content .
1532
- */
1533
- public function check_email_content_type( $setting, $content ) {
1534
-
1535
- if ( 'html' == $setting[ 'email-formatting' ] ) {
1536
- add_filter( 'wp_mail_content_type', array( $this, 'set_html_content_type' ) );
1537
- if ( 'true' !== $setting[ 'disable-autop' ] ) {
1538
- $content = wpautop( $content );
1539
- }
1540
- } else {
1541
- add_filter( 'wp_mail_content_type', array( $this, 'set_text_content_type' ) );
1542
- $content = strip_tags( $content );
1543
- }
1544
-
1545
- return $content;
1546
- }
1547
-
1548
- /**
1549
- * Set the email formatting to HTML.
1550
- *
1551
- * @since 1.4
1552
- */
1553
- public function set_html_content_type() {
1554
- return 'text/html';
1555
- }
1556
-
1557
- /**
1558
- * Set the email formatting to text.
1559
- *
1560
- * @since 1.4
1561
- */
1562
- public function set_text_content_type() {
1563
- return 'text/plain';
1564
- }
1565
-
1566
- /**
1567
- * Get user's download URL from data export request
1568
- *
1569
- * @since 1.8.4
1570
- * @param int $user_email
1571
- * @return string $download_url | string error message
1572
- */
1573
- public function get_export_downloadable_url($request_id = null){
1574
- if(!$request_id)
1575
- return;
1576
-
1577
- global $wpdb;
1578
- $table = $wpdb->prefix.'posts';
1579
- $query = 'SELECT ID FROM '.$table.' WHERE `post_type` = "user_request" AND `ID` = '.$request_id;
1580
-
1581
- $query = apply_filters('export_downloadable_url_query',$query,$request_id);
1582
-
1583
- $get_id = $wpdb->get_var($query);
1584
-
1585
- $file = get_post_meta($get_id,'_export_file_name',true);
1586
- $upload_url = wp_upload_dir();
1587
- $dl_url = $upload_url['baseurl'].'/wp-personal-data-exports/'.$file;
1588
-
1589
- $dl_url = apply_filters('export_downloadable_url_return',$dl_url);
1590
-
1591
- if($dl_url)
1592
- return $dl_url;
1593
- else
1594
- return __('Error: Download link is not available please contact support');
1595
-
1596
- }
1597
-
1598
- }
1
+ <?php
2
+
3
+ /**
4
+ * BNFW Engine
5
+ *
6
+ * @since 1.0
7
+ */
8
+ class BNFW_Engine {
9
+
10
+ /**
11
+ * Send test email.
12
+ *
13
+ * @since 1.2
14
+ *
15
+ * @param array $setting
16
+ */
17
+ public function send_test_email( $setting ) {
18
+ $subject = __( 'Test Email:', 'bnfw' ) . ' ' . $setting[ 'subject' ];
19
+ $message = '<p><strong>' . __( 'This is a test email. All shortcodes below will show in place but not be replaced with content.', 'bnfw' ) . '</strong></p>' . stripslashes( $setting[ 'message' ] );
20
+
21
+ if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
22
+ $message = wpautop( $message );
23
+ }
24
+
25
+ $current_user = wp_get_current_user();
26
+ $email = $current_user->user_email;
27
+
28
+ $headers = array();
29
+ if ( 'html' == $setting[ 'email-formatting' ] ) {
30
+ $headers[] = 'Content-type: text/html';
31
+ $message = apply_filters( 'bnfw_test_email_message', $message, $setting );
32
+ } elseif ( 'text' == $setting[ 'email-formatting' ] ) {
33
+ $message = strip_tags( $message );
34
+ }
35
+
36
+ wp_mail( $email, stripslashes( $subject ), $message, $headers );
37
+ }
38
+
39
+ /**
40
+ * Send the notification email.
41
+ *
42
+ * @since 1.0
43
+ * @param array $setting
44
+ * @param int $id
45
+ */
46
+ public function send_notification( $setting, $id ) {
47
+ /**
48
+ * BNFW - Whether notification is disabled?
49
+ *
50
+ * @since 1.3.6
51
+ */
52
+
53
+ $notification_disabled = apply_filters( 'bnfw_notification_disabled', ( 'true' === $setting[ 'disabled' ] ), $id, $setting );
54
+
55
+ if ( ! $notification_disabled ) {
56
+
57
+ $subject = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $id );
58
+ $message = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $id );
59
+ $emails = $this->get_emails( $setting, $id );
60
+ $headers = $this->get_headers( $emails );
61
+
62
+ if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
63
+ $message = wpautop( $message );
64
+ }
65
+
66
+ if ( 'html' == $setting[ 'email-formatting' ] ) {
67
+ $headers[] = 'Content-type: text/html';
68
+ $message = apply_filters( 'bnfw_notification_message', $message, $setting );
69
+ } else {
70
+ $headers[] = 'Content-type: text/plain';
71
+ if ( 'text' == $setting[ 'email-formatting' ] ) {
72
+ $message = strip_tags( $message );
73
+ }
74
+ }
75
+
76
+ $emails = apply_filters( 'bnfw_emails', $emails, $setting, $id );
77
+
78
+ $send = apply_filters( 'bnfw_can_send_email', true, $setting, $emails, $subject, $message, $headers );
79
+
80
+ if ( ! $send ) {
81
+ return;
82
+ }
83
+
84
+ if ( isset( $emails[ 'to' ] ) && is_array( $emails[ 'to' ] ) ) {
85
+ foreach ( $emails[ 'to' ] as $email ) {
86
+ wp_mail( $email, stripslashes( $this->handle_global_user_shortcodes( $subject, $email ) ), $this->handle_global_user_shortcodes( $message, $email ), $headers );
87
+ }
88
+ }
89
+ }
90
+ }
91
+
92
+ /**
93
+ * Send new user registration notification email.
94
+ *
95
+ * @since 1.1
96
+ * @param array $setting Notification setting
97
+ * @param object $user User object
98
+ * @param string $password_url Plain text password in WP < 4.3 and password url in WP > 4.3
99
+ */
100
+ public function send_registration_email( $setting, $user, $password_url = '' ) {
101
+ /**
102
+ * Whether to trigger welcome email notification or not.
103
+ *
104
+ * @since 1.7
105
+ */
106
+ $trigger_notification = apply_filters( 'bnfw_trigger_welcome-email_notification', true, $setting, $user );
107
+
108
+ if ( ! $trigger_notification ) {
109
+ return;
110
+ }
111
+
112
+ $user_id = $user->ID;
113
+
114
+ $subject = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $user_id );
115
+ $message = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $user_id );
116
+
117
+ $subject = str_replace( '[password]', $password_url, $subject );
118
+ $message = str_replace( '[password]', $password_url, $message );
119
+
120
+ $subject = str_replace( '[password_url]', $password_url, $subject );
121
+ $message = str_replace( '[password_url]', $password_url, $message );
122
+
123
+ $subject = str_replace( '[login_url]', wp_login_url(), $subject );
124
+ $message = str_replace( '[login_url]', wp_login_url(), $message );
125
+
126
+ if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
127
+ $message = wpautop( $message );
128
+ }
129
+
130
+ $headers = array();
131
+ if ( 'html' == $setting[ 'email-formatting' ] ) {
132
+ $headers[] = 'Content-type: text/html';
133
+ $message = apply_filters( 'bnfw_registration_email_message', $message, $setting );
134
+ } elseif ( 'text' == $setting[ 'email-formatting' ] ) {
135
+ $message = strip_tags( $message );
136
+ }
137
+
138
+ $subject = $this->handle_global_user_shortcodes( $subject, $user->user_email );
139
+ $message = $this->handle_global_user_shortcodes( $message, $user->user_email );
140
+ wp_mail( $user->user_email, stripslashes( $subject ), $message, $headers );
141
+ }
142
+
143
+ /**
144
+ * Send user login notification email.
145
+ *
146
+ * @since 1.1
147
+ * @param array $setting Notification setting
148
+ * @param object $user User object
149
+ */
150
+ public function send_user_login_email( $setting, $user ) {
151
+
152
+ $trigger_notification = apply_filters( 'bnfw_trigger_user-login_notification', true, $setting, $user );
153
+
154
+ if ( ! $trigger_notification ) {
155
+ return;
156
+ }
157
+
158
+ $user_id = $user->ID;
159
+
160
+ $subject = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $user_id );
161
+ $message = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $user_id );
162
+ $emails = $this->get_emails( $setting, $user_id );
163
+ $headers = $this->get_headers( $emails );
164
+
165
+ if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
166
+ $message = wpautop( $message );
167
+ }
168
+
169
+ if ( 'html' == $setting[ 'email-formatting' ] ) {
170
+ $headers[] = 'Content-type: text/html';
171
+ $message = apply_filters( 'bnfw_notification_message', $message, $setting );
172
+ } elseif ( 'text' == $setting[ 'email-formatting' ] ) {
173
+ $message = strip_tags( $message );
174
+ }
175
+
176
+ $subject = $this->handle_global_user_shortcodes( $subject, $user->user_email );
177
+ $message = $this->handle_global_user_shortcodes( $message, $user->user_email );
178
+
179
+ wp_mail( $user->user_email, stripslashes( $subject ), $message, $headers );
180
+ }
181
+
182
+ /**
183
+ * Send user login notification email for admin.
184
+ *
185
+ * @since 1.1
186
+ * @param array $setting Notification setting
187
+ * @param object $user User object
188
+ */
189
+ public function send_user_login_email_for_admin( $setting, $user ) {
190
+
191
+ $trigger_notification = apply_filters( 'bnfw_trigger_user-login_notification', true, $setting, $user );
192
+
193
+ if ( ! $trigger_notification ) {
194
+ return;
195
+ }
196
+ $user_id = $user->ID;
197
+
198
+ $this->send_notification( $setting, $user_id );
199
+ }
200
+
201
+ /**
202
+ * Send comment reply notification email.
203
+ *
204
+ * @since 1.3
205
+ * @param array $setting Notification setting
206
+ * @param object $comment Comment object
207
+ * @param object $parent_comment Parent comment object
208
+ */
209
+ public function send_comment_reply_email( $setting, $comment,
210
+ $parent_comment ) {
211
+ $comment_id = $comment->comment_ID;
212
+
213
+ /**
214
+ * BNFW - Whether notification is disabled?
215
+ *
216
+ * @since 1.3.6
217
+ */
218
+ $notification_disabled = apply_filters( 'bnfw_notification_disabled', false, $comment_id, $setting );
219
+
220
+ if ( ! $notification_disabled ) {
221
+ $subject = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $comment_id );
222
+ $message = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $comment_id );
223
+
224
+ $headers = array();
225
+ if ( 'html' == $setting[ 'email-formatting' ] ) {
226
+ $headers[] = 'Content-type: text/html';
227
+ } elseif ( 'text' == $setting[ 'email-formatting' ] ) {
228
+ $message = strip_tags( $message );
229
+ }
230
+
231
+ if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
232
+ $message = wpautop( $message );
233
+ $message = apply_filters( 'bnfw_comment_reply_email_message', $message, $setting );
234
+ }
235
+
236
+ $subject = $this->handle_global_user_shortcodes( $subject, $parent_comment->comment_author_email );
237
+ $message = $this->handle_global_user_shortcodes( $message, $parent_comment->comment_author_email );
238
+ wp_mail( $parent_comment->comment_author_email, stripslashes( $subject ), $message, $headers );
239
+ }
240
+ }
241
+
242
+ /**
243
+ * Send user role changed email.
244
+ *
245
+ * @since 1.3.9
246
+ *
247
+ * @param array $setting Notification setting
248
+ * @param int $user_id User ID
249
+ * @param array $old_role Old User Role.
250
+ * @param array $new_role New User Role.
251
+ */
252
+ public function send_user_role_changed_email( $setting, $user_id, $old_role,
253
+ $new_role ) {
254
+ $subject = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $user_id );
255
+ $message = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $user_id );
256
+
257
+ $subject = $this->handle_user_role_shortcodes( $subject, $old_role, $new_role );
258
+ $message = $this->handle_user_role_shortcodes( $message, $old_role, $new_role );
259
+
260
+ $headers = array();
261
+ if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
262
+ $message = wpautop( $message );
263
+ }
264
+
265
+ if ( 'html' == $setting[ 'email-formatting' ] ) {
266
+ $headers[] = 'Content-type: text/html';
267
+ $message = apply_filters( 'bnfw_user_role_changed_email_message', $message, $setting );
268
+ } elseif ( 'text' == $setting[ 'email-formatting' ] ) {
269
+ $message = strip_tags( $message );
270
+ }
271
+
272
+ $user = get_user_by( 'id', $user_id );
273
+
274
+ $subject = $this->handle_global_user_shortcodes( $subject, $user->user_email );
275
+ $message = $this->handle_global_user_shortcodes( $message, $user->user_email );
276
+ wp_mail( $user->user_email, stripslashes( $subject ), $message, $headers );
277
+ }
278
+
279
+ /**
280
+ * Send user role added support User Role Editor by Members Plugin.
281
+ *
282
+ * @since 1.3.9
283
+ *
284
+ * @param array $setting Notification setting
285
+ * @param int $user_id User ID
286
+ * @param array $old_role Old User Role.
287
+ * @param array $new_role New User Role.
288
+ */
289
+ public function send_user_role_added_email( $setting, $user_id, $old_role,
290
+ $new_role ) {
291
+ $subject = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $user_id );
292
+ $message = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $user_id );
293
+
294
+ $subject = $this->handle_user_added_role_shortcodes( $subject, $old_role, $new_role );
295
+ $message = $this->handle_user_added_role_shortcodes( $message, $old_role, $new_role );
296
+
297
+ $headers = array();
298
+ if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
299
+ $message = wpautop( $message );
300
+ }
301
+
302
+ if ( 'html' == $setting[ 'email-formatting' ] ) {
303
+ $headers[] = 'Content-type: text/html';
304
+ $message = apply_filters( 'bnfw_user_role_changed_email_message', $message, $setting );
305
+ } elseif ( 'text' == $setting[ 'email-formatting' ] ) {
306
+ $message = strip_tags( $message );
307
+ }
308
+
309
+ $user = get_user_by( 'id', $user_id );
310
+
311
+ $subject = $this->handle_global_user_shortcodes( $subject, $user->user_email );
312
+ $message = $this->handle_global_user_shortcodes( $message, $user->user_email );
313
+ wp_mail( $user->user_email, stripslashes( $subject ), $message, $headers );
314
+ }
315
+
316
+ /**
317
+ * Handle User Role shortcodes.
318
+ *
319
+ * @param string $message String that needs shortcode processing.
320
+ * @param array $old_role Old User Role.
321
+ * @param array $new_role New User Role.
322
+ *
323
+ * @return string Processed string.
324
+ */
325
+ public function handle_user_role_shortcodes( $message, $old_role, $new_role ) {
326
+ $roles = wp_roles();
327
+
328
+ $old_role_name = '';
329
+ $new_role_name = '';
330
+
331
+ if ( isset( $roles->role_names[ $old_role ] ) ) {
332
+ $old_role_name = $roles->role_names[ $old_role ];
333
+ }
334
+
335
+ if ( isset( $roles->role_names[ $new_role ] ) ) {
336
+ $new_role_name = $roles->role_names[ $new_role ];
337
+ }
338
+
339
+ $message = str_replace( '[user_role_old]', $old_role_name, $message );
340
+ $message = str_replace( '[user_role_new]', $new_role_name, $message );
341
+
342
+ return $message;
343
+ }
344
+
345
+ /**
346
+ * Handle User Added Role shortcodes.
347
+ *
348
+ * @param string $message String that needs shortcode processing.
349
+ * @param array $old_role Old User Role.
350
+ * @param array $new_role New User Role.
351
+ *
352
+ * @return string Processed string.
353
+ */
354
+ public function handle_user_added_role_shortcodes( $message, $old_roles,
355
+ $new_roles ) {
356
+ $roles = wp_roles();
357
+
358
+ $old_role_name = array();
359
+ $new_role_name = array();
360
+
361
+ foreach ( $old_roles as $key => $old_role ) {
362
+ if ( isset( $roles->role_names[ $old_role ] ) ) {
363
+ $old_role_name[] = $roles->role_names[ $old_role ];
364
+ }
365
+ }
366
+ foreach ( $new_roles as $key => $new_role ) {
367
+ if ( isset( $roles->role_names[ $new_role ] ) ) {
368
+ $new_role_name[] = $roles->role_names[ $new_role ];
369
+ }
370
+ }
371
+
372
+ $message = str_replace( '[user_role_old]', implode( ',', $old_role_name ), $message );
373
+ $message = str_replace( '[user_role_new]', implode( ',', $new_role_name ), $message );
374
+
375
+ return $message;
376
+ }
377
+
378
+ /**
379
+ * Handle shortcodes for filtered data notifications like `password_changed` and `email_changed`.
380
+ *
381
+ * @since 1.6
382
+ *
383
+ * @param array $email_data Email data.
384
+ * @param array $setting Notification settings.
385
+ * @param string|int $extra_data Extra data.
386
+ *
387
+ * @return array Modified email data.
388
+ */
389
+ public function handle_filtered_data_notification( $email_data, $setting,
390
+ $extra_data ) {
391
+ $email_data[ 'message' ] = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $extra_data );
392
+ $email_data[ 'subject' ] = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $extra_data );
393
+
394
+ $email_data[ 'message' ] = $this->handle_global_user_shortcodes( $email_data[ 'message' ], $email_data[ 'to' ] );
395
+ $email_data[ 'subject' ] = $this->handle_global_user_shortcodes( $email_data[ 'subject' ], $email_data[ 'to' ] );
396
+
397
+ if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
398
+ $email_data[ 'message' ] = wpautop( $email_data[ 'message' ] );
399
+ }
400
+
401
+ if ( 'html' == $setting[ 'email-formatting' ] ) {
402
+ $headers[] = 'Content-type: text/html';
403
+ } else {
404
+ $headers[] = 'Content-type: text/plain';
405
+ if ( 'text' == $setting[ 'email-formatting' ] ) {
406
+ $message = strip_tags( $message );
407
+ }
408
+ }
409
+
410
+ $email_data[ 'headers' ] = $headers;
411
+
412
+ return $email_data;
413
+ }
414
+
415
+ /**
416
+ * Handle shortcodes for core updated notification.
417
+ *
418
+ * @since 1.6
419
+ *
420
+ * @param array $email_data Email data.
421
+ * @param array $setting Notification settings.
422
+ * @param string $type Result of update.
423
+ *
424
+ * @return array Modified email data.
425
+ */
426
+ public function handle_core_updated_notification( $email_data, $setting,
427
+ $type ) {
428
+ $email_data[ 'body' ] = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $type );
429
+ $email_data[ 'subject' ] = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $type );
430
+
431
+ $emails = $this->get_emails( $setting, $type );
432
+ $headers = $this->get_headers( $emails );
433
+
434
+ $email_data[ 'body' ] = $this->handle_global_user_shortcodes( $email_data[ 'body' ], $emails[ 'to' ][ 0 ] );
435
+ $email_data[ 'subject' ] = $this->handle_global_user_shortcodes( $email_data[ 'subject' ], $emails[ 'to' ][ 0 ] );
436
+
437
+ if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
438
+ $email_data[ 'body' ] = wpautop( $email_data[ 'body' ] );
439
+ }
440
+
441
+ if ( 'html' == $setting[ 'email-formatting' ] ) {
442
+ $headers[] = 'Content-type: text/html';
443
+ } else {
444
+ $headers[] = 'Content-type: text/plain';
445
+ if ( 'text' == $setting[ 'email-formatting' ] ) {
446
+ $message = strip_tags( $message );
447
+ }
448
+ }
449
+
450
+ $email_data[ 'headers' ] = $headers;
451
+
452
+ return $email_data;
453
+ }
454
+
455
+ /**
456
+ * Handle shortcode for password reset email message.
457
+ *
458
+ * @since 1.1
459
+ *
460
+ * @param $setting
461
+ * @param $key
462
+ * @param $user_login
463
+ * @param $user_data
464
+ *
465
+ * @return mixed|string
466
+ */
467
+ public function handle_password_reset_shortcodes( $setting, $key,
468
+ $user_login, $user_data ) {
469
+ $message = '';
470
+
471
+ if ( '' != $user_login ) {
472
+ // For WordPress version 4.1.0 or less, we could have empty user_login
473
+ $message = $this->handle_shortcodes( $setting[ 'message' ], 'user-password', $user_data->ID );
474
+ $message = $this->handle_global_user_shortcodes( $message, $user_data->user_email );
475
+
476
+ $reset_link = network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user_login ), 'login' );
477
+ $message = str_replace( '[password_reset_link]', $reset_link, $message );
478
+ }
479
+
480
+ return $message;
481
+ }
482
+
483
+ /**
484
+ * Send Password Changed email.
485
+ *
486
+ * @param array $setting Notification Setting.
487
+ * @param WP_User $user User for whom the password has changed.
488
+ */
489
+ public function send_password_changed_email( $setting, $user ) {
490
+ $user_id = $user->ID;
491
+
492
+ $subject = $this->handle_shortcodes( $setting[ 'subject' ], $setting[ 'notification' ], $user_id );
493
+ $message = $this->handle_shortcodes( $setting[ 'message' ], $setting[ 'notification' ], $user_id );
494
+
495
+ if ( 'true' != $setting[ 'disable-autop' ] && 'html' == $setting[ 'email-formatting' ] ) {
496
+ $message = wpautop( $message );
497
+ }
498
+
499
+ $headers = array();
500
+ if ( 'html' == $setting[ 'email-formatting' ] ) {
501
+ $headers[] = 'Content-type: text/html';
502
+ } elseif ( 'text' == $setting[ 'email-formatting' ] ) {
503
+ $message = strip_tags( $message );
504
+ }
505
+
506
+ $subject = $this->handle_global_user_shortcodes( $subject, $user->user_email );
507
+ $message = $this->handle_global_user_shortcodes( $message, $user->user_email );
508
+ wp_mail( $user->user_email, stripslashes( $subject ), $message, $headers );
509
+ }
510
+
511
+ /**
512
+ * Generate message for notification.
513
+ *
514
+ * @since 1.0
515
+ * public since @since 1.6
516
+ *
517
+ * @param string $message String may have shortcode.
518
+ * @param string $notification Notification name.
519
+ * @param string|int $extra_data Additional data for shortcode.
520
+ *
521
+ * @return string Processed string.
522
+ */
523
+ public function handle_shortcodes( $message, $notification, $extra_data ) {
524
+
525
+ switch ( $notification ) {
526
+ case 'new-comment':
527
+ case 'new-trackback':
528
+ case 'new-pingback':
529
+ case 'reply-comment':
530
+ // handle new comments, trackbacks and pingbacks
531
+ $message = $this->comment_shortcodes( $message, $extra_data );
532
+ $comment = get_comment( $extra_data );
533
+ $message = $this->post_shortcodes( $message, $comment->comment_post_ID );
534
+ if ( 0 != $comment->user_id ) {
535
+ $message = $this->user_shortcodes( $message, $comment->user_id );
536
+ }
537
+ break;
538
+
539
+ case 'admin-password':
540
+ case 'admin-password-changed':
541
+ case 'admin-email-changed':
542
+ case 'admin-user':
543
+ case 'welcome-email':
544
+ case 'user-login':
545
+ $message = $this->user_shortcodes( $message, $extra_data );
546
+ break;
547
+ case 'admin-user-login':
548
+ $message = $this->user_shortcodes( $message, $extra_data );
549
+ break;
550
+ case 'new-user':
551
+ case 'user-role':
552
+ case 'admin-role':
553
+ case 'password-changed':
554
+ // handle users (lost password and new user registration)
555
+ $message = $this->user_shortcodes( $message, $extra_data );
556
+ break;
557
+
558
+ case 'email-changed':
559
+ case 'user-password':
560
+ // handle users (lost password and new user registration)
561
+ $message = $this->user_shortcodes( $message, $extra_data, 'email_' );
562
+ break;
563
+
564
+ case 'new-category':
565
+ // handle new category
566
+ $message = $this->taxonomy_shortcodes( $message, 'category', $extra_data );
567
+ break;
568
+
569
+ case 'new-post_tag':
570
+ // handle new tag
571
+ $message = $this->taxonomy_shortcodes( $message, 'post_tag', $extra_data );
572
+ break;
573
+
574
+ case 'core-updated':
575
+ // handle core updated type
576
+ $message = $this->core_updated_shortcodes( $message, $extra_data );
577
+ break;
578
+
579
+ case 'data-export':
580
+ // handle data export email
581
+ $message = $this->data_export_shortcodes( $message, $extra_data );
582
+ break;
583
+
584
+ case 'data-erased':
585
+ // handle data export email
586
+ $message = $this->data_erased_shortcodes( $message, $extra_data );
587
+ break;
588
+
589
+ case 'new-media':
590
+ case 'update-media':
591
+ $message = $this->post_shortcodes( $message, $extra_data );
592
+ $post = get_post( $extra_data );
593
+ if ( $post instanceof WP_Post ) {
594
+ $message = $this->user_shortcodes( $message, $post->post_author );
595
+ }
596
+ break;
597
+
598
+ default:
599
+ $type = explode( '-', $notification, 2 );
600
+ if ( 'newterm' == $type[ 0 ] ) {
601
+ // handle new terms
602
+ $message = $this->taxonomy_shortcodes( $message, $type[ 1 ], $extra_data );
603
+ } elseif ( 'new' == $type[ 0 ] || 'update' == $type[ 0 ] || 'pending' == $type[ 0 ] || 'future' == $type[ 0 ] || 'private' == $type[ 0 ] || 'trash' == $type[ 0 ] ) {
604
+ // handle new, update and pending posts
605
+ $post_types = get_post_types( array( 'public' => true ), 'names' );
606
+ $post_types = array_diff( $post_types, array( BNFW_Notification::POST_TYPE ) );
607
+
608
+ if ( in_array( $type[ 1 ], $post_types ) ) {
609
+ $message = $this->post_shortcodes( $message, $extra_data );
610
+ $post = get_post( $extra_data );
611
+ if ( $post instanceof WP_Post ) {
612
+ $message = $this->user_shortcodes( $message, $post->post_author );
613
+ }
614
+ }
615
+ } elseif ( 'comment' == $type[ 0 ] || 'moderate' == $type[ 0 ] || 'commentreply' == $type[ 0 ] ) {
616
+ $message = $this->comment_shortcodes( $message, $extra_data );
617
+ $comment = get_comment( $extra_data );
618
+ $message = $this->post_shortcodes( $message, $comment->comment_post_ID );
619
+ if ( 0 != $comment->user_id ) {
620
+ $message = $this->user_shortcodes( $message, $comment->user_id );
621
+ }
622
+ } elseif ( 'approve' === $type[ 0 ] ) {
623
+ // handle Approve comments notification
624
+ $message = $this->comment_shortcodes( $message, $extra_data );
625
+ $comment = get_comment( $extra_data );
626
+ $message = $this->post_shortcodes( $message, $comment->comment_post_ID );
627
+ if ( 0 != $comment->user_id ) {
628
+ $message = $this->user_shortcodes( $message, $comment->user_id );
629
+ }
630
+ break;
631
+ } elseif ( 'ca' === $type[ 0 ] ) {
632
+ $message = $this->confirm_action_shortcodes( $message, $extra_data );
633
+ $message = $this->handle_global_user_shortcodes( $message, $extra_data[ 'email' ] );
634
+ } elseif ( 'uc' === $type[ 0 ] ) {
635
+ $message = $this->confirmed_action_shortcodes( $message, $extra_data );
636
+ $message = $this->handle_global_user_shortcodes( $message, $extra_data[ 'admin_email' ] );
637
+ }
638
+ break;
639
+ }
640
+
641
+ $message = $this->global_shortcodes( $message );
642
+
643
+ $message = apply_filters( 'bnfw_shortcodes', $message, $notification, $extra_data, $this );
644
+ return $message;
645
+ }
646
+
647
+ /**
648
+ * Handle Global shortcodes.
649
+ *
650
+ * @since 1.5
651
+ *
652
+ * @param string $message String with shortcodes.
653
+ *
654
+ * @return string String after processing global shortcodes.
655
+ */
656
+ private function global_shortcodes( $message ) {
657
+ $message = str_replace( '[global_site_title]', get_bloginfo( 'name' ), $message );
658
+ $message = str_replace( '[global_site_tagline]', get_bloginfo( 'description' ), $message );
659
+ $message = str_replace( '[global_site_url]', get_bloginfo( 'url' ), $message );
660
+
661
+ $message = str_replace( '[current_time]', current_time( get_option( 'time_format' ) ), $message );
662
+ $message = str_replace( '[current_date]', date_i18n( get_option( 'date_format' ), current_time( 'timestamp' ) ), $message );
663
+ $message = str_replace( '[admin_email]', get_option( 'admin_email' ), $message );
664
+
665
+ return $message;
666
+ }
667
+
668
+ /**
669
+ * Handle Global shortcodes.
670
+ *
671
+ * @param string $message Message.
672
+ * @param string $email Email.
673
+ *
674
+ * @return string
675
+ */
676
+ public function handle_global_shortcodes( $message, $email ) {
677
+ $message = $this->global_shortcodes( $message );
678
+
679
+ return $this->handle_global_user_shortcodes( $message, $email );
680
+ }
681
+
682
+ /**
683
+ * Handle Global User Shortcodes.
684
+ *
685
+ * @param string $message String to be processed.
686
+ * @param string $email Email of the user.
687
+ *
688
+ * @return string Processed string.
689
+ */
690
+ public function handle_global_user_shortcodes( $message, $email ) {
691
+ $user = get_user_by( 'email', $email );
692
+
693
+ if ( false === $user ) {
694
+ $message = str_replace( '[global_user_firstname]', $email, $message );
695
+ $message = str_replace( '[global_user_lastname]', $email, $message );
696
+ $message = str_replace( '[global_user_username]', $email, $message );
697
+ } else {
698
+ $message = str_replace( '[global_user_firstname]', $user->first_name, $message );
699
+ $message = str_replace( '[global_user_lastname]', $user->last_name, $message );
700
+ $message = str_replace( '[global_user_username]', $user->user_login, $message );
701
+
702
+ $message = $this->user_shortcodes( $message, $user->ID, 'email_' );
703
+ }
704
+
705
+ $message = str_replace( '[privacy_policy_url]', get_privacy_policy_url(), $message );
706
+
707
+ $message = str_replace( array('[global_user_email]','[user_email]'), $email, $message );
708
+
709
+ return $message;
710
+ }
711
+
712
+ /**
713
+ * Handle media post shortcodes.
714
+ *
715
+ * @since 1.0
716
+ * @param string $message
717
+ * @param int $post_id
718
+ * @return string
719
+ */
720
+ public function media_post_shortcodes( $message, $post ) {
721
+ $post_content = $this->may_be_strip_shortcode( $post->post_content );
722
+ $post_content = apply_filters( 'the_content', $post_content );
723
+ $post_content = str_replace( ']]>', ']]&gt;', $post_content );
724
+ $message = str_replace( '[ID]', $post->ID, $message );
725
+ $message = str_replace( '[media_date]', bnfw_format_date( $post->post_date ), $message );
726
+ $message = str_replace( '[media_date_gmt]', bnfw_format_date( $post->post_date_gmt ), $message );
727
+ $message = str_replace( '[media_description]', $post_content, $message );
728
+ $message = str_replace( '[media_title]', $post->post_title, $message );
729
+ $message = str_replace( '[media_alt_text]', get_post_meta( $post->ID, '_wp_attachment_image_alt', true ), $message );
730
+ $message = str_replace( '[media_caption]', $this->may_be_strip_shortcode( get_the_excerpt( $post ) ), $message );
731
+ $message = str_replace( '[media_status]', $post->post_status, $message );
732
+ $message = str_replace( '[media_modified]', bnfw_format_date( $post->post_modified ), $message );
733
+ $message = str_replace( '[media_modified_gmt]', bnfw_format_date( $post->post_modified_gmt ), $message );
734
+ $message = str_replace( '[media_content_filtered]', $post->post_content_filtered, $message );
735
+ $message = str_replace( '[media_type]', $post->post_type, $message );
736
+ $message = str_replace( '[media_mime_type]', $post->post_mime_type, $message );
737
+ $message = str_replace( '[media_slug]', $post->post_name, $message );
738
+ $dimensions = get_post_meta( $post->ID, '_wp_attachment_metadata', true );
739
+ $media_dimensions = $dimensions[ 'width' ] . ' x ' . $dimensions[ 'height' ];
740
+ $message = str_replace( '[media_dimensions]', $media_dimensions, $message );
741
+ $user_info = get_userdata( $post->post_author );
742
+ $message = str_replace( '[media_author]', $user_info->display_name, $message );
743
+
744
+ return $message;
745
+ }
746
+
747
+ /**
748
+ * Handle post shortcodes.
749
+ *
750
+ * @since 1.0
751
+ * @param string $message
752
+ * @param int $post_id
753
+ * @return string
754
+ */
755
+ public function post_shortcodes( $message, $post_id ) {
756
+ $post = get_post( $post_id );
757
+
758
+ if ( ! $post instanceof WP_Post ) {
759
+ return $message;
760
+ }
761
+
762
+ if ( $post->post_type == 'attachment' ) {
763
+ $message = $this->media_post_shortcodes( $message, $post );
764
+ }
765
+
766
+ $post_content = $this->may_be_strip_shortcode( $post->post_content );
767
+ $post_content = apply_filters( 'the_content', $post_content );
768
+ $post_content = str_replace( ']]>', ']]&gt;', $post_content );
769
+
770
+ $message = str_replace( '[ID]', $post->ID, $message );
771
+ $message = str_replace( '[post_date]', bnfw_format_date( $post->post_date ), $message );
772
+ $message = str_replace( '[post_date_gmt]', bnfw_format_date( $post->post_date_gmt ), $message );
773
+ $message = str_replace( '[post_content]', $post_content, $message );
774
+ $message = str_replace( '[post_title]', $post->post_title, $message );
775
+ $message = str_replace( '[post_excerpt]', $this->may_be_strip_shortcode( get_the_excerpt( $post ) ), $message );
776
+ $message = str_replace( '[post_status]', $post->post_status, $message );
777
+ $message = str_replace( '[comment_status]', $post->comment_status, $message );
778
+ $message = str_replace( '[ping_status]', $post->ping_status, $message );
779
+ $message = str_replace( '[post_password]', $post->post_password, $message );
780
+ $message = str_replace( '[post_name]', $post->post_name, $message );
781
+ $message = str_replace( '[post_slug]', $post->post_name, $message );
782
+ $message = str_replace( '[to_ping]', $post->to_ping, $message );
783
+ $message = str_replace( '[pinged]', $post->pinged, $message );
784
+ $message = str_replace( '[post_modified]', bnfw_format_date( $post->post_modified ), $message );
785
+ $message = str_replace( '[post_modified_gmt]', bnfw_format_date( $post->post_modified_gmt ), $message );
786
+ $message = str_replace( '[post_content_filtered]', $post->post_content_filtered, $message );
787
+ $message = str_replace( '[post_parent]', $post->post_parent, $message );
788
+ $message = str_replace( '[post_parent_permalink]', get_permalink( $post->post_parent ), $message );
789
+ $message = str_replace( '[guid]', $post->guid, $message );
790
+ $message = str_replace( '[menu_order]', $post->menu_order, $message );
791
+ $message = str_replace( '[post_type]', $post->post_type, $message );
792
+ $message = str_replace( '[post_mime_type]', $post->post_mime_type, $message );
793
+ $message = str_replace( '[comment_count]', $post->comment_count, $message );
794
+ $message = str_replace( '[permalink]', get_permalink( $post->ID ), $message );
795
+ $message = str_replace( '[post_type_archive]', get_post_type_archive_link( $post->post_type ), $message );
796
+
797
+ $message = str_replace( '[edit_post]', $this->get_edit_post_link( $post->ID, 'return' ), $message );
798
+
799
+ $featured_image = '';
800
+ if ( has_post_thumbnail( $post->ID ) ) {
801
+ $image_url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
802
+ if ( is_array( $image_url ) ) {
803
+ $featured_image = $image_url[ 0 ];
804
+ }
805
+ }
806
+ $message = str_replace( '[featured_image]', $featured_image, $message );
807
+
808
+ $message = str_replace( '[first_image]', $this->get_first_image( $post->post_content ), $message );
809
+
810
+ if ( 'future' == $post->post_status ) {
811
+ $message = str_replace( '[post_scheduled_date]', bnfw_format_date( $post->post_date ), $message );
812
+ $message = str_replace( '[post_scheduled_date_gmt]', bnfw_format_date( $post->post_date_gmt ), $message );
813
+ } else {
814
+ $message = str_replace( '[post_scheduled_date]', 'Published', $message );
815
+ $message = str_replace( '[post_scheduled_date_gmt]', 'Published', $message );
816
+ }
817
+
818
+ $categories = wp_get_post_categories( $post_id, array( 'fields' => 'all' ) );
819
+
820
+ $message = str_replace( '[post_category]', implode( ', ', wp_list_pluck( $categories, 'name' ) ), $message );
821
+
822
+ if ( count( $categories ) > 0 ) {
823
+ $message = str_replace(
824
+ array(
825
+ '[post_category_slug]',
826
+ '[post_category_description]',
827
+ ),
828
+ array(
829
+ $categories[ 0 ]->slug,
830
+ $categories[ 0 ]->description,
831
+ ),
832
+ $message
833
+ );
834
+ }
835
+
836
+ $tag_list = implode( ', ', wp_get_post_tags( $post_id, array( 'fields' => 'names' ) ) );
837
+ $message = str_replace( '[post_tag]', $tag_list, $message );
838
+
839
+ $user_info = get_userdata( $post->post_author );
840
+ $message = str_replace( '[post_author]', $user_info->display_name, $message );
841
+
842
+ $message = str_replace( '[author_link]', get_author_posts_url( $post->post_author ), $message );
843
+
844
+ if ( $last_id = get_post_meta( $post->ID, '_edit_lock', true ) ) {
845
+
846
+ $last_id = explode(':',$last_id);
847
+ if(count($last_id) > 1){
848
+ $last_id = end($last_id);
849
+ }
850
+
851
+ if ( $post->post_author != $last_id ) {
852
+ $last_user_info = get_userdata( $last_id );
853
+ } else {
854
+ $last_user_info = $user_info;
855
+ }
856
+
857
+ $message = str_replace( '[post_update_author]', $last_user_info->display_name, $message );
858
+ }
859
+
860
+ $message = str_replace( '[post_term', '[post_term id="' . $post_id . '"', $message );
861
+ add_shortcode( 'post_term', array( $this, 'post_term_shortcode_handler' ) );
862
+ $message = do_shortcode( $message );
863
+ remove_shortcode( 'post_term', array( $this, 'post_term_shortcode_handler' ) );
864
+
865
+ return apply_filters( 'bnfw_shortcodes_post', $message, $post_id );
866
+ }
867
+
868
+ /**
869
+ * Retrieves the edit post link for post.
870
+ *
871
+ * This is a copy of the built-in function without the user check.
872
+ *
873
+ * Can be used within the WordPress loop or outside of it. Can be used with
874
+ * pages, posts, attachments, and revisions.
875
+ *
876
+ * @param int|WP_Post $id Optional. Post ID or post object. Default is the global `$post`.
877
+ * @param string $context Optional. How to output the '&' character. Default '&amp;'.
878
+ * @return string|null The edit post link for the given post. null if the post type is invalid or does
879
+ * not allow an editing UI.
880
+ */
881
+ public function get_edit_post_link( $id = 0, $context = 'display' ) {
882
+ if ( ! $post = get_post( $id ) )
883
+ return;
884
+
885
+ if ( 'revision' === $post->post_type )
886
+ $action = '';
887
+ elseif ( 'display' == $context )
888
+ $action = '&amp;action=edit';
889
+ else
890
+ $action = '&action=edit';
891
+
892
+ $post_type_object = get_post_type_object( $post->post_type );
893
+ if ( ! $post_type_object )
894
+ return;
895
+
896
+ if ( $post_type_object->_edit_link ) {
897
+ $link = admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) );
898
+ } else {
899
+ $link = '';
900
+ }
901
+
902
+ /**
903
+ * Filters the post edit link.
904
+ *
905
+ * @since 2.3.0
906
+ *
907
+ * @param string $link The edit link.
908
+ * @param int $post_id Post ID.
909
+ * @param string $context The link context. If set to 'display' then ampersands
910
+ * are encoded.
911
+ */
912
+ return apply_filters( 'get_edit_post_link', $link, $post->ID, $context );
913
+ }
914
+
915
+ /**
916
+ * Handle post term shortcode.
917
+ *
918
+ * @param array $atts Shortocde attributes.
919
+ *
920
+ * @return string Processed string.
921
+ */
922
+ public function post_term_shortcode_handler( $atts ) {
923
+ $atts = shortcode_atts( array(
924
+ 'taxonomy' => '',
925
+ 'id' => 0,
926
+ ), $atts );
927
+
928
+ $terms = wp_get_post_terms( $atts[ 'id' ], $atts[ 'taxonomy' ], array( 'fields' => 'names' ) );
929
+
930
+ if ( ! is_wp_error( $terms ) ) {
931
+ return implode( ', ', $terms );
932
+ }
933
+
934
+ return '';
935
+ }
936
+
937
+ /**
938
+ * Strip shortcodes, unless disabled.
939
+ *
940
+ * @param string $content Content who's shortcodes should be stripped.
941
+ *
942
+ * @return string Processed content.
943
+ */
944
+ private function may_be_strip_shortcode( $content ) {
945
+ $enable_shortcode = get_option( 'bnfw_enable_shortcodes' );
946
+
947
+ if ( '1' == $enable_shortcode ) {
948
+ return $content;
949
+ }
950
+
951
+ return strip_shortcodes( $content );
952
+ }
953
+
954
+ /**
955
+ * Handle comment shortcodes.
956
+ *
957
+ * @since 1.0
958
+ *
959
+ * @param string $message String to be processed.
960
+ * @param int $comment_id Comment id.
961
+ *
962
+ * @return string Processed string.
963
+ */
964
+ private function comment_shortcodes( $message, $comment_id ) {
965
+ $comment = get_comment( $comment_id );
966
+
967
+ $message = str_replace( '[comment_ID]', $comment->comment_ID, $message );
968
+ $message = str_replace( '[comment_post_ID]', $comment->comment_post_ID, $message );
969
+ $message = str_replace( '[comment_author]', $comment->comment_author, $message );
970
+ $message = str_replace( '[comment_author_email]', $comment->comment_author_email, $message );
971
+ $message = str_replace( '[comment_author_url]', $comment->comment_author_url, $message );
972
+ $message = str_replace( '[comment_author_IP]', $comment->comment_author_IP, $message );
973
+ $message = str_replace( '[comment_date]', bnfw_format_date( $comment->comment_date ), $message );
974
+ $message = str_replace( '[comment_date_gmt]', bnfw_format_date( $comment->comment_date_gmt ), $message );
975
+ $message = str_replace( '[comment_content]', get_comment_text( $comment->comment_ID ), $message );
976
+ $message = str_replace( '[comment_karma]', $comment->comment_karma, $message );
977
+ $message = str_replace( '[comment_approved]', str_replace( array( '0', '1', 'spam' ), array( 'Awaiting Moderation', 'Approved', 'Spam' ), $comment->comment_approved ), $message );
978
+ $message = str_replace( '[comment_agent]', $comment->comment_agent, $message );
979
+ $message = str_replace( '[comment_type]', $comment->comment_type, $message );
980
+ $message = str_replace( '[comment_parent]', $comment->comment_parent, $message );
981
+ $message = str_replace( '[user_id]', $comment->user_id, $message );
982
+ $message = str_replace( '[permalink]', get_comment_link( $comment->comment_ID ), $message );
983
+ $message = str_replace( '[comment_moderation_link]', admin_url( 'comment.php?action=editcomment&c=' ) . $comment->comment_ID, $message );
984
+ $message = str_replace( '[comment_moderation_approve]', '<a href="' . wp_nonce_url( admin_url( "comment.php?action=approve&c={$comment->comment_ID}#wpbody-content" ) ) . '">Approve</a>', $message );
985
+ $message = str_replace( '[comment_moderation_spam]', '<a href="' . wp_nonce_url( admin_url( "comment.php?action=spam&c={$comment->comment_ID}#wpbody-content" ) ) . '">Spam</a>', $message );
986
+ $message = str_replace( '[comment_moderation_delete]', '<a href="' . wp_nonce_url( admin_url( "comment.php?action=trash&c={$comment->comment_ID}#wpbody-content" ) ) . '">Delete</a>', $message );
987
+
988
+ $parent_comment = get_comment( $comment->comment_parent );
989
+ if ( $parent_comment instanceof WP_Comment ) {
990
+ $message = str_replace( '[comment_parent_content]', $parent_comment->comment_content, $message );
991
+ }
992
+
993
+ return $message;
994
+ }
995
+
996
+ /**
997
+ * Handle user shortcodes.
998
+ *
999
+ * @since 1.0
1000
+ *
1001
+ * @param string $message String to be processed.
1002
+ * @param int $user_id User id.
1003
+ *
1004
+ * @return string Processed string.
1005
+ */
1006
+ public function user_shortcodes( $message, $user_id, $prefix = '' ) {
1007
+ global $wp_roles;
1008
+
1009
+ $user_info = get_userdata( $user_id );
1010
+
1011
+ if ( ! $user_info instanceof WP_User ) {
1012
+ return $message;
1013
+ }
1014
+
1015
+ // deprecated
1016
+ $message = str_replace( '[ID]', $user_info->ID, $message );
1017
+ $message = str_replace( '[display_name]', $user_info->display_name, $message );
1018
+ $message = str_replace( '[nickname]', $user_info->nickname, $message );
1019
+ $message = str_replace( '[commenter_avatar]', get_avatar_url( $user_id ), $message );
1020
+
1021
+ $message = str_replace( '[' . $prefix . 'user_id]', $user_info->ID, $message );
1022
+ $message = str_replace( '[' . $prefix . 'user_login]', $user_info->user_login, $message );
1023
+ $message = str_replace( '[' . $prefix . 'user_nicename]', $user_info->user_nicename, $message );
1024
+ $message = str_replace( '[' . $prefix . 'user_email]', $user_info->user_email, $message );
1025
+ $message = str_replace( '[' . $prefix . 'user_url]', $user_info->user_url, $message );
1026
+ $message = str_replace( '[' . $prefix . 'user_registered]', $user_info->user_registered, $message );
1027
+ $message = str_replace( '[' . $prefix . 'user_display_name]', $user_info->display_name, $message );
1028
+ $message = str_replace( '[' . $prefix . 'user_firstname]', $user_info->user_firstname, $message );
1029
+ $message = str_replace( '[' . $prefix . 'user_lastname]', $user_info->user_lastname, $message );
1030
+ $message = str_replace( '[' . $prefix . 'user_nickname]', $user_info->nickname, $message );
1031
+ $message = str_replace( '[' . $prefix . 'user_description]', $user_info->user_description, $message );
1032
+ $message = str_replace( '[' . $prefix . 'user_avatar]', get_avatar_url( $user_id ), $message );
1033
+
1034
+ $roles = array_map( array( $this, 'get_role_label_by_name' ), $user_info->roles );
1035
+ $message = str_replace( '[' . $prefix . 'user_role]', implode( ', ', $roles ), $message );
1036
+
1037
+ $user_capabilities = bnfw_format_user_capabilities( $user_info->wp_capabilities );
1038
+ if ( ! empty( $user_capabilities ) ) {
1039
+ $message = str_replace( '[wp_capabilities]', $user_capabilities, $message );
1040
+ $message = str_replace( '[' . $prefix . 'user_wp_capabilities]', $user_capabilities, $message );
1041
+ }
1042
+
1043
+ $message = apply_filters( 'bnfw_shortcodes_user', $message, $user_id, $prefix );
1044
+ return $message;
1045
+ }
1046
+
1047
+ /**
1048
+ * Handle taxonomy shortcodes.
1049
+ *
1050
+ * @access private
1051
+ * @since 1.1
1052
+ *
1053
+ * @param string $message
1054
+ * @param string $taxonomy
1055
+ * @param int $term_id
1056
+ * @return string
1057
+ */
1058
+ private function taxonomy_shortcodes( $message, $taxonomy, $term_id ) {
1059
+ $term_info = get_term( $term_id, $taxonomy );
1060
+
1061
+ $message = str_replace( '[slug]', $term_info->slug, $message );
1062
+ $message = str_replace( '[name]', $term_info->name, $message );
1063
+ $message = str_replace( '[description]', $term_info->description, $message );
1064
+
1065
+ return $message;
1066
+ }
1067
+
1068
+ /**
1069
+ * Handle Core Updated Shortcodes.
1070
+ *
1071
+ * @since 1.6
1072
+ *
1073
+ * @param string $message Original message with shortcodes.
1074
+ * @param string $type The type of email being sent. Can be one of
1075
+ * 'success', 'fail', 'manual', 'critical'.
1076
+ *
1077
+ * @return string Modified content.
1078
+ */
1079
+ private function core_updated_shortcodes( $message, $type ) {
1080
+ $message = str_replace( '[core_update_status]', $type, $message );
1081
+
1082
+ return $message;
1083
+ }
1084
+
1085
+ /**
1086
+ * Get the list of emails from the notification settings.
1087
+ *
1088
+ * @since 1.0
1089
+ *
1090
+ * @param array $setting Notification settings
1091
+ * @param int $id
1092
+ * @param bool $process_post_authors
1093
+ * @param bool $process_exclude_current_user
1094
+ *
1095
+ * @return array Emails
1096
+ */
1097
+ public function get_emails( $setting, $id, $process_post_authors = true,
1098
+ $process_exclude_current_user = true ) {
1099
+ global $current_user;
1100
+
1101
+ $emails = array();
1102
+
1103
+ $exclude = null;
1104
+ if ( $process_exclude_current_user && 'true' == $setting[ 'disable-current-user' ] ) {
1105
+ if ( isset( $current_user->ID ) ) {
1106
+ $exclude = $current_user->ID;
1107
+ }
1108
+ }
1109
+
1110
+ $emails[ 'to' ] = array();
1111
+
1112
+ if ( ! empty( $setting[ 'users' ] ) ) {
1113
+ $emails[ 'to' ] = $this->get_emails_from_users( $setting[ 'users' ], $exclude, $id, $setting );
1114
+ }
1115
+
1116
+ /**
1117
+ * BNFW get to emails.
1118
+ */
1119
+ if ( $process_post_authors && 'true' === $setting[ 'only-post-author' ] ) {
1120
+ $post_id = $id;
1121
+
1122
+ if ( bnfw_is_comment_notification( $setting[ 'notification' ] ) ) {
1123
+ $comment = get_comment( $id );
1124
+ $post_id = $comment->comment_post_ID;
1125
+ }
1126
+
1127
+ $type = explode( '-', $setting[ 'notification' ], 2 );
1128
+ if ( 'approve' == $type[ 0 ] ) {
1129
+ if ( ! in_array( $comment->comment_author_email, $emails[ 'to' ] ) ) {
1130
+ $emails[ 'to' ][] = $comment->comment_author_email;
1131
+ }
1132
+ } else {
1133
+ if ( $setting[ 'notification' ] == 'user-customfield' || $setting[ 'notification' ] == 'user-customfieldvalue' ) {
1134
+ $post_author = $post_id;
1135
+ } else {
1136
+ $post_author = get_post_field( 'post_author', $post_id );
1137
+ }
1138
+ $author = get_user_by( 'id', $post_author );
1139
+ if ( false !== $author && $post_author != $exclude ) {
1140
+ if ( ! in_array( $author->user_email, $emails[ 'to' ] ) ) {
1141
+ $emails[ 'to' ][] = $author->user_email;
1142
+ }
1143
+ }
1144
+ }
1145
+ }
1146
+
1147
+ if ( 'true' == $setting[ 'show-fields' ] ) {
1148
+ $default_from_field = get_option( 'blogname' ) . ' <' . get_option( 'admin_email' ) . '>';
1149
+
1150
+ if ( ! empty( $setting[ 'from-name' ] ) && ! empty( $setting[ 'from-email' ] ) && is_email( $setting[ 'from-email' ] ) ) {
1151
+ $default_from_field = $setting[ 'from-name' ] . ' <' . $setting[ 'from-email' ] . '>';
1152
+ }
1153
+
1154
+ /**
1155
+ * Filter Email From Field.
1156
+ */
1157
+ $emails[ 'from' ] = apply_filters( 'bnfw_from_field', $default_from_field, $setting, $id, $emails[ 'to' ] );
1158
+
1159
+ /**
1160
+ * Filter Reply Name Field.
1161
+ */
1162
+ $emails[ 'reply-name' ] = apply_filters( 'bnfw_reply_name_field', $setting[ 'reply-name' ], $setting, $id, $emails[ 'to' ] );
1163
+
1164
+ /**
1165
+ * Filter Reply Email Field.
1166
+ */
1167
+ $emails[ 'reply-email' ] = apply_filters( 'bnfw_reply_email_field', $setting[ 'reply-email' ], $setting, $id, $emails[ 'to' ] );
1168
+
1169
+ if ( ! empty( $setting[ 'cc' ] ) ) {
1170
+ $emails[ 'cc' ] = $this->get_emails_from_users( $setting[ 'cc' ], $exclude, $id, $setting );
1171
+ }
1172
+
1173
+ if ( ! empty( $setting[ 'bcc' ] ) ) {
1174
+ $emails[ 'bcc' ] = $this->get_emails_from_users( $setting[ 'bcc' ], $exclude, $id, $setting );
1175
+ }
1176
+ }
1177
+
1178
+ $excluded_emails = array();
1179
+
1180
+ if ( ! empty( $setting[ 'exclude-users' ] ) ) {
1181
+ $excluded_emails = $this->get_emails_from_users( $setting[ 'exclude-users' ] );
1182
+ }
1183
+
1184
+ if ( ! empty( $excluded_emails ) ) {
1185
+ $emails[ 'to' ] = array_diff( $emails[ 'to' ], $excluded_emails );
1186
+
1187
+ if ( ! empty( $emails[ 'cc' ] ) ) {
1188
+ $emails[ 'cc' ] = array_diff( $emails[ 'cc' ], $excluded_emails );
1189
+ }
1190
+
1191
+ if ( ! empty( $emails[ 'bcc' ] ) ) {
1192
+ $emails[ 'bcc' ] = array_diff( $emails[ 'bcc' ], $excluded_emails );
1193
+ }
1194
+ }
1195
+ $emails[ 'to' ] = apply_filters( 'bnfw_to_emails', $emails[ 'to' ], $setting, $id );
1196
+
1197
+ return $emails;
1198
+ }
1199
+
1200
+ /**
1201
+ * Get emails from users.
1202
+ *
1203
+ * @since 1.2
1204
+ *
1205
+ * @param array $users Users Array
1206
+ * @param int $exclude User id to exclude
1207
+ * @param int $post_id Post id.
1208
+ * @param array $setting Notification setting.
1209
+ *
1210
+ * @return array
1211
+ */
1212
+ public function get_emails_from_users( $users, $exclude = null,
1213
+ $post_id = 0, $setting = array() ) {
1214
+ $user_ids = array();
1215
+ $user_roles = array();
1216
+ $non_wp_users = array();
1217
+
1218
+ if ( empty( $users ) ) {
1219
+ return array();
1220
+ }
1221
+
1222
+ foreach ( $users as $user ) {
1223
+ if ( $this->starts_with( $user, 'role-' ) ) {
1224
+ $user_roles[] = str_replace( 'role-', '', $user );
1225
+ } elseif ( strpos( $user, '@' ) !== false ) {
1226
+ $non_wp_users[] = $user;
1227
+ continue;
1228
+ } elseif ( absint( $user ) > 0 ) {
1229
+ $user_ids[] = absint( $user );
1230
+ } else {
1231
+ $non_wp_users[] = $user;
1232
+ }
1233
+ }
1234
+
1235
+ if ( null != $exclude ) {
1236
+ $user_ids = array_diff( $user_ids, array( $exclude ) );
1237
+ }
1238
+
1239
+ $emails_from_user_ids = $this->get_emails_from_id( $user_ids );
1240
+ $emails_from_user_roles = $this->get_emails_from_role( $user_roles, $exclude );
1241
+
1242
+ if ( ! empty( $setting ) ) {
1243
+ // for new comment notifications, we need to use post id instead of comment id.
1244
+ if ( bnfw_is_comment_notification( $setting[ 'notification' ] ) && $post_id ) {
1245
+ $comment = get_comment( $post_id );
1246
+ $post_id = $comment->comment_post_ID;
1247
+ }
1248
+ }
1249
+
1250
+ $non_wp_emails = apply_filters( 'bnfw_non_wp_emails', array(), $non_wp_users, $post_id );
1251
+
1252
+ return array_merge( $emails_from_user_roles, $emails_from_user_ids, $non_wp_emails );
1253
+ }
1254
+
1255
+ /**
1256
+ * Get user emails by user ids.
1257
+ *
1258
+ * @since 1.0
1259
+ *
1260
+ * @param array $user_ids.
1261
+ *
1262
+ * @return array Emails.
1263
+ */
1264
+ private function get_emails_from_id( $user_ids ) {
1265
+ $email_list = array();
1266
+ if ( is_array( $user_ids ) && count( $user_ids ) > 0 ) {
1267
+ $user_query = new WP_User_Query( array( 'include' => $user_ids ) );
1268
+ foreach ( $user_query->results as $user ) {
1269
+ $email_list[] = $user->user_email;
1270
+ }
1271
+ }
1272
+ return $email_list;
1273
+ }
1274
+
1275
+ /**
1276
+ * Get emails of users based on role.
1277
+ *
1278
+ * @since 1.0
1279
+ * @param array $roles User Roles
1280
+ * @param int $exclude User id to exclude
1281
+ * @return array Email ids
1282
+ */
1283
+ private function get_emails_from_role( $roles, $exclude = null ) {
1284
+ if ( ! is_array( $roles ) ) {
1285
+ $roles = array( $roles );
1286
+ }
1287
+
1288
+ $email_list = array();
1289
+ foreach ( $roles as $role ) {
1290
+ $role_name = $this->get_role_name_by_label( $role );
1291
+ $users = get_users(
1292
+ array(
1293
+ 'role' => $role_name,
1294
+ 'fields' => array( 'user_email', 'ID' ),
1295
+ )
1296
+ );
1297
+
1298
+ foreach ( $users as $user ) {
1299
+ if ( null != $exclude ) {
1300
+ if ( $user->ID == $exclude ) {
1301
+ continue;
1302
+ }
1303
+ }
1304
+
1305
+ if ( ! in_array( $user->user_email, $email_list ) ) {
1306
+ $email_list[] = $user->user_email;
1307
+ }
1308
+ }
1309
+ }
1310
+
1311
+ return $email_list;
1312
+ }
1313
+
1314
+ /**
1315
+ * Find if a string starts with another string.
1316
+ *
1317
+ * @since 1.2
1318
+ *
1319
+ * @param $haystack
1320
+ * @param $needle
1321
+ *
1322
+ * @return bool
1323
+ */
1324
+ private function starts_with( $haystack, $needle ) {
1325
+ // search backwards starting from haystack length characters from the end
1326
+ return '' === $needle || strrpos( $haystack, $needle, -strlen( $haystack ) ) !== false;
1327
+ }
1328
+
1329
+ /**
1330
+ * Get User role name by label.
1331
+ *
1332
+ * @param mixed $role_label
1333
+ *
1334
+ * @return int|string
1335
+ */
1336
+ protected function get_role_name_by_label( $role_label ) {
1337
+ global $wp_roles;
1338
+ foreach ( $wp_roles->roles as $role_name => $role_info ) {
1339
+ if ( $role_label == $role_info[ 'name' ] || $role_name == $role_label ) {
1340
+ return $role_name;
1341
+ }
1342
+ }
1343
+
1344
+ // There is something wrong
1345
+ return '';
1346
+ }
1347
+
1348
+ /**
1349
+ * Get the lable for a user role from name.
1350
+ *
1351
+ * @param string $role_name Role name
1352
+ *
1353
+ * @return string Role Label.
1354
+ */
1355
+ public function get_role_label_by_name( $role_name ) {
1356
+ global $wp_roles;
1357
+
1358
+ if ( ! isset( $wp_roles->roles[ $role_name ] ) ) {
1359
+ return '';
1360
+ }
1361
+
1362
+ return translate_user_role( $wp_roles->roles[ $role_name ][ 'name' ] );
1363
+ }
1364
+
1365
+ /**
1366
+ * Get first image in post.
1367
+ *
1368
+ * @param mixed $post_content
1369
+ *
1370
+ * @return string
1371
+ */
1372
+ protected function get_first_image( $post_content ) {
1373
+ if ( preg_match_all( '/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post_content, $matches ) ) {
1374
+ return $matches[ 1 ][ 0 ];
1375
+ }
1376
+ }
1377
+
1378
+ /**
1379
+ * Generate email headers based on the emails.
1380
+ *
1381
+ * @since 1.0
1382
+ * @param array $emails
1383
+ * @return array
1384
+ */
1385
+ public function get_headers( $emails ) {
1386
+ $headers = array();
1387
+
1388
+ if ( ! empty( $emails[ 'from' ] ) ) {
1389
+ $headers[] = 'From:' . $emails[ 'from' ];
1390
+ }
1391
+
1392
+ if ( ! empty( $emails[ 'reply-email' ] ) && is_email( $emails[ 'reply-email' ] ) ) {
1393
+ $headers[] = 'Reply-To:' . $emails[ 'reply-name' ] . '<' . $emails[ 'reply-email' ] . '>';
1394
+ }
1395
+
1396
+ if ( ! empty( $emails[ 'cc' ] ) ) {
1397
+ $headers[] = 'Cc:' . implode( ',', $emails[ 'cc' ] );
1398
+ }
1399
+ if ( ! empty( $emails[ 'bcc' ] ) ) {
1400
+ $headers[] = 'Bcc:' . implode( ',', $emails[ 'bcc' ] );
1401
+ }
1402
+
1403
+ /**
1404
+ * Filter out mail headers.
1405
+ *
1406
+ * @param array $headers Headers.
1407
+ * @param array $emails Emails.
1408
+ */
1409
+ return apply_filters( 'bnfw_mail_headers', $headers, $emails );
1410
+ }
1411
+
1412
+ public function handle_user_request_email_shortcodes( $message, $setting,
1413
+ $email_data ) {
1414
+ $message = $this->handle_shortcodes( $message, $setting[ 'notification' ], $email_data );
1415
+
1416
+ return $message;
1417
+ }
1418
+
1419
+ public function handle_user_confirmed_action_email_shortcodes( $message,
1420
+ $setting,
1421
+ $email_data ) {
1422
+ $message = $this->handle_shortcodes( $message, $setting[ 'notification' ], $email_data );
1423
+
1424
+ return $message;
1425
+ }
1426
+
1427
+ public function handle_data_export_email_shortcodes( $message, $setting,
1428
+ $request_id ) {
1429
+ $message = $this->handle_shortcodes( $message, $setting[ 'notification' ], $request_id );
1430
+
1431
+ return $message;
1432
+ }
1433
+
1434
+ protected function confirm_action_shortcodes( $message, $extra_data ) {
1435
+ $message = $this->data_request_shortcodes( $message, $extra_data );
1436
+ $message = str_replace( '[request_confirmation_link]', $extra_data[ 'confirm_url' ], $message );
1437
+ if ( isset( $extra_data[ 'email' ] ) ) {
1438
+ $message = str_replace( '[request_email]', $extra_data[ 'email' ], $message );
1439
+ }
1440
+
1441
+ if ( isset( $extra_data[ 'user_email' ] ) ) {
1442
+ $message = str_replace( '[request_email]', $extra_data[ 'user_email' ], $message );
1443
+ }
1444
+
1445
+ return $message;
1446
+ }
1447
+
1448
+ protected function confirmed_action_shortcodes( $message, $extra_data ) {
1449
+ $message = $this->data_request_shortcodes( $message, $extra_data );
1450
+ $message = str_replace( '[data_privacy_requests_url]', $extra_data[ 'manage_url' ], $message );
1451
+ $message = str_replace( '[request_email]', $extra_data[ 'user_email' ], $message );
1452
+
1453
+ return $message;
1454
+ }
1455
+
1456
+ protected function data_request_shortcodes( $message, $extra_data ) {
1457
+ $message = str_replace( '[data_request_type]', $extra_data[ 'description' ], $message );
1458
+
1459
+ return $message;
1460
+ }
1461
+
1462
+ protected function data_export_shortcodes( $message, $request_id ) {
1463
+ $export_file_url = get_post_meta( $request_id, '_export_file_url', true );
1464
+
1465
+ $export_file_url = 'Download File: '.$this->get_export_downloadable_url($request_id);
1466
+
1467
+ $message = str_replace( '[data_privacy_download_url]', $export_file_url, $message );
1468
+
1469
+ $expiration = apply_filters( 'wp_privacy_export_expiration', 3 * DAY_IN_SECONDS );
1470
+ $expiration_date = date_i18n( get_option( 'date_format' ), time() + $expiration );
1471
+ $message = str_replace( '[data_privacy_download_expiry]', $expiration_date, $message );
1472
+
1473
+ return $message;
1474
+ }
1475
+
1476
+ protected function data_erased_shortcodes( $message, $extra_data ) {
1477
+ $privacy_policy_url = (!isset($extra_data[ 'privacy_policy_url' ]))? get_privacy_policy_url() : $extra_data[ 'privacy_policy_url' ];
1478
+
1479
+ $message = str_replace( '[privacy_policy_url]', $privacy_policy_url, $message );
1480
+ $message = str_replace( '[sitename]', $extra_data[ 'sitename' ], $message );
1481
+
1482
+ return $message;
1483
+ }
1484
+
1485
+ /**
1486
+ * Process shortcodes in email.
1487
+ *
1488
+ * @param $email
1489
+ * @param $post_id
1490
+ * @param $setting
1491
+ *
1492
+ * @return string
1493
+ */
1494
+ public function process_shortcodes_in_email( $email, $post_id, $setting,
1495
+ $to_emails ) {
1496
+ if ( ! empty( $setting ) ) {
1497
+ if ( $this->starts_with( $setting[ 'notification' ], 'comment-' ) || $this->starts_with( $setting[ 'notification' ], 'moderate-' ) ) {
1498
+ // for new comment notifications, we need to use post id instead of comment id.
1499
+ $post_id = bnfw_get_post_id_from_comment( $post_id );
1500
+ }
1501
+ }
1502
+
1503
+ $email = $this->handle_shortcodes( $email, $setting[ 'notification' ], $post_id );
1504
+
1505
+ if ( is_array( $to_emails ) && ! empty( $to_emails ) ) {
1506
+ $to_email = $to_emails[ 0 ];
1507
+
1508
+ $email = $this->handle_global_user_shortcodes( $email, $to_email );
1509
+ }
1510
+
1511
+ $processed_emails = array();
1512
+ if ( is_email( $email ) ) {
1513
+ $processed_emails[] = $email;
1514
+ }
1515
+
1516
+ $emails = apply_filters( 'bnfw_non_wp_emails', $processed_emails, array( $email ), $post_id );
1517
+
1518
+ if ( empty( $emails ) ) {
1519
+ return '';
1520
+ }
1521
+
1522
+ return $emails[ 0 ];
1523
+ }
1524
+
1525
+ /**
1526
+ * Check email content type.
1527
+ *
1528
+ * @param string $setting Setting.
1529
+ * @param string $content Content.
1530
+ *
1531
+ * @return string Content .
1532
+ */
1533
+ public function check_email_content_type( $setting, $content ) {
1534
+
1535
+ if ( 'html' == $setting[ 'email-formatting' ] ) {
1536
+ add_filter( 'wp_mail_content_type', array( $this, 'set_html_content_type' ) );
1537
+ if ( 'true' !== $setting[ 'disable-autop' ] ) {
1538
+ $content = wpautop( $content );
1539
+ }
1540
+ } else {
1541
+ add_filter( 'wp_mail_content_type', array( $this, 'set_text_content_type' ) );
1542
+ $content = strip_tags( $content );
1543
+ }
1544
+
1545
+ return $content;
1546
+ }
1547
+
1548
+ /**
1549
+ * Set the email formatting to HTML.
1550
+ *
1551
+ * @since 1.4
1552
+ */
1553
+ public function set_html_content_type() {
1554
+ return 'text/html';
1555
+ }
1556
+
1557
+ /**
1558
+ * Set the email formatting to text.
1559
+ *
1560
+ * @since 1.4
1561
+ */
1562
+ public function set_text_content_type() {
1563
+ return 'text/plain';
1564
+ }
1565
+
1566
+ /**
1567
+ * Get user's download URL from data export request
1568
+ *
1569
+ * @since 1.8.4
1570
+ * @param int $user_email
1571
+ * @return string $download_url | string error message
1572
+ */
1573
+ public function get_export_downloadable_url($request_id = null){
1574
+ if(!$request_id)
1575
+ return;
1576
+
1577
+ global $wpdb;
1578
+ $table = $wpdb->prefix.'posts';
1579
+ $query = 'SELECT ID FROM '.$table.' WHERE `post_type` = "user_request" AND `ID` = '.$request_id;
1580
+
1581
+ $query = apply_filters('export_downloadable_url_query',$query,$request_id);
1582
+
1583
+ $get_id = $wpdb->get_var($query);
1584
+
1585
+ $file = get_post_meta($get_id,'_export_file_name',true);
1586
+ $upload_url = wp_upload_dir();
1587
+ $dl_url = $upload_url['baseurl'].'/wp-personal-data-exports/'.$file;
1588
+
1589
+ $dl_url = apply_filters('export_downloadable_url_return',$dl_url);
1590
+
1591
+ if($dl_url)
1592
+ return $dl_url;
1593
+ else
1594
+ return __('Error: Download link is not available please contact support');
1595
+
1596
+ }
1597
+
1598
+ }
includes/helpers/ajax-helpers.php CHANGED
@@ -1,64 +1,68 @@
1
- <?php
2
- /**
3
- * BNFW AJAX Helper functions.
4
- *
5
- * @since 1.4
6
- */
7
-
8
- /**
9
- * BNFW Search User AJAX Handler.
10
- *
11
- * @since 1.3.6
12
- */
13
- function bnfw_search_users() {
14
- global $wp_roles;
15
-
16
- $roles_data = array();
17
- $user_count = count_users();
18
- $roles = $wp_roles->get_names();
19
- foreach ( $roles as $role_slug => $role_name ) {
20
- $count = 0;
21
- if ( isset( $user_count['avail_roles'][ $role_slug ] ) ) {
22
- $count = $user_count['avail_roles'][ $role_slug ];
23
- }
24
-
25
- $roles_data[] = array(
26
- 'id' => 'role-' . $role_slug,
27
- 'text' => $role_name . ' (' . $count . ' Users)',
28
- );
29
- }
30
-
31
- $data = array(
32
- array(
33
- 'id' => 1,
34
- 'text' => esc_html__( 'User Roles', 'bnfw' ),
35
- 'children' => $roles_data,
36
- ),
37
- );
38
-
39
- $query = sanitize_text_field( $_GET['query'] );
40
- $users = get_users( array(
41
- 'order_by' => 'email',
42
- 'search' => "$query*",
43
- 'number' => 100,
44
- 'fields' => array( 'ID', 'user_login' ),
45
- ) );
46
-
47
- $user_data = array();
48
- foreach ( $users as $user ) {
49
- $user_data[] = array(
50
- 'id' => $user->ID,
51
- 'text' => $user->user_login,
52
- );
53
- }
54
-
55
- $data[] = array(
56
- 'id' => 2,
57
- 'text' => esc_html__( 'Users', 'bnfw' ),
58
- 'children' => $user_data,
59
- );
60
-
61
- echo json_encode( $data );
62
- wp_die();
63
- }
64
- add_action( 'wp_ajax_bnfw_search_users', 'bnfw_search_users' );
 
 
 
 
1
+ <?php
2
+ /**
3
+ * BNFW AJAX Helper functions.
4
+ *
5
+ * @since 1.4
6
+ */
7
+
8
+ /**
9
+ * BNFW Search User AJAX Handler.
10
+ *
11
+ * @since 1.3.6
12
+ */
13
+ function bnfw_search_users() {
14
+ check_ajax_referer( 'bnfw_users_search_ajax_nonce', 'bnfw_security' );
15
+ if ( ! current_user_can( 'bnfw' ) ) {
16
+ wp_die( -1 );
17
+ }
18
+ global $wp_roles;
19
+
20
+ $roles_data = array();
21
+ $user_count = count_users();
22
+ $roles = $wp_roles->get_names();
23
+ foreach ( $roles as $role_slug => $role_name ) {
24
+ $count = 0;
25
+ if ( isset( $user_count['avail_roles'][ $role_slug ] ) ) {
26
+ $count = $user_count['avail_roles'][ $role_slug ];
27
+ }
28
+
29
+ $roles_data[] = array(
30
+ 'id' => 'role-' . $role_slug,
31
+ 'text' => $role_name . ' (' . $count . ' Users)',
32
+ );
33
+ }
34
+
35
+ $data = array(
36
+ array(
37
+ 'id' => 1,
38
+ 'text' => esc_html__( 'User Roles', 'bnfw' ),
39
+ 'children' => $roles_data,
40
+ ),
41
+ );
42
+
43
+ $query = sanitize_text_field( $_GET['query'] );
44
+ $users = get_users( array(
45
+ 'order_by' => 'email',
46
+ 'search' => "$query*",
47
+ 'number' => 100,
48
+ 'fields' => array( 'ID', 'user_login' ),
49
+ ) );
50
+
51
+ $user_data = array();
52
+ foreach ( $users as $user ) {
53
+ $user_data[] = array(
54
+ 'id' => $user->ID,
55
+ 'text' => $user->user_login,
56
+ );
57
+ }
58
+
59
+ $data[] = array(
60
+ 'id' => 2,
61
+ 'text' => esc_html__( 'Users', 'bnfw' ),
62
+ 'children' => $user_data,
63
+ );
64
+
65
+ echo json_encode( $data );
66
+ wp_die();
67
+ }
68
+ add_action( 'wp_ajax_bnfw_search_users', 'bnfw_search_users' );
includes/helpers/helpers.php CHANGED
@@ -1,205 +1,205 @@
1
- <?php
2
- /**
3
- * General BNFW Helpers.
4
- *
5
- * @since 1.3.6
6
- */
7
-
8
- defined( 'ABSPATH' ) || exit; // Exit if accessed directly
9
-
10
- /**
11
- * Dynamically determine the class name for select2 user dropdown based on user count.
12
- *
13
- * @since 1.3.6
14
- */
15
- function bnfw_get_user_select_class() {
16
- $user_count = count_users();
17
-
18
- if ( $user_count['total_users'] > 200 ) {
19
- return 'user-ajax-select2';
20
- } else {
21
- return 'user-select2';
22
- }
23
- }
24
-
25
- /**
26
- * Render users dropdown.
27
- *
28
- * @since 1.3.6
29
- *
30
- * @param $selected_users
31
- */
32
- function bnfw_render_users_dropdown( $selected_users ) {
33
- global $wp_roles;
34
-
35
- $non_wp_users = $selected_users;
36
- $user_count = count_users();
37
- ?>
38
- <optgroup label="<?php _e( 'User Roles', 'bnfw' ); ?>">
39
- <?php
40
- $roles = $wp_roles->get_names();
41
-
42
- foreach ( $roles as $role_slug => $role_name ) {
43
- $selected = selected( true, in_array( 'role-' . $role_slug, $selected_users ), false );
44
-
45
- if ( ! empty( $selected ) ) {
46
- $non_wp_users = array_diff( $non_wp_users, array( 'role-' . $role_slug ) );
47
- }
48
-
49
- // Compatibility code, which will be eventually removed.
50
- $selected_old = selected( true, in_array( 'role-' . $role_name, $selected_users ), false );
51
- if ( ! empty( $selected_old ) ) {
52
- $selected = $selected_old;
53
- }
54
-
55
- $count = 0;
56
- if ( isset( $user_count['avail_roles'][ $role_slug ] ) ) {
57
- $count = $user_count['avail_roles'][ $role_slug ];
58
- }
59
- echo '<option value="role-', esc_attr( $role_slug ), '" ', $selected, '>', esc_html( $role_name ), ' (', $count, ' ' . __( 'Users', 'bnfw' ) . ')', '</option>';
60
- }
61
- ?>
62
- </optgroup>
63
-
64
- <optgroup label="<?php _e( 'Users', 'bnfw' ); ?>">
65
- <?php
66
- $args = array(
67
- 'order_by' => 'email',
68
- 'fields' => array( 'ID', 'user_login' ),
69
- 'number' => 200,
70
- );
71
-
72
- // if there are more than 200 users then use AJAX to load them dynamically.
73
- // So just get only the selected users.
74
- if ( $user_count['total_users'] > 200 ) {
75
- $selected_user_ids = array();
76
- foreach ( $selected_users as $selected_user ) {
77
- if ( absint( $selected_user ) > 0 ) {
78
- $selected_user_ids[] = $selected_user;
79
- }
80
- }
81
-
82
- if ( $selected_user_ids > 0 ) {
83
- $args['include'] = $selected_user_ids;
84
- }
85
- }
86
-
87
- $users = get_users( $args );
88
-
89
- foreach ( $users as $user ) {
90
- $selected = selected( true, in_array( $user->ID, $selected_users ), false );
91
-
92
- if ( ! empty( $selected ) ) {
93
- $non_wp_users = array_diff( $non_wp_users, array( $user->ID ) );
94
- }
95
-
96
- echo '<option value="', esc_attr( $user->ID ), '" ', $selected, '>', esc_html( $user->user_login ), '</option>';
97
- }
98
-
99
- ?>
100
- </optgroup>
101
-
102
- <?php if ( ! empty( $non_wp_users ) ) { ?>
103
- <optgroup label="<?php _e( 'Non WordPress Users', 'bnfw' ); ?>">
104
- <?php foreach ( $non_wp_users as $non_wp_user ) {
105
- echo '<option value="', esc_attr( $non_wp_user ), '" selected >', esc_html( $non_wp_user ), '</option>';
106
- }
107
- ?>
108
- </optgroup>
109
- <?php }
110
- }
111
-
112
- /**
113
- * Find whether the notification name is a comment notification.
114
- *
115
- * @param string $notification_name Notification Name.
116
- *
117
- * @return bool True if it is a comment notification, False otherwise.
118
- */
119
- function bnfw_is_comment_notification( $notification_name ) {
120
- $is_comment_notification = false;
121
-
122
- switch ( $notification_name ) {
123
- case 'new-comment':
124
- case 'new-trackback':
125
- case 'new-pingback':
126
- case 'reply-comment':
127
- $is_comment_notification = true;
128
- break;
129
-
130
- default:
131
- $type = explode( '-', $notification_name, 2 );
132
- if ( 'comment' == $type[0] || 'moderate' === $type[0] || 'approve' == $type[0] ) {
133
- $is_comment_notification = true;
134
- }
135
- break;
136
- }
137
-
138
- return $is_comment_notification;
139
- }
140
-
141
- /**
142
- * Format user capabilities.
143
- *
144
- * @param array $wp_capabilities User capabilities.
145
- *
146
- * @return string Formatted capabilities.
147
- */
148
- function bnfw_format_user_capabilities( $wp_capabilities ) {
149
- $capabilities = array();
150
-
151
- if ( is_array( $wp_capabilities ) ) {
152
- foreach ( $wp_capabilities as $capability => $enabled ) {
153
- if ( $enabled ) {
154
- $capabilities[] = $capability;
155
- }
156
- }
157
- }
158
-
159
- return implode( ', ', $capabilities );
160
- }
161
-
162
- /**
163
- * Has the user opted-in for tracking?
164
- *
165
- * @return bool True if tracking is allowed, False otherwise.
166
- */
167
- function bnfw_is_tracking_allowed() {
168
- $tracking_allowed = false;
169
-
170
- if ( get_option( 'bnfw_allow_tracking' ) == 'on' ) {
171
- $tracking_allowed = true;
172
- }
173
-
174
- return $tracking_allowed;
175
- }
176
-
177
- /**
178
- * Get post id from comment id.
179
- *
180
- * @param int $comment_id Comment ID for which we need Post ID.
181
- * @return int Post ID. 0 if invalid comment id.
182
- */
183
- function bnfw_get_post_id_from_comment( $comment_id ) {
184
- $comment = get_comment( $comment_id );
185
-
186
- if ( null !== $comment ) {
187
- return $comment->comment_post_ID;
188
- }
189
-
190
- return 0;
191
- }
192
-
193
- /**
194
- * Format date based on date format stored in options.
195
- *
196
- * @param string $date Date.
197
- *
198
- * @return string Formatted date.
199
- */
200
- function bnfw_format_date( $date ) {
201
- $date_format = get_option( 'date_format' );
202
- $time_format = get_option( 'time_format' );
203
-
204
- return date( $date_format . ' ' . $time_format, strtotime( $date ) );
205
- }
1
+ <?php
2
+ /**
3
+ * General BNFW Helpers.
4
+ *
5
+ * @since 1.3.6
6
+ */
7
+
8
+ defined( 'ABSPATH' ) || exit; // Exit if accessed directly
9
+
10
+ /**
11
+ * Dynamically determine the class name for select2 user dropdown based on user count.
12
+ *
13
+ * @since 1.3.6
14
+ */
15
+ function bnfw_get_user_select_class() {
16
+ $user_count = count_users();
17
+
18
+ if ( $user_count['total_users'] > 200 ) {
19
+ return 'user-ajax-select2';
20
+ } else {
21
+ return 'user-select2';
22
+ }
23
+ }
24
+
25
+ /**
26
+ * Render users dropdown.
27
+ *
28
+ * @since 1.3.6
29
+ *
30
+ * @param $selected_users
31
+ */
32
+ function bnfw_render_users_dropdown( $selected_users ) {
33
+ global $wp_roles;
34
+
35
+ $non_wp_users = $selected_users;
36
+ $user_count = count_users();
37
+ ?>
38
+ <optgroup label="<?php _e( 'User Roles', 'bnfw' ); ?>">
39
+ <?php
40
+ $roles = $wp_roles->get_names();
41
+
42
+ foreach ( $roles as $role_slug => $role_name ) {
43
+ $selected = selected( true, in_array( 'role-' . $role_slug, $selected_users ), false );
44
+
45
+ if ( ! empty( $selected ) ) {
46
+ $non_wp_users = array_diff( $non_wp_users, array( 'role-' . $role_slug ) );
47
+ }
48
+
49
+ // Compatibility code, which will be eventually removed.
50
+ $selected_old = selected( true, in_array( 'role-' . $role_name, $selected_users ), false );
51
+ if ( ! empty( $selected_old ) ) {
52
+ $selected = $selected_old;
53
+ }
54
+
55
+ $count = 0;
56
+ if ( isset( $user_count['avail_roles'][ $role_slug ] ) ) {
57
+ $count = $user_count['avail_roles'][ $role_slug ];
58
+ }
59
+ echo '<option value="role-', esc_attr( $role_slug ), '" ', $selected, '>', esc_html( $role_name ), ' (', $count, ' ' . __( 'Users', 'bnfw' ) . ')', '</option>';
60
+ }
61
+ ?>
62
+ </optgroup>
63
+
64
+ <optgroup label="<?php _e( 'Users', 'bnfw' ); ?>">
65
+ <?php
66
+ $args = array(
67
+ 'order_by' => 'email',
68
+ 'fields' => array( 'ID', 'user_login' ),
69
+ 'number' => 200,
70
+ );
71
+
72
+ // if there are more than 200 users then use AJAX to load them dynamically.
73
+ // So just get only the selected users.
74
+ if ( $user_count['total_users'] > 200 ) {
75
+ $selected_user_ids = array();
76
+ foreach ( $selected_users as $selected_user ) {
77
+ if ( absint( $selected_user ) > 0 ) {
78
+ $selected_user_ids[] = $selected_user;
79
+ }
80
+ }
81
+
82
+ if ( $selected_user_ids > 0 ) {
83
+ $args['include'] = $selected_user_ids;
84
+ }
85
+ }
86
+
87
+ $users = get_users( $args );
88
+
89
+ foreach ( $users as $user ) {
90
+ $selected = selected( true, in_array( $user->ID, $selected_users ), false );
91
+
92
+ if ( ! empty( $selected ) ) {
93
+ $non_wp_users = array_diff( $non_wp_users, array( $user->ID ) );
94
+ }
95
+
96
+ echo '<option value="', esc_attr( $user->ID ), '" ', $selected, '>', esc_html( $user->user_login ), '</option>';
97
+ }
98
+
99
+ ?>
100
+ </optgroup>
101
+
102
+ <?php if ( ! empty( $non_wp_users ) ) { ?>
103
+ <optgroup label="<?php _e( 'Non WordPress Users', 'bnfw' ); ?>">
104
+ <?php foreach ( $non_wp_users as $non_wp_user ) {
105
+ echo '<option value="', esc_attr( $non_wp_user ), '" selected >', esc_html( $non_wp_user ), '</option>';
106
+ }
107
+ ?>
108
+ </optgroup>
109
+ <?php }
110
+ }
111
+
112
+ /**
113
+ * Find whether the notification name is a comment notification.
114
+ *
115
+ * @param string $notification_name Notification Name.
116
+ *
117
+ * @return bool True if it is a comment notification, False otherwise.
118
+ */
119
+ function bnfw_is_comment_notification( $notification_name ) {
120
+ $is_comment_notification = false;
121
+
122
+ switch ( $notification_name ) {
123
+ case 'new-comment':
124
+ case 'new-trackback':
125
+ case 'new-pingback':
126
+ case 'reply-comment':
127
+ $is_comment_notification = true;
128
+ break;
129
+
130
+ default:
131
+ $type = explode( '-', $notification_name, 2 );
132
+ if ( 'comment' == $type[0] || 'moderate' === $type[0] || 'approve' == $type[0] ) {
133
+ $is_comment_notification = true;
134
+ }
135
+ break;
136
+ }
137
+
138
+ return $is_comment_notification;
139
+ }
140
+
141
+ /**
142
+ * Format user capabilities.
143
+ *
144
+ * @param array $wp_capabilities User capabilities.
145
+ *
146
+ * @return string Formatted capabilities.
147
+ */
148
+ function bnfw_format_user_capabilities( $wp_capabilities ) {
149
+ $capabilities = array();
150
+
151
+ if ( is_array( $wp_capabilities ) ) {
152
+ foreach ( $wp_capabilities as $capability => $enabled ) {
153
+ if ( $enabled ) {
154
+ $capabilities[] = $capability;
155
+ }
156
+ }
157
+ }
158
+
159
+ return implode( ', ', $capabilities );
160
+ }
161
+
162
+ /**
163
+ * Has the user opted-in for tracking?
164
+ *
165
+ * @return bool True if tracking is allowed, False otherwise.
166
+ */
167
+ function bnfw_is_tracking_allowed() {
168
+ $tracking_allowed = false;
169
+
170
+ if ( get_option( 'bnfw_allow_tracking' ) == 'on' ) {
171
+ $tracking_allowed = true;
172
+ }
173
+
174
+ return $tracking_allowed;
175
+ }
176
+
177
+ /**
178
+ * Get post id from comment id.
179
+ *
180
+ * @param int $comment_id Comment ID for which we need Post ID.
181
+ * @return int Post ID. 0 if invalid comment id.
182
+ */
183
+ function bnfw_get_post_id_from_comment( $comment_id ) {
184
+ $comment = get_comment( $comment_id );
185
+
186
+ if ( null !== $comment ) {
187
+ return $comment->comment_post_ID;
188
+ }
189
+
190
+ return 0;
191
+ }
192
+
193
+ /**
194
+ * Format date based on date format stored in options.
195
+ *
196
+ * @param string $date Date.
197
+ *
198
+ * @return string Formatted date.
199
+ */
200
+ function bnfw_format_date( $date ) {
201
+ $date_format = get_option( 'date_format' );
202
+ $time_format = get_option( 'time_format' );
203
+
204
+ return date( $date_format . ' ' . $time_format, strtotime( $date ) );
205
+ }
includes/import.php CHANGED
@@ -1,169 +1,169 @@
1
- <?php
2
-
3
- /**
4
- * Import notification from old plugin.
5
- *
6
- * @since 1.0
7
- */
8
- class BNFW_Import {
9
- const EMAIL_OPTION = 'bnfw_custom_email_settings';
10
- const SETTING_OPTION = 'bnfw_settings';
11
- private $events = array(
12
- 'create_term',
13
- 'publish_post',
14
- 'comment_post',
15
- 'user_register',
16
- 'trackback_post',
17
- 'pingback_post',
18
- 'lostpassword_post',
19
- );
20
-
21
- /**
22
- * Import notification from old plugin.
23
- *
24
- * @since 1.0
25
- */
26
- public function import() {
27
- global $wp_roles;
28
- $roles = $wp_roles->get_names();
29
-
30
- if ( $this->import_needed() ) {
31
- $old_events = get_option( self::SETTING_OPTION );
32
- foreach ( $old_events as $event => $value ) {
33
- if ( '1' == $value ) {
34
- $event_array = explode( '-', $event );
35
- if ( 2 == count( $event_array ) ) {
36
- if ( in_array( $event_array[0], $this->events ) && in_array( $event_array[1], array_keys( $roles ) ) ) {
37
- $event_array[1] = $roles[ $event_array[1] ];
38
- $this->insert_notification( $event_array );
39
- }
40
- }
41
- }
42
- }
43
- // delete the old options
44
- $this->delete_option();
45
- }
46
- }
47
-
48
- /**
49
- * Check if import is needed.
50
- *
51
- * @since 1.0
52
- * @return unknown
53
- */
54
- private function import_needed() {
55
- if ( get_option( self::EMAIL_OPTION ) && get_option( self::SETTING_OPTION ) ) {
56
- return true;
57
- }
58
-
59
- return false;
60
- }
61
-
62
- /**
63
- * Insert notification.
64
- *
65
- * @param mixed $event
66
- */
67
- private function insert_notification( $event ) {
68
- $post = array(
69
- 'post_title' => $event[0] . esc_html__( ' for ', 'bnfw' ) . $event[1] . esc_html__( ' (Auto Imported)', 'bnfw' ),
70
- 'post_type' => BNFW_Notification::POST_TYPE,
71
- 'post_content' => '',
72
- 'post_status' => 'publish',
73
- );
74
-
75
- $post_id = wp_insert_post( $post );
76
- if ( $post_id > 0 ) {
77
- $content = $this->map_notification_content( $event[0] );
78
- $setting = array(
79
- 'notification' => $this->map_notification( $event[0] ),
80
- 'user-roles' => array( $event[1] ),
81
- 'users' => array(),
82
- 'subject' => $content['subject'],
83
- 'message' => $content['body'],
84
- );
85
-
86
- foreach ( $setting as $key => $value ) {
87
- update_post_meta( $post_id, BNFW_Notification::META_KEY_PREFIX . $key, $value );
88
- }
89
- }
90
- }
91
-
92
- /**
93
- * Map old notification type to new notification type.
94
- *
95
- * @param mixed $event_name
96
- *
97
- * @return unknown
98
- */
99
- private function map_notification( $event_name ) {
100
- switch ( $event_name ) {
101
- case 'create_term':
102
- return 'new-category';
103
- break;
104
- case 'publish_post':
105
- return 'new-post';
106
- break;
107
- case 'comment_post':
108
- return 'new-comment';
109
- break;
110
- case 'user_register':
111
- return 'new-user';
112
- break;
113
- case 'trackback_post':
114
- return 'new-trackback';
115
- break;
116
- case 'pingback_post':
117
- return 'new-pingback';
118
- break;
119
- case 'lostpassword_post':
120
- return 'user-password';
121
- break;
122
- }
123
- }
124
-
125
- /**
126
- * Map content from old plugin.
127
- *
128
- * @param unknown $event_name
129
- *
130
- * @return unknown
131
- */
132
- private function map_notification_content( $event_name ) {
133
- $content = array();
134
- if ( ! isset( $this->content_map ) ) {
135
- $this->parse_content();
136
- }
137
-
138
- return $this->content_map[ $event_name ];
139
- }
140
-
141
- /**
142
- * Parse content from old plugins setting.
143
- *
144
- * @since 1.0
145
- */
146
- private function parse_content() {
147
- $old_content = get_option( self::EMAIL_OPTION );
148
- $content_map = array();
149
- foreach ( $old_content as $key => $value ) {
150
- $key_array = explode( '-', $key );
151
- if ( 3 == count( $key_array ) ) {
152
- $content_map[ $key_array[2] ][ $key_array[1] ] = $value;
153
- }
154
- }
155
- $this->content_map = $content_map;
156
- }
157
-
158
- /**
159
- * Delete old plugin database options.
160
- *
161
- * @since 1.0
162
- */
163
- private function delete_option() {
164
- delete_option( self::EMAIL_OPTION );
165
- delete_option( self::SETTING_OPTION );
166
- }
167
- }
168
-
169
- ?>
1
+ <?php
2
+
3
+ /**
4
+ * Import notification from old plugin.
5
+ *
6
+ * @since 1.0
7
+ */
8
+ class BNFW_Import {
9
+ const EMAIL_OPTION = 'bnfw_custom_email_settings';
10
+ const SETTING_OPTION = 'bnfw_settings';
11
+ private $events = array(
12
+ 'create_term',
13
+ 'publish_post',
14
+ 'comment_post',
15
+ 'user_register',
16
+ 'trackback_post',
17
+ 'pingback_post',
18
+ 'lostpassword_post',
19
+ );
20
+
21
+ /**
22
+ * Import notification from old plugin.
23
+ *
24
+ * @since 1.0
25
+ */
26
+ public function import() {
27
+ global $wp_roles;
28
+ $roles = $wp_roles->get_names();
29
+
30
+ if ( $this->import_needed() ) {
31
+ $old_events = get_option( self::SETTING_OPTION );
32
+ foreach ( $old_events as $event => $value ) {
33
+ if ( '1' == $value ) {
34
+ $event_array = explode( '-', $event );
35
+ if ( 2 == count( $event_array ) ) {
36
+ if ( in_array( $event_array[0], $this->events ) && in_array( $event_array[1], array_keys( $roles ) ) ) {
37
+ $event_array[1] = $roles[ $event_array[1] ];
38
+ $this->insert_notification( $event_array );
39
+ }
40
+ }
41
+ }
42
+ }
43
+ // delete the old options
44
+ $this->delete_option();
45
+ }
46
+ }
47
+
48
+ /**
49
+ * Check if import is needed.
50
+ *
51
+ * @since 1.0
52
+ * @return unknown
53
+ */
54
+ private function import_needed() {
55
+ if ( get_option( self::EMAIL_OPTION ) && get_option( self::SETTING_OPTION ) ) {
56
+ return true;
57
+ }
58
+
59
+ return false;
60
+ }
61
+
62
+ /**
63
+ * Insert notification.
64
+ *
65
+ * @param mixed $event
66
+ */
67
+ private function insert_notification( $event ) {
68
+ $post = array(
69
+ 'post_title' => $event[0] . esc_html__( ' for ', 'bnfw' ) . $event[1] . esc_html__( ' (Auto Imported)', 'bnfw' ),
70
+ 'post_type' => BNFW_Notification::POST_TYPE,
71
+ 'post_content' => '',
72
+ 'post_status' => 'publish',
73
+ );
74
+
75
+ $post_id = wp_insert_post( $post );
76
+ if ( $post_id > 0 ) {
77
+ $content = $this->map_notification_content( $event[0] );
78
+ $setting = array(
79
+ 'notification' => $this->map_notification( $event[0] ),
80
+ 'user-roles' => array( $event[1] ),
81
+ 'users' => array(),
82
+ 'subject' => $content['subject'],
83
+ 'message' => $content['body'],
84
+ );
85
+
86
+ foreach ( $setting as $key => $value ) {
87
+ update_post_meta( $post_id, BNFW_Notification::META_KEY_PREFIX . $key, $value );
88
+ }
89
+ }
90
+ }
91
+
92
+ /**
93
+ * Map old notification type to new notification type.
94
+ *
95
+ * @param mixed $event_name
96
+ *
97
+ * @return unknown
98
+ */
99
+ private function map_notification( $event_name ) {
100
+ switch ( $event_name ) {
101
+ case 'create_term':
102
+ return 'new-category';
103
+ break;
104
+ case 'publish_post':
105
+ return 'new-post';
106
+ break;
107
+ case 'comment_post':
108
+ return 'new-comment';
109
+ break;
110
+ case 'user_register':
111
+ return 'new-user';
112
+ break;
113
+ case 'trackback_post':
114
+ return 'new-trackback';
115
+ break;
116
+ case 'pingback_post':
117
+ return 'new-pingback';
118
+ break;
119
+ case 'lostpassword_post':
120
+ return 'user-password';
121
+ break;
122
+ }
123
+ }
124
+
125
+ /**
126
+ * Map content from old plugin.
127
+ *
128
+ * @param unknown $event_name
129
+ *
130
+ * @return unknown
131
+ */
132
+ private function map_notification_content( $event_name ) {
133
+ $content = array();
134
+ if ( ! isset( $this->content_map ) ) {
135
+ $this->parse_content();
136
+ }
137
+
138
+ return $this->content_map[ $event_name ];
139
+ }
140
+
141
+ /**
142
+ * Parse content from old plugins setting.
143
+ *
144
+ * @since 1.0
145
+ */
146
+ private function parse_content() {
147
+ $old_content = get_option( self::EMAIL_OPTION );
148
+ $content_map = array();
149
+ foreach ( $old_content as $key => $value ) {
150
+ $key_array = explode( '-', $key );
151
+ if ( 3 == count( $key_array ) ) {
152
+ $content_map[ $key_array[2] ][ $key_array[1] ] = $value;
153
+ }
154
+ }
155
+ $this->content_map = $content_map;
156
+ }
157
+
158
+ /**
159
+ * Delete old plugin database options.
160
+ *
161
+ * @since 1.0
162
+ */
163
+ private function delete_option() {
164
+ delete_option( self::EMAIL_OPTION );
165
+ delete_option( self::SETTING_OPTION );
166
+ }
167
+ }
168
+
169
+ ?>
includes/libraries/EDD_SL_Plugin_Updater.php CHANGED
@@ -1,619 +1,619 @@
1
- <?php
2
-
3
- // Exit if accessed directly
4
- if ( ! defined( 'ABSPATH' ) ) exit;
5
-
6
- /**
7
- * Allows plugins to use their own update API.
8
- *
9
- * @author Easy Digital Downloads
10
- * @version 1.8.0
11
- */
12
- class EDD_SL_Plugin_Updater {
13
-
14
- private $api_url = '';
15
- private $api_data = array();
16
- private $name = '';
17
- private $slug = '';
18
- private $version = '';
19
- private $wp_override = false;
20
- private $cache_key = '';
21
- private $beta = false;
22
- private $health_check_timeout = 5;
23
-
24
- /**
25
- * Class constructor.
26
- *
27
- * @uses plugin_basename()
28
- * @uses hook()
29
- *
30
- * @param string $_api_url The URL pointing to the custom API endpoint.
31
- * @param string $_plugin_file Path to the plugin file.
32
- * @param array $_api_data Optional data to send with API calls.
33
- */
34
- public function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
35
-
36
- global $edd_plugin_data;
37
-
38
- $this->api_url = trailingslashit( $_api_url );
39
- $this->api_data = $_api_data;
40
- $this->name = plugin_basename( $_plugin_file );
41
- $this->slug = basename( $_plugin_file, '.php' );
42
- $this->version = $_api_data['version'];
43
- $this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false;
44
- $this->beta = ! empty( $this->api_data['beta'] ) ? true : false;
45
- $this->cache_key = 'edd_sl_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) );
46
-
47
- $edd_plugin_data[ $this->slug ] = $this->api_data;
48
-
49
- /**
50
- * Fires after the $edd_plugin_data is setup.
51
- *
52
- * @since x.x.x
53
- *
54
- * @param array $edd_plugin_data Array of EDD SL plugin data.
55
- */
56
- do_action( 'post_edd_sl_plugin_updater_setup', $edd_plugin_data );
57
-
58
- // Set up hooks.
59
- $this->init();
60
-
61
- }
62
-
63
- /**
64
- * Set up WordPress filters to hook into WP's update process.
65
- *
66
- * @uses add_filter()
67
- *
68
- * @return void
69
- */
70
- public function init() {
71
-
72
- add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
73
- add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
74
- remove_action( 'after_plugin_row_' . $this->name, 'wp_plugin_update_row', 10 );
75
- add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
76
- add_action( 'admin_init', array( $this, 'show_changelog' ) );
77
-
78
- }
79
-
80
- /**
81
- * Check for Updates at the defined API endpoint and modify the update array.
82
- *
83
- * This function dives into the update API just when WordPress creates its update array,
84
- * then adds a custom API call and injects the custom plugin data retrieved from the API.
85
- * It is reassembled from parts of the native WordPress plugin update code.
86
- * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
87
- *
88
- * @uses api_request()
89
- *
90
- * @param array $_transient_data Update array build by WordPress.
91
- * @return array Modified update array with custom plugin data.
92
- */
93
- public function check_update( $_transient_data ) {
94
-
95
- global $pagenow;
96
-
97
- if ( ! is_object( $_transient_data ) ) {
98
- $_transient_data = new stdClass;
99
- }
100
-
101
- if ( 'plugins.php' == $pagenow && is_multisite() ) {
102
- return $_transient_data;
103
- }
104
-
105
- if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) {
106
- return $_transient_data;
107
- }
108
-
109
- $current = $this->get_repo_api_data();
110
- if ( false !== $current && is_object( $current ) && isset( $current->new_version ) ) {
111
- if ( version_compare( $this->version, $current->new_version, '<' ) ) {
112
- $_transient_data->response[ $this->name ] = $current;
113
- } else {
114
- // Populating the no_update information is required to support auto-updates in WordPress 5.5.
115
- $_transient_data->no_update[ $this->name ] = $current;
116
- }
117
- }
118
- $_transient_data->last_checked = time();
119
- $_transient_data->checked[ $this->name ] = $this->version;
120
-
121
- return $_transient_data;
122
- }
123
-
124
- /**
125
- * Get repo API data from store.
126
- * Save to cache.
127
- *
128
- * @return \stdClass
129
- */
130
- public function get_repo_api_data() {
131
- $version_info = $this->get_cached_version_info();
132
-
133
- if ( false === $version_info ) {
134
- $version_info = $this->api_request(
135
- 'plugin_latest_version',
136
- array(
137
- 'slug' => $this->slug,
138
- 'beta' => $this->beta,
139
- )
140
- );
141
- if ( ! $version_info ) {
142
- return false;
143
- }
144
-
145
- // This is required for your plugin to support auto-updates in WordPress 5.5.
146
- $version_info->plugin = $this->name;
147
- $version_info->id = $this->name;
148
-
149
- $this->set_version_info_cache( $version_info );
150
- }
151
-
152
- return $version_info;
153
- }
154
-
155
- /**
156
- * show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise!
157
- *
158
- * @param string $file
159
- * @param array $plugin
160
- */
161
- public function show_update_notification( $file, $plugin ) {
162
-
163
- if ( is_network_admin() ) {
164
- return;
165
- }
166
-
167
- if( ! current_user_can( 'update_plugins' ) ) {
168
- return;
169
- }
170
-
171
- if( ! is_multisite() ) {
172
- return;
173
- }
174
-
175
- if ( $this->name != $file ) {
176
- return;
177
- }
178
-
179
- // Remove our filter on the site transient
180
- remove_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
181
-
182
- $update_cache = get_site_transient( 'update_plugins' );
183
-
184
- $update_cache = is_object( $update_cache ) ? $update_cache : new stdClass();
185
-
186
- if ( empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
187
-
188
- $version_info = $this->get_repo_api_data();
189
-
190
- if ( false === $version_info ) {
191
- $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug, 'beta' => $this->beta ) );
192
-
193
- // Since we disabled our filter for the transient, we aren't running our object conversion on banners, sections, or icons. Do this now:
194
- if ( isset( $version_info->banners ) && ! is_array( $version_info->banners ) ) {
195
- $version_info->banners = $this->convert_object_to_array( $version_info->banners );
196
- }
197
-
198
- if ( isset( $version_info->sections ) && ! is_array( $version_info->sections ) ) {
199
- $version_info->sections = $this->convert_object_to_array( $version_info->sections );
200
- }
201
-
202
- if ( isset( $version_info->icons ) && ! is_array( $version_info->icons ) ) {
203
- $version_info->icons = $this->convert_object_to_array( $version_info->icons );
204
- }
205
-
206
- if ( isset( $version_info->contributors ) && ! is_array( $version_info->contributors ) ) {
207
- $version_info->contributors = $this->convert_object_to_array( $version_info->contributors );
208
- }
209
-
210
- $this->set_version_info_cache( $version_info );
211
- }
212
-
213
- if ( ! is_object( $version_info ) ) {
214
- return;
215
- }
216
-
217
- if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
218
- $update_cache->response[ $this->name ] = $version_info;
219
- } else {
220
- $update_cache->no_update[ $this->name ] = $version_info;
221
- }
222
-
223
- $update_cache->last_checked = time();
224
- $update_cache->checked[ $this->name ] = $this->version;
225
-
226
- set_site_transient( 'update_plugins', $update_cache );
227
-
228
- } else {
229
-
230
- $version_info = $update_cache->response[ $this->name ];
231
-
232
- }
233
-
234
- // Restore our filter
235
- add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
236
-
237
- if ( ! empty( $update_cache->response[ $this->name ] ) && version_compare( $this->version, $version_info->new_version, '<' ) ) {
238
-
239
- // build a plugin list row, with update notification
240
- $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
241
- # <tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">
242
- echo '<tr class="plugin-update-tr" id="' . $this->slug . '-update" data-slug="' . $this->slug . '" data-plugin="' . $this->slug . '/' . $file . '">';
243
- echo '<td colspan="3" class="plugin-update colspanchange">';
244
- echo '<div class="update-message notice inline notice-warning notice-alt">';
245
-
246
- $changelog_link = self_admin_url( 'index.php?edd_sl_action=view_plugin_changelog&plugin=' . $this->name . '&slug=' . $this->slug . '&TB_iframe=true&width=772&height=911' );
247
-
248
- if ( empty( $version_info->download_link ) ) {
249
- printf(
250
- __( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s.', 'easy-digital-downloads' ),
251
- esc_html( $version_info->name ),
252
- '<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
253
- esc_html( $version_info->new_version ),
254
- '</a>'
255
- );
256
- } else {
257
- printf(
258
- __( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s or %5$supdate now%6$s.', 'easy-digital-downloads' ),
259
- esc_html( $version_info->name ),
260
- '<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
261
- esc_html( $version_info->new_version ),
262
- '</a>',
263
- '<a href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) ) .'">',
264
- '</a>'
265
- );
266
- }
267
-
268
- do_action( "in_plugin_update_message-{$file}", $plugin, $version_info );
269
-
270
- echo '</div></td></tr>';
271
- }
272
- }
273
-
274
- /**
275
- * Updates information on the "View version x.x details" page with custom data.
276
- *
277
- * @uses api_request()
278
- *
279
- * @param mixed $_data
280
- * @param string $_action
281
- * @param object $_args
282
- * @return object $_data
283
- */
284
- public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
285
-
286
- if ( $_action != 'plugin_information' ) {
287
-
288
- return $_data;
289
-
290
- }
291
-
292
- if ( ! isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) {
293
-
294
- return $_data;
295
-
296
- }
297
-
298
- $to_send = array(
299
- 'slug' => $this->slug,
300
- 'is_ssl' => is_ssl(),
301
- 'fields' => array(
302
- 'banners' => array(),
303
- 'reviews' => false,
304
- 'icons' => array(),
305
- )
306
- );
307
-
308
- // Get the transient where we store the api request for this plugin for 24 hours
309
- $edd_api_request_transient = $this->get_cached_version_info();
310
-
311
- //If we have no transient-saved value, run the API, set a fresh transient with the API value, and return that value too right now.
312
- if ( empty( $edd_api_request_transient ) ) {
313
-
314
- $api_response = $this->api_request( 'plugin_information', $to_send );
315
-
316
- // Expires in 3 hours
317
- $this->set_version_info_cache( $api_response );
318
-
319
- if ( false !== $api_response ) {
320
- $_data = $api_response;
321
- }
322
-
323
- } else {
324
- $_data = $edd_api_request_transient;
325
- }
326
-
327
- // Convert sections into an associative array, since we're getting an object, but Core expects an array.
328
- if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) {
329
- $_data->sections = $this->convert_object_to_array( $_data->sections );
330
- }
331
-
332
- // Convert banners into an associative array, since we're getting an object, but Core expects an array.
333
- if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) {
334
- $_data->banners = $this->convert_object_to_array( $_data->banners );
335
- }
336
-
337
- // Convert icons into an associative array, since we're getting an object, but Core expects an array.
338
- if ( isset( $_data->icons ) && ! is_array( $_data->icons ) ) {
339
- $_data->icons = $this->convert_object_to_array( $_data->icons );
340
- }
341
-
342
- // Convert contributors into an associative array, since we're getting an object, but Core expects an array.
343
- if ( isset( $_data->contributors ) && ! is_array( $_data->contributors ) ) {
344
- $_data->contributors = $this->convert_object_to_array( $_data->contributors );
345
- }
346
-
347
- if( ! isset( $_data->plugin ) ) {
348
- $_data->plugin = $this->name;
349
- }
350
-
351
- return $_data;
352
- }
353
-
354
- /**
355
- * Convert some objects to arrays when injecting data into the update API
356
- *
357
- * Some data like sections, banners, and icons are expected to be an associative array, however due to the JSON
358
- * decoding, they are objects. This method allows us to pass in the object and return an associative array.
359
- *
360
- * @since 3.6.5
361
- *
362
- * @param stdClass $data
363
- *
364
- * @return array
365
- */
366
- private function convert_object_to_array( $data ) {
367
- if ( ! is_array( $data ) && ! is_object( $data ) ) {
368
- return array();
369
- }
370
- $new_data = array();
371
- foreach ( $data as $key => $value ) {
372
- $new_data[ $key ] = is_object( $value ) ? $this->convert_object_to_array( $value ) : $value;
373
- }
374
-
375
- return $new_data;
376
- }
377
-
378
- /**
379
- * Disable SSL verification in order to prevent download update failures
380
- *
381
- * @param array $args
382
- * @param string $url
383
- * @return object $array
384
- */
385
- public function http_request_args( $args, $url ) {
386
-
387
- $verify_ssl = $this->verify_ssl();
388
- if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
389
- $args['sslverify'] = $verify_ssl;
390
- }
391
- return $args;
392
-
393
- }
394
-
395
- /**
396
- * Calls the API and, if successfull, returns the object delivered by the API.
397
- *
398
- * @uses get_bloginfo()
399
- * @uses wp_remote_post()
400
- * @uses is_wp_error()
401
- *
402
- * @param string $_action The requested action.
403
- * @param array $_data Parameters for the API action.
404
- * @return false|object
405
- */
406
- private function api_request( $_action, $_data ) {
407
-
408
- global $wp_version, $edd_plugin_url_available;
409
-
410
- $verify_ssl = $this->verify_ssl();
411
-
412
- // Do a quick status check on this domain if we haven't already checked it.
413
- $store_hash = md5( $this->api_url );
414
- if ( ! is_array( $edd_plugin_url_available ) || ! isset( $edd_plugin_url_available[ $store_hash ] ) ) {
415
- $test_url_parts = parse_url( $this->api_url );
416
-
417
- $scheme = ! empty( $test_url_parts['scheme'] ) ? $test_url_parts['scheme'] : 'http';
418
- $host = ! empty( $test_url_parts['host'] ) ? $test_url_parts['host'] : '';
419
- $port = ! empty( $test_url_parts['port'] ) ? ':' . $test_url_parts['port'] : '';
420
-
421
- if ( empty( $host ) ) {
422
- $edd_plugin_url_available[ $store_hash ] = false;
423
- } else {
424
- $test_url = $scheme . '://' . $host . $port;
425
- $response = wp_remote_get( $test_url, array( 'timeout' => $this->health_check_timeout, 'sslverify' => $verify_ssl ) );
426
- $edd_plugin_url_available[ $store_hash ] = is_wp_error( $response ) ? false : true;
427
- }
428
- }
429
-
430
- if ( false === $edd_plugin_url_available[ $store_hash ] ) {
431
- return false;
432
- }
433
-
434
- $data = array_merge( $this->api_data, $_data );
435
-
436
- if ( $data['slug'] != $this->slug ) {
437
- return false;
438
- }
439
-
440
- if ( $this->api_url == trailingslashit ( home_url() ) ) {
441
- return false; // Don't allow a plugin to ping itself
442
- }
443
-
444
- $api_params = array(
445
- 'edd_action' => 'get_version',
446
- 'license' => ! empty( $data['license'] ) ? $data['license'] : '',
447
- 'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false,
448
- 'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
449
- 'version' => isset( $data['version'] ) ? $data['version'] : false,
450
- 'slug' => $data['slug'],
451
- 'author' => $data['author'],
452
- 'url' => home_url(),
453
- 'beta' => ! empty( $data['beta'] ),
454
- );
455
-
456
- $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
457
-
458
- if ( ! is_wp_error( $request ) ) {
459
- $request = json_decode( wp_remote_retrieve_body( $request ) );
460
- }
461
-
462
- if ( $request && isset( $request->sections ) ) {
463
- $request->sections = maybe_unserialize( $request->sections );
464
- } else {
465
- $request = false;
466
- }
467
-
468
- if ( $request && isset( $request->banners ) ) {
469
- $request->banners = maybe_unserialize( $request->banners );
470
- }
471
-
472
- if ( $request && isset( $request->icons ) ) {
473
- $request->icons = maybe_unserialize( $request->icons );
474
- }
475
-
476
- if ( ! empty( $request->sections ) ) {
477
- foreach( $request->sections as $key => $section ) {
478
- $request->$key = (array) $section;
479
- }
480
- }
481
-
482
- return $request;
483
- }
484
-
485
- /**
486
- * If available, show the changelog for sites in a multisite install.
487
- */
488
- public function show_changelog() {
489
-
490
- global $edd_plugin_data;
491
-
492
- if( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
493
- return;
494
- }
495
-
496
- if( empty( $_REQUEST['plugin'] ) ) {
497
- return;
498
- }
499
-
500
- if( empty( $_REQUEST['slug'] ) ) {
501
- return;
502
- }
503
-
504
- if( ! current_user_can( 'update_plugins' ) ) {
505
- wp_die( __( 'You do not have permission to install plugin updates', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) );
506
- }
507
-
508
- $data = $edd_plugin_data[ $_REQUEST['slug'] ];
509
- $version_info = $this->get_cached_version_info();
510
-
511
- if( false === $version_info ) {
512
-
513
- $api_params = array(
514
- 'edd_action' => 'get_version',
515
- 'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false,
516
- 'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
517
- 'slug' => $_REQUEST['slug'],
518
- 'author' => $data['author'],
519
- 'url' => home_url(),
520
- 'beta' => ! empty( $data['beta'] )
521
- );
522
-
523
- $verify_ssl = $this->verify_ssl();
524
- $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
525
-
526
- if ( ! is_wp_error( $request ) ) {
527
- $version_info = json_decode( wp_remote_retrieve_body( $request ) );
528
- }
529
-
530
- if ( ! empty( $version_info ) && isset( $version_info->sections ) ) {
531
- $version_info->sections = maybe_unserialize( $version_info->sections );
532
- } else {
533
- $version_info = false;
534
- }
535
-
536
- if( ! empty( $version_info ) ) {
537
- foreach( $version_info->sections as $key => $section ) {
538
- $version_info->$key = (array) $section;
539
- }
540
- }
541
-
542
- $this->set_version_info_cache( $version_info );
543
-
544
- // Delete the unneeded option
545
- delete_option( md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $this->beta . '_version_info' ) );
546
- }
547
-
548
- if ( isset( $version_info->sections ) ) {
549
- $sections = $this->convert_object_to_array( $version_info->sections );
550
- if ( ! empty( $sections['changelog'] ) ) {
551
- echo '<div style="background:#fff;padding:10px;">' . wp_kses_post( $sections['changelog'] ) . '</div>';
552
- }
553
- }
554
-
555
- exit;
556
- }
557
-
558
- /**
559
- * Gets the plugin's cached version information from the database.
560
- *
561
- * @param string $cache_key
562
- * @return boolean|string
563
- */
564
- public function get_cached_version_info( $cache_key = '' ) {
565
-
566
- if( empty( $cache_key ) ) {
567
- $cache_key = $this->cache_key;
568
- }
569
-
570
- $cache = get_option( $cache_key );
571
-
572
- if( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) {
573
- return false; // Cache is expired
574
- }
575
-
576
- // We need to turn the icons into an array, thanks to WP Core forcing these into an object at some point.
577
- $cache['value'] = json_decode( $cache['value'] );
578
- if ( ! empty( $cache['value']->icons ) ) {
579
- $cache['value']->icons = (array) $cache['value']->icons;
580
- }
581
-
582
- return $cache['value'];
583
-
584
- }
585
-
586
- /**
587
- * Adds the plugin version information to the database.
588
- *
589
- * @param string $value
590
- * @param string $cache_key
591
- */
592
- public function set_version_info_cache( $value = '', $cache_key = '' ) {
593
-
594
- if( empty( $cache_key ) ) {
595
- $cache_key = $this->cache_key;
596
- }
597
-
598
- $data = array(
599
- 'timeout' => strtotime( '+3 hours', time() ),
600
- 'value' => json_encode( $value )
601
- );
602
-
603
- update_option( $cache_key, $data, 'no' );
604
-
605
- // Delete the duplicate option
606
- delete_option( 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) ) );
607
- }
608
-
609
- /**
610
- * Returns if the SSL of the store should be verified.
611
- *
612
- * @since 1.6.13
613
- * @return bool
614
- */
615
- private function verify_ssl() {
616
- return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this );
617
- }
618
-
619
- }
1
+ <?php
2
+
3
+ // Exit if accessed directly
4
+ if ( ! defined( 'ABSPATH' ) ) exit;
5
+
6
+ /**
7
+ * Allows plugins to use their own update API.
8
+ *
9
+ * @author Easy Digital Downloads
10
+ * @version 1.8.0
11
+ */
12
+ class EDD_SL_Plugin_Updater {
13
+
14
+ private $api_url = '';
15
+ private $api_data = array();
16
+ private $name = '';
17
+ private $slug = '';
18
+ private $version = '';
19
+ private $wp_override = false;
20
+ private $cache_key = '';
21
+ private $beta = false;
22
+ private $health_check_timeout = 5;
23
+
24
+ /**
25
+ * Class constructor.
26
+ *
27
+ * @uses plugin_basename()
28
+ * @uses hook()
29
+ *
30
+ * @param string $_api_url The URL pointing to the custom API endpoint.
31
+ * @param string $_plugin_file Path to the plugin file.
32
+ * @param array $_api_data Optional data to send with API calls.
33
+ */
34
+ public function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
35
+
36
+ global $edd_plugin_data;
37
+
38
+ $this->api_url = trailingslashit( $_api_url );
39
+ $this->api_data = $_api_data;
40
+ $this->name = plugin_basename( $_plugin_file );
41
+ $this->slug = basename( $_plugin_file, '.php' );
42
+ $this->version = $_api_data['version'];
43
+ $this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false;
44
+ $this->beta = ! empty( $this->api_data['beta'] ) ? true : false;
45
+ $this->cache_key = 'edd_sl_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) );
46
+
47
+ $edd_plugin_data[ $this->slug ] = $this->api_data;
48
+
49
+ /**
50
+ * Fires after the $edd_plugin_data is setup.
51
+ *
52
+ * @since x.x.x
53
+ *
54
+ * @param array $edd_plugin_data Array of EDD SL plugin data.
55
+ */
56
+ do_action( 'post_edd_sl_plugin_updater_setup', $edd_plugin_data );
57
+
58
+ // Set up hooks.
59
+ $this->init();
60
+
61
+ }
62
+
63
+ /**
64
+ * Set up WordPress filters to hook into WP's update process.
65
+ *
66
+ * @uses add_filter()
67
+ *
68
+ * @return void
69
+ */
70
+ public function init() {
71
+
72
+ add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
73
+ add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
74
+ remove_action( 'after_plugin_row_' . $this->name, 'wp_plugin_update_row', 10 );
75
+ add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
76
+ add_action( 'admin_init', array( $this, 'show_changelog' ) );
77
+
78
+ }
79
+
80
+ /**
81
+ * Check for Updates at the defined API endpoint and modify the update array.
82
+ *
83
+ * This function dives into the update API just when WordPress creates its update array,
84
+ * then adds a custom API call and injects the custom plugin data retrieved from the API.
85
+ * It is reassembled from parts of the native WordPress plugin update code.
86
+ * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
87
+ *
88
+ * @uses api_request()
89
+ *
90
+ * @param array $_transient_data Update array build by WordPress.
91
+ * @return array Modified update array with custom plugin data.
92
+ */
93
+ public function check_update( $_transient_data ) {
94
+
95
+ global $pagenow;
96
+
97
+ if ( ! is_object( $_transient_data ) ) {
98
+ $_transient_data = new stdClass;
99
+ }
100
+
101
+ if ( 'plugins.php' == $pagenow && is_multisite() ) {
102
+ return $_transient_data;
103
+ }
104
+
105
+ if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) {
106
+ return $_transient_data;
107
+ }
108
+
109
+ $current = $this->get_repo_api_data();
110
+ if ( false !== $current && is_object( $current ) && isset( $current->new_version ) ) {
111
+ if ( version_compare( $this->version, $current->new_version, '<' ) ) {
112
+ $_transient_data->response[ $this->name ] = $current;
113
+ } else {
114
+ // Populating the no_update information is required to support auto-updates in WordPress 5.5.
115
+ $_transient_data->no_update[ $this->name ] = $current;
116
+ }
117
+ }
118
+ $_transient_data->last_checked = time();
119
+ $_transient_data->checked[ $this->name ] = $this->version;
120
+
121
+ return $_transient_data;
122
+ }
123
+
124
+ /**
125
+ * Get repo API data from store.
126
+ * Save to cache.
127
+ *
128
+ * @return \stdClass
129
+ */
130
+ public function get_repo_api_data() {
131
+ $version_info = $this->get_cached_version_info();
132
+
133
+ if ( false === $version_info ) {
134
+ $version_info = $this->api_request(
135
+ 'plugin_latest_version',
136
+ array(
137
+ 'slug' => $this->slug,
138
+ 'beta' => $this->beta,
139
+ )
140
+ );
141
+ if ( ! $version_info ) {
142
+ return false;
143
+ }
144
+
145
+ // This is required for your plugin to support auto-updates in WordPress 5.5.
146
+ $version_info->plugin = $this->name;
147
+ $version_info->id = $this->name;
148
+
149
+ $this->set_version_info_cache( $version_info );
150
+ }
151
+
152
+ return $version_info;
153
+ }
154
+
155
+ /**
156
+ * show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise!
157
+ *
158
+ * @param string $file
159
+ * @param array $plugin
160
+ */
161
+ public function show_update_notification( $file, $plugin ) {
162
+
163
+ if ( is_network_admin() ) {
164
+ return;
165
+ }
166
+
167
+ if( ! current_user_can( 'update_plugins' ) ) {
168
+ return;
169
+ }
170
+
171
+ if( ! is_multisite() ) {
172
+ return;
173
+ }
174
+
175
+ if ( $this->name != $file ) {
176
+ return;
177
+ }
178
+
179
+ // Remove our filter on the site transient
180
+ remove_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
181
+
182
+ $update_cache = get_site_transient( 'update_plugins' );
183
+
184
+ $update_cache = is_object( $update_cache ) ? $update_cache : new stdClass();
185
+
186
+ if ( empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
187
+
188
+ $version_info = $this->get_repo_api_data();
189
+
190
+ if ( false === $version_info ) {
191
+ $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug, 'beta' => $this->beta ) );
192
+
193
+ // Since we disabled our filter for the transient, we aren't running our object conversion on banners, sections, or icons. Do this now:
194
+ if ( isset( $version_info->banners ) && ! is_array( $version_info->banners ) ) {
195
+ $version_info->banners = $this->convert_object_to_array( $version_info->banners );
196
+ }
197
+
198
+ if ( isset( $version_info->sections ) && ! is_array( $version_info->sections ) ) {
199
+ $version_info->sections = $this->convert_object_to_array( $version_info->sections );
200
+ }
201
+
202
+ if ( isset( $version_info->icons ) && ! is_array( $version_info->icons ) ) {
203
+ $version_info->icons = $this->convert_object_to_array( $version_info->icons );
204
+ }
205
+
206
+ if ( isset( $version_info->contributors ) && ! is_array( $version_info->contributors ) ) {
207
+ $version_info->contributors = $this->convert_object_to_array( $version_info->contributors );
208
+ }
209
+
210
+ $this->set_version_info_cache( $version_info );
211
+ }
212
+
213
+ if ( ! is_object( $version_info ) ) {
214
+ return;
215
+ }
216
+
217
+ if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
218
+ $update_cache->response[ $this->name ] = $version_info;
219
+ } else {
220
+ $update_cache->no_update[ $this->name ] = $version_info;
221
+ }
222
+
223
+ $update_cache->last_checked = time();
224
+ $update_cache->checked[ $this->name ] = $this->version;
225
+
226
+ set_site_transient( 'update_plugins', $update_cache );
227
+
228
+ } else {
229
+
230
+ $version_info = $update_cache->response[ $this->name ];
231
+
232
+ }
233
+
234
+ // Restore our filter
235
+ add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
236
+
237
+ if ( ! empty( $update_cache->response[ $this->name ] ) && version_compare( $this->version, $version_info->new_version, '<' ) ) {
238
+
239
+ // build a plugin list row, with update notification
240
+ $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
241
+ # <tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">
242
+ echo '<tr class="plugin-update-tr" id="' . $this->slug . '-update" data-slug="' . $this->slug . '" data-plugin="' . $this->slug . '/' . $file . '">';
243
+ echo '<td colspan="3" class="plugin-update colspanchange">';
244
+ echo '<div class="update-message notice inline notice-warning notice-alt">';
245
+
246
+ $changelog_link = self_admin_url( 'index.php?edd_sl_action=view_plugin_changelog&plugin=' . $this->name . '&slug=' . $this->slug . '&TB_iframe=true&width=772&height=911' );
247
+
248
+ if ( empty( $version_info->download_link ) ) {
249
+ printf(
250
+ __( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s.', 'easy-digital-downloads' ),
251
+ esc_html( $version_info->name ),
252
+ '<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
253
+ esc_html( $version_info->new_version ),
254
+ '</a>'
255
+ );
256
+ } else {
257
+ printf(
258
+ __( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s or %5$supdate now%6$s.', 'easy-digital-downloads' ),
259
+ esc_html( $version_info->name ),
260
+ '<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
261
+ esc_html( $version_info->new_version ),
262
+ '</a>',
263
+ '<a href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) ) .'">',
264
+ '</a>'
265
+ );
266
+ }
267
+
268
+ do_action( "in_plugin_update_message-{$file}", $plugin, $version_info );
269
+
270
+ echo '</div></td></tr>';
271
+ }
272
+ }
273
+
274
+ /**
275
+ * Updates information on the "View version x.x details" page with custom data.
276
+ *
277
+ * @uses api_request()
278
+ *
279
+ * @param mixed $_data
280
+ * @param string $_action
281
+ * @param object $_args
282
+ * @return object $_data
283
+ */
284
+ public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
285
+
286
+ if ( $_action != 'plugin_information' ) {
287
+
288
+ return $_data;
289
+
290
+ }
291
+
292
+ if ( ! isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) {
293
+
294
+ return $_data;
295
+
296
+ }
297
+
298
+ $to_send = array(
299
+ 'slug' => $this->slug,
300
+ 'is_ssl' => is_ssl(),
301
+ 'fields' => array(
302
+ 'banners' => array(),
303
+ 'reviews' => false,
304
+ 'icons' => array(),
305
+ )
306
+ );
307
+
308
+ // Get the transient where we store the api request for this plugin for 24 hours
309
+ $edd_api_request_transient = $this->get_cached_version_info();
310
+
311
+ //If we have no transient-saved value, run the API, set a fresh transient with the API value, and return that value too right now.
312
+ if ( empty( $edd_api_request_transient ) ) {
313
+
314
+ $api_response = $this->api_request( 'plugin_information', $to_send );
315
+
316
+ // Expires in 3 hours
317
+ $this->set_version_info_cache( $api_response );
318
+
319
+ if ( false !== $api_response ) {
320
+ $_data = $api_response;
321
+ }
322
+
323
+ } else {
324
+ $_data = $edd_api_request_transient;
325
+ }
326
+
327
+ // Convert sections into an associative array, since we're getting an object, but Core expects an array.
328
+ if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) {
329
+ $_data->sections = $this->convert_object_to_array( $_data->sections );
330
+ }
331
+
332
+ // Convert banners into an associative array, since we're getting an object, but Core expects an array.
333
+ if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) {
334
+ $_data->banners = $this->convert_object_to_array( $_data->banners );
335
+ }
336
+
337
+ // Convert icons into an associative array, since we're getting an object, but Core expects an array.
338
+ if ( isset( $_data->icons ) && ! is_array( $_data->icons ) ) {
339
+ $_data->icons = $this->convert_object_to_array( $_data->icons );
340
+ }
341
+
342
+ // Convert contributors into an associative array, since we're getting an object, but Core expects an array.
343
+ if ( isset( $_data->contributors ) && ! is_array( $_data->contributors ) ) {
344
+ $_data->contributors = $this->convert_object_to_array( $_data->contributors );
345
+ }
346
+
347
+ if( ! isset( $_data->plugin ) ) {
348
+ $_data->plugin = $this->name;
349
+ }
350
+
351
+ return $_data;
352
+ }
353
+
354
+ /**
355
+ * Convert some objects to arrays when injecting data into the update API
356
+ *
357
+ * Some data like sections, banners, and icons are expected to be an associative array, however due to the JSON
358
+ * decoding, they are objects. This method allows us to pass in the object and return an associative array.
359
+ *
360
+ * @since 3.6.5
361
+ *
362
+ * @param stdClass $data
363
+ *
364
+ * @return array
365
+ */
366
+ private function convert_object_to_array( $data ) {
367
+ if ( ! is_array( $data ) && ! is_object( $data ) ) {
368
+ return array();
369
+ }
370
+ $new_data = array();
371
+ foreach ( $data as $key => $value ) {
372
+ $new_data[ $key ] = is_object( $value ) ? $this->convert_object_to_array( $value ) : $value;
373
+ }
374
+
375
+ return $new_data;
376
+ }
377
+
378
+ /**
379
+ * Disable SSL verification in order to prevent download update failures
380
+ *
381
+ * @param array $args
382
+ * @param string $url
383
+ * @return object $array
384
+ */
385
+ public function http_request_args( $args, $url ) {
386
+
387
+ $verify_ssl = $this->verify_ssl();
388
+ if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
389
+ $args['sslverify'] = $verify_ssl;
390
+ }
391
+ return $args;
392
+
393
+ }
394
+
395
+ /**
396
+ * Calls the API and, if successfull, returns the object delivered by the API.
397
+ *
398
+ * @uses get_bloginfo()
399
+ * @uses wp_remote_post()
400
+ * @uses is_wp_error()
401
+ *
402
+ * @param string $_action The requested action.
403
+ * @param array $_data Parameters for the API action.
404
+ * @return false|object
405
+ */
406
+ private function api_request( $_action, $_data ) {
407
+
408
+ global $wp_version, $edd_plugin_url_available;
409
+
410
+ $verify_ssl = $this->verify_ssl();
411
+
412
+ // Do a quick status check on this domain if we haven't already checked it.
413
+ $store_hash = md5( $this->api_url );
414
+ if ( ! is_array( $edd_plugin_url_available ) || ! isset( $edd_plugin_url_available[ $store_hash ] ) ) {
415
+ $test_url_parts = parse_url( $this->api_url );
416
+
417
+ $scheme = ! empty( $test_url_parts['scheme'] ) ? $test_url_parts['scheme'] : 'http';
418
+ $host = ! empty( $test_url_parts['host'] ) ? $test_url_parts['host'] : '';
419
+ $port = ! empty( $test_url_parts['port'] ) ? ':' . $test_url_parts['port'] : '';
420
+
421
+ if ( empty( $host ) ) {
422
+ $edd_plugin_url_available[ $store_hash ] = false;
423
+ } else {
424
+ $test_url = $scheme . '://' . $host . $port;
425
+ $response = wp_remote_get( $test_url, array( 'timeout' => $this->health_check_timeout, 'sslverify' => $verify_ssl ) );
426
+ $edd_plugin_url_available[ $store_hash ] = is_wp_error( $response ) ? false : true;
427
+ }
428
+ }
429
+
430
+ if ( false === $edd_plugin_url_available[ $store_hash ] ) {
431
+ return false;
432
+ }
433
+
434
+ $data = array_merge( $this->api_data, $_data );
435
+
436
+ if ( $data['slug'] != $this->slug ) {
437
+ return false;
438
+ }
439
+
440
+ if ( $this->api_url == trailingslashit ( home_url() ) ) {
441
+ return false; // Don't allow a plugin to ping itself
442
+ }
443
+
444
+ $api_params = array(
445
+ 'edd_action' => 'get_version',
446
+ 'license' => ! empty( $data['license'] ) ? $data['license'] : '',
447
+ 'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false,
448
+ 'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
449
+ 'version' => isset( $data['version'] ) ? $data['version'] : false,
450
+ 'slug' => $data['slug'],
451
+ 'author' => $data['author'],
452
+ 'url' => home_url(),
453
+ 'beta' => ! empty( $data['beta'] ),
454
+ );
455
+
456
+ $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
457
+
458
+ if ( ! is_wp_error( $request ) ) {
459
+ $request = json_decode( wp_remote_retrieve_body( $request ) );
460
+ }
461
+
462
+ if ( $request && isset( $request->sections ) ) {
463
+ $request->sections = maybe_unserialize( $request->sections );
464
+ } else {
465
+ $request = false;
466
+ }
467
+
468
+ if ( $request && isset( $request->banners ) ) {
469
+ $request->banners = maybe_unserialize( $request->banners );
470
+ }
471
+
472
+ if ( $request && isset( $request->icons ) ) {
473
+ $request->icons = maybe_unserialize( $request->icons );
474
+ }
475
+
476
+ if ( ! empty( $request->sections ) ) {
477
+ foreach( $request->sections as $key => $section ) {
478
+ $request->$key = (array) $section;
479
+ }
480
+ }
481
+
482
+ return $request;
483
+ }
484
+
485
+ /**
486
+ * If available, show the changelog for sites in a multisite install.
487
+ */
488
+ public function show_changelog() {
489
+
490
+ global $edd_plugin_data;
491
+
492
+ if( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
493
+ return;
494
+ }
495
+
496
+ if( empty( $_REQUEST['plugin'] ) ) {
497
+ return;
498
+ }
499
+
500
+ if( empty( $_REQUEST['slug'] ) ) {
501
+ return;
502
+ }
503
+
504
+ if( ! current_user_can( 'update_plugins' ) ) {
505
+ wp_die( __( 'You do not have permission to install plugin updates', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) );
506
+ }
507
+
508
+ $data = $edd_plugin_data[ $_REQUEST['slug'] ];
509
+ $version_info = $this->get_cached_version_info();
510
+
511
+ if( false === $version_info ) {
512
+
513
+ $api_params = array(
514
+ 'edd_action' => 'get_version',
515
+ 'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false,
516
+ 'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
517
+ 'slug' => $_REQUEST['slug'],
518
+ 'author' => $data['author'],
519
+ 'url' => home_url(),
520
+ 'beta' => ! empty( $data['beta'] )
521
+ );
522
+
523
+ $verify_ssl = $this->verify_ssl();
524
+ $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
525
+
526
+ if ( ! is_wp_error( $request ) ) {
527
+ $version_info = json_decode( wp_remote_retrieve_body( $request ) );
528
+ }
529
+
530
+ if ( ! empty( $version_info ) && isset( $version_info->sections ) ) {
531
+ $version_info->sections = maybe_unserialize( $version_info->sections );
532
+ } else {
533
+ $version_info = false;
534
+ }
535
+
536
+ if( ! empty( $version_info ) ) {
537
+ foreach( $version_info->sections as $key => $section ) {
538
+ $version_info->$key = (array) $section;
539
+ }
540
+ }
541
+
542
+ $this->set_version_info_cache( $version_info );
543
+
544
+ // Delete the unneeded option
545
+ delete_option( md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $this->beta . '_version_info' ) );
546
+ }
547
+
548
+ if ( isset( $version_info->sections ) ) {
549
+ $sections = $this->convert_object_to_array( $version_info->sections );
550
+ if ( ! empty( $sections['changelog'] ) ) {
551
+ echo '<div style="background:#fff;padding:10px;">' . wp_kses_post( $sections['changelog'] ) . '</div>';
552
+ }
553
+ }
554
+
555
+ exit;
556
+ }
557
+
558
+ /**
559
+ * Gets the plugin's cached version information from the database.
560
+ *
561
+ * @param string $cache_key
562
+ * @return boolean|string
563
+ */
564
+ public function get_cached_version_info( $cache_key = '' ) {
565
+
566
+ if( empty( $cache_key ) ) {
567
+ $cache_key = $this->cache_key;
568
+ }
569
+
570
+ $cache = get_option( $cache_key );
571
+
572
+ if( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) {
573
+ return false; // Cache is expired
574
+ }
575
+
576
+ // We need to turn the icons into an array, thanks to WP Core forcing these into an object at some point.
577
+ $cache['value'] = json_decode( $cache['value'] );
578
+ if ( ! empty( $cache['value']->icons ) ) {
579
+ $cache['value']->icons = (array) $cache['value']->icons;
580
+ }
581
+
582
+ return $cache['value'];
583
+
584
+ }
585
+
586
+ /**
587
+ * Adds the plugin version information to the database.
588
+ *
589
+ * @param string $value
590
+ * @param string $cache_key
591
+ */
592
+ public function set_version_info_cache( $value = '', $cache_key = '' ) {
593
+
594
+ if( empty( $cache_key ) ) {
595
+ $cache_key = $this->cache_key;
596
+ }
597
+
598
+ $data = array(
599
+ 'timeout' => strtotime( '+3 hours', time() ),
600
+ 'value' => json_encode( $value )
601
+ );
602
+
603
+ update_option( $cache_key, $data, 'no' );
604
+
605
+ // Delete the duplicate option
606
+ delete_option( 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) ) );
607
+ }
608
+
609
+ /**
610
+ * Returns if the SSL of the store should be verified.
611
+ *
612
+ * @since 1.6.13
613
+ * @return bool
614
+ */
615
+ private function verify_ssl() {
616
+ return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this );
617
+ }
618
+
619
+ }
includes/license/class-bnfw-license-setting.php CHANGED
@@ -1,136 +1,136 @@
1
- <?php
2
- /**
3
- * BNFW License setting Handler.
4
- *
5
- * @since v1.4
6
- */
7
-
8
- defined( 'ABSPATH' ) || exit; // Exit if accessed directly
9
-
10
- /**
11
- * Add License page.
12
- *
13
- * @since 1.4
14
- */
15
- function bnfw_add_license_page() {
16
- add_submenu_page(
17
- 'edit.php?post_type=bnfw_notification',
18
- esc_html__( 'Add-on Licenses', 'bnfw' ),
19
- esc_html__( 'Add-on Licenses', 'bnfw' ),
20
- 'bnfw',
21
- 'bnfw-license',
22
- 'bnfw_render_license_page'
23
- );
24
- }
25
-
26
- add_action( 'admin_menu', 'bnfw_add_license_page', 11 );
27
-
28
- /**
29
- * Render license page.
30
- *
31
- * @since 1.4
32
- */
33
- function bnfw_render_license_page() {
34
- $settings = apply_filters( 'bnfw_settings_licenses', array() );
35
- ob_start(); ?>
36
-
37
- <div class="wrap">
38
- <h2><?php esc_html_e( 'BNFW Add-on Licenses', 'bnfw' ); ?></h2>
39
-
40
- <form method="post" action="options.php" class="bnfw-form">
41
- <?php
42
- settings_errors();
43
- settings_fields( 'bnfw-license-settings' );
44
- do_settings_sections( 'bnfw-license' );
45
-
46
- if ( ! empty( $settings ) ) {
47
- submit_button( esc_html__( 'Save License', 'bnfw' ) );
48
- } else {
49
- $store_url = 'https://betternotificationsforwp.com/downloads/';
50
-
51
- if ( bnfw_is_tracking_allowed() ) {
52
- $store_url .= "?utm_source=WP%20Admin%20Submenu%20Item%20-%20Add-on%20Licenses&amp;utm_medium=referral";
53
- }
54
-
55
- _e( '<br>You have no BNFW Premium Add-ons installed yet.<br>You can buy add-ons from the <a href="' . $store_url . '" target="_blank">Store</a>.<br>Once purchased, install and activate the add-on(s) like you would any other WordPress plugin. Then return here and enter your license key.', 'bnfw' );
56
- }
57
- ?>
58
- </form>
59
- </div>
60
-
61
- <?php echo ob_get_clean();
62
- }
63
-
64
- function bnfw_license_settings() {
65
- $settings = apply_filters( 'bnfw_settings_licenses', array() );
66
-
67
- if ( ! empty( $settings ) ) {
68
-
69
- add_settings_section(
70
- 'bnfw_license_section', // Section ID
71
- esc_html__( '', 'bnfw' ), // Title above settings section
72
- '__return_false', // Name of function that renders a description of the settings section
73
- 'bnfw-license' // Page to show on
74
- );
75
-
76
- foreach ( $settings as $option ) {
77
- $name = isset( $option['name'] ) ? $option['name'] : '';
78
- add_settings_field(
79
- 'bnfw_licenses[' . $option['id'] . ']',
80
- $name,
81
- 'bnfw_license_key_callback',
82
- 'bnfw-license',
83
- 'bnfw_license_section',
84
- array(
85
- 'id' => isset( $option['id'] ) ? $option['id'] : null,
86
- 'desc' => ! empty( $option['desc'] ) ? $option['desc'] : '',
87
- 'name' => isset( $option['name'] ) ? $option['name'] : null,
88
- 'size' => isset( $option['size'] ) ? $option['size'] : null,
89
- 'options' => isset( $option['options'] ) ? $option['options'] : '',
90
- 'std' => isset( $option['std'] ) ? $option['std'] : '',
91
- 'min' => isset( $option['min'] ) ? $option['min'] : null,
92
- 'max' => isset( $option['max'] ) ? $option['max'] : null,
93
- 'step' => isset( $option['step'] ) ? $option['step'] : null,
94
- 'chosen' => isset( $option['chosen'] ) ? $option['chosen'] : null,
95
- 'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : null,
96
- 'allow_blank' => isset( $option['allow_blank'] ) ? $option['allow_blank'] : true,
97
- 'readonly' => isset( $option['readonly'] ) ? $option['readonly'] : false,
98
- 'faux' => isset( $option['faux'] ) ? $option['faux'] : false,
99
- )
100
- );
101
- }
102
-
103
- register_setting(
104
- 'bnfw-license-settings',
105
- 'bnfw_licenses'
106
- );
107
- }
108
- }
109
-
110
- add_action( 'admin_init', 'bnfw_license_settings', 11 );
111
-
112
- /**
113
- * Register the new license field type
114
- *
115
- * @return void
116
- */
117
- function bnfw_license_key_callback( $args ) {
118
- $bnfw_options = get_option( 'bnfw_licenses' );
119
-
120
- if ( isset( $bnfw_options[ $args['id'] ] ) ) {
121
- $value = $bnfw_options[ $args['id'] ];
122
- } else {
123
- $value = isset( $args['std'] ) ? $args['std'] : '';
124
- }
125
-
126
- $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
127
- $html = '<input type="text" class="' . sanitize_html_class( $size ) . '-text" id="bnfw_licenses[' . $args['id'] . ']" name="bnfw_licenses[' . $args['id'] . ']" value="' . esc_attr( $value ) . '">';
128
-
129
- if ( 'valid' == get_option( $args['options']['is_valid_license_option'] ) ) {
130
- $html .= '<input type="submit" class="button-secondary" name="' . $args['id'] . '_deactivate" value="' . esc_attr__( 'Deactivate License', 'bnfw' ) . '">';
131
- }
132
-
133
- $html .= '<label for="bnfw_licenses[' . $args['id'] . ']"> ' . esc_html( $args['desc'] ) . '</label>';
134
-
135
- echo $html;
136
- }
1
+ <?php
2
+ /**
3
+ * BNFW License setting Handler.
4
+ *
5
+ * @since v1.4
6
+ */
7
+
8
+ defined( 'ABSPATH' ) || exit; // Exit if accessed directly
9
+
10
+ /**
11
+ * Add License page.
12
+ *
13
+ * @since 1.4
14
+ */
15
+ function bnfw_add_license_page() {
16
+ add_submenu_page(
17
+ 'edit.php?post_type=bnfw_notification',
18
+ esc_html__( 'Add-on Licenses', 'bnfw' ),
19
+ esc_html__( 'Add-on Licenses', 'bnfw' ),
20
+ 'bnfw',
21
+ 'bnfw-license',
22
+ 'bnfw_render_license_page'
23
+ );
24
+ }
25
+
26
+ add_action( 'admin_menu', 'bnfw_add_license_page', 11 );
27
+
28
+ /**
29
+ * Render license page.
30
+ *
31
+ * @since 1.4
32
+ */
33
+ function bnfw_render_license_page() {
34
+ $settings = apply_filters( 'bnfw_settings_licenses', array() );
35
+ ob_start(); ?>
36
+
37
+ <div class="wrap">
38
+ <h2><?php esc_html_e( 'BNFW Add-on Licenses', 'bnfw' ); ?></h2>
39
+
40
+ <form method="post" action="options.php" class="bnfw-form">
41
+ <?php
42
+ settings_errors();
43
+ settings_fields( 'bnfw-license-settings' );
44
+ do_settings_sections( 'bnfw-license' );
45
+
46
+ if ( ! empty( $settings ) ) {
47
+ submit_button( esc_html__( 'Save License', 'bnfw' ) );
48
+ } else {
49
+ $store_url = 'https://betternotificationsforwp.com/downloads/';
50
+
51
+ if ( bnfw_is_tracking_allowed() ) {
52
+ $store_url .= "?utm_source=WP%20Admin%20Submenu%20Item%20-%20Add-on%20Licenses&amp;utm_medium=referral";
53
+ }
54
+
55
+ _e( '<br>You have no BNFW Premium Add-ons installed yet.<br>You can buy add-ons from the <a href="' . $store_url . '" target="_blank">Store</a>.<br>Once purchased, install and activate the add-on(s) like you would any other WordPress plugin. Then return here and enter your license key.', 'bnfw' );
56
+ }
57
+ ?>
58
+ </form>
59
+ </div>
60
+
61
+ <?php echo ob_get_clean();
62
+ }
63
+
64
+ function bnfw_license_settings() {
65
+ $settings = apply_filters( 'bnfw_settings_licenses', array() );
66
+
67
+ if ( ! empty( $settings ) ) {
68
+
69
+ add_settings_section(
70
+ 'bnfw_license_section', // Section ID
71
+ esc_html__( '', 'bnfw' ), // Title above settings section
72
+ '__return_false', // Name of function that renders a description of the settings section
73
+ 'bnfw-license' // Page to show on
74
+ );
75
+
76
+ foreach ( $settings as $option ) {
77
+ $name = isset( $option['name'] ) ? $option['name'] : '';
78
+ add_settings_field(
79
+ 'bnfw_licenses[' . $option['id'] . ']',
80
+ $name,
81
+ 'bnfw_license_key_callback',
82
+ 'bnfw-license',
83
+ 'bnfw_license_section',
84
+ array(
85
+ 'id' => isset( $option['id'] ) ? $option['id'] : null,
86
+ 'desc' => ! empty( $option['desc'] ) ? $option['desc'] : '',
87
+ 'name' => isset( $option['name'] ) ? $option['name'] : null,
88
+ 'size' => isset( $option['size'] ) ? $option['size'] : null,
89
+ 'options' => isset( $option['options'] ) ? $option['options'] : '',
90
+ 'std' => isset( $option['std'] ) ? $option['std'] : '',
91
+ 'min' => isset( $option['min'] ) ? $option['min'] : null,
92
+ 'max' => isset( $option['max'] ) ? $option['max'] : null,
93
+ 'step' => isset( $option['step'] ) ? $option['step'] : null,
94
+ 'chosen' => isset( $option['chosen'] ) ? $option['chosen'] : null,
95
+ 'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : null,
96
+ 'allow_blank' => isset( $option['allow_blank'] ) ? $option['allow_blank'] : true,
97
+ 'readonly' => isset( $option['readonly'] ) ? $option['readonly'] : false,
98
+ 'faux' => isset( $option['faux'] ) ? $option['faux'] : false,
99
+ )
100
+ );
101
+ }
102
+
103
+ register_setting(
104
+ 'bnfw-license-settings',
105
+ 'bnfw_licenses'
106
+ );
107
+ }
108
+ }
109
+
110
+ add_action( 'admin_init', 'bnfw_license_settings', 11 );
111
+
112
+ /**
113
+ * Register the new license field type
114
+ *
115
+ * @return void
116
+ */
117
+ function bnfw_license_key_callback( $args ) {
118
+ $bnfw_options = get_option( 'bnfw_licenses' );
119
+
120
+ if ( isset( $bnfw_options[ $args['id'] ] ) ) {
121
+ $value = $bnfw_options[ $args['id'] ];
122
+ } else {
123
+ $value = isset( $args['std'] ) ? $args['std'] : '';
124
+ }
125
+
126
+ $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
127
+ $html = '<input type="text" class="' . sanitize_html_class( $size ) . '-text" id="bnfw_licenses[' . $args['id'] . ']" name="bnfw_licenses[' . $args['id'] . ']" value="' . esc_attr( $value ) . '">';
128
+
129
+ if ( 'valid' == get_option( $args['options']['is_valid_license_option'] ) ) {
130
+ $html .= '<input type="submit" class="button-secondary" name="' . $args['id'] . '_deactivate" value="' . esc_attr__( 'Deactivate License', 'bnfw' ) . '">';
131
+ }
132
+
133
+ $html .= '<label for="bnfw_licenses[' . $args['id'] . ']"> ' . esc_html( $args['desc'] ) . '</label>';
134
+
135
+ echo $html;
136
+ }
includes/license/class-bnfw-license.php CHANGED
@@ -1,255 +1,255 @@
1
- <?php
2
- /**
3
- * License handler for BNFW
4
- *
5
- * @since 1.4
6
- */
7
-
8
- defined( 'ABSPATH' ) || exit; // Exit if accessed directly
9
-
10
- /**
11
- * BNFW_License Class
12
- */
13
- class BNFW_License {
14
- private $file;
15
- private $license;
16
- private $item_name;
17
- private $item_shortname;
18
- private $version;
19
- private $author;
20
- private $api_url = 'https://betternotificationsforwp.com/';
21
-
22
- /**
23
- * Class constructor
24
- *
25
- * @param string $_file
26
- * @param string $_item_name
27
- * @param string $_version
28
- * @param string $_author
29
- * @param string $_optname
30
- * @param string $_api_url
31
- */
32
- function __construct( $_file, $_item_name, $_version, $_author, $_optname = null, $_api_url = null ) {
33
- $bnfw_options = get_option( 'bnfw_licenses' );
34
-
35
- $this->file = $_file;
36
- $this->item_name = $_item_name;
37
- $this->item_shortname = 'bnfw_' . preg_replace( '/[^a-zA-Z0-9_\s]/', '', str_replace( ' ', '_', strtolower( $this->item_name ) ) );
38
- $this->version = $_version;
39
- $this->license = isset( $bnfw_options[ $this->item_shortname . '_license_key' ] ) ? trim( $bnfw_options[ $this->item_shortname . '_license_key' ] ) : '';
40
- $this->author = $_author;
41
- $this->api_url = is_null( $_api_url ) ? $this->api_url : $_api_url;
42
-
43
- // Setup hooks
44
- $this->hooks();
45
- $this->auto_updater();
46
- }
47
-
48
- /**
49
- * Setup hooks
50
- *
51
- * @access private
52
- * @return void
53
- */
54
- private function hooks() {
55
- // Register settings
56
- add_filter( 'bnfw_settings_licenses', array( $this, 'settings' ), 1 );
57
-
58
- // Activate license key on settings save
59
- add_action( 'admin_init', array( $this, 'activate_license' ) );
60
-
61
- // Deactivate license key
62
- add_action( 'admin_init', array( $this, 'deactivate_license' ) );
63
-
64
- add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'update_plugins_transient_unserialize_icons' ), 99 );
65
- }
66
-
67
- /**
68
- * Filter the transient data for our plugin's icons.
69
- * Since icons are passed back as serialized arrays, we need to unserialize them.
70
- * This has to be run from within your plugin.
71
- *
72
- * Based on code from https://renventura.com/adding-update-icons-for-commercial-plugins/
73
- *
74
- * @param (object) $transient - Full transient data
75
- *
76
- * @return mixed (object) $transient
77
- */
78
- public function update_plugins_transient_unserialize_icons( $transient ) {
79
-
80
- if ( is_object( $transient ) && isset( $transient->response ) && is_array( $transient->response ) ) {
81
-
82
- $basename = plugin_basename( __FILE__ );
83
-
84
- // Received a response for our plugin
85
- $plugin = isset( $transient->response[ $basename ] ) ? $transient->response[ $basename ] : new stdClass;
86
-
87
- // Are there any icons set for the plugin?
88
- if ( isset( $plugin->icons ) ) {
89
- $icons = is_string( $plugin->icons ) ? unserialize( $plugin->icons ) : $plugin->icons;
90
- $transient->response[ $basename ]->icons = $icons;
91
- }
92
- }
93
-
94
- return $transient;
95
- }
96
-
97
- /**
98
- * Auto updater
99
- *
100
- * @access private
101
- * @return void
102
- */
103
- private function auto_updater() {
104
- // Setup the updater
105
- $edd_updater = new EDD_SL_Plugin_Updater(
106
- $this->api_url,
107
- $this->file,
108
- array(
109
- 'version' => $this->version,
110
- 'license' => $this->license,
111
- 'item_name' => $this->item_name,
112
- 'author' => $this->author,
113
- )
114
- );
115
- }
116
-
117
- /**
118
- * Add license field to settings
119
- *
120
- * @access public
121
- *
122
- * @param array $settings
123
- *
124
- * @return array
125
- */
126
- public function settings( $settings ) {
127
- if ( 'Multisite Add-on' === $this->item_name && ! is_multisite() ) {
128
- return $settings;
129
- }
130
-
131
- if ( 'Multisite Add-on' === $this->item_name && is_multisite() ) {
132
- if ( ! is_main_site() ) {
133
- return $settings;
134
- }
135
- }
136
-
137
- $bnfw_license_settings = array(
138
- array(
139
- 'id' => $this->item_shortname . '_license_key',
140
- 'name' => sprintf( esc_html__( '%1$s License Key', 'bnfw' ), $this->item_name ),
141
- 'desc' => '',
142
- 'type' => 'license_key',
143
- 'options' => array( 'is_valid_license_option' => $this->item_shortname . '_license_active' ),
144
- 'size' => 'regular',
145
- ),
146
- );
147
-
148
- return array_merge( $settings, $bnfw_license_settings );
149
- }
150
-
151
- /**
152
- * Activate the license key
153
- *
154
- * @access public
155
- * @return void
156
- */
157
- public function activate_license() {
158
- if ( ! isset( $_POST['bnfw_licenses'] ) ) {
159
- return;
160
- }
161
-
162
- if ( ! isset( $_POST['bnfw_licenses'][ $this->item_shortname . '_license_key' ] ) ) {
163
- return;
164
- }
165
-
166
- if ( 'valid' == get_option( $this->item_shortname . '_license_active' ) ) {
167
- return;
168
- }
169
-
170
- $license = sanitize_text_field( $_POST['bnfw_licenses'][ $this->item_shortname . '_license_key' ] );
171
-
172
- // Data to send to the API
173
- $api_params = array(
174
- 'edd_action' => 'activate_license',
175
- 'license' => $license,
176
- 'item_name' => urlencode( $this->item_name ),
177
- );
178
-
179
- if ( 'Multisite Add-on' === $this->item_name && is_multisite() ) {
180
- $api_params['url'] = get_home_url( get_main_site_id() );
181
- }
182
-
183
- // Call the API
184
- $response = wp_remote_get(
185
- esc_url_raw( add_query_arg( $api_params, $this->api_url ) ),
186
- array(
187
- 'timeout' => 15,
188
- 'body' => $api_params,
189
- 'sslverify' => false,
190
- )
191
- );
192
-
193
- // Make sure there are no errors
194
- if ( is_wp_error( $response ) ) {
195
- return;
196
- }
197
-
198
- // Decode license data
199
- $license_data = json_decode( wp_remote_retrieve_body( $response ) );
200
-
201
- update_option( $this->item_shortname . '_license_active', $license_data->license );
202
- }
203
-
204
- /**
205
- * Deactivate the license key
206
- *
207
- * @access public
208
- * @return void
209
- */
210
- public function deactivate_license() {
211
- if ( ! isset( $_POST['bnfw_licenses'] ) ) {
212
- return;
213
- }
214
-
215
- if ( ! isset( $_POST['bnfw_licenses'][ $this->item_shortname . '_license_key' ] ) ) {
216
- return;
217
- }
218
-
219
- // Run on deactivate button press
220
- if ( isset( $_POST[ $this->item_shortname . '_license_key_deactivate' ] ) ) {
221
-
222
- // Data to send to the API
223
- $api_params = array(
224
- 'edd_action' => 'deactivate_license',
225
- 'license' => $this->license,
226
- 'item_name' => urlencode( $this->item_name ),
227
- );
228
-
229
- if ( 'Multisite Add-on' === $this->item_name && is_multisite() ) {
230
- $api_params['url'] = get_home_url( get_main_site_id() );
231
- }
232
-
233
- // Call the API
234
- $response = wp_remote_get(
235
- esc_url_raw( add_query_arg( $api_params, $this->api_url ) ),
236
- array(
237
- 'timeout' => 15,
238
- 'sslverify' => false,
239
- )
240
- );
241
-
242
- // Make sure there are no errors
243
- if ( is_wp_error( $response ) ) {
244
- return;
245
- }
246
-
247
- // Decode the license data
248
- $license_data = json_decode( wp_remote_retrieve_body( $response ) );
249
-
250
- if ( 'deactivated' == $license_data->license ) {
251
- delete_option( $this->item_shortname . '_license_active' );
252
- }
253
- }
254
- }
255
- }
1
+ <?php
2
+ /**
3
+ * License handler for BNFW
4
+ *
5
+ * @since 1.4
6
+ */
7
+
8
+ defined( 'ABSPATH' ) || exit; // Exit if accessed directly
9
+
10
+ /**
11
+ * BNFW_License Class
12
+ */
13
+ class BNFW_License {
14
+ private $file;
15
+ private $license;
16
+ private $item_name;
17
+ private $item_shortname;
18
+ private $version;
19
+ private $author;
20
+ private $api_url = 'https://betternotificationsforwp.com/';
21
+
22
+ /**
23
+ * Class constructor
24
+ *
25
+ * @param string $_file
26
+ * @param string $_item_name
27
+ * @param string $_version
28
+ * @param string $_author
29
+ * @param string $_optname
30
+ * @param string $_api_url
31
+ */
32
+ function __construct( $_file, $_item_name, $_version, $_author, $_optname = null, $_api_url = null ) {
33
+ $bnfw_options = get_option( 'bnfw_licenses' );
34
+
35
+ $this->file = $_file;
36
+ $this->item_name = $_item_name;
37
+ $this->item_shortname = 'bnfw_' . preg_replace( '/[^a-zA-Z0-9_\s]/', '', str_replace( ' ', '_', strtolower( $this->item_name ) ) );
38
+ $this->version = $_version;
39
+ $this->license = isset( $bnfw_options[ $this->item_shortname . '_license_key' ] ) ? trim( $bnfw_options[ $this->item_shortname . '_license_key' ] ) : '';
40
+ $this->author = $_author;
41
+ $this->api_url = is_null( $_api_url ) ? $this->api_url : $_api_url;
42
+
43
+ // Setup hooks
44
+ $this->hooks();
45
+ $this->auto_updater();
46
+ }
47
+
48
+ /**
49
+ * Setup hooks
50
+ *
51
+ * @access private
52
+ * @return void
53
+ */
54
+ private function hooks() {
55
+ // Register settings
56
+ add_filter( 'bnfw_settings_licenses', array( $this, 'settings' ), 1 );
57
+
58
+ // Activate license key on settings save
59
+ add_action( 'admin_init', array( $this, 'activate_license' ) );
60
+
61
+ // Deactivate license key
62
+ add_action( 'admin_init', array( $this, 'deactivate_license' ) );
63
+
64
+ add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'update_plugins_transient_unserialize_icons' ), 99 );
65
+ }
66
+
67
+ /**
68
+ * Filter the transient data for our plugin's icons.
69
+ * Since icons are passed back as serialized arrays, we need to unserialize them.
70
+ * This has to be run from within your plugin.
71
+ *
72
+ * Based on code from https://renventura.com/adding-update-icons-for-commercial-plugins/
73
+ *
74
+ * @param (object) $transient - Full transient data
75
+ *
76
+ * @return mixed (object) $transient
77
+ */
78
+ public function update_plugins_transient_unserialize_icons( $transient ) {
79
+
80
+ if ( is_object( $transient ) && isset( $transient->response ) && is_array( $transient->response ) ) {
81
+
82
+ $basename = plugin_basename( __FILE__ );
83
+
84
+ // Received a response for our plugin
85
+ $plugin = isset( $transient->response[ $basename ] ) ? $transient->response[ $basename ] : new stdClass;
86
+
87
+ // Are there any icons set for the plugin?
88
+ if ( isset( $plugin->icons ) ) {
89
+ $icons = is_string( $plugin->icons ) ? unserialize( $plugin->icons ) : $plugin->icons;
90
+ $transient->response[ $basename ]->icons = $icons;
91
+ }
92
+ }
93
+
94
+ return $transient;
95
+ }
96
+
97
+ /**
98
+ * Auto updater
99
+ *
100
+ * @access private
101
+ * @return void
102
+ */
103
+ private function auto_updater() {
104
+ // Setup the updater
105
+ $edd_updater = new EDD_SL_Plugin_Updater(
106
+ $this->api_url,
107
+ $this->file,
108
+ array(
109
+ 'version' => $this->version,
110
+ 'license' => $this->license,
111
+ 'item_name' => $this->item_name,
112
+ 'author' => $this->author,
113
+ )
114
+ );
115
+ }
116
+
117
+ /**
118
+ * Add license field to settings
119
+ *
120
+ * @access public
121
+ *
122
+ * @param array $settings
123
+ *
124
+ * @return array
125
+ */
126
+ public function settings( $settings ) {
127
+ if ( 'Multisite Add-on' === $this->item_name && ! is_multisite() ) {
128
+ return $settings;
129
+ }
130
+
131
+ if ( 'Multisite Add-on' === $this->item_name && is_multisite() ) {
132
+ if ( ! is_main_site() ) {
133
+ return $settings;
134
+ }
135
+ }
136
+
137
+ $bnfw_license_settings = array(
138
+ array(
139
+ 'id' => $this->item_shortname . '_license_key',
140
+ 'name' => sprintf( esc_html__( '%1$s License Key', 'bnfw' ), $this->item_name ),
141
+ 'desc' => '',
142
+ 'type' => 'license_key',
143
+ 'options' => array( 'is_valid_license_option' => $this->item_shortname . '_license_active' ),
144
+ 'size' => 'regular',
145
+ ),
146
+ );
147
+
148
+ return array_merge( $settings, $bnfw_license_settings );
149
+ }
150
+
151
+ /**
152
+ * Activate the license key
153
+ *
154
+ * @access public
155
+ * @return void
156
+ */
157
+ public function activate_license() {
158
+ if ( ! isset( $_POST['bnfw_licenses'] ) ) {
159
+ return;
160
+ }
161
+
162
+ if ( ! isset( $_POST['bnfw_licenses'][ $this->item_shortname . '_license_key' ] ) ) {
163
+ return;
164
+ }
165
+
166
+ if ( 'valid' == get_option( $this->item_shortname . '_license_active' ) ) {
167
+ return;
168
+ }
169
+
170
+ $license = sanitize_text_field( $_POST['bnfw_licenses'][ $this->item_shortname . '_license_key' ] );
171
+
172
+ // Data to send to the API
173
+ $api_params = array(
174
+ 'edd_action' => 'activate_license',
175
+ 'license' => $license,
176
+ 'item_name' => urlencode( $this->item_name ),
177
+ );
178
+
179
+ if ( 'Multisite Add-on' === $this->item_name && is_multisite() ) {
180
+ $api_params['url'] = get_home_url( get_main_site_id() );
181
+ }
182
+
183
+ // Call the API
184
+ $response = wp_remote_get(
185
+ esc_url_raw( add_query_arg( $api_params, $this->api_url ) ),
186
+ array(
187
+ 'timeout' => 15,
188
+ 'body' => $api_params,
189
+ 'sslverify' => false,
190
+ )
191
+ );
192
+
193
+ // Make sure there are no errors
194
+ if ( is_wp_error( $response ) ) {
195
+ return;
196
+ }
197
+
198
+ // Decode license data
199
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
200
+
201
+ update_option( $this->item_shortname . '_license_active', $license_data->license );
202
+ }
203
+
204
+ /**
205
+ * Deactivate the license key
206
+ *
207
+ * @access public
208
+ * @return void
209
+ */
210
+ public function deactivate_license() {
211
+ if ( ! isset( $_POST['bnfw_licenses'] ) ) {
212
+ return;
213
+ }
214
+
215
+ if ( ! isset( $_POST['bnfw_licenses'][ $this->item_shortname . '_license_key' ] ) ) {
216
+ return;
217
+ }
218
+
219
+ // Run on deactivate button press
220
+ if ( isset( $_POST[ $this->item_shortname . '_license_key_deactivate' ] ) ) {
221
+
222
+ // Data to send to the API
223
+ $api_params = array(
224
+ 'edd_action' => 'deactivate_license',
225
+ 'license' => $this->license,
226
+ 'item_name' => urlencode( $this->item_name ),
227
+ );
228
+
229
+ if ( 'Multisite Add-on' === $this->item_name && is_multisite() ) {
230
+ $api_params['url'] = get_home_url( get_main_site_id() );
231
+ }
232
+
233
+ // Call the API
234
+ $response = wp_remote_get(
235
+ esc_url_raw( add_query_arg( $api_params, $this->api_url ) ),
236
+ array(
237
+ 'timeout' => 15,
238
+ 'sslverify' => false,
239
+ )
240
+ );
241
+
242
+ // Make sure there are no errors
243
+ if ( is_wp_error( $response ) ) {
244
+ return;
245
+ }
246
+
247
+ // Decode the license data
248
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
249
+
250
+ if ( 'deactivated' == $license_data->license ) {
251
+ delete_option( $this->item_shortname . '_license_active' );
252
+ }
253
+ }
254
+ }
255
+ }
includes/notification/post-notification.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
- /**
3
- * Handle post notifications.
4
- *
5
- * @since 1.3.6
6
- */
7
-
8
- /**
9
- * Define the list of post notifications.
10
- *
11
- * @since 1.3.6
12
- *
13
- * @param array $notifications List of post notifications
14
- * @param string $post_type Post type
15
- * @return array Filtered list of post notifications
16
- */
17
- function bnfw_post_notifications( $notifications, $post_type ) {
18
- $notifications[] = 'new-' . $post_type;
19
- $notifications[] = 'update-' . $post_type;
20
- $notifications[] = 'pending-' . $post_type;
21
- $notifications[] = 'future-' . $post_type;
22
- $notifications[] = 'comment-' . $post_type;
23
- $notifications[] = 'moderate-' . $post_type . '-comment';
24
- $notifications[] = 'approve-' . $post_type . '-comment';
25
- if($post_type == 'post'){
26
- $notifications[] = 'new-comment';
27
- $notifications[] = 'new-trackback';
28
- $notifications[] = 'new-pingback';
29
- $notifications[] = 'approve-comment';
30
- }
31
- return $notifications;
32
- }
33
- add_filter( 'bnfw_post_notifications', 'bnfw_post_notifications', 10, 2 );
1
+ <?php
2
+ /**
3
+ * Handle post notifications.
4
+ *
5
+ * @since 1.3.6
6
+ */
7
+
8
+ /**
9
+ * Define the list of post notifications.
10
+ *
11
+ * @since 1.3.6
12
+ *
13
+ * @param array $notifications List of post notifications
14
+ * @param string $post_type Post type
15
+ * @return array Filtered list of post notifications
16
+ */
17
+ function bnfw_post_notifications( $notifications, $post_type ) {
18
+ $notifications[] = 'new-' . $post_type;
19
+ $notifications[] = 'update-' . $post_type;
20
+ $notifications[] = 'pending-' . $post_type;
21
+ $notifications[] = 'future-' . $post_type;
22
+ $notifications[] = 'comment-' . $post_type;
23
+ $notifications[] = 'moderate-' . $post_type . '-comment';
24
+ $notifications[] = 'approve-' . $post_type . '-comment';
25
+ if($post_type == 'post'){
26
+ $notifications[] = 'new-comment';
27
+ $notifications[] = 'new-trackback';
28
+ $notifications[] = 'new-pingback';
29
+ $notifications[] = 'approve-comment';
30
+ }
31
+ return $notifications;
32
+ }
33
+ add_filter( 'bnfw_post_notifications', 'bnfw_post_notifications', 10, 2 );
includes/overrides.php CHANGED
@@ -1,193 +1,193 @@
1
- <?php
2
- /**
3
- * Override default WordPress emails
4
- *
5
- */
6
-
7
- /**
8
- * Email login credentials to a newly-registered user.
9
- *
10
- * A new user registration notification is also sent to admin email.
11
- *
12
- * @param int $user_id User ID.
13
- * @param null $deprecated Not used (argument deprecated).
14
- * @param string $notify Optional. Type of notification that should happen. Accepts 'admin' or an empty
15
- * string (admin only), or 'both' (admin and user). The empty string value was kept
16
- * for backward-compatibility purposes with the renamed parameter. Default empty.
17
- */
18
- if ( ! function_exists( 'wp_new_user_notification' ) ) {
19
- function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' ) {
20
- global $wp_version, $wp_hasher;
21
-
22
- $bnfw = BNFW::factory();
23
- $user = get_userdata( $user_id );
24
-
25
- if ( version_compare( $wp_version, '4.3', '>=' ) ) {
26
- // for WordPress 4.3 and above
27
-
28
- if ( version_compare( $wp_version, '4.3', '=' ) ) {
29
- $notify = $deprecated;
30
- } else {
31
- if ( $deprecated !== null ) {
32
- _deprecated_argument( __FUNCTION__, '4.3.1' );
33
- }
34
- }
35
-
36
- // The blogname option is escaped with esc_html on the way into the database in sanitize_option
37
- // we want to reverse this for the plain text arena of emails.
38
- $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
39
-
40
- if ( ! $bnfw->notifier->notification_exists( 'admin-user', false ) ) {
41
- $message = sprintf( esc_html__( 'New user registration on your site %s:' ), $blogname ) . "\r\n\r\n";
42
- $message .= sprintf( esc_html__( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
43
- $message .= sprintf( esc_html__( 'E-mail: %s' ), $user->user_email ) . "\r\n";
44
-
45
- $wp_new_user_notification_email_admin = array(
46
- 'to' => get_option( 'admin_email' ),
47
- /* translators: Password change notification email subject. %s: Site title */
48
- 'subject' => __( '[%s] New User Registration' ),
49
- 'message' => $message,
50
- 'headers' => '',
51
- );
52
-
53
- /**
54
- * Filters the contents of the new user notification email sent to the site admin.
55
- *
56
- * @since 4.9.0
57
- *
58
- * @param array $wp_new_user_notification_email {
59
- * Used to build wp_mail().
60
- *
61
- * @type string $to The intended recipient - site admin email address.
62
- * @type string $subject The subject of the email.
63
- * @type string $message The body of the email.
64
- * @type string $headers The headers of the email.
65
- * }
66
- *
67
- * @param WP_User $user User object for new user.
68
- * @param string $blogname The site title.
69
- */
70
- $wp_new_user_notification_email_admin = apply_filters( 'wp_new_user_notification_email_admin', $wp_new_user_notification_email_admin, $user, $blogname );
71
-
72
- @wp_mail(
73
- $wp_new_user_notification_email_admin['to'],
74
- wp_specialchars_decode( sprintf( $wp_new_user_notification_email_admin['subject'], $blogname ) ),
75
- $wp_new_user_notification_email_admin['message'],
76
- $wp_new_user_notification_email_admin['headers']
77
- );
78
- }
79
-
80
- if ( 'admin' === $notify || empty( $notify ) ) {
81
- return;
82
- }
83
-
84
- // Generate something random for a password reset key.
85
- $key = wp_generate_password( 20, false );
86
-
87
- /** This action is documented in wp-login.php */
88
- do_action( 'retrieve_password_key', $user->user_login, $key );
89
-
90
- // Now insert the key, hashed, into the DB.
91
- if ( empty( $wp_hasher ) ) {
92
- require_once ABSPATH . WPINC . '/class-phpass.php';
93
- $wp_hasher = new PasswordHash( 8, true );
94
- }
95
- $hashed = time() . ':' . $wp_hasher->HashPassword( $key );
96
-
97
- wp_update_user(
98
- array(
99
- 'ID' => $user->ID,
100
- 'user_activation_key' => $hashed,
101
- )
102
- );
103
-
104
- if ( $bnfw->notifier->notification_exists( 'new-user', false ) ) {
105
- $notifications = $bnfw->notifier->get_notifications( 'new-user' );
106
- $password_url = network_site_url( 'wp-login.php?action=rp&key=' . $key . '&login=' . rawurlencode( $user->user_login ), 'login' );
107
-
108
- foreach ( $notifications as $notification ) {
109
- $setting = $bnfw->notifier->read_settings( $notification->ID );
110
- $trigger_notification = apply_filters( 'bnfw_trigger_new-user_notification', true, $setting, $user );
111
-
112
- if ( $trigger_notification ) {
113
- $bnfw->engine->send_registration_email( $setting, $user, $password_url );
114
- }
115
- }
116
- } else {
117
- $message = sprintf( esc_html__( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
118
- $message .= esc_html__( 'To set your password, visit the following address:' ) . "\r\n\r\n";
119
- $message .= '<' . network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user->user_login ), 'login' ) . ">\r\n\r\n";
120
-
121
- $message .= wp_login_url() . "\r\n";
122
-
123
- wp_mail( $user->user_email, sprintf( esc_html__( '[%s] Your username and password info' ), $blogname ), $message );
124
- }
125
- } else {
126
-
127
- // for WordPress below 4.3
128
- $plaintext_pass = $deprecated;
129
-
130
- // The blogname option is escaped with esc_html on the way into the database in sanitize_option
131
- // we want to reverse this for the plain text arena of emails.
132
- $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
133
-
134
- if ( ! $bnfw->notifier->notification_exists( 'admin-user', false ) ) {
135
- $message = sprintf( esc_html__( 'New user registration on your site %s:' ), $blogname ) . "\r\n\r\n";
136
- $message .= sprintf( esc_html__( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
137
- $message .= sprintf( esc_html__( 'E-mail: %s' ), $user->user_email ) . "\r\n";
138
-
139
- @wp_mail( get_option( 'admin_email' ), sprintf( esc_html__( '[%s] New User Registration' ), $blogname ), $message );
140
- }
141
-
142
- if ( empty( $plaintext_pass ) ) {
143
- return;
144
- }
145
-
146
- if ( $bnfw->notifier->notification_exists( 'new-user', false ) ) {
147
- $notifications = $bnfw->notifier->get_notifications( 'new-user' );
148
- foreach ( $notifications as $notification ) {
149
- $bnfw->engine->send_registration_email( $bnfw->notifier->read_settings( $notification->ID ), $user, $plaintext_pass );
150
- }
151
- } else {
152
- $message = sprintf( esc_html__( 'Username: %s' ), $user->user_login ) . "\r\n";
153
- $message .= sprintf( esc_html__( 'Password: %s' ), $plaintext_pass ) . "\r\n";
154
- $message .= wp_login_url() . "\r\n";
155
-
156
- wp_mail( $user->user_email, sprintf( esc_html__( '[%s] Your username and password' ), $blogname ), $message );
157
- }
158
- }
159
- }
160
- }
161
-
162
- if ( ! function_exists( 'wp_password_change_notification' ) ) {
163
- /**
164
- * Notify the blog admin of a user changing password, normally via email.
165
- *
166
- * @param WP_User $user User object.
167
- */
168
- function wp_password_change_notification( $user ) {
169
- $bnfw = BNFW::factory();
170
-
171
- if ( $bnfw->notifier->notification_exists( 'admin-password-changed', false ) ) {
172
- $notifications = $bnfw->notifier->get_notifications( 'admin-password-changed' );
173
-
174
- if ( count( $notifications ) > 0 ) {
175
- // Ideally there should be only one notification for this type.
176
- // If there are multiple notification then we will read data about only the last one
177
- $bnfw->engine->send_notification( $bnfw->notifier->read_settings( end( $notifications )->ID ), $user->ID );
178
- }
179
- } else {
180
- // send a copy of password change notification to the admin
181
- // but check to see if it's the admin whose password we're changing, and skip this.
182
- if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) {
183
- /* translators: %s: user name */
184
- $message = sprintf( __( 'Password changed for user: %s' ), $user->user_login ) . "\r\n";
185
- // The blogname option is escaped with esc_html on the way into the database in sanitize_option
186
- // we want to reverse this for the plain text arena of emails.
187
- $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
188
- /* translators: %s: site title */
189
- wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] Password Changed' ), $blogname ), $message );
190
- }
191
- }
192
- }
193
- }
1
+ <?php
2
+ /**
3
+ * Override default WordPress emails
4
+ *
5
+ */
6
+
7
+ /**
8
+ * Email login credentials to a newly-registered user.
9
+ *
10
+ * A new user registration notification is also sent to admin email.
11
+ *
12
+ * @param int $user_id User ID.
13
+ * @param null $deprecated Not used (argument deprecated).
14
+ * @param string $notify Optional. Type of notification that should happen. Accepts 'admin' or an empty
15
+ * string (admin only), or 'both' (admin and user). The empty string value was kept
16
+ * for backward-compatibility purposes with the renamed parameter. Default empty.
17
+ */
18
+ if ( ! function_exists( 'wp_new_user_notification' ) ) {
19
+ function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' ) {
20
+ global $wp_version, $wp_hasher;
21
+
22
+ $bnfw = BNFW::factory();
23
+ $user = get_userdata( $user_id );
24
+
25
+ if ( version_compare( $wp_version, '4.3', '>=' ) ) {
26
+ // for WordPress 4.3 and above
27
+
28
+ if ( version_compare( $wp_version, '4.3', '=' ) ) {
29
+ $notify = $deprecated;
30
+ } else {
31
+ if ( $deprecated !== null ) {
32
+ _deprecated_argument( __FUNCTION__, '4.3.1' );
33
+ }
34
+ }
35
+
36
+ // The blogname option is escaped with esc_html on the way into the database in sanitize_option
37
+ // we want to reverse this for the plain text arena of emails.
38
+ $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
39
+
40
+ if ( ! $bnfw->notifier->notification_exists( 'admin-user', false ) ) {
41
+ $message = sprintf( esc_html__( 'New user registration on your site %s:' ), $blogname ) . "\r\n\r\n";
42
+ $message .= sprintf( esc_html__( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
43
+ $message .= sprintf( esc_html__( 'E-mail: %s' ), $user->user_email ) . "\r\n";
44
+
45
+ $wp_new_user_notification_email_admin = array(
46
+ 'to' => get_option( 'admin_email' ),
47
+ /* translators: Password change notification email subject. %s: Site title */
48
+ 'subject' => __( '[%s] New User Registration' ),
49
+ 'message' => $message,
50
+ 'headers' => '',
51
+ );
52
+
53
+ /**
54
+ * Filters the contents of the new user notification email sent to the site admin.
55
+ *
56
+ * @since 4.9.0
57
+ *
58
+ * @param array $wp_new_user_notification_email {
59
+ * Used to build wp_mail().
60
+ *
61
+ * @type string $to The intended recipient - site admin email address.
62
+ * @type string $subject The subject of the email.
63
+ * @type string $message The body of the email.
64
+ * @type string $headers The headers of the email.
65
+ * }
66
+ *
67
+ * @param WP_User $user User object for new user.
68
+ * @param string $blogname The site title.
69
+ */
70
+ $wp_new_user_notification_email_admin = apply_filters( 'wp_new_user_notification_email_admin', $wp_new_user_notification_email_admin, $user, $blogname );
71
+
72
+ @wp_mail(
73
+ $wp_new_user_notification_email_admin['to'],
74
+ wp_specialchars_decode( sprintf( $wp_new_user_notification_email_admin['subject'], $blogname ) ),
75
+ $wp_new_user_notification_email_admin['message'],
76
+ $wp_new_user_notification_email_admin['headers']
77
+ );
78
+ }
79
+
80
+ if ( 'admin' === $notify || empty( $notify ) ) {
81
+ return;
82
+ }
83
+
84
+ // Generate something random for a password reset key.
85
+ $key = wp_generate_password( 20, false );
86
+
87
+ /** This action is documented in wp-login.php */
88
+ do_action( 'retrieve_password_key', $user->user_login, $key );
89
+
90
+ // Now insert the key, hashed, into the DB.
91
+ if ( empty( $wp_hasher ) ) {
92
+ require_once ABSPATH . WPINC . '/class-phpass.php';
93
+ $wp_hasher = new PasswordHash( 8, true );
94
+ }
95
+ $hashed = time() . ':' . $wp_hasher->HashPassword( $key );
96
+
97
+ wp_update_user(
98
+ array(
99
+ 'ID' => $user->ID,
100
+ 'user_activation_key' => $hashed,
101
+ )
102
+ );
103
+
104
+ if ( $bnfw->notifier->notification_exists( 'new-user', false ) ) {
105
+ $notifications = $bnfw->notifier->get_notifications( 'new-user' );
106
+ $password_url = network_site_url( 'wp-login.php?action=rp&key=' . $key . '&login=' . rawurlencode( $user->user_login ), 'login' );
107
+
108
+ foreach ( $notifications as $notification ) {
109
+ $setting = $bnfw->notifier->read_settings( $notification->ID );
110
+ $trigger_notification = apply_filters( 'bnfw_trigger_new-user_notification', true, $setting, $user );
111
+
112
+ if ( $trigger_notification ) {
113
+ $bnfw->engine->send_registration_email( $setting, $user, $password_url );
114
+ }
115
+ }
116
+ } else {
117
+ $message = sprintf( esc_html__( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
118
+ $message .= esc_html__( 'To set your password, visit the following address:' ) . "\r\n\r\n";
119
+ $message .= '<' . network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user->user_login ), 'login' ) . ">\r\n\r\n";
120
+
121
+ $message .= wp_login_url() . "\r\n";
122
+
123
+ wp_mail( $user->user_email, sprintf( esc_html__( '[%s] Your username and password info' ), $blogname ), $message );
124
+ }
125
+ } else {
126
+
127
+ // for WordPress below 4.3
128
+ $plaintext_pass = $deprecated;
129
+
130
+ // The blogname option is escaped with esc_html on the way into the database in sanitize_option
131
+ // we want to reverse this for the plain text arena of emails.
132
+ $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
133
+
134
+ if ( ! $bnfw->notifier->notification_exists( 'admin-user', false ) ) {
135
+ $message = sprintf( esc_html__( 'New user registration on your site %s:' ), $blogname ) . "\r\n\r\n";
136
+ $message .= sprintf( esc_html__( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
137
+ $message .= sprintf( esc_html__( 'E-mail: %s' ), $user->user_email ) . "\r\n";
138
+
139
+ @wp_mail( get_option( 'admin_email' ), sprintf( esc_html__( '[%s] New User Registration' ), $blogname ), $message );
140
+ }
141
+
142
+ if ( empty( $plaintext_pass ) ) {
143
+ return;
144
+ }
145
+
146
+ if ( $bnfw->notifier->notification_exists( 'new-user', false ) ) {
147
+ $notifications = $bnfw->notifier->get_notifications( 'new-user' );
148
+ foreach ( $notifications as $notification ) {
149
+ $bnfw->engine->send_registration_email( $bnfw->notifier->read_settings( $notification->ID ), $user, $plaintext_pass );
150
+ }
151
+ } else {
152
+ $message = sprintf( esc_html__( 'Username: %s' ), $user->user_login ) . "\r\n";
153
+ $message .= sprintf( esc_html__( 'Password: %s' ), $plaintext_pass ) . "\r\n";
154
+ $message .= wp_login_url() . "\r\n";
155
+
156
+ wp_mail( $user->user_email, sprintf( esc_html__( '[%s] Your username and password' ), $blogname ), $message );
157
+ }
158
+ }
159
+ }
160
+ }
161
+
162
+ if ( ! function_exists( 'wp_password_change_notification' ) ) {
163
+ /**
164
+ * Notify the blog admin of a user changing password, normally via email.
165
+ *
166
+ * @param WP_User $user User object.
167
+ */
168
+ function wp_password_change_notification( $user ) {
169
+ $bnfw = BNFW::factory();
170
+
171
+ if ( $bnfw->notifier->notification_exists( 'admin-password-changed', false ) ) {
172
+ $notifications = $bnfw->notifier->get_notifications( 'admin-password-changed' );
173
+
174
+ if ( count( $notifications ) > 0 ) {
175
+ // Ideally there should be only one notification for this type.
176
+ // If there are multiple notification then we will read data about only the last one
177
+ $bnfw->engine->send_notification( $bnfw->notifier->read_settings( end( $notifications )->ID ), $user->ID );
178
+ }
179
+ } else {
180
+ // send a copy of password change notification to the admin
181
+ // but check to see if it's the admin whose password we're changing, and skip this.
182
+ if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) {
183
+ /* translators: %s: user name */
184
+ $message = sprintf( __( 'Password changed for user: %s' ), $user->user_login ) . "\r\n";
185
+ // The blogname option is escaped with esc_html on the way into the database in sanitize_option
186
+ // we want to reverse this for the plain text arena of emails.
187
+ $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
188
+ /* translators: %s: site title */
189
+ wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] Password Changed' ), $blogname ), $message );
190
+ }
191
+ }
192
+ }
193
+ }
languages/bnfw-de_DE.mo CHANGED
File without changes
languages/bnfw-de_DE.po CHANGED
@@ -1,1026 +1,1026 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Better Notifications for WP 1.3.3\n"
4
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/bnfw\n"
5
- "POT-Creation-Date: 2020-11-27 21:34+0800\n"
6
- "PO-Revision-Date: 2020-11-28 00:02+0800\n"
7
- "Last-Translator: Michael <michael.schroettle@tpm-systems.eu>\n"
8
- "Language-Team: \n"
9
- "Language: de\n"
10
- "MIME-Version: 1.0\n"
11
- "Content-Type: text/plain; charset=UTF-8\n"
12
- "Content-Transfer-Encoding: 8bit\n"
13
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
- "X-Poedit-SourceCharset: UTF-8\n"
15
- "X-Poedit-Basepath: .\n"
16
- "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
17
- "__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
18
- "_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
19
- "esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
20
- "esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
21
- "X-Loco-Target-Locale: de_DE\n"
22
- "X-Generator: Poedit 2.2\n"
23
- "X-Poedit-SearchPath-0: ../../plugins/bnfw\n"
24
-
25
- #: bnfw.php:283 includes/admin/bnfw-settings.php:15
26
- msgid "Settings"
27
- msgstr "Einstellungen"
28
-
29
- #: includes/admin/bnfw-settings.php:14
30
- #: includes/admin/class-bnfw-notification.php:129
31
- msgid "Notification Settings"
32
- msgstr "Benachrichtigungs-Einstellungen"
33
-
34
- #: includes/admin/bnfw-settings.php:38
35
- msgid "BNFW Settings"
36
- msgstr "BNFW Einstellungen"
37
-
38
- #: includes/admin/bnfw-settings.php:46
39
- msgid "Save Settings"
40
- msgstr "Einstellungen speichern"
41
-
42
- #: includes/admin/bnfw-settings.php:73
43
- msgid "Documentation"
44
- msgstr ""
45
-
46
- #: includes/admin/bnfw-settings.php:80
47
- msgid "Premium Add-ons"
48
- msgstr ""
49
-
50
- #: includes/admin/bnfw-settings.php:87
51
- msgid "Priority Support"
52
- msgstr ""
53
-
54
- #: includes/admin/bnfw-settings.php:150
55
- msgid "Suppress SPAM comment notification"
56
- msgstr "SPAM Kommentar Benachrichtigung unterdrücken"
57
-
58
- #: includes/admin/bnfw-settings.php:150
59
- msgid ""
60
- "Comments that are correctly marked as SPAM by a 3rd party plugin (such as "
61
- "Akismet) will not generate a notification if this is ticked."
62
- msgstr ""
63
-
64
- #: includes/admin/bnfw-settings.php:155
65
- msgid "Don't send notifications for comments marked as SPAM"
66
- msgstr ""
67
- "Senden Sie keine Benachrichtigungen für Kommentare, die als SPAM "
68
- "gekennzeichnet sind"
69
-
70
- #: includes/admin/bnfw-settings.php:167
71
- msgid "Default Email Format"
72
- msgstr "Voreingestelltes Email-Format"
73
-
74
- #: includes/admin/bnfw-settings.php:167
75
- msgid ""
76
- "This will apply to all emails sent out via WordPress, even those from other "
77
- "plugins. For more details, please see the "
78
- msgstr ""
79
- "Dies gilt für alle E-Mails, die über WordPress gesendet werden, auch für E-"
80
- "Mails von anderen Plugins. Weitere Details finden Sie in der"
81
-
82
- #: includes/admin/bnfw-settings.php:181
83
- msgid "Enable Content Shortcodes?"
84
- msgstr ""
85
-
86
- #: includes/admin/bnfw-settings.php:181
87
- msgid "Shortcodes in the post/page content are disabled by default."
88
- msgstr ""
89
-
90
- #: includes/admin/bnfw-settings.php:186
91
- msgid "Enable shortcode output in the page/post content"
92
- msgstr ""
93
-
94
- #: includes/admin/bnfw-settings.php:198
95
- msgid "Allow Usage Tracking?"
96
- msgstr ""
97
-
98
- #: includes/admin/bnfw-settings.php:203
99
- msgid ""
100
- "Allow Better Notifications for WP to anonymously track how this plugin is "
101
- "used and help make the plugin better."
102
- msgstr ""
103
-
104
- #: includes/admin/bnfw-settings.php:251
105
- #: includes/admin/class-bnfw-notification.php:433
106
- msgid "HTML Formatting"
107
- msgstr "HTML Formatierung"
108
-
109
- #: includes/admin/bnfw-settings.php:256
110
- #: includes/admin/class-bnfw-notification.php:439
111
- msgid "Plain Text"
112
- msgstr "Nur Text"
113
-
114
- #: includes/admin/class-bnfw-notification.php:52
115
- #: includes/admin/class-bnfw-notification.php:55
116
- #: includes/admin/class-bnfw-notification.php:56
117
- msgid "Notifications"
118
- msgstr "Notifications"
119
-
120
- #: includes/admin/class-bnfw-notification.php:53
121
- msgid "Notification"
122
- msgstr "Benachrichtigung"
123
-
124
- #: includes/admin/class-bnfw-notification.php:54
125
- msgid "Add New"
126
- msgstr "Neue erstellen"
127
-
128
- #: includes/admin/class-bnfw-notification.php:57
129
- msgid "Add New Notification"
130
- msgstr "Neue Benachrichtigung erstellen"
131
-
132
- #: includes/admin/class-bnfw-notification.php:58
133
- msgid "Edit Notification"
134
- msgstr "Benachrichtigung bearbeiten"
135
-
136
- #: includes/admin/class-bnfw-notification.php:59
137
- msgid "New Notification"
138
- msgstr "Neue Benachrichtigung"
139
-
140
- #: includes/admin/class-bnfw-notification.php:60
141
- msgid "View Notification"
142
- msgstr "Benachrichtigung anzeigen"
143
-
144
- #: includes/admin/class-bnfw-notification.php:61
145
- msgid "Search Notifications"
146
- msgstr "Benachrichtung suchen"
147
-
148
- #: includes/admin/class-bnfw-notification.php:62
149
- msgid "No Notifications found"
150
- msgstr "Keine Benachrichtigung gefunden"
151
-
152
- #: includes/admin/class-bnfw-notification.php:63
153
- msgid "No Notifications found in trash"
154
- msgstr "Keine Benachrichtigung im Papierkorb gefunden"
155
-
156
- #: includes/admin/class-bnfw-notification.php:64
157
- msgid "All Notifications"
158
- msgstr "Alle Benachrichtigungen"
159
-
160
- #: includes/admin/class-bnfw-notification.php:138
161
- msgid "Save Notification"
162
- msgstr "Benachrichtigung speichern"
163
-
164
- #: includes/admin/class-bnfw-notification.php:186
165
- msgid "Notification For"
166
- msgstr "Benachrichtigung für"
167
-
168
- #: includes/admin/class-bnfw-notification.php:187
169
- msgid ""
170
- "E.g. If you select \"New Post Published\" from the list on the right, this "
171
- "notification will be sent when a new post is published."
172
- msgstr ""
173
-
174
- #: includes/admin/class-bnfw-notification.php:191
175
- msgid "Select the notification type"
176
- msgstr "Wählen Sie den Benachrichtigungstyp"
177
-
178
- #: includes/admin/class-bnfw-notification.php:192
179
- msgid "Admin"
180
- msgstr ""
181
-
182
- #: includes/admin/class-bnfw-notification.php:194
183
- #: includes/admin/class-bnfw-notification.php:1302
184
- msgid "New User Registration - For Admin"
185
- msgstr "Neuen Benutzer Registrieren - für Admin"
186
-
187
- #: includes/admin/class-bnfw-notification.php:196
188
- #: includes/admin/class-bnfw-notification.php:1269
189
- msgid "User Lost Password - For Admin"
190
- msgstr "Benutzer Passwort verloren - Für Admin"
191
-
192
- #: includes/admin/class-bnfw-notification.php:198
193
- #: includes/admin/class-bnfw-notification.php:1272
194
- msgid "Password Changed - For Admin"
195
- msgstr "Passwort geändert - Für Admin"
196
-
197
- #: includes/admin/class-bnfw-notification.php:200
198
- #: includes/admin/class-bnfw-notification.php:1275
199
- msgid "User Email Changed - For Admin"
200
- msgstr "Benutzer-E-Mail geändert - Für Admin"
201
-
202
- #: includes/admin/class-bnfw-notification.php:202
203
- #: includes/admin/class-bnfw-notification.php:1308
204
- msgid "User Role Changed - For Admin"
205
- msgstr "Benutzerrolle geändert - Für Admin"
206
-
207
- #: includes/admin/class-bnfw-notification.php:204
208
- #: includes/admin/class-bnfw-notification.php:1296
209
- msgid "User Logged In - For Admin"
210
- msgstr "Benutzer angemeldet - Für Admin"
211
-
212
- #: includes/admin/class-bnfw-notification.php:206
213
- #: includes/admin/class-bnfw-notification.php:1287
214
- msgid "WordPress Core Automatic Background Updates"
215
- msgstr ""
216
-
217
- #: includes/admin/class-bnfw-notification.php:210
218
- #: includes/admin/class-bnfw-notification.php:1344
219
- msgid "Privacy - Confirm Action: Export Data Request - For Admin"
220
- msgstr ""
221
-
222
- #: includes/admin/class-bnfw-notification.php:214
223
- #: includes/admin/class-bnfw-notification.php:1347
224
- msgid "Privacy - Confirm Action: Erase Data Request - For Admin"
225
- msgstr ""
226
-
227
- #: includes/admin/class-bnfw-notification.php:222
228
- msgid "Transactional"
229
- msgstr ""
230
-
231
- #: includes/admin/class-bnfw-notification.php:224
232
- #: includes/admin/class-bnfw-notification.php:1290
233
- msgid "New User Registration - For User"
234
- msgstr "Neuen Benutzer registrieren - für Benutzer"
235
-
236
- #: includes/admin/class-bnfw-notification.php:226
237
- #: includes/admin/class-bnfw-notification.php:1299
238
- msgid "New User - Post-registration Email"
239
- msgstr "Neuer Benutzer - E-Mail nach der Registrierung"
240
-
241
- #: includes/admin/class-bnfw-notification.php:228
242
- #: includes/admin/class-bnfw-notification.php:1266
243
- msgid "User Lost Password - For User"
244
- msgstr "Benutzer Passwort verloren - Für Benutzer"
245
-
246
- #: includes/admin/class-bnfw-notification.php:230
247
- #: includes/admin/class-bnfw-notification.php:1278
248
- msgid "Password Changed - For User"
249
- msgstr "Passwort geändert - Für Benutzer"
250
-
251
- #: includes/admin/class-bnfw-notification.php:232
252
- #: includes/admin/class-bnfw-notification.php:1281
253
- msgid "User Email Changed Confirmation - For User"
254
- msgstr "Benutzer-E-Mail-Bestätigung geändert - Für Benutzer"
255
-
256
- #: includes/admin/class-bnfw-notification.php:235
257
- #: includes/admin/class-bnfw-notification.php:1284
258
- msgid "User Email Changed - For User"
259
- msgstr "Benutzer-E-Mail geändert - Für Benutzer"
260
-
261
- #: includes/admin/class-bnfw-notification.php:237
262
- #: includes/admin/class-bnfw-notification.php:1305
263
- msgid "User Role Changed - For User"
264
- msgstr "Benutzerrolle geändert - Für Benutzer"
265
-
266
- #: includes/admin/class-bnfw-notification.php:239
267
- #: includes/admin/class-bnfw-notification.php:1293
268
- msgid "User Logged In - For User"
269
- msgstr "Benutzer angemeldet - Für Benutzer"
270
-
271
- #: includes/admin/class-bnfw-notification.php:241
272
- #: includes/admin/class-bnfw-notification.php:375
273
- #: includes/admin/class-bnfw-notification.php:1263
274
- msgid "Comment Reply"
275
- msgstr "Antwort auf Kommentar"
276
-
277
- #: includes/admin/class-bnfw-notification.php:245
278
- msgid "Privacy - Confirm Action: Export Data Request - For User"
279
- msgstr ""
280
-
281
- #: includes/admin/class-bnfw-notification.php:249
282
- msgid "Privacy - Confirm Action: Erase Data Request - For User"
283
- msgstr ""
284
-
285
- #: includes/admin/class-bnfw-notification.php:253
286
- #: includes/admin/class-bnfw-notification.php:1350
287
- msgid "Privacy - Data Export - For User"
288
- msgstr ""
289
-
290
- #: includes/admin/class-bnfw-notification.php:257
291
- #: includes/admin/class-bnfw-notification.php:1353
292
- msgid "Privacy - Data Erased - For User"
293
- msgstr ""
294
-
295
- #: includes/admin/class-bnfw-notification.php:267
296
- #: includes/admin/class-bnfw-notification.php:1311
297
- msgid "New Post Published"
298
- msgstr "Neuer Beitrag veröffentlicht"
299
-
300
- #: includes/admin/class-bnfw-notification.php:269
301
- #: includes/admin/class-bnfw-notification.php:1314
302
- msgid "Post Updated"
303
- msgstr "Beitrag aktualisiert"
304
-
305
- #: includes/admin/class-bnfw-notification.php:271
306
- #: includes/admin/class-bnfw-notification.php:1317
307
- msgid "Post Pending Review"
308
- msgstr "Beitrag mit ausstehender Überprüfung"
309
-
310
- #: includes/admin/class-bnfw-notification.php:273
311
- #: includes/admin/class-bnfw-notification.php:1320
312
- msgid "New Private Post"
313
- msgstr ""
314
-
315
- #: includes/admin/class-bnfw-notification.php:275
316
- #: includes/admin/class-bnfw-notification.php:1323
317
- msgid "Post Scheduled"
318
- msgstr "geplanter Beitrag"
319
-
320
- #: includes/admin/class-bnfw-notification.php:277
321
- #: includes/admin/class-bnfw-notification.php:1326
322
- msgid "Published Post Moved to Trash"
323
- msgstr "Veröffentlichter Beitrag in den Papierkorb verschoben"
324
-
325
- #: includes/admin/class-bnfw-notification.php:279
326
- #: includes/admin/class-bnfw-notification.php:367
327
- #: includes/admin/class-bnfw-notification.php:1248
328
- msgid "New Comment"
329
- msgstr "Neuer Kommentar"
330
-
331
- #: includes/admin/class-bnfw-notification.php:282
332
- #: includes/admin/class-bnfw-notification.php:369
333
- #: includes/admin/class-bnfw-notification.php:1254
334
- #: includes/admin/class-bnfw-notification.php:1407
335
- msgid "New Comment Awaiting Moderation"
336
- msgstr "Neuer Kommentar wartet auf Moderation"
337
-
338
- #: includes/admin/class-bnfw-notification.php:285
339
- #: includes/admin/class-bnfw-notification.php:1251
340
- msgid "Post - Comment Approved"
341
- msgstr ""
342
-
343
- #: includes/admin/class-bnfw-notification.php:288
344
- #: includes/admin/class-bnfw-notification.php:1332
345
- msgid "New Category"
346
- msgstr "Neue Kategorie"
347
-
348
- #: includes/admin/class-bnfw-notification.php:290
349
- #: includes/admin/class-bnfw-notification.php:1335
350
- msgid "New Tag"
351
- msgstr "Neuer Tag"
352
-
353
- #: includes/admin/class-bnfw-notification.php:292
354
- #: includes/admin/class-bnfw-notification.php:1257
355
- msgid "New Trackback"
356
- msgstr "Neuer Trackback"
357
-
358
- #: includes/admin/class-bnfw-notification.php:294
359
- #: includes/admin/class-bnfw-notification.php:1260
360
- msgid "New Pingback"
361
- msgstr "Neuer Pingback"
362
-
363
- #: includes/admin/class-bnfw-notification.php:301
364
- #: includes/admin/class-bnfw-notification.php:1329
365
- msgid "New Page Published"
366
- msgstr "Neue Seite publiziert"
367
-
368
- #: includes/admin/class-bnfw-notification.php:303
369
- msgid "Page Updated"
370
- msgstr "Seite aktualisiert"
371
-
372
- #: includes/admin/class-bnfw-notification.php:305
373
- msgid "Page Pending Review"
374
- msgstr "Seite mit ausstehender Überprüfung"
375
-
376
- #: includes/admin/class-bnfw-notification.php:307
377
- msgid "New Private Page"
378
- msgstr ""
379
-
380
- #: includes/admin/class-bnfw-notification.php:309
381
- msgid "Page Scheduled"
382
- msgstr "geplante Seite"
383
-
384
- #: includes/admin/class-bnfw-notification.php:311
385
- msgid "Page - New Comment"
386
- msgstr "Seite - neuer Kommentar"
387
-
388
- #: includes/admin/class-bnfw-notification.php:313
389
- msgid "Page - New Comment Awaiting Moderation"
390
- msgstr "Seite - Neuer Kommentar wartet auf Moderation"
391
-
392
- #: includes/admin/class-bnfw-notification.php:316
393
- #: includes/admin/class-bnfw-notification.php:1365
394
- msgid "Page - Comment Approved"
395
- msgstr "Seite - Kommentar genehmigt"
396
-
397
- #: includes/admin/class-bnfw-notification.php:319
398
- msgid "Page - Comment Reply"
399
- msgstr "Seite - Kommentar Antworten"
400
-
401
- #: includes/admin/class-bnfw-notification.php:326
402
- #: includes/admin/class-bnfw-notification.php:1356
403
- msgid "New Media Published"
404
- msgstr "Neue Medien veröffentlicht"
405
-
406
- #: includes/admin/class-bnfw-notification.php:328
407
- #: includes/admin/class-bnfw-notification.php:1359
408
- msgid "Media Updated"
409
- msgstr "Medien aktualisiert"
410
-
411
- #: includes/admin/class-bnfw-notification.php:330
412
- #: includes/admin/class-bnfw-notification.php:1362
413
- msgid "Media - New Comment"
414
- msgstr "Medien - Neuer Kommentar"
415
-
416
- #: includes/admin/class-bnfw-notification.php:332
417
- #: includes/admin/class-bnfw-notification.php:1368
418
- msgid "Media - Comment Approved"
419
- msgstr ""
420
-
421
- #: includes/admin/class-bnfw-notification.php:335
422
- #: includes/admin/class-bnfw-notification.php:1371
423
- msgid "Media - New Comment Awaiting Moderation"
424
- msgstr "Medien - Neuer Kommentar wartet auf Moderation"
425
-
426
- #: includes/admin/class-bnfw-notification.php:337
427
- #: includes/admin/class-bnfw-notification.php:1374
428
- msgid "Media - Comment Reply"
429
- msgstr "Medien - Kommentar Antworten"
430
-
431
- #: includes/admin/class-bnfw-notification.php:355
432
- msgid "Custom Post Type"
433
- msgstr "Benutzerdefinierter Beitrags-Typ"
434
-
435
- #: includes/admin/class-bnfw-notification.php:357
436
- #: includes/admin/class-bnfw-notification.php:1389
437
- msgid "New "
438
- msgstr "Neu"
439
-
440
- #: includes/admin/class-bnfw-notification.php:357
441
- msgid " Published"
442
- msgstr "Veröffentlicht"
443
-
444
- #: includes/admin/class-bnfw-notification.php:359
445
- msgid "Updated"
446
- msgstr "Aktualisiert"
447
-
448
- #: includes/admin/class-bnfw-notification.php:361
449
- msgid "Pending Review"
450
- msgstr "Überprüfung ausstehend"
451
-
452
- #: includes/admin/class-bnfw-notification.php:363
453
- #: includes/admin/class-bnfw-notification.php:1401
454
- msgid "New Private "
455
- msgstr ""
456
-
457
- #: includes/admin/class-bnfw-notification.php:365
458
- msgid "Scheduled"
459
- msgstr "Geplant"
460
-
461
- #: includes/admin/class-bnfw-notification.php:372
462
- msgid "Comment Approved"
463
- msgstr "Kommentar genehmigt"
464
-
465
- #: includes/admin/class-bnfw-notification.php:394
466
- msgid "Custom Taxonomy"
467
- msgstr "Benutzerdefinierte Taxonomie"
468
-
469
- #: includes/admin/class-bnfw-notification.php:400
470
- msgid "New"
471
- msgstr "Neu"
472
-
473
- #: includes/admin/class-bnfw-notification.php:419
474
- msgid ""
475
- "This notification doesn't support additional email fields due to a "
476
- "limitation in WordPress."
477
- msgstr ""
478
- "Diese Benachrichtigung unterstützt keine zusätzlichen E-Mail-Felder aufgrund "
479
- "einer Einschränkung in WordPress."
480
-
481
- #: includes/admin/class-bnfw-notification.php:426
482
- msgid "Email Formatting"
483
- msgstr "Email-Format"
484
-
485
- #: includes/admin/class-bnfw-notification.php:427
486
- msgid ""
487
- "How do you want to format the sent email? HTML is recommended as it'll show "
488
- "images and links correctly."
489
- msgstr ""
490
-
491
- #: includes/admin/class-bnfw-notification.php:448
492
- msgid "Additional Email Fields"
493
- msgstr "Zusätzliche Email-Felder"
494
-
495
- #: includes/admin/class-bnfw-notification.php:449
496
- msgid ""
497
- "This should be fairly self explanatory but if you're unsure, tick this "
498
- "checkbox and have a look at the available options. You can always untick it "
499
- "again should you decide you don't need to use it."
500
- msgstr ""
501
-
502
- #: includes/admin/class-bnfw-notification.php:454
503
- msgid "Set \"From\" Name & Email, Reply To, CC, BCC"
504
- msgstr ""
505
-
506
- #: includes/admin/class-bnfw-notification.php:461
507
- msgid "From Name and Email"
508
- msgstr "Absendername und Email"
509
-
510
- #: includes/admin/class-bnfw-notification.php:462
511
- msgid ""
512
- "If you want to send the email from your site name and email address instead "
513
- "of the default \"WordPress\" from \"wordpress@domain.com\", this is where "
514
- "you can do it."
515
- msgstr ""
516
-
517
- #: includes/admin/class-bnfw-notification.php:466
518
- msgid "Site Name"
519
- msgstr ""
520
-
521
- #: includes/admin/class-bnfw-notification.php:468
522
- msgid "Site Email"
523
- msgstr ""
524
-
525
- #: includes/admin/class-bnfw-notification.php:475
526
- msgid "Reply To"
527
- msgstr ""
528
-
529
- #: includes/admin/class-bnfw-notification.php:476
530
- msgid ""
531
- "If you want any replies to your email notification to go to another person, "
532
- "fill in this box with their name and email address."
533
- msgstr ""
534
-
535
- #: includes/admin/class-bnfw-notification.php:480
536
- msgid "Name"
537
- msgstr ""
538
-
539
- #: includes/admin/class-bnfw-notification.php:482
540
- msgid "Email"
541
- msgstr "Email"
542
-
543
- #: includes/admin/class-bnfw-notification.php:488
544
- msgid "CC"
545
- msgstr "CC"
546
-
547
- #: includes/admin/class-bnfw-notification.php:489
548
- msgid "Publicly copy in any other users or user roles to this email."
549
- msgstr ""
550
-
551
- #: includes/admin/class-bnfw-notification.php:494
552
- #: includes/admin/class-bnfw-notification.php:508
553
- #: includes/admin/class-bnfw-notification.php:557
554
- #: includes/admin/class-bnfw-notification.php:575
555
- msgid "Select User Roles / Users"
556
- msgstr "Wählen Sie Benutzerrollen / Benutzer"
557
-
558
- #: includes/admin/class-bnfw-notification.php:502
559
- msgid "BCC"
560
- msgstr "BCC"
561
-
562
- #: includes/admin/class-bnfw-notification.php:503
563
- msgid "Privately copy in any other users or user roles to this email."
564
- msgstr ""
565
-
566
- #: includes/admin/class-bnfw-notification.php:518
567
- msgid "Send to Author"
568
- msgstr ""
569
-
570
- #: includes/admin/class-bnfw-notification.php:519
571
- msgid ""
572
- "E.g. If you want a new post published notification to go to the post author, "
573
- "tick this box."
574
- msgstr ""
575
-
576
- #: includes/admin/class-bnfw-notification.php:526
577
- msgid "Send this notification to the Author"
578
- msgstr "Senden Sie diese Benachrichtigung an den Autor"
579
-
580
- #: includes/admin/class-bnfw-notification.php:536
581
- msgid ""
582
- "E.g. If you're an editor and regularly update your posts, you might not want "
583
- "to be emailed about this all the time. Ticking this box will prevent you "
584
- "from receiving emails about your own changes."
585
- msgstr ""
586
-
587
- #: includes/admin/class-bnfw-notification.php:542
588
- msgid "Do not send this Notification to the User that triggered it"
589
- msgstr ""
590
- "Senden Sie diese Benachrichtigung nicht an den Benutzer, der sie ausgelöst "
591
- "hat"
592
-
593
- #: includes/admin/class-bnfw-notification.php:551
594
- msgid "Send To"
595
- msgstr "Sende an"
596
-
597
- #: includes/admin/class-bnfw-notification.php:552
598
- msgid "Choose the users and/or user roles to send this email notification to."
599
- msgstr ""
600
-
601
- #: includes/admin/class-bnfw-notification.php:565
602
- msgid "Except For"
603
- msgstr ""
604
-
605
- #: includes/admin/class-bnfw-notification.php:568
606
- msgid ""
607
- "Choose the users and/or user roles that this notification should not be sent "
608
- "to."
609
- msgstr ""
610
-
611
- #: includes/admin/class-bnfw-notification.php:593
612
- msgid ""
613
- "You have chosen to send this notification to over 200 users. Please check "
614
- "the email sending rate limit at your host before sending."
615
- msgstr ""
616
-
617
- #: includes/admin/class-bnfw-notification.php:603
618
- #: includes/admin/class-bnfw-notification.php:1129
619
- msgid "Subject"
620
- msgstr "Betreff"
621
-
622
- #: includes/admin/class-bnfw-notification.php:604
623
- msgid "Notification subject. You can use "
624
- msgstr "Benachrichtigungsgegenstand. Sie können verwenden"
625
-
626
- #: includes/admin/class-bnfw-notification.php:604
627
- #: includes/admin/class-bnfw-notification.php:618
628
- msgid " here."
629
- msgstr ""
630
-
631
- #: includes/admin/class-bnfw-notification.php:617
632
- msgid "Message Body"
633
- msgstr "Nachrichten-Text"
634
-
635
- #: includes/admin/class-bnfw-notification.php:618
636
- msgid "Notification message. You can use "
637
- msgstr "Benachrichtigungsgegenstand. Sie können verwenden"
638
-
639
- #: includes/admin/class-bnfw-notification.php:626
640
- msgid "Need some more help?"
641
- msgstr ""
642
-
643
- #: includes/admin/class-bnfw-notification.php:636
644
- msgid "Insert Default Content"
645
- msgstr "Standardinhalt einfügen"
646
-
647
- #: includes/admin/class-bnfw-notification.php:640
648
- msgid "Read Documentation"
649
- msgstr ""
650
-
651
- #: includes/admin/class-bnfw-notification.php:644
652
- msgid "Find Shortcodes"
653
- msgstr ""
654
-
655
- #: includes/admin/class-bnfw-notification.php:655
656
- msgid ""
657
- "Stop additional paragraph and line break HTML from being inserted into my "
658
- "notifications"
659
- msgstr ""
660
-
661
- #: includes/admin/class-bnfw-notification.php:710
662
- msgid ""
663
- "You must choose at least one User or User Role to send the notification to "
664
- "before you can save"
665
- msgstr ""
666
-
667
- #: includes/admin/class-bnfw-notification.php:825
668
- msgid "Test Notification Sent."
669
- msgstr "Test Benachrichtigung gesendet"
670
-
671
- #: includes/admin/class-bnfw-notification.php:915
672
- msgid "Notification saved."
673
- msgstr "Benachrichtigung gespeichert"
674
-
675
- #: includes/admin/class-bnfw-notification.php:934
676
- #: includes/admin/class-bnfw-notification.php:992
677
- #: includes/admin/class-bnfw-notification.php:994
678
- msgid "Save"
679
- msgstr "Speichern"
680
-
681
- #: includes/admin/class-bnfw-notification.php:942
682
- msgid ""
683
- "Use this to enable or disable notifications. If you want to disable a "
684
- "default WordPress notification, just create it on the left, then disable it "
685
- "here."
686
- msgstr ""
687
-
688
- #: includes/admin/class-bnfw-notification.php:949
689
- msgid "Notification Enabled"
690
- msgstr "Benachrichtigung aktiviert"
691
-
692
- #: includes/admin/class-bnfw-notification.php:956
693
- msgid "Notification Disabled"
694
- msgstr "Benachrichtigung deaktiviert"
695
-
696
- #: includes/admin/class-bnfw-notification.php:967
697
- msgid "Send Me a Test Email"
698
- msgstr "Sende mir eine Test Email"
699
-
700
- #: includes/admin/class-bnfw-notification.php:969
701
- msgid ""
702
- "This will send you (the currently logged in user) a notification so that you "
703
- "can check for any issues with formatting – it’s doesn't mean that a "
704
- "notification will send correctly in the future. You can read about how to "
705
- "improve email delivery"
706
- msgstr ""
707
-
708
- #: includes/admin/class-bnfw-notification.php:969
709
- msgid "here"
710
- msgstr ""
711
-
712
- #: includes/admin/class-bnfw-notification.php:969
713
- msgid ". Shortcodes will not be replaced with content."
714
- msgstr ""
715
-
716
- #: includes/admin/class-bnfw-notification.php:980
717
- msgid "Delete Permanently"
718
- msgstr "Dauerhaft löschen"
719
-
720
- #: includes/admin/class-bnfw-notification.php:982
721
- msgid "Move to Trash"
722
- msgstr "In den Papierkorb"
723
-
724
- #: includes/admin/class-bnfw-notification.php:1127
725
- msgid "Notification Type"
726
- msgstr "Benachrichtigungs Type"
727
-
728
- #: includes/admin/class-bnfw-notification.php:1128
729
- msgid "Enabled?"
730
- msgstr "Aktiviert?"
731
-
732
- #: includes/admin/class-bnfw-notification.php:1130
733
- msgid "User Roles / Users"
734
- msgstr "Rolle / Benutzer"
735
-
736
- #: includes/admin/class-bnfw-notification.php:1131
737
- msgid "Excluded User Roles / Users"
738
- msgstr "Ausgeschlossene Benutzerrollen / Benutzer"
739
-
740
- #: includes/admin/class-bnfw-notification.php:1172
741
- msgid ", Post Author"
742
- msgstr ""
743
-
744
- #: includes/admin/class-bnfw-notification.php:1338
745
- msgid "Privacy – Confirm Action: Export Data Request – For User"
746
- msgstr ""
747
-
748
- #: includes/admin/class-bnfw-notification.php:1341
749
- msgid "Privacy – Confirm Action: Erase Data Request – For User"
750
- msgstr ""
751
-
752
- #: includes/admin/class-bnfw-notification.php:1389
753
- msgid "Published"
754
- msgstr "Veröffentlicht"
755
-
756
- #: includes/admin/class-bnfw-notification.php:1392
757
- msgid "Updated "
758
- msgstr "Aktualisiert"
759
-
760
- #: includes/admin/class-bnfw-notification.php:1395
761
- msgid " Pending Review"
762
- msgstr "Überprüfung ausstehend"
763
-
764
- #: includes/admin/class-bnfw-notification.php:1398
765
- msgid " Scheduled"
766
- msgstr "Geplant"
767
-
768
- #: includes/admin/class-bnfw-notification.php:1404
769
- msgid " Comment"
770
- msgstr "Kommentar"
771
-
772
- #: includes/admin/class-bnfw-notification.php:1410
773
- msgid " Comment Reply"
774
- msgstr "Kommentar Antworten"
775
-
776
- #: includes/admin/class-bnfw-notification.php:1413
777
- msgid " Comment Approved"
778
- msgstr "Kommentar genehmigt"
779
-
780
- #: includes/admin/class-bnfw-notification.php:1418
781
- msgid "New Term"
782
- msgstr "Neuer Begriff"
783
-
784
- #: includes/admin/class-bnfw-notification.php:1420
785
- msgid "New Term in "
786
- msgstr "Neuer Begriff in"
787
-
788
- #: includes/admin/class-bnfw-notification.php:1440
789
- msgid "Enable Notifications"
790
- msgstr "Benachrichtigungen aktivieren"
791
-
792
- #: includes/admin/class-bnfw-notification.php:1441
793
- msgid "Disable Notifications"
794
- msgstr "Benachrichtigungen ausschalten"
795
-
796
- #: includes/admin/class-bnfw-notification.php:1502
797
- msgid "Enable Notification"
798
- msgstr "Aktiviere Benachrichtigungen"
799
-
800
- #: includes/admin/class-bnfw-notification.php:1510
801
- msgid "Disable Notification"
802
- msgstr "Benachrichtigung deaktiviert"
803
-
804
- #: includes/admin/class-bnfw-notification.php:1568
805
- msgid "Enabled 1 Notification."
806
- msgstr "Aktiviert 1 Benachrichtigung."
807
-
808
- #: includes/admin/class-bnfw-notification.php:1572
809
- msgid "Disabled 1 Notification."
810
- msgstr "Deaktiviert 1 Benachrichtigung."
811
-
812
- #: includes/admin/class-bnfw-notification.php:1578
813
- #, php-format
814
- msgid "Enabled %s Notification."
815
- msgid_plural "Enabled %s Notifications."
816
- msgstr[0] "%s Benachrichtigung aktiviert."
817
- msgstr[1] "%s Benachrichtigungen aktiviert."
818
-
819
- #: includes/admin/class-bnfw-notification.php:1588
820
- #, php-format
821
- msgid "Disabled %s Notification."
822
- msgid_plural "Disabled %s Notifications."
823
- msgstr[0] "%s Benachrichtigungen deaktiviert."
824
- msgstr[1] "%s Benachrichtigungen deaktiviert."
825
-
826
- #: includes/admin/class-bnfw-notification.php:1602
827
- msgid ""
828
- "If you send out notifications with BNFW but don't receive them, you may need "
829
- "to install an SMTP plugin to <a href=\"https://betternotificationsforwp.com/"
830
- "documentation/getting-started/how-to-improve-email-delivery/\" target="
831
- "\"_blank\">improve email deliverability</a>. I recommend using <a href="
832
- "\"https://wordpress.org/plugins/post-smtp/\" target=\"_blank\">Post SMTP</a> "
833
- "as it's easy to set-up or <a href=\"https://wordpress.org/plugins/email-log/"
834
- "\" target=\"_blank\">Email Log</a> to just log and view emails that are sent."
835
- msgstr ""
836
-
837
- #: includes/engine/class-bnfw-engine.php:18
838
- msgid "Test Email:"
839
- msgstr "Test-Email:"
840
-
841
- #: includes/engine/class-bnfw-engine.php:19
842
- msgid ""
843
- "This is a test email. All shortcodes below will show in place but not be "
844
- "replaced with content."
845
- msgstr ""
846
-
847
- #: includes/engine/class-bnfw-engine.php:1583
848
- msgid "Error: Download link is not available please contact support"
849
- msgstr ""
850
-
851
- #: includes/helpers/ajax-helpers.php:34 includes/helpers/helpers.php:38
852
- msgid "User Roles"
853
- msgstr "Benutzerregeln"
854
-
855
- #: includes/helpers/ajax-helpers.php:57 includes/helpers/helpers.php:59
856
- #: includes/helpers/helpers.php:64
857
- msgid "Users"
858
- msgstr ""
859
-
860
- #: includes/helpers/helpers.php:103
861
- msgid "Non WordPress Users"
862
- msgstr ""
863
-
864
- #: includes/import.php:69
865
- msgid " for "
866
- msgstr "für"
867
-
868
- #: includes/import.php:69
869
- msgid " (Auto Imported)"
870
- msgstr "(Auto-importiert)"
871
-
872
- #: includes/libraries/EDD_SL_Plugin_Updater.php:228
873
- #, php-format
874
- msgid ""
875
- "There is a new version of %1$s available. %2$sView version %3$s details%4$s."
876
- msgstr ""
877
-
878
- #: includes/libraries/EDD_SL_Plugin_Updater.php:236
879
- #, php-format
880
- msgid ""
881
- "There is a new version of %1$s available. %2$sView version %3$s details%4$s "
882
- "or %5$supdate now%6$s."
883
- msgstr ""
884
-
885
- #: includes/libraries/EDD_SL_Plugin_Updater.php:474
886
- msgid "You do not have permission to install plugin updates"
887
- msgstr ""
888
-
889
- #: includes/libraries/EDD_SL_Plugin_Updater.php:474
890
- msgid "Error"
891
- msgstr ""
892
-
893
- #: includes/license/class-bnfw-license-setting.php:18
894
- #: includes/license/class-bnfw-license-setting.php:19
895
- msgid "Add-on Licenses"
896
- msgstr ""
897
-
898
- #: includes/license/class-bnfw-license-setting.php:38
899
- msgid "BNFW Add-on Licenses"
900
- msgstr ""
901
-
902
- #: includes/license/class-bnfw-license-setting.php:47
903
- msgid "Save License"
904
- msgstr ""
905
-
906
- #: includes/license/class-bnfw-license-setting.php:55
907
- msgid ""
908
- "<br>You have no BNFW Premium Add-ons installed yet.<br>You can buy add-ons "
909
- "from the <a href=\""
910
- msgstr ""
911
-
912
- #: includes/license/class-bnfw-license-setting.php:130
913
- msgid "Deactivate License"
914
- msgstr ""
915
-
916
- #: includes/license/class-bnfw-license.php:140
917
- #, php-format
918
- msgid "%1$s License Key"
919
- msgstr ""
920
-
921
- #: includes/overrides.php:41 includes/overrides.php:135
922
- #, php-format
923
- msgid "New user registration on your site %s:"
924
- msgstr "Neue Benutzerregistrierung auf Ihrer Seite %s:"
925
-
926
- #: includes/overrides.php:42 includes/overrides.php:117
927
- #: includes/overrides.php:136 includes/overrides.php:152
928
- #, php-format
929
- msgid "Username: %s"
930
- msgstr "Benutzername: %s"
931
-
932
- #: includes/overrides.php:43 includes/overrides.php:137
933
- #, php-format
934
- msgid "E-mail: %s"
935
- msgstr "Email: %s"
936
-
937
- #. translators: Password change notification email subject. %s: Site title
938
- #: includes/overrides.php:48 includes/overrides.php:139
939
- #, php-format
940
- msgid "[%s] New User Registration"
941
- msgstr "[%s] Neue Benutzerregistrierung"
942
-
943
- #: includes/overrides.php:118
944
- msgid "To set your password, visit the following address:"
945
- msgstr ""
946
-
947
- #: includes/overrides.php:123
948
- #, php-format
949
- msgid "[%s] Your username and password info"
950
- msgstr "[%s] Ihr Benutzername und Passwort"
951
-
952
- #: includes/overrides.php:153
953
- #, php-format
954
- msgid "Password: %s"
955
- msgstr "Passwort: %s"
956
-
957
- #: includes/overrides.php:156
958
- #, php-format
959
- msgid "[%s] Your username and password"
960
- msgstr "[%s] Ihr Benutzername und Passwort"
961
-
962
- #. translators: %s: user name
963
- #: includes/overrides.php:184
964
- #, php-format
965
- msgid "Password changed for user: %s"
966
- msgstr "Passwort für Benutzer geändert:%s"
967
-
968
- #. translators: %s: site title
969
- #: includes/overrides.php:189
970
- #, php-format
971
- msgid "[%s] Password Changed"
972
- msgstr ""
973
-
974
- #. Plugin Name of the plugin/theme
975
- msgid "Better Notifications for WP"
976
- msgstr "Better Notifications for WP"
977
-
978
- #. Plugin URI of the plugin/theme
979
- #, fuzzy
980
- #| msgid "http://wordpress.org/plugins/bnfw/"
981
- msgid "https://wordpress.org/plugins/bnfw/"
982
- msgstr "http://wordpress.org/plugins/bnfw/"
983
-
984
- #. Description of the plugin/theme
985
- msgid ""
986
- "Supercharge your WordPress notifications using a WYSIWYG editor and "
987
- "shortcodes. Default and new notifications available. Add more power with Add-"
988
- "ons."
989
- msgstr ""
990
-
991
- #. Author of the plugin/theme
992
- msgid "Made with Fuel"
993
- msgstr "Made with Fuel"
994
-
995
- #. Author URI of the plugin/theme
996
- msgid "https://madewithfuel.com/"
997
- msgstr ""
998
-
999
- #~ msgid "New User - Welcome Email"
1000
- #~ msgstr "Neuer Benutzer - Willkommens Email"
1001
-
1002
- #~ msgid "Update "
1003
- #~ msgstr "Aktualisieren"
1004
-
1005
- #~ msgid "Show additional email fields"
1006
- #~ msgstr "Zeige zusätzliche Email-Felder"
1007
-
1008
- #~ msgid ""
1009
- #~ "Looking for help with shortcodes? Click here to see which ones you can "
1010
- #~ "use with the selected notification."
1011
- #~ msgstr ""
1012
- #~ "Hilfe mit Shortcodes benötigt? Klick hier zum Anzeigen, welche für die "
1013
- #~ "gewählte Benachrichtigung verfügbar sind."
1014
-
1015
- #~ msgid "New User - Welcome email"
1016
- #~ msgstr "Neuer Benutzer - Willkommens-Email"
1017
-
1018
- #~ msgid ""
1019
- #~ "Send customisable HTML emails to your users for different WordPress "
1020
- #~ "notifications."
1021
- #~ msgstr ""
1022
- #~ "Anpassbare HTML Emails für die verschiedensten WordPress Mitteilungen an "
1023
- #~ "Ihre Benutzer versenden."
1024
-
1025
- #~ msgid "https://betternotificationsforwp.com/"
1026
- #~ msgstr "https://betternotificationsforwp.com/"
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Better Notifications for WP 1.3.3\n"
4
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/bnfw\n"
5
+ "POT-Creation-Date: 2020-11-27 21:34+0800\n"
6
+ "PO-Revision-Date: 2020-11-28 00:02+0800\n"
7
+ "Last-Translator: Michael <michael.schroettle@tpm-systems.eu>\n"
8
+ "Language-Team: \n"
9
+ "Language: de\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
+ "X-Poedit-SourceCharset: UTF-8\n"
15
+ "X-Poedit-Basepath: .\n"
16
+ "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
17
+ "__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
18
+ "_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
19
+ "esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
20
+ "esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
21
+ "X-Loco-Target-Locale: de_DE\n"
22
+ "X-Generator: Poedit 2.2\n"
23
+ "X-Poedit-SearchPath-0: ../../plugins/bnfw\n"
24
+
25
+ #: bnfw.php:283 includes/admin/bnfw-settings.php:15
26
+ msgid "Settings"
27
+ msgstr "Einstellungen"
28
+
29
+ #: includes/admin/bnfw-settings.php:14
30
+ #: includes/admin/class-bnfw-notification.php:129
31
+ msgid "Notification Settings"
32
+ msgstr "Benachrichtigungs-Einstellungen"
33
+
34
+ #: includes/admin/bnfw-settings.php:38
35
+ msgid "BNFW Settings"
36
+ msgstr "BNFW Einstellungen"
37
+
38
+ #: includes/admin/bnfw-settings.php:46
39
+ msgid "Save Settings"
40
+ msgstr "Einstellungen speichern"
41
+
42
+ #: includes/admin/bnfw-settings.php:73
43
+ msgid "Documentation"
44
+ msgstr ""
45
+
46
+ #: includes/admin/bnfw-settings.php:80
47
+ msgid "Premium Add-ons"
48
+ msgstr ""
49
+
50
+ #: includes/admin/bnfw-settings.php:87
51
+ msgid "Priority Support"
52
+ msgstr ""
53
+
54
+ #: includes/admin/bnfw-settings.php:150
55
+ msgid "Suppress SPAM comment notification"
56
+ msgstr "SPAM Kommentar Benachrichtigung unterdrücken"
57
+
58
+ #: includes/admin/bnfw-settings.php:150
59
+ msgid ""
60
+ "Comments that are correctly marked as SPAM by a 3rd party plugin (such as "
61
+ "Akismet) will not generate a notification if this is ticked."
62
+ msgstr ""
63
+
64
+ #: includes/admin/bnfw-settings.php:155
65
+ msgid "Don't send notifications for comments marked as SPAM"
66
+ msgstr ""
67
+ "Senden Sie keine Benachrichtigungen für Kommentare, die als SPAM "
68
+ "gekennzeichnet sind"
69
+
70
+ #: includes/admin/bnfw-settings.php:167
71
+ msgid "Default Email Format"
72
+ msgstr "Voreingestelltes Email-Format"
73
+
74
+ #: includes/admin/bnfw-settings.php:167
75
+ msgid ""
76
+ "This will apply to all emails sent out via WordPress, even those from other "
77
+ "plugins. For more details, please see the "
78
+ msgstr ""
79
+ "Dies gilt für alle E-Mails, die über WordPress gesendet werden, auch für E-"
80
+ "Mails von anderen Plugins. Weitere Details finden Sie in der"
81
+
82
+ #: includes/admin/bnfw-settings.php:181
83
+ msgid "Enable Content Shortcodes?"
84
+ msgstr ""
85
+
86
+ #: includes/admin/bnfw-settings.php:181
87
+ msgid "Shortcodes in the post/page content are disabled by default."
88
+ msgstr ""
89
+
90
+ #: includes/admin/bnfw-settings.php:186
91
+ msgid "Enable shortcode output in the page/post content"
92
+ msgstr ""
93
+
94
+ #: includes/admin/bnfw-settings.php:198
95
+ msgid "Allow Usage Tracking?"
96
+ msgstr ""
97
+
98
+ #: includes/admin/bnfw-settings.php:203
99
+ msgid ""
100
+ "Allow Better Notifications for WP to anonymously track how this plugin is "
101
+ "used and help make the plugin better."
102
+ msgstr ""
103
+
104
+ #: includes/admin/bnfw-settings.php:251
105
+ #: includes/admin/class-bnfw-notification.php:433
106
+ msgid "HTML Formatting"
107
+ msgstr "HTML Formatierung"
108
+
109
+ #: includes/admin/bnfw-settings.php:256
110
+ #: includes/admin/class-bnfw-notification.php:439
111
+ msgid "Plain Text"
112
+ msgstr "Nur Text"
113
+
114
+ #: includes/admin/class-bnfw-notification.php:52
115
+ #: includes/admin/class-bnfw-notification.php:55
116
+ #: includes/admin/class-bnfw-notification.php:56
117
+ msgid "Notifications"
118
+ msgstr "Notifications"
119
+
120
+ #: includes/admin/class-bnfw-notification.php:53
121
+ msgid "Notification"
122
+ msgstr "Benachrichtigung"
123
+
124
+ #: includes/admin/class-bnfw-notification.php:54
125
+ msgid "Add New"
126
+ msgstr "Neue erstellen"
127
+
128
+ #: includes/admin/class-bnfw-notification.php:57
129
+ msgid "Add New Notification"
130
+ msgstr "Neue Benachrichtigung erstellen"
131
+
132
+ #: includes/admin/class-bnfw-notification.php:58
133
+ msgid "Edit Notification"
134
+ msgstr "Benachrichtigung bearbeiten"
135
+
136
+ #: includes/admin/class-bnfw-notification.php:59
137
+ msgid "New Notification"
138
+ msgstr "Neue Benachrichtigung"
139
+
140
+ #: includes/admin/class-bnfw-notification.php:60
141
+ msgid "View Notification"
142
+ msgstr "Benachrichtigung anzeigen"
143
+
144
+ #: includes/admin/class-bnfw-notification.php:61
145
+ msgid "Search Notifications"
146
+ msgstr "Benachrichtung suchen"
147
+
148
+ #: includes/admin/class-bnfw-notification.php:62
149
+ msgid "No Notifications found"
150
+ msgstr "Keine Benachrichtigung gefunden"
151
+
152
+ #: includes/admin/class-bnfw-notification.php:63
153
+ msgid "No Notifications found in trash"
154
+ msgstr "Keine Benachrichtigung im Papierkorb gefunden"
155
+
156
+ #: includes/admin/class-bnfw-notification.php:64
157
+ msgid "All Notifications"
158
+ msgstr "Alle Benachrichtigungen"
159
+
160
+ #: includes/admin/class-bnfw-notification.php:138
161
+ msgid "Save Notification"
162
+ msgstr "Benachrichtigung speichern"
163
+
164
+ #: includes/admin/class-bnfw-notification.php:186
165
+ msgid "Notification For"
166
+ msgstr "Benachrichtigung für"
167
+
168
+ #: includes/admin/class-bnfw-notification.php:187
169
+ msgid ""
170
+ "E.g. If you select \"New Post Published\" from the list on the right, this "
171
+ "notification will be sent when a new post is published."
172
+ msgstr ""
173
+
174
+ #: includes/admin/class-bnfw-notification.php:191
175
+ msgid "Select the notification type"
176
+ msgstr "Wählen Sie den Benachrichtigungstyp"
177
+
178
+ #: includes/admin/class-bnfw-notification.php:192
179
+ msgid "Admin"
180
+ msgstr ""
181
+
182
+ #: includes/admin/class-bnfw-notification.php:194
183
+ #: includes/admin/class-bnfw-notification.php:1302
184
+ msgid "New User Registration - For Admin"
185
+ msgstr "Neuen Benutzer Registrieren - für Admin"
186
+
187
+ #: includes/admin/class-bnfw-notification.php:196
188
+ #: includes/admin/class-bnfw-notification.php:1269
189
+ msgid "User Lost Password - For Admin"
190
+ msgstr "Benutzer Passwort verloren - Für Admin"
191
+
192
+ #: includes/admin/class-bnfw-notification.php:198
193
+ #: includes/admin/class-bnfw-notification.php:1272
194
+ msgid "Password Changed - For Admin"
195
+ msgstr "Passwort geändert - Für Admin"
196
+
197
+ #: includes/admin/class-bnfw-notification.php:200
198
+ #: includes/admin/class-bnfw-notification.php:1275
199
+ msgid "User Email Changed - For Admin"
200
+ msgstr "Benutzer-E-Mail geändert - Für Admin"
201
+
202
+ #: includes/admin/class-bnfw-notification.php:202
203
+ #: includes/admin/class-bnfw-notification.php:1308
204
+ msgid "User Role Changed - For Admin"
205
+ msgstr "Benutzerrolle geändert - Für Admin"
206
+
207
+ #: includes/admin/class-bnfw-notification.php:204
208
+ #: includes/admin/class-bnfw-notification.php:1296
209
+ msgid "User Logged In - For Admin"
210
+ msgstr "Benutzer angemeldet - Für Admin"
211
+
212
+ #: includes/admin/class-bnfw-notification.php:206
213
+ #: includes/admin/class-bnfw-notification.php:1287
214
+ msgid "WordPress Core Automatic Background Updates"
215
+ msgstr ""
216
+
217
+ #: includes/admin/class-bnfw-notification.php:210
218
+ #: includes/admin/class-bnfw-notification.php:1344
219
+ msgid "Privacy - Confirm Action: Export Data Request - For Admin"
220
+ msgstr ""
221
+
222
+ #: includes/admin/class-bnfw-notification.php:214
223
+ #: includes/admin/class-bnfw-notification.php:1347
224
+ msgid "Privacy - Confirm Action: Erase Data Request - For Admin"
225
+ msgstr ""
226
+
227
+ #: includes/admin/class-bnfw-notification.php:222
228
+ msgid "Transactional"
229
+ msgstr ""
230
+
231
+ #: includes/admin/class-bnfw-notification.php:224
232
+ #: includes/admin/class-bnfw-notification.php:1290
233
+ msgid "New User Registration - For User"
234
+ msgstr "Neuen Benutzer registrieren - für Benutzer"
235
+
236
+ #: includes/admin/class-bnfw-notification.php:226
237
+ #: includes/admin/class-bnfw-notification.php:1299
238
+ msgid "New User - Post-registration Email"
239
+ msgstr "Neuer Benutzer - E-Mail nach der Registrierung"
240
+
241
+ #: includes/admin/class-bnfw-notification.php:228
242
+ #: includes/admin/class-bnfw-notification.php:1266
243
+ msgid "User Lost Password - For User"
244
+ msgstr "Benutzer Passwort verloren - Für Benutzer"
245
+
246
+ #: includes/admin/class-bnfw-notification.php:230
247
+ #: includes/admin/class-bnfw-notification.php:1278
248
+ msgid "Password Changed - For User"
249
+ msgstr "Passwort geändert - Für Benutzer"
250
+
251
+ #: includes/admin/class-bnfw-notification.php:232
252
+ #: includes/admin/class-bnfw-notification.php:1281
253
+ msgid "User Email Changed Confirmation - For User"
254
+ msgstr "Benutzer-E-Mail-Bestätigung geändert - Für Benutzer"
255
+
256
+ #: includes/admin/class-bnfw-notification.php:235
257
+ #: includes/admin/class-bnfw-notification.php:1284
258
+ msgid "User Email Changed - For User"
259
+ msgstr "Benutzer-E-Mail geändert - Für Benutzer"
260
+
261
+ #: includes/admin/class-bnfw-notification.php:237
262
+ #: includes/admin/class-bnfw-notification.php:1305
263
+ msgid "User Role Changed - For User"
264
+ msgstr "Benutzerrolle geändert - Für Benutzer"
265
+
266
+ #: includes/admin/class-bnfw-notification.php:239
267
+ #: includes/admin/class-bnfw-notification.php:1293
268
+ msgid "User Logged In - For User"
269
+ msgstr "Benutzer angemeldet - Für Benutzer"
270
+
271
+ #: includes/admin/class-bnfw-notification.php:241
272
+ #: includes/admin/class-bnfw-notification.php:375
273
+ #: includes/admin/class-bnfw-notification.php:1263
274
+ msgid "Comment Reply"
275
+ msgstr "Antwort auf Kommentar"
276
+
277
+ #: includes/admin/class-bnfw-notification.php:245
278
+ msgid "Privacy - Confirm Action: Export Data Request - For User"
279
+ msgstr ""
280
+
281
+ #: includes/admin/class-bnfw-notification.php:249
282
+ msgid "Privacy - Confirm Action: Erase Data Request - For User"
283
+ msgstr ""
284
+
285
+ #: includes/admin/class-bnfw-notification.php:253
286
+ #: includes/admin/class-bnfw-notification.php:1350
287
+ msgid "Privacy - Data Export - For User"
288
+ msgstr ""
289
+
290
+ #: includes/admin/class-bnfw-notification.php:257
291
+ #: includes/admin/class-bnfw-notification.php:1353
292
+ msgid "Privacy - Data Erased - For User"
293
+ msgstr ""
294
+
295
+ #: includes/admin/class-bnfw-notification.php:267
296
+ #: includes/admin/class-bnfw-notification.php:1311
297
+ msgid "New Post Published"
298
+ msgstr "Neuer Beitrag veröffentlicht"
299
+
300
+ #: includes/admin/class-bnfw-notification.php:269
301
+ #: includes/admin/class-bnfw-notification.php:1314
302
+ msgid "Post Updated"
303
+ msgstr "Beitrag aktualisiert"
304
+
305
+ #: includes/admin/class-bnfw-notification.php:271
306
+ #: includes/admin/class-bnfw-notification.php:1317
307
+ msgid "Post Pending Review"
308
+ msgstr "Beitrag mit ausstehender Überprüfung"
309
+
310
+ #: includes/admin/class-bnfw-notification.php:273
311
+ #: includes/admin/class-bnfw-notification.php:1320
312
+ msgid "New Private Post"
313
+ msgstr ""
314
+
315
+ #: includes/admin/class-bnfw-notification.php:275
316
+ #: includes/admin/class-bnfw-notification.php:1323
317
+ msgid "Post Scheduled"
318
+ msgstr "geplanter Beitrag"
319
+
320
+ #: includes/admin/class-bnfw-notification.php:277
321
+ #: includes/admin/class-bnfw-notification.php:1326
322
+ msgid "Published Post Moved to Trash"
323
+ msgstr "Veröffentlichter Beitrag in den Papierkorb verschoben"
324
+
325
+ #: includes/admin/class-bnfw-notification.php:279
326
+ #: includes/admin/class-bnfw-notification.php:367
327
+ #: includes/admin/class-bnfw-notification.php:1248
328
+ msgid "New Comment"
329
+ msgstr "Neuer Kommentar"
330
+
331
+ #: includes/admin/class-bnfw-notification.php:282
332
+ #: includes/admin/class-bnfw-notification.php:369
333
+ #: includes/admin/class-bnfw-notification.php:1254
334
+ #: includes/admin/class-bnfw-notification.php:1407
335
+ msgid "New Comment Awaiting Moderation"
336
+ msgstr "Neuer Kommentar wartet auf Moderation"
337
+
338
+ #: includes/admin/class-bnfw-notification.php:285
339
+ #: includes/admin/class-bnfw-notification.php:1251
340
+ msgid "Post - Comment Approved"
341
+ msgstr ""
342
+
343
+ #: includes/admin/class-bnfw-notification.php:288
344
+ #: includes/admin/class-bnfw-notification.php:1332
345
+ msgid "New Category"
346
+ msgstr "Neue Kategorie"
347
+
348
+ #: includes/admin/class-bnfw-notification.php:290
349
+ #: includes/admin/class-bnfw-notification.php:1335
350
+ msgid "New Tag"
351
+ msgstr "Neuer Tag"
352
+
353
+ #: includes/admin/class-bnfw-notification.php:292
354
+ #: includes/admin/class-bnfw-notification.php:1257
355
+ msgid "New Trackback"
356
+ msgstr "Neuer Trackback"
357
+
358
+ #: includes/admin/class-bnfw-notification.php:294
359
+ #: includes/admin/class-bnfw-notification.php:1260
360
+ msgid "New Pingback"
361
+ msgstr "Neuer Pingback"
362
+
363
+ #: includes/admin/class-bnfw-notification.php:301
364
+ #: includes/admin/class-bnfw-notification.php:1329
365
+ msgid "New Page Published"
366
+ msgstr "Neue Seite publiziert"
367
+
368
+ #: includes/admin/class-bnfw-notification.php:303
369
+ msgid "Page Updated"
370
+ msgstr "Seite aktualisiert"
371
+
372
+ #: includes/admin/class-bnfw-notification.php:305
373
+ msgid "Page Pending Review"
374
+ msgstr "Seite mit ausstehender Überprüfung"
375
+
376
+ #: includes/admin/class-bnfw-notification.php:307
377
+ msgid "New Private Page"
378
+ msgstr ""
379
+
380
+ #: includes/admin/class-bnfw-notification.php:309
381
+ msgid "Page Scheduled"
382
+ msgstr "geplante Seite"
383
+
384
+ #: includes/admin/class-bnfw-notification.php:311
385
+ msgid "Page - New Comment"
386
+ msgstr "Seite - neuer Kommentar"
387
+
388
+ #: includes/admin/class-bnfw-notification.php:313
389
+ msgid "Page - New Comment Awaiting Moderation"
390
+ msgstr "Seite - Neuer Kommentar wartet auf Moderation"
391
+
392
+ #: includes/admin/class-bnfw-notification.php:316
393
+ #: includes/admin/class-bnfw-notification.php:1365
394
+ msgid "Page - Comment Approved"
395
+ msgstr "Seite - Kommentar genehmigt"
396
+
397
+ #: includes/admin/class-bnfw-notification.php:319
398
+ msgid "Page - Comment Reply"
399
+ msgstr "Seite - Kommentar Antworten"
400
+
401
+ #: includes/admin/class-bnfw-notification.php:326
402
+ #: includes/admin/class-bnfw-notification.php:1356
403
+ msgid "New Media Published"
404
+ msgstr "Neue Medien veröffentlicht"
405
+
406
+ #: includes/admin/class-bnfw-notification.php:328
407
+ #: includes/admin/class-bnfw-notification.php:1359
408
+ msgid "Media Updated"
409
+ msgstr "Medien aktualisiert"
410
+
411
+ #: includes/admin/class-bnfw-notification.php:330
412
+ #: includes/admin/class-bnfw-notification.php:1362
413
+ msgid "Media - New Comment"
414
+ msgstr "Medien - Neuer Kommentar"
415
+
416
+ #: includes/admin/class-bnfw-notification.php:332
417
+ #: includes/admin/class-bnfw-notification.php:1368
418
+ msgid "Media - Comment Approved"
419
+ msgstr ""
420
+
421
+ #: includes/admin/class-bnfw-notification.php:335
422
+ #: includes/admin/class-bnfw-notification.php:1371
423
+ msgid "Media - New Comment Awaiting Moderation"
424
+ msgstr "Medien - Neuer Kommentar wartet auf Moderation"
425
+
426
+ #: includes/admin/class-bnfw-notification.php:337
427
+ #: includes/admin/class-bnfw-notification.php:1374
428
+ msgid "Media - Comment Reply"
429
+ msgstr "Medien - Kommentar Antworten"
430
+
431
+ #: includes/admin/class-bnfw-notification.php:355
432
+ msgid "Custom Post Type"
433
+ msgstr "Benutzerdefinierter Beitrags-Typ"
434
+
435
+ #: includes/admin/class-bnfw-notification.php:357
436
+ #: includes/admin/class-bnfw-notification.php:1389
437
+ msgid "New "
438
+ msgstr "Neu"
439
+
440
+ #: includes/admin/class-bnfw-notification.php:357
441
+ msgid " Published"
442
+ msgstr "Veröffentlicht"
443
+
444
+ #: includes/admin/class-bnfw-notification.php:359
445
+ msgid "Updated"
446
+ msgstr "Aktualisiert"
447
+
448
+ #: includes/admin/class-bnfw-notification.php:361
449
+ msgid "Pending Review"
450
+ msgstr "Überprüfung ausstehend"
451
+
452
+ #: includes/admin/class-bnfw-notification.php:363
453
+ #: includes/admin/class-bnfw-notification.php:1401
454
+ msgid "New Private "
455
+ msgstr ""
456
+
457
+ #: includes/admin/class-bnfw-notification.php:365
458
+ msgid "Scheduled"
459
+ msgstr "Geplant"
460
+
461
+ #: includes/admin/class-bnfw-notification.php:372
462
+ msgid "Comment Approved"
463
+ msgstr "Kommentar genehmigt"
464
+
465
+ #: includes/admin/class-bnfw-notification.php:394
466
+ msgid "Custom Taxonomy"
467
+ msgstr "Benutzerdefinierte Taxonomie"
468
+
469
+ #: includes/admin/class-bnfw-notification.php:400
470
+ msgid "New"
471
+ msgstr "Neu"
472
+
473
+ #: includes/admin/class-bnfw-notification.php:419
474
+ msgid ""
475
+ "This notification doesn't support additional email fields due to a "
476
+ "limitation in WordPress."
477
+ msgstr ""
478
+ "Diese Benachrichtigung unterstützt keine zusätzlichen E-Mail-Felder aufgrund "
479
+ "einer Einschränkung in WordPress."
480
+
481
+ #: includes/admin/class-bnfw-notification.php:426
482
+ msgid "Email Formatting"
483
+ msgstr "Email-Format"
484
+
485
+ #: includes/admin/class-bnfw-notification.php:427
486
+ msgid ""
487
+ "How do you want to format the sent email? HTML is recommended as it'll show "
488
+ "images and links correctly."
489
+ msgstr ""
490
+
491
+ #: includes/admin/class-bnfw-notification.php:448
492
+ msgid "Additional Email Fields"
493
+ msgstr "Zusätzliche Email-Felder"
494
+
495
+ #: includes/admin/class-bnfw-notification.php:449
496
+ msgid ""
497
+ "This should be fairly self explanatory but if you're unsure, tick this "
498
+ "checkbox and have a look at the available options. You can always untick it "
499
+ "again should you decide you don't need to use it."
500
+ msgstr ""
501
+
502
+ #: includes/admin/class-bnfw-notification.php:454
503
+ msgid "Set \"From\" Name & Email, Reply To, CC, BCC"
504
+ msgstr ""
505
+
506
+ #: includes/admin/class-bnfw-notification.php:461
507
+ msgid "From Name and Email"
508
+ msgstr "Absendername und Email"
509
+
510
+ #: includes/admin/class-bnfw-notification.php:462
511
+ msgid ""
512
+ "If you want to send the email from your site name and email address instead "
513
+ "of the default \"WordPress\" from \"wordpress@domain.com\", this is where "
514
+ "you can do it."
515
+ msgstr ""
516
+
517
+ #: includes/admin/class-bnfw-notification.php:466
518
+ msgid "Site Name"
519
+ msgstr ""
520
+
521
+ #: includes/admin/class-bnfw-notification.php:468
522
+ msgid "Site Email"
523
+ msgstr ""
524
+
525
+ #: includes/admin/class-bnfw-notification.php:475
526
+ msgid "Reply To"
527
+ msgstr ""
528
+
529
+ #: includes/admin/class-bnfw-notification.php:476
530
+ msgid ""
531
+ "If you want any replies to your email notification to go to another person, "
532
+ "fill in this box with their name and email address."
533
+ msgstr ""
534
+
535
+ #: includes/admin/class-bnfw-notification.php:480
536
+ msgid "Name"
537
+ msgstr ""
538
+
539
+ #: includes/admin/class-bnfw-notification.php:482
540
+ msgid "Email"
541
+ msgstr "Email"
542
+
543
+ #: includes/admin/class-bnfw-notification.php:488
544
+ msgid "CC"
545
+ msgstr "CC"
546
+
547
+ #: includes/admin/class-bnfw-notification.php:489
548
+ msgid "Publicly copy in any other users or user roles to this email."
549
+ msgstr ""
550
+
551
+ #: includes/admin/class-bnfw-notification.php:494
552
+ #: includes/admin/class-bnfw-notification.php:508
553
+ #: includes/admin/class-bnfw-notification.php:557
554
+ #: includes/admin/class-bnfw-notification.php:575
555
+ msgid "Select User Roles / Users"
556
+ msgstr "Wählen Sie Benutzerrollen / Benutzer"
557
+
558
+ #: includes/admin/class-bnfw-notification.php:502
559
+ msgid "BCC"
560
+ msgstr "BCC"
561
+
562
+ #: includes/admin/class-bnfw-notification.php:503
563
+ msgid "Privately copy in any other users or user roles to this email."
564
+ msgstr ""
565
+
566
+ #: includes/admin/class-bnfw-notification.php:518
567
+ msgid "Send to Author"
568
+ msgstr ""
569
+
570
+ #: includes/admin/class-bnfw-notification.php:519
571
+ msgid ""
572
+ "E.g. If you want a new post published notification to go to the post author, "
573
+ "tick this box."
574
+ msgstr ""
575
+
576
+ #: includes/admin/class-bnfw-notification.php:526
577
+ msgid "Send this notification to the Author"
578
+ msgstr "Senden Sie diese Benachrichtigung an den Autor"
579
+
580
+ #: includes/admin/class-bnfw-notification.php:536
581
+ msgid ""
582
+ "E.g. If you're an editor and regularly update your posts, you might not want "
583
+ "to be emailed about this all the time. Ticking this box will prevent you "
584
+ "from receiving emails about your own changes."
585
+ msgstr ""
586
+
587
+ #: includes/admin/class-bnfw-notification.php:542
588
+ msgid "Do not send this Notification to the User that triggered it"
589
+ msgstr ""
590
+ "Senden Sie diese Benachrichtigung nicht an den Benutzer, der sie ausgelöst "
591
+ "hat"
592
+
593
+ #: includes/admin/class-bnfw-notification.php:551
594
+ msgid "Send To"
595
+ msgstr "Sende an"
596
+
597
+ #: includes/admin/class-bnfw-notification.php:552
598
+ msgid "Choose the users and/or user roles to send this email notification to."
599
+ msgstr ""
600
+
601
+ #: includes/admin/class-bnfw-notification.php:565
602
+ msgid "Except For"
603
+ msgstr ""
604
+
605
+ #: includes/admin/class-bnfw-notification.php:568
606
+ msgid ""
607
+ "Choose the users and/or user roles that this notification should not be sent "
608
+ "to."
609
+ msgstr ""
610
+
611
+ #: includes/admin/class-bnfw-notification.php:593
612
+ msgid ""
613
+ "You have chosen to send this notification to over 200 users. Please check "
614
+ "the email sending rate limit at your host before sending."
615
+ msgstr ""
616
+
617
+ #: includes/admin/class-bnfw-notification.php:603
618
+ #: includes/admin/class-bnfw-notification.php:1129
619
+ msgid "Subject"
620
+ msgstr "Betreff"
621
+
622
+ #: includes/admin/class-bnfw-notification.php:604
623
+ msgid "Notification subject. You can use "
624
+ msgstr "Benachrichtigungsgegenstand. Sie können verwenden"
625
+
626
+ #: includes/admin/class-bnfw-notification.php:604
627
+ #: includes/admin/class-bnfw-notification.php:618
628
+ msgid " here."
629
+ msgstr ""
630
+
631
+ #: includes/admin/class-bnfw-notification.php:617
632
+ msgid "Message Body"
633
+ msgstr "Nachrichten-Text"
634
+
635
+ #: includes/admin/class-bnfw-notification.php:618
636
+ msgid "Notification message. You can use "
637
+ msgstr "Benachrichtigungsgegenstand. Sie können verwenden"
638
+
639
+ #: includes/admin/class-bnfw-notification.php:626
640
+ msgid "Need some more help?"
641
+ msgstr ""
642
+
643
+ #: includes/admin/class-bnfw-notification.php:636
644
+ msgid "Insert Default Content"
645
+ msgstr "Standardinhalt einfügen"
646
+
647
+ #: includes/admin/class-bnfw-notification.php:640
648
+ msgid "Read Documentation"
649
+ msgstr ""
650
+
651
+ #: includes/admin/class-bnfw-notification.php:644
652
+ msgid "Find Shortcodes"
653
+ msgstr ""
654
+
655
+ #: includes/admin/class-bnfw-notification.php:655
656
+ msgid ""
657
+ "Stop additional paragraph and line break HTML from being inserted into my "
658
+ "notifications"
659
+ msgstr ""
660
+
661
+ #: includes/admin/class-bnfw-notification.php:710
662
+ msgid ""
663
+ "You must choose at least one User or User Role to send the notification to "
664
+ "before you can save"
665
+ msgstr ""
666
+
667
+ #: includes/admin/class-bnfw-notification.php:825
668
+ msgid "Test Notification Sent."
669
+ msgstr "Test Benachrichtigung gesendet"
670
+
671
+ #: includes/admin/class-bnfw-notification.php:915
672
+ msgid "Notification saved."
673
+ msgstr "Benachrichtigung gespeichert"
674
+
675
+ #: includes/admin/class-bnfw-notification.php:934
676
+ #: includes/admin/class-bnfw-notification.php:992
677
+ #: includes/admin/class-bnfw-notification.php:994
678
+ msgid "Save"
679
+ msgstr "Speichern"
680
+
681
+ #: includes/admin/class-bnfw-notification.php:942
682
+ msgid ""
683
+ "Use this to enable or disable notifications. If you want to disable a "
684
+ "default WordPress notification, just create it on the left, then disable it "
685
+ "here."
686
+ msgstr ""
687
+
688
+ #: includes/admin/class-bnfw-notification.php:949
689
+ msgid "Notification Enabled"
690
+ msgstr "Benachrichtigung aktiviert"
691
+
692
+ #: includes/admin/class-bnfw-notification.php:956
693
+ msgid "Notification Disabled"
694
+ msgstr "Benachrichtigung deaktiviert"
695
+
696
+ #: includes/admin/class-bnfw-notification.php:967
697
+ msgid "Send Me a Test Email"
698
+ msgstr "Sende mir eine Test Email"
699
+
700
+ #: includes/admin/class-bnfw-notification.php:969
701
+ msgid ""
702
+ "This will send you (the currently logged in user) a notification so that you "
703
+ "can check for any issues with formatting – it’s doesn't mean that a "
704
+ "notification will send correctly in the future. You can read about how to "
705
+ "improve email delivery"
706
+ msgstr ""
707
+
708
+ #: includes/admin/class-bnfw-notification.php:969
709
+ msgid "here"
710
+ msgstr ""
711
+
712
+ #: includes/admin/class-bnfw-notification.php:969
713
+ msgid ". Shortcodes will not be replaced with content."
714
+ msgstr ""
715
+
716
+ #: includes/admin/class-bnfw-notification.php:980
717
+ msgid "Delete Permanently"
718
+ msgstr "Dauerhaft löschen"
719
+
720
+ #: includes/admin/class-bnfw-notification.php:982
721
+ msgid "Move to Trash"
722
+ msgstr "In den Papierkorb"
723
+
724
+ #: includes/admin/class-bnfw-notification.php:1127
725
+ msgid "Notification Type"
726
+ msgstr "Benachrichtigungs Type"
727
+
728
+ #: includes/admin/class-bnfw-notification.php:1128
729
+ msgid "Enabled?"
730
+ msgstr "Aktiviert?"
731
+
732
+ #: includes/admin/class-bnfw-notification.php:1130
733
+ msgid "User Roles / Users"
734
+ msgstr "Rolle / Benutzer"
735
+
736
+ #: includes/admin/class-bnfw-notification.php:1131
737
+ msgid "Excluded User Roles / Users"
738
+ msgstr "Ausgeschlossene Benutzerrollen / Benutzer"
739
+
740
+ #: includes/admin/class-bnfw-notification.php:1172
741
+ msgid ", Post Author"
742
+ msgstr ""
743
+
744
+ #: includes/admin/class-bnfw-notification.php:1338
745
+ msgid "Privacy – Confirm Action: Export Data Request – For User"
746
+ msgstr ""
747
+
748
+ #: includes/admin/class-bnfw-notification.php:1341
749
+ msgid "Privacy – Confirm Action: Erase Data Request – For User"
750
+ msgstr ""
751
+
752
+ #: includes/admin/class-bnfw-notification.php:1389
753
+ msgid "Published"
754
+ msgstr "Veröffentlicht"
755
+
756
+ #: includes/admin/class-bnfw-notification.php:1392
757
+ msgid "Updated "
758
+ msgstr "Aktualisiert"
759
+
760
+ #: includes/admin/class-bnfw-notification.php:1395
761
+ msgid " Pending Review"
762
+ msgstr "Überprüfung ausstehend"
763
+
764
+ #: includes/admin/class-bnfw-notification.php:1398
765
+ msgid " Scheduled"
766
+ msgstr "Geplant"
767
+
768
+ #: includes/admin/class-bnfw-notification.php:1404
769
+ msgid " Comment"
770
+ msgstr "Kommentar"
771
+
772
+ #: includes/admin/class-bnfw-notification.php:1410
773
+ msgid " Comment Reply"
774
+ msgstr "Kommentar Antworten"
775
+
776
+ #: includes/admin/class-bnfw-notification.php:1413
777
+ msgid " Comment Approved"
778
+ msgstr "Kommentar genehmigt"
779
+
780
+ #: includes/admin/class-bnfw-notification.php:1418
781
+ msgid "New Term"
782
+ msgstr "Neuer Begriff"
783
+
784
+ #: includes/admin/class-bnfw-notification.php:1420
785
+ msgid "New Term in "
786
+ msgstr "Neuer Begriff in"
787
+
788
+ #: includes/admin/class-bnfw-notification.php:1440
789
+ msgid "Enable Notifications"
790
+ msgstr "Benachrichtigungen aktivieren"
791
+
792
+ #: includes/admin/class-bnfw-notification.php:1441
793
+ msgid "Disable Notifications"
794
+ msgstr "Benachrichtigungen ausschalten"
795
+
796
+ #: includes/admin/class-bnfw-notification.php:1502
797
+ msgid "Enable Notification"
798
+ msgstr "Aktiviere Benachrichtigungen"
799
+
800
+ #: includes/admin/class-bnfw-notification.php:1510
801
+ msgid "Disable Notification"
802
+ msgstr "Benachrichtigung deaktiviert"
803
+
804
+ #: includes/admin/class-bnfw-notification.php:1568
805
+ msgid "Enabled 1 Notification."
806
+ msgstr "Aktiviert 1 Benachrichtigung."
807
+
808
+ #: includes/admin/class-bnfw-notification.php:1572
809
+ msgid "Disabled 1 Notification."
810
+ msgstr "Deaktiviert 1 Benachrichtigung."
811
+
812
+ #: includes/admin/class-bnfw-notification.php:1578
813
+ #, php-format
814
+ msgid "Enabled %s Notification."
815
+ msgid_plural "Enabled %s Notifications."
816
+ msgstr[0] "%s Benachrichtigung aktiviert."
817
+ msgstr[1] "%s Benachrichtigungen aktiviert."
818
+
819
+ #: includes/admin/class-bnfw-notification.php:1588
820
+ #, php-format
821
+ msgid "Disabled %s Notification."
822
+ msgid_plural "Disabled %s Notifications."
823
+ msgstr[0] "%s Benachrichtigungen deaktiviert."
824
+ msgstr[1] "%s Benachrichtigungen deaktiviert."
825
+
826
+ #: includes/admin/class-bnfw-notification.php:1602
827
+ msgid ""
828
+ "If you send out notifications with BNFW but don't receive them, you may need "
829
+ "to install an SMTP plugin to <a href=\"https://betternotificationsforwp.com/"
830
+ "documentation/getting-started/how-to-improve-email-delivery/\" target="
831
+ "\"_blank\">improve email deliverability</a>. I recommend using <a href="
832
+ "\"https://wordpress.org/plugins/post-smtp/\" target=\"_blank\">Post SMTP</a> "
833
+ "as it's easy to set-up or <a href=\"https://wordpress.org/plugins/email-log/"
834
+ "\" target=\"_blank\">Email Log</a> to just log and view emails that are sent."
835
+ msgstr ""
836
+
837
+ #: includes/engine/class-bnfw-engine.php:18
838
+ msgid "Test Email:"
839
+ msgstr "Test-Email:"
840
+
841
+ #: includes/engine/class-bnfw-engine.php:19
842
+ msgid ""
843
+ "This is a test email. All shortcodes below will show in place but not be "
844
+ "replaced with content."
845
+ msgstr ""
846
+
847
+ #: includes/engine/class-bnfw-engine.php:1583
848
+ msgid "Error: Download link is not available please contact support"
849
+ msgstr ""
850
+
851
+ #: includes/helpers/ajax-helpers.php:34 includes/helpers/helpers.php:38
852
+ msgid "User Roles"
853
+ msgstr "Benutzerregeln"
854
+
855
+ #: includes/helpers/ajax-helpers.php:57 includes/helpers/helpers.php:59
856
+ #: includes/helpers/helpers.php:64
857
+ msgid "Users"
858
+ msgstr ""
859
+
860
+ #: includes/helpers/helpers.php:103
861
+ msgid "Non WordPress Users"
862
+ msgstr ""
863
+
864
+ #: includes/import.php:69
865
+ msgid " for "
866
+ msgstr "für"
867
+
868
+ #: includes/import.php:69
869
+ msgid " (Auto Imported)"
870
+ msgstr "(Auto-importiert)"
871
+
872
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:228
873
+ #, php-format
874
+ msgid ""
875
+ "There is a new version of %1$s available. %2$sView version %3$s details%4$s."
876
+ msgstr ""
877
+
878
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:236
879
+ #, php-format
880
+ msgid ""
881
+ "There is a new version of %1$s available. %2$sView version %3$s details%4$s "
882
+ "or %5$supdate now%6$s."
883
+ msgstr ""
884
+
885
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:474
886
+ msgid "You do not have permission to install plugin updates"
887
+ msgstr ""
888
+
889
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:474
890
+ msgid "Error"
891
+ msgstr ""
892
+
893
+ #: includes/license/class-bnfw-license-setting.php:18
894
+ #: includes/license/class-bnfw-license-setting.php:19
895
+ msgid "Add-on Licenses"
896
+ msgstr ""
897
+
898
+ #: includes/license/class-bnfw-license-setting.php:38
899
+ msgid "BNFW Add-on Licenses"
900
+ msgstr ""
901
+
902
+ #: includes/license/class-bnfw-license-setting.php:47
903
+ msgid "Save License"
904
+ msgstr ""
905
+
906
+ #: includes/license/class-bnfw-license-setting.php:55
907
+ msgid ""
908
+ "<br>You have no BNFW Premium Add-ons installed yet.<br>You can buy add-ons "
909
+ "from the <a href=\""
910
+ msgstr ""
911
+
912
+ #: includes/license/class-bnfw-license-setting.php:130
913
+ msgid "Deactivate License"
914
+ msgstr ""
915
+
916
+ #: includes/license/class-bnfw-license.php:140
917
+ #, php-format
918
+ msgid "%1$s License Key"
919
+ msgstr ""
920
+
921
+ #: includes/overrides.php:41 includes/overrides.php:135
922
+ #, php-format
923
+ msgid "New user registration on your site %s:"
924
+ msgstr "Neue Benutzerregistrierung auf Ihrer Seite %s:"
925
+
926
+ #: includes/overrides.php:42 includes/overrides.php:117
927
+ #: includes/overrides.php:136 includes/overrides.php:152
928
+ #, php-format
929
+ msgid "Username: %s"
930
+ msgstr "Benutzername: %s"
931
+
932
+ #: includes/overrides.php:43 includes/overrides.php:137
933
+ #, php-format
934
+ msgid "E-mail: %s"
935
+ msgstr "Email: %s"
936
+
937
+ #. translators: Password change notification email subject. %s: Site title
938
+ #: includes/overrides.php:48 includes/overrides.php:139
939
+ #, php-format
940
+ msgid "[%s] New User Registration"
941
+ msgstr "[%s] Neue Benutzerregistrierung"
942
+
943
+ #: includes/overrides.php:118
944
+ msgid "To set your password, visit the following address:"
945
+ msgstr ""
946
+
947
+ #: includes/overrides.php:123
948
+ #, php-format
949
+ msgid "[%s] Your username and password info"
950
+ msgstr "[%s] Ihr Benutzername und Passwort"
951
+
952
+ #: includes/overrides.php:153
953
+ #, php-format
954
+ msgid "Password: %s"
955
+ msgstr "Passwort: %s"
956
+
957
+ #: includes/overrides.php:156
958
+ #, php-format
959
+ msgid "[%s] Your username and password"
960
+ msgstr "[%s] Ihr Benutzername und Passwort"
961
+
962
+ #. translators: %s: user name
963
+ #: includes/overrides.php:184
964
+ #, php-format
965
+ msgid "Password changed for user: %s"
966
+ msgstr "Passwort für Benutzer geändert:%s"
967
+
968
+ #. translators: %s: site title
969
+ #: includes/overrides.php:189
970
+ #, php-format
971
+ msgid "[%s] Password Changed"
972
+ msgstr ""
973
+
974
+ #. Plugin Name of the plugin/theme
975
+ msgid "Better Notifications for WP"
976
+ msgstr "Better Notifications for WP"
977
+
978
+ #. Plugin URI of the plugin/theme
979
+ #, fuzzy
980
+ #| msgid "http://wordpress.org/plugins/bnfw/"
981
+ msgid "https://wordpress.org/plugins/bnfw/"
982
+ msgstr "http://wordpress.org/plugins/bnfw/"
983
+
984
+ #. Description of the plugin/theme
985
+ msgid ""
986
+ "Supercharge your WordPress notifications using a WYSIWYG editor and "
987
+ "shortcodes. Default and new notifications available. Add more power with Add-"
988
+ "ons."
989
+ msgstr ""
990
+
991
+ #. Author of the plugin/theme
992
+ msgid "Made with Fuel"
993
+ msgstr "Made with Fuel"
994
+
995
+ #. Author URI of the plugin/theme
996
+ msgid "https://madewithfuel.com/"
997
+ msgstr ""
998
+
999
+ #~ msgid "New User - Welcome Email"
1000
+ #~ msgstr "Neuer Benutzer - Willkommens Email"
1001
+
1002
+ #~ msgid "Update "
1003
+ #~ msgstr "Aktualisieren"
1004
+
1005
+ #~ msgid "Show additional email fields"
1006
+ #~ msgstr "Zeige zusätzliche Email-Felder"
1007
+
1008
+ #~ msgid ""
1009
+ #~ "Looking for help with shortcodes? Click here to see which ones you can "
1010
+ #~ "use with the selected notification."
1011
+ #~ msgstr ""
1012
+ #~ "Hilfe mit Shortcodes benötigt? Klick hier zum Anzeigen, welche für die "
1013
+ #~ "gewählte Benachrichtigung verfügbar sind."
1014
+
1015
+ #~ msgid "New User - Welcome email"
1016
+ #~ msgstr "Neuer Benutzer - Willkommens-Email"
1017
+
1018
+ #~ msgid ""
1019
+ #~ "Send customisable HTML emails to your users for different WordPress "
1020
+ #~ "notifications."
1021
+ #~ msgstr ""
1022
+ #~ "Anpassbare HTML Emails für die verschiedensten WordPress Mitteilungen an "
1023
+ #~ "Ihre Benutzer versenden."
1024
+
1025
+ #~ msgid "https://betternotificationsforwp.com/"
1026
+ #~ msgstr "https://betternotificationsforwp.com/"
languages/bnfw-es_ES.mo CHANGED
File without changes
languages/bnfw-es_ES.po CHANGED
@@ -1,1020 +1,1020 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Better Notifications for WP 1.3.3\n"
4
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/bnfw\n"
5
- "POT-Creation-Date: 2020-11-27 21:34+0800\n"
6
- "PO-Revision-Date: 2020-11-28 00:01+0800\n"
7
- "Last-Translator: \n"
8
- "Language-Team: \n"
9
- "Language: es\n"
10
- "MIME-Version: 1.0\n"
11
- "Content-Type: text/plain; charset=UTF-8\n"
12
- "Content-Transfer-Encoding: 8bit\n"
13
- "X-Generator: Poedit 2.2\n"
14
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
-
16
- #: bnfw.php:283 includes/admin/bnfw-settings.php:15
17
- msgid "Settings"
18
- msgstr "Ajustes"
19
-
20
- #: includes/admin/bnfw-settings.php:14
21
- #: includes/admin/class-bnfw-notification.php:129
22
- msgid "Notification Settings"
23
- msgstr "Configuración de las notificaciones"
24
-
25
- #: includes/admin/bnfw-settings.php:38
26
- msgid "BNFW Settings"
27
- msgstr "Ajsutes de BNFW"
28
-
29
- #: includes/admin/bnfw-settings.php:46
30
- msgid "Save Settings"
31
- msgstr "AjustesGuardar ajustes"
32
-
33
- #: includes/admin/bnfw-settings.php:73
34
- msgid "Documentation"
35
- msgstr ""
36
-
37
- #: includes/admin/bnfw-settings.php:80
38
- msgid "Premium Add-ons"
39
- msgstr ""
40
-
41
- #: includes/admin/bnfw-settings.php:87
42
- msgid "Priority Support"
43
- msgstr ""
44
-
45
- #: includes/admin/bnfw-settings.php:150
46
- msgid "Suppress SPAM comment notification"
47
- msgstr "Excluir notificaciones de comentarios marcados como SPAM"
48
-
49
- #: includes/admin/bnfw-settings.php:150
50
- msgid ""
51
- "Comments that are correctly marked as SPAM by a 3rd party plugin (such as "
52
- "Akismet) will not generate a notification if this is ticked."
53
- msgstr ""
54
-
55
- #: includes/admin/bnfw-settings.php:155
56
- msgid "Don't send notifications for comments marked as SPAM"
57
- msgstr "No envíe notificaciones de comentarios marcados como SPAM"
58
-
59
- #: includes/admin/bnfw-settings.php:167
60
- msgid "Default Email Format"
61
- msgstr "Formato de email predeterminado"
62
-
63
- #: includes/admin/bnfw-settings.php:167
64
- #, fuzzy
65
- #| msgid ""
66
- #| "This will apply to all emails sent out via WordPress, even those from "
67
- #| "other plugins. For more details, please see the <a href=\"https://"
68
- #| "wordpress.org/plugins/bnfw/faq/\" target=\"_blank\">FAQ</a>."
69
- msgid ""
70
- "This will apply to all emails sent out via WordPress, even those from other "
71
- "plugins. For more details, please see the "
72
- msgstr ""
73
- "Esto aplicará a todos los emails enviados vía WordPress, incluso desde otros "
74
- "plugins. Para más detalles, por favor mira <a href=\"https://wordpress.org/"
75
- "plugins/bnfw/faq/\" target=\"_blank\">FAQ</a>."
76
-
77
- #: includes/admin/bnfw-settings.php:181
78
- msgid "Enable Content Shortcodes?"
79
- msgstr ""
80
-
81
- #: includes/admin/bnfw-settings.php:181
82
- msgid "Shortcodes in the post/page content are disabled by default."
83
- msgstr ""
84
-
85
- #: includes/admin/bnfw-settings.php:186
86
- msgid "Enable shortcode output in the page/post content"
87
- msgstr ""
88
-
89
- #: includes/admin/bnfw-settings.php:198
90
- msgid "Allow Usage Tracking?"
91
- msgstr ""
92
-
93
- #: includes/admin/bnfw-settings.php:203
94
- msgid ""
95
- "Allow Better Notifications for WP to anonymously track how this plugin is "
96
- "used and help make the plugin better."
97
- msgstr ""
98
-
99
- #: includes/admin/bnfw-settings.php:251
100
- #: includes/admin/class-bnfw-notification.php:433
101
- msgid "HTML Formatting"
102
- msgstr "Formato HTML"
103
-
104
- #: includes/admin/bnfw-settings.php:256
105
- #: includes/admin/class-bnfw-notification.php:439
106
- msgid "Plain Text"
107
- msgstr "Texto plano"
108
-
109
- #: includes/admin/class-bnfw-notification.php:52
110
- #: includes/admin/class-bnfw-notification.php:55
111
- #: includes/admin/class-bnfw-notification.php:56
112
- msgid "Notifications"
113
- msgstr "Notificaciones"
114
-
115
- #: includes/admin/class-bnfw-notification.php:53
116
- msgid "Notification"
117
- msgstr "Notificación"
118
-
119
- #: includes/admin/class-bnfw-notification.php:54
120
- msgid "Add New"
121
- msgstr "Añadir nuevo"
122
-
123
- #: includes/admin/class-bnfw-notification.php:57
124
- msgid "Add New Notification"
125
- msgstr "Añadir nuevo aviso"
126
-
127
- #: includes/admin/class-bnfw-notification.php:58
128
- msgid "Edit Notification"
129
- msgstr "Editar notificación"
130
-
131
- #: includes/admin/class-bnfw-notification.php:59
132
- msgid "New Notification"
133
- msgstr "Nueva notificación"
134
-
135
- #: includes/admin/class-bnfw-notification.php:60
136
- msgid "View Notification"
137
- msgstr "Ver notificación"
138
-
139
- #: includes/admin/class-bnfw-notification.php:61
140
- msgid "Search Notifications"
141
- msgstr "Buscar notificaciones"
142
-
143
- #: includes/admin/class-bnfw-notification.php:62
144
- msgid "No Notifications found"
145
- msgstr "No hemos encontrado notificaciones"
146
-
147
- #: includes/admin/class-bnfw-notification.php:63
148
- msgid "No Notifications found in trash"
149
- msgstr "No encontramos notificaciones en la Papelera"
150
-
151
- #: includes/admin/class-bnfw-notification.php:64
152
- msgid "All Notifications"
153
- msgstr "Todas las notificaciones"
154
-
155
- #: includes/admin/class-bnfw-notification.php:138
156
- msgid "Save Notification"
157
- msgstr "Guardar notificacion"
158
-
159
- #: includes/admin/class-bnfw-notification.php:186
160
- msgid "Notification For"
161
- msgstr "Notificación por"
162
-
163
- #: includes/admin/class-bnfw-notification.php:187
164
- msgid ""
165
- "E.g. If you select \"New Post Published\" from the list on the right, this "
166
- "notification will be sent when a new post is published."
167
- msgstr ""
168
-
169
- #: includes/admin/class-bnfw-notification.php:191
170
- msgid "Select the notification type"
171
- msgstr "Seleccione el tipo de notificación"
172
-
173
- #: includes/admin/class-bnfw-notification.php:192
174
- msgid "Admin"
175
- msgstr ""
176
-
177
- #: includes/admin/class-bnfw-notification.php:194
178
- #: includes/admin/class-bnfw-notification.php:1302
179
- msgid "New User Registration - For Admin"
180
- msgstr "Nuevo usuario registrado - para Admin"
181
-
182
- #: includes/admin/class-bnfw-notification.php:196
183
- #: includes/admin/class-bnfw-notification.php:1269
184
- msgid "User Lost Password - For Admin"
185
- msgstr "No recuerdo la clave - para Admin"
186
-
187
- #: includes/admin/class-bnfw-notification.php:198
188
- #: includes/admin/class-bnfw-notification.php:1272
189
- msgid "Password Changed - For Admin"
190
- msgstr "Contraseña cambiada: para administrador"
191
-
192
- #: includes/admin/class-bnfw-notification.php:200
193
- #: includes/admin/class-bnfw-notification.php:1275
194
- msgid "User Email Changed - For Admin"
195
- msgstr "Correo electrónico de usuario modificado: para administrador"
196
-
197
- #: includes/admin/class-bnfw-notification.php:202
198
- #: includes/admin/class-bnfw-notification.php:1308
199
- msgid "User Role Changed - For Admin"
200
- msgstr "Cambio de rol de usuario: para administrador"
201
-
202
- #: includes/admin/class-bnfw-notification.php:204
203
- #: includes/admin/class-bnfw-notification.php:1296
204
- msgid "User Logged In - For Admin"
205
- msgstr "Usuario conectado: para administrador"
206
-
207
- #: includes/admin/class-bnfw-notification.php:206
208
- #: includes/admin/class-bnfw-notification.php:1287
209
- msgid "WordPress Core Automatic Background Updates"
210
- msgstr ""
211
-
212
- #: includes/admin/class-bnfw-notification.php:210
213
- #: includes/admin/class-bnfw-notification.php:1344
214
- msgid "Privacy - Confirm Action: Export Data Request - For Admin"
215
- msgstr ""
216
-
217
- #: includes/admin/class-bnfw-notification.php:214
218
- #: includes/admin/class-bnfw-notification.php:1347
219
- msgid "Privacy - Confirm Action: Erase Data Request - For Admin"
220
- msgstr ""
221
-
222
- #: includes/admin/class-bnfw-notification.php:222
223
- msgid "Transactional"
224
- msgstr ""
225
-
226
- #: includes/admin/class-bnfw-notification.php:224
227
- #: includes/admin/class-bnfw-notification.php:1290
228
- msgid "New User Registration - For User"
229
- msgstr "Nuevo usuario registrado - para Usuario"
230
-
231
- #: includes/admin/class-bnfw-notification.php:226
232
- #: includes/admin/class-bnfw-notification.php:1299
233
- msgid "New User - Post-registration Email"
234
- msgstr "Nuevo usuario: correo electrónico posterior al registro"
235
-
236
- #: includes/admin/class-bnfw-notification.php:228
237
- #: includes/admin/class-bnfw-notification.php:1266
238
- msgid "User Lost Password - For User"
239
- msgstr "Usuario contraseña perdida: para el usuario"
240
-
241
- #: includes/admin/class-bnfw-notification.php:230
242
- #: includes/admin/class-bnfw-notification.php:1278
243
- msgid "Password Changed - For User"
244
- msgstr "Contraseña cambiada: para el usuario"
245
-
246
- #: includes/admin/class-bnfw-notification.php:232
247
- #: includes/admin/class-bnfw-notification.php:1281
248
- msgid "User Email Changed Confirmation - For User"
249
- msgstr ""
250
- "Confirmación de cambio de correo electrónico del usuario: para el usuario"
251
-
252
- #: includes/admin/class-bnfw-notification.php:235
253
- #: includes/admin/class-bnfw-notification.php:1284
254
- msgid "User Email Changed - For User"
255
- msgstr "Se cambió el correo electrónico del usuario: para el usuario"
256
-
257
- #: includes/admin/class-bnfw-notification.php:237
258
- #: includes/admin/class-bnfw-notification.php:1305
259
- msgid "User Role Changed - For User"
260
- msgstr "Cambio de rol de usuario: para el usuario"
261
-
262
- #: includes/admin/class-bnfw-notification.php:239
263
- #: includes/admin/class-bnfw-notification.php:1293
264
- msgid "User Logged In - For User"
265
- msgstr "Usuario conectado: para usuario"
266
-
267
- #: includes/admin/class-bnfw-notification.php:241
268
- #: includes/admin/class-bnfw-notification.php:375
269
- #: includes/admin/class-bnfw-notification.php:1263
270
- msgid "Comment Reply"
271
- msgstr "Respuesta a comentario"
272
-
273
- #: includes/admin/class-bnfw-notification.php:245
274
- msgid "Privacy - Confirm Action: Export Data Request - For User"
275
- msgstr ""
276
-
277
- #: includes/admin/class-bnfw-notification.php:249
278
- msgid "Privacy - Confirm Action: Erase Data Request - For User"
279
- msgstr ""
280
-
281
- #: includes/admin/class-bnfw-notification.php:253
282
- #: includes/admin/class-bnfw-notification.php:1350
283
- msgid "Privacy - Data Export - For User"
284
- msgstr ""
285
-
286
- #: includes/admin/class-bnfw-notification.php:257
287
- #: includes/admin/class-bnfw-notification.php:1353
288
- msgid "Privacy - Data Erased - For User"
289
- msgstr ""
290
-
291
- #: includes/admin/class-bnfw-notification.php:267
292
- #: includes/admin/class-bnfw-notification.php:1311
293
- msgid "New Post Published"
294
- msgstr "Nuevo post publicado"
295
-
296
- #: includes/admin/class-bnfw-notification.php:269
297
- #: includes/admin/class-bnfw-notification.php:1314
298
- msgid "Post Updated"
299
- msgstr "Post actualizado"
300
-
301
- #: includes/admin/class-bnfw-notification.php:271
302
- #: includes/admin/class-bnfw-notification.php:1317
303
- msgid "Post Pending Review"
304
- msgstr "Post pendiente de reseña"
305
-
306
- #: includes/admin/class-bnfw-notification.php:273
307
- #: includes/admin/class-bnfw-notification.php:1320
308
- msgid "New Private Post"
309
- msgstr ""
310
-
311
- #: includes/admin/class-bnfw-notification.php:275
312
- #: includes/admin/class-bnfw-notification.php:1323
313
- msgid "Post Scheduled"
314
- msgstr "Post programado"
315
-
316
- #: includes/admin/class-bnfw-notification.php:277
317
- #: includes/admin/class-bnfw-notification.php:1326
318
- msgid "Published Post Moved to Trash"
319
- msgstr "La publicación publicada se movió a la papelera"
320
-
321
- #: includes/admin/class-bnfw-notification.php:279
322
- #: includes/admin/class-bnfw-notification.php:367
323
- #: includes/admin/class-bnfw-notification.php:1248
324
- msgid "New Comment"
325
- msgstr "Nuevo comentario"
326
-
327
- #: includes/admin/class-bnfw-notification.php:282
328
- #: includes/admin/class-bnfw-notification.php:369
329
- #: includes/admin/class-bnfw-notification.php:1254
330
- #: includes/admin/class-bnfw-notification.php:1407
331
- msgid "New Comment Awaiting Moderation"
332
- msgstr "Nuevo comentario / Esperando moderación"
333
-
334
- #: includes/admin/class-bnfw-notification.php:285
335
- #: includes/admin/class-bnfw-notification.php:1251
336
- msgid "Post - Comment Approved"
337
- msgstr ""
338
-
339
- #: includes/admin/class-bnfw-notification.php:288
340
- #: includes/admin/class-bnfw-notification.php:1332
341
- msgid "New Category"
342
- msgstr "Nueva categoría"
343
-
344
- #: includes/admin/class-bnfw-notification.php:290
345
- #: includes/admin/class-bnfw-notification.php:1335
346
- msgid "New Tag"
347
- msgstr "Nueva etiqueta"
348
-
349
- #: includes/admin/class-bnfw-notification.php:292
350
- #: includes/admin/class-bnfw-notification.php:1257
351
- msgid "New Trackback"
352
- msgstr "Nuevo Trackback"
353
-
354
- #: includes/admin/class-bnfw-notification.php:294
355
- #: includes/admin/class-bnfw-notification.php:1260
356
- msgid "New Pingback"
357
- msgstr "Nuevo Pingback"
358
-
359
- #: includes/admin/class-bnfw-notification.php:301
360
- #: includes/admin/class-bnfw-notification.php:1329
361
- msgid "New Page Published"
362
- msgstr "Nueva página publicada"
363
-
364
- #: includes/admin/class-bnfw-notification.php:303
365
- msgid "Page Updated"
366
- msgstr "Página actualizada"
367
-
368
- #: includes/admin/class-bnfw-notification.php:305
369
- msgid "Page Pending Review"
370
- msgstr "Página pendiente de reseña"
371
-
372
- #: includes/admin/class-bnfw-notification.php:307
373
- msgid "New Private Page"
374
- msgstr ""
375
-
376
- #: includes/admin/class-bnfw-notification.php:309
377
- msgid "Page Scheduled"
378
- msgstr "Página programada"
379
-
380
- #: includes/admin/class-bnfw-notification.php:311
381
- msgid "Page - New Comment"
382
- msgstr "Página - Nuevo comentario"
383
-
384
- #: includes/admin/class-bnfw-notification.php:313
385
- msgid "Page - New Comment Awaiting Moderation"
386
- msgstr "Página: nuevo comentario pendiente de moderación"
387
-
388
- #: includes/admin/class-bnfw-notification.php:316
389
- #: includes/admin/class-bnfw-notification.php:1365
390
- msgid "Page - Comment Approved"
391
- msgstr "Página: comentario aprobado"
392
-
393
- #: includes/admin/class-bnfw-notification.php:319
394
- msgid "Page - Comment Reply"
395
- msgstr "Página - Responder al comentario"
396
-
397
- #: includes/admin/class-bnfw-notification.php:326
398
- #: includes/admin/class-bnfw-notification.php:1356
399
- msgid "New Media Published"
400
- msgstr "Nuevos medios publicados"
401
-
402
- #: includes/admin/class-bnfw-notification.php:328
403
- #: includes/admin/class-bnfw-notification.php:1359
404
- msgid "Media Updated"
405
- msgstr "Medios actualizados"
406
-
407
- #: includes/admin/class-bnfw-notification.php:330
408
- #: includes/admin/class-bnfw-notification.php:1362
409
- msgid "Media - New Comment"
410
- msgstr "Medios - Nuevo comentario"
411
-
412
- #: includes/admin/class-bnfw-notification.php:332
413
- #: includes/admin/class-bnfw-notification.php:1368
414
- msgid "Media - Comment Approved"
415
- msgstr ""
416
-
417
- #: includes/admin/class-bnfw-notification.php:335
418
- #: includes/admin/class-bnfw-notification.php:1371
419
- msgid "Media - New Comment Awaiting Moderation"
420
- msgstr "Medios - Nuevo comentario pendiente de moderación"
421
-
422
- #: includes/admin/class-bnfw-notification.php:337
423
- #: includes/admin/class-bnfw-notification.php:1374
424
- msgid "Media - Comment Reply"
425
- msgstr "Medios - Responder al comentario"
426
-
427
- #: includes/admin/class-bnfw-notification.php:355
428
- msgid "Custom Post Type"
429
- msgstr "Custom Post Type"
430
-
431
- #: includes/admin/class-bnfw-notification.php:357
432
- #: includes/admin/class-bnfw-notification.php:1389
433
- msgid "New "
434
- msgstr "Nuevo "
435
-
436
- #: includes/admin/class-bnfw-notification.php:357
437
- msgid " Published"
438
- msgstr "Publicado"
439
-
440
- #: includes/admin/class-bnfw-notification.php:359
441
- msgid "Updated"
442
- msgstr "Actualizado"
443
-
444
- #: includes/admin/class-bnfw-notification.php:361
445
- msgid "Pending Review"
446
- msgstr "Reseña pendiente"
447
-
448
- #: includes/admin/class-bnfw-notification.php:363
449
- #: includes/admin/class-bnfw-notification.php:1401
450
- msgid "New Private "
451
- msgstr ""
452
-
453
- #: includes/admin/class-bnfw-notification.php:365
454
- msgid "Scheduled"
455
- msgstr "Programado"
456
-
457
- #: includes/admin/class-bnfw-notification.php:372
458
- msgid "Comment Approved"
459
- msgstr "Comentario aprobado"
460
-
461
- #: includes/admin/class-bnfw-notification.php:394
462
- msgid "Custom Taxonomy"
463
- msgstr "Custom Taxonomy"
464
-
465
- #: includes/admin/class-bnfw-notification.php:400
466
- msgid "New"
467
- msgstr "Nuevo"
468
-
469
- #: includes/admin/class-bnfw-notification.php:419
470
- msgid ""
471
- "This notification doesn't support additional email fields due to a "
472
- "limitation in WordPress."
473
- msgstr ""
474
- "Esta notificación no admite campos de correo electrónico adicionales debido "
475
- "a una limitación en WordPress."
476
-
477
- #: includes/admin/class-bnfw-notification.php:426
478
- msgid "Email Formatting"
479
- msgstr "Email Formatting"
480
-
481
- #: includes/admin/class-bnfw-notification.php:427
482
- msgid ""
483
- "How do you want to format the sent email? HTML is recommended as it'll show "
484
- "images and links correctly."
485
- msgstr ""
486
-
487
- #: includes/admin/class-bnfw-notification.php:448
488
- msgid "Additional Email Fields"
489
- msgstr "Campos de email adicionales"
490
-
491
- #: includes/admin/class-bnfw-notification.php:449
492
- msgid ""
493
- "This should be fairly self explanatory but if you're unsure, tick this "
494
- "checkbox and have a look at the available options. You can always untick it "
495
- "again should you decide you don't need to use it."
496
- msgstr ""
497
-
498
- #: includes/admin/class-bnfw-notification.php:454
499
- msgid "Set \"From\" Name & Email, Reply To, CC, BCC"
500
- msgstr ""
501
-
502
- #: includes/admin/class-bnfw-notification.php:461
503
- msgid "From Name and Email"
504
- msgstr "Nombre y email \"De\""
505
-
506
- #: includes/admin/class-bnfw-notification.php:462
507
- msgid ""
508
- "If you want to send the email from your site name and email address instead "
509
- "of the default \"WordPress\" from \"wordpress@domain.com\", this is where "
510
- "you can do it."
511
- msgstr ""
512
-
513
- #: includes/admin/class-bnfw-notification.php:466
514
- msgid "Site Name"
515
- msgstr ""
516
-
517
- #: includes/admin/class-bnfw-notification.php:468
518
- msgid "Site Email"
519
- msgstr ""
520
-
521
- #: includes/admin/class-bnfw-notification.php:475
522
- msgid "Reply To"
523
- msgstr ""
524
-
525
- #: includes/admin/class-bnfw-notification.php:476
526
- msgid ""
527
- "If you want any replies to your email notification to go to another person, "
528
- "fill in this box with their name and email address."
529
- msgstr ""
530
-
531
- #: includes/admin/class-bnfw-notification.php:480
532
- msgid "Name"
533
- msgstr ""
534
-
535
- #: includes/admin/class-bnfw-notification.php:482
536
- msgid "Email"
537
- msgstr "Correo electrónico"
538
-
539
- #: includes/admin/class-bnfw-notification.php:488
540
- msgid "CC"
541
- msgstr "CC"
542
-
543
- #: includes/admin/class-bnfw-notification.php:489
544
- msgid "Publicly copy in any other users or user roles to this email."
545
- msgstr ""
546
-
547
- #: includes/admin/class-bnfw-notification.php:494
548
- #: includes/admin/class-bnfw-notification.php:508
549
- #: includes/admin/class-bnfw-notification.php:557
550
- #: includes/admin/class-bnfw-notification.php:575
551
- msgid "Select User Roles / Users"
552
- msgstr "Seleccionar roles de usuario / usuarios"
553
-
554
- #: includes/admin/class-bnfw-notification.php:502
555
- msgid "BCC"
556
- msgstr "BCC"
557
-
558
- #: includes/admin/class-bnfw-notification.php:503
559
- msgid "Privately copy in any other users or user roles to this email."
560
- msgstr ""
561
-
562
- #: includes/admin/class-bnfw-notification.php:518
563
- msgid "Send to Author"
564
- msgstr ""
565
-
566
- #: includes/admin/class-bnfw-notification.php:519
567
- msgid ""
568
- "E.g. If you want a new post published notification to go to the post author, "
569
- "tick this box."
570
- msgstr ""
571
-
572
- #: includes/admin/class-bnfw-notification.php:526
573
- msgid "Send this notification to the Author"
574
- msgstr "Envíe esta notificación al autor"
575
-
576
- #: includes/admin/class-bnfw-notification.php:536
577
- msgid ""
578
- "E.g. If you're an editor and regularly update your posts, you might not want "
579
- "to be emailed about this all the time. Ticking this box will prevent you "
580
- "from receiving emails about your own changes."
581
- msgstr ""
582
-
583
- #: includes/admin/class-bnfw-notification.php:542
584
- msgid "Do not send this Notification to the User that triggered it"
585
- msgstr "No envíe esta notificación al usuario que la activó"
586
-
587
- #: includes/admin/class-bnfw-notification.php:551
588
- msgid "Send To"
589
- msgstr "Enviar A"
590
-
591
- #: includes/admin/class-bnfw-notification.php:552
592
- msgid "Choose the users and/or user roles to send this email notification to."
593
- msgstr ""
594
-
595
- #: includes/admin/class-bnfw-notification.php:565
596
- msgid "Except For"
597
- msgstr ""
598
-
599
- #: includes/admin/class-bnfw-notification.php:568
600
- msgid ""
601
- "Choose the users and/or user roles that this notification should not be sent "
602
- "to."
603
- msgstr ""
604
-
605
- #: includes/admin/class-bnfw-notification.php:593
606
- msgid ""
607
- "You have chosen to send this notification to over 200 users. Please check "
608
- "the email sending rate limit at your host before sending."
609
- msgstr ""
610
-
611
- #: includes/admin/class-bnfw-notification.php:603
612
- #: includes/admin/class-bnfw-notification.php:1129
613
- msgid "Subject"
614
- msgstr "Asunto"
615
-
616
- #: includes/admin/class-bnfw-notification.php:604
617
- msgid "Notification subject. You can use "
618
- msgstr "Asunto de la notificación. Puedes usar"
619
-
620
- #: includes/admin/class-bnfw-notification.php:604
621
- #: includes/admin/class-bnfw-notification.php:618
622
- msgid " here."
623
- msgstr ""
624
-
625
- #: includes/admin/class-bnfw-notification.php:617
626
- msgid "Message Body"
627
- msgstr "Cuerpo del mensaje"
628
-
629
- #: includes/admin/class-bnfw-notification.php:618
630
- msgid "Notification message. You can use "
631
- msgstr "Mensaje de notificación. Puedes usar"
632
-
633
- #: includes/admin/class-bnfw-notification.php:626
634
- msgid "Need some more help?"
635
- msgstr ""
636
-
637
- #: includes/admin/class-bnfw-notification.php:636
638
- msgid "Insert Default Content"
639
- msgstr "Insertar contenido predeterminado"
640
-
641
- #: includes/admin/class-bnfw-notification.php:640
642
- msgid "Read Documentation"
643
- msgstr ""
644
-
645
- #: includes/admin/class-bnfw-notification.php:644
646
- msgid "Find Shortcodes"
647
- msgstr ""
648
-
649
- #: includes/admin/class-bnfw-notification.php:655
650
- msgid ""
651
- "Stop additional paragraph and line break HTML from being inserted into my "
652
- "notifications"
653
- msgstr ""
654
-
655
- #: includes/admin/class-bnfw-notification.php:710
656
- msgid ""
657
- "You must choose at least one User or User Role to send the notification to "
658
- "before you can save"
659
- msgstr ""
660
-
661
- #: includes/admin/class-bnfw-notification.php:825
662
- msgid "Test Notification Sent."
663
- msgstr "Test de notificación enviado."
664
-
665
- #: includes/admin/class-bnfw-notification.php:915
666
- msgid "Notification saved."
667
- msgstr "Notificación guardada."
668
-
669
- #: includes/admin/class-bnfw-notification.php:934
670
- #: includes/admin/class-bnfw-notification.php:992
671
- #: includes/admin/class-bnfw-notification.php:994
672
- msgid "Save"
673
- msgstr "Guardar"
674
-
675
- #: includes/admin/class-bnfw-notification.php:942
676
- msgid ""
677
- "Use this to enable or disable notifications. If you want to disable a "
678
- "default WordPress notification, just create it on the left, then disable it "
679
- "here."
680
- msgstr ""
681
-
682
- #: includes/admin/class-bnfw-notification.php:949
683
- msgid "Notification Enabled"
684
- msgstr "Notificación habilitada"
685
-
686
- #: includes/admin/class-bnfw-notification.php:956
687
- msgid "Notification Disabled"
688
- msgstr "Notificación deshabilitado"
689
-
690
- #: includes/admin/class-bnfw-notification.php:967
691
- msgid "Send Me a Test Email"
692
- msgstr "Enviarme un email de prueba"
693
-
694
- #: includes/admin/class-bnfw-notification.php:969
695
- msgid ""
696
- "This will send you (the currently logged in user) a notification so that you "
697
- "can check for any issues with formatting – it’s doesn't mean that a "
698
- "notification will send correctly in the future. You can read about how to "
699
- "improve email delivery"
700
- msgstr ""
701
-
702
- #: includes/admin/class-bnfw-notification.php:969
703
- msgid "here"
704
- msgstr ""
705
-
706
- #: includes/admin/class-bnfw-notification.php:969
707
- msgid ". Shortcodes will not be replaced with content."
708
- msgstr ""
709
-
710
- #: includes/admin/class-bnfw-notification.php:980
711
- msgid "Delete Permanently"
712
- msgstr "Borrar definitivamente"
713
-
714
- #: includes/admin/class-bnfw-notification.php:982
715
- msgid "Move to Trash"
716
- msgstr "Enviar a la papelera"
717
-
718
- #: includes/admin/class-bnfw-notification.php:1127
719
- msgid "Notification Type"
720
- msgstr "Tipo de notificación"
721
-
722
- #: includes/admin/class-bnfw-notification.php:1128
723
- msgid "Enabled?"
724
- msgstr "Habilitado?"
725
-
726
- #: includes/admin/class-bnfw-notification.php:1130
727
- msgid "User Roles / Users"
728
- msgstr "Roles de Usuario / Usuarios"
729
-
730
- #: includes/admin/class-bnfw-notification.php:1131
731
- msgid "Excluded User Roles / Users"
732
- msgstr "Usuarios / roles de usuario excluidos"
733
-
734
- #: includes/admin/class-bnfw-notification.php:1172
735
- msgid ", Post Author"
736
- msgstr ""
737
-
738
- #: includes/admin/class-bnfw-notification.php:1338
739
- msgid "Privacy – Confirm Action: Export Data Request – For User"
740
- msgstr ""
741
-
742
- #: includes/admin/class-bnfw-notification.php:1341
743
- msgid "Privacy – Confirm Action: Erase Data Request – For User"
744
- msgstr ""
745
-
746
- #: includes/admin/class-bnfw-notification.php:1389
747
- msgid "Published"
748
- msgstr "Publicado"
749
-
750
- #: includes/admin/class-bnfw-notification.php:1392
751
- msgid "Updated "
752
- msgstr "Actualizado "
753
-
754
- #: includes/admin/class-bnfw-notification.php:1395
755
- msgid " Pending Review"
756
- msgstr " Reseña pendiente"
757
-
758
- #: includes/admin/class-bnfw-notification.php:1398
759
- msgid " Scheduled"
760
- msgstr " Programado"
761
-
762
- #: includes/admin/class-bnfw-notification.php:1404
763
- msgid " Comment"
764
- msgstr " Comentario"
765
-
766
- #: includes/admin/class-bnfw-notification.php:1410
767
- msgid " Comment Reply"
768
- msgstr "Comentar Responder"
769
-
770
- #: includes/admin/class-bnfw-notification.php:1413
771
- msgid " Comment Approved"
772
- msgstr "Comentario aprobado"
773
-
774
- #: includes/admin/class-bnfw-notification.php:1418
775
- msgid "New Term"
776
- msgstr "Nuevo término"
777
-
778
- #: includes/admin/class-bnfw-notification.php:1420
779
- msgid "New Term in "
780
- msgstr "Nuevo término en"
781
-
782
- #: includes/admin/class-bnfw-notification.php:1440
783
- msgid "Enable Notifications"
784
- msgstr "Permitir notificaciones"
785
-
786
- #: includes/admin/class-bnfw-notification.php:1441
787
- msgid "Disable Notifications"
788
- msgstr "Desactivar notificaciones"
789
-
790
- #: includes/admin/class-bnfw-notification.php:1502
791
- msgid "Enable Notification"
792
- msgstr "Habilitar la notificación"
793
-
794
- #: includes/admin/class-bnfw-notification.php:1510
795
- msgid "Disable Notification"
796
- msgstr "Desactivar notificación"
797
-
798
- #: includes/admin/class-bnfw-notification.php:1568
799
- msgid "Enabled 1 Notification."
800
- msgstr "Habilitado 1 Notificación."
801
-
802
- #: includes/admin/class-bnfw-notification.php:1572
803
- msgid "Disabled 1 Notification."
804
- msgstr "Notificación de discapacitados 1."
805
-
806
- #: includes/admin/class-bnfw-notification.php:1578
807
- #, php-format
808
- msgid "Enabled %s Notification."
809
- msgid_plural "Enabled %s Notifications."
810
- msgstr[0] "Notificación %s habilitada."
811
- msgstr[1] "Notificaciones %s habilitadas."
812
-
813
- #: includes/admin/class-bnfw-notification.php:1588
814
- #, php-format
815
- msgid "Disabled %s Notification."
816
- msgid_plural "Disabled %s Notifications."
817
- msgstr[0] "Notificación %s desactivada."
818
- msgstr[1] "Notificaciones %s desactivadas."
819
-
820
- #: includes/admin/class-bnfw-notification.php:1602
821
- msgid ""
822
- "If you send out notifications with BNFW but don't receive them, you may need "
823
- "to install an SMTP plugin to <a href=\"https://betternotificationsforwp.com/"
824
- "documentation/getting-started/how-to-improve-email-delivery/\" target="
825
- "\"_blank\">improve email deliverability</a>. I recommend using <a href="
826
- "\"https://wordpress.org/plugins/post-smtp/\" target=\"_blank\">Post SMTP</a> "
827
- "as it's easy to set-up or <a href=\"https://wordpress.org/plugins/email-log/"
828
- "\" target=\"_blank\">Email Log</a> to just log and view emails that are sent."
829
- msgstr ""
830
-
831
- #: includes/engine/class-bnfw-engine.php:18
832
- msgid "Test Email:"
833
- msgstr "Email de prueba:"
834
-
835
- #: includes/engine/class-bnfw-engine.php:19
836
- msgid ""
837
- "This is a test email. All shortcodes below will show in place but not be "
838
- "replaced with content."
839
- msgstr ""
840
-
841
- #: includes/engine/class-bnfw-engine.php:1583
842
- msgid "Error: Download link is not available please contact support"
843
- msgstr ""
844
-
845
- #: includes/helpers/ajax-helpers.php:34 includes/helpers/helpers.php:38
846
- msgid "User Roles"
847
- msgstr "Roles del usuario"
848
-
849
- #: includes/helpers/ajax-helpers.php:57 includes/helpers/helpers.php:59
850
- #: includes/helpers/helpers.php:64
851
- msgid "Users"
852
- msgstr ""
853
-
854
- #: includes/helpers/helpers.php:103
855
- msgid "Non WordPress Users"
856
- msgstr ""
857
-
858
- #: includes/import.php:69
859
- msgid " for "
860
- msgstr " para "
861
-
862
- #: includes/import.php:69
863
- msgid " (Auto Imported)"
864
- msgstr " (auto importación)"
865
-
866
- #: includes/libraries/EDD_SL_Plugin_Updater.php:228
867
- #, php-format
868
- msgid ""
869
- "There is a new version of %1$s available. %2$sView version %3$s details%4$s."
870
- msgstr ""
871
-
872
- #: includes/libraries/EDD_SL_Plugin_Updater.php:236
873
- #, php-format
874
- msgid ""
875
- "There is a new version of %1$s available. %2$sView version %3$s details%4$s "
876
- "or %5$supdate now%6$s."
877
- msgstr ""
878
-
879
- #: includes/libraries/EDD_SL_Plugin_Updater.php:474
880
- msgid "You do not have permission to install plugin updates"
881
- msgstr ""
882
-
883
- #: includes/libraries/EDD_SL_Plugin_Updater.php:474
884
- msgid "Error"
885
- msgstr ""
886
-
887
- #: includes/license/class-bnfw-license-setting.php:18
888
- #: includes/license/class-bnfw-license-setting.php:19
889
- msgid "Add-on Licenses"
890
- msgstr ""
891
-
892
- #: includes/license/class-bnfw-license-setting.php:38
893
- msgid "BNFW Add-on Licenses"
894
- msgstr ""
895
-
896
- #: includes/license/class-bnfw-license-setting.php:47
897
- msgid "Save License"
898
- msgstr ""
899
-
900
- #: includes/license/class-bnfw-license-setting.php:55
901
- msgid ""
902
- "<br>You have no BNFW Premium Add-ons installed yet.<br>You can buy add-ons "
903
- "from the <a href=\""
904
- msgstr ""
905
-
906
- #: includes/license/class-bnfw-license-setting.php:130
907
- msgid "Deactivate License"
908
- msgstr ""
909
-
910
- #: includes/license/class-bnfw-license.php:140
911
- #, php-format
912
- msgid "%1$s License Key"
913
- msgstr ""
914
-
915
- #: includes/overrides.php:41 includes/overrides.php:135
916
- #, php-format
917
- msgid "New user registration on your site %s:"
918
- msgstr "Nuevo usuario registrado en tu sitio %s:"
919
-
920
- #: includes/overrides.php:42 includes/overrides.php:117
921
- #: includes/overrides.php:136 includes/overrides.php:152
922
- #, php-format
923
- msgid "Username: %s"
924
- msgstr "Nombre de Usuario: %s"
925
-
926
- #: includes/overrides.php:43 includes/overrides.php:137
927
- #, php-format
928
- msgid "E-mail: %s"
929
- msgstr "Email: %s"
930
-
931
- #. translators: Password change notification email subject. %s: Site title
932
- #: includes/overrides.php:48 includes/overrides.php:139
933
- #, php-format
934
- msgid "[%s] New User Registration"
935
- msgstr "[%s] Registro de nuevo usuario"
936
-
937
- #: includes/overrides.php:118
938
- msgid "To set your password, visit the following address:"
939
- msgstr ""
940
-
941
- #: includes/overrides.php:123
942
- #, php-format
943
- msgid "[%s] Your username and password info"
944
- msgstr "[%s] Tu nombre de usuario y contraseña"
945
-
946
- #: includes/overrides.php:153
947
- #, php-format
948
- msgid "Password: %s"
949
- msgstr "Clave: %s"
950
-
951
- #: includes/overrides.php:156
952
- #, php-format
953
- msgid "[%s] Your username and password"
954
- msgstr "[%s] Tu nombre de usuario y clave"
955
-
956
- #. translators: %s: user name
957
- #: includes/overrides.php:184
958
- #, php-format
959
- msgid "Password changed for user: %s"
960
- msgstr "Contraseña cambiada para el usuario: %s"
961
-
962
- #. translators: %s: site title
963
- #: includes/overrides.php:189
964
- #, php-format
965
- msgid "[%s] Password Changed"
966
- msgstr ""
967
-
968
- #. Plugin Name of the plugin/theme
969
- msgid "Better Notifications for WP"
970
- msgstr "Better Notifications for WP"
971
-
972
- #. Plugin URI of the plugin/theme
973
- #, fuzzy
974
- #| msgid "http://wordpress.org/plugins/bnfw/"
975
- msgid "https://wordpress.org/plugins/bnfw/"
976
- msgstr "http://wordpress.org/plugins/bnfw/"
977
-
978
- #. Description of the plugin/theme
979
- msgid ""
980
- "Supercharge your WordPress notifications using a WYSIWYG editor and "
981
- "shortcodes. Default and new notifications available. Add more power with Add-"
982
- "ons."
983
- msgstr ""
984
-
985
- #. Author of the plugin/theme
986
- msgid "Made with Fuel"
987
- msgstr "Hecho con Fuel"
988
-
989
- #. Author URI of the plugin/theme
990
- msgid "https://madewithfuel.com/"
991
- msgstr ""
992
-
993
- #~ msgid ""
994
- #~ "Looking for help with shortcodes? Click here to see which ones you can "
995
- #~ "use with the selected notification."
996
- #~ msgstr ""
997
- #~ "Buscando ayuda con shortcodes? Click aquí para ver cuales puedes usar con "
998
- #~ "la notificación seleccionada."
999
-
1000
- #~ msgid "New User - Welcome Email"
1001
- #~ msgstr "Nuevo Usuario - Email de bienvenida"
1002
-
1003
- #~ msgid "New User - Welcome email"
1004
- #~ msgstr "Nuevo usuario - Email de bienvenida"
1005
-
1006
- #~ msgid ""
1007
- #~ "Send customisable HTML emails to your users for different WordPress "
1008
- #~ "notifications."
1009
- #~ msgstr ""
1010
- #~ "Enviar emails HTML configurables a tus usuarios por distintas "
1011
- #~ "notificaciones de WordPress."
1012
-
1013
- #~ msgid "Show additional email fields"
1014
- #~ msgstr "Mostrar campos de email adicionales"
1015
-
1016
- #~ msgid "Update "
1017
- #~ msgstr "Actualizar "
1018
-
1019
- #~ msgid "https://betternotificationsforwp.com/"
1020
- #~ msgstr "https://betternotificationsforwp.com/"
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Better Notifications for WP 1.3.3\n"
4
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/bnfw\n"
5
+ "POT-Creation-Date: 2020-11-27 21:34+0800\n"
6
+ "PO-Revision-Date: 2020-11-28 00:01+0800\n"
7
+ "Last-Translator: \n"
8
+ "Language-Team: \n"
9
+ "Language: es\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 2.2\n"
14
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
+
16
+ #: bnfw.php:283 includes/admin/bnfw-settings.php:15
17
+ msgid "Settings"
18
+ msgstr "Ajustes"
19
+
20
+ #: includes/admin/bnfw-settings.php:14
21
+ #: includes/admin/class-bnfw-notification.php:129
22
+ msgid "Notification Settings"
23
+ msgstr "Configuración de las notificaciones"
24
+
25
+ #: includes/admin/bnfw-settings.php:38
26
+ msgid "BNFW Settings"
27
+ msgstr "Ajsutes de BNFW"
28
+
29
+ #: includes/admin/bnfw-settings.php:46
30
+ msgid "Save Settings"
31
+ msgstr "AjustesGuardar ajustes"
32
+
33
+ #: includes/admin/bnfw-settings.php:73
34
+ msgid "Documentation"
35
+ msgstr ""
36
+
37
+ #: includes/admin/bnfw-settings.php:80
38
+ msgid "Premium Add-ons"
39
+ msgstr ""
40
+
41
+ #: includes/admin/bnfw-settings.php:87
42
+ msgid "Priority Support"
43
+ msgstr ""
44
+
45
+ #: includes/admin/bnfw-settings.php:150
46
+ msgid "Suppress SPAM comment notification"
47
+ msgstr "Excluir notificaciones de comentarios marcados como SPAM"
48
+
49
+ #: includes/admin/bnfw-settings.php:150
50
+ msgid ""
51
+ "Comments that are correctly marked as SPAM by a 3rd party plugin (such as "
52
+ "Akismet) will not generate a notification if this is ticked."
53
+ msgstr ""
54
+
55
+ #: includes/admin/bnfw-settings.php:155
56
+ msgid "Don't send notifications for comments marked as SPAM"
57
+ msgstr "No envíe notificaciones de comentarios marcados como SPAM"
58
+
59
+ #: includes/admin/bnfw-settings.php:167
60
+ msgid "Default Email Format"
61
+ msgstr "Formato de email predeterminado"
62
+
63
+ #: includes/admin/bnfw-settings.php:167
64
+ #, fuzzy
65
+ #| msgid ""
66
+ #| "This will apply to all emails sent out via WordPress, even those from "
67
+ #| "other plugins. For more details, please see the <a href=\"https://"
68
+ #| "wordpress.org/plugins/bnfw/faq/\" target=\"_blank\">FAQ</a>."
69
+ msgid ""
70
+ "This will apply to all emails sent out via WordPress, even those from other "
71
+ "plugins. For more details, please see the "
72
+ msgstr ""
73
+ "Esto aplicará a todos los emails enviados vía WordPress, incluso desde otros "
74
+ "plugins. Para más detalles, por favor mira <a href=\"https://wordpress.org/"
75
+ "plugins/bnfw/faq/\" target=\"_blank\">FAQ</a>."
76
+
77
+ #: includes/admin/bnfw-settings.php:181
78
+ msgid "Enable Content Shortcodes?"
79
+ msgstr ""
80
+
81
+ #: includes/admin/bnfw-settings.php:181
82
+ msgid "Shortcodes in the post/page content are disabled by default."
83
+ msgstr ""
84
+
85
+ #: includes/admin/bnfw-settings.php:186
86
+ msgid "Enable shortcode output in the page/post content"
87
+ msgstr ""
88
+
89
+ #: includes/admin/bnfw-settings.php:198
90
+ msgid "Allow Usage Tracking?"
91
+ msgstr ""
92
+
93
+ #: includes/admin/bnfw-settings.php:203
94
+ msgid ""
95
+ "Allow Better Notifications for WP to anonymously track how this plugin is "
96
+ "used and help make the plugin better."
97
+ msgstr ""
98
+
99
+ #: includes/admin/bnfw-settings.php:251
100
+ #: includes/admin/class-bnfw-notification.php:433
101
+ msgid "HTML Formatting"
102
+ msgstr "Formato HTML"
103
+
104
+ #: includes/admin/bnfw-settings.php:256
105
+ #: includes/admin/class-bnfw-notification.php:439
106
+ msgid "Plain Text"
107
+ msgstr "Texto plano"
108
+
109
+ #: includes/admin/class-bnfw-notification.php:52
110
+ #: includes/admin/class-bnfw-notification.php:55
111
+ #: includes/admin/class-bnfw-notification.php:56
112
+ msgid "Notifications"
113
+ msgstr "Notificaciones"
114
+
115
+ #: includes/admin/class-bnfw-notification.php:53
116
+ msgid "Notification"
117
+ msgstr "Notificación"
118
+
119
+ #: includes/admin/class-bnfw-notification.php:54
120
+ msgid "Add New"
121
+ msgstr "Añadir nuevo"
122
+
123
+ #: includes/admin/class-bnfw-notification.php:57
124
+ msgid "Add New Notification"
125
+ msgstr "Añadir nuevo aviso"
126
+
127
+ #: includes/admin/class-bnfw-notification.php:58
128
+ msgid "Edit Notification"
129
+ msgstr "Editar notificación"
130
+
131
+ #: includes/admin/class-bnfw-notification.php:59
132
+ msgid "New Notification"
133
+ msgstr "Nueva notificación"
134
+
135
+ #: includes/admin/class-bnfw-notification.php:60
136
+ msgid "View Notification"
137
+ msgstr "Ver notificación"
138
+
139
+ #: includes/admin/class-bnfw-notification.php:61
140
+ msgid "Search Notifications"
141
+ msgstr "Buscar notificaciones"
142
+
143
+ #: includes/admin/class-bnfw-notification.php:62
144
+ msgid "No Notifications found"
145
+ msgstr "No hemos encontrado notificaciones"
146
+
147
+ #: includes/admin/class-bnfw-notification.php:63
148
+ msgid "No Notifications found in trash"
149
+ msgstr "No encontramos notificaciones en la Papelera"
150
+
151
+ #: includes/admin/class-bnfw-notification.php:64
152
+ msgid "All Notifications"
153
+ msgstr "Todas las notificaciones"
154
+
155
+ #: includes/admin/class-bnfw-notification.php:138
156
+ msgid "Save Notification"
157
+ msgstr "Guardar notificacion"
158
+
159
+ #: includes/admin/class-bnfw-notification.php:186
160
+ msgid "Notification For"
161
+ msgstr "Notificación por"
162
+
163
+ #: includes/admin/class-bnfw-notification.php:187
164
+ msgid ""
165
+ "E.g. If you select \"New Post Published\" from the list on the right, this "
166
+ "notification will be sent when a new post is published."
167
+ msgstr ""
168
+
169
+ #: includes/admin/class-bnfw-notification.php:191
170
+ msgid "Select the notification type"
171
+ msgstr "Seleccione el tipo de notificación"
172
+
173
+ #: includes/admin/class-bnfw-notification.php:192
174
+ msgid "Admin"
175
+ msgstr ""
176
+
177
+ #: includes/admin/class-bnfw-notification.php:194
178
+ #: includes/admin/class-bnfw-notification.php:1302
179
+ msgid "New User Registration - For Admin"
180
+ msgstr "Nuevo usuario registrado - para Admin"
181
+
182
+ #: includes/admin/class-bnfw-notification.php:196
183
+ #: includes/admin/class-bnfw-notification.php:1269
184
+ msgid "User Lost Password - For Admin"
185
+ msgstr "No recuerdo la clave - para Admin"
186
+
187
+ #: includes/admin/class-bnfw-notification.php:198
188
+ #: includes/admin/class-bnfw-notification.php:1272
189
+ msgid "Password Changed - For Admin"
190
+ msgstr "Contraseña cambiada: para administrador"
191
+
192
+ #: includes/admin/class-bnfw-notification.php:200
193
+ #: includes/admin/class-bnfw-notification.php:1275
194
+ msgid "User Email Changed - For Admin"
195
+ msgstr "Correo electrónico de usuario modificado: para administrador"
196
+
197
+ #: includes/admin/class-bnfw-notification.php:202
198
+ #: includes/admin/class-bnfw-notification.php:1308
199
+ msgid "User Role Changed - For Admin"
200
+ msgstr "Cambio de rol de usuario: para administrador"
201
+
202
+ #: includes/admin/class-bnfw-notification.php:204
203
+ #: includes/admin/class-bnfw-notification.php:1296
204
+ msgid "User Logged In - For Admin"
205
+ msgstr "Usuario conectado: para administrador"
206
+
207
+ #: includes/admin/class-bnfw-notification.php:206
208
+ #: includes/admin/class-bnfw-notification.php:1287
209
+ msgid "WordPress Core Automatic Background Updates"
210
+ msgstr ""
211
+
212
+ #: includes/admin/class-bnfw-notification.php:210
213
+ #: includes/admin/class-bnfw-notification.php:1344
214
+ msgid "Privacy - Confirm Action: Export Data Request - For Admin"
215
+ msgstr ""
216
+
217
+ #: includes/admin/class-bnfw-notification.php:214
218
+ #: includes/admin/class-bnfw-notification.php:1347
219
+ msgid "Privacy - Confirm Action: Erase Data Request - For Admin"
220
+ msgstr ""
221
+
222
+ #: includes/admin/class-bnfw-notification.php:222
223
+ msgid "Transactional"
224
+ msgstr ""
225
+
226
+ #: includes/admin/class-bnfw-notification.php:224
227
+ #: includes/admin/class-bnfw-notification.php:1290
228
+ msgid "New User Registration - For User"
229
+ msgstr "Nuevo usuario registrado - para Usuario"
230
+
231
+ #: includes/admin/class-bnfw-notification.php:226
232
+ #: includes/admin/class-bnfw-notification.php:1299
233
+ msgid "New User - Post-registration Email"
234
+ msgstr "Nuevo usuario: correo electrónico posterior al registro"
235
+
236
+ #: includes/admin/class-bnfw-notification.php:228
237
+ #: includes/admin/class-bnfw-notification.php:1266
238
+ msgid "User Lost Password - For User"
239
+ msgstr "Usuario contraseña perdida: para el usuario"
240
+
241
+ #: includes/admin/class-bnfw-notification.php:230
242
+ #: includes/admin/class-bnfw-notification.php:1278
243
+ msgid "Password Changed - For User"
244
+ msgstr "Contraseña cambiada: para el usuario"
245
+
246
+ #: includes/admin/class-bnfw-notification.php:232
247
+ #: includes/admin/class-bnfw-notification.php:1281
248
+ msgid "User Email Changed Confirmation - For User"
249
+ msgstr ""
250
+ "Confirmación de cambio de correo electrónico del usuario: para el usuario"
251
+
252
+ #: includes/admin/class-bnfw-notification.php:235
253
+ #: includes/admin/class-bnfw-notification.php:1284
254
+ msgid "User Email Changed - For User"
255
+ msgstr "Se cambió el correo electrónico del usuario: para el usuario"
256
+
257
+ #: includes/admin/class-bnfw-notification.php:237
258
+ #: includes/admin/class-bnfw-notification.php:1305
259
+ msgid "User Role Changed - For User"
260
+ msgstr "Cambio de rol de usuario: para el usuario"
261
+
262
+ #: includes/admin/class-bnfw-notification.php:239
263
+ #: includes/admin/class-bnfw-notification.php:1293
264
+ msgid "User Logged In - For User"
265
+ msgstr "Usuario conectado: para usuario"
266
+
267
+ #: includes/admin/class-bnfw-notification.php:241
268
+ #: includes/admin/class-bnfw-notification.php:375
269
+ #: includes/admin/class-bnfw-notification.php:1263
270
+ msgid "Comment Reply"
271
+ msgstr "Respuesta a comentario"
272
+
273
+ #: includes/admin/class-bnfw-notification.php:245
274
+ msgid "Privacy - Confirm Action: Export Data Request - For User"
275
+ msgstr ""
276
+
277
+ #: includes/admin/class-bnfw-notification.php:249
278
+ msgid "Privacy - Confirm Action: Erase Data Request - For User"
279
+ msgstr ""
280
+
281
+ #: includes/admin/class-bnfw-notification.php:253
282
+ #: includes/admin/class-bnfw-notification.php:1350
283
+ msgid "Privacy - Data Export - For User"
284
+ msgstr ""
285
+
286
+ #: includes/admin/class-bnfw-notification.php:257
287
+ #: includes/admin/class-bnfw-notification.php:1353
288
+ msgid "Privacy - Data Erased - For User"
289
+ msgstr ""
290
+
291
+ #: includes/admin/class-bnfw-notification.php:267
292
+ #: includes/admin/class-bnfw-notification.php:1311
293
+ msgid "New Post Published"
294
+ msgstr "Nuevo post publicado"
295
+
296
+ #: includes/admin/class-bnfw-notification.php:269
297
+ #: includes/admin/class-bnfw-notification.php:1314
298
+ msgid "Post Updated"
299
+ msgstr "Post actualizado"
300
+
301
+ #: includes/admin/class-bnfw-notification.php:271
302
+ #: includes/admin/class-bnfw-notification.php:1317
303
+ msgid "Post Pending Review"
304
+ msgstr "Post pendiente de reseña"
305
+
306
+ #: includes/admin/class-bnfw-notification.php:273
307
+ #: includes/admin/class-bnfw-notification.php:1320
308
+ msgid "New Private Post"
309
+ msgstr ""
310
+
311
+ #: includes/admin/class-bnfw-notification.php:275
312
+ #: includes/admin/class-bnfw-notification.php:1323
313
+ msgid "Post Scheduled"
314
+ msgstr "Post programado"
315
+
316
+ #: includes/admin/class-bnfw-notification.php:277
317
+ #: includes/admin/class-bnfw-notification.php:1326
318
+ msgid "Published Post Moved to Trash"
319
+ msgstr "La publicación publicada se movió a la papelera"
320
+
321
+ #: includes/admin/class-bnfw-notification.php:279
322
+ #: includes/admin/class-bnfw-notification.php:367
323
+ #: includes/admin/class-bnfw-notification.php:1248
324
+ msgid "New Comment"
325
+ msgstr "Nuevo comentario"
326
+
327
+ #: includes/admin/class-bnfw-notification.php:282
328
+ #: includes/admin/class-bnfw-notification.php:369
329
+ #: includes/admin/class-bnfw-notification.php:1254
330
+ #: includes/admin/class-bnfw-notification.php:1407
331
+ msgid "New Comment Awaiting Moderation"
332
+ msgstr "Nuevo comentario / Esperando moderación"
333
+
334
+ #: includes/admin/class-bnfw-notification.php:285
335
+ #: includes/admin/class-bnfw-notification.php:1251
336
+ msgid "Post - Comment Approved"
337
+ msgstr ""
338
+
339
+ #: includes/admin/class-bnfw-notification.php:288
340
+ #: includes/admin/class-bnfw-notification.php:1332
341
+ msgid "New Category"
342
+ msgstr "Nueva categoría"
343
+
344
+ #: includes/admin/class-bnfw-notification.php:290
345
+ #: includes/admin/class-bnfw-notification.php:1335
346
+ msgid "New Tag"
347
+ msgstr "Nueva etiqueta"
348
+
349
+ #: includes/admin/class-bnfw-notification.php:292
350
+ #: includes/admin/class-bnfw-notification.php:1257
351
+ msgid "New Trackback"
352
+ msgstr "Nuevo Trackback"
353
+
354
+ #: includes/admin/class-bnfw-notification.php:294
355
+ #: includes/admin/class-bnfw-notification.php:1260
356
+ msgid "New Pingback"
357
+ msgstr "Nuevo Pingback"
358
+
359
+ #: includes/admin/class-bnfw-notification.php:301
360
+ #: includes/admin/class-bnfw-notification.php:1329
361
+ msgid "New Page Published"
362
+ msgstr "Nueva página publicada"
363
+
364
+ #: includes/admin/class-bnfw-notification.php:303
365
+ msgid "Page Updated"
366
+ msgstr "Página actualizada"
367
+
368
+ #: includes/admin/class-bnfw-notification.php:305
369
+ msgid "Page Pending Review"
370
+ msgstr "Página pendiente de reseña"
371
+
372
+ #: includes/admin/class-bnfw-notification.php:307
373
+ msgid "New Private Page"
374
+ msgstr ""
375
+
376
+ #: includes/admin/class-bnfw-notification.php:309
377
+ msgid "Page Scheduled"
378
+ msgstr "Página programada"
379
+
380
+ #: includes/admin/class-bnfw-notification.php:311
381
+ msgid "Page - New Comment"
382
+ msgstr "Página - Nuevo comentario"
383
+
384
+ #: includes/admin/class-bnfw-notification.php:313
385
+ msgid "Page - New Comment Awaiting Moderation"
386
+ msgstr "Página: nuevo comentario pendiente de moderación"
387
+
388
+ #: includes/admin/class-bnfw-notification.php:316
389
+ #: includes/admin/class-bnfw-notification.php:1365
390
+ msgid "Page - Comment Approved"
391
+ msgstr "Página: comentario aprobado"
392
+
393
+ #: includes/admin/class-bnfw-notification.php:319
394
+ msgid "Page - Comment Reply"
395
+ msgstr "Página - Responder al comentario"
396
+
397
+ #: includes/admin/class-bnfw-notification.php:326
398
+ #: includes/admin/class-bnfw-notification.php:1356
399
+ msgid "New Media Published"
400
+ msgstr "Nuevos medios publicados"
401
+
402
+ #: includes/admin/class-bnfw-notification.php:328
403
+ #: includes/admin/class-bnfw-notification.php:1359
404
+ msgid "Media Updated"
405
+ msgstr "Medios actualizados"
406
+
407
+ #: includes/admin/class-bnfw-notification.php:330
408
+ #: includes/admin/class-bnfw-notification.php:1362
409
+ msgid "Media - New Comment"
410
+ msgstr "Medios - Nuevo comentario"
411
+
412
+ #: includes/admin/class-bnfw-notification.php:332
413
+ #: includes/admin/class-bnfw-notification.php:1368
414
+ msgid "Media - Comment Approved"
415
+ msgstr ""
416
+
417
+ #: includes/admin/class-bnfw-notification.php:335
418
+ #: includes/admin/class-bnfw-notification.php:1371
419
+ msgid "Media - New Comment Awaiting Moderation"
420
+ msgstr "Medios - Nuevo comentario pendiente de moderación"
421
+
422
+ #: includes/admin/class-bnfw-notification.php:337
423
+ #: includes/admin/class-bnfw-notification.php:1374
424
+ msgid "Media - Comment Reply"
425
+ msgstr "Medios - Responder al comentario"
426
+
427
+ #: includes/admin/class-bnfw-notification.php:355
428
+ msgid "Custom Post Type"
429
+ msgstr "Custom Post Type"
430
+
431
+ #: includes/admin/class-bnfw-notification.php:357
432
+ #: includes/admin/class-bnfw-notification.php:1389
433
+ msgid "New "
434
+ msgstr "Nuevo "
435
+
436
+ #: includes/admin/class-bnfw-notification.php:357
437
+ msgid " Published"
438
+ msgstr "Publicado"
439
+
440
+ #: includes/admin/class-bnfw-notification.php:359
441
+ msgid "Updated"
442
+ msgstr "Actualizado"
443
+
444
+ #: includes/admin/class-bnfw-notification.php:361
445
+ msgid "Pending Review"
446
+ msgstr "Reseña pendiente"
447
+
448
+ #: includes/admin/class-bnfw-notification.php:363
449
+ #: includes/admin/class-bnfw-notification.php:1401
450
+ msgid "New Private "
451
+ msgstr ""
452
+
453
+ #: includes/admin/class-bnfw-notification.php:365
454
+ msgid "Scheduled"
455
+ msgstr "Programado"
456
+
457
+ #: includes/admin/class-bnfw-notification.php:372
458
+ msgid "Comment Approved"
459
+ msgstr "Comentario aprobado"
460
+
461
+ #: includes/admin/class-bnfw-notification.php:394
462
+ msgid "Custom Taxonomy"
463
+ msgstr "Custom Taxonomy"
464
+
465
+ #: includes/admin/class-bnfw-notification.php:400
466
+ msgid "New"
467
+ msgstr "Nuevo"
468
+
469
+ #: includes/admin/class-bnfw-notification.php:419
470
+ msgid ""
471
+ "This notification doesn't support additional email fields due to a "
472
+ "limitation in WordPress."
473
+ msgstr ""
474
+ "Esta notificación no admite campos de correo electrónico adicionales debido "
475
+ "a una limitación en WordPress."
476
+
477
+ #: includes/admin/class-bnfw-notification.php:426
478
+ msgid "Email Formatting"
479
+ msgstr "Email Formatting"
480
+
481
+ #: includes/admin/class-bnfw-notification.php:427
482
+ msgid ""
483
+ "How do you want to format the sent email? HTML is recommended as it'll show "
484
+ "images and links correctly."
485
+ msgstr ""
486
+
487
+ #: includes/admin/class-bnfw-notification.php:448
488
+ msgid "Additional Email Fields"
489
+ msgstr "Campos de email adicionales"
490
+
491
+ #: includes/admin/class-bnfw-notification.php:449
492
+ msgid ""
493
+ "This should be fairly self explanatory but if you're unsure, tick this "
494
+ "checkbox and have a look at the available options. You can always untick it "
495
+ "again should you decide you don't need to use it."
496
+ msgstr ""
497
+
498
+ #: includes/admin/class-bnfw-notification.php:454
499
+ msgid "Set \"From\" Name & Email, Reply To, CC, BCC"
500
+ msgstr ""
501
+
502
+ #: includes/admin/class-bnfw-notification.php:461
503
+ msgid "From Name and Email"
504
+ msgstr "Nombre y email \"De\""
505
+
506
+ #: includes/admin/class-bnfw-notification.php:462
507
+ msgid ""
508
+ "If you want to send the email from your site name and email address instead "
509
+ "of the default \"WordPress\" from \"wordpress@domain.com\", this is where "
510
+ "you can do it."
511
+ msgstr ""
512
+
513
+ #: includes/admin/class-bnfw-notification.php:466
514
+ msgid "Site Name"
515
+ msgstr ""
516
+
517
+ #: includes/admin/class-bnfw-notification.php:468
518
+ msgid "Site Email"
519
+ msgstr ""
520
+
521
+ #: includes/admin/class-bnfw-notification.php:475
522
+ msgid "Reply To"
523
+ msgstr ""
524
+
525
+ #: includes/admin/class-bnfw-notification.php:476
526
+ msgid ""
527
+ "If you want any replies to your email notification to go to another person, "
528
+ "fill in this box with their name and email address."
529
+ msgstr ""
530
+
531
+ #: includes/admin/class-bnfw-notification.php:480
532
+ msgid "Name"
533
+ msgstr ""
534
+
535
+ #: includes/admin/class-bnfw-notification.php:482
536
+ msgid "Email"
537
+ msgstr "Correo electrónico"
538
+
539
+ #: includes/admin/class-bnfw-notification.php:488
540
+ msgid "CC"
541
+ msgstr "CC"
542
+
543
+ #: includes/admin/class-bnfw-notification.php:489
544
+ msgid "Publicly copy in any other users or user roles to this email."
545
+ msgstr ""
546
+
547
+ #: includes/admin/class-bnfw-notification.php:494
548
+ #: includes/admin/class-bnfw-notification.php:508
549
+ #: includes/admin/class-bnfw-notification.php:557
550
+ #: includes/admin/class-bnfw-notification.php:575
551
+ msgid "Select User Roles / Users"
552
+ msgstr "Seleccionar roles de usuario / usuarios"
553
+
554
+ #: includes/admin/class-bnfw-notification.php:502
555
+ msgid "BCC"
556
+ msgstr "BCC"
557
+
558
+ #: includes/admin/class-bnfw-notification.php:503
559
+ msgid "Privately copy in any other users or user roles to this email."
560
+ msgstr ""
561
+
562
+ #: includes/admin/class-bnfw-notification.php:518
563
+ msgid "Send to Author"
564
+ msgstr ""
565
+
566
+ #: includes/admin/class-bnfw-notification.php:519
567
+ msgid ""
568
+ "E.g. If you want a new post published notification to go to the post author, "
569
+ "tick this box."
570
+ msgstr ""
571
+
572
+ #: includes/admin/class-bnfw-notification.php:526
573
+ msgid "Send this notification to the Author"
574
+ msgstr "Envíe esta notificación al autor"
575
+
576
+ #: includes/admin/class-bnfw-notification.php:536
577
+ msgid ""
578
+ "E.g. If you're an editor and regularly update your posts, you might not want "
579
+ "to be emailed about this all the time. Ticking this box will prevent you "
580
+ "from receiving emails about your own changes."
581
+ msgstr ""
582
+
583
+ #: includes/admin/class-bnfw-notification.php:542
584
+ msgid "Do not send this Notification to the User that triggered it"
585
+ msgstr "No envíe esta notificación al usuario que la activó"
586
+
587
+ #: includes/admin/class-bnfw-notification.php:551
588
+ msgid "Send To"
589
+ msgstr "Enviar A"
590
+
591
+ #: includes/admin/class-bnfw-notification.php:552
592
+ msgid "Choose the users and/or user roles to send this email notification to."
593
+ msgstr ""
594
+
595
+ #: includes/admin/class-bnfw-notification.php:565
596
+ msgid "Except For"
597
+ msgstr ""
598
+
599
+ #: includes/admin/class-bnfw-notification.php:568
600
+ msgid ""
601
+ "Choose the users and/or user roles that this notification should not be sent "
602
+ "to."
603
+ msgstr ""
604
+
605
+ #: includes/admin/class-bnfw-notification.php:593
606
+ msgid ""
607
+ "You have chosen to send this notification to over 200 users. Please check "
608
+ "the email sending rate limit at your host before sending."
609
+ msgstr ""
610
+
611
+ #: includes/admin/class-bnfw-notification.php:603
612
+ #: includes/admin/class-bnfw-notification.php:1129
613
+ msgid "Subject"
614
+ msgstr "Asunto"
615
+
616
+ #: includes/admin/class-bnfw-notification.php:604
617
+ msgid "Notification subject. You can use "
618
+ msgstr "Asunto de la notificación. Puedes usar"
619
+
620
+ #: includes/admin/class-bnfw-notification.php:604
621
+ #: includes/admin/class-bnfw-notification.php:618
622
+ msgid " here."
623
+ msgstr ""
624
+
625
+ #: includes/admin/class-bnfw-notification.php:617
626
+ msgid "Message Body"
627
+ msgstr "Cuerpo del mensaje"
628
+
629
+ #: includes/admin/class-bnfw-notification.php:618
630
+ msgid "Notification message. You can use "
631
+ msgstr "Mensaje de notificación. Puedes usar"
632
+
633
+ #: includes/admin/class-bnfw-notification.php:626
634
+ msgid "Need some more help?"
635
+ msgstr ""
636
+
637
+ #: includes/admin/class-bnfw-notification.php:636
638
+ msgid "Insert Default Content"
639
+ msgstr "Insertar contenido predeterminado"
640
+
641
+ #: includes/admin/class-bnfw-notification.php:640
642
+ msgid "Read Documentation"
643
+ msgstr ""
644
+
645
+ #: includes/admin/class-bnfw-notification.php:644
646
+ msgid "Find Shortcodes"
647
+ msgstr ""
648
+
649
+ #: includes/admin/class-bnfw-notification.php:655
650
+ msgid ""
651
+ "Stop additional paragraph and line break HTML from being inserted into my "
652
+ "notifications"
653
+ msgstr ""
654
+
655
+ #: includes/admin/class-bnfw-notification.php:710
656
+ msgid ""
657
+ "You must choose at least one User or User Role to send the notification to "
658
+ "before you can save"
659
+ msgstr ""
660
+
661
+ #: includes/admin/class-bnfw-notification.php:825
662
+ msgid "Test Notification Sent."
663
+ msgstr "Test de notificación enviado."
664
+
665
+ #: includes/admin/class-bnfw-notification.php:915
666
+ msgid "Notification saved."
667
+ msgstr "Notificación guardada."
668
+
669
+ #: includes/admin/class-bnfw-notification.php:934
670
+ #: includes/admin/class-bnfw-notification.php:992
671
+ #: includes/admin/class-bnfw-notification.php:994
672
+ msgid "Save"
673
+ msgstr "Guardar"
674
+
675
+ #: includes/admin/class-bnfw-notification.php:942
676
+ msgid ""
677
+ "Use this to enable or disable notifications. If you want to disable a "
678
+ "default WordPress notification, just create it on the left, then disable it "
679
+ "here."
680
+ msgstr ""
681
+
682
+ #: includes/admin/class-bnfw-notification.php:949
683
+ msgid "Notification Enabled"
684
+ msgstr "Notificación habilitada"
685
+
686
+ #: includes/admin/class-bnfw-notification.php:956
687
+ msgid "Notification Disabled"
688
+ msgstr "Notificación deshabilitado"
689
+
690
+ #: includes/admin/class-bnfw-notification.php:967
691
+ msgid "Send Me a Test Email"
692
+ msgstr "Enviarme un email de prueba"
693
+
694
+ #: includes/admin/class-bnfw-notification.php:969
695
+ msgid ""
696
+ "This will send you (the currently logged in user) a notification so that you "
697
+ "can check for any issues with formatting – it’s doesn't mean that a "
698
+ "notification will send correctly in the future. You can read about how to "
699
+ "improve email delivery"
700
+ msgstr ""
701
+
702
+ #: includes/admin/class-bnfw-notification.php:969
703
+ msgid "here"
704
+ msgstr ""
705
+
706
+ #: includes/admin/class-bnfw-notification.php:969
707
+ msgid ". Shortcodes will not be replaced with content."
708
+ msgstr ""
709
+
710
+ #: includes/admin/class-bnfw-notification.php:980
711
+ msgid "Delete Permanently"
712
+ msgstr "Borrar definitivamente"
713
+
714
+ #: includes/admin/class-bnfw-notification.php:982
715
+ msgid "Move to Trash"
716
+ msgstr "Enviar a la papelera"
717
+
718
+ #: includes/admin/class-bnfw-notification.php:1127
719
+ msgid "Notification Type"
720
+ msgstr "Tipo de notificación"
721
+
722
+ #: includes/admin/class-bnfw-notification.php:1128
723
+ msgid "Enabled?"
724
+ msgstr "Habilitado?"
725
+
726
+ #: includes/admin/class-bnfw-notification.php:1130
727
+ msgid "User Roles / Users"
728
+ msgstr "Roles de Usuario / Usuarios"
729
+
730
+ #: includes/admin/class-bnfw-notification.php:1131
731
+ msgid "Excluded User Roles / Users"
732
+ msgstr "Usuarios / roles de usuario excluidos"
733
+
734
+ #: includes/admin/class-bnfw-notification.php:1172
735
+ msgid ", Post Author"
736
+ msgstr ""
737
+
738
+ #: includes/admin/class-bnfw-notification.php:1338
739
+ msgid "Privacy – Confirm Action: Export Data Request – For User"
740
+ msgstr ""
741
+
742
+ #: includes/admin/class-bnfw-notification.php:1341
743
+ msgid "Privacy – Confirm Action: Erase Data Request – For User"
744
+ msgstr ""
745
+
746
+ #: includes/admin/class-bnfw-notification.php:1389
747
+ msgid "Published"
748
+ msgstr "Publicado"
749
+
750
+ #: includes/admin/class-bnfw-notification.php:1392
751
+ msgid "Updated "
752
+ msgstr "Actualizado "
753
+
754
+ #: includes/admin/class-bnfw-notification.php:1395
755
+ msgid " Pending Review"
756
+ msgstr " Reseña pendiente"
757
+
758
+ #: includes/admin/class-bnfw-notification.php:1398
759
+ msgid " Scheduled"
760
+ msgstr " Programado"
761
+
762
+ #: includes/admin/class-bnfw-notification.php:1404
763
+ msgid " Comment"
764
+ msgstr " Comentario"
765
+
766
+ #: includes/admin/class-bnfw-notification.php:1410
767
+ msgid " Comment Reply"
768
+ msgstr "Comentar Responder"
769
+
770
+ #: includes/admin/class-bnfw-notification.php:1413
771
+ msgid " Comment Approved"
772
+ msgstr "Comentario aprobado"
773
+
774
+ #: includes/admin/class-bnfw-notification.php:1418
775
+ msgid "New Term"
776
+ msgstr "Nuevo término"
777
+
778
+ #: includes/admin/class-bnfw-notification.php:1420
779
+ msgid "New Term in "
780
+ msgstr "Nuevo término en"
781
+
782
+ #: includes/admin/class-bnfw-notification.php:1440
783
+ msgid "Enable Notifications"
784
+ msgstr "Permitir notificaciones"
785
+
786
+ #: includes/admin/class-bnfw-notification.php:1441
787
+ msgid "Disable Notifications"
788
+ msgstr "Desactivar notificaciones"
789
+
790
+ #: includes/admin/class-bnfw-notification.php:1502
791
+ msgid "Enable Notification"
792
+ msgstr "Habilitar la notificación"
793
+
794
+ #: includes/admin/class-bnfw-notification.php:1510
795
+ msgid "Disable Notification"
796
+ msgstr "Desactivar notificación"
797
+
798
+ #: includes/admin/class-bnfw-notification.php:1568
799
+ msgid "Enabled 1 Notification."
800
+ msgstr "Habilitado 1 Notificación."
801
+
802
+ #: includes/admin/class-bnfw-notification.php:1572
803
+ msgid "Disabled 1 Notification."
804
+ msgstr "Notificación de discapacitados 1."
805
+
806
+ #: includes/admin/class-bnfw-notification.php:1578
807
+ #, php-format
808
+ msgid "Enabled %s Notification."
809
+ msgid_plural "Enabled %s Notifications."
810
+ msgstr[0] "Notificación %s habilitada."
811
+ msgstr[1] "Notificaciones %s habilitadas."
812
+
813
+ #: includes/admin/class-bnfw-notification.php:1588
814
+ #, php-format
815
+ msgid "Disabled %s Notification."
816
+ msgid_plural "Disabled %s Notifications."
817
+ msgstr[0] "Notificación %s desactivada."
818
+ msgstr[1] "Notificaciones %s desactivadas."
819
+
820
+ #: includes/admin/class-bnfw-notification.php:1602
821
+ msgid ""
822
+ "If you send out notifications with BNFW but don't receive them, you may need "
823
+ "to install an SMTP plugin to <a href=\"https://betternotificationsforwp.com/"
824
+ "documentation/getting-started/how-to-improve-email-delivery/\" target="
825
+ "\"_blank\">improve email deliverability</a>. I recommend using <a href="
826
+ "\"https://wordpress.org/plugins/post-smtp/\" target=\"_blank\">Post SMTP</a> "
827
+ "as it's easy to set-up or <a href=\"https://wordpress.org/plugins/email-log/"
828
+ "\" target=\"_blank\">Email Log</a> to just log and view emails that are sent."
829
+ msgstr ""
830
+
831
+ #: includes/engine/class-bnfw-engine.php:18
832
+ msgid "Test Email:"
833
+ msgstr "Email de prueba:"
834
+
835
+ #: includes/engine/class-bnfw-engine.php:19
836
+ msgid ""
837
+ "This is a test email. All shortcodes below will show in place but not be "
838
+ "replaced with content."
839
+ msgstr ""
840
+
841
+ #: includes/engine/class-bnfw-engine.php:1583
842
+ msgid "Error: Download link is not available please contact support"
843
+ msgstr ""
844
+
845
+ #: includes/helpers/ajax-helpers.php:34 includes/helpers/helpers.php:38
846
+ msgid "User Roles"
847
+ msgstr "Roles del usuario"
848
+
849
+ #: includes/helpers/ajax-helpers.php:57 includes/helpers/helpers.php:59
850
+ #: includes/helpers/helpers.php:64
851
+ msgid "Users"
852
+ msgstr ""
853
+
854
+ #: includes/helpers/helpers.php:103
855
+ msgid "Non WordPress Users"
856
+ msgstr ""
857
+
858
+ #: includes/import.php:69
859
+ msgid " for "
860
+ msgstr " para "
861
+
862
+ #: includes/import.php:69
863
+ msgid " (Auto Imported)"
864
+ msgstr " (auto importación)"
865
+
866
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:228
867
+ #, php-format
868
+ msgid ""
869
+ "There is a new version of %1$s available. %2$sView version %3$s details%4$s."
870
+ msgstr ""
871
+
872
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:236
873
+ #, php-format
874
+ msgid ""
875
+ "There is a new version of %1$s available. %2$sView version %3$s details%4$s "
876
+ "or %5$supdate now%6$s."
877
+ msgstr ""
878
+
879
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:474
880
+ msgid "You do not have permission to install plugin updates"
881
+ msgstr ""
882
+
883
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:474
884
+ msgid "Error"
885
+ msgstr ""
886
+
887
+ #: includes/license/class-bnfw-license-setting.php:18
888
+ #: includes/license/class-bnfw-license-setting.php:19
889
+ msgid "Add-on Licenses"
890
+ msgstr ""
891
+
892
+ #: includes/license/class-bnfw-license-setting.php:38
893
+ msgid "BNFW Add-on Licenses"
894
+ msgstr ""
895
+
896
+ #: includes/license/class-bnfw-license-setting.php:47
897
+ msgid "Save License"
898
+ msgstr ""
899
+
900
+ #: includes/license/class-bnfw-license-setting.php:55
901
+ msgid ""
902
+ "<br>You have no BNFW Premium Add-ons installed yet.<br>You can buy add-ons "
903
+ "from the <a href=\""
904
+ msgstr ""
905
+
906
+ #: includes/license/class-bnfw-license-setting.php:130
907
+ msgid "Deactivate License"
908
+ msgstr ""
909
+
910
+ #: includes/license/class-bnfw-license.php:140
911
+ #, php-format
912
+ msgid "%1$s License Key"
913
+ msgstr ""
914
+
915
+ #: includes/overrides.php:41 includes/overrides.php:135
916
+ #, php-format
917
+ msgid "New user registration on your site %s:"
918
+ msgstr "Nuevo usuario registrado en tu sitio %s:"
919
+
920
+ #: includes/overrides.php:42 includes/overrides.php:117
921
+ #: includes/overrides.php:136 includes/overrides.php:152
922
+ #, php-format
923
+ msgid "Username: %s"
924
+ msgstr "Nombre de Usuario: %s"
925
+
926
+ #: includes/overrides.php:43 includes/overrides.php:137
927
+ #, php-format
928
+ msgid "E-mail: %s"
929
+ msgstr "Email: %s"
930
+
931
+ #. translators: Password change notification email subject. %s: Site title
932
+ #: includes/overrides.php:48 includes/overrides.php:139
933
+ #, php-format
934
+ msgid "[%s] New User Registration"
935
+ msgstr "[%s] Registro de nuevo usuario"
936
+
937
+ #: includes/overrides.php:118
938
+ msgid "To set your password, visit the following address:"
939
+ msgstr ""
940
+
941
+ #: includes/overrides.php:123
942
+ #, php-format
943
+ msgid "[%s] Your username and password info"
944
+ msgstr "[%s] Tu nombre de usuario y contraseña"
945
+
946
+ #: includes/overrides.php:153
947
+ #, php-format
948
+ msgid "Password: %s"
949
+ msgstr "Clave: %s"
950
+
951
+ #: includes/overrides.php:156
952
+ #, php-format
953
+ msgid "[%s] Your username and password"
954
+ msgstr "[%s] Tu nombre de usuario y clave"
955
+
956
+ #. translators: %s: user name
957
+ #: includes/overrides.php:184
958
+ #, php-format
959
+ msgid "Password changed for user: %s"
960
+ msgstr "Contraseña cambiada para el usuario: %s"
961
+
962
+ #. translators: %s: site title
963
+ #: includes/overrides.php:189
964
+ #, php-format
965
+ msgid "[%s] Password Changed"
966
+ msgstr ""
967
+
968
+ #. Plugin Name of the plugin/theme
969
+ msgid "Better Notifications for WP"
970
+ msgstr "Better Notifications for WP"
971
+
972
+ #. Plugin URI of the plugin/theme
973
+ #, fuzzy
974
+ #| msgid "http://wordpress.org/plugins/bnfw/"
975
+ msgid "https://wordpress.org/plugins/bnfw/"
976
+ msgstr "http://wordpress.org/plugins/bnfw/"
977
+
978
+ #. Description of the plugin/theme
979
+ msgid ""
980
+ "Supercharge your WordPress notifications using a WYSIWYG editor and "
981
+ "shortcodes. Default and new notifications available. Add more power with Add-"
982
+ "ons."
983
+ msgstr ""
984
+
985
+ #. Author of the plugin/theme
986
+ msgid "Made with Fuel"
987
+ msgstr "Hecho con Fuel"
988
+
989
+ #. Author URI of the plugin/theme
990
+ msgid "https://madewithfuel.com/"
991
+ msgstr ""
992
+
993
+ #~ msgid ""
994
+ #~ "Looking for help with shortcodes? Click here to see which ones you can "
995
+ #~ "use with the selected notification."
996
+ #~ msgstr ""
997
+ #~ "Buscando ayuda con shortcodes? Click aquí para ver cuales puedes usar con "
998
+ #~ "la notificación seleccionada."
999
+
1000
+ #~ msgid "New User - Welcome Email"
1001
+ #~ msgstr "Nuevo Usuario - Email de bienvenida"
1002
+
1003
+ #~ msgid "New User - Welcome email"
1004
+ #~ msgstr "Nuevo usuario - Email de bienvenida"
1005
+
1006
+ #~ msgid ""
1007
+ #~ "Send customisable HTML emails to your users for different WordPress "
1008
+ #~ "notifications."
1009
+ #~ msgstr ""
1010
+ #~ "Enviar emails HTML configurables a tus usuarios por distintas "
1011
+ #~ "notificaciones de WordPress."
1012
+
1013
+ #~ msgid "Show additional email fields"
1014
+ #~ msgstr "Mostrar campos de email adicionales"
1015
+
1016
+ #~ msgid "Update "
1017
+ #~ msgstr "Actualizar "
1018
+
1019
+ #~ msgid "https://betternotificationsforwp.com/"
1020
+ #~ msgstr "https://betternotificationsforwp.com/"
languages/bnfw-fr_FR.mo CHANGED
File without changes
languages/bnfw-fr_FR.po CHANGED
@@ -1,1024 +1,1024 @@
1
- # Translation of Stable (latest release) in French (France)
2
- # This file is distributed under the same license as the Stable (latest release) package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Stable (latest release)\n"
6
- "POT-Creation-Date: 2020-11-27 21:34+0800\n"
7
- "PO-Revision-Date: 2020-11-28 00:03+0800\n"
8
- "Last-Translator: \n"
9
- "Language-Team: \n"
10
- "Language: fr\n"
11
- "MIME-Version: 1.0\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
- "Content-Transfer-Encoding: 8bit\n"
14
- "Plural-Forms: nplurals=2; plural=n > 1;\n"
15
- "X-Generator: Poedit 2.2\n"
16
-
17
- #: bnfw.php:283 includes/admin/bnfw-settings.php:15
18
- msgid "Settings"
19
- msgstr "Réglages"
20
-
21
- #: includes/admin/bnfw-settings.php:14
22
- #: includes/admin/class-bnfw-notification.php:129
23
- msgid "Notification Settings"
24
- msgstr "Paramètres des notifications"
25
-
26
- #: includes/admin/bnfw-settings.php:38
27
- msgid "BNFW Settings"
28
- msgstr "Réglages BNFW"
29
-
30
- #: includes/admin/bnfw-settings.php:46
31
- msgid "Save Settings"
32
- msgstr "Enregistrer les paramètres"
33
-
34
- #: includes/admin/bnfw-settings.php:73
35
- msgid "Documentation"
36
- msgstr "Consultez la documentation."
37
-
38
- #: includes/admin/bnfw-settings.php:80
39
- msgid "Premium Add-ons"
40
- msgstr ""
41
-
42
- #: includes/admin/bnfw-settings.php:87
43
- msgid "Priority Support"
44
- msgstr ""
45
-
46
- #: includes/admin/bnfw-settings.php:150
47
- msgid "Suppress SPAM comment notification"
48
- msgstr "Supprimer les notifications de commentaires SPAM"
49
-
50
- #: includes/admin/bnfw-settings.php:150
51
- msgid ""
52
- "Comments that are correctly marked as SPAM by a 3rd party plugin (such as "
53
- "Akismet) will not generate a notification if this is ticked."
54
- msgstr ""
55
-
56
- #: includes/admin/bnfw-settings.php:155
57
- msgid "Don't send notifications for comments marked as SPAM"
58
- msgstr ""
59
- "N'envoyez pas de notifications pour les commentaires marqués comme SPAM"
60
-
61
- #: includes/admin/bnfw-settings.php:167
62
- msgid "Default Email Format"
63
- msgstr "Format par défaut des emails"
64
-
65
- #: includes/admin/bnfw-settings.php:167
66
- msgid ""
67
- "This will apply to all emails sent out via WordPress, even those from other "
68
- "plugins. For more details, please see the "
69
- msgstr ""
70
- "Cela s'appliquera à tous les e-mails envoyés via WordPress, même ceux "
71
- "d'autres plugins. Pour plus de détails, veuillez consulter le"
72
-
73
- #: includes/admin/bnfw-settings.php:181
74
- msgid "Enable Content Shortcodes?"
75
- msgstr ""
76
-
77
- #: includes/admin/bnfw-settings.php:181
78
- msgid "Shortcodes in the post/page content are disabled by default."
79
- msgstr ""
80
-
81
- #: includes/admin/bnfw-settings.php:186
82
- msgid "Enable shortcode output in the page/post content"
83
- msgstr ""
84
-
85
- #: includes/admin/bnfw-settings.php:198
86
- msgid "Allow Usage Tracking?"
87
- msgstr ""
88
-
89
- #: includes/admin/bnfw-settings.php:203
90
- msgid ""
91
- "Allow Better Notifications for WP to anonymously track how this plugin is "
92
- "used and help make the plugin better."
93
- msgstr ""
94
-
95
- #: includes/admin/bnfw-settings.php:251
96
- #: includes/admin/class-bnfw-notification.php:433
97
- msgid "HTML Formatting"
98
- msgstr "Recevoir en HTML"
99
-
100
- #: includes/admin/bnfw-settings.php:256
101
- #: includes/admin/class-bnfw-notification.php:439
102
- msgid "Plain Text"
103
- msgstr "Recevoir en Texte brut"
104
-
105
- #: includes/admin/class-bnfw-notification.php:52
106
- #: includes/admin/class-bnfw-notification.php:55
107
- #: includes/admin/class-bnfw-notification.php:56
108
- msgid "Notifications"
109
- msgstr "Alertes"
110
-
111
- #: includes/admin/class-bnfw-notification.php:53
112
- msgid "Notification"
113
- msgstr "Note"
114
-
115
- #: includes/admin/class-bnfw-notification.php:54
116
- msgid "Add New"
117
- msgstr "Ajouter nouveau"
118
-
119
- #: includes/admin/class-bnfw-notification.php:57
120
- msgid "Add New Notification"
121
- msgstr "Ajouter une nouvelle notification"
122
-
123
- #: includes/admin/class-bnfw-notification.php:58
124
- msgid "Edit Notification"
125
- msgstr "Editer une notification"
126
-
127
- #: includes/admin/class-bnfw-notification.php:59
128
- msgid "New Notification"
129
- msgstr "Nouvelle notification"
130
-
131
- #: includes/admin/class-bnfw-notification.php:60
132
- msgid "View Notification"
133
- msgstr "Voir la notification"
134
-
135
- #: includes/admin/class-bnfw-notification.php:61
136
- msgid "Search Notifications"
137
- msgstr "Rechercher parmi les notifications"
138
-
139
- #: includes/admin/class-bnfw-notification.php:62
140
- msgid "No Notifications found"
141
- msgstr "Aucune notification trouvée"
142
-
143
- #: includes/admin/class-bnfw-notification.php:63
144
- msgid "No Notifications found in trash"
145
- msgstr "Aucune notification trouvée dans la corbeille"
146
-
147
- #: includes/admin/class-bnfw-notification.php:64
148
- msgid "All Notifications"
149
- msgstr "Toutes les notifications"
150
-
151
- #: includes/admin/class-bnfw-notification.php:138
152
- msgid "Save Notification"
153
- msgstr "Enregistrer la notification"
154
-
155
- #: includes/admin/class-bnfw-notification.php:186
156
- msgid "Notification For"
157
- msgstr "Recevoir une notification pour"
158
-
159
- #: includes/admin/class-bnfw-notification.php:187
160
- msgid ""
161
- "E.g. If you select \"New Post Published\" from the list on the right, this "
162
- "notification will be sent when a new post is published."
163
- msgstr ""
164
-
165
- #: includes/admin/class-bnfw-notification.php:191
166
- msgid "Select the notification type"
167
- msgstr "Sélectionnez le type de notification"
168
-
169
- #: includes/admin/class-bnfw-notification.php:192
170
- msgid "Admin"
171
- msgstr ""
172
-
173
- #: includes/admin/class-bnfw-notification.php:194
174
- #: includes/admin/class-bnfw-notification.php:1302
175
- msgid "New User Registration - For Admin"
176
- msgstr "Enregistrement d'un nouvel utilisateur - pour admin"
177
-
178
- #: includes/admin/class-bnfw-notification.php:196
179
- #: includes/admin/class-bnfw-notification.php:1269
180
- msgid "User Lost Password - For Admin"
181
- msgstr "Mot de passe perdu par l'utilisateur - Pour l'administrateur"
182
-
183
- #: includes/admin/class-bnfw-notification.php:198
184
- #: includes/admin/class-bnfw-notification.php:1272
185
- msgid "Password Changed - For Admin"
186
- msgstr "Mot de passe modifié - Pour l'administrateur"
187
-
188
- #: includes/admin/class-bnfw-notification.php:200
189
- #: includes/admin/class-bnfw-notification.php:1275
190
- msgid "User Email Changed - For Admin"
191
- msgstr "Adresse e-mail de l'utilisateur modifiée - Pour l'administrateur"
192
-
193
- #: includes/admin/class-bnfw-notification.php:202
194
- #: includes/admin/class-bnfw-notification.php:1308
195
- msgid "User Role Changed - For Admin"
196
- msgstr "Rôle de l'utilisateur modifié - Pour l'administrateur"
197
-
198
- #: includes/admin/class-bnfw-notification.php:204
199
- #: includes/admin/class-bnfw-notification.php:1296
200
- msgid "User Logged In - For Admin"
201
- msgstr "Utilisateur connecté - Pour l'administrateur"
202
-
203
- #: includes/admin/class-bnfw-notification.php:206
204
- #: includes/admin/class-bnfw-notification.php:1287
205
- msgid "WordPress Core Automatic Background Updates"
206
- msgstr ""
207
-
208
- #: includes/admin/class-bnfw-notification.php:210
209
- #: includes/admin/class-bnfw-notification.php:1344
210
- msgid "Privacy - Confirm Action: Export Data Request - For Admin"
211
- msgstr ""
212
-
213
- #: includes/admin/class-bnfw-notification.php:214
214
- #: includes/admin/class-bnfw-notification.php:1347
215
- msgid "Privacy - Confirm Action: Erase Data Request - For Admin"
216
- msgstr ""
217
-
218
- #: includes/admin/class-bnfw-notification.php:222
219
- msgid "Transactional"
220
- msgstr ""
221
-
222
- #: includes/admin/class-bnfw-notification.php:224
223
- #: includes/admin/class-bnfw-notification.php:1290
224
- msgid "New User Registration - For User"
225
- msgstr "Enregistrement d'un nouvel utilisateur - pour l'utilisateur"
226
-
227
- #: includes/admin/class-bnfw-notification.php:226
228
- #: includes/admin/class-bnfw-notification.php:1299
229
- msgid "New User - Post-registration Email"
230
- msgstr "Nouvel utilisateur - E-mail post-inscription"
231
-
232
- #: includes/admin/class-bnfw-notification.php:228
233
- #: includes/admin/class-bnfw-notification.php:1266
234
- msgid "User Lost Password - For User"
235
- msgstr "Mot de passe perdu par l'utilisateur - Pour l'utilisateur"
236
-
237
- #: includes/admin/class-bnfw-notification.php:230
238
- #: includes/admin/class-bnfw-notification.php:1278
239
- msgid "Password Changed - For User"
240
- msgstr "Mot de passe modifié - Pour l'utilisateur"
241
-
242
- #: includes/admin/class-bnfw-notification.php:232
243
- #: includes/admin/class-bnfw-notification.php:1281
244
- msgid "User Email Changed Confirmation - For User"
245
- msgstr ""
246
- "Confirmation de modification de l'adresse e-mail de l'utilisateur - Pour "
247
- "l'utilisateur"
248
-
249
- #: includes/admin/class-bnfw-notification.php:235
250
- #: includes/admin/class-bnfw-notification.php:1284
251
- msgid "User Email Changed - For User"
252
- msgstr "Adresse e-mail de l'utilisateur modifiée - Pour l'utilisateur"
253
-
254
- #: includes/admin/class-bnfw-notification.php:237
255
- #: includes/admin/class-bnfw-notification.php:1305
256
- msgid "User Role Changed - For User"
257
- msgstr "Rôle de l'utilisateur modifié - Pour l'utilisateur"
258
-
259
- #: includes/admin/class-bnfw-notification.php:239
260
- #: includes/admin/class-bnfw-notification.php:1293
261
- msgid "User Logged In - For User"
262
- msgstr "Utilisateur connecté - Pour l'utilisateur"
263
-
264
- #: includes/admin/class-bnfw-notification.php:241
265
- #: includes/admin/class-bnfw-notification.php:375
266
- #: includes/admin/class-bnfw-notification.php:1263
267
- msgid "Comment Reply"
268
- msgstr "Réponse à un commentaire"
269
-
270
- #: includes/admin/class-bnfw-notification.php:245
271
- msgid "Privacy - Confirm Action: Export Data Request - For User"
272
- msgstr ""
273
-
274
- #: includes/admin/class-bnfw-notification.php:249
275
- msgid "Privacy - Confirm Action: Erase Data Request - For User"
276
- msgstr ""
277
-
278
- #: includes/admin/class-bnfw-notification.php:253
279
- #: includes/admin/class-bnfw-notification.php:1350
280
- msgid "Privacy - Data Export - For User"
281
- msgstr ""
282
-
283
- #: includes/admin/class-bnfw-notification.php:257
284
- #: includes/admin/class-bnfw-notification.php:1353
285
- msgid "Privacy - Data Erased - For User"
286
- msgstr ""
287
-
288
- #: includes/admin/class-bnfw-notification.php:267
289
- #: includes/admin/class-bnfw-notification.php:1311
290
- msgid "New Post Published"
291
- msgstr "Nouvel article publié"
292
-
293
- #: includes/admin/class-bnfw-notification.php:269
294
- #: includes/admin/class-bnfw-notification.php:1314
295
- msgid "Post Updated"
296
- msgstr "Mise à jour d'un article"
297
-
298
- #: includes/admin/class-bnfw-notification.php:271
299
- #: includes/admin/class-bnfw-notification.php:1317
300
- msgid "Post Pending Review"
301
- msgstr "Article en attente de relecture"
302
-
303
- #: includes/admin/class-bnfw-notification.php:273
304
- #: includes/admin/class-bnfw-notification.php:1320
305
- msgid "New Private Post"
306
- msgstr ""
307
-
308
- #: includes/admin/class-bnfw-notification.php:275
309
- #: includes/admin/class-bnfw-notification.php:1323
310
- msgid "Post Scheduled"
311
- msgstr "Article planifié"
312
-
313
- #: includes/admin/class-bnfw-notification.php:277
314
- #: includes/admin/class-bnfw-notification.php:1326
315
- msgid "Published Post Moved to Trash"
316
- msgstr "Message publié placé dans la corbeille"
317
-
318
- #: includes/admin/class-bnfw-notification.php:279
319
- #: includes/admin/class-bnfw-notification.php:367
320
- #: includes/admin/class-bnfw-notification.php:1248
321
- msgid "New Comment"
322
- msgstr "Nouveau Commentaire"
323
-
324
- #: includes/admin/class-bnfw-notification.php:282
325
- #: includes/admin/class-bnfw-notification.php:369
326
- #: includes/admin/class-bnfw-notification.php:1254
327
- #: includes/admin/class-bnfw-notification.php:1407
328
- msgid "New Comment Awaiting Moderation"
329
- msgstr "Nouveau commentaire en attente de modération"
330
-
331
- #: includes/admin/class-bnfw-notification.php:285
332
- #: includes/admin/class-bnfw-notification.php:1251
333
- msgid "Post - Comment Approved"
334
- msgstr ""
335
-
336
- #: includes/admin/class-bnfw-notification.php:288
337
- #: includes/admin/class-bnfw-notification.php:1332
338
- msgid "New Category"
339
- msgstr "Nouvelle catégorie"
340
-
341
- #: includes/admin/class-bnfw-notification.php:290
342
- #: includes/admin/class-bnfw-notification.php:1335
343
- msgid "New Tag"
344
- msgstr "Nouveau Tag"
345
-
346
- #: includes/admin/class-bnfw-notification.php:292
347
- #: includes/admin/class-bnfw-notification.php:1257
348
- msgid "New Trackback"
349
- msgstr "Nouveau rétrolien (trackback)"
350
-
351
- #: includes/admin/class-bnfw-notification.php:294
352
- #: includes/admin/class-bnfw-notification.php:1260
353
- msgid "New Pingback"
354
- msgstr "Nouveau rétrolien (pingback)"
355
-
356
- #: includes/admin/class-bnfw-notification.php:301
357
- #: includes/admin/class-bnfw-notification.php:1329
358
- msgid "New Page Published"
359
- msgstr "Nouvelle page publiée"
360
-
361
- #: includes/admin/class-bnfw-notification.php:303
362
- msgid "Page Updated"
363
- msgstr "Page mise à jour"
364
-
365
- #: includes/admin/class-bnfw-notification.php:305
366
- msgid "Page Pending Review"
367
- msgstr "Page en attente de relecture"
368
-
369
- #: includes/admin/class-bnfw-notification.php:307
370
- msgid "New Private Page"
371
- msgstr ""
372
-
373
- #: includes/admin/class-bnfw-notification.php:309
374
- msgid "Page Scheduled"
375
- msgstr "Page planifiée"
376
-
377
- #: includes/admin/class-bnfw-notification.php:311
378
- msgid "Page - New Comment"
379
- msgstr "Page - Nouveau commentaire"
380
-
381
- #: includes/admin/class-bnfw-notification.php:313
382
- msgid "Page - New Comment Awaiting Moderation"
383
- msgstr "Page - Nouveau commentaire en attente de modération"
384
-
385
- #: includes/admin/class-bnfw-notification.php:316
386
- #: includes/admin/class-bnfw-notification.php:1365
387
- msgid "Page - Comment Approved"
388
- msgstr "Page - Commentaire approuvé"
389
-
390
- #: includes/admin/class-bnfw-notification.php:319
391
- msgid "Page - Comment Reply"
392
- msgstr "Page - Réponse au commentaire"
393
-
394
- #: includes/admin/class-bnfw-notification.php:326
395
- #: includes/admin/class-bnfw-notification.php:1356
396
- msgid "New Media Published"
397
- msgstr "Nouveaux médias publiés"
398
-
399
- #: includes/admin/class-bnfw-notification.php:328
400
- #: includes/admin/class-bnfw-notification.php:1359
401
- msgid "Media Updated"
402
- msgstr "Médias mis à jour"
403
-
404
- #: includes/admin/class-bnfw-notification.php:330
405
- #: includes/admin/class-bnfw-notification.php:1362
406
- msgid "Media - New Comment"
407
- msgstr "Médias - Nouveau commentaire"
408
-
409
- #: includes/admin/class-bnfw-notification.php:332
410
- #: includes/admin/class-bnfw-notification.php:1368
411
- msgid "Media - Comment Approved"
412
- msgstr ""
413
-
414
- #: includes/admin/class-bnfw-notification.php:335
415
- #: includes/admin/class-bnfw-notification.php:1371
416
- msgid "Media - New Comment Awaiting Moderation"
417
- msgstr "Médias - Nouveau commentaire en attente de modération"
418
-
419
- #: includes/admin/class-bnfw-notification.php:337
420
- #: includes/admin/class-bnfw-notification.php:1374
421
- msgid "Media - Comment Reply"
422
- msgstr "Médias - Réponse au commentaire"
423
-
424
- #: includes/admin/class-bnfw-notification.php:355
425
- msgid "Custom Post Type"
426
- msgstr "Type d'article personnalisé"
427
-
428
- #: includes/admin/class-bnfw-notification.php:357
429
- #: includes/admin/class-bnfw-notification.php:1389
430
- msgid "New "
431
- msgstr "Nouveau"
432
-
433
- #: includes/admin/class-bnfw-notification.php:357
434
- msgid " Published"
435
- msgstr "Publié"
436
-
437
- #: includes/admin/class-bnfw-notification.php:359
438
- msgid "Updated"
439
- msgstr "Mis à jour"
440
-
441
- #: includes/admin/class-bnfw-notification.php:361
442
- msgid "Pending Review"
443
- msgstr "En attente de relecture"
444
-
445
- #: includes/admin/class-bnfw-notification.php:363
446
- #: includes/admin/class-bnfw-notification.php:1401
447
- msgid "New Private "
448
- msgstr ""
449
-
450
- #: includes/admin/class-bnfw-notification.php:365
451
- msgid "Scheduled"
452
- msgstr "Planifié"
453
-
454
- #: includes/admin/class-bnfw-notification.php:372
455
- msgid "Comment Approved"
456
- msgstr "Commentaire approuvé"
457
-
458
- #: includes/admin/class-bnfw-notification.php:394
459
- msgid "Custom Taxonomy"
460
- msgstr "Taxonomie personnalisée"
461
-
462
- #: includes/admin/class-bnfw-notification.php:400
463
- msgid "New"
464
- msgstr "Ajouter"
465
-
466
- #: includes/admin/class-bnfw-notification.php:419
467
- msgid ""
468
- "This notification doesn't support additional email fields due to a "
469
- "limitation in WordPress."
470
- msgstr ""
471
- "Cette notification ne prend pas en charge les champs d'e-mail "
472
- "supplémentaires en raison d'une limitation dans WordPress."
473
-
474
- #: includes/admin/class-bnfw-notification.php:426
475
- msgid "Email Formatting"
476
- msgstr "Formatage de l'email"
477
-
478
- #: includes/admin/class-bnfw-notification.php:427
479
- msgid ""
480
- "How do you want to format the sent email? HTML is recommended as it'll show "
481
- "images and links correctly."
482
- msgstr ""
483
-
484
- #: includes/admin/class-bnfw-notification.php:448
485
- msgid "Additional Email Fields"
486
- msgstr "Champs d'email supplémentaires"
487
-
488
- #: includes/admin/class-bnfw-notification.php:449
489
- msgid ""
490
- "This should be fairly self explanatory but if you're unsure, tick this "
491
- "checkbox and have a look at the available options. You can always untick it "
492
- "again should you decide you don't need to use it."
493
- msgstr ""
494
-
495
- #: includes/admin/class-bnfw-notification.php:454
496
- msgid "Set \"From\" Name & Email, Reply To, CC, BCC"
497
- msgstr "Définir le nom et l'e-mail «De», Répondre à, CC, Cci"
498
-
499
- #: includes/admin/class-bnfw-notification.php:461
500
- msgid "From Name and Email"
501
- msgstr "Nom et adresse email"
502
-
503
- #: includes/admin/class-bnfw-notification.php:462
504
- msgid ""
505
- "If you want to send the email from your site name and email address instead "
506
- "of the default \"WordPress\" from \"wordpress@domain.com\", this is where "
507
- "you can do it."
508
- msgstr ""
509
-
510
- #: includes/admin/class-bnfw-notification.php:466
511
- msgid "Site Name"
512
- msgstr ""
513
-
514
- #: includes/admin/class-bnfw-notification.php:468
515
- msgid "Site Email"
516
- msgstr ""
517
-
518
- #: includes/admin/class-bnfw-notification.php:475
519
- msgid "Reply To"
520
- msgstr ""
521
-
522
- #: includes/admin/class-bnfw-notification.php:476
523
- msgid ""
524
- "If you want any replies to your email notification to go to another person, "
525
- "fill in this box with their name and email address."
526
- msgstr ""
527
-
528
- #: includes/admin/class-bnfw-notification.php:480
529
- msgid "Name"
530
- msgstr ""
531
-
532
- #: includes/admin/class-bnfw-notification.php:482
533
- msgid "Email"
534
- msgstr "Email"
535
-
536
- #: includes/admin/class-bnfw-notification.php:488
537
- msgid "CC"
538
- msgstr "CC"
539
-
540
- #: includes/admin/class-bnfw-notification.php:489
541
- msgid "Publicly copy in any other users or user roles to this email."
542
- msgstr ""
543
-
544
- #: includes/admin/class-bnfw-notification.php:494
545
- #: includes/admin/class-bnfw-notification.php:508
546
- #: includes/admin/class-bnfw-notification.php:557
547
- #: includes/admin/class-bnfw-notification.php:575
548
- msgid "Select User Roles / Users"
549
- msgstr "Sélectionnez les rôles utilisateur / utilisateurs"
550
-
551
- #: includes/admin/class-bnfw-notification.php:502
552
- msgid "BCC"
553
- msgstr "CCI"
554
-
555
- #: includes/admin/class-bnfw-notification.php:503
556
- msgid "Privately copy in any other users or user roles to this email."
557
- msgstr ""
558
-
559
- #: includes/admin/class-bnfw-notification.php:518
560
- msgid "Send to Author"
561
- msgstr ""
562
-
563
- #: includes/admin/class-bnfw-notification.php:519
564
- msgid ""
565
- "E.g. If you want a new post published notification to go to the post author, "
566
- "tick this box."
567
- msgstr ""
568
-
569
- #: includes/admin/class-bnfw-notification.php:526
570
- msgid "Send this notification to the Author"
571
- msgstr "Envoyez cette notification à l'auteur"
572
-
573
- #: includes/admin/class-bnfw-notification.php:536
574
- msgid ""
575
- "E.g. If you're an editor and regularly update your posts, you might not want "
576
- "to be emailed about this all the time. Ticking this box will prevent you "
577
- "from receiving emails about your own changes."
578
- msgstr ""
579
-
580
- #: includes/admin/class-bnfw-notification.php:542
581
- msgid "Do not send this Notification to the User that triggered it"
582
- msgstr "N'envoyez pas cette notification à l'utilisateur qui l'a déclenchée"
583
-
584
- #: includes/admin/class-bnfw-notification.php:551
585
- msgid "Send To"
586
- msgstr "Envoyer à"
587
-
588
- #: includes/admin/class-bnfw-notification.php:552
589
- msgid "Choose the users and/or user roles to send this email notification to."
590
- msgstr ""
591
-
592
- #: includes/admin/class-bnfw-notification.php:565
593
- msgid "Except For"
594
- msgstr ""
595
-
596
- #: includes/admin/class-bnfw-notification.php:568
597
- msgid ""
598
- "Choose the users and/or user roles that this notification should not be sent "
599
- "to."
600
- msgstr ""
601
-
602
- #: includes/admin/class-bnfw-notification.php:593
603
- msgid ""
604
- "You have chosen to send this notification to over 200 users. Please check "
605
- "the email sending rate limit at your host before sending."
606
- msgstr ""
607
-
608
- #: includes/admin/class-bnfw-notification.php:603
609
- #: includes/admin/class-bnfw-notification.php:1129
610
- msgid "Subject"
611
- msgstr "Objet"
612
-
613
- #: includes/admin/class-bnfw-notification.php:604
614
- msgid "Notification subject. You can use "
615
- msgstr "Objet de la notification. Vous pouvez utiliser"
616
-
617
- #: includes/admin/class-bnfw-notification.php:604
618
- #: includes/admin/class-bnfw-notification.php:618
619
- msgid " here."
620
- msgstr ""
621
-
622
- #: includes/admin/class-bnfw-notification.php:617
623
- msgid "Message Body"
624
- msgstr "Votre message"
625
-
626
- #: includes/admin/class-bnfw-notification.php:618
627
- msgid "Notification message. You can use "
628
- msgstr "Message de notification. Vous pouvez utiliser"
629
-
630
- #: includes/admin/class-bnfw-notification.php:626
631
- msgid "Need some more help?"
632
- msgstr "Besoin d'aide supplémentaire?"
633
-
634
- #: includes/admin/class-bnfw-notification.php:636
635
- msgid "Insert Default Content"
636
- msgstr "Insérer le contenu par défaut"
637
-
638
- #: includes/admin/class-bnfw-notification.php:640
639
- msgid "Read Documentation"
640
- msgstr "Lire la documentation"
641
-
642
- #: includes/admin/class-bnfw-notification.php:644
643
- msgid "Find Shortcodes"
644
- msgstr "Aide sur les Shortcodes"
645
-
646
- #: includes/admin/class-bnfw-notification.php:655
647
- msgid ""
648
- "Stop additional paragraph and line break HTML from being inserted into my "
649
- "notifications"
650
- msgstr ""
651
- "Éviter que des paragraphes additionnels et des retours à la ligne HTML "
652
- "soient insérés dans mes notifications"
653
-
654
- #: includes/admin/class-bnfw-notification.php:710
655
- msgid ""
656
- "You must choose at least one User or User Role to send the notification to "
657
- "before you can save"
658
- msgstr ""
659
-
660
- #: includes/admin/class-bnfw-notification.php:825
661
- msgid "Test Notification Sent."
662
- msgstr "Test de notification envoyé."
663
-
664
- #: includes/admin/class-bnfw-notification.php:915
665
- msgid "Notification saved."
666
- msgstr "Notification enregistrée."
667
-
668
- #: includes/admin/class-bnfw-notification.php:934
669
- #: includes/admin/class-bnfw-notification.php:992
670
- #: includes/admin/class-bnfw-notification.php:994
671
- msgid "Save"
672
- msgstr "Enregister"
673
-
674
- #: includes/admin/class-bnfw-notification.php:942
675
- msgid ""
676
- "Use this to enable or disable notifications. If you want to disable a "
677
- "default WordPress notification, just create it on the left, then disable it "
678
- "here."
679
- msgstr ""
680
-
681
- #: includes/admin/class-bnfw-notification.php:949
682
- msgid "Notification Enabled"
683
- msgstr "Notification activée"
684
-
685
- #: includes/admin/class-bnfw-notification.php:956
686
- msgid "Notification Disabled"
687
- msgstr "Notification désactivée"
688
-
689
- #: includes/admin/class-bnfw-notification.php:967
690
- msgid "Send Me a Test Email"
691
- msgstr "Envoyez-moi un email de test"
692
-
693
- #: includes/admin/class-bnfw-notification.php:969
694
- msgid ""
695
- "This will send you (the currently logged in user) a notification so that you "
696
- "can check for any issues with formatting – it’s doesn't mean that a "
697
- "notification will send correctly in the future. You can read about how to "
698
- "improve email delivery"
699
- msgstr ""
700
-
701
- #: includes/admin/class-bnfw-notification.php:969
702
- msgid "here"
703
- msgstr ""
704
-
705
- #: includes/admin/class-bnfw-notification.php:969
706
- msgid ". Shortcodes will not be replaced with content."
707
- msgstr ""
708
-
709
- #: includes/admin/class-bnfw-notification.php:980
710
- msgid "Delete Permanently"
711
- msgstr "Supprimer définitivement"
712
-
713
- #: includes/admin/class-bnfw-notification.php:982
714
- msgid "Move to Trash"
715
- msgstr "Déplacer dans la corbeille"
716
-
717
- #: includes/admin/class-bnfw-notification.php:1127
718
- msgid "Notification Type"
719
- msgstr "Type de notification"
720
-
721
- #: includes/admin/class-bnfw-notification.php:1128
722
- msgid "Enabled?"
723
- msgstr "Activé ?"
724
-
725
- #: includes/admin/class-bnfw-notification.php:1130
726
- msgid "User Roles / Users"
727
- msgstr "Rôles de l'utilisateur / Utilisateurs"
728
-
729
- #: includes/admin/class-bnfw-notification.php:1131
730
- msgid "Excluded User Roles / Users"
731
- msgstr "Rôles d'utilisateur / utilisateurs exclus"
732
-
733
- #: includes/admin/class-bnfw-notification.php:1172
734
- msgid ", Post Author"
735
- msgstr ""
736
-
737
- #: includes/admin/class-bnfw-notification.php:1338
738
- msgid "Privacy – Confirm Action: Export Data Request – For User"
739
- msgstr ""
740
-
741
- #: includes/admin/class-bnfw-notification.php:1341
742
- msgid "Privacy – Confirm Action: Erase Data Request – For User"
743
- msgstr ""
744
-
745
- #: includes/admin/class-bnfw-notification.php:1389
746
- msgid "Published"
747
- msgstr "Publié"
748
-
749
- #: includes/admin/class-bnfw-notification.php:1392
750
- msgid "Updated "
751
- msgstr "Mis(e) a jour "
752
-
753
- #: includes/admin/class-bnfw-notification.php:1395
754
- msgid " Pending Review"
755
- msgstr " En attente de relecture"
756
-
757
- #: includes/admin/class-bnfw-notification.php:1398
758
- msgid " Scheduled"
759
- msgstr " Planifié"
760
-
761
- #: includes/admin/class-bnfw-notification.php:1404
762
- msgid " Comment"
763
- msgstr " Commentaire"
764
-
765
- #: includes/admin/class-bnfw-notification.php:1410
766
- msgid " Comment Reply"
767
- msgstr "Commentaire Répondre"
768
-
769
- #: includes/admin/class-bnfw-notification.php:1413
770
- msgid " Comment Approved"
771
- msgstr "Commentaire approuvé"
772
-
773
- #: includes/admin/class-bnfw-notification.php:1418
774
- msgid "New Term"
775
- msgstr "Nouveau mandat"
776
-
777
- #: includes/admin/class-bnfw-notification.php:1420
778
- msgid "New Term in "
779
- msgstr "Nouveau terme dans "
780
-
781
- #: includes/admin/class-bnfw-notification.php:1440
782
- msgid "Enable Notifications"
783
- msgstr "Activer les notifications"
784
-
785
- #: includes/admin/class-bnfw-notification.php:1441
786
- msgid "Disable Notifications"
787
- msgstr "Désactiver les notifications"
788
-
789
- #: includes/admin/class-bnfw-notification.php:1502
790
- msgid "Enable Notification"
791
- msgstr "Activer la notification"
792
-
793
- #: includes/admin/class-bnfw-notification.php:1510
794
- msgid "Disable Notification"
795
- msgstr "Désactiver les notifications"
796
-
797
- #: includes/admin/class-bnfw-notification.php:1568
798
- msgid "Enabled 1 Notification."
799
- msgstr "Notification activée 1."
800
-
801
- #: includes/admin/class-bnfw-notification.php:1572
802
- msgid "Disabled 1 Notification."
803
- msgstr "Désactivé 1 Notification."
804
-
805
- #: includes/admin/class-bnfw-notification.php:1578
806
- #, php-format
807
- msgid "Enabled %s Notification."
808
- msgid_plural "Enabled %s Notifications."
809
- msgstr[0] "Notification% s activée."
810
- msgstr[1] "Notifications% s activées."
811
-
812
- #: includes/admin/class-bnfw-notification.php:1588
813
- #, php-format
814
- msgid "Disabled %s Notification."
815
- msgid_plural "Disabled %s Notifications."
816
- msgstr[0] "Notification% s désactivée."
817
- msgstr[1] "Notifications% s désactivées."
818
-
819
- #: includes/admin/class-bnfw-notification.php:1602
820
- msgid ""
821
- "If you send out notifications with BNFW but don't receive them, you may need "
822
- "to install an SMTP plugin to <a href=\"https://betternotificationsforwp.com/"
823
- "documentation/getting-started/how-to-improve-email-delivery/\" target="
824
- "\"_blank\">improve email deliverability</a>. I recommend using <a href="
825
- "\"https://wordpress.org/plugins/post-smtp/\" target=\"_blank\">Post SMTP</a> "
826
- "as it's easy to set-up or <a href=\"https://wordpress.org/plugins/email-log/"
827
- "\" target=\"_blank\">Email Log</a> to just log and view emails that are sent."
828
- msgstr ""
829
-
830
- #: includes/engine/class-bnfw-engine.php:18
831
- msgid "Test Email:"
832
- msgstr "Email de test:"
833
-
834
- #: includes/engine/class-bnfw-engine.php:19
835
- msgid ""
836
- "This is a test email. All shortcodes below will show in place but not be "
837
- "replaced with content."
838
- msgstr ""
839
-
840
- #: includes/engine/class-bnfw-engine.php:1583
841
- msgid "Error: Download link is not available please contact support"
842
- msgstr ""
843
-
844
- #: includes/helpers/ajax-helpers.php:34 includes/helpers/helpers.php:38
845
- msgid "User Roles"
846
- msgstr "Rôles utilisateurs"
847
-
848
- #: includes/helpers/ajax-helpers.php:57 includes/helpers/helpers.php:59
849
- #: includes/helpers/helpers.php:64
850
- msgid "Users"
851
- msgstr "Abonnés"
852
-
853
- #: includes/helpers/helpers.php:103
854
- msgid "Non WordPress Users"
855
- msgstr ""
856
-
857
- #: includes/import.php:69
858
- msgid " for "
859
- msgstr " pour "
860
-
861
- #: includes/import.php:69
862
- msgid " (Auto Imported)"
863
- msgstr ""
864
- " \n"
865
- "(Importé automatiquement)"
866
-
867
- #: includes/libraries/EDD_SL_Plugin_Updater.php:228
868
- #, fuzzy, php-format
869
- #| msgid ""
870
- #| "There is a new version of %1$s available. <a target=\"_blank\" class="
871
- #| "\"thickbox\" href=\"%2$s\">View version %3$s details</a>."
872
- msgid ""
873
- "There is a new version of %1$s available. %2$sView version %3$s details%4$s."
874
- msgstr ""
875
- "Une nouvelle version de %1$s est disponible. <a target=\"_blank\" class="
876
- "\"thickbox\" href=\"%2$s\">Voir les détails de la version %3$s</a>."
877
-
878
- #: includes/libraries/EDD_SL_Plugin_Updater.php:236
879
- #, fuzzy, php-format
880
- #| msgid ""
881
- #| "There is a new version of %1$s available. <a target=\"_blank\" class="
882
- #| "\"thickbox\" href=\"%2$s\">View version %3$s details</a> or <a href=\"%4$s"
883
- #| "\">update now</a>."
884
- msgid ""
885
- "There is a new version of %1$s available. %2$sView version %3$s details%4$s "
886
- "or %5$supdate now%6$s."
887
- msgstr ""
888
- "Une nouvelle version de %1$s est disponible. <a target=\"_blank\" class="
889
- "\"thickbox\" href=\"%2$s\">Voir les détails de la version %3$s</a> ou <a "
890
- "href=\"%4$s\">effectuer la mise à jour maintenant</a>."
891
-
892
- #: includes/libraries/EDD_SL_Plugin_Updater.php:474
893
- msgid "You do not have permission to install plugin updates"
894
- msgstr ""
895
- "Vous n’avez pas les droits pour installer des mises à jour d’extensions"
896
-
897
- #: includes/libraries/EDD_SL_Plugin_Updater.php:474
898
- msgid "Error"
899
- msgstr "Erreur"
900
-
901
- #: includes/license/class-bnfw-license-setting.php:18
902
- #: includes/license/class-bnfw-license-setting.php:19
903
- msgid "Add-on Licenses"
904
- msgstr "Licences complémentaires"
905
-
906
- #: includes/license/class-bnfw-license-setting.php:38
907
- msgid "BNFW Add-on Licenses"
908
- msgstr "Licences complémentaires BNFW"
909
-
910
- #: includes/license/class-bnfw-license-setting.php:47
911
- msgid "Save License"
912
- msgstr "Enregistrer la licence"
913
-
914
- #: includes/license/class-bnfw-license-setting.php:55
915
- msgid ""
916
- "<br>You have no BNFW Premium Add-ons installed yet.<br>You can buy add-ons "
917
- "from the <a href=\""
918
- msgstr ""
919
-
920
- #: includes/license/class-bnfw-license-setting.php:130
921
- msgid "Deactivate License"
922
- msgstr "Désactiver la license"
923
-
924
- #: includes/license/class-bnfw-license.php:140
925
- #, php-format
926
- msgid "%1$s License Key"
927
- msgstr "%1$s clé de licence"
928
-
929
- #: includes/overrides.php:41 includes/overrides.php:135
930
- #, php-format
931
- msgid "New user registration on your site %s:"
932
- msgstr "Enregistrement d'un nouvel utilisateur sur votre site %s"
933
-
934
- #: includes/overrides.php:42 includes/overrides.php:117
935
- #: includes/overrides.php:136 includes/overrides.php:152
936
- #, php-format
937
- msgid "Username: %s"
938
- msgstr "Utilisateur : %s"
939
-
940
- #: includes/overrides.php:43 includes/overrides.php:137
941
- #, php-format
942
- msgid "E-mail: %s"
943
- msgstr "Adresse email: %s"
944
-
945
- #. translators: Password change notification email subject. %s: Site title
946
- #: includes/overrides.php:48 includes/overrides.php:139
947
- #, php-format
948
- msgid "[%s] New User Registration"
949
- msgstr "[%s] Enregistrement d'un nouvel utilisateur"
950
-
951
- #: includes/overrides.php:118
952
- msgid "To set your password, visit the following address:"
953
- msgstr "Pour choisir votre mot de passe, rendez-vous à l'adresse suivante :"
954
-
955
- #: includes/overrides.php:123
956
- #, php-format
957
- msgid "[%s] Your username and password info"
958
- msgstr "[%s] Votre identifiant et votre mot de passe"
959
-
960
- #: includes/overrides.php:153
961
- #, php-format
962
- msgid "Password: %s"
963
- msgstr "Mot de passe: %s"
964
-
965
- #: includes/overrides.php:156
966
- #, php-format
967
- msgid "[%s] Your username and password"
968
- msgstr "[%s] Vos nom d'utilisateur et mot de passe"
969
-
970
- #. translators: %s: user name
971
- #: includes/overrides.php:184
972
- #, php-format
973
- msgid "Password changed for user: %s"
974
- msgstr "Mot de passe modifié pour l'utilisateur: %s"
975
-
976
- #. translators: %s: site title
977
- #: includes/overrides.php:189
978
- #, php-format
979
- msgid "[%s] Password Changed"
980
- msgstr ""
981
-
982
- #. Plugin Name of the plugin/theme
983
- msgid "Better Notifications for WP"
984
- msgstr "Better Notifications pour WordPress"
985
-
986
- #. Plugin URI of the plugin/theme
987
- #, fuzzy
988
- #| msgid "http://wordpress.org/plugins/bnfw/"
989
- msgid "https://wordpress.org/plugins/bnfw/"
990
- msgstr "http://wordpress.org/plugins/bnfw/"
991
-
992
- #. Description of the plugin/theme
993
- msgid ""
994
- "Supercharge your WordPress notifications using a WYSIWYG editor and "
995
- "shortcodes. Default and new notifications available. Add more power with Add-"
996
- "ons."
997
- msgstr ""
998
-
999
- #. Author of the plugin/theme
1000
- msgid "Made with Fuel"
1001
- msgstr "Made with Fuel"
1002
-
1003
- #. Author URI of the plugin/theme
1004
- msgid "https://madewithfuel.com/"
1005
- msgstr ""
1006
-
1007
- #~ msgid "Show additional email fields"
1008
- #~ msgstr "Afficher des champs d’emails supplémentaires"
1009
-
1010
- #~ msgid ""
1011
- #~ "Send customisable emails to your users for different WordPress "
1012
- #~ "notifications."
1013
- #~ msgstr ""
1014
- #~ "Envoyez des emails personnalisés à vos utilisateurs pour différentes "
1015
- #~ "notifications."
1016
-
1017
- #~ msgid "https://betternotificationsforwp.com/"
1018
- #~ msgstr "https://betternotificationsforwp.com/"
1019
-
1020
- #~ msgid "Update "
1021
- #~ msgstr "Mettre à jour"
1022
-
1023
- #~ msgid "New User - Welcome Email"
1024
- #~ msgstr "Nouvel utilisateur - message de bienvenue"
1
+ # Translation of Stable (latest release) in French (France)
2
+ # This file is distributed under the same license as the Stable (latest release) package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Stable (latest release)\n"
6
+ "POT-Creation-Date: 2020-11-27 21:34+0800\n"
7
+ "PO-Revision-Date: 2020-11-28 00:03+0800\n"
8
+ "Last-Translator: \n"
9
+ "Language-Team: \n"
10
+ "Language: fr\n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: 8bit\n"
14
+ "Plural-Forms: nplurals=2; plural=n > 1;\n"
15
+ "X-Generator: Poedit 2.2\n"
16
+
17
+ #: bnfw.php:283 includes/admin/bnfw-settings.php:15
18
+ msgid "Settings"
19
+ msgstr "Réglages"
20
+
21
+ #: includes/admin/bnfw-settings.php:14
22
+ #: includes/admin/class-bnfw-notification.php:129
23
+ msgid "Notification Settings"
24
+ msgstr "Paramètres des notifications"
25
+
26
+ #: includes/admin/bnfw-settings.php:38
27
+ msgid "BNFW Settings"
28
+ msgstr "Réglages BNFW"
29
+
30
+ #: includes/admin/bnfw-settings.php:46
31
+ msgid "Save Settings"
32
+ msgstr "Enregistrer les paramètres"
33
+
34
+ #: includes/admin/bnfw-settings.php:73
35
+ msgid "Documentation"
36
+ msgstr "Consultez la documentation."
37
+
38
+ #: includes/admin/bnfw-settings.php:80
39
+ msgid "Premium Add-ons"
40
+ msgstr ""
41
+
42
+ #: includes/admin/bnfw-settings.php:87
43
+ msgid "Priority Support"
44
+ msgstr ""
45
+
46
+ #: includes/admin/bnfw-settings.php:150
47
+ msgid "Suppress SPAM comment notification"
48
+ msgstr "Supprimer les notifications de commentaires SPAM"
49
+
50
+ #: includes/admin/bnfw-settings.php:150
51
+ msgid ""
52
+ "Comments that are correctly marked as SPAM by a 3rd party plugin (such as "
53
+ "Akismet) will not generate a notification if this is ticked."
54
+ msgstr ""
55
+
56
+ #: includes/admin/bnfw-settings.php:155
57
+ msgid "Don't send notifications for comments marked as SPAM"
58
+ msgstr ""
59
+ "N'envoyez pas de notifications pour les commentaires marqués comme SPAM"
60
+
61
+ #: includes/admin/bnfw-settings.php:167
62
+ msgid "Default Email Format"
63
+ msgstr "Format par défaut des emails"
64
+
65
+ #: includes/admin/bnfw-settings.php:167
66
+ msgid ""
67
+ "This will apply to all emails sent out via WordPress, even those from other "
68
+ "plugins. For more details, please see the "
69
+ msgstr ""
70
+ "Cela s'appliquera à tous les e-mails envoyés via WordPress, même ceux "
71
+ "d'autres plugins. Pour plus de détails, veuillez consulter le"
72
+
73
+ #: includes/admin/bnfw-settings.php:181
74
+ msgid "Enable Content Shortcodes?"
75
+ msgstr ""
76
+
77
+ #: includes/admin/bnfw-settings.php:181
78
+ msgid "Shortcodes in the post/page content are disabled by default."
79
+ msgstr ""
80
+
81
+ #: includes/admin/bnfw-settings.php:186
82
+ msgid "Enable shortcode output in the page/post content"
83
+ msgstr ""
84
+
85
+ #: includes/admin/bnfw-settings.php:198
86
+ msgid "Allow Usage Tracking?"
87
+ msgstr ""
88
+
89
+ #: includes/admin/bnfw-settings.php:203
90
+ msgid ""
91
+ "Allow Better Notifications for WP to anonymously track how this plugin is "
92
+ "used and help make the plugin better."
93
+ msgstr ""
94
+
95
+ #: includes/admin/bnfw-settings.php:251
96
+ #: includes/admin/class-bnfw-notification.php:433
97
+ msgid "HTML Formatting"
98
+ msgstr "Recevoir en HTML"
99
+
100
+ #: includes/admin/bnfw-settings.php:256
101
+ #: includes/admin/class-bnfw-notification.php:439
102
+ msgid "Plain Text"
103
+ msgstr "Recevoir en Texte brut"
104
+
105
+ #: includes/admin/class-bnfw-notification.php:52
106
+ #: includes/admin/class-bnfw-notification.php:55
107
+ #: includes/admin/class-bnfw-notification.php:56
108
+ msgid "Notifications"
109
+ msgstr "Alertes"
110
+
111
+ #: includes/admin/class-bnfw-notification.php:53
112
+ msgid "Notification"
113
+ msgstr "Note"
114
+
115
+ #: includes/admin/class-bnfw-notification.php:54
116
+ msgid "Add New"
117
+ msgstr "Ajouter nouveau"
118
+
119
+ #: includes/admin/class-bnfw-notification.php:57
120
+ msgid "Add New Notification"
121
+ msgstr "Ajouter une nouvelle notification"
122
+
123
+ #: includes/admin/class-bnfw-notification.php:58
124
+ msgid "Edit Notification"
125
+ msgstr "Editer une notification"
126
+
127
+ #: includes/admin/class-bnfw-notification.php:59
128
+ msgid "New Notification"
129
+ msgstr "Nouvelle notification"
130
+
131
+ #: includes/admin/class-bnfw-notification.php:60
132
+ msgid "View Notification"
133
+ msgstr "Voir la notification"
134
+
135
+ #: includes/admin/class-bnfw-notification.php:61
136
+ msgid "Search Notifications"
137
+ msgstr "Rechercher parmi les notifications"
138
+
139
+ #: includes/admin/class-bnfw-notification.php:62
140
+ msgid "No Notifications found"
141
+ msgstr "Aucune notification trouvée"
142
+
143
+ #: includes/admin/class-bnfw-notification.php:63
144
+ msgid "No Notifications found in trash"
145
+ msgstr "Aucune notification trouvée dans la corbeille"
146
+
147
+ #: includes/admin/class-bnfw-notification.php:64
148
+ msgid "All Notifications"
149
+ msgstr "Toutes les notifications"
150
+
151
+ #: includes/admin/class-bnfw-notification.php:138
152
+ msgid "Save Notification"
153
+ msgstr "Enregistrer la notification"
154
+
155
+ #: includes/admin/class-bnfw-notification.php:186
156
+ msgid "Notification For"
157
+ msgstr "Recevoir une notification pour"
158
+
159
+ #: includes/admin/class-bnfw-notification.php:187
160
+ msgid ""
161
+ "E.g. If you select \"New Post Published\" from the list on the right, this "
162
+ "notification will be sent when a new post is published."
163
+ msgstr ""
164
+
165
+ #: includes/admin/class-bnfw-notification.php:191
166
+ msgid "Select the notification type"
167
+ msgstr "Sélectionnez le type de notification"
168
+
169
+ #: includes/admin/class-bnfw-notification.php:192
170
+ msgid "Admin"
171
+ msgstr ""
172
+
173
+ #: includes/admin/class-bnfw-notification.php:194
174
+ #: includes/admin/class-bnfw-notification.php:1302
175
+ msgid "New User Registration - For Admin"
176
+ msgstr "Enregistrement d'un nouvel utilisateur - pour admin"
177
+
178
+ #: includes/admin/class-bnfw-notification.php:196
179
+ #: includes/admin/class-bnfw-notification.php:1269
180
+ msgid "User Lost Password - For Admin"
181
+ msgstr "Mot de passe perdu par l'utilisateur - Pour l'administrateur"
182
+
183
+ #: includes/admin/class-bnfw-notification.php:198
184
+ #: includes/admin/class-bnfw-notification.php:1272
185
+ msgid "Password Changed - For Admin"
186
+ msgstr "Mot de passe modifié - Pour l'administrateur"
187
+
188
+ #: includes/admin/class-bnfw-notification.php:200
189
+ #: includes/admin/class-bnfw-notification.php:1275
190
+ msgid "User Email Changed - For Admin"
191
+ msgstr "Adresse e-mail de l'utilisateur modifiée - Pour l'administrateur"
192
+
193
+ #: includes/admin/class-bnfw-notification.php:202
194
+ #: includes/admin/class-bnfw-notification.php:1308
195
+ msgid "User Role Changed - For Admin"
196
+ msgstr "Rôle de l'utilisateur modifié - Pour l'administrateur"
197
+
198
+ #: includes/admin/class-bnfw-notification.php:204
199
+ #: includes/admin/class-bnfw-notification.php:1296
200
+ msgid "User Logged In - For Admin"
201
+ msgstr "Utilisateur connecté - Pour l'administrateur"
202
+
203
+ #: includes/admin/class-bnfw-notification.php:206
204
+ #: includes/admin/class-bnfw-notification.php:1287
205
+ msgid "WordPress Core Automatic Background Updates"
206
+ msgstr ""
207
+
208
+ #: includes/admin/class-bnfw-notification.php:210
209
+ #: includes/admin/class-bnfw-notification.php:1344
210
+ msgid "Privacy - Confirm Action: Export Data Request - For Admin"
211
+ msgstr ""
212
+
213
+ #: includes/admin/class-bnfw-notification.php:214
214
+ #: includes/admin/class-bnfw-notification.php:1347
215
+ msgid "Privacy - Confirm Action: Erase Data Request - For Admin"
216
+ msgstr ""
217
+
218
+ #: includes/admin/class-bnfw-notification.php:222
219
+ msgid "Transactional"
220
+ msgstr ""
221
+
222
+ #: includes/admin/class-bnfw-notification.php:224
223
+ #: includes/admin/class-bnfw-notification.php:1290
224
+ msgid "New User Registration - For User"
225
+ msgstr "Enregistrement d'un nouvel utilisateur - pour l'utilisateur"
226
+
227
+ #: includes/admin/class-bnfw-notification.php:226
228
+ #: includes/admin/class-bnfw-notification.php:1299
229
+ msgid "New User - Post-registration Email"
230
+ msgstr "Nouvel utilisateur - E-mail post-inscription"
231
+
232
+ #: includes/admin/class-bnfw-notification.php:228
233
+ #: includes/admin/class-bnfw-notification.php:1266
234
+ msgid "User Lost Password - For User"
235
+ msgstr "Mot de passe perdu par l'utilisateur - Pour l'utilisateur"
236
+
237
+ #: includes/admin/class-bnfw-notification.php:230
238
+ #: includes/admin/class-bnfw-notification.php:1278
239
+ msgid "Password Changed - For User"
240
+ msgstr "Mot de passe modifié - Pour l'utilisateur"
241
+
242
+ #: includes/admin/class-bnfw-notification.php:232
243
+ #: includes/admin/class-bnfw-notification.php:1281
244
+ msgid "User Email Changed Confirmation - For User"
245
+ msgstr ""
246
+ "Confirmation de modification de l'adresse e-mail de l'utilisateur - Pour "
247
+ "l'utilisateur"
248
+
249
+ #: includes/admin/class-bnfw-notification.php:235
250
+ #: includes/admin/class-bnfw-notification.php:1284
251
+ msgid "User Email Changed - For User"
252
+ msgstr "Adresse e-mail de l'utilisateur modifiée - Pour l'utilisateur"
253
+
254
+ #: includes/admin/class-bnfw-notification.php:237
255
+ #: includes/admin/class-bnfw-notification.php:1305
256
+ msgid "User Role Changed - For User"
257
+ msgstr "Rôle de l'utilisateur modifié - Pour l'utilisateur"
258
+
259
+ #: includes/admin/class-bnfw-notification.php:239
260
+ #: includes/admin/class-bnfw-notification.php:1293
261
+ msgid "User Logged In - For User"
262
+ msgstr "Utilisateur connecté - Pour l'utilisateur"
263
+
264
+ #: includes/admin/class-bnfw-notification.php:241
265
+ #: includes/admin/class-bnfw-notification.php:375
266
+ #: includes/admin/class-bnfw-notification.php:1263
267
+ msgid "Comment Reply"
268
+ msgstr "Réponse à un commentaire"
269
+
270
+ #: includes/admin/class-bnfw-notification.php:245
271
+ msgid "Privacy - Confirm Action: Export Data Request - For User"
272
+ msgstr ""
273
+
274
+ #: includes/admin/class-bnfw-notification.php:249
275
+ msgid "Privacy - Confirm Action: Erase Data Request - For User"
276
+ msgstr ""
277
+
278
+ #: includes/admin/class-bnfw-notification.php:253
279
+ #: includes/admin/class-bnfw-notification.php:1350
280
+ msgid "Privacy - Data Export - For User"
281
+ msgstr ""
282
+
283
+ #: includes/admin/class-bnfw-notification.php:257
284
+ #: includes/admin/class-bnfw-notification.php:1353
285
+ msgid "Privacy - Data Erased - For User"
286
+ msgstr ""
287
+
288
+ #: includes/admin/class-bnfw-notification.php:267
289
+ #: includes/admin/class-bnfw-notification.php:1311
290
+ msgid "New Post Published"
291
+ msgstr "Nouvel article publié"
292
+
293
+ #: includes/admin/class-bnfw-notification.php:269
294
+ #: includes/admin/class-bnfw-notification.php:1314
295
+ msgid "Post Updated"
296
+ msgstr "Mise à jour d'un article"
297
+
298
+ #: includes/admin/class-bnfw-notification.php:271
299
+ #: includes/admin/class-bnfw-notification.php:1317
300
+ msgid "Post Pending Review"
301
+ msgstr "Article en attente de relecture"
302
+
303
+ #: includes/admin/class-bnfw-notification.php:273
304
+ #: includes/admin/class-bnfw-notification.php:1320
305
+ msgid "New Private Post"
306
+ msgstr ""
307
+
308
+ #: includes/admin/class-bnfw-notification.php:275
309
+ #: includes/admin/class-bnfw-notification.php:1323
310
+ msgid "Post Scheduled"
311
+ msgstr "Article planifié"
312
+
313
+ #: includes/admin/class-bnfw-notification.php:277
314
+ #: includes/admin/class-bnfw-notification.php:1326
315
+ msgid "Published Post Moved to Trash"
316
+ msgstr "Message publié placé dans la corbeille"
317
+
318
+ #: includes/admin/class-bnfw-notification.php:279
319
+ #: includes/admin/class-bnfw-notification.php:367
320
+ #: includes/admin/class-bnfw-notification.php:1248
321
+ msgid "New Comment"
322
+ msgstr "Nouveau Commentaire"
323
+
324
+ #: includes/admin/class-bnfw-notification.php:282
325
+ #: includes/admin/class-bnfw-notification.php:369
326
+ #: includes/admin/class-bnfw-notification.php:1254
327
+ #: includes/admin/class-bnfw-notification.php:1407
328
+ msgid "New Comment Awaiting Moderation"
329
+ msgstr "Nouveau commentaire en attente de modération"
330
+
331
+ #: includes/admin/class-bnfw-notification.php:285
332
+ #: includes/admin/class-bnfw-notification.php:1251
333
+ msgid "Post - Comment Approved"
334
+ msgstr ""
335
+
336
+ #: includes/admin/class-bnfw-notification.php:288
337
+ #: includes/admin/class-bnfw-notification.php:1332
338
+ msgid "New Category"
339
+ msgstr "Nouvelle catégorie"
340
+
341
+ #: includes/admin/class-bnfw-notification.php:290
342
+ #: includes/admin/class-bnfw-notification.php:1335
343
+ msgid "New Tag"
344
+ msgstr "Nouveau Tag"
345
+
346
+ #: includes/admin/class-bnfw-notification.php:292
347
+ #: includes/admin/class-bnfw-notification.php:1257
348
+ msgid "New Trackback"
349
+ msgstr "Nouveau rétrolien (trackback)"
350
+
351
+ #: includes/admin/class-bnfw-notification.php:294
352
+ #: includes/admin/class-bnfw-notification.php:1260
353
+ msgid "New Pingback"
354
+ msgstr "Nouveau rétrolien (pingback)"
355
+
356
+ #: includes/admin/class-bnfw-notification.php:301
357
+ #: includes/admin/class-bnfw-notification.php:1329
358
+ msgid "New Page Published"
359
+ msgstr "Nouvelle page publiée"
360
+
361
+ #: includes/admin/class-bnfw-notification.php:303
362
+ msgid "Page Updated"
363
+ msgstr "Page mise à jour"
364
+
365
+ #: includes/admin/class-bnfw-notification.php:305
366
+ msgid "Page Pending Review"
367
+ msgstr "Page en attente de relecture"
368
+
369
+ #: includes/admin/class-bnfw-notification.php:307
370
+ msgid "New Private Page"
371
+ msgstr ""
372
+
373
+ #: includes/admin/class-bnfw-notification.php:309
374
+ msgid "Page Scheduled"
375
+ msgstr "Page planifiée"
376
+
377
+ #: includes/admin/class-bnfw-notification.php:311
378
+ msgid "Page - New Comment"
379
+ msgstr "Page - Nouveau commentaire"
380
+
381
+ #: includes/admin/class-bnfw-notification.php:313
382
+ msgid "Page - New Comment Awaiting Moderation"
383
+ msgstr "Page - Nouveau commentaire en attente de modération"
384
+
385
+ #: includes/admin/class-bnfw-notification.php:316
386
+ #: includes/admin/class-bnfw-notification.php:1365
387
+ msgid "Page - Comment Approved"
388
+ msgstr "Page - Commentaire approuvé"
389
+
390
+ #: includes/admin/class-bnfw-notification.php:319
391
+ msgid "Page - Comment Reply"
392
+ msgstr "Page - Réponse au commentaire"
393
+
394
+ #: includes/admin/class-bnfw-notification.php:326
395
+ #: includes/admin/class-bnfw-notification.php:1356
396
+ msgid "New Media Published"
397
+ msgstr "Nouveaux médias publiés"
398
+
399
+ #: includes/admin/class-bnfw-notification.php:328
400
+ #: includes/admin/class-bnfw-notification.php:1359
401
+ msgid "Media Updated"
402
+ msgstr "Médias mis à jour"
403
+
404
+ #: includes/admin/class-bnfw-notification.php:330
405
+ #: includes/admin/class-bnfw-notification.php:1362
406
+ msgid "Media - New Comment"
407
+ msgstr "Médias - Nouveau commentaire"
408
+
409
+ #: includes/admin/class-bnfw-notification.php:332
410
+ #: includes/admin/class-bnfw-notification.php:1368
411
+ msgid "Media - Comment Approved"
412
+ msgstr ""
413
+
414
+ #: includes/admin/class-bnfw-notification.php:335
415
+ #: includes/admin/class-bnfw-notification.php:1371
416
+ msgid "Media - New Comment Awaiting Moderation"
417
+ msgstr "Médias - Nouveau commentaire en attente de modération"
418
+
419
+ #: includes/admin/class-bnfw-notification.php:337
420
+ #: includes/admin/class-bnfw-notification.php:1374
421
+ msgid "Media - Comment Reply"
422
+ msgstr "Médias - Réponse au commentaire"
423
+
424
+ #: includes/admin/class-bnfw-notification.php:355
425
+ msgid "Custom Post Type"
426
+ msgstr "Type d'article personnalisé"
427
+
428
+ #: includes/admin/class-bnfw-notification.php:357
429
+ #: includes/admin/class-bnfw-notification.php:1389
430
+ msgid "New "
431
+ msgstr "Nouveau"
432
+
433
+ #: includes/admin/class-bnfw-notification.php:357
434
+ msgid " Published"
435
+ msgstr "Publié"
436
+
437
+ #: includes/admin/class-bnfw-notification.php:359
438
+ msgid "Updated"
439
+ msgstr "Mis à jour"
440
+
441
+ #: includes/admin/class-bnfw-notification.php:361
442
+ msgid "Pending Review"
443
+ msgstr "En attente de relecture"
444
+
445
+ #: includes/admin/class-bnfw-notification.php:363
446
+ #: includes/admin/class-bnfw-notification.php:1401
447
+ msgid "New Private "
448
+ msgstr ""
449
+
450
+ #: includes/admin/class-bnfw-notification.php:365
451
+ msgid "Scheduled"
452
+ msgstr "Planifié"
453
+
454
+ #: includes/admin/class-bnfw-notification.php:372
455
+ msgid "Comment Approved"
456
+ msgstr "Commentaire approuvé"
457
+
458
+ #: includes/admin/class-bnfw-notification.php:394
459
+ msgid "Custom Taxonomy"
460
+ msgstr "Taxonomie personnalisée"
461
+
462
+ #: includes/admin/class-bnfw-notification.php:400
463
+ msgid "New"
464
+ msgstr "Ajouter"
465
+
466
+ #: includes/admin/class-bnfw-notification.php:419
467
+ msgid ""
468
+ "This notification doesn't support additional email fields due to a "
469
+ "limitation in WordPress."
470
+ msgstr ""
471
+ "Cette notification ne prend pas en charge les champs d'e-mail "
472
+ "supplémentaires en raison d'une limitation dans WordPress."
473
+
474
+ #: includes/admin/class-bnfw-notification.php:426
475
+ msgid "Email Formatting"
476
+ msgstr "Formatage de l'email"
477
+
478
+ #: includes/admin/class-bnfw-notification.php:427
479
+ msgid ""
480
+ "How do you want to format the sent email? HTML is recommended as it'll show "
481
+ "images and links correctly."
482
+ msgstr ""
483
+
484
+ #: includes/admin/class-bnfw-notification.php:448
485
+ msgid "Additional Email Fields"
486
+ msgstr "Champs d'email supplémentaires"
487
+
488
+ #: includes/admin/class-bnfw-notification.php:449
489
+ msgid ""
490
+ "This should be fairly self explanatory but if you're unsure, tick this "
491
+ "checkbox and have a look at the available options. You can always untick it "
492
+ "again should you decide you don't need to use it."
493
+ msgstr ""
494
+
495
+ #: includes/admin/class-bnfw-notification.php:454
496
+ msgid "Set \"From\" Name & Email, Reply To, CC, BCC"
497
+ msgstr "Définir le nom et l'e-mail «De», Répondre à, CC, Cci"
498
+
499
+ #: includes/admin/class-bnfw-notification.php:461
500
+ msgid "From Name and Email"
501
+ msgstr "Nom et adresse email"
502
+
503
+ #: includes/admin/class-bnfw-notification.php:462
504
+ msgid ""
505
+ "If you want to send the email from your site name and email address instead "
506
+ "of the default \"WordPress\" from \"wordpress@domain.com\", this is where "
507
+ "you can do it."
508
+ msgstr ""
509
+
510
+ #: includes/admin/class-bnfw-notification.php:466
511
+ msgid "Site Name"
512
+ msgstr ""
513
+
514
+ #: includes/admin/class-bnfw-notification.php:468
515
+ msgid "Site Email"
516
+ msgstr ""
517
+
518
+ #: includes/admin/class-bnfw-notification.php:475
519
+ msgid "Reply To"
520
+ msgstr ""
521
+
522
+ #: includes/admin/class-bnfw-notification.php:476
523
+ msgid ""
524
+ "If you want any replies to your email notification to go to another person, "
525
+ "fill in this box with their name and email address."
526
+ msgstr ""
527
+
528
+ #: includes/admin/class-bnfw-notification.php:480
529
+ msgid "Name"
530
+ msgstr ""
531
+
532
+ #: includes/admin/class-bnfw-notification.php:482
533
+ msgid "Email"
534
+ msgstr "Email"
535
+
536
+ #: includes/admin/class-bnfw-notification.php:488
537
+ msgid "CC"
538
+ msgstr "CC"
539
+
540
+ #: includes/admin/class-bnfw-notification.php:489
541
+ msgid "Publicly copy in any other users or user roles to this email."
542
+ msgstr ""
543
+
544
+ #: includes/admin/class-bnfw-notification.php:494
545
+ #: includes/admin/class-bnfw-notification.php:508
546
+ #: includes/admin/class-bnfw-notification.php:557
547
+ #: includes/admin/class-bnfw-notification.php:575
548
+ msgid "Select User Roles / Users"
549
+ msgstr "Sélectionnez les rôles utilisateur / utilisateurs"
550
+
551
+ #: includes/admin/class-bnfw-notification.php:502
552
+ msgid "BCC"
553
+ msgstr "CCI"
554
+
555
+ #: includes/admin/class-bnfw-notification.php:503
556
+ msgid "Privately copy in any other users or user roles to this email."
557
+ msgstr ""
558
+
559
+ #: includes/admin/class-bnfw-notification.php:518
560
+ msgid "Send to Author"
561
+ msgstr ""
562
+
563
+ #: includes/admin/class-bnfw-notification.php:519
564
+ msgid ""
565
+ "E.g. If you want a new post published notification to go to the post author, "
566
+ "tick this box."
567
+ msgstr ""
568
+
569
+ #: includes/admin/class-bnfw-notification.php:526
570
+ msgid "Send this notification to the Author"
571
+ msgstr "Envoyez cette notification à l'auteur"
572
+
573
+ #: includes/admin/class-bnfw-notification.php:536
574
+ msgid ""
575
+ "E.g. If you're an editor and regularly update your posts, you might not want "
576
+ "to be emailed about this all the time. Ticking this box will prevent you "
577
+ "from receiving emails about your own changes."
578
+ msgstr ""
579
+
580
+ #: includes/admin/class-bnfw-notification.php:542
581
+ msgid "Do not send this Notification to the User that triggered it"
582
+ msgstr "N'envoyez pas cette notification à l'utilisateur qui l'a déclenchée"
583
+
584
+ #: includes/admin/class-bnfw-notification.php:551
585
+ msgid "Send To"
586
+ msgstr "Envoyer à"
587
+
588
+ #: includes/admin/class-bnfw-notification.php:552
589
+ msgid "Choose the users and/or user roles to send this email notification to."
590
+ msgstr ""
591
+
592
+ #: includes/admin/class-bnfw-notification.php:565
593
+ msgid "Except For"
594
+ msgstr ""
595
+
596
+ #: includes/admin/class-bnfw-notification.php:568
597
+ msgid ""
598
+ "Choose the users and/or user roles that this notification should not be sent "
599
+ "to."
600
+ msgstr ""
601
+
602
+ #: includes/admin/class-bnfw-notification.php:593
603
+ msgid ""
604
+ "You have chosen to send this notification to over 200 users. Please check "
605
+ "the email sending rate limit at your host before sending."
606
+ msgstr ""
607
+
608
+ #: includes/admin/class-bnfw-notification.php:603
609
+ #: includes/admin/class-bnfw-notification.php:1129
610
+ msgid "Subject"
611
+ msgstr "Objet"
612
+
613
+ #: includes/admin/class-bnfw-notification.php:604
614
+ msgid "Notification subject. You can use "
615
+ msgstr "Objet de la notification. Vous pouvez utiliser"
616
+
617
+ #: includes/admin/class-bnfw-notification.php:604
618
+ #: includes/admin/class-bnfw-notification.php:618
619
+ msgid " here."
620
+ msgstr ""
621
+
622
+ #: includes/admin/class-bnfw-notification.php:617
623
+ msgid "Message Body"
624
+ msgstr "Votre message"
625
+
626
+ #: includes/admin/class-bnfw-notification.php:618
627
+ msgid "Notification message. You can use "
628
+ msgstr "Message de notification. Vous pouvez utiliser"
629
+
630
+ #: includes/admin/class-bnfw-notification.php:626
631
+ msgid "Need some more help?"
632
+ msgstr "Besoin d'aide supplémentaire?"
633
+
634
+ #: includes/admin/class-bnfw-notification.php:636
635
+ msgid "Insert Default Content"
636
+ msgstr "Insérer le contenu par défaut"
637
+
638
+ #: includes/admin/class-bnfw-notification.php:640
639
+ msgid "Read Documentation"
640
+ msgstr "Lire la documentation"
641
+
642
+ #: includes/admin/class-bnfw-notification.php:644
643
+ msgid "Find Shortcodes"
644
+ msgstr "Aide sur les Shortcodes"
645
+
646
+ #: includes/admin/class-bnfw-notification.php:655
647
+ msgid ""
648
+ "Stop additional paragraph and line break HTML from being inserted into my "
649
+ "notifications"
650
+ msgstr ""
651
+ "Éviter que des paragraphes additionnels et des retours à la ligne HTML "
652
+ "soient insérés dans mes notifications"
653
+
654
+ #: includes/admin/class-bnfw-notification.php:710
655
+ msgid ""
656
+ "You must choose at least one User or User Role to send the notification to "
657
+ "before you can save"
658
+ msgstr ""
659
+
660
+ #: includes/admin/class-bnfw-notification.php:825
661
+ msgid "Test Notification Sent."
662
+ msgstr "Test de notification envoyé."
663
+
664
+ #: includes/admin/class-bnfw-notification.php:915
665
+ msgid "Notification saved."
666
+ msgstr "Notification enregistrée."
667
+
668
+ #: includes/admin/class-bnfw-notification.php:934
669
+ #: includes/admin/class-bnfw-notification.php:992
670
+ #: includes/admin/class-bnfw-notification.php:994
671
+ msgid "Save"
672
+ msgstr "Enregister"
673
+
674
+ #: includes/admin/class-bnfw-notification.php:942
675
+ msgid ""
676
+ "Use this to enable or disable notifications. If you want to disable a "
677
+ "default WordPress notification, just create it on the left, then disable it "
678
+ "here."
679
+ msgstr ""
680
+
681
+ #: includes/admin/class-bnfw-notification.php:949
682
+ msgid "Notification Enabled"
683
+ msgstr "Notification activée"
684
+
685
+ #: includes/admin/class-bnfw-notification.php:956
686
+ msgid "Notification Disabled"
687
+ msgstr "Notification désactivée"
688
+
689
+ #: includes/admin/class-bnfw-notification.php:967
690
+ msgid "Send Me a Test Email"
691
+ msgstr "Envoyez-moi un email de test"
692
+
693
+ #: includes/admin/class-bnfw-notification.php:969
694
+ msgid ""
695
+ "This will send you (the currently logged in user) a notification so that you "
696
+ "can check for any issues with formatting – it’s doesn't mean that a "
697
+ "notification will send correctly in the future. You can read about how to "
698
+ "improve email delivery"
699
+ msgstr ""
700
+
701
+ #: includes/admin/class-bnfw-notification.php:969
702
+ msgid "here"
703
+ msgstr ""
704
+
705
+ #: includes/admin/class-bnfw-notification.php:969
706
+ msgid ". Shortcodes will not be replaced with content."
707
+ msgstr ""
708
+
709
+ #: includes/admin/class-bnfw-notification.php:980
710
+ msgid "Delete Permanently"
711
+ msgstr "Supprimer définitivement"
712
+
713
+ #: includes/admin/class-bnfw-notification.php:982
714
+ msgid "Move to Trash"
715
+ msgstr "Déplacer dans la corbeille"
716
+
717
+ #: includes/admin/class-bnfw-notification.php:1127
718
+ msgid "Notification Type"
719
+ msgstr "Type de notification"
720
+
721
+ #: includes/admin/class-bnfw-notification.php:1128
722
+ msgid "Enabled?"
723
+ msgstr "Activé ?"
724
+
725
+ #: includes/admin/class-bnfw-notification.php:1130
726
+ msgid "User Roles / Users"
727
+ msgstr "Rôles de l'utilisateur / Utilisateurs"
728
+
729
+ #: includes/admin/class-bnfw-notification.php:1131
730
+ msgid "Excluded User Roles / Users"
731
+ msgstr "Rôles d'utilisateur / utilisateurs exclus"
732
+
733
+ #: includes/admin/class-bnfw-notification.php:1172
734
+ msgid ", Post Author"
735
+ msgstr ""
736
+
737
+ #: includes/admin/class-bnfw-notification.php:1338
738
+ msgid "Privacy – Confirm Action: Export Data Request – For User"
739
+ msgstr ""
740
+
741
+ #: includes/admin/class-bnfw-notification.php:1341
742
+ msgid "Privacy – Confirm Action: Erase Data Request – For User"
743
+ msgstr ""
744
+
745
+ #: includes/admin/class-bnfw-notification.php:1389
746
+ msgid "Published"
747
+ msgstr "Publié"
748
+
749
+ #: includes/admin/class-bnfw-notification.php:1392
750
+ msgid "Updated "
751
+ msgstr "Mis(e) a jour "
752
+
753
+ #: includes/admin/class-bnfw-notification.php:1395
754
+ msgid " Pending Review"
755
+ msgstr " En attente de relecture"
756
+
757
+ #: includes/admin/class-bnfw-notification.php:1398
758
+ msgid " Scheduled"
759
+ msgstr " Planifié"
760
+
761
+ #: includes/admin/class-bnfw-notification.php:1404
762
+ msgid " Comment"
763
+ msgstr " Commentaire"
764
+
765
+ #: includes/admin/class-bnfw-notification.php:1410
766
+ msgid " Comment Reply"
767
+ msgstr "Commentaire Répondre"
768
+
769
+ #: includes/admin/class-bnfw-notification.php:1413
770
+ msgid " Comment Approved"
771
+ msgstr "Commentaire approuvé"
772
+
773
+ #: includes/admin/class-bnfw-notification.php:1418
774
+ msgid "New Term"
775
+ msgstr "Nouveau mandat"
776
+
777
+ #: includes/admin/class-bnfw-notification.php:1420
778
+ msgid "New Term in "
779
+ msgstr "Nouveau terme dans "
780
+
781
+ #: includes/admin/class-bnfw-notification.php:1440
782
+ msgid "Enable Notifications"
783
+ msgstr "Activer les notifications"
784
+
785
+ #: includes/admin/class-bnfw-notification.php:1441
786
+ msgid "Disable Notifications"
787
+ msgstr "Désactiver les notifications"
788
+
789
+ #: includes/admin/class-bnfw-notification.php:1502
790
+ msgid "Enable Notification"
791
+ msgstr "Activer la notification"
792
+
793
+ #: includes/admin/class-bnfw-notification.php:1510
794
+ msgid "Disable Notification"
795
+ msgstr "Désactiver les notifications"
796
+
797
+ #: includes/admin/class-bnfw-notification.php:1568
798
+ msgid "Enabled 1 Notification."
799
+ msgstr "Notification activée 1."
800
+
801
+ #: includes/admin/class-bnfw-notification.php:1572
802
+ msgid "Disabled 1 Notification."
803
+ msgstr "Désactivé 1 Notification."
804
+
805
+ #: includes/admin/class-bnfw-notification.php:1578
806
+ #, php-format
807
+ msgid "Enabled %s Notification."
808
+ msgid_plural "Enabled %s Notifications."
809
+ msgstr[0] "Notification% s activée."
810
+ msgstr[1] "Notifications% s activées."
811
+
812
+ #: includes/admin/class-bnfw-notification.php:1588
813
+ #, php-format
814
+ msgid "Disabled %s Notification."
815
+ msgid_plural "Disabled %s Notifications."
816
+ msgstr[0] "Notification% s désactivée."
817
+ msgstr[1] "Notifications% s désactivées."
818
+
819
+ #: includes/admin/class-bnfw-notification.php:1602
820
+ msgid ""
821
+ "If you send out notifications with BNFW but don't receive them, you may need "
822
+ "to install an SMTP plugin to <a href=\"https://betternotificationsforwp.com/"
823
+ "documentation/getting-started/how-to-improve-email-delivery/\" target="
824
+ "\"_blank\">improve email deliverability</a>. I recommend using <a href="
825
+ "\"https://wordpress.org/plugins/post-smtp/\" target=\"_blank\">Post SMTP</a> "
826
+ "as it's easy to set-up or <a href=\"https://wordpress.org/plugins/email-log/"
827
+ "\" target=\"_blank\">Email Log</a> to just log and view emails that are sent."
828
+ msgstr ""
829
+
830
+ #: includes/engine/class-bnfw-engine.php:18
831
+ msgid "Test Email:"
832
+ msgstr "Email de test:"
833
+
834
+ #: includes/engine/class-bnfw-engine.php:19
835
+ msgid ""
836
+ "This is a test email. All shortcodes below will show in place but not be "
837
+ "replaced with content."
838
+ msgstr ""
839
+
840
+ #: includes/engine/class-bnfw-engine.php:1583
841
+ msgid "Error: Download link is not available please contact support"
842
+ msgstr ""
843
+
844
+ #: includes/helpers/ajax-helpers.php:34 includes/helpers/helpers.php:38
845
+ msgid "User Roles"
846
+ msgstr "Rôles utilisateurs"
847
+
848
+ #: includes/helpers/ajax-helpers.php:57 includes/helpers/helpers.php:59
849
+ #: includes/helpers/helpers.php:64
850
+ msgid "Users"
851
+ msgstr "Abonnés"
852
+
853
+ #: includes/helpers/helpers.php:103
854
+ msgid "Non WordPress Users"
855
+ msgstr ""
856
+
857
+ #: includes/import.php:69
858
+ msgid " for "
859
+ msgstr " pour "
860
+
861
+ #: includes/import.php:69
862
+ msgid " (Auto Imported)"
863
+ msgstr ""
864
+ " \n"
865
+ "(Importé automatiquement)"
866
+
867
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:228
868
+ #, fuzzy, php-format
869
+ #| msgid ""
870
+ #| "There is a new version of %1$s available. <a target=\"_blank\" class="
871
+ #| "\"thickbox\" href=\"%2$s\">View version %3$s details</a>."
872
+ msgid ""
873
+ "There is a new version of %1$s available. %2$sView version %3$s details%4$s."
874
+ msgstr ""
875
+ "Une nouvelle version de %1$s est disponible. <a target=\"_blank\" class="
876
+ "\"thickbox\" href=\"%2$s\">Voir les détails de la version %3$s</a>."
877
+
878
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:236
879
+ #, fuzzy, php-format
880
+ #| msgid ""
881
+ #| "There is a new version of %1$s available. <a target=\"_blank\" class="
882
+ #| "\"thickbox\" href=\"%2$s\">View version %3$s details</a> or <a href=\"%4$s"
883
+ #| "\">update now</a>."
884
+ msgid ""
885
+ "There is a new version of %1$s available. %2$sView version %3$s details%4$s "
886
+ "or %5$supdate now%6$s."
887
+ msgstr ""
888
+ "Une nouvelle version de %1$s est disponible. <a target=\"_blank\" class="
889
+ "\"thickbox\" href=\"%2$s\">Voir les détails de la version %3$s</a> ou <a "
890
+ "href=\"%4$s\">effectuer la mise à jour maintenant</a>."
891
+
892
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:474
893
+ msgid "You do not have permission to install plugin updates"
894
+ msgstr ""
895
+ "Vous n’avez pas les droits pour installer des mises à jour d’extensions"
896
+
897
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:474
898
+ msgid "Error"
899
+ msgstr "Erreur"
900
+
901
+ #: includes/license/class-bnfw-license-setting.php:18
902
+ #: includes/license/class-bnfw-license-setting.php:19
903
+ msgid "Add-on Licenses"
904
+ msgstr "Licences complémentaires"
905
+
906
+ #: includes/license/class-bnfw-license-setting.php:38
907
+ msgid "BNFW Add-on Licenses"
908
+ msgstr "Licences complémentaires BNFW"
909
+
910
+ #: includes/license/class-bnfw-license-setting.php:47
911
+ msgid "Save License"
912
+ msgstr "Enregistrer la licence"
913
+
914
+ #: includes/license/class-bnfw-license-setting.php:55
915
+ msgid ""
916
+ "<br>You have no BNFW Premium Add-ons installed yet.<br>You can buy add-ons "
917
+ "from the <a href=\""
918
+ msgstr ""
919
+
920
+ #: includes/license/class-bnfw-license-setting.php:130
921
+ msgid "Deactivate License"
922
+ msgstr "Désactiver la license"
923
+
924
+ #: includes/license/class-bnfw-license.php:140
925
+ #, php-format
926
+ msgid "%1$s License Key"
927
+ msgstr "%1$s clé de licence"
928
+
929
+ #: includes/overrides.php:41 includes/overrides.php:135
930
+ #, php-format
931
+ msgid "New user registration on your site %s:"
932
+ msgstr "Enregistrement d'un nouvel utilisateur sur votre site %s"
933
+
934
+ #: includes/overrides.php:42 includes/overrides.php:117
935
+ #: includes/overrides.php:136 includes/overrides.php:152
936
+ #, php-format
937
+ msgid "Username: %s"
938
+ msgstr "Utilisateur : %s"
939
+
940
+ #: includes/overrides.php:43 includes/overrides.php:137
941
+ #, php-format
942
+ msgid "E-mail: %s"
943
+ msgstr "Adresse email: %s"
944
+
945
+ #. translators: Password change notification email subject. %s: Site title
946
+ #: includes/overrides.php:48 includes/overrides.php:139
947
+ #, php-format
948
+ msgid "[%s] New User Registration"
949
+ msgstr "[%s] Enregistrement d'un nouvel utilisateur"
950
+
951
+ #: includes/overrides.php:118
952
+ msgid "To set your password, visit the following address:"
953
+ msgstr "Pour choisir votre mot de passe, rendez-vous à l'adresse suivante :"
954
+
955
+ #: includes/overrides.php:123
956
+ #, php-format
957
+ msgid "[%s] Your username and password info"
958
+ msgstr "[%s] Votre identifiant et votre mot de passe"
959
+
960
+ #: includes/overrides.php:153
961
+ #, php-format
962
+ msgid "Password: %s"
963
+ msgstr "Mot de passe: %s"
964
+
965
+ #: includes/overrides.php:156
966
+ #, php-format
967
+ msgid "[%s] Your username and password"
968
+ msgstr "[%s] Vos nom d'utilisateur et mot de passe"
969
+
970
+ #. translators: %s: user name
971
+ #: includes/overrides.php:184
972
+ #, php-format
973
+ msgid "Password changed for user: %s"
974
+ msgstr "Mot de passe modifié pour l'utilisateur: %s"
975
+
976
+ #. translators: %s: site title
977
+ #: includes/overrides.php:189
978
+ #, php-format
979
+ msgid "[%s] Password Changed"
980
+ msgstr ""
981
+
982
+ #. Plugin Name of the plugin/theme
983
+ msgid "Better Notifications for WP"
984
+ msgstr "Better Notifications pour WordPress"
985
+
986
+ #. Plugin URI of the plugin/theme
987
+ #, fuzzy
988
+ #| msgid "http://wordpress.org/plugins/bnfw/"
989
+ msgid "https://wordpress.org/plugins/bnfw/"
990
+ msgstr "http://wordpress.org/plugins/bnfw/"
991
+
992
+ #. Description of the plugin/theme
993
+ msgid ""
994
+ "Supercharge your WordPress notifications using a WYSIWYG editor and "
995
+ "shortcodes. Default and new notifications available. Add more power with Add-"
996
+ "ons."
997
+ msgstr ""
998
+
999
+ #. Author of the plugin/theme
1000
+ msgid "Made with Fuel"
1001
+ msgstr "Made with Fuel"
1002
+
1003
+ #. Author URI of the plugin/theme
1004
+ msgid "https://madewithfuel.com/"
1005
+ msgstr ""
1006
+
1007
+ #~ msgid "Show additional email fields"
1008
+ #~ msgstr "Afficher des champs d’emails supplémentaires"
1009
+
1010
+ #~ msgid ""
1011
+ #~ "Send customisable emails to your users for different WordPress "
1012
+ #~ "notifications."
1013
+ #~ msgstr ""
1014
+ #~ "Envoyez des emails personnalisés à vos utilisateurs pour différentes "
1015
+ #~ "notifications."
1016
+
1017
+ #~ msgid "https://betternotificationsforwp.com/"
1018
+ #~ msgstr "https://betternotificationsforwp.com/"
1019
+
1020
+ #~ msgid "Update "
1021
+ #~ msgstr "Mettre à jour"
1022
+
1023
+ #~ msgid "New User - Welcome Email"
1024
+ #~ msgstr "Nouvel utilisateur - message de bienvenue"
languages/bnfw-nl_NL.mo CHANGED
File without changes
languages/bnfw-nl_NL.po CHANGED
@@ -1,997 +1,997 @@
1
- # Copyright (C) 2015 Better Notifications for WP
2
- # This file is distributed under the same license as the Better Notifications for WP package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Better Notifications for WP 1.3.3\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/bnfw\n"
7
- "POT-Creation-Date: 2020-11-27 21:34+0800\n"
8
- "PO-Revision-Date: 2020-11-28 00:03+0800\n"
9
- "Last-Translator: \n"
10
- "Language-Team: \n"
11
- "Language: nl_NL\n"
12
- "MIME-Version: 1.0\n"
13
- "Content-Type: text/plain; charset=UTF-8\n"
14
- "Content-Transfer-Encoding: 8bit\n"
15
- "X-Generator: Poedit 2.2\n"
16
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
-
18
- #: bnfw.php:283 includes/admin/bnfw-settings.php:15
19
- msgid "Settings"
20
- msgstr "Instellingen"
21
-
22
- #: includes/admin/bnfw-settings.php:14
23
- #: includes/admin/class-bnfw-notification.php:129
24
- msgid "Notification Settings"
25
- msgstr "Meldingen instellingen"
26
-
27
- #: includes/admin/bnfw-settings.php:38
28
- msgid "BNFW Settings"
29
- msgstr "BNFW instellingen"
30
-
31
- #: includes/admin/bnfw-settings.php:46
32
- msgid "Save Settings"
33
- msgstr "Instellingen opslaan"
34
-
35
- #: includes/admin/bnfw-settings.php:73
36
- msgid "Documentation"
37
- msgstr ""
38
-
39
- #: includes/admin/bnfw-settings.php:80
40
- msgid "Premium Add-ons"
41
- msgstr ""
42
-
43
- #: includes/admin/bnfw-settings.php:87
44
- msgid "Priority Support"
45
- msgstr ""
46
-
47
- #: includes/admin/bnfw-settings.php:150
48
- msgid "Suppress SPAM comment notification"
49
- msgstr "SPAM bericht melding onderdrukken"
50
-
51
- #: includes/admin/bnfw-settings.php:150
52
- msgid ""
53
- "Comments that are correctly marked as SPAM by a 3rd party plugin (such as "
54
- "Akismet) will not generate a notification if this is ticked."
55
- msgstr ""
56
-
57
- #: includes/admin/bnfw-settings.php:155
58
- msgid "Don't send notifications for comments marked as SPAM"
59
- msgstr "Stuur geen meldingen voor opmerkingen die als SPAM zijn gemarkeerd"
60
-
61
- #: includes/admin/bnfw-settings.php:167
62
- msgid "Default Email Format"
63
- msgstr "Standaard e-mail indeling"
64
-
65
- #: includes/admin/bnfw-settings.php:167
66
- msgid ""
67
- "This will apply to all emails sent out via WordPress, even those from other "
68
- "plugins. For more details, please see the "
69
- msgstr ""
70
- "Dit is van toepassing op alle e-mails die via WordPress worden verzonden, "
71
- "zelfs die van andere plug-ins. Zie het"
72
-
73
- #: includes/admin/bnfw-settings.php:181
74
- msgid "Enable Content Shortcodes?"
75
- msgstr ""
76
-
77
- #: includes/admin/bnfw-settings.php:181
78
- msgid "Shortcodes in the post/page content are disabled by default."
79
- msgstr ""
80
-
81
- #: includes/admin/bnfw-settings.php:186
82
- msgid "Enable shortcode output in the page/post content"
83
- msgstr ""
84
-
85
- #: includes/admin/bnfw-settings.php:198
86
- msgid "Allow Usage Tracking?"
87
- msgstr ""
88
-
89
- #: includes/admin/bnfw-settings.php:203
90
- msgid ""
91
- "Allow Better Notifications for WP to anonymously track how this plugin is "
92
- "used and help make the plugin better."
93
- msgstr ""
94
-
95
- #: includes/admin/bnfw-settings.php:251
96
- #: includes/admin/class-bnfw-notification.php:433
97
- msgid "HTML Formatting"
98
- msgstr "HTML-opmaak"
99
-
100
- #: includes/admin/bnfw-settings.php:256
101
- #: includes/admin/class-bnfw-notification.php:439
102
- msgid "Plain Text"
103
- msgstr "Platte tekst"
104
-
105
- #: includes/admin/class-bnfw-notification.php:52
106
- #: includes/admin/class-bnfw-notification.php:55
107
- #: includes/admin/class-bnfw-notification.php:56
108
- msgid "Notifications"
109
- msgstr "Meldingen"
110
-
111
- #: includes/admin/class-bnfw-notification.php:53
112
- msgid "Notification"
113
- msgstr "Melding"
114
-
115
- #: includes/admin/class-bnfw-notification.php:54
116
- msgid "Add New"
117
- msgstr "Nieuwe toevoegen"
118
-
119
- #: includes/admin/class-bnfw-notification.php:57
120
- msgid "Add New Notification"
121
- msgstr "Nieuwe melding toevoegen"
122
-
123
- #: includes/admin/class-bnfw-notification.php:58
124
- msgid "Edit Notification"
125
- msgstr "Bewerk melding"
126
-
127
- #: includes/admin/class-bnfw-notification.php:59
128
- msgid "New Notification"
129
- msgstr "Nieuwe melding"
130
-
131
- #: includes/admin/class-bnfw-notification.php:60
132
- msgid "View Notification"
133
- msgstr "Bekijk melding"
134
-
135
- #: includes/admin/class-bnfw-notification.php:61
136
- msgid "Search Notifications"
137
- msgstr "Zoek meldigen"
138
-
139
- #: includes/admin/class-bnfw-notification.php:62
140
- msgid "No Notifications found"
141
- msgstr "Geen meldingen gevonden"
142
-
143
- #: includes/admin/class-bnfw-notification.php:63
144
- msgid "No Notifications found in trash"
145
- msgstr "Geen meldingen gevonden in prullenmand"
146
-
147
- #: includes/admin/class-bnfw-notification.php:64
148
- msgid "All Notifications"
149
- msgstr "Alle meldingen"
150
-
151
- #: includes/admin/class-bnfw-notification.php:138
152
- msgid "Save Notification"
153
- msgstr "Melding opslaan"
154
-
155
- #: includes/admin/class-bnfw-notification.php:186
156
- msgid "Notification For"
157
- msgstr "Melding voor"
158
-
159
- #: includes/admin/class-bnfw-notification.php:187
160
- msgid ""
161
- "E.g. If you select \"New Post Published\" from the list on the right, this "
162
- "notification will be sent when a new post is published."
163
- msgstr ""
164
-
165
- #: includes/admin/class-bnfw-notification.php:191
166
- msgid "Select the notification type"
167
- msgstr "Selecteer het meldingstype"
168
-
169
- #: includes/admin/class-bnfw-notification.php:192
170
- msgid "Admin"
171
- msgstr ""
172
-
173
- #: includes/admin/class-bnfw-notification.php:194
174
- #: includes/admin/class-bnfw-notification.php:1302
175
- msgid "New User Registration - For Admin"
176
- msgstr "[%s] Registratie nieuwe gebruiker"
177
-
178
- #: includes/admin/class-bnfw-notification.php:196
179
- #: includes/admin/class-bnfw-notification.php:1269
180
- msgid "User Lost Password - For Admin"
181
- msgstr "Gebruiker wachtwoord verloren - voor admin"
182
-
183
- #: includes/admin/class-bnfw-notification.php:198
184
- #: includes/admin/class-bnfw-notification.php:1272
185
- msgid "Password Changed - For Admin"
186
- msgstr "Wachtwoord gewijzigd - voor Admin"
187
-
188
- #: includes/admin/class-bnfw-notification.php:200
189
- #: includes/admin/class-bnfw-notification.php:1275
190
- msgid "User Email Changed - For Admin"
191
- msgstr "E-mailadres van gebruiker gewijzigd - voor admin"
192
-
193
- #: includes/admin/class-bnfw-notification.php:202
194
- #: includes/admin/class-bnfw-notification.php:1308
195
- msgid "User Role Changed - For Admin"
196
- msgstr "Gebruikersrol gewijzigd - voor Admin"
197
-
198
- #: includes/admin/class-bnfw-notification.php:204
199
- #: includes/admin/class-bnfw-notification.php:1296
200
- msgid "User Logged In - For Admin"
201
- msgstr "Gebruiker aangemeld - voor admin"
202
-
203
- #: includes/admin/class-bnfw-notification.php:206
204
- #: includes/admin/class-bnfw-notification.php:1287
205
- msgid "WordPress Core Automatic Background Updates"
206
- msgstr ""
207
-
208
- #: includes/admin/class-bnfw-notification.php:210
209
- #: includes/admin/class-bnfw-notification.php:1344
210
- msgid "Privacy - Confirm Action: Export Data Request - For Admin"
211
- msgstr ""
212
-
213
- #: includes/admin/class-bnfw-notification.php:214
214
- #: includes/admin/class-bnfw-notification.php:1347
215
- msgid "Privacy - Confirm Action: Erase Data Request - For Admin"
216
- msgstr ""
217
-
218
- #: includes/admin/class-bnfw-notification.php:222
219
- msgid "Transactional"
220
- msgstr ""
221
-
222
- #: includes/admin/class-bnfw-notification.php:224
223
- #: includes/admin/class-bnfw-notification.php:1290
224
- msgid "New User Registration - For User"
225
- msgstr "Nieuwe gebruikersregistratie: %s"
226
-
227
- #: includes/admin/class-bnfw-notification.php:226
228
- #: includes/admin/class-bnfw-notification.php:1299
229
- msgid "New User - Post-registration Email"
230
- msgstr "Nieuwe gebruiker - E-mail na registratie"
231
-
232
- #: includes/admin/class-bnfw-notification.php:228
233
- #: includes/admin/class-bnfw-notification.php:1266
234
- msgid "User Lost Password - For User"
235
- msgstr "Wachtwoord verloren gebruiker - voor gebruiker"
236
-
237
- #: includes/admin/class-bnfw-notification.php:230
238
- #: includes/admin/class-bnfw-notification.php:1278
239
- msgid "Password Changed - For User"
240
- msgstr "Wachtwoord gewijzigd - voor gebruiker"
241
-
242
- #: includes/admin/class-bnfw-notification.php:232
243
- #: includes/admin/class-bnfw-notification.php:1281
244
- msgid "User Email Changed Confirmation - For User"
245
- msgstr "Bevestiging e-mail gebruiker gewijzigd - voor gebruiker"
246
-
247
- #: includes/admin/class-bnfw-notification.php:235
248
- #: includes/admin/class-bnfw-notification.php:1284
249
- msgid "User Email Changed - For User"
250
- msgstr "E-mailadres van gebruiker gewijzigd - voor gebruiker"
251
-
252
- #: includes/admin/class-bnfw-notification.php:237
253
- #: includes/admin/class-bnfw-notification.php:1305
254
- msgid "User Role Changed - For User"
255
- msgstr "Gebruikersrol gewijzigd - voor gebruiker"
256
-
257
- #: includes/admin/class-bnfw-notification.php:239
258
- #: includes/admin/class-bnfw-notification.php:1293
259
- msgid "User Logged In - For User"
260
- msgstr "Gebruiker aangemeld - voor gebruiker"
261
-
262
- #: includes/admin/class-bnfw-notification.php:241
263
- #: includes/admin/class-bnfw-notification.php:375
264
- #: includes/admin/class-bnfw-notification.php:1263
265
- msgid "Comment Reply"
266
- msgstr "Deze reactie beantwoorden"
267
-
268
- #: includes/admin/class-bnfw-notification.php:245
269
- msgid "Privacy - Confirm Action: Export Data Request - For User"
270
- msgstr ""
271
-
272
- #: includes/admin/class-bnfw-notification.php:249
273
- msgid "Privacy - Confirm Action: Erase Data Request - For User"
274
- msgstr ""
275
-
276
- #: includes/admin/class-bnfw-notification.php:253
277
- #: includes/admin/class-bnfw-notification.php:1350
278
- msgid "Privacy - Data Export - For User"
279
- msgstr ""
280
-
281
- #: includes/admin/class-bnfw-notification.php:257
282
- #: includes/admin/class-bnfw-notification.php:1353
283
- msgid "Privacy - Data Erased - For User"
284
- msgstr ""
285
-
286
- #: includes/admin/class-bnfw-notification.php:267
287
- #: includes/admin/class-bnfw-notification.php:1311
288
- msgid "New Post Published"
289
- msgstr "Nieuw bericht gepubliceerd"
290
-
291
- #: includes/admin/class-bnfw-notification.php:269
292
- #: includes/admin/class-bnfw-notification.php:1314
293
- msgid "Post Updated"
294
- msgstr "Bericht bijgewerkt."
295
-
296
- #: includes/admin/class-bnfw-notification.php:271
297
- #: includes/admin/class-bnfw-notification.php:1317
298
- msgid "Post Pending Review"
299
- msgstr "Wachtend op review"
300
-
301
- #: includes/admin/class-bnfw-notification.php:273
302
- #: includes/admin/class-bnfw-notification.php:1320
303
- msgid "New Private Post"
304
- msgstr ""
305
-
306
- #: includes/admin/class-bnfw-notification.php:275
307
- #: includes/admin/class-bnfw-notification.php:1323
308
- msgid "Post Scheduled"
309
- msgstr "Bericht gepland"
310
-
311
- #: includes/admin/class-bnfw-notification.php:277
312
- #: includes/admin/class-bnfw-notification.php:1326
313
- msgid "Published Post Moved to Trash"
314
- msgstr "Gepubliceerde post naar prullenbak verplaatst"
315
-
316
- #: includes/admin/class-bnfw-notification.php:279
317
- #: includes/admin/class-bnfw-notification.php:367
318
- #: includes/admin/class-bnfw-notification.php:1248
319
- msgid "New Comment"
320
- msgstr "Nieuwe reactie toevoegen"
321
-
322
- #: includes/admin/class-bnfw-notification.php:282
323
- #: includes/admin/class-bnfw-notification.php:369
324
- #: includes/admin/class-bnfw-notification.php:1254
325
- #: includes/admin/class-bnfw-notification.php:1407
326
- msgid "New Comment Awaiting Moderation"
327
- msgstr "Nieuwe reactie wacht op moderatie"
328
-
329
- #: includes/admin/class-bnfw-notification.php:285
330
- #: includes/admin/class-bnfw-notification.php:1251
331
- msgid "Post - Comment Approved"
332
- msgstr ""
333
-
334
- #: includes/admin/class-bnfw-notification.php:288
335
- #: includes/admin/class-bnfw-notification.php:1332
336
- msgid "New Category"
337
- msgstr "Nieuwe categorie toevoegen"
338
-
339
- #: includes/admin/class-bnfw-notification.php:290
340
- #: includes/admin/class-bnfw-notification.php:1335
341
- msgid "New Tag"
342
- msgstr "Nieuwe tag toevoegen"
343
-
344
- #: includes/admin/class-bnfw-notification.php:292
345
- #: includes/admin/class-bnfw-notification.php:1257
346
- msgid "New Trackback"
347
- msgstr "Nieuwe trackback op je bericht \"%s\""
348
-
349
- #: includes/admin/class-bnfw-notification.php:294
350
- #: includes/admin/class-bnfw-notification.php:1260
351
- msgid "New Pingback"
352
- msgstr "Nieuwe pingback op bericht \"%s\""
353
-
354
- #: includes/admin/class-bnfw-notification.php:301
355
- #: includes/admin/class-bnfw-notification.php:1329
356
- msgid "New Page Published"
357
- msgstr "Nieuwe pagina gepubliceerd"
358
-
359
- #: includes/admin/class-bnfw-notification.php:303
360
- msgid "Page Updated"
361
- msgstr "Pagina bijgewerkt."
362
-
363
- #: includes/admin/class-bnfw-notification.php:305
364
- msgid "Page Pending Review"
365
- msgstr "Pagina wacht op review"
366
-
367
- #: includes/admin/class-bnfw-notification.php:307
368
- msgid "New Private Page"
369
- msgstr ""
370
-
371
- #: includes/admin/class-bnfw-notification.php:309
372
- msgid "Page Scheduled"
373
- msgstr "Pagina gepland "
374
-
375
- #: includes/admin/class-bnfw-notification.php:311
376
- msgid "Page - New Comment"
377
- msgstr "Nieuwe reactie toevoegen"
378
-
379
- #: includes/admin/class-bnfw-notification.php:313
380
- msgid "Page - New Comment Awaiting Moderation"
381
- msgstr "Pagina - Nieuwe reactie wacht op moderatie"
382
-
383
- #: includes/admin/class-bnfw-notification.php:316
384
- #: includes/admin/class-bnfw-notification.php:1365
385
- msgid "Page - Comment Approved"
386
- msgstr "Pagina - Reactie goedgekeurd"
387
-
388
- #: includes/admin/class-bnfw-notification.php:319
389
- msgid "Page - Comment Reply"
390
- msgstr "Pagina - Reactie Reageren"
391
-
392
- #: includes/admin/class-bnfw-notification.php:326
393
- #: includes/admin/class-bnfw-notification.php:1356
394
- msgid "New Media Published"
395
- msgstr "Nieuwe media gepubliceerd"
396
-
397
- #: includes/admin/class-bnfw-notification.php:328
398
- #: includes/admin/class-bnfw-notification.php:1359
399
- msgid "Media Updated"
400
- msgstr "Pagina bijgewerkt."
401
-
402
- #: includes/admin/class-bnfw-notification.php:330
403
- #: includes/admin/class-bnfw-notification.php:1362
404
- msgid "Media - New Comment"
405
- msgstr "Media - Nieuwe reactie"
406
-
407
- #: includes/admin/class-bnfw-notification.php:332
408
- #: includes/admin/class-bnfw-notification.php:1368
409
- msgid "Media - Comment Approved"
410
- msgstr ""
411
-
412
- #: includes/admin/class-bnfw-notification.php:335
413
- #: includes/admin/class-bnfw-notification.php:1371
414
- msgid "Media - New Comment Awaiting Moderation"
415
- msgstr "Media - Nieuwe reactie wacht op moderatie"
416
-
417
- #: includes/admin/class-bnfw-notification.php:337
418
- #: includes/admin/class-bnfw-notification.php:1374
419
- msgid "Media - Comment Reply"
420
- msgstr "Media - Reactie Reageren"
421
-
422
- #: includes/admin/class-bnfw-notification.php:355
423
- msgid "Custom Post Type"
424
- msgstr "Berichttype"
425
-
426
- #: includes/admin/class-bnfw-notification.php:357
427
- #: includes/admin/class-bnfw-notification.php:1389
428
- msgid "New "
429
- msgstr "Nieuw"
430
-
431
- #: includes/admin/class-bnfw-notification.php:357
432
- msgid " Published"
433
- msgstr "Gepubliceerd"
434
-
435
- #: includes/admin/class-bnfw-notification.php:359
436
- msgid "Updated"
437
- msgstr "Bijgewerkt"
438
-
439
- #: includes/admin/class-bnfw-notification.php:361
440
- msgid "Pending Review"
441
- msgstr "Wachtend op review"
442
-
443
- #: includes/admin/class-bnfw-notification.php:363
444
- #: includes/admin/class-bnfw-notification.php:1401
445
- msgid "New Private "
446
- msgstr ""
447
-
448
- #: includes/admin/class-bnfw-notification.php:365
449
- msgid "Scheduled"
450
- msgstr "Gepland"
451
-
452
- #: includes/admin/class-bnfw-notification.php:372
453
- msgid "Comment Approved"
454
- msgstr "Reactie goedgekeurd"
455
-
456
- #: includes/admin/class-bnfw-notification.php:394
457
- msgid "Custom Taxonomy"
458
- msgstr "Taxonomie:"
459
-
460
- #: includes/admin/class-bnfw-notification.php:400
461
- msgid "New"
462
- msgstr "Nieuw"
463
-
464
- #: includes/admin/class-bnfw-notification.php:419
465
- msgid ""
466
- "This notification doesn't support additional email fields due to a "
467
- "limitation in WordPress."
468
- msgstr ""
469
- "Deze melding ondersteunt geen extra e-mailvelden vanwege een beperking in "
470
- "WordPress."
471
-
472
- #: includes/admin/class-bnfw-notification.php:426
473
- msgid "Email Formatting"
474
- msgstr "Formattering"
475
-
476
- #: includes/admin/class-bnfw-notification.php:427
477
- msgid ""
478
- "How do you want to format the sent email? HTML is recommended as it'll show "
479
- "images and links correctly."
480
- msgstr ""
481
-
482
- #: includes/admin/class-bnfw-notification.php:448
483
- msgid "Additional Email Fields"
484
- msgstr "Additionele e-mailvelden"
485
-
486
- #: includes/admin/class-bnfw-notification.php:449
487
- msgid ""
488
- "This should be fairly self explanatory but if you're unsure, tick this "
489
- "checkbox and have a look at the available options. You can always untick it "
490
- "again should you decide you don't need to use it."
491
- msgstr ""
492
-
493
- #: includes/admin/class-bnfw-notification.php:454
494
- msgid "Set \"From\" Name & Email, Reply To, CC, BCC"
495
- msgstr ""
496
-
497
- #: includes/admin/class-bnfw-notification.php:461
498
- msgid "From Name and Email"
499
- msgstr "Naam en e-mailadres zijn verplicht bij het plaatsen van een reactie"
500
-
501
- #: includes/admin/class-bnfw-notification.php:462
502
- msgid ""
503
- "If you want to send the email from your site name and email address instead "
504
- "of the default \"WordPress\" from \"wordpress@domain.com\", this is where "
505
- "you can do it."
506
- msgstr ""
507
-
508
- #: includes/admin/class-bnfw-notification.php:466
509
- msgid "Site Name"
510
- msgstr ""
511
-
512
- #: includes/admin/class-bnfw-notification.php:468
513
- msgid "Site Email"
514
- msgstr ""
515
-
516
- #: includes/admin/class-bnfw-notification.php:475
517
- msgid "Reply To"
518
- msgstr ""
519
-
520
- #: includes/admin/class-bnfw-notification.php:476
521
- msgid ""
522
- "If you want any replies to your email notification to go to another person, "
523
- "fill in this box with their name and email address."
524
- msgstr ""
525
-
526
- #: includes/admin/class-bnfw-notification.php:480
527
- msgid "Name"
528
- msgstr ""
529
-
530
- #: includes/admin/class-bnfw-notification.php:482
531
- msgid "Email"
532
- msgstr "E-mail"
533
-
534
- #: includes/admin/class-bnfw-notification.php:488
535
- msgid "CC"
536
- msgstr "CC:"
537
-
538
- #: includes/admin/class-bnfw-notification.php:489
539
- msgid "Publicly copy in any other users or user roles to this email."
540
- msgstr ""
541
-
542
- #: includes/admin/class-bnfw-notification.php:494
543
- #: includes/admin/class-bnfw-notification.php:508
544
- #: includes/admin/class-bnfw-notification.php:557
545
- #: includes/admin/class-bnfw-notification.php:575
546
- msgid "Select User Roles / Users"
547
- msgstr "Selecteer Gebruikersrollen / gebruikers"
548
-
549
- #: includes/admin/class-bnfw-notification.php:502
550
- msgid "BCC"
551
- msgstr "BCC:"
552
-
553
- #: includes/admin/class-bnfw-notification.php:503
554
- msgid "Privately copy in any other users or user roles to this email."
555
- msgstr ""
556
-
557
- #: includes/admin/class-bnfw-notification.php:518
558
- msgid "Send to Author"
559
- msgstr ""
560
-
561
- #: includes/admin/class-bnfw-notification.php:519
562
- msgid ""
563
- "E.g. If you want a new post published notification to go to the post author, "
564
- "tick this box."
565
- msgstr ""
566
-
567
- #: includes/admin/class-bnfw-notification.php:526
568
- msgid "Send this notification to the Author"
569
- msgstr "Stuur deze melding naar de auteur"
570
-
571
- #: includes/admin/class-bnfw-notification.php:536
572
- msgid ""
573
- "E.g. If you're an editor and regularly update your posts, you might not want "
574
- "to be emailed about this all the time. Ticking this box will prevent you "
575
- "from receiving emails about your own changes."
576
- msgstr ""
577
-
578
- #: includes/admin/class-bnfw-notification.php:542
579
- msgid "Do not send this Notification to the User that triggered it"
580
- msgstr ""
581
- "Stuur deze kennisgeving niet naar de gebruiker die deze heeft geactiveerd"
582
-
583
- #: includes/admin/class-bnfw-notification.php:551
584
- msgid "Send To"
585
- msgstr ""
586
-
587
- #: includes/admin/class-bnfw-notification.php:552
588
- msgid "Choose the users and/or user roles to send this email notification to."
589
- msgstr ""
590
-
591
- #: includes/admin/class-bnfw-notification.php:565
592
- msgid "Except For"
593
- msgstr ""
594
-
595
- #: includes/admin/class-bnfw-notification.php:568
596
- msgid ""
597
- "Choose the users and/or user roles that this notification should not be sent "
598
- "to."
599
- msgstr ""
600
-
601
- #: includes/admin/class-bnfw-notification.php:593
602
- msgid ""
603
- "You have chosen to send this notification to over 200 users. Please check "
604
- "the email sending rate limit at your host before sending."
605
- msgstr ""
606
-
607
- #: includes/admin/class-bnfw-notification.php:603
608
- #: includes/admin/class-bnfw-notification.php:1129
609
- msgid "Subject"
610
- msgstr ""
611
-
612
- #: includes/admin/class-bnfw-notification.php:604
613
- msgid "Notification subject. You can use "
614
- msgstr "Onderwerp van melding. Je kunt gebruiken"
615
-
616
- #: includes/admin/class-bnfw-notification.php:604
617
- #: includes/admin/class-bnfw-notification.php:618
618
- msgid " here."
619
- msgstr ""
620
-
621
- #: includes/admin/class-bnfw-notification.php:617
622
- msgid "Message Body"
623
- msgstr ""
624
-
625
- #: includes/admin/class-bnfw-notification.php:618
626
- msgid "Notification message. You can use "
627
- msgstr "Meldingsbericht. Je kunt gebruiken"
628
-
629
- #: includes/admin/class-bnfw-notification.php:626
630
- msgid "Need some more help?"
631
- msgstr ""
632
-
633
- #: includes/admin/class-bnfw-notification.php:636
634
- msgid "Insert Default Content"
635
- msgstr "Voeg standaardinhoud in"
636
-
637
- #: includes/admin/class-bnfw-notification.php:640
638
- msgid "Read Documentation"
639
- msgstr ""
640
-
641
- #: includes/admin/class-bnfw-notification.php:644
642
- msgid "Find Shortcodes"
643
- msgstr ""
644
-
645
- #: includes/admin/class-bnfw-notification.php:655
646
- msgid ""
647
- "Stop additional paragraph and line break HTML from being inserted into my "
648
- "notifications"
649
- msgstr ""
650
-
651
- #: includes/admin/class-bnfw-notification.php:710
652
- msgid ""
653
- "You must choose at least one User or User Role to send the notification to "
654
- "before you can save"
655
- msgstr ""
656
-
657
- #: includes/admin/class-bnfw-notification.php:825
658
- msgid "Test Notification Sent."
659
- msgstr ""
660
-
661
- #: includes/admin/class-bnfw-notification.php:915
662
- msgid "Notification saved."
663
- msgstr ""
664
-
665
- #: includes/admin/class-bnfw-notification.php:934
666
- #: includes/admin/class-bnfw-notification.php:992
667
- #: includes/admin/class-bnfw-notification.php:994
668
- msgid "Save"
669
- msgstr ""
670
-
671
- #: includes/admin/class-bnfw-notification.php:942
672
- msgid ""
673
- "Use this to enable or disable notifications. If you want to disable a "
674
- "default WordPress notification, just create it on the left, then disable it "
675
- "here."
676
- msgstr ""
677
-
678
- #: includes/admin/class-bnfw-notification.php:949
679
- msgid "Notification Enabled"
680
- msgstr "Melding ingeschakeld"
681
-
682
- #: includes/admin/class-bnfw-notification.php:956
683
- msgid "Notification Disabled"
684
- msgstr "Melding uitgeschakeld"
685
-
686
- #: includes/admin/class-bnfw-notification.php:967
687
- msgid "Send Me a Test Email"
688
- msgstr "Stuur mij een test e-mail"
689
-
690
- #: includes/admin/class-bnfw-notification.php:969
691
- msgid ""
692
- "This will send you (the currently logged in user) a notification so that you "
693
- "can check for any issues with formatting – it’s doesn't mean that a "
694
- "notification will send correctly in the future. You can read about how to "
695
- "improve email delivery"
696
- msgstr ""
697
-
698
- #: includes/admin/class-bnfw-notification.php:969
699
- msgid "here"
700
- msgstr ""
701
-
702
- #: includes/admin/class-bnfw-notification.php:969
703
- msgid ". Shortcodes will not be replaced with content."
704
- msgstr ""
705
-
706
- #: includes/admin/class-bnfw-notification.php:980
707
- msgid "Delete Permanently"
708
- msgstr "Permanent verwijderen"
709
-
710
- #: includes/admin/class-bnfw-notification.php:982
711
- msgid "Move to Trash"
712
- msgstr "In de prullenbak"
713
-
714
- #: includes/admin/class-bnfw-notification.php:1127
715
- msgid "Notification Type"
716
- msgstr "Type melding"
717
-
718
- #: includes/admin/class-bnfw-notification.php:1128
719
- msgid "Enabled?"
720
- msgstr "Actief?"
721
-
722
- #: includes/admin/class-bnfw-notification.php:1130
723
- msgid "User Roles / Users"
724
- msgstr "Gebruikersrollen"
725
-
726
- #: includes/admin/class-bnfw-notification.php:1131
727
- msgid "Excluded User Roles / Users"
728
- msgstr "Uitgesloten gebruikersrollen / gebruikers"
729
-
730
- #: includes/admin/class-bnfw-notification.php:1172
731
- msgid ", Post Author"
732
- msgstr ""
733
-
734
- #: includes/admin/class-bnfw-notification.php:1338
735
- msgid "Privacy – Confirm Action: Export Data Request – For User"
736
- msgstr ""
737
-
738
- #: includes/admin/class-bnfw-notification.php:1341
739
- msgid "Privacy – Confirm Action: Erase Data Request – For User"
740
- msgstr ""
741
-
742
- #: includes/admin/class-bnfw-notification.php:1389
743
- msgid "Published"
744
- msgstr "Gepubliceerd"
745
-
746
- #: includes/admin/class-bnfw-notification.php:1392
747
- msgid "Updated "
748
- msgstr "Bijgewerkt!"
749
-
750
- #: includes/admin/class-bnfw-notification.php:1395
751
- msgid " Pending Review"
752
- msgstr "Wachtend op review"
753
-
754
- #: includes/admin/class-bnfw-notification.php:1398
755
- msgid " Scheduled"
756
- msgstr "Gepland"
757
-
758
- #: includes/admin/class-bnfw-notification.php:1404
759
- msgid " Comment"
760
- msgstr "Reactie"
761
-
762
- #: includes/admin/class-bnfw-notification.php:1410
763
- msgid " Comment Reply"
764
- msgstr "Reageer Reageer"
765
-
766
- #: includes/admin/class-bnfw-notification.php:1413
767
- msgid " Comment Approved"
768
- msgstr "Reactie goedgekeurd"
769
-
770
- #: includes/admin/class-bnfw-notification.php:1418
771
- msgid "New Term"
772
- msgstr "Nieuwe term"
773
-
774
- #: includes/admin/class-bnfw-notification.php:1420
775
- msgid "New Term in "
776
- msgstr ""
777
-
778
- #: includes/admin/class-bnfw-notification.php:1440
779
- msgid "Enable Notifications"
780
- msgstr "Notificaties aanzetten"
781
-
782
- #: includes/admin/class-bnfw-notification.php:1441
783
- msgid "Disable Notifications"
784
- msgstr "Meldingen uitschakelen"
785
-
786
- #: includes/admin/class-bnfw-notification.php:1502
787
- msgid "Enable Notification"
788
- msgstr "Melding inschakelen"
789
-
790
- #: includes/admin/class-bnfw-notification.php:1510
791
- msgid "Disable Notification"
792
- msgstr "Uitschakelen melding"
793
-
794
- #: includes/admin/class-bnfw-notification.php:1568
795
- msgid "Enabled 1 Notification."
796
- msgstr "Ingeschakeld 1 Melding."
797
-
798
- #: includes/admin/class-bnfw-notification.php:1572
799
- msgid "Disabled 1 Notification."
800
- msgstr "Uitgeschakeld 1 Melding."
801
-
802
- #: includes/admin/class-bnfw-notification.php:1578
803
- #, php-format
804
- msgid "Enabled %s Notification."
805
- msgid_plural "Enabled %s Notifications."
806
- msgstr[0] "%s melding ingeschakeld."
807
- msgstr[1] "%s meldingen ingeschakeld."
808
-
809
- #: includes/admin/class-bnfw-notification.php:1588
810
- #, php-format
811
- msgid "Disabled %s Notification."
812
- msgid_plural "Disabled %s Notifications."
813
- msgstr[0] "%s melding uitgeschakeld."
814
- msgstr[1] "%s meldingen uitgeschakeld."
815
-
816
- #: includes/admin/class-bnfw-notification.php:1602
817
- msgid ""
818
- "If you send out notifications with BNFW but don't receive them, you may need "
819
- "to install an SMTP plugin to <a href=\"https://betternotificationsforwp.com/"
820
- "documentation/getting-started/how-to-improve-email-delivery/\" target="
821
- "\"_blank\">improve email deliverability</a>. I recommend using <a href="
822
- "\"https://wordpress.org/plugins/post-smtp/\" target=\"_blank\">Post SMTP</a> "
823
- "as it's easy to set-up or <a href=\"https://wordpress.org/plugins/email-log/"
824
- "\" target=\"_blank\">Email Log</a> to just log and view emails that are sent."
825
- msgstr ""
826
-
827
- #: includes/engine/class-bnfw-engine.php:18
828
- msgid "Test Email:"
829
- msgstr "Test e-mail:"
830
-
831
- #: includes/engine/class-bnfw-engine.php:19
832
- msgid ""
833
- "This is a test email. All shortcodes below will show in place but not be "
834
- "replaced with content."
835
- msgstr ""
836
-
837
- #: includes/engine/class-bnfw-engine.php:1583
838
- msgid "Error: Download link is not available please contact support"
839
- msgstr ""
840
-
841
- #: includes/helpers/ajax-helpers.php:34 includes/helpers/helpers.php:38
842
- msgid "User Roles"
843
- msgstr "Gebruikersrollen"
844
-
845
- #: includes/helpers/ajax-helpers.php:57 includes/helpers/helpers.php:59
846
- #: includes/helpers/helpers.php:64
847
- msgid "Users"
848
- msgstr ""
849
-
850
- #: includes/helpers/helpers.php:103
851
- msgid "Non WordPress Users"
852
- msgstr ""
853
-
854
- #: includes/import.php:69
855
- msgid " for "
856
- msgstr "voor"
857
-
858
- #: includes/import.php:69
859
- msgid " (Auto Imported)"
860
- msgstr "(Automatisch ge-importeert)"
861
-
862
- #: includes/libraries/EDD_SL_Plugin_Updater.php:228
863
- #, php-format
864
- msgid ""
865
- "There is a new version of %1$s available. %2$sView version %3$s details%4$s."
866
- msgstr ""
867
-
868
- #: includes/libraries/EDD_SL_Plugin_Updater.php:236
869
- #, php-format
870
- msgid ""
871
- "There is a new version of %1$s available. %2$sView version %3$s details%4$s "
872
- "or %5$supdate now%6$s."
873
- msgstr ""
874
-
875
- #: includes/libraries/EDD_SL_Plugin_Updater.php:474
876
- msgid "You do not have permission to install plugin updates"
877
- msgstr ""
878
-
879
- #: includes/libraries/EDD_SL_Plugin_Updater.php:474
880
- msgid "Error"
881
- msgstr ""
882
-
883
- #: includes/license/class-bnfw-license-setting.php:18
884
- #: includes/license/class-bnfw-license-setting.php:19
885
- msgid "Add-on Licenses"
886
- msgstr ""
887
-
888
- #: includes/license/class-bnfw-license-setting.php:38
889
- msgid "BNFW Add-on Licenses"
890
- msgstr ""
891
-
892
- #: includes/license/class-bnfw-license-setting.php:47
893
- msgid "Save License"
894
- msgstr ""
895
-
896
- #: includes/license/class-bnfw-license-setting.php:55
897
- msgid ""
898
- "<br>You have no BNFW Premium Add-ons installed yet.<br>You can buy add-ons "
899
- "from the <a href=\""
900
- msgstr ""
901
-
902
- #: includes/license/class-bnfw-license-setting.php:130
903
- msgid "Deactivate License"
904
- msgstr ""
905
-
906
- #: includes/license/class-bnfw-license.php:140
907
- #, php-format
908
- msgid "%1$s License Key"
909
- msgstr ""
910
-
911
- #: includes/overrides.php:41 includes/overrides.php:135
912
- #, php-format
913
- msgid "New user registration on your site %s:"
914
- msgstr "Nieuwe gebruiker geregistreerd op de site %s:"
915
-
916
- #: includes/overrides.php:42 includes/overrides.php:117
917
- #: includes/overrides.php:136 includes/overrides.php:152
918
- #, php-format
919
- msgid "Username: %s"
920
- msgstr "Gebruikersnaam: %s"
921
-
922
- #: includes/overrides.php:43 includes/overrides.php:137
923
- #, php-format
924
- msgid "E-mail: %s"
925
- msgstr "E-mailadres: %s"
926
-
927
- #. translators: Password change notification email subject. %s: Site title
928
- #: includes/overrides.php:48 includes/overrides.php:139
929
- #, php-format
930
- msgid "[%s] New User Registration"
931
- msgstr "[%s] Registratie nieuwe gebruiker"
932
-
933
- #: includes/overrides.php:118
934
- msgid "To set your password, visit the following address:"
935
- msgstr ""
936
-
937
- #: includes/overrides.php:123
938
- #, php-format
939
- msgid "[%s] Your username and password info"
940
- msgstr "[%s] Uw gebruikersnaam en wachtwoordinformatie"
941
-
942
- #: includes/overrides.php:153
943
- #, php-format
944
- msgid "Password: %s"
945
- msgstr "Wachtwoord: %s"
946
-
947
- #: includes/overrides.php:156
948
- #, php-format
949
- msgid "[%s] Your username and password"
950
- msgstr "[%s] Je gebruikersnaam en wachtwoord"
951
-
952
- #. translators: %s: user name
953
- #: includes/overrides.php:184
954
- #, php-format
955
- msgid "Password changed for user: %s"
956
- msgstr "Wachtwoord gewijzigd voor gebruiker: %s"
957
-
958
- #. translators: %s: site title
959
- #: includes/overrides.php:189
960
- #, php-format
961
- msgid "[%s] Password Changed"
962
- msgstr ""
963
-
964
- #. Plugin Name of the plugin/theme
965
- msgid "Better Notifications for WP"
966
- msgstr ""
967
-
968
- #. Plugin URI of the plugin/theme
969
- msgid "https://wordpress.org/plugins/bnfw/"
970
- msgstr ""
971
-
972
- #. Description of the plugin/theme
973
- msgid ""
974
- "Supercharge your WordPress notifications using a WYSIWYG editor and "
975
- "shortcodes. Default and new notifications available. Add more power with Add-"
976
- "ons."
977
- msgstr ""
978
-
979
- #. Author of the plugin/theme
980
- msgid "Made with Fuel"
981
- msgstr ""
982
-
983
- #. Author URI of the plugin/theme
984
- msgid "https://madewithfuel.com/"
985
- msgstr ""
986
-
987
- #~ msgid "New User - Welcome Email"
988
- #~ msgstr "Verzend welkomstberichtl aan de nieuwe gebruiker."
989
-
990
- #~ msgid "Update "
991
- #~ msgstr "Bijwerken"
992
-
993
- #~ msgid "Show additional email fields"
994
- #~ msgstr "Toon additionele e-mailvelden"
995
-
996
- #~ msgid "New User - Welcome email"
997
- #~ msgstr "Welkomst e-mail voor nieuwe gebruiker"
1
+ # Copyright (C) 2015 Better Notifications for WP
2
+ # This file is distributed under the same license as the Better Notifications for WP package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Better Notifications for WP 1.3.3\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/bnfw\n"
7
+ "POT-Creation-Date: 2020-11-27 21:34+0800\n"
8
+ "PO-Revision-Date: 2020-11-28 00:03+0800\n"
9
+ "Last-Translator: \n"
10
+ "Language-Team: \n"
11
+ "Language: nl_NL\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 2.2\n"
16
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
+
18
+ #: bnfw.php:283 includes/admin/bnfw-settings.php:15
19
+ msgid "Settings"
20
+ msgstr "Instellingen"
21
+
22
+ #: includes/admin/bnfw-settings.php:14
23
+ #: includes/admin/class-bnfw-notification.php:129
24
+ msgid "Notification Settings"
25
+ msgstr "Meldingen instellingen"
26
+
27
+ #: includes/admin/bnfw-settings.php:38
28
+ msgid "BNFW Settings"
29
+ msgstr "BNFW instellingen"
30
+
31
+ #: includes/admin/bnfw-settings.php:46
32
+ msgid "Save Settings"
33
+ msgstr "Instellingen opslaan"
34
+
35
+ #: includes/admin/bnfw-settings.php:73
36
+ msgid "Documentation"
37
+ msgstr ""
38
+
39
+ #: includes/admin/bnfw-settings.php:80
40
+ msgid "Premium Add-ons"
41
+ msgstr ""
42
+
43
+ #: includes/admin/bnfw-settings.php:87
44
+ msgid "Priority Support"
45
+ msgstr ""
46
+
47
+ #: includes/admin/bnfw-settings.php:150
48
+ msgid "Suppress SPAM comment notification"
49
+ msgstr "SPAM bericht melding onderdrukken"
50
+
51
+ #: includes/admin/bnfw-settings.php:150
52
+ msgid ""
53
+ "Comments that are correctly marked as SPAM by a 3rd party plugin (such as "
54
+ "Akismet) will not generate a notification if this is ticked."
55
+ msgstr ""
56
+
57
+ #: includes/admin/bnfw-settings.php:155
58
+ msgid "Don't send notifications for comments marked as SPAM"
59
+ msgstr "Stuur geen meldingen voor opmerkingen die als SPAM zijn gemarkeerd"
60
+
61
+ #: includes/admin/bnfw-settings.php:167
62
+ msgid "Default Email Format"
63
+ msgstr "Standaard e-mail indeling"
64
+
65
+ #: includes/admin/bnfw-settings.php:167
66
+ msgid ""
67
+ "This will apply to all emails sent out via WordPress, even those from other "
68
+ "plugins. For more details, please see the "
69
+ msgstr ""
70
+ "Dit is van toepassing op alle e-mails die via WordPress worden verzonden, "
71
+ "zelfs die van andere plug-ins. Zie het"
72
+
73
+ #: includes/admin/bnfw-settings.php:181
74
+ msgid "Enable Content Shortcodes?"
75
+ msgstr ""
76
+
77
+ #: includes/admin/bnfw-settings.php:181
78
+ msgid "Shortcodes in the post/page content are disabled by default."
79
+ msgstr ""
80
+
81
+ #: includes/admin/bnfw-settings.php:186
82
+ msgid "Enable shortcode output in the page/post content"
83
+ msgstr ""
84
+
85
+ #: includes/admin/bnfw-settings.php:198
86
+ msgid "Allow Usage Tracking?"
87
+ msgstr ""
88
+
89
+ #: includes/admin/bnfw-settings.php:203
90
+ msgid ""
91
+ "Allow Better Notifications for WP to anonymously track how this plugin is "
92
+ "used and help make the plugin better."
93
+ msgstr ""
94
+
95
+ #: includes/admin/bnfw-settings.php:251
96
+ #: includes/admin/class-bnfw-notification.php:433
97
+ msgid "HTML Formatting"
98
+ msgstr "HTML-opmaak"
99
+
100
+ #: includes/admin/bnfw-settings.php:256
101
+ #: includes/admin/class-bnfw-notification.php:439
102
+ msgid "Plain Text"
103
+ msgstr "Platte tekst"
104
+
105
+ #: includes/admin/class-bnfw-notification.php:52
106
+ #: includes/admin/class-bnfw-notification.php:55
107
+ #: includes/admin/class-bnfw-notification.php:56
108
+ msgid "Notifications"
109
+ msgstr "Meldingen"
110
+
111
+ #: includes/admin/class-bnfw-notification.php:53
112
+ msgid "Notification"
113
+ msgstr "Melding"
114
+
115
+ #: includes/admin/class-bnfw-notification.php:54
116
+ msgid "Add New"
117
+ msgstr "Nieuwe toevoegen"
118
+
119
+ #: includes/admin/class-bnfw-notification.php:57
120
+ msgid "Add New Notification"
121
+ msgstr "Nieuwe melding toevoegen"
122
+
123
+ #: includes/admin/class-bnfw-notification.php:58
124
+ msgid "Edit Notification"
125
+ msgstr "Bewerk melding"
126
+
127
+ #: includes/admin/class-bnfw-notification.php:59
128
+ msgid "New Notification"
129
+ msgstr "Nieuwe melding"
130
+
131
+ #: includes/admin/class-bnfw-notification.php:60
132
+ msgid "View Notification"
133
+ msgstr "Bekijk melding"
134
+
135
+ #: includes/admin/class-bnfw-notification.php:61
136
+ msgid "Search Notifications"
137
+ msgstr "Zoek meldigen"
138
+
139
+ #: includes/admin/class-bnfw-notification.php:62
140
+ msgid "No Notifications found"
141
+ msgstr "Geen meldingen gevonden"
142
+
143
+ #: includes/admin/class-bnfw-notification.php:63
144
+ msgid "No Notifications found in trash"
145
+ msgstr "Geen meldingen gevonden in prullenmand"
146
+
147
+ #: includes/admin/class-bnfw-notification.php:64
148
+ msgid "All Notifications"
149
+ msgstr "Alle meldingen"
150
+
151
+ #: includes/admin/class-bnfw-notification.php:138
152
+ msgid "Save Notification"
153
+ msgstr "Melding opslaan"
154
+
155
+ #: includes/admin/class-bnfw-notification.php:186
156
+ msgid "Notification For"
157
+ msgstr "Melding voor"
158
+
159
+ #: includes/admin/class-bnfw-notification.php:187
160
+ msgid ""
161
+ "E.g. If you select \"New Post Published\" from the list on the right, this "
162
+ "notification will be sent when a new post is published."
163
+ msgstr ""
164
+
165
+ #: includes/admin/class-bnfw-notification.php:191
166
+ msgid "Select the notification type"
167
+ msgstr "Selecteer het meldingstype"
168
+
169
+ #: includes/admin/class-bnfw-notification.php:192
170
+ msgid "Admin"
171
+ msgstr ""
172
+
173
+ #: includes/admin/class-bnfw-notification.php:194
174
+ #: includes/admin/class-bnfw-notification.php:1302
175
+ msgid "New User Registration - For Admin"
176
+ msgstr "[%s] Registratie nieuwe gebruiker"
177
+
178
+ #: includes/admin/class-bnfw-notification.php:196
179
+ #: includes/admin/class-bnfw-notification.php:1269
180
+ msgid "User Lost Password - For Admin"
181
+ msgstr "Gebruiker wachtwoord verloren - voor admin"
182
+
183
+ #: includes/admin/class-bnfw-notification.php:198
184
+ #: includes/admin/class-bnfw-notification.php:1272
185
+ msgid "Password Changed - For Admin"
186
+ msgstr "Wachtwoord gewijzigd - voor Admin"
187
+
188
+ #: includes/admin/class-bnfw-notification.php:200
189
+ #: includes/admin/class-bnfw-notification.php:1275
190
+ msgid "User Email Changed - For Admin"
191
+ msgstr "E-mailadres van gebruiker gewijzigd - voor admin"
192
+
193
+ #: includes/admin/class-bnfw-notification.php:202
194
+ #: includes/admin/class-bnfw-notification.php:1308
195
+ msgid "User Role Changed - For Admin"
196
+ msgstr "Gebruikersrol gewijzigd - voor Admin"
197
+
198
+ #: includes/admin/class-bnfw-notification.php:204
199
+ #: includes/admin/class-bnfw-notification.php:1296
200
+ msgid "User Logged In - For Admin"
201
+ msgstr "Gebruiker aangemeld - voor admin"
202
+
203
+ #: includes/admin/class-bnfw-notification.php:206
204
+ #: includes/admin/class-bnfw-notification.php:1287
205
+ msgid "WordPress Core Automatic Background Updates"
206
+ msgstr ""
207
+
208
+ #: includes/admin/class-bnfw-notification.php:210
209
+ #: includes/admin/class-bnfw-notification.php:1344
210
+ msgid "Privacy - Confirm Action: Export Data Request - For Admin"
211
+ msgstr ""
212
+
213
+ #: includes/admin/class-bnfw-notification.php:214
214
+ #: includes/admin/class-bnfw-notification.php:1347
215
+ msgid "Privacy - Confirm Action: Erase Data Request - For Admin"
216
+ msgstr ""
217
+
218
+ #: includes/admin/class-bnfw-notification.php:222
219
+ msgid "Transactional"
220
+ msgstr ""
221
+
222
+ #: includes/admin/class-bnfw-notification.php:224
223
+ #: includes/admin/class-bnfw-notification.php:1290
224
+ msgid "New User Registration - For User"
225
+ msgstr "Nieuwe gebruikersregistratie: %s"
226
+
227
+ #: includes/admin/class-bnfw-notification.php:226
228
+ #: includes/admin/class-bnfw-notification.php:1299
229
+ msgid "New User - Post-registration Email"
230
+ msgstr "Nieuwe gebruiker - E-mail na registratie"
231
+
232
+ #: includes/admin/class-bnfw-notification.php:228
233
+ #: includes/admin/class-bnfw-notification.php:1266
234
+ msgid "User Lost Password - For User"
235
+ msgstr "Wachtwoord verloren gebruiker - voor gebruiker"
236
+
237
+ #: includes/admin/class-bnfw-notification.php:230
238
+ #: includes/admin/class-bnfw-notification.php:1278
239
+ msgid "Password Changed - For User"
240
+ msgstr "Wachtwoord gewijzigd - voor gebruiker"
241
+
242
+ #: includes/admin/class-bnfw-notification.php:232
243
+ #: includes/admin/class-bnfw-notification.php:1281
244
+ msgid "User Email Changed Confirmation - For User"
245
+ msgstr "Bevestiging e-mail gebruiker gewijzigd - voor gebruiker"
246
+
247
+ #: includes/admin/class-bnfw-notification.php:235
248
+ #: includes/admin/class-bnfw-notification.php:1284
249
+ msgid "User Email Changed - For User"
250
+ msgstr "E-mailadres van gebruiker gewijzigd - voor gebruiker"
251
+
252
+ #: includes/admin/class-bnfw-notification.php:237
253
+ #: includes/admin/class-bnfw-notification.php:1305
254
+ msgid "User Role Changed - For User"
255
+ msgstr "Gebruikersrol gewijzigd - voor gebruiker"
256
+
257
+ #: includes/admin/class-bnfw-notification.php:239
258
+ #: includes/admin/class-bnfw-notification.php:1293
259
+ msgid "User Logged In - For User"
260
+ msgstr "Gebruiker aangemeld - voor gebruiker"
261
+
262
+ #: includes/admin/class-bnfw-notification.php:241
263
+ #: includes/admin/class-bnfw-notification.php:375
264
+ #: includes/admin/class-bnfw-notification.php:1263
265
+ msgid "Comment Reply"
266
+ msgstr "Deze reactie beantwoorden"
267
+
268
+ #: includes/admin/class-bnfw-notification.php:245
269
+ msgid "Privacy - Confirm Action: Export Data Request - For User"
270
+ msgstr ""
271
+
272
+ #: includes/admin/class-bnfw-notification.php:249
273
+ msgid "Privacy - Confirm Action: Erase Data Request - For User"
274
+ msgstr ""
275
+
276
+ #: includes/admin/class-bnfw-notification.php:253
277
+ #: includes/admin/class-bnfw-notification.php:1350
278
+ msgid "Privacy - Data Export - For User"
279
+ msgstr ""
280
+
281
+ #: includes/admin/class-bnfw-notification.php:257
282
+ #: includes/admin/class-bnfw-notification.php:1353
283
+ msgid "Privacy - Data Erased - For User"
284
+ msgstr ""
285
+
286
+ #: includes/admin/class-bnfw-notification.php:267
287
+ #: includes/admin/class-bnfw-notification.php:1311
288
+ msgid "New Post Published"
289
+ msgstr "Nieuw bericht gepubliceerd"
290
+
291
+ #: includes/admin/class-bnfw-notification.php:269
292
+ #: includes/admin/class-bnfw-notification.php:1314
293
+ msgid "Post Updated"
294
+ msgstr "Bericht bijgewerkt."
295
+
296
+ #: includes/admin/class-bnfw-notification.php:271
297
+ #: includes/admin/class-bnfw-notification.php:1317
298
+ msgid "Post Pending Review"
299
+ msgstr "Wachtend op review"
300
+
301
+ #: includes/admin/class-bnfw-notification.php:273
302
+ #: includes/admin/class-bnfw-notification.php:1320
303
+ msgid "New Private Post"
304
+ msgstr ""
305
+
306
+ #: includes/admin/class-bnfw-notification.php:275
307
+ #: includes/admin/class-bnfw-notification.php:1323
308
+ msgid "Post Scheduled"
309
+ msgstr "Bericht gepland"
310
+
311
+ #: includes/admin/class-bnfw-notification.php:277
312
+ #: includes/admin/class-bnfw-notification.php:1326
313
+ msgid "Published Post Moved to Trash"
314
+ msgstr "Gepubliceerde post naar prullenbak verplaatst"
315
+
316
+ #: includes/admin/class-bnfw-notification.php:279
317
+ #: includes/admin/class-bnfw-notification.php:367
318
+ #: includes/admin/class-bnfw-notification.php:1248
319
+ msgid "New Comment"
320
+ msgstr "Nieuwe reactie toevoegen"
321
+
322
+ #: includes/admin/class-bnfw-notification.php:282
323
+ #: includes/admin/class-bnfw-notification.php:369
324
+ #: includes/admin/class-bnfw-notification.php:1254
325
+ #: includes/admin/class-bnfw-notification.php:1407
326
+ msgid "New Comment Awaiting Moderation"
327
+ msgstr "Nieuwe reactie wacht op moderatie"
328
+
329
+ #: includes/admin/class-bnfw-notification.php:285
330
+ #: includes/admin/class-bnfw-notification.php:1251
331
+ msgid "Post - Comment Approved"
332
+ msgstr ""
333
+
334
+ #: includes/admin/class-bnfw-notification.php:288
335
+ #: includes/admin/class-bnfw-notification.php:1332
336
+ msgid "New Category"
337
+ msgstr "Nieuwe categorie toevoegen"
338
+
339
+ #: includes/admin/class-bnfw-notification.php:290
340
+ #: includes/admin/class-bnfw-notification.php:1335
341
+ msgid "New Tag"
342
+ msgstr "Nieuwe tag toevoegen"
343
+
344
+ #: includes/admin/class-bnfw-notification.php:292
345
+ #: includes/admin/class-bnfw-notification.php:1257
346
+ msgid "New Trackback"
347
+ msgstr "Nieuwe trackback op je bericht \"%s\""
348
+
349
+ #: includes/admin/class-bnfw-notification.php:294
350
+ #: includes/admin/class-bnfw-notification.php:1260
351
+ msgid "New Pingback"
352
+ msgstr "Nieuwe pingback op bericht \"%s\""
353
+
354
+ #: includes/admin/class-bnfw-notification.php:301
355
+ #: includes/admin/class-bnfw-notification.php:1329
356
+ msgid "New Page Published"
357
+ msgstr "Nieuwe pagina gepubliceerd"
358
+
359
+ #: includes/admin/class-bnfw-notification.php:303
360
+ msgid "Page Updated"
361
+ msgstr "Pagina bijgewerkt."
362
+
363
+ #: includes/admin/class-bnfw-notification.php:305
364
+ msgid "Page Pending Review"
365
+ msgstr "Pagina wacht op review"
366
+
367
+ #: includes/admin/class-bnfw-notification.php:307
368
+ msgid "New Private Page"
369
+ msgstr ""
370
+
371
+ #: includes/admin/class-bnfw-notification.php:309
372
+ msgid "Page Scheduled"
373
+ msgstr "Pagina gepland "
374
+
375
+ #: includes/admin/class-bnfw-notification.php:311
376
+ msgid "Page - New Comment"
377
+ msgstr "Nieuwe reactie toevoegen"
378
+
379
+ #: includes/admin/class-bnfw-notification.php:313
380
+ msgid "Page - New Comment Awaiting Moderation"
381
+ msgstr "Pagina - Nieuwe reactie wacht op moderatie"
382
+
383
+ #: includes/admin/class-bnfw-notification.php:316
384
+ #: includes/admin/class-bnfw-notification.php:1365
385
+ msgid "Page - Comment Approved"
386
+ msgstr "Pagina - Reactie goedgekeurd"
387
+
388
+ #: includes/admin/class-bnfw-notification.php:319
389
+ msgid "Page - Comment Reply"
390
+ msgstr "Pagina - Reactie Reageren"
391
+
392
+ #: includes/admin/class-bnfw-notification.php:326
393
+ #: includes/admin/class-bnfw-notification.php:1356
394
+ msgid "New Media Published"
395
+ msgstr "Nieuwe media gepubliceerd"
396
+
397
+ #: includes/admin/class-bnfw-notification.php:328
398
+ #: includes/admin/class-bnfw-notification.php:1359
399
+ msgid "Media Updated"
400
+ msgstr "Pagina bijgewerkt."
401
+
402
+ #: includes/admin/class-bnfw-notification.php:330
403
+ #: includes/admin/class-bnfw-notification.php:1362
404
+ msgid "Media - New Comment"
405
+ msgstr "Media - Nieuwe reactie"
406
+
407
+ #: includes/admin/class-bnfw-notification.php:332
408
+ #: includes/admin/class-bnfw-notification.php:1368
409
+ msgid "Media - Comment Approved"
410
+ msgstr ""
411
+
412
+ #: includes/admin/class-bnfw-notification.php:335
413
+ #: includes/admin/class-bnfw-notification.php:1371
414
+ msgid "Media - New Comment Awaiting Moderation"
415
+ msgstr "Media - Nieuwe reactie wacht op moderatie"
416
+
417
+ #: includes/admin/class-bnfw-notification.php:337
418
+ #: includes/admin/class-bnfw-notification.php:1374
419
+ msgid "Media - Comment Reply"
420
+ msgstr "Media - Reactie Reageren"
421
+
422
+ #: includes/admin/class-bnfw-notification.php:355
423
+ msgid "Custom Post Type"
424
+ msgstr "Berichttype"
425
+
426
+ #: includes/admin/class-bnfw-notification.php:357
427
+ #: includes/admin/class-bnfw-notification.php:1389
428
+ msgid "New "
429
+ msgstr "Nieuw"
430
+
431
+ #: includes/admin/class-bnfw-notification.php:357
432
+ msgid " Published"
433
+ msgstr "Gepubliceerd"
434
+
435
+ #: includes/admin/class-bnfw-notification.php:359
436
+ msgid "Updated"
437
+ msgstr "Bijgewerkt"
438
+
439
+ #: includes/admin/class-bnfw-notification.php:361
440
+ msgid "Pending Review"
441
+ msgstr "Wachtend op review"
442
+
443
+ #: includes/admin/class-bnfw-notification.php:363
444
+ #: includes/admin/class-bnfw-notification.php:1401
445
+ msgid "New Private "
446
+ msgstr ""
447
+
448
+ #: includes/admin/class-bnfw-notification.php:365
449
+ msgid "Scheduled"
450
+ msgstr "Gepland"
451
+
452
+ #: includes/admin/class-bnfw-notification.php:372
453
+ msgid "Comment Approved"
454
+ msgstr "Reactie goedgekeurd"
455
+
456
+ #: includes/admin/class-bnfw-notification.php:394
457
+ msgid "Custom Taxonomy"
458
+ msgstr "Taxonomie:"
459
+
460
+ #: includes/admin/class-bnfw-notification.php:400
461
+ msgid "New"
462
+ msgstr "Nieuw"
463
+
464
+ #: includes/admin/class-bnfw-notification.php:419
465
+ msgid ""
466
+ "This notification doesn't support additional email fields due to a "
467
+ "limitation in WordPress."
468
+ msgstr ""
469
+ "Deze melding ondersteunt geen extra e-mailvelden vanwege een beperking in "
470
+ "WordPress."
471
+
472
+ #: includes/admin/class-bnfw-notification.php:426
473
+ msgid "Email Formatting"
474
+ msgstr "Formattering"
475
+
476
+ #: includes/admin/class-bnfw-notification.php:427
477
+ msgid ""
478
+ "How do you want to format the sent email? HTML is recommended as it'll show "
479
+ "images and links correctly."
480
+ msgstr ""
481
+
482
+ #: includes/admin/class-bnfw-notification.php:448
483
+ msgid "Additional Email Fields"
484
+ msgstr "Additionele e-mailvelden"
485
+
486
+ #: includes/admin/class-bnfw-notification.php:449
487
+ msgid ""
488
+ "This should be fairly self explanatory but if you're unsure, tick this "
489
+ "checkbox and have a look at the available options. You can always untick it "
490
+ "again should you decide you don't need to use it."
491
+ msgstr ""
492
+
493
+ #: includes/admin/class-bnfw-notification.php:454
494
+ msgid "Set \"From\" Name & Email, Reply To, CC, BCC"
495
+ msgstr ""
496
+
497
+ #: includes/admin/class-bnfw-notification.php:461
498
+ msgid "From Name and Email"
499
+ msgstr "Naam en e-mailadres zijn verplicht bij het plaatsen van een reactie"
500
+
501
+ #: includes/admin/class-bnfw-notification.php:462
502
+ msgid ""
503
+ "If you want to send the email from your site name and email address instead "
504
+ "of the default \"WordPress\" from \"wordpress@domain.com\", this is where "
505
+ "you can do it."
506
+ msgstr ""
507
+
508
+ #: includes/admin/class-bnfw-notification.php:466
509
+ msgid "Site Name"
510
+ msgstr ""
511
+
512
+ #: includes/admin/class-bnfw-notification.php:468
513
+ msgid "Site Email"
514
+ msgstr ""
515
+
516
+ #: includes/admin/class-bnfw-notification.php:475
517
+ msgid "Reply To"
518
+ msgstr ""
519
+
520
+ #: includes/admin/class-bnfw-notification.php:476
521
+ msgid ""
522
+ "If you want any replies to your email notification to go to another person, "
523
+ "fill in this box with their name and email address."
524
+ msgstr ""
525
+
526
+ #: includes/admin/class-bnfw-notification.php:480
527
+ msgid "Name"
528
+ msgstr ""
529
+
530
+ #: includes/admin/class-bnfw-notification.php:482
531
+ msgid "Email"
532
+ msgstr "E-mail"
533
+
534
+ #: includes/admin/class-bnfw-notification.php:488
535
+ msgid "CC"
536
+ msgstr "CC:"
537
+
538
+ #: includes/admin/class-bnfw-notification.php:489
539
+ msgid "Publicly copy in any other users or user roles to this email."
540
+ msgstr ""
541
+
542
+ #: includes/admin/class-bnfw-notification.php:494
543
+ #: includes/admin/class-bnfw-notification.php:508
544
+ #: includes/admin/class-bnfw-notification.php:557
545
+ #: includes/admin/class-bnfw-notification.php:575
546
+ msgid "Select User Roles / Users"
547
+ msgstr "Selecteer Gebruikersrollen / gebruikers"
548
+
549
+ #: includes/admin/class-bnfw-notification.php:502
550
+ msgid "BCC"
551
+ msgstr "BCC:"
552
+
553
+ #: includes/admin/class-bnfw-notification.php:503
554
+ msgid "Privately copy in any other users or user roles to this email."
555
+ msgstr ""
556
+
557
+ #: includes/admin/class-bnfw-notification.php:518
558
+ msgid "Send to Author"
559
+ msgstr ""
560
+
561
+ #: includes/admin/class-bnfw-notification.php:519
562
+ msgid ""
563
+ "E.g. If you want a new post published notification to go to the post author, "
564
+ "tick this box."
565
+ msgstr ""
566
+
567
+ #: includes/admin/class-bnfw-notification.php:526
568
+ msgid "Send this notification to the Author"
569
+ msgstr "Stuur deze melding naar de auteur"
570
+
571
+ #: includes/admin/class-bnfw-notification.php:536
572
+ msgid ""
573
+ "E.g. If you're an editor and regularly update your posts, you might not want "
574
+ "to be emailed about this all the time. Ticking this box will prevent you "
575
+ "from receiving emails about your own changes."
576
+ msgstr ""
577
+
578
+ #: includes/admin/class-bnfw-notification.php:542
579
+ msgid "Do not send this Notification to the User that triggered it"
580
+ msgstr ""
581
+ "Stuur deze kennisgeving niet naar de gebruiker die deze heeft geactiveerd"
582
+
583
+ #: includes/admin/class-bnfw-notification.php:551
584
+ msgid "Send To"
585
+ msgstr ""
586
+
587
+ #: includes/admin/class-bnfw-notification.php:552
588
+ msgid "Choose the users and/or user roles to send this email notification to."
589
+ msgstr ""
590
+
591
+ #: includes/admin/class-bnfw-notification.php:565
592
+ msgid "Except For"
593
+ msgstr ""
594
+
595
+ #: includes/admin/class-bnfw-notification.php:568
596
+ msgid ""
597
+ "Choose the users and/or user roles that this notification should not be sent "
598
+ "to."
599
+ msgstr ""
600
+
601
+ #: includes/admin/class-bnfw-notification.php:593
602
+ msgid ""
603
+ "You have chosen to send this notification to over 200 users. Please check "
604
+ "the email sending rate limit at your host before sending."
605
+ msgstr ""
606
+
607
+ #: includes/admin/class-bnfw-notification.php:603
608
+ #: includes/admin/class-bnfw-notification.php:1129
609
+ msgid "Subject"
610
+ msgstr ""
611
+
612
+ #: includes/admin/class-bnfw-notification.php:604
613
+ msgid "Notification subject. You can use "
614
+ msgstr "Onderwerp van melding. Je kunt gebruiken"
615
+
616
+ #: includes/admin/class-bnfw-notification.php:604
617
+ #: includes/admin/class-bnfw-notification.php:618
618
+ msgid " here."
619
+ msgstr ""
620
+
621
+ #: includes/admin/class-bnfw-notification.php:617
622
+ msgid "Message Body"
623
+ msgstr ""
624
+
625
+ #: includes/admin/class-bnfw-notification.php:618
626
+ msgid "Notification message. You can use "
627
+ msgstr "Meldingsbericht. Je kunt gebruiken"
628
+
629
+ #: includes/admin/class-bnfw-notification.php:626
630
+ msgid "Need some more help?"
631
+ msgstr ""
632
+
633
+ #: includes/admin/class-bnfw-notification.php:636
634
+ msgid "Insert Default Content"
635
+ msgstr "Voeg standaardinhoud in"
636
+
637
+ #: includes/admin/class-bnfw-notification.php:640
638
+ msgid "Read Documentation"
639
+ msgstr ""
640
+
641
+ #: includes/admin/class-bnfw-notification.php:644
642
+ msgid "Find Shortcodes"
643
+ msgstr ""
644
+
645
+ #: includes/admin/class-bnfw-notification.php:655
646
+ msgid ""
647
+ "Stop additional paragraph and line break HTML from being inserted into my "
648
+ "notifications"
649
+ msgstr ""
650
+
651
+ #: includes/admin/class-bnfw-notification.php:710
652
+ msgid ""
653
+ "You must choose at least one User or User Role to send the notification to "
654
+ "before you can save"
655
+ msgstr ""
656
+
657
+ #: includes/admin/class-bnfw-notification.php:825
658
+ msgid "Test Notification Sent."
659
+ msgstr ""
660
+
661
+ #: includes/admin/class-bnfw-notification.php:915
662
+ msgid "Notification saved."
663
+ msgstr ""
664
+
665
+ #: includes/admin/class-bnfw-notification.php:934
666
+ #: includes/admin/class-bnfw-notification.php:992
667
+ #: includes/admin/class-bnfw-notification.php:994
668
+ msgid "Save"
669
+ msgstr ""
670
+
671
+ #: includes/admin/class-bnfw-notification.php:942
672
+ msgid ""
673
+ "Use this to enable or disable notifications. If you want to disable a "
674
+ "default WordPress notification, just create it on the left, then disable it "
675
+ "here."
676
+ msgstr ""
677
+
678
+ #: includes/admin/class-bnfw-notification.php:949
679
+ msgid "Notification Enabled"
680
+ msgstr "Melding ingeschakeld"
681
+
682
+ #: includes/admin/class-bnfw-notification.php:956
683
+ msgid "Notification Disabled"
684
+ msgstr "Melding uitgeschakeld"
685
+
686
+ #: includes/admin/class-bnfw-notification.php:967
687
+ msgid "Send Me a Test Email"
688
+ msgstr "Stuur mij een test e-mail"
689
+
690
+ #: includes/admin/class-bnfw-notification.php:969
691
+ msgid ""
692
+ "This will send you (the currently logged in user) a notification so that you "
693
+ "can check for any issues with formatting – it’s doesn't mean that a "
694
+ "notification will send correctly in the future. You can read about how to "
695
+ "improve email delivery"
696
+ msgstr ""
697
+
698
+ #: includes/admin/class-bnfw-notification.php:969
699
+ msgid "here"
700
+ msgstr ""
701
+
702
+ #: includes/admin/class-bnfw-notification.php:969
703
+ msgid ". Shortcodes will not be replaced with content."
704
+ msgstr ""
705
+
706
+ #: includes/admin/class-bnfw-notification.php:980
707
+ msgid "Delete Permanently"
708
+ msgstr "Permanent verwijderen"
709
+
710
+ #: includes/admin/class-bnfw-notification.php:982
711
+ msgid "Move to Trash"
712
+ msgstr "In de prullenbak"
713
+
714
+ #: includes/admin/class-bnfw-notification.php:1127
715
+ msgid "Notification Type"
716
+ msgstr "Type melding"
717
+
718
+ #: includes/admin/class-bnfw-notification.php:1128
719
+ msgid "Enabled?"
720
+ msgstr "Actief?"
721
+
722
+ #: includes/admin/class-bnfw-notification.php:1130
723
+ msgid "User Roles / Users"
724
+ msgstr "Gebruikersrollen"
725
+
726
+ #: includes/admin/class-bnfw-notification.php:1131
727
+ msgid "Excluded User Roles / Users"
728
+ msgstr "Uitgesloten gebruikersrollen / gebruikers"
729
+
730
+ #: includes/admin/class-bnfw-notification.php:1172
731
+ msgid ", Post Author"
732
+ msgstr ""
733
+
734
+ #: includes/admin/class-bnfw-notification.php:1338
735
+ msgid "Privacy – Confirm Action: Export Data Request – For User"
736
+ msgstr ""
737
+
738
+ #: includes/admin/class-bnfw-notification.php:1341
739
+ msgid "Privacy – Confirm Action: Erase Data Request – For User"
740
+ msgstr ""
741
+
742
+ #: includes/admin/class-bnfw-notification.php:1389
743
+ msgid "Published"
744
+ msgstr "Gepubliceerd"
745
+
746
+ #: includes/admin/class-bnfw-notification.php:1392
747
+ msgid "Updated "
748
+ msgstr "Bijgewerkt!"
749
+
750
+ #: includes/admin/class-bnfw-notification.php:1395
751
+ msgid " Pending Review"
752
+ msgstr "Wachtend op review"
753
+
754
+ #: includes/admin/class-bnfw-notification.php:1398
755
+ msgid " Scheduled"
756
+ msgstr "Gepland"
757
+
758
+ #: includes/admin/class-bnfw-notification.php:1404
759
+ msgid " Comment"
760
+ msgstr "Reactie"
761
+
762
+ #: includes/admin/class-bnfw-notification.php:1410
763
+ msgid " Comment Reply"
764
+ msgstr "Reageer Reageer"
765
+
766
+ #: includes/admin/class-bnfw-notification.php:1413
767
+ msgid " Comment Approved"
768
+ msgstr "Reactie goedgekeurd"
769
+
770
+ #: includes/admin/class-bnfw-notification.php:1418
771
+ msgid "New Term"
772
+ msgstr "Nieuwe term"
773
+
774
+ #: includes/admin/class-bnfw-notification.php:1420
775
+ msgid "New Term in "
776
+ msgstr ""
777
+
778
+ #: includes/admin/class-bnfw-notification.php:1440
779
+ msgid "Enable Notifications"
780
+ msgstr "Notificaties aanzetten"
781
+
782
+ #: includes/admin/class-bnfw-notification.php:1441
783
+ msgid "Disable Notifications"
784
+ msgstr "Meldingen uitschakelen"
785
+
786
+ #: includes/admin/class-bnfw-notification.php:1502
787
+ msgid "Enable Notification"
788
+ msgstr "Melding inschakelen"
789
+
790
+ #: includes/admin/class-bnfw-notification.php:1510
791
+ msgid "Disable Notification"
792
+ msgstr "Uitschakelen melding"
793
+
794
+ #: includes/admin/class-bnfw-notification.php:1568
795
+ msgid "Enabled 1 Notification."
796
+ msgstr "Ingeschakeld 1 Melding."
797
+
798
+ #: includes/admin/class-bnfw-notification.php:1572
799
+ msgid "Disabled 1 Notification."
800
+ msgstr "Uitgeschakeld 1 Melding."
801
+
802
+ #: includes/admin/class-bnfw-notification.php:1578
803
+ #, php-format
804
+ msgid "Enabled %s Notification."
805
+ msgid_plural "Enabled %s Notifications."
806
+ msgstr[0] "%s melding ingeschakeld."
807
+ msgstr[1] "%s meldingen ingeschakeld."
808
+
809
+ #: includes/admin/class-bnfw-notification.php:1588
810
+ #, php-format
811
+ msgid "Disabled %s Notification."
812
+ msgid_plural "Disabled %s Notifications."
813
+ msgstr[0] "%s melding uitgeschakeld."
814
+ msgstr[1] "%s meldingen uitgeschakeld."
815
+
816
+ #: includes/admin/class-bnfw-notification.php:1602
817
+ msgid ""
818
+ "If you send out notifications with BNFW but don't receive them, you may need "
819
+ "to install an SMTP plugin to <a href=\"https://betternotificationsforwp.com/"
820
+ "documentation/getting-started/how-to-improve-email-delivery/\" target="
821
+ "\"_blank\">improve email deliverability</a>. I recommend using <a href="
822
+ "\"https://wordpress.org/plugins/post-smtp/\" target=\"_blank\">Post SMTP</a> "
823
+ "as it's easy to set-up or <a href=\"https://wordpress.org/plugins/email-log/"
824
+ "\" target=\"_blank\">Email Log</a> to just log and view emails that are sent."
825
+ msgstr ""
826
+
827
+ #: includes/engine/class-bnfw-engine.php:18
828
+ msgid "Test Email:"
829
+ msgstr "Test e-mail:"
830
+
831
+ #: includes/engine/class-bnfw-engine.php:19
832
+ msgid ""
833
+ "This is a test email. All shortcodes below will show in place but not be "
834
+ "replaced with content."
835
+ msgstr ""
836
+
837
+ #: includes/engine/class-bnfw-engine.php:1583
838
+ msgid "Error: Download link is not available please contact support"
839
+ msgstr ""
840
+
841
+ #: includes/helpers/ajax-helpers.php:34 includes/helpers/helpers.php:38
842
+ msgid "User Roles"
843
+ msgstr "Gebruikersrollen"
844
+
845
+ #: includes/helpers/ajax-helpers.php:57 includes/helpers/helpers.php:59
846
+ #: includes/helpers/helpers.php:64
847
+ msgid "Users"
848
+ msgstr ""
849
+
850
+ #: includes/helpers/helpers.php:103
851
+ msgid "Non WordPress Users"
852
+ msgstr ""
853
+
854
+ #: includes/import.php:69
855
+ msgid " for "
856
+ msgstr "voor"
857
+
858
+ #: includes/import.php:69
859
+ msgid " (Auto Imported)"
860
+ msgstr "(Automatisch ge-importeert)"
861
+
862
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:228
863
+ #, php-format
864
+ msgid ""
865
+ "There is a new version of %1$s available. %2$sView version %3$s details%4$s."
866
+ msgstr ""
867
+
868
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:236
869
+ #, php-format
870
+ msgid ""
871
+ "There is a new version of %1$s available. %2$sView version %3$s details%4$s "
872
+ "or %5$supdate now%6$s."
873
+ msgstr ""
874
+
875
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:474
876
+ msgid "You do not have permission to install plugin updates"
877
+ msgstr ""
878
+
879
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:474
880
+ msgid "Error"
881
+ msgstr ""
882
+
883
+ #: includes/license/class-bnfw-license-setting.php:18
884
+ #: includes/license/class-bnfw-license-setting.php:19
885
+ msgid "Add-on Licenses"
886
+ msgstr ""
887
+
888
+ #: includes/license/class-bnfw-license-setting.php:38
889
+ msgid "BNFW Add-on Licenses"
890
+ msgstr ""
891
+
892
+ #: includes/license/class-bnfw-license-setting.php:47
893
+ msgid "Save License"
894
+ msgstr ""
895
+
896
+ #: includes/license/class-bnfw-license-setting.php:55
897
+ msgid ""
898
+ "<br>You have no BNFW Premium Add-ons installed yet.<br>You can buy add-ons "
899
+ "from the <a href=\""
900
+ msgstr ""
901
+
902
+ #: includes/license/class-bnfw-license-setting.php:130
903
+ msgid "Deactivate License"
904
+ msgstr ""
905
+
906
+ #: includes/license/class-bnfw-license.php:140
907
+ #, php-format
908
+ msgid "%1$s License Key"
909
+ msgstr ""
910
+
911
+ #: includes/overrides.php:41 includes/overrides.php:135
912
+ #, php-format
913
+ msgid "New user registration on your site %s:"
914
+ msgstr "Nieuwe gebruiker geregistreerd op de site %s:"
915
+
916
+ #: includes/overrides.php:42 includes/overrides.php:117
917
+ #: includes/overrides.php:136 includes/overrides.php:152
918
+ #, php-format
919
+ msgid "Username: %s"
920
+ msgstr "Gebruikersnaam: %s"
921
+
922
+ #: includes/overrides.php:43 includes/overrides.php:137
923
+ #, php-format
924
+ msgid "E-mail: %s"
925
+ msgstr "E-mailadres: %s"
926
+
927
+ #. translators: Password change notification email subject. %s: Site title
928
+ #: includes/overrides.php:48 includes/overrides.php:139
929
+ #, php-format
930
+ msgid "[%s] New User Registration"
931
+ msgstr "[%s] Registratie nieuwe gebruiker"
932
+
933
+ #: includes/overrides.php:118
934
+ msgid "To set your password, visit the following address:"
935
+ msgstr ""
936
+
937
+ #: includes/overrides.php:123
938
+ #, php-format
939
+ msgid "[%s] Your username and password info"
940
+ msgstr "[%s] Uw gebruikersnaam en wachtwoordinformatie"
941
+
942
+ #: includes/overrides.php:153
943
+ #, php-format
944
+ msgid "Password: %s"
945
+ msgstr "Wachtwoord: %s"
946
+
947
+ #: includes/overrides.php:156
948
+ #, php-format
949
+ msgid "[%s] Your username and password"
950
+ msgstr "[%s] Je gebruikersnaam en wachtwoord"
951
+
952
+ #. translators: %s: user name
953
+ #: includes/overrides.php:184
954
+ #, php-format
955
+ msgid "Password changed for user: %s"
956
+ msgstr "Wachtwoord gewijzigd voor gebruiker: %s"
957
+
958
+ #. translators: %s: site title
959
+ #: includes/overrides.php:189
960
+ #, php-format
961
+ msgid "[%s] Password Changed"
962
+ msgstr ""
963
+
964
+ #. Plugin Name of the plugin/theme
965
+ msgid "Better Notifications for WP"
966
+ msgstr ""
967
+
968
+ #. Plugin URI of the plugin/theme
969
+ msgid "https://wordpress.org/plugins/bnfw/"
970
+ msgstr ""
971
+
972
+ #. Description of the plugin/theme
973
+ msgid ""
974
+ "Supercharge your WordPress notifications using a WYSIWYG editor and "
975
+ "shortcodes. Default and new notifications available. Add more power with Add-"
976
+ "ons."
977
+ msgstr ""
978
+
979
+ #. Author of the plugin/theme
980
+ msgid "Made with Fuel"
981
+ msgstr ""
982
+
983
+ #. Author URI of the plugin/theme
984
+ msgid "https://madewithfuel.com/"
985
+ msgstr ""
986
+
987
+ #~ msgid "New User - Welcome Email"
988
+ #~ msgstr "Verzend welkomstberichtl aan de nieuwe gebruiker."
989
+
990
+ #~ msgid "Update "
991
+ #~ msgstr "Bijwerken"
992
+
993
+ #~ msgid "Show additional email fields"
994
+ #~ msgstr "Toon additionele e-mailvelden"
995
+
996
+ #~ msgid "New User - Welcome email"
997
+ #~ msgstr "Welkomst e-mail voor nieuwe gebruiker"
languages/bnfw-pt_BR.mo CHANGED
File without changes
languages/bnfw-pt_BR.po CHANGED
@@ -1,1015 +1,1015 @@
1
- # Copyright (C) 2015 Better Notifications for WP
2
- # This file is distributed under the same license as the Better Notifications for WP package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Better Notifications for WP 1.3.3\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/bnfw\n"
7
- "POT-Creation-Date: 2020-11-27 21:34+0800\n"
8
- "PO-Revision-Date: 2020-11-28 00:04+0800\n"
9
- "Last-Translator: Glayton Caixeta <contato@caixeta.com>\n"
10
- "Language-Team: \n"
11
- "Language: pt_BR\n"
12
- "MIME-Version: 1.0\n"
13
- "Content-Type: text/plain; charset=UTF-8\n"
14
- "Content-Transfer-Encoding: 8bit\n"
15
- "X-Generator: Poedit 2.2\n"
16
- "Plural-Forms: nplurals=2; plural=(n > 1);\n"
17
-
18
- #: bnfw.php:283 includes/admin/bnfw-settings.php:15
19
- msgid "Settings"
20
- msgstr "Configurações"
21
-
22
- #: includes/admin/bnfw-settings.php:14
23
- #: includes/admin/class-bnfw-notification.php:129
24
- msgid "Notification Settings"
25
- msgstr "Configurações de notificações"
26
-
27
- #: includes/admin/bnfw-settings.php:38
28
- msgid "BNFW Settings"
29
- msgstr "Configurações do BNFW"
30
-
31
- #: includes/admin/bnfw-settings.php:46
32
- msgid "Save Settings"
33
- msgstr "Salvar configurações"
34
-
35
- #: includes/admin/bnfw-settings.php:73
36
- msgid "Documentation"
37
- msgstr ""
38
-
39
- #: includes/admin/bnfw-settings.php:80
40
- msgid "Premium Add-ons"
41
- msgstr ""
42
-
43
- #: includes/admin/bnfw-settings.php:87
44
- msgid "Priority Support"
45
- msgstr ""
46
-
47
- #: includes/admin/bnfw-settings.php:150
48
- msgid "Suppress SPAM comment notification"
49
- msgstr "Esconder comentário e notificação de SPAM"
50
-
51
- #: includes/admin/bnfw-settings.php:150
52
- msgid ""
53
- "Comments that are correctly marked as SPAM by a 3rd party plugin (such as "
54
- "Akismet) will not generate a notification if this is ticked."
55
- msgstr ""
56
-
57
- #: includes/admin/bnfw-settings.php:155
58
- msgid "Don't send notifications for comments marked as SPAM"
59
- msgstr "Não envie notificações para comentários marcados como SPAM"
60
-
61
- #: includes/admin/bnfw-settings.php:167
62
- msgid "Default Email Format"
63
- msgstr "Formato padrão de email"
64
-
65
- #: includes/admin/bnfw-settings.php:167
66
- msgid ""
67
- "This will apply to all emails sent out via WordPress, even those from other "
68
- "plugins. For more details, please see the "
69
- msgstr ""
70
- "Isso se aplica a todos os e-mails enviados via WordPress, mesmo aqueles de "
71
- "outros plug-ins. Para obter mais detalhes, consulte o"
72
-
73
- #: includes/admin/bnfw-settings.php:181
74
- msgid "Enable Content Shortcodes?"
75
- msgstr ""
76
-
77
- #: includes/admin/bnfw-settings.php:181
78
- msgid "Shortcodes in the post/page content are disabled by default."
79
- msgstr ""
80
-
81
- #: includes/admin/bnfw-settings.php:186
82
- msgid "Enable shortcode output in the page/post content"
83
- msgstr ""
84
-
85
- #: includes/admin/bnfw-settings.php:198
86
- msgid "Allow Usage Tracking?"
87
- msgstr ""
88
-
89
- #: includes/admin/bnfw-settings.php:203
90
- msgid ""
91
- "Allow Better Notifications for WP to anonymously track how this plugin is "
92
- "used and help make the plugin better."
93
- msgstr ""
94
-
95
- #: includes/admin/bnfw-settings.php:251
96
- #: includes/admin/class-bnfw-notification.php:433
97
- msgid "HTML Formatting"
98
- msgstr "Formatação HTML"
99
-
100
- #: includes/admin/bnfw-settings.php:256
101
- #: includes/admin/class-bnfw-notification.php:439
102
- msgid "Plain Text"
103
- msgstr "Texto simples"
104
-
105
- #: includes/admin/class-bnfw-notification.php:52
106
- #: includes/admin/class-bnfw-notification.php:55
107
- #: includes/admin/class-bnfw-notification.php:56
108
- msgid "Notifications"
109
- msgstr "Notificações"
110
-
111
- #: includes/admin/class-bnfw-notification.php:53
112
- msgid "Notification"
113
- msgstr "Notificação"
114
-
115
- #: includes/admin/class-bnfw-notification.php:54
116
- msgid "Add New"
117
- msgstr "Adicionar nova"
118
-
119
- #: includes/admin/class-bnfw-notification.php:57
120
- msgid "Add New Notification"
121
- msgstr "Adicionar nova notificação"
122
-
123
- #: includes/admin/class-bnfw-notification.php:58
124
- msgid "Edit Notification"
125
- msgstr "Editar notificação"
126
-
127
- #: includes/admin/class-bnfw-notification.php:59
128
- msgid "New Notification"
129
- msgstr "Nova notificação"
130
-
131
- #: includes/admin/class-bnfw-notification.php:60
132
- msgid "View Notification"
133
- msgstr "Ver notificação"
134
-
135
- #: includes/admin/class-bnfw-notification.php:61
136
- msgid "Search Notifications"
137
- msgstr "Pesquisar notificação"
138
-
139
- #: includes/admin/class-bnfw-notification.php:62
140
- msgid "No Notifications found"
141
- msgstr "Nenhuma notificação"
142
-
143
- #: includes/admin/class-bnfw-notification.php:63
144
- msgid "No Notifications found in trash"
145
- msgstr "Nenhuma notificação na lixeira"
146
-
147
- #: includes/admin/class-bnfw-notification.php:64
148
- msgid "All Notifications"
149
- msgstr "Todas notificações"
150
-
151
- #: includes/admin/class-bnfw-notification.php:138
152
- msgid "Save Notification"
153
- msgstr "Salvar notificação"
154
-
155
- #: includes/admin/class-bnfw-notification.php:186
156
- msgid "Notification For"
157
- msgstr "Notificação para"
158
-
159
- #: includes/admin/class-bnfw-notification.php:187
160
- msgid ""
161
- "E.g. If you select \"New Post Published\" from the list on the right, this "
162
- "notification will be sent when a new post is published."
163
- msgstr ""
164
-
165
- #: includes/admin/class-bnfw-notification.php:191
166
- msgid "Select the notification type"
167
- msgstr "Selecione o tipo de notificação"
168
-
169
- #: includes/admin/class-bnfw-notification.php:192
170
- msgid "Admin"
171
- msgstr ""
172
-
173
- #: includes/admin/class-bnfw-notification.php:194
174
- #: includes/admin/class-bnfw-notification.php:1302
175
- msgid "New User Registration - For Admin"
176
- msgstr "Novo registro de usuário - Para administração"
177
-
178
- #: includes/admin/class-bnfw-notification.php:196
179
- #: includes/admin/class-bnfw-notification.php:1269
180
- msgid "User Lost Password - For Admin"
181
- msgstr "Senha perdida pelo usuário - para administrador"
182
-
183
- #: includes/admin/class-bnfw-notification.php:198
184
- #: includes/admin/class-bnfw-notification.php:1272
185
- msgid "Password Changed - For Admin"
186
- msgstr "Senha alterada - para administrador"
187
-
188
- #: includes/admin/class-bnfw-notification.php:200
189
- #: includes/admin/class-bnfw-notification.php:1275
190
- msgid "User Email Changed - For Admin"
191
- msgstr "E-mail do usuário alterado - para administrador"
192
-
193
- #: includes/admin/class-bnfw-notification.php:202
194
- #: includes/admin/class-bnfw-notification.php:1308
195
- msgid "User Role Changed - For Admin"
196
- msgstr "Registro de usuário - Para administração"
197
-
198
- #: includes/admin/class-bnfw-notification.php:204
199
- #: includes/admin/class-bnfw-notification.php:1296
200
- msgid "User Logged In - For Admin"
201
- msgstr "Usuário conectado - para administrador"
202
-
203
- #: includes/admin/class-bnfw-notification.php:206
204
- #: includes/admin/class-bnfw-notification.php:1287
205
- msgid "WordPress Core Automatic Background Updates"
206
- msgstr ""
207
-
208
- #: includes/admin/class-bnfw-notification.php:210
209
- #: includes/admin/class-bnfw-notification.php:1344
210
- msgid "Privacy - Confirm Action: Export Data Request - For Admin"
211
- msgstr ""
212
-
213
- #: includes/admin/class-bnfw-notification.php:214
214
- #: includes/admin/class-bnfw-notification.php:1347
215
- msgid "Privacy - Confirm Action: Erase Data Request - For Admin"
216
- msgstr ""
217
-
218
- #: includes/admin/class-bnfw-notification.php:222
219
- msgid "Transactional"
220
- msgstr ""
221
-
222
- #: includes/admin/class-bnfw-notification.php:224
223
- #: includes/admin/class-bnfw-notification.php:1290
224
- msgid "New User Registration - For User"
225
- msgstr "Novo Registro de Usuário - Por Usuário"
226
-
227
- #: includes/admin/class-bnfw-notification.php:226
228
- #: includes/admin/class-bnfw-notification.php:1299
229
- msgid "New User - Post-registration Email"
230
- msgstr "Novo usuário - E-mail de pós-registro"
231
-
232
- #: includes/admin/class-bnfw-notification.php:228
233
- #: includes/admin/class-bnfw-notification.php:1266
234
- msgid "User Lost Password - For User"
235
- msgstr "Senha perdida pelo usuário - Para o usuário"
236
-
237
- #: includes/admin/class-bnfw-notification.php:230
238
- #: includes/admin/class-bnfw-notification.php:1278
239
- msgid "Password Changed - For User"
240
- msgstr "Senha alterada - para o usuário"
241
-
242
- #: includes/admin/class-bnfw-notification.php:232
243
- #: includes/admin/class-bnfw-notification.php:1281
244
- msgid "User Email Changed Confirmation - For User"
245
- msgstr "Confirmação de alteração de e-mail do usuário - Para o usuário"
246
-
247
- #: includes/admin/class-bnfw-notification.php:235
248
- #: includes/admin/class-bnfw-notification.php:1284
249
- msgid "User Email Changed - For User"
250
- msgstr "Email do usuário alterado - Para o usuário"
251
-
252
- #: includes/admin/class-bnfw-notification.php:237
253
- #: includes/admin/class-bnfw-notification.php:1305
254
- msgid "User Role Changed - For User"
255
- msgstr "Função do usuário alterada - para o usuário"
256
-
257
- #: includes/admin/class-bnfw-notification.php:239
258
- #: includes/admin/class-bnfw-notification.php:1293
259
- msgid "User Logged In - For User"
260
- msgstr "Usuário conectado - Para o usuário"
261
-
262
- #: includes/admin/class-bnfw-notification.php:241
263
- #: includes/admin/class-bnfw-notification.php:375
264
- #: includes/admin/class-bnfw-notification.php:1263
265
- msgid "Comment Reply"
266
- msgstr "Responder comentário"
267
-
268
- #: includes/admin/class-bnfw-notification.php:245
269
- msgid "Privacy - Confirm Action: Export Data Request - For User"
270
- msgstr ""
271
-
272
- #: includes/admin/class-bnfw-notification.php:249
273
- msgid "Privacy - Confirm Action: Erase Data Request - For User"
274
- msgstr ""
275
-
276
- #: includes/admin/class-bnfw-notification.php:253
277
- #: includes/admin/class-bnfw-notification.php:1350
278
- msgid "Privacy - Data Export - For User"
279
- msgstr ""
280
-
281
- #: includes/admin/class-bnfw-notification.php:257
282
- #: includes/admin/class-bnfw-notification.php:1353
283
- msgid "Privacy - Data Erased - For User"
284
- msgstr ""
285
-
286
- #: includes/admin/class-bnfw-notification.php:267
287
- #: includes/admin/class-bnfw-notification.php:1311
288
- msgid "New Post Published"
289
- msgstr "Novo post publicado"
290
-
291
- #: includes/admin/class-bnfw-notification.php:269
292
- #: includes/admin/class-bnfw-notification.php:1314
293
- msgid "Post Updated"
294
- msgstr "Post atualizado"
295
-
296
- #: includes/admin/class-bnfw-notification.php:271
297
- #: includes/admin/class-bnfw-notification.php:1317
298
- msgid "Post Pending Review"
299
- msgstr "Post pendente para revisão"
300
-
301
- #: includes/admin/class-bnfw-notification.php:273
302
- #: includes/admin/class-bnfw-notification.php:1320
303
- msgid "New Private Post"
304
- msgstr ""
305
-
306
- #: includes/admin/class-bnfw-notification.php:275
307
- #: includes/admin/class-bnfw-notification.php:1323
308
- msgid "Post Scheduled"
309
- msgstr "Programar post"
310
-
311
- #: includes/admin/class-bnfw-notification.php:277
312
- #: includes/admin/class-bnfw-notification.php:1326
313
- msgid "Published Post Moved to Trash"
314
- msgstr "Postagem publicada movida para a lixeira"
315
-
316
- #: includes/admin/class-bnfw-notification.php:279
317
- #: includes/admin/class-bnfw-notification.php:367
318
- #: includes/admin/class-bnfw-notification.php:1248
319
- msgid "New Comment"
320
- msgstr "Novo comentário"
321
-
322
- #: includes/admin/class-bnfw-notification.php:282
323
- #: includes/admin/class-bnfw-notification.php:369
324
- #: includes/admin/class-bnfw-notification.php:1254
325
- #: includes/admin/class-bnfw-notification.php:1407
326
- msgid "New Comment Awaiting Moderation"
327
- msgstr "Novo comentário aguardando moderação"
328
-
329
- #: includes/admin/class-bnfw-notification.php:285
330
- #: includes/admin/class-bnfw-notification.php:1251
331
- msgid "Post - Comment Approved"
332
- msgstr ""
333
-
334
- #: includes/admin/class-bnfw-notification.php:288
335
- #: includes/admin/class-bnfw-notification.php:1332
336
- msgid "New Category"
337
- msgstr "Nova categoria"
338
-
339
- #: includes/admin/class-bnfw-notification.php:290
340
- #: includes/admin/class-bnfw-notification.php:1335
341
- msgid "New Tag"
342
- msgstr "Nova tag"
343
-
344
- #: includes/admin/class-bnfw-notification.php:292
345
- #: includes/admin/class-bnfw-notification.php:1257
346
- msgid "New Trackback"
347
- msgstr "Novo Trackback"
348
-
349
- #: includes/admin/class-bnfw-notification.php:294
350
- #: includes/admin/class-bnfw-notification.php:1260
351
- msgid "New Pingback"
352
- msgstr "Novo Pingback"
353
-
354
- #: includes/admin/class-bnfw-notification.php:301
355
- #: includes/admin/class-bnfw-notification.php:1329
356
- msgid "New Page Published"
357
- msgstr "Nova página publicada"
358
-
359
- #: includes/admin/class-bnfw-notification.php:303
360
- msgid "Page Updated"
361
- msgstr "Página atualizada"
362
-
363
- #: includes/admin/class-bnfw-notification.php:305
364
- msgid "Page Pending Review"
365
- msgstr "Página aguardando revisão"
366
-
367
- #: includes/admin/class-bnfw-notification.php:307
368
- msgid "New Private Page"
369
- msgstr ""
370
-
371
- #: includes/admin/class-bnfw-notification.php:309
372
- msgid "Page Scheduled"
373
- msgstr "Programar página"
374
-
375
- #: includes/admin/class-bnfw-notification.php:311
376
- msgid "Page - New Comment"
377
- msgstr "Página - Novo Comentário"
378
-
379
- #: includes/admin/class-bnfw-notification.php:313
380
- msgid "Page - New Comment Awaiting Moderation"
381
- msgstr "Página - Novo comentário aguardando moderação"
382
-
383
- #: includes/admin/class-bnfw-notification.php:316
384
- #: includes/admin/class-bnfw-notification.php:1365
385
- msgid "Page - Comment Approved"
386
- msgstr "Página - Comentário aprovado"
387
-
388
- #: includes/admin/class-bnfw-notification.php:319
389
- msgid "Page - Comment Reply"
390
- msgstr "Página - Resposta a Comentário"
391
-
392
- #: includes/admin/class-bnfw-notification.php:326
393
- #: includes/admin/class-bnfw-notification.php:1356
394
- msgid "New Media Published"
395
- msgstr "Nova mídia publicada"
396
-
397
- #: includes/admin/class-bnfw-notification.php:328
398
- #: includes/admin/class-bnfw-notification.php:1359
399
- msgid "Media Updated"
400
- msgstr "Mídia atualizada"
401
-
402
- #: includes/admin/class-bnfw-notification.php:330
403
- #: includes/admin/class-bnfw-notification.php:1362
404
- msgid "Media - New Comment"
405
- msgstr "Mídia - Novo Comentário"
406
-
407
- #: includes/admin/class-bnfw-notification.php:332
408
- #: includes/admin/class-bnfw-notification.php:1368
409
- msgid "Media - Comment Approved"
410
- msgstr ""
411
-
412
- #: includes/admin/class-bnfw-notification.php:335
413
- #: includes/admin/class-bnfw-notification.php:1371
414
- msgid "Media - New Comment Awaiting Moderation"
415
- msgstr "Mídia - Novo comentário aguardando moderação"
416
-
417
- #: includes/admin/class-bnfw-notification.php:337
418
- #: includes/admin/class-bnfw-notification.php:1374
419
- msgid "Media - Comment Reply"
420
- msgstr "Mídia - Resposta a Comentário"
421
-
422
- #: includes/admin/class-bnfw-notification.php:355
423
- msgid "Custom Post Type"
424
- msgstr "Tipo de post customizado"
425
-
426
- #: includes/admin/class-bnfw-notification.php:357
427
- #: includes/admin/class-bnfw-notification.php:1389
428
- msgid "New "
429
- msgstr "Novo"
430
-
431
- #: includes/admin/class-bnfw-notification.php:357
432
- msgid " Published"
433
- msgstr "Publicados"
434
-
435
- #: includes/admin/class-bnfw-notification.php:359
436
- msgid "Updated"
437
- msgstr "Atualizado"
438
-
439
- #: includes/admin/class-bnfw-notification.php:361
440
- msgid "Pending Review"
441
- msgstr "Revisão pendente"
442
-
443
- #: includes/admin/class-bnfw-notification.php:363
444
- #: includes/admin/class-bnfw-notification.php:1401
445
- msgid "New Private "
446
- msgstr ""
447
-
448
- #: includes/admin/class-bnfw-notification.php:365
449
- msgid "Scheduled"
450
- msgstr "Programado"
451
-
452
- #: includes/admin/class-bnfw-notification.php:372
453
- msgid "Comment Approved"
454
- msgstr "Comentário aprovado"
455
-
456
- #: includes/admin/class-bnfw-notification.php:394
457
- msgid "Custom Taxonomy"
458
- msgstr "Taxonomia customizada"
459
-
460
- #: includes/admin/class-bnfw-notification.php:400
461
- msgid "New"
462
- msgstr "Novo"
463
-
464
- #: includes/admin/class-bnfw-notification.php:419
465
- msgid ""
466
- "This notification doesn't support additional email fields due to a "
467
- "limitation in WordPress."
468
- msgstr ""
469
- "Esta notificação não oferece suporte a campos de e-mail adicionais devido a "
470
- "uma limitação do WordPress."
471
-
472
- #: includes/admin/class-bnfw-notification.php:426
473
- msgid "Email Formatting"
474
- msgstr "Formatar email"
475
-
476
- #: includes/admin/class-bnfw-notification.php:427
477
- msgid ""
478
- "How do you want to format the sent email? HTML is recommended as it'll show "
479
- "images and links correctly."
480
- msgstr ""
481
-
482
- #: includes/admin/class-bnfw-notification.php:448
483
- msgid "Additional Email Fields"
484
- msgstr "Campos adicionais do email"
485
-
486
- #: includes/admin/class-bnfw-notification.php:449
487
- msgid ""
488
- "This should be fairly self explanatory but if you're unsure, tick this "
489
- "checkbox and have a look at the available options. You can always untick it "
490
- "again should you decide you don't need to use it."
491
- msgstr ""
492
-
493
- #: includes/admin/class-bnfw-notification.php:454
494
- msgid "Set \"From\" Name & Email, Reply To, CC, BCC"
495
- msgstr ""
496
-
497
- #: includes/admin/class-bnfw-notification.php:461
498
- msgid "From Name and Email"
499
- msgstr "Nome do remetente do email"
500
-
501
- #: includes/admin/class-bnfw-notification.php:462
502
- msgid ""
503
- "If you want to send the email from your site name and email address instead "
504
- "of the default \"WordPress\" from \"wordpress@domain.com\", this is where "
505
- "you can do it."
506
- msgstr ""
507
-
508
- #: includes/admin/class-bnfw-notification.php:466
509
- msgid "Site Name"
510
- msgstr ""
511
-
512
- #: includes/admin/class-bnfw-notification.php:468
513
- msgid "Site Email"
514
- msgstr ""
515
-
516
- #: includes/admin/class-bnfw-notification.php:475
517
- msgid "Reply To"
518
- msgstr ""
519
-
520
- #: includes/admin/class-bnfw-notification.php:476
521
- msgid ""
522
- "If you want any replies to your email notification to go to another person, "
523
- "fill in this box with their name and email address."
524
- msgstr ""
525
-
526
- #: includes/admin/class-bnfw-notification.php:480
527
- msgid "Name"
528
- msgstr ""
529
-
530
- #: includes/admin/class-bnfw-notification.php:482
531
- msgid "Email"
532
- msgstr "O email"
533
-
534
- #: includes/admin/class-bnfw-notification.php:488
535
- msgid "CC"
536
- msgstr "CC"
537
-
538
- #: includes/admin/class-bnfw-notification.php:489
539
- msgid "Publicly copy in any other users or user roles to this email."
540
- msgstr ""
541
-
542
- #: includes/admin/class-bnfw-notification.php:494
543
- #: includes/admin/class-bnfw-notification.php:508
544
- #: includes/admin/class-bnfw-notification.php:557
545
- #: includes/admin/class-bnfw-notification.php:575
546
- msgid "Select User Roles / Users"
547
- msgstr "Selecione Funções de usuário / usuários"
548
-
549
- #: includes/admin/class-bnfw-notification.php:502
550
- msgid "BCC"
551
- msgstr "CCO"
552
-
553
- #: includes/admin/class-bnfw-notification.php:503
554
- msgid "Privately copy in any other users or user roles to this email."
555
- msgstr ""
556
-
557
- #: includes/admin/class-bnfw-notification.php:518
558
- msgid "Send to Author"
559
- msgstr ""
560
-
561
- #: includes/admin/class-bnfw-notification.php:519
562
- msgid ""
563
- "E.g. If you want a new post published notification to go to the post author, "
564
- "tick this box."
565
- msgstr ""
566
-
567
- #: includes/admin/class-bnfw-notification.php:526
568
- msgid "Send this notification to the Author"
569
- msgstr "Envie esta notificação ao autor"
570
-
571
- #: includes/admin/class-bnfw-notification.php:536
572
- msgid ""
573
- "E.g. If you're an editor and regularly update your posts, you might not want "
574
- "to be emailed about this all the time. Ticking this box will prevent you "
575
- "from receiving emails about your own changes."
576
- msgstr ""
577
-
578
- #: includes/admin/class-bnfw-notification.php:542
579
- msgid "Do not send this Notification to the User that triggered it"
580
- msgstr "Não envie esta notificação ao usuário que a acionou"
581
-
582
- #: includes/admin/class-bnfw-notification.php:551
583
- msgid "Send To"
584
- msgstr "Enviar para"
585
-
586
- #: includes/admin/class-bnfw-notification.php:552
587
- msgid "Choose the users and/or user roles to send this email notification to."
588
- msgstr ""
589
-
590
- #: includes/admin/class-bnfw-notification.php:565
591
- msgid "Except For"
592
- msgstr ""
593
-
594
- #: includes/admin/class-bnfw-notification.php:568
595
- msgid ""
596
- "Choose the users and/or user roles that this notification should not be sent "
597
- "to."
598
- msgstr ""
599
-
600
- #: includes/admin/class-bnfw-notification.php:593
601
- msgid ""
602
- "You have chosen to send this notification to over 200 users. Please check "
603
- "the email sending rate limit at your host before sending."
604
- msgstr ""
605
-
606
- #: includes/admin/class-bnfw-notification.php:603
607
- #: includes/admin/class-bnfw-notification.php:1129
608
- msgid "Subject"
609
- msgstr "Assunto"
610
-
611
- #: includes/admin/class-bnfw-notification.php:604
612
- msgid "Notification subject. You can use "
613
- msgstr "Assunto da notificação. Você pode usar"
614
-
615
- #: includes/admin/class-bnfw-notification.php:604
616
- #: includes/admin/class-bnfw-notification.php:618
617
- msgid " here."
618
- msgstr ""
619
-
620
- #: includes/admin/class-bnfw-notification.php:617
621
- msgid "Message Body"
622
- msgstr "Corpo da mensagem"
623
-
624
- #: includes/admin/class-bnfw-notification.php:618
625
- msgid "Notification message. You can use "
626
- msgstr "Mensagem de notificação. Você pode usar"
627
-
628
- #: includes/admin/class-bnfw-notification.php:626
629
- msgid "Need some more help?"
630
- msgstr ""
631
-
632
- #: includes/admin/class-bnfw-notification.php:636
633
- msgid "Insert Default Content"
634
- msgstr "Inserir conteúdo padrão"
635
-
636
- #: includes/admin/class-bnfw-notification.php:640
637
- msgid "Read Documentation"
638
- msgstr ""
639
-
640
- #: includes/admin/class-bnfw-notification.php:644
641
- msgid "Find Shortcodes"
642
- msgstr ""
643
-
644
- #: includes/admin/class-bnfw-notification.php:655
645
- msgid ""
646
- "Stop additional paragraph and line break HTML from being inserted into my "
647
- "notifications"
648
- msgstr ""
649
-
650
- #: includes/admin/class-bnfw-notification.php:710
651
- msgid ""
652
- "You must choose at least one User or User Role to send the notification to "
653
- "before you can save"
654
- msgstr ""
655
-
656
- #: includes/admin/class-bnfw-notification.php:825
657
- msgid "Test Notification Sent."
658
- msgstr "Teste de envio da notificação."
659
-
660
- #: includes/admin/class-bnfw-notification.php:915
661
- msgid "Notification saved."
662
- msgstr "Notificação salva."
663
-
664
- #: includes/admin/class-bnfw-notification.php:934
665
- #: includes/admin/class-bnfw-notification.php:992
666
- #: includes/admin/class-bnfw-notification.php:994
667
- msgid "Save"
668
- msgstr "Salvar"
669
-
670
- #: includes/admin/class-bnfw-notification.php:942
671
- msgid ""
672
- "Use this to enable or disable notifications. If you want to disable a "
673
- "default WordPress notification, just create it on the left, then disable it "
674
- "here."
675
- msgstr ""
676
-
677
- #: includes/admin/class-bnfw-notification.php:949
678
- msgid "Notification Enabled"
679
- msgstr "Notificação habilitada"
680
-
681
- #: includes/admin/class-bnfw-notification.php:956
682
- msgid "Notification Disabled"
683
- msgstr "Notificação Desativada"
684
-
685
- #: includes/admin/class-bnfw-notification.php:967
686
- msgid "Send Me a Test Email"
687
- msgstr "Envie-me um email de teste"
688
-
689
- #: includes/admin/class-bnfw-notification.php:969
690
- msgid ""
691
- "This will send you (the currently logged in user) a notification so that you "
692
- "can check for any issues with formatting – it’s doesn't mean that a "
693
- "notification will send correctly in the future. You can read about how to "
694
- "improve email delivery"
695
- msgstr ""
696
-
697
- #: includes/admin/class-bnfw-notification.php:969
698
- msgid "here"
699
- msgstr ""
700
-
701
- #: includes/admin/class-bnfw-notification.php:969
702
- msgid ". Shortcodes will not be replaced with content."
703
- msgstr ""
704
-
705
- #: includes/admin/class-bnfw-notification.php:980
706
- msgid "Delete Permanently"
707
- msgstr "Excluir permanente"
708
-
709
- #: includes/admin/class-bnfw-notification.php:982
710
- msgid "Move to Trash"
711
- msgstr "Enviar para lixeira"
712
-
713
- #: includes/admin/class-bnfw-notification.php:1127
714
- msgid "Notification Type"
715
- msgstr "Tipo de notificação"
716
-
717
- #: includes/admin/class-bnfw-notification.php:1128
718
- msgid "Enabled?"
719
- msgstr "Ativado?"
720
-
721
- #: includes/admin/class-bnfw-notification.php:1130
722
- msgid "User Roles / Users"
723
- msgstr "Funções de usuário / Usuários"
724
-
725
- #: includes/admin/class-bnfw-notification.php:1131
726
- msgid "Excluded User Roles / Users"
727
- msgstr "Funções de usuário / usuários excluídos"
728
-
729
- #: includes/admin/class-bnfw-notification.php:1172
730
- msgid ", Post Author"
731
- msgstr ""
732
-
733
- #: includes/admin/class-bnfw-notification.php:1338
734
- msgid "Privacy – Confirm Action: Export Data Request – For User"
735
- msgstr ""
736
-
737
- #: includes/admin/class-bnfw-notification.php:1341
738
- msgid "Privacy – Confirm Action: Erase Data Request – For User"
739
- msgstr ""
740
-
741
- #: includes/admin/class-bnfw-notification.php:1389
742
- msgid "Published"
743
- msgstr "Publicados"
744
-
745
- #: includes/admin/class-bnfw-notification.php:1392
746
- msgid "Updated "
747
- msgstr "Atualizar"
748
-
749
- #: includes/admin/class-bnfw-notification.php:1395
750
- msgid " Pending Review"
751
- msgstr "Revisão pendente"
752
-
753
- #: includes/admin/class-bnfw-notification.php:1398
754
- msgid " Scheduled"
755
- msgstr "Programado"
756
-
757
- #: includes/admin/class-bnfw-notification.php:1404
758
- msgid " Comment"
759
- msgstr "Comentário"
760
-
761
- #: includes/admin/class-bnfw-notification.php:1410
762
- msgid " Comment Reply"
763
- msgstr "Comentário Responder"
764
-
765
- #: includes/admin/class-bnfw-notification.php:1413
766
- msgid " Comment Approved"
767
- msgstr "Comentário aprovado"
768
-
769
- #: includes/admin/class-bnfw-notification.php:1418
770
- msgid "New Term"
771
- msgstr "Novo termo"
772
-
773
- #: includes/admin/class-bnfw-notification.php:1420
774
- msgid "New Term in "
775
- msgstr "Novo termo em"
776
-
777
- #: includes/admin/class-bnfw-notification.php:1440
778
- msgid "Enable Notifications"
779
- msgstr "Ativar notificações"
780
-
781
- #: includes/admin/class-bnfw-notification.php:1441
782
- msgid "Disable Notifications"
783
- msgstr "Desativar as notificações"
784
-
785
- #: includes/admin/class-bnfw-notification.php:1502
786
- msgid "Enable Notification"
787
- msgstr "Desabilitar notificação"
788
-
789
- #: includes/admin/class-bnfw-notification.php:1510
790
- msgid "Disable Notification"
791
- msgstr "Desabilitar notificação"
792
-
793
- #: includes/admin/class-bnfw-notification.php:1568
794
- msgid "Enabled 1 Notification."
795
- msgstr "Ativado 1 notificação."
796
-
797
- #: includes/admin/class-bnfw-notification.php:1572
798
- msgid "Disabled 1 Notification."
799
- msgstr "Desativado 1 notificação."
800
-
801
- #: includes/admin/class-bnfw-notification.php:1578
802
- #, php-format
803
- msgid "Enabled %s Notification."
804
- msgid_plural "Enabled %s Notifications."
805
- msgstr[0] "Notificação%s habilitada."
806
- msgstr[1] "Ativou%s Notificações."
807
-
808
- #: includes/admin/class-bnfw-notification.php:1588
809
- #, php-format
810
- msgid "Disabled %s Notification."
811
- msgid_plural "Disabled %s Notifications."
812
- msgstr[0] "Notificação%s desativada."
813
- msgstr[1] "Notificações de%s desativadas."
814
-
815
- #: includes/admin/class-bnfw-notification.php:1602
816
- msgid ""
817
- "If you send out notifications with BNFW but don't receive them, you may need "
818
- "to install an SMTP plugin to <a href=\"https://betternotificationsforwp.com/"
819
- "documentation/getting-started/how-to-improve-email-delivery/\" target="
820
- "\"_blank\">improve email deliverability</a>. I recommend using <a href="
821
- "\"https://wordpress.org/plugins/post-smtp/\" target=\"_blank\">Post SMTP</a> "
822
- "as it's easy to set-up or <a href=\"https://wordpress.org/plugins/email-log/"
823
- "\" target=\"_blank\">Email Log</a> to just log and view emails that are sent."
824
- msgstr ""
825
-
826
- #: includes/engine/class-bnfw-engine.php:18
827
- msgid "Test Email:"
828
- msgstr "Email de teste:"
829
-
830
- #: includes/engine/class-bnfw-engine.php:19
831
- msgid ""
832
- "This is a test email. All shortcodes below will show in place but not be "
833
- "replaced with content."
834
- msgstr ""
835
-
836
- #: includes/engine/class-bnfw-engine.php:1583
837
- msgid "Error: Download link is not available please contact support"
838
- msgstr ""
839
-
840
- #: includes/helpers/ajax-helpers.php:34 includes/helpers/helpers.php:38
841
- msgid "User Roles"
842
- msgstr "Funções do usuário"
843
-
844
- #: includes/helpers/ajax-helpers.php:57 includes/helpers/helpers.php:59
845
- #: includes/helpers/helpers.php:64
846
- msgid "Users"
847
- msgstr ""
848
-
849
- #: includes/helpers/helpers.php:103
850
- msgid "Non WordPress Users"
851
- msgstr ""
852
-
853
- #: includes/import.php:69
854
- msgid " for "
855
- msgstr "para"
856
-
857
- #: includes/import.php:69
858
- msgid " (Auto Imported)"
859
- msgstr "(Importado automático)"
860
-
861
- #: includes/libraries/EDD_SL_Plugin_Updater.php:228
862
- #, php-format
863
- msgid ""
864
- "There is a new version of %1$s available. %2$sView version %3$s details%4$s."
865
- msgstr ""
866
-
867
- #: includes/libraries/EDD_SL_Plugin_Updater.php:236
868
- #, php-format
869
- msgid ""
870
- "There is a new version of %1$s available. %2$sView version %3$s details%4$s "
871
- "or %5$supdate now%6$s."
872
- msgstr ""
873
-
874
- #: includes/libraries/EDD_SL_Plugin_Updater.php:474
875
- msgid "You do not have permission to install plugin updates"
876
- msgstr ""
877
-
878
- #: includes/libraries/EDD_SL_Plugin_Updater.php:474
879
- msgid "Error"
880
- msgstr ""
881
-
882
- #: includes/license/class-bnfw-license-setting.php:18
883
- #: includes/license/class-bnfw-license-setting.php:19
884
- msgid "Add-on Licenses"
885
- msgstr ""
886
-
887
- #: includes/license/class-bnfw-license-setting.php:38
888
- msgid "BNFW Add-on Licenses"
889
- msgstr ""
890
-
891
- #: includes/license/class-bnfw-license-setting.php:47
892
- msgid "Save License"
893
- msgstr ""
894
-
895
- #: includes/license/class-bnfw-license-setting.php:55
896
- msgid ""
897
- "<br>You have no BNFW Premium Add-ons installed yet.<br>You can buy add-ons "
898
- "from the <a href=\""
899
- msgstr ""
900
-
901
- #: includes/license/class-bnfw-license-setting.php:130
902
- msgid "Deactivate License"
903
- msgstr ""
904
-
905
- #: includes/license/class-bnfw-license.php:140
906
- #, php-format
907
- msgid "%1$s License Key"
908
- msgstr ""
909
-
910
- #: includes/overrides.php:41 includes/overrides.php:135
911
- #, php-format
912
- msgid "New user registration on your site %s:"
913
- msgstr "Novo registro de usuário em seu site %s:"
914
-
915
- #: includes/overrides.php:42 includes/overrides.php:117
916
- #: includes/overrides.php:136 includes/overrides.php:152
917
- #, php-format
918
- msgid "Username: %s"
919
- msgstr "Usuário: %s"
920
-
921
- #: includes/overrides.php:43 includes/overrides.php:137
922
- #, php-format
923
- msgid "E-mail: %s"
924
- msgstr "Email: %s"
925
-
926
- #. translators: Password change notification email subject. %s: Site title
927
- #: includes/overrides.php:48 includes/overrides.php:139
928
- #, php-format
929
- msgid "[%s] New User Registration"
930
- msgstr "[%s] Novo Registro de Usuário"
931
-
932
- #: includes/overrides.php:118
933
- msgid "To set your password, visit the following address:"
934
- msgstr ""
935
-
936
- #: includes/overrides.php:123
937
- #, php-format
938
- msgid "[%s] Your username and password info"
939
- msgstr "[%s] Informações do seu nome de usuário e senha"
940
-
941
- #: includes/overrides.php:153
942
- #, php-format
943
- msgid "Password: %s"
944
- msgstr "Senha: %s"
945
-
946
- #: includes/overrides.php:156
947
- #, php-format
948
- msgid "[%s] Your username and password"
949
- msgstr "[%s] O seu nome de usuário e senha"
950
-
951
- #. translators: %s: user name
952
- #: includes/overrides.php:184
953
- #, php-format
954
- msgid "Password changed for user: %s"
955
- msgstr "Senha alterada para o usuário:%s"
956
-
957
- #. translators: %s: site title
958
- #: includes/overrides.php:189
959
- #, php-format
960
- msgid "[%s] Password Changed"
961
- msgstr ""
962
-
963
- #. Plugin Name of the plugin/theme
964
- msgid "Better Notifications for WP"
965
- msgstr "Melhores notificações para WordPress"
966
-
967
- #. Plugin URI of the plugin/theme
968
- #, fuzzy
969
- #| msgid "http://wordpress.org/plugins/bnfw/"
970
- msgid "https://wordpress.org/plugins/bnfw/"
971
- msgstr "http://wordpress.org/plugins/bnfw/"
972
-
973
- #. Description of the plugin/theme
974
- msgid ""
975
- "Supercharge your WordPress notifications using a WYSIWYG editor and "
976
- "shortcodes. Default and new notifications available. Add more power with Add-"
977
- "ons."
978
- msgstr ""
979
-
980
- #. Author of the plugin/theme
981
- msgid "Made with Fuel"
982
- msgstr "Made with Fuel"
983
-
984
- #. Author URI of the plugin/theme
985
- msgid "https://madewithfuel.com/"
986
- msgstr ""
987
-
988
- #~ msgid "New User - Welcome Email"
989
- #~ msgstr "Novo Usuário - Email de boas vindas"
990
-
991
- #~ msgid "Update "
992
- #~ msgstr "Atualizar"
993
-
994
- #~ msgid "Show additional email fields"
995
- #~ msgstr "Mostrar campos adicionais do email"
996
-
997
- #~ msgid ""
998
- #~ "Looking for help with shortcodes? Click here to see which ones you can "
999
- #~ "use with the selected notification."
1000
- #~ msgstr ""
1001
- #~ "Precisando de ajuda com códigos de acesso? Clique aqui para ver qual "
1002
- #~ "deles você pode usar com a notificação selecionada."
1003
-
1004
- #~ msgid "New User - Welcome email"
1005
- #~ msgstr "Novo usuário - Email de boas vindas"
1006
-
1007
- #~ msgid ""
1008
- #~ "Send customisable HTML emails to your users for different WordPress "
1009
- #~ "notifications."
1010
- #~ msgstr ""
1011
- #~ "Enviar emails HTML com notificações personalizáveis para usuários "
1012
- #~ "diferentes do WordPress."
1013
-
1014
- #~ msgid "https://betternotificationsforwp.com/"
1015
- #~ msgstr "https://betternotificationsforwp.com/"
1
+ # Copyright (C) 2015 Better Notifications for WP
2
+ # This file is distributed under the same license as the Better Notifications for WP package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Better Notifications for WP 1.3.3\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/bnfw\n"
7
+ "POT-Creation-Date: 2020-11-27 21:34+0800\n"
8
+ "PO-Revision-Date: 2020-11-28 00:04+0800\n"
9
+ "Last-Translator: Glayton Caixeta <contato@caixeta.com>\n"
10
+ "Language-Team: \n"
11
+ "Language: pt_BR\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 2.2\n"
16
+ "Plural-Forms: nplurals=2; plural=(n > 1);\n"
17
+
18
+ #: bnfw.php:283 includes/admin/bnfw-settings.php:15
19
+ msgid "Settings"
20
+ msgstr "Configurações"
21
+
22
+ #: includes/admin/bnfw-settings.php:14
23
+ #: includes/admin/class-bnfw-notification.php:129
24
+ msgid "Notification Settings"
25
+ msgstr "Configurações de notificações"
26
+
27
+ #: includes/admin/bnfw-settings.php:38
28
+ msgid "BNFW Settings"
29
+ msgstr "Configurações do BNFW"
30
+
31
+ #: includes/admin/bnfw-settings.php:46
32
+ msgid "Save Settings"
33
+ msgstr "Salvar configurações"
34
+
35
+ #: includes/admin/bnfw-settings.php:73
36
+ msgid "Documentation"
37
+ msgstr ""
38
+
39
+ #: includes/admin/bnfw-settings.php:80
40
+ msgid "Premium Add-ons"
41
+ msgstr ""
42
+
43
+ #: includes/admin/bnfw-settings.php:87
44
+ msgid "Priority Support"
45
+ msgstr ""
46
+
47
+ #: includes/admin/bnfw-settings.php:150
48
+ msgid "Suppress SPAM comment notification"
49
+ msgstr "Esconder comentário e notificação de SPAM"
50
+
51
+ #: includes/admin/bnfw-settings.php:150
52
+ msgid ""
53
+ "Comments that are correctly marked as SPAM by a 3rd party plugin (such as "
54
+ "Akismet) will not generate a notification if this is ticked."
55
+ msgstr ""
56
+
57
+ #: includes/admin/bnfw-settings.php:155
58
+ msgid "Don't send notifications for comments marked as SPAM"
59
+ msgstr "Não envie notificações para comentários marcados como SPAM"
60
+
61
+ #: includes/admin/bnfw-settings.php:167
62
+ msgid "Default Email Format"
63
+ msgstr "Formato padrão de email"
64
+
65
+ #: includes/admin/bnfw-settings.php:167
66
+ msgid ""
67
+ "This will apply to all emails sent out via WordPress, even those from other "
68
+ "plugins. For more details, please see the "
69
+ msgstr ""
70
+ "Isso se aplica a todos os e-mails enviados via WordPress, mesmo aqueles de "
71
+ "outros plug-ins. Para obter mais detalhes, consulte o"
72
+
73
+ #: includes/admin/bnfw-settings.php:181
74
+ msgid "Enable Content Shortcodes?"
75
+ msgstr ""
76
+
77
+ #: includes/admin/bnfw-settings.php:181
78
+ msgid "Shortcodes in the post/page content are disabled by default."
79
+ msgstr ""
80
+
81
+ #: includes/admin/bnfw-settings.php:186
82
+ msgid "Enable shortcode output in the page/post content"
83
+ msgstr ""
84
+
85
+ #: includes/admin/bnfw-settings.php:198
86
+ msgid "Allow Usage Tracking?"
87
+ msgstr ""
88
+
89
+ #: includes/admin/bnfw-settings.php:203
90
+ msgid ""
91
+ "Allow Better Notifications for WP to anonymously track how this plugin is "
92
+ "used and help make the plugin better."
93
+ msgstr ""
94
+
95
+ #: includes/admin/bnfw-settings.php:251
96
+ #: includes/admin/class-bnfw-notification.php:433
97
+ msgid "HTML Formatting"
98
+ msgstr "Formatação HTML"
99
+
100
+ #: includes/admin/bnfw-settings.php:256
101
+ #: includes/admin/class-bnfw-notification.php:439
102
+ msgid "Plain Text"
103
+ msgstr "Texto simples"
104
+
105
+ #: includes/admin/class-bnfw-notification.php:52
106
+ #: includes/admin/class-bnfw-notification.php:55
107
+ #: includes/admin/class-bnfw-notification.php:56
108
+ msgid "Notifications"
109
+ msgstr "Notificações"
110
+
111
+ #: includes/admin/class-bnfw-notification.php:53
112
+ msgid "Notification"
113
+ msgstr "Notificação"
114
+
115
+ #: includes/admin/class-bnfw-notification.php:54
116
+ msgid "Add New"
117
+ msgstr "Adicionar nova"
118
+
119
+ #: includes/admin/class-bnfw-notification.php:57
120
+ msgid "Add New Notification"
121
+ msgstr "Adicionar nova notificação"
122
+
123
+ #: includes/admin/class-bnfw-notification.php:58
124
+ msgid "Edit Notification"
125
+ msgstr "Editar notificação"
126
+
127
+ #: includes/admin/class-bnfw-notification.php:59
128
+ msgid "New Notification"
129
+ msgstr "Nova notificação"
130
+
131
+ #: includes/admin/class-bnfw-notification.php:60
132
+ msgid "View Notification"
133
+ msgstr "Ver notificação"
134
+
135
+ #: includes/admin/class-bnfw-notification.php:61
136
+ msgid "Search Notifications"
137
+ msgstr "Pesquisar notificação"
138
+
139
+ #: includes/admin/class-bnfw-notification.php:62
140
+ msgid "No Notifications found"
141
+ msgstr "Nenhuma notificação"
142
+
143
+ #: includes/admin/class-bnfw-notification.php:63
144
+ msgid "No Notifications found in trash"
145
+ msgstr "Nenhuma notificação na lixeira"
146
+
147
+ #: includes/admin/class-bnfw-notification.php:64
148
+ msgid "All Notifications"
149
+ msgstr "Todas notificações"
150
+
151
+ #: includes/admin/class-bnfw-notification.php:138
152
+ msgid "Save Notification"
153
+ msgstr "Salvar notificação"
154
+
155
+ #: includes/admin/class-bnfw-notification.php:186
156
+ msgid "Notification For"
157
+ msgstr "Notificação para"
158
+
159
+ #: includes/admin/class-bnfw-notification.php:187
160
+ msgid ""
161
+ "E.g. If you select \"New Post Published\" from the list on the right, this "
162
+ "notification will be sent when a new post is published."
163
+ msgstr ""
164
+
165
+ #: includes/admin/class-bnfw-notification.php:191
166
+ msgid "Select the notification type"
167
+ msgstr "Selecione o tipo de notificação"
168
+
169
+ #: includes/admin/class-bnfw-notification.php:192
170
+ msgid "Admin"
171
+ msgstr ""
172
+
173
+ #: includes/admin/class-bnfw-notification.php:194
174
+ #: includes/admin/class-bnfw-notification.php:1302
175
+ msgid "New User Registration - For Admin"
176
+ msgstr "Novo registro de usuário - Para administração"
177
+
178
+ #: includes/admin/class-bnfw-notification.php:196
179
+ #: includes/admin/class-bnfw-notification.php:1269
180
+ msgid "User Lost Password - For Admin"
181
+ msgstr "Senha perdida pelo usuário - para administrador"
182
+
183
+ #: includes/admin/class-bnfw-notification.php:198
184
+ #: includes/admin/class-bnfw-notification.php:1272
185
+ msgid "Password Changed - For Admin"
186
+ msgstr "Senha alterada - para administrador"
187
+
188
+ #: includes/admin/class-bnfw-notification.php:200
189
+ #: includes/admin/class-bnfw-notification.php:1275
190
+ msgid "User Email Changed - For Admin"
191
+ msgstr "E-mail do usuário alterado - para administrador"
192
+
193
+ #: includes/admin/class-bnfw-notification.php:202
194
+ #: includes/admin/class-bnfw-notification.php:1308
195
+ msgid "User Role Changed - For Admin"
196
+ msgstr "Registro de usuário - Para administração"
197
+
198
+ #: includes/admin/class-bnfw-notification.php:204
199
+ #: includes/admin/class-bnfw-notification.php:1296
200
+ msgid "User Logged In - For Admin"
201
+ msgstr "Usuário conectado - para administrador"
202
+
203
+ #: includes/admin/class-bnfw-notification.php:206
204
+ #: includes/admin/class-bnfw-notification.php:1287
205
+ msgid "WordPress Core Automatic Background Updates"
206
+ msgstr ""
207
+
208
+ #: includes/admin/class-bnfw-notification.php:210
209
+ #: includes/admin/class-bnfw-notification.php:1344
210
+ msgid "Privacy - Confirm Action: Export Data Request - For Admin"
211
+ msgstr ""
212
+
213
+ #: includes/admin/class-bnfw-notification.php:214
214
+ #: includes/admin/class-bnfw-notification.php:1347
215
+ msgid "Privacy - Confirm Action: Erase Data Request - For Admin"
216
+ msgstr ""
217
+
218
+ #: includes/admin/class-bnfw-notification.php:222
219
+ msgid "Transactional"
220
+ msgstr ""
221
+
222
+ #: includes/admin/class-bnfw-notification.php:224
223
+ #: includes/admin/class-bnfw-notification.php:1290
224
+ msgid "New User Registration - For User"
225
+ msgstr "Novo Registro de Usuário - Por Usuário"
226
+
227
+ #: includes/admin/class-bnfw-notification.php:226
228
+ #: includes/admin/class-bnfw-notification.php:1299
229
+ msgid "New User - Post-registration Email"
230
+ msgstr "Novo usuário - E-mail de pós-registro"
231
+
232
+ #: includes/admin/class-bnfw-notification.php:228
233
+ #: includes/admin/class-bnfw-notification.php:1266
234
+ msgid "User Lost Password - For User"
235
+ msgstr "Senha perdida pelo usuário - Para o usuário"
236
+
237
+ #: includes/admin/class-bnfw-notification.php:230
238
+ #: includes/admin/class-bnfw-notification.php:1278
239
+ msgid "Password Changed - For User"
240
+ msgstr "Senha alterada - para o usuário"
241
+
242
+ #: includes/admin/class-bnfw-notification.php:232
243
+ #: includes/admin/class-bnfw-notification.php:1281
244
+ msgid "User Email Changed Confirmation - For User"
245
+ msgstr "Confirmação de alteração de e-mail do usuário - Para o usuário"
246
+
247
+ #: includes/admin/class-bnfw-notification.php:235
248
+ #: includes/admin/class-bnfw-notification.php:1284
249
+ msgid "User Email Changed - For User"
250
+ msgstr "Email do usuário alterado - Para o usuário"
251
+
252
+ #: includes/admin/class-bnfw-notification.php:237
253
+ #: includes/admin/class-bnfw-notification.php:1305
254
+ msgid "User Role Changed - For User"
255
+ msgstr "Função do usuário alterada - para o usuário"
256
+
257
+ #: includes/admin/class-bnfw-notification.php:239
258
+ #: includes/admin/class-bnfw-notification.php:1293
259
+ msgid "User Logged In - For User"
260
+ msgstr "Usuário conectado - Para o usuário"
261
+
262
+ #: includes/admin/class-bnfw-notification.php:241
263
+ #: includes/admin/class-bnfw-notification.php:375
264
+ #: includes/admin/class-bnfw-notification.php:1263
265
+ msgid "Comment Reply"
266
+ msgstr "Responder comentário"
267
+
268
+ #: includes/admin/class-bnfw-notification.php:245
269
+ msgid "Privacy - Confirm Action: Export Data Request - For User"
270
+ msgstr ""
271
+
272
+ #: includes/admin/class-bnfw-notification.php:249
273
+ msgid "Privacy - Confirm Action: Erase Data Request - For User"
274
+ msgstr ""
275
+
276
+ #: includes/admin/class-bnfw-notification.php:253
277
+ #: includes/admin/class-bnfw-notification.php:1350
278
+ msgid "Privacy - Data Export - For User"
279
+ msgstr ""
280
+
281
+ #: includes/admin/class-bnfw-notification.php:257
282
+ #: includes/admin/class-bnfw-notification.php:1353
283
+ msgid "Privacy - Data Erased - For User"
284
+ msgstr ""
285
+
286
+ #: includes/admin/class-bnfw-notification.php:267
287
+ #: includes/admin/class-bnfw-notification.php:1311
288
+ msgid "New Post Published"
289
+ msgstr "Novo post publicado"
290
+
291
+ #: includes/admin/class-bnfw-notification.php:269
292
+ #: includes/admin/class-bnfw-notification.php:1314
293
+ msgid "Post Updated"
294
+ msgstr "Post atualizado"
295
+
296
+ #: includes/admin/class-bnfw-notification.php:271
297
+ #: includes/admin/class-bnfw-notification.php:1317
298
+ msgid "Post Pending Review"
299
+ msgstr "Post pendente para revisão"
300
+
301
+ #: includes/admin/class-bnfw-notification.php:273
302
+ #: includes/admin/class-bnfw-notification.php:1320
303
+ msgid "New Private Post"
304
+ msgstr ""
305
+
306
+ #: includes/admin/class-bnfw-notification.php:275
307
+ #: includes/admin/class-bnfw-notification.php:1323
308
+ msgid "Post Scheduled"
309
+ msgstr "Programar post"
310
+
311
+ #: includes/admin/class-bnfw-notification.php:277
312
+ #: includes/admin/class-bnfw-notification.php:1326
313
+ msgid "Published Post Moved to Trash"
314
+ msgstr "Postagem publicada movida para a lixeira"
315
+
316
+ #: includes/admin/class-bnfw-notification.php:279
317
+ #: includes/admin/class-bnfw-notification.php:367
318
+ #: includes/admin/class-bnfw-notification.php:1248
319
+ msgid "New Comment"
320
+ msgstr "Novo comentário"
321
+
322
+ #: includes/admin/class-bnfw-notification.php:282
323
+ #: includes/admin/class-bnfw-notification.php:369
324
+ #: includes/admin/class-bnfw-notification.php:1254
325
+ #: includes/admin/class-bnfw-notification.php:1407
326
+ msgid "New Comment Awaiting Moderation"
327
+ msgstr "Novo comentário aguardando moderação"
328
+
329
+ #: includes/admin/class-bnfw-notification.php:285
330
+ #: includes/admin/class-bnfw-notification.php:1251
331
+ msgid "Post - Comment Approved"
332
+ msgstr ""
333
+
334
+ #: includes/admin/class-bnfw-notification.php:288
335
+ #: includes/admin/class-bnfw-notification.php:1332
336
+ msgid "New Category"
337
+ msgstr "Nova categoria"
338
+
339
+ #: includes/admin/class-bnfw-notification.php:290
340
+ #: includes/admin/class-bnfw-notification.php:1335
341
+ msgid "New Tag"
342
+ msgstr "Nova tag"
343
+
344
+ #: includes/admin/class-bnfw-notification.php:292
345
+ #: includes/admin/class-bnfw-notification.php:1257
346
+ msgid "New Trackback"
347
+ msgstr "Novo Trackback"
348
+
349
+ #: includes/admin/class-bnfw-notification.php:294
350
+ #: includes/admin/class-bnfw-notification.php:1260
351
+ msgid "New Pingback"
352
+ msgstr "Novo Pingback"
353
+
354
+ #: includes/admin/class-bnfw-notification.php:301
355
+ #: includes/admin/class-bnfw-notification.php:1329
356
+ msgid "New Page Published"
357
+ msgstr "Nova página publicada"
358
+
359
+ #: includes/admin/class-bnfw-notification.php:303
360
+ msgid "Page Updated"
361
+ msgstr "Página atualizada"
362
+
363
+ #: includes/admin/class-bnfw-notification.php:305
364
+ msgid "Page Pending Review"
365
+ msgstr "Página aguardando revisão"
366
+
367
+ #: includes/admin/class-bnfw-notification.php:307
368
+ msgid "New Private Page"
369
+ msgstr ""
370
+
371
+ #: includes/admin/class-bnfw-notification.php:309
372
+ msgid "Page Scheduled"
373
+ msgstr "Programar página"
374
+
375
+ #: includes/admin/class-bnfw-notification.php:311
376
+ msgid "Page - New Comment"
377
+ msgstr "Página - Novo Comentário"
378
+
379
+ #: includes/admin/class-bnfw-notification.php:313
380
+ msgid "Page - New Comment Awaiting Moderation"
381
+ msgstr "Página - Novo comentário aguardando moderação"
382
+
383
+ #: includes/admin/class-bnfw-notification.php:316
384
+ #: includes/admin/class-bnfw-notification.php:1365
385
+ msgid "Page - Comment Approved"
386
+ msgstr "Página - Comentário aprovado"
387
+
388
+ #: includes/admin/class-bnfw-notification.php:319
389
+ msgid "Page - Comment Reply"
390
+ msgstr "Página - Resposta a Comentário"
391
+
392
+ #: includes/admin/class-bnfw-notification.php:326
393
+ #: includes/admin/class-bnfw-notification.php:1356
394
+ msgid "New Media Published"
395
+ msgstr "Nova mídia publicada"
396
+
397
+ #: includes/admin/class-bnfw-notification.php:328
398
+ #: includes/admin/class-bnfw-notification.php:1359
399
+ msgid "Media Updated"
400
+ msgstr "Mídia atualizada"
401
+
402
+ #: includes/admin/class-bnfw-notification.php:330
403
+ #: includes/admin/class-bnfw-notification.php:1362
404
+ msgid "Media - New Comment"
405
+ msgstr "Mídia - Novo Comentário"
406
+
407
+ #: includes/admin/class-bnfw-notification.php:332
408
+ #: includes/admin/class-bnfw-notification.php:1368
409
+ msgid "Media - Comment Approved"
410
+ msgstr ""
411
+
412
+ #: includes/admin/class-bnfw-notification.php:335
413
+ #: includes/admin/class-bnfw-notification.php:1371
414
+ msgid "Media - New Comment Awaiting Moderation"
415
+ msgstr "Mídia - Novo comentário aguardando moderação"
416
+
417
+ #: includes/admin/class-bnfw-notification.php:337
418
+ #: includes/admin/class-bnfw-notification.php:1374
419
+ msgid "Media - Comment Reply"
420
+ msgstr "Mídia - Resposta a Comentário"
421
+
422
+ #: includes/admin/class-bnfw-notification.php:355
423
+ msgid "Custom Post Type"
424
+ msgstr "Tipo de post customizado"
425
+
426
+ #: includes/admin/class-bnfw-notification.php:357
427
+ #: includes/admin/class-bnfw-notification.php:1389
428
+ msgid "New "
429
+ msgstr "Novo"
430
+
431
+ #: includes/admin/class-bnfw-notification.php:357
432
+ msgid " Published"
433
+ msgstr "Publicados"
434
+
435
+ #: includes/admin/class-bnfw-notification.php:359
436
+ msgid "Updated"
437
+ msgstr "Atualizado"
438
+
439
+ #: includes/admin/class-bnfw-notification.php:361
440
+ msgid "Pending Review"
441
+ msgstr "Revisão pendente"
442
+
443
+ #: includes/admin/class-bnfw-notification.php:363
444
+ #: includes/admin/class-bnfw-notification.php:1401
445
+ msgid "New Private "
446
+ msgstr ""
447
+
448
+ #: includes/admin/class-bnfw-notification.php:365
449
+ msgid "Scheduled"
450
+ msgstr "Programado"
451
+
452
+ #: includes/admin/class-bnfw-notification.php:372
453
+ msgid "Comment Approved"
454
+ msgstr "Comentário aprovado"
455
+
456
+ #: includes/admin/class-bnfw-notification.php:394
457
+ msgid "Custom Taxonomy"
458
+ msgstr "Taxonomia customizada"
459
+
460
+ #: includes/admin/class-bnfw-notification.php:400
461
+ msgid "New"
462
+ msgstr "Novo"
463
+
464
+ #: includes/admin/class-bnfw-notification.php:419
465
+ msgid ""
466
+ "This notification doesn't support additional email fields due to a "
467
+ "limitation in WordPress."
468
+ msgstr ""
469
+ "Esta notificação não oferece suporte a campos de e-mail adicionais devido a "
470
+ "uma limitação do WordPress."
471
+
472
+ #: includes/admin/class-bnfw-notification.php:426
473
+ msgid "Email Formatting"
474
+ msgstr "Formatar email"
475
+
476
+ #: includes/admin/class-bnfw-notification.php:427
477
+ msgid ""
478
+ "How do you want to format the sent email? HTML is recommended as it'll show "
479
+ "images and links correctly."
480
+ msgstr ""
481
+
482
+ #: includes/admin/class-bnfw-notification.php:448
483
+ msgid "Additional Email Fields"
484
+ msgstr "Campos adicionais do email"
485
+
486
+ #: includes/admin/class-bnfw-notification.php:449
487
+ msgid ""
488
+ "This should be fairly self explanatory but if you're unsure, tick this "
489
+ "checkbox and have a look at the available options. You can always untick it "
490
+ "again should you decide you don't need to use it."
491
+ msgstr ""
492
+
493
+ #: includes/admin/class-bnfw-notification.php:454
494
+ msgid "Set \"From\" Name & Email, Reply To, CC, BCC"
495
+ msgstr ""
496
+
497
+ #: includes/admin/class-bnfw-notification.php:461
498
+ msgid "From Name and Email"
499
+ msgstr "Nome do remetente do email"
500
+
501
+ #: includes/admin/class-bnfw-notification.php:462
502
+ msgid ""
503
+ "If you want to send the email from your site name and email address instead "
504
+ "of the default \"WordPress\" from \"wordpress@domain.com\", this is where "
505
+ "you can do it."
506
+ msgstr ""
507
+
508
+ #: includes/admin/class-bnfw-notification.php:466
509
+ msgid "Site Name"
510
+ msgstr ""
511
+
512
+ #: includes/admin/class-bnfw-notification.php:468
513
+ msgid "Site Email"
514
+ msgstr ""
515
+
516
+ #: includes/admin/class-bnfw-notification.php:475
517
+ msgid "Reply To"
518
+ msgstr ""
519
+
520
+ #: includes/admin/class-bnfw-notification.php:476
521
+ msgid ""
522
+ "If you want any replies to your email notification to go to another person, "
523
+ "fill in this box with their name and email address."
524
+ msgstr ""
525
+
526
+ #: includes/admin/class-bnfw-notification.php:480
527
+ msgid "Name"
528
+ msgstr ""
529
+
530
+ #: includes/admin/class-bnfw-notification.php:482
531
+ msgid "Email"
532
+ msgstr "O email"
533
+
534
+ #: includes/admin/class-bnfw-notification.php:488
535
+ msgid "CC"
536
+ msgstr "CC"
537
+
538
+ #: includes/admin/class-bnfw-notification.php:489
539
+ msgid "Publicly copy in any other users or user roles to this email."
540
+ msgstr ""
541
+
542
+ #: includes/admin/class-bnfw-notification.php:494
543
+ #: includes/admin/class-bnfw-notification.php:508
544
+ #: includes/admin/class-bnfw-notification.php:557
545
+ #: includes/admin/class-bnfw-notification.php:575
546
+ msgid "Select User Roles / Users"
547
+ msgstr "Selecione Funções de usuário / usuários"
548
+
549
+ #: includes/admin/class-bnfw-notification.php:502
550
+ msgid "BCC"
551
+ msgstr "CCO"
552
+
553
+ #: includes/admin/class-bnfw-notification.php:503
554
+ msgid "Privately copy in any other users or user roles to this email."
555
+ msgstr ""
556
+
557
+ #: includes/admin/class-bnfw-notification.php:518
558
+ msgid "Send to Author"
559
+ msgstr ""
560
+
561
+ #: includes/admin/class-bnfw-notification.php:519
562
+ msgid ""
563
+ "E.g. If you want a new post published notification to go to the post author, "
564
+ "tick this box."
565
+ msgstr ""
566
+
567
+ #: includes/admin/class-bnfw-notification.php:526
568
+ msgid "Send this notification to the Author"
569
+ msgstr "Envie esta notificação ao autor"
570
+
571
+ #: includes/admin/class-bnfw-notification.php:536
572
+ msgid ""
573
+ "E.g. If you're an editor and regularly update your posts, you might not want "
574
+ "to be emailed about this all the time. Ticking this box will prevent you "
575
+ "from receiving emails about your own changes."
576
+ msgstr ""
577
+
578
+ #: includes/admin/class-bnfw-notification.php:542
579
+ msgid "Do not send this Notification to the User that triggered it"
580
+ msgstr "Não envie esta notificação ao usuário que a acionou"
581
+
582
+ #: includes/admin/class-bnfw-notification.php:551
583
+ msgid "Send To"
584
+ msgstr "Enviar para"
585
+
586
+ #: includes/admin/class-bnfw-notification.php:552
587
+ msgid "Choose the users and/or user roles to send this email notification to."
588
+ msgstr ""
589
+
590
+ #: includes/admin/class-bnfw-notification.php:565
591
+ msgid "Except For"
592
+ msgstr ""
593
+
594
+ #: includes/admin/class-bnfw-notification.php:568
595
+ msgid ""
596
+ "Choose the users and/or user roles that this notification should not be sent "
597
+ "to."
598
+ msgstr ""
599
+
600
+ #: includes/admin/class-bnfw-notification.php:593
601
+ msgid ""
602
+ "You have chosen to send this notification to over 200 users. Please check "
603
+ "the email sending rate limit at your host before sending."
604
+ msgstr ""
605
+
606
+ #: includes/admin/class-bnfw-notification.php:603
607
+ #: includes/admin/class-bnfw-notification.php:1129
608
+ msgid "Subject"
609
+ msgstr "Assunto"
610
+
611
+ #: includes/admin/class-bnfw-notification.php:604
612
+ msgid "Notification subject. You can use "
613
+ msgstr "Assunto da notificação. Você pode usar"
614
+
615
+ #: includes/admin/class-bnfw-notification.php:604
616
+ #: includes/admin/class-bnfw-notification.php:618
617
+ msgid " here."
618
+ msgstr ""
619
+
620
+ #: includes/admin/class-bnfw-notification.php:617
621
+ msgid "Message Body"
622
+ msgstr "Corpo da mensagem"
623
+
624
+ #: includes/admin/class-bnfw-notification.php:618
625
+ msgid "Notification message. You can use "
626
+ msgstr "Mensagem de notificação. Você pode usar"
627
+
628
+ #: includes/admin/class-bnfw-notification.php:626
629
+ msgid "Need some more help?"
630
+ msgstr ""
631
+
632
+ #: includes/admin/class-bnfw-notification.php:636
633
+ msgid "Insert Default Content"
634
+ msgstr "Inserir conteúdo padrão"
635
+
636
+ #: includes/admin/class-bnfw-notification.php:640
637
+ msgid "Read Documentation"
638
+ msgstr ""
639
+
640
+ #: includes/admin/class-bnfw-notification.php:644
641
+ msgid "Find Shortcodes"
642
+ msgstr ""
643
+
644
+ #: includes/admin/class-bnfw-notification.php:655
645
+ msgid ""
646
+ "Stop additional paragraph and line break HTML from being inserted into my "
647
+ "notifications"
648
+ msgstr ""
649
+
650
+ #: includes/admin/class-bnfw-notification.php:710
651
+ msgid ""
652
+ "You must choose at least one User or User Role to send the notification to "
653
+ "before you can save"
654
+ msgstr ""
655
+
656
+ #: includes/admin/class-bnfw-notification.php:825
657
+ msgid "Test Notification Sent."
658
+ msgstr "Teste de envio da notificação."
659
+
660
+ #: includes/admin/class-bnfw-notification.php:915
661
+ msgid "Notification saved."
662
+ msgstr "Notificação salva."
663
+
664
+ #: includes/admin/class-bnfw-notification.php:934
665
+ #: includes/admin/class-bnfw-notification.php:992
666
+ #: includes/admin/class-bnfw-notification.php:994
667
+ msgid "Save"
668
+ msgstr "Salvar"
669
+
670
+ #: includes/admin/class-bnfw-notification.php:942
671
+ msgid ""
672
+ "Use this to enable or disable notifications. If you want to disable a "
673
+ "default WordPress notification, just create it on the left, then disable it "
674
+ "here."
675
+ msgstr ""
676
+
677
+ #: includes/admin/class-bnfw-notification.php:949
678
+ msgid "Notification Enabled"
679
+ msgstr "Notificação habilitada"
680
+
681
+ #: includes/admin/class-bnfw-notification.php:956
682
+ msgid "Notification Disabled"
683
+ msgstr "Notificação Desativada"
684
+
685
+ #: includes/admin/class-bnfw-notification.php:967
686
+ msgid "Send Me a Test Email"
687
+ msgstr "Envie-me um email de teste"
688
+
689
+ #: includes/admin/class-bnfw-notification.php:969
690
+ msgid ""
691
+ "This will send you (the currently logged in user) a notification so that you "
692
+ "can check for any issues with formatting – it’s doesn't mean that a "
693
+ "notification will send correctly in the future. You can read about how to "
694
+ "improve email delivery"
695
+ msgstr ""
696
+
697
+ #: includes/admin/class-bnfw-notification.php:969
698
+ msgid "here"
699
+ msgstr ""
700
+
701
+ #: includes/admin/class-bnfw-notification.php:969
702
+ msgid ". Shortcodes will not be replaced with content."
703
+ msgstr ""
704
+
705
+ #: includes/admin/class-bnfw-notification.php:980
706
+ msgid "Delete Permanently"
707
+ msgstr "Excluir permanente"
708
+
709
+ #: includes/admin/class-bnfw-notification.php:982
710
+ msgid "Move to Trash"
711
+ msgstr "Enviar para lixeira"
712
+
713
+ #: includes/admin/class-bnfw-notification.php:1127
714
+ msgid "Notification Type"
715
+ msgstr "Tipo de notificação"
716
+
717
+ #: includes/admin/class-bnfw-notification.php:1128
718
+ msgid "Enabled?"
719
+ msgstr "Ativado?"
720
+
721
+ #: includes/admin/class-bnfw-notification.php:1130
722
+ msgid "User Roles / Users"
723
+ msgstr "Funções de usuário / Usuários"
724
+
725
+ #: includes/admin/class-bnfw-notification.php:1131
726
+ msgid "Excluded User Roles / Users"
727
+ msgstr "Funções de usuário / usuários excluídos"
728
+
729
+ #: includes/admin/class-bnfw-notification.php:1172
730
+ msgid ", Post Author"
731
+ msgstr ""
732
+
733
+ #: includes/admin/class-bnfw-notification.php:1338
734
+ msgid "Privacy – Confirm Action: Export Data Request – For User"
735
+ msgstr ""
736
+
737
+ #: includes/admin/class-bnfw-notification.php:1341
738
+ msgid "Privacy – Confirm Action: Erase Data Request – For User"
739
+ msgstr ""
740
+
741
+ #: includes/admin/class-bnfw-notification.php:1389
742
+ msgid "Published"
743
+ msgstr "Publicados"
744
+
745
+ #: includes/admin/class-bnfw-notification.php:1392
746
+ msgid "Updated "
747
+ msgstr "Atualizar"
748
+
749
+ #: includes/admin/class-bnfw-notification.php:1395
750
+ msgid " Pending Review"
751
+ msgstr "Revisão pendente"
752
+
753
+ #: includes/admin/class-bnfw-notification.php:1398
754
+ msgid " Scheduled"
755
+ msgstr "Programado"
756
+
757
+ #: includes/admin/class-bnfw-notification.php:1404
758
+ msgid " Comment"
759
+ msgstr "Comentário"
760
+
761
+ #: includes/admin/class-bnfw-notification.php:1410
762
+ msgid " Comment Reply"
763
+ msgstr "Comentário Responder"
764
+
765
+ #: includes/admin/class-bnfw-notification.php:1413
766
+ msgid " Comment Approved"
767
+ msgstr "Comentário aprovado"
768
+
769
+ #: includes/admin/class-bnfw-notification.php:1418
770
+ msgid "New Term"
771
+ msgstr "Novo termo"
772
+
773
+ #: includes/admin/class-bnfw-notification.php:1420
774
+ msgid "New Term in "
775
+ msgstr "Novo termo em"
776
+
777
+ #: includes/admin/class-bnfw-notification.php:1440
778
+ msgid "Enable Notifications"
779
+ msgstr "Ativar notificações"
780
+
781
+ #: includes/admin/class-bnfw-notification.php:1441
782
+ msgid "Disable Notifications"
783
+ msgstr "Desativar as notificações"
784
+
785
+ #: includes/admin/class-bnfw-notification.php:1502
786
+ msgid "Enable Notification"
787
+ msgstr "Desabilitar notificação"
788
+
789
+ #: includes/admin/class-bnfw-notification.php:1510
790
+ msgid "Disable Notification"
791
+ msgstr "Desabilitar notificação"
792
+
793
+ #: includes/admin/class-bnfw-notification.php:1568
794
+ msgid "Enabled 1 Notification."
795
+ msgstr "Ativado 1 notificação."
796
+
797
+ #: includes/admin/class-bnfw-notification.php:1572
798
+ msgid "Disabled 1 Notification."
799
+ msgstr "Desativado 1 notificação."
800
+
801
+ #: includes/admin/class-bnfw-notification.php:1578
802
+ #, php-format
803
+ msgid "Enabled %s Notification."
804
+ msgid_plural "Enabled %s Notifications."
805
+ msgstr[0] "Notificação%s habilitada."
806
+ msgstr[1] "Ativou%s Notificações."
807
+
808
+ #: includes/admin/class-bnfw-notification.php:1588
809
+ #, php-format
810
+ msgid "Disabled %s Notification."
811
+ msgid_plural "Disabled %s Notifications."
812
+ msgstr[0] "Notificação%s desativada."
813
+ msgstr[1] "Notificações de%s desativadas."
814
+
815
+ #: includes/admin/class-bnfw-notification.php:1602
816
+ msgid ""
817
+ "If you send out notifications with BNFW but don't receive them, you may need "
818
+ "to install an SMTP plugin to <a href=\"https://betternotificationsforwp.com/"
819
+ "documentation/getting-started/how-to-improve-email-delivery/\" target="
820
+ "\"_blank\">improve email deliverability</a>. I recommend using <a href="
821
+ "\"https://wordpress.org/plugins/post-smtp/\" target=\"_blank\">Post SMTP</a> "
822
+ "as it's easy to set-up or <a href=\"https://wordpress.org/plugins/email-log/"
823
+ "\" target=\"_blank\">Email Log</a> to just log and view emails that are sent."
824
+ msgstr ""
825
+
826
+ #: includes/engine/class-bnfw-engine.php:18
827
+ msgid "Test Email:"
828
+ msgstr "Email de teste:"
829
+
830
+ #: includes/engine/class-bnfw-engine.php:19
831
+ msgid ""
832
+ "This is a test email. All shortcodes below will show in place but not be "
833
+ "replaced with content."
834
+ msgstr ""
835
+
836
+ #: includes/engine/class-bnfw-engine.php:1583
837
+ msgid "Error: Download link is not available please contact support"
838
+ msgstr ""
839
+
840
+ #: includes/helpers/ajax-helpers.php:34 includes/helpers/helpers.php:38
841
+ msgid "User Roles"
842
+ msgstr "Funções do usuário"
843
+
844
+ #: includes/helpers/ajax-helpers.php:57 includes/helpers/helpers.php:59
845
+ #: includes/helpers/helpers.php:64
846
+ msgid "Users"
847
+ msgstr ""
848
+
849
+ #: includes/helpers/helpers.php:103
850
+ msgid "Non WordPress Users"
851
+ msgstr ""
852
+
853
+ #: includes/import.php:69
854
+ msgid " for "
855
+ msgstr "para"
856
+
857
+ #: includes/import.php:69
858
+ msgid " (Auto Imported)"
859
+ msgstr "(Importado automático)"
860
+
861
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:228
862
+ #, php-format
863
+ msgid ""
864
+ "There is a new version of %1$s available. %2$sView version %3$s details%4$s."
865
+ msgstr ""
866
+
867
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:236
868
+ #, php-format
869
+ msgid ""
870
+ "There is a new version of %1$s available. %2$sView version %3$s details%4$s "
871
+ "or %5$supdate now%6$s."
872
+ msgstr ""
873
+
874
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:474
875
+ msgid "You do not have permission to install plugin updates"
876
+ msgstr ""
877
+
878
+ #: includes/libraries/EDD_SL_Plugin_Updater.php:474
879
+ msgid "Error"
880
+ msgstr ""
881
+
882
+ #: includes/license/class-bnfw-license-setting.php:18
883
+ #: includes/license/class-bnfw-license-setting.php:19
884
+ msgid "Add-on Licenses"
885
+ msgstr ""
886
+
887
+ #: includes/license/class-bnfw-license-setting.php:38
888
+ msgid "BNFW Add-on Licenses"
889
+ msgstr ""
890
+
891
+ #: includes/license/class-bnfw-license-setting.php:47
892
+ msgid "Save License"
893
+ msgstr ""
894
+
895
+ #: includes/license/class-bnfw-license-setting.php:55
896
+ msgid ""
897
+ "<br>You have no BNFW Premium Add-ons installed yet.<br>You can buy add-ons "
898
+ "from the <a href=\""
899
+ msgstr ""
900
+
901
+ #: includes/license/class-bnfw-license-setting.php:130
902
+ msgid "Deactivate License"
903
+ msgstr ""
904
+
905
+ #: includes/license/class-bnfw-license.php:140
906
+ #, php-format
907
+ msgid "%1$s License Key"
908
+ msgstr ""
909
+
910
+ #: includes/overrides.php:41 includes/overrides.php:135
911
+ #, php-format
912
+ msgid "New user registration on your site %s:"
913
+ msgstr "Novo registro de usuário em seu site %s:"
914
+
915
+ #: includes/overrides.php:42 includes/overrides.php:117
916
+ #: includes/overrides.php:136 includes/overrides.php:152
917
+ #, php-format
918
+ msgid "Username: %s"
919
+ msgstr "Usuário: %s"
920
+
921
+ #: includes/overrides.php:43 includes/overrides.php:137
922
+ #, php-format
923
+ msgid "E-mail: %s"
924
+ msgstr "Email: %s"
925
+
926
+ #. translators: Password change notification email subject. %s: Site title
927
+ #: includes/overrides.php:48 includes/overrides.php:139
928
+ #, php-format
929
+ msgid "[%s] New User Registration"
930
+ msgstr "[%s] Novo Registro de Usuário"
931
+
932
+ #: includes/overrides.php:118
933
+ msgid "To set your password, visit the following address:"
934
+ msgstr ""
935
+
936
+ #: includes/overrides.php:123
937
+ #, php-format
938
+ msgid "[%s] Your username and password info"
939
+ msgstr "[%s] Informações do seu nome de usuário e senha"
940
+
941
+ #: includes/overrides.php:153
942
+ #, php-format
943
+ msgid "Password: %s"
944
+ msgstr "Senha: %s"
945
+
946
+ #: includes/overrides.php:156
947
+ #, php-format
948
+ msgid "[%s] Your username and password"
949
+ msgstr "[%s] O seu nome de usuário e senha"
950
+
951
+ #. translators: %s: user name
952
+ #: includes/overrides.php:184
953
+ #, php-format
954
+ msgid "Password changed for user: %s"
955
+ msgstr "Senha alterada para o usuário:%s"
956
+
957
+ #. translators: %s: site title
958
+ #: includes/overrides.php:189
959
+ #, php-format
960
+ msgid "[%s] Password Changed"
961
+ msgstr ""
962
+
963
+ #. Plugin Name of the plugin/theme
964
+ msgid "Better Notifications for WP"
965
+ msgstr "Melhores notificações para WordPress"
966
+
967
+ #. Plugin URI of the plugin/theme
968
+ #, fuzzy
969
+ #| msgid "http://wordpress.org/plugins/bnfw/"
970
+ msgid "https://wordpress.org/plugins/bnfw/"
971
+ msgstr "http://wordpress.org/plugins/bnfw/"
972
+
973
+ #. Description of the plugin/theme
974
+ msgid ""
975
+ "Supercharge your WordPress notifications using a WYSIWYG editor and "
976
+ "shortcodes. Default and new notifications available. Add more power with Add-"
977
+ "ons."
978
+ msgstr ""
979
+
980
+ #. Author of the plugin/theme
981
+ msgid "Made with Fuel"
982
+ msgstr "Made with Fuel"
983
+
984
+ #. Author URI of the plugin/theme
985
+ msgid "https://madewithfuel.com/"
986
+ msgstr ""
987
+
988
+ #~ msgid "New User - Welcome Email"
989
+ #~ msgstr "Novo Usuário - Email de boas vindas"
990
+
991
+ #~ msgid "Update "
992
+ #~ msgstr "Atualizar"
993
+
994
+ #~ msgid "Show additional email fields"
995
+ #~ msgstr "Mostrar campos adicionais do email"
996
+
997
+ #~ msgid ""
998
+ #~ "Looking for help with shortcodes? Click here to see which ones you can "
999
+ #~ "use with the selected notification."
1000
+ #~ msgstr ""
1001
+ #~ "Precisando de ajuda com códigos de acesso? Clique aqui para ver qual "
1002
+ #~ "deles você pode usar com a notificação selecionada."
1003
+
1004
+ #~ msgid "New User - Welcome email"
1005
+ #~ msgstr "Novo usuário - Email de boas vindas"
1006
+
1007
+ #~ msgid ""
1008
+ #~ "Send customisable HTML emails to your users for different WordPress "
1009
+ #~ "notifications."
1010
+ #~ msgstr ""
1011
+ #~ "Enviar emails HTML com notificações personalizáveis para usuários "
1012
+ #~ "diferentes do WordPress."
1013
+
1014
+ #~ msgid "https://betternotificationsforwp.com/"
1015
+ #~ msgstr "https://betternotificationsforwp.com/"
languages/bnfw.pot CHANGED
File without changes
vendor/persist-admin-notices-dismissal/CHANGES.md CHANGED
File without changes
vendor/persist-admin-notices-dismissal/README.md CHANGED
File without changes
vendor/persist-admin-notices-dismissal/composer.json CHANGED
File without changes
vendor/persist-admin-notices-dismissal/dismiss-notice.js CHANGED
@@ -1,34 +1,34 @@
1
- (function ($) {
2
- //shorthand for ready event.
3
- $(
4
- function () {
5
- $( 'div[data-dismissible] button.notice-dismiss, div[data-dismissible] .dismiss-this' ).on("click",
6
- function (event) {
7
- event.preventDefault();
8
- var $this = $( this );
9
-
10
- var attr_value, option_name, dismissible_length, data;
11
-
12
- attr_value = $this.closest("div[data-dismissible]").attr( 'data-dismissible' ).split( '-' );
13
-
14
- // remove the dismissible length from the attribute value and rejoin the array.
15
- dismissible_length = attr_value.pop();
16
-
17
- option_name = attr_value.join( '-' );
18
-
19
- data = {
20
- 'action': 'dismiss_admin_notice',
21
- 'option_name': option_name,
22
- 'dismissible_length': dismissible_length,
23
- 'nonce': dismissible_notice.nonce
24
- };
25
-
26
- // We can also pass the url value separately from ajaxurl for front end AJAX implementations
27
- $.post( ajaxurl, data );
28
- $this.closest("div[data-dismissible]").hide('slow');
29
- }
30
- );
31
- }
32
- )
33
-
34
- }(jQuery));
1
+ (function ($) {
2
+ //shorthand for ready event.
3
+ $(
4
+ function () {
5
+ $( 'div[data-dismissible] button.notice-dismiss, div[data-dismissible] .dismiss-this' ).on("click",
6
+ function (event) {
7
+ event.preventDefault();
8
+ var $this = $( this );
9
+
10
+ var attr_value, option_name, dismissible_length, data;
11
+
12
+ attr_value = $this.closest("div[data-dismissible]").attr( 'data-dismissible' ).split( '-' );
13
+
14
+ // remove the dismissible length from the attribute value and rejoin the array.
15
+ dismissible_length = attr_value.pop();
16
+
17
+ option_name = attr_value.join( '-' );
18
+
19
+ data = {
20
+ 'action': 'dismiss_admin_notice',
21
+ 'option_name': option_name,
22
+ 'dismissible_length': dismissible_length,
23
+ 'nonce': dismissible_notice.nonce
24
+ };
25
+
26
+ // We can also pass the url value separately from ajaxurl for front end AJAX implementations
27
+ $.post( ajaxurl, data );
28
+ $this.closest("div[data-dismissible]").hide('slow');
29
+ }
30
+ );
31
+ }
32
+ )
33
+
34
+ }(jQuery));
vendor/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php CHANGED
@@ -1,187 +1,187 @@
1
- <?php
2
- /**
3
- * Persist Admin notices Dismissal
4
- *
5
- * Copyright (C) 2016 Collins Agbonghama <https://w3guy.com>
6
- *
7
- * This program is free software: you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation, either version 3 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
19
- *
20
- * @package Persist Admin notices Dismissal
21
- * @author Collins Agbonghama, Andy Fragen
22
- * @license http://www.gnu.org/licenses GNU General Public License
23
- */
24
-
25
- /**
26
- * Exit if called directly.
27
- */
28
- if ( ! defined( 'ABSPATH' ) ) {
29
- die;
30
- }
31
-
32
- if ( ! class_exists( 'PAnD' ) ) {
33
-
34
- /**
35
- * Class PAnD
36
- */
37
- class PAnD {
38
-
39
- /**
40
- * Init hooks.
41
- */
42
- public static function init() {
43
- add_action( 'admin_enqueue_scripts', array( __CLASS__, 'load_script' ) );
44
- add_action( 'wp_ajax_dismiss_admin_notice', array( __CLASS__, 'dismiss_admin_notice' ) );
45
-
46
- /**
47
- * Filter to activate another filter providing a simpler use case.
48
- *
49
- * @since 1.4.3
50
- *
51
- * @param bool
52
- */
53
- if ( apply_filters( 'pand_theme_loader', false ) ) {
54
- add_filter(
55
- 'pand_dismiss_notice_js_url',
56
- function( $js_url, $composer_path ) {
57
- return get_stylesheet_directory_uri() . $composer_path;
58
- },
59
- 10,
60
- 2
61
- );
62
- }
63
- }
64
-
65
- /**
66
- * Enqueue javascript and variables.
67
- */
68
- public static function load_script() {
69
-
70
- if ( is_customize_preview() ) {
71
- return;
72
- }
73
-
74
- $js_url = plugins_url( 'dismiss-notice.js', __FILE__ );
75
- $composer_path = '/vendor/collizo4sky/persist-admin-notices-dismissal/dismiss-notice.js';
76
-
77
- /**
78
- * Filter dismiss-notice.js URL.
79
- *
80
- * @since 1.4.3
81
- *
82
- * @param string $js_url URL to the Javascript file.
83
- * @param string $composer_path Relative path of Javascript file from composer install.
84
- */
85
- $js_url = apply_filters( 'pand_dismiss_notice_js_url', $js_url, $composer_path );
86
- wp_enqueue_script(
87
- 'dismissible-notices',
88
- $js_url,
89
- array( 'jquery', 'common' ),
90
- false,
91
- true
92
- );
93
-
94
- wp_localize_script(
95
- 'dismissible-notices',
96
- 'dismissible_notice',
97
- array(
98
- 'nonce' => wp_create_nonce( 'dismissible-notice' ),
99
- )
100
- );
101
- }
102
-
103
- /**
104
- * Handles Ajax request to persist notices dismissal.
105
- * Uses check_ajax_referer to verify nonce.
106
- */
107
- public static function dismiss_admin_notice() {
108
- $option_name = isset( $_POST['option_name'] ) ? sanitize_text_field( wp_unslash( $_POST['option_name'] ) ) : '';
109
- $dismissible_length = isset( $_POST['dismissible_length'] ) ? sanitize_text_field( wp_unslash( $_POST['dismissible_length'] ) ) : 0;
110
-
111
- if ( 'forever' !== $dismissible_length ) {
112
- // If $dismissible_length is not an integer default to 1.
113
- $dismissible_length = ( 0 === absint( $dismissible_length ) ) ? 1 : $dismissible_length;
114
- $dismissible_length = strtotime( absint( $dismissible_length ) . ' days' );
115
- }
116
-
117
- check_ajax_referer( 'dismissible-notice', 'nonce' );
118
- self::set_admin_notice_cache( $option_name, $dismissible_length );
119
- wp_die();
120
- }
121
-
122
- /**
123
- * Is admin notice active?
124
- *
125
- * @param string $arg data-dismissible content of notice.
126
- *
127
- * @return bool
128
- */
129
- public static function is_admin_notice_active( $arg ) {
130
- $array = explode( '-', $arg );
131
- $length = array_pop( $array );
132
- $option_name = implode( '-', $array );
133
- $db_record = self::get_admin_notice_cache( $option_name );
134
-
135
- if ( 'forever' === $db_record ) {
136
- return false;
137
- } elseif ( absint( $db_record ) >= time() ) {
138
- return false;
139
- } else {
140
- return true;
141
- }
142
- }
143
-
144
- /**
145
- * Returns admin notice cached timeout.
146
- *
147
- * @access public
148
- *
149
- * @param string|bool $id admin notice name or false.
150
- *
151
- * @return array|bool The timeout. False if expired.
152
- */
153
- public static function get_admin_notice_cache( $id = false ) {
154
- if ( ! $id ) {
155
- return false;
156
- }
157
- $cache_key = 'pand-' . md5( $id );
158
- $timeout = get_site_option( $cache_key );
159
- $timeout = 'forever' === $timeout ? time() + 60 : $timeout;
160
-
161
- if ( empty( $timeout ) || time() > $timeout ) {
162
- return false;
163
- }
164
-
165
- return $timeout;
166
- }
167
-
168
- /**
169
- * Sets admin notice timeout in site option.
170
- *
171
- * @access public
172
- *
173
- * @param string $id Data Identifier.
174
- * @param string|bool $timeout Timeout for admin notice.
175
- *
176
- * @return bool
177
- */
178
- public static function set_admin_notice_cache( $id, $timeout ) {
179
- $cache_key = 'pand-' . md5( $id );
180
- update_site_option( $cache_key, $timeout );
181
-
182
- return true;
183
- }
184
-
185
- }
186
-
187
- }
1
+ <?php
2
+ /**
3
+ * Persist Admin notices Dismissal
4
+ *
5
+ * Copyright (C) 2016 Collins Agbonghama <https://w3guy.com>
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
19
+ *
20
+ * @package Persist Admin notices Dismissal
21
+ * @author Collins Agbonghama, Andy Fragen
22
+ * @license http://www.gnu.org/licenses GNU General Public License
23
+ */
24
+
25
+ /**
26
+ * Exit if called directly.
27
+ */
28
+ if ( ! defined( 'ABSPATH' ) ) {
29
+ die;
30
+ }
31
+
32
+ if ( ! class_exists( 'PAnD' ) ) {
33
+
34
+ /**
35
+ * Class PAnD
36
+ */
37
+ class PAnD {
38
+
39
+ /**
40
+ * Init hooks.
41
+ */
42
+ public static function init() {
43
+ add_action( 'admin_enqueue_scripts', array( __CLASS__, 'load_script' ) );
44
+ add_action( 'wp_ajax_dismiss_admin_notice', array( __CLASS__, 'dismiss_admin_notice' ) );
45
+
46
+ /**
47
+ * Filter to activate another filter providing a simpler use case.
48
+ *
49
+ * @since 1.4.3
50
+ *
51
+ * @param bool
52
+ */
53
+ if ( apply_filters( 'pand_theme_loader', false ) ) {
54
+ add_filter(
55
+ 'pand_dismiss_notice_js_url',
56
+ function( $js_url, $composer_path ) {
57
+ return get_stylesheet_directory_uri() . $composer_path;
58
+ },
59
+ 10,
60
+ 2
61
+ );
62
+ }
63
+ }
64
+
65
+ /**
66
+ * Enqueue javascript and variables.
67
+ */
68
+ public static function load_script() {
69
+
70
+ if ( is_customize_preview() ) {
71
+ return;
72
+ }
73
+
74
+ $js_url = plugins_url( 'dismiss-notice.js', __FILE__ );
75
+ $composer_path = '/vendor/collizo4sky/persist-admin-notices-dismissal/dismiss-notice.js';
76
+
77
+ /**
78
+ * Filter dismiss-notice.js URL.
79
+ *
80
+ * @since 1.4.3
81
+ *
82
+ * @param string $js_url URL to the Javascript file.
83
+ * @param string $composer_path Relative path of Javascript file from composer install.
84
+ */
85
+ $js_url = apply_filters( 'pand_dismiss_notice_js_url', $js_url, $composer_path );
86
+ wp_enqueue_script(
87
+ 'dismissible-notices',
88
+ $js_url,
89
+ array( 'jquery', 'common' ),
90
+ false,
91
+ true
92
+ );
93
+
94
+ wp_localize_script(
95
+ 'dismissible-notices',
96
+ 'dismissible_notice',
97
+ array(
98
+ 'nonce' => wp_create_nonce( 'dismissible-notice' ),
99
+ )
100
+ );
101
+ }
102
+
103
+ /**
104
+ * Handles Ajax request to persist notices dismissal.
105
+ * Uses check_ajax_referer to verify nonce.
106
+ */
107
+ public static function dismiss_admin_notice() {
108
+ $option_name = isset( $_POST['option_name'] ) ? sanitize_text_field( wp_unslash( $_POST['option_name'] ) ) : '';
109
+ $dismissible_length = isset( $_POST['dismissible_length'] ) ? sanitize_text_field( wp_unslash( $_POST['dismissible_length'] ) ) : 0;
110
+
111
+ if ( 'forever' !== $dismissible_length ) {
112
+ // If $dismissible_length is not an integer default to 1.
113
+ $dismissible_length = ( 0 === absint( $dismissible_length ) ) ? 1 : $dismissible_length;
114
+ $dismissible_length = strtotime( absint( $dismissible_length ) . ' days' );
115
+ }
116
+
117
+ check_ajax_referer( 'dismissible-notice', 'nonce' );
118
+ self::set_admin_notice_cache( $option_name, $dismissible_length );
119
+ wp_die();
120
+ }
121
+
122
+ /**
123
+ * Is admin notice active?
124
+ *
125
+ * @param string $arg data-dismissible content of notice.
126
+ *
127
+ * @return bool
128
+ */
129
+ public static function is_admin_notice_active( $arg ) {
130
+ $array = explode( '-', $arg );
131
+ $length = array_pop( $array );
132
+ $option_name = implode( '-', $array );
133
+ $db_record = self::get_admin_notice_cache( $option_name );
134
+
135
+ if ( 'forever' === $db_record ) {
136
+ return false;
137
+ } elseif ( absint( $db_record ) >= time() ) {
138
+ return false;
139
+ } else {
140
+ return true;
141
+ }
142
+ }
143
+
144
+ /**
145
+ * Returns admin notice cached timeout.
146
+ *
147
+ * @access public
148
+ *
149
+ * @param string|bool $id admin notice name or false.
150
+ *
151
+ * @return array|bool The timeout. False if expired.
152
+ */
153
+ public static function get_admin_notice_cache( $id = false ) {
154
+ if ( ! $id ) {
155
+ return false;
156
+ }
157
+ $cache_key = 'pand-' . md5( $id );
158
+ $timeout = get_site_option( $cache_key );
159
+ $timeout = 'forever' === $timeout ? time() + 60 : $timeout;
160
+
161
+ if ( empty( $timeout ) || time() > $timeout ) {
162
+ return false;
163
+ }
164
+
165
+ return $timeout;
166
+ }
167
+
168
+ /**
169
+ * Sets admin notice timeout in site option.
170
+ *
171
+ * @access public
172
+ *
173
+ * @param string $id Data Identifier.
174
+ * @param string|bool $timeout Timeout for admin notice.
175
+ *
176
+ * @return bool
177
+ */
178
+ public static function set_admin_notice_cache( $id, $timeout ) {
179
+ $cache_key = 'pand-' . md5( $id );
180
+ update_site_option( $cache_key, $timeout );
181
+
182
+ return true;
183
+ }
184
+
185
+ }
186
+
187
+ }