Title: Cannot activate
Last modified: November 6, 2016

---

# Cannot activate

 *  Resolved [EastDevonAlliance](https://wordpress.org/support/users/eastdevonalliance/)
 * (@eastdevonalliance)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/cannot-activate-34/)
 * Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string()
   in /wp-content/plugins/wp-mailing-group/mailing-group-module.php:246
    Stack trace:#
   0 /wp-includes/plugin.php(524): wpmg_add_mailing_group_plugin(”) #1 /wp-admin/
   plugins.php(166): do_action(‘activate_wp-mai…’) #2 {main} thrown in /wp-content/
   plugins/wp-mailing-group/mailing-group-module.php on line 246

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

 *  Thread Starter [EastDevonAlliance](https://wordpress.org/support/users/eastdevonalliance/)
 * (@eastdevonalliance)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/cannot-activate-34/#post-8403279)
 * Using PHP 7.
 * Host is 1and1.co.uk
 *  Thread Starter [EastDevonAlliance](https://wordpress.org/support/users/eastdevonalliance/)
 * (@eastdevonalliance)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/cannot-activate-34/#post-8403299)
 * Hmm … it looks like this plugin is not PHP7 compliant and this is why I am receiving
   this error. According to [http://php.net/manual/en/function.mysql-real-escape-string.php](http://php.net/manual/en/function.mysql-real-escape-string.php):
 * Warning
    mysql_real_escape_string was deprecated in PHP 5.5.0, and it was removed
   in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used. See 
   also MySQL: choosing an API guide and related FAQ for more information. Alternatives
   to this function include: mysqli_real_escape_string() PDO::quote()
 * I will try changing this call from mysql_ to mysqli_ and see if it works and 
   post the results back here.
 *  Thread Starter [EastDevonAlliance](https://wordpress.org/support/users/eastdevonalliance/)
 * (@eastdevonalliance)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/cannot-activate-34/#post-8403305)
 * There were 10 instances of mysql_real_escape_string in x and I replaced them 
   with mysqli_real_escape_string and the plugin activated. So providing that the
   plugin works now that it is activated, this looks like an easy fix.
 * I will now try to configure it and see if it works.
 *  Plugin Author [Yamna Khawaja](https://wordpress.org/support/users/marcusbs/)
 * (@marcusbs)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/cannot-activate-34/#post-8407346)
 * Thanks, in next release the plugin will be PHP 7 compliant.
 *  Plugin Author [Yamna Khawaja](https://wordpress.org/support/users/marcusbs/)
 * (@marcusbs)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/cannot-activate-34/#post-8407422)
 * A better choice would have been using esc_sql() which is a native wordpress function.
   [https://codex.wordpress.org/Function_Reference/esc_sql](https://codex.wordpress.org/Function_Reference/esc_sql)
   
   Thats untested for now. Will test soon.
 *  Thread Starter [EastDevonAlliance](https://wordpress.org/support/users/eastdevonalliance/)
 * (@eastdevonalliance)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/cannot-activate-34/#post-8407450)
 * I was just looking for a quick and dirty fix to get it going.
 * Having got it to activate I have been trying to make it work today – eventually
   I switched back to a configuration I had previously used but didn’t work, and
   hey presto it suddenly started working.
 * But in this process I took a look at the code and also made a list of several
   minor issues. I am happy to provide you feedback via Skype if you are interested.
 * But my biggest suggestion is that you should consider open sourcing the free 
   version on GitHub to allow the community to help you improve the plugin more 
   rapidly. You would need to retrofit these changes to the paid version which would
   remain proprietary code.

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

The topic ‘Cannot activate’ is closed to new replies.

 * ![](https://ps.w.org/wp-mailing-group/assets/icon-128x128.png?rev=1113552)
 * [Mailing Group Listserv](https://wordpress.org/plugins/wp-mailing-group/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-mailing-group/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-mailing-group/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-mailing-group/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-mailing-group/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-mailing-group/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [EastDevonAlliance](https://wordpress.org/support/users/eastdevonalliance/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/cannot-activate-34/#post-8407450)
 * Status: resolved