@@ 134-144 (lines=11) @@ | ||
131 | add_filter( 'wp_feed_cache_transient_lifetime' , array( $this, 'return_0' ) ); |
|
132 | $rss = fetch_feed( $feed_url ); |
|
133 | remove_filter( 'wp_feed_cache_transient_lifetime' , array( $this, 'return_0' ) ); |
|
134 | if ( is_wp_error( $rss ) ) { |
|
135 | $subject = '[' . get_bloginfo( 'name' ) . ']' . __( 'feed import failed', WPSYND_DOMAIN ); |
|
136 | $msg = sprintf( __( 'An error occurred at a feed retrieval of %s', WPSYND_DOMAIN ), $post->post_name ) . "\n". __( 'action time', WPSYND_DOMAIN ). ':' . date_i18n('Y/m/d:H:i:s') . "\n\n\n"; |
|
137 | $msg .= __( 'below error message', WPSYND_DOMAIN ) . "\n"; |
|
138 | $msg .= $rss->get_error_message()."\n\n"; |
|
139 | $msg .= __( 'feed URL', WPSYND_DOMAIN ) . ':' . $feed_url; |
|
140 | $error_post_id = WP_SYND_logger::get_instance()->error( $subject, $msg ); |
|
141 | $msg .= admin_url('/post.php?post=' . $error_post_id . '&action=edit'); |
|
142 | wp_mail( $options['error_mail'], $subject, $msg ); |
|
143 | return; |
|
144 | } |
|
145 | ||
146 | $url = parse_url($rss->get_base()); |
|
147 | $this->host = $url['host']; |
|
@@ 235-244 (lines=10) @@ | ||
232 | $msg .= __( 'below ID data updates', WPSYND_DOMAIN ) . "\n"; |
|
233 | $msg .= implode( "\n", $post_ids ); |
|
234 | WP_SYND_logger::get_instance()->success( $subject, $msg ); |
|
235 | } else { |
|
236 | $subject = '[' . get_bloginfo( 'name' ) . ']' . __( 'feed import failed', WPSYND_DOMAIN ); |
|
237 | $msg = __( 'feed URL:', WPSYND_DOMAIN ) . $feed_url . "\n"; |
|
238 | $msg .= sprintf( __( 'Failed to some data registration of %s', WPSYND_DOMAIN ), $post->post_name ) . "\n". __( 'action time', WPSYND_DOMAIN ). ':' . date_i18n('Y/m/d:H:i:s') . "\n\n\n"; |
|
239 | $msg .= __( 'below ID data updates', WPSYND_DOMAIN ) . "\n"; |
|
240 | $msg .= implode( "\n", $post_ids ); |
|
241 | $error_post_id = WP_SYND_logger::get_instance()->error( $subject, $msg ); |
|
242 | $msg .= admin_url('/post.php?post=' . $error_post_id . '&action=edit'); |
|
243 | wp_mail( $options['error_mail'], $subject, $msg ); |
|
244 | } |
|
245 | ||
246 | } |
|
247 |