Settings get overwritten after setup with wp-cli
-
Dear team,
i really appreciate this plugin a lot. However i noticed an issue when setting up the plugin via WP-CLI.
I install the plugin using with the following command:
wp plugin install woocommerce-pdf-invoices-packing-slips --activateTo configure it, i use the wp options command:
wp option update wpo_wcpdf_documents_settings_packing-slip '{"enabled":1}' --format=json wp option update wpo_wcpdf_documents_settings_invoice '{"enabled":"1","attach_to_email_ids":{"customer_processing_order":"1"},"display_shipping_address":"when_different","display_customer_notes":"1","display_date":"order_date","display_number":"invoice_number","number_format":{"prefix":"[invoice_year]-[invoice_month]-","suffix":"","padding":"6"},"reset_number_yearly":"1","my_account_buttons":"available","invoice_number_column":"1","use_latest_settings":"1"}' --format=json wp option update wpo_wcpdf_settings_debug '{"guest_access":"1","enable_cleanup":"1","cleanup_days":"30"}' --format=json wp option update wpo_wcpdf_settings_general '{"download_display":"display","template_path":"wp-content\/plugins\/woocommerce-pdf-invoices-packing-slips\/templates\/Simple","paper_size":"a4","header_logo":"","header_logo_height":"","shop_name":{"default":"MyShop"},"shop_address":{"default":"MyInfos"},"footer":{"default":""},"extra_1":{"default":""},"extra_2":{"default":""},"extra_3":{"default":""}}' --format=jsonThe settings get accepted.
As soon as i log in as administrator to the dashboard of the fresh installation, the settings get overwritten again. They are set to the defaults! This probably happens by calling the method
protected function install()inincludes\class-wcpdf-install.phpagain.It would be great, if this method would only be called once immediately after activating the plugin, and not when visiting the dashboard for the first time, as this hinders automatic setups.
Thank you for your support.
The topic ‘Settings get overwritten after setup with wp-cli’ is closed to new replies.