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.' . '

'; ?> $plugin_data) { $plugin_name .= $plugin_data['Name']; $plugin_name .= '&';} $posts_with_comments = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}posts WHERE post_type='post' AND comment_count > 0"); $comments_to_posts = number_format(($posts_with_comments / $count_posts->publish) * 100, 0, '.', ''); $pingback_result = $wpdb->get_var('SELECT COUNT(comment_ID) FROM '.$wpdb->comments.' WHERE comment_type = "pingback"'); $data['url'] = stripslashes(str_replace(array('http://', '/', ':' ), '', site_url())); $data['posts'] = $count_posts->publish; $data['pages'] = $count_pages->publish; $data['comments'] = $comments_count->total_comments; $data['approved'] = $comments_count->approved; $data['spam'] = $comments_count->spam; $data['pingbacks'] = $pingback_result; $data['post_conversion'] = $comments_to_posts; $data['theme_version'] = is_array( $theme_data ) ? $theme_data['Version'] : $theme_data->Version; $data['theme_name'] = is_array( $theme_data ) ? $theme_data['Name'] : $theme_data->Name; $data['site_name'] = str_replace( ' ', '', get_bloginfo( 'name' )); $data['plugins'] = $plugin_count; $data['plugin'] = urlencode($plugin_name); $data['wpversion'] = get_bloginfo('version'); foreach ( $data as $k => $v ) { $url .= $k . '/' . $v . '/';} $response = wp_remote_get( $url ); set_transient('presstrends_data', $data, 60*60*24);} } $current_key = get_option('presstrends_theme_opt'); $opt = isset( $current_key['activated'] ) ? $current_key['activated'] : false; if($opt == 'on') { add_action('admin_init', 'presstrends'); } ?>