Issue 1
I was not seeing the embedded object in javascript because:
The error was, I thought plugins_url
always resolved to the plugins dir, it resolves to the dir of __FILE__
:
In my situation myplugin.js
and myplugin.php
are both in the same public/
dir, so this:
$script_url = plugins_url( 'public/myplugin.js', __FILE__ )
Was resolving as (notice the double public
):
http://server.example.com/wp-content/plugins/myplugin/public/public/myplugin.js
instead of
http://server.example.com/wp-content/plugins/myplugin/public/myplugin.js
Issue 2
I still see the error, however even with my plugin disabled, and managed to track it down to WooComerce by looking at the debug network tab and seeing the ajax request.
Related Posts:
- When should I use wp_register_script() with wp_enqueue_script() vs just wp_enqueue_script()?
- How can I get a list of all enqueued scripts and styles?
- Load CSS/Javascript in frontend conditionally if block is used
- How to properly dequeue scripts and styles in child theme?
- How can I de-register ALL styles all at once? And same with Javascript?
- Cannot deregister a script using wp_deregister_script
- Removing specific style from wp_head
- How to dequeue / deregister any theme styles and scripts
- Using wp_enqueue_script on shortcode function handler
- Enqueue script only for IE
- Hook for writing text string after footer scripts
- Conditionally dequeue dependency of scripts
- Benefits to enqueuing site scripts/stylesheets?
- Problem in wp_localize_script
- wp_enqueue_script vs. wp_register_script
- Adding dependencies to script enqueing
- How to dequeue / deregister parent theme style
- Why is it wrong to use admin_print_scripts-{hook} to enqueue a script (.js) file?
- Enqueueing Scripts on a Custom Top-level Menu Page
- Enqueue script with url_query variables?
- How to switch css files according to devices and button click?
- Performance-wise, is it better to enqueue a (small) script on every page or test to see if it’s needed?
- Bootstrap js refuses to load
- Stop WordPress editor embedding links
- Enque Typekit Fonts – Not Found
- How to load script-related styles automatically?
- Notice: wp_enqueue_script was called incorrectly
- How to cancel `wp_print_scripts`?
- How do I enqueue a JavaScript in my footer via the functions.php file?
- Do we have to register JQuery if we want to use it in wp_enqueue_script()?
- Including style.css in Child Theme
- wp_head() – list hooked actions with priorities?
- Retrieve URL of Script/Style and Dependencies
- wp enqueue script- jQuery not loading
- using conditionals on enqueue styles
- 404 Error on trying to enqueue a JS file
- Including files in Child Themes
- Can’t load JS File
- Exclude external uri for css and js version
- Do I need to register my own created .js and .css files
- How to set cookies to switch style sheets when a link is clicked and set it till another particular link is clicked?
- How to create a child theme with multiple css files.
- How to enqueu php files with custom variable & conditionals?
- plugins_url() incorrectly returning wp-include directory
- Unable to dequeue a plugin script. I think I’ve tried everything
- Change script type and src of plugins in theme
- Action hooked on wp_enqueue_scripts running twice
- Styles and scripts inside template part
- How to enqueue the script without hardcoded in the theme files?
- Why is .map being added to the end of my file path?
- Wp_enqueue is not printing the version
- How can I properly enqueue tags in WordPress to use with Web Components?
- Enqueuing script is adding extra text for google maps [closed]
- Custom script file enqueue has “?ver=4.5.1” when loading and doesn’t update
- get_stylesheet_directory() in child theme breaks parent scripts
- Use of CONSTANT in wp_enqueue_script not possible?
- wp_enqueue_scripts are apearing inline rather than as links
- How to remove all enqueued assets from the active theme?
- Not all my scripts are enqueueing
- JavaScript is not enqueuing
- browser showing connection was reset while accessing posts from local host
- Should we explicitely enqueue jQuery and our theme’s main stylesheet?
- wp_enqueue_style referencing parent theme
- Enqueueing Scripts/Styles mid-page
- how to enqueue javascript to manipulate acf input field in admin?
- add WordPress script to page conditionally by category
- load jquery in footer not working
- load a different stylesheet in a category post
- I want to set global directory locations for my CSS and JS locations. How?
- Fatal error: Call to undefined function wp_enqueue_media()
- javascript file is not enqueing
- Enqueueing Scripts and Styles to page template that has html
- Calling wp_localize_script in a different function
- is there a way to get all queued scripts/styles into a template without `get_header()`?
- thickbox never gets called (weird behavior)
- Filter enqueued styles and scripts
- wp_enqueue_script was called incorrectly. Scripts and styles
- Unqueue css file from specific page
- Modifying an enqueued script URL
- Enqueue registered dependencies only when necessary
- Set a parent script presence status true so that child scripts load in wordpress
- wp_enqueue_scripts action from a plugin overrides theme wp_enqueue_scripts no matter what the priority setting
- Trouble with wp_enqueue_script
- Can’t get jquery script to work
- Proper use of wp_localize_script?
- Prevent caching when using wp_enqueue_script?
- Should I be enqueueing styles/scripts once and then dequeueing them?
- List all non-admin enqueued files
- How to load default wordpress scripts
- Generating embed code for users to share
- How do I display the handle for all front-end enqueued scripts in plugin options page?
- css3-mediaqueries-js failing with child theme
- Registering / Enqueing Scripts Not Working
- Enqueueing Script to footer puts it at the very bottom
- Bootstrap css not getting applied to the custom WordPress Dashboard Widget
- WooCommerce not enqueuing its scripts [closed]
- See Scripts used by Page
- wp_script_is(‘enqueued’) true, but file not requested in HTML
- Why do WordPress adds the id=”handle-{js|css}” attribute to scripts and stylesheet?
- Should I use wp_register_style(), wp_enqueue_style, or both?