Skip to content

Addressing PR comments#1204

Closed
Claude wants to merge 3 commits intomasterfrom
claude/change-default-shortcode-max-items
Closed

Addressing PR comments#1204
Claude wants to merge 3 commits intomasterfrom
claude/change-default-shortcode-max-items

Conversation

@Claude
Copy link
Copy Markdown

@Claude Claude AI commented Mar 23, 2026

Original prompt

This section details on the original issue you should resolve

<issue_title>Change default shortcode max items from 5 to 10</issue_title>
<issue_description>## Problem

The shortcode default for max is 5, but the free tier cap is 10 items. This means free users who don't explicitly set max see only 5 items — half of what they're entitled to. Multiple uninstall survey responses cite "limited" display as a frustration point. The mismatch between the default (5) and the actual cap (10) creates a false perception that the plugin is more restrictive than it actually is.

Solution

admin-abstract.php — Change 'max' => '5' to 'max' => '10' in get_short_code_attributes().

This is a "smart defaults > configurability" change: users get the full value of the free tier without needing to discover and set the max parameter.

Files Affected

  • includes/abstract/feedzy-rss-feeds-admin-abstract.php

Acceptance Criteria

  • New shortcodes without explicit max show 10 items by default
  • Existing shortcodes with explicit max="5" are unaffected
  • Free tier cap (10) still enforced — no items beyond 10
  • Pro users can still set any value they want

Priority: Low — smart default, reduces perceived limitation in free tier
Regression risk: Low — only affects shortcodes without explicit max</issue_description>

Comments on the Issue (you are @claude[agent] in this section)

@Claude Claude AI changed the title [WIP] Change default shortcode max items from 5 to 10 Change default shortcode max items from 5 to 10 Mar 23, 2026
@Claude Claude AI requested a review from ineagu March 23, 2026 15:12
@ineagu ineagu requested a review from Copilot March 23, 2026 15:17
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 Feedzy’s default “max items” setting to match the free-tier entitlement (10 items), reducing confusion when users don’t explicitly pass max in shortcodes/blocks.

Changes:

  • Changed shortcode default max from 5 to 10 in get_short_code_attributes().
  • Updated sanitization fallback for invalid/empty max values from 5 to 10.
  • Aligned Gutenberg block attribute default and UI placeholder example to 10.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
includes/abstract/feedzy-rss-feeds-admin-abstract.php Updates shortcode default and sanitization fallback for max to 10.
includes/gutenberg/feedzy-rss-feeds-gutenberg-block.php Updates Gutenberg block max default to 10.
includes/admin/feedzy-rss-feeds-ui-lang.php Updates UI placeholder example for max to 10.

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

Comment on lines 104 to 107
'max' => array(
'type' => 'number',
'default' => '5',
'default' => '10',
),
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

max is registered with 'type' => 'number' but its default is set as a string ('10'). Using a numeric literal for the default keeps the attribute schema consistent and avoids subtle type/coercion differences during block parsing/serialization.

Copilot uses AI. Check for mistakes.
@ineagu
Copy link
Copy Markdown
Contributor

ineagu commented Mar 23, 2026

@claude[agent] can you fix the review items?

@Claude
Copy link
Copy Markdown
Author

Claude AI commented Mar 23, 2026

@claude[agent] can you fix the review items?

Fixed in 535919b - changed the Gutenberg block max default from string '10' to numeric 10 to match the 'type' => 'number' declaration.

@Claude Claude AI changed the title Change default shortcode max items from 5 to 10 Addressing PR comments Mar 23, 2026
@ineagu ineagu requested a review from Copilot March 23, 2026 16:08
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 3 out of 3 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

includes/gutenberg/feedzy-rss-feeds-gutenberg-block.php:111

  • offset is declared as a Gutenberg attribute with type: 'number', but its PHP schema sets default to the string '0'. This violates the block attribute type contract and can lead to block validation warnings. Use a numeric literal (0) for the default to match the declared type (and align with the editor-side schema).
					'offset'          => array(
						'type'    => 'number',
						'default' => '0',
					),

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

'max' => array(
'type' => 'number',
'default' => '5',
'default' => 10,
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

The Gutenberg block’s JS attribute schema still defaults max to 5 (see js/FeedzyBlock/attributes.js), while the PHP register_block_type() schema now defaults to 10. This mismatch can cause newly inserted blocks in the editor to still start at 5 items and may also trigger block validation/serialization inconsistencies. Update the editor-side attributes default (and rebuilt assets, if applicable) to keep the JS and PHP schemas in sync.

Suggested change
'default' => 10,
'default' => 5,

Copilot uses AI. Check for mistakes.
Comment on lines 613 to 617
// comma separated feeds url.
'feeds' => '',
// number of feeds items (0 for unlimited).
'max' => '5',
'max' => '10',
// display feed title yes/no.
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

This PR changes the shortcode default/fallback for max to 10, but there’s no unit test asserting the default behavior when max is omitted/empty/invalid. Since the repo already has PHPUnit coverage for the admin abstract, add a test that get_short_code_attributes([]) defaults max to 10 and that sanitize_attr() falls back to 10 for empty/non-numeric values (while preserving explicit numeric values like 5).

Copilot uses AI. Check for mistakes.
@ineagu ineagu closed this Mar 24, 2026
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.

Change default shortcode max items from 5 to 10

3 participants