Skip to content

Commit c37708c

Browse files
Request for Review (#61)
* Add review prompts * Add review request on settings page * Typo * Format * Update review prompt text to 'Leave a review' - Changed review link text from 'Write a review' to 'Leave a review' - Provides clearer call-to-action for users to leave feedback - Affects dashboard widget and settings page review prompts
1 parent 35c2ccf commit c37708c

File tree

6 files changed

+30
-6
lines changed

6 files changed

+30
-6
lines changed

src/class-tiny-plugin.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,4 +716,16 @@ function friendly_user_name() {
716716
$name = ucfirst( empty( $user->first_name ) ? $user->display_name : $user->first_name );
717717
return $name;
718718
}
719+
720+
static function request_review() {
721+
$review_url = 'https://wordpress.org/support/plugin/tiny-compress-images/reviews/#new-post';
722+
$review_block = esc_html__( 'Enjoying TinyPNG?', 'tiny-compress-images' );
723+
$review_block .= ' ';
724+
$review_block .= sprintf(
725+
'<a href="%s" target="_blank">%s</a>',
726+
esc_url( $review_url ),
727+
esc_html__( 'Write a review', 'tiny-compress-images' )
728+
);
729+
return $review_block;
730+
}
719731
}

src/css/bulk-optimization.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ div.tiny-bulk-optimization div.optimize div.optimization-buttons input.button-he
247247
box-shadow: 0 3px 0 #920011 inset !important;
248248
}
249249

250+
div.tiny-bulk-optimization div.optimize div.optimization-buttons p.optimization-buttons_notice {
251+
max-width: 420px;
252+
margin: 10px auto 0 auto;
253+
}
250254
div.tiny-bulk-optimization div.optimize div#optimization-spinner {
251255
position: absolute;
252256
display: none;

src/views/bulk-optimization-form.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
submit_button( esc_attr__( 'Cancelling', 'tiny-compress-images' ) . '...', 'button-primary button-hero red', 'id-cancelling', false );
99
?>
1010
<div id="optimization-spinner" class="spinner"></div>
11+
<p class="optimization-buttons_notice"><?php esc_html_e( 'For the plugin to do the work, you need to keep this page open. But no worries: when stopped, you can continue where you left off!', 'tiny-compress-images' ); ?></p>
1112
</div>

src/views/bulk-optimization.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,13 @@
179179
</tr>
180180
</table>
181181
<div class="notes">
182-
<h4><?php esc_html_e( 'Remember', 'tiny-compress-images' ) ?></h4>
183-
<p>
184-
<?php esc_html_e( 'For the plugin to do the work, you need to keep this page open. But no worries: when stopped, you can continue where you left off!', 'tiny-compress-images' ); ?>
185-
</p>
182+
<?php
183+
/* translators: %s: link to settings page saying here */
184+
printf(wp_kses(__( 'Configure compression settings %s.', 'tiny-compress-images' ), array(
185+
'a' => array(
186+
'href' => array(),
187+
),
188+
)), '<a href=' . admin_url( 'options-general.php?page=tinify' ) . '>' . __( 'here', 'tiny-compress-images' ) . '</a>') ?>
186189
</div>
187190
</div>
188191
</div>

src/views/dashboard-widget.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
<?php $link = "<a href='" . admin_url( 'upload.php?page=tiny-bulk-optimization' ) . "'>" . esc_html__( 'bulk optimization', 'tiny-compress-images' ) . '</a>'; ?>
2-
1+
<?php
2+
$link = "<a href='" . admin_url( 'upload.php?page=tiny-bulk-optimization' ) . "'>" . esc_html__( 'bulk optimization', 'tiny-compress-images' ) . '</a>';
3+
?>
34
<style type="text/css" >
45
div#tinypng_dashboard_widget div.description {
56
display: none;
@@ -58,6 +59,8 @@
5859
<?php
5960
/* translators: %s: friendly user name */
6061
printf( esc_html__( '%s, this is great! Your entire library is optimized!', 'tiny-compress-images' ), $this->friendly_user_name() );
62+
echo ' ';
63+
echo Tiny_Plugin::request_review();
6164
?>
6265
</p>
6366
</div>

src/views/settings.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
</tr>
4545
</tbody>
4646
</table>
47+
<p><?php echo Tiny_Plugin::request_review();?></p>
4748
<p class="submit">
4849
<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_html_e( 'Save Changes' ) ?>">
4950
</p>

0 commit comments

Comments
 (0)