| @@ -7,8 +7,10 @@ | ||
| 7 | 7 | * |
| 8 | 8 | * @since 1.0.0-alpha |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | +use BitCode\BitForm\BitApps\WPTelemetry\Telemetry\Telemetry; | |
| 12 | +use BitCode\BitForm\BitApps\WPTelemetry\Telemetry\TelemetryConfig; | |
| 11 | 13 | use BitCode\BitForm\Core\Database\DB; |
| 12 | 14 | use BitCode\BitForm\Core\Database\FormModel; |
| 13 | 15 | use BitCode\BitForm\Core\Fallback\FormFallback; |
| 14 | 16 | use BitCode\BitForm\Core\Hooks\Hooks; |
| @@ -36,8 +38,10 @@ | ||
| 36 | 38 | add_action('plugins_loaded', [$this, 'init_plugin']); |
| 37 | 39 | (new Activation())->activate(); |
| 38 | 40 | (new Deactivation())->register(); |
| 39 | 41 | (new Uninstallation())->register(); |
| 42 | + | |
| 43 | + $this->initWpTelemetry(); | |
| 40 | 44 | } |
| 41 | 45 | |
| 42 | 46 | private function commaReplace($options, $lbl, $val) |
| 43 | 47 | { |
| @@ -141,9 +145,9 @@ | ||
| 141 | 145 | } |
| 142 | 146 | |
| 143 | 147 | public function plugin_action_links($links) |
| 144 | 148 | { |
| 145 | - $links[] = '<a href="https://docs.form.bitapps.pro" target="_blank">' . __('Docs') . '</a>'; | |
| 149 | + $links[] = '<a href="https://bitapps.pro/docs/bit-form/" target="_blank">' . __('Docs') . '</a>'; | |
| 146 | 150 | |
| 147 | 151 | return $links; |
| 148 | 152 | } |
| 149 | 153 | |
| @@ -162,6 +166,21 @@ | ||
| 162 | 166 | |
| 163 | 167 | static::$instance = new static($main_file); |
| 164 | 168 | static::$instance->register(); |
| 165 | 169 | return true; |
| 170 | + } | |
| 171 | + | |
| 172 | + private function initWpTelemetry() | |
| 173 | + { | |
| 174 | + TelemetryConfig::setSlug(Config::SLUG); | |
| 175 | + TelemetryConfig::setTitle(Config::TITLE); | |
| 176 | + TelemetryConfig::setVersion(Config::VERSION); | |
| 177 | + TelemetryConfig::setPrefix(Config::VAR_PREFIX); | |
| 178 | + | |
| 179 | + TelemetryConfig::setServerBaseUrl('https://wp-api.bitapps.pro/public/'); | |
| 180 | + TelemetryConfig::setTermsUrl('https://bitapps.pro/terms-of-service/'); | |
| 181 | + TelemetryConfig::setPolicyUrl('https://bitapps.pro/privacy-policy/'); | |
| 182 | + | |
| 183 | + Telemetry::report()->addPluginData()->init(); | |
| 184 | + Telemetry::feedback()->init(); | |
| 166 | 185 | } |
| 167 | 186 | } |