[ SYSTEM ]: Linux wordpress 6.1.0-44-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
[ SERVER ]: Apache/2.4.66 (Debian) | PHP: 8.2.30
[ USER ]: www-data | IP: 172.19.30.54
GEFORCE FILE MANAGER
/
var
/
www
/
html
/
wordpress
/
wp-content
/
plugins
/
presto-player
/
src
/
admin
/
settings
/
pages
/
parts
/
integration
/
UPLOAD:
NAME
SIZE
QUICK PERMS
ACTIONS
📄 ActiveCampaign.js
2,764 B
SET
[ EDIT ]
|
[ DEL ]
📄 FluentCRM.js
1,992 B
SET
[ EDIT ]
|
[ DEL ]
📄 Mailchimp.js
2,727 B
SET
[ EDIT ]
|
[ DEL ]
📄 MailerLite.js
2,734 B
SET
[ EDIT ]
|
[ DEL ]
📄 withIntegration.js
1,827 B
SET
[ EDIT ]
|
[ DEL ]
DELETE SELECTED
[ CLOSE ]
EDIT: withIntegration.js
/** * WordPress dependencies */ import { __ } from "@wordpress/i18n"; import { useState } from "@wordpress/element"; import apiFetch from "@wordpress/api-fetch"; import { createHigherOrderComponent } from "@wordpress/compose"; import { useEntityProp } from "@wordpress/core-data"; /** * Higher order component factory * * @return {Function} The higher order component. */ export default ({ name }) => createHigherOrderComponent( (WrappedComponent) => (props) => { const [error, setError] = useState(""); const [success, setSuccess] = useState(""); const [isBusy, setIsBusy] = useState(false); const [setting, setSetting] = useEntityProp("root", "site", name); const updateSetting = (data) => { setSetting({ ...(setting || {}), ...data, }); }; const makeRequest = async ({ path, data = {}, message = __("Success", "presto-player"), success, error, }) => { setError(""); setSuccess(""); setIsBusy(true); try { let response = await apiFetch({ path, method: "post", data, }); success && success(response); setSuccess(message); } catch (e) { if (e?.message) { setError(e.message); error && error(e); } } finally { setIsBusy(false); } }; return ( <WrappedComponent success={success} setSuccess={setSuccess} setError={setError} error={error} isBusy={isBusy} setting={setting} updateSetting={updateSetting} makeRequest={makeRequest} {...props} /> ); }, "withIntegration" );