envato-wordpress-toolkit icon indicating copy to clipboard operation
envato-wordpress-toolkit copied to clipboard

Failure to detect existing envato theme

Open reidbiztech opened this issue 9 years ago • 9 comments

The current version of this plugin (1.7.3) fails to detect the presence of the current Envato theme on my site (Blaszok Version: 3.2.1).

"Blaszok has not been installed. View version 3.4.2 details or install automatically."

So hoping for the best I tried "install automatically", but to no avail, it fails with:

"Downloading install package from the Envato API… Unpacking the package… Installing the theme… Destination folder already exists. path-removed-for-post/wp-content/themes/blaszok/ Theme install failed."

So this renders the plugin pretty much useless. It would be great if it did work. In the meantime I will just manually copy the new theme version files into my site, but I have to wonder if any update/activation actions will be missing.

Thanks for your attention to this matter.

reidbiztech avatar Jul 22 '15 19:07 reidbiztech

I have the same issue with my Blogy Theme by 2035 Themes... I did not want to risk clicking install automatically in case it overwrote my existing data. I get the same message from within the Toolkit page "Blogy Personal Blog & Portfolio Wordpress Theme has not been installed. View version 1.4.7 details or install automatically."

Is this a toolkit issue or a theme issue?

Would be good to know as I would love to be able to use the auto update feature of this toolkit

Please advise :)

justingarrett avatar Aug 02 '15 13:08 justingarrett

Hello guys! I have the same problem. After few hours i've established:

In my theme's style.css file the header 'Author' is set to: <a href="http://themeforest.net/user/apollo13" target="_blank">Apollo13</a>

Your plugin is using WordPress wp_get_themes() function to get information about installed themes and WordPress always returns this field without target attribute (file class-wp-theme.php) look for 'sanitize_header' function, which allows 'Author' field to have only 'href' and 'title' attribute. So it looks: <a href="http://themeforest.net/user/apollo13">Apollo13</a>

Meanwhile your API returns Author without any sanitization, so in my case it looks: <a href="http://themeforest.net/user/apollo13" target="_blank">Apollo13</a>

and this causes FALSE in condition located here: https://github.com/envato/envato-wordpress-toolkit/blob/master/index.php#L421

Surgeonito avatar Aug 10 '15 19:08 Surgeonito

Same Issue here, with Theme Une Boutique. Is there a workaround for this problem yet?

Regards,

Sebastian

baddel73 avatar Aug 12 '15 16:08 baddel73

To work around it you would have to:

  1. Change internal WordPress function that sanitize css header or
  2. Change the code of 'Envato WordPress Toolkit' plugin here: https://github.com/envato/envato-wordpress-toolkit/blob/master/index.php#L421 or
  3. Somehow, by magic - I guess - change the Envato API

good luck! none of above is acceptable.

Surgeonito avatar Aug 13 '15 06:08 Surgeonito

Thanks for your reply Surgeonito. After trying to understand what's happening in the give part of the code I realized, that in my case the Author simply just changed it's name. In the "Available Themes"-Section of the plugin they where listed with "Capital Themes" (their name on Envato), in style.css the author was named "CapitalH.ir" (their old name?). So I changed the authors name in the stylesheet manually and the update worked fine. In the updated stylesheet the authors name is now correct, so hopefully no more future problems. HTH Sebastian

baddel73 avatar Aug 13 '15 13:08 baddel73

Yep, but what if Author didn't change? zonk...

Surgeonito avatar Aug 14 '15 12:08 Surgeonito

Hm, you pointed me to the right part of the code. I simply added some echos to see which field made the difference.

 if ( ! empty( $item_details ) ) {
                echo '<h1>' . $theme->theme_name . '</h1>';
                /* get installed theme information */
                foreach( $get_themes as $k => $v ) {
                    echo '<h3>k:' . $k;
                    echo ', v:' . $v . '</h3>';
                    echo ($get_themes[$k]['Title'] == $title) . '<br>';
                    echo ($get_themes[$k]['Author Name'] == $author) . '<br>';
                    echo ($template == '') . '<br>';

                    echo $get_themes[$k]['Title'];
                    echo '<br>';
                    echo $title;
                    echo '<br>';
                    echo $get_themes[$k]['Author Name'];
                    echo '<br>';
                    echo  $author;
                    echo '<br>';
                    echo 'template:' . $template . '<br>';
                    echo '---<br>';

Lucky me there was no need for me to mess with with the code, but I guess my second approach would have been to eliminate the author condition temporarily and go with

                  if ( $get_themes[$k]['Title'] == $title && $template == '' ) {

baddel73 avatar Aug 14 '15 12:08 baddel73

Yep again, but it's not a solution you could recommend to the customer. Changing the plugin's code is not acceptable.

Surgeonito avatar Aug 14 '15 16:08 Surgeonito

Indeed it isn't. But hopefully someone in charge reads this ...

baddel73 avatar Aug 14 '15 16:08 baddel73