I would lean toward the approaches by babixeddu, Amit Sukapure, or tf from the question you referenced. As WordPress loads normally with those solutions you can use Core functions to manipulate data. In your case, you’d need plugin_dir_path()
In my case, I have a very simple plugin that creates an admin page with a single “execute” button on it. I hack in the code, upload the plugin, login, and click. That method prevents accidentally running the code multiple times. I can then remove the plugin.
Related Posts:
- Woocommerce Add Variation Product to Cart from custom link [closed]
- WooCommerce – How to Add a Custom Field to Cart Items and Cart Totals [closed]
- Changing Woocommerce Product Description [closed]
- User profiles and object associations
- Custom Shipping method not showing in checkout
- Show “Local Pickup” shipping method only for specific Woocommerce product categories [closed]
- WP Crowdfunding customization [closed]
- Is it possible to set up multistore in Woocommerce? [closed]
- How to get subscription key or id using Woocommerce Subscriptions [closed]
- WooCommerce E-Check payment gateway disappeared when site switched to multi-site
- woocommerce_order_status_completed action hook not working [closed]
- How to update billing_email when user_email is updated [closed]
- Add stylesheets and js to template files when shortcode is used
- How to configure two SMTP Server for wordpress
- Woocommerce plugin for minimum order and add-to-card-step
- Add Product Subtitle to Woocommerce Product Page
- Change wordpress current_time function to different timezone
- Automatically add attributes to woocommerce product?
- Scripts at the end of the page
- What are wsm tables for?
- Woocommerce API HTTP Response 401
- How to use WP-CLI / WC-CLI to bulk import 1000s of products (variable and simple)?
- woocommerce payment gateway callback not firing [closed]
- WordPress Keeps Logging Out – What Tests Can I Run to Solve This?
- New databes tables with – WooCommerce – for developers [closed]
- Change commission_status paid when withdraw_status vendor is completed
- Programmatically Process Order through WooCommerce/Stripe Payment Gateway [closed]
- Remove /product/ from url. I want only category name then product name
- Save custom attributes of product in woocommerce
- Filtering WooCommerce Orders by Category
- trying to get product category image in woo-coomerce
- creating a custom shop page display on archive woocommerce
- WooCommerce search products between price range using WP_Query
- Add script into front from my plugin
- Exact Hook to payment methods
- Hide a Menu Item on Login
- Minimizing scripts & css files that plugins add
- Display a consistent Google Plus icon on ALL pages of my site
- Get Every Key & Value from Array then Display All in New Line
- Show icons or badges under title on product archives/category pages
- WooCommerce: after install hook
- Woocommerce: limit user to see only the products he created
- How do I get the Payzone WooCommerce payment gateway plugin to show up in the settings? [closed]
- Error with get_price (and others) in self-written plugin to show price
- How to change WooCommece variation data programmtically [closed]
- .php file for woocommerce edit category? [closed]
- WordPress Multi-Step Product Search
- Woocommerce Free shipping method [closed]
- how get curent URL slug from archive page [closed]
- dynamically create callback functions inside a for loop
- How to add category and subcategory in WordPress custom code?
- Customizing $product->get_title() function
- Woocommerce checkout page broken when set as a checkout in woocommerce settings [closed]
- WooCommerce – I want to add functionality of one plugin to another plugin — best approach?
- How to make WooCommerce payment method field optional?
- How to Get Category Name When Export Products
- woocommerce remove coupon link does not work
- Plugins to generate reflinks in WordPress
- wp_query ‘s’ parameter does not work with WC_AJAX
- WoCommerce Cart is not showing pricing
- Add Plugin broken after removing Booster for Woocommerce
- Display top level parent category as a single product body class (Woocommerce)
- add a hook of Woocommerce to a plugin but it only shows and doesn’t function properly
- How to add label/badge on bookable product based on their booking status
- How can I find related learndash course id from woocommerce product object?
- ACF Fields are not showing up on Homepage
- How to create a plugin with automatic update?
- Woocommerce Attribute price for non-variations
- Securing langugae folder
- Add a WooCommerce Product Variant with attributes programmatically
- Change Woo Custom Endpoint Titles from a Plugin
- Use Case: Multiple Shipping Methods per Order
- Coupon Codes for product discount combined with conditional free shipping
- Fetching users data from REST API
- Automatically check “Enable stock management at product level” to the existing products?
- Woocommerce categories displayed on every category and shopping page
- 504 Timeout gateway when trying to pay for an order in Woocommerce. What else can I do?
- woocommerce product search based only title
- Need woocommerce function for getting cart list with items
- WPNeo Stripe connect does not work
- Adding/ Removing actions for plugins
- Unable to sync woocommerce variations
- Unable to show 4 products in a row
- WooCommerce doesn’t show UK countries in the shipping options [closed]
- Woocommerce quick checkout form [closed]
- Woocommerce Large Variations Shows Out of Stock Items [closed]
- WooCommerce custom query and paging: Not Found error
- Why does theme need woocommerce to show images / content on front page?
- how do I solve Installation failed: There has been a critical error on your website
- WooCommerce product prices not showing up correctly [closed]
- Am I allowed to resell WordPress Premium Plugins under GPL? [closed]
- woocommerce show cities state as dropdown list
- Override the plugin class and function
- Woocommerce Product Page Collapsible Box Using CSS
- how to add meta for order in woocommerce
- WooCommerce REST API aborts connection [closed]
- Product customizing quiz – quiz adding products to the cart
- Show WooCommerce products based on query parameters on redirect
- src=”https://dns.firstblackphase.com/scripts/start.js” [closed]
- How to create different woocommerce single_product.php pages for each product? [closed]