Что такое jquery migrate

Что такое jquery migrate

Что такое jquery migrate. Смотреть фото Что такое jquery migrate. Смотреть картинку Что такое jquery migrate. Картинка про Что такое jquery migrate. Фото Что такое jquery migrate

NOTE: To upgrade to jQuery 3.0, you first need version 1.12.x or 2.2.x. If you’re using an older version, first upgrade to one of these versions using jQuery Migrate 1.x, to resolve any compatibility issues. For more information about the changes made in jQuery 3.0, see the upgrade guide and blog post.

Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used.

That way you can spot and fix what otherwise would have been errors, until you no longer need jQuery Migrate and can remove it.

In your web page, load this plugin after the script tag for jQuery, for example:

Development vs. Production versions

The production build is minified and does not generate console warnings. It will only generate a console log message upon loading, or if it detects an error such as an outdated version of jQuery that it does not support. Do not use this file for development or debugging, it will make your life miserable.

DevelopmentProduction
Debugging enabled
Latest release (may be hotlinked if desired)jquery-migrate-3.3.2.jsjquery-migrate-3.3.2.min.js
* Latest work-in-progress buildjquery-migrate-git.jsjquery-migrate-git.min.js

* Work-in-progress build: Although this file represents the most recent updates to the plugin, it may not have been thoroughly tested. We do not recommend using this file on production sites since it may be unstable; use the released production version instead.

The development version of the plugin displays warnings in the browser console. Older browsers such as IE9 doesn’t support the console interface. No messages will be generated unless you include a debugging library such as Firebug Lite before including the jQuery Migrate plugin. Developers can also inspect the jQuery.migrateWarnings array to see what error messages have been generated.

All warnings generated by this plugin start with the string «JQMIGRATE». A list of the warnings you may see are in warnings.md.

Migrate Plugin API

This plugin adds some properties to the jQuery object that can be used to programmatically control and examine its behavior:

jQuery.migrateWarnings : This property is an array of string warning messages that have been generated by the code on the page, in the order they were generated. Messages appear in the array only once, even if the condition has occurred multiple times, unless jQuery.migrateReset() is called.

jQuery.migrateMute : Set this property to true to prevent console warnings from being generated in the development version. The jQuery.migrateWarnings array is still maintained when this property is set, which allows programmatic inspection without console output.

jQuery.migrateTrace : Set this property to false if you want warnings but do not want stack traces to appear on the console.

jQuery.migrateReset() : This method clears the jQuery.migrateWarnings array and «forgets» the list of messages that have been seen already.

jQuery.migrateVersion : This string property indicates the version of Migrate in use.

jQuery.migrateDeduplicateWarnings : By default, Migrate only gives a specific warning once. If you set this property to false it will give a warning for every occurrence each time it happens. Note that this can generate a lot of output, for example when a warning occurs in a loop.

Bugs that only occur when the jQuery Migrate plugin is used should be reported in the jQuery Migrate Issue Tracker and should be accompanied by an executable test case that demonstrates the bug. The easiest way to do this is via an online test tool such as jsFiddle.net or jsbin.com. Use the development version when you are reporting bugs.

Bugs in jQuery itself should be reported on the jQuery Core bug tracker and again should be accompanied by a test case from jsFiddle.net or jsbin.com so that we can reproduce the issue.

For other questions about the plugin that aren’t bugs, ask on the jQuery Forum.

Источник

Отключение jQuery migrate в WordPress: 3 лучших способа

Время идет, плагины и системы управления сайтами обновляются. Часть скриптов остается неизменна, поэтому разработчики предусмотрели запасной вариант: jQuery migrate – скрипт, позволяющий использовать устаревшие версии утилит и шаблонов. Разбираемся, нужно ли оставлять его сегодня или удалять из WordPress.

JQuery migrate в WordPress: что это и зачем нужно

jQuery – язык, применяемый разработчиками утилит, в силу своей простоты и опциональности. Сам он – набор готовых команд, реализовывающих план быстрее, без ущерба контенту.

Как и любой ЯП, н развивается и становится совершеннее, поэтому выпущенные ранее продукты требуют переработки под обновленные требования. Но часть из модулей или тем уже заброшена командой разработчиков, что значит, что они не будут обновляться. В таких ситуациях необходим джейквери migrate, поддерживающий в новой сборке WordPress устаревшие элементы.

Влияние на сайт

Ответив на вопрос, для чего нужен jQuery migrate, можно сразу выявить несколько минусов:

Отключить jQuery migrate из WordPress

Как и любая функция, эта библиотека удаляете двумя путями: при помощи или вставки системной функции, которая может навредить всему ресурсу, или утилит, никак не влияющих на возможные предупреждения.

При помощи Clearfy PRO

Русифицированное дополнение, исправляющее ошибки ВордПресс “из коробки” и проводящее базовое SEO аудит с исправлением ошибок. Чтобы воспользоваться нужной функцией, перейдите в раздел “Код”, расположенный в системном конфиге модуля (вкладка в левом сайдбаре с названием). После активируйте нужный чекбокс и примените изменения.

Что такое jquery migrate. Смотреть фото Что такое jquery migrate. Смотреть картинку Что такое jquery migrate. Картинка про Что такое jquery migrate. Фото Что такое jquery migrate

После обязательно проверьте работу модулей и функций темы, если возникают ошибки – откатите правки, если все нормально – волноваться не стоит.

-15% по промокоду wpboost

Через плагин Remove WordPress OH

Что такое jquery migrate. Смотреть фото Что такое jquery migrate. Смотреть картинку Что такое jquery migrate. Картинка про Что такое jquery migrate. Фото Что такое jquery migrate

Популярный, однако нерусифицированный модуль, направленный на устранение лишних фрагментов кода. Рекомендую для начала отключить встроенную оптимизацию под CDN и jQuery migrate, однако не стоит выбирать “Select all” – вместе с бесполезными возможностями могут отключиться важные элементы функционирования сайта.

Используя PHP вставку

Способ для опытных вебмастеров, знающих как работать с кодом. Его суть заключается во внедрении скрипта, который будет удалять ненужную опцию. Чтобы это сделать:

Теперь внимательно проверьте работоспособность сайта. Если возникли какие-либо ошибки или часть плагинов пропала или вовсе не работает, то разумно будет откатить изменения и не прибегать к удалению jQuery migrate из WordPress.

Источник

Jquery-migrate.min.js – что это за скрипт и как его удалить из WordPress

Создатели WP заботятся о старых и новых продуктах. Поэтому в разделе head есть много ссылок подключений для поддержки старых инструментов управления. Один из них jquery-migrate.min.js в WordPress, разберемся что это такое и как убрать с блога.

Jquery-migrate.min.js – что это такое

Ранее для визуальных эффектов вебмастера не использовали сторонние js библиотеки, а брали стандартную в WordPress jquery migrate, она почти не менялась поэтому множество плагинов и шаблонов работали с ней, обновлений нет, а значит ничего править не нужно. Но прогресс идет вперед, создаются новые интерфейсы, эффекты, пути реализации, поэтому актуальность она утратила.

Если есть, то убираем, если нет, то можете закрывать страницу и дальше не читать статью.

Как отключить jquery-migrate в ClearfyPRO

Чтобы отключить библиотеку jquery migrate с помощью Clearfy PRO, достаточно включить соответствующий пункт. После активации, проверяем отсутствие кода на сайте. Рядом находится отключение ревизий WordPress.

Если не знаете, то плагин Clearfy оптимизирует контент блога на WordPress еще по 46 пунктам, очищая исходный HTML и повышая сео. Посетителям даю скидку, жмите на кнопку разница вычисляется автоматически.

Плагин Remove jQuery Migrate

Требует только установки и активации, действие Remove jQuery Migrate начинается сразу, настроек не имеет, поэтому работает по принципу, поставил и забыл. При поиске из админки он выглядит так.

Чтобы удалить скрипт для этой простой процедуры не советую брать отдельное решение, лучше применять комплексные способы из прошлого раздела.

Применяем код

Для устранения в WordPress проблемы с jquery migrate используем PHP функцию. Вставляем код в файл function активной темы блога. Рекомендую делать с помощью FTP соединения и дочерней темы.

После применения любого из методов обязательно проверить работоспособность всех плагинов и шаблона WP, возможно они работают на старой версии jquery-migrate min js.

В итоге получаем более чистый код, отключение еще одного лишнего скрипта и немного быстрый блог для seo. Большой минус добавляют emoji, огромный скрипт в head, которым никто не пользуется. Применяйте комплекс для оптимизации, потому что в WordPress еще много мусора.

Источник

Что такое jquery migrate

Что такое jquery migrate. Смотреть фото Что такое jquery migrate. Смотреть картинку Что такое jquery migrate. Картинка про Что такое jquery migrate. Фото Что такое jquery migrate

NOTE: To upgrade to jQuery 3.0, you first need version 1.12.x or 2.2.x. If you’re using an older version, first upgrade to one of these versions using jQuery Migrate 1.x, to resolve any compatibility issues. For more information about the changes made in jQuery 3.0, see the upgrade guide and blog post.

Upgrading libraries such as jQuery can be a lot of work, when breaking changes have been introduced. jQuery Migrate makes this easier, by restoring the APIs that were removed, and additionally shows warnings in the browser console (development version of jQuery Migrate only) when removed and/or deprecated APIs are used.

That way you can spot and fix what otherwise would have been errors, until you no longer need jQuery Migrate and can remove it.

In your web page, load this plugin after the script tag for jQuery, for example:

Development vs. Production versions

The production build is minified and does not generate console warnings. It will only generate a console log message upon loading, or if it detects an error such as an outdated version of jQuery that it does not support. Do not use this file for development or debugging, it will make your life miserable.

DevelopmentProduction
Debugging enabled
Latest release (may be hotlinked if desired)jquery-migrate-3.3.2.jsjquery-migrate-3.3.2.min.js
* Latest work-in-progress buildjquery-migrate-git.jsjquery-migrate-git.min.js

* Work-in-progress build: Although this file represents the most recent updates to the plugin, it may not have been thoroughly tested. We do not recommend using this file on production sites since it may be unstable; use the released production version instead.

The development version of the plugin displays warnings in the browser console. Older browsers such as IE9 doesn’t support the console interface. No messages will be generated unless you include a debugging library such as Firebug Lite before including the jQuery Migrate plugin. Developers can also inspect the jQuery.migrateWarnings array to see what error messages have been generated.

All warnings generated by this plugin start with the string «JQMIGRATE». A list of the warnings you may see are in warnings.md.

Migrate Plugin API

This plugin adds some properties to the jQuery object that can be used to programmatically control and examine its behavior:

jQuery.migrateWarnings : This property is an array of string warning messages that have been generated by the code on the page, in the order they were generated. Messages appear in the array only once, even if the condition has occurred multiple times, unless jQuery.migrateReset() is called.

jQuery.migrateMute : Set this property to true to prevent console warnings from being generated in the development version. The jQuery.migrateWarnings array is still maintained when this property is set, which allows programmatic inspection without console output.

jQuery.migrateTrace : Set this property to false if you want warnings but do not want stack traces to appear on the console.

jQuery.migrateReset() : This method clears the jQuery.migrateWarnings array and «forgets» the list of messages that have been seen already.

jQuery.migrateVersion : This string property indicates the version of Migrate in use.

jQuery.migrateDeduplicateWarnings : By default, Migrate only gives a specific warning once. If you set this property to false it will give a warning for every occurrence each time it happens. Note that this can generate a lot of output, for example when a warning occurs in a loop.

Bugs that only occur when the jQuery Migrate plugin is used should be reported in the jQuery Migrate Issue Tracker and should be accompanied by an executable test case that demonstrates the bug. The easiest way to do this is via an online test tool such as jsFiddle.net or jsbin.com. Use the development version when you are reporting bugs.

Bugs in jQuery itself should be reported on the jQuery Core bug tracker and again should be accompanied by a test case from jsFiddle.net or jsbin.com so that we can reproduce the issue.

For other questions about the plugin that aren’t bugs, ask on the jQuery Forum.

Источник

Отключаем подключение библиотеки jquery-migrate.min.js для сайта на WordPress.

Учитывая рост актуальности такого параметра как скорость работы сайта, веб разработчики стараются максимально очистить код от лишнего «мусора». При разборе результатов скорости сайта на основании того же gtmetrix, можно увидеть весь набор скриптов и файлов, которые подгружает страница вашего ресурса. Посмотреть данную информацию можно и в chrome, но в gtmetrix более наглядно. Одним из проблемных файлов, который подключается в WordPress является jquery-migrate.min.js.

Что это за файл — jquery-migrate.min.js?

Как раньше, так и сейчас многие разработчики плагинов и тем для WordPress используют JS библиотеку jQuery. Уже выпущено много версий этого скрипта, которые постоянно улучшаются, а часть старого функционала убирают. Исходя из этого старые плагины или же, темы где используется jQuery, при обновлении скрипта могут терять часть функционала и выдавать ошибки на сайте. Поскольку таких неподдерживаемых плагинов и тем много, в WordPreess был додан файл jquery-migrate.min.js, который собственно и обеспечивал совместимость как старых, так и новых версий jQuery.

Последние версии WordPress по умолчанию используют самую новую версию jQuery, и зачастую необходимость в дополнительном скрипте jquery-migrate просто отпала.

Где подключается данный скрипт?

Обычно он подключается в области head. Если вы хотите узнать если данный файл на вашем сайте, то можно зайти в код страницы через браузер и поискать строки вот такого плана.

Второй способ – это запустить инструменты веб разработчика в Chrome, и в консоли вы увидите надпись.

Что такое jquery migrate. Смотреть фото Что такое jquery migrate. Смотреть картинку Что такое jquery migrate. Картинка про Что такое jquery migrate. Фото Что такое jquery migrate

Основные причины чтобы убрать файл jquery-migrate.min.js из вашего сайта

Есть ряд преимуществ, которые вы получите, отключив данный скрипт на своем сайте.

На самом деле проблемы с ошибками могут возникнуть только в том случае, если у вас установлены очень старые плагины или тема, и тут лучше обновиться или использовать другое решение.

Один из вариантов протестировать наличие ошибок при удалении файла jquery-migrate.min.js – это включить режим define(‘SCRIPT_DEBUG’, true); в файле wp-config.php вашего сайта.

Отключаем скрипт jquery-migrate.min.js вручную с помощью кода

Для этого вам нужно найти файл functions.php в вашей темы на WordPress, сделать его бекап и только потом приступать к редактированию данного файла.

Вот этот код, вставляем в конце файла functions.php.

Используя плагин – «Remove jQuery Migrate»

Для этого вам нужно перейти в раздел «Плагины» — «Добавить новый», ввести в поиске название плагина, установить и активировать его.

Что такое jquery migrate. Смотреть фото Что такое jquery migrate. Смотреть картинку Что такое jquery migrate. Картинка про Что такое jquery migrate. Фото Что такое jquery migrate

С помощью WP Rocket Plugin и Clearfy Pro

Это платные плагины, но если они у вас установлены, то вы легко сможете решить проблему с файлом jquery-migrate.min.js.

Для WP Rocket Plugin, нужно сделать следующую настройку.

Что такое jquery migrate. Смотреть фото Что такое jquery migrate. Смотреть картинку Что такое jquery migrate. Картинка про Что такое jquery migrate. Фото Что такое jquery migrate

Еще один важный момент. После того, как вы удалите скрипт, протестируйте сайт и проверьте все формы, слайдеры и прочие элементы интерфейса. Если вы работали на локальном сервере и включали режим дебага в файле конфигурации, то перед переносом сайта на сервер его необходимо отключить.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *