Title: Getting a preg_replace_callback(): Compilation failed: warning
Last modified: August 21, 2016

---

# Getting a preg_replace_callback(): Compilation failed: warning

 *  [Onda Concepts](https://wordpress.org/support/users/onda-concepts/)
 * (@onda-concepts)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/getting-a-preg_replace_callback-compilation-failed-warning/)
 * I used the WP plugin duplicator to create a package of my production site so 
   that I can do some local sandbox enhancements in my MAMP environment.
 * However, when I installed it locally, cleared the build cache, I get this warning
   from shortcodes pro:
 * > [24-Jun-2014 00:23:58 UTC] PHP Warning: preg_replace_callback(): Compilation
   > failed: missing opening brace after \o at offset 45 in /Applications/MAMP/htdocs/
   > examplesite/wp-content/plugins/shortcodes-pro/inc/class-shortcodespro-base.
   > php on line 57
 * The issue seems to be with this pattern variable:
 * > $pattern = ‘~\[do action\=\”[^\”]*\”\s?[^\]\/]*\]( [^\[\d\o\n]* )\[\/do\]~’;
 * Would anyone know why I may be getting this? My production site is working fine
   I believe.
 * My set up is as follows:
    - MAMP: Version 3.0.3
    - WordPress: version 3.9.1
    - OS: Max OS X Mavericks
    - Shorcodes Pro: version 1.1.5
 * Please let me know if you require any additional information.
 * Thank you for your assistance in this matter!
 * [https://wordpress.org/plugins/shortcodes-pro/](https://wordpress.org/plugins/shortcodes-pro/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [timbr](https://wordpress.org/support/users/brugman/)
 * (@brugman)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/getting-a-preg_replace_callback-compilation-failed-warning/#post-5036189)
 * Same warning message showing up here. The PHP function must have changed to be
   slightly more strict in 5.5. Please update the plugin. I tried to get you the
   exact code that needs changing but regex is not my strong suit.
 * Windows
    WampServer 2.5 PHP 5.5.12 Apache 2.4.9 WordPress 3.9.1 Shortcodes Pro
   1.1.5
 *  [pazis](https://wordpress.org/support/users/pazis/)
 * (@pazis)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/getting-a-preg_replace_callback-compilation-failed-warning/#post-5036192)
 * Changing the line to
 * > $pattern = ‘~\[do action\=\”[^\”]*\”\s?[^\]\/]*\]( [^\[\do\n]* )\[\/do\]~’;
 * This would solve the problem!
 *  [trustcompanyozarks](https://wordpress.org/support/users/trustcompanyozarks/)
 * (@trustcompanyozarks)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/getting-a-preg_replace_callback-compilation-failed-warning/#post-5036199)
 * Hi there,
    I’m having this same issue. Bear with me – I’m not exactly a coding
   pro, but I’m very familiar with WordPress. Has anyone discovered a concrete resolution
   to this problem? Will changing the original line problem to this:
 * > $pattern = ‘~\[do action\=\”[^\”]*\”\s?[^\]\/]*\]( [^\[\do\n]* )\[\/do\]~’;
 * solve the problem? If so, where can I locate how to edit that line?
 * Thanks.
 *  [Paulo Roberto Sasso](https://wordpress.org/support/users/paulo-roberto-sasso/)
 * (@paulo-roberto-sasso)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/getting-a-preg_replace_callback-compilation-failed-warning/#post-5036200)
 * Meu site está inacessível ao público.
 * Esta é a mensagem que surge nos artigos, menus e widgets do site nas tentativas
   de acesso público:
 * Warning: preg_replace_callback() [function.preg-replace-callback]: Compilation
   failed: missing opening brace after \o at offset 45 in /home/queroema/public_html/
   wp-content/plugins/shortcodes-pro/inc/class-shortcodespro-base.php on line 57.
 * No Cpanel do site afetado está assim:
 * Linha 56: $pattern = ‘~\[do action\=\”[^\”]*\”\s?[^\]\/]*\]( [^\[\d\o\n]* )\[\/
   do\]~’;
 * Linha 57: $content = preg_replace_callback( $pattern, array( &$this, ‘replace_do_shortcode_callback’),
   $content );
 * Afinal onde está o erro (qual linha deve ser alterada), e como corrigi-lo?
 *  [Paulo Roberto Sasso](https://wordpress.org/support/users/paulo-roberto-sasso/)
 * (@paulo-roberto-sasso)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/getting-a-preg_replace_callback-compilation-failed-warning/#post-5036204)
 * O Problema acima foi resolvido com a alteração do código na linha 56.
 * Alterar em: CPanel>public_html>wp-content>plugins>shortcodespro>inc>class-shortcodespro-
   base.php
 * $pattern = ‘~\[do action\=\”[^\”]*\”\s?[^\]\/]*\]( [^\[\do\n]* )\[\/do\]~’;
 * Exatamente como está. Funciona bem.
 *  [drjonesy](https://wordpress.org/support/users/drjonesy/)
 * (@drjonesy)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/getting-a-preg_replace_callback-compilation-failed-warning/#post-5036214)
 * ==============================
    ~~~~ SOLVED ~~~~ ============================
   ==
 * _pazis, solved the error issue._
    It’s a great plugin.
 * Replace or comment out // Line 56 on the “class-shortcodespro-base.php” file 
   and add the replacement code.
 * **~~~~~~ File Location:**
 * > wp-content > plugins > shortcodes-pro > inc > class-shortcodespro-base.php
 * `$pattern = '~\[do action\=\"[^\"]*\"\s?[^\]\/]*\]( [^\[\do\n]* )\[\/do\]~';`
 * _Ex. Here’s what I did…._
 *     ```
       // normal shortcode/no nesting
       			//$pattern = '~\[do action\=\"[^\"]*\"\s?[^\]\/]*\]( [^\[\d\o\n]* )\[\/do\]~';
       			$pattern = '~\[do action\=\"[^\"]*\"\s?[^\]\/]*\]( [^\[\do\n]* )\[\/do\]~';
       			$content =  preg_replace_callback( $pattern, array( &$this, 'replace_do_shortcode_callback' ), $content );
   
       			return $content;
       		}
       ```
   
 *  [cataphor](https://wordpress.org/support/users/cataphor/)
 * (@cataphor)
 * [11 years ago](https://wordpress.org/support/topic/getting-a-preg_replace_callback-compilation-failed-warning/#post-5036231)
 * Shortcodes Pro seems to be essentially extinct now. My own client’s sites didn’t
   really suffer until their hosting updated to php 5.4 recently, and then this 
   same error appeared.
 * Looking at the entry for Shortcodes Pro in the /admin page under Plugins, one
   can see that the plugin has not been updated for at least 3 years and that it
   has received some comments about not being compatible with even WordPress 4, 
   not to mention later minor versions.
 * Worse, the link from the /admin page under Plugins to the plugin author’s site
   is broken. In fact, even the author’s domain, mattvarone.com, is no longer working.
 * I can’t see continuing with the use of this plugin. But to be perfectly honest,
   this is where all use of WordPress ends up eventually, with one plugin after 
   another failing and/or going out of support.
 *  [Theunknown1](https://wordpress.org/support/users/deexgnome/)
 * (@deexgnome)
 * [10 years, 12 months ago](https://wordpress.org/support/topic/getting-a-preg_replace_callback-compilation-failed-warning/#post-5036232)
 * @ drjonesy
 * You are my man. With the latest php5-fpm shortcodes pro crashed my site. With
   your workarround all is again working fine. Thanks alot

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Getting a preg_replace_callback(): Compilation failed: warning’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/shortcodes-pro_434343.svg)
 * [Shortcodes Pro](https://wordpress.org/plugins/shortcodes-pro/)
 * [Support Threads](https://wordpress.org/support/plugin/shortcodes-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcodes-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcodes-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcodes-pro/reviews/)

 * 8 replies
 * 8 participants
 * Last reply from: [Theunknown1](https://wordpress.org/support/users/deexgnome/)
 * Last activity: [10 years, 12 months ago](https://wordpress.org/support/topic/getting-a-preg_replace_callback-compilation-failed-warning/#post-5036232)
 * Status: not resolved