[wp-trac] [WordPress Trac] #43357: SimplePie deprecated calls modified

WordPress Trac noreply at wordpress.org
Fri Apr 24 02:12:56 UTC 2020


#43357: SimplePie deprecated calls modified
----------------------------------------+-----------------------------
 Reporter:  arena                       |       Owner:  (none)
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  Future Release
Component:  Feeds                       |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+-----------------------------

Comment (by arena):

 I am using simplepie within wordpress several times a day with my plugin
 dashpress.
 Current version is 4.1, but since 3.9 (hereunder extract of readme.txt)

 {{{
  3.9            2018/02/19 several improvements
    * new thumbnail search with extended SimplePie Item class
    * changing deprecated calls of SimplePie extended classes

 }}}

 and here is my code in plugin :

 {{{#!php
 <?php
 if ( !class_exists( 'SimplePie', false ) ) require_once( ABSPATH . WPINC .
 '/class-simplepie.php' );

 require_once( ABSPATH . WPINC . '/class-wp-feed-cache.php' );
 require_once( ABSPATH . WPINC . '/class-wp-feed-cache-transient.php' );
 require_once( ABSPATH . WPINC . '/class-wp-simplepie-file.php' );
 require_once( ABSPATH . WPINC . '/class-wp-simplepie-sanitize-kses.php' );

 $feed = new SimplePie();

 $feed->set_cache_duration( $options['caching'] ?? 43200 );

 $feed->registry->register( 'Cache', 'WP_Feed_Cache',     true );
 $feed->registry->register( 'File',  'WP_SimplePie_File', true );

 // this one is specific to plugin
 $feed->registry->register( 'Item', 'DBP_SimplePie_Item', true );


 }}}


 and finally, there is a patch attached to this ticket






 Replying to [comment:6 desrosj]:
 > Hi @arena,
 >
 > Thanks for reporting this! My apologies it took a while for someone to
 get around to it.
 >
 > It appears that the documentation linked above is out of date, but the
 initial premise of the ticket is still correct.
 >
 > Updating the SimplePie library is being tackled in #36669, hopefully for
 5.5. I am going to wait for that to be completed before making these
 changes so they can be verified and tested against the latest version in
 WordPress.
 >
 > There also should be unit tests to ensure the WordPress specific classes
 are correctly registered in SimplePie using the new registry. If you are
 able to write those, that would help move this along.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43357#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list