reduxframework / redux-framework

Redux is a simple, truly extensible options framework for WordPress themes and plugins!
http://redux.io
Other
1.74k stars 584 forks source link

Selective Field Updates in WordPress Theme Options: Implementing Frontend Tagging to Prevent Unnecessary Data Overwrites #4019

Closed vincenzo85 closed 2 months ago

vincenzo85 commented 2 months ago

Site Health Report

Theme Name: ListingPro Steps to reproduce Open the WordPress admin and navigate to the Redux Framework options page in the ListingPro theme. Set or modify any option from the frontend, such as changing the homepage featured image. Save the changes. Check the categories or other settings that were previously configured in the options panel. Expected Behavior When saving a specific option (e.g., modifying the homepage featured image), the system should only update the option that was modified via the frontend. All other options, including previously configured category settings, should remain unchanged.

Actual Behavior When saving an option from the frontend, such as the homepage featured image, other unrelated settings (such as category selections) are overwritten or reset, even though they were not modified. This results in the loss of category data and requires manual reconfiguration of these settings.

Any Error Details (PHP/JavaScript) There are no specific PHP or JavaScript errors observed. However, the issue appears to be caused by the way Redux saves all fields together instead of only the modified ones.

Proposed Solution: We suggest implementing a frontend tagging system for modified fields. The process would work as follows:

Tagging Modified Fields via Frontend: When a user modifies a field through the frontend, a specific tag (e.g., modified_via_frontend) is added to the field to indicate it was changed. Selective Saving Based on Tags: During the save process, the system will read all the data from the Redux options array but will only update the fields that have the modified_via_frontend tag. This ensures that only the modified fields are saved, while all other settings remain intact. Frontend-Only Tagging: The tagging process is exclusively handled by the frontend, ensuring that only the fields modified via user interaction are tagged for saving. This prevents unnecessary overwrites of unrelated settings.

kprovance commented 2 months ago

The problem is that you are using a premium theme I do not have access to. We also do not support themes that use Redux. You'll need to report this issue to the theme author for evaluation. If they determine there is an issue with Redux, they will need to file a report with us, as we are a developer's tool.

Good luck.

Kev