Changeset 1037778
- Timestamp:
- 12/03/2014 10:37:39 PM (11 years ago)
- Location:
- imforza-news/trunk
- Files:
-
- 3 added
- 1 deleted
- 1 edited
-
Readme.txt (deleted)
-
admin (added)
-
admin/wpengine.php (added)
-
imforza.php (modified) (9 diffs)
-
readme.txt (added)
Legend:
- Unmodified
- Added
- Removed
-
imforza-news/trunk/imforza.php
r957554 r1037778 2 2 /* 3 3 Plugin Name: imFORZA News 4 Version: 1. 1.04 Version: 1.2.0 5 5 Plugin URI: http://www.imforza.com/#utm_source=wpadmin&utm_medium=plugin&utm_campaign=imforzanewsplugin 6 6 Description: 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. … … 25 25 along with this program. If not, see <http://www.gnu.org/licenses/>. 26 26 */ 27 28 29 // Include WP Engine Cleanup 30 include_once('admin/wpengine.php'); 27 31 28 32 ################################################################################ … … 62 66 63 67 <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 68 a.button.imforza-button{background:#f7921e;color:#fff;border:0;font-weight:bold;text-transform:uppercase}a.button.imforza-button:hover{background:#ff971f;color:#fff} 78 69 </style> 79 70 80 71 <div class="support-widget"> 81 72 <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> 83 74 <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> 85 76 <p style="text-align: center;"> 86 77 <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> 88 79 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> -->94 80 </ul> 95 81 </p> 96 97 98 82 99 83 </div> … … 118 102 'id' => 'imforza_link', 119 103 'title' => __( 'imFORZA' ), 120 'href' => __(' http://imforza.com/#utm_source=wpadmin&utm_medium=imforzaplugin&utm_campaign=wpadminbar'),104 'href' => __('//www.imforza.com/#utm_source=wpadmin&utm_medium=imforzaplugin&utm_campaign=wpadminbar'), 121 105 "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&utm_medium=imforzaplugin&utm_campaign=wpadminbar'),130 "meta" => array("target" => "blank", "onClick" => "_gaq.push(['_trackEvent', 'imFORZA News Plugin', 'Shop']);")131 106 )); 132 107 … … 153 128 'id' => 'imforza_twitter', 154 129 'title' => __( 'Twitter'), 155 'href' => __(' http://twitter.com/imforza'),130 'href' => __('//twitter.com/imforza'), 156 131 "meta" => array("target" => "blank", "onClick" => "_gaq.push(['_trackEvent', 'imFORZA News Plugin', 'Twitter']);") 157 132 )); … … 161 136 'id' => 'imforza_pinterest', 162 137 'title' => __( 'Pinterest'), 163 'href' => __(' http://pinterest.com/imforza'),138 'href' => __('//pinterest.com/imforza'), 164 139 "meta" => array("target" => "blank", "onClick" => "_gaq.push(['_trackEvent', 'imFORZA News Plugin', 'Pinterest']);") 165 140 )); … … 169 144 'id' => 'imforza_linkedin', 170 145 'title' => __( 'LinkedIn'), 171 'href' => __(' http://www.linkedin.com/company/230194'),146 'href' => __('//www.linkedin.com/company/230194'), 172 147 "meta" => array("target" => "blank", "onClick" => "_gaq.push(['_trackEvent', 'imFORZA News Plugin', 'LinkedIn']);") 173 148 )); … … 178 153 'id' => 'imforza_support', 179 154 'title' => __( 'Support'), 180 'href' => __(' http://help.imforza.com/customer/portal/emails/new'),155 'href' => __('//help.imforza.com/customer/portal/emails/new'), 181 156 "meta" => array("target" => "blank", "onClick" => "_gaq.push(['_trackEvent', 'imFORZA News Plugin', 'Support']);") 182 157 )); … … 185 160 add_action('admin_bar_menu', 'add_imforza_admin_bar_link',25); 186 161 187 188 ################################################################################189 // imFORZA Shortcodes190 ################################################################################191 192 // Real Estate Footer193 function imfzafooter1Shortcode() {194 return '<a href="http://realestate.imforza.com/#utm_source=' .get_bloginfo('url') . '&utm_medium=plugin&utm_campaign=imforzanewsplugin" target="_blank" class="imfzalink" >Real Estate</a> by <a href="http://imforza.com/#utm_source=' .get_bloginfo('url') . '&utm_medium=plugin&utm_campaign=imforzanewsplugin" target="_blank" class="imfzalink" >imFORZA</a>';195 }196 add_shortcode('imfza-realestate-footer', 'imfzafooter1Shortcode');197 198 // Website Design Footer199 function imfzafooter2Shortcode() {200 return '<a href="http://www.imforza.com/services/website-design/#utm_source=' .get_bloginfo('url') . '&utm_medium=plugin&utm_campaign=imforzanewsplugin" target="_blank" class="imfzalink">Website Design</a> by <a href="http://imforza.com/#utm_source=' .get_bloginfo('url') . '&utm_medium=plugin&utm_campaign=imforzanewsplugin" target="_blank" class="imfzalink">imFORZA</a>';201 }202 add_shortcode('imfza-design-footer', 'imfzafooter2Shortcode');203 204 // Website Development Footer205 function imfzafooter3Shortcode() {206 return '<a href="http://www.imforza.com/services/website-development/#utm_source=' .get_bloginfo('url') . '&utm_medium=plugin&utm_campaign=imforzanewsplugin" target="_blank" class="imfzalink">Website Development</a> by <a href="http://imforza.com/#utm_source=' .get_bloginfo('url') . '&utm_medium=plugin&utm_campaign=imforzanewsplugin" target="_blank" class="imfzalink">imFORZA</a>';207 }208 add_shortcode('imfza-dev-footer', 'imfzafooter3Shortcode');209 210 211 212 ################################################################################213 // PressTrends Plugin Analytics214 ################################################################################215 function presstrends_imFORZANews_plugin() {216 217 // PressTrends Account API Key218 $api_key = 'l325qf6uap6dnjrrutams299ajr5zsts8wgr';219 $auth = 'ayh1rgfmmgujdhcgnqi6tum0j9j8zz14w';220 221 // Start of Metrics222 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 FILE246 $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 Action274 add_action('admin_init', 'presstrends_imFORZANews_plugin');275
Note: See TracChangeset
for help on using the changeset viewer.