--- /dev/null
+<?php
+
+/*
+ * Plugin Name: Honeypot for Mailjet
+ * Version: 1.0
+ */
+
+add_action('wp_ajax_nopriv_mailjet_subscribe_ajax_hook', 'honeypot_mailjet', 1);
+add_action('wp_ajax_mailjet_subscribe_ajax_hook', 'honeypot_mailjet', 1);
+
+function honeypot_mailjet()
+{
+ if (!empty($_POST['hp_mailjet'])) {
+ wp_send_json_error(['message' => 'spam']);
+ wp_die();
+ }
+}
+
+add_action('wp_footer', function() {
+?>
+<script>
+ document.addEventListener("DOMContentLoaded", function() {
+ const form = document.querySelector("#wp_mailjet_subscribe_widget-2 form");
+ if (!form.querySelector('input[name="hp_mailjet"]')) {
+ let hp = document.createElement("input");
+ hp.type = "text";
+ hp.name = "hp_mailjet";
+ hp.style.display = "none";
+ form.appendChild(hp);
+ }
+ });
+</script>
+<?php
+});
\ No newline at end of file
--- /dev/null
+<?php
+
+/*
+ * Plugin Name: Honeypot for Mailjet
+ * Version: 1.0
+ */
+
+add_action('wp_ajax_nopriv_mailjet_subscribe_ajax_hook', 'honeypot_mailjet', 1);
+add_action('wp_ajax_mailjet_subscribe_ajax_hook', 'honeypot_mailjet', 1);
+
+function honeypot_mailjet()
+{
+ if (!empty($_POST['hp_mailjet'])) {
+ wp_send_json_error(['message' => 'spam']);
+ wp_die();
+ }
+}
+
+add_action('wp_footer', function() {
+?>
+<script>
+ document.addEventListener("DOMContentLoaded", function() {
+ const form = document.querySelector("#wp_mailjet_subscribe_widget-2 form");
+ if (!form.querySelector('input[name="hp_mailjet"]')) {
+ let hp = document.createElement("input");
+ hp.type = "text";
+ hp.name = "hp_mailjet";
+ hp.style.display = "none";
+ form.appendChild(hp);
+ }
+ });
+</script>
+<?php
+});
\ No newline at end of file
--- /dev/null
+<?php
+
+/*
+ * Plugin Name: Honeypot for Mailjet
+ * Version: 1.0
+ */
+
+add_action('wp_ajax_nopriv_mailjet_subscribe_ajax_hook', 'honeypot_mailjet', 1);
+add_action('wp_ajax_mailjet_subscribe_ajax_hook', 'honeypot_mailjet', 1);
+
+function honeypot_mailjet()
+{
+ if (!empty($_POST['hp_mailjet'])) {
+ wp_send_json_error(['message' => 'spam']);
+ wp_die();
+ }
+}
+
+add_action('wp_footer', function() {
+?>
+<script>
+ document.addEventListener("DOMContentLoaded", function() {
+ const form = document.querySelector("#wp_mailjet_subscribe_widget-2 form");
+ if (!form.querySelector('input[name="hp_mailjet"]')) {
+ let hp = document.createElement("input");
+ hp.type = "text";
+ hp.name = "hp_mailjet";
+ hp.style.display = "none";
+ form.appendChild(hp);
+ }
+ });
+</script>
+<?php
+});
\ No newline at end of file