PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more / 4.4.9
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more v4.4.9
4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.7.0 3.7.1 3.7.2 3.7.3 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.14 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.10 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.4.0 4.4.1 4.4.10 4.4.11 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5.0 4.5.1
embedpress / Core / LocalizationManager.php
embedpress / Core Last commit date
AssetManager.php 5 months ago LocalizationManager.php 5 months ago init.php 9 months ago
LocalizationManager.php
572 lines
1 <?php
2
3 namespace EmbedPress\Core;
4
5 use EmbedPress\Includes\Classes\Helper;
6
7 /**
8 * EmbedPress Localization Manager
9 *
10 * Handles all JavaScript localization for EmbedPress blocks, admin, and frontend
11 * Provides clean separation of concerns from AssetManager
12 */
13 class LocalizationManager
14 {
15 /**
16 * Setup admin localization scripts
17 *
18 * @param string $hook Current admin page hook
19 */
20 public static function setup_admin_localization($hook)
21 {
22 global $pagenow;
23
24 self::setup_license_localization();
25 self::setup_feature_notices_localization();
26
27 // Setup settings page localization if on EmbedPress settings page
28 if (strpos($hook, 'embedpress') !== false) {
29 self::setup_settings_localization();
30 self::setup_preview_localization();
31 }
32
33 // Only setup localization on post edit pages
34 if (!in_array($pagenow, ['post.php', 'post-new.php'])) {
35 return;
36 }
37 }
38
39 /**
40 * Setup editor localization scripts
41 */
42 public static function setup_editor_localization()
43 {
44 self::setup_frontend_script_localization();
45 self::setup_gutenberg_localization();
46 self::setup_new_blocks_localization();
47 self::setup_preview_localization();
48 }
49
50 /**
51 * Setup frontend localization scripts
52 */
53 public static function setup_frontend_localization()
54 {
55 self::setup_frontend_script_localization();
56 self::setup_gutenberg_localization();
57 self::setup_preview_localization();
58 self::setup_analytics_localization();
59 }
60
61 /**
62 * Setup Elementor widget localization
63 */
64 public static function setup_elementor_localization()
65 {
66 self::setup_frontend_script_localization();
67 self::setup_calendar_widget_localization();
68 self::setup_analytics_localization();
69 }
70
71 /**
72 * Setup preview localization (attached to preview script)
73 */
74 private static function setup_preview_localization()
75 {
76 // Try both admin and preview script handles
77 $script_handles = ['embedpress-admin', 'embedpress-preview'];
78
79 $url_schemes = apply_filters('embedpress:getAdditionalURLSchemes', self::get_url_schemes());
80
81 // Ensure required constants are defined with fallbacks
82 $version = defined('EMBEDPRESS_VERSION') ? EMBEDPRESS_VERSION : '1.0.0';
83 $shortcode = defined('EMBEDPRESS_SHORTCODE') ? EMBEDPRESS_SHORTCODE : 'embedpress';
84 $assets_url = defined('EMBEDPRESS_URL_ASSETS') ? EMBEDPRESS_URL_ASSETS : '';
85
86 $localization_data = [
87 'previewSettings' => [
88 'baseUrl' => get_site_url() . '/',
89 'versionUID' => $version,
90 'debug' => defined('WP_DEBUG') && WP_DEBUG,
91 ],
92 'shortcode' => $shortcode,
93 'assetsUrl' => $assets_url,
94 'urlSchemes' => $url_schemes,
95 ];
96
97 foreach ($script_handles as $script_handle) {
98 if (wp_script_is($script_handle, 'enqueued') || wp_script_is($script_handle, 'registered')) {
99 wp_localize_script($script_handle, 'embedpressPreviewData', $localization_data);
100 }
101 }
102
103 wp_localize_script($script_handle, 'embedpressAdminParams', [
104 'ajaxUrl' => admin_url('admin-ajax.php'),
105 'nonce' => wp_create_nonce('embedpress')
106 ]);
107 }
108
109 /**
110 * Setup license script localization
111 */
112 private static function setup_license_localization()
113 {
114 $script_handle = 'embedpress-admin';
115
116 if (!wp_script_is($script_handle, 'enqueued') && !wp_script_is($script_handle, 'registered')) {
117 return;
118 }
119
120 $item_id = defined('EMBEDPRESS_SL_ITEM_ID') ? EMBEDPRESS_SL_ITEM_ID : 'embedpress';
121
122 wp_localize_script($script_handle, 'embedpressLicenseData', [
123 'nonce' => wp_create_nonce('wpdeveloper_sl_' . $item_id . '_nonce')
124 ]);
125 }
126
127 /**
128 * Setup feature notices script localization
129 */
130 private static function setup_feature_notices_localization()
131 {
132 $script_handle = 'embedpress-feature-notices';
133
134 if (!wp_script_is($script_handle, 'enqueued') && !wp_script_is($script_handle, 'registered')) {
135 return;
136 }
137
138 wp_localize_script($script_handle, 'embedpressFeatureNotices', [
139 'ajaxurl' => admin_url('admin-ajax.php'),
140 'nonce' => wp_create_nonce('embedpress_feature_notice'),
141 ]);
142 }
143
144 /**
145 * Setup Gutenberg blocks localization (embedpressObj variable)
146 */
147 private static function setup_gutenberg_localization()
148 {
149 $script_handle = 'embedpress-blocks-editor';
150
151 if (!wp_script_is($script_handle, 'enqueued') && !wp_script_is($script_handle, 'registered')) {
152 return;
153 }
154
155 // Ensure required constants are defined
156 if (!defined('EMBEDPRESS_PLG_NAME')) {
157 return;
158 }
159
160 $elements = (array) get_option(EMBEDPRESS_PLG_NAME . ":elements", []);
161 $active_blocks = isset($elements['gutenberg']) ? (array) $elements['gutenberg'] : [];
162
163 $wistia_labels = self::get_wistia_labels();
164 $wistia_options = self::get_wistia_options();
165 $pars_url = wp_parse_url(get_site_url());
166 $documents_cta_options = (array) get_option(EMBEDPRESS_PLG_NAME . ':document');
167 $current_user = wp_get_current_user();
168 $assets_url = defined('EMBEDPRESS_URL_ASSETS') ? EMBEDPRESS_URL_ASSETS : '';
169 $static_url = defined('EMBEDPRESS_URL_STATIC') ? EMBEDPRESS_URL_STATIC : '';
170
171 // Get global powered_by setting
172 $g_settings = get_option(EMBEDPRESS_PLG_NAME, []);
173 $powered_by_default = isset($g_settings['embedpress_document_powered_by']) && $g_settings['embedpress_document_powered_by'] === 'yes';
174 $lazy_load_default = isset($g_settings['g_lazyload']) && $g_settings['g_lazyload'] == 1;
175
176 wp_localize_script($script_handle, 'embedpressGutenbergData', [
177
178
179 // Keep only the variables that are actually used in JavaScript
180 'wistiaLabels' => json_encode($wistia_labels),
181 'wistiaOptions' => $wistia_options,
182 'poweredBy' => apply_filters('embedpress_document_block_powered_by', $powered_by_default),
183 'isProVersion' => defined('EMBEDPRESS_PRO_PLUGIN_FILE'),
184 'twitchHost' => !empty($pars_url['host']) ? $pars_url['host'] : '',
185 'siteUrl' => site_url(),
186 'activeBlocks' => $active_blocks,
187 'documentCta' => $documents_cta_options,
188 'pdfRenderer' => Helper::get_pdf_renderer(),
189 'flipbookRenderer' => Helper::get_flipbook_renderer(),
190 'isProPluginActive' => defined('EMBEDPRESS_SL_ITEM_SLUG'),
191 'ajaxUrl' => admin_url('admin-ajax.php'),
192 'adminUrl' => admin_url(),
193 'sourceNonce' => wp_create_nonce('source_nonce_embedpress'),
194 'canUploadMedia' => current_user_can('upload_files'),
195 'assetsUrl' => $assets_url,
196 'staticUrl' => $static_url,
197 // Use underscore naming for consistency with block attributes
198 'iframe_width' => Helper::get_options_value('enableEmbedResizeWidth', '600'),
199 'iframe_height' => Helper::get_options_value('enableEmbedResizeHeight', '400'),
200 'iframeWidth' => Helper::get_options_value('enableEmbedResizeWidth', '600'), // Keep camelCase for backward compatibility
201 'iframeHeight' => Helper::get_options_value('enableEmbedResizeHeight', '400'), // Keep camelCase for backward compatibility
202 'pdfCustomColor' => Helper::get_options_value('custom_color', '#403A81'),
203 'lazyLoad' => $lazy_load_default,
204 'brandingLogos' => [
205 'youtube' => Helper::get_branding_value('logo_url', 'youtube'),
206 'vimeo' => Helper::get_branding_value('logo_url', 'vimeo'),
207 'wistia' => Helper::get_branding_value('logo_url', 'wistia'),
208 'twitch' => Helper::get_branding_value('logo_url', 'twitch'),
209 'dailymotion' => Helper::get_branding_value('logo_url', 'dailymotion'),
210 'document' => Helper::get_branding_value('logo_url', 'document'),
211 ],
212 'userRoles' => Helper::get_user_roles(),
213 'currentUser' => $current_user->data,
214 'feedbackSubmitted' => get_option('embedpress_feedback_submited'),
215 'ratingHelpDisabled' => Helper::get_options_value('turn_off_rating_help', false),
216 'milestoneDisabled' => Helper::get_options_value('turn_off_milestone', false),
217
218 // Legacy support
219 'wistia_labels' => json_encode($wistia_labels),
220 'wisita_options' => $wistia_options,
221 'embedpress_powered_by' => apply_filters('embedpress_document_block_powered_by', $powered_by_default),
222 'embedpress_pro' => defined('EMBEDPRESS_PRO_PLUGIN_FILE'),
223 'twitch_host' => !empty($pars_url['host']) ? $pars_url['host'] : '',
224 'site_url' => site_url(),
225 'rest_url' => get_rest_url(),
226 'embedpress_rest_url' => get_rest_url(null, 'embedpress/v1/oembed/embedpress'),
227 'active_blocks' => $active_blocks,
228 'document_cta' => $documents_cta_options,
229 'pdf_renderer' => Helper::get_pdf_renderer(),
230 'flipbook_renderer' => Helper::get_flipbook_renderer(),
231 'is_pro_plugin_active' => defined('EMBEDPRESS_SL_ITEM_SLUG'),
232 'ajaxurl' => admin_url('admin-ajax.php'),
233 'source_nonce' => wp_create_nonce('source_nonce_embedpress'),
234 'can_upload_media' => current_user_can('upload_files'),
235 'permalink_structure' => get_option('permalink_structure'),
236 'EMBEDPRESS_URL_ASSETS' => EMBEDPRESS_URL_ASSETS,
237 'iframe_width' => Helper::get_options_value('enableEmbedResizeWidth'),
238 'iframe_height' => Helper::get_options_value('enableEmbedResizeHeight'),
239 'pdf_custom_color' => Helper::get_options_value('custom_color'),
240 'pdf_custom_color' => Helper::get_options_value('custom_color'),
241 'youtube_brand_logo_url' => Helper::get_branding_value('logo_url', 'youtube'),
242 'vimeo_brand_logo_url' => Helper::get_branding_value('logo_url', 'vimeo'),
243 'wistia_brand_logo_url' => Helper::get_branding_value('logo_url', 'wistia'),
244 'twitch_brand_logo_url' => Helper::get_branding_value('logo_url', 'twitch'),
245 'dailymotion_brand_logo_url' => Helper::get_branding_value('logo_url', 'dailymotion'),
246 'user_roles' => Helper::get_user_roles(),
247 'current_user' => $current_user->data,
248 'is_embedpress_feedback_submited' => get_option('embedpress_feedback_submited'),
249 'turn_off_rating_help' => Helper::get_options_value('turn_off_rating_help'),
250 'turn_off_milestone' => Helper::get_options_value('turn_off_milestone'),
251 ]);
252 }
253
254 /**
255 * Setup frontend script localization (embedpressFrontendData variable)
256 */
257 private static function setup_frontend_script_localization()
258 {
259 // The embedpressFrontendData variable should be attached to multiple frontend scripts
260 $script_handles = ['embedpress-front', 'embedpress-ads'];
261
262 $localization_data = [
263 'ajaxurl' => admin_url('admin-ajax.php'),
264 'isProPluginActive' => defined('EMBEDPRESS_SL_ITEM_SLUG'),
265 'nonce' => wp_create_nonce('ep_nonce'),
266 ];
267
268 foreach ($script_handles as $script_handle) {
269 if (wp_script_is($script_handle, 'enqueued') || wp_script_is($script_handle, 'registered')) {
270 wp_localize_script($script_handle, 'embedpressFrontendData', $localization_data);
271 }
272 }
273 }
274
275 /**
276 * Setup settings page localization (attached to admin script)
277 */
278 private static function setup_settings_localization()
279 {
280 $script_handle = 'embedpress-admin';
281
282 if (!wp_script_is($script_handle, 'enqueued') && !wp_script_is($script_handle, 'registered')) {
283 return;
284 }
285
286 wp_localize_script($script_handle, 'embedpressSettingsData', [
287 'nonce' => wp_create_nonce('embedpress_elements_action'),
288 'ajaxNonce' => wp_create_nonce('embedpress_ajax_nonce'),
289 ]);
290 }
291
292 /**
293 * Setup new blocks localization (for new block system)
294 */
295 private static function setup_new_blocks_localization()
296 {
297 // Try multiple possible handles for new blocks
298 $possible_handles = [
299 'embedpress-blocks-editor', // Current handle from AssetManager
300 'embedpress-blocks', // Old handle
301 'embedpress_blocks-cgb-block-js', // Legacy handle
302 'embedpress-blocks-js', // Alternative handle
303 ];
304
305 $script_handle = null;
306 foreach ($possible_handles as $handle) {
307 if (wp_script_is($handle, 'enqueued') || wp_script_is($handle, 'registered')) {
308 $script_handle = $handle;
309 break;
310 }
311 }
312
313 if (!$script_handle) {
314 return;
315 }
316
317 // Ensure required constants are defined
318 if (!defined('EMBEDPRESS_PLG_NAME')) {
319 return;
320 }
321
322 $elements = (array) get_option(EMBEDPRESS_PLG_NAME . ":elements", []);
323 $active_blocks = isset($elements['gutenberg']) ? (array) $elements['gutenberg'] : [];
324
325 wp_localize_script($script_handle, 'embedpressNewBlocksData', [
326 'pluginDirPath' => defined('EMBEDPRESS_PATH_BASE') ? EMBEDPRESS_PATH_BASE : '',
327 'pluginDirUrl' => defined('EMBEDPRESS_URL_STATIC') ? EMBEDPRESS_URL_STATIC . '../' : '',
328 'activeBlocks' => $active_blocks,
329 'canUploadMedia' => current_user_can('upload_files'),
330 'ajaxUrl' => admin_url('admin-ajax.php'),
331 'nonce' => wp_create_nonce('embedpress_nonce'),
332 'restUrl' => rest_url('embedpress/v1/'),
333 'siteUrl' => site_url(),
334 ]);
335 }
336
337
338
339
340
341 /**
342 * Setup analytics tracker localization
343 */
344 private static function setup_analytics_localization()
345 {
346 $script_handle = 'embedpress-analytics-tracker';
347
348 if (!wp_script_is($script_handle, 'enqueued') && !wp_script_is($script_handle, 'registered')) {
349 return;
350 }
351
352 // Get analytics manager instance to check for embedded content
353 $has_embedded_content = false;
354 if (class_exists('EmbedPress\Includes\Classes\Analytics\Analytics_Manager')) {
355 $analytics_manager = \EmbedPress\Includes\Classes\Analytics\Analytics_Manager::get_instance();
356 $has_embedded_content = $analytics_manager->has_embedded_content();
357 }
358
359 // Get tracking enabled setting
360 $tracking_enabled = get_option('embedpress_analytics_tracking_enabled', true);
361
362 // Get original referrer if available
363 $original_referrer = '';
364 if (defined('EMBEDPRESS_ORIGINAL_REFERRER') && !empty(EMBEDPRESS_ORIGINAL_REFERRER)) {
365 $original_referrer = EMBEDPRESS_ORIGINAL_REFERRER;
366 }
367
368 // Get session ID safely
369 $session_id = self::get_analytics_session_id();
370
371 wp_localize_script($script_handle, 'embedpress_analytics', [
372 'ajax_url' => admin_url('admin-ajax.php'),
373 'rest_url' => rest_url('embedpress/v1/analytics/'),
374 'nonce' => wp_create_nonce('wp_rest'),
375 'session_id' => $session_id,
376 'page_url' => get_permalink(),
377 'post_id' => get_the_ID(),
378 'tracking_enabled' => (bool) $tracking_enabled,
379 'original_referrer' => $original_referrer,
380 'has_embedded_content' => $has_embedded_content
381 ]);
382 }
383
384 /**
385 * Setup Google Calendar widget localization
386 */
387 private static function setup_calendar_widget_localization()
388 {
389 $script_handle = 'epgc';
390
391 if (!wp_script_is($script_handle, 'enqueued') && !wp_script_is($script_handle, 'registered')) {
392 return;
393 }
394
395 $nonce = wp_create_nonce('epgc_nonce');
396 wp_localize_script($script_handle, 'embedpressCalendarData', [
397 'ajaxUrl' => admin_url('admin-ajax.php'),
398 'nonce' => $nonce,
399 'translations' => [
400 'allDay' => __('All day', 'embedpress'),
401 'createdBy' => __('Created by', 'embedpress'),
402 'goToEvent' => __('Go to event', 'embedpress'),
403 'unknownError' => __('Unknown error', 'embedpress'),
404 'requestError' => __('Request error', 'embedpress'),
405 'loading' => __('Loading', 'embedpress')
406 ]
407 ]);
408 }
409
410 /**
411 * Load plugin text domain for translations
412 */
413 public static function load_text_domain()
414 {
415 $locale = determine_locale();
416 $locale = apply_filters('plugin_locale', $locale, 'embedpress');
417
418 // Load from WordPress languages directory first
419 if (file_exists(WP_LANG_DIR . "/embedpress-" . $locale . '.mo')) {
420 unload_textdomain('embedpress');
421 load_textdomain('embedpress', WP_LANG_DIR . "/embedpress-" . $locale . '.mo');
422 }
423
424 // Load from plugin languages directory
425 load_plugin_textdomain('embedpress', false, plugin_basename(dirname(EMBEDPRESS_FILE)) . '/languages');
426 }
427
428 /**
429 * Get Wistia labels for localization
430 *
431 * @return array
432 */
433 private static function get_wistia_labels()
434 {
435 return [
436 'watch_from_beginning' => __('Watch from the beginning', 'embedpress'),
437 'skip_to_where_you_left_off' => __('Skip to where you left off', 'embedpress'),
438 'you_have_watched_it_before' => __('It looks like you\'ve watched<br />part of this video before!', 'embedpress'),
439 ];
440 }
441
442 /**
443 * Get Wistia options safely
444 *
445 * @return mixed|null
446 */
447 private static function get_wistia_options()
448 {
449 if (!function_exists('embedpress_wisita_pro_get_options')) {
450 return null;
451 }
452
453 try {
454 // return embedpress_wisita_pro_get_options();
455 } catch (\Exception $e) {
456 // Silently fail if function throws an error
457 return null;
458 }
459 }
460
461 /**
462 * Get branding value safely
463 *
464 * @param string $type
465 * @param string $provider
466 * @return string
467 */
468 private static function get_branding_value($type, $provider)
469 {
470 if (!function_exists('get_branding_value')) {
471 return '';
472 }
473
474 try {
475 return self::get_branding_value($type, $provider);
476 } catch (\Exception $e) {
477 return '';
478 }
479 }
480
481 /**
482 * Get analytics session ID safely
483 *
484 * @return string
485 */
486 private static function get_analytics_session_id()
487 {
488 // Prefer cookie-based session IDs to avoid server PHP session configuration issues
489 if (isset($_COOKIE['ep_session_id'])) {
490 $cookie = $_COOKIE['ep_session_id'];
491 // Allow only safe characters and a minimum length
492 if (is_string($cookie) && preg_match('/^[A-Za-z0-9._:-]{8,}$/', $cookie)) {
493 return sanitize_text_field($cookie);
494 }
495 }
496
497 // Generate a new ephemeral session ID
498 $id = 'ep-sess-' . time() . '-' . wp_generate_password(8, false);
499
500 // Set a session cookie (expires when the browser closes)
501 if (!headers_sent()) {
502 $path = defined('COOKIEPATH') ? COOKIEPATH : '/';
503 $domain = (defined('COOKIE_DOMAIN') && COOKIE_DOMAIN) ? COOKIE_DOMAIN : '';
504 $secure = is_ssl();
505 $httponly = true;
506 setcookie('ep_session_id', $id, 0, $path, $domain, $secure, $httponly);
507 }
508
509 return $id;
510 }
511
512 /**
513 * Get URL schemes for preview script
514 *
515 * @return array
516 */
517 private static function get_url_schemes()
518 {
519 return [
520 // Apple podcasts
521 'podcasts.apple.com/*',
522 // YouTube
523 'youtube.com/watch\\?*',
524 'youtube.com/playlist\\?*',
525 'youtube.com/channel/*',
526 'youtube.com/c/*',
527 'youtube.com/user/*',
528 'youtube.com/(\w+)[^?\/]*$',
529 // Vimeo
530 'vimeo.com/*',
531 'vimeo.com/groups/*/videos/*',
532 // Twitter
533 'twitter.com/*/status/*',
534 'twitter.com/i/moments/*',
535 'twitter.com/*/timelines/*',
536 // Facebook
537 'facebook.com/*',
538 'fb.watch/*',
539 // Instagram
540 'instagram.com/p/*',
541 'instagr.am/p/*',
542 // SoundCloud
543 'soundcloud.com/*',
544 // Twitch
545 '*.twitch.tv/*',
546 'twitch.tv/*',
547 // Wistia
548 '*.wistia.com/medias/*',
549 'fast.wistia.com/embed/medias/*.jsonp',
550 // Google services
551 'google.com/*',
552 'google.com.*/*',
553 'google.co.*/*',
554 'maps.google.com/*',
555 'docs.google.com/presentation/*',
556 'docs.google.com/document/*',
557 'docs.google.com/spreadsheets/*',
558 'docs.google.com/forms/*',
559 'docs.google.com/drawings/*',
560 ];
561 }
562
563 /**
564 * Initialize localization manager hooks
565 */
566 public static function init()
567 {
568 // Load text domain early
569 add_action('plugins_loaded', [__CLASS__, 'load_text_domain'], 1);
570 }
571 }
572