| 1 |
<?php |
| 2 |
/** |
| 3 |
* The provider for all telemetry related functionality. |
| 4 |
* |
| 5 |
* @since 0.1.0 |
| 6 |
* |
| 7 |
* @package SolidWP\Performance |
| 8 |
*/ |
| 9 |
|
| 10 |
namespace SolidWP\Performance\Telemetry; |
| 11 |
|
| 12 |
use SolidWP\Performance\Contracts\Service_Provider; |
| 13 |
use SolidWP\Performance\Core; |
| 14 |
use SolidWP\Performance\StellarWP\Telemetry\Config as TelemetryConfig; |
| 15 |
use SolidWP\Performance\StellarWP\Telemetry\Core as Telemetry; |
| 16 |
|
| 17 |
if ( ! defined( 'ABSPATH' ) ) { |
| 18 |
exit; |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* The provider for all telemetry related functionality. |
| 23 |
* |
| 24 |
* @since 0.1.0 |
| 25 |
* |
| 26 |
* @package SolidWP\Performance |
| 27 |
*/ |
| 28 |
class Provider extends Service_Provider { |
| 29 |
|
| 30 |
/** |
| 31 |
* {@inheritdoc} |
| 32 |
*/ |
| 33 |
public function register(): void { |
| 34 |
TelemetryConfig::set_container( $this->container ); |
| 35 |
TelemetryConfig::set_server_url( 'https://telemetry.stellarwp.com/api/v1' ); |
| 36 |
TelemetryConfig::set_hook_prefix( 'solid-performance' ); |
| 37 |
TelemetryConfig::set_stellar_slug( 'solid-performance' ); |
| 38 |
Telemetry::instance()->init( $this->container->getVar( Core::PLUGIN_FILE ) ); |
| 39 |
|
| 40 |
add_filter( 'stellarwp/telemetry/optin_args', $this->container->callback( Modal::class, 'optin_args' ), 10, 2 ); |
| 41 |
add_filter( 'debug_information', $this->container->callback( Health_Data::class, 'add_summary_to_telemetry' ), 10, 1 ); |
| 42 |
} |
| 43 |
} |
| 44 |
|