Untitled Snippet

(self.SWG_BASIC = self.SWG_BASIC || []).push( basicSubscriptions => { basicSubscriptions.init({ type: “NewsArticle”, isPartOfType: [“Product”], isPartOfProductId: “CAow7ue8DA:openaccess”, clientOptions: { theme: “light”, lang: “id” }, }); });Continue reading

_MK – SECURITY – Disable XML-RPC-API

// Disable XML-RPC add_filter( ‘xmlrpc_enabled’, ‘__return_false’ ); // Block access to xmlrpc.php via .htaccess equivalent (Apache fallback) add_action( ‘init’, function () { if (strpos($_SERVER[‘REQUEST_URI’], ‘xmlrpc.php’) !== false) { wp_die( ‘Access denied.’ ); } }); // Remove pingback header add_filter( ‘wp_headers’,…Continue reading

_MK – Last connection

// Enregistre la date de connexion de l’utilisateur function enregistrer_derniere_connexion($user_login, $user) { // Met à jour la date de la dernière connexion $last_login = current_time(‘mysql’); update_user_meta($user->ID, ‘last_login’, $last_login); // Debug: Vérifie si la date est bien enregistrée if (false ===…Continue reading

_MK – SECURITY – Block Author Enumeration

// 🔒 Block ?author=1 user enumeration attempts add_action(‘init’, function () { if (!is_admin() && isset($_GET[‘author’])) { wp_redirect(home_url(), 301); exit; } }); // 🛡️ Disable REST API user exposure add_filter(‘rest_endpoints’, function ($endpoints) { if (isset($endpoints[‘/wp/v2/users’])) { unset($endpoints[‘/wp/v2/users’]); } return $endpoints; });Continue reading