Support » Plugin: WP FullCalendar » Events do not appear in IE 8 & 9 when admin and frontend schemes are different

  • When FORCE_SSL_ADMIN is true, admin_url() returns an HTTPS URL. If is_ssl() is false (i.e. the frontend page is accessed over HTTP), there is a scheme mismatch that prevents the call to admin-ajax.php from working in IE 8 & 9. This is a limitation of XDomainRequest used in IE < 10 – see #7 on http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx.

    Steps to reproduce (WP FullCalendar 0.8.4):

    1. Add define('FORCE_SSL_ADMIN', true); to wp-config.php
    2. Add [fullcalendar] to a page
    3. View page over HTTP in Chrome or Firefox – events appear
    4. View page over HTTP in IE 8 or 9 – events do not appear
    5. View page over HTTPS in IE 8 or 9 – events appear

    Fix: modify localize_script() in wp-fullcalendar.php:

    //$js_vars['ajaxurl'] = admin_url('admin-ajax.php');
    if( is_ssl() ) {
        $js_vars['ajaxurl'] = admin_url('admin-ajax.php', 'https');
    } else {
        $js_vars['ajaxurl'] = admin_url('admin-ajax.php', 'http');
    }

    https://wordpress.org/plugins/wp-fullcalendar/

Viewing 3 replies - 1 through 3 (of 3 total)
  • This can be filtered in your theme or plugin instead:

    add_filter( 'wpfc_js_vars', 'my_wpfc_js_vars', 10, 1 );
    function my_wpfc_js_vars( $js_vars ) {
    	if ( is_ssl() ) {
    		$js_vars['ajaxurl'] = admin_url( 'admin-ajax.php', 'https' );
    	} else {
    		$js_vars['ajaxurl'] = admin_url( 'admin-ajax.php', 'http' );
    	}
    	return $js_vars;
    }

    Simpler version:

    add_filter( 'wpfc_js_vars', 'my_wpfc_js_vars', 10, 1 );
    function my_wpfc_js_vars( $js_vars ) {
    	$js_vars['ajaxurl'] = set_url_scheme( $js_vars['ajaxurl'], null );
    	return $js_vars;
    }

    Plugin Support angelo_nwl

    (@angelo_nwl)

    Thanks, Im going to let the devs know about this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Events do not appear in IE 8 & 9 when admin and frontend schemes are different’ is closed to new replies.