• Resolved Bob Arnold

    (@bobarnold80537)


    On updating Wordfence Security from 6.0.25 to 6.1.10, I’ve noted that Live Traffic is no longer working (Invalid Date Invalid Date (NaN seconds ago)). The failure point is a JS “not a function” error at admin.liveTraffic.js, line 610:

    ko.bindingHandlers.datetimepicker = {
    init: function(element, valueAccessor, allBindingsAccessor) {
      //initialize datepicker with some optional options
      var options = allBindingsAccessor().datepickerOptions || {},
                    $el = $(element);
      // line 610:  JS error - $el.datetimepicker is not a function
      $el.datetimepicker(options);

    This in turn is due to the early return in jquery-ui-timepicker-addon.js if “jquery.ui.timepicker” is already defined

    $.ui.timepicker = $.ui.timepicker || {};
    if ($.ui.timepicker.version) {
    	return;
    }

    In my case the conflicting plugin is “jamsession-post-types” (v2.4.1), which defines query.ui.timepicker via jquery.ui.timepicker.js (v0.3.2, 2011). This latter file, by Francois Gelinas, appears to be in fairly widespread use in WP plugins and elsewhere.

    A workaround I’ve found is to replace all (5) instances of $el.datetimepicker with $el.datepicker in the definition of ko.bindingHandlers.datetimepicker, thus reverting to the core jquery.ui.datepicker. While this prevents filtering on “time”, it does allow the Live Traffic page to render.

    Can the Wordfence code be modified to check for pre-definition of query.ui.timepicker, and take appropriate action to avoid a JS crash? It seems unreasonable to require that all conflicting plugins — which may have been in place for years — be retrofit to accommodate jquery-ui-timepicker-addon.js.

    For the date/time filtering, it may be best to develop a new widget altogether — one with its own unique naming, thus avoiding a name collision on something as generic as “timepicker”

    https://www.ads-software.com/plugins/wordfence/

Viewing 1 replies (of 1 total)
  • Hi,
    Thanks for your time in debugging this issue, I’ve forwarded this one to our dev team (reference number: #2190) so they can take a closer look at this issue and apply any necessary fix in next updates.

    Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘Live Traffic broken due to plugin conflict’ is closed to new replies.