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 create custom 401, 403 and 500 error pages?
- When to use Exceptions vs Error Objects vs just plain false/null
- WordPress URL Rewrite not working
- Image Upload “exceeds the maximum upload size for this site”, but php.ini is correct
- PHP – redirect https to http and www to non-www
- Create Image Uploader for Widget
- Bypass .htaccess when using download_url
- simple wordpress ajax plugin not working when not logged in
- How can I run a .php file located in my site’s root folder?
- Saving metabox repeatable fields
- how to create and show sessions in word press?
- do not show web page section when using advanced custom fields pro
- Restrict WordPress File Type Uploads by User Type
- How to get all existing post types
- New Plugin Review
- Create custom blocks for bootstrap
- Query String being Removed Creating a Pagination Issue within a Custom Plugin
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- Randomise upload filenames (or another solution to hide the original image URL from theft?)
- WordPress Scheduled Event Request Blocking
- Apache Fallback instead of add_rewrite_rule
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- Saving an array of dynamic repeater data as post_meta
- WordPress wpform plugin submit and get multiple checked value from checkbox [closed]
- Improve page speed loading using CDN and async or defer attribute
- Script to browser problem PHP
- Store a default value for a transient on plugin activation
- subdirectory index.php is not working
- wp query foreach deleting record returning only first or last item
- WordPress Custom field Colors
- Change WordPress Upload Folder using wp handle upload
- “Undefined index” error when saving empty array with checkboxes
- WordPress Specified file failed upload test
- Is it save to use eval for a jQuery callback method coming from the database?
- Scheduling an event inside plugin class is not working
- How to Change CSS Colors from Custom Plugin Settings Page
- Passing the name of selected color from the custom component to `render_callback`
- Any ideas why I am getting “I’m getting “wp-admin/admin-ajax.php 401 (Unauthorized)”
- Cant register rest routs from class instance
- How to allow download url redirection only if user logged in WordPress site?
- wordpress frontend editor to add extra css to website
- Get featured image with custom size outside WordPress
- Images Uploaded saving onto older/previous year folders
- Removing files programmatically
- How to Make Thumbnail of Post Stay Animated
- PHP: How to access db the right way in plugin?
- select a single val though a table in wordpress
- How to decrease the max file upload size without using php.ini or htaccess?
- Help with accessing wp-admin page and resolving error messages
- WordPress – Get Posts with Category data
- Change image data durgin upload
- How to use wp_send_json() and output the value with ajax?
- Is it possible to access admin-ajax.php using PHP?
- Call to “admin_notices” hook from a static method
- How to Create custom block for displaying information in content section which act like shortcode
- How to detect and handle the time difference between server and user in WordPress?
- How to setup the Email piping in WordPress plugin?
- Reliable way to add nonce to HTTP Header in WordPress?
- Getting an error when my plugin is updated, but the files update correctly
- Creating a POP Alert
- ssl redirect function is not working
- WordPress Plugin Development – get_option error
- how to add new PHP page in WordPress plugin
- How can I get my WordPress plugin to receive data and relay it in an ajax/php request to a remote server that requires authentication?
- Constant expression contains invalid operations plugin class properties visibility
- Gutenberg blocks shortcodes compatibility
- Save custom field on WP_List_Table
- Load script and styles using an array of resources
- Input field duplicates on form submit by jQuery
- I want url from a file in media using title file
- Crop an image after upload on custom account page
- Restrict File Type Uploads by User on Wordress via functions.php
- Resource 404 error on multisite subdirectory install
- INCOMING: Wall of code for form and $_POST, not updating custom field’s value
- add shortcode heading showing multiple time
- Name Input from widget displays Sidebar name instead of saved data
- WP multisite network plugin fails to see classes loaded with spl autoload
- AJAX & PHP | Call a specific PHP function from a PHP file via AJAX?
- Edit Image/Image Details – Replace button missing
- What is this mark for “? function()” [closed]
- using a shortcode in a hyperlink
- How to use multiple 404 Error Pages in WordPress
- Import js variables loaded via wp_localize_script() into js module without global scope connection
- Custom taxonomy with page post type – WordPress
- Query posts by custom taxonomy slug in WP REST API?
- oneOf JSON Schema validation not properly working for custom post meta value?
- Too few arguments at registering new templates in my plugin
- I want to lists posts in wordpress to nearest location entered by the user
- get_post_meta returns on side but it doesn’t return on bottom of admin page