{"id":16889486,"date":"2023-07-12T12:47:38","date_gmt":"2023-07-12T12:47:38","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/plugin-breaks-site-migration\/"},"modified":"2023-07-12T12:47:38","modified_gmt":"2023-07-12T12:47:38","slug":"plugin-breaks-site-migration","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/plugin-breaks-site-migration\/","title":{"rendered":"Plugin breaks site migration"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">We were having trouble migrating a client&#8217;s site using All In One WP Migration, and the culprit turned out to be this plugin. Here was the stack trace:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined function get_user_by() in \/public_html\/wp-content\/plugins\/aryo-activity-log\/classes\/class-aal-api.php:89\\nStack trace:\\n#0 \/public_html\/wp-content\/plugins\/aryo-activity-log\/classes\/class-aal-api.php(161): AAL_API-&gt;insert()\\n#1 \/public_html\/wp-content\/plugins\/aryo-activity-log\/hooks\/class-aal-hook-plugins.php(20): aal_insert_log()\\n#2 \/public_html\/wp-content\/plugins\/aryo-activity-log\/hooks\/class-aal-hook-plugins.php(26): AAL_Hook_Plugins-&gt;_add_log_plugin()\\n#3 \/public_html\/wp-includes\/class-wp-hook.php(310): AAL_Hook_Plugins-&gt;hooks_deactivated_plugin()\\n#4 \/public_html\/wp-includes\/class-wp-hook.php(332): WP_Hook-&gt;apply_filters()\\n#5 \/public_html\/wp-incl\u2026', referer:<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Deactivating this plugin via FTP fixed the fatal error and allowed All In One WP Migration to finish its migration process.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The error was happening on both PHP 7 and 8.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Is it possible that you&#8217;re calling the <code>get_user_by()<\/code> function in a nonstandard location, such as an early-loaded WordPress hook where it isn&#8217;t guaranteed to exist yet? If so, you could probably fix the incompatibility by using <code>function_exists<\/code>.<\/p>\n","protected":false},"template":"","class_list":["post-16889486","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16889486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16889486\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=16889486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}