I am using fetch_feed and basically have the same code as the great example provided here but I am creating new posts from the content instead of displaying it afterwards. The errors I am seeing are:
Warning: include_once(ABSPATHWPINC/feed.php) [function.include-once]: failed to open stream: No such file or directory in /home/user/public_html/test/wp-content/plugins/rss-plugin/rss-plugin-scan.php on line 6
Warning: include_once() [function.include]: Failed opening 'ABSPATHWPINC/feed.php' for inclusion (include_path='.:/opt/php53/lib/php') in /home/user/public_html/test/wp-content/plugins/rss-plugin/rss-plugin-scan.php on line 6
Fatal error: Call to undefined function fetch_feed() in /home/user/public_html/test/wp-content/plugins/rss-plugin/rss-plugin-scan.php on line 9
Line 6 is the first statement:
include_once( ABSPATH . WPINC . '/feed.php' );
and line 9 (the second statement) from my scan file is:
$rss = fetch_feed( 'http://www.website.com/rss' );
I have been digging around but the few posts I found that were similar on wordpress.org were not resolved or never answered. One fix I see when searching is to make sure there is no wp_error but I am already using the code from the codex example which includes this.
if ( ! is_wp_error( $rss ) ) : // Checks that the object is created correctly
I am loading the rss-plugin-scan.php file using this method:
<?php
$plugin_location = plugins_url();
$scan_url = $plugin_location . '/rss-plugin/rss-plugin-scan.php';
?>
<a href="<?php echo $scan_url ?>?scan=true&source=<?php echo $feed_source;?>"><b>Scan Now!</b></a>
Is there any reason why this would work perfectly within my index page every time I reloaded it but not within this plugin/wp-admin?