From 7df0221f3e413c6429379043aa7f41f470ad861e Mon Sep 17 00:00:00 2001 From: Rafikooo Date: Tue, 3 Feb 2026 14:58:37 +0100 Subject: [PATCH] Add telemetry support --- README.md | 4 +++ TELEMETRY_POLICY.md | 69 ++++++++++++++++++++++++++++++++++++++ composer.json | 1 + src/SyliusRefundPlugin.php | 8 +++++ 4 files changed, 82 insertions(+) create mode 100644 TELEMETRY_POLICY.md diff --git a/README.md b/README.md index e0402e1c4..fe893e476 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,10 @@ Instead, all security issues must be sent to `security@sylius.com`. For online communication, we invite you to chat with us and other users on [Sylius Slack](https://sylius.com/slack). +## Telemetry + +This plugin includes telemetry that collects anonymous usage data. For more information, see [TELEMETRY_POLICY.md](TELEMETRY_POLICY.md). + ## License This plugin is released under the [MIT License](LICENSE). \ No newline at end of file diff --git a/TELEMETRY_POLICY.md b/TELEMETRY_POLICY.md new file mode 100644 index 000000000..bbdd79685 --- /dev/null +++ b/TELEMETRY_POLICY.md @@ -0,0 +1,69 @@ +# Telemetry Policy + +## Applicability + +This Telemetry Policy applies to the use of this plugin in combination with Sylius. + +By installing or using this plugin with Sylius, the user acknowledges that telemetry data is collected and transmitted as described in this document. + +--- + +## Mandatory telemetry + +Telemetry data collection is mandatory when this plugin is used. + +While this plugin is installed and active, Sylius telemetry operates under the conditions defined by this plugin and cannot be disabled independently. +Telemetry behavior outside of this scope follows the standard Sylius configuration. + +--- + +## Scope of collected data + +Telemetry is limited to non-identifying technical data, which may include: + +- Sylius version +- plugin version +- PHP version and selected dependency versions +- identifiers of installed and enabled plugins +- runtime environment classification (production or non-production) + +Telemetry does not include, and is not intended to include: + +- personal data +- customer data +- order data +- product data +- business, transactional, or confidential information +- authentication credentials or secrets + +A detailed description of the Sylius telemetry mechanism is available in the public issue: +https://github.com/Sylius/Sylius/issues/18588 + +--- + +## Purpose and use of telemetry data + +Telemetry data is collected for the purpose of: + +- understanding usage patterns within the Sylius ecosystem +- analyzing the adoption and frequency of plugin usage +- identifying commonly used versions of Sylius and plugins +- supporting maintenance, compatibility, and future development efforts + +Telemetry data is processed in aggregated form and is not used to identify individual users, installations, or businesses. + +--- + +## Licensing + +This plugin is distributed under the MIT license. + +Telemetry collection constitutes part of the technical operation of the software and does not alter, restrict, or supplement the rights granted under the license. + +--- + +## Changes to this policy + +This Telemetry Policy may be updated to reflect changes in telemetry implementation, legal requirements, or operational practices. + +Updated versions of this policy will be made available in the plugin repository. diff --git a/composer.json b/composer.json index 799c4ac13..aa5a3b7fb 100644 --- a/composer.json +++ b/composer.json @@ -24,6 +24,7 @@ "myclabs/php-enum": "^1.8", "sylius/resource-bundle": "^1.12", "sylius/sylius": "^2.0", + "sylius/telemetry": "^1.0", "symfony/messenger": "^6.4 || ^7.1", "php-http/discovery": "^1.20" }, diff --git a/src/SyliusRefundPlugin.php b/src/SyliusRefundPlugin.php index 7951216cd..350db2a94 100644 --- a/src/SyliusRefundPlugin.php +++ b/src/SyliusRefundPlugin.php @@ -14,6 +14,8 @@ namespace Sylius\RefundPlugin; use Sylius\Bundle\CoreBundle\Application\SyliusPluginTrait; +use Sylius\Telemetry\TelemetryCompilerPass; +use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; final class SyliusRefundPlugin extends Bundle @@ -24,4 +26,10 @@ public function getPath(): string { return \dirname(__DIR__); } + + public function build(ContainerBuilder $container): void + { + parent::build($container); + $container->addCompilerPass(new TelemetryCompilerPass()); + } }