better debugging
Peter Molnar hello@petermolnar.eu
Tue, 08 Mar 2016 13:37:52 +0000
2 files changed,
13 insertions(+),
8 deletions(-)
M
readme.txt
→
readme.txt
@@ -3,8 +3,8 @@ Contributors: cadeyrn
Donate link: https://paypal.me/petermolnar/3 Tags: RSS, feed, featured image, attachment Requires at least: 3.0 -Tested up to: 4.4 -Stable tag: 0.1 +Tested up to: 4.4.2 +Stable tag: 0.1.1 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html Required minimum PHP version: 5.3@@ -31,6 +31,11 @@
* every A. indicates BIG changes. * every .B version indicates new features. * every ..C indicates bugfixes for A.B version. + += 0.1.1 = +*2016-03-08* + +* better debugging = 0.1 = *2015-12-14*
M
wp-featured2rss.php
→
wp-featured2rss.php
@@ -3,7 +3,7 @@ /*
Plugin Name: wp-featured2rss Plugin URI: https://github.com/petermolnar/wp-featured2rss Description: WordPress plugin to add featured image to RSS feed as attachment (which WordPress doesn't do by default) -Version: 0.1 +Version: 0.1.1 Author: Peter Molnar <hello@petermolnar.eu> Author URI: http://petermolnar.eu/ License: GPLv3@@ -52,7 +52,7 @@ public static function insert_enclosure_image ( ) {
$post = static::fix_post(); - //static::debug('insterting featured image to rss'); + static::debug('insterting featured image to rss',7); if ($post === false ) return false;@@ -79,10 +79,10 @@ }
arsort($candidates); foreach ($candidates as $potential => $maxsize ) { - //static::debug('checking size ' . $potential . ': ' . $meta['sizes'][$potential]['file'] . ' vs ' .$meta['file'] ); + static::debug('checking size ' . $potential . ': ' . $meta['sizes'][$potential]['file'] . ' vs ' .$meta['file'], 7 ); if (isset($meta['sizes'][$potential]) && isset($meta['sizes'][$potential]['file']) && $meta['sizes'][$potential]['file'] != $meta['file']) { - //static::debug( $meta['sizes'][$potential]['file'] . ' look like a resized file, using it'); + static::debug( $meta['sizes'][$potential]['file'] . ' look like a resized file, using it', 7); $asize = $potential; $img = wp_get_attachment_image_src( $thid, $potential ); break;@@ -172,7 +172,7 @@
// in case WordPress debug log has a minimum level if ( defined ( 'WP_DEBUG_LEVEL' ) ) { $wp_level = $levels [ WP_DEBUG_LEVEL ]; - if ( $level_ < $wp_level ) { + if ( $level_ > $wp_level ) { return false; } }@@ -213,4 +213,4 @@ }
$WP_FEATURED2RSS = new WP_FEATURED2RSS(); -endif;+endif;