Skip to content

Conversation

@gabrielcld2
Copy link
Collaborator

@gabrielcld2 gabrielcld2 commented Aug 14, 2025

Fix the feature to disable additional assets.

Approach

When using the toggle and clicking “Apply Changes”, the Cloudinary plugin calls the disable_cache_items REST API endpoint via AJAX.

The implementation of this API endpoint had a typo where it was looking for the existing asset as a post_state instead of a sync_type, resulting in the UPDATE SQL query not updating anything.

After fixing that, there was still a need to:

  • prevent disabled assets from being delivered
  • prevent the sync mechanism to re-enabled them (for instance when updating the plugin containing the asset)

QA Notes

  • Install the following test image plugin test-image-updated(1).zip
  • Go to the Cloudinary General Settings page and make sure it’s configured to delivery assets from this plugin
  • Go to the Test Image plugin page which should display two images. Wait a minute for the assets to load. Refresh and confirm the assets are now delivered from Cloudinary
  • Go back to the Cloudinary General Settings, and untick via the toggle one of the two image URL within this plugin, and click “Apply Changes”
  • Go back again to the Test Image plugin page and confirm the image URL you just unchecked is now delivered from WP. The other image should still be delivered from Cloudinary.
  • Update the plugin version, and refresh the page to confirm the disabled asset remains disabled

Copy link
Collaborator

@aatanasov-cloudinary aatanasov-cloudinary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@aatanasov-cloudinary aatanasov-cloudinary merged commit 14d3ee4 into develop Sep 12, 2025
4 checks passed
This was referenced Sep 12, 2025
@aatanasov-cloudinary aatanasov-cloudinary deleted the fix-disable-additional-assets branch September 17, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants