X7ROOT File Manager
Current Path:
/home/okeydcqc/public_html/wp-content/plugins/jetpack/_inc/lib
home
/
okeydcqc
/
public_html
/
wp-content
/
plugins
/
jetpack
/
_inc
/
lib
/
ðŸ“
..
ðŸ“
admin-pages
📄
class-jetpack-ai-helper.php
(14.21 KB)
📄
class-jetpack-blog-stats-helper.php
(2.73 KB)
📄
class-jetpack-currencies.php
(4.73 KB)
📄
class-jetpack-instagram-gallery-helper.php
(2.92 KB)
📄
class-jetpack-mapbox-helper.php
(3.16 KB)
📄
class-jetpack-podcast-feed-locator.php
(3.47 KB)
📄
class-jetpack-podcast-helper.php
(20.23 KB)
📄
class-jetpack-recommendations.php
(15.24 KB)
📄
class-jetpack-top-posts-helper.php
(4.48 KB)
📄
class.color.php
(21.79 KB)
📄
class.core-rest-api-endpoints.php
(148.07 KB)
📄
class.jetpack-automatic-install-skin.php
(293 B)
📄
class.jetpack-iframe-embed.php
(3.1 KB)
📄
class.jetpack-password-checker.php
(32.45 KB)
📄
class.jetpack-search-performance-logger.php
(3.62 KB)
📄
class.media-extractor.php
(21.57 KB)
📄
class.media-summary.php
(15.43 KB)
📄
class.media.php
(15.56 KB)
📄
components.php
(3.04 KB)
ðŸ“
core-api
ðŸ“
debugger
📄
debugger.php
(872 B)
📄
icalendar-reader.php
(33.11 KB)
ðŸ“
markdown
📄
markdown.php
(344 B)
📄
plans.php
(1.89 KB)
📄
plugins.php
(209 B)
📄
tonesque.php
(6.85 KB)
📄
widgets.php
(26.19 KB)
Editing: class-jetpack-blog-stats-helper.php
<?php /** * Blog Stats block helper. * * @package automattic/jetpack */ use Automattic\Jetpack\Stats\WPCOM_Stats; /** * Class Jetpack_Blog_Stats_Helper */ class Jetpack_Blog_Stats_Helper { /** * Returns user's blog stats. * * @param array $stats_option Array containing the Blog Stats block attributes. * * @return int */ public static function get_stats( $stats_option ) { $stats_option = wp_parse_args( $stats_option, array( 'statsOption' => 'blog', 'statsData' => 'views', 'postId' => get_the_ID(), ) ); if ( ! defined( 'IS_WPCOM' ) || ! IS_WPCOM ) { // Jetpack sites. $wpcom_stats = new WPCOM_Stats(); if ( $stats_option['statsOption'] === 'post' ) { // Cache in post meta to prevent wp_options blowing up when retrieving views // for multiple posts simultaneously (eg. when inserted into template). $cache_in_meta = true; $data = $wpcom_stats->convert_stats_array_to_object( $wpcom_stats->get_post_views( $stats_option['postId'], array( 'fields' => 'views' ), // No visitor count for posts. $cache_in_meta ) ); if ( isset( $data->views ) ) { return $data->views; } } else { $data = $wpcom_stats->convert_stats_array_to_object( $wpcom_stats->get_stats( array( 'fields' => 'stats' ) ) ); if ( $stats_option['statsData'] === 'views' && isset( $data->stats->views ) ) { return $data->stats->views; } if ( $stats_option['statsData'] === 'visitors' && isset( $data->stats->visitors ) ) { return $data->stats->visitors; } } } elseif ( $stats_option['statsOption'] === 'post' ) { // Simple sites. if ( function_exists( 'get_all_time_postviews' ) ) { // This is cached so no need to cache it again. // @phan-suppress-next-line PhanUndeclaredFunction return (int) get_all_time_postviews( $stats_option['postId'] ); } } else { // Simple sites. $_blog_id = get_current_blog_id(); if ( $stats_option['statsData'] === 'views' && function_exists( 'stats_grandtotal_views' ) ) { // This is cached so no need to cache it again. // @phan-suppress-next-line PhanUndeclaredFunction return stats_grandtotal_views( $_blog_id ); } if ( $stats_option['statsData'] === 'visitors' && function_exists( 'stats_get_visitors' ) ) { $stats = wp_cache_get( "stats_get_visitors_total_$_blog_id", 'blog-stats-block' ); if ( false !== $stats ) { return $stats; } // @phan-suppress-next-line PhanUndeclaredFunction $stats = array_sum( stats_get_visitors( get_current_blog_id(), false, gmdate( 'Y' ) - 2012, 365 ) ); wp_cache_set( "stats_get_visitors_total_$_blog_id", $stats, 'blog-stats-block', HOUR_IN_SECONDS ); return $stats; } } return 0; } }
Upload File
Create Folder