Skip to content

Conversation

@Crabcyborg
Copy link
Contributor

…le setting

Uncaught (in promise) InvalidStylesError: One or more style selectors and/or CSS properties are invalid
Invalid style value 'Tahoma,Arial' for property 'fontFamily'.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 27, 2025

Warning

Rate limit exceeded

@Crabcyborg has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 39 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 3880f9c and 2a30f66.

📒 Files selected for processing (1)
  • square/controllers/FrmSquareLiteActionsController.php (2 hunks)

Walkthrough

Modified the font parsing logic in get_style to handle font stacks defensively. When a font configuration contains a comma, the code extracts and trims the first font before the comma for assignment to fontFamily; otherwise uses the original font value.

Changes

Cohort / File(s) Change Summary
Font stack parsing
square/controllers/FrmSquareLiteActionsController.php
Modified get_style method to defensively parse font strings: when a font contains a comma, extract the first font (before comma) and trim it; otherwise use the original value. Enables proper handling of font stacks in fontFamily assignment.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify the comma-detection and string trimming logic correctly handles edge cases (empty strings, whitespace, single font names)
  • Confirm the change doesn't break existing font configurations that don't use font stacks

Suggested labels

run analysis, run tests

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly addresses the main change: fixing square styling errors when using multiple fonts in font family style settings, which matches the core issue in the changeset.
Description check ✅ Passed The description provides relevant context by showing the specific error that occurs when multiple fonts are used, which aligns with the changeset's purpose of handling font stacks.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3a3102e and 3880f9c.

📒 Files selected for processing (1)
  • square/controllers/FrmSquareLiteActionsController.php (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: PHP 7.4 tests in WP trunk
  • GitHub Check: PHP 8 tests in WP trunk
  • GitHub Check: PHP 8 tests in WP trunk
  • GitHub Check: PHP 7.4 tests in WP trunk
  • GitHub Check: Cypress
  • GitHub Check: Cypress
🔇 Additional comments (1)
square/controllers/FrmSquareLiteActionsController.php (1)

583-583: Fix the edge case where a comma at position 0 would be treated as false.

Using strpos() directly in a boolean context has a known edge case: if the comma appears at position 0, strpos returns 0, which is falsy in PHP. While unlikely in practice, this would cause the code to use the malformed font string instead of extracting the first font.

Apply this diff to fix the edge case:

-		if ( ! empty( $settings['font'] ) ) {
-			if ( false !== strpos( $settings['font'], ',' ) ) {
+		if ( ! empty( $settings['font'] ) ) {
+			if ( strpos( $settings['font'], ',' ) !== false ) {

Likely an incorrect or invalid review comment.

@Crabcyborg Crabcyborg merged commit e376641 into master Nov 27, 2025
16 checks passed
@Crabcyborg Crabcyborg deleted the fix_square_styling_error_when_using_multiple_fonts_in_font_family_style_setting branch November 27, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants