BSF_Analytics_Loader::load_analytics()
Load Analytics library.
Description
Return
(void)
Source
File: admin/bsf-analytics/class-bsf-analytics-loader.php
public function load_analytics() { $unique_entities = array(); if ( ! empty( $this->entities ) ) { foreach ( $this->entities as $entity ) { foreach ( $entity as $key => $data ) { if ( isset( $data['path'] ) ) { if ( file_exists( $data['path'] . '/version.json' ) ) { $file_contents = file_get_contents( $data['path'] . '/version.json' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents $analytics_version = json_decode( $file_contents, 1 ); $analytics_version = $analytics_version['bsf-analytics-ver']; if ( version_compare( $analytics_version, $this->analytics_version, '>' ) ) { $this->analytics_version = $analytics_version; $this->analytics_path = $data['path']; } } } if ( ! isset( $unique_entities[ $key ] ) ) { $unique_entities[ $key ] = $data; } } } if ( file_exists( $this->analytics_path ) && ! class_exists( 'BSF_Analytics' ) ) { require_once $this->analytics_path . '/class-bsf-analytics.php'; new BSF_Analytics( $unique_entities, $this->analytics_path, $this->analytics_version ); } } }
Expand full source code Collapse full source code View on Trac