Title: wp-plugin.php error on line 27
Last modified: August 22, 2016

---

# wp-plugin.php error on line 27

 *  [Phil995511](https://wordpress.org/support/users/phil995511/)
 * (@phil995511)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/wp-pluginphp-error-on-line-27/)
 * Hello,
 * I have some problem on my site, the preview of my theme don’t work correctly.
   When I in WP_DEBUG_LOG limited to 128 Mb I have this results :
 * Strict Standards: Redefining already defined constructor for class ReCAPTCHAPlugin
   in /var/www/virtual/maggeek.com/htdocs/wp-content/plugins/wp-recaptcha/recaptcha.
   php on line 41 Strict Standards: Redefining already defined constructor for class
   WPPlugin in /var/www/virtual/maggeek.com/htdocs/wp-content/plugins/wp-recaptcha/
   wp-plugin.php on line 27
 * Reading more at this problem :
 * [http://generatepress.com/forums/topic/small-incompatibility/#post-57743](http://generatepress.com/forums/topic/small-incompatibility/#post-57743)
 * Tks for your help.
 * [https://wordpress.org/plugins/wp-recaptcha/](https://wordpress.org/plugins/wp-recaptcha/)

Viewing 1 replies (of 1 total)

 *  [andrewgould](https://wordpress.org/support/users/andrewgould/)
 * (@andrewgould)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/wp-pluginphp-error-on-line-27/#post-5617222)
 * Luckily there is a simple fix for this. You need to swap the order of some of
   the functions around in recaptcha.php and wp-plugin.php.
 * In both files, the `function __construct` block should come before the function
   that shares the same name as the class. For example, recaptcha.php had been looking
   like this:
 *     ```
       class ReCAPTCHAPlugin extends WPPlugin
       {
           private $_saved_error;
           private $_reCaptchaLib;
   
           /**
            * Php 4 Constructor.
            *
            * @param string $options_name
            */
           function ReCAPTCHAPlugin($options_name) {
               $args = func_get_args();
               call_user_func_array(array(&$this, "__construct"), $args);
           }
   
           /**
            * Php 5 Constructor.
            *
            * @param string $options_name
            */
           function __construct($options_name) {
               parent::__construct($options_name);
               $this->register_default_options();
   
               // require the recaptcha library
               $this->_require_library();
   
               // register the hooks
               $this->register_actions();
               $this->register_filters();
           }
       ```
   
 * But will now need to look like:
 *     ```
       class ReCAPTCHAPlugin extends WPPlugin
       {
           private $_saved_error;
           private $_reCaptchaLib;
   
           /**
            * Php 5 Constructor.
            *
            * @param string $options_name
            */
           function __construct($options_name) {
               parent::__construct($options_name);
               $this->register_default_options();
   
               // require the recaptcha library
               $this->_require_library();
   
               // register the hooks
               $this->register_actions();
               $this->register_filters();
           }
   
           /**
            * Php 4 Constructor.
            *
            * @param string $options_name
            */
           function ReCAPTCHAPlugin($options_name) {
               $args = func_get_args();
               call_user_func_array(array(&$this, "__construct"), $args);
           }
       ```
   
 * Make sure you make the same type of change to wp-plugin.php too.

Viewing 1 replies (of 1 total)

The topic ‘wp-plugin.php error on line 27’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-recaptcha.svg)
 * [WP-reCAPTCHA](https://wordpress.org/plugins/wp-recaptcha/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-recaptcha/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-recaptcha/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-recaptcha/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-recaptcha/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-recaptcha/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [andrewgould](https://wordpress.org/support/users/andrewgould/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/wp-pluginphp-error-on-line-27/#post-5617222)
 * Status: not resolved