@@ -3,24 +3,24 @@ discard block |
||
| 3 | 3 | Classlessly add a "more tools" tab to promote (future) AO addons and/ or affiliate services |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
| 6 | +if (!defined('ABSPATH')) exit; // Exit if accessed directly |
|
| 7 | 7 | |
| 8 | 8 | add_action('admin_init', 'ao_partner_tabs_preinit'); |
| 9 | 9 | function ao_partner_tabs_preinit() { |
| 10 | - if (apply_filters('autoptimize_filter_show_partner_tabs',true)) { |
|
| 11 | - add_filter('autoptimize_filter_settingsscreen_tabs','ao_add_partner_tabs'); |
|
| 10 | + if (apply_filters('autoptimize_filter_show_partner_tabs', true)) { |
|
| 11 | + add_filter('autoptimize_filter_settingsscreen_tabs', 'ao_add_partner_tabs'); |
|
| 12 | 12 | } |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | function ao_add_partner_tabs($in) { |
| 16 | - $in=array_merge($in,array('ao_partners' => __('Optimize More!','autoptimize'))); |
|
| 16 | + $in = array_merge($in, array('ao_partners' => __('Optimize More!', 'autoptimize'))); |
|
| 17 | 17 | return $in; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | -add_action('admin_menu','ao_partners_init'); |
|
| 20 | +add_action('admin_menu', 'ao_partners_init'); |
|
| 21 | 21 | function ao_partners_init() { |
| 22 | - if (apply_filters('autoptimize_filter_show_partner_tabs',true)) { |
|
| 23 | - $hook=add_submenu_page(NULL,'AO partner','AO partner','manage_options','ao_partners','ao_partners'); |
|
| 22 | + if (apply_filters('autoptimize_filter_show_partner_tabs', true)) { |
|
| 23 | + $hook = add_submenu_page(NULL, 'AO partner', 'AO partner', 'manage_options', 'ao_partners', 'ao_partners'); |
|
| 24 | 24 | // register_settings here as well if needed |
| 25 | 25 | } |
| 26 | 26 | } |
@@ -71,10 +71,10 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | </style> |
| 73 | 73 | <div class="wrap"> |
| 74 | - <h1><?php _e('Autoptimize Settings','autoptimize'); ?></h1> |
|
| 74 | + <h1><?php _e('Autoptimize Settings', 'autoptimize'); ?></h1> |
|
| 75 | 75 | <?php echo autoptimizeConfig::ao_admin_tabs(); ?> |
| 76 | 76 | <?php |
| 77 | - echo '<h2>'. __("These Autoptimize power-ups and related services will improve your site's performance even more!",'autoptimize') . '</h2>'; |
|
| 77 | + echo '<h2>'.__("These Autoptimize power-ups and related services will improve your site's performance even more!", 'autoptimize').'</h2>'; |
|
| 78 | 78 | ?> |
| 79 | 79 | <div> |
| 80 | 80 | <?php getAOPartnerFeed(); ?> |
@@ -84,33 +84,33 @@ discard block |
||
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | function getAOPartnerFeed() { |
| 87 | - $noFeedText=__( 'Have a look at <a href="http://optimizingmatters.com/">optimizingmatters.com</a> for Autoptimize power-ups!', 'autoptimize' ); |
|
| 87 | + $noFeedText = __('Have a look at <a href="http://optimizingmatters.com/">optimizingmatters.com</a> for Autoptimize power-ups!', 'autoptimize'); |
|
| 88 | 88 | |
| 89 | - if (apply_filters('autoptimize_settingsscreen_remotehttp',true)) { |
|
| 90 | - $rss = fetch_feed( "http://feeds.feedburner.com/OptimizingMattersDownloads" ); |
|
| 89 | + if (apply_filters('autoptimize_settingsscreen_remotehttp', true)) { |
|
| 90 | + $rss = fetch_feed("http://feeds.feedburner.com/OptimizingMattersDownloads"); |
|
| 91 | 91 | $maxitems = 0; |
| 92 | 92 | |
| 93 | - if ( ! is_wp_error( $rss ) ) { |
|
| 94 | - $maxitems = $rss->get_item_quantity( 20 ); |
|
| 95 | - $rss_items = $rss->get_items( 0, $maxitems ); |
|
| 93 | + if (!is_wp_error($rss)) { |
|
| 94 | + $maxitems = $rss->get_item_quantity(20); |
|
| 95 | + $rss_items = $rss->get_items(0, $maxitems); |
|
| 96 | 96 | } ?> |
| 97 | 97 | <ul> |
| 98 | 98 | <?php |
| 99 | - if ( $maxitems == 0 ) { |
|
| 99 | + if ($maxitems == 0) { |
|
| 100 | 100 | echo $noFeedText; |
| 101 | 101 | } else { |
| 102 | - foreach ( $rss_items as $item ) : |
|
| 103 | - $itemURL = esc_url( $item->get_permalink() ); ?> |
|
| 102 | + foreach ($rss_items as $item) : |
|
| 103 | + $itemURL = esc_url($item->get_permalink()); ?> |
|
| 104 | 104 | <li class="itemDetail"> |
| 105 | - <h3 class="itemTitle"><a href="<?php echo $itemURL; ?>" target="_blank"><?php echo esc_html( $item->get_title() ); ?></a></h3> |
|
| 105 | + <h3 class="itemTitle"><a href="<?php echo $itemURL; ?>" target="_blank"><?php echo esc_html($item->get_title()); ?></a></h3> |
|
| 106 | 106 | <?php |
| 107 | - if (($enclosure = $item->get_enclosure()) && (strpos($enclosure->get_type(),"image")!==false) ) { |
|
| 108 | - $itemImgURL=esc_url($enclosure->get_link()); |
|
| 107 | + if (($enclosure = $item->get_enclosure()) && (strpos($enclosure->get_type(), "image") !== false)) { |
|
| 108 | + $itemImgURL = esc_url($enclosure->get_link()); |
|
| 109 | 109 | echo "<div class=\"itemImage\"><a href=\"".$itemURL."\" target=\"_blank\"><img src=\"".$itemImgURL."\"/></a></div>"; |
| 110 | 110 | } |
| 111 | 111 | ?> |
| 112 | - <div class="itemDescription"><?php echo wp_kses_post($item -> get_description() ); ?></div> |
|
| 113 | - <div class="itemButtonRow"><div class="itemButton button-secondary"><a href="<?php echo $itemURL; ?>" target="_blank"><?php _e('More info','autoptimize'); ?></a></div></div> |
|
| 112 | + <div class="itemDescription"><?php echo wp_kses_post($item -> get_description()); ?></div> |
|
| 113 | + <div class="itemButtonRow"><div class="itemButton button-secondary"><a href="<?php echo $itemURL; ?>" target="_blank"><?php _e('More info', 'autoptimize'); ?></a></div></div> |
|
| 114 | 114 | </li> |
| 115 | 115 | <?php endforeach; ?> |
| 116 | 116 | <?php } ?> |