Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected HTML output when updating WordPress #191

Open
rodrigoprimo opened this issue Nov 17, 2014 · 25 comments
Open

Unexpected HTML output when updating WordPress #191

rodrigoprimo opened this issue Nov 17, 2014 · 25 comments

Comments

@rodrigoprimo
Copy link
Contributor

If I update WP using wp core update I get a lot of unexpected HTML output coming from WordPress itself:

$ wp core update
Updating to version 4.0 (pt_BR)...
Descompactando a atualização...
<p>Algumas traduções precisam de atualização. Descanse por mais alguns segundos, enquanto atualizamos elas também.</p>
<div class="update-messages lp-show-latest"><h4>Atualizando traduções de WordPress (pt_BR)&#8230;</h4><p>Fazendo download da tradução de <span class="code">(http://downloads.wordpress.org/translation/core/4.0/pt_BR.zip)</span>&#8230;</p>
<p>Descompactando a atualização&#8230;</p>
<p>Instalando a versão mais recente&#8230;</p>
<p>Tradução atualizada com sucesso.</p>
</div><script type="text/javascript">
                (function( wp ) {
                    if ( wp && wp.updates.decrementCount ) {
                        wp.updates.decrementCount( "translation" );
                    }
                })( window.wp );
            </script></div></div>Success: WordPress updated successfully.

This output is coming from the new WP code to automatically update translations when updating core.

It seems that WP_CLI\UpgraderSkin is not being used in this context because the static method Language_Pack_Upgrader::async_upgrade() instantiate Language_Pack_Upgrader class with a hard coded skin. I guess we will have to open a new ticket on core. I decided to open an issue here first in case anyone has another idea on how to fix this.

@danielbachhuber
Copy link
Member

I guess we will have to open a new ticket on core.

Please link the ticket here when you open it.

@rodrigoprimo
Copy link
Contributor Author

@danielbachhuber
Copy link
Member

@rodrigoprimo Can you provide a reproducible test case for this? I'm not sure whether it's still a bug, as I can't reproduce locally.

@rodrigoprimo
Copy link
Contributor Author

@danielbachhuber I'm not able to reproduce this anymore so I guess it was fixed somehow. Closing the issue. Thanks.

@danielbachhuber
Copy link
Member

@rodrigoprimo 👍 thanks

@ernilambar
Copy link
Member

I got similar output when I upgraded from 4.5.3 to 4.6. I ignored it thinking some language update issue. Hindi language was activated in my system. May be it appears in update in language other than default English.

@rodrigoprimo
Copy link
Contributor Author

@ernilambar I was testing with Brazilian Portuguese activated on my WP. Are you able to reproduce this issue again? Maybe it is necessary to make sure translation files are outdated and that is what I missed last time I tried to reproduce it?

@ernilambar
Copy link
Member

Steps to reproduce.

  • Install WP 4.5.3
  • Install and activate hi_IN language
  • Update to 4.6.
  • After update:
Updating to version 4.6 (hi_IN)...
https://downloads.wordpress.org/release/hi_IN/wordpress-4.6.zip से अपडेट डाउनलोड कर रहे हैं...
अपडेट अनपैकिंग...
<p>अपने अनुवाद कुछ अपडेट की जरूरत है। हम के रूप में अच्छी तरह से उन्हें अद्यतन , जबकि कुछ और सेकंड के लिए तंग बैठो।</p>
<div class="update-messages lp-show-latest"><h2>Date Today Nepali (hi_IN)&#8230; के लिए अनुवाद का अद्यतन किया जा रहा है।</h2><p><span class="code">https://downloads.wordpress.org/translation/plugin/date-today-nepali/2.2/hi_IN.zip</span>&#8230; से अनुवाद डाउनलोड किया जा रहा</p>
<p>अपडेट अनपैकिंग&#8230;</p>
<p>नवीनतम संस्करण स्थापित(इन्सटॉल) कर रहे हैं&#8230;</p>
<p>अनुवाद सफलतापूर्वक अपडेट किया गया.</p>
</div><script type="text/javascript">
                    (function( wp ) {
                        if ( wp && wp.updates.decrementCount ) {
                            wp.updates.decrementCount( "translation" );
                        }
                    })( window.wp );
                </script>Cleaning up files...
No files found that need cleaned up.
Success: WordPress updated successfully.

@rodrigoprimo
Copy link
Contributor Author

@ernilambar thanks for taking the time to test this. I wasn't able to reproduce the same behavior. Which version of WP-CLI are you running? I just tested with the latest version from the master branch. Here is what I did:

$ wp core download --version=4.5.3
Downloading WordPress 4.5.3 (en_US)...
Using cached file '~/.wp-cli/cache/core/wordpress-4.5.3-en_US.tar.gz'...
Success: WordPress downloaded.
$ wp core config --prompt         
Success: Generated 'wp-config.php' file.
$ wp core install --prompt
Success: WordPress installed successfully.
$ wp core language install hi_IN 
Success: Language installed.
$ wp core language activate hi_IN
Success: Language activated.
$ wp core update
Updating to version 4.6 (hi_IN)...
https://downloads.wordpress.org/release/hi_IN/wordpress-4.6.zip से अपडेट डाउनलोड कर रहे हैं...
अपडेट अनपैकिंग...
Cleaning up files...
No files found that need cleaned up.
Success: WordPress updated successfully.

Are you running the same commands and getting the HTML output?

@ernilambar
Copy link
Member

Ahh, I had tested in existing WordPress setup. But now I checked again and there is no such output. I am not sure what happening actually 😁

@rodrigoprimo
Copy link
Contributor Author

rodrigoprimo commented Aug 22, 2016

@ernilambar maybe there was an language update available when you first tested? Do you happen to know how to downgrade a language package so that we can test what happens when we run the commands above with an outdated language package? Thanks for your help!

@rodrigoprimo rodrigoprimo reopened this Aug 22, 2016
@danielbachhuber
Copy link
Member

@rodrigoprimo @ernilambar Is this a core bug, or a WP-CLI bug?

@rodrigoprimo
Copy link
Contributor Author

It used to be a core bug but I'm not sure anymore since now I can't reproduce it 😄

@ernilambar
Copy link
Member

I saw such output once. I tried but could not specifically reproduce it again.

@danielbachhuber
Copy link
Member

Ok. If someone can reproduce this with specific steps and identify where the bug is with WP-CLI, then we can get it fixed.

@ottok
Copy link
Contributor

ottok commented Mar 23, 2019

I am able to reproduce this still with 5.1.0 -> 5.1.1 upgrade. See https://core.trac.wordpress.org/ticket/30497#comment:4

@swissspidy
Copy link
Member

Just happened to me today with wp core update --version=nightly.

A workaround could be to disable async translation updates using add_filter( 'async_update_translation', '__return_false' ); and instead encourage users to use wp language core update and the like for updates.

@swissspidy swissspidy reopened this Mar 28, 2019
@ocean90
Copy link
Contributor

ocean90 commented Mar 28, 2019

A workaround could be to disable async translation updates

Fwiw: This is already the case for plugins/themes: https://github.com/wp-cli/extension-command/blob/fba4b2c/src/WP_CLI/CommandWithUpgrade.php#L20-L23

@schlessera
Copy link
Member

Yes, the behavior for core should be updated to match the one we currently have for plugins/themes.

@planetahuevo
Copy link

It happened to me today.
I think it only happens when you do an upgrade and you have translations pending to be updated, which is too often in Spanish.
So disabling the async translations could fix the issue.

@markhowellsmead
Copy link

Following error occurred when the task was run via CRON - I'm not sure whether this is the same issue or not.

Warning: Declaration of WP_CLI\UpgraderSkin::feedback($string) should be compatible with WP_Upgrader_Skin::feedback($string, ...$args) in phar:///home/PROJECT/bin/wp/php/WP_CLI/UpgraderSkin.php on line 59
name	old_version	new_version	status
redirection	4.4.2	4.5.1	Updated

@wojsmol
Copy link
Contributor

wojsmol commented Nov 24, 2019

@markhowellsmead Witch WP-CLI and WordPress version are you using?

@ocean90
Copy link
Contributor

ocean90 commented Nov 24, 2019

@markhowellsmead You have to update WP-CLI to 2.4.0, see wp-cli/wp-cli#5283.

@bgturner
Copy link

I'm still wrapping my head around a fix, but before my focus time on open-source is up, I wanted to share a more reliable reproduction using the --locale flag within the wp core download command:

wp core download --locale=fr_CA --version='4.8'
wp config create --dbname='local' --dbuser='root' --dbpass='root' --dbhost='localhost' --skip-check
wp core update

Image 2021-09-17 at 10 35 29 AM

@swissspidy
Copy link
Member

I'm still wrapping my head around a fix

The fix was mentioned in the discussion above already.

We need to add something like the following to Core_Command::update().

// Do not automatically check translations updates after updating plugins/themes.
add_action( 'upgrader_process_complete', function() {
	remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
}, 1 );

@swissspidy swissspidy transferred this issue from wp-cli/wp-cli Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.