get_all_settings(); if ( ! empty( $s['test_mode'] ) ) { // In test mode, disable optimizations for non-admins if ( ! current_user_can( 'manage_options' ) ) { add_filter( 'qwsc_should_optimize', '__return_false' ); } } if ( ! empty( $s['debug_mode'] ) && current_user_can( 'manage_options' ) ) { add_action( 'wp_footer', array( $this, 'footer_comment' ), 9999 ); add_action( 'admin_bar_menu', array( $this, 'admin_bar' ), 200 ); } } public function footer_comment() { $cache = isset( $_SERVER['HTTP_X_QWSC_CACHE_STATUS'] ) && is_string( $_SERVER['HTTP_X_QWSC_CACHE_STATUS'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_QWSC_CACHE_STATUS'] ) ) : 'n/a'; printf( "\n\n", esc_html( $cache ), esc_html( QWSC_VERSION ) ); } public function admin_bar( $bar ) { $bar->add_node( array( 'id' => 'qwsc-debug', 'title' => 'QW Optimize Debug ON', 'href' => admin_url( 'admin.php?page=qw-speed-cache-tools' ), ) ); } }