Descripció
OneSeed Tree Planting for WooCommerce connects your WooCommerce store with OneSeed.eco to automatically plant real trees based on customer purchases. Create meaningful environmental impact while boosting customer loyalty and engagement.
Key Features
- Automatic Tree Rewards – Plant trees automatically when customers make qualifying purchases
- Customer Tree Sponsorship – Let customers sponsor additional trees at checkout with a simple checkbox
- Flexible Triggers – Configure tree planting based on specific products, minimum purchase amounts, or both
- Dual Project Support – Use separate OneSeed projects for reward trees vs. customer-sponsored trees
- WooCommerce Blocks Compatible – Works with both classic and block-based cart/checkout pages
- Email Notifications – Send customers beautiful tree claim emails with certificate links
- Thank You Page Widget – Display interactive tree certificates on order confirmation
- Detailed Logging – Comprehensive admin logs for monitoring and troubleshooting
- Order Integration – View tree planting status directly on WooCommerce orders
How It Works
- Customer makes a purchase that meets your configured criteria
- OneSeed API automatically plants a tree in the customer’s name
- Customer receives an email invitation to claim their tree certificate
- Tree certificates display on the Thank You page and in order details
Customer Tree Sponsorship
Enable customers to sponsor additional trees at checkout:
- Checkbox appears on cart and checkout pages
- You control the tree product price
- Works with both classic WooCommerce and WooCommerce Blocks
- Compatible with popular themes including Astra Pro
Requirements
- WordPress 6.2 or higher
- WooCommerce 4.0 or higher
- PHP 7.4 or higher
- OneSeed.eco account with:
- Tree credits on your account
- Managed Contacts project for tree rewards
- Sponsored Forest project for customer sponsorship (optional)
- API token from your Projects API page
External Services
This plugin connects to the OneSeed.eco API to:
- Retrieve available tree planting projects
- Submit tree planting requests
- Generate tree certificates for customers
OneSeed.eco Service:
* Website: https://oneseed.eco
* Terms of Service: https://oneseed.eco/terms
* Privacy Policy: https://oneseed.eco/privacy
Data transmitted to OneSeed includes customer email addresses and order information necessary to plant trees and send certificate emails.
Support
For support and questions:
- Email: support@oneseed.eco
- Website: oneseed.eco
- Use the chatbot on the OneSeed website
Privacy
This plugin transmits customer data (email address, name, order details) to OneSeed.eco for the purpose of planting trees and sending certificate emails. Please review OneSeed’s privacy policy and ensure compliance with your local privacy regulations (GDPR, CCPA, etc.).
Instal·lació
- Upload the
oneseed-tree-plantingfolder to the/wp-content/plugins/directory, or install directly through the WordPress plugins screen - Activate the plugin through the ‘Plugins’ screen in WordPress
- Navigate to OneSeed in your WordPress admin menu
- Enter your OneSeed Account ID and API Token (found in your OneSeed admin panel)
- Select your tree planting project and configure your preferences
- Configure triggers (specific products and/or minimum purchase amounts)
- Optionally enable customer tree sponsorship
Setting Up OneSeed Account
- Create an account at oneseed.eco
- Add tree credits to your account
- Create a Managed Contacts type project for reward trees
- (Optional) Create a Sponsored Forest type project for customer-sponsored trees
- Copy your API token from the Projects API page
- If using OneSeed emails, enable Email Invites on your project
Email Configuration
To have OneSeed send tree claim emails:
- Connect your own email system in OneSeed admin, OR
- Contact support@oneseed.eco to enable sending through trees@oneseed.eco
Important: Email invites must be properly configured or tree planting will fail.
PMF
-
What is OneSeed?
-
OneSeed.eco is a platform that enables businesses to plant real trees as part of their customer experience. Trees are planted in verified reforestation projects around the world.
-
Do I need a OneSeed account?
-
Yes, you need a OneSeed.eco account with tree credits and SPONSOR (Sponsored Forests) projects. Sign up at oneseed.eco.
-
What project types do I need?
-
- SPONSOR (Sponsored Forests) projects in OneSeed — use one project for reward trees and optionally a second for checkout-sponsored trees (or the same project for both, if you prefer).
-
Why don’t I see any projects in the dropdown?
-
- Choose Project lists SPONSOR-type projects from the OneSeed API. Create SPONSOR projects in your OneSeed dashboard or via the in-list create action if the list is empty.
- Developers can override the projects list
typequery with theoneseed_projects_api_query_typefilter.
-
Where is the API documented?
-
- Tree planting uses POST
https://api.oneseed.eco/api/sponsor_trees(Sponsor a Forest). See the Sponsor a Forest API article on the OneSeed Help Center.
- Tree planting uses POST
-
Does this work with WooCommerce Blocks?
-
Yes! The plugin fully supports both classic WooCommerce cart/checkout and the newer WooCommerce Blocks-based cart and checkout.
-
Which themes are supported?
-
The plugin is designed to work with most WordPress themes. It has been specifically tested with popular themes including Astra, Astra Pro, Storefront, and others.
-
Can customers sponsor trees?
-
Yes! When enabled, a checkbox appears on both the cart and checkout pages allowing customers to add a sponsored tree to their order. You control the price by editing the tree product.
-
How do customers receive their tree certificates?
-
Customers can receive tree certificates via:
1. Email invitation from OneSeed (requires email configuration)
2. Direct link on the Thank You page after checkout
3. Link in WooCommerce order emails (if configured) -
Can I use different projects for rewards vs. sponsored trees?
-
Yes! Version 1.9.0+ supports separate project selection for reward trees and customer-sponsored trees.
-
Where can I view logs and troubleshoot issues?
-
Navigate to OneSeed > Logs in your WordPress admin to view detailed logs of all tree planting activity, API calls, and any errors.
-
How do I test the plugin?
-
Try our demo store to see the plugin in action: Demo Store
Ressenyes
No hi ha ressenyes per a aquesta extensió.
Col·laboradors i desenvolupadors
«OneSeed Tree Planting for WooCommerce» és programari de codi obert. La següent gent ha col·laborat en aquesta extensió.
Col·laboradorsTraduïu «OneSeed Tree Planting for WooCommerce» a la vostra llengua.
Interessats en el desenvolupament?
Navegueu pel codi, baixeu-vos el repositori SVN, o subscriviu-vos al registre de desenvolupament per fisl de subscripció RSS.
Registre de canvis
3.1.4
- Scope admin notices to plugin screens for Guideline 11
3.1.3
- Compliance: Align text domain with WordPress.org plugin slug (oneseed-tree-planting-for-woocommerce).
3.1.2
- Compliance: Passes WordPress.org Plugin Check — bumped «Tested up to» to 7.0, removed the standalone demo page/stylesheet, and switched dynamic SQL to the %i identifier placeholder.
- Compatibility: Requires at least WordPress 6.2 (needed for the %i identifier placeholder in $wpdb->prepare()).
- Security: Clarified nonce/sanitization annotations on admin AJAX handlers; moved the migration-notice script into an enqueued asset with a localized nonce.
3.1.0
- Feature: Planting Mode setting (API tab) — Background (default) queues trees via Action Scheduler and auto-updates the Thank You page; Immediate plants during checkout (~1–4s delay).
- UX: Thank You page shows «We are planting your trees…» with improved AJAX polling (status-aware, longer timeout in background mode).
- Fix: Thank-you fallback no longer double-plants; retries only when queue stalled.
3.0.9
- Performance: Sponsored and reward trees on the same order now plant in parallel via concurrent sponsor_trees API calls (falls back to sequential if Requests library unavailable).
- Fix: Orders with only a customer-sponsored tree (no reward trigger) now initiate planting on payment complete.
3.0.8
- Fix: Plantings Data page Load Plantings button did nothing — plantings script now enqueues reliably from main plugin bootstrap (with page=oneseed-plantings fallback); hardened AJAX and error display; auto-create plantings table if missing.
3.0.7
- UX: First-setup banner and account summary now guide users to enter Account ID and API token in API & Projects tab.
- UX: Account summary shows available tree credits (e.g. «8 tree credits available») with low-credit warning below 20; recommends auto-topup before going live.
- UI: Checkout settings tab renamed to Customer Sponsors; removed duplicate Edit Tree Product banner from settings header.
3.0.6
- Fix: Logs page stuck on «Loading logs…» — logs script now enqueues reliably from the main plugin bootstrap (with page=oneseed-logs fallback); settings admin.js no longer loads on the logs screen; hardened AJAX/display error handling.
3.0.5
- UI: Removed obsolete «Create a Managed Project» link from account management header; projects are created via Choose Project in settings.
3.0.4
- Fix: Trigger Products now auto-saves (multi-select was excluded from auto-save binding); Clear All persists.
- Fix: Per-option auto-save debounce — rapid edits to different fields no longer cancel each other’s saves (project picker now reliably saves the project ID).
- Fix: Order Status Retry button fatal (
plant_trees_for_orderwas private); manual retry now bypasses the planted check and retry cap. - Fix: Removed broken block-registration hook that could fatal on checkout.
- Safety: Per-order planting lock prevents duplicate trees when payment-complete and thank-you hooks race; automatic retries of failed plantings capped at 3.
- Safety: Sponsored trees now require the paid tree product line item — checkbox meta alone no longer plants a free tree.
- Fix: Thank-you widget read planting rows as an object (showed empty data); duplicate «qualified» notes on page reloads.
- HPOS: Sponsorship meta saved via order CRUD; fulfillment stats query and order edit links work with custom order tables.
- Hardening: Escaped admin plantings table output; block checkout checkbox reverts on failed cart update; thank-you poll no longer swaps in empty HTML; logs table created only when missing; removed duplicate logs script enqueue and dead handlers.
3.0.3
- Fix: LIVE toggle JS referenced undefined
tokenvariable — project status refresh never ran. - Fix:
get_projectnow uses POST (GET returned HTTP 400 with empty body on current OneSeed API). - Fix: Logs page stuck on loading — hardened script init, JSON AJAX, timeout handling, table auto-create.
- Admin logging: Settings AJAX actions (
get_project,set_project, auto-save) now write to the Logs page.
3.0.2
- Settings UX: Removed bottom Save button; settings auto-save on change. Tabbed layout (API, Triggers, Checkout, Email, Invite Messaging).
- Invite messaging: Moved to dedicated tab with manual save; refresh loads copy from OneSeed API.
- Fix: LIVE checkbox now enables when API token is saved in the database (not only when typed in the form).
- Fix: GET project/account API calls include full auth headers (resolves invalid JSON on invite refresh).
- Fix: Debug logging no longer recurses infinitely when debug mode is enabled.
- Fix: Admin logs page AJAX, error handling, and display.
3.0.1
- Migration: Admin notice and remap prompt when updating from any version before 3.0.0, or when updating from 3.0.0 with legacy project options only (new storage empty). Contact support@oneseed.eco for help.
- Storage: Reward and checkout-sponsored SPONSOR project IDs and names use new options (
oneseed_sponsor_reward_project_id,oneseed_sponsor_checkout_project_id, and matching*_namefields). Legacyoneseed_project_id/oneseed_sponsored_project_idvalues are left in the database but are no longer used—re-select projects in settings. - UI: «Load Projects» renamed to Choose Project; create_project is available at the end of the chooser list (or when no projects are returned). LIVE/TESTING is a checkbox beside each project field, driven by get_project (disabled if status cannot be read). Set LIVE / Set TESTING removed from the invite panel.
3.0.0
- Breaking: Fulfillment now uses sponsor_trees (
POST /api/sponsor_trees) instead ofproject_addmember_v2 - Breaking: Project picker lists SPONSOR projects only (reward and sponsored selectors use the same API type)
- Customer idempotency:
customer_id= billing email,customer_trans={order_id}_{tree_type};sponsored_bytrue for checkout-sponsored trees, false for reward trees - Settings: sponsor forest options (
is_public, trees per call), per-project get_project / set_project UI (invite subject/body, LIVE/TESTING), quick create_project helper - Upgrade notice when updating from 2.3.4 or older to re-select projects; dismissible
- Filters:
oneseed_api_base_url,oneseed_sponsor_trees_path,oneseed_sponsor_trees_payload,oneseed_get_project_path,oneseed_set_project_path,oneseed_create_project_path
2.3.6
- Reward vs Sponsored «Load Projects» now requests the correct API project type (PRIVATEEVENT vs SPONSORED)
- Project picker list clears after you select a project until you click Load Projects again
oneseed_projects_api_query_typefilter to override API type strings if needed
2.3.5
- Show selected OneSeed project name in admin next to project ID (saved with settings)
- Optional auto-resolve of project name on settings load when ID exists but name is empty (legacy installs)
- Clear stored display name when project ID is edited manually
2.3.4
- Added Documentation and Support links to plugin row meta
- Links appear next to plugin description on Plugins page
2.3.3
- Fixed checkbox appearing on order-received/thank-you page
- Added is_wc_endpoint_url(‘order-received’) check to exclude thank-you page
- Block script now returns early if on order-received page
2.3.2
- Enforce tree product quantity to exactly 1 – cannot be changed
- Added woocommerce_add_to_cart_quantity filter to force qty=1 on add
- Added woocommerce_update_cart_item_quantity filter to block qty changes
- Tree product already set to sold_individually=true
2.3.1
- Trees planted on payment complete but EXCLUDE on-hold orders
- Added process_order_by_id() with on-hold status check
- Thank-you page can now display tree badges immediately after checkout
- On-hold orders (bank transfer, etc.) won’t plant trees until payment confirmed
2.3.0
- Changed hook to woocommerce_order_status_completed (reverted in 2.3.1)
2.2.9
- Hide cart page checkbox when cart is empty
- Added WC()->cart->is_empty() check to cart checkbox render
2.2.8
- Fixed sponsor checkbox incorrectly appearing on order-received/thank-you page
- Added is_wc_endpoint_url(‘order-received’) check to prevent post-checkout checkbox display
2.2.7
- Complete WordPress.org Plugin Directory compliance – properly fixed SQL queries
- Refactored dynamic SQL to prepare each condition individually (no placeholder count issues)
- Each WHERE condition now uses $wpdb->prepare() separately before joining
- Removed phpcs:disable workarounds – actual code fixes instead
- Added sanitize_text_field() and absint() to all filter inputs
2.2.6
- Added phpcs:disable for WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber
2.2.5
- Added phpcs:disable/enable blocks for dynamic SQL construction patterns
- Restructured database queries with proper phpcs annotations
- Fixed nonce verification warnings with correct phpcs:ignore placement
- Updated Tested up to: 6.9 (current WordPress version)
2.2.4
- Restructured database queries to use $wpdb->prepare() inline with table prefix
- Added phpcs:ignore comments for legitimate direct database queries
- Fixed all remaining date() to gmdate() for timezone safety
- Fixed all remaining output escaping (esc_html, esc_attr)
2.2.3
- Fixed database query security with proper escaping and prepared statements
- Fixed wp_redirect() to wp_safe_redirect() for security
- Added direct file access protection to index.php
- Matched plugin name in header to readme.txt
- Reduced tags to 5 per WordPress.org guidelines
2.2.2
- Complete WordPress.org Plugin Directory compliance
- Added sanitization callbacks to all register_setting() calls
- Fixed all escaping issues in admin, widget, and WooCommerce classes
- Improved input validation and nonce verification
- Added sanitize_trigger_products method for array sanitization
2.2.1
- Additional security escaping fixes for WooCommerce class
- Improved nonce verification and input sanitization
- Fixed all remaining WordPress.org plugin checker errors
2.2.0
- WordPress.org Plugin Directory compliance update
- Added Debug Mode setting for conditional logging
- Fixed security escaping in all templates
- Removed Network and Update URI headers
- Synced Tested up to version (6.4)
2.1.0
- Added Setup Guide link to admin navigation
- Links to comprehensive KB documentation
2.0.9
- Fixed console errors on checkout pages
- Improved page detection for cart vs checkout scripts
2.0.8
- Removed unnecessary page reloads after cart updates
- Smoother AJAX-based cart updates
2.0.7
- Added email template configuration note in admin settings
- Improved admin UI guidance
2.0.6
- Fixed classic checkout checkbox JavaScript selector
2.0.5
- Fixed ZIP structure for WordPress update mechanism
- Plugin updates now work via «Replace current with uploaded»
2.0.4
- Added cart page checkbox for WooCommerce Blocks
- Improved Astra theme compatibility
2.0.3
- Enhanced WooCommerce Blocks checkout support
- Removed forced page refreshes for smoother experience
1.9.0
- Added separate project selector for sponsored trees
- Independent configuration for reward vs sponsored tree projects
1.8.7
- Added customer-visible order note when rewarded tree is planted
1.8.6
- Fixed dual tree planting logic
- Rewarded trees now plant independently of sponsored trees
- Updated widget titles
1.8.5
- Added resubmit action for failed tree planting attempts
1.8.4
- Fixed critical API error «Invalid data for key sendInvite»
- Enhanced logging integration
1.8.0
- Advanced logging system with custom database table
- New admin logs interface
1.7.5
- Enhanced order metadata tracking
- Smart widget display logic
1.6.0
- Dual tree system with separate sponsored and rewarded trees
- Parallel API calls with async allocation
- Unique IDs with email+order+type
- Dual thank-you boxes with individual tree links