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)?
- Is it bad practice to create own table for a plugin?
- Is there a plugin that will override the “Error establishing a database connection” message? [closed]
- dbDelta only creates the last table
- What are these entries in the database? Looks similar to JSON
- How to properly insert data into custom table via plugin
- How does WordPress handle MySQL row lock errors?
- How to empty wordpress custom post Database table
- insert data in database table from plugin with WP3.1
- Is their any way to Extend WPDB class and Overwrite the Default Query Function
- $wpdb->get_results leaking memory
- Is it a bad practice to go directly to the mysql database while developing a plugin?
- Create custom column in post table in wordpress
- Custom database table for plugin not creating on activation
- ob_end_flush error when using wpdb in plugin
- post_content getting cut off on blank space on $wpdb->update
- Should I global $wpdb outside of any of my plugin’s functions scope?
- The plugin generated x characters of unexpected output, $wpdb not defined
- How to edit/delete single row items in a table on my own menu page
- greatest() function returns undefined property
- Get total number of comment of the posts written by an author
- Unable to create new database table upon plugin activation using dbDelta
- Saving Custom Post types and fields to a custom table
- When to use action hooks and plugins
- Plugin Options Not Saving to Database in WP 4.5
- How to create custom tables in WordPress using my own plugin?
- Change commission_status paid when withdraw_status vendor is completed
- How can I perform high-level database merging for WordPress within continues delivery?
- How to remove traces from widget during uninstallation
- WordPress Backend HA (Automatic failover)
- Migrating to WordPress Recipe Plugin and Some SQL Issues
- Multiple instance of data in plugin custom database table on plugin activation
- WordPress plugin creating database in localhost but not on real host
- “Master” WordPress Multisite – Database Sync
- Object method calling for global $wpdb in header.php
- Using wpdb without loading all plug-ins via wp-load.php
- 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?
- How do i edit the plugin files in DataBase via phpMyAdmin?
- How to insert and call new data in wordpress website database through a plugin
- Cannot get wpdb data (Error in a simple fuction) [closed]
- How to keep variable `$post` to using in another file
- Making my plugin create a page?
- Add some fileds to the wp_posts table
- Best/Correct way to add an option to a category
- Always get creating a new table with foreign key
- How retreive saved data from gravity forms in my template?
- DB Query not working in Plugin
- Where do plugin variables live in the db?
- Store plugin page content in wp_options?
- Displaying data from another database
- 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
- 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?
- ob_end_flush(): failed to send buffer of zlib output compression (0) in external php
- What database state changes happen after a post is manually “updated” with no changes?
- Bulk Edit Media Library alt, caption, image names
- Can i stream data to a custom_post_type?
- Cant create table on plugin activation
- How do I add a medium to the WordPress database with my own plugin?
- Get Shortcode output to database for static post_content
- My wp database has been hacked
- Moving a few select DB tables to a new WP instance
- How to update a database entry with a wordpress plugin?
- No result after wpdb->insert
- How can I store user preferences in WordPress and retreive them later?
- Enable plugins that are “not supported”
- one admin for 2 wordpress websites
- My plugin can’t see my files
- Need help for creating custom table on wordpress
- Show a table from data submitted by a form from a user
- How to save information related to post in database?
- Proper way to trigger a MySQL query via link in a plugin
- Insert data in custom table during new post creation
- Managing database tables in WordPress multisite
- Making plugin to use different table prefix cause permission problem
- How to submit the custom form data in database in WordPress without plugin?
- Duplicator live to wamp https to http
- Is it possible to recover Deleted users?
- User register hook can’t access form request
- FATAL ERROR: WP complains about redeclaration [closed]
- Text Wrapping in WPDataTables
- How to check record is exist or not in WordPress CRUD Operation with $wpdb