PHP 8.2.31
Preview: plugins-cache.js Size: 666 B
/home/nshryvcy/radiantskinclinics.org/wp-content/plugins/extendify_old/src/PageCreator/state/plugins-cache.js

import apiFetch from '@wordpress/api-fetch';
import { create } from 'zustand';
import { persist } from 'zustand/middleware';

export const useInstalledPluginsCache = create(
	persist(
		(set) => ({
			installedPlugins: window.extSharedData?.activePlugins?.map(
				(plugin) => plugin.split('/')[0],
			),
			updateInstalledPlugins: async () => {
				const installedPlugins = (
					await apiFetch({
						path: '/wp/v2/plugins',
						method: 'GET',
					})
				)?.map((plugin) => plugin.plugin.split('/')[0]);

				set({ installedPlugins });
			},
		}),
		{
			name: `extendify-page-creator-page-installed-plugins-cache-${window.extSharedData.siteId}`,
		},
	),
);

Directory Contents

Dirs: 0 × Files: 5

Name Size Perms Modified Actions
387 B lrw-r--r-- 2025-03-13 21:10:44
Edit Download
466 B lrw-r--r-- 2025-03-13 21:10:44
Edit Download
1.52 KB lrw-r--r-- 2025-03-13 21:10:44
Edit Download
666 B lrw-r--r-- 2025-05-12 16:42:28
Edit Download
944 B lrw-r--r-- 2026-02-19 03:27:14
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).