Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Press0 1122 #23

Merged
merged 18 commits into from
Apr 23, 2024
Merged
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,118 @@ height="42" />

Runtime for Newfold WP modules and plugins

## Module Responsibilities

* Container is loaded from the brand plugin in Runtime class and it returns a `NewfoldRuntime` object.
aratidgr8 marked this conversation as resolved.
Show resolved Hide resolved
* This object can be imported in any React components as specified in `Usage` section below.
* Primary respnsibility of `wp-module-runtime` is to return `NewfoldRuntime` object which provides WordPress site meta data to React components of any newfold-labs modules in below format.


```
{
"site": {
"url": "Your wordpress site url",
"title": "Your wordpress site name"
},
"adminUrl": "Your wordpress site wp-admin url",
"base_url": "Your wordpress site index.php url",
aratidgr8 marked this conversation as resolved.
Show resolved Hide resolved
"homeUrl": "Your wordpress site url",
"capabilities": {
"canAccessAI": boolean,
"canAccessGlobalCTB": boolean,
"canAccessHelpCenter": boolean,
"hasEcomdash": boolean,
"hasYithExtended": boolean,
"isEcommerce": boolean,
"isJarvis": boolean
},
"sdk": {
aratidgr8 marked this conversation as resolved.
Show resolved Hide resolved
"wpversion": "Current WordPress version",
"plugin": {
"url": "Brand plugin build url",
"version": "Brand plugin version",
"assets": "Brand plugin assets url",
"brand": "Current WordPress hosting brand name"
},
"ecommerce": {
"brand_settings": {
"brand": "Hosting brand value",
"name": "Hosting brand name",
"url": "Hosting brand page url",
"hireExpertsInfo": "Marketplace service purchase url",
"support": "Hosting brand support contact url",
"adminPage": "Plugin Dashboard Homepage url",
"setup": {
"payment": [
Payment options supported for eg: "Paypal", "Razorpay", "Stripe"
],
"shipping": [
Shipping options supporter for eg: "Shippo"
]
},
"defaultContact": {
"woocommerce_default_country": "Default country code",
"woocommerce_currency": "Default currency code"
},
"wondercartBuyNow": "Marketplace link to purchase WonderCart"
},
"nonces": {
"gateway_toggle": ""gateway_toggle_code"
},
"install_token": "NFD_INSTALLER_token"
}
},
"siteUrl": "Your wordpress site url",
"siteTitle": "Your wordpress site name",
"restUrl": "Your wordpress site /wp-json/",
"restNonce": "restNonce_value",
"isWoocommerceActive": boolean,
"isYithBookingActive": boolean,
"isJetpackBoostActive": boolean,
"wpVersion": "Current WordPress version",
"currentTheme": "Current Theme Name",
"context": {
"platform": "default",
"brand": {
"name": "Hosting brand name"
}
},
"plugin": {
"url": "Brand plugin build url",
"version": "Brand plugin version",
"assets": "Brand plugin assets url",
"brand": "Current WordPress hosting brand name"
},
"comingSoon": {
enable: {
success: boolean
}
isEnabled: boolean,
disabled: {
success: boolean
}
lastChanged: timeStamp when coming soon setting was updated last time
toggleAdminBarSiteStatus: null
}
}
```

## Critical Paths

* Runtime should provide WordPress site meta data.
* Runtime module should also provide status of site capabilities like:
1. If WordPress site has access to AI onboarding
2. If WordPress site has access to GlobalCTB
3. If WordPress site has access to HelpCenter
4. If WordPress site has Ecomdash plugin enabled
5. If WordPress site has any of Yith Extended plugins enabled
6. If WordPress site is an Ecommerce store
7. If WordPress site is migrated to Jarvis
* Runtime module should provide hosting brand settings information
* Runtime module must give payment & shipping options available on Ecommerce store as per the geographic location.
* Runtime module should give current status information of `coming soon` mode.
* Runtime module should support addition of custom values as per need under `NewfoldRuntime.sdk` variable.
aratidgr8 marked this conversation as resolved.
Show resolved Hide resolved

## Installation

### 1. Setup GitHub registry
Expand Down