PluginProbe ʕ •ᴥ•ʔ
Hostinger Reach – AI-Powered Email Marketing for WordPress / 1.7.0
Hostinger Reach – AI-Powered Email Marketing for WordPress v1.7.0
1.7.2 1.7.1 1.7.0 1.6.0 1.5.9 1.5.8 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 trunk 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6
hostinger-reach / vendor / hostinger / hostinger-wp-surveys / src / SurveyLoader.php
hostinger-reach / vendor / hostinger / hostinger-wp-surveys / src Last commit date
Ajax.php 3 months ago Assets.php 1 month ago Loader.php 1 year ago Rest.php 1 year ago SurveyLoader.php 1 year ago SurveyManager.php 1 month ago
SurveyLoader.php
38 lines
1 <?php
2
3 namespace Hostinger\Surveys;
4
5 use Hostinger\Surveys\Rest;
6 use Hostinger\Surveys\SurveyManager;
7 use Hostinger\WpHelper\Requests\Client as RequestClient;
8 use Hostinger\WpHelper\Config;
9 use Hostinger\WpHelper\Utils as Helper;
10 use Hostinger\WpHelper\Constants;
11
12 class SurveyLoader
13 {
14 public function run(): void
15 {
16 if (is_admin()) {
17 $this->showSurvey();
18 }
19 }
20
21 private function showSurvey(): void
22 {
23 $helper = new Helper();
24 $configHandler = new Config();
25 $client = new RequestClient(
26 $configHandler->getConfigValue('base_rest_uri', Constants::HOSTINGER_REST_URI),
27 [
28 Config::TOKEN_HEADER => $helper::getApiToken(),
29 Config::DOMAIN_HEADER => $helper->getHostInfo(),
30 ]
31 );
32 $rest = new Rest($client);
33 $surveys = new SurveyManager($helper, $configHandler, $rest);
34
35 add_action('admin_footer', [ $surveys, 'activeSurveyHtml' ], 10);
36 }
37 }
38