Skip to content

Commit 9285f48

Browse files
committed
Initial commit of ZATCA WordPress plugin
0 parents  commit 9285f48

File tree

75 files changed

+16233
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+16233
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve the plugin
4+
title: '[BUG] '
5+
labels: ['bug', 'needs-triage']
6+
assignees: ''
7+
8+
---
9+
10+
## Bug Description
11+
A clear and concise description of what the bug is.
12+
13+
## Steps to Reproduce
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
## Expected Behavior
21+
A clear and concise description of what you expected to happen.
22+
23+
## Actual Behavior
24+
A clear and concise description of what actually happened.
25+
26+
## Environment Information
27+
- **WordPress Version**:
28+
- **WooCommerce Version**:
29+
- **Plugin Version**:
30+
- **PHP Version**:
31+
- **Server**: (e.g., Apache/Nginx)
32+
- **Theme**:
33+
- **Other Plugins**: (list any relevant plugins)
34+
35+
## Error Messages
36+
If applicable, add any error messages or logs here.
37+
38+
## Screenshots
39+
If applicable, add screenshots to help explain your problem.
40+
41+
## Additional Context
42+
Add any other context about the problem here.
43+
44+
## Debug Information
45+
If you have debug mode enabled, please include relevant log entries:
46+
```
47+
Paste debug log entries here
48+
```
49+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this plugin
4+
title: '[FEATURE] '
5+
labels: ['enhancement', 'needs-triage']
6+
assignees: ''
7+
8+
---
9+
10+
## Feature Description
11+
A clear and concise description of the feature you'd like to see implemented.
12+
13+
## Problem Statement
14+
Is your feature request related to a problem? Please describe.
15+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
16+
17+
## Proposed Solution
18+
Describe the solution you'd like to see implemented.
19+
20+
## Use Case
21+
Describe the specific use case or scenario where this feature would be helpful.
22+
23+
## Alternative Solutions
24+
Describe any alternative solutions or workarounds you've considered.
25+
26+
## Additional Context
27+
Add any other context, mockups, or screenshots about the feature request here.
28+
29+
## Implementation Considerations
30+
If you have any thoughts on how this feature could be implemented, please share them here.
31+
32+
## Priority
33+
How important is this feature to you?
34+
- [ ] Critical - Blocks my workflow
35+
- [ ] High - Would significantly improve my experience
36+
- [ ] Medium - Nice to have
37+
- [ ] Low - Minor improvement
38+

.github/pull_request_template.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## Description
2+
Brief description of the changes made in this pull request.
3+
4+
## Type of Change
5+
- [ ] Bug fix (non-breaking change which fixes an issue)
6+
- [ ] New feature (non-breaking change which adds functionality)
7+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
8+
- [ ] Documentation update
9+
- [ ] Code refactoring
10+
- [ ] Performance improvement
11+
12+
## Related Issues
13+
Fixes #(issue number)
14+
Closes #(issue number)
15+
16+
## Changes Made
17+
-
18+
-
19+
-
20+
21+
## Testing
22+
- [ ] I have tested these changes locally
23+
- [ ] I have tested with different WordPress versions
24+
- [ ] I have tested with different WooCommerce versions
25+
- [ ] I have tested with different PHP versions
26+
- [ ] I have tested the ZATCA integration (sandbox/production)
27+
28+
## Screenshots
29+
If applicable, add screenshots to help explain your changes.
30+
31+
## Checklist
32+
- [ ] My code follows the WordPress coding standards
33+
- [ ] I have performed a self-review of my code
34+
- [ ] I have commented my code, particularly in hard-to-understand areas
35+
- [ ] I have made corresponding changes to the documentation
36+
- [ ] My changes generate no new warnings or errors
37+
- [ ] I have added tests that prove my fix is effective or that my feature works
38+
- [ ] New and existing unit tests pass locally with my changes
39+
- [ ] Any dependent changes have been merged and published
40+
41+
## Additional Notes
42+
Any additional information that reviewers should know about this pull request.
43+

.github/workflows/release.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: Release Plugin
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
packages: write
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: '7.4'
24+
extensions: mbstring, xml, ctype, iconv, intl, pdo_mysql, dom, filter, gd, iconv, json, mbstring, pdo
25+
26+
- name: Get Composer Cache Directory
27+
id: composer-cache
28+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
29+
30+
- name: Cache Composer dependencies
31+
uses: actions/cache@v3
32+
with:
33+
path: ${{ steps.composer-cache.outputs.dir }}
34+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
35+
restore-keys: ${{ runner.os }}-composer-
36+
37+
- name: Install dependencies
38+
run: composer install --no-dev --optimize-autoloader
39+
40+
- name: Create release ZIP
41+
run: |
42+
PLUGIN_NAME="Zatca-wordpress-plugin"
43+
# Extract version from tag, fallback to timestamp if not a tag
44+
if [[ $GITHUB_REF == refs/tags/* ]]; then
45+
VERSION=${GITHUB_REF#refs/tags/v}
46+
else
47+
VERSION=$(date +%Y%m%d-%H%M%S)
48+
fi
49+
ZIP_NAME="${PLUGIN_NAME}-${VERSION}.zip"
50+
51+
echo "Creating release package: $ZIP_NAME"
52+
53+
# Create release directory
54+
mkdir -p release/$PLUGIN_NAME
55+
56+
# Copy plugin files
57+
rsync -av --exclude-from=.gitignore \
58+
--exclude=".git/" \
59+
--exclude=".github/" \
60+
--exclude="release/" \
61+
--exclude="tests/" \
62+
--exclude="*.md" \
63+
--exclude="composer.json" \
64+
--exclude="composer.lock" \
65+
--exclude=".gitignore" \
66+
--exclude="release-prep.sh" \
67+
./ release/$PLUGIN_NAME/
68+
69+
# Copy essential documentation
70+
cp README.md release/$PLUGIN_NAME/
71+
cp LICENSE release/$PLUGIN_NAME/
72+
cp CHANGELOG.md release/$PLUGIN_NAME/
73+
cp INSTALLATION.md release/$PLUGIN_NAME/
74+
cp vendor -r release/$PLUGIN_NAME/
75+
76+
# Create ZIP
77+
cd release
78+
zip -r $ZIP_NAME $PLUGIN_NAME -x "*.DS_Store" "*/.*"
79+
cd ..
80+
81+
# Move ZIP to root
82+
mv release/$ZIP_NAME .
83+
84+
echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_ENV
85+
echo "Release package created: $ZIP_NAME"
86+
87+
- name: Upload release asset
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: plugin-zip
91+
path: ${{ env.ZIP_NAME }}
92+
93+
- name: Create GitHub Release
94+
if: startsWith(github.ref, 'refs/tags/')
95+
uses: softprops/action-gh-release@v1
96+
with:
97+
files: ${{ env.ZIP_NAME }}
98+
generate_release_notes: true
99+
body: |
100+
## Installation Instructions
101+
102+
### For End Users (Recommended)
103+
1. Download the ZIP file below
104+
2. Go to WordPress Admin → Plugins → Add New
105+
3. Click "Upload Plugin" and select the ZIP file
106+
4. Click "Install Now" and then "Activate Plugin"
107+
5. Configure in WooCommerce → ZATCA
108+
109+
### For Developers
110+
```bash
111+
git clone https://github.com/Husam-Almiyah/Zatca-wordpress-plugin.git
112+
cd Zatca-wordpress-plugin
113+
composer install --no-dev --optimize-autoloader
114+
```
115+
116+
## Requirements
117+
- WordPress 5.0+
118+
- WooCommerce 5.0+
119+
- PHP 7.4+
120+
- ZATCA Account
121+
122+
## Features
123+
- ✅ ZATCA Phase 1 & 2 Compliance
124+
- ✅ QR Code Generation
125+
- ✅ XML Invoice Generation
126+
- ✅ API Integration
127+
- ✅ WooCommerce Integration
128+
- ✅ Certificate Management
129+
- ✅ Multi-language Support
130+
env:
131+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132+
133+
- name: Manual Build Complete
134+
if: github.event_name == 'workflow_dispatch'
135+
run: |
136+
echo "✅ Manual build completed successfully!"
137+
echo "📦 Release package: ${{ env.ZIP_NAME }}"
138+
echo "📁 Download the artifact from the Actions tab above"
139+

.gitignore

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# WordPress Plugin .gitignore
2+
3+
# Composer
4+
/vendor/
5+
composer.phar
6+
composer.lock
7+
8+
# IDE and Editor files
9+
.vscode/
10+
.cursor/
11+
.idea/
12+
*.swp
13+
*.swo
14+
*~
15+
16+
# OS generated files
17+
.DS_Store
18+
.DS_Store?
19+
._*
20+
.Spotlight-V100
21+
.Trashes
22+
ehthumbs.db
23+
Thumbs.db
24+
25+
# Logs
26+
*.log
27+
error_log
28+
debug.log
29+
30+
# Temporary files
31+
*.tmp
32+
*.temp
33+
*.bak
34+
*.backup
35+
.history/
36+
37+
# Cache files
38+
cache/
39+
wp-content/cache/
40+
41+
# Node.js (if using build tools)
42+
node_modules/
43+
npm-debug.log*
44+
yarn-debug.log*
45+
yarn-error.log*
46+
47+
# Build artifacts
48+
dist/
49+
build/
50+
*.zip
51+
52+
# Environment files
53+
.env
54+
.env.local
55+
.env.production
56+
57+
# WordPress specific
58+
wp-config.php
59+
wp-content/uploads/
60+
wp-content/upgrade/
61+
wp-content/backup-db/
62+
wp-content/advanced-cache.php
63+
wp-content/wp-cache-config.php
64+
65+
# Plugin specific
66+
*.pem
67+
*.crt
68+
*.key
69+
certificates/
70+
logs/
71+
72+
# Testing
73+
/tests/coverage/
74+
phpunit.xml
75+
.phpunit.result.cache
76+
77+
# Documentation build
78+
docs/_build/
79+

0 commit comments

Comments
 (0)