PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more / 4.4.11
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more v4.4.11
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 / EmbedPress / Ends / Back / Handler.php
embedpress / EmbedPress / Ends / Back Last commit date
Settings 3 months ago Handler.php 6 months ago index.html 7 years ago
Handler.php
840 lines
1 <?php
2
3 namespace EmbedPress\Ends\Back;
4
5 use EmbedPress\Core;
6 use EmbedPress\Ends\Handler as EndHandlerAbstract;
7 use EmbedPress\Shortcode;
8 use Embera\Embera;
9 use EmbedPress\Includes\Classes\Helper;
10
11 (defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
12
13 /**
14 * The admin-facing functionality of the plugin.
15 * Defines the plugin name, version, and enqueue the admin-specific stylesheets and scripts.
16 *
17 * @package EmbedPress
18 * @subpackage EmbedPress/Ends/Back
19 * @author EmbedPress <help@embedpress.com>
20 * @copyright Copyright (C) 2023 WPDeveloper. All rights reserved.
21 * @license GPLv3 or later
22 * @since 1.0.0
23 */
24 class Handler extends EndHandlerAbstract
25 {
26 /**
27 * Method that register all scripts for the admin area.
28 *
29 * @return void
30 * @since 1.0.0
31 *
32 */
33
34 public function __construct($pluginName, $pluginVersion)
35 {
36 parent::__construct($pluginName, $pluginVersion);
37
38 add_action('wp_ajax_delete_instagram_account', [$this, 'delete_instagram_account']);
39 // add_action('init', [$this, 'handle_instagram_data']);
40
41 add_action('wp_ajax_get_instagram_userdata_ajax', [$this, 'get_instagram_userdata_ajax']);
42
43 if (!empty($_GET['page_type']) && $_GET['page_type'] == 'calendly') {
44 add_action('init', [$this, 'handle_calendly_data']);
45 }
46
47 if (defined('EMBEDPRESS_SL_ITEM_SLUG') && is_admin()) {
48 add_action('admin_enqueue_scripts', [$this, 'enqueueLisenceScripts']);
49 }
50
51 add_action('wp_ajax_sync_instagram_data_ajax', [$this, 'sync_instagram_data_ajax']);
52 add_action('wp_ajax_nopriv_sync_instagram_data_ajax', [$this, 'sync_instagram_data_ajax']);
53
54
55 }
56
57
58 public function get_instagram_userdata_ajax()
59 {
60 if (function_exists('set_time_limit')) {
61 set_time_limit(0);
62 }
63
64 if (!current_user_can('manage_options')) {
65 wp_send_json_error(array('message' => 'You do not have sufficient permissions to access this functionality.'));
66 return;
67 }
68
69 if (isset($_POST['_nonce']) && wp_verify_nonce($_POST['_nonce'], 'embedpress_elements_action')) {
70 if (isset($_POST['access_token'])) {
71 $access_token = sanitize_text_field($_POST['access_token']);
72 $account_type = sanitize_text_field($_POST['account_type']);
73
74 $user_data = $this->get_instagram_userdata($access_token, $account_type);
75
76 $this->handle_instagram_data($user_data);
77
78 $access_token = sanitize_text_field($_POST['access_token']);
79 $account_type = sanitize_text_field($_POST['account_type']);
80 $user_id = $this->get_instagram_userid($access_token, $account_type);
81
82 $option_key = 'ep_instagram_feed_data';
83 $feed_data = get_option($option_key, array());
84
85 $feed_userinfo = Helper::getInstagramUserInfo($access_token, $account_type, $user_id, true);
86 $feed_posts = Helper::getInstagramPosts($access_token, $account_type, $user_id, 100, true);
87
88 if (!empty($user_id)) {
89 $feed_data[$user_id] = [
90 'feed_userinfo' => $feed_userinfo,
91 'feed_posts' => $feed_posts,
92 ];
93
94 delete_transient('instagram_user_info_' . $user_id);
95 delete_transient('instagram_posts_' . $user_id);
96 update_option('ep_instagram_feed_data', $feed_data);
97 } else {
98 $feed_data['error'] = "Access token Invalid or expired.";
99 }
100
101
102 wp_send_json($feed_data);
103 } else {
104 wp_send_json_error('Access token not provided');
105 }
106 } else {
107 wp_send_json_error('Nonce verification failed');
108 }
109 }
110
111 public function sync_instagram_data_ajax()
112 {
113 if (function_exists('set_time_limit')) {
114 set_time_limit(0);
115 }
116 if (!current_user_can('manage_options')) {
117 wp_send_json_error(array('message' => 'You do not have sufficient permissions to access this functionality.'));
118 return;
119 }
120
121 if (isset($_POST['_nonce']) && wp_verify_nonce($_POST['_nonce'], 'embedpress_elements_action')) {
122 if (isset($_POST['access_token'])) {
123
124 $access_token = sanitize_text_field($_POST['access_token']);
125 $account_type = sanitize_text_field($_POST['account_type']);
126 $user_id = sanitize_text_field($_POST['user_id']);
127
128 $option_key = 'ep_instagram_feed_data';
129 $feed_data = get_option($option_key, array());
130
131 $feed_userinfo = Helper::getInstagramUserInfo($access_token, $account_type, $user_id, true);
132 $feed_posts = Helper::getInstagramPosts($access_token, $account_type, $user_id, 100, true);
133
134 $feed_data[$user_id] = [
135 'feed_userinfo' => $feed_userinfo,
136 'feed_posts' => $feed_posts,
137 ];
138
139 delete_transient('instagram_user_info_' . $user_id);
140 delete_transient('instagram_posts_' . $user_id);
141 update_option('ep_instagram_feed_data', $feed_data);
142
143
144 wp_send_json($feed_data);
145 } else {
146 wp_send_json_error('Access token not provided');
147 }
148 } else {
149 wp_send_json_error('Nonce verification failed');
150 }
151 }
152
153
154 public function get_instagram_userid($access_token)
155 {
156 $response = "https://graph.facebook.com/v19.0/me/accounts?fields=connected_instagram_account{id}&access_token=$access_token";
157 if (!is_wp_error($response)) {
158
159 $body = wp_remote_retrieve_body($response);
160 $data = json_decode($body, true);
161
162 // Extract the connected Instagram account ID
163 if (isset($data['data'][0]['connected_instagram_account']['id'])) {
164 return $data['data'][0]['connected_instagram_account']['id'];
165 } else {
166 return '';
167 }
168 } else {
169 $user_data['error'] = "Error: Unable to connect to Instagram API.";
170 }
171 }
172
173 public function get_instagram_profile_picture($access_token, $userid) {}
174
175 public function get_instagram_user_id($access_token, $account_type)
176 {
177 // Check if user data is already cached
178 $user_id = get_transient('instagram_user_id_' . $access_token);
179
180 if (!$user_id) {
181 $user_id = array();
182
183 if ($account_type == 'personal') {
184 $response = wp_remote_get('https://graph.instagram.com/v24.0/me?fields=id,username&access_token=' . $access_token);
185 } else {
186 $response = wp_remote_get('https://graph.facebook.com/v19.0/me/accounts?fields=connected_instagram_account{id,name,username,followers_count}&access_token=' . $access_token);
187 }
188
189
190 if (!is_wp_error($response)) {
191
192 $body = wp_remote_retrieve_body($response);
193 $data = json_decode($body, true);
194
195 if ($account_type == 'personal') {
196 if (isset($data['id']) && isset($data['username'])) {
197 set_transient('instagram_user_id_' . $access_token, $data['id'], HOUR_IN_SECONDS);
198 return $data['id'];
199 } else {
200 $data['error'] = "Access token Invalid or expired.";
201 }
202 } else {
203 if (isset($data['data'][0]['connected_instagram_account']['id']) && isset($data['data'][0]['connected_instagram_account']['username'])) {
204 set_transient('instagram_user_id_' . $access_token, $data['data'][0]['connected_instagram_account']['id'], HOUR_IN_SECONDS);
205 return $data['data'][0]['connected_instagram_account']['id'];
206 } else {
207 $data['error'] = "Access token Invalid or expired.";
208 }
209 }
210 } else {
211 $data['error'] = "Error: Unable to connect to Instagram API.";
212 }
213 }
214
215 return $data;
216 }
217
218 public function get_instagram_userdata($access_token, $account_type)
219 {
220 // Check if user data is already cached
221 $user_data = get_transient('instagram_user_data_' . $access_token);
222
223 if (!$user_data) {
224 $user_data = array();
225
226 if ($account_type == 'personal') {
227 $response = wp_remote_get('https://graph.instagram.com/v24.0/me?fields=biography,id,username,website,followers_count,media_count,profile_picture_url,name&access_token=' . $access_token);
228 } else {
229 $response = wp_remote_get('https://graph.facebook.com/v19.0/me/accounts?fields=connected_instagram_account{id,name,username,followers_count}&access_token=' . $access_token);
230 }
231
232
233 if (!is_wp_error($response)) {
234
235 $body = wp_remote_retrieve_body($response);
236 $data = json_decode($body, true);
237
238 if ($account_type == 'personal') {
239 if (isset($data['id']) && isset($data['username'])) {
240 $user_data['access_token'] = $access_token;
241 $user_data['user_id'] = $data['id'];
242 $user_data['username'] = $data['username'];
243 $user_data['account_type'] = $account_type;
244
245 set_transient('instagram_user_data_' . $access_token, $user_data, HOUR_IN_SECONDS);
246 } else {
247 $user_data['error'] = "Access token Invalid or expired.";
248 }
249 } else {
250 if (isset($data['data'][0]['connected_instagram_account']['id']) && isset($data['data'][0]['connected_instagram_account']['username'])) {
251 $user_data['access_token'] = $access_token;
252 $user_data['user_id'] = $data['data'][0]['connected_instagram_account']['id']; // Assuming 'id' refers to Facebook account ID
253 $user_data['instagram_id'] = $data['data'][0]['connected_instagram_account']['id'];
254 $user_data['username'] = $data['data'][0]['connected_instagram_account']['username'];
255 $user_data['account_type'] = $account_type;
256
257 set_transient('instagram_user_data_' . $access_token, $user_data, HOUR_IN_SECONDS);
258 } else {
259 $user_data['error'] = "Access token Invalid or expired.";
260 }
261 }
262 } else {
263 $user_data['error'] = "Error: Unable to connect to Instagram API.";
264 }
265 }
266
267 return $user_data;
268 }
269
270
271
272
273 public function handle_instagram_data($user_data)
274 {
275 if (empty($user_data['error'])) {
276 $user_id = isset($user_data['user_id']) ? $user_data['user_id'] : '';
277 $username = isset($user_data['username']) ? $user_data['username'] : '';
278 $account_type = isset($user_data['account_type']) ? $user_data['account_type'] : '';
279 $access_token = isset($user_data['access_token']) ? $user_data['access_token'] : '';
280
281 $get_instagram_data = get_option('ep_instagram_account_data');
282
283 $token_data = [
284 [
285 'user_id' => $user_id,
286 'username' => $username,
287 'account_type' => $account_type,
288 'access_token' => $access_token,
289 ]
290 ];
291
292 if (!empty($get_instagram_data)) {
293 $updated = false;
294
295 foreach ($get_instagram_data as &$data) {
296
297 if ($data['user_id'] === $user_id) {
298
299 // If user_id matches, update the data
300 $data['username'] = $username;
301 $data['account_type'] = $account_type;
302 $data['access_token'] = $access_token;
303
304 $updated = true;
305 break;
306 }
307 }
308
309 if (!$updated) {
310 // If user_id does not exist, add new data
311 $get_instagram_data[] = $token_data[0];
312 }
313 } else {
314 // If $get_instagram_data is empty, add the new data directly
315 $get_instagram_data = $token_data;
316 }
317
318 update_option('ep_instagram_account_data', $get_instagram_data);
319
320 wp_redirect(admin_url('admin.php?page=embedpress&page_type=instagram'), 301);
321
322 exit();
323 }
324 }
325
326 public function handle_calendly_data()
327 {
328
329 if (empty($_GET['_nonce'])) {
330 return false;
331 }
332
333 $verify = wp_verify_nonce($_GET['_nonce'], 'calendly_nonce');
334
335 // Check if access_token or calendly_status is present and nonce is invalid
336 if (!$verify) {
337 echo esc_html__('Invalid nonce', 'embedpress');
338 die;
339 }
340
341 if ((!empty($_GET['_nonce']) && $verify) && (!empty($_GET['access_token']) && isset($_GET['page_type']) && $_GET['page_type'] == 'calendly') || (isset($_GET['calendly_status']) && ($_GET['calendly_status'] == 'sync' || $_GET['calendly_status'] == 'connect'))) {
342
343 if ($_GET['calendly_status'] === 'connect') {
344 update_option('is_calendly_connected', true);
345 }
346
347 if (isset($_GET['access_token']) && !empty($_GET['access_token'])) {
348 $access_token = $_GET['access_token'];
349 $refresh_token = $_GET['refresh_token'];
350 $expires_in = $_GET['expires_in'];
351 $created_at = $_GET['created_at'];
352 } elseif (isset($_GET['calendly_status']) && ($_GET['calendly_status'] == 'sync' || $_GET['calendly_status'] == 'connect')) {
353 $token_data = get_option('calendly_tokens');
354 $access_token = $token_data['access_token'];
355 $refresh_token = $token_data['refresh_token'];
356 $expires_in = $token_data['expires_in'];
357 $created_at = $token_data['created_at'];
358 }
359
360
361 // Create an array to store the tokens and expiration time
362 $token_data = array(
363 'access_token' => $access_token,
364 'refresh_token' => $refresh_token,
365 'expires_in' => $expires_in,
366 'created_at' => $created_at
367 );
368
369 // Save the serialized data in a single option key
370 update_option('calendly_tokens', $token_data);
371
372 $user_info = json_decode(Helper::getCalendlyUserInfo($access_token), true);
373
374 if (!empty($user_info['resource']['uri'])) {
375 $event_types = Helper::getCalaendlyEventTypes($user_info['resource']['uri'], $access_token);
376 $scheduled_events = Helper::getCalaendlyScheduledEvents($user_info['resource']['uri'], $access_token);
377
378 $invite_list = [];
379
380 if (is_array($scheduled_events['collection'])) {
381 foreach ($scheduled_events['collection'] as $event) :
382 $uuid = Helper::getCalendlyUuid($event['uri']);
383 $invite_list[$uuid] = Helper::getListEventInvitee($uuid, $access_token);
384 endforeach;
385 }
386
387 update_option('calendly_user_info', $user_info);
388
389 if (!apply_filters('embedpress/is_allow_rander', false)) {
390 update_option('calendly_event_types', []);
391 update_option('calendly_scheduled_events', []);
392 update_option('calendly_invitees_list', []);
393 } else {
394 do_action('embedepress/calendly_event_data', $event_types, $scheduled_events, $invite_list);
395 }
396 }
397
398 wp_redirect(admin_url('admin.php?page=embedpress&page_type=calendly'), 302);
399 exit();
400 }
401 }
402
403 public function enqueueScripts()
404 {
405 // Assets and localization are now handled by AssetManager and LocalizationManager
406 // This method is kept for backward compatibility but functionality has been moved
407 }
408
409 public function enqueueLisenceScripts()
410 {
411 // Assets and localization are now handled by AssetManager and LocalizationManager
412 // This method is kept for backward compatibility but functionality has been moved
413 }
414
415
416 /**
417 * Method that register all stylesheets for the admin area.
418 *
419 * @return void
420 * @since 1.0.0
421 * @static
422 *
423 */
424 public static function enqueueStyles()
425 {
426 // Assets are now handled by AssetManager
427 // This method is kept for backward compatibility
428 }
429
430 /**
431 * Method that receive a string via AJAX and return the decoded-shortcoded-version of that string.
432 *
433 * @return void
434 * @since 1.0.0
435 *
436 */
437 public function doShortcodeReceivedViaAjax()
438 {
439 $subject = isset($_POST['subject']) ? $_POST['subject'] : "";
440
441 $response = [
442 'data' => Shortcode::parseContent($subject, true),
443 ];
444
445 header('Content-Type:application/json;charset=UTF-8');
446 echo json_encode($response);
447
448 exit();
449 }
450
451 /**
452 * Method that receive an url via AJAX and return the info about that url/embed.
453 *
454 * @return void
455 * @since 1.0.0
456 *
457 */
458 public function getUrlInfoViaAjax()
459 {
460 $url = isset($_GET['url']) ? trim($_GET['url']) : "";
461
462 $response = [
463 'url' => $url,
464 'canBeResponsive' => false,
465 ];
466
467 if (!!strlen($response['url'])) {
468
469 $additionalServiceProviders = Core::getAdditionalServiceProviders();
470 if (!empty($additionalServiceProviders)) {
471 foreach ($additionalServiceProviders as $serviceProviderClassName => $serviceProviderUrls) {
472 Shortcode::addServiceProvider($serviceProviderClassName, $serviceProviderUrls);
473 }
474 }
475 $embera = new Embera([], Shortcode::get_collection());
476
477 $urlInfo = $embera->getUrlData($response['url']);
478 if (isset($urlInfo[$response['url']]) && $urlInfo[$response['url']]['provider_name']) {
479 $response['canBeResponsive'] = Core::canServiceProviderBeResponsive(strtolower($urlInfo[$response['url']]['provider_name']));
480 }
481 }
482
483 header('Content-Type:application/json;charset=UTF-8');
484 echo json_encode($response);
485
486 exit();
487 }
488
489 /**
490 * Returns a list of supported URL schemes for the preview script
491 *
492 * @return array
493 */
494 public function getUrlSchemes()
495 {
496 return [
497 // Apple podcasts
498 'podcasts.apple.com/*',
499 // PollDaddy
500 '*.polldaddy.com/s/*',
501 '*.polldaddy.com/poll/*',
502 '*.polldaddy.com/ratings/*',
503 'polldaddy.com/s/*',
504 'polldaddy.com/poll/*',
505 'polldaddy.com/ratings/*',
506
507 // VideoPress
508 'videopress.com/v/*',
509
510 // Tumblr
511 '*.tumblr.com/post/*',
512
513 // SmugMug
514 'smugmug.com/*',
515 '*.smugmug.com/*',
516
517 // SlideShare
518 'slideshare.net/*/*',
519 '*.slideshare.net/*/*',
520
521 // Reddit
522 'reddit.com/r/[^/]+/comments/*',
523
524 // Photobucket
525 'i*.photobucket.com/albums/*',
526 'gi*.photobucket.com/groups/*',
527
528 // Cloudup
529 'cloudup.com/*',
530
531 // Imgur
532 'imgur.com/*',
533 'i.imgur.com/*',
534
535 // YouTube (http://www.youtube.com/)
536 'youtube.com/watch\\?*',
537 'youtube.com/playlist\\?*',
538 'youtube.com/channel/*',
539 'youtube.com/c/*',
540 'youtube.com/user/*',
541 'youtube.com/(\w+)[^?\/]*$',
542
543 // opensea
544 'opensea.io/collection/*',
545
546 // Flickr (http://www.flickr.com/)
547 'flickr.com/photos/*/*',
548 'flic.kr/p/*',
549
550 // Viddler (http://www.viddler.com/)
551 'viddler.com/v/*',
552
553 // Hulu (http://www.hulu.com/)
554 'hulu.com/watch/*',
555
556 // Vimeo (http://vimeo.com/)
557 'vimeo.com/*',
558 'vimeo.com/groups/*/videos/*',
559
560 // CollegeHumor (http://www.collegehumor.com/)
561 'collegehumor.com/video/*',
562
563 // Deviantart.com (http://www.deviantart.com)
564 '*.deviantart.com/art/*',
565 '*.deviantart.com/*#/d*',
566 'fav.me/*',
567 'sta.sh/*',
568
569 // SlideShare (http://www.slideshare.net/)
570
571 // chirbit.com (http://www.chirbit.com/)
572 'chirb.it/*',
573
574 // nfb.ca (http://www.nfb.ca/)
575 '*.nfb.ca/film/*',
576
577 // Scribd (http://www.scribd.com/)
578 '*.scribd.com/doc/*',
579 '*.scribd.com/document/*',
580
581 // Dotsub (http://dotsub.com/)
582 'dotsub.com/view/*',
583
584 // Animoto (http://animoto.com/)
585 'animoto.com/play/*',
586
587 // Rdio (http://rdio.com/)
588 '*.rdio.com/artist/*',
589 '*.rdio.com/people/*',
590
591 // MixCloud (http://mixcloud.com/)
592 'mixcloud.com/*/*/',
593
594 // FunnyOrDie (http://www.funnyordie.com/)
595 'funnyordie.com/videos/*',
596
597 // Ted (http://ted.com)
598 'ted.com/talks/*',
599
600 // Sapo Videos (http://videos.sapo.pt)
601 'videos.sapo.pt/*',
602
603 // Official FM (http://official.fm)
604 'official.fm/tracks/*',
605 'official.fm/playlists/*',
606
607 // HuffDuffer (http://huffduffer.com)
608 'huffduffer.com/*/*',
609
610 // Shoudio (http://shoudio.com)
611 'shoudio.com/*',
612 'shoud.io/*',
613
614 // Moby Picture (http://www.mobypicture.com)
615 'mobypicture.com/user/*/view/*',
616 'moby.to/*',
617
618 // 23HQ (http://www.23hq.com)
619 '23hq.com/*/photo/*',
620
621 // Cacoo (https://cacoo.com)
622 'cacoo.com/diagrams/*',
623
624 // Dipity (http://www.dipity.com)
625 'dipity.com/*/*/',
626
627 // Roomshare (http://roomshare.jp)
628 'roomshare.jp/post/*',
629 'roomshare.jp/en/post/*',
630
631 // Dailymotion (http://www.dailymotion.com)
632 'dailymotion.com/video/*',
633
634 // Crowd Ranking (http://crowdranking.com)
635 'c9ng.com/*/*',
636
637 // CircuitLab (https://www.circuitlab.com/)
638 'circuitlab.com/circuit/*',
639
640 // Coub (http://coub.com/)
641 'coub.com/view/*',
642 'coub.com/embed/*',
643
644 // SpeakerDeck (https://speakerdeck.com)
645 'speakerdeck.com/*/*',
646
647 // Instagram (https://instagram.com)
648 'instagram.com/p/*',
649 'instagr.am/p/*',
650
651 // SoundCloud (http://soundcloud.com/)
652 'soundcloud.com/*',
653
654 // Kickstarter (http://www.kickstarter.com)
655 'kickstarter.com/projects/*',
656
657 // Ustream (http://www.ustream.tv)
658 '*.ustream.tv/*',
659 '*.ustream.com/*',
660
661 // Daily Mile (http://www.dailymile.com)
662 'dailymile.com/people/*/entries/*',
663
664 // Sketchfab (http://sketchfab.com)
665 'sketchfab.com/models/*',
666 'sketchfab.com/*/folders/*',
667
668 // Meetup (http://www.meetup.com)
669 'meetup.com/*',
670 'meetu.ps/*',
671
672 // AudioSnaps (http://audiosnaps.com)
673 'audiosnaps.com/k/*',
674
675 // RapidEngage (https://rapidengage.com)
676 'rapidengage.com/s/*',
677
678 // Getty Images (http://www.gettyimages.com/)
679 'gty.im/*',
680 'gettyimages.com/detail/photo/*',
681
682 // amCharts Live Editor (http://live.amcharts.com/)
683 'live.amcharts.com/*',
684
685 // Infogram (https://infogr.am/)
686 'infogr.am/*',
687 'infogram.com/*',
688
689 // ChartBlocks (http://www.chartblocks.com/)
690 'public.chartblocks.com/c/*',
691
692 // ReleaseWire (http://www.releasewire.com/)
693 'rwire.com/*',
694
695 // ShortNote (https://www.shortnote.jp/)
696 'shortnote.jp/view/notes/*',
697
698 // EgliseInfo (http://egliseinfo.catholique.fr/)
699 'egliseinfo.catholique.fr/*',
700
701 // Silk (http://www.silk.co/)
702 '*.silk.co/explore/*',
703 '*.silk.co/s/embed/*',
704
705 // Twitter
706 'twitter.com/*/status/*',
707 'twitter.com/i/moments/*',
708 'twitter.com/*/timelines/*',
709
710 // http://bambuser.com
711 'bambuser.com/v/*',
712
713 // https://clyp.it
714 'clyp.it/*',
715
716 // https://gist.github.com
717 'gist.github.com/*/*',
718
719 // http://issuu.com
720 'issuu.com/*',
721
722 // https://portfolium.com
723 'portfolium.com/*',
724
725 // https://www.reverbnation.com
726 'reverbnation.com/*',
727
728 // http://rutube.ru
729 'rutube.ru/video/*',
730
731 // https://spotify.com/
732 'open.spotify.com/*',
733
734 // http://www.videojug.com
735 'videojug.com/*',
736
737 // https://vine.com
738 'vine.co/v/*',
739
740 // Facebook
741 'facebook.com/*',
742 'fb.watch/*',
743
744 // Google Shortened Url
745 'goo.gl/*',
746
747 // Google Maps
748 'google.com/*',
749 'google.com.*/*',
750 'google.co.*/*',
751 'maps.google.com/*',
752
753 // Google Docs
754 'docs.google.com/presentation/*',
755 'docs.google.com/document/*',
756 'docs.google.com/spreadsheets/*',
757 'docs.google.com/forms/*',
758 'docs.google.com/drawings/*',
759
760 // Twitch.tv
761 '*.twitch.tv/*',
762 'twitch.tv/*',
763
764 // Giphy
765 '*.giphy.com/gifs/*',
766 'giphy.com/gifs/*',
767 'i.giphy.com/*',
768 'gph.is/*',
769
770 // Wistia
771 '*.wistia.com/medias/*',
772 'fast.wistia.com/embed/medias/*.jsonp',
773 // Boomplay (http://boomplay.com/)
774 'boomplay.com/*',
775 'codepen.io/*',
776 'archivos.digital/*',
777 'audioclip.naver.com/*',
778 'app.blogcast.host/*',
779 'codepoints.net/*',
780 'codesandbox.io/*',
781 'commaful.com/*',
782 '*.survey.fm/*',
783 'survey.fm/*',
784 'datawrapper.dwcdn.net/*',
785 '*.didacte.com/*',
786 'didacte.com/*',
787 'digiteka.com/*',
788 'docdro.id/*',
789 'edumedia-sciences.com/*',
790 'ethfiddle.com/*',
791 'eyrie.io/*',
792 '*.getfader.com/*',
793 'getfader.com/*',
794 'fitapp.pro/*',
795 'fite.tv/*',
796 'public.flourish.studio/*',
797 'geograph.org.gg/*',
798 'geo-en.hlipp.de/*',
799 'geograph.org.uk/*',
800 'fortest.getshow.io/*',
801 'opensea.io/assets/*',
802 ];
803 }
804
805 public function delete_instagram_account()
806 {
807 if (!current_user_can('manage_options')) {
808 wp_send_json_error(array('message' => 'You do not have sufficient permissions to access this functionality.'));
809 return;
810 }
811
812 if (isset($_POST['_nonce']) && wp_verify_nonce($_POST['_nonce'], 'embedpress_elements_action')) {
813 $user_id = isset($_POST['user_id']) ? $_POST['user_id'] : '';
814 $account_type = isset($_POST['account_type']) ? $_POST['account_type'] : '';
815 $account_data = get_option('ep_instagram_account_data');
816
817 $data = array_filter($account_data, function ($item) use ($user_id) {
818 return $item['user_id'] !== $user_id;
819 });
820 $data = array_values($data);
821 update_option('ep_instagram_account_data', $data);
822 } else {
823 wp_die('Nonce verification failed.');
824 }
825 }
826
827
828
829 /**
830 * Update admin notice view status
831 *
832 * @since 2.5.1
833 */
834 public static function embedpress_notice_dismiss()
835 {
836 check_ajax_referer('embedpress', 'security');
837 update_option('embedpress_social_dismiss_notice', true);
838 }
839 }
840