-
Notifications
You must be signed in to change notification settings - Fork 0
/
cove-asset-manager.php
553 lines (481 loc) · 21.5 KB
/
cove-asset-manager.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
<?php
/*
* Plugin Name: COVE Asset Manager
* Version: 3.4 -- adds DRM code for partner player
* Plugin URI: http://www.thirteen.org/
* Description: COVE Asset Manager
* Author: William Tam, WNET
* Author URI: http://ieg.wnet.org/
* Requires at least: 4.6
* Tested up to: 3.5.1
*
* @package WordPress
* @author William Tam
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) exit;
register_activation_hook(__FILE__ , 'cove_asset_manager_install');
register_deactivation_hook(__FILE__ , 'cove_asset_manager_uninstall');
// Include plugin class files
require_once( 'classes/class-cove-asset-manager.php' );
require_once( 'classes/class-cove-asset-manager-settings.php' );
require_once( 'classes/class-cove-asset-metaboxes.php' );
if ( !class_exists('PBS_Media_Manager_API_Client') ) {
require_once( 'assets/php/PBS_Media_Manager_Client/class-PBS-Media-Manager-API-Client.php' );
}
// Include the YouTube server scripts
require_once( 'classes/class-youtube-oauth.php' );
// Instantiate necessary classes
global $plugin_obj;
$plugin_obj = new COVE_Asset_Manager( __FILE__ );
$youtube_oauth_obj = new WNET_Google_oAuth(__FILE__);
if ( is_admin() ) {
$plugin_metaboxes_obj = new COVE_Asset_Metaboxes( __FILE__ );
$plugin_settings_obj = new COVE_Asset_Manager_Settings( __FILE__ );
}
function coveam_get_video( $id ) {
// array to eventually return
$videofields = array();
// first lets get the stuff from the post meta
$postmeta = get_post_custom($id);
$videofields['title'] = $postmeta['_coveam_video_title'][0];
$videofields['description'] = $postmeta['_coveam_description'][0];
$videofields['status'] = $postmeta['_coveam_video_status'][0];
$videofields['short_description'] = $postmeta['_coveam_shortdescription'][0];
$videofields['airdate'] = $postmeta['_coveam_airdate'][0];
$videofields['youtubeid'] = $postmeta['_coveam_youtube_id'][0];
$videofields['coveplayerid'] = $postmeta['_coveam_cove_player_id'][0];
$videofields['rights'] = $postmeta['_coveam_rights'][0];
$videofields['fullprogram'] = $postmeta['_coveam_video_fullprogram'][0];
$videofields['duration'] = $postmeta['_coveam_duration'][0];
$videofields['video_override_url'] = $postmeta['_coveam_video_override_url'][0];
// Most older videos don't have the cove/youtube status set, default to good if overall status set to publish
if ($videofields['status'] == 'publish') {
$videofields['covestatus'] = 'available';
$videofields['youtubestatus'] = 'public';
}
if ($postmeta['_coveam_covestatus'][0]) {
$videofields['covestatus'] = strtolower($postmeta['_coveam_covestatus'][0]);
}
if ($postmeta['_coveam_youtubestatus'][0]) {
$videofields['youtubestatus'] = $postmeta['_coveam_youtubestatus'][0];
}
$videofields['slug'] = $postmeta['_coveam_video_slug'][0];
$videofields['raw_video_url'] = $postmeta['_coveam_video_url'][0];
$videofields['raw_image_url'] = $postmeta['_coveam_video_image'][0];
if (isset ($postmeta['_coveam_metadata_json']) && isset ($postmeta['_coveam_metadata_json'][0])) {
$fields_json = $postmeta['_coveam_metadata_json'][0];
$morefields = json_decode($fields_json, true);
foreach ($morefields as $field => $value) {
$videofields[$field] = $value;
}
}
// get the thumbnail url for the post
// TODO make this pull in the object so it can be queried for size
// see get_intermediate_image_sizes
$videofields['thumbnail'] = wp_get_attachment_url( get_post_thumbnail_id($id) );
// return the list of tag slugs assigned to this post
$thesetags = get_the_terms( $id, 'post_tag' );
if ($thesetags && ! is_wp_error( $thesetags ) ) {
$thistag_array = array();
foreach ( $thesetags as $tag ) {
$thistag_array[] = $tag->slug;
}
}
$videofields['tags'] = $thistag_array;
return $videofields;
}
function coveam_update_video_status($id) {
if (function_exists('coveam_get_video')) {
$video = coveam_get_video( $id );
$video_status = strtolower($video["status"]);
$cove_status = strtolower($video["covestatus"]);
$cove_rights = strtolower($video["rights"]);
$cove_airdate = $video["airdate"];
$youtube_status = strtolower($video["youtubestatus"]);
$video_override_url = $video["video_override_url"];
if ($cove_status) {
if ($cove_status == 'available') {
$video_status = 'publish';
} else {
$video_status = $cove_status;
}
}
if (!in_array($cove_status, array('expired', 'not_yet_available'))) {
if ($youtube_status) {
if ($youtube_status == 'public') {
$video_status = 'publish';
}
}
if ($video_override_url != '') {
$video_status = 'publish';
}
}
if ($cove_rights == "limited") {
$video_expire_date = $cove_airdate;
$video_expire_date = strtotime($video_expire_date);
$video_expire_date = strtotime("+30 day", $video_expire_date);
if ((time() > $video_expire_date)) {
$video_status = "expired";
}
}
update_post_meta($id, '_coveam_video_status', $video_status);
return 'cove_status = ' . $cove_status. ', youtube_status = ' . $youtube_status ;
}
}
function coveam_render_player( $id, $args = array() ) {
global $whereami;
$defaults = array('player_chrome' => 'show',
'show_related' => 'hide',
'display' => 'static'
);
if (! is_array($args)) {
$args = array();
}
$args = array_merge($defaults, $args);
$linkedpostid = $id;
if (function_exists('wt_p2p_return_related_postid')) {
$allowed_post_types = get_option('coveam_showonposttypes');
if (in_array(get_post_type($id), $allowed_post_types)) {
$linkedpost = wt_p2p_return_related_postid($id,'p2p_to','featured_video',1);
$linkedpostid = $linkedpost[0][0];
} else {
$videopost = wt_p2p_return_related_postid($id,'p2p_from','featured_video',1);
$id = $videopost[0][0];
}
}
// generate a unique id for the div. It is possible for the same video to appear multiple times on the page so add a rand
$div_id = "coveam_player_" . $id . "_" . rand(10,100);
// get all the data about the video -- maybe there won't be any data
if (function_exists('coveam_get_video')) {
$video = coveam_get_video( $id );
$available = true;
$error = "We're sorry, no data exists for this video(" . $id . ")";
if (strtolower($video["rights"]) == "limited") {
$video_expire_date = $video["airdate"];
$video_expire_date = strtotime($video_expire_date);
$video_expire_date = strtotime("+30 day", $video_expire_date);
if ((time() > $video_expire_date)) {
$available = false;
$error = 'We\'re sorry, the rights for this video have expired.';
if ( is_feed() ) {
return $error;
}
}
}
if ( is_feed() ) {
if ($video && $available) {
if ($video['coveplayerid'] && ($video['covestatus'] == 'available')) {
if ($whereami == "rss-description") {
$playlink = '<a href="https://video.pbs.org/video/' . $video['coveplayerid']. '/">[Watch Video]</a>';
} else {
$playlink = "<iframe class='partnerPlayer' frameborder='0' marginwidth='0' marginheight='0' scrolling='no' width='100%' height='100%' src='https://player.pbs.org/widget/partnerplayer/" . $video['coveplayerid'] . "/?start=0&end=0&chapterbar=false&endscreen=false' allow='encrypted-media' allowfullscreen></iframe>";
}
} elseif (($video['youtubestatus'] == "public") && $video['youtubeid'] ) {
if ($whereami == "rss-description") {
$playlink = '<a href="http://www.youtube.com/watch?v=' . $video['youtubeid'] . '">[Watch Video]</a>';
} else {
$playlink = '<iframe width="100%" height="100%" src="http://www.youtube.com/embed/' . $video['youtubeid'] . '" frameborder="0" allowfullscreen></iframe>';
}
} elseif ($video['video_override_url']) {
if ($whereami == "rss-description") {
$playlink = 'There should be an embedded item here. Please visit the original post to view it.';
} else {
$playlink = wp_oembed_get( $video['video_override_url'] );
}
} else {
$playlink = "This video is not currently available.";
}
return $playlink;
}
} else {
// print out a div with a class, a unique id, title, description, youtube_id, cove_id
$html = '<div class="video-wrapper coveam-videoplayer no-content nocontent" id="' . $div_id . '">';
//check if we've got anything
if ($video && $available) {
$html .= '<div class="coveam_vars" style="display:none;">';
$covepreferred = get_option( 'coveam_cove_preferred', 'true' );
$html .= '<span class="coveam_videoid">' . $id . '</span>';
$html .= '<span class="coveam_linkedpostid">' . $linkedpostid . '</span><span class="coveam_excluded">' . $linkedpostid . '</span>';
$html .= '<span class="coveam_videotitle">' . $video['title'] . '</span>';
$html .= '<span class="coveam_videodescription">' . $video['description'] . '</span>';
$html .= '<span class="coveam_airdate">' . $video['airdate'] . '</span>';
// these are blank on purpose, only updated by jquery
$html .= '<span class="coveam_autoplay">disabled</span>';
$playerhtml = '';
if ($args['player_chrome'] == 'hide') {
$html .= '<span class="coveam_playerchrome">hide</span>';
}
// check status of cove and youtube and if there's a server-setting to use cove
$html .= '<span class="coveplayerid">';
if ($video['coveplayerid'] && ($video['covestatus'] == 'available')) {
$html .= $video['coveplayerid'];
$playerhtml = '<div class="video-wrap" style="width:100%; padding-bottom: 56.25%; position:relative;"><iframe class="partnerPlayer" marginwidth="0" marginheight="0" scrolling="no" style="position:absolute; top:0;" src="//player.pbs.org/widget/partnerplayer/' . $video['coveplayerid'] . '/?start=0&end=0&chapterbar=false&endscreen=false&topbar=true&autoplay=false" allow="encrypted-media" allowfullscreen="" width="100%" height="100%" frameborder="0"></iframe></div>';
}
$html .= '</span><span class="youtubeid">';
if (($video['youtubestatus'] == "public") && $video['youtubeid']) {
$html .= $video['youtubeid'];
if (empty($playerhtml)) {
// youtube player code
$playerhtml = '<div class="video-wrap" style="width:100%; padding-bottom: 56.25%; position:relative;" ><iframe width="100%" height="100%" style="position:absolute; top:0;" src="//www.youtube.com/embed/' . $video['youtubeid'] . '?enablejsapi=1" frameborder="0" allowfullscreen></iframe></div>';
}
}
$html .= '</span><span class="coveam_covepreferred">' . $covepreferred . '</span><span class="coveam_video_override_encoded">';
if ($video['video_override_url']) {
if (empty($playerhtml)) {
if (strpos($video['video_override_url'], 'facebook')) {$extraClass = "facebook";}
else {$extraClass = "";}
$override = "<div class='cam-oembed $extraClass'>". wp_oembed_get( $video['video_override_url'] ) . "</div>";
$html .= rawurlencode($override);
$playerhtml = '<div class="video-wrap">' . $override . '</div>';
}
}
$html .= '</span>';
if ($args['show_related'] == 'show') {
$relatedvideos = wt_p2p_related_videos($id, 3, null);
if(is_array($relatedvideos)){
$vidcount=1;
foreach($relatedvideos as $relatedvideo) {
$html .= '<span class="coveam_relatedvid_linkedpostid_' . $vidcount . '">' . $relatedvideo['ID'] . '</span>';
$html .= '<span class="coveam_relatedvid_id_' . $vidcount . '">' . $relatedvideo['video_post'] . '</span>';
$html .= '<span class="coveam_relatedvid_permalink_' . $vidcount . '">' . $relatedvideo['permalink'] . '</span>';
$html .= '<span class="coveam_relatedvid_title_' . $vidcount . '">' . $relatedvideo['title'] . '</span>';
$html .= '<span class="coveam_relatedvid_description_' . $vidcount . '">' . $relatedvideo['description'] . '</span>';
$html .= '<span class="coveam_relatedvid_airdate_' . $vidcount . '">' . $relatedvideo['airdate'] . '</span>';
$html .= '<span class="coveam_relatedvid_img_' . $vidcount . '">' . $relatedvideo['thumbnail_url'] . '</span>';
$html .= '<span class="coveam_relatedvid_coveplayerid_' . $vidcount . '">' . $relatedvideo['coveplayerid'] . '</span>';
$html .= '<span class="coveam_relatedvid_youtubeid_' . $vidcount . '">' . $relatedvideo['youtubeid'] . '</span>';
$html .= '<span class="coveam_relatedvid_video_override_encoded_' . $vidcount . '">' . rawurlencode( wp_oembed_get($relatedvideo['video_override_url']) ) . '</span>';
$vidcount++;
}
}
}
$html .= '</div><div class="coveam_player">';
if (!empty($playerhtml)) {
$html .= $playerhtml;
}
$html .= '</div></div>';
//if ($args['display'] == "ajax") {
//fire the display player script if called after page load ie via ajax
//$html .= '<script type="text/javascript"> jQuery(function(){ jQuery("#' . $div_id . '").coveamDisplayPlayer(); }); </script>';
//}
} else {
$html .= '<div class="errormessage">' . $error . '</div></div>';
}
return $html;
}
} else {
return false;
}
}
function coveam_remove_watchvideo_from_excerpt($excerpt) {
return preg_replace("/\[Watch Video\](.*)/", "$1", $excerpt);
}
add_filter( 'get_the_excerpt', 'coveam_remove_watchvideo_from_excerpt' );
add_action( 'wp_ajax_coveam_ajax_relatedvideos', 'coveam_ajax_relatedvideos' );
add_action( 'wp_ajax_nopriv_coveam_ajax_relatedvideos', 'coveam_ajax_relatedvideos' );
function coveam_ajax_relatedvideos() {
$videoid = ( isset( $_POST['videoid'] ) ) ? $_POST['videoid'] : '';
$excluded = ( isset( $_POST['excluded'] ) ) ? $_POST['excluded'] : '';
$returnarray = wt_p2p_related_videos($videoid, 3, $excluded);
if ($returnarray ) {
echo json_encode($returnarray);
} else {
echo json_encode($error);
}
die();
}
add_action( 'wp_ajax_coveam_sign_aws_request', 'coveam_sign_aws_request' );
function coveam_sign_aws_request() {
$slug = $_GET['slug'];
$fileinfo = $_GET['fileinfo'];
$return = 'config params needed';
if (get_option( 'coveam_aws_key' ) && get_option( 'coveam_aws_secret_key' ) && get_option ( 'coveam_s3_bucket' )) {
$SIGNPUT_S3_KEY=get_option( 'coveam_aws_key' );
$SIGNPUT_S3_SECRET=get_option( 'coveam_aws_secret_key' );
$SIGNPUT_S3_BUCKET= '/' . get_option( 'coveam_s3_bucket' );
$EXPIRE_TIME=(60 * 5); // 5 minutes
$S3_URL='https://s3.amazonaws.com';
$objectName='/' . $slug;
if (get_option( 'coveam_s3_bucket_dir' ) ) {
$objectName = '/' . get_option( 'coveam_s3_bucket_dir' ) . $objectName;
}
$mimeType=$fileinfo;
$expires = time() + $EXPIRE_TIME;
$amzHeaders= "x-amz-acl:public-read";
$stringToSign = "PUT\n\n$mimeType\n$expires\n$amzHeaders\n$SIGNPUT_S3_BUCKET$objectName";
$sig = urlencode(base64_encode(hash_hmac('sha1', $stringToSign, $SIGNPUT_S3_SECRET, true)));
$return = urlencode("$S3_URL$SIGNPUT_S3_BUCKET$objectName?AWSAccessKeyId=$SIGNPUT_S3_KEY&Expires=$expires&Signature=$sig");
}
echo $return;
die;
}
function coveam_daily_expire_videos() {
$expire_vids_before_this_date = strtotime("-30 day", time());
$ids_to_expire = array();
$allowed_post_types = get_option('coveam_showonposttypes');
$args = array(
'post_status' => 'publish',
'post_type' => $allowed_post_types,
'meta_query' => array(
'relation' => 'AND',
array(
'key' => '_coveam_rights',
'value' => 'Limited',
'compare' => '='
),
array(
'key' => '_coveam_video_status',
'value' => 'publish',
'compare' => '='
)
),
'date_query' => array(
array(
'after' => '2 month ago'
)
),
'posts_per_page' => 200,
'orderby' => 'date',
'order' => 'ASC'
);
$returnlist = '';
$youtubelist = '';
$limitedvideos = new WP_Query($args);
if ($limitedvideos->have_posts()){
while ( $limitedvideos->have_posts() ) : $limitedvideos->the_post();
$thisairdate = get_post_meta($limitedvideos->post->ID, '_coveam_airdate', true);
if ($thisairdate) {
$rawairdate = strtotime($thisairdate);
if ($rawairdate < $expire_vids_before_this_date && $rawairdate > 0){
array_push($ids_to_expire, $limitedvideos->post->ID);
$returnlist .= 'vidid = ' . $limitedvideos->post->ID . ' date = ' . $thisairdate . "\n";
}
}
endwhile;
}
// init the youtube class
$youtube_oauth= new WNET_Google_oAuth(__FILE__);
// first, we go through the videos and expire them in WordPress.
foreach ($ids_to_expire as $id) {
update_post_meta($id, '_coveam_video_status', 'expired');
// second, see if there are youtube videos to expire
$youtubeid = get_post_meta($id, '_coveam_youtube_id', true);
if ($youtubeid) {
$privacy_set = $youtube_oauth->submit_youtube_expire_request($youtubeid);
if ($privacy_set === true){
update_post_meta($id, '_coveam_youtubestatus', 'private');
$youtubelist .= ' http://www.youtube.com/watch?v=' . $youtubeid;
} else {
$youtubelist .= "\nError: $youtubeid $privacy_set \n";
}
}
}
if ($returnlist || $youtubelist) {
// only send an email if actual videos were expired
$subject = 'coveam videos expired on' . get_bloginfo('name');
$message = 'expiration date: ' . date('Y-m-d', $expire_vids_before_this_date);
$message .= "\n these videos were expired: " . $returnlist;
if ($youtubelist != '') {
$message .= "\n these youtube videos were set to private: " . $youtubelist;
}
$to = get_option('coveam_notify_email');
if (!empty($to)) {
wp_mail( $to, $subject, $message);
}
}
// sanity check lets return the list of ids
return $ids_to_expire;
}
function coveam_check_inprogress_ingest_videos() {
$plugin_obj = new COVE_Asset_Manager( __FILE__ );
$ignore_vids_before_this_date = date("Y-m-d", strtotime("-2 day", time()));
$inprogress_videos = array();
$allowed_post_types = get_option('coveam_showonposttypes');
// see if there are youtube videos processing
$youtubeargs = array(
'post_type' => $allowed_post_types,
'post_status' => array('publish', 'pending', 'draft', 'future'),
'meta_query' => array(
array(
'key' => '_coveam_youtubestatus',
'value' => array('uploaded','processing','private'),
'compare' => 'IN'
)
),
'date_query' => array(
array('after' => $ignore_vids_before_this_date)
),
'posts_per_page' => 100,
'orderby' => 'date',
'order' => 'DESC'
);
$youtubevideos = new WP_Query($youtubeargs);
$yt_processedvideos = array();
if ($youtubevideos->have_posts()){
// init the youtube class
$youtube_oauth= new WNET_Google_oAuth(__FILE__);
while ( $youtubevideos->have_posts() ) : $youtubevideos->the_post();
$postid = $youtubevideos->post->ID;
$processed = $youtube_oauth->update_youtube_status_from_youtube($postid);
if ($processed) {
array_push($yt_processedvideos, $postid);
} else {
array_push($inprogress_videos, $postid);
}
endwhile;
}
// sanity check lets return the list of ids
/*
$json_response = json_encode($affected_videos);
echo $json_response;
$subject = 'coveam_check_inprogress_ingest_videos on ' . get_bloginfo('name');
$message = 'These posts inprogress: ' . join(",", $inprogress_videos);
$message .= 'These videos ready with timestamp: ' . join(",", $waiting_videos);
$message .= 'these youtube videos affected: ' . join(",", $yt_processedvideos);
if ((count($inprogress_videos) + count($waiting_videos) + count($yt_processedvideos)) > 0 ) {
//wp_mail( '[email protected]', $subject, $message);
}
*/
}
add_action( 'wp_ajax_coveam_check_inprogress_ingest_videos', 'coveam_check_inprogress_ingest_videos' );
//schedule events
//note -- per the documentation from wp, best for schedule hooks to have all lowercase and no underscores
//http://codex.wordpress.org/Function_Reference/wp_schedule_event
add_filter( 'cron_schedules', 'cron_add_fiveminute' );
function cron_add_fiveminute( $schedules ) {
// Adds once weekly to the existing schedules.
$schedules['fiveminute'] = array(
'interval' => 300,
'display' => __( 'Every Five Minutes ' )
);
return $schedules;
}
add_action( 'coveamdailyevent', 'coveam_daily_expire_videos' );
add_action( 'coveamfiveminuteevent', 'coveam_check_inprogress_ingest_videos' );
add_action( 'wp', 'coveam_setup_schedule' );
function coveam_setup_schedule() {
if ( ! wp_next_scheduled( 'coveamdailyevent' ) ) {
wp_schedule_event( time(), 'daily', 'coveamdailyevent');
}
if ( ! wp_next_scheduled( 'coveamfiveminuteevent' ) ) {
wp_schedule_event( time(), 'fiveminute', 'coveamfiveminuteevent');
}
}
# on install/activate
function cove_asset_manager_install() {
$plugin_obj = new COVE_Asset_Manager( __FILE__ );
// setup the daily episode generation
$ep_gen = $plugin_obj->do_daily_episode_generate();
if (!empty($ep_gen['errors'])) {
error_log(json_encode($ep_gen));
} else {
error_log('scheduled daily episode generation');
}
}
# on uninstall/deactivate
function cove_asset_manager_uninstall() {
$plugin_obj = new COVE_Asset_Manager( __FILE__ );
// remove any scheduled episode generation
$plugin_obj->clear_scheduled_episode_generation();
}