How do I solve the strict standards definitions for class marketpress?

I have a number of "Strict Standards" error statements showing up to be debugged...

Redefining already defined constructor for class MarketPress in /wordpress/wp-content/plugins/marketpress/marketpress.php on line 52

Redefining already defined constructor for class MarketPress_Shortcodes in /wordpress/wp-content/plugins/marketpress/marketpress-includes/marketpress-shortcodes.php on line 12

There are 10 in total. How can I fix this?


  • Ash

    Hello Monique

    I hope you are well today and thanks for asking the question.

    I guess you are using 5.4+ and in newer versions E_STRICT is part of E_ALL. Also, I don't think it's harmful for your application. But if you really want to remove this, you need to follow the instruction.

    For example:

    Redefining already defined constructor for class MarketPress in /wordpress/wp-content/plugins/marketpress/marketpress.php on line 52

    If you go to marketpress.php file you will see there is a class declared
    class MarketPress {

    On line 52 you will see a constructor declared
    function __construct() {

    Just before that constructor you will see a function that has same name as class name. In this file line no 48 to 50:

    function MarketPress() {

    You need to remove this function.

    You need to do this for every file where you are getting this notice. Also, I am requesting the developer, if he can get some better solution/suggestion for this.

    Note that, please keep a backup of your marketpress plugin folder/files, so that if any problem occurs you can restore them.

    Hope it helps. Please feel free to ask if you have any more question.


  • MoniQ

    Goal: to setup network of stores with a gallery-style standard theme template.

    Currently running: WP 3.6.1 with Multisite configured; activated MarketPress 2.8.8 (with Akismet and WPMU DEV Dahsboard too).

    History: Configured Multisite after playing with MarketPress and themes for a while. I failed badly at child-theme customization which crashed the site. Site is back up now after deleting (and re-installing a fresh copy of) FrameMarket and GridMarket. I have not re-activated GridMarket since, instead I am trying to setup an initial store using the Gallery Theme to use its great picture display options, but finding this slow. The 10 error messages are my first priority to clean up.

  • MoniQ

    I would like to keep debug on while I develop.

    In a previous posting, a person updated WP and it solved this error for him, but in my case an update did not correct this - why?

    I thought even the pickiest error notices like this were an indication that something changed/went wrong during all my various theme changes/activations and marketpress setting-changes for example, because these errors showed up after all that. There should be a way to correct this right? As I would like to maintain a clean multisite, to reduce chances later for things to go wrong in the shopping cart.

    (For example currently, I have reloaded framemarket and gridmarket 2 times, after deleting gallery theme, and they are not loading. I just have these picky error notices and no theme right now. At this point I am considering a total re-install of WP and multisite config.)

    If you are saying I should ignore this list of errors, and by doing so, I won't be creating more problems down the road (if I can fix my theme issue), which way below would be the best way to modify debug (these are an excerpt from the link above):

    In your php.ini change

    error_reporting = E_ALL


    error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT

    If you don't have access to the php.ini, you can potentially put this in your .htaccess file:

    php_value error_reporting 30711

    This is the E_ALL value (32767) and the removing the E_STRICT (2048) and E_NOTICE (8) values.

    If you don't have access to the .htaccess file or it's not enabled, you'll probably need to put this at the top of the PHP section of any script that gets loaded from a browser call:

    error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE);

    One of those should help you be able to use the software. The notices and strict stuff are indicators of problems or potential problems though and you may find some of the code is not working correctly in PHP 5.4.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.