GhostManSec
Server: Apache
System: Linux webm003.cluster115.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User: eliteafr (153088)
PHP: 5.4.45
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/e/l/i/eliteafr/datapro/wp-content/plugins/themeisle-companion/dashboard/src/utils/common.js
import { post } from "./rest";

import { __ } from "@wordpress/i18n";

export const tabs = {
  modules: __("Available Modules", "themeisle-companion"),
  plugins: __("Recommended Plugins", "themeisle-companion"),
};

export const getTabHash = () => {
  let hash = window.location.hash;

  if ("string" !== typeof window.location.hash) {
    return null;
  }

  hash = hash.substring(1);

  if (!Object.keys(tabs).includes(hash)) {
    return null;
  }

  return hash;
};

export const unregister = (url) => {
  post(url, "deactivate=unregister").then((r) => {
    if (r === false) {
      return;
    }
    window.location.reload();
  });
};

/**
 * Decodes a html encoded string while preserving tags
 *
 * @param {string} html encoded string
 * @return {string} decoded string
 */
export const decodeHtml = (html) => {
  const txt = document.createElement("textarea");
  txt.innerHTML = html;
  return txt.value;
};