Plugin Directory

Changeset 2335901


Ignore:
Timestamp:
07/06/2020 08:23:48 AM (6 years ago)
Author:
podigee
Message:

fixed rare bug where only the first line of the feed would be read

Location:
podigee
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • podigee/tags/1.1/podigee-quick-publish.php

    r2329267 r2335901  
    55* Description: Let's you import metadata from your Podigee podcast feed right into the Wordpress post editor. Now also compatible to Gutenberg. Developed for Podigee by Jürgen Krauß (https://www.es-ist-ein-krauss.de/).
    66* Text Domain: podigee-quick-publish
    7 * Version:     1.0
     7* Version:     1.1
    88* Author:      Podigee
    99* Author URI:  https://podigee.com
     
    229229    global $_PFEX_DEBUG;
    230230    if( !session_id() ) session_start();
     231    if (isset($_GET['pfex-debug'])) $_SESSION = $_GET['pfex-debug'];
    231232    if (isset($_SESSION['pfex-debug']) && $_SESSION['pfex-debug'] == "1") $_PFEX_DEBUG = $_SESSION['pfex-debug'];
    232233}
     
    492493        if ($_PFEX_DEBUG) pfex_log(true, "DOMdocument exists –> using it.");
    493494        $rss = new DOMDocument();
    494         @$rss->load($url);
     495        @$rss->loadXML(pfex_url_get_contents($url));
    495496        $feed = array();
    496497        //echo $url."<br />";
     
    538539            if ($_PFEX_DEBUG) pfex_log(true, "SimpleXML worked and retrieved ".count($feed)." feed entries.", array("url" => $url));
    539540        } catch (Exception $e) {
    540             if ($_PFEX_DEBUG) pfex_log(true, "SimpleXML threw an error.", array("error" => $e));
     541            if ($_PFEX_DEBUG) pfex_log(false, "SimpleXML threw an error.", array("error" => $e));
    541542            wp_die('error');
    542543        }
     
    623624
    624625/*
     626* Had to add this download function to fix the few cases in which the XML would return empty.
     627*/
     628function pfex_url_get_contents ($Url) {
     629    if (!function_exists('curl_init')){
     630        pfex_log(false, "CURL is not installed – try using file_get_contents instead");
     631        return file_get_contents(($url));
     632    }
     633    $ch = curl_init();
     634    curl_setopt($ch, CURLOPT_URL, $Url);
     635    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     636    $output = curl_exec($ch);
     637    curl_close($ch);
     638    return $output;
     639}
     640
     641/*
    625642* This is the class for our custom table that displays the feed items.
    626643*/
  • podigee/tags/1.1/readme.txt

    r2329267 r2335901  
    55Tested up to: 5.4.2
    66Requires PHP: 5.2.4
    7 Stable tag: 1.0
     7Stable tag: 1.1
    88License:     MIT License
    99License URI: https://opensource.org/licenses/MIT
     
    7474 
    7575== Changelog ==
     76= 1.1 =
     77* Fixed rare error where plugin would only read the first line of a podcast feed
     78
    7679= 1.0 =
    7780* Added backend menu item
  • podigee/trunk/podigee-quick-publish.php

    r2329267 r2335901  
    55* Description: Let's you import metadata from your Podigee podcast feed right into the Wordpress post editor. Now also compatible to Gutenberg. Developed for Podigee by Jürgen Krauß (https://www.es-ist-ein-krauss.de/).
    66* Text Domain: podigee-quick-publish
    7 * Version:     1.0
     7* Version:     1.1
    88* Author:      Podigee
    99* Author URI:  https://podigee.com
     
    229229    global $_PFEX_DEBUG;
    230230    if( !session_id() ) session_start();
     231    if (isset($_GET['pfex-debug'])) $_SESSION = $_GET['pfex-debug'];
    231232    if (isset($_SESSION['pfex-debug']) && $_SESSION['pfex-debug'] == "1") $_PFEX_DEBUG = $_SESSION['pfex-debug'];
    232233}
     
    492493        if ($_PFEX_DEBUG) pfex_log(true, "DOMdocument exists –> using it.");
    493494        $rss = new DOMDocument();
    494         @$rss->load($url);
     495        @$rss->loadXML(pfex_url_get_contents($url));
    495496        $feed = array();
    496497        //echo $url."<br />";
     
    538539            if ($_PFEX_DEBUG) pfex_log(true, "SimpleXML worked and retrieved ".count($feed)." feed entries.", array("url" => $url));
    539540        } catch (Exception $e) {
    540             if ($_PFEX_DEBUG) pfex_log(true, "SimpleXML threw an error.", array("error" => $e));
     541            if ($_PFEX_DEBUG) pfex_log(false, "SimpleXML threw an error.", array("error" => $e));
    541542            wp_die('error');
    542543        }
     
    623624
    624625/*
     626* Had to add this download function to fix the few cases in which the XML would return empty.
     627*/
     628function pfex_url_get_contents ($Url) {
     629    if (!function_exists('curl_init')){
     630        pfex_log(false, "CURL is not installed – try using file_get_contents instead");
     631        return file_get_contents(($url));
     632    }
     633    $ch = curl_init();
     634    curl_setopt($ch, CURLOPT_URL, $Url);
     635    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     636    $output = curl_exec($ch);
     637    curl_close($ch);
     638    return $output;
     639}
     640
     641/*
    625642* This is the class for our custom table that displays the feed items.
    626643*/
  • podigee/trunk/readme.txt

    r2329267 r2335901  
    55Tested up to: 5.4.2
    66Requires PHP: 5.2.4
    7 Stable tag: 1.0
     7Stable tag: 1.1
    88License:     MIT License
    99License URI: https://opensource.org/licenses/MIT
     
    7474 
    7575== Changelog ==
     76= 1.1 =
     77* Fixed rare error where plugin would only read the first line of a podcast feed
     78
    7679= 1.0 =
    7780* Added backend menu item
Note: See TracChangeset for help on using the changeset viewer.