Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
25 changes: 25 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/.git
/.github
/.wordpress-org
/node_modules
/src

.distignore
.editorconfig
.gitattributes
.gitignore
.plugin-data
.wp-env.json
CHANGELOG.md
composer.json
composer.lock
grumphp.yml
LICENSE.md
package.json
package-lock.json
phpcs.xml.dist
phpunit.xml.dist
psalm.xml.dist
README.md
webpack.config.js
yarn.lock
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[*.{yml,yaml}]
indent_style = space
indent_size = 2
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/.git export-ignore
/.github export-ignore
/.distignore export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.plugin-data export-ignore
/CHANGELOG.md export-ignore
/grumphp.yml export-ignore
/phpcs.xml.dist export-ignore
/psalm.xml export-ignore
/README.md export-ignore
38 changes: 38 additions & 0 deletions .github/workflows/pull-request-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Check plugin version and tags"
on:
pull_request:
branches:
- main

jobs:
version-check:
name: "Check version doesn't not already exists."
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- id: set-vars
name: "Set variables from .plugin-data file"
run: |
# Get all data from .plugin-data file
content=`cat ./.plugin-data`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=pluginData::$content"

- id: version-check
name: "Check version in .plugin-data is not existing"
run: |
# Check version from .plugin-data
VERSION=${{fromJson(steps.set-vars.outputs.pluginData).version}}

if git rev-parse "$VERSION" >/dev/null 2>&1; then
echo "Tag aleady exists please update the .plugin-data file to good version";
exit 1;
fi
38 changes: 38 additions & 0 deletions .github/workflows/quality-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: PHP Quality Checks

on:
pull_request:
push:
branches:
- main

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
checks:
name: Lint PHP
runs-on: ubuntu-latest

steps:
- name: Checkout project
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
extensions: mbstring, intl

- name: Validate composer file
run: composer validate

- name: Install composer dependencies
run: composer install

- name: Run codesniffer
run: composer cs
69 changes: 69 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: "Release new TAG"
on:
push:
branches:
- main

jobs:
build-and-release:
name: "Release new TAG"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- id: set-vars
name: "Set variable from .plugin-data file"
run: |
# Get all data from .plugin-data file
content=`cat ./.plugin-data`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=pluginData::$content"

- id: check-version
name: "Check version does not exists"
run: |
# Get the version from .plugin-data file.
VERSION=${{fromJson(steps.set-vars.outputs.pluginData).version}}

echo "Get Branch tag"
if git rev-parse "$VERSION" >/dev/null 2>&1; then
echo "Tag already exists, stop now";
exit 1;
fi

- id: build-php
name: "Build project PHP"
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
- run: composer install --prefer-dist --no-dev -o --ignore-platform-reqs

- id: commit-and-push
name: "Commit and push new TAG"
run: |
# Get the version from .plugin-data file.
VERSION=${{fromJson(steps.set-vars.outputs.pluginData).version}}

echo "Copy .distignore to .gitignore"
cp .distignore .gitignore

echo "Configure git"
git config --local user.email "$(git log --format='%ae' HEAD^!)"
git config --local user.name "$(git log --format='%an' HEAD^!)"

echo "Creating branch"
git checkout -b release/${VERSION}

echo "Creating tag ${VERSION}"
git add .
git add -u
git commit -m "Release version ${VERSION}"
git tag ${VERSION}
git push --tags
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Coverage directory used by tools like istanbul
coverage

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
build/

# Dependency directories
node_modules/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Output of `npm pack`
*.tgz

# Output of `wp-scripts plugin-zip`
*.zip

# dotenv environment variables file
.env
4 changes: 4 additions & 0 deletions .plugin-data
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"version": "1.0.0",
"slug": "blockparty-iframe"
}
1 change: 1 addition & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Blockparty Iframe

## Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/).

## [1.0.0] - 2025-01-09

### 🎉 Initial Release

#### Added

- **Gutenberg Iframe Block**: New custom block to embed iframes in WordPress editor
- **Configurable Attributes**:
- `url`: URL of the page to embed
- `title`: Iframe title for accessibility
- `lazyload`: Option to enable lazy loading
- **Dimension Support**:
- Customizable width
- Customizable height
- Configurable aspect ratio
- **Alignments**: Support for wide and full-width alignments
- **Internationalization**:
- Full i18n/l10n support
- French translations included
- POT files for translators
- **Performance**:
- Uses `blocks-manifest.php` API (WordPress 6.7+)
- Compatible with `wp_register_block_types_from_metadata_collection` (WordPress 6.8+)
- Optional lazy loading for iframes
- **Code Quality**:
- WordPress Coding Standards (WPCS) compliance
- Static analysis with Psalm
- PHPCompatibility verification
- ESLint for JavaScript
- GrumPHP for pre-commit hooks
- **Documentation**:
- Complete README with usage guide
- PHPDoc for all functions
- Detailed inline comments
- **Development Environment**:
- `@wordpress/env` support for local environment
- npm scripts for development and production
- Composer configuration for development tools

#### Technical

- **Minimum Versions**:
- WordPress 6.7+
- PHP 8.1+
- Requires ext-json
- **Block Editor API**: Uses API version 3
- **Build System**: `@wordpress/scripts` with `--blocks-manifest` flag
- **Structure**: Modular architecture with edit/save separation
- **Styles**: SCSS with automatic RTL support

---

[1.0.0]: https://github.com/BeAPI/blockparty-iframe/releases/tag/1.0.0
Loading
Loading