Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove files that are already included in WordPress Core #7727

Merged
merged 3 commits into from
Jan 13, 2025

Conversation

donnapep
Copy link
Collaborator

@donnapep donnapep commented Jan 13, 2025

Resolves https://github.com/Automattic/sensei-security/issues/17. (Cherry-picked from https://github.com/Automattic/sensei-security/pull/28.)

Proposed Changes

  • Removes the polyfill for the core-pattern block that was needed for WP 5.8. I checked WP 5.9 and confirmed that the block is registered there.
  • Deletes the assets/dist/css/jquery-ui.js file after webpack creates it. As we are enqueuing the jquery-ui.css file in PHP, rather than importing it via a JS file, Webpack generates a corresponding jquery-ui.js file that is essentially empty. That is true of all CSS files that we handle this way, and is a well-documented problem. I tried using this Webpack plugin but it didn't work, so instead opted for a quick and dirty solution and just delete this particular file after Webpack does its thing.

Testing Instructions

  • Create a new course, add a title and a description in the wizard, and close the modal.
  • Make sure the default course template continues working.
  • Create a new course, and navigate to the last step.
  • Make sure you see a default course pattern.
  • Choose it, and make sure it works properly.
  • Run npm run build.
  • Unzip the built file.
  • Check that there is no assets/dist/css/jquery-ui.js file.
  • Install the Plugin Check plugin.
  • Go to Tools > Plugin Check.
  • Select Sensei LMS from the dropdown and ensure Plugin Repo is selected.
  • Click Check it! button.
  • Search the page for "Library files that are already in the WordPress core are not permitted." and ensure no instances are found.

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately describe the changes
  • Adheres to coding standards (PHP, JavaScript, CSS, HTML)
  • All strings are translatable (without concatenation, handles plurals)
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first approach
  • Code is tested on the minimum supported PHP and WordPress versions

@donnapep donnapep added this to the 4.24.5 milestone Jan 13, 2025
@donnapep donnapep self-assigned this Jan 13, 2025
Copy link

Test the previous changes of this PR with WordPress Playground.

@donnapep
Copy link
Collaborator Author

Merging as this was already approved in https://github.com/Automattic/sensei-security/pull/28.

@donnapep donnapep merged commit 3fe596b into trunk Jan 13, 2025
23 checks passed
@donnapep donnapep deleted the remove/obsolete-javascript branch January 13, 2025 14:00
@donnapep donnapep changed the title Remove files that are already included in WordPress Core #28 Remove files that are already included in WordPress Core Jan 15, 2025
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.

1 participant