In a nutshell there is no generic reliable way to load WordPress core from arbitrary file. Since core and extensions directories are independent from each other (they are co-located by default, not by necessity) only core configuration “knows” where extensions are, but not other way around.
In private code things like this just get hardcoded. In public code this is pretty much undoable properly.
If it’s not critical for you to modify core load process then custom URL is definitely way to go. Implemented via Rewrite API from scratch or as endpoint it will be reasonably reliable.
Related Posts:
- How to delete all records from or empty a custom database table?
- Doubt using $wpbd->get_col for a single column
- Help With MySQL to WPDB Query Conversion
- Create a table with wordpress plugin boilerplate
- plugin code is pulling information from database in one instance and not in other. What is wrong?
- after wordpress update to 3.5+ i get many errors in plugin wpdb::prepare()
- WPDB: Update table
- Issue running db create table query from static method
- How to access the WordPress DB from a plugin file
- WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version [closed]
- $wpdb->delete not working for me
- How to securely controlling data without keeping it in postmeta?
- Write mysql credentials in plugin
- Is it safe to increase/alter the size of the wp_post.guid column from VARCHAR(255) to VARCHAR(2048)?
- “Master” WordPress Multisite – Database Sync
- Better ads plugin has 500.000 entries in wp_postmeta
- Object method calling for global $wpdb in header.php
- Using wpdb without loading all plug-ins via wp-load.php
- How to create multiple database tables on plugin activation?
- Can I create a table on my DB without creating a plugin?
- WordPress : Explain Plugins & Theme string value in database
- Is it necessary to auto delete my WP plugin database tables when users deactivate/delete my plugin?
- Does deleting a Plugin via the WordPress admin ‘completely’ remove the code?
- Creating a CSV with PHP inside the plugin directory
- Plugins in WP_Options but not Active
- How to insert multiple postmeta values with one query?
- How do i edit the plugin files in DataBase via phpMyAdmin?
- WordPress as a data-store?
- How to insert and call new data in wordpress website database through a plugin
- Cannot get wpdb data (Error in a simple fuction) [closed]
- Gathering and logging data from a plugin: how to do it without race conditions?
- How to pass the API key to the client from the database? [closed]
- Problem of encoding characters (apostrophes) in my posts publications
- Separate database for a wordpress plugin
- Is there a rule for wordpress plugins developers to not do any database changes upon update?
- How to keep variable `$post` to using in another file
- dbDelta not adding additional columns in plugin database update
- $wpdb update query in plugin only updating one column
- Updating options into the wp database performance
- Making my plugin create a page?
- Ajax save data to database on document ready, no data being saved
- Add some fileds to the wp_posts table
- How to edit a published post?
- Best/Correct way to add an option to a category
- Plugin has added weird data in wp_options, set to autoload
- Always get creating a new table with foreign key
- How to do database for download stats?
- What is the WordPress approach to custom data?
- How to create plugin/ page that reads from database
- How retreive saved data from gravity forms in my template?
- DB Query not working in Plugin
- Assign all Post in Wp to a specific Category
- External wpdb connections in different plugins on single page
- Storing The Data Collected by Ninja Forms into Another (custom) Database [closed]
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- Where do plugin variables live in the db?
- WordPress plugin boilerplate table create
- Mowing site to another domain in simplest way
- Store plugin page content in wp_options?
- How to relate 3 wordpress components with each other (Create database relationships)
- Creating a search form and displaying results
- WordPress plugin: efficient way to store large data
- Displaying data from another database
- How can I store data from custom fields to custom tables?
- Using $wpdb in a plugin, what sort of data does it return?
- Plugin: connect to external database without showing password
- Storing Form data in a different database
- Is this plugin safe to run?
- Integrating Custom Database with WordPress
- How to display results from a data table with an encrypted user id?
- Linked pages from plugin on front can’t see $wpdb
- How to add a custom form to a plugin’s setting page
- update_option creates an option, which empties on a blog reload
- More than one WordPress site using the same database – how to disable plugin for one site?
- add_action for publish_post doesn’t work
- Need help creating asynchronous data scraper in WordPress
- Getting URL GET parameter with Code snippets and storing it in database?
- How to make a Product page without ordering and database
- How to get specific column data conditionally in database in WordPress?
- Same Plugin tables between wordpress installations
- ob_end_flush(): failed to send buffer of zlib output compression (0) in external php
- How can I display selected content from a seperate database in an Activity style widget?
- What database state changes happen after a post is manually “updated” with no changes?
- Bulk Edit Media Library alt, caption, image names
- How to fetch WordPress database values in JavaScript widget
- Can i stream data to a custom_post_type?
- create pages automatically and dynamically in wordPress
- Cant create table on plugin activation
- How do I add a medium to the WordPress database with my own plugin?
- any word search WordPress
- Optimise wordpress database using SQL after deleting registered images from Media Folder
- Performing CRUD operations on front end in wordpress
- How to implement data residency in my WordPress site
- How to add specific script to WordPress webpage that will working with user input and databases
- I want to schedule email (date, time is in database->table) wp_schedule_event() not working
- How to use WordPress header function and footer function and not load word press database
- $wpdb->insert not working inside save_post tag
- Get Shortcode output to database for static post_content
- add_action(‘the_content’, ‘my_plugin_content’) is null
- Store GravityForm data in phpmyadmin (mysql)