{"id":19029088,"date":"2026-09-25T09:10:09","date_gmt":"2026-09-25T09:10:09","guid":{"rendered":"https:\/\/wordpress.org\/support\/?post_type=topic&#038;p=19029088"},"modified":"2026-09-25T09:44:26","modified_gmt":"2026-09-25T09:44:26","slug":"invalid-signature-7","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/invalid-signature-7\/","title":{"rendered":"Invalid Signature"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I had a problem with a newsletter where the links were causing an &#8220;Invalid signature&#8221; error.<br \/>I&#8217;m using version 9.4.1, and the newsletter was sent using version 9.3.9.<br \/>I investigated the source of the error and had to modify the <code>verify_signature<\/code> function in the <code>statistics.php<\/code> file to fix the problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s the modification I made:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    function verify_signature($text, $signature) {<br \/>        $signature = trim($signature);<br \/>        if (!$signature) {<br \/>            return 0;<br \/>        }<br \/><br \/>        $parts = explode('.', $signature, 2);<br \/>        if (count($parts) === 2) {<br \/>            $time = (int) $parts&#091;0];<br \/><br \/>            $verified = hash_equals(md5($text . $time . $this-&gt;get_key()), $parts&#091;1]);<br \/><br \/>            if (!$verified) {<br \/>                return 0;<br \/>            }<br \/>            return $time &gt;= time() ? 1 : 2;<br \/>        } else {<br \/>            \/\/return $this-&gt;check_signature($text, $signature) ? 2 : 0;<br \/>            return (md5($text . $this-&gt;get_key()) === $signature) ? 2 : 0;<br \/>        }<br \/>    }<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Can you please fix this in the next version.<\/p>\n","protected":false},"template":"","class_list":["post-19029088","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19029088","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19029088\/revisions"}],"predecessor-version":[{"id":19029123,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19029088\/revisions\/19029123"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19029088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}