PHP Fatal error: Maximum execution in acronym plugin (4 posts)

  1. elyonline
    Posted 9 years ago #

    Hi All,

    I am using this plugin: http://www.100px.com/100wordpress/remplazador_de_acronimos_la_nueva_generacion/ but it displays the following error...

    [20-Apr-2006 00:16:53] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/news/wp-content/plugins/acronym-revisited.php on line 275

    Line 275 relates to this... $text = preg_replace("|(].*)()$theAcronym()(.*)|imsU" , "$1$3$theAcronym$4$5" , $text);

    This is the plugins source: http://pastebin.com/670744

    Does anyone know why this error would be displayed?


  2. davidchait
    Posted 9 years ago #

    Ummm, because it does a ton of preg_replaces for EVERY acronym in its database? So, a big article, plus a ton of acronyms in the database, equals a lot of processing time. So running the process ends up exceeeding your PHP processing time limit.

    But, you don't want a standard page load to take 30 seconds in ANY case... what's your page load time WITHOUT this plugin active? how about page load for a single article being viewed? okay, THEN, how about page load for a single article WITH the plugin reactivated?

    There are other coding approaches which would cut down the time significantly. Since I have a plugin with a similar type of functionality (that is, look for particular tags within post content and replace them live), I know there are faster ways... such as doing a optimal match expressions to detect if there's anything to replace (i.e., make a match for ALL acronyms), then loop through the matches, rebuilding the body content block as you go.

    But you'd have to ask the plugin writer about this for more details. ;)


  3. elyonline
    Posted 9 years ago #

    Thanks Davis, what is your plugin as a matter of interest?


  4. davidchait
    Posted 9 years ago #

    CG-Inline is the one I was referring to. It does sort of 'macro based' link creation, including post permalinks, multi-page links, my CG-Amazon inline text and image product links, as well as links to click through to google, wikipedia, and other data lookup sources.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.