PluginProbe
Autoptimize / 2.7.0
Autoptimize v2.7.0
2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.5.0 2.5.1 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 All 107 releases
autoptimize / classes / critcss-inc / admin_settings_key.php

admin_settings_key.php in Autoptimize 2.7.0, at classes/critcss-inc/admin_settings_key.php

58 lines 3.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Render key panel.
4 */
5
6 /**
7 * Function that renders key panel.
8 *
9 * @param string $key API Key.
10 * @param string $status API Key status.
11 * @param string $status_msg Status message.
12 * @param string $message Message.
13 * @param string $color Color to highlight message in.
14 */
15 function ao_ccss_render_key( $key, $status, $status_msg, $message, $color ) {
16 if ( defined( 'AUTOPTIMIZE_CRITICALCSS_API_KEY' ) ) {
17 $key = __( 'API key provided by your host/ WordPress administrator, no need to enter anything here. In case of problems with the API key, contact your host/ WordPress administrator.', 'autoptimize' );
18 }
19 ?>
20 <ul id="key-panel">
21 <li class="itemDetail">
22 <h2 class="itemTitle fleft"><?php _e( 'API Key', 'autoptimize' ); ?>: <span style="color:<?php echo $color; ?>;"><?php echo $status_msg; ?></span></h2>
23 <button type="button" class="toggle-btn">
24 <?php if ( 'valid' != $status ) { ?>
25 <span class="toggle-indicator dashicons dashicons-arrow-up"></span>
26 <?php } else { ?>
27 <span class="toggle-indicator dashicons dashicons-arrow-up dashicons-arrow-down"></span>
28 <?php } ?>
29 </button>
30 <?php if ( 'valid' != $status ) { ?>
31 <div class="collapsible">
32 <?php } else { ?>
33 <div class="collapsible hidden">
34 <?php } ?>
35 <?php if ( 'valid' != $status ) { ?>
36 <div style="clear:both;padding:2px 10px;border-left:solid;border-left-width:5px;border-left-color:<?php echo $color; ?>;background-color:white;">
37 <p><?php echo $message; ?></p>
38 </div>
39 <?php } ?>
40 <table id="key" class="form-table">
41 <tr>
42 <th scope="row">
43 <?php _e( 'Your API Key', 'autoptimize' ); ?>
44 </th>
45 <td>
46 <textarea id="autoptimize_ccss_key" name="autoptimize_ccss_key" rows='3' style="width:100%;" placeholder="<?php _e( 'Please enter your criticalcss.com API key here.', 'autoptimize' ); ?>"><?php echo trim( $key ); ?></textarea>
47 <p class="notes">
48 <?php _e( 'Enter your <a href="https://criticalcss.com/account/api-keys?aff=1" target="_blank">criticalcss.com</a> API key above. The key is revalidated every time a new job is sent to it.<br />To obtain your API key, go to <a href="https://criticalcss.com/account/api-keys?aff=1" target="_blank">criticalcss.com</a> > Account > API Keys.<br />Requests to generate a critical CSS via the API are priced at £5 per domain per month.<br /><strong>Not sure yet? With the <a href="https://criticalcss.com/faq/?aff=1#trial" target="_blank">30 day free trial</a>, you have nothing to lose!</strong>', 'autoptimize' ); ?>
49 </p>
50 </td>
51 </tr>
52 </table>
53 </div>
54 </li>
55 </ul>
56 <?php
57 }
58