PluginProbe
PhastPress / 3.6
PhastPress v3.6
3.12 3.11 1.75 1.76 1.77 1.78 1.79 1.80 1.81 1.82 1.83 1.84 1.85 1.86 1.87 1.88 1.89 1.90 1.91 1.92 1.93 1.94 1.95 1.96 1.97 All 119 releases
phastpress / classes / PluginHostImplementation.php

PluginHostImplementation.php in PhastPress 3.6, at classes/PluginHostImplementation.php

64 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Kibo\PhastPlugins\PhastPress;
4
5 use Kibo\PhastPlugins\SDK\Common\PluginHostTrait;
6 use Kibo\PhastPlugins\SDK\PluginHost;
7
8 class PluginHostImplementation extends ServiceSDKImplementation implements PluginHost {
9 use PluginHostTrait;
10
11 public function getPluginName() {
12 return 'PhastPress';
13 }
14
15 public function getPluginHostName() {
16 return 'PhastPress';
17 }
18
19 public function getPluginHostVersion() {
20 $plugin_info = get_file_data(PHASTPRESS_PLUGIN_FILE, ['Version' => 'Version']);
21 return $plugin_info['Version'];
22 }
23
24 public function getKeyValueStore() {
25 return new KeyValueStoreImplementation();
26 }
27
28 public function getHostURLs() {
29 return new HostURLsImplementation();
30 }
31
32 public function getInstallNoticeRenderer() {
33 return new InstallNoticeRendererImplementation();
34 }
35
36 public function getNonce() {
37 return NonceCheckerImplementation::makeNonce();
38 }
39
40 public function getNonceChecker() {
41 return new NonceCheckerImplementation();
42 }
43
44 public function getPhastUser() {
45 return new PhastUserImplementation();
46 }
47
48 public function getSecurityTokenRoot() {
49 if (defined('AUTH_KEY')) {
50 return AUTH_KEY;
51 }
52 return null;
53 }
54
55 public function onPhastConfigurationLoad(array $config) {
56 $nonce = apply_filters('phastpress_csp_nonce', null);
57 if ($nonce !== null) {
58 $config['csp']['nonce'] = $nonce;
59 }
60
61 return $config;
62 }
63 }
64