Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import apiFetch from '@wordpress/api-fetch';
// Middleware
apiFetch.use(apiFetch.createNonceMiddleware(window.wpApiSettings.nonce));
apiFetch.use(apiFetch.createRootURLMiddleware(window.wpApiSettings.root));
import { registerStore } from '@wordpress/data';
import apiFetch from "@wordpress/api-fetch";
apiFetch.use( apiFetch.createNonceMiddleware( SiteHealth.nonce.api_nonce ) );
const SiteHealth_DefaultState_Tests = {
tests: [],
isLoading: true,
results: {
good: [],
recommended: [],
critical: [],
},
};
const actions = {
setLoading( loading ) {
return {
type: 'SET_LOADING',
loading
import { registerStore } from '@wordpress/data';
import apiFetch from "@wordpress/api-fetch";
apiFetch.use( apiFetch.createNonceMiddleware( HealthCheckTS.api_nonce ) );
const SiteHealth_TroubleshootingMode_DefaultState_Notices = {
notices: [],
};
const actions = {
setNotices( notices ) {
return {
type: 'SET_NOTICES',
notices,
};
},
fetchFromAPI( path ) {
return {
type: 'FETCH_FROM_API',