PressTrends helps theme authors build better themes and provide awesome support by retrieving aggregated stats. PressTrends also provides a plugin that delivers stats on how your site is performing against the web and similar sites like yours. Learn more…

'; } // PressTrends Opt-In Option function presstrends_opt_string() { $current_key = get_option('presstrends_theme_opt'); $opt = isset( $current_key['activated'] ) ? $current_key['activated'] : false; if($opt == 'on') { echo ""; } else { echo ""; } } // Add PressTrends Pointer function be_password_pointer_enqueue( $hook_suffix ) { $enqueue = false; $dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) ); if ( ! in_array( 'activate_presstrends', $dismissed ) ) { $enqueue = true; add_action( 'admin_print_footer_scripts', 'be_password_pointer_print_admin_bar' ); } if ( $enqueue ) { wp_enqueue_style( 'wp-pointer' ); wp_enqueue_script( 'wp-pointer' ); } } add_action( 'admin_enqueue_scripts', 'be_password_pointer_enqueue' ); function be_password_pointer_print_admin_bar() { $pointer_content = '

' . 'Activate PressTrends' . '

'; $pointer_content .= '

' . 'Help theme authors build better themes and provide awesome support by retrieving aggregated stats.' . '

'; ?> Name ); $theme_version = $theme_data->Version; } else { $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' ); $theme_name = $theme_data['Name']; $theme_versino = $theme_data['Version']; } $plugin_name = '&'; foreach ( get_plugins() as $plugin_info ) { $plugin_name .= $plugin_info['Name'] . '&'; } $posts_with_comments = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type='post' AND comment_count > 0" ); $data = array( 'url' => stripslashes( str_replace( array( 'http://', '/', ':' ), '', site_url() ) ), 'posts' => $count_posts->publish, 'pages' => $count_pages->publish, 'comments' => $comments_count->total_comments, 'approved' => $comments_count->approved, 'spam' => $comments_count->spam, 'pingbacks' => $wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_type = 'pingback'" ), 'post_conversion' => ( $count_posts->publish > 0 && $posts_with_comments > 0 ) ? number_format( ( $posts_with_comments / $count_posts->publish ) * 100, 0, '.', '' ) : 0, 'theme_version' => $theme_version, 'theme_name' => $theme_name, 'site_name' => str_replace( ' ', '', get_bloginfo( 'name' ) ), 'plugins' => count( get_option( 'active_plugins' ) ), 'plugin' => urlencode( $plugin_name ), 'wpversion' => get_bloginfo( 'version' ), 'api_version' => '2.4', ); foreach ( $data as $k => $v ) { $url .= $k . '/' . $v . '/'; } wp_remote_get( $url ); set_transient( 'presstrends_theme_cache_data', $data, 60 * 60 * 24 ); } } // PressTrends WordPress Action $current_key = get_option('presstrends_theme_opt'); $opt = isset( $current_key['activated'] ) ? $current_key['activated'] : false; if($opt == 'on') { add_action('admin_init', 'ec_presstrends'); } ?>