Tribe__PUE__Checker::get_stats()

Build and get the stats

Contents


Return

(array)


Top ↑

Source

File: src/Tribe/PUE/Checker.php

		public function get_stats() {

			$stats = self::$stats;

			if ( empty( $stats ) ) {
				$stats = $this->build_stats();
			}

			/**
			 * Allow full stats data to be built and sent.
			 *
			 * @param boolean $use_full_stats Whether to send full stats
			 *
			 * @since 4.5.1
			 */
			$use_full_stats = apply_filters( 'pue_use_full_stats', false );

			if ( $use_full_stats ) {
				$stats_full = self::$stats_full;

				if ( empty( $stats_full ) ) {
					$stats = $this->build_full_stats( $stats );
				}
			}

			/**
			 * Filter stats and allow plugins to add their own stats
			 * for tracking specific points of data.
			 *
			 * @param array                $stats          Stats gathered by PUE Checker class
			 * @param boolean              $use_full_stats Whether to send full stats
			 * @param \Tribe__PUE__Checker $checker        PUE Checker class object
			 *
			 * @since 4.5.1
			 */
			$stats = apply_filters( 'pue_stats', $stats, $use_full_stats, $this );

			return $stats;
		}