[wp-hackers] Looking for input

Dave Grijalva grijalva at gmail.com
Thu Feb 16 09:35:48 GMT 2006


I went ahead and applied some of the changes you suggested.  I'm still gonna
have to go back and cleanup some of the expressions, but I did manage to get
blacklisting working thanks to your suggestion.

I updated the expressions to allow " and ' for html attributes.

Also, I changed the coralize_site() hook to 'init'.

Please test out the new version if you have a few minutes.
thanks again for the help.

-dave

On 2/16/06, Dave Grijalva <grijalva at gmail.com> wrote:
>
> Hey, thanks for the feedback.  This is my first wp plugin so I'm still
> learning all the hooks and whatnot.  I'll definitely incorporate these
> suggestions in the next rev.
>
> -dave
>
> On 2/15/06, Sam Angove <sam at rephrase.net> wrote:
> >
> > On 2/16/06, Dave Grijalva <grijalva at gmail.com> wrote:
> > > I don't know if this is the right place to ask this, but I've been
> > working
> > > on a wordpress plugin and I'm looking for some testers/feedback from
> > other
> > > wp hackers.  Anyway, the url is
> > > http://theblogthatnoonereads.tunasoft.com/coralize/
> >
> > That looks like a great plugin. A few things from browsing the source:
> >
> > * `wp_head` is a really bad hook to put `coralize_site()` on, since
> > it's theme-dependent and called very late. Maybe `plugins_loaded` or
> > `init`.
> >
> > * For the blacklist regex, you can use negative lookahead. Something
> > like:
> >
> >     (<img\s+.*?src="http://(?!(example.com|example.net)).*?)(/.*?".*?>)
> >
> > * Single quotes are also valid for HTML attributes, but the plugin
> > only matches double quotes.
> >
> > * Is there some reason I don't see to use `coralize_preg_domain()`
> > instead of PHP's `preg_quote()`?
> >
> > * Just for general readability, you don't need to backslash-escape
> > nearly so much in the regular expressions, especially if you use
> > something other than forward-slash as the delimiter.
> >
> > :)
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
>
>


More information about the wp-hackers mailing list