Skip to content

Depreciated jQuery reported by jQuery Migrate Plugin #216

@atwellpub

Description

@atwellpub

From jQuery Migrate Plugin

https://wordpress.org/plugins/enable-jquery-migrate-helper/

jQuery.fn.unload() is deprecated | Plugin: o2 | https://****/wp-content/plugins/o2/modules/offline/js/offline.js

\'ready\' event is deprecated | Plugin: o2 | https://****/wp-content/plugins/o2/js/editor/editor.js

False Positives

wp-content/plugins/o2/modules/notifications/js/app/notifications.js leverages the event ready.o2, which jQuery Migrate Plugin picks up as a false positive.

Solution: ready event is depreciated

I'm following this article as a guide: https://api.jquery.com/ready/

wp-content/plugins/o2/js/editor/editor.js:84

replace

$doc.on( 'ready', function() {

with

$(function() {

Solution: unload is depreciated

I'm following this guide:
https://stackoverflow.com/questions/46443032/what-is-a-foolproof-alternative-to-window-unload/46443788

/wp-content/plugins/o2/modules/offline/js/offline.js:31

Change

jQuery( window ).unload( function() { o2.Offline.onWindowUnloading(); } );
To

jQuery( window ).on( 'beforeunload' , function() { o2.Offline.onWindowUnloading(); } );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions