Skip to content

dev: update dev packages & format file#534

Merged
Soare-Robert-Daniel merged 35 commits intodevelopmentfrom
dev/format
Apr 7, 2026
Merged

dev: update dev packages & format file#534
Soare-Robert-Daniel merged 35 commits intodevelopmentfrom
dev/format

Conversation

@Soare-Robert-Daniel
Copy link
Copy Markdown
Contributor

@Soare-Robert-Daniel Soare-Robert-Daniel commented Mar 25, 2026

Summary

  • Update all the dev packages.
  • Apply formatting and some linting
  • Restructure the E2E around PHP fixtures (and also a helping plugin) that help with constructing complex cases.

Will affect visual aspect of the product

NO

Screenshots

Test instructions

  • Check if the build is fine.

Check before Pull Request is ready:

Closes #.

@Soare-Robert-Daniel Soare-Robert-Daniel self-assigned this Mar 25, 2026
@Soare-Robert-Daniel Soare-Robert-Daniel added the pr-checklist-skip Allow this Pull Request to skip checklist. label Mar 25, 2026
@pirate-bot pirate-bot added pr-checklist-complete The Pull Request checklist is complete. (automatic label) labels Mar 25, 2026
@pirate-bot
Copy link
Copy Markdown
Contributor

pirate-bot commented Mar 25, 2026

Plugin build for fd75028 is ready 🛎️!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates PPOM’s development tooling and applies broad formatting/docblock cleanup across JS/PHP, plus CI/workflow adjustments.

Changes:

  • Bumps/adjusts dev tooling (Composer scripts/deps, PHPCS baseline support) and updates CI to use npm + newer Node versions.
  • Reformats and documents multiple frontend/admin JS modules and many PHP files (docblocks, arrays, small refactors).
  • Adds/revises repo tooling/config files (ESLint/Prettier ignores, wp-env config, distignore entries, Copilot workflow).

Reviewed changes

Copilot reviewed 88 out of 164 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
js/validate.js Formatting and minor refactors in required-field validation logic
js/ppom-validation.js AJAX add-to-cart validation formatting + small control flow update
js/ppom-tooltip.js Tooltip script formatting + documentation header
js/ppom-simple-popup.js Popup/tooltip bridge formatting + tooltip init guard
js/ppom-plusminus.js Plus/minus widget formatting and minor refactors
js/ppom-conditions.js Legacy conditions engine formatted + documented
js/popup.js Admin popup documentation + typing annotations/cleanup
js/image-tooltip.js Image tooltip formatting + documentation header
js/admin/serializejson.js Reformat vendored serializeJSON plugin for readability
js/admin/pre-load.js Preloader formatting + doc header
js/admin/ppom-meta-table.js Admin meta table refactor + popup-based confirmations
js/admin/ppom-deactivate.js Deactivation modal formatting + doc header
js/admin/ppom-bulkquantity.js Bulk quantity admin editor refactor + doc/typedef additions
inc/woocommerce.php Adds docblocks/sections and normalizes array syntax/formatting
inc/validation.php Adds docblocks and refactors sanitization helper signature/logic
inc/rest.class.php Adds docblocks/visibility updates and improves order meta formatting safety
inc/prices.php Adds docblocks/sections and normalizes formatting/increments
inc/nmInput.class.php Formatting tweaks; minor control-flow simplification
inc/hooks.php Adds docblocks/sections and normalizes formatting/increments
inc/functions.php Docblocks + small control-flow simplification
inc/files.php Adds docblocks/sections and normalizes formatting/increments
inc/arrays.php Formatting tweaks (alignment/trailing commas)
inc/admin.php Adds docblocks; improves nonce handling/normalization and formatting
grunt/addtextdomain.js Formatting cleanup
composer.json Adds lint/format scripts, bumps phpstan config, updates platform PHP + dev deps
classes/survey.class.php Formatting (comma/trailing comma)
classes/ppom.class.php Adds docblocks/visibility; formatting and minor array normalizations
classes/plugin.class.php Adds docblocks; formatting/increment tweaks
classes/legacy-meta.class.php Braces/formatting cleanup
classes/integrations/elementor/shortcode-widget.php Switches to long array syntax for compatibility/style
classes/integrations/elementor/elementor.class.php Switches callbacks to long array syntax
classes/inputs/input.timezone.php Minor formatting cleanup
classes/inputs/input.textarea.php Minor formatting cleanup
classes/inputs/input.text.php Minor formatting cleanup
classes/inputs/input.select.php Minor formatting cleanup
classes/inputs/input.section.php Minor formatting cleanup
classes/inputs/input.radio.php Minor formatting cleanup
classes/inputs/input.quantities.php Minor formatting cleanup
classes/inputs/input.pricematrix.php Minor formatting cleanup
classes/inputs/input.palettes.php Minor formatting cleanup
classes/inputs/input.number.php Minor formatting cleanup
classes/inputs/input.image.php Minor formatting cleanup
classes/inputs/input.hidden.php Minor formatting cleanup
classes/inputs/input.file.php Minor formatting cleanup
classes/inputs/input.email.php Minor formatting cleanup
classes/inputs/input.divider.php Minor formatting cleanup
classes/inputs/input.daterange.php Minor formatting cleanup
classes/inputs/input.date.php Minor formatting cleanup
classes/inputs/input.cropper.php Minor formatting cleanup
classes/inputs/input.color.php Minor formatting cleanup
classes/inputs/input.checkbox.php Minor formatting cleanup
classes/inputs/input.audio.php Minor formatting cleanup
classes/input.class.php Adds docblocks and clarifies responsibilities
classes/input-meta.class.php Switches short arrays to long arrays for consistency
classes/frontend-scripts.class.php Adds docblocks/sections; formatting and increment tweaks
classes/freemium.class.php Braces/arrays formatting improvements
classes/form.class.php Docblocks + formatting and array syntax normalization
classes/fields.class.php Docblocks + refactors around asset loading/localization and builder rendering
classes/attach-popup/select-component.class.php Output formatting/escaping consistency improvements
classes/admin.class.php Docblocks/visibility improvements and formatting across attach/settings flows
backend/templates/admin-settings.php Uses printf with clearer formatting for upsell notices
backend/settings-panel.class.php Docblocks + long array defaults and minor refactors
backend/options.php Docblocks + long array syntax in option definitions
backend/changelog_handler.php Normalizes return values/arrays and formatting
Gruntfile.js Formatting cleanup and minor structure normalization
AGENTS.md Updates docs for new tooling, security guidance, and PHP min info
.wp-env.json Adds schema + autoPort; changes WooCommerce plugin download
.prettierignore Adds ignore patterns for generated/vendor assets
.github/workflows/test-php.yml Switches to npm + newer node; adds PHPCS job; adjusts action versions
.github/workflows/sync-wporg-assets.yml Quote/style normalization
.github/workflows/sync-branches.yml Quote/style normalization
.github/workflows/e2e.yml Switches to npm + newer node; adjusts action versions
.github/workflows/deploy-svn.yml Switches build steps from yarn to npm
.github/workflows/deploy-s3-store.yml Switches build steps from yarn to npm; bumps node
.github/workflows/create-tag.yml Switches build steps from yarn to npm; bumps node
.github/workflows/create-build-zip.yml Switches build steps from yarn to npm; bumps node
.github/workflows/copilot.yml Adds agent setup workflow steps for Copilot runs
.eslintrc.json Adds WordPress ESLint preset config and ignores
.distignore Adds new dev config files to distignore

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread js/popup.js
Comment thread .github/workflows/copilot-setup-steps.yml
Comment thread .wp-env.json
Comment thread inc/validation.php
Comment thread js/validate.js Outdated
Comment thread inc/woocommerce.php Outdated
Comment thread js/admin/ppom-meta-table.js Outdated
Soare Robert-Daniel added 2 commits April 1, 2026 17:27
Comment on lines +50 to +64
name: PHPCS
runs-on: ubuntu-latest
steps:
- name: Setup PHP version
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
extensions: simplexml
- name: Checkout source code
uses: actions/checkout@master
- name: Install composer
run: |
composer install --no-progress
- name: Run linter for PHP
run: composer run lint
Comment thread js/file-upload.js
Comment on lines +846 to +850
'<input checked="checked" name="ppom[fields][' +
field_name +
'][' +
image_id +
'][cropped]" type="checkbox"/>'
Comment thread js/ppom-conditions.js
case 'is':
if ( element_type === 'checkbox' ) {
var element_value = ppom_get_element_value( rule.elements );
jQuery( element_value ).each( function ( i, item ) {
Comment thread js/ppom-conditions.js
} );
} else if ( element_type === 'image' ) {
var element_value = ppom_get_element_value( rule.elements );
jQuery( element_value ).each( function ( i, item ) {
Comment thread js/ppom-conditions.js
case 'not':
if ( element_type === 'checkbox' ) {
var element_value = ppom_get_element_value( rule.elements );
jQuery( element_value ).each( function ( i, item ) {
Comment thread js/ppom-conditions.js
case 'greater than':
if ( element_type === 'checkbox' ) {
var element_value = ppom_get_element_value( rule.elements );
jQuery( element_value ).each( function ( i, item ) {
Comment thread js/ppom-conditions.js
case 'less than':
if ( element_type === 'checkbox' ) {
var element_value = ppom_get_element_value( rule.elements );
jQuery( element_value ).each( function ( i, item ) {
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 88 out of 166 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread js/popup.js
);
this.text.classList.toggle(
'ppom-hide',
Boolean( options?.text?.length )
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

this.text.classList.toggle('ppom-hide', Boolean(options?.text?.length)) will hide the text element when text is provided (since the second arg is true). This looks inverted for a ppom-hide class; it should typically hide when there is no text. Flip the condition so the text is hidden only when options.text is empty/absent.

Suggested change
Boolean( options?.text?.length )
! options?.text?.length

Copilot uses AI. Check for mistakes.
Comment thread js/ppom-simple-popup.js
Comment on lines +65 to 70
// modal behavior, while others use it to initialize tooltip-enabled inputs.
if ( $( '[data-ppom-tooltip~=ppom_tooltip]' ).length > 0 ) {
$( '[data-ppom-tooltip~=ppom_tooltip]' ).ppom_tooltipster?.(
tooltip_options
);
}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

This introduces optional chaining (?.) in a frontend asset. If these scripts are shipped without transpilation, optional chaining can cause a hard syntax error in older browsers and prevent the entire file from executing. Prefer a feature check (e.g., verify the plugin function exists) without optional chaining to keep runtime compatibility consistent with the rest of the bundle.

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +14
- uses: actions/checkout@master
- uses: actions/setup-node@v6
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

Using actions/checkout@master (and similarly other @master action references in this PR) is a supply-chain risk and can introduce unexpected breaking changes. Pin actions to a stable major tag (e.g., actions/checkout@v4) or a specific commit SHA to make CI reproducible and safer.

Copilot uses AI. Check for mistakes.
Comment thread .wp-env.json
} No newline at end of file
"$schema": "https://schemas.wp.org/trunk/wp-env.json",
"plugins": [
"https://downloads.wordpress.org/plugin/woocommerce.zip",
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

Switching from a pinned WooCommerce version ZIP to the floating woocommerce.zip makes local/E2E environments non-reproducible (the installed WooCommerce version can change over time and break tests/builds). Consider pinning a specific WooCommerce version (as before) or explicitly documenting that wp-env uses a moving target.

Suggested change
"https://downloads.wordpress.org/plugin/woocommerce.zip",
"https://downloads.wordpress.org/plugin/woocommerce.8.6.1.zip",

Copilot uses AI. Check for mistakes.
Soare Robert-Daniel added 2 commits April 6, 2026 10:46
@Soare-Robert-Daniel Soare-Robert-Daniel requested review from abaicus and removed request for HardeepAsrani April 6, 2026 08:36
@Soare-Robert-Daniel Soare-Robert-Daniel merged commit b9c976c into development Apr 7, 2026
10 of 11 checks passed
@Soare-Robert-Daniel Soare-Robert-Daniel deleted the dev/format branch April 7, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants