settings_screen_do_remote_http = apply_filters( 'autoptimize_settingsscreen_remotehttp', $this->settings_screen_do_remote_http ); } // Adds the Autoptimize Toolbar to the Admin bar. // (we load outside the is_admin check so it's also displayed on the frontend toolbar). $toolbar = new autoptimizeToolbar(); } /** * @return autoptimizeConfig */ static public function instance() { // Only one instance. if ( null === self::$instance ) { self::$instance = new autoptimizeConfig(); } return self::$instance; } public function show() { $conf = self::instance(); ?>
' . sprintf( __( 'You are using a very old version of PHP (5.2.x or older) which has serious security and performance issues. Support for PHP 5.5 and below will be removed in one of the next AO released, please ask your hoster to provide you with an upgrade path to 7.x.', 'autoptimize' ), '"http://blog.futtta.be/2016/03/15/why-would-you-still-be-on-php-5-2/" target="_blank"' ) . '

'; ?>

ao_admin_tabs(); ?>
  • />
    '. __('(deprecated)','autoptimize') . ''; ?>
  • />
    '. __('(deprecated)','autoptimize') . ''; ?>
  • />
  • 0 ) { $details = ', ~' . $AOcacheSize . ' total'; } printf( __( '%1$s files, totalling %2$s Kbytes (calculated at %3$s)', 'autoptimize' ), $AOstatArr[0], $AOcacheSize, date( 'H:i e', $AOstatArr[2] ) ); } ?>
  • get( 'autoptimize_css_aggregate' ) && !$conf->get( 'autoptimize_js_aggregate' ) ) { $_min_excl_class = ' hidden'; } ?>

%s', __( 'Settings' ) ); array_unshift( $links, $settings_link ); } else { // 2.8 and higher. // If it's us, add the link. if ( $file === $plugin ) { $newlink = array( sprintf( '%s', __( 'Settings' ) ) ); $links = array_merge( $links, $newlink ); } } return $links; } /** * @return array */ public static function get_defaults() { static $config = array( 'autoptimize_html' => 0, 'autoptimize_html_keepcomments' => 0, 'autoptimize_js' => 0, 'autoptimize_js_aggregate' => 1, 'autoptimize_js_exclude' => 'wp-includes/js/dist/, wp-includes/js/tinymce/, js/jquery/jquery.js', 'autoptimize_js_trycatch' => 0, 'autoptimize_js_justhead' => 0, 'autoptimize_js_include_inline' => 0, 'autoptimize_js_forcehead' => 0, 'autoptimize_css' => 0, 'autoptimize_css_aggregate' => 1, 'autoptimize_css_exclude' => 'admin-bar.min.css, dashicons.min.css, wp-content/cache/, wp-content/uploads/', 'autoptimize_css_justhead' => 0, 'autoptimize_css_include_inline' => 1, 'autoptimize_css_defer' => 0, 'autoptimize_css_defer_inline' => '', 'autoptimize_css_inline' => 0, 'autoptimize_css_datauris' => 0, 'autoptimize_cdn_url' => '', 'autoptimize_cache_nogzip' => 1, 'autoptimize_show_adv' => 1, 'autoptimize_optimize_logged' => 1, 'autoptimize_optimize_checkout' => 1, 'autoptimize_minify_excluded' => 1, ); return $config; } /** * Returns default option values for autoptimizeExtra. * * @return array */ public static function get_ao_extra_default_options() { $defaults = array( 'autoptimize_extra_checkbox_field_1' => '0', 'autoptimize_extra_checkbox_field_0' => '0', 'autoptimize_extra_radio_field_4' => '1', 'autoptimize_extra_text_field_2' => '', 'autoptimize_extra_text_field_3' => '', ); return $defaults; } /** * Returns default option values for autoptimizeExtra. * * @return array */ public static function get_ao_imgopt_default_options() { $defaults = array( 'autoptimize_imgopt_checkbox_field_1' => '0', // imgopt off. 'autoptimize_imgopt_select_field_2' => '2', // quality glossy. 'autoptimize_imgopt_checkbox_field_3' => '0', // lazy load off. 'autoptimize_imgopt_checkbox_field_4' => '0', // webp off (might be removed). 'autoptimize_imgopt_text_field_5' => '', // lazy load exclusions empty. ); return $defaults; } /** * Returns preload polyfill JS. * * @return string */ public static function get_ao_css_preload_polyfill() { $preload_poly = apply_filters('autoptimize_css_preload_polyfill',''); return $preload_poly; } /** * Returns preload JS onload handler. * * @return string */ public static function get_ao_css_preload_onload() { $preload_onload = apply_filters('autoptimize_filter_css_preload_onload',"this.onload=null;this.rel='stylesheet'"); return $preload_onload; } public function get($key) { if ( ! is_array( $this->config ) ) { // Default config. $config = self::get_defaults(); // Override with user settings. foreach ( array_keys( $config ) as $name ) { $conf = get_option( $name ); if ( false !== $conf ) { // It was set before! $config[ $name ] = $conf; } } // Save for next call. $this->config = apply_filters( 'autoptimize_filter_get_config', $config ); } if ( isset( $this->config[ $key ] ) ) { return $this->config[ $key ]; } return false; } private function getFutttaFeeds($url) { if ( $this->settings_screen_do_remote_http ) { $rss = fetch_feed( $url ); $maxitems = 0; if ( ! is_wp_error( $rss ) ) { $maxitems = $rss->get_item_quantity( 7 ); $rss_items = $rss->get_items( 0, $maxitems ); } ?> __( 'JS, CSS & HTML', 'autoptimize' ) ) ); $tabContent = ''; $tabs_count = count($tabs); if ( $tabs_count > 1 ) { if ( isset( $_GET['page'] ) ) { $currentId = $_GET['page']; } else { $currentId = "autoptimize"; } $tabContent .= ''; } else { $tabContent = '
'; } return $tabContent; } /** * Returns true if in admin (and not in admin-ajax.php!) * * @return bool */ public static function is_admin_and_not_ajax() { return ( is_admin() && ! self::doing_ajax() ); } /** * Returns true if doing ajax. * * @return bool */ protected static function doing_ajax() { if ( function_exists( 'wp_doing_ajax' ) ) { return wp_doing_ajax(); } return ( defined( 'DOING_AJAX' ) && DOING_AJAX ); } }