Plugin Directory

Changeset 3269556


Ignore:
Timestamp:
04/09/2025 10:09:58 AM (12 months ago)
Author:
systemsrtk
Message:

v1.0.10

Location:
auto-podcast-import
Files:
30 added
6 edited

Legend:

Unmodified
Added
Removed
  • auto-podcast-import/trunk/assets/js/admin.js

    r3225063 r3269556  
    6060     });
    6161     
    62  });
     62});
     63
     64
     65jQuery(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
    63100
    64101jQuery(document).on('submit','.aupi_contact',function(e){
  • auto-podcast-import/trunk/auto-podcast-import.php

    r3243696 r3269556  
    44 * Plugin URI:        https://wordpress.org/plugins/auto-podcast-import/
    55 * Description:       Import your podcast feed, automatically from any supported podcast provider.
    6  * Version:           1.0.8
     6 * Version:           1.0.10
    77 * Requires at least: 6.1.0
    88 * Requires PHP:      7.4
     
    1616defined( 'ABSPATH' ) || exit;
    1717 
    18 define('AUPI_VER','1.0.8');
     18define('AUPI_VER','1.0.10');
    1919define('AUPI_SLUG','aupi');
    2020
  • auto-podcast-import/trunk/functions.php

    r3243696 r3269556  
    5454    return $ret;
    5555}
     56
     57/**
     58 * get registered taxonomies by post type (public)
     59 * 
     60 * @since 1.0.9
     61 *
     62 * @return array
     63 */
     64function 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 */
     90function 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}
    56117 
    57118
     
    98159            $r['feed_before_title'] = get_post_meta($feed->ID,'feed_before_title',true);
    99160            $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);
    100163            $r['force_update_posts'] = get_post_meta($feed->ID,'force_update_posts',true);
    101164            $r['insert_audio_player'] = get_post_meta($feed->ID,'insert_audio_player',true)=='yes' ? 'yes' : 'no';
     
    157220    $r['feed_before_title'] = get_post_meta($feed->ID,'feed_before_title',true);
    158221    $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);
    159224    $r['force_update_posts'] = get_post_meta($feed->ID,'force_update_posts',true);
    160225    $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  
    8686                $data['feed_url'] = \wp_kses_post($_POST['feed_url']);
    8787                $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']);
    8890                $data['post_status'] = \wp_kses_post($_POST['post_status']);
    8991                $data['recurrence'] = \wp_kses_post($_POST['recurrence']);
     
    484486        $vals['feed_url']='';
    485487        $vals['post_type']='';
     488        $vals['taxonomy']='';
     489        $vals['term']='';
    486490        $vals['post_status']='';
    487491        $vals['recurrence']='';
     
    493497
    494498        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);
    502508
    503509            $vals['force_update_posts']=\get_post_meta($id,'force_update_posts',true);
     
    508514   
    509515   
    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();
    511519
    512520        if(!$id){
     
    552560                                        echo '<option '.($r==$vals['post_type'] ? 'selected' : '').' value="'.esc_attr($r).'">'.esc_html($r).'</option>';
    553561                                    }
     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                                    }
    554592                                echo '</select>';
    555593                            echo '</td>';
     
    646684                echo '</table>';
    647685
    648 
    649            
    650              
    651 
    652686                echo '<div data-error="'.esc_attr__( 'Error, please try later.', 'aupi' ).'" data-ajaxing="'.esc_attr__( 'Saving settings, please wait!', 'aupi' ).'" class="aupi_ajaxing"></div>';
    653687
     
    656690
    657691        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
    660700    }
    661701
  • auto-podcast-import/trunk/inc/feed.php

    r3243696 r3269556  
    4747            $body     = \wp_remote_retrieve_body($response);
    4848            if(!empty($body)){
     49
    4950                $xml  = \simplexml_load_string($body);
     51
     52                $namespaces = $xml->getNamespaces(true);
     53
    5054                $xml = (array)$xml;
    51 
    52                  
    53                    
    5455
    5556                 
     
    6061                    $moreData['image']=[];
    6162                    foreach($xml['channel'] as $k=>$item ){
    62 
    63                        
    64  
    6563
    6664
     
    8179 
    8280                    foreach($xml['channel'] as $k=>$item ){
    83 
    84                      
    85 
    86 
    8781                        if($k=='item'){
     82
    8883                            $r=[];
    8984                            $r['title']  = \wp_kses_post((string)$item->title);
     
    9893                           
    9994                            $r['pubDate']  = (string)$item->pubDate;
     95                           
     96                            $r['duration']  = isset($namespaces['itunes']) ? (int) $item->children($namespaces['itunes'])->duration : 0;
     97
    10098                            $url = (array)$item->enclosure ;
    10199                            $r['url']  = !empty($url['@attributes']['url']) ? $url['@attributes']['url'] : '';
     
    182180            $post = \get_posts($args);
    183181
    184            
    185    
    186 
    187182            $metaToSave= [];
    188183            $metaToSave['aupi_feed_id'] =$this->feed['id'];
     
    194189            $metaToSave['aupi_audio'] = !empty($x['url']) ? wp_kses_post($x['url']) : '';
    195190            $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       
    198193            $metaToSave['aupi_image_url'] ='';
    199194            $metaToSave['aupi_image_title'] ='';
    200 
    201 
    202195
    203196
     
    228221                $args['post_title']= $feed_title;
    229222                $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               
    233226                $pnum = \wp_insert_post($args);
    234227               
     
    248241                    $args['post_title']= $feed_title;
    249242                    $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
    250245                    if(empty($args['post_content']) && !empty($x['description'])){
    251246                        $args['post_content']=wp_kses_post($x['description']);
     
    266261                    \update_post_meta($pnum,$k,$v);
    267262                }
    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                }
    269270
    270271            }
  • auto-podcast-import/trunk/readme.txt

    r3243696 r3269556  
    77Requires PHP: 7.4
    88Tested up to: 6.7.2
    9 Stable tag: 1.0.8
     9Stable tag: 1.0.10
    1010Import your podcast feed, automatically from any supported podcast provider.
    1111
    1212== Description ==
    1313
    14 Import Podcast feed is easy.
     14=Auto Podcast Import – The Easiest Way to Bring Podcasts into WordPress=
     15Have 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
     17Auto 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.
    1518
    1619
    17 Automatically Sync Podcast RSS Feeds with Your WordPress Website
    1820
    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?=
     22Auto 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.
     23You 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.
    2024
    21 Our plugin is fully compatible with popular podcasting platforms.
     25=Key Features=
     26Flexible 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.
    2227
    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=
     29Import 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.
    2430
    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=
     32Already 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.
    2633
     34=Taxonomy and Organization=
     35You 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=
     38The 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=
     41Getting 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.
    2747 
    2848
     49=Why Use Auto Podcast Import?=
     50There 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.
    2955
    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
     58If 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.
     59Download the plugin today and see how much easier podcasting can be with WordPress.
     60
     61
    3862
    3963Please write to us if your provider not listed here.
     
    5579
    5680== 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
    5786= 1.0.8 =
    5887- Test on Wordpress 6.7.2
Note: See TracChangeset for help on using the changeset viewer.