Crowdsignal Dashboard – Polls, Surveys & more - Version 3.0.4

Version Description

  • Added missing files that should have been in the previous release.
Download this release

Release Info

Developer donncha
Plugin Icon 128x128 Crowdsignal Dashboard – Polls, Surveys & more
Version 3.0.4
Comparing to
See all releases

Code changes from version 3.0.1 to 3.0.4

admin-styles.css ADDED
@@ -0,0 +1,412 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: Recoleta;
3
+ src: url( "https://s1.wp.com/i/fonts/recoleta/400.woff2" );
4
+ }
5
+
6
+ @font-face {
7
+ font-family: Recoleta;
8
+ src: url( "https://s1.wp.com/i/fonts/recoleta/500.woff2" );
9
+ font-weight: 500;
10
+ }
11
+
12
+ @font-face {
13
+ font-family: Recoleta;
14
+ src: url( "https://s1.wp.com/i/fonts/recoleta/700.woff2" );
15
+ font-weight: 700;
16
+ }
17
+
18
+ #jp-plugin-container .wrap {
19
+ margin: 0 auto;
20
+ max-width:45rem;
21
+ padding: 0 1.5rem;
22
+ }
23
+ #jp-plugin-container.is-wide .wrap {
24
+ max-width: 1040px;
25
+ }
26
+ #jp-plugin-container .wrap .jetpack-wrap-container {
27
+ margin-top: 1em;
28
+ }
29
+
30
+ .wp-admin #dolly {
31
+ float: none;
32
+ position: relative;
33
+ right: 0;
34
+ left: 0;
35
+ top: 0;
36
+ padding: .625rem;
37
+ text-align: right;
38
+ background: #fff;
39
+ font-size: .75rem;
40
+ font-style: italic;
41
+ color: #87a6bc;
42
+ border-bottom: 1px #e9eff3 solid;
43
+ }
44
+
45
+ .crowdsignal-setup__header {
46
+ background-color: #fff;
47
+ text-align: center;
48
+ box-shadow: 0 1px 0 #ccd0d4,0 1px 1px 1px rgba(0,0,0,0.04);
49
+ margin-left: -20px;
50
+ margin-right: -20px;
51
+ margin-bottom: 8px;
52
+ }
53
+
54
+ .crowdsignal-setup__header-container {
55
+ display: flex;
56
+ flex-wrap: wrap;
57
+ padding-bottom: .375rem;
58
+ padding-left: 16px;
59
+ }
60
+
61
+ .crowdsignal-settings-wrap {
62
+ max-width: 960px;
63
+ margin: 0 auto;
64
+ }
65
+
66
+ .crowdsignal-setup__logo-container {
67
+ flex-grow: 0;
68
+ flex-shrink: 0;
69
+ padding: .6875rem 0 0;
70
+ display: inline-block;
71
+ }
72
+
73
+ .crowdsignal-setup__email-activation {
74
+ font-size: 16px !important;
75
+ font-style: italic;
76
+ }
77
+
78
+ .crowdsignal-setup__footer {
79
+ text-align: center;
80
+ margin: 100px -20px 2rem;
81
+ }
82
+
83
+ .crowdsignal-setup__footer-container {
84
+ margin-bottom: .5rem;
85
+ }
86
+
87
+ .crowdsignal-setup__footer-attr {
88
+ width: 11.25rem;
89
+ }
90
+
91
+ .crowdsignal-setup__footer-links {
92
+ border-top: 1px #e1e1e1 solid;
93
+ border-bottom: 1px #e1e1e1 solid;
94
+ margin-top: 0;
95
+ margin-bottom: 1rem;
96
+ }
97
+
98
+ .crowdsignal-setup__footer-item {
99
+ display: inline-block;
100
+ margin-bottom: 0;
101
+ }
102
+
103
+ .crowdsignal-setup__footer-link {
104
+ padding: 1rem .5rem;
105
+ color: #888;
106
+ display: inline-block;
107
+ cursor: pointer;
108
+ }
109
+
110
+ .crowdsignal-setup__main {
111
+ background-color: #fff;
112
+ display: flex;
113
+ flex-direction: column;
114
+ align-content: center;
115
+ margin: 24px auto 0;
116
+ border: 1px solid rgba(213, 213, 213, 0.5);
117
+ max-width: 960px;
118
+ }
119
+
120
+ .crowdsignal-setup__main img {
121
+ width: 100%;
122
+ height: auto;
123
+ max-height: 150px;
124
+ }
125
+
126
+ .crowdsignal-setup__content {
127
+ padding: 0 20px 20px;
128
+ text-align: center;
129
+ display: flex;
130
+ flex-direction: column;
131
+ justify-content: space-around;
132
+ min-height: 400px;
133
+ margin: 40px 0;
134
+ }
135
+
136
+ .crowdsignal-setup__content p {
137
+ font-size: 18px;
138
+ max-width: 800px;
139
+ margin: 0 auto;
140
+ }
141
+
142
+ .dops-card h3,
143
+ .dops-card h4 {
144
+ font-family: Recoleta, sans-serif;
145
+ font-weight: 700;
146
+ font-size: 20px;
147
+ line-height: 150%;
148
+ margin: 0;
149
+ margin: 0 0 10px 0;
150
+ }
151
+
152
+ .crowdsignal-setup__content h4 {
153
+ font-size: 34px;
154
+ line-height: 140%;
155
+ }
156
+
157
+ .crowdsignal-setup__button {
158
+ margin: 0 auto;
159
+ background-color: #c9356e;
160
+ border-color: #8c1749;
161
+ color: #ffffff;
162
+ font-weight: 500;
163
+ align-items: center;
164
+ border-radius: 5px;
165
+ border-style: solid;
166
+ border-width: 1px 1px 2px;
167
+ box-sizing: border-box;
168
+ cursor: pointer;
169
+ display: inline-flex;
170
+ font-size: 14px;
171
+ height: 32px;
172
+ justify-content: center;
173
+ line-height: 24px;
174
+ outline: 0;
175
+ padding: 3px 15px 2px;
176
+ text-align: center;
177
+ transition: background-color .1s ease-out, border-color .1s ease-out;
178
+ white-space: nowrap;
179
+ width: fit-content;
180
+ min-width: 200px;
181
+ }
182
+
183
+ .crowdsignal-setup__button:hover {
184
+ background-color: #eb6594;
185
+ }
186
+
187
+ .crowdsignal-setup__support {
188
+ font-size: 14px;
189
+ }
190
+
191
+ .crowdsignal-setup__top {
192
+ margin-top: 32px;
193
+ }
194
+
195
+ .crowdsignal-setup__middle {
196
+ min-height: 100px;
197
+ margin-right: auto;
198
+ margin-left: auto;
199
+ padding-left: 0px;
200
+ border: 1px none #000;
201
+ border-radius: 0px;
202
+ margin-top: 40px;
203
+ }
204
+
205
+ .crowdsignal-setup__middle p {
206
+ color: #838383;
207
+ }
208
+
209
+ .crowdsignal-setup__middle a {
210
+
211
+ }
212
+
213
+ .crowdsignal-setup__video-container {
214
+ display: block;
215
+ overflow: hidden;
216
+ position: relative;
217
+ margin-top: 64px;
218
+ margin-bottom: 120px;
219
+ padding-top: 56.25%;
220
+ width: 100%;
221
+ }
222
+
223
+ .crowdsignal-setup__video {
224
+ position: absolute;
225
+ top: 0;
226
+ left: 0;
227
+ bottom: 0;
228
+ right: 0;
229
+ width: 100%;
230
+ height: 100%;
231
+ background-color: #e2e2e2;
232
+ }
233
+
234
+ .crowdsignal-setup__video iframe {
235
+ width: 100%;
236
+ height: 100%;
237
+ }
238
+
239
+
240
+ div.crowdsignal-message {
241
+ margin: 24px auto 8px auto;
242
+ border: 0;
243
+ padding: 16px;
244
+ padding-left: 24px;
245
+ max-width: 1040px;
246
+ box-sizing: border-box;
247
+ }
248
+
249
+ div.updated.crowdsignal-message {
250
+ background-color: #eff9f1;
251
+ }
252
+ div.error.crowdsignal-message {
253
+ background-color: #fbcfd2;
254
+ }
255
+ div.updated.crowdsignal-message p,
256
+ div.error.crowdsignal-message p {
257
+ padding: 0;
258
+ color: black;
259
+ font-size: 14px;
260
+ line-height: 22px;
261
+ margin: 4px 0px;
262
+ }
263
+
264
+ .crowdsignal-message .crowdsignal-notification-icon {
265
+ display: inline-block;
266
+ vertical-align: text-bottom;
267
+ margin-right: 16px;
268
+ line-height: 0;
269
+ height: 22px;
270
+ }
271
+
272
+ .crowdsignal-settings__main-content {
273
+ }
274
+
275
+ .dops-card {
276
+ display: block;
277
+ position: relative;
278
+ margin: 0 auto 10px;
279
+ padding: 16px;
280
+ box-sizing: border-box;
281
+ background: #fff;
282
+ box-shadow: 0 0 0 1px #ccd0d4,0 1px 1px 1px rgba(0,0,0,.04);
283
+ }
284
+
285
+ .dops-card.is-compact {
286
+ margin-bottom: 1px;
287
+ padding: 16px 24px;
288
+ }
289
+
290
+ .dops-section-header.dops-card {
291
+ display: flex;
292
+ flex-wrap: wrap;
293
+ padding-top: .6875rem;
294
+ padding-bottom: .6875rem;
295
+ position: relative;
296
+ }
297
+
298
+ .dops-section-header__label {
299
+ line-height: 1.75rem;
300
+ color: #414141;
301
+ font-size: .875rem;
302
+ }
303
+
304
+ .dops-section-header__label-text {
305
+ position: relative;
306
+ margin-right: .5rem;
307
+ white-space: nowrap;
308
+ overflow: hidden;
309
+ width: 100%;
310
+ padding-right: .5rem;
311
+ min-width: 0;
312
+ font-weight: 400;
313
+ color: #3C434A;
314
+ }
315
+
316
+ .crowdsignal-settings__middle {
317
+ min-height: 100px;
318
+ padding-left: 0px;
319
+ border: 1px none #000;
320
+ border-radius: 0px;
321
+ }
322
+
323
+ .crowdsignal-settings__text {
324
+ margin-top: 40px;
325
+ line-height: 150%;
326
+ font-size: 14px;
327
+ line-height: 30px;
328
+ color: #444444;
329
+ }
330
+
331
+ .crowdsignal-settings__bottom {
332
+ margin-top: 80px;
333
+ }
334
+
335
+ .crowdsignal-settings__submit {
336
+ margin-top: 10px;
337
+ }
338
+
339
+ @media screen and (min-width: 782px) {
340
+ .crowdsignal-settings__submit {
341
+ margin-top: -45px;
342
+ display: block;
343
+ margin-left: 585px;
344
+ }
345
+ }
346
+
347
+ @media screen and (max-width: 782px) {
348
+ .crowdsignal-setup__header {
349
+ margin-left: -12px;
350
+ margin-right: -12px;
351
+ }
352
+
353
+ .crowdsignal-setup__footer {
354
+ margin-left: -12px;
355
+ margin-right: -12px;
356
+ }
357
+ }
358
+
359
+ .jp-form-settings-group p {
360
+ color: #838383;
361
+ font-style: italic;
362
+ font-size: .875rem;
363
+ font-weight: 400;
364
+ }
365
+
366
+ .jp-form-settings-group a {
367
+ }
368
+
369
+ .jp-form-settings-group h2 {
370
+ font-size: .875rem;
371
+ font-weight: 700;
372
+ }
373
+
374
+ #crowdsignal__teaser_img {
375
+ max-width:100%;
376
+ max-height:100%;
377
+ padding-bottom: 20px;
378
+ }
379
+
380
+ #crowdsignal__logo {
381
+ font-size: 1.5rem;
382
+ font-weight: 400;
383
+ margin: .67em 0;
384
+ color: #1d2327;
385
+ font-family: Recoleta, "Noto Serif", Georgia, Times New Roman, Times, serif;
386
+ font-style: normal;
387
+ line-height: 1.2em;
388
+ }
389
+
390
+ #crowdsignal__install_cta {
391
+ margin: 0;
392
+ max-width: 100%;
393
+ }
394
+
395
+ .crowdsignal__advanced_desc {
396
+ color: #838383;
397
+ font-style: italic;
398
+ font-size: .875rem;
399
+ font-weight: 400;
400
+ padding-top: 5px;
401
+ }
402
+
403
+ .crowdsignal__advanced_text {
404
+ font-style: normal;
405
+ }
406
+
407
+ #crowdsignal_advanced_link a {
408
+ text-decoration: none;
409
+ color: #8c8f94;
410
+ padding-left: 24px;
411
+ }
412
+
partials/html-admin-setup-footer.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * File containing the view used in the footer of the setup pages.
4
+ *
5
+ * @package Crowdsignal_Forms\Admin
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+ ?>
12
+
13
+ <div class="jp-footer">
14
+ <div class="jp-footer__a8c-attr-container">
15
+ <a href="https://automattic.com/">
16
+ <svg role="img" class="jp-footer__a8c-attr" x="0" y="0" viewBox="0 0 935 38.2" enable-background="new 0 0 935 38.2" aria-labelledby="a8c-svg-title">
17
+ <title id="a8c-svg-title">An Automattic Adventure</title>
18
+ <path d="M317.1 38.2c-12.6 0-20.7-9.1-20.7-18.5v-1.2c0-9.6 8.2-18.5 20.7-18.5 12.6 0 20.8 8.9 20.8 18.5v1.2C337.9 29.1 329.7 38.2 317.1 38.2zM331.2 18.6c0-6.9-5-13-14.1-13s-14 6.1-14 13v0.9c0 6.9 5 13.1 14 13.1s14.1-6.2 14.1-13.1V18.6zM175 36.8l-4.7-8.8h-20.9l-4.5 8.8h-7L157 1.3h5.5L182 36.8H175zM159.7 8.2L152 23.1h15.7L159.7 8.2zM212.4 38.2c-12.7 0-18.7-6.9-18.7-16.2V1.3h6.6v20.9c0 6.6 4.3 10.5 12.5 10.5 8.4 0 11.9-3.9 11.9-10.5V1.3h6.7V22C231.4 30.8 225.8 38.2 212.4 38.2zM268.6 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H268.6zM397.3 36.8V8.7l-1.8 3.1 -14.9 25h-3.3l-14.7-25 -1.8-3.1v28.1h-6.5V1.3h9.2l14 24.4 1.7 3 1.7-3 13.9-24.4h9.1v35.5H397.3zM454.4 36.8l-4.7-8.8h-20.9l-4.5 8.8h-7l19.2-35.5h5.5l19.5 35.5H454.4zM439.1 8.2l-7.7 14.9h15.7L439.1 8.2zM488.4 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H488.4zM537.3 6.8v30h-6.7v-30h-15.5V1.3h37.7v5.5H537.3zM569.3 36.8V4.6c2.7 0 3.7-1.4 3.7-3.4h2.8v35.5L569.3 36.8 569.3 36.8zM628 11.3c-3.2-2.9-7.9-5.7-14.2-5.7 -9.5 0-14.8 6.5-14.8 13.3v0.7c0 6.7 5.4 13 15.3 13 5.9 0 10.8-2.8 13.9-5.7l4 4.2c-3.9 3.8-10.5 7.1-18.3 7.1 -13.4 0-21.6-8.7-21.6-18.3v-1.2c0-9.6 8.9-18.7 21.9-18.7 7.5 0 14.3 3.1 18 7.1L628 11.3zM321.5 12.4c1.2 0.8 1.5 2.4 0.8 3.6l-6.1 9.4c-0.8 1.2-2.4 1.6-3.6 0.8l0 0c-1.2-0.8-1.5-2.4-0.8-3.6l6.1-9.4C318.7 11.9 320.3 11.6 321.5 12.4L321.5 12.4z"></path>
19
+ </svg>
20
+ </a>
21
+ </div>
22
+ <ul class="jp-footer__links">
23
+ <li class="jp-footer__link-item"><a href="https://crowdsignal.com" target="_blank" rel="noopener noreferrer" class="jp-footer__link" title="Crowdsignal">Crowdsignal.com</a></li>
24
+ <li class="jp-footer__link-item"><a href="https://crowdsignal.com/support" target="_blank" rel="noopener noreferrer" class="jp-footer__link" title="<?php esc_html_e( 'Crowdsignal Support', 'crowdsignal-forms' ); ?>"><?php esc_html_e( 'Support', 'crowdsignal-forms' ); ?></a></li>
25
+ <li class="jp-footer__link-item"><a href="https://crowdsignal.com/terms/" target="_blank" rel="noopener noreferrer" title="<?php esc_attr_e( 'Terms of Service', 'crowdsignal-forms' ); ?>" class="jp-footer__link"><?php esc_html_e( 'Terms', 'crowdsignal-forms' ); ?></a></li>
26
+ <li class="jp-footer__link-item"><a href="https://automattic.com/privacy/" target="_blank" rel="noopener noreferrer" title="<?php esc_attr_e( 'Privacy Policy', 'crowdsignal-forms' ); ?>" class="jp-footer__link"><?php esc_html_e( 'Privacy', 'crowdsignal-forms' ); ?></a></li>
27
+ </ul>
28
+ </div>
29
+ </div> <!--.wrap-->
partials/html-admin-setup-header.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * File containing the view used in the header of the setup pages.
4
+ *
5
+ * @package Crowdsignal_Forms\Admin
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+ ?>
12
+ <div>
13
+ <div id="jp-plugin-container">
14
+ <div class='jp-lower'>
15
+ <h1 id='crowdsignal__logo'><?php esc_html_e( 'Crowdsignal Settings', 'crowdsignal-forms' ); ?></h1>
16
+ <?php
17
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended
18
+ if ( isset( $_GET['msg'] ) ) {
19
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended
20
+ switch ( $_GET['msg'] ) {
21
+ case 'disconnect-fail':
22
+ echo '<div class="error fade crowdsignal-message"><p>' .
23
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Content is svg from internal lib
24
+ Crowdsignal_Forms\Admin\Crowdsignal_Forms_Setup::get_icon( 'warning' ) .
25
+ esc_html__( 'Could not disconnect. Please try again.', 'crowdsignal-forms' ) .
26
+ '</p></div>';
27
+ break;
28
+ case 'disconnected':
29
+ echo '<div class="updated fade crowdsignal-message"><p>' .
30
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Content is svg from internal lib
31
+ Crowdsignal_Forms\Admin\Crowdsignal_Forms_Setup::get_icon( 'success' ) .
32
+ esc_html__( 'Successfully disconnected from Crowdsignal.', 'crowdsignal-forms' ) .
33
+ '</p></div>';
34
+ break;
35
+ case 'connected':
36
+ echo '<div class="updated crowdsignal-message"><p>' .
37
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Content is svg from internal lib
38
+ Crowdsignal_Forms\Admin\Crowdsignal_Forms_Setup::get_icon( 'success' ) .
39
+ esc_html__( 'Success! Your Crowdsignal account is successfully connected! You are ready!', 'crowdsignal-forms' ) .
40
+ '</p></div>';
41
+ break;
42
+ case 'api-key-added':
43
+ echo '<div class="updated crowdsignal-message"><p>' .
44
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Content is svg from internal lib
45
+ Crowdsignal_Forms\Admin\Crowdsignal_Forms_Setup::get_icon( 'success' ) .
46
+ esc_html__( 'You have been connected to Crowdsignal.', 'crowdsignal-forms' ) .
47
+ '</p></div>';
48
+ break;
49
+ case 'api-key-not-added':
50
+ echo '<div class="error fade crowdsignal-message"><p>' .
51
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Content is svg from internal lib
52
+ Crowdsignal_Forms\Admin\Crowdsignal_Forms_Setup::get_icon( 'warning' ) .
53
+ esc_html__( 'Your API key has not been updated, please try again.', 'crowdsignal-forms' ) .
54
+ '</p></div>';
55
+ break;
56
+ }
57
+ }
58
+ ?>
partials/html-admin-setup-step-1.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * File containing the view for step 1 of the setup wizard.
4
+ *
5
+ * @package Crowdsignal_Forms\Admin
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+ ?>
12
+ <br />
13
+ <div class='jp-settings-container'>
14
+ <div class="dops-card dops-section-header is-compact">
15
+ <div class="dops-section-header__label">
16
+ <span class="dops-section-header__label-text"><?php esc_html_e( 'Getting Started', 'crowdsignal-forms' ); ?></span>
17
+ </div>
18
+ </div>
19
+
20
+ <div class="dops-card dops-section-header is-compact">
21
+
22
+ <div class="jp-form-settings-group crowdsignal-forms" style='text-align: center; width: 100%'>
23
+ <div class="crowdsignal-setup__content">
24
+ <div class="crowdsignal-setup__description">
25
+ <h1><?php esc_html_e( 'Welcome to Crowdsignal', 'crowdsignal-forms' ); ?></h1>
26
+ <p><?php echo wp_kses_post( 'To collect and manage respones you need to connect the plugin to <a href="https://crowdsignal.com">Crowdsignal</a>. <br />It will take less than a minute and it’s free.', 'polldaddy' ); ?></p>
27
+ </div>
28
+
29
+ <div class="wrap crowdsignal-settings-wrap">
30
+ <form id="cs-connect-form" class="crowdsignal-options" method="post" action="https://app.crowdsignal.com/get-api-key/" target="CSCONNECT">
31
+ <input type="hidden" name="get_api_key" value="<?php echo esc_attr( get_option( 'crowdsignal_api_key_secret' ) ); ?>" />
32
+ <input type="hidden" name="ref" value="<?php echo esc_attr( admin_url( 'options-general.php?page=crowdsignal-settings' ) ); ?>" />
33
+ <input type="submit" value="<?php esc_html_e( 'Let’s get started', 'polldaddy' ); ?>" class="dops-button is-primary" />
34
+ </form>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </div>
40
+
41
+ <script>
42
+ let CSCONNECT = null;
43
+ const showConnect = ( title ) => {
44
+ // window size, match standard iPhone screen size
45
+ const widthRatio = 1/2;
46
+ const heightRatio = 3/4;
47
+
48
+ // Fixes dual-screen position
49
+ const dualScreenLeft = window.screenLeft !== undefined
50
+ ? window.screenLeft // Most browsers
51
+ : window.screenX; // Firefox
52
+ const dualScreenTop = window.screenTop !== undefined
53
+ ? window.screenTop // Most browsers
54
+ : window.screenY; // Firefox
55
+
56
+ const width = window.innerWidth
57
+ ? window.innerWidth
58
+ : document.documentElement.clientWidth
59
+ ? document.documentElement.clientWidth
60
+ : screen.width;
61
+ const height = window.innerHeight
62
+ ? window.innerHeight
63
+ : document.documentElement.clientHeight
64
+ ? document.documentElement.clientHeight
65
+ : screen.height;
66
+
67
+ const popupWidth = width * widthRatio;
68
+ const popupHeight = height * heightRatio;
69
+
70
+ const left = ( (width / 2 ) - ( popupWidth / 2 ) ) + dualScreenLeft;
71
+ const top = ( (height / 2 ) - ( popupHeight / 2 ) ) + dualScreenTop;
72
+
73
+ CSCONNECT = window.open( 'about:blank', title,
74
+ `
75
+ location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no,
76
+ width=${ parseInt( popupWidth, 10 ) },
77
+ height=${ parseInt( popupHeight, 10 ) },
78
+ top=${ parseInt( top, 10 ) },
79
+ left=${ parseInt( left, 10 ) }
80
+ `
81
+ )
82
+
83
+ if ( window.focus ) CSCONNECT.focus();
84
+ }
85
+ ( function( form ) {
86
+ form.onsubmit = function() {
87
+ showConnect( 'CSCONNECT' );
88
+ }
89
+ } )( document.getElementById( 'cs-connect-form' ) );
90
+ </script>
partials/html-admin-setup-step-2.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * File containing the view for step 2 of the setup wizard.
4
+ *
5
+ * @package Crowdsignal_Forms\Admin
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+ if ( $is_connected ) {
12
+ $crowdsignal_forms_msg = 'connected';
13
+ } else {
14
+ $crowdsignal_forms_msg = 'api-key-not-added';
15
+ }
16
+ ?>
17
+ <script type='text/javascript'>
18
+ window.close();
19
+ if (window.opener && !window.opener.closed) {
20
+ var querystring = window.opener.location.search;
21
+ querystring += ( querystring ? '&' : '?' ) + 'message=<?php echo esc_js( $crowdsignal_forms_msg ); ?>';
22
+ window.opener.location.search = querystring;
23
+ }
24
+ </script>
25
+ <noscript><h3><?php esc_html_e( "You're ready to start using Crowdsignal!", 'polldaddy' ); ?></h3></noscript>
partials/html-admin-setup-step-3.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * File containing the view for step 3 of the setup wizard.
4
+ *
5
+ * @package Crowdsignal_Forms\Admin
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+ ?>
12
+ <br />
13
+ <div class='jp-settings-container'>
14
+ <div class="dops-card dops-section-header is-compact">
15
+ <div class="dops-section-header__label">
16
+ <span class="dops-section-header__label-text"><?php esc_html_e( 'Getting Started', 'polldaddy' ); ?></span>
17
+ </div>
18
+ </div>
19
+
20
+ <div class="dops-card dops-section-header is-compact">
21
+ <div class="jp-form-settings-group" style='width: 100%'>
22
+ <h2><?php echo wp_kses_post( __( 'First time using Crowdsignal?', 'polldaddy' ) ); ?></h2>
23
+ <div class="crowdsignal-setup__middle">
24
+ <p>
25
+ <?php echo wp_kses_post( __( 'You can use Crowdsignal blocks right in your editor. Search for Crowdsignal in the blocks library and add the blocks to your page. Here is a short video to get you started:', 'polldaddy' ) ); ?>
26
+ </p>
27
+
28
+ <div class="crowdsignal-setup__video-container">
29
+ <div class="crowdsignal-setup__video">
30
+ <iframe src="https://videopress.com/v/jWTs90Dg?autoplay=0&hd=1" frameborder="0" allowfullscreen></iframe>
31
+ </div>
32
+ </div>
33
+ <p>
34
+ <?php
35
+ echo wp_kses_post(
36
+ sprintf(
37
+ // translators: Argument is a link to Crowdsignal's support page.
38
+ __(
39
+ 'Do you want to know more about Crowdsignal and our blocks? <a href="%1s" target="_blank">Learn more</a>.',
40
+ 'polldaddy'
41
+ ),
42
+ 'https://crowdsignal.com/support/'
43
+ )
44
+ );
45
+ ?>
46
+ </p>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </div>
partials/html-admin-teaser.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * File containing the view for the teaser
4
+ *
5
+ * @package Crowdsignal_Forms\Admin
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+ ?>
12
+ <br />
13
+ <div class='jp-settings-container'>
14
+ <div class="dops-card dops-section-header is-compact">
15
+ <div class="dops-section-header__label">
16
+ <span class="dops-section-header__label-text"><?php esc_html_e( 'Crowdsignal Blocks', 'polldaddy' ); ?></span>
17
+ </div>
18
+ </div>
19
+
20
+ <div class="dops-card dops-section-header is-compact">
21
+ <div class="jp-form-settings-group" style='width: 100%'>
22
+ <h2><?php echo wp_kses_post( __( 'First time using Crowdsignal?', 'polldaddy' ) ); ?></h2>
23
+ <div class="crowdsignal-setup__middle">
24
+ <p>
25
+ <?php
26
+ printf(
27
+ /* translators: Placeholder is the text "second plugin" and "Install the plugin". */
28
+ esc_html__( 'We have a %1$s called Crowdsignal Forms that allows you to create Crowdsignal blocks right inside of your WordPress editor. %2$s, then search for Crowdsignal in the blocks library and add Crowdsignal blocks, like a Poll block or Feedback button.', 'polldaddy' ),
29
+ sprintf(
30
+ '<a href="https://wordpress.org/plugins/crowdsignal-forms/">%s</a>',
31
+ esc_html__( 'second plugin', 'polldaddy' )
32
+ ),
33
+ sprintf(
34
+ '<a href="' . admin_url( 'plugin-install.php?s=crowdsignal+forms&tab=search&type=term' ) . '">%s</a>',
35
+ esc_html__( 'Install the plugin', 'polldaddy' )
36
+ )
37
+ );
38
+ ?>
39
+ </p>
40
+ <p><?php _e( 'Here is a short video to get you started:', 'polldaddy' ); ?></p>
41
+
42
+
43
+ <div class="crowdsignal-setup__video-container">
44
+ <div class="crowdsignal-setup__video">
45
+ <iframe src="https://videopress.com/v/jWTs90Dg?autoplay=0&hd=1" frameborder="0" allowfullscreen></iframe>
46
+ </div>
47
+ </div>
48
+
49
+
50
+ <p>
51
+ <?php
52
+ echo wp_kses_post(
53
+ sprintf(
54
+ '<a href="' . admin_url( 'admin.php?page=polls&action=landing-page' ) . '">%s</a>',
55
+ __(
56
+ 'See an overview of our Crowdsignal blocks.',
57
+ 'polldaddy'
58
+ )
59
+ )
60
+ );
61
+ ?>
62
+ </p>
63
+ <p>
64
+ <?php
65
+ printf(
66
+ /* translators: Placeholder is the text "website plugins page". */
67
+ esc_html__( 'Install the Crowdsignal Forms plugin directly from your %s.', 'polldaddy' ),
68
+ sprintf(
69
+ '<a href="' . admin_url( 'plugin-install.php?s=crowdsignal+forms&tab=search&type=term' ) . '">%s</a>',
70
+ esc_html__( 'website plugins page', 'polldaddy' )
71
+ )
72
+ );
73
+ ?>
74
+ </p>
75
+ </div>
76
+ </div>
77
+ </div>
partials/polls-table.php CHANGED
@@ -341,7 +341,7 @@ jQuery( document ).ready(function(){
341
  icon: 'arrow-down',
342
  controls: [
343
  { title: 'My Account', onClick: () => window.open( 'https://app.crowdsignal.com/account', '_blank' ) },
344
- { title: 'Settings', onClick: () => window.open( 'options-general.php?page=pollsettings', '_self' ) },
345
  { title: 'Crowdsignal Blog', onClick: () => window.open( 'https://crowdsignal.com/blog', '_blank' ) },
346
  { title: 'Help', onClick: () => window.open( 'https://crowdsignal.com/support', '_blank' ) },
347
  { title: 'crowdsignal.com', onClick: () => window.open( 'https://crowdsignal.com/', '_blank' ) },
341
  icon: 'arrow-down',
342
  controls: [
343
  { title: 'My Account', onClick: () => window.open( 'https://app.crowdsignal.com/account', '_blank' ) },
344
+ { title: 'Settings', onClick: () => window.open( 'options-general.php?page=crowdsignal-settings', '_self' ) },
345
  { title: 'Crowdsignal Blog', onClick: () => window.open( 'https://crowdsignal.com/blog', '_blank' ) },
346
  { title: 'Help', onClick: () => window.open( 'https://crowdsignal.com/support', '_blank' ) },
347
  { title: 'crowdsignal.com', onClick: () => window.open( 'https://crowdsignal.com/', '_blank' ) },
partials/settings-2.php ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Crowdsignal legacy plugin
4
+ *
5
+ * @package polldaddy
6
+ */
7
+
8
+ ?>
9
+ <br />
10
+ <div id='crowdsignal_advanced_link'><a href="#" id='toggle_advanced_setting_link'><?php _e( 'Advanced Settings' ); ?></a></div>
11
+ <br />
12
+
13
+ <script>
14
+ jQuery(document).ready( function() {
15
+ jQuery( '#toggle_advanced_setting_link' ).click( function() {
16
+ jQuery( '#crowdsignal__advanced_page' ).toggle( 100 );
17
+ return false;
18
+ })
19
+ });
20
+ </script>
21
+
22
+ <div style='display:none' id="crowdsignal__advanced_page">
23
+
24
+ <?php if ( $controller->multiple_accounts ) { ?>
25
+ <div class='jp-settings-container'>
26
+ <div class="dops-card dops-section-header is-compact">
27
+ <div class="jp-form-settings-group" style='width: 100%'>
28
+ <h2><?php echo wp_kses_post( __( 'Multiuser Account', 'polldaddy' ) ); ?></h2>
29
+ <div class="crowdsignal-setup__middle">
30
+ <form action="" method="post">
31
+ <p><input type='checkbox' name='crowdsignal_multiuser' value='1' <?php echo $controller->multiple_accounts ? 'checked' : ''; ?> /> <span class='crowdsignal__advanced_text'><?php _e( 'You have granted authors, editors and admin users of this site access to your Crowdsignal account.', 'polldaddy' ); ?></span></p>
32
+ <p class='crowdsignal__advanced_desc'><?php _e( 'Warning: This is a deprecated feature and wont’t be supported in future. If you disable the Multi-User-Access feature, you won’t be able to activate it again.', 'polldaddy' ); ?></p>
33
+ <p class="submit">
34
+ <?php wp_nonce_field( 'polldaddy-reset' . $current_user->ID ); ?>
35
+ <input type="hidden" name="action" value="multi-account" />
36
+ <input type="submit" class="button-primary" value="<?php echo esc_attr( __( 'Save', 'polldaddy' ) ); ?>" />
37
+ </p>
38
+ </form>
39
+ </div>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ <br />
44
+ <?php } ?>
45
+
46
+ <?php
47
+ global $current_user;
48
+ $fields = array( 'polldaddy_api_key', 'pd-rating-comments', 'pd-rating-comments-id', 'pd-rating-comments-pos', 'pd-rating-exclude-post-ids', 'pd-rating-pages', 'pd-rating-pages-id', 'pd-rating-posts', 'pd-rating-posts-id', 'pd-rating-posts-index', 'pd-rating-posts-index-id', 'pd-rating-posts-index-pos', 'pd-rating-posts-pos', 'pd-rating-title-filter', 'pd-rating-usercode', 'pd-rich-snippets', 'pd-usercode-' . $current_user->ID );
49
+ $show_reset_form = false;
50
+ foreach( $fields as $field ) {
51
+ $value = get_option( $field );
52
+ if ( $value != false ) {
53
+ $show_reset_form = true;
54
+ }
55
+ $settings[ $field ] = $value;
56
+ }
57
+ $previous_settings = get_option( 'polldaddy_settings' );
58
+ if ( ! $show_reset_form && empty( $previous_settings ) ) {
59
+ return;
60
+ }
61
+ ?>
62
+
63
+ <div class='jp-settings-container'>
64
+ <div class="dops-card dops-section-header is-compact">
65
+ <div class="" style='width: 100%'>
66
+ <h2><?php echo wp_kses_post( __( 'Reset Connection Settings', 'polldaddy' ) ); ?></h2>
67
+ <div class="crowdsignal-setup__middle">
68
+ <p class='crowdsignal__advanced_text'><?php _e( 'If you are experiencing problems connecting to the Crowdsignal website resetting your connection settings may help. A backup will be made. After resetting, link your account again with the same API key.', 'polldaddy' ); ?></p>
69
+ <p class='crowdsignal__advanced_text'><?php _e( 'The following settings will be reset:', 'polldaddy' ); ?></p>
70
+ <?php if ( $show_reset_form ) { ?>
71
+ <table>
72
+ <?php
73
+ foreach( $settings as $key => $value ) {
74
+ if ( $value != '' ) {
75
+ if ( strpos( $key, 'usercode' ) ) {
76
+ $value = "***********" . substr( $value, -4 );
77
+ } elseif ( in_array( $key, array( 'pd-rating-pages-id', 'pd-rating-comments-id', 'pd-rating-posts-id' ) ) ) {
78
+ $value = "$value (<a href='https://app.crowdsignal.com/ratings/{$value}/edit/'>" . __( 'Edit', 'polldaddy' ) . "</a>)";
79
+ }
80
+ ?>
81
+ <tr>
82
+ <th style="text-align: left"><?php echo esc_html( $key ); ?>:</th>
83
+ <td><?php echo $value; ?></td>
84
+ </tr>
85
+ <?php
86
+ }
87
+ }
88
+ ?>
89
+ </table>
90
+ <p><?php _e( "* The usercode is like a password, keep it secret.", 'polldaddy' ); ?></p>
91
+ <form action="" method="post">
92
+ <p class="submit">
93
+ <?php wp_nonce_field( 'polldaddy-reset' . $current_user->ID ); ?>
94
+ <input type="hidden" name="action" value="reset-account" />
95
+ <input type="hidden" name="account" value="import" />
96
+ <p><input type="checkbox" name="email" value="1" /> <?php _e( 'Send me an email with the connection settings for future reference' ); ?></p>
97
+ <input type="submit" class="button-primary" value="<?php echo esc_attr( __( 'Reset API Connection', 'polldaddy' ) ); ?>" />
98
+ </p>
99
+ </form>
100
+ <br />
101
+ <?php
102
+ }
103
+ if ( is_array( $previous_settings ) && !empty( $previous_settings ) ) {
104
+ ?>
105
+ <h2><?php _e( 'Restore Previous Settings', 'polldaddy' ); ?></h2>
106
+ <p><?php _e( 'The connection settings for this site were reset but a backup was made. The following settings can be restored:', 'polldaddy' ); ?></p>
107
+ <table>
108
+ <?php
109
+ foreach( $previous_settings as $key => $value ) {
110
+ if ( $value != '' ) {
111
+ if ( strpos( $key, 'usercode' ) ) {
112
+ $value = "***********" . substr( $value, -4 );
113
+ } elseif ( in_array( $key, array( 'pd-rating-pages-id', 'pd-rating-comments-id', 'pd-rating-posts-id' ) ) ) {
114
+ $value = "$value (<a href='https://app.crowdsignal.com/ratings/{$value}/edit/'>" . __( 'Edit', 'polldaddy' ) . "</a>)";
115
+ }
116
+ ?>
117
+ <tr>
118
+ <th style="text-align: left"><?php echo esc_html( $key ); ?>:</th>
119
+ <td><?php echo $value; ?></td>
120
+ </tr>
121
+ <?php
122
+ }
123
+ }
124
+ ?>
125
+ </table>
126
+ <p><?php _e( "* The usercode is like a password, keep it secret.", 'polldaddy' ); ?></p>
127
+ <form action="" method="post">
128
+ <p class="submit">
129
+ <?php wp_nonce_field( 'polldaddy-restore' . $current_user->ID ); ?>
130
+ <input type="hidden" name="action" value="restore-account" />
131
+ <input type="hidden" name="account" value="import" />
132
+ <input type="submit" class="button-primary" value="<?php echo esc_attr( __( 'Restore API Settings', 'polldaddy' ) ); ?>" />
133
+ </p>
134
+ </form>
135
+ <br />
136
+ <?php
137
+ if (
138
+ $show_reset_form
139
+ && isset( $settings[ 'pd-rating-posts-id' ] )
140
+ && isset( $previous_settings[ 'pd-rating-posts-id' ] )
141
+ && $settings[ 'pd-rating-posts-id' ] != $previous_settings[ 'pd-rating-posts-id' ]
142
+ ) {
143
+ ?>
144
+ <h2><?php _e( 'Restore Ratings Settings', 'polldaddy' ); ?></h2>
145
+ <p><?php _e( 'Different rating settings detected. If you are missing ratings on your posts, pages or comments you can restore the original rating settings by clicking the button below.', 'polldaddy' ); ?></p>
146
+ <p><?php _e( 'This tells the plugin to look for this data in a different rating in your Crowdsignal account.', 'polldaddy' ); ?></p>
147
+ <form action="" method="post">
148
+ <p class="submit">
149
+ <?php wp_nonce_field( 'polldaddy-restore-ratings' . $current_user->ID ); ?>
150
+ <input type="hidden" name="action" value="restore-ratings" />
151
+ <input type="hidden" name="account" value="import" />
152
+ <input type="submit" class="button-primary" value="<?php echo esc_attr( __( 'Restore Ratings Only', 'polldaddy' ) ); ?>" />
153
+ </p>
154
+ </form>
155
+ <br />
156
+ <?php
157
+ }
158
+ }
159
+ ?>
160
+ </div>
161
+ </div>
162
+ </div>
163
+ </div>
164
+ </div>
165
+
partials/settings.php CHANGED
@@ -7,228 +7,141 @@
7
 
8
  ?>
9
  <?php // phpcs:ignoreFile -- too many legacy warnings, needs full linter ?>
10
- <div id="options-page" class="cs-wrapper-row cs-background-fill">
11
- <div class="icon32" id="icon-options-general"></div>
12
- <h2>
13
- <?php _e( 'Crowdsignal Settings', 'polldaddy' ); ?>
14
- </h2>
15
- <?php if ( $controller->is_admin || $controller->multiple_accounts ) { ?>
16
- <h3><?php _e( 'Account Info', 'polldaddy' ); ?></h3>
17
- <p><?php _e( '<em>Crowdsignal</em> and <em>WordPress.com</em> are now connected using <a href="http://en.support.wordpress.com/wpcc-faq/">WordPress.com Connect</a>. If you have a WordPress.com account you can use it to login to <a href="https://app.crowdsignal.com/">Crowdsignal.com</a>. Click on the Crowdsignal "sign in" button, authorize the connection and create your new Crowdsignal account.', 'polldaddy' ); ?></p>
18
- <p><?php _e( 'Login to the Crowdsignal website and scroll to the end of your <a href="https://app.crowdsignal.com/account/#apikey">account page</a> to create or retrieve an API key.', 'polldaddy' ); ?></p>
19
- <?php if ( isset( $account_email ) && $account_email != false ) { ?>
20
- <p><?php printf( __( 'Your account is currently linked to this API key: <strong>%s</strong>', 'polldaddy' ), WP_POLLDADDY__PARTNERGUID ); ?></p>
21
- <br />
22
- <h3><?php _e( 'Link to a different Crowdsignal account', 'polldaddy' ); ?></h3>
23
- <?php } else { ?>
24
- <br />
25
- <h3><?php _e( 'Link to your Crowdsignal account', 'polldaddy' ); ?></h3>
26
- <?php } ?>
27
- <form action="" method="post">
28
- <table class="form-table">
29
- <tbody>
30
- <tr class="form-field form-required">
31
- <th valign="top" scope="row">
32
- <label for="polldaddy-key">
33
- <?php _e( 'Crowdsignal.com API Key', 'polldaddy' ); ?>
34
- </label>
35
- </th>
36
- <td>
37
- <input type="text" name="polldaddy_key" id="polldaddy-key" aria-required="true" size="20" value="<?php if ( isset( $_POST[ 'polldaddy_key' ] ) ) echo esc_attr( $_POST[ 'polldaddy_key' ] ); ?>" />
38
- </td>
39
- </tr>
40
- </tbody>
41
- </table>
42
- <p class="submit">
43
- <?php wp_nonce_field( 'polldaddy-account' ); ?>
44
- <input type="hidden" name="action" value="import-account" />
45
- <input type="hidden" name="account" value="import" />
46
- <input type="submit" class="button-primary" value="<?php echo esc_attr( __( 'Link Account', 'polldaddy' ) ); ?>" />
47
- </p>
48
- </form>
49
- <?php
50
- }
51
 
52
- if ( is_object( $poll ) ) {
53
- ?>
54
- <h3><?php _e( 'General Settings', 'polldaddy' ); ?></h3>
55
- <form action="" method="post">
56
- <table class="form-table">
57
- <tbody>
58
- <tr valign="top">
59
- <th valign="top" scope="row">
60
- <label><?php _e( 'Default poll settings', 'polldaddy' ); ?></label>
61
- </th>
62
- <td>
63
- <fieldset>
64
- <legend class="screen-reader-text"><span>poll-defaults</span></legend>
65
- <?php
66
- foreach ( array( 'randomiseAnswers' => __( 'Randomize answer order', 'polldaddy' ), 'otherAnswer' => __( 'Allow other answers', 'polldaddy' ), 'multipleChoice' => __( 'Multiple choice', 'polldaddy' ), 'sharing' => __( 'Sharing', 'polldaddy' ) ) as $option => $label ) :
67
- $checked = 'yes' === $poll->$option ? ' checked="checked"' : '';
68
- ?>
69
- <label for="<?php echo $option; ?>"><input type="checkbox"<?php echo $checked; ?> value="1" id="<?php echo $option; ?>" name="<?php echo $option; ?>" /> <?php echo esc_html( $label ); ?></label><br />
70
- <?php endforeach; ?>
71
- <br class="clear" />
72
- <br class="clear" />
73
- <div class="field">
74
- <label for="resultsType" class="pd-label">
75
- <?php _e( 'Results Display', 'polldaddy' ); ?>
76
- </label>
77
- <select id="resultsType" name="resultsType">
78
- <option <?php echo $poll->resultsType == 'show' ? 'selected="selected"':''; ?> value="show"><?php _e( 'Show', 'polldaddy' ); ?></option>
79
- <option <?php echo $poll->resultsType == 'hide' ? 'selected="selected"':''; ?> value="hide"><?php _e( 'Hide', 'polldaddy' ); ?></option>
80
- <option <?php echo $poll->resultsType == 'percent' ? 'selected="selected"':''; ?> value="percent"><?php _e( 'Percentages', 'polldaddy' ); ?></option>
81
- </select>
82
- </div>
83
- <br class="clear" />
84
- <div class="field">
85
- <label for="styleID" class="pd-label"><?php _e( 'Poll style', 'polldaddy' ); ?></label>
86
- <select id="styleID" name="styleID">
87
- <?php
88
- foreach ( (array) $options as $styleID => $label ) :
89
- $selected = $styleID == $poll->styleID ? ' selected="selected"' : ''; ?>
90
- <option value="<?php echo (int) $styleID; ?>"<?php echo $selected; ?>><?php echo esc_html( $label ); ?></option>
91
- <?php endforeach; ?>
92
- </select>
93
- </div>
94
- <br class="clear" />
95
- <div class="field">
96
- <label for="blockRepeatVotersType" class="pd-label"><?php _e( 'Repeat Voting', 'polldaddy' ); ?></label>
97
- <select id="poll-block-repeat" name="blockRepeatVotersType">
98
- <option <?php echo $poll->blockRepeatVotersType == 'off' ? 'selected="selected"':''; ?> value="off"><?php _e( 'Off', 'polldaddy' ); ?></option>
99
- <option <?php echo $poll->blockRepeatVotersType == 'cookie' ? 'selected="selected"':''; ?> value="cookie"><?php _e( 'Cookie', 'polldaddy' ); ?></option>
100
- <option <?php echo $poll->blockRepeatVotersType == 'cookieip' ? 'selected="selected"':''; ?> value="cookieip"><?php _e( 'Cookie & IP address', 'polldaddy' ); ?></option>
101
- </select>
102
- </div>
103
- <br class="clear" />
104
- <div class="field">
105
- <label for="blockExpiration" class="pd-label"><?php _e( 'Block expiration limit', 'polldaddy' ); ?></label>
106
- <select id="blockExpiration" name="blockExpiration">
107
- <option value="3600" <?php echo $poll->blockExpiration == 3600 ? 'selected="selected"':''; ?>><?php printf( __( '%d hour', 'polldaddy' ), 1 ); ?></option>
108
- <option value="10800" <?php echo (int) $poll->blockExpiration == 10800 ? 'selected="selected"' : ''; ?>><?php printf( __( '%d hours', 'polldaddy' ), 3 ); ?></option>
109
- <option value="21600" <?php echo (int) $poll->blockExpiration == 21600 ? 'selected="selected"' : ''; ?>><?php printf( __( '%d hours', 'polldaddy' ), 6 ); ?></option>
110
- <option value="43200" <?php echo (int) $poll->blockExpiration == 43200 ? 'selected="selected"' : ''; ?>><?php printf( __( '%d hours', 'polldaddy' ), 12 ); ?></option>
111
- <option value="86400" <?php echo (int) $poll->blockExpiration == 86400 ? 'selected="selected"' : ''; ?>><?php printf( __( '%d day', 'polldaddy' ), 1 ); ?></option>
112
- <option value="604800" <?php echo (int) $poll->blockExpiration == 604800 ? 'selected="selected"' : ''; ?>><?php printf( __( '%d week', 'polldaddy' ), 1 ); ?></option>
113
- </select>
114
- </div>
115
- <br class="clear" />
116
- </fieldset>
117
- </td>
118
- </tr>
119
- <?php $controller->plugin_options_add(); ?>
120
- </tbody>
121
- </table>
122
- <p class="submit">
123
- <?php wp_nonce_field( 'polldaddy-account' ); ?>
124
- <input type="hidden" name="action" value="update-options" />
125
- <input type="submit" class="button-primary" value="<?php echo esc_attr( __( 'Save Options', 'polldaddy' ) ); ?>" />
126
- </p>
127
- </form>
128
- <?php
129
- } // is_object( $poll )
130
- ?>
131
- <div class="extra-stuff">
132
- <?php
133
- global $current_user;
134
- $fields = array( 'polldaddy_api_key', 'pd-rating-comments', 'pd-rating-comments-id', 'pd-rating-comments-pos', 'pd-rating-exclude-post-ids', 'pd-rating-pages', 'pd-rating-pages-id', 'pd-rating-posts', 'pd-rating-posts-id', 'pd-rating-posts-index', 'pd-rating-posts-index-id', 'pd-rating-posts-index-pos', 'pd-rating-posts-pos', 'pd-rating-title-filter', 'pd-rating-usercode', 'pd-rich-snippets', 'pd-usercode-' . $current_user->ID );
135
- $show_reset_form = false;
136
- foreach( $fields as $field ) {
137
- $value = get_option( $field );
138
- if ( $value != false )
139
- $show_reset_form = true;
140
- $settings[ $field ] = $value;
141
- }
142
- if ( $show_reset_form ) {
143
- echo "<h3>" . __( 'Reset Connection Settings', 'polldaddy' ) . "</h3>";
144
- echo "<p>" . __( 'If you are experiencing problems connecting to the Crowdsignal website resetting your connection settings may help. A backup will be made. After resetting, link your account again with the same API key.', 'polldaddy' ) . "</p>";
145
- echo "<p>" . __( 'The following settings will be reset:', 'polldaddy' ) . "</p>";
146
- echo "<table>";
147
- foreach( $settings as $key => $value ) {
148
- if ( $value != '' ) {
149
- if ( strpos( $key, 'usercode' ) ) {
150
- $value = "***********" . substr( $value, -4 );
151
- } elseif ( in_array( $key, array( 'pd-rating-pages-id', 'pd-rating-comments-id', 'pd-rating-posts-id' ) ) ) {
152
- $value = "$value (<a href='https://app.crowdsignal.com/ratings/{$value}/edit/'>" . __( 'Edit', 'polldaddy' ) . "</a>)";
153
- }
154
- ?>
155
- <tr>
156
- <th style="text-align: right"><?php echo esc_html( $key ); ?>:</th>
157
- <td><?php echo $value; ?></td>
158
- </tr>
159
- <?php
160
- }
161
- }
162
- echo "</table>";
163
- echo "<p>" . __( "* The usercode is like a password, keep it secret.", 'polldaddy' ) . "</p>";
164
  ?>
165
- <form action="" method="post">
166
- <p class="submit">
167
- <?php wp_nonce_field( 'polldaddy-reset' . $current_user->ID ); ?>
168
- <input type="hidden" name="action" value="reset-account" />
169
- <input type="hidden" name="account" value="import" />
170
- <p><input type="checkbox" name="email" value="1" /> <?php _e( 'Send me an email with the connection settings for future reference' ); ?></p>
171
- <input type="submit" class="button-primary" value="<?php echo esc_attr( __( 'Reset', 'polldaddy' ) ); ?>" />
172
- </p>
173
- </form>
174
- <br />
175
  <?php
176
- }
177
- $previous_settings = get_option( 'polldaddy_settings' );
178
- if ( is_array( $previous_settings ) && !empty( $previous_settings ) ) {
179
- echo "<h3>" . __( 'Restore Previous Settings', 'polldaddy' ) . "</h3>";
180
- echo "<p>" . __( 'The connection settings for this site were reset but a backup was made. The following settings can be restored:', 'polldaddy' ) . "</p>";
181
- echo "<table>";
182
- foreach( $previous_settings as $key => $value ) {
183
- if ( $value != '' ) {
184
- if ( strpos( $key, 'usercode' ) ) {
185
- $value = "***********" . substr( $value, -4 );
186
- } elseif ( in_array( $key, array( 'pd-rating-pages-id', 'pd-rating-comments-id', 'pd-rating-posts-id' ) ) ) {
187
- $value = "$value (<a href='https://app.crowdsignal.com/ratings/{$value}/edit/'>" . __( 'Edit', 'polldaddy' ) . "</a>)";
188
- }
189
- ?>
190
- <tr>
191
- <th style="text-align: right"><?php echo esc_html( $key ); ?>:</th>
192
- <td><?php echo $value; ?></td>
193
- </tr>
194
- <?php
195
- }
196
- }
197
- echo "</table>";
198
- echo "<p>" . __( "* The usercode is like a password, keep it secret.", 'polldaddy' ) . "</p>";
199
  ?>
200
- <form action="" method="post">
201
- <p class="submit">
202
- <?php wp_nonce_field( 'polldaddy-restore' . $current_user->ID ); ?>
203
- <input type="hidden" name="action" value="restore-account" />
204
- <input type="hidden" name="account" value="import" />
205
- <input type="submit" class="button-primary" value="<?php echo esc_attr( __( 'Restore', 'polldaddy' ) ); ?>" />
206
- </p>
207
- </form>
208
- <br />
 
 
 
209
  <?php
210
- if (
211
- $show_reset_form
212
- && isset( $settings[ 'pd-rating-posts-id' ] )
213
- && isset( $previous_settings[ 'pd-rating-posts-id' ] )
214
- && $settings[ 'pd-rating-posts-id' ] != $previous_settings[ 'pd-rating-posts-id' ]
215
- ) {
216
- echo "<h3>" . __( 'Restore Ratings Settings', 'polldaddy' ) . "</h3>";
217
- echo "<p>" . __( 'Different rating settings detected. If you are missing ratings on your posts, pages or comments you can restore the original rating settings by clicking the button below.', 'polldaddy' ) . "</p>";
218
- echo "<p>" . __( 'This tells the plugin to look for this data in a different rating in your Crowdsignal account.', 'polldaddy' ) . "</p>";
219
- ?>
220
- <form action="" method="post">
221
- <p class="submit">
222
- <?php wp_nonce_field( 'polldaddy-restore-ratings' . $current_user->ID ); ?>
223
- <input type="hidden" name="action" value="restore-ratings" />
224
- <input type="hidden" name="account" value="import" />
225
- <input type="submit" class="button-primary" value="<?php echo esc_attr( __( 'Restore Ratings Only', 'polldaddy' ) ); ?>" />
226
- </p>
227
- </form>
228
- <br />
229
- <?php
230
  }
231
- }
232
- ?>
233
- </div>
234
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  ?>
9
  <?php // phpcs:ignoreFile -- too many legacy warnings, needs full linter ?>
10
+ <div class='jp-settings-container'>
11
+ <div class="dops-card dops-section-header is-compact">
12
+ <div class="dops-section-header__label">
13
+ <span class="dops-section-header__label-text"><?php esc_html_e( 'Account Settings', 'crowdsignal-forms' ); ?></span>
14
+ </div>
15
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
+ <div class="dops-card dops-section-header is-compact">
18
+ <div class="jp-form-settings-group">
19
+ <h2><?php esc_html_e( 'API Key', 'crowdsignal-forms' ); ?></h2>
20
+ <p>
21
+ <?php
22
+ printf(
23
+ /* translators: Placeholder is the text "Crowdsignal". */
24
+ esc_html__( 'Your website is connected to a %s account to collect responses and data from your visitors.', 'crowdsignal-forms' ),
25
+ '<a href="https://crowdsignal.com/">Crowdsignal</a>'
26
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  ?>
28
+ <br />
 
 
 
 
 
 
 
 
 
29
  <?php
30
+ printf(
31
+ /* translators: Placeholder is the text "Crowdsignal acount page". */
32
+ esc_html__( 'Visit your %s to find out more about your settings.', 'crowdsignal-forms' ),
33
+ sprintf(
34
+ '<a href="https://crowdsignal.com/account/">%s</a>',
35
+ esc_html__( 'Crowdsignal account page', 'crowdsignal-forms' )
36
+ )
37
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  ?>
39
+ </p>
40
+ <?php if ( ! $api_key ) { ?>
41
+ <p>
42
+ <?php esc_html_e( 'If you have a Crowdsignal account, click the "Get API Key" button to connect. This will open a new window.', 'crowdsignal-forms' ); ?>
43
+ <form id="cs-connect-form" class="crowdsignal-options" method="post" action="https://app.crowdsignal.com/get-api-key/" target="CSCONNECT">
44
+ <input type="hidden" name="get_api_key" value="<?php echo esc_attr( get_option( 'crowdsignal_api_key_secret' ) ); ?>" />
45
+ <input type="hidden" name="ref" value="<?php echo esc_attr( admin_url( 'options-general.php?page=crowdsignal-settings' ) ); ?>" />
46
+ <input type="submit" value="<?php esc_html_e( 'Get API Key', 'crowdsignal-forms' ); ?>" class="dops-button is-primary" />
47
+ </form>
48
+ </p>
49
+ <?php } ?>
50
+ <form class="crowdsignal-options" method="post" action="<?php echo esc_url( admin_url( 'options-general.php?page=crowdsignal-settings' ) ); ?>">
51
  <?php
52
+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Used for basic flow.
53
+ if ( ! empty( $_GET['settings-updated'] ) ) {
54
+ echo '<div class="updated fade crowdsignal-updated"><p>' . esc_html__( 'Settings successfully saved', 'crowdsignal-forms' ) . '</p></div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
56
+
57
+ ?>
58
+ <div style='padding-bottom:16px;' id="settings-general" class="settings_panel">
59
+ <table class="form-table settings parent-settings">
60
+ <tr valign="top" class="">
61
+ <th scope="row"><label for="setting-crowdsignal_api_key"><?php esc_html_e( 'Your Crowdsignal API Key', 'crowdsignal-forms' ); ?></a></th>
62
+ <td><input
63
+ <?php echo $api_key ? 'readonly' : ''; ?>
64
+ id="setting-crowdsignal_api_key"
65
+ class="regular-text"
66
+ type="text"
67
+ name="crowdsignal_api_key"
68
+ value="<?php echo esc_attr( $api_key ); ?>"
69
+ />
70
+ </td>
71
+ <td>
72
+ <?php
73
+ if ( $api_key ) {
74
+ wp_nonce_field( 'disconnect-api-key' );
75
+ ?>
76
+ <input type="hidden" name="action" value="disconnect" />
77
+ <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Disconnect', 'crowdsignal-forms' ); ?>" />
78
+ <?php
79
+ } else {
80
+ wp_nonce_field( 'add-api-key' );
81
+ ?>
82
+ <input type="hidden" name="action" value="update" />
83
+ <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Connect', 'crowdsignal-forms' ); ?>" />
84
+ <?php
85
+ }
86
+ ?>
87
+ </td>
88
+ </tr>
89
+ </table>
90
+ </div>
91
+ </form>
92
+ </div>
93
+ </div>
94
+ </div>
95
+
96
+ <?php if ( ! $api_key ) { ?>
97
+ <script>
98
+ let CSCONNECT = null;
99
+ const showConnect = ( title ) => {
100
+ // window size, match standard iPhone screen size
101
+ const widthRatio = 1/2;
102
+ const heightRatio = 3/4;
103
+
104
+ // Fixes dual-screen position
105
+ const dualScreenLeft = window.screenLeft !== undefined
106
+ ? window.screenLeft // Most browsers
107
+ : window.screenX; // Firefox
108
+ const dualScreenTop = window.screenTop !== undefined
109
+ ? window.screenTop // Most browsers
110
+ : window.screenY; // Firefox
111
+
112
+ const width = window.innerWidth
113
+ ? window.innerWidth
114
+ : document.documentElement.clientWidth
115
+ ? document.documentElement.clientWidth
116
+ : screen.width;
117
+ const height = window.innerHeight
118
+ ? window.innerHeight
119
+ : document.documentElement.clientHeight
120
+ ? document.documentElement.clientHeight
121
+ : screen.height;
122
+
123
+ const popupWidth = width * widthRatio;
124
+ const popupHeight = height * heightRatio;
125
+
126
+ const left = ( (width / 2 ) - ( popupWidth / 2 ) ) + dualScreenLeft;
127
+ const top = ( (height / 2 ) - ( popupHeight / 2 ) ) + dualScreenTop;
128
+
129
+ CSCONNECT = window.open( 'about:blank', title,
130
+ `
131
+ location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no,
132
+ width=${ parseInt( popupWidth, 10 ) },
133
+ height=${ parseInt( popupHeight, 10 ) },
134
+ top=${ parseInt( top, 10 ) },
135
+ left=${ parseInt( left, 10 ) }
136
+ `
137
+ )
138
+
139
+ if ( window.focus ) CSCONNECT.focus();
140
+ }
141
+ ( function( form ) {
142
+ form.onsubmit = function() {
143
+ showConnect( 'CSCONNECT' );
144
+ }
145
+ } )( document.getElementById( 'cs-connect-form' ) );
146
+ </script>
147
+ <?php } ?>
polldaddy-client.php CHANGED
@@ -178,7 +178,7 @@ class api_client {
178
  */
179
  function get_usercode( $partnerUserID ) {
180
  $this->request = new Polldaddy_Access( array(
181
- // 'demands' => new Polldaddy_Demands( array( 'demand' => new Polldaddy_Demand( null, array( 'id' => __FUNCTION__ ) ) ) )
182
  'demands' => new Polldaddy_Demands( array( 'demand' => new Polldaddy_Demand( null, array( 'id' => 'getusercode' ) ) ) )
183
  ), array(
184
  'partnerGUID' => $this->partnerGUID,
@@ -207,7 +207,7 @@ class api_client {
207
  return false;
208
 
209
  $this->request = new Polldaddy_Access( array(
210
- // 'demands' => new Polldaddy_Demands( array( 'demand' => new Polldaddy_Demand( compact( 'account' ), array( 'id' => __FUNCTION__ ) ) ) )
211
  'demands' => new Polldaddy_Demands( array( 'demand' => new Polldaddy_Demand( compact( 'account' ), array( 'id' => 'createaccount' ) ) ) )
212
  ), array(
213
  'partnerGUID' => $this->partnerGUID,
@@ -219,20 +219,19 @@ class api_client {
219
  return false;
220
  }
221
 
222
- function sync_rating( ){
223
- $pos = $this->add_request( 'syncrating', new Polldaddy_Rating( null , null ) );
224
 
225
- $this->send_request();
226
-
227
- $demand = $this->response_part( $pos );
228
 
229
- if ( is_a( $demand, 'Ghetto_XML_Object' ) && isset( $demand->rating ) ){
230
- return $demand->rating;
231
- }
232
 
233
- return false;
 
 
234
 
235
- }
 
236
 
237
  /* pdRequest: Request API Objects */
238
 
@@ -241,7 +240,7 @@ function sync_rating( ){
241
  * @return object|false Polldaddy Account or false on failure
242
  */
243
  function get_account() {
244
- // $pos = $this->add_request( __FUNCTION__ );
245
  $pos = $this->add_request( 'getaccount' );
246
  $this->send_request();
247
  $r = $this->response_part( $pos );
@@ -259,7 +258,7 @@ function sync_rating( ){
259
  if ( !$account = polldaddy_account( $args ) )
260
  return false;
261
 
262
- // $this->add_request( __FUNCTION__, $account );
263
  $this->add_request( 'updateaccount', $account );
264
  $this->send_request();
265
  if ( isset( $this->response->userCode ) )
@@ -275,10 +274,10 @@ function sync_rating( ){
275
  $start = (int) $start;
276
  $end = (int) $end;
277
  if ( !$start && !$end )
278
- // $pos = $this->add_request( __FUNCTION__ );
279
  $pos = $this->add_request( 'getpolls' );
280
  else
281
- // $pos = $this->add_request( __FUNCTION__, new Polldaddy_List( null, compact( 'start', 'end' ) ) );
282
  $pos = $this->add_request( 'getpolls', new Polldaddy_List( null, compact( 'start', 'end' ) ) );
283
  $this->send_request();
284
  $r = $this->response_part( $pos );
@@ -314,7 +313,6 @@ function sync_rating( ){
314
  }
315
  $this->send_request();
316
  $r = $this->response_part( $pos );
317
-
318
  if ( isset( $r->items ) ) {
319
  if ( isset( $r->items->item ) ) {
320
  if ( ! is_array( $r->items->item ) ) {
178
  */
179
  function get_usercode( $partnerUserID ) {
180
  $this->request = new Polldaddy_Access( array(
181
+ // 'demands' => new Polldaddy_Demands( array( 'demand' => new Polldaddy_Demand( null, array( 'id' => __FUNCTION__ ) ) ) )
182
  'demands' => new Polldaddy_Demands( array( 'demand' => new Polldaddy_Demand( null, array( 'id' => 'getusercode' ) ) ) )
183
  ), array(
184
  'partnerGUID' => $this->partnerGUID,
207
  return false;
208
 
209
  $this->request = new Polldaddy_Access( array(
210
+ // 'demands' => new Polldaddy_Demands( array( 'demand' => new Polldaddy_Demand( compact( 'account' ), array( 'id' => __FUNCTION__ ) ) ) )
211
  'demands' => new Polldaddy_Demands( array( 'demand' => new Polldaddy_Demand( compact( 'account' ), array( 'id' => 'createaccount' ) ) ) )
212
  ), array(
213
  'partnerGUID' => $this->partnerGUID,
219
  return false;
220
  }
221
 
222
+ function sync_rating( ){
223
+ $pos = $this->add_request( 'syncrating', new Polldaddy_Rating( null , null ) );
224
 
225
+ $this->send_request();
 
 
226
 
227
+ $demand = $this->response_part( $pos );
 
 
228
 
229
+ if ( is_a( $demand, 'Ghetto_XML_Object' ) && isset( $demand->rating ) ){
230
+ return $demand->rating;
231
+ }
232
 
233
+ return false;
234
+ }
235
 
236
  /* pdRequest: Request API Objects */
237
 
240
  * @return object|false Polldaddy Account or false on failure
241
  */
242
  function get_account() {
243
+ // $pos = $this->add_request( __FUNCTION__ );
244
  $pos = $this->add_request( 'getaccount' );
245
  $this->send_request();
246
  $r = $this->response_part( $pos );
258
  if ( !$account = polldaddy_account( $args ) )
259
  return false;
260
 
261
+ // $this->add_request( __FUNCTION__, $account );
262
  $this->add_request( 'updateaccount', $account );
263
  $this->send_request();
264
  if ( isset( $this->response->userCode ) )
274
  $start = (int) $start;
275
  $end = (int) $end;
276
  if ( !$start && !$end )
277
+ // $pos = $this->add_request( __FUNCTION__ );
278
  $pos = $this->add_request( 'getpolls' );
279
  else
280
+ // $pos = $this->add_request( __FUNCTION__, new Polldaddy_List( null, compact( 'start', 'end' ) ) );
281
  $pos = $this->add_request( 'getpolls', new Polldaddy_List( null, compact( 'start', 'end' ) ) );
282
  $this->send_request();
283
  $r = $this->response_part( $pos );
313
  }
314
  $this->send_request();
315
  $r = $this->response_part( $pos );
 
316
  if ( isset( $r->items ) ) {
317
  if ( isset( $r->items->item ) ) {
318
  if ( ! is_array( $r->items->item ) ) {
polldaddy-org.php CHANGED
@@ -81,7 +81,7 @@ class WPORG_Polldaddy extends WP_Polldaddy {
81
 
82
  $this->set_api_user_code();
83
 
84
- if ( 'polls' === $page || 'pollsettings' === $page ) {
85
  switch ( $action ) {
86
  case 'update-options' :
87
  if ( !$is_POST )
@@ -117,12 +117,6 @@ class WPORG_Polldaddy extends WP_Polldaddy {
117
  $polldaddy->update_partner_account( $partner );
118
  update_option( 'polldaddy_multiple_accounts', $polldaddy_multiple_accounts );
119
  update_option( 'polldaddy_load_poll_inline', $polldaddy_load_poll_inline );
120
-
121
- $rating_title_filter = '';
122
- if ( isset( $_POST['polldaddy-ratings-title-filter'] ) )
123
- $rating_title_filter = sanitize_text_field( $_POST['polldaddy-ratings-title-filter'] );
124
-
125
- update_option( 'pd-rating-title-filter', $rating_title_filter );
126
  }
127
  break;
128
  } //end switch
@@ -658,7 +652,7 @@ function polldaddy_login_warning() {
658
  return;
659
  }
660
 
661
- echo '<div class="updated"><p><strong>' . sprintf( __( 'Warning! The Crowdsignal plugin must be linked to your Crowdsignal.com account. Please visit the <a href="%s">plugin settings page</a> to login.', 'polldaddy' ), admin_url( 'options-general.php?page=pollsettings' ) ) . '</strong></p></div>';
662
  }
663
  add_action( 'admin_notices', 'polldaddy_login_warning' );
664
 
81
 
82
  $this->set_api_user_code();
83
 
84
+ if ( 'polls' === $page || 'crowdsignal-settings' === $page ) {
85
  switch ( $action ) {
86
  case 'update-options' :
87
  if ( !$is_POST )
117
  $polldaddy->update_partner_account( $partner );
118
  update_option( 'polldaddy_multiple_accounts', $polldaddy_multiple_accounts );
119
  update_option( 'polldaddy_load_poll_inline', $polldaddy_load_poll_inline );
 
 
 
 
 
 
120
  }
121
  break;
122
  } //end switch
652
  return;
653
  }
654
 
655
+ echo '<div class="updated"><p><strong>' . sprintf( __( 'Warning! The Crowdsignal plugin must be linked to your Crowdsignal.com account. Please visit the <a href="%s">plugin settings page</a> to login.', 'polldaddy' ), admin_url( 'options-general.php?page=crowdsignal-settings' ) ) . '</strong></p></div>';
656
  }
657
  add_action( 'admin_notices', 'polldaddy_login_warning' );
658
 
polldaddy.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Create and manage Crowdsignal polls and ratings in WordPress
6
  * Author: Automattic, Inc.
7
  * Author URL: https://crowdsignal.com/
8
- * Version: 3.0.1
9
  */
10
 
11
  // To hardcode your Polldaddy PartnerGUID (API Key), add the (uncommented) line below with the PartnerGUID to your `wp-config.php`
@@ -157,6 +157,10 @@ class WP_Polldaddy {
157
  }
158
 
159
  function admin_menu() {
 
 
 
 
160
  add_action( 'wp_enqueue_scripts', array( &$this, 'register_polldaddy_styles' ) );
161
  add_action( 'admin_enqueue_scripts', array( &$this, 'menu_alter' ) );
162
 
@@ -195,7 +199,7 @@ class WP_Polldaddy {
195
  }
196
 
197
  // Add settings pages.
198
- foreach( array( 'pollsettings' => __( 'Crowdsignal', 'polldaddy' ), 'ratingsettings' => __( 'Ratings', 'polldaddy' ) ) as $menu_slug => $page_title ) {
199
  // translators: %s placeholder is the setting page type (Poll or Rating).
200
  $settings_page_title = sprintf( esc_html__( '%s', 'polldaddy' ), $page_title );
201
  $hook = add_options_page( $settings_page_title, $settings_page_title, $menu_slug == 'ratings' ? 'manage_options' : $capability, $menu_slug, array( $this, 'settings_page' ) );
@@ -434,9 +438,38 @@ class WP_Polldaddy {
434
  wp_reset_vars( array( 'page', 'action', 'poll', 'style', 'rating', 'id' ) );
435
  global $plugin_page, $page, $action, $poll, $style, $rating, $id, $wp_locale;
436
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
  $this->set_api_user_code();
438
 
439
- if ( empty( $this->user_code ) && 'pollsettings' === $page && 'options' !== $action ) {
440
  // one last try to get the user code automatically if possible
441
  $this->user_code = apply_filters_ref_array( 'polldaddy_get_user_code', array( $this->user_code, &$this ) );
442
  if ( false == $this->user_code && $action != 'restore-account' )
@@ -445,16 +478,324 @@ class WP_Polldaddy {
445
 
446
  require_once WP_POLLDADDY__POLLDADDY_CLIENT_PATH;
447
 
 
 
 
 
448
  wp_enqueue_style( 'wp-components' );
449
  wp_enqueue_script( 'polls', "{$this->base_url}js/polldaddy.js", array( 'jquery', 'jquery-ui-sortable', 'jquery-form', 'wp-components' ), $this->version );
450
  wp_enqueue_script( 'polls-common', "{$this->base_url}js/common.js", array(), $this->version );
451
 
452
  if ( $page == 'polls' ) {
453
- if ( !$this->is_author && in_array( $action, array( 'edit', 'edit-poll', 'create-poll', 'edit-style', 'create-style', 'list-styles', 'options', 'update-options', 'import-account' ) ) ) {//check user privileges has access to action
454
  $action = '';
455
  }
456
 
457
  switch ( $action ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
458
  case 'edit' :
459
  case 'edit-poll' :
460
  case 'create-poll' :
@@ -477,8 +818,8 @@ class WP_Polldaddy {
477
  $plugin_page = 'polls&action=list-styles';
478
  break;
479
  }//end switch
480
- } elseif ( $page == 'pollsettings' ) {
481
- $plugin_page = 'pollsettings';
482
  } elseif ( $page == 'ratings' ) {
483
  if ( empty( $action ) ) {
484
  $action = 'reports';
@@ -540,8 +881,13 @@ class WP_Polldaddy {
540
 
541
  $is_POST = 'post' == strtolower( $_SERVER['REQUEST_METHOD'] );
542
 
543
- if ( 'polls' === $page || 'pollsettings' === $page ) {
544
  switch ( $action ) {
 
 
 
 
 
545
  case 'reset-account' : // reset everything
546
  global $current_user;
547
  check_admin_referer( 'polldaddy-reset' . $this->id );
@@ -1281,9 +1627,13 @@ class WP_Polldaddy {
1281
  $message = sprintf( _n( '%s Style Deleted.', '%s Custom Styles Deleted.', $deleted, 'polldaddy' ), number_format_i18n( $deleted ) );
1282
  }
1283
  break;
 
1284
  case 'imported-account' :
1285
  $message = __( 'Account Linked.', 'polldaddy' );
1286
  break;
 
 
 
1287
  case 'updated-options' :
1288
  $message = __( 'Options Updated.', 'polldaddy' );
1289
  break;
@@ -1319,9 +1669,9 @@ class WP_Polldaddy {
1319
 
1320
  if ( !$message )
1321
  return;
1322
- ?>
1323
  <div class='updated'><p><?php echo $message; ?></p></div>
1324
- <?php
1325
  $this->print_errors();
1326
  }
1327
 
@@ -1329,7 +1679,6 @@ class WP_Polldaddy {
1329
  global $page, $action;
1330
  ?>
1331
  <div class="wrap" id="manage-polls">
1332
- <div class="cs-pre-wrap"></div>
1333
  <div class="cs-wrapper">
1334
  <?php
1335
  $this->set_api_user_code();
@@ -1337,7 +1686,7 @@ class WP_Polldaddy {
1337
  if ( isset( $_GET['page'] ) ) { // phpcs:ignore
1338
  $page = $_GET['page']; // phpcs:ignore
1339
  }
1340
- if ( 'pollsettings' === $page ) {
1341
  if ( ! $this->is_author ) { // check user privileges has access to action.
1342
  return;
1343
  }
@@ -3953,7 +4302,7 @@ class WP_Polldaddy {
3953
  $previous_settings = get_option( 'polldaddy_settings' );
3954
  $current_setting = get_option( 'pd-rating-posts-id' );
3955
  if ( $current_setting && isset( $previous_settings[ 'pd-rating-posts-id' ] ) && $current_setting != $previous_settings[ 'pd-rating-posts-id' ] ) {
3956
- echo "<p>" . sprintf( __( "Previous settings for ratings on this site discovered. You can restore them on the <a href='%s'>poll settings page</a> if your site is missing ratings after resetting your connection settings.", 'polldaddy' ), "options-general.php?page=pollsettings" ) . "</p>";
3957
  }
3958
  ?>
3959
  </div>
@@ -4905,16 +5254,38 @@ class WP_Polldaddy {
4905
 
4906
  $this->print_errors();
4907
 
4908
- $this->render_partial(
4909
- 'settings',
4910
- array(
4911
- 'is_connected' => $connected,
4912
- 'poll' => $poll,
4913
- 'options' => $options,
4914
- 'controller' => $this,
4915
- 'account_email' => $account_email,
4916
- )
4917
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4918
  }
4919
 
4920
  function plugin_options_add() {}
@@ -4960,7 +5331,7 @@ class WP_Polldaddy {
4960
  echo '<h1>' . $message . '</h1>';
4961
  echo '<p>' . __( "There are a few things you can do:" );
4962
  echo "<ul><ol>" . __( "Press reload on your browser and reload this page. There may have been a temporary problem communicating with Crowdsignal.com", "polldaddy" ) . "</ol>";
4963
- echo "<ol>" . sprintf( __( "Go to the <a href='%s'>poll settings page</a>, scroll to the end of the page and reset your connection settings. Link your account again with the same API key.", "polldaddy" ), 'options-general.php?page=pollsettings' ) . "</ol>";
4964
  echo "<ol>" . sprintf( __( 'Contact <a href="%1$s" %2$s>Crowdsignal support</a> and tell them your rating usercode is %3$s', 'polldaddy' ), 'https://crowdsignal.com/feedback/', 'target="_blank"', $this->rating_user_code ) . '<br />' . __( 'Also include the following information when contacting support to help us resolve your problem as quickly as possible:', 'polldaddy' ) . '';
4965
  echo "<ul><li> API Key: " . get_option( 'polldaddy_api_key' ) . "</li>";
4966
  echo "<li> ID Usercode: " . get_option( 'pd-usercode-' . $current_user->ID ) . "</li>";
5
  * Description: Create and manage Crowdsignal polls and ratings in WordPress
6
  * Author: Automattic, Inc.
7
  * Author URL: https://crowdsignal.com/
8
+ * Version: 3.0.4
9
  */
10
 
11
  // To hardcode your Polldaddy PartnerGUID (API Key), add the (uncommented) line below with the PartnerGUID to your `wp-config.php`
157
  }
158
 
159
  function admin_menu() {
160
+ if ( isset( $_GET['page'] ) && 'pollsettings' === $_GET['page'] ) {
161
+ wp_safe_redirect( admin_url( 'options-general.php?page=crowdsignal-settings' ) );
162
+ die();
163
+ }
164
  add_action( 'wp_enqueue_scripts', array( &$this, 'register_polldaddy_styles' ) );
165
  add_action( 'admin_enqueue_scripts', array( &$this, 'menu_alter' ) );
166
 
199
  }
200
 
201
  // Add settings pages.
202
+ foreach( array( 'crowdsignal-settings' => __( 'Crowdsignal', 'polldaddy' ), 'ratingsettings' => __( 'Ratings', 'polldaddy' ) ) as $menu_slug => $page_title ) {
203
  // translators: %s placeholder is the setting page type (Poll or Rating).
204
  $settings_page_title = sprintf( esc_html__( '%s', 'polldaddy' ), $page_title );
205
  $hook = add_options_page( $settings_page_title, $settings_page_title, $menu_slug == 'ratings' ? 'manage_options' : $capability, $menu_slug, array( $this, 'settings_page' ) );
438
  wp_reset_vars( array( 'page', 'action', 'poll', 'style', 'rating', 'id' ) );
439
  global $plugin_page, $page, $action, $poll, $style, $rating, $id, $wp_locale;
440
 
441
+ if (
442
+ isset( $_GET['step'] ) && 2 === (int) $_GET['step']
443
+ && isset( $_SERVER['REQUEST_METHOD'] ) && 'POST' === $_SERVER['REQUEST_METHOD']
444
+ && isset( $_POST['got_api_key'] ) && get_option( 'crowdsignal_api_key_secret' ) === $_POST['got_api_key']
445
+ && isset( $_POST['api_key'] )
446
+ ) {
447
+ $api_key = sanitize_key( wp_unslash( $_POST['api_key'] ) );
448
+ $crowdsignal = $this->get_client( $api_key );
449
+ $crowdsignal->reset();
450
+ $usercode = $crowdsignal->get_usercode( $this->id );
451
+ if ( $usercode ) {
452
+ update_option( 'polldaddy_api_key', $api_key );
453
+ update_option( 'crowdsignal_api_key', $api_key );
454
+ update_option( 'crowdsignal_user_code', $usercode );
455
+ update_option( 'pd-usercode-' . $this->id, $usercode );
456
+ delete_option( 'crowdsignal_api_key_secret' );
457
+ $connected = true;
458
+ } else {
459
+ $connected = false;
460
+ }
461
+ $this->render_partial(
462
+ 'html-admin-setup-step-2',
463
+ array(
464
+ 'is_connected' => $connected,
465
+ )
466
+ );
467
+ die();
468
+ }
469
+
470
  $this->set_api_user_code();
471
 
472
+ if ( empty( $this->user_code ) && 'crowdsignal-settings' === $page && 'options' !== $action ) {
473
  // one last try to get the user code automatically if possible
474
  $this->user_code = apply_filters_ref_array( 'polldaddy_get_user_code', array( $this->user_code, &$this ) );
475
  if ( false == $this->user_code && $action != 'restore-account' )
478
 
479
  require_once WP_POLLDADDY__POLLDADDY_CLIENT_PATH;
480
 
481
+ wp_enqueue_style( 'jetpack-styles1', 'https://c0.wp.com/p/jetpack/10.0/_inc/build/style.min.css', array(), '1.5.7' );
482
+ wp_enqueue_style( 'jetpack-styles2', 'https://c0.wp.com/c/5.8.1/wp-admin/css/common.min.css', array(), '1.5.7' );
483
+ wp_enqueue_style( 'jetpack-styles3', 'https://c0.wp.com/p/jetpack/10.0/_inc/build/admin.css', array(), '1.5.7' );
484
+ wp_enqueue_style( 'admin-styles', plugin_dir_url( __FILE__ ) . '/admin-styles.css', array(), '1.5.12' );
485
  wp_enqueue_style( 'wp-components' );
486
  wp_enqueue_script( 'polls', "{$this->base_url}js/polldaddy.js", array( 'jquery', 'jquery-ui-sortable', 'jquery-form', 'wp-components' ), $this->version );
487
  wp_enqueue_script( 'polls-common', "{$this->base_url}js/common.js", array(), $this->version );
488
 
489
  if ( $page == 'polls' ) {
490
+ if ( !$this->is_author && in_array( $action, array( 'edit', 'edit-poll', 'create-poll', 'edit-style', 'create-style', 'list-styles', 'options', 'update-options', 'import-account', 'create-block-poll' ) ) ) {//check user privileges has access to action
491
  $action = '';
492
  }
493
 
494
  switch ( $action ) {
495
+ case 'create-block-poll':
496
+ $post_id = wp_insert_post(
497
+ array(
498
+ 'post_title' => esc_html__( 'Crowdsignal blocks in WordPress' ),
499
+
500
+ 'post_content' => '
501
+ <!-- wp:paragraph -->
502
+ <p>Welcome to this little demo page! We would love to introduce you to our set of Crowdsignal blocks and created this post for you, so that you can test and play with all of them right inside of your editor. </p>
503
+ <!-- /wp:paragraph -->
504
+
505
+ <!-- wp:paragraph -->
506
+ <p><a href="https://wordpress.org/support/article/how-to-use-the-preview-function/">Preview this post</a> if you would like to test the Crowdsignal blocks from your visitors perspective. <em>Oh and please feel free to delete this draft post anytime</em>, it was only created for demo purposes.</p>
507
+ <!-- /wp:paragraph -->
508
+
509
+ <!-- wp:spacer {"height":60} -->
510
+ <div style="height:60px" aria-hidden="true" class="wp-block-spacer"></div>
511
+ <!-- /wp:spacer -->
512
+
513
+ <!-- wp:heading -->
514
+ <h2>Overview</h2>
515
+ <!-- /wp:heading -->
516
+
517
+ <!-- wp:paragraph -->
518
+ <p>Let\'s start with a quick overview of all our current blocks available in your WordPress editor. You can <a href="https://wordpress.com/support/wordpress-editor/">find all these blocks inside your block library via searching</a> for their name or simply by searching "Crowdsignal".</p>
519
+ <!-- /wp:paragraph -->
520
+
521
+ <!-- wp:image {"align":"wide","id":241,"sizeSlug":"full","linkDestination":"none"} -->
522
+ <figure class="wp-block-image alignwide size-full"><img src="https://crowdsignal.files.wordpress.com/2021/11/crowdsignalcards.png" alt="" class="wp-image-241"/></figure>
523
+ <!-- /wp:image -->
524
+
525
+ <!-- wp:paragraph -->
526
+ <p>If you want to learn more about Crowdsignal please go to <a href="https://crowdsignal.com" data-type="URL" data-id="https://crowdsignal.com">crowdsignal.com</a> and join our little <a href="https://crowdsignalfeedback.wordpress.com/">community</a> all about feedback here.</p>
527
+ <!-- /wp:paragraph -->
528
+
529
+ <!-- wp:spacer {"height":60} -->
530
+ <div style="height:60px" aria-hidden="true" class="wp-block-spacer"></div>
531
+ <!-- /wp:spacer -->
532
+
533
+ <!-- wp:heading -->
534
+ <h2>Polls</h2>
535
+ <!-- /wp:heading -->
536
+
537
+ <!-- wp:paragraph -->
538
+ <p>We all have opinions! Curious about the opinion of your audience? Start asking with our poll block. It makes creating a poll as fast and simple as listing bullet points.</p>
539
+ <!-- /wp:paragraph -->
540
+
541
+ <!-- wp:paragraph -->
542
+ <p>&nbsp;You can choose between a button or a list style for your answer options, and you can fully customize the styling of the block. &nbsp;By default the poll block will support your theme styling, but it’s up to you if you want to keep it. You can customize the style how you want, from font-family to border colours.</p>
543
+ <!-- /wp:paragraph -->
544
+
545
+ <!-- wp:paragraph -->
546
+ <p>Just click in the poll below and start editing. </p>
547
+ <!-- /wp:paragraph -->
548
+
549
+ <!-- wp:crowdsignal-forms/poll {"pollId":"","title":"Demo Poll block","question":"What do you think about this demo page","answers":[{"text":"Super useful","answerId":""},{"text":"Not sure yet","answerId":""},{"text":"I don\'t like it","answerId":""}],"borderWidth":5,"borderRadius":5,"hasBoxShadow":true,"fontFamily":"Open+Sans","className":"is-style-buttons"} /-->
550
+
551
+ <!-- wp:paragraph -->
552
+ <p>And everything else you expect from a Crowdsignal poll is also available — such as setting “single answer” or “multiple answer” choices, a customised confirmation message, poll timeframe, and avoidance of double voting.</p>
553
+ <!-- /wp:paragraph -->
554
+
555
+ <!-- wp:paragraph -->
556
+ <p>Here is a short demo video for how to set up this block, not that you would need it ;) </p>
557
+ <!-- /wp:paragraph -->
558
+
559
+ <!-- wp:video {"align":"center","className":"wp-block-embed is-type-video is-provider-videopress"} -->
560
+ <figure class="wp-block-video aligncenter wp-block-embed is-type-video is-provider-videopress"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-poll-tutorial-720.mp4"></video></figure>
561
+ <!-- /wp:video -->
562
+
563
+ <!-- wp:spacer {"height":60} -->
564
+ <div style="height:60px" aria-hidden="true" class="wp-block-spacer"></div>
565
+ <!-- /wp:spacer -->
566
+
567
+ <!-- wp:heading -->
568
+ <h2>Feedback Button</h2>
569
+ <!-- /wp:heading -->
570
+
571
+ <!-- wp:paragraph -->
572
+ <p>You might have spotted it already, in the bottom left corner of this page: Our Feedback button.</p>
573
+ <!-- /wp:paragraph -->
574
+
575
+ <!-- wp:paragraph -->
576
+ <p>This is a floating button that lives above your site\'s content. Always visible this button makes giving feedback easy! User can send you a message and provide their email address so you could can get back to them. Needless to say that you can fully customize the design and text, including the label of the button itself. Feel free to make it a "Contact me" or "Say hello" button or anything you like.</p>
577
+ <!-- /wp:paragraph -->
578
+
579
+ <!-- wp:paragraph -->
580
+ <p>And yes, you can change its placement! You can put the button in any corner of your site. Just try it! Click in the feedback and start editing.</p>
581
+ <!-- /wp:paragraph -->
582
+
583
+ <!-- wp:paragraph -->
584
+ <p>Don\'t miss out on your customers\' feedback. Keep your door open anytime and place a feedback button on all your pages. </p>
585
+ <!-- /wp:paragraph -->
586
+
587
+ <!-- wp:video {"align":"center","className":"wp-block-embed is-type-video is-provider-videopress"} -->
588
+ <figure class="wp-block-video aligncenter wp-block-embed is-type-video is-provider-videopress"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-feedback-button-tutorial.mp4"></video></figure>
589
+ <!-- /wp:video -->
590
+
591
+ <!-- wp:spacer {"height":60} -->
592
+ <div style="height:60px" aria-hidden="true" class="wp-block-spacer"></div>
593
+ <!-- /wp:spacer -->
594
+
595
+ <!-- wp:heading -->
596
+ <h2>Voting</h2>
597
+ <!-- /wp:heading -->
598
+
599
+ <!-- wp:paragraph -->
600
+ <p>Sometimes we need just quick and fast feedback from our audience. A quick voting button might be all you need. Fully customizable of course.</p>
601
+ <!-- /wp:paragraph -->
602
+
603
+ <!-- wp:paragraph -->
604
+ <p>There is already a “like” button at the end of a WordPress post that you can click to express satisfaction or agreement. But what if you want to ask readers their opinion on a subject in the middle of a post? Or what if you want to present several ideas and find out which one is the most popular? Wouldn’t it be great to ask readers what they think without having to leave the editor or switch to another service or plugin?</p>
605
+ <!-- /wp:paragraph -->
606
+
607
+ <!-- wp:paragraph -->
608
+ <p>That’s what we thought! Say hello to our Voting Block:</p>
609
+ <!-- /wp:paragraph -->
610
+
611
+ <!-- wp:crowdsignal-forms/vote {"pollId":"","title":"Demo Vote block"} -->
612
+ <!-- wp:crowdsignal-forms/vote-item {"answerId":"","type":"up","textColor":"#066127","borderColor":"#066127"} /-->
613
+
614
+ <!-- wp:crowdsignal-forms/vote-item {"answerId":"","type":"down","textColor":"#c6302e","borderColor":"#c6302e"} /-->
615
+ <!-- /wp:crowdsignal-forms/vote -->
616
+
617
+ <!-- wp:paragraph -->
618
+ <p>It’s a simple block that adds two voting buttons—thumbs up, thumbs down—to your post wherever you want to place them. Customize the block in different sizes and colors, with or without a border, and with or without a visible vote counter. Put several in a single post, next to different ideas, to see how they stack up for readers. Make the block your own!</p>
619
+ <!-- /wp:paragraph -->
620
+
621
+ <!-- wp:video {"align":"center","className":"wp-block-embed is-type-video is-provider-videopress"} -->
622
+ <figure class="wp-block-video aligncenter wp-block-embed is-type-video is-provider-videopress"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-vote-tutorial.mp4"></video></figure>
623
+ <!-- /wp:video -->
624
+
625
+ <!-- wp:spacer {"height":60} -->
626
+ <div style="height:60px" aria-hidden="true" class="wp-block-spacer"></div>
627
+ <!-- /wp:spacer -->
628
+
629
+ <!-- wp:heading -->
630
+ <h2>Applause</h2>
631
+ <!-- /wp:heading -->
632
+
633
+ <!-- wp:image {"sizeSlug":"large"} -->
634
+ <figure class="wp-block-image size-large"><img src="https://crowdsignal.files.wordpress.com/2021/11/17claps-small.gif" alt=""/></figure>
635
+ <!-- /wp:image -->
636
+
637
+ <!-- wp:paragraph -->
638
+ <p>The Applause block is a simpler and more playful version of our Voting block. The main differences are users only being able to give positive feedback and encouraging users to “make as much noise as they want”. Meaning this block does not only allow repeated voting, but even encourages it.</p>
639
+ <!-- /wp:paragraph -->
640
+
641
+ <!-- wp:paragraph -->
642
+ <p>Let your audience make some noise with a big round of applause.</p>
643
+ <!-- /wp:paragraph -->
644
+
645
+ <!-- wp:crowdsignal-forms/applause {"pollId":"","title":"Demo Applause block","answerId":"","size":"large","borderWidth":1,"borderRadius":5} /-->
646
+
647
+ <!-- wp:paragraph -->
648
+ <p><a href="https://wordpress.org/support/article/how-to-use-the-preview-function/">Preview this post</a> and try clapping yourself! It\'s fun.</p>
649
+ <!-- /wp:paragraph -->
650
+
651
+ <!-- wp:paragraph -->
652
+ <p>The block currently comes in three different sizes, and can be customised with a button-like styling, including a border, border radius and some colour customisation options.</p>
653
+ <!-- /wp:paragraph -->
654
+
655
+ <!-- wp:video {"align":"center","className":"wp-block-embed is-type-video is-provider-videopress"} -->
656
+ <figure class="wp-block-video aligncenter wp-block-embed is-type-video is-provider-videopress"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-applause-block-tutorial.mp4"></video></figure>
657
+ <!-- /wp:video -->
658
+
659
+ <!-- wp:spacer {"height":60} -->
660
+ <div style="height:60px" aria-hidden="true" class="wp-block-spacer"></div>
661
+ <!-- /wp:spacer -->
662
+
663
+ <!-- wp:heading -->
664
+ <h2>Embed Surveys &amp; Forms</h2>
665
+ <!-- /wp:heading -->
666
+
667
+ <!-- wp:paragraph -->
668
+ <p>So far we only talked about quick and fast ways to collect feedback or opinions from your audience. But what if you have many questions or want to create simple forms? You can do this with Crowdsignal, too! Create a survey or form on app.crowdsignal.com and embed it into your WordPress post or site. Similar like here:</p>
669
+ <!-- /wp:paragraph -->
670
+
671
+ <!-- wp:embed {"url":"https://crowdsignal.survey.fm/product-market-fit-score","type":"rich","providerNameSlug":"crowdsignal","responsive":true,"align":"wide"} -->
672
+ <figure class="wp-block-embed alignwide is-type-rich is-provider-crowdsignal wp-block-embed-crowdsignal"><div class="wp-block-embed__wrapper">
673
+ https://crowdsignal.survey.fm/product-market-fit-score
674
+ </div></figure>
675
+ <!-- /wp:embed -->
676
+
677
+ <!-- wp:paragraph -->
678
+ <p>The Crowdsignal survey above was embedded using our "Single question per page mode."&nbsp;It’s exactly what it sounds like: In this mode, no matter how many questions your survey has, your respondents will always see one question at a time. Single Mode shines when you embed a survey into your website or blog post. Surveys with multiple questions can take up a lot of space, overwhelming your site. If you’re not sure whether your readers will take the survey at all, it disrupts the reading experience. With Single Mode, a survey&nbsp; uses the same amount of space as an image, even a really long survey.</p>
679
+ <!-- /wp:paragraph -->
680
+
681
+ <!-- wp:paragraph -->
682
+ <p>Once they provide an answer (or skip the question),&nbsp; the next question loads. It has a playful&nbsp; feel, like flipping through a slide show. Every answered question feels like progress.</p>
683
+ <!-- /wp:paragraph -->
684
+
685
+ <!-- wp:paragraph -->
686
+ <p>You can choose between several transition options, and decide whether the questions should move from top to bottom, or from left to right.</p>
687
+ <!-- /wp:paragraph -->
688
+
689
+ <!-- wp:paragraph -->
690
+ <p><strong>Ready to create one? Here’s how:</strong></p>
691
+ <!-- /wp:paragraph -->
692
+
693
+ <!-- wp:paragraph -->
694
+ <p>- Go to <a href="https://app.crowdsignal.com/dashboard">app.crowdsignal.com</a> (we will log you in with your WordPress.com account - magic ;)) .</p>
695
+ <!-- /wp:paragraph -->
696
+
697
+ <!-- wp:paragraph -->
698
+ <p>- Create a new survey.</p>
699
+ <!-- /wp:paragraph -->
700
+
701
+ <!-- wp:paragraph -->
702
+ <p>- In the Editor, choose “Single Mode” at the top left.</p>
703
+ <!-- /wp:paragraph -->
704
+
705
+ <!-- wp:paragraph -->
706
+ <p>- Then create as many questions as you like and style your theme.</p>
707
+ <!-- /wp:paragraph -->
708
+
709
+ <!-- wp:paragraph -->
710
+ <p>- When you are ready click on Sharing and copy the URL of your survey.</p>
711
+ <!-- /wp:paragraph -->
712
+
713
+ <!-- wp:paragraph -->
714
+ <p>- Go back to your WordPress editor and paste the URL of your survey into your post</p>
715
+ <!-- /wp:paragraph -->
716
+
717
+ <!-- wp:paragraph -->
718
+ <p>- Done! Your survey will appear in your post.</p>
719
+ <!-- /wp:paragraph -->
720
+
721
+ <!-- wp:paragraph -->
722
+ <p>Here is a short demo video for you that shows you how it works in less than a minute:</p>
723
+ <!-- /wp:paragraph -->
724
+
725
+ <!-- wp:video {"align":"center","className":"wp-block-embed is-type-video is-provider-videopress"} -->
726
+ <figure class="wp-block-video aligncenter wp-block-embed is-type-video is-provider-videopress"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-survey-tutorial-yt.mp4"></video></figure>
727
+ <!-- /wp:video -->
728
+
729
+ <!-- wp:spacer {"height":60} -->
730
+ <div style="height:60px" aria-hidden="true" class="wp-block-spacer"></div>
731
+ <!-- /wp:spacer -->
732
+
733
+ <!-- wp:heading -->
734
+ <h2>Measure NPS</h2>
735
+ <!-- /wp:heading -->
736
+
737
+ <!-- wp:paragraph -->
738
+ <p>While we are driving our projects, working hard on our products, we all wonder: How are we doing? Are people satisfied with our service? Are we doing better since last month?&nbsp;</p>
739
+ <!-- /wp:paragraph -->
740
+
741
+ <!-- wp:paragraph -->
742
+ <p>Sometimes you want to measure your progress over time. <a href="https://crowdsignal.com/2021/03/16/measure-nps/">Measure and monitor the customer satisfaction and growth potential of your product with a Net Promoter Score</a>. </p>
743
+ <!-- /wp:paragraph -->
744
+
745
+ <!-- wp:paragraph -->
746
+ <p>We have built a Gutenberg block for you that makes it easier than ever before to track your Net Promoter Score on WordPress. If you have <a href="https://wordpress.org/support/article/how-to-use-the-preview-function/">previewed this post</a> before, you might have seen the NPS question already in a modal window. </p>
747
+ <!-- /wp:paragraph -->
748
+
749
+ <!-- wp:crowdsignal-forms/nps {"surveyId":"","title":"Demo NPS block","viewThreshold":"2"} /-->
750
+
751
+ <!-- wp:paragraph -->
752
+ <p>The moment you add the block, you are basically done. The design of the block is based on your site’s theme. You can still customize the styling of the block, or edit the questions, but that might not even be necessary.</p>
753
+ <!-- /wp:paragraph -->
754
+
755
+ <!-- wp:paragraph -->
756
+ <p>To get the most out of your NPS data, it is important to show the question only to users that are already familiar with your service or product. You can configure the block to only show to repeat visitors. It’s more likely you will get feedback from someone who knows what they are talking about, and you can make sure new users are not interrupted during their first visit to your site.</p>
757
+ <!-- /wp:paragraph -->
758
+
759
+ <!-- wp:paragraph -->
760
+ <p>After you publish the block go to the results page of the block and monitor your results. We have built a special results page for you to track your NPS score and to analyse any additional feedback. </p>
761
+ <!-- /wp:paragraph -->
762
+
763
+ <!-- wp:image {"sizeSlug":"large"} -->
764
+ <figure class="wp-block-image size-large"><img src="https://s0.wp.com/wp-content/themes/a8c/crowd-signal/assets/images/AnalyseResults.png" alt=""/></figure>
765
+ <!-- /wp:image -->
766
+
767
+ <!-- wp:paragraph -->
768
+ <p>We provide an analytics dashboard with our block that automatically calculates the Net Promoter Score for you in real-time and allows you to monitor your score over time. Are the differences geographic? Filter your results based on countries.</p>
769
+ <!-- /wp:paragraph -->
770
+
771
+ <!-- wp:paragraph -->
772
+ <p>By the way, did you know you also can get email notifications or a ping in your Slack channel any time you get an NPS rating? Just click on the little “connect” button on your results page.</p>
773
+ <!-- /wp:paragraph -->
774
+
775
+ <!-- wp:paragraph -->
776
+ <p>Here is a quick tutorial video on how it works.</p>
777
+ <!-- /wp:paragraph -->
778
+
779
+ <!-- wp:video {"align":"center","className":"wp-block-embed is-type-video is-provider-videopress"} -->
780
+ <figure class="wp-block-video aligncenter wp-block-embed is-type-video is-provider-videopress"><video controls src="https://crowdsignal.files.wordpress.com/2021/11/add-nps-tutorial-long-3.mp4"></video></figure>
781
+ <!-- /wp:video -->
782
+
783
+ <!-- wp:crowdsignal-forms/feedback {"surveyId":"","title":"Demo Feedback block"} /-->
784
+
785
+ <!-- wp:paragraph -->
786
+ <p></p>
787
+ <!-- /wp:paragraph -->
788
+ ',
789
+ )
790
+ );
791
+ if ( ! is_wp_error( $post_id ) ) {
792
+ wp_safe_redirect( admin_url( 'post.php?post=' . intval( $post_id ) . '&action=edit' ) );
793
+ } else {
794
+ // admin.php?page=polls
795
+ // wp_safe_redirect( admin_url( 'admin.php?page=polls' ) );
796
+ }
797
+ break;
798
+
799
  case 'edit' :
800
  case 'edit-poll' :
801
  case 'create-poll' :
818
  $plugin_page = 'polls&action=list-styles';
819
  break;
820
  }//end switch
821
+ } elseif ( $page == 'crowdsignal-settings' ) {
822
+ $plugin_page = 'crowdsignal-settings';
823
  } elseif ( $page == 'ratings' ) {
824
  if ( empty( $action ) ) {
825
  $action = 'reports';
881
 
882
  $is_POST = 'post' == strtolower( $_SERVER['REQUEST_METHOD'] );
883
 
884
+ if ( 'polls' === $page || 'crowdsignal-settings' === $page ) {
885
  switch ( $action ) {
886
+ case 'multi-account':
887
+ if ( ! isset( $_POST['crowdsignal_multiuser'] ) ) {
888
+ delete_option( 'polldaddy_usercode_user' );
889
+ }
890
+ break;
891
  case 'reset-account' : // reset everything
892
  global $current_user;
893
  check_admin_referer( 'polldaddy-reset' . $this->id );
1627
  $message = sprintf( _n( '%s Style Deleted.', '%s Custom Styles Deleted.', $deleted, 'polldaddy' ), number_format_i18n( $deleted ) );
1628
  }
1629
  break;
1630
+ case 'connected' :
1631
  case 'imported-account' :
1632
  $message = __( 'Account Linked.', 'polldaddy' );
1633
  break;
1634
+ case 'api-key-not-added' :
1635
+ $message = __( 'There was a problem linking your account.', 'polldaddy' );
1636
+ break;
1637
  case 'updated-options' :
1638
  $message = __( 'Options Updated.', 'polldaddy' );
1639
  break;
1669
 
1670
  if ( !$message )
1671
  return;
1672
+ ?>
1673
  <div class='updated'><p><?php echo $message; ?></p></div>
1674
+ <?php
1675
  $this->print_errors();
1676
  }
1677
 
1679
  global $page, $action;
1680
  ?>
1681
  <div class="wrap" id="manage-polls">
 
1682
  <div class="cs-wrapper">
1683
  <?php
1684
  $this->set_api_user_code();
1686
  if ( isset( $_GET['page'] ) ) { // phpcs:ignore
1687
  $page = $_GET['page']; // phpcs:ignore
1688
  }
1689
+ if ( 'crowdsignal-settings' === $page ) {
1690
  if ( ! $this->is_author ) { // check user privileges has access to action.
1691
  return;
1692
  }
4302
  $previous_settings = get_option( 'polldaddy_settings' );
4303
  $current_setting = get_option( 'pd-rating-posts-id' );
4304
  if ( $current_setting && isset( $previous_settings[ 'pd-rating-posts-id' ] ) && $current_setting != $previous_settings[ 'pd-rating-posts-id' ] ) {
4305
+ echo "<p>" . sprintf( __( "Previous settings for ratings on this site discovered. You can restore them on the <a href='%s'>poll settings page</a> if your site is missing ratings after resetting your connection settings.", 'polldaddy' ), "options-general.php?page=crowdsignal-settings" ) . "</p>";
4306
  }
4307
  ?>
4308
  </div>
5254
 
5255
  $this->print_errors();
5256
 
5257
+ $this->render_partial( 'html-admin-setup-header' );
5258
+ if ( ! $connected ) {
5259
+ update_option( 'crowdsignal_api_key_secret', md5( time() . wp_rand() ) );
5260
+ $this->render_partial( 'html-admin-setup-step-1' );
5261
+ } else {
5262
+ $this->render_partial(
5263
+ 'settings',
5264
+ array(
5265
+ 'is_connected' => $connected,
5266
+ 'api_key' => get_option( 'polldaddy_api_key' ),
5267
+ )
5268
+ );
5269
+
5270
+ if ( ! is_plugin_active( 'crowdsignal-forms/crowdsignal-forms.php' ) ) {
5271
+ $this->render_partial( 'html-admin-teaser' );
5272
+ } else {
5273
+ $this->render_partial( 'html-admin-setup-step-3' );
5274
+ }
5275
+
5276
+ $this->render_partial(
5277
+ 'settings-2',
5278
+ array(
5279
+ 'is_connected' => $connected,
5280
+ 'api_key' => get_option( 'polldaddy_api_key' ),
5281
+ 'poll' => $poll,
5282
+ 'options' => $options,
5283
+ 'controller' => $this,
5284
+ 'account_email' => $account_email,
5285
+ )
5286
+ );
5287
+ }
5288
+ $this->render_partial( 'html-admin-setup-footer' );
5289
  }
5290
 
5291
  function plugin_options_add() {}
5331
  echo '<h1>' . $message . '</h1>';
5332
  echo '<p>' . __( "There are a few things you can do:" );
5333
  echo "<ul><ol>" . __( "Press reload on your browser and reload this page. There may have been a temporary problem communicating with Crowdsignal.com", "polldaddy" ) . "</ol>";
5334
+ echo "<ol>" . sprintf( __( "Go to the <a href='%s'>poll settings page</a>, scroll to the end of the page and reset your connection settings. Link your account again with the same API key.", "polldaddy" ), 'options-general.php?page=crowdsignal-settings' ) . "</ol>";
5335
  echo "<ol>" . sprintf( __( 'Contact <a href="%1$s" %2$s>Crowdsignal support</a> and tell them your rating usercode is %3$s', 'polldaddy' ), 'https://crowdsignal.com/feedback/', 'target="_blank"', $this->rating_user_code ) . '<br />' . __( 'Also include the following information when contacting support to help us resolve your problem as quickly as possible:', 'polldaddy' ) . '';
5336
  echo "<ul><li> API Key: " . get_option( 'polldaddy_api_key' ) . "</li>";
5337
  echo "<li> ID Usercode: " . get_option( 'pd-usercode-' . $current_user->ID ) . "</li>";
rating.php CHANGED
@@ -112,15 +112,16 @@ function polldaddy_get_rating_html( $condition = '' ) {
112
  }
113
 
114
  if ( $rating_id > 0 ) {
115
- $rating_title_filter = get_option( 'pd-rating-title-filter' );
116
-
117
- if ( $rating_title_filter === false )
 
 
 
 
118
  $title = apply_filters( 'the_title', $post->post_title, $post->ID, '' );
119
- elseif ( strlen( $rating_title_filter ) > 0 )
120
- $title = apply_filters( $rating_title_filter, $post->post_title, $post->ID, '' );
121
- else
122
- $title = $post->post_title;
123
-
124
  $permalink = get_permalink( $post->ID );
125
  $html = polldaddy_get_rating_code( $rating_id, $unique_id, $title, $permalink, $item_id );
126
  }
112
  }
113
 
114
  if ( $rating_id > 0 ) {
115
+ if ( defined( 'CS_RATING_TITLE_FILTER' ) ) {
116
+ if ( strlen( constant( 'CS_RATING_TITLE_FILTER' ) ) > 0 ) {
117
+ $title = apply_filters( constant( 'CS_RATING_TITLE_FILTER' ), $post->post_title, $post->ID, '' );
118
+ } else {
119
+ $title = $post->post_title;
120
+ }
121
+ } else {
122
  $title = apply_filters( 'the_title', $post->post_title, $post->ID, '' );
123
+ }
124
+
 
 
 
125
  $permalink = get_permalink( $post->ID );
126
  $html = polldaddy_get_rating_code( $rating_id, $unique_id, $title, $permalink, $item_id );
127
  }
readme.txt CHANGED
@@ -1,59 +1,25 @@
1
- === Crowdsignal Polls & Ratings ===
2
- Contributors: eoigal, mdawaffe, donncha, johnny5, panosktn, ice9js, cgastrell
3
  Tags: crowdsignal, polls, poll, polldaddy, wppolls, vote, polling, surveys, rate, rating, ratings
4
  Requires at least: 5.5
5
  Requires PHP: 5.6
6
- Tested up to: 5.7.1
7
- Stable tag: 3.0.1
8
-
9
- Create and manage Crowdsignal polls and ratings from within WordPress.
10
 
11
  == Description ==
12
 
13
- The Crowdsignal Polls and Ratings plugin allows you to create and manage polls and ratings from within your WordPress dashboard. You can create polls, choose from 20 different styles for your polls, and view all results for your polls as they come in. All Crowdsignal polls are fully customizable, you can set a close date for your poll, create multiple choice polls, choose whether to display the results or keep them private. You can also create your own custom style for your poll. You can even embed the polls you create on other websites. You can collect unlimited votes and create unlimited polls. The new ratings menu allows you to embed ratings into your posts, pages or comments. The rating editor allows you to fully customize your rating. You can also avail of the 'Top Rated' widget that will allow you to place the widget in your sidebar. This widget will show you the top rated posts, pages and comments today, this week and this month.
14
-
15
- === And there's another plugin! ===
16
- Are you a fan of the new block editor for WordPress? Our other plugin, [Crowdsignal Forms](https://wordpress.org/plugins/crowdsignal-forms/) provides a number of good looking blocks for your site. Of course there is a poll block and it's even easier to use than the poll embed here. Collect the positive vibes of a round of applause through our applause block, or see who will give your blog post a thumbs up with the vote block. There are even some blocks like the NPS block that are only available in this plugin. To get the most out of Crowdsignal you should install the Crowdsignal Forms plugin and this plugin because they do different jobs.
17
-
18
- Crowdsignal Polls is currently available in the following languages:
19
-
20
- * Arabic
21
- * Bosnian
22
- * Bulgarian
23
- * Chinese (Taiwan)
24
- * Croatian
25
- * Czech
26
- * Danish
27
- * Dutch
28
- * Finnish
29
- * French (Canada)
30
- * French (France)
31
- * French (Switzerland)
32
- * Galician
33
- * German
34
- * Greek (Polytonic)
35
- * Hebrew
36
- * Hungarian
37
- * Indonesian
38
- * Irish
39
- * Italian
40
- * Korean
41
- * Lithuanian
42
- * Malay
43
- * Norwegian
44
- * Norwegian (Nynorsk)
45
- * Persian
46
- * Polish
47
- * Portuguese (Brazil)
48
- * Portuguese (Portugal)
49
- * Romanian
50
- * Russian
51
- * Serbian
52
- * Slovak
53
- * Spanish (Puerto Rico)
54
- * Spanish (Spain)
55
- * Swedish
56
- * Uighur
57
 
58
  Want to help translate the plugin or keep an existing translation up-to-date? Head on over to the [translation site](http://translate.wordpress.com/projects/polldaddy/plugin).
59
 
@@ -63,37 +29,37 @@ Development of the plugin will take place in [this Github repository](https://gi
63
 
64
  == Installation ==
65
 
66
- Upload the plugin to your blog (or search for it and install it on your plugins page), activate it, then go to Settings->Polls to configure the plugin. You'll need a Crowdsignal API key available from your [Crowdsignal account page](https://app.crowdsignal.com/account/#apikey) to sync your account and pull in your existing polls and ratings.
67
  Crowdsignal.com is now linked to WordPress.com using [WordPress.com Connect](http://en.support.wordpress.com/wpcc-faq/) which means you can use your WordPress.com username and password to login to Crowdsignal.com. If you have a WordPress.com account and have never used Crowdsignal.com you can login [here](https://app.crowdsignal.com/login/) to access Crowdsignal.com.
68
 
69
  You can find further help on our [support page](https://crowdsignal.com/support/). If you have any problems please use the [support forum](http://wordpress.org/support/plugin/polldaddy). The plugin also logs activity to a file using the [WP Debug Logger](http://wordpress.org/extend/plugins/wp-debug-logger/) plugin which can be useful in determining the cause of a problem.
70
 
71
  == Screenshots ==
72
 
73
- 1. Manage polls
74
- 2. Edit poll
75
- 3. View poll on page or in a widget
76
- 4. Add ratings
77
- 5. Ratings on a post
78
- 6. Ratings on comments
79
 
80
  == Frequently Asked Questions ==
81
 
82
- = Where do I find my Polls & Ratings menus? =
 
 
83
 
84
- The Polls & Ratings menus can now be found under the Feedbacks top level menu.
85
 
86
- = I have multiple authors on my blog? What happens? =
 
 
87
 
88
  Each author that wants to create polls will need his or her own Crowdsignal.com account.
89
 
90
  = But, as an Administrator, can I edit my Authors' polls =
91
 
92
- Yes. You'll be able to edit the polls they create from your blog. (You won't be able to edit any of their non-blog, personal polls they create through Crowdsignal.com.)
93
 
94
  = Neat! Um... can my Authors edit MY blog polls? =
95
 
96
- Nope. The permissions are the same as for posts. So Editors and Administrators can edit anyone's polls for that blog. Authors can only edit their own.
97
 
98
  = Where are my ratings? =
99
 
@@ -111,7 +77,7 @@ You need to select the synchronize ratings account in the WordPress options page
111
 
112
  = When I try to use a rating on a page, I get a PHP warning about the post title. =
113
 
114
- Your rating uses the filter 'wp_title' by default when retrieving the post title, you may need to remove this in the Polls & Ratings settings to allow ratings to work with your theme.
115
 
116
  = Why is a poll loading in the footer of my main page? =
117
 
@@ -119,7 +85,7 @@ Your theme is getting the post content, without necessarily showing it. If the p
119
 
120
  = My API key is valid but I cannot get the plugin to link with Crowdsignal
121
 
122
- This is possible if your server or network is blocking outgoing calls to Crowdsignal's API.
123
  Make sure to whitelist `api.crowdsignal.com` in your firewall to fix this.
124
 
125
  == Upgrade Notice ==
@@ -127,9 +93,14 @@ Revamp wp-admin styles: Crowdsignal dashboard
127
 
128
  == Changelog ==
129
 
130
- = 3.0.1
 
 
 
 
 
 
131
  * Allow landing page to be rendered on demand
132
- * Rename menu entries
133
 
134
  = 3.0.0 =
135
  * New dashboard menu
@@ -382,7 +353,7 @@ Revamp wp-admin styles: Crowdsignal dashboard
382
  = 1.8.8 =
383
  * Updated style editor to catch some missing strings so they can be now be localised
384
  * Added string maps to javascript files to allow them to be localised
385
- * Added extra label to ratings settings, vote, so now the label votes has a singular expression for localisation.
386
  * Added option to style editor to update all polls that use this style, so any update to style will automatically be reflected in the poll.
387
  * Bug Fix: Embed options are now in readonly text inputs, resolves issue of pre tags being pasted along with embed code/URL in the HTML editor.
388
 
@@ -490,7 +461,7 @@ Revamp wp-admin styles: Crowdsignal dashboard
490
  = 1.0 =
491
  * New Polldaddy API
492
  * Do not store UserCode, retrieve from API
493
- * Bug Fix: Fix API key retrieval. Improper use of wp_remote_post()
494
 
495
  = 0.9 =
496
  * Compatiblity with WordPress 2.7
@@ -504,7 +475,7 @@ Revamp wp-admin styles: Crowdsignal dashboard
504
  * Potential bug fix: Maybe get rid of 'Invalid Poll Author' error... again.
505
 
506
  = 0.6 =
507
- * Bug fix: Allow reauthentication with Polldaddy email address and Polldaddy password. This is necessary because the stored Polldaddy User API key is invalidated if the user's details change on Polldaddy.com.
508
  * Buf fix: Speed up CSS and JS.
509
  * Feature: Link to view Shortcode and JavaScript code for each poll.
510
 
@@ -519,7 +490,7 @@ Revamp wp-admin styles: Crowdsignal dashboard
519
 
520
  = 0.3 =
521
  * Bug fix: Send text data escaped in CDATA to prevent XML errors.
522
- * Bug fix: Append to text value, don't overwrite it. XML parser can call text handler many times per node.
523
  * Bug fix: No more slashes when a poll reloads in the edit form after an error.
524
 
525
  = 0.2 =
1
+ === Crowdsignal Dashboard - Polls, Surveys & more ===
2
+ Contributors: donncha, ice9js, cgastrell, digitalwaveride, jcheringer
3
  Tags: crowdsignal, polls, poll, polldaddy, wppolls, vote, polling, surveys, rate, rating, ratings
4
  Requires at least: 5.5
5
  Requires PHP: 5.6
6
+ Tested up to: 5.8.2
7
+ Stable tag: 3.0.4
 
 
8
 
9
  == Description ==
10
 
11
+ The Crowdsignal Dashboard plugin allows you to create and manage polls, surveys, quizzes, and ratings from within your WordPress admin. See all your projects in one place, be they surveys, quizzes and polls made on Crowdsignal.com or any of our poll and survey blocks using our Crowdsignal Forms plugin. With just one click view all results for your responses as they come in to analyze responses in real time and export your results everywhere!
12
+
13
+ === The Block Editor ===
14
+ Are you using the new block editor for WordPress? Our other plugin, [Crowdsignal Forms](https://wordpress.org/plugins/crowdsignal-forms/) provides a number of blocks for your post editor that allow you to gather actionable feedback from your audience:
15
+ * Poll: Create polls and get your audience’s opinion.
16
+ * Survey Embed: Create surveys in minutes with 14 question types and embed them into your page.
17
+ * Feedback Button: A floating and always visible button that allows your audience to share feedback anytime.
18
+ * Measure NPS: Calculate your Net Promoter Score! Collect feedback and track customer satisfaction over time.
19
+ * Voting: Allow your audience to rate your work or express their opinion.
20
+ * Applause: Let your audience cheer with a big round of applause.
21
+
22
+ Learn more about the Crowdsignal Forms plugin [here](https://wordpress.org/plugins/crowdsignal-forms/), and on [crowdsignal.com](https://crowdsignal.com/).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  Want to help translate the plugin or keep an existing translation up-to-date? Head on over to the [translation site](http://translate.wordpress.com/projects/polldaddy/plugin).
25
 
29
 
30
  == Installation ==
31
 
32
+ Upload the plugin to your blog (or search for it and install it on your plugins page), activate it, then go to Settings->Crowdsignal to configure the plugin. You'll need a Crowdsignal API key available from your [Crowdsignal account page](https://app.crowdsignal.com/account/#apikey) to sync your account and pull in your existing polls and ratings.
33
  Crowdsignal.com is now linked to WordPress.com using [WordPress.com Connect](http://en.support.wordpress.com/wpcc-faq/) which means you can use your WordPress.com username and password to login to Crowdsignal.com. If you have a WordPress.com account and have never used Crowdsignal.com you can login [here](https://app.crowdsignal.com/login/) to access Crowdsignal.com.
34
 
35
  You can find further help on our [support page](https://crowdsignal.com/support/). If you have any problems please use the [support forum](http://wordpress.org/support/plugin/polldaddy). The plugin also logs activity to a file using the [WP Debug Logger](http://wordpress.org/extend/plugins/wp-debug-logger/) plugin which can be useful in determining the cause of a problem.
36
 
37
  == Screenshots ==
38
 
39
+ 1. The Crowdsignal Dashboard
40
+ 2. Analyse and export your results
 
 
 
 
41
 
42
  == Frequently Asked Questions ==
43
 
44
+ = Where do I find my Crowdsignal Dashboard? =
45
+
46
+ You can find your dashboard under the Feedback top level menu. You will find Crowdsignal and Ratings menu items there. The Crowdsignal menu item leads to the dashboard. If you have ratings enabled you will see a Ratings menu item that links to a summary of your ratings.
47
 
48
+ = Where do I find my Crowdsignal Settings? =
49
 
50
+ You will find the settings area for this plugin under the Settings top level menu, and look for the Crowdsignal menu item.
51
+
52
+ = I have multiple authors on my blog? What happens? =
53
 
54
  Each author that wants to create polls will need his or her own Crowdsignal.com account.
55
 
56
  = But, as an Administrator, can I edit my Authors' polls =
57
 
58
+ Yes. You'll be able to edit the polls they create from your blog. (You won't be able to edit any of their non-blog, personal polls they create through Crowdsignal.com.)
59
 
60
  = Neat! Um... can my Authors edit MY blog polls? =
61
 
62
+ Nope. The permissions are the same as for posts. So Editors and Administrators can edit anyone's polls for that blog. Authors can only edit their own.
63
 
64
  = Where are my ratings? =
65
 
77
 
78
  = When I try to use a rating on a page, I get a PHP warning about the post title. =
79
 
80
+ Your rating uses the filter 'wp_title' by default when retrieving the post title, you may need to remove this by defining the constant "CS_RATING_TITLE_FILTER" to a new filter to use, or just set it to "" to diasable it and allow ratings to work with your theme. Define the constant in wp-config.php or an mu-plugin.
81
 
82
  = Why is a poll loading in the footer of my main page? =
83
 
85
 
86
  = My API key is valid but I cannot get the plugin to link with Crowdsignal
87
 
88
+ This is possible if your server or network is blocking outgoing calls to Crowdsignal's API.
89
  Make sure to whitelist `api.crowdsignal.com` in your firewall to fix this.
90
 
91
  == Upgrade Notice ==
93
 
94
  == Changelog ==
95
 
96
+ = 3.0.4 =
97
+ * Added missing files that should have been in the previous release.
98
+
99
+ = 3.0.3 =
100
+ * Move settings page and update style of the settings page to match the Crowdsignal Forms plugin
101
+
102
+ = 3.0.1 =
103
  * Allow landing page to be rendered on demand
 
104
 
105
  = 3.0.0 =
106
  * New dashboard menu
353
  = 1.8.8 =
354
  * Updated style editor to catch some missing strings so they can be now be localised
355
  * Added string maps to javascript files to allow them to be localised
356
+ * Added extra label to ratings settings, vote, so now the label votes has a singular expression for localisation.
357
  * Added option to style editor to update all polls that use this style, so any update to style will automatically be reflected in the poll.
358
  * Bug Fix: Embed options are now in readonly text inputs, resolves issue of pre tags being pasted along with embed code/URL in the HTML editor.
359
 
461
  = 1.0 =
462
  * New Polldaddy API
463
  * Do not store UserCode, retrieve from API
464
+ * Bug Fix: Fix API key retrieval. Improper use of wp_remote_post()
465
 
466
  = 0.9 =
467
  * Compatiblity with WordPress 2.7
475
  * Potential bug fix: Maybe get rid of 'Invalid Poll Author' error... again.
476
 
477
  = 0.6 =
478
+ * Bug fix: Allow reauthentication with Polldaddy email address and Polldaddy password. This is necessary because the stored Polldaddy User API key is invalidated if the user's details change on Polldaddy.com.
479
  * Buf fix: Speed up CSS and JS.
480
  * Feature: Link to view Shortcode and JavaScript code for each poll.
481
 
490
 
491
  = 0.3 =
492
  * Bug fix: Send text data escaped in CDATA to prevent XML errors.
493
+ * Bug fix: Append to text value, don't overwrite it. XML parser can call text handler many times per node.
494
  * Bug fix: No more slashes when a poll reloads in the edit form after an error.
495
 
496
  = 0.2 =
screenshot-1.png DELETED
Binary file
screenshot-2.png DELETED
Binary file
screenshot-3.png DELETED
Binary file
screenshot-4.png DELETED
Binary file
screenshot-5.png DELETED
Binary file
screenshot-6.png DELETED
Binary file