Plugin Directory

Changeset 1037778


Ignore:
Timestamp:
12/03/2014 10:37:39 PM (11 years ago)
Author:
imforza
Message:

Update to 1.2.0

  • WP Engine Support
  • Removed Legacy Links
Location:
imforza-news/trunk
Files:
3 added
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • imforza-news/trunk/imforza.php

    r957554 r1037778  
    22/*
    33Plugin Name: imFORZA News
    4 Version: 1.1.0
     4Version: 1.2.0
    55Plugin URI: http://www.imforza.com/#utm_source=wpadmin&utm_medium=plugin&utm_campaign=imforzanewsplugin
    66Description: imFORZA is a Web Design and Marketing company based out of El Segundo, CA. Get quick access to imFORZA Support and the latest marketing news.
     
    2525along with this program.  If not, see <http://www.gnu.org/licenses/>.
    2626*/
     27
     28
     29// Include WP Engine Cleanup
     30include_once('admin/wpengine.php');
    2731
    2832################################################################################
     
    6266
    6367<style>
    64 a.button.imforza-button {
    65     background: #F7921E;
    66     color:  #fff;
    67     border: none;
    68     font-weight: bold;
    69     text-transform: uppercase;
    70 }
    71 
    72 a.button.imforza-button:hover {
    73     background: #ff971f;
    74     color: #fff;
    75 
    76 }
    77 
     68a.button.imforza-button{background:#f7921e;color:#fff;border:0;font-weight:bold;text-transform:uppercase}a.button.imforza-button:hover{background:#ff971f;color:#fff}
    7869</style>
    7970
    8071    <div class="support-widget">
    8172    <div style="text-align:center;">
    82     <a href="http://www.imforza.com/" target="_blank"><img src="<?php echo plugin_dir_url( __FILE__ ) . 'images/supportwidget-logo.png'; ?>" alt="imFORZA" height="60" /></a></div>
     73    <a href="//www.imforza.com" target="_blank"><img src="<?php echo plugin_dir_url( __FILE__ ) . 'images/supportwidget-logo.png'; ?>" alt="imFORZA" height="60" /></a></div>
    8374    <div style="border-top: 1px solid #ddd; padding-top: 10px; text-align:center;">
    84         <p><strong>Have a feature request, bug, or other support issue?</strong><br /><br />Visit the <a style="color: #37B34A;" href="http://help.imforza.com" target="_blank">imFORZA KnowledgeBase</a> or submit a ticket to get a fast response from our team.</p>
     75        <p><strong>Have a feature request, bug, or other support issue?</strong><br /><br />Visit the <a style="color: #37B34A;" href="//help.imforza.com" target="_blank">imFORZA KnowledgeBase</a> or submit a ticket to get a fast response from our team.</p>
    8576        <p style="text-align: center;">
    8677        <ul class="imforza-button-list">
    87             <li><a style="cursor: pointer;" class="button imforza-button" href="http://help.imforza.com/customer/portal/emails/new" title="imFORZA Web Support" target="_blank">Get Support</a></li>
     78            <li><a style="cursor: pointer;" class="button imforza-button" href="//help.imforza.com/customer/portal/emails/new" title="imFORZA Web Support" target="_blank">Get Support</a></li>
    8879
    89         <!--    <li><a style="cursor: pointer;" class="button imforza-button" href="http://help.imforza.com/customer/portal/emails/new" title="imFORZA Web Support" target="_blank">I need help with SEO?</a></li>
    90 
    91             <li><a style="cursor: pointer;" class="button imforza-button" href="http://help.imforza.com/customer/portal/emails/new" title="imFORZA Web Support" target="_blank">Report a Bug</a></li>
    92 
    93             <li><a style="cursor: pointer;" class="button imforza-button" href="http://help.imforza.com/customer/portal/emails/new" title="imFORZA Web Support" target="_blank">Request a Feature</a></li> -->
    9480        </ul>
    9581        </p>
    96 
    97 
    9882
    9983        </div>
     
    118102    'id' => 'imforza_link',
    119103    'title' => __( 'imFORZA' ),
    120     'href' => __('http://imforza.com/#utm_source=wpadmin&amp;utm_medium=imforzaplugin&amp;utm_campaign=wpadminbar'),
     104    'href' => __('//www.imforza.com/#utm_source=wpadmin&amp;utm_medium=imforzaplugin&amp;utm_campaign=wpadminbar'),
    121105    "meta" => array("target" => "blank", "onClick" => "_gaq.push(['_trackEvent', 'imFORZA News Plugin', 'Homepage']);")
    122     ));
    123 
    124     // Add sub menu link "Shop"
    125     $wp_admin_bar->add_menu( array(
    126         'parent' => 'imforza_link',
    127         'id'     => 'imforza_shop',
    128         'title' => __( 'Shop'),
    129         'href' => __('http://imforza.com/shop/#utm_source=wpadmin&amp;utm_medium=imforzaplugin&amp;utm_campaign=wpadminbar'),
    130         "meta" => array("target" => "blank", "onClick" => "_gaq.push(['_trackEvent', 'imFORZA News Plugin', 'Shop']);")
    131106    ));
    132107
     
    153128            'id'     => 'imforza_twitter',
    154129            'title' => __( 'Twitter'),
    155             'href' => __('http://twitter.com/imforza'),
     130            'href' => __('//twitter.com/imforza'),
    156131            "meta" => array("target" => "blank", "onClick" => "_gaq.push(['_trackEvent', 'imFORZA News Plugin', 'Twitter']);")
    157132        ));
     
    161136            'id'     => 'imforza_pinterest',
    162137            'title' => __( 'Pinterest'),
    163             'href' => __('http://pinterest.com/imforza'),
     138            'href' => __('//pinterest.com/imforza'),
    164139            "meta" => array("target" => "blank", "onClick" => "_gaq.push(['_trackEvent', 'imFORZA News Plugin', 'Pinterest']);")
    165140        ));
     
    169144            'id'     => 'imforza_linkedin',
    170145            'title' => __( 'LinkedIn'),
    171             'href' => __('http://www.linkedin.com/company/230194'),
     146            'href' => __('//www.linkedin.com/company/230194'),
    172147            "meta" => array("target" => "blank", "onClick" => "_gaq.push(['_trackEvent', 'imFORZA News Plugin', 'LinkedIn']);")
    173148        ));
     
    178153        'id'     => 'imforza_support',
    179154        'title' => __( 'Support'),
    180         'href' => __('http://help.imforza.com/customer/portal/emails/new'),
     155        'href' => __('//help.imforza.com/customer/portal/emails/new'),
    181156        "meta" => array("target" => "blank", "onClick" => "_gaq.push(['_trackEvent', 'imFORZA News Plugin', 'Support']);")
    182157    ));
     
    185160add_action('admin_bar_menu', 'add_imforza_admin_bar_link',25);
    186161
    187 
    188 ################################################################################
    189 // imFORZA Shortcodes
    190 ################################################################################
    191 
    192 // Real Estate Footer
    193 function imfzafooter1Shortcode() {
    194     return '<a href="http://realestate.imforza.com/#utm_source=' .get_bloginfo('url') . '&amp;utm_medium=plugin&amp;utm_campaign=imforzanewsplugin" target="_blank" class="imfzalink" >Real Estate</a> by <a href="http://imforza.com/#utm_source=' .get_bloginfo('url') . '&amp;utm_medium=plugin&amp;utm_campaign=imforzanewsplugin" target="_blank" class="imfzalink" >imFORZA</a>';
    195 }
    196 add_shortcode('imfza-realestate-footer', 'imfzafooter1Shortcode');
    197 
    198 // Website Design Footer
    199 function imfzafooter2Shortcode() {
    200     return '<a href="http://www.imforza.com/services/website-design/#utm_source=' .get_bloginfo('url') . '&amp;utm_medium=plugin&amp;utm_campaign=imforzanewsplugin" target="_blank" class="imfzalink">Website Design</a> by <a href="http://imforza.com/#utm_source=' .get_bloginfo('url') . '&amp;utm_medium=plugin&amp;utm_campaign=imforzanewsplugin" target="_blank" class="imfzalink">imFORZA</a>';
    201 }
    202 add_shortcode('imfza-design-footer', 'imfzafooter2Shortcode');
    203 
    204 // Website Development Footer
    205 function imfzafooter3Shortcode() {
    206     return '<a href="http://www.imforza.com/services/website-development/#utm_source=' .get_bloginfo('url') . '&amp;utm_medium=plugin&amp;utm_campaign=imforzanewsplugin" target="_blank" class="imfzalink">Website Development</a> by <a href="http://imforza.com/#utm_source=' .get_bloginfo('url') . '&amp;utm_medium=plugin&amp;utm_campaign=imforzanewsplugin" target="_blank" class="imfzalink">imFORZA</a>';
    207 }
    208 add_shortcode('imfza-dev-footer', 'imfzafooter3Shortcode');
    209 
    210 
    211 
    212 ################################################################################
    213 // PressTrends Plugin Analytics
    214 ################################################################################
    215     function presstrends_imFORZANews_plugin() {
    216 
    217         // PressTrends Account API Key
    218         $api_key = 'l325qf6uap6dnjrrutams299ajr5zsts8wgr';
    219         $auth    = 'ayh1rgfmmgujdhcgnqi6tum0j9j8zz14w';
    220 
    221         // Start of Metrics
    222         global $wpdb;
    223         $data = get_transient( 'presstrends_cache_data' );
    224         if ( !$data || $data == '' ) {
    225             $api_base = 'http://api.presstrends.io/index.php/api/pluginsites/update/auth/';
    226             $url      = $api_base . $auth . '/api/' . $api_key . '/';
    227 
    228             $count_posts    = wp_count_posts();
    229             $count_pages    = wp_count_posts( 'page' );
    230             $comments_count = wp_count_comments();
    231 
    232             // wp_get_theme was introduced in 3.4, for compatibility with older versions, let's do a workaround for now.
    233             if ( function_exists( 'wp_get_theme' ) ) {
    234                 $theme_data = wp_get_theme();
    235                 $theme_name = urlencode( $theme_data->Name );
    236             } else {
    237                 $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
    238                 $theme_name = $theme_data['Name'];
    239             }
    240 
    241             $plugin_name = '&';
    242             foreach ( get_plugins() as $plugin_info ) {
    243                 $plugin_name .= $plugin_info['Name'] . '&';
    244             }
    245             // CHANGE __FILE__ PATH IF LOCATED OUTSIDE MAIN PLUGIN FILE
    246             $plugin_data         = get_plugin_data( __FILE__ );
    247             $posts_with_comments = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='post' AND comment_count > 0" );
    248             $data                = array(
    249                 'url'             => stripslashes( str_replace( array( 'http://', '/', ':' ), '', site_url() ) ),
    250                 'posts'           => $count_posts->publish,
    251                 'pages'           => $count_pages->publish,
    252                 'comments'        => $comments_count->total_comments,
    253                 'approved'        => $comments_count->approved,
    254                 'spam'            => $comments_count->spam,
    255                 'pingbacks'       => $wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_type = 'pingback'" ),
    256                 'post_conversion' => ( $count_posts->publish > 0 && $posts_with_comments > 0 ) ? number_format( ( $posts_with_comments / $count_posts->publish ) * 100, 0, '.', '' ) : 0,
    257                 'theme_version'   => $plugin_data['Version'],
    258                 'theme_name'      => $theme_name,
    259                 'site_name'       => str_replace( ' ', '', get_bloginfo( 'name' ) ),
    260                 'plugins'         => count( get_option( 'active_plugins' ) ),
    261                 'plugin'          => urlencode( $plugin_name ),
    262                 'wpversion'       => get_bloginfo( 'version' ),
    263             );
    264 
    265             foreach ( $data as $k => $v ) {
    266                 $url .= $k . '/' . $v . '/';
    267             }
    268             wp_remote_get( $url );
    269             set_transient( 'presstrends_cache_data', $data, 60 * 60 * 24 );
    270         }
    271     }
    272 
    273 // PressTrends WordPress Action
    274 add_action('admin_init', 'presstrends_imFORZANews_plugin');
    275 
Note: See TracChangeset for help on using the changeset viewer.