ical sync schedule

This topic contains 9 replies, has 2 voices, and was last updated by  Stephen Harris 6 years, 5 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #9274

    Our ical feeds are not updating with the schedule option. If I click the Fetch now option, the calendar is updated. I have tried changing the intervals and re-adding the ical feed, but they still do not update automatically.

    Bryan Rohling
    #9278

    Hi Bryan,

    The extension uses WordPress’ “pseudo”-cron API for triggering updates. As such feed updates do not necessarily update at the specified time. (The more hits a site gets, the more ‘accurate’ the task scheduler is).

    If there the updates are not happening at all (as opposed to happening late), then it may be that the server is prevent callbacks. If that’s the case you can try enabling alternative cron. It could also be that “WP Cron” is disabled (you can check that by visiting the system information page: …/wp-admin/edit.php?post_type=event&page=debug.

    Have you noticed scheduled posts not publishing at all?

    Stephen Harris
    #9510

    The ical feeds were not updating at all so I disabled the wordpress cron and added a manual cron job for wp-cron. The ical feed update is working now, but we are seeing another problem with the sync.

    We have been adding carriage returns (</br>) into the titles of our events so that when they are displayed by events organiser they fit on our ipad screens correctly for digital signage. When I use the Fetch Now link on the ical sync settings page, it fetches the ical feed and keeps the </br> in the event title. But after it updates the feed with wp-cron it omits the </br> from the event title, which then causes the titles to not display correctly on our signs. Is there a way to add manual cron jobs to re-fetch the ical feed manually for each feed? Any other ideas for how to overcome this problem? Thanks!

    Bryan Rohling
    #9519

    Hi Bryan,

    Thinking about this I think the event title is being stripped when its automatically fetched because when the event is updated, the user is “logged out”. Typicall non-admins / non-editors are subject to tighter filters on what they can/cannot post. While it’ll be possible to configure this to allow HTML in the title, I think it would be better to understand why you’re needing to use <br> tags in the title. Is this to create additional whitespace between the title and the content below it? Or is the title doubling up as a sub-title as well, which you want displayed below the ‘title’? Or is there another reason? Whatever the aim – there might be a better way to achieve it.

    Stephen Harris
    #9521

    Our aim is to use the break to create a subtitle. We are using ipads as digital signs and we want to control where the title will break for the second line so it fits properly on the screen. In most cases, we are entering the event title followed by the carriage return then followed by the presenter name. Our presenter names are importing as just the email address from the ical feed so we have to include it in the event title.

    Bryan Rohling
    #9536

    Hi Bryan,

    In that case, the following might be the best approach (I’ve not fully tested it, but it should do the job):

    function my_cron_kses_init(){
    
        if( defined( 'DOING_CRON' ) && DOING_CRON ){
            kses_remove_filters();
        }
    
    }
    add_action( 'init', 'my_cron_kses_init', 15 );
    add_action( 'set_current_user', 'my_cron_kses_init', 15 );

    Just add that in a site utility plug-in or theme’s functions.php.

    What this snippet does: In a cron job “no-one” is logged in (user ID=0). And someone who is no-one can’t post unfiltered HTML :). This removes that restriction, so no tags are stripped. This doesn’t give anyone the ability to post who can’t already post. It only takes affect in the context of a cron job.

    The only possible concern you may have is if the content of the feed is not controlled by you or a trusted person – because the content of the post isn’t filtered. That is to say the content of the event is in effect assumed to have been written by an admin/editor. If that’s not the case, you can tighten things up a bit

    Stephen Harris
    #9618

    The content is trusted, so that is not a concern. I added the code to the functions.php file for my theme, but now it is not updating the ical feed at all. I have my cron job set for every 15 minutes. This is what I have added to cron:

    wget -O /dev/null http://marketing.essdack.org/wp-cron.php?doing_wp_cron

    Bryan Rohling
    #9625

    What is the setting on the import/export page? The above snippet shouldn’t alter whether the sync is triggered at all (and there are no errors).

    Stephen Harris
    #9655

    Can I force the sync schedule for every 15 minutes instead of hourly?

    Bryan Rohling
    #9661

    Yes – in fact you use whatever schedules are registered on your site. There are code snippets on the iCal extension’s page showing you how to register custom schedules.

    Stephen Harris
Viewing 10 posts - 1 through 10 (of 10 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.