| @@ -1,9 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace Kibo\PhastPlugins\PhastPress; |
| 4 | 4 | |
| 5 | -use Kibo\Phast\ValueObjects\URL; | |
| 6 | 5 | use Kibo\PhastPlugins\SDK\Common\PluginHostTrait; |
| 7 | 6 | use Kibo\PhastPlugins\SDK\PluginHost; |
| 8 | 7 | |
| 9 | 8 | class PluginHostImplementation extends ServiceSDKImplementation implements PluginHost { |
| @@ -17,9 +16,9 @@ | ||
| 17 | 16 | return 'PhastPress'; |
| 18 | 17 | } |
| 19 | 18 | |
| 20 | 19 | public function getPluginHostVersion() { |
| 21 | - $plugin_info = get_file_data(PHASTPRESS_PLUGIN_FILE, ['Version' => 'Version']); | |
| 20 | + $plugin_info = get_file_data(PHASTPRESS_PLUGIN_FILE, array('Version' => 'Version')); | |
| 22 | 21 | return $plugin_info['Version']; |
| 23 | 22 | } |
| 24 | 23 | |
| 25 | 24 | public function getKeyValueStore() { |
| @@ -29,37 +28,8 @@ | ||
| 29 | 28 | public function getHostURLs() { |
| 30 | 29 | return new HostURLsImplementation(); |
| 31 | 30 | } |
| 32 | 31 | |
| 33 | - public function getScriptSourceURLs() { | |
| 34 | - $urls = [ | |
| 35 | - home_url('/'), | |
| 36 | - site_url('/'), | |
| 37 | - content_url('/'), | |
| 38 | - plugins_url('/'), | |
| 39 | - includes_url('/'), | |
| 40 | - ]; | |
| 41 | - | |
| 42 | - if (is_multisite()) { | |
| 43 | - $urls[] = network_home_url('/'); | |
| 44 | - $urls[] = network_site_url('/'); | |
| 45 | - } | |
| 46 | - | |
| 47 | - $hostURLs = $this->getHostURLs(); | |
| 48 | - $urls = array_map([URL::class, 'fromString'], array_unique($urls)); | |
| 49 | - $cdnURLs = []; | |
| 50 | - foreach ($urls as $url) { | |
| 51 | - $cdnURLs[] = $hostURLs->getCDNURL($url); | |
| 52 | - } | |
| 53 | - $urls = array_merge($urls, $cdnURLs); | |
| 54 | - | |
| 55 | - $unique = []; | |
| 56 | - foreach ($urls as $url) { | |
| 57 | - $unique[$url->toString()] = $url; | |
| 58 | - } | |
| 59 | - return array_values($unique); | |
| 60 | - } | |
| 61 | - | |
| 62 | 32 | public function getInstallNoticeRenderer() { |
| 63 | 33 | return new InstallNoticeRendererImplementation(); |
| 64 | 34 | } |
| 65 | 35 | |
| @@ -72,22 +42,6 @@ | ||
| 72 | 42 | } |
| 73 | 43 | |
| 74 | 44 | public function getPhastUser() { |
| 75 | 45 | return new PhastUserImplementation(); |
| 76 | - } | |
| 77 | - | |
| 78 | - public function getSecurityTokenRoot() { | |
| 79 | - if (defined('AUTH_KEY')) { | |
| 80 | - return AUTH_KEY; | |
| 81 | - } | |
| 82 | - return null; | |
| 83 | - } | |
| 84 | - | |
| 85 | - public function onPhastConfigurationLoad(array $config) { | |
| 86 | - $nonce = apply_filters('phastpress_csp_nonce', null); | |
| 87 | - if ($nonce !== null) { | |
| 88 | - $config['csp']['nonce'] = $nonce; | |
| 89 | - } | |
| 90 | - | |
| 91 | - return $config; | |
| 92 | 46 | } |
| 93 | 47 | } |