����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
import apiFetch from '@wordpress/api-fetch';
import { addQueryArgs } from '@wordpress/url';
const getRecaptchaToken = (action, siteKey) =>
new Promise((resolve, reject) => {
const existing = document.querySelector(
`script[src*="recaptcha/enterprise"]`,
);
const load = () =>
window.grecaptcha.enterprise.ready(async () => {
try {
resolve(
await window.grecaptcha.enterprise.execute(siteKey, { action }),
);
} catch (error) {
reject(error);
}
});
if (existing) {
load();
return;
}
const script = document.createElement('script');
script.src = `https://www.google.com/recaptcha/enterprise.js?render=${siteKey}`;
script.async = true;
script.onload = load;
document.head.appendChild(script);
});
const createAccount = async ({
slug,
email,
marketingConsent,
termsAgreed,
signal,
scriptData,
}) => {
await apiFetch({
path: `extendify/v1/${slug}/create-account`,
method: 'POST',
data: {
email,
marketingConsent,
termsAgreed,
...scriptData,
},
signal,
});
};
/*
* Plugin entries shape:
* createAccountCallback: (data) => Promise<void> — performs the account creation request
* idempotent: boolean (default true) — false skips retries; use when re-sending the same request could cause errors
*/
export const pluginsActivation = {
simplybook: {
idempotent: false,
createAccountCallback: async ({
scriptData,
email,
marketingConsent,
termsAgreed,
signal,
}) => {
const captchaToken = await getRecaptchaToken(
scriptData?.recaptchaAction,
scriptData?.recaptchaSiteKey,
);
// Hit the endpoint via ?rest_route= so the request URL contains "simplybook" —
// SimplyBook only registers its onboarding routes when it does, else they 404.
const url = addQueryArgs(`${window.extSharedData.homeUrl}/`, {
rest_route: '/extendify/v1/simplybook/create-account',
});
await apiFetch({
url,
method: 'POST',
data: {
email,
marketingConsent,
termsAgreed,
captcha_token: captchaToken,
},
signal,
});
},
},
'translatepress-multilingual': {
createAccountCallback: (data) =>
createAccount({ slug: 'translatepress-multilingual', ...data }),
},
imagify: {
createAccountCallback: (data) =>
createAccount({ slug: 'imagify', ...data }),
},
};
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| DataApi.js | File | 2.36 KB | 0644 |
|
| digest.js | File | 2.07 KB | 0644 |
|
| pluginsActivation.js | File | 2.3 KB | 0644 |
|
| wp.js | File | 3.32 KB | 0644 |
|