deliciousbrains / wp-migrate-db

WordPress plugin that exports your database, does a find and replace on URLs and file paths, then allows you to save it to your computer.
https://wordpress.org/plugins/wp-migrate-db/
341 stars 515 forks source link

Find replace button throwing javascript errors #130

Closed furai closed 2 years ago

furai commented 2 years ago

Hey,

I'm using latest (v2.2.1) version of WP Migrate DB Pro. This happens as well in free version of migrate db plugin. I could reproduce it on both Google Chrome (96.0.4664.93) and Mozilla Firefox (96.0b2).

Screenshot with error: image It occurs on few different websites running the plugin on various environments.

Steps to reproduce: Go to Migrate db plugin, click on migrate tab and click on find & replace button.

Console logs


Warning: Invalid DOM property `for`. Did you mean `htmlFor`?
    in label
    in div
    in Unknown (created by eh)
    in eh
    in fieldset
    in Unknown (created by f)
    in f (created by t)
    in div (created by t)
    in fieldgroup (created by t)
    in t (created by t)
    in t (created by t)
    in t (created by Connect(t))
    in Connect(t)
    in fieldgroup (created by t)
    in t (created by t)
    in t (created by Connect(t))
    in Connect(t)
    in t (created by t)
    in t
    in section (created by Context.Consumer)
    in t (created by styled.section)
    in styled.section (created by td)
    in td
    in div (created by Ja)
    in div (created by ForwardRef)
    in ForwardRef (created by Ja)
    in div (created by Ja)
    in Ja
    in div
    in Unknown (created by f)
    in f
    in Unknown (created by f)
    in f
    in div (created by Ja)
    in div (created by ForwardRef)
    in ForwardRef (created by Ja)
    in div (created by Ja)
    in Ja
    in div
    in Unknown (created by f)
    in f
    in div
    in Unknown (created by f)
    in f (created by vh)
    in vh (created by Context.Consumer)
    in Bo (created by Fo)
    in Fo (created by Context.Consumer)
    in t (created by rM)
    in div (created by os)
    in div (created by Context.Consumer)
    in t (created by styled.div)
    in styled.div (created by os)
    in div (created by os)
    in t (created by os)
    in os (created by rM)
    in div (created by Context.Consumer)
    in t (created by styled.div)
    in styled.div (created by rM)
    in t (created by t)
    in t (created by rM)
    in rM
    in t react_devtools_backend.js:2540:25
Warning: The tag  is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.
    in fieldgroup (created by t)
    in t (created by t)
    in t (created by t)
    in t (created by Connect(t))
    in Connect(t)
    in fieldgroup (created by t)
    in t (created by t)
    in t (created by Connect(t))
    in Connect(t)
    in t (created by t)
    in t
    in section (created by Context.Consumer)
    in t (created by styled.section)
    in styled.section (created by td)
    in td
    in div (created by Ja)
    in div (created by ForwardRef)
    in ForwardRef (created by Ja)
    in div (created by Ja)
    in Ja
    in div
    in Unknown (created by f)
    in f
    in Unknown (created by f)
    in f
    in div (created by Ja)
    in div (created by ForwardRef)
    in ForwardRef (created by Ja)
    in div (created by Ja)
    in Ja
    in div
    in Unknown (created by f)
    in f
    in div
    in Unknown (created by f)
    in f (created by vh)
    in vh (created by Context.Consumer)
    in Bo (created by Fo)
    in Fo (created by Context.Consumer)
    in t (created by rM)
    in div (created by os)
    in div (created by Context.Consumer)
    in t (created by styled.div)
    in styled.div (created by os)
    in div (created by os)
    in t (created by os)
    in os (created by rM)
    in div (created by Context.Consumer)
    in t (created by styled.div)
    in styled.div (created by rM)
    in t (created by t)
    in t (created by rM)
    in rM
    in t react_devtools_backend.js:2540:25
Uncaught 
error { target: Window, isTrusted: true, message: "TypeError: \"onClick\" is read-only", filename: "(snip)/app/plugins/wp-migrate-db/frontend/build-free/static/js/main.d667b299e649.chunk.js", lineno: 1, colno: 1292174, error: TypeError, srcElement: Window, eventPhase: 0, bubbles: true, … }
​
bubbles: true
​
cancelBubble: false
​
cancelable: true
​
colno: 1292174
​
composed: false
​
currentTarget: null
​
defaultPrevented: false
​
error: TypeError: "onClick" is read-only
​
eventPhase: 0
​
explicitOriginalTarget: Window (snip)/wp/wp-admin/tools.php?page=wp-migrate-db#migrate
​
filename: "(snip)/app/plugins/wp-migrate-db/frontend/build-free/static/js/main.d667b299e649.chunk.js"
​
isTrusted: true
​
lineno: 1
​
message: "TypeError: \"onClick\" is read-only"
​
originalTarget: Window (snip)/wp/wp-admin/tools.php?page=wp-migrate-db#migrate
​
returnValue: true
​
srcElement: Window (snip)/wp/wp-admin/tools.php?page=wp-migrate-db#migrate
​
target: Window (snip)/wp/wp-admin/tools.php?page=wp-migrate-db#migrate
​
timeStamp: 4396
​
type: "error"
​
: function isTrusted()
​
: ErrorEventPrototype { message: Getter, filename: Getter, lineno: Getter, … }
main.d667b299e649.chunk.js:1:1371265
Uncaught TypeError: "onClick" is read-only
    Do (snip)/app/plugins/wp-migrate-db/frontend/build-free/static/js/main.d667b299e649.chunk.js:1
    Do (snip)/app/plugins/wp-migrate-db/frontend/build-free/static/js/main.d667b299e649.chunk.js:1
    commitHookEffectListMount (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:19866
    commitPassiveHookEffects (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:19904
    callCallback (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:182
    invokeGuardedCallbackDev (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:231
    invokeGuardedCallback (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:286
    flushPassiveEffectsImpl (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:22988
    unstable_runWithPriority (snip)/wp/wp-includes/js/dist/vendor/react.js?ver=16.13.1:2685
    runWithPriority$1 (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:11174
    flushPassiveEffects (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:22955
    performSyncWorkOnRoot (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:21872
    flushSyncCallbackQueueImpl (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:11224
    unstable_runWithPriority (snip)/wp/wp-includes/js/dist/vendor/react.js?ver=16.13.1:2685
    runWithPriority$1 (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:11174
    flushSyncCallbackQueueImpl (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:11219
    flushSyncCallbackQueue (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:11207
    discreteUpdates$1 (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:22028
    discreteUpdates (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:803
    dispatchDiscreteEvent (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:4291
    addEventBubbleListener (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:4150
    trapEventForPluginEventSystem (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:4285
    trapBubbledEvent (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:4256
    legacyListenToTopLevelEvent (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:3765
    legacyListenToEvent (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:3724
    ensureListeningTo (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:5884
    setInitialDOMProperties (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:5951
    setInitialProperties (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:6149
    finalizeInitialChildren (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:7622
    completeWork (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:19113
    completeUnitOfWork (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:22327
    performUnitOfWork (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:22300
    workLoopSync (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:22265
    performSyncWorkOnRoot (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:21891
    scheduleUpdateOnFiber (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:21323
    updateContainer (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:24508
    legacyRenderSubtreeIntoContainer (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:24893
    unbatchedUpdates (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:22038
    legacyRenderSubtreeIntoContainer (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:24892
    render (snip)/wp/wp-includes/js/dist/vendor/react-dom.js?ver=16.13.1:24975
     (snip)/app/plugins/wp-migrate-db/frontend/build-free/static/js/main.d667b299e649.chunk.js:1
    a (snip)/app/plugins/wp-migrate-db/frontend/build-free/static/js/wpmdb-runtime.5dc8d2614c6b.js:1
     (snip)/app/plugins/wp-migrate-db/frontend/build-free/static/js/main.d667b299e649.chunk.js:1
    a (snip)/app/plugins/wp-migrate-db/frontend/build-free/static/js/wpmdb-runtime.5dc8d2614c6b.js:1
    t (snip)/app/plugins/wp-migrate-db/frontend/build-free/static/js/wpmdb-runtime.5dc8d2614c6b.js:1
    r (snip)/app/plugins/wp-migrate-db/frontend/build-free/static/js/wpmdb-runtime.5dc8d2614c6b.js:1
     (snip)/app/plugins/wp-migrate-db/frontend/build-free/static/js/main.d667b299e649.chunk.js:1
main.d667b299e649.chunk.js:1:1292174
The above error occurred in the  component:
    in Do
    in Unknown (created by f)
    in f (created by Bo)
    in div (created by Bo)
    in Bo (created by Fo)
    in Fo (created by Context.Consumer)
    in t (created by rM)
    in div (created by os)
    in div (created by Context.Consumer)
    in t (created by styled.div)
    in styled.div (created by os)
    in div (created by os)
    in t (created by os)
    in os (created by rM)
    in div (created by Context.Consumer)
    in t (created by styled.div)
    in styled.div (created by rM)
    in t (created by t)
    in t (created by rM)
    in rM
    in t

React will try to recreate this component tree from scratch using the error boundary you provided, t.

I hope all this info can help pin down the issue. Maybe someone else can reproduce. It's happening for few of my work colleagues as well.

Diagnostic Info & Error Log local env


site_url():  https://example.test/wp
home_url():  https://example.test

Database Name:  snip
Table Prefix:   wp_

WordPress Version:  5.8.2

Media Files: ...... 2.1.0
WP Migrate DB Pro:  2.2.1
CLI: .............. 1.6.0

Web Server: ..................... nginx/1.21.4
PHP: ............................ 7.4.26
WP Memory Limit: ................ 512M
PHP Time Limit: ................. 600
Blocked External HTTP Requests:   None
fsockopen: ...................... Enabled
OpenSSL: ........................ OpenSSL 1.1.1f  31 Mar 2020
cURL: ........................... Enabled
Enable SSL verification setting:  No
Opcache Enabled: ................ Enabled

MySQL: ................... 5.5.5-10.6.5-MariaDB-1:10.6.5+maria~focal
ext/mysqli: .............. yes
WP Locale: ............... en_US
DB Charset: .............. utf8mb4
WPMDB_STRIP_INVALID_TEXT:  No

Debug Mode: ... Yes
Debug Log: .... Yes
Debug Display:  Yes
Script Debug:   Yes
PHP Error Log:  /web/app/debug.log

WP Max Upload Size:  512 MB
PHP Post Max Size:   512 MB

WPMDB Bottleneck: ...... 25 MB
Compatibility Mode: .... No
Delay Between Requests:  0

WP_HOME: ....... https://example.test
WP_SITEURL: .... https://example.test/wp
WP_CONTENT_URL:  https://example.test/app
WP_CONTENT_DIR:  /web/app
WP_PLUGIN_DIR:   /web/app/plugins
WP_PLUGIN_URL:   https://example.test/app/plugins

Media Files
Transfer Bottleneck: ...... 512 MB
Upload Folder Permissions:  775

Active Theme Name:    Broadbandnow
Active Theme Folder: /web/app/themes/broadbandnow/resources

Active Plugins
 -  Query Monitor (v3.7.1) by John Blackbourn
 -  Advanced Custom Fields PRO (v5.11.4) by Delicious Brains
 -  Akismet Anti-Spam (v4.2.1) by Automattic
 -  Classic Editor (v1.6.2) by WordPress Contributors
 -  Enable Media Replace (v3.6.3) by ShortPixel
 -  Members (v3.1.6) by MemberPress
 -  Permalink Manager Pro (v2.2.14) by Maciej Bis
 -  Redirection (v5.1.3) by John Godley
 -  Redis Object Cache (v2.0.22) by Till Krüss
 -  Regenerate Thumbnails Advanced (v2.4.0) by ShortPixel
 -  Safe SVG (v1.9.9) by Daryll Doyle
 -  ShortPixel Image Optimizer (v4.22.6) by ShortPixel
 -  Wordfence Security (v7.5.7) by Wordfence
 -  WordPress Importer (v0.7) by wordpressdotorg
 -  Yoast SEO (v17.7.1) by Team Yoast
 -  WP Migrate DB Pro CLI (v1.6.0) by Delicious Brains
 -  WP Migrate DB Pro Media Files (v2.1.0) by Delicious Brains
 -  WP Migrate DB Pro (v2.2.1) by Delicious Brains

Must-Use Plugins
 -  Bedrock Autoloader (v1.0.3) by Roots
 -  Disallow Indexing (v1.0.0) by Roots
 -  Permalink manager customizer (v1.0.0) 
 -  Disable plugins (v1.0.0) 
 -  Register Theme Directory (v1.0.0) by Roots
 -  Register WP Rocket Licence (v1.0.0) 

Diagnostic Info & Error Log different website qa env


site_url():  https://example.com/wp
home_url():  https://example.com

Database Name:  snip
Table Prefix:   wp_

WordPress Version:  5.8.2

Media Files: ...... 2.1.0
WP Migrate DB Pro:  2.2.1
CLI: .............. 1.6.0

Web Server: ..................... nginx/1.21.4
PHP: ............................ 8.0.13
WP Memory Limit: ................ 40M
PHP Time Limit: ................. 30
Blocked External HTTP Requests:   None
fsockopen: ...................... Enabled
OpenSSL: ........................ OpenSSL 1.1.1k  25 Mar 2021
cURL: ........................... Enabled
Enable SSL verification setting:  No
Opcache Enabled: ................ Enabled

MySQL: ................... 8.0.13
ext/mysqli: .............. yes
WP Locale: ............... en_US
DB Charset: .............. utf8mb4
WPMDB_STRIP_INVALID_TEXT:  No

Debug Mode: ... Yes
Debug Log: .... Yes
Debug Display:  Yes
Script Debug:   Yes
PHP Error Log:  /var/www/html/web/app/debug.log

WP Max Upload Size:  32 MB
PHP Post Max Size:   32 MB

WPMDB Bottleneck: ...... 25 MB
Compatibility Mode: .... No
Delay Between Requests:  0

WP_HOME: ....... https://example.com
WP_SITEURL: .... https://example.com/wp
WP_CONTENT_URL:  https://example.com/app
WP_CONTENT_DIR:  /var/www/html/web/app
WP_PLUGIN_DIR:   /var/www/html/web/app/plugins
WP_PLUGIN_URL:   https://example.com/app/plugins

Media Files
Transfer Bottleneck: ...... 32 MB
Upload Folder Permissions:  775

Active Theme Name:    asdf headless theme
Active Theme Folder:  /var/www/html/web/app/themes/asdf

Active Plugins
 -  Query Monitor (v3.7.1) by John Blackbourn
 -  Admin Columns Pro - Advanced Custom Fields (ACF) (v2.7) by AdminColumns.com
 -  Admin Columns Pro - Yoast SEO (v1.1) by AdminColumns.com
 -  Add WPGraphQL SEO (v4.16.0) by Ash Hitchcock
 -  Admin Columns Pro (v5.6.4) by AdminColumns.com
 -  Advanced Custom Fields PRO (v5.11.4) by Delicious Brains
 -  WP Offload Media (v2.5.6) by Delicious Brains
 -  Enable Media Replace (v3.6.3) by ShortPixel
 -  Members (v3.1.6) by MemberPress
 -  Permalink Manager Pro (v2.2.14) by Maciej Bis
 -  Redis Object Cache (v2.0.22) by Till Krüss
 -  Regenerate Thumbnails Advanced (v2.4.0) by ShortPixel
 -  WordPress Importer (v0.7) by wordpressdotorg
 -  Yoast SEO (v17.8) by Team Yoast
 -  WPGraphQL for Advanced Custom Fields (v0.5.3) by WPGraphQL, Jason Bahl
 -  WPGraphQL JWT Authentication (v0.4.1) by WPGraphQL, Jason Bahl
 -  WP GraphQL (v1.6.10) by WPGraphQL
 -  WP Migrate DB Pro CLI (v1.6.0) by Delicious Brains
 -  WP Migrate DB Pro Media Files (v2.1.0) by Delicious Brains
 -  WP Migrate DB Pro (v2.2.1) by Delicious Brains
 -  Yoast Test Helper (v1.15) by Team Yoast

Must-Use Plugins
 -  Bedrock Autoloader (v1.0.3) by Roots
 -  Redis Cache by URI (v0.1)
 -  Register Theme Directory (v1.0.0) by Roots
 -  General Site Functions and Configuration (v1.0.0)
 -  HTML to JSON parser (v0.1)

Diagnostic Info & Error Log prod env


site_url():  https://prod.com/wp
home_url():  https://prod.com

Database Name:  snip
Table Prefix:   wp_

WordPress Version:  5.8.2

Media Files: ...... 2.1.0
WP Migrate DB Pro:  2.2.1
CLI: .............. 1.6.0

Web Server: ..................... nginx/1.21.4
PHP: ............................ 8.0.13
WP Memory Limit: ................ 40M
PHP Time Limit: ................. 30
Blocked External HTTP Requests:   None
fsockopen: ...................... Enabled
OpenSSL: ........................ OpenSSL 1.1.1k  25 Mar 2021
cURL: ........................... Enabled
Enable SSL verification setting:  No
Opcache Enabled: ................ Enabled

MySQL: ................... 8.0.13
ext/mysqli: .............. yes
WP Locale: ............... en_US
DB Charset: .............. utf8mb4
WPMDB_STRIP_INVALID_TEXT:  No

Debug Mode: ... Yes
Debug Log: .... Yes
Debug Display:  Yes
Script Debug:   Yes
PHP Error Log:  /var/www/html/web/app/debug.log

WP Max Upload Size:  32 MB
PHP Post Max Size:   32 MB

WPMDB Bottleneck: ...... 25 MB
Compatibility Mode: .... No
Delay Between Requests:  0

WP_HOME: ....... https://prod.com
WP_SITEURL: .... https://prod.com/wp
WP_CONTENT_URL:  https://prod.com/app
WP_CONTENT_DIR:  /var/www/html/web/app
WP_PLUGIN_DIR:   /var/www/html/web/app/plugins
WP_PLUGIN_URL:   https://prod.com/app/plugins

Media Files
Transfer Bottleneck: ...... 32 MB
Upload Folder Permissions:  755

Active Theme Name:    asdf headless theme
Active Theme Folder:  /var/www/html/web/app/themes/asdf

Active Plugins
 -  Query Monitor (v3.7.1) by John Blackbourn
 -  Admin Columns Pro - Advanced Custom Fields (ACF) (v2.7) by AdminColumns.com
 -  Admin Columns Pro - Yoast SEO (v1.1) by AdminColumns.com
 -  Add WPGraphQL SEO (v4.16.0) by Ash Hitchcock
 -  Admin Columns Pro (v5.6.4) by AdminColumns.com
 -  Advanced Custom Fields PRO (v5.11.4) by Delicious Brains
 -  WP Offload Media (v2.5.6) by Delicious Brains
 -  Enable Media Replace (v3.6.3) by ShortPixel
 -  Members (v3.1.6) by MemberPress
 -  Permalink Manager Pro (v2.2.14) by Maciej Bis
 -  Redis Object Cache (v2.0.22) by Till Krüss
 -  Regenerate Thumbnails Advanced (v2.4.0) by ShortPixel
 -  WordPress Importer (v0.7) by wordpressdotorg
 -  Yoast SEO (v17.8) by Team Yoast
 -  WPGraphQL for Advanced Custom Fields (v0.5.3) by WPGraphQL, Jason Bahl
 -  WPGraphQL JWT Authentication (v0.4.1) by WPGraphQL, Jason Bahl
 -  WP GraphQL (v1.6.10) by WPGraphQL
 -  WP Migrate DB Pro CLI (v1.6.0) by Delicious Brains
 -  WP Migrate DB Pro Media Files (v2.1.0) by Delicious Brains
 -  WP Migrate DB Pro (v2.2.1) by Delicious Brains
 -  Yoast Test Helper (v1.15) by Team Yoast

Must-Use Plugins
 -  Bedrock Autoloader (v1.0.3) by Roots
 -  Redis Cache by URI (v0.1)
 -  Register Theme Directory (v1.0.0) by Roots
 -  General Site Functions and Configuration (v1.0.0)
 -  HTML to JSON parser (v0.1)

It happens on these 3 totally different envs.

Cheers, Furai

kevinwhoffman commented 2 years ago

Hi and thanks for the report. I wanted to let you know that this issue should be resolved in the latest 2.2.2 release:

Bug fix: Opening Find & Replace no longer results in a JavaScript error when SCRIPT_DEBUG is true

We were able to determine that the error was happening when the SCRIPT_DEBUG constant was set to true. In 2.2.2, we fixed the error so that the Find & Replace screen should function regardless of whether SCRIPT_DEBUG is set or not.

You can view the full changelog here: https://deliciousbrains.com/wp-migrate-db-pro/doc/changelog/

furai commented 2 years ago

Thank you!