Yoast / yoast-acf-analysis

WordPress plugin that adds the content of all ACF fields to the Yoast SEO score analysis.
https://wordpress.org/plugins/acf-content-analysis-for-yoast-seo/
GNU General Public License v3.0
62 stars 20 forks source link

JavaScript errrors from plugin #83

Open roboweaver opened 6 years ago

roboweaver commented 6 years ago

Seeing these errors in the plugin:

VM4528 yoast-acf-analysis.js?ver=53d060ccc700b5fee12f02a4805fdeb8:23 Uncaught TypeError: acf.add_action is not a function
    at App.bindListeners (VM4528 yoast-acf-analysis.js?ver=53d060ccc700b5fee12f02a4805fdeb8:23)
    at new App (VM4528 yoast-acf-analysis.js?ver=53d060ccc700b5fee12f02a4805fdeb8:16)
    at HTMLDocument.<anonymous> (VM4528 yoast-acf-analysis.js?ver=53d060ccc700b5fee12f02a4805fdeb8:326)
    at i (VM4495 load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu,wp-a11y,jquery-ui-autocomplet&load[]=e,underscore,wp-util,plupload&ver=53d060ccc700b5fee12f02a4805fdeb8:2)
    at Object.fireWith [as resolveWith] (VM4495 load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu,wp-a11y,jquery-ui-autocomplet&load[]=e,underscore,wp-util,plupload&ver=53d060ccc700b5fee12f02a4805fdeb8:2)
    at Function.ready (VM4495 load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu,wp-a11y,jquery-ui-autocomplet&load[]=e,underscore,wp-util,plupload&ver=53d060ccc700b5fee12f02a4805fdeb8:2)
    at HTMLDocument.K (VM4495 load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu,wp-a11y,jquery-ui-autocomplet&load[]=e,underscore,wp-util,plupload&ver=53d060ccc700b5fee12f02a4805fdeb8:2)`

`Refused to display 'https://accounts.google.com/o/oauth2/auth?client_id=554770891598-psq41tn4ud38mrjbv792ekq2segmh68r.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.readonly&immediate=true&include_granted_scopes=true&authuser=-1&login_hint=robweaver%40workfront.com&proxy=oauth2relay1989858901&redirect_uri=postmessage&origin=https%3A%2F%2Fworkfront.local&response_type=token&gsiwebsdk=1&state=367241133%7C0.932242089&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en.MwMdaaKpZhc.O%2Fm%3D__features__%2Fam%3DAQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAGLTcCMgYkua7qDeYnxoLf7GjdxpyoP9JQ' in a frame because it set 'X-Frame-Options' to 'sameorigin'.`

`Uncaught TypeError: acf.get_fields is not a function
    at module.exports (VM4528 yoast-acf-analysis.js?ver=53d060ccc700b5fee12f02a4805fdeb8:213)
    at Collect.getData (VM4528 yoast-acf-analysis.js?ver=53d060ccc700b5fee12f02a4805fdeb8:280)
    at Collect.getFieldData (VM4528 yoast-acf-analysis.js?ver=53d060ccc700b5fee12f02a4805fdeb8:233)
    at Collect.append (VM4528 yoast-acf-analysis.js?ver=53d060ccc700b5fee12f02a4805fdeb8:255)
    at VM4520 wp-seo-post-scraper-541.min.js?ver=5.4.1:30
    at d (VM4520 wp-seo-post-scraper-541.min.js?ver=5.4.1:21)
    at d (VM4520 wp-seo-post-scraper-541.min.js?ver=5.4.1:22)
    at k._applyModifications (VM4520 wp-seo-post-scraper-541.min.js?ver=5.4.1:30)
    at B.modifyData (VM4520 wp-seo-post-scraper-541.min.js?ver=5.4.1:25)
    at B.runAnalyzer (VM4520 wp-seo-post-scraper-541.min.js?ver=5.4.1:25)`
`VM4746 load-scripts.php?c=1&load[]=hoverIntent,common,admin-bar,wp-pointer,heartbeat,autosave,wp-ajax-response,jquery-color,wp-lists,quicktags,jquery-query,admin-c&load[]=omments,suggest,jquery-ui-mouse,jquery-ui-sortable,postbox,tags-suggest,tags-box,word-count,post,editor-expand,thickbox,shortcod&load[]=e,backbone,wp-backbone,media-models,wp-plupload,mediaelement,wp-mediaelement,media-views,media-editor,media-audiovideo,mce-view,&load[]=imgareaselect,image-edit,svg-painter,wp-auth-check,jquery-ui-tabs,jquery-ui-draggable,jquery-ui-slider,jquery-touch-punch,iris,w&load[]=p-color-picker,media-upload,jquery-ui-resizable,jquery-ui-button,jquery-ui-dialog,wplink,wp-embed&ver=53d060ccc700b5fee12f02a4805fdeb8:680 Uncaught TypeError: Cannot read property 'hasClass' of undefined
    at HTMLDocument.<anonymous> (VM4746 load-scripts.php?c=1&load[]=hoverIntent,common,admin-bar,wp-pointer,heartbeat,autosave,wp-ajax-response,jquery-color,wp-lists,quicktags,jquery-query,admin-c&load[]=omments,suggest,jquery-ui-mouse,jquery-ui-sortable,postbox,tags-suggest,tags-box,word-count,post,editor-expand,thickbox,shortcod&load[]=e,backbone,wp-backbone,media-models,wp-plupload,mediaelement,wp-mediaelement,media-views,media-editor,media-audiovideo,mce-view,&load[]=imgareaselect,image-edit,svg-painter,wp-auth-check,jquery-ui-tabs,jquery-ui-draggable,jquery-ui-slider,jquery-touch-punch,iris,w&load[]=p-color-picker,media-upload,jquery-ui-resizable,jquery-ui-button,jquery-ui-dialog,wplink,wp-embed&ver=53d060ccc700b5fee12f02a4805fdeb8:680)
    at HTMLDocument.dispatch (VM4495 load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu,wp-a11y,jquery-ui-autocomplet&load[]=e,underscore,wp-util,plupload&ver=53d060ccc700b5fee12f02a4805fdeb8:3)
    at HTMLDocument.r.handle (VM4495 load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu,wp-a11y,jquery-ui-autocomplet&load[]=e,underscore,wp-util,plupload&ver=53d060ccc700b5fee12f02a4805fdeb8:3)
    at Object.trigger (VM4495 load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu,wp-a11y,jquery-ui-autocomplet&load[]=e,underscore,wp-util,plupload&ver=53d060ccc700b5fee12f02a4805fdeb8:3)
    at Object.a.event.trigger (VM4495 load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu,wp-a11y,jquery-ui-autocomplet&load[]=e,underscore,wp-util,plupload&ver=53d060ccc700b5fee12f02a4805fdeb8:9)
    at HTMLDocument.<anonymous> (VM4495 load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu,wp-a11y,jquery-ui-autocomplet&load[]=e,underscore,wp-util,plupload&ver=53d060ccc700b5fee12f02a4805fdeb8:3)
    at Function.each (VM4495 load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu,wp-a11y,jquery-ui-autocomplet&load[]=e,underscore,wp-util,plupload&ver=53d060ccc700b5fee12f02a4805fdeb8:2)
    at a.fn.init.each (VM4495 load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu,wp-a11y,jquery-ui-autocomplet&load[]=e,underscore,wp-util,plupload&ver=53d060ccc700b5fee12f02a4805fdeb8:2)
    at a.fn.init.trigger (VM4495 load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-widget,jquery-ui-position,jquery-ui-core,jquery-ui-menu,wp-a11y,jquery-ui-autocomplet&load[]=e,underscore,wp-util,plupload&ver=53d060ccc700b5fee12f02a4805fdeb8:3)
    at Object.<anonymous> (VM4746 load-scripts.php?c=1&load[]=hoverIntent,common,admin-bar,wp-pointer,heartbeat,autosave,wp-ajax-response,jquery-color,wp-lists,quicktags,jquery-query,admin-c&load[]=omments,suggest,jquery-ui-mouse,jquery-ui-sortable,postbox,tags-suggest,tags-box,word-count,post,editor-expand,thickbox,shortcod&load[]=e,backbone,wp-backbone,media-models,wp-plupload,mediaelement,wp-mediaelement,media-views,media-editor,media-audiovideo,mce-view,&load[]=imgareaselect,image-edit,svg-painter,wp-auth-check,jquery-ui-tabs,jquery-ui-draggable,jquery-ui-slider,jquery-touch-punch,iris,w&load[]=p-color-picker,media-upload,jquery-ui-resizable,jquery-ui-button,jquery-ui-dialog,wplink,wp-embed&ver=53d060ccc700b5fee12f02a4805fdeb8:5)
kraftner commented 6 years ago

Can you add some more info like versions of WordPress and Yoast SEO? On what page does that happen? Under some special conditions and so on...

roboweaver commented 6 years ago

WordPress 4.8.2 (running MultiSite unfortunately). Yoast 5.3.3 On an edit post with some ACF fields on it.

kraftner commented 6 years ago

What ACF Version? Any other plugins active?

overwine commented 6 years ago

I'm having similar javascript issues, but only in backend. More specifically if I'm using a repeater with a conditional field. It seems to work fine when I just put one "row" in and then save it. But if I try to add two right off the bat, it breaks with these errors. I'm using Wordpress 4.8.2, ACF Pro 5.6.3, ACF Content Analysis for Yoast SEO 2.0.0, Yoast SEO Premium 5.5.1. Hope this helps!

Uncaught TypeError: Cannot set property 'replacement' of undefined
    at replacevars.js:48
    at Function.m.each.m.forEach (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-menu,wp-a11y,jquery-ui-autocomplete,underscore,wp-util,plupload,jquery-ui-resizable&ver=4.8.2:93)
    at App.updateReplaceVars (replacevars.js:44)
    at d (acf-input.min.js?ver=5.6.3:1)
    at Object.i (acf-input.min.js?ver=5.6.3:1)
    at Object.do_action (acf-input.min.js?ver=5.6.3:1)
    at acf-input.min.js?ver=5.6.3:1
replacevars.js:48 Uncaught TypeError: Cannot set property 'replacement' of undefined
    at replacevars.js:48
    at Function.m.each.m.forEach (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-menu,wp-a11y,jquery-ui-autocomplete,underscore,wp-util,plupload,jquery-ui-resizable&ver=4.8.2:93)
    at App.updateReplaceVars (replacevars.js:44)
    at d (acf-input.min.js?ver=5.6.3:1)
    at Object.i (acf-input.min.js?ver=5.6.3:1)
    at Object.do_action (acf-input.min.js?ver=5.6.3:1)
    at Object.remove_el (acf-input.min.js?ver=5.6.3:1)
    at acf-input.min.js?ver=5.6.3:3
replacevars.js:48 Uncaught TypeError: Cannot set property 'replacement' of undefined
    at replacevars.js:48
    at Function.m.each.m.forEach (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-menu,wp-a11y,jquery-ui-autocomplete,underscore,wp-util,plupload,jquery-ui-resizable&ver=4.8.2:93)
    at App.updateReplaceVars (replacevars.js:44)
    at d (acf-input.min.js?ver=5.6.3:1)
    at Object.i (acf-input.min.js?ver=5.6.3:1)
    at Object.do_action (acf-input.min.js?ver=5.6.3:1)
    at HTMLInputElement.<anonymous> (acf-input.min.js?ver=5.6.3:1)
    at HTMLDocument.dispatch (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-menu,wp-a11y,jquery-ui-autocomplete,underscore,wp-util,plupload,jquery-ui-resizable&ver=4.8.2:3)
    at HTMLDocument.r.handle (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-menu,wp-a11y,jquery-ui-autocomplete,underscore,wp-util,plupload,jquery-ui-resizable&ver=4.8.2:3)
replacevars.js:48 Uncaught TypeError: Cannot set property 'replacement' of undefined
    at replacevars.js:48
    at Function.m.each.m.forEach (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-menu,wp-a11y,jquery-ui-autocomplete,underscore,wp-util,plupload,jquery-ui-resizable&ver=4.8.2:93)
    at App.updateReplaceVars (replacevars.js:44)
    at d (acf-input.min.js?ver=5.6.3:1)
    at Object.i (acf-input.min.js?ver=5.6.3:1)
    at Object.do_action (acf-input.min.js?ver=5.6.3:1)
    at HTMLSelectElement.<anonymous> (acf-input.min.js?ver=5.6.3:1)
    at HTMLDocument.dispatch (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-menu,wp-a11y,jquery-ui-autocomplete,underscore,wp-util,plupload,jquery-ui-resizable&ver=4.8.2:3)
    at HTMLDocument.r.handle (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-menu,wp-a11y,jquery-ui-autocomplete,underscore,wp-util,plupload,jquery-ui-resizable&ver=4.8.2:3)
    at Object.trigger (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-menu,wp-a11y,jquery-ui-autocomplete,underscore,wp-util,plupload,jquery-ui-resizable&ver=4.8.2:3)
kraftner commented 6 years ago

@overwine The issue you're having is something different and already known. See #60 for details.

kraftner commented 6 years ago

@roboweaver I just had a new idea what this could be - maybe it is related to #80.

Is it possible that you had ACF Pro active at some point but then downgraded to the free version? If you're running ACF 4 (the free version) can you run this

 YoastACFAnalysisConfig.acfVersion

in the browser console and tell me what it returns?

kraftner commented 6 years ago

@roboweaver Any news on this, especially regarding my question above?