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

Copy link
Copy Markdown
Collaborator

Approach

Tested the plugin against WordPress 7.2 and compared the results with 7.1.4. RC1 was not published yet when this was tested (wordpress-7.2-RC1.zip returned 404, and the update API reported 7.2-beta5), so the tests ran on the latest nightly, 7.2-beta5-65536. 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.

Checked against the 7.2 dev notes; 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 Options/View menus: the plugin does not use PluginMoreMenuItem or the as prop.
  • Components updates: the plugin does not use the deprecated components (Animate, Divider, Surface, Tip, etc.), asButtons, the css prop on View or FontFamilyControl.
  • NO_BACKSLASH_ESCAPES and the Abilities API: not used.

Results on 7.2

  • 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 on the settings screens, Media Library, post editor, front end and Site Health: the only new message is JQMIGRATE: DEPRECATED: jQuery.proxy() on the Media grid. It comes from core. The plugin does not call jQuery.proxy().

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.
  • jQuery Migrate warnings from src/js/wp-color-picker-alpha.js and src/js/components/settings-page.js.
  • 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.

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-RC1.zip" (or the nightly build) 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.
  • Open the Cloudinary settings pages, Media Library (grid and list), the post editor with an image block and the Cloudinary Gallery block, and the front end. Check that the PHP debug log has no new 7.2 entries and the JS console has no new warnings from the plugin.
  • On the Gallery settings page and in the editor, check that the gallery 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