GRAYBYTE WORDPRESS FILE MANAGER9849

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/swamivivekananda.co.in/wp-content/plugins/suremails/src/api/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/swamivivekananda.co.in/wp-content/plugins/suremails/src/api//settings.js
import apiFetch from '@wordpress/api-fetch';
import { __ } from '@wordpress/i18n';
// Fetch settings from the API
export const fetchSettings = async () => {
	try {
		const response = await apiFetch( {
			path: '/suremails/v1/get-settings',
			method: 'POST',
			headers: {
				'Content-Type': 'application/json',
				'X-WP-Nonce': suremails.nonce,
			},
		} );

		if ( typeof response !== 'object' ) {
			throw new Error( 'Invalid JSON response' );
		}
		return response;
	} catch ( error ) {
		throw new Error( error.message || 'Error fetching settings' );
	}
};

// Save settings to the API
export const saveSettings = async ( updatedSettings ) => {
	try {
		const response = await apiFetch( {
			path: '/suremails/v1/set-settings',
			method: 'POST',
			headers: {
				'X-WP-Nonce': suremails.nonce,
				'Content-Type': 'application/json',
			},
			body: JSON.stringify( {
				settings: {
					delete_email_logs_after:
						updatedSettings.settings.delete_email_logs_after,
					log_emails: updatedSettings.settings.log_emails,
					email_simulation: updatedSettings.settings.email_simulation,
					default_connection:
						updatedSettings.settings.default_connection,
					analytics: updatedSettings.settings.analytics,
				},
			} ),
		} );
		return response;
	} catch ( error ) {
		throw new Error( error.message || 'Error saving settings' );
	}
};

/**
 * Authenticate the Content Guard
 *
 * @return {Object} The response
 */
export const activateContentGuard = async () => {
	try {
		return await apiFetch( {
			path: '/suremails/v1/content-guard/activate',
			method: 'GET',
			headers: {
				'Content-Type': 'application/json',
				'X-WP-Nonce': suremails.nonce,
			},
		} );
	} catch ( error ) {
		throw new Error(
			error.data.message ||
				__( 'Error activating Reputation Shield', 'suremails' )
		);
	}
};

/**
 * Save user details for Content Guard
 *
 * @param {Object} userDetails - The user details
 * @return {Object} The response
 */
export const saveUserDetails = async ( userDetails ) => {
	try {
		return await apiFetch( {
			path: '/suremails/v1/content-guard/user-details',
			method: 'POST',
			headers: {
				'X-WP-Nonce': suremails.nonce,
				'Content-Type': 'application/json',
			},
			body: JSON.stringify( userDetails ),
		} );
	} catch ( error ) {
		throw new Error( error.data.message || 'Error saving user details' );
	}
};

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:27
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:27
giriqfky / giriqfky
0644
auth.js
0.6 KB
June 23 2025 07:12:38
giriqfky / giriqfky
0644
connections.js
4.318 KB
June 23 2025 07:12:38
giriqfky / giriqfky
0644
dashboard.js
1.515 KB
June 23 2025 07:12:38
giriqfky / giriqfky
0644
logs.js
3.036 KB
June 23 2025 07:12:38
giriqfky / giriqfky
0644
onboarding.js
0.759 KB
June 23 2025 07:12:38
giriqfky / giriqfky
0644
plugins.js
0.908 KB
June 23 2025 07:12:38
giriqfky / giriqfky
0644
settings.js
2.309 KB
June 23 2025 07:12:38
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF