PluginProbe
Autoptimize / 3.1.16
Autoptimize v3.1.16
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/autoptimizePartners.php +19 -11 2.4.4 → 3.1.16 View file →
@@ -19,9 +19,13 @@
19 19 {
20 20 if ( $this->enabled() ) {
21 21 add_filter( 'autoptimize_filter_settingsscreen_tabs', array( $this, 'add_partner_tabs' ), 10, 1 );
22 22 }
23 - add_action( 'admin_menu', array( $this, 'add_admin_menu' ) );
23 + if ( is_multisite() && is_network_admin() && autoptimizeOptionWrapper::is_ao_active_for_network() ) {
24 + add_action( 'network_admin_menu', array( $this, 'add_admin_menu' ) );
25 + } else {
26 + add_action( 'admin_menu', array( $this, 'add_admin_menu' ) );
27 + }
24 28 }
25 29
26 30 protected function enabled()
27 31 {
@@ -29,11 +33,14 @@
29 33 }
30 34
31 35 public function add_partner_tabs( $in )
32 36 {
33 - $in = array_merge( $in, array(
34 - 'ao_partners' => __( 'Optimize More!', 'autoptimize' ),
35 - ) );
37 + $in = array_merge(
38 + $in,
39 + array(
40 + 'ao_partners' => esc_html__( 'Optimize More!', 'autoptimize' ),
41 + )
42 + );
36 43
37 44 return $in;
38 45 }
39 46
@@ -39,15 +46,15 @@
39 46
40 47 public function add_admin_menu()
41 48 {
42 49 if ( $this->enabled() ) {
43 - add_submenu_page( null, 'AO partner', 'AO partner', 'manage_options', 'ao_partners', array( $this, 'ao_partners_page' ) );
50 + add_submenu_page( '', 'AO partner', 'AO partner', 'manage_options', 'ao_partners', array( $this, 'ao_partners_page' ) );
44 51 }
45 52 }
46 53
47 54 protected function get_ao_partner_feed_markup()
48 55 {
49 - $no_feed_text = __( 'Have a look at <a href="http://optimizingmatters.com/">optimizingmatters.com</a> for Autoptimize power-ups!', 'autoptimize' );
56 + $no_feed_text = sprintf( esc_html__( 'Have a look at %1$sAutoptimize Pro%2$s to power-up your site!', 'autoptimize' ), '<a href="http://autoptimize.com/pro">', '</a>' );
50 57 $output = '';
51 58 if ( apply_filters( 'autoptimize_settingsscreen_remotehttp', true ) ) {
52 59 $rss = fetch_feed( 'http://feeds.feedburner.com/OptimizingMattersDownloads' );
53 60 $maxitems = 0;
@@ -73,9 +80,9 @@
73 80 $output .= '<div class="itemImage"><a href="' . $item_url . '" target="_blank"><img src="' . $img_url . '"></a></div>';
74 81 }
75 82
76 83 $output .= '<div class="itemDescription">' . wp_kses_post( $item->get_description() ) . '</div>';
77 - $output .= '<div class="itemButtonRow"><div class="itemButton button-secondary"><a href="' . $item_url . '" target="_blank">' . __( 'More info', 'autoptimize' ) . '</a></div></div>';
84 + $output .= '<div class="itemButtonRow"><div class="itemButton button-secondary"><a href="' . $item_url . '" target="_blank">' . esc_html__( 'More info', 'autoptimize' ) . '</a></div></div>';
78 85 $output .= '</li>';
79 86 }
80 87 $output .= '</ul>';
81 88 }
@@ -87,9 +94,9 @@
87 94 }
88 95
89 96 public function ao_partners_page()
90 97 {
91 -?>
98 + ?>
92 99 <style>
93 100 .itemDetail {
94 101 background: #fff;
95 102 width: 250px;
@@ -131,15 +138,16 @@
131 138 text-decoration: none;
132 139 color: #23282d;
133 140 }
134 141 </style>
142 + <script>document.title = "Autoptimize: <?php esc_html_e( 'Optimize More!', 'autoptimize' ); ?> " + document.title;</script>
135 143 <div class="wrap">
136 - <h1><?php _e( 'Autoptimize Settings', 'autoptimize' ); ?></h1>
144 + <h1><?php apply_filters( 'autoptimize_filter_settings_is_pro', false ) ? esc_html_e( 'Autoptimize Pro Settings', 'autoptimize' ) : esc_html_e( 'Autoptimize Settings', 'autoptimize' ); ?></h1>
137 145 <?php echo autoptimizeConfig::ao_admin_tabs(); ?>
138 - <?php echo '<h2>' . __( "These Autoptimize power-ups and related services will improve your site's performance even more!", 'autoptimize' ) . '</h2>'; ?>
146 + <?php echo '<h2>' . esc_html__( "These Autoptimize power-ups and related services will improve your site's performance even more!", 'autoptimize' ) . '</h2>'; ?>
139 147 <div>
140 148 <?php echo $this->get_ao_partner_feed_markup(); ?>
141 149 </div>
142 150 </div>
143 -<?php
151 + <?php
144 152 }
145 153 }