Ticket #5 (closed enhancement: fixed)
Staticize and wp-hashcash not compatible
| Reported by: | robert@… | Owned by: | ecb29 |
|---|---|---|---|
| Priority: | normal | Component: | wp-hashcash |
| Severity: | normal | Keywords: | |
| Cc: |
Description
wp-hashcash doesn't function correctly when staticize-reloaded reloaded is used.
The problem is that hashcash_add_hidden_tag isn't adding the appropriate tags to the html of the page... hence your forced to fail.
Change History
comment:2 Changed 7 years ago by matt
- Owner changed from chrisjdavis to ecb29
- Component changed from anxiety to wp-hashcash
- Summary changed from wp-hashcash to Staticize and wp-hashcash not compatible
comment:3 Changed 7 years ago by ecb29
- Severity changed from major to trivial
A version of wp-hashcash could be produced that would work with staticize reloaded, but it would require special calls to functions in certain particular places... and I can't figure out any standard way to do that right now. I'll try somethign tomorrow and get back to you.
comment:4 Changed 7 years ago by ecb29
- Status changed from new to closed
- Resolution set to fixed
Manual files have been added, and the following instructions have been added to the readme. This fixes compatability with staticise...which is as much of a pain as I suspected.
1) Install and activate the plugin.
2) Add the following line somewhere in your wp-comments.php files:
<!--mclude ./wp-content/plugins/wp-hashcash-manual.inc--><?php require('./wp-content/plugins/wp-hashcash-manual.inc'); ?><!--/mclude-->
3) Add the following javascript to your head in index.php:
<script src=" http://yoursite.com/wp/wp-content/plugins/md5.js" type="text/javascript"></script><script type="text/javascript"> function removeHTMLComments(html) { return html.replace(/<!(?:--[\s\S]*?--\s*)?>\s*/g,); } function antispam(in_str){ in_str = removeHTMLComments(in_str); eElement = document.getElementById("antispam_id"); if(!eElement){ return false; } else{ eElement.name = hex_md5(in_str); eElement.value = removeHTMLComments(eElement.value); return true; } }</script>
4) Add the following event handler as an attribute of the comments <form> tag in wp-comments.php:
onsubmit="do-your-anti-spam-thing('<!--mfunc get_hashcash_special_code() --><?php get_hashcash_special_code(); ?><!--/mfunc-->');"
5) Add the following hidden form field somewhere inside your form:
<input type="hidden" id="your-anti-spam-id" name="thisvaluedoesntmatter" value="<!--mfunc get_hashcash_field_value() --><?php get_hashcash_field_value()?><!--/mfunc-->" />
6) Delete all cached files from wp-content/staticize-cache
comment:5 Changed 7 years ago by ecb29
- Severity changed from trivial to enhancement
There's a typo where "do-your-anti-spam-thing" should be "antispam" and "your-anti-spam-id" should be "antispam_id." Aside from that, this should work.

Oh shoot...
should be plugin: wp-hashcash, not anxiety... sorry...
oh shoot, it's not listed... so when it is, please move this over
and pardon the bug spam.