Skip to content

Commit 73ab79a

Browse files
authored
Merge pull request #503 from ProgressPlanner/filip/v15/more-tweaks
More v1.5 tweaks
2 parents 8f6f2b7 + f716b4a commit 73ab79a

4 files changed

Lines changed: 40 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Bugs we fixed:
44

55
* Don't redirect user to Progress Planner dashboard if 'redirect_to' GET or POST parameter is set.
66
* Fixed detecting creation of new valuable content posts.
7+
* Don't award point for all Todo tasks, only for golden.
78

89
= 1.4.2 =
910

classes/activities/class-suggested-task.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,15 @@ public function get_points( $date ) {
6969
$tasks = \progress_planner()->get_suggested_tasks()->get_tasks_by( 'task_id', $this->data_id );
7070

7171
if ( ! empty( $tasks ) && isset( $tasks[0]['provider_id'] ) ) {
72-
$task_provider = \progress_planner()->get_suggested_tasks()->get_tasks_manager()->get_task_provider( $tasks[0]['provider_id'] );
72+
if ( 'user' === $tasks[0]['provider_id'] ) {
73+
$points = isset( $tasks[0]['points'] ) ? (int) $tasks[0]['points'] : 0;
74+
} else {
75+
$task_provider = \progress_planner()->get_suggested_tasks()->get_tasks_manager()->get_task_provider( $tasks[0]['provider_id'] );
7376

74-
if ( $task_provider ) {
75-
// Create post task provider had a different points system, this is for backwards compatibility.
76-
$points = $task_provider instanceof Content_Create ? $task_provider->get_points( $this->data_id ) : $task_provider->get_points();
77+
if ( $task_provider ) {
78+
// Create post task provider had a different points system, this is for backwards compatibility.
79+
$points = $task_provider instanceof Content_Create ? $task_provider->get_points( $this->data_id ) : $task_provider->get_points();
80+
}
7781
}
7882
}
7983
$this->points[ $date_ymd ] = $points;

classes/class-suggested-tasks.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,7 @@ public function suggested_task_action() {
583583

584584
// Insert an activity.
585585
$this->insert_activity( $task_id );
586+
586587
$updated = true;
587588
break;
588589

classes/suggested-tasks/providers/interactive/class-email-sending.php

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function init() {
120120

121121
$this->email_subject = \esc_html__( 'Your Progress Planner test message!', 'progress-planner' );
122122
// translators: %1$s <br><br> tags, %2$s the admin URL.
123-
$this->email_content = sprintf( \esc_html__( 'You just used Progress Planner to verify if sending email works on your website. %1$s The good news; it does! Click %2$s to mark Ravi\'s Recommendation as completed.', 'progress-planner' ), '<br><br>', '<a href="' . \admin_url( 'admin.php?page=progress-planner&prpl_complete_task=' . $this->get_task_id() ) . '" target="_blank">' . \esc_html__( 'here', 'progress-planner' ) . '</a>', '<a href="' . \admin_url( 'admin.php?page=progress-planner&prpl_complete_task=' . $this->get_task_id() ) . '" target="_blank">' . \esc_html__( 'here', 'progress-planner' ) . '</a>' );
123+
$this->email_content = sprintf( \esc_html__( 'You just used Progress Planner to verify if sending email works on your website. %1$s The good news; it does! Click here to %2$s.', 'progress-planner' ), '<br><br>', '<a href="' . \admin_url( 'admin.php?page=progress-planner&prpl_complete_task=' . $this->get_task_id() ) . '" target="_blank">' . \esc_html__( 'mark Ravi\'s Recommendation as completed', 'progress-planner' ) . '</a>', '<a href="' . \admin_url( 'admin.php?page=progress-planner&prpl_complete_task=' . $this->get_task_id() ) . '" target="_blank">' . \esc_html__( 'here', 'progress-planner' ) . '</a>' );
124124
}
125125

126126
/**
@@ -286,7 +286,7 @@ public function the_popover_content() {
286286
<div class="prpl-steps-nav-wrapper">
287287
<button class="prpl-button" data-action="showResults" type="submit">
288288
<?php
289-
/* translators: %s is an arrow icon. */
289+
/* translators: %s is a forward arrow icon. */
290290
printf( \esc_html__( 'Next step %s', 'progress-planner' ), '<span class="dashicons dashicons-arrow-right-alt2"></span>' );
291291
?>
292292
</button>
@@ -333,7 +333,12 @@ public function the_popover_content() {
333333
</p>
334334

335335
<div class="prpl-steps-nav-wrapper">
336-
<button class="prpl-button" data-action="showForm"><?php \esc_html_e( 'Try again', 'progress-planner' ); ?></button>
336+
<button class="prpl-button" data-action="showForm">
337+
<?php
338+
/* translators: %s is a back arrow icon. */
339+
printf( \esc_html__( ' %s Try again', 'progress-planner' ), '<span class="dashicons dashicons-arrow-left-alt2"></span>' );
340+
?>
341+
</button>
337342
<button class="prpl-button" data-action="closePopover"><?php \esc_html_e( 'Retry later', 'progress-planner' ); ?></button>
338343
</div>
339344
</div>
@@ -419,33 +424,44 @@ public function the_popover_content() {
419424
<?php /* Email not received, showing troubleshooting */ ?>
420425
<div class="prpl-columns-wrapper-flex prpl-sending-email-step" id="prpl-sending-email-troubleshooting-step" style="display: none;">
421426
<div class="prpl-column prpl-column-content">
422-
<p>
427+
<h2 class="prpl-interactive-task-title"><?php \esc_html_e( 'Your email might not be working well', 'progress-planner' ); ?></h2>
428+
<p class="prpl-interactive-task-description">
423429
<?php
424430
\esc_html_e( 'We\'re sorry to hear you did not receive our confirmation email yet. On some websites, it make take up to a few hours to send email. That\'s why we strongly advise you to check back in a few hours from now.', 'progress-planner' );
425431
?>
426432
</p>
427-
<p>
433+
<p class="prpl-interactive-task-description">
428434
<?php
429-
\esc_html_e( 'If you already waited a couple of hours and you still didn\'t get our email, your email might not be working well. If you haven\'t already, you may need to install a plugin to handle email for you.', 'progress-planner' );
435+
\esc_html_e( 'If you already waited a couple of hours and you still didn\'t get our email, your email might not be working well.', 'progress-planner' );
430436
?>
431437
</p>
438+
</div>
439+
440+
<div class="prpl-column">
432441
<?php if ( $this->is_there_sending_email_override() ) : ?>
433442
<p>
434443
<?php
435-
\esc_html_e( 'We\'ve detected you\'re most likely already running an SMTP plugin. Please check its documentation to help you in troubleshooting.', 'progress-planner' );
444+
\esc_html_e( 'What can you do next? Well, it looks like you are already running an SMTP plugin on your website, but it might not be configured correctly.', 'progress-planner' );
445+
?>
446+
</p>
447+
<p>
448+
<?php
449+
\esc_html_e( 'You can find more information about running an SMTP plugin in our troubleshooting guide.', 'progress-planner' );
436450
?>
437451
</p>
438452
<?php else : ?>
439-
<p>
453+
<p>
440454
<?php
441-
printf(
442-
/* translators: %s is a link to the troubleshooting guide. */
443-
\esc_html__( 'We\'ve not detected an SMTP plugin on your site. Installing one may help resolving the email problem. You can read more about this at %s.', 'progress-planner' ),
444-
'<a href="' . \esc_url( $this->troubleshooting_guide_url ) . '" target="_blank">' . \esc_html__( 'troubleshooting guide', 'progress-planner' ) . '</a>'
445-
);
455+
\esc_html_e( 'What can you do next? If you haven\'t already, you may need to install a plugin to handle email for you (an SMTP plugin).', 'progress-planner' );
446456
?>
447-
</p>
457+
</p>
458+
<p>
459+
<?php
460+
\esc_html_e( 'You can find more information about installing an SMTP plugin in our troubleshooting guide.', 'progress-planner' );
461+
?>
462+
</p>
448463
<?php endif; ?>
464+
449465
<div class="prpl-steps-nav-wrapper">
450466
<button class="prpl-button" data-action="openTroubleshootingGuide"><?php \esc_html_e( 'Take me to your troubleshooting guide', 'progress-planner' ); ?></button>
451467
</div>

0 commit comments

Comments
 (0)