Plugin Directory

Changeset 2971944


Ignore:
Timestamp:
09/26/2023 05:30:52 PM (2 years ago)
Author:
libsyn
Message:

changes for version 1.4.4

Location:
libsyn-podcasting/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • libsyn-podcasting/trunk/admin/config.php

    r2584186 r2971944  
    1010
    1111function uninstall() {
    12 /*
    13     global $wpdb;
    14 
    15     $meta_query = "DELETE FROM $wpdb->postmeta WHERE meta_key LIKE '" . LIBSYN_NS . "%';";
    16     $option_query = "DELETE FROM $wpdb->options WHERE option_name LIKE '" . LIBSYN_NS . "%';";
    17     $post_query = "DELETE FROM $wpdb->posts WHERE post_type = 'jw_playlist';";
    18 
    19     $wpdb->query($meta_query);
    20     $wpdb->query($option_query);
    21     $wpdb->query($post_query);
    22 
    23     @unlink(LongTailFramework::getPlayerPath());
    24     @unlink(LongTailFramework::getEmbedderPath());
    25     @rmdir(JWPLAYER_FILES_DIR . "/player/");
    26 
    27     $handler = @opendir(JWPLAYER_FILES_DIR . "/configs");
    28     if ($handler) {
    29     while ($file = readdir($handler)) {
    30       if ($file != "." && $file != ".." && strstr($file, ".xml")) {
    31         @unlink(JWPLAYER_FILES_DIR . "/configs/$file");
    32       }
    33     }
    34     closedir($handler);
    35     }
    36     @rmdir(JWPLAYER_FILES_DIR . "/configs/");
    37     @rmdir(JWPLAYER_FILES_DIR);
    38 
    39     update_option(LIBSYN_NS . "uninstalled", true);
    40     feedback_message(__('Files and settings deleted.  The plugin can now be deactivated.', 'jw-player-plugin-for-wordpress'));
    41 */
     12/* Run uninstall*/
    4213}
    4314
  • libsyn-podcasting/trunk/admin/functions.php

    r2951699 r2971944  
    706706    add_filter('query_vars','Libsyn\\Ajax::plugin_add_trigger_load_form_data');
    707707    add_action('wp_ajax_load_libsyn_media', 'Libsyn\\Post::loadFormData');
    708     add_action('wp_ajax_nopriv_load_libsyn_media', 'Libsyn\\Post::loadFormData');
    709708
    710709    //post remove ftp unreleased ajax
    711710    add_filter('query_vars','Libsyn\\Ajax::plugin_add_trigger_remove_ftp_unreleased');
    712711    add_action('wp_ajax_remove_ftp_unreleased', 'Libsyn\\Post::removeFTPUnreleased');
    713     add_action('wp_ajax_nopriv_remove_ftp_unreleased', 'Libsyn\\Post::removeFTPUnreleased');
    714712
    715713    //post add custom postmeta (for block editor)
    716714    add_filter('query_vars','Libsyn\\Ajax::plugin_add_trigger_update_libsyn_postmeta');
    717715    add_action('wp_ajax_update_libsyn_postmeta', 'Libsyn\\Post::updateLibsynPostmeta');
    718     add_action('wp_ajax_nopriv_update_libsyn_postmeta', 'Libsyn\\Post::updateLibsynPostmeta');
    719716
    720717    //post form player settings dialog ajax
    721718    add_filter('query_vars','Libsyn\\Ajax::plugin_add_trigger_load_player_settings');
    722719    add_action('wp_ajax_load_player_settings', 'Libsyn\\Post::loadPlayerSettings');
    723     add_action('wp_ajax_nopriv_load_player_settings', 'Libsyn\\Post::loadPlayerSettings');
    724720
    725721    //get player shortcode ajax
     
    731727    add_filter('query_vars', 'Libsyn\\Ajax::plugin_add_trigger_libsyn_check_ajax');
    732728    add_action( 'wp_ajax_libsyn_check_url', 'Libsyn\\Ajax::checkAjax' );
    733     add_action( 'wp_ajax_nopriv_libsyn_check_url', 'Libsyn\\Ajax::checkAjax' );
    734729
    735730    //phpinfo debug_log ajax
    736731    add_filter('query_vars', 'Libsyn\\Ajax::plugin_add_trigger_libsyn_phpinfo');
    737732    add_action( 'wp_ajax_libsyn_phpinfo', 'Libsyn\\Utilities::getPhpinfo' );
    738     add_action( 'wp_ajax_nopriv_libsyn_phpinfo', 'Libsyn\\Utilities::getPhpinfo' );
    739733
    740734    //plugins list debug_log ajax
    741735    add_filter('query_vars', 'Libsyn\\Ajax::plugin_add_trigger_libsyn_debuginfo');
    742736    add_action( 'wp_ajax_libsyn_debuginfo', 'Libsyn\\Utilities::logPluginData' );
    743     add_action( 'wp_ajax_nopriv_libsyn_debuginfo', 'Libsyn\\Utilities::logPluginData' );
    744737
    745738    //powerpress feed import loader ajax
    746739    add_filter('query_vars', 'Libsyn\\Ajax::plugin_add_trigger_libsyn_pploadfeed');
    747740    add_action( 'wp_ajax_libsyn_pploadfeed', 'Libsyn\\Utilities::loadPPFeed' );
    748     add_action( 'wp_ajax_nopriv_libsyn_pploadfeed', 'Libsyn\\Utilities::loadPPFeed' );
    749741
    750742    //oauth settings save
    751743    add_filter('query_vars', 'Libsyn\\Ajax::plugin_add_trigger_libsyn_oauth_settings');
    752744    add_action( 'wp_ajax_libsyn_oauth_settings', 'Libsyn\\Utilities::saveOauthSettings' );
    753     add_action( 'wp_ajax_nopriv_libsyn_oauth_settings', 'Libsyn\\Utilities::saveOauthSettings' );
    754745
    755746    //clear settings
    756747    add_filter('query_vars', 'Libsyn\\Ajax::plugin_add_trigger_libsyn_update_oauth_settings');
    757748    add_action( 'wp_ajax_libsyn_update_oauth_settings', 'Libsyn\\Utilities::updateOauthSettings' );
    758     add_action( 'wp_ajax_nopriv_libsyn_update_oauth_settings', 'Libsyn\\Utilities::updateOauthSettings' );
    759749
    760750    //create WP Post
    761751    add_filter('query_vars', 'Libsyn\\Ajax::plugin_add_trigger_libsyn_create_new_post');
    762752    add_action( 'wp_ajax_libsyn_create_new_post', 'Libsyn\\Service\\Importer::createPostAjax' );
    763     add_action( 'wp_ajax_nopriv_libsyn_create_new_post', 'Libsyn\\Service\\Importer::createPostAjax' );
    764753
    765754    //create metadata
    766755    add_filter('query_vars', 'Libsyn\\Ajax::plugin_add_trigger_libsyn_create_metadata');
    767756    add_action( 'wp_ajax_libsyn_create_metadata', 'Libsyn\\Service\\Importer::createMetadataAjax' );
    768     add_action( 'wp_ajax_nopriv_libsyn_create_metadata', 'Libsyn\\Service\\Importer::createMetadataAjax' );
    769757
    770758    //create metadata
    771759    add_filter('query_vars', 'Libsyn\\Ajax::plugin_add_trigger_libsyn_add_player');
    772760    add_action( 'wp_ajax_libsyn_add_player', 'Libsyn\\Service\\Importer::addPlayerAjax' );
    773     add_action( 'wp_ajax_nopriv_libsyn_add_player', 'Libsyn\\Service\\Importer::addPlayerAjax' );
    774761
    775762    //imports data
    776763    add_filter('query_vars', 'Libsyn\\Ajax::plugin_add_trigger_libsyn_run_import');
    777764    add_action( 'wp_ajax_libsyn_run_import', 'Libsyn\\Service\\Importer::importAjax' );
    778     add_action( 'wp_ajax_nopriv_libsyn_run_import', 'Libsyn\\Service\\Importer::importAjax' );
    779765
    780766    /* Add Uninstall Hook */
  • libsyn-podcasting/trunk/admin/lib/Libsyn.php

    r2960268 r2971944  
    44    protected $text_dom = LIBSYN_TEXT_DOMAIN;
    55    protected $plugin_name = "Libsyn/Wordpress";
    6     protected $plugin_version = "1.4.3";
     6    protected $plugin_version = "1.4.4";
    77    protected $api_table_name = "libsyn_podcast_plugin";
    88    protected $api_base_uri = "https://api.libsyn.com";
  • libsyn-podcasting/trunk/admin/lib/Libsyn/Api.php

    r2213760 r2971944  
    6161
    6262        //first check to see if we need to make the call
    63         if(strtotime($this->refresh_token_expires) >= strtotime("+87 days 23 hours 59 minutes")) return true;
     63        if ( empty($this->refresh_token_expires) || strtotime($this->refresh_token_expires) >= strtotime("+87 days 23 hours 59 minutes") ) return true;
    6464        /*
    6565        add_action('http_api_curl', function( $handle ){
  • libsyn-podcasting/trunk/admin/lib/Libsyn/Post.php

    r2951699 r2971944  
    20992099                $wpdb->delete($wpdb->prefix . 'posts', array('post_mime_type' => 'audio/ftp-unreleased'));
    21002100                $wpdb->delete($wpdb->prefix . 'posts', array('post_mime_type' => 'video/ftp-unreleased'));
    2101                 $wpdb->query($wpdb->prepare("DELETE FROM ".$wpdb->prefix."postmeta WHERE meta_value LIKE %s", "\"%libsyn/ftp-unreleased%\""));
     2101                $wpdb->query(
     2102                    $wpdb->prepare(
     2103                        "DELETE FROM %i WHERE meta_value LIKE %s",
     2104                        [ $wpdb->prefix . 'postmeta', '%libsyn/ftp-unreleased%' ]
     2105                    )
     2106                );
    21022107            } catch ( Exception $e ) {
    21032108                $plugin = new Service();
  • libsyn-podcasting/trunk/admin/lib/Libsyn/Service.php

    r2951699 r2971944  
    881881        );
    882882        $lastId = $wpdb->insert_id;
    883         $data = $wpdb->get_results("SELECT * FROM $api_table_name WHERE plugin_api_id = $lastId AND is_active = 1");
     883        $data = $wpdb->get_results(
     884            $wpdb->prepare(
     885                "SELECT * FROM %i WHERE plugin_api_id = %d AND is_active = %d",
     886                [ $api_table_name, $lastId, 1 ]
     887            )
     888        );
    884889        if ( $this->hasLogger ) $this->logger->info("Service:\tcreateLibsynApi:\tCreating New Libsyn API");
    885890        return new \Libsyn\Api($data[0]);
     
    898903    public function getApi() {
    899904        global $wpdb;
    900         $usersmetaTable = $wpdb->get_var("SHOW TABLES LIKE \"{$wpdb->prefix}usermeta\"");
     905        $usersmetaTable = $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE %s", $wpdb->prefix . 'usermeta' ) );
    901906        if ( empty($usersmetaTable) ) { //Check table name without prefix (could be multisite)
    902907            $prefix_modified = str_replace('__', '_', preg_replace('/\d/', '', $wpdb->prefix));
    903             $usersmetaTable = $wpdb->get_var("SHOW TABLES LIKE \"{$prefix_modified}usermeta\"");
     908            $usersmetaTable = $wpdb->get_var( $wpdb->prepare( "SHOW TABLES LIKE %s", $prefix_modified . 'usermeta' ) );
    904909        }
    905910
    906911        $apiUserId = get_option('libsyn_podcasting_wp_user_id');
    907         if ( !$apiUserId ) {
    908             $userIdSearch = "";
    909         } else {
    910             $userIdSearch = " AND user_id={$apiUserId}";
    911         }
    912912
    913913        if ( !empty($usersmetaTable) ) {
     
    930930
    931931                if ( empty($results) || empty(maybe_unserialize($results)) ) {
    932                     $results = $wpdb->get_var("SELECT meta_value FROM {$usersmetaTable} WHERE meta_key=\"{$meta_key_prefixed}\" OR meta_key=\"{$meta_key}\"{$userIdSearch} LIMIT 1");
     932
     933                    if ( !$apiUserId ) {
     934                        $userIdSearch = $wpdb->prepare(
     935                            "SELECT meta_value FROM %i WHERE meta_key = %s OR meta_key = %s LIMIT 1",
     936                            [ $usersmetaTable, $meta_key_prefixed, $meta_key ]
     937                        );
     938                    } else {
     939                        $userIdSearch = $wpdb->prepare(
     940                            "SELECT meta_value FROM %i WHERE meta_key = %s OR meta_key = %s AND user_id = %d LIMIT 1",
     941                            [ $usersmetaTable, $meta_key_prefixed, $meta_key, $apiUserId ]
     942                        );
     943                    }
     944
     945                    $results = $wpdb->get_var( $userIdSearch );
    933946                }
    934947
    935948                if ( empty($results) || empty(maybe_unserialize($results)) ) {
    936                     $results = $wpdb->get_var("SELECT meta_value FROM {$wpdb->usermeta} WHERE meta_key LIKE '%{$meta_key}'");
     949                    $results = $wpdb->get_var(
     950                        $wpdb->prepare(
     951                            "SELECT meta_value FROM %i WHERE meta_key LIKE %s",
     952                            [ $wpdb->usermeta, '%' . $wpdb->esc_like($meta_key) ]
     953                        )
     954                    );
    937955                }
    938956
     
    949967                $meta_key = $this->getApiTableName();
    950968                $meta_key_prefixed = $wpdb->prefix . $meta_key;
    951                 $results = $wpdb->get_var("SELECT meta_value FROM {$wpdb->usermeta} WHERE meta_key LIKE \"%{$meta_key}\"");
     969                $results = $wpdb->get_var(
     970                    $wpdb->prepare(
     971                        "SELECT meta_value FROM %i WHERE meta_key LIKE %s",
     972                        [ $wpdb->usermeta, '%' . $wpdb->esc_like( $meta_key ) ]
     973                    )
     974                );
    952975
    953976                if ( empty($results) ) {
     
    11391162        try {
    11401163            $results = $wpdb->get_results(
    1141                 $wpdb->prepare("SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_key='libsyn-item-id' AND meta_value='%d'", $this->sanitize->itemId($itemId))
     1164                $wpdb->prepare(
     1165                    "SELECT post_id FROM %i WHERE meta_key = 'libsyn-item-id' AND meta_value = '%d'",
     1166                    [ $wpdb->prefix . 'postmeta', $this->sanitize->itemId($itemId) ]
     1167                )
    11421168            );
    11431169        } catch (Exception $e) {
  • libsyn-podcasting/trunk/admin/lib/Libsyn/Service/Sanitize.php

    r2584186 r2971944  
    246246            $safe_itunesSubscriptionUrl = esc_url_raw($itunesSubscriptionUrl);
    247247        } else $safe_itunesSubscriptionUrl = '';
     248        return $safe_itunesSubscriptionUrl;
    248249    }
    249250
  • libsyn-podcasting/trunk/admin/lib/Libsyn/Utilities.php

    r2951699 r2971944  
    494494        if ( !empty($api_table_name) ) {
    495495            try {
    496                 $wpdb->query( "DROP TABLE IF EXISTS ".$api_table_name ); //old without prefix
    497                 $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}".$api_table_name );
     496                $wpdb->query( $wpdb->prepare( "DROP TABLE IF EXISTS %i", $api_table_name ) ); //old without prefix
     497                $wpdb->query( $wpdb->prepare( "DROP TABLE IF EXISTS %i", $wpdb->prefix . $api_table_name ) );
    498498            } catch( Exception $e ) {
    499499                if ( $plugin->hasLogger ) $plugin->logger->error("Utilities::uninstallSettings:\t" . $e);
     
    580580        global $wp;
    581581        return add_query_arg( $_SERVER['QUERY_STRING'], '', home_url( $wp->request ) );
    582     }
    583 
    584     /**
    585      * Takes an __PHP_Incomplete_Class and casts it to a stdClass object.
    586      * All properties will be made public in this step.
    587      *
    588      * @since  1.0.1.6
    589      * @param  object $object __PHP_Incomplete_Class
    590      *
    591      * @return object
    592      */
    593     function fixObject( $object ) {
    594         // preg_replace_callback handler. Needed to calculate new key-length.
    595         $fix_key = create_function(
    596             '$matches',
    597             'return ":" . strlen( $matches[1] ) . ":\"" . $matches[1] . "\"";'
    598         );
    599 
    600         // 1. Serialize the object to a string.
    601         $dump = serialize( $object );
    602 
    603         // 2. Change class-type to 'stdClass'.
    604         $dump = preg_replace( '/^O:\d+:"[^"]++"/', 'O:8:"stdClass"', $dump );
    605 
    606         // 3. Make private and protected properties public.
    607         $dump = preg_replace_callback( '/:\d+:"\0.*?\0([^"]+)"/', $fix_key, $dump );
    608 
    609         // 4. Unserialize the modified object again.
    610         return unserialize( $dump );
    611582    }
    612583
     
    775746                    "
    776747                    SELECT DISTINCT     meta_value
    777                     FROM                {$wpdb->postmeta} AS pm
    778                     JOIN                {$wpdb->posts} AS p ON pm.post_id = p.ID
     748                    FROM                %i AS pm
     749                    JOIN                %i AS p ON pm.post_id = p.ID
    779750                    WHERE               meta_key = %s
    780751                    AND                 post_status = 'publish'
     
    782753                    ORDER BY            meta_value ASC
    783754                    ",
    784                     array($postMeta_key, $postMeta_value)
     755                    [ $wpdb->postmeta, $wpdb->posts, $postMeta_key, $postMeta_value ]
    785756                )
    786757            );
     
    10301001    public function get_id_from_guid( $guid ){
    10311002        global $wpdb;
    1032         return $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid=%s", $guid ) );
     1003        return $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM %i WHERE guid = %s", [ $wpdb->posts, $guid ] ) );
    10331004    }
    10341005
  • libsyn-podcasting/trunk/admin/settings.php

    r2584186 r2971944  
    13521352                                    text: "Clear Settings",
    13531353                                    click: function(){
     1354                                        $('#clientId').removeAttr('required');
     1355                                        $('#clientSecret').removeAttr('required');
    13541356                                        $("select[name^='showSelect']").removeAttr('required');
    13551357                                        $('#<?php echo LIBSYN_NS . 'form'; ?>').append('<input type="hidden" name="clear-settings-data" value="<?php echo time(); ?>" />');
  • libsyn-podcasting/trunk/libsyn-podcasting.php

    r2960268 r2971944  
    55 * Description:       Post or edit Libsyn Podcast episodes directly through Wordpress.
    66 * Tags:              libsyn, podcast, podcasting, audio, video, liberated syndication, publisher hub, hosting
    7  * Version:           1.4.3
     7 * Version:           1.4.4
    88 * Requires PHP:      7.4
    9  * Requires at least: 5.6
     9 * Requires at least: 5.1
    1010 * Tested up to:      6.3.1
    1111 * Author:            Libsyn
  • libsyn-podcasting/trunk/readme.txt

    r2960268 r2971944  
    22Contributors: libsyn
    33Tags: libsyn publisher hub, libsyn podcasting, libsyn publishing, libsyn, podcast, podcasting, audio, video, liberated syndication, hosting, libsyn podcast plugin, libsin, libsun, libson
    4 Requires at least: 5.6
     4Requires at least: 5.1
    55Requires PHP: 7.4
    66Tested up to: 6.3.1
    7 Stable tag: 1.4.3
     7Stable tag: 1.4.4
    88License: GPLv3 or later
    99Author URI: https://help.libsynsupport.com/hc/en-us/articles/360041220971-Installing-Configuring-the-Libsyn-Publisher-Hub-WordPress-Plugin
     
    5757== Changelog ==
    5858
     59= 1.4.4 =
     60* Testing up to Wordpress 6.3.1
     61* Changes to some of the ajax calls
     62* Updates for plugin security
     63
    5964= 1.4.2 =
    6065* Testing up to Wordpress 6.3
Note: See TracChangeset for help on using the changeset viewer.