Plugin Directory


Opened 12 years ago

Last modified 11 years ago

#401 assigned enhancement

Speed enhancement

Reported by: mastermind Owned by: ryanduff
Priority: low Severity: normal
Plugin: wp-contact-form Keywords:


On line 121 of wp-contactform.php, you write

if(! preg_match('|<!--contact form-->|', $content))

I don't see the point of using a regular expression here, I replaced your line with

if(! strpos($content, '<!--contact form-->'))

which is much "cheaper", especially on long sites.


Change History (2)

comment:1 @ryanduff11 years ago

  • Status changed from new to assigned

comment:2 @ryanduff11 years ago

This is actually a better substitute:

if(false === strpos($content, '<!--contact form-->'))

Note: See TracTickets for help on using tickets.