PluginProbe
Autoptimize / trunk
Autoptimize vtrunk
3.1.16 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 All 108 releases
← All changes | classes/critcss-inc/admin_settings_explain.php +13 -5 2.7.6 → trunk View file →
@@ -11,23 +11,31 @@
11 11 <style>
12 12 .ao_settings_div {background: white;border: 1px solid #ccc;padding: 1px 15px;margin: 15px 10px 10px 0;}
13 13 .ao_settings_div .form-table th {font-weight: normal;}
14 14 </style>
15 - <script>document.title = "Autoptimize: <?php _e( 'Critical CSS', 'autoptimize' ); ?> " + document.title;</script>
15 + <script>document.title = "Autoptimize: <?php esc_html_e( 'Critical CSS', 'autoptimize' ); ?> " + document.title;</script>
16 16 <ul id="explain-panel">
17 17 <div class="ao_settings_div">
18 18 <?php
19 19 $ccss_explanation = '';
20 20
21 + if ( apply_filters( 'autoptimize_filter_ccss_rules_without_api', true ) ) {
22 + $_transient = 'ao3_ccss_explain';
23 + $_explain_html = 'https://misc.optimizingmatters.com/autoptimize_ccss_explain_ao30_i18n.html?ao_ver=';
24 + } else {
25 + $_transient = 'ao_ccss_explain';
26 + $_explain_html = 'https://misc.optimizingmatters.com/autoptimize_ccss_explain_i18n.html?ao_ver=';
27 + }
28 +
21 29 // get the HTML with the explanation of what critical CSS is.
22 30 if ( apply_filters( 'autoptimize_settingsscreen_remotehttp', true ) ) {
23 - $ccss_explanation = get_transient( 'ao_ccss_explain' );
31 + $ccss_explanation = get_transient( $_transient );
24 32 if ( empty( $ccss_explanation ) ) {
25 - $ccss_expl_resp = wp_remote_get( 'https://misc.optimizingmatters.com/autoptimize_ccss_explain_i18n.html?ao_ver=' . AUTOPTIMIZE_PLUGIN_VERSION );
33 + $ccss_expl_resp = wp_remote_get( $_explain_html . AUTOPTIMIZE_PLUGIN_VERSION );
26 34 if ( ! is_wp_error( $ccss_expl_resp ) ) {
27 35 if ( '200' == wp_remote_retrieve_response_code( $ccss_expl_resp ) ) {
28 36 $ccss_explanation = wp_kses_post( wp_remote_retrieve_body( $ccss_expl_resp ) );
29 - set_transient( 'ao_ccss_explain', $ccss_explanation, WEEK_IN_SECONDS );
37 + set_transient( $_transient, $ccss_explanation, WEEK_IN_SECONDS );
30 38 }
31 39 }
32 40 }
33 41 }
@@ -33,9 +41,9 @@
33 41 }
34 42
35 43 // placeholder text in case HTML is empty.
36 44 if ( empty( $ccss_explanation ) ) {
37 - $ccss_explanation = __( '<h2>Fix render-blocking CSS!</h2><p>Significantly improve your first-paint times by making CSS non-render-blocking.</p><p>The next step is to sign up at <a href="https://criticalcss.com/?aff=1" target="_blank">https://criticalcss.com</a> (this is a premium service, priced 2 GBP/month for membership and 5 GBP/month per domain) <strong>and get the API key, which you can copy from <a href="https://criticalcss.com/account/api-keys?aff=1" target="_blank">the API-keys page</a></strong> and paste below.</p><p>If you have any questions or need support, head on over to <a href="https://wordpress.org/support/plugin/autoptimize" target="_blank">our support forum</a> and we\'ll help you get up and running in no time!</p>', 'autoptimize' );
45 + $ccss_explanation = sprintf( esc_html__( '%1$sFix render-blocking CSS!%2$s%3$sSignificantly improve your first-paint times by making CSS non-render-blocking.%4$s%3$sThe %5$snext step is to sign up at %7$shttps://criticalcss.com%8$s%6$s (this is a premium service, priced 2 GBP/month for membership and 5 GBP/month per domain) %5$sand get the API key%6$s, which you can copy from %7$sthe API-keys page%8$s and paste below.%4$s%3$sIf you have any questions or need support, head on over to %9$sour support forum%10$s and we\'ll help you get up and running in no time!%4$s', 'autoptimize' ), '<h2>', '</h2>', '<p>', '</p>', '<strong>', '</strong>', '<a href="https://criticalcss.com/?aff=1" target="_blank">', '</a>', '<a href="https://wordpress.org/support/plugin/autoptimize" target="_blank">', '</a>' );
38 46 } else {
39 47 // we were able to fetch the explenation, so add the JS to show correct language.
40 48 $ccss_explanation .= "<script>jQuery('.ao_i18n').hide();d=document;lang=d.getElementsByTagName('html')[0].getAttribute('lang').substring(0,2);if(d.getElementById(lang)!= null){jQuery('#'+lang).show();}else{jQuery('#default').show();}</script>";
41 49 }