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:
- Custom product page’s style for printing
- wc_get_product_terms() throws “Notice: Undefined offset: 0”
- Enabling plugin on specific pages and subpages
- Configuring default woo commerce login with modal popup
- Custom plugin issue – Notice: Trying to get property of non-object in
- fetch price from different table woocommerce
- Woocommerce list variations that are added already to cart in Single Product
- Cannot save a custom meta field in quick edit
- {status}_{post_type} does not run correctly?
- How to capture customer’s credit card details via PayPal on my checkout page?
- Not displaying Woocommerce product page in lightbox
- Saving data only when payment is successful
- Fetching users data from REST API
- Automatically check “Enable stock management at product level” to the existing products?
- Change (replace) word in metabox
- how to make settings page for woocommerce plugin?
- Change hook to add_action in a plugin class
- redirect to a custom page
- wordpress plugin translation not working
- Woocommerce categories displayed on every category and shopping page
- Allow vendors on a WordPress site to pick from a gallery of pre-selected images when choosing product’s featured image
- Hide ‘add to cart’ button for some products [duplicate]
- 504 Timeout gateway when trying to pay for an order in Woocommerce. What else can I do?
- Change pricing in Woocommerce based on Category and Product [closed]
- woocommerce product search based only title
- Template conflict with WC Payment Method
- Many to many relationship for variable products
- Need woocommerce function for getting cart list with items
- WPNeo Stripe connect does not work
- Payment failed but order is placed on wp site
- How to change the product short description for each product with PHP?
- Adding/ Removing actions for plugins
- Get value from an input field and pass into update_meta_data as $meta_value
- Help needed with woocommerce (wc stripe) filter
- Widget logic using woocommerce product category
- Enqueued admin javascript for plugin settings page not executing
- Change value of Points earned in product data
- Problem with conditional woocommerce custom checkout field
- Adding javascript to header of MetroMagazine theme
- Unable to sync woocommerce variations
- WordPress Theme Conflict With Plugin
- How to change text in a page by utilizing a custom user id?
- How to Save settings of custom tab product page in admin side in a database?
- change product image url in widgets & shop page
- How woo-commerce store Product Data value in DB?
- Not getting result using ajax on wordpress
- How to allow customers to input a text as a product variation *and* charge per character?
- woocommerce blank page after clicking add to cart [closed]
- Which WordPress version to use for improved plugin compatibility? [closed]
- Woocommerce: deleted single-product.php, everything still works. How is it possible?
- Call/Run a Mathematica (.m) Shell Script from WordPress Page/Blog
- Plugin’s required JS not being inserted in my theme
- Holding 2 wp_user in the same action (to update billing_email when user_email is updated)
- Is there a way to include some external script to some or all pages in a wordpress site?
- Woocommerce Bookings – Resource needs to be allocated for part of the booking duration, not the whole booking
- Unable to show 4 products in a row
- Sort Reviews/Ratings by date on Woocommerce
- Move related products after product summary? [closed]
- Add A Button to WooCommerce Product Page
- 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]
- Turning Existing Eccommerce Site into Multi-SIte
- How ACF Advanced Custom Field works with Woocommerce Single Product [closed]
- is_plugin_active() not defined on active plugin, in the thumbnails.php file
- The plugin generated xxx characters of unexpected output during activation
- WooCommerce custom query and paging: Not Found error
- WooCommerce & WooCommerce Shopee Intergration
- How to execute init or woocommerce_init only for checkout page
- WP Customer Reviews call short code on another page [closed]
- Trying to disable all notifications except for one on woocommerce checkout page with css [closed]
- Woocommerce – Product Description heading [closed]
- Need help saving input fields for Security Deposit plugin in WC Vendors page
- Visual Composer Data Source?
- Send Processing Order Email from custom payment plugin
- Why does theme need woocommerce to show images / content on front page?
- Woocommerce disable checkout on specific day
- Populate Woocommerce order notes with custom field value
- Woocommerce Product Add-ons – Auto-select first option
- how do I solve Installation failed: There has been a critical error on your website
- How to add plus minus button on Input Quantity box Woocommerce? [closed]
- Hook for single product thumbnail
- WooCommerce product prices not showing up correctly [closed]
- Woocommerce resize existing product images
- Am I allowed to resell WordPress Premium Plugins under GPL? [closed]
- Woocommerce where to set the Price Suffix [closed]
- Is there a method or plugin to download my products in WooCommerce?
- Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]
- Translate text for empty product
- woocommerce show cities state as dropdown list
- which plugin is this? [closed]
- Adding a script & php to functions.php
- Override the plugin class and function
- How to add a text in the checkout page woocomerce?
- Predefine Product Variations for specific custom product type [closed]
- Shortcode inside a redirect [closed]
- Woocommerce Product Page Collapsible Box Using CSS
- Display out of stock products in WooCommerce [closed]
- Console errors after WordPress Update 6.1
- ‘Active lotteries’ only custom query for woocommerce lottery plugin and elementor