├── .gitignore ├── LICENSE ├── admin ├── header.php ├── logs.php └── settings.php ├── class-jquery-migrate-helper.php ├── enable-jquery-migrate-helper.php ├── js ├── deprecation-notice.js ├── jquery-migrate │ ├── jquery-migrate-1.4.1-wp.js │ └── jquery-migrate-3.4.1-wp.js ├── jquery-ui │ ├── accordion.min.js │ ├── autocomplete.min.js │ ├── button.min.js │ ├── core.min.js │ ├── datepicker.min.js │ ├── dialog.min.js │ ├── draggable.min.js │ ├── droppable.min.js │ ├── effect-blind.min.js │ ├── effect-bounce.min.js │ ├── effect-clip.min.js │ ├── effect-drop.min.js │ ├── effect-explode.min.js │ ├── effect-fade.min.js │ ├── effect-fold.min.js │ ├── effect-highlight.min.js │ ├── effect-puff.min.js │ ├── effect-pulsate.min.js │ ├── effect-scale.min.js │ ├── effect-shake.min.js │ ├── effect-size.min.js │ ├── effect-slide.min.js │ ├── effect-transfer.min.js │ ├── effect.min.js │ ├── menu.min.js │ ├── mouse.min.js │ ├── position.min.js │ ├── progressbar.min.js │ ├── resizable.min.js │ ├── selectable.min.js │ ├── selectmenu.min.js │ ├── slider.min.js │ ├── sortable.min.js │ ├── spinner.min.js │ ├── tabs.min.js │ ├── tooltip.min.js │ └── widget.min.js └── jquery │ └── jquery-1.12.4-wp.js ├── readme.txt ├── templates ├── admin-notices │ ├── deprecated-scripts.php │ ├── no-longer-needed.php │ └── welcome.php └── email │ ├── automatic-downgrade.php │ └── weekly.php └── uninstall.php /.gitignore: -------------------------------------------------------------------------------- 1 | js/.DS_Store 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /admin/header.php: -------------------------------------------------------------------------------- 1 | 13 | 14 |

jQuery Migrate

15 | 16 |
17 |

18 | 19 |

20 | 21 |

22 | 23 |

24 | 25 |

26 | 27 |

28 | 29 |

30 | 31 |

32 |
33 | 34 | 38 | 39 | $plugin ) { 17 | $slug = explode( '/', $slug ); 18 | $plugins[ $slug[0] ] = $plugin; 19 | } 20 | 21 | $themes = wp_get_themes(); 22 | 23 | $logs = get_option( 'jqmh_logs', array() ); 24 | ?> 25 | 26 |

Logs

27 | 28 |
29 |

30 | 31 |

32 |
33 | 34 |
35 | 36 |
37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 55 | 56 | 57 | 58 | .+?)\/.+?: (?P.+)/', $log['notice'], $plugin ); 62 | preg_match( '/\/themes\/(?P.+?)\/.+?: (?P.+)/', $log['notice'], $theme ); 63 | preg_match( '/\/wp-(admin|includes)\/.+?: (?P.+)/', $log['notice'], $core ); 64 | 65 | $notice = $log['notice']; 66 | $source = __( 'Undetermined', 'enable-jquery-migrate-helper' ); 67 | $file = __( 'Inline code, unknown file location', 'enable-jquery-migrate-helper' ); 68 | 69 | if ( ! empty( $plugin ) ) { 70 | preg_match( '/(?Phttps?:\/\/.+?):/', $log['notice'], $file ); 71 | $file = $file['path']; 72 | 73 | $plugin_link = '#'; 74 | 75 | if ( isset( $plugins[ $plugin['slug'] ] ) ) { 76 | $plugin_link = ( isset( $plugins[ $plugin['slug'] ]['PluginURI'] ) ? $plugins[ $plugin['slug'] ]['PluginURI'] : $plugins[ $plugin['slug'] ]['AuthorURI'] ); 77 | } 78 | 79 | $notice = $plugin['notice']; 80 | $source = sprintf( 81 | // translators: 1: Linked name of the plugin throwing notices. 82 | __( 'Plugin: %s', 'enable-jquery-migrate-helper' ), 83 | sprintf( 84 | '%s', 85 | esc_url( $plugin_link ), 86 | esc_html( ( isset( $plugins[ $plugin['slug'] ] ) ? $plugins[ $plugin['slug'] ]['Name'] : $plugin['slug'] ) ) 87 | ) 88 | ); 89 | } elseif ( ! empty( $theme ) ) { 90 | preg_match( '/(?Phttps?:\/\/.+?):/', $log['notice'], $file ); 91 | $file = $file['path']; 92 | 93 | $theme_link = '#'; 94 | 95 | if ( isset( $themes[ $theme['slug'] ] ) ) { 96 | $theme_link = $themes[ $theme['slug'] ]->get( 'ThemeURI' ); 97 | } 98 | 99 | $notice = $theme['notice']; 100 | $source = sprintf( 101 | // translators: 1: Linked name of the theme throwing notices. 102 | __( 'Theme: %s', 'enable-jquery-migrate-helper' ), 103 | sprintf( 104 | '%s', 105 | esc_url( $theme_link ), 106 | esc_html( ( isset( $themes[ $theme['slug'] ] ) ? $themes[ $theme['slug'] ]->get( 'Name' ) : $theme['slug'] ) ) 107 | ) 108 | ); 109 | } elseif ( ! empty( $core ) ) { 110 | preg_match( '/(?Phttps?:\/\/.+?):/', $log['notice'], $file ); 111 | $file = $file['path']; 112 | 113 | $notice = $core['notice']; 114 | $source = __( 'WordPress core', 'enable-jquery-migrate-helper' ); 115 | } 116 | 117 | ?> 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 |
53 | 54 |
140 | 141 |
142 | 143 |
144 | 145 | -------------------------------------------------------------------------------- /admin/settings.php: -------------------------------------------------------------------------------- 1 | 16 | 17 |

Settings

18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 30 | 45 | 46 | 47 | 48 | 51 | 57 | 58 | 59 | 60 | 61 | 64 | 70 | 71 | 72 | 73 | 74 | 75 | 78 | 87 | 88 | 89 | 90 | 91 | 94 | 103 | 104 | 105 | 106 | 107 |
108 | -------------------------------------------------------------------------------- /enable-jquery-migrate-helper.php: -------------------------------------------------------------------------------- 1 | -1 || line.indexOf( '/themes/' ) > -1 || line.indexOf( '/wp-admin/js/' ) > -1 || line.indexOf( '/wp-includes/js/' ) > -1 ) 34 | ) { 35 | match = line.replace( /.*?http/, 'http' ); 36 | } 37 | 38 | // If no match is found, we do a second pass, and attempt to extrapolate special 39 | // cases where the script may be within anonymous functions, and thus has no asset relationship. 40 | if ( 41 | ! match && 42 | line.indexOf( '/' + JQMH.plugin_slug + '/js' ) === -1 && 43 | line.indexOf( 'anonymous' ) > -1 44 | ) { 45 | match = line.replace( /.*?http/, 'http' ); 46 | } 47 | } ); 48 | 49 | // If the stack trace did not contain a matching plugin or theme, just return a null value. 50 | return match; 51 | } 52 | 53 | /** 54 | * Update the count of deprecations found on this page. 55 | * 56 | * @param count 57 | */ 58 | function setAdminBarCount( count ) { 59 | if ( ! adminbar.length ) { 60 | return; 61 | } 62 | 63 | // The live counter may be disabled if jQuery 3 is used during WordPress 5.6 64 | if ( ! JQMH.capture_deprecations ) { 65 | return; 66 | } 67 | 68 | if ( ! countWrapper.is( ':visible' ) ) { 69 | countWrapper.show(); 70 | 71 | countWrapperVisibility(); 72 | } 73 | 74 | $( '.count', adminbar ).text( count ); 75 | } 76 | 77 | /** 78 | * Set the admin bar visibility level based on the warning counters. 79 | */ 80 | function countWrapperVisibility() { 81 | if ( countWrapper.is( ':visible' ) ) { 82 | adminbar 83 | .css( 'background-color', '#be4400' ) 84 | .css( 'color', '#eeeeee' ); 85 | } else { 86 | adminbar 87 | .css( 'background-color', '' ) 88 | .css( 'color', '' ); 89 | } 90 | } 91 | 92 | /** 93 | * Append the deprecation to the admin dashbaord, if applicable. 94 | * 95 | * @param message 96 | */ 97 | function appendNoticeDisplay( message ) { 98 | var list = notice.find( '.jquery-migrate-deprecation-list' ); 99 | 100 | if ( ! notice.length ) { 101 | return; 102 | } 103 | 104 | // Only list one case of the same error per file. 105 | if ( JQMH.single_instance_log ) { 106 | if ( previousDeprecations.indexOf( message ) > -1 ) { 107 | return; 108 | } 109 | 110 | previousDeprecations.push( message ); 111 | } 112 | 113 | if ( ! notice.is( ':visible' ) ) { 114 | notice.show(); 115 | } 116 | 117 | list.append( $( '
  • ' ).text( message ) ); 118 | } 119 | 120 | /** 121 | * Try to log the deprecation for the admin area. 122 | * 123 | * @param message 124 | */ 125 | function reportDeprecation( message ) { 126 | // Do not write to the logfile if this is the backend and the notices are written to the screen. 127 | if ( JQMH.backend && notice.length ) { 128 | return; 129 | } 130 | 131 | if ( ! JQMH.capture_deprecations ) { 132 | return; 133 | } 134 | 135 | var data = { 136 | action: 'jquery-migrate-log-notice', 137 | notice: message, 138 | nonce: JQMH.report_nonce, 139 | backend: JQMH.backend, 140 | url: window.location.href, 141 | }; 142 | 143 | $.post( { 144 | url: JQMH.ajaxurl, 145 | data: data 146 | } ); 147 | } 148 | 149 | if ( warnings.length ) { 150 | warnings.forEach( function( entry ) { 151 | const trace = getSlugFromTrace( entry.trace ? entry.trace : "" ); 152 | let message = trace ? trace + ': ' : ''; 153 | 154 | // Traces some times get a null value, skip these. 155 | if ( '' === message ) { 156 | return; 157 | } 158 | 159 | message += entry.warning; 160 | 161 | appendNoticeDisplay( message ); 162 | 163 | reportDeprecation( message ); 164 | } ); 165 | 166 | setAdminBarCount( warnings.length ); 167 | } 168 | 169 | // Add handler for dismissing of the dashboard notice. 170 | $( document ).on( 'click', '.jquery-migrate-dashboard-notice .notice-dismiss', function() { 171 | var $notice = $( this ).closest( '.notice' ); 172 | var notice_id = $notice.data( 'notice-id' ); 173 | 174 | $.post( { 175 | url: window.ajaxurl, 176 | data: { 177 | action: 'jquery-migrate-dismiss-notice', 178 | 'notice': notice_id, 179 | 'dismiss-notice-nonce': $( '#' + notice_id + '-nonce' ).val(), 180 | }, 181 | } ); 182 | } ); 183 | 184 | // When the previous deprecations are dismissed, reset the admin bar log display. 185 | $( document ).on( 'click', '.jquery-migrate-previous-deprecations .notice-dismiss', function() { 186 | countWrapper.hide(); 187 | countWrapperVisibility(); 188 | } ); 189 | 190 | // Check if the counter is visible on page load. 191 | countWrapperVisibility(); 192 | } ); 193 | -------------------------------------------------------------------------------- /js/jquery-ui/accordion.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI Accordion 1.11.4 3 | * http://jqueryui.com 4 | * 5 | * Copyright jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | * 9 | * http://api.jqueryui.com/accordion/ 10 | */ 11 | !function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./widget"],e):e(jQuery)}(function(d){return d.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=d(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),e.collapsible||!1!==e.active&&null!=e.active||(e.active=0),this._processPanels(),e.active<0&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():d()}},_createIcons:function(){var e=this.options.icons;e&&(d("").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){"active"!==e?("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||!1!==this.options.active||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t))):this._activate(t)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var t=d.ui.keyCode,i=this.headers.length,a=this.headers.index(e.target),s=!1;switch(e.keyCode){case t.RIGHT:case t.DOWN:s=this.headers[(a+1)%i];break;case t.LEFT:case t.UP:s=this.headers[(a-1+i)%i];break;case t.SPACE:case t.ENTER:this._eventHandler(e);break;case t.HOME:s=this.headers[0];break;case t.END:s=this.headers[i-1]}s&&(d(e.target).attr("tabIndex",-1),d(s).attr("tabIndex",0),s.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===d.ui.keyCode.UP&&e.ctrlKey&&d(e.currentTarget).prev().focus()},refresh:function(){var e=this.options;this._processPanels(),!1===e.active&&!0===e.collapsible||!this.headers.length?(e.active=!1,this.active=d()):!1===e.active?this._activate(0):this.active.length&&!d.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=d()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var i,e=this.options,t=e.heightStyle,a=this.element.parent();this.active=this._findActive(e.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var e=d(this),t=e.uniqueId().attr("id"),i=e.next(),a=i.uniqueId().attr("id");e.attr("aria-controls",a),i.attr("aria-labelledby",t)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(e.event),"fill"===t?(i=a.height(),this.element.siblings(":visible").each(function(){var e=d(this),t=e.css("position");"absolute"!==t&&"fixed"!==t&&(i-=e.outerHeight(!0))}),this.headers.each(function(){i-=d(this).outerHeight(!0)}),this.headers.next().each(function(){d(this).height(Math.max(0,i-d(this).innerHeight()+d(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.headers.next().each(function(){i=Math.max(i,d(this).css("height","").height())}).height(i))},_activate:function(e){var t=this._findActive(e)[0];t!==this.active[0]&&(t=t||this.active[0],this._eventHandler({target:t,currentTarget:t,preventDefault:d.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):d()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&d.each(e.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var t=this.options,i=this.active,a=d(e.currentTarget),s=a[0]===i[0],n=s&&t.collapsible,r=n?d():a.next(),o=i.next(),h={oldHeader:i,oldPanel:o,newHeader:n?d():a,newPanel:r};e.preventDefault(),s&&!t.collapsible||!1===this._trigger("beforeActivate",e,h)||(t.active=!n&&this.headers.index(a),this.active=s?d():a,this._toggle(h),i.removeClass("ui-accordion-header-active ui-state-active"),t.icons&&i.children(".ui-accordion-header-icon").removeClass(t.icons.activeHeader).addClass(t.icons.header),s||(a.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),t.icons&&a.children(".ui-accordion-header-icon").removeClass(t.icons.header).addClass(t.icons.activeHeader),a.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var t=e.newPanel,i=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=t,this.prevHide=i,this.options.animate?this._animate(t,i,e):(i.hide(),t.show(),this._toggleComplete(e)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),t.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):t.length&&this.headers.filter(function(){return 0===parseInt(d(this).attr("tabIndex"),10)}).attr("tabIndex",-1),t.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,i,t){function a(){o._toggleComplete(t)}var s,n,r,o=this,h=0,d=e.css("box-sizing"),c=e.length&&(!i.length||e.index()",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var i,s,n,e=this.element[0].nodeName.toLowerCase(),t="textarea"===e,o="input"===e;this.isMultiLine=t||!o&&this.element.prop("isContentEditable"),this.valueMethod=this.element[t||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(e){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var t=u.ui.keyCode;switch(e.keyCode){case t.PAGE_UP:i=!0,this._move("previousPage",e);break;case t.PAGE_DOWN:i=!0,this._move("nextPage",e);break;case t.UP:i=!0,this._keyEvent("previous",e);break;case t.DOWN:i=!0,this._keyEvent("next",e);break;case t.ENTER:this.menu.active&&(i=!0,e.preventDefault(),this.menu.select(e));break;case t.TAB:this.menu.active&&this.menu.select(e);break;case t.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(e),e.preventDefault());break;default:s=!0,this._searchTimeout(e)}}},keypress:function(e){if(i)return i=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||e.preventDefault());if(!s){var t=u.ui.keyCode;switch(e.keyCode){case t.PAGE_UP:this._move("previousPage",e);break;case t.PAGE_DOWN:this._move("nextPage",e);break;case t.UP:this._keyEvent("previous",e);break;case t.DOWN:this._keyEvent("next",e)}}},input:function(e){if(n)return n=!1,void e.preventDefault();this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){this.cancelBlur?delete this.cancelBlur:(clearTimeout(this.searching),this.close(e),this._change(e))}}),this._initSource(),this.menu=u("