Title: Fixing 2 PHP errors
Last modified: August 31, 2016

---

# Fixing 2 PHP errors

 *  [komani](https://wordpress.org/support/users/komani/)
 * (@komani)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/fixing-2-php-errors/)
 * Hi guys, so I have two errors that gets repeated plenty of times in my php errorlog.
 * First error:
 * **Array to string conversion in woocommerce/zn-woocommerce-init.php on line 96**
 * _Line 96 in zn-woocommerce-init.php:_
 * `$output .= '<img src="'. woocommerce_placeholder_img_src() .'" alt="Placeholder"
   width="' . $placeholder_width . '" height="' . $placeholder_height . '" />';`
 * Second error:
 * **The called constructor method for WP_Widget is ****deprecated** since version
   4.3.0! Use
 *     ```
       __construct()
       ```
   
 *  instead. in wp-includes/functions.php on line 3619
 * _Line 3585 to 3630 in functions.php:_
 *     ```
       /**
        * Marks a constructor as deprecated and informs when it has been used.
        *
        * Similar to _deprecated_function(), but with different strings. Used to
        * remove PHP4 style constructors.
        *
        * The current behavior is to trigger a user error if <code>WP_DEBUG</code> is true.
        *
        * This function is to be used in every PHP4 style constructor method that is deprecated.
        *
        * @since 4.3.0
        * @access private
        *
        * @param string $class   The class containing the deprecated constructor.
        * @param string $version The version of WordPress that deprecated the function.
        */
       function _deprecated_constructor( $class, $version ) {
   
       	/**
       	 * Fires when a deprecated constructor is called.
       	 *
       	 * @since 4.3.0
       	 *
       	 * @param string $class   The class containing the deprecated constructor.
       	 * @param string $version The version of WordPress that deprecated the function.
       	 */
       	do_action( 'deprecated_constructor_run', $class, $version );
   
       	/**
       	 * Filter whether to trigger an error for deprecated functions.
       	 *
       	 * <code>WP_DEBUG</code> must be true in addition to the filter evaluating to true.
       	 *
       	 * @since 4.3.0
       	 *
       	 * @param bool $trigger Whether to trigger the error for deprecated functions. Default true.
       	 */
       	if ( WP_DEBUG && apply_filters( 'deprecated_constructor_trigger_error', true ) ) {
       		if ( function_exists( '__' ) ) {
       			trigger_error( sprintf( __( 'The called constructor method for %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ), $class, $version, '<pre>__construct()</pre>' ) );
       		} else {
       			trigger_error( sprintf( 'The called constructor method for %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $class, $version, '<pre>__construct()</pre>' ) );
       		}
       	}
   
       }
       ```
   
 * Anyone able to spot what I shall edit in these lines?
    I thank you in advance
   and hopefully these errors will be easy to squash 🙂

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

 *  [kjodle](https://wordpress.org/support/users/kjodle/)
 * (@kjodle)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/fixing-2-php-errors/#post-7010190)
 * Is WordPress up to date? Your theme? Your plugins?
 * > Anyone able to spot what I shall edit in these lines?
 * You should never edit theme, plugin, or WP core files.
 *  Thread Starter [komani](https://wordpress.org/support/users/komani/)
 * (@komani)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/fixing-2-php-errors/#post-7010196)
 * WP & Plugins up to date, theme is not.
    Dont know what is causing it.
 *  [kjodle](https://wordpress.org/support/users/kjodle/)
 * (@kjodle)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/fixing-2-php-errors/#post-7010231)
 * Try updating your theme and seeing if the issue resolves itself.
 *  Thread Starter [komani](https://wordpress.org/support/users/komani/)
 * (@komani)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/fixing-2-php-errors/#post-7010232)
 * I updated the theme a long time ago but reverted it because it changed the interface
   of the website too much.
    So I am looking to fix these issues in some other way,
   manually.
 *  [kjodle](https://wordpress.org/support/users/kjodle/)
 * (@kjodle)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/fixing-2-php-errors/#post-7010281)
 * Anytime you get a message that something is deprecated, it’s usually because 
   you have a theme or plugin that is out of date. Editing something is WordPress
   core is not the way to fix it, and is likely to cause even more problems down
   the road.
 * You can always create a child theme to maintain the integrity of your website’s
   appearance. That way, you can update the theme without losing your appearance
   and you don’t run into issues like this.
 *  Thread Starter [komani](https://wordpress.org/support/users/komani/)
 * (@komani)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/fixing-2-php-errors/#post-7010298)
 * Okay, that a great idea… If I knew how to do it lol.
    So, I have the latest version
   of the theme downlaoded, I named it _themename_-child and I shall place it in
   the same folder as the current theme my site is using; wp-content/themes. So 
   far, so good?
 * Next up, I go in Appearance -> Themes -> Activate Child theme -> Done?
    Haven’t
   done this yet, so would this be a correct way to go about it or am I missing 
   something
 *  [kjodle](https://wordpress.org/support/users/kjodle/)
 * (@kjodle)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/fixing-2-php-errors/#post-7010338)
 * No, not quite.
 * The Codex page about child themes is here:
 * [https://codex.wordpress.org/Child_Themes](https://codex.wordpress.org/Child_Themes)
 * But if you have edited theme files already, you should read this tutorial I wrote
   about wrangling a child theme out of your original theme modifications:
 * [http://techblog.kjodle.net/2014/04/12/wordpress-child-themes-the-whys-and-hows/](http://techblog.kjodle.net/2014/04/12/wordpress-child-themes-the-whys-and-hows/)
 * Even if you didn’t modify theme files, and are just using an older version, you
   can use the same approach.

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

The topic ‘Fixing 2 PHP errors’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 2 participants
 * Last reply from: [kjodle](https://wordpress.org/support/users/kjodle/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/fixing-2-php-errors/#post-7010338)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
