0

I am building my first Wordpress site, I just downloaded and installed v3.9.1. I bought a theme (rustik3) and I am trying to install it, but I am running into these errors produced by WP_DEBUG:

Notice: Use of undefined constant Redux_TEXT_DOMAIN - assumed 'Redux_TEXT_DOMAIN' in /var/www/wp-content/themes/rustik3/admin/options.php on line 501

Notice: Use of undefined constant Redux_TEXT_DOMAIN - assumed 'Redux_TEXT_DOMAIN' in /var/www/wp-content/themes/rustik3/admin/options.php on line 502

Notice: Use of undefined constant Redux_TEXT_DOMAIN - assumed 'Redux_TEXT_DOMAIN' in /var/www/wp-content/themes/rustik3/admin/options.php on line 503

Notice: Undefined variable: item_info in /var/www/wp-content/themes/rustik3/admin/theme-functions.php on line 23

I have done some googling, and I'm starting to think that the last Wordpress update made it so that the Redux Framework is deprecated and cannot be used. This is just a hunch though. As of right now, the theme installs, but it shows up as completely blank - either when I go to http://localhost or when I am trying to customize it in the Wordpress UI. I haven't looked into the last part of the error messages log (line 23 error)...but it is just an undefined variable so I might be able to tackle that one myself. Any ideas?

UPDATE

This is what the chunk of code looks like in options.php:

array(
            'id' => 'google_webfonts',
            'type' => 'google_webfonts',
            'title' => __('Enable Google Webfonts', Redux_TEXT_DOMAIN), 
            'sub_desc' => __('Pick from over 600 Google Webfonts to use on the site. Then select below which elements you want to apply it to.', Redux_TEXT_DOMAIN),
                'desc' => __('', Redux_TEXT_DOMAIN)
      ),

UPDATE

I did a text search through all of the wordpress files for Redux_TEXT_DOMAIN and the only spot it appears is in the above chunk of code...

UPDATE

This code is what loads the text domain in the theme I have...I am not familiar with what a text domain is - but this might be relevant:

public function load_textdomain() {
        if ( isset( $this->textdomain_loaded ) )
            return $this->textdomain_loaded;

        $textdomain = $this->get('TextDomain');
        if ( ! $textdomain ) {
            $this->textdomain_loaded = false;
            return false;
        }

        if ( is_textdomain_loaded( $textdomain ) ) {
            $this->textdomain_loaded = true;
            return true;
        }

        $path = $this->get_stylesheet_directory();
        if ( $domainpath = $this->get('DomainPath') )
            $path .= $domainpath;
        else
            $path .= '/languages';

        $this->textdomain_loaded = load_theme_textdomain( $textdomain, $path );
        return $this->textdomain_loaded;
    }

Is there something wrong with the above code?

Note: I have posted a duplicate question here. I did this before I was aware that there was a Wordpress specific section of Stack Exchange. If you care about stackoverflow.com - you can answer the question there...I have put a 50 point bounty on it :). You should also read the comments on that page...I think I may have found some relevant information.

UPDATE

Thanks to a comment by cybmeta - I got rid of the Redux_TEXT_DOMAIN errors...the last one left is this:

Notice: Undefined variable: item_info in /var/www/wp-content/themes/rustik3/admin/theme-functions.php on line 23

Here is the code:

$item_info .= '<div class="rustik_updated"><div class="mc_embed_signup_admin">
        <form action="http://doublerainbowx.us6.list-manage2.com/subscribe/post?u=eac2b83a92633c39dae8a663b&amp;id=334c60b856" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
            <label for="mce-EMAIL">Get e-mails about important updates and helpful tips on how to run your store by joining the Rustik newsletter.</label>
            <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
            <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
            <div style="position: absolute; left: -5000px;"><input type="text" name="b_eac2b83a92633c39dae8a663b_334c60b856" value=""></div>
            <input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">
            <span><a href="?rustik_updates_nag_ignore=0">Hide Notice</a></span>
        </form>

        </div></div>';

        echo $item_info;

The error is thrown on the echo $item_info line - so it is as if it isn't being set for some reason...even though it looks like it is above.

  • if Redux_TEXT_DOMAIN it is not a PHP constant, you should write it as string (between quotes) to pass it as the textdomain parameter of a gettext function. – cybmeta Jul 2 '14 at 17:37
  • @cybmeta I think it is a constant though - part of the theme...some part of it is dependant on this aspect of the Redux Framework...I think – ewizard Jul 2 '14 at 17:40
  • @cybmeta I tried it and it got rid of the error! the only one i have left is this one now...Notice: Undefined variable: item_info in /var/www/wp-content/themes/rustik3/admin/theme-functions.php on line 23 any ideas? – ewizard Jul 2 '14 at 17:43
  • @cybmeta im updating my question to show the code in theme-functions.php – ewizard Jul 2 '14 at 17:45
  • @cybmeta is $item_info not being set because of .= what is the difference between that and just using =? – ewizard Jul 2 '14 at 17:51
0

The problem with your $item_info is that the variable is not initialized before your try to append to it. $item_info .= 'String content'; is the exact same thing as $item_info = $item_info . 'String content';, so all you need is to check whether or not this variable exists:

if (!isset($item_info)) { 
    $item_info = '';
}
$item_info .= '<div class="rustik_updated"><div class="mc_embed_signup_admin">
    <form action="http://doublerainbowx.us6.list-manage2.com/subscribe/post?u=eac2b83a92633c39dae8a663b&amp;id=334c60b856" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
        <label for="mce-EMAIL">Get e-mails about important updates and helpful tips on how to run your store by joining the Rustik newsletter.</label>
        <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
        <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
        <div style="position: absolute; left: -5000px;"><input type="text" name="b_eac2b83a92633c39dae8a663b_334c60b856" value=""></div>
        <input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">
        <span><a href="?rustik_updates_nag_ignore=0">Hide Notice</a></span>
    </form>

    </div></div>';

Sometimes developers sell themes/plugins without testing them with warnings ON, that's why you have this error.

  • oooo thanks...the if (!isset($item_info)) { $item_info = ''; } looks promising...wouldn't have thought to do that...I am not on the computer with my stuff on it...so ill check it out when i can and get back to you...thanks! – ewizard Jul 2 '14 at 21:16
  • incase it doesn't work lol - $item_info is declared and set with = in another file (so im not just trying to set it with a string concatination - i think you realize this already judging by your idea for a solution...but what reasons would it have to not recognize $item_info if it is being declared in a different file? – ewizard Jul 2 '14 at 21:18
  • if file is not loaded, if var failed to be initialized, you always have to verify that thing exist even if you just declared it. – Jonathan Lafleur Jul 3 '14 at 13:33
  • good to know - haven't gotten around to trying yet...so this is like a php best practice type thing? or you are saying it will never work unless i do what you suggested? – ewizard Jul 3 '14 at 16:39
  • it's more a best practice. – Jonathan Lafleur Jul 3 '14 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.