• Resolved ArtGoddess

    (@artgoddess)


    Hi there,

    I would like to share with you an issue I’m facing right now.

    1. Weglot plugin deactivated, Permalink settings: Plain
    2. I activate plugin.
    3. Without any notice, permalink setting is changed to “Post name”.
    4. When I want to edit a post or page, I get this error: “Updating failed. The response is not a valid JSON response.”
    5. As I have debug activated, this PHP warning can be read in wp-debug.log:

    [0X-Dec-2021 11:42:22 UTC] PHP Deprecated:? Required parameter $translationEngine follows optional parameter $version in /home/user/domain.com/wp-content/plugins/weglot/vendor/weglot/weglot-php/src/Client/Client.php on line 72

    In order to make the site functional again, I have to deactivate the plugin and change twice permalink settings.

    My current configuration:
    WordPress:?5.8.2
    PHP: 8.0
    Twenty Twenty-One: 1.4

    Is this a bug or something am I facing myself only?

    Please, do let me know. Many thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Edson Galina Fortes

    (@glx77)

    Hi @artgoddess,

    Hope you’re fine?
    I’m sorry for the issue you’re facing. I’ll try to reproduce it but I can’t. Can you tell me which version of weglot you use ? You’ve an ngninx or apache server?

    Best

    Thread Starter ArtGoddess

    (@artgoddess)

    Hello @glx77

    My current setup is:

    Apache server
    Weglot WP plugin 3.5
    PHP: 8.0
    WordPress: 5.8.2
    Twenty Twenty-One: 1.4

    Hope it helps. Many thanks.

    Plugin Contributor Edson Galina Fortes

    (@glx77)

    hi @artgoddess ,

    I may have a solution for you issue. Can you modify this 2 files :
    /wp-content/plugins/weglot/vendor/weglot/weglot-php/src/Client/Client.php line 72
    replace public function __construct($apiKey, $version = ‘1’, $translationEngine,$options = []) by public function __construct($apiKey, $translationEngine, $version = ‘1’, $options = [])

    and

    wp-content/plugins/weglot/src/services/class-parser-service-weglot.php line 58

    replace

    
    $client = new Client(
    $api_key,
    $version,
    $translation_engine,
    array(
    ‘host’ => Helper_API::get_api_url(),
    )
    );
    

    by

    
    $client = new Client(
    			$api_key,
    			$translation_engine,
    			$version,
    			array(
    				'host' => Helper_API::get_api_url(),
    			)
    		);
    

    You can also contact our weglot support and ask for me (Edson) to help you make this modification

    Regards`

    • This reply was modified 2 years, 11 months ago by Yui.
    • This reply was modified 2 years, 11 months ago by Yui. Reason: formatting
    Thread Starter ArtGoddess

    (@artgoddess)

    Hello, @glx77 many thanks for your assistance.

    I don’t know if this is an issue I am facing myself, or it is just a bug in the plugin that can be solved with the code that you have provided.

    In any case, I would really appreciate, in case you really need that I test again, to provide me with a beta version or similar.

    Many thanks for your time and interest in your plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Weglot: Updating failed. The response is not a valid JSON response.’ is closed to new replies.