Skip to content
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export.sh
.vscode
.github/prompts
.cursor
.superpowers
docs/superpowers
Comment on lines +9 to +10

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

❓ Verification inconclusive

Script executed:

#!/bin/bash
# Description: Check if .superpowers or docs/superpowers directories/files exist or are referenced elsewhere in the codebase.

echo "=== Checking for .superpowers references ==="
fd -H -t d -t f "\.superpowers" . 2>/dev/null || echo "No .superpowers files/dirs found"

echo -e "\n=== Checking for docs/superpowers references ==="
fd -H "superpowers" docs/ 2>/dev/null || echo "No superpowers found in docs/"

echo -e "\n=== Checking for any code/config references to 'superpowers' ==="
rg -i "superpowers" --type-add 'config:*.{json,yml,yaml,toml,ini}' -t config -t js -t php -g '!.gitignore' -g '!node_modules' -C2 || echo "No code references found"

Repository: weDevsOfficial/wp-user-frontend


Repository: weDevsOfficial/wp-user-frontend
Exit code: 0

stdout:

=== Checking for .superpowers references ===

=== Checking for docs/superpowers references ===
No superpowers found in docs/

=== Checking for any code/config references to 'superpowers' ===
config/icons-config.json-    },
config/icons-config.json-    {
config/icons-config.json:      "class": "fab fa-superpowers",
config/icons-config.json:      "name": "Superpowers",
config/icons-config.json:      "keywords": "superpowers brand"
config/icons-config.json-    },
config/icons-config.json-    {

Remove or justify these gitignore entries, as they appear unrelated to this PR's scope.

The additions of .superpowers and docs/superpowers to .gitignore have no corresponding files, directories, or code references in the repository, and are not mentioned in the PR objectives focusing on subscription Gutenberg block implementation. These appear to be preemptive entries without clear justification.

Either:

  1. Document what generates these paths and why they're needed in this PR, or
  2. Move these to a separate housekeeping PR to maintain clear change scope.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.gitignore around lines 9 - 10, The .gitignore additions ".superpowers" and
"docs/superpowers" are unrelated to this PR; either remove those two entries
from .gitignore (delete the ".superpowers" and "docs/superpowers" lines) or move
them into a separate housekeeping PR — if you keep them here, add a one-line
justification in this PR description explaining what generates those paths and
why they must be ignored (e.g., the tool/process that creates .superpowers and
docs/superpowers) and reference those exact entries so reviewers can verify the
rationale.

/.DS_Store
/bin
nbproject
Expand Down
2 changes: 1 addition & 1 deletion assets/css/admin/form-builder.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/admin/subscriptions.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/ai-form-builder.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/ai-form-builder.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/forms-list.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/frontend-subscriptions.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/frontend/account.css

Large diffs are not rendered by default.

108 changes: 108 additions & 0 deletions assets/js/js/blocks/subscription-packs/block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "wpuf/subscription-packs",
"version": "1.0.0",
"title": "Subscription Packs",
"category": "wpuf",
"description": "Display WPUF subscription packs with customizable layout and styling.",
"textdomain": "wp-user-frontend",
"icon": "cart",
"keywords": [
"subscription",
"pricing",
"plans",
"wpuf"
],
"attributes": {
"include": {
"type": "array",
"default": []
},
"exclude": {
"type": "array",
"default": []
},
"columns": {
"type": "number",
"default": 3
},
"order": {
"type": "string",
"default": ""
},
"orderby": {
"type": "string",
"default": ""
},
"showPrice": {
"type": "boolean",
"default": true
},
"showFeatures": {
"type": "boolean",
"default": true
},
"showDescription": {
"type": "boolean",
"default": true
},
"buttonColor": {
"type": "string",
"default": ""
},
"buttonText": {
"type": "string",
"default": ""
},
"packBackgroundColor": {
"type": "string",
"default": "#ffffff"
},
"packBorderColor": {
"type": "string",
"default": "#e5e7eb"
},
"packBorderRadius": {
"type": "number",
"default": 12
},
"packPadding": {
"type": "number",
"default": 24
},
"packShadow": {
"type": "string",
"default": "md"
},
"titleFontSize": {
"type": "number",
"default": 18
},
"priceFontSize": {
"type": "number",
"default": 30
},
"cardGap": {
"type": "number",
"default": 16
},
"recurringFontSize": {
"type": "number",
"default": 14
}
},
"supports": {
"spacing": {
"margin": true,
"padding": true
},
"align": [
"wide",
"full"
],
"html": false
},
"editorScript": "wpuf-subscription-packs-editor",
"editorStyle": "wpuf-subscription-packs-editor-style"
}
Comment on lines +1 to +108

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check for duplicate block.json files and verify which one is used
echo "=== All block.json files for subscription-packs ==="
fd -t f 'block.json' | xargs grep -l 'wpuf/subscription-packs' 2>/dev/null

echo ""
echo "=== Checking if assets/js/js/ path is intentional ==="
# Look for webpack config or build scripts that might output to this path
rg -l 'assets/js/js' --type=js --type=json -g '!**/node_modules/**' 2>/dev/null || echo "No references found"

echo ""
echo "=== Check .gitignore for assets/js/ patterns ==="
cat .gitignore 2>/dev/null | grep -E '(assets/js|build)' || echo "No matching patterns"

Repository: weDevsOfficial/wp-user-frontend

Length of output: 351


🏁 Script executed:

#!/bin/bash
# Check if the two files have identical content
echo "=== Comparing block.json files ==="
if diff -q assets/js/js/blocks/subscription-packs/block.json src/js/blocks/subscription-packs/block.json; then
    echo "Files are identical"
else
    echo "Files differ"
    diff assets/js/js/blocks/subscription-packs/block.json src/js/blocks/subscription-packs/block.json | head -20
fi

echo ""
echo "=== Checking SubscriptionPacks.php line 88 ==="
sed -n '85,91p' includes/Blocks/SubscriptionPacks.php

echo ""
echo "=== Checking if assets/js/js/ is in git ==="
git ls-files | grep -c '^assets/js/js/' && echo "Yes, tracked in git" || echo "Not tracked in git"

Repository: weDevsOfficial/wp-user-frontend

Length of output: 1118


🏁 Script executed:

#!/bin/bash
# Get the full diff to see the actual differences
echo "=== Full comparison of differences ==="
diff -u src/js/blocks/subscription-packs/block.json assets/js/js/blocks/subscription-packs/block.json

echo ""
echo "=== Line counts ==="
echo "src/js/blocks/subscription-packs/block.json: $(wc -l < src/js/blocks/subscription-packs/block.json) lines"
echo "assets/js/js/blocks/subscription-packs/block.json: $(wc -l < assets/js/js/blocks/subscription-packs/block.json) lines"

echo ""
echo "=== Check for webpack/build config that might output to assets/js/ ==="
fd -t f 'webpack\|gulpfile\|rollup\|build' | head -20

echo ""
echo "=== Check git history of the assets file ==="
git log --oneline -n 5 -- assets/js/js/blocks/subscription-packs/block.json 2>/dev/null || echo "No history available"

Repository: weDevsOfficial/wp-user-frontend

Length of output: 5434


Remove or clarify the orphaned assets/js/js/blocks/subscription-packs/block.json file.

This file is tracked in git but not used by the block registration. SubscriptionPacks.php (line 88) registers the block from src/js/blocks/subscription-packs, not from assets/js/js/blocks/. The file in assets/js/js/ contains identical functional content to the source version (only formatting differences: 2-space vs 4-space indentation), making it an unused duplicate.

The assets/js/js/ directory structure also appears unusual and is not referenced anywhere in the codebase. Either remove this file or clarify its purpose if it's intended for a build process that's not yet configured.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@assets/js/js/blocks/subscription-packs/block.json` around lines 1 - 108,
There’s an unused duplicate block.json (the subscription-packs block JSON
checked into the assets tree) that isn’t referenced by the block registration in
the SubscriptionPacks registration code; remove the orphaned block.json from the
assets copy (or, if it’s required by your build, update the build/registration
paths or add a comment explaining its purpose) so only the canonical block.json
used by the SubscriptionPacks registration remains tracked.

164 changes: 164 additions & 0 deletions assets/js/subscription-packs-rtl.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
/* DESCRIPTION: Editor-only styles for the subscription packs block. */
/* Includes MultiSelect component styles and ServerSideRender adjustments. */

.wp-block-wpuf-subscription-packs .components-server-side-render {
pointer-events: none;
}

.wp-block-wpuf-subscription-packs .components-placeholder {
min-height: 100px;
}

/* Loading overlay for ServerSideRender */
.wpuf-ssr-loading-overlay {
position: absolute;
inset: 0;
z-index: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: rgba(255, 255, 255, 0.75);
min-height: 80px;
}

.wpuf-ssr-loading {
width: 32px;
height: 32px;
border: 3px solid #e0e0e0;
border-top-color: #007cba;
border-radius: 50%;
animation: wpuf-ssr-spin 0.7s linear infinite;
}

@keyframes wpuf-ssr-spin {
to { transform: rotate(-360deg); }
}

/* MultiSelect component */
.wpuf-block-multiselect {
position: relative;
}

.wpuf-block-multiselect__trigger {
display: flex;
width: 100%;
align-items: center;
justify-content: space-between;
height: 40px;
padding: 8px 12px;
background: #fff;
border: 1px solid #949494;
border-radius: 4px;
font-size: 13px;
color: #1e1e1e;
cursor: pointer;
text-align: right;
}

.wpuf-block-multiselect__trigger:hover {
border-color: #007cba;
}

.wpuf-block-multiselect__placeholder {
color: #757575;
}

.wpuf-block-multiselect__dropdown {
position: absolute;
z-index: 10;
margin-top: 4px;
width: 100%;
max-height: 240px;
overflow-y: auto;
background: #fff;
border: 1px solid #ddd;
border-radius: 4px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
list-style: none;
padding: 0;
margin-right: 0;
}

.wpuf-block-multiselect__search-wrap {
position: sticky;
top: 0;
background: #fff;
padding: 8px;
border-bottom: 1px solid #eee;
margin-bottom: 0;
}

.wpuf-block-multiselect__search {
width: 100%;
padding: 6px 10px;
border: 1px solid #ddd;
border-radius: 3px;
font-size: 13px;
}

.wpuf-block-multiselect__search:focus {
outline: none;
border-color: #007cba;
box-shadow: 0 0 0 1px #007cba;
}

.wpuf-block-multiselect__option {
padding: 8px 12px;
cursor: pointer;
font-size: 13px;
margin-bottom: 0;
}

.wpuf-block-multiselect__option:hover {
background: #f0f0f0;
}

.wpuf-block-multiselect__empty {
padding: 12px;
color: #757575;
font-size: 13px;
margin-bottom: 0;
}

.wpuf-block-multiselect__pills {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-top: 8px;
}

.wpuf-block-multiselect__pill {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 2px 8px;
background: #f0f0f0;
border: 1px solid #ddd;
border-radius: 12px;
font-size: 12px;
color: #1e1e1e;
}

.wpuf-block-multiselect__pill-remove {
background: none;
border: none;
padding: 0;
margin: 0;
cursor: pointer;
font-size: 14px;
line-height: 1;
color: #757575;
width: 16px;
height: 16px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
}

.wpuf-block-multiselect__pill-remove:hover {
background: #ddd;
color: #1e1e1e;
}

1 change: 1 addition & 0 deletions assets/js/subscription-packs.asset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-server-side-render'), 'version' => '40ce483ea2d9243d2140');
Loading
Loading