You’ve got a path problem. When the plugin executes, any reference to a file is relative to the plugin folder.
Use developer tools (like Firebug) to see the actual request for the jpg file. You’ll see that it is trying to find the jpg file in the plugin folder. Adjust the path to the files.
Take a look at the get_template_directory_uri() function to help you get the proper path for your images. See https://developer.wordpress.org/reference/functions/get_template_directory_uri/ .
Related Posts:
- Image upload via FTP to wordpress media library
- Add htaccess rules with insert_with_markers at beginning of htaccess
- How to restrict wp generate attachment metadata() to certain intermediate image sizes
- How to upload a file to a folder named after the user_id via plugin
- Can’t upload image using media_sideload_image
- Redirect to another page using contact form 7? [closed]
- zip unzip attachments in wordpress
- Can’t upload CSV file to plugin directory using custom upload form in admin panel
- custom plugin with upload files does not work
- Problem with inserting multiple images in gallery of each WooCommerce product programmatically
- How to automatically convert images to WebP on WordPress?
- How to change upload directory in wp_handle_upload
- Decrease file size upload in Media
- Change Password Hint
- Debugging upload problem: What part of WP does actual image-resizing?
- Accessing a random image via ajax
- How to use a frontend URL with a Plugin
- WordPress template_include filter not working properly
- “The plugin generated 2694 characters of unexpected output…” on Plugin activation, CREATE TABLE sql command not working
- How to display a value from a radio button in the options menu in wordpress
- Custom image upload
- is it possible to force wordpress to always save thumbnails as ‘jpg’ not ‘png’
- How to call function at the bottom of post using plugin?
- Upload Image in a WordPress page using PHP
- WordPress (3.9.1) MultiSite Permissions. Is chown the answer?
- WP add_action factory
- how to retrieve uploaded url of zip files
- Swapping wp_dropdown_categories function with wp_category_checklist
- How to show phpinfo() only in a new tab?
- How can I remove a function that has been added to wordpress with add_filter?
- what is the best practice to add new field to an api route
- How to change redirection route to a php page for making it only accessible by logged-in members?
- How to use $_GET function WordPress backend
- Extend PHP regex to cover “srcset” and “style” attributes
- How do I Import / Upload Files with jQuery AJAX?
- WordPress function when file is uploaded, deleted or edited
- wp_insert_post: array only. wp_update_post: array|object (?)
- Building a REST API for your web app exposes primary keys of DB records?
- How to remove the message ‘We could not find any results for your search’ without changing template files and without adding posts/pages?
- Custom Registration username_exists / email_exists
- How can I search all plugins for composer’s vendor/autoload.php?
- Action Hook Inside WordPress Plugin Shortcode
- How do I increase the upload size only when editing special pages?
- Submit form to db
- Some problems in custom widget
- Add a custom WooCommerce settings tab with sections
- Checking page before applying image restrictions while uploading
- Hook on file upload
- PHP using external anonymous function inside class
- How to make Subdomain work for product_tag?
- How to serve WordPress folder over subdomain?
- Using ACF Relationship field to set post type to draft or published status
- Add Pre-Defined Value to Click Counter in WordPress
- Drop down question
- code that I can run, or a plug in to show what sql tables something pulls information from
- Automatic email message after manual user approval
- The style.php file inside theme-engine folder has other content on FTP
- custom mailchimp form using HTTP API
- How to override theme’s public static function inside of a trait?
- pass datetime using wp_localize_script to frontend from settings page
- add custom metabox to media library custom widget
- Display attached images of a page or post that are insetred using gallery
- overwrite wordpress gallery with custom gallery shortcode
- Enqueue sripts and styles only if function is called
- Add widget area from visual editor
- Register/enqueue scripts only on certain admin pages
- Looping through custom data in a custom table to display all items in a post
- How to properly escape in ternary operators – Wp Coding Standards?
- not able to access $_POST on backend profile update
- WordPress Redirect / Add_Rewrite_Rule – Non Index.php Page
- Custom Plugin Develoment, Form Action
- WordPress Query Crashes Browser
- Force CSV download with template_redirect
- How can I add “.html” to the end of a single URL on a WordPress website?
- wp_delete_attachment not working with multiple values
- How to use foreach and if statement within array of arrays?
- 301 redirect from webpage to wordpress page in the same root
- Rewrite /keyword1+keyword2.html to search page | .htaccess
- Renaming “Expand Details” within “Add Media”
- Custom post type single page return to listing page
- Save the outputted image into the Media Library, with a different filename and extension
- WordPress rewrite question
- Using Nonce for my Form
- Create new folder and upload files to custom folder via wp_handle_upload
- Can’t upload files
- Why I can download any file except PHP files from a URL but I can download any from another site?
- How to edit the default database of WordPress [closed]
- Cookie not created in AJAX request
- Check user last login date
- Transate plugin with js & wp_localize_script
- WP Custom tables query
- Import js variables loaded via wp_localize_script() into js module without global scope connection
- Redirect users by role to custom pages
- getJSON response to PHP
- Custom plugin with shortcode not working
- wp_register_script – illegal string offset
- How can I modify the html output of a custom post type admin page?
- how to escape alert/window.location.replace with variable
- Translate string in another langage than Locale
- How can we upload custom page files?