In most cases you shouldn’t access your plugin’s PHP files directly. By itself file is just a file, it has no way of knowing it is part of WordPress installation. Even purposely loading WP core from arbitrary file is very challenging to do in a generic and reliable way.
What you should be doing is pointing your form at one of WordPress endpoints and using hooks to connect your code to it.
For simple form submission you probably should start with studying wp-admin/admin-post.php endpoint and trying to make use of it.
Related Posts:
- WP Rest API: details of latest post including featured media url in one request?
- Prompted for FTP details even with FS_DIRECT set to true
- How to customise the output of the WP image gallery shortcode from a plugin?
- How does WordPress handle MySQL row lock errors?
- What is the best page ordering plugin that works well with WPML? [closed]
- Removing an action from an external plugin class
- Why does WordPress require a ftp server to be running on the webserver to transfer plugins?
- How can I have two different urls for the same page that load two different templates?
- How does WordPress Multisite know that a Plugin is installed?
- Generate custom output for page/URL in a plugin
- Is it a bad practice to go directly to the mysql database while developing a plugin?
- How does WordPress update plugins, without running into permissions issues?
- How to list the Hooks and order of execution in current loading page? [duplicate]
- Register Custom Post Type from Plugin
- Why would WordPress request FTP information when it can write to the file server?
- How can I enqueue a style only when a particular widget is active?
- How to bulk send emails
- How to handle the Plugin Version on Update using Tortoise SVN and the worpdress.org Plugin Repository?
- How to find installed plugins
- Setting up a multilingual wordpress site
- Automatically adding post and pages to new blog setups
- The Point of Using apply_filters()
- Add custom variable in Contact Form 7 mail body
- Storing Options in a Shortcode
- Add Product Subtitle to Woocommerce Product Page
- How to delete Passwrd Protected posts cookies when a user logged out from the site
- Map a custom id to wordpress post id
- What are wsm tables for?
- Force quit running background job
- WordPress Sitemap including pages that aren’t there
- How to fix the woocommerce – adaranth.com redirection issue [closed]
- Remove a custom options name/value pair
- How do I make a child theme I made POST through a 3rd party plugin?
- Adding regex filter to feedwordpress
- Unable to delete custom post types, confusion around capabilities
- Getting wp.me shortlink for wordpress custom post type
- Post Comments with Ajax in WordPress
- Execute js files doesn’t seem to work
- where is the main file in this plugin?
- Problem since update 3.5 [duplicate]
- How can I use a file in my plugin as a replacement for single.php on custom-post-type query?
- How to create a post with next buttons
- Allowed memory size exhausted problem
- How can i force wp-admin to use 2-column dashboard layout? [closed]
- How to keep track of new plugins published on wordpress.org?
- Is this a plug-in in wordpress or a custom JavaScript
- Plugin onclick button activate other plugin
- Moving Jetpack buttons to appear below the first H2 title on all project/post pages [closed]
- Show icons or badges under title on product archives/category pages
- How to automatically redirect to custom admin menu after plugin activation?
- How to get images using taxonomy ( WP Media Folder)
- Site shows URL instead of “meta title” after deleted few plugins (not any SEO plugin was deleted)
- Inserting shortcode in href – any ideas or workarounds?
- Convert to shortcode?
- Disallow: /wp-* in robots.txt?
- Add logo to admin menu in my plugin
- Structuring function with registration_errors hook
- Advanced video gallery plugin needed [closed]
- Displaying URL Based on User Input from a Form W/in a Dashboard Widget
- Problem with ajax plugin for refreshing posts
- Is there any plugin to show number of clicks on the link?
- how to resubmit a submitted form with gravity forms plugin
- wp_query ‘s’ parameter does not work with WC_AJAX
- Monitor all the queriers executed by my website
- problem disabling plugin only for mobile
- How to remove a hook written with $this?
- Create survey that redirects to sidebar menu customized to answers
- How to allow code like PHP, SQL, HTML to WPBakery Visual Composer?
- Changing author slug for a custom role without using plugin
- How can I mass-open/edit all WordPress posts & pages?
- Notice: unserialize(): Error at offset 0 of 1 bytes in plugin Accordion on WordPress
- How can I refresh the plugins cache manually?
- Need woocommerce function for getting cart list with items
- WPNeo Stripe connect does not work
- How can I customize Easy Appointment plugin?
- Allowing Comments on Posts
- how to add custom css at top above all css file for specific url
- Creating Custom Hook for my plugin
- Plugin Translation project not found
- Web Application Framework Compatibility with WP Plugin
- Plugin loaded, but not running
- Merge custom plugins in one folder
- how to create or rewrite files in wordpress plugin folder
- Show similar category portfolio items?
- Plugin options not appearing on options page using tabbed navigation
- how to protect wordpress website
- Top Contributors Plugin with Custom Post Type
- Plugin won’t activate, fatal error (widget class not found)
- WP-Minify 400 errors and open_basedir restriction in effect
- My WP site and password was hacked, what to do? [closed]
- map urls to plugins
- Google analytics not working on WordPress
- Is it possible to recover Deleted users?
- Social network plugins for WordPress [closed]
- I want to set a different banner for each product in the woocommerce plugin on my wordpress site
- Remove embed url for internal links
- WordPress Custom Page Blog Template Pagination Problem (Pagination Not Displaying)
- How to override plugin function in code snippets WordPress
- how to make yoast seo read text from custom fields in custom post type
- WordPress additional update of publications after importing WP All Import Pro