Skip to content

Warning: Undefined array key when importing WP Rocket Settings #67

@markonikolic985

Description

@markonikolic985

Describe the bug
The user reported a problem when trying to import WP Rocket Settings json files:

Warning: Undefined array key "consumer_key" in /home/php-fpm-user/.wp-cli/packages/vendor/wp-media/wp-rocket-cli/command.php on line 566
Warning: Undefined array key "consumer_email" in /home/php-fpm-user/.wp-cli/packages/vendor/wp-media/wp-rocket-cli/command.php on line 567
Warning: Undefined array key "secret_key" in /home/php-fpm-user/.wp-cli/packages/vendor/wp-media/wp-rocket-cli/command.php on line 568
Warning: Undefined array key "secret_cache_key" in /home/php-fpm-user/.wp-cli/packages/vendor/wp-media/wp-rocket-cli/command.php on line 569
Warning: Undefined array key "minify_css_key" in /home/php-fpm-user/.wp-cli/packages/vendor/wp-media/wp-rocket-cli/command.php on line 570
Warning: Undefined array key "minify_js_key" in /home/php-fpm-user/.wp-cli/packages/vendor/wp-media/wp-rocket-cli/command.php on line 571
Warning: Undefined array key "version" in /home/php-fpm-user/.wp-cli/packages/vendor/wp-media/wp-rocket-cli/command.php on line 572
Success: Settings imported and saved.

Still, the settings are saved successfully but causing these PHP warnings.

To Reproduce
Steps to reproduce the behavior:

  1. Activate PHP error display (or make sure to check logs after the action)
  2. Make sure your .json file does not contain array keys mentioned in lines 566-572 of command.php
  3. Run WP-CLI command to import .json Settings file

Expected behavior
The process should succeed and there should not be any warnings in the logs.

HS Ticket

Slack Thread

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions