$wpdb->prepare( "SELECT t2.object_id, SUM(t1.pageviews) AS traffic FROM {$wpdb->prefix}rank_math_analytics_ga AS t1 Left JOIN {$wpdb->prefix}rank_math_analytics_objects AS t2 ON t1.page=t2.page WHERE t2.object_id IN ( {$placeholder} ) and t1.created BETWEEN Now() - interval 36 day and Now() - interval 3 day GROUP BY t2.object_id", $post_ids ), ARRAY_A ); // phpcs:enable return array_combine( array_column( $data, 'object_id' ), array_column( $data, 'traffic' ) ); } /** * Get pageviews for single post by post Id. * * @param array $post_ids Post IDs. * * @return array */ public static function get_impressions_by_object_ids( $post_ids ) { if ( ! DB_Helper::check_table_exists( 'rank_math_analytics_gsc' ) ) { return []; } global $wpdb; $placeholder = implode( ', ', array_fill( 0, count( $post_ids ), '%d' ) ); // phpcs:disable $data = $wpdb->get_results( $wpdb->prepare( "SELECT t2.object_id, SUM(impressions) AS traffic FROM {$wpdb->prefix}rank_math_analytics_gsc AS t1 Left JOIN {$wpdb->prefix}rank_math_analytics_objects AS t2 ON t1.page=t2.page WHERE t2.object_id IN ( {$placeholder} ) and t1.created BETWEEN Now() - interval 36 day and Now() - interval 3 day GROUP BY t2.object_id", $post_ids ), ARRAY_A ); // phpcs:enable return array_combine( array_column( $data, 'object_id' ), array_column( $data, 'traffic' ) ); } }
Fatal error: Uncaught Error: Class "RankMathPro\Analytics\Pageviews" not found in /htdocs/milfdoporn.com/wp-content/plugins/seo-by-rank-math-pro/includes/modules/analytics/class-analytics.php:78 Stack trace: #0 /htdocs/milfdoporn.com/wp-content/plugins/seo-by-rank-math-pro/rank-math-pro.php(315): RankMathPro\Analytics\Analytics->__construct() #1 /htdocs/milfdoporn.com/wp-includes/class-wp-hook.php(324): RankMathPro->init('') #2 /htdocs/milfdoporn.com/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #3 /htdocs/milfdoporn.com/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /htdocs/milfdoporn.com/wp-settings.php(559): do_action('plugins_loaded') #5 /htdocs/milfdoporn.com/wp-config.php(110): require_once('/htdocs/milfdop...') #6 /htdocs/milfdoporn.com/wp-load.php(50): require_once('/htdocs/milfdop...') #7 /htdocs/milfdoporn.com/wp-blog-header.php(13): require_once('/htdocs/milfdop...') #8 /htdocs/milfdoporn.com/index.php(17): require('/htdocs/milfdop...') #9 {main} thrown in /htdocs/milfdoporn.com/wp-content/plugins/seo-by-rank-math-pro/includes/modules/analytics/class-analytics.php on line 78