Remove options remapping, use settings directly. #360
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed in this Pull Request:
Fix
ga_ecommerce_tracking_enabled
is not sent to tracker data #359I don't see any value in having another layer that's just a copy of the existing
->settings
. Having three places to store the same thing may lead to more bugs like #359, where the objects get out of sync.use
$this->settings
directly.All the properties, except
ga_id
, were not used at all.ga_id
was used only once.Checks:
Screenshots:
Detailed test instructions:
wp-admin/admin.php?page=wc-settings&tab=integration§ion=google_analytics
wcgaiData.config
matches the settingsAdditional details:
static get
function and using the settings array directly. A static function that relies on the property set by the instance constructor looks bug-prone. Plus, defining a function to do$this->get( 'foo' )
instead of$this->settings['foo']
, makes the code less explicit and does not bring much value IMOChangelog entry