Jonathan Goldford
Forum Replies Created
-
Forum: Plugins
In reply to: [Comment Email Reply] Sends Email Before ApprovalI’m glad to hear the code was helpful for everyone. @kilozwo, let me know if there is anything else I can do to help.
As far as building out the plugin, the only other big suggestion I’d have is adding a very simple settings page that allows people to adjust the content of the email, as well as the from name and email address. It would also be awesome if you could send a test email.
Forum: Plugins
In reply to: [Comment Email Reply] Sends Email Before ApprovalThat’s no good. Did you change the email address listed on line 15 to one within your domain? Otherwise, it might be marked as spam.
Also, it’s worth mentioning that you have to approve the comment reply before the email will be sent.
If you’ve done both of those then you may want to talk to your host to make sure the emails aren’t being blocked for some reason.
Forum: Plugins
In reply to: [Comment Email Reply] Sends Email Before ApprovalThanks. I noticed that too. If you look at my post now I linked to a gist, which is much easier to read.
Forum: Plugins
In reply to: [Comment Email Reply] Sends Email Before ApprovalNo problem @eh9116. Here is the code we came up with:
https://gist.github.com/jg314/a3b0c7e442e3ba283c84
I hope it’s helpful. Good luck.
Us as well. Subscribing to this thread.
Great suggestion. I think we’ll leave it as is since every site that pulls a feed only has one, but this is another awesome resource.
Thanks a ton for the help. I really appreciate the great support and I made sure to leave a positive plugin review for you all.
I’ll go ahead and mark this resolved.
Awesome. Thanks a ton for the help. This should keep us from showing old events that have already passed.
The other issue we were concerned about was if someone updates the title of an event, which happens regularly. This isn’t then reflected in the stored feed item. This might also be an issue if the date is updated as well. To deal with this we added the following code in functions.php:
<?php
add_action( 'wprss_fetch_all_feeds_hook', 'wi_delete_all_feed_items', 1 ); //Priority 1 so feed items are all deleted before they're fetched.
function wi_delete_all_feed_items(){
$args = array(
'post_type' => 'wprss_feed_item',
'post_status' => array( 'publish', 'future' ),
'cache_results' => false, // Disable caching, used for one-off queries
'fields' => 'ids', // Returns post IDs only
'posts_per_page' => -1,
);
$feed_item_ids = get_posts( $args );
foreach( $feed_item_ids as $feed_item_id ) {
$purge = wp_delete_post( $feed_item_id, true ); // delete the feed item, skipping trash
}
wp_reset_postdata();
wprss_log( sprintf( 'All feed items deleted: %1$d', count($feed_item_ids) ), __FUNCTION__, WPRSS_LOG_LEVEL_INFO );
}
?>
We adapted this from a function within the plugin and it deletes all of the feed items before every fetch, ensuring the events are always accurate.
Aside from the concern of running this too frequently, do you see any issues with this approach? I think we’re almost there so thanks again.
Jonathan
Thanks a ton for the help. Would you mind telling me exactly what you would put for the settings? The two that seem relevant are “Limit feed items by age” and “Feed processing interval”. Are those the two we should be looking at?
As for “Limit feed items by age”, what if each post in the RSS feed is in the future, such as the events we’re trying to list? Will they ever be deleted, even if we set it to 1 or 0 days?
Thanks again.
Hi, I wanted to follow up on my last response to see if you all have had a chance to look at it.
Also, I talked with our client and they’re happy to pay for support if that would allow us to get a faster response.
Thanks a ton and I hope you’re having a good week.
Forum: Plugins
In reply to: [WP RSS Multi Importer] RSS Shortcode Showing Old Feed ItemsUnfortunately, we weren’t able to find a solution and have started testing the WP RSS Aggregator plugin as a replacement.
We talked briefly with the developer of the WP RSS Multi-Importer plugin and even offered to pay for support, but he said he didn’t have a lot of time to devote to it, which we totally understand.
The WP RSS Aggregator plugin has excellent support and I think there is also a paid option if needed.
For both plugins the issue we seem to run into is that the feed items tend to be saved to your website’s database. If the feed items change or are deleted, they often aren’t changed or deleted in your website’s database for a long time.
I hope that’s helpful. Good luck.
Haha. Sorry about the guise. That’s our company account. And I appreciate your explanation of how the plugin saves feed items.
Basically, when wp_query is set to include a ‘post_status’ of both ‘future’ and ‘publish’ posts, the plugin doesn’t actually remove old events (those that are in the past) even though they are no longer contained in the actual RSS feed itself.
It seems like what we need is way to force the plugin to check the feed more frequently and remove posts that no longer exist in the feed. Is that possible? Was my explanation a little more clear this time?
Thanks again for the help.
Thanks for getting back to me Miguel. I’m actually able to get them to load only “Scheduled” posts by using the following code which includes the “post_status” parameter:
<?php add_filter( 'wprss_display_feed_items_query', 'wi_reverse_feed_order', 10, 2 ); function wi_reverse_feed_order( $args, $settings ) { $args['order'] = 'ASC'; $args['post_status'] = 'future'; return $args; } ?>It seems to be working by only pulling events in the future, but I wanted to see if you saw any potential issues with this. Also, do you know any way to target a query for one particular feed?
Thanks for the help.
Thanks for getting back to me Miguel. Here is the URL of the feed source we’re trying to pull from:
http://jewishinstlouis.org/calendar/category/jfed/feed/
I set the option to delete feed items older than one day, but unfortunately it’s still showing events in the past.
Do you have any thoughts on why that would be?
Thanks a ton Miguel. The filter worked great in terms of changing the order. Unfortunately, the plugin is showing events that have already passed even after I change “Limit feed items by age” to be one day. Any idea why that would be or what setting I could use to ensure posts published more than one day ago don’t show?
Have a good one.
Thanks for getting back to me Miguel. You’re exactly right, we simply need the order reversed.