Skip to content

Ensure compatibility with WordPress 7.2 - #1377

Draft
utkarshcloudinary wants to merge 1 commit into
developfrom
chore/wp-7-2-compatibility
Draft

utkarshcloudinary wants to merge 1 commit into
developfrom
chore/wp-7-2-compatibility

Conversation

@utkarshcloudinary

@utkarshcloudinary utkarshcloudinary commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Approach

Tested the plugin against WordPress 7.2 and compared the results with 7.1.4. The first round ran on 7.2-beta5-65536. The plugin was tested again on 7.2-RC2 and checked against the WordPress 7.2 Field Guide. No regressions were found.

Change

  • Rebuilt the committed assets from the current lockfile. The bundles were built before the latest wordpress group bump and still contained @wordpress/components 43. They now use @wordpress/components 44.0.0, @wordpress/ui 0.26.0 and @wordpress/dataviews 22.0.0. These are the minimum versions in the 7.2 dev note Update bundled @wordpress/* packages … to fix CSS module class name collisions. css/gallery-ui.css bundles the @wordpress/components styles, so this applies to the plugin.

Client-side media processing (new in 7.2), tested on RC2 in Chrome

  • In 7.2, images uploaded from the Media Library grid, Add New Media File and the media modal are resized in the browser. They go through /wp/v2/media, then /sideload, then /finalize, and no longer through async-upload.php.
  • The image was uploaded from the grid and from the editor's media modal. All REST steps succeeded.
  • With "dual full" and "dual low" storage, the uploaded images synced to Cloudinary and were delivered from Cloudinary.
  • An animated GIF uploaded through the new path kept all frames in every local size, and Cloudinary delivers an animated GIF.
  • The Media Library grid and the editor are now cross-origin isolated (Document-Isolation-Policy: isolate-and-credentialless). The Cloudinary tab in the media modal still loads, and the browser still sends the user's Cloudinary login cookie to it.
  • With "Cloudinary only" storage, the image is not synced right after upload. During that time, the medium-size URL is malformed (test-image-6-300x225.jpg/test-image-6-300x225.jpg.jpg). The classic upload path gives the same result, so this is not caused by 7.2.

Checked against the Field Guide; no change needed

  • SVG icons in the admin menu and admin bar: the plugin uses its own dashicons-cloudinary font icon, which has no core-admin replacement, so it renders as before. The admin bar node has no ab-icon, and no plugin CSS targets core menu or admin bar icons.
  • Editor: the plugin does not use the Options/View menu as prop, the deprecated components, asButtons, FontFamilyControl, __experimentalGroup, __experimentalImageEditor or the style-state API. registry.subscribe in terms-inspector.js does not pass a store name, so the 7.2 change to it does not affect the plugin.
  • Cross-origin isolation: the plugin does not call wp_start_cross_origin_isolation_output_buffer() or wp_add_crossorigin_attributes(). The plugin still self-hosts its media library script (Cloudinary media tab broken under WP 7.1 + Chromium ≥ 137: all.js blocked by CORS (crossorigin="anonymous" stamped by wp_set_up_cross_origin_isolation) #1254). 7.2 no longer adds the crossorigin attribute, but 7.1 still does, so the workaround stays.
  • REST revisions now return only revisioned meta. The featured-image transformation meta (show_in_rest, not revisioned) is no longer reset when a revision is restored. This is a fix, not a regression.
  • The plugin does not use the Abilities API, the Interactivity API, the comments status parameter, rest_allowed_cors_methods, NO_BACKSLASH_ESCAPES, the compression constants or text shadow.
  • /random/ redirects do not apply, because both plugin post types use public => false.
  • Admin: the "Howdy" move and the Add Theme menu position do not affect the plugin.

Results on 7.2-RC2

  • PHPUnit: 80 tests pass.
  • E2E: all 54 tests pass (1 skipped). The same suite also passes on 7.1.4.
  • PHP log: no 7.2-specific deprecations, notices or errors.
  • JS console, compared with 7.1.4: the only new message is JQMIGRATE: DEPRECATED: jQuery.proxy() on the Media grid. It comes from core. The plugin does not call jQuery.proxy().

Follow-up for 7.3 (not a 7.2 blocker)

  • 7.2 ships jQuery Migrate 3.6.0, and core plans to move to jQuery 4 in 7.3. jQuery 4 removes $.isFunction, which is called in src/js/wp-color-picker-alpha.js (lines 545, 599, 626) and src/js/components/settings-page.js (line 36). Those calls must be replaced before 7.3.

Already present on 7.1.4 (out of scope)

  • cloudinary/gallery uses block apiVersion: 2, which has been deprecated since 6.9.
  • src/js/components/video.js calls getMedia, which has been deprecated since 6.9.
  • cloudinary.Cloudinary.new() in the video preview templates.
  • PHP warning Attempt to read property "post_title" on null in php/assets/class-rest-assets.php when a cache point is missing.
  • After the first wp cloudinary sync pass, the relationship row keeps public_id NULL until a later read. This can make the video delivery E2E test fail sometimes.

Not tested

  • Multisite upload quota for sizes generated in the browser.
  • Images attached to the post automatically when it is saved in the block editor.
  • Safari and Firefox. They do not support browser-side processing and use the classic upload path, which was tested.

Tested up to in readme.txt is still 7.1.4. Bump it when 7.2 ships (Dec 8).

QA notes

  • Set "core": "https://wordpress.org/wordpress-7.2-RC2.zip" (or a later RC) in .wp-env.override.json, then run npm run env:start.
  • If the tests site has the plugin inactive or the theme set to default, run npx wp-env run tests-cli wp plugin activate cloudinary_wordpress and npx wp-env run tests-cli wp theme activate twentytwentyfive.
  • Run npm run test:unit and npm run test:e2e.
  • Client-side upload, in Chrome 137+ on localhost or HTTPS:
    • Open Media > Library (grid) and confirm that window.crossOriginIsolated is true in the console.
    • Upload a JPEG and an animated GIF.
    • In the Network tab, confirm the /wp/v2/media, /sideload and /finalize requests.
    • Confirm that each image syncs and is delivered from res.cloudinary.com, and that the GIF stays animated.
  • Open the media modal in the post editor, go to the Cloudinary tab, and confirm that the Media Library widget loads.
  • Open the Cloudinary settings pages, the post editor with an image block and the Cloudinary Gallery block, and the front end. Confirm that there are no new PHP log entries and no new plugin warnings in the JS console. On the Gallery settings page, confirm that the controls look the same as on 7.1.4.

The committed bundles were built before the latest wordpress group
bump, so they still contained @wordpress/components 43. Rebuild them
from the current lockfile (@wordpress/components 44.0.0,
@wordpress/ui 0.26.0, @wordpress/dataviews 22.0.0).

These are the minimum versions that the WordPress 7.2 dev note on CSS
module class name collisions requires for plugins that bundle these
packages. gallery-ui.css bundles the @wordpress/components styles.

This branch has not been deployed

No deployments
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.

2 participants