Changeset 3269556
- Timestamp:
- 04/09/2025 10:09:58 AM (12 months ago)
- Location:
- auto-podcast-import
- Files:
-
- 30 added
- 6 edited
-
tags/1.0.10 (added)
-
tags/1.0.10/assets (added)
-
tags/1.0.10/assets/css (added)
-
tags/1.0.10/assets/css/admin.css (added)
-
tags/1.0.10/assets/css/index.php (added)
-
tags/1.0.10/assets/images (added)
-
tags/1.0.10/assets/images/loader.gif (added)
-
tags/1.0.10/assets/index.php (added)
-
tags/1.0.10/assets/js (added)
-
tags/1.0.10/assets/js/admin.js (added)
-
tags/1.0.10/assets/js/index.php (added)
-
tags/1.0.10/auto-podcast-import.php (added)
-
tags/1.0.10/functions.php (added)
-
tags/1.0.10/inc (added)
-
tags/1.0.10/inc/admin_menu.php (added)
-
tags/1.0.10/inc/cron.php (added)
-
tags/1.0.10/inc/feed.php (added)
-
tags/1.0.10/inc/filters.php (added)
-
tags/1.0.10/inc/index.php (added)
-
tags/1.0.10/inc/post_type.php (added)
-
tags/1.0.10/index.php (added)
-
tags/1.0.10/languages (added)
-
tags/1.0.10/languages/aupi-ar.mo (added)
-
tags/1.0.10/languages/aupi-ar.po (added)
-
tags/1.0.10/languages/aupi-he_IL.mo (added)
-
tags/1.0.10/languages/aupi-he_IL.po (added)
-
tags/1.0.10/languages/aupi.pot (added)
-
tags/1.0.10/languages/index.php (added)
-
tags/1.0.10/main.php (added)
-
tags/1.0.10/readme.txt (added)
-
trunk/assets/js/admin.js (modified) (1 diff)
-
trunk/auto-podcast-import.php (modified) (2 diffs)
-
trunk/functions.php (modified) (3 diffs)
-
trunk/inc/admin_menu.php (modified) (7 diffs)
-
trunk/inc/feed.php (modified) (9 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
auto-podcast-import/trunk/assets/js/admin.js
r3225063 r3269556 60 60 }); 61 61 62 }); 62 }); 63 64 65 jQuery(document).on('change','.aupi_add #post_type, .aupi_add #taxonomy',function(e){ 66 67 let f = jQuery(this).parents('form'), 68 id = jQuery(this).attr('id'); 69 70 let pt = f.find('#post_type').val(), 71 tax = f.find('#taxonomy').val(); 72 73 74 if (id == 'post_type') { 75 let taxField = f.find('#taxonomy'); 76 taxField.empty(); 77 let opts = '<option value="" selected></option>'; 78 if (typeof aupi_tax[pt] !== 'undefined') { 79 jQuery.each(aupi_tax[pt], function(tax,label) { 80 opts += '<option value="'+tax+'">'+label+'</option>'; 81 }); 82 } 83 taxField.append(opts); 84 } 85 86 let termField = f.find('#term'); 87 termField.empty(); 88 let opts2 = '<option value="" selected></option>'; 89 console.log(aupi_terms[tax]); 90 91 if (typeof aupi_terms[tax] !== 'undefined') { 92 jQuery.each(aupi_terms[tax], function(id, label) { 93 opts2 += '<option value="'+id+'">'+label+'</option>'; 94 }); 95 } 96 termField.append(opts2); 97 98 }); 99 63 100 64 101 jQuery(document).on('submit','.aupi_contact',function(e){ -
auto-podcast-import/trunk/auto-podcast-import.php
r3243696 r3269556 4 4 * Plugin URI: https://wordpress.org/plugins/auto-podcast-import/ 5 5 * Description: Import your podcast feed, automatically from any supported podcast provider. 6 * Version: 1.0. 86 * Version: 1.0.10 7 7 * Requires at least: 6.1.0 8 8 * Requires PHP: 7.4 … … 16 16 defined( 'ABSPATH' ) || exit; 17 17 18 define('AUPI_VER','1.0. 8');18 define('AUPI_VER','1.0.10'); 19 19 define('AUPI_SLUG','aupi'); 20 20 -
auto-podcast-import/trunk/functions.php
r3243696 r3269556 54 54 return $ret; 55 55 } 56 57 /** 58 * get registered taxonomies by post type (public) 59 * 60 * @since 1.0.9 61 * 62 * @return array 63 */ 64 function aupi_get_taxonomies_by_post_type(){ 65 66 $post_types = aupi_get_post_types(); 67 $ret = []; 68 if (!empty($post_types)) { 69 foreach ($post_types as $pt) { 70 $ret[$pt] = []; 71 $post_type_taxes = get_object_taxonomies($pt, 'objects'); 72 foreach($post_type_taxes as $ptt => $ptto) { 73 if ($ptt == 'post_tag') { 74 continue; 75 } 76 $ret[$pt][$ptt] = $ptto->label; 77 } 78 } 79 } 80 return $ret; 81 } 82 83 /** 84 * get registered terms by taxonomy (public) 85 * 86 * @since 1.0.9 87 * 88 * @return array 89 */ 90 function aupi_get_terms_by_taxonomy(){ 91 92 $post_type_taxes = aupi_get_taxonomies_by_post_type(); 93 $ret = []; 94 95 if (!empty($post_type_taxes)) { 96 foreach ($post_type_taxes as $pt=>$taxes) { 97 if (!empty($taxes)) { 98 foreach ($taxes as $tax=>$label) { 99 if (isset($ret[$tax])) { 100 continue; 101 } 102 $terms = get_terms(array( 103 'taxonomy' => $tax, 104 'hide_empty' => false, 105 )); 106 if (!empty($terms )) { 107 foreach($terms as $term) { 108 $ret[$tax][$term->term_id] = $term->name; 109 } 110 } 111 } 112 } 113 } 114 } 115 return $ret; 116 } 56 117 57 118 … … 98 159 $r['feed_before_title'] = get_post_meta($feed->ID,'feed_before_title',true); 99 160 $r['post_type'] = get_post_meta($feed->ID,'post_type',true); 161 $r['taxonomy'] = get_post_meta($feed->ID,'taxonomy',true); 162 $r['term'] = get_post_meta($feed->ID,'term',true); 100 163 $r['force_update_posts'] = get_post_meta($feed->ID,'force_update_posts',true); 101 164 $r['insert_audio_player'] = get_post_meta($feed->ID,'insert_audio_player',true)=='yes' ? 'yes' : 'no'; … … 157 220 $r['feed_before_title'] = get_post_meta($feed->ID,'feed_before_title',true); 158 221 $r['post_type'] = get_post_meta($feed->ID,'post_type',true); 222 $r['taxonomy'] = get_post_meta($feed->ID,'taxonomy',true); 223 $r['term'] = get_post_meta($feed->ID,'term',true); 159 224 $r['force_update_posts'] = get_post_meta($feed->ID,'force_update_posts',true); 160 225 $r['insert_audio_player'] = get_post_meta($feed->ID,'insert_audio_player',true)=='yes' ? 'yes' : 'no'; -
auto-podcast-import/trunk/inc/admin_menu.php
r3243696 r3269556 86 86 $data['feed_url'] = \wp_kses_post($_POST['feed_url']); 87 87 $data['post_type'] = \wp_kses_post($_POST['post_type']); 88 $data['taxonomy'] = \wp_kses_post($_POST['taxonomy']); 89 $data['term'] = \wp_kses_post($_POST['term']); 88 90 $data['post_status'] = \wp_kses_post($_POST['post_status']); 89 91 $data['recurrence'] = \wp_kses_post($_POST['recurrence']); … … 484 486 $vals['feed_url']=''; 485 487 $vals['post_type']=''; 488 $vals['taxonomy']=''; 489 $vals['term']=''; 486 490 $vals['post_status']=''; 487 491 $vals['recurrence']=''; … … 493 497 494 498 if($id){ 495 $vals['feed_before_title']=\get_post_meta($id,'feed_before_title',true); 496 $vals['feed_title']=\get_post_meta($id,'feed_title',true); 497 $vals['feed_url']=\get_post_meta($id,'feed_url',true); 498 $vals['post_type']=\get_post_meta($id,'post_type',true); 499 $vals['post_status']=\get_post_meta($id,'post_status',true); 500 $vals['recurrence']=\get_post_meta($id,'recurrence',true); 501 $vals['post_author']=\get_post_meta($id,'post_author',true); 499 $vals['feed_before_title'] =\get_post_meta($id,'feed_before_title',true); 500 $vals['feed_title'] =\get_post_meta($id,'feed_title',true); 501 $vals['feed_url'] =\get_post_meta($id,'feed_url',true); 502 $vals['post_type'] =\get_post_meta($id,'post_type',true); 503 $vals['taxonomy'] =\get_post_meta($id,'taxonomy',true); 504 $vals['term'] =\get_post_meta($id,'term',true); 505 $vals['post_status'] =\get_post_meta($id,'post_status',true); 506 $vals['recurrence'] =\get_post_meta($id,'recurrence',true); 507 $vals['post_author'] =\get_post_meta($id,'post_author',true); 502 508 503 509 $vals['force_update_posts']=\get_post_meta($id,'force_update_posts',true); … … 508 514 509 515 510 $ret=\aupi_get_post_types(); 516 $ret = \aupi_get_post_types(); 517 $taxes = \aupi_get_taxonomies_by_post_type(); 518 $terms = \aupi_get_terms_by_taxonomy(); 511 519 512 520 if(!$id){ … … 552 560 echo '<option '.($r==$vals['post_type'] ? 'selected' : '').' value="'.esc_attr($r).'">'.esc_html($r).'</option>'; 553 561 } 562 echo '</select>'; 563 echo '</td>'; 564 echo '</tr>'; 565 echo '<tr>'; 566 echo '<th>'; 567 echo '<label for="taxonomy">'.esc_html__( 'Taxonomy', 'aupi' ).':</label>'; 568 echo '</th>'; 569 echo '<td>'; 570 echo '<select id="taxonomy" name="taxonomy">'; 571 echo '<option value=""></option>'; 572 if (isset($taxes[$vals['post_type']]) && !empty($taxes[$vals['post_type']])) { 573 foreach($taxes[$vals['post_type']] as $tax=>$label){ 574 echo '<option '.($tax==$vals['taxonomy'] ? 'selected' : '').' value="'.esc_attr($tax).'">'.esc_html($label).'</option>'; 575 } 576 } 577 echo '</select>'; 578 echo '</td>'; 579 echo '</tr>'; 580 echo '<tr>'; 581 echo '<th>'; 582 echo '<label for="term">'.esc_html__( 'Term', 'aupi' ).':</label>'; 583 echo '</th>'; 584 echo '<td>'; 585 echo '<select id="term" name="term">'; 586 echo '<option value=""></option>'; 587 if ($vals['taxonomy'] && isset($terms[$vals['taxonomy']]) && !empty($terms[$vals['taxonomy']])) { 588 foreach($terms[$vals['taxonomy']] as $term_id=>$label){ 589 echo '<option '.($term_id==$vals['term'] ? 'selected' : '').' value="'.esc_attr($term_id).'">'.esc_html($label).'</option>'; 590 } 591 } 554 592 echo '</select>'; 555 593 echo '</td>'; … … 646 684 echo '</table>'; 647 685 648 649 650 651 652 686 echo '<div data-error="'.esc_attr__( 'Error, please try later.', 'aupi' ).'" data-ajaxing="'.esc_attr__( 'Saving settings, please wait!', 'aupi' ).'" class="aupi_ajaxing"></div>'; 653 687 … … 656 690 657 691 echo '</form>'; 658 659 692 ?> 693 694 <script> 695 let aupi_tax = <?php echo json_encode($taxes); ?>; 696 let aupi_terms = <?php echo json_encode($terms); ?>; 697 </script> 698 699 <?php 660 700 } 661 701 -
auto-podcast-import/trunk/inc/feed.php
r3243696 r3269556 47 47 $body = \wp_remote_retrieve_body($response); 48 48 if(!empty($body)){ 49 49 50 $xml = \simplexml_load_string($body); 51 52 $namespaces = $xml->getNamespaces(true); 53 50 54 $xml = (array)$xml; 51 52 53 54 55 55 56 … … 60 61 $moreData['image']=[]; 61 62 foreach($xml['channel'] as $k=>$item ){ 62 63 64 65 63 66 64 … … 81 79 82 80 foreach($xml['channel'] as $k=>$item ){ 83 84 85 86 87 81 if($k=='item'){ 82 88 83 $r=[]; 89 84 $r['title'] = \wp_kses_post((string)$item->title); … … 98 93 99 94 $r['pubDate'] = (string)$item->pubDate; 95 96 $r['duration'] = isset($namespaces['itunes']) ? (int) $item->children($namespaces['itunes'])->duration : 0; 97 100 98 $url = (array)$item->enclosure ; 101 99 $r['url'] = !empty($url['@attributes']['url']) ? $url['@attributes']['url'] : ''; … … 182 180 $post = \get_posts($args); 183 181 184 185 186 187 182 $metaToSave= []; 188 183 $metaToSave['aupi_feed_id'] =$this->feed['id']; … … 194 189 $metaToSave['aupi_audio'] = !empty($x['url']) ? wp_kses_post($x['url']) : ''; 195 190 $metaToSave['aupi_date'] = !empty($x['pubDate']) ? wp_kses_post($x['pubDate']) : ''; 196 197 191 $metaToSave['aupi_duration'] = !empty($x['duration']) ? wp_kses_post($x['duration']) : ''; 192 198 193 $metaToSave['aupi_image_url'] =''; 199 194 $metaToSave['aupi_image_title'] =''; 200 201 202 195 203 196 … … 228 221 $args['post_title']= $feed_title; 229 222 $args['post_content']=$postContent; 230 231 232 223 $args['post_date'] = !empty($x['pubDate']) ? date('Y-m-d H:i:s', strtotime(wp_kses_post($x['pubDate']))) : date('Y-m-d H:i:s'); 224 225 233 226 $pnum = \wp_insert_post($args); 234 227 … … 248 241 $args['post_title']= $feed_title; 249 242 $args['post_content']=$postContent; 243 $args['post_date'] = !empty($x['pubDate']) ? date('Y-m-d H:i:s', strtotime(wp_kses_post($x['pubDate']))) : date('Y-m-d H:i:s'); 244 250 245 if(empty($args['post_content']) && !empty($x['description'])){ 251 246 $args['post_content']=wp_kses_post($x['description']); … … 266 261 \update_post_meta($pnum,$k,$v); 267 262 } 268 263 264 $taxanomy = $this->feed['taxonomy']; 265 $term = $this->feed['term']; 266 267 if ($taxanomy && $term) { 268 wp_set_post_terms($pnum, [intval($term)], $taxanomy); 269 } 269 270 270 271 } -
auto-podcast-import/trunk/readme.txt
r3243696 r3269556 7 7 Requires PHP: 7.4 8 8 Tested up to: 6.7.2 9 Stable tag: 1.0. 89 Stable tag: 1.0.10 10 10 Import your podcast feed, automatically from any supported podcast provider. 11 11 12 12 == Description == 13 13 14 Import Podcast feed is easy. 14 =Auto Podcast Import – The Easiest Way to Bring Podcasts into WordPress= 15 Have you ever wanted to automatically import podcast episodes into your WordPress site without jumping through hoops? If so, you're in the right place. 16 17 Auto Podcast Import is a simple, powerful plugin that helps you publish podcast episodes on your website—without the manual work. Whether you're a podcaster, blogger, or editor, this tool takes care of the repetitive stuff so you can focus on creating content. 15 18 16 19 17 Automatically Sync Podcast RSS Feeds with Your WordPress Website18 20 19 Introducing the Auto podcast import, your seamless solution for effortlessly importing podcasts into your WordPress site. Whether you want to integrate your podcast into regular WordPress posts or a custom post type of your choice (if you already have one set up), our plugin has you covered. 21 =What is Auto Podcast Import?= 22 Auto Podcast Import is a WordPress plugin that lets you bring podcast episodes straight into your site using an RSS feed. Once it's set up, it takes care of everything for you—automatically importing new episodes and publishing them as regular posts or custom post types. 23 You don’t need to upload audio files manually, create new posts, or copy-paste show notes. It just works. And because it’s designed to be lightweight, it won’t slow down your website. 20 24 21 Our plugin is fully compatible with popular podcasting platforms. 25 =Key Features= 26 Flexible Scheduling, You can set import schedules to match your release cycle—daily, weekly, monthly, or whenever works best for you. New episodes will show up on your site automatically. 22 27 23 With the Auto podcast import, you can import episodes into existing custom post types, and more. What's more, the plugin offers continuous import, or 'Sync,' of podcast RSS feeds. This means that every time you release a new podcast episode, it can be automatically generated within your WordPress site. You even have the flexibility to set multiple import schedules and import content from various podcasts originating from different sources simultaneously. For instance, you can import separate podcasts from distinct feeds into a single website effortlessly. 28 =Multiple Feeds, One Site= 29 Import episodes from different podcast feeds and have them all appear on a single WordPress site. Perfect if you’re running more than one show or curating podcasts from various sources. 24 30 25 To get started with the plugin, simply initiate a new import by navigating to 'Tools -> Auto podcast import' in the main menu of your WordPress dashboard. Configure your desired options, and if you want to ensure a continuous import process for future episodes, don't forget to check the appropriate box before starting the import process. Should you wish to discontinue a scheduled import, it's as easy as deleting the import entry. 31 =Custom Post Type Support= 32 Already using a custom post type for your podcast? No problem. The plugin works with your existing setup and gives you full control over how your content appears. 26 33 34 =Taxonomy and Organization= 35 You can set specific taxonomies for each feed, helping you organize and display your episodes however you want. 36 37 =Compatible with All the Big Platforms= 38 The plugin works with popular podcast hosting platforms like Libsyn, BuzzSprout, Transistor, Podbean, Apple Podcasts, Spotify, and SimpleCast. And if your provider isn’t on the list, the support team is open to adding it. 39 40 =How to Get Started= 41 Getting started is quick and easy: 42 - Go to your WordPress dashboard, click on “Tools,” then “Auto Podcast Import.” 43 - Start a new import and set your preferences. 44 - If you want the episodes to keep coming in automatically, just check the box for continuous sync. 45 - Click import—and that’s it. You’re all set. 46 - Need to stop an import later? Just delete it from the list. 27 47 28 48 49 =Why Use Auto Podcast Import?= 50 There are plenty of reasons to give this plugin a try: 51 - It saves you time. No more copying and pasting or uploading each episode by hand. 52 - It improves your SEO. Episodes are added as posts, which means better visibility in search engines. 53 - It works with your favorite platforms. You don’t have to switch providers or change how you publish. 54 - It’s simple. You don’t need to be a developer to use it. 29 55 30 == Supported feed == 31 1. Libsyn 32 2. Transistor 33 3. BuzzSprout 34 4. SimpleCast 35 5. Spotify 36 6. Podbean 37 7. Apple podcasts 56 57 58 If you're a podcaster or a content creator looking to simplify your workflow, Auto Podcast Import is the tool for you. It's reliable, easy to use, and totally free. Most importantly, it helps you spend less time managing your podcast—and more time creating it. 59 Download the plugin today and see how much easier podcasting can be with WordPress. 60 61 38 62 39 63 Please write to us if your provider not listed here. … … 55 79 56 80 == Changelog == 81 = 1.0.10 = 82 - Allow fetch duration from itunes feed 83 - Allow attach podcast post to taxonomy 84 - Allow set podcast date from publish date in feed 85 57 86 = 1.0.8 = 58 87 - Test on Wordpress 6.7.2
Note: See TracChangeset
for help on using the changeset viewer.