run(); } public function run() { if ( $this->enabled() ) { add_filter( 'autoptimize_filter_settingsscreen_tabs', array( $this, 'add_partner_tabs' ), 10, 1 ); } if ( is_multisite() && is_network_admin() && autoptimizeOptionWrapper::is_ao_active_for_network() ) { add_action( 'network_admin_menu', array( $this, 'add_admin_menu' ) ); } else { add_action( 'admin_menu', array( $this, 'add_admin_menu' ) ); } } protected function enabled() { return apply_filters( 'autoptimize_filter_show_partner_tabs', true ); } public function add_partner_tabs( $in ) { $in = array_merge( $in, array( 'ao_partners' => esc_html__( 'Optimize More!', 'autoptimize' ), ) ); return $in; } public function add_admin_menu() { if ( $this->enabled() ) { add_submenu_page( '', 'AO partner', 'AO partner', 'manage_options', 'ao_partners', array( $this, 'ao_partners_page' ) ); } } protected function get_ao_partner_feed_markup() { $no_feed_text = sprintf( esc_html__( 'Have a look at %1$sAutoptimize Pro%2$s to power-up your site!', 'autoptimize' ), '', '' ); $output = ''; if ( apply_filters( 'autoptimize_settingsscreen_remotehttp', true ) ) { $rss = fetch_feed( 'http://feeds.feedburner.com/OptimizingMattersDownloads' ); $maxitems = 0; if ( ! is_wp_error( $rss ) ) { $maxitems = $rss->get_item_quantity( 20 ); $rss_items = $rss->get_items( 0, $maxitems ); } if ( 0 == $maxitems ) { $output .= $no_feed_text; } else { $output .= ''; } } else { $output .= $no_feed_text; } return $output; } public function ao_partners_page() { ?>

' . esc_html__( "These Autoptimize power-ups and related services will improve your site's performance even more!", 'autoptimize' ) . ''; ?>
get_ao_partner_feed_markup(); ?>