account-status-connected.php
9 years ago
account-status-create-advanced.php
9 years ago
account-status-create-simple.php
9 years ago
account-status-loading.php
9 years ago
bulk-optimization-chart.php
9 years ago
bulk-optimization-form.php
9 years ago
bulk-optimization.php
9 years ago
compress-details-processing.php
9 years ago
compress-details.php
9 years ago
dashboard-widget.php
9 years ago
account-status-connected.php
88 lines
| 1 | <div class="tiny-account-status" id="tiny-account-status" data-state="complete"> |
| 2 | <div class="status <?php echo $status->ok ? ( $status->pending ? 'status-pending' : 'status-success' ) : 'status-failure'; ?>"> |
| 3 | <p class="status"><?php |
| 4 | if ( $status->ok ) { |
| 5 | if ( isset( $status->message ) ) { |
| 6 | echo esc_html( $status->message, 'tiny-compress-images' ); |
| 7 | } else { |
| 8 | echo esc_html__( 'Your account is connected', 'tiny-compress-images' ); |
| 9 | } |
| 10 | } else { |
| 11 | echo esc_html__( 'Connection unsuccessful', 'tiny-compress-images' ); |
| 12 | } |
| 13 | ?></p> |
| 14 | <p><?php |
| 15 | if ( $status->ok ) { |
| 16 | $compressions = self::get_compression_count(); |
| 17 | /* It is not possible to check if a subscription is free or flexible. */ |
| 18 | if ( Tiny_Config::MONTHLY_FREE_COMPRESSIONS == $compressions ) { |
| 19 | $link = '<a href="https://tinypng.com/dashboard/developers" target="_blank">' . esc_html__( 'TinyPNG API account', 'tiny-compress-images' ) . '</a>'; |
| 20 | printf( esc_html__( |
| 21 | 'You have reached your limit of %s compressions this month.', |
| 22 | 'tiny-compress-images' |
| 23 | ), $compressions ); |
| 24 | echo '<br>'; |
| 25 | printf( esc_html__( |
| 26 | 'If you need to compress more images you can change your %s.', |
| 27 | 'tiny-compress-images' |
| 28 | ), $link ); |
| 29 | } else { |
| 30 | printf( esc_html__( |
| 31 | 'You have made %s compressions this month.', |
| 32 | 'tiny-compress-images' |
| 33 | ), $compressions ); |
| 34 | } |
| 35 | } else { |
| 36 | if ( isset( $status->message ) ) { |
| 37 | echo esc_html__( 'Error', 'tiny-compress-images' ) . ': '; |
| 38 | echo esc_html( $status->message, 'tiny-compress-images' ); |
| 39 | } else { |
| 40 | esc_html__( |
| 41 | 'API status could not be checked, enable cURL for more information', |
| 42 | 'tiny-compress-images' |
| 43 | ); |
| 44 | } |
| 45 | } |
| 46 | ?></p> |
| 47 | <p><?php |
| 48 | if ( defined( 'TINY_API_KEY' ) ) { |
| 49 | echo sprintf( esc_html__( |
| 50 | 'The API key has been configured in %s', |
| 51 | 'tiny-compress-images' |
| 52 | ), 'wp-config.php' ); |
| 53 | } else { |
| 54 | echo '<a href="#" onclick="jQuery(\'div.tiny-account-status div.update\').toggle(); jQuery(\'div.tiny-account-status div.status\').toggle(); return false">'; |
| 55 | echo esc_html__( 'Change API key', 'tiny-compress-images' ); |
| 56 | echo '</a>'; |
| 57 | } |
| 58 | ?></p> |
| 59 | </div> |
| 60 | |
| 61 | <div class="update" style="display: none"> |
| 62 | <h4><?php echo esc_html__( 'Change your API key', 'tiny-compress-images' ); ?></h4> |
| 63 | <p class="introduction"><?php |
| 64 | $link = sprintf( '<a href="https://tinypng.com/dashboard/developers" target="_blank">%s</a>', |
| 65 | esc_html__( 'API dashboard', 'tiny-compress-images' ) |
| 66 | ); |
| 67 | printf( esc_html__( |
| 68 | 'Enter your API key. If you have lost your key, go to your %s to retrieve it.', |
| 69 | 'tiny-compress-images' |
| 70 | ), $link ); |
| 71 | ?></p> |
| 72 | |
| 73 | <input type="text" id="tinypng_api_key" |
| 74 | name="tinypng_api_key" size="35" spellcheck="false" |
| 75 | value="<?php echo esc_attr( $key ); ?>"> |
| 76 | |
| 77 | <button class="button button-primary" data-tiny-action="update-key"><?php |
| 78 | echo esc_html__( 'Save' ); |
| 79 | ?></button> |
| 80 | |
| 81 | <p class="message"></p> |
| 82 | |
| 83 | <p><a href="#" onclick="jQuery('div.tiny-account-status div.update').toggle(); jQuery('div.tiny-account-status div.status').toggle(); return false"><?php |
| 84 | echo esc_html__( 'Cancel' ); |
| 85 | ?></a></p> |
| 86 | </div> |
| 87 | </div> |
| 88 |