Skip to content

Commit 6aec0f3

Browse files
committed
A ground-up rebuild of the plugin
1 parent 6856b93 commit 6aec0f3

File tree

13 files changed

+716
-73
lines changed

13 files changed

+716
-73
lines changed

.github/workflows/main.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
name: Tests
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
10+
jobs:
11+
phpUnitTests:
12+
runs-on: ubuntu-latest
13+
name: Unit Tests / PHP ${{ matrix.phpVersion }} / Winter ${{ matrix.winterRelease }}
14+
strategy:
15+
max-parallel: 6
16+
matrix:
17+
phpVersion: ['8.0', '8.1', '8.2']
18+
winterRelease: ['develop']
19+
winterReleaseDir: ['develop']
20+
fail-fast: false
21+
env:
22+
phpExtensions: mbstring, intl, gd, xml, sqlite
23+
cacheKey: ext-cache-v1
24+
winterCmsRelease: develop
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
steps:
27+
- name: Checkout changes
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Run Super-Linter
33+
uses: github/super-linter@v4
34+
env:
35+
DEFAULT_BRANCH: main
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
VALIDATE_YAML: true
38+
VALIDATE_JSON: true
39+
VALIDATE_MARKDOWN: true
40+
VALIDATE_PHP_BUILTIN: true
41+
42+
- name: Move files to a widgets-plugin directory
43+
run: mkdir widgets-plugin && find . -mindepth 1 -maxdepth 1 ! -name 'widgets-plugin' -exec mv -t widgets-plugin -- {} +
44+
45+
- name: Setup cache environment
46+
id: extcache
47+
uses: shivammathur/cache-extensions@v1
48+
with:
49+
php-version: ${{ matrix.phpVersion }}
50+
extensions: ${{ env.phpExtensions }}
51+
key: ${{ env.cacheKey }}
52+
53+
- name: Cache extensions
54+
uses: actions/cache@v4
55+
with:
56+
path: ${{ steps.extcache.outputs.dir }}
57+
key: ${{ steps.extcache.outputs.key }}
58+
restore-keys: ${{ steps.extcache.outputs.key }}
59+
60+
- name: Install PHP and extensions
61+
uses: shivammathur/setup-php@v2
62+
with:
63+
php-version: ${{ matrix.phpVersion }}
64+
extensions: ${{ env.phpExtensions }}
65+
66+
- name: Install Winter CMS
67+
run: |
68+
wget https://github.com/wintercms/winter/archive/${{ matrix.winterRelease }}.zip
69+
unzip ${{ matrix.winterRelease }}.zip
70+
rm ${{ matrix.winterRelease }}.zip
71+
shopt -s dotglob
72+
mv winter-${{ matrix.winterReleaseDir }}/* ./
73+
rmdir winter-${{ matrix.winterReleaseDir }}
74+
shopt -u dotglob
75+
cp config/cms.php config/testing/cms.php
76+
mkdir -p plugins/numencode
77+
mv widgets-plugin plugins/numencode/widgets
78+
79+
- name: Get Composer cache directory
80+
id: composercache
81+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_ENV
82+
83+
- name: Cache dependencies
84+
uses: actions/cache@v4
85+
with:
86+
path: ${{ env.dir }}
87+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
88+
restore-keys: ${{ runner.os }}-composer-
89+
90+
- name: Install Composer dependencies
91+
run: composer install --no-interaction --no-progress --no-suggest
92+
93+
- name: Run unit tests
94+
run: php artisan winter:test -p NumenCode.Widgets

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea
2+
*.cache

CHANGELOG.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
# Changelog
22

3-
All notable changes to `numencode/wn-widgets-plugin` will be documented in this file
3+
All notable changes to this project will be documented in this file.
44

5-
## 2.0.1 - 2021-11-20
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
67

7-
- content update
8+
## [1.0.0] - 2025-01-16
9+
### Added
10+
- Initial release of the **Widgets Plugin**.
11+
- Features:
12+
- Support for Winter CMS.
13+
- Fully compatible with Winter CMS version `1.2.7`.
814

9-
## 2.0.0 - 2021-05-06
15+
---
1016

11-
- migration to Winter CMS
12-
13-
## 1.0.1 - 2021-01-31
14-
15-
- major refactoring
16-
17-
## 1.0.0 - 2021-01-07
18-
19-
- initial release
17+
### Links
18+
- GitHub repository: [wn-widgets-plugin](https://github.com/numencode/wn-widgets-plugin)

CONTRIBUTING.md

Lines changed: 57 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,84 @@
22

33
Contributions are **welcome** and will be fully **credited**.
44

5-
Please read and understand the contribution guide before creating an issue or pull request.
5+
Before creating an issue or pull request, please take a moment to read and understand this contribution guide.
6+
7+
---
68

79
## Etiquette
810

9-
This project is open source, and as such, the maintainers give their free time to build and maintain the
10-
source code held within. They make the code freely available in the hope that it will be of use to other
11-
developers. It would be extremely unfair for them to suffer abuse or anger for their hard work.
11+
This project is open source, and the maintainers volunteer their time to build and maintain it. They provide the source code freely with the hope that it will be useful to others. Please be respectful and considerate when raising issues or submitting pull requests.
12+
13+
- **Be respectful**: Avoid abusive, angry, or impatient behavior toward maintainers or contributors.
14+
- **Stay constructive**: Provide detailed, actionable feedback and clearly describe issues or suggestions.
15+
- **Understand maintainers' decisions**: Contributions are accepted at the discretion of the maintainers. Respect their decision, even if your submission is not used.
1216

13-
Please be considerate towards maintainers when raising issues or presenting pull requests.
14-
Let's show the world that developers are civilized and selfless people.
17+
Let’s show the world that developers are civilized, collaborative, and selfless!
1518

16-
It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
17-
quality to benefit the project. Many developers have different skill sets, strengths, and weaknesses.
18-
Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.
19+
---
1920

2021
## Viability
2122

22-
When requesting or submitting new features, first consider whether it might be useful to others.
23-
Open source projects are used by many developers, who may have entirely different needs to your own.
24-
Think about whether your feature is likely to be used by other users of the project.
23+
Before suggesting new features or changes, consider their viability:
24+
- Will the feature benefit other users of the project?
25+
- Is the feature aligned with the project's scope and goals?
26+
- Could the feature introduce unnecessary complexity or maintenance challenges?
27+
28+
Open source projects serve a diverse group of developers with varied needs, so your contributions should aim to add value to the broader community.
29+
30+
---
2531

26-
## Procedure
32+
## Reporting Issues
2733

2834
Before filing an issue:
35+
1. **Attempt to replicate the problem** to rule out one-off incidents.
36+
2. **Search existing issues** to ensure your problem or suggestion hasn’t already been raised.
37+
3. **Check pull requests** for ongoing work that may address the issue.
2938

30-
- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
31-
- Check to make sure your feature suggestion isn't already present within the project.
32-
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
33-
- Check the pull requests tab to ensure that the feature isn't already in progress.
39+
---
3440

35-
Before submitting a pull request:
41+
## Submitting Pull Requests
3642

37-
- Check the codebase to ensure that your feature doesn't already exist.
38-
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
43+
When submitting a pull request:
44+
1. **Ensure the feature doesn’t already exist** in the codebase.
45+
2. **Review existing pull requests** to ensure no one else is working on the same feature or fix.
46+
3. Follow these best practices:
47+
- **One pull request per feature**: If you want to contribute multiple changes, submit separate pull requests for each.
48+
- **Provide a coherent commit history**: Squash intermediate commits into meaningful ones.
49+
- **Document your changes**: Update the `README.md` or other relevant documentation to reflect your changes.
50+
- **Adhere to coding standards**: Use the PSR-12 coding standard.
51+
52+
---
3953

4054
## Requirements
4155

42-
If the project maintainer has any additional requirements, you will find them listed here.
56+
This project follows specific standards and guidelines to ensure consistency and maintainability:
57+
58+
1. **Coding Standard**
59+
- Follow **[PSR-12](https://www.php-fig.org/psr/psr-12/)**.
60+
- Use tools like [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer) to check your code.
61+
62+
2. **Semantic Versioning**
63+
- This project adheres to **[SemVer v2.0.0](http://semver.org/)**.
64+
- Avoid making random or unnecessary breaking changes to public APIs.
65+
66+
3. **Documentation**
67+
- Document any changes in functionality.
68+
- Update all relevant files, including `README.md` and other documentation, as needed.
4369

44-
- **[PSR-12 Coding Standard](https://www.php-fig.org/psr/psr-12/)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
70+
---
4571

46-
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
72+
## Contribution Workflow
4773

48-
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
74+
To contribute effectively:
75+
1. Fork the repository and create a new branch for your work.
76+
2. Ensure your branch is up-to-date with the `main` branch.
77+
3. Implement your feature or fix, ensuring compliance with the guidelines.
78+
4. Run tests and ensure no existing functionality is broken.
79+
5. Create a pull request with a clear description of the changes and why they are necessary.
4980

50-
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
81+
---
5182

52-
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
83+
**Thank you for contributing!** Your effort and time are greatly appreciated. Let’s build something amazing together.
5384

5485
**Happy coding**!

LICENSE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
MIT License
1+
# MIT License
22

3-
Copyright (c) 2021 NumenCode
3+
Copyright (c) 2025 NumenCode
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function pluginDetails(): array
2424
'description' => 'numencode.widgets::lang.plugin.description',
2525
'author' => 'Blaz Orazem',
2626
'icon' => 'oc-icon-briefcase',
27-
'homepage' => 'https://github.com/numencode/widgets-plugin',
27+
'homepage' => 'https://github.com/numencode/wn-widgets-plugin',
2828
];
2929
}
3030

README.md

Lines changed: 66 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,103 @@
11
# Widgets Plugin
22

3-
NumenCode Widgets plugin for Winter CMS.
3+
The **NumenCode Widgets** plugin for Winter CMS provides a flexible and easy-to-use solution for managing reusable
4+
widgets in Winter CMS. This plugin simplifies adding dynamic, visually engaging components to your themes and
5+
templates, enhancing the overall user experience.
46

5-
## Installation and usage
7+
[![Version](https://img.shields.io/github/v/release/numencode/wn-widgets-plugin?sort=semver&style=flat-square&color=0099FF)](https://github.com/numencode/wn-widgets-plugin/releases)
8+
[![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/numencode/wn-widgets-plugin?style=flat-square&color=0099FF)](https://packagist.org/packages/numencode/wn-widgets-plugin)
9+
[![Checks](https://img.shields.io/github/check-runs/numencode/wn-widgets-plugin/main?style=flat-square)](https://github.com/numencode/wn-widgets-plugin/actions)
10+
[![Tests](https://img.shields.io/github/actions/workflow/status/numencode/wn-widgets-plugin/main.yml?branch=main&label=tests&style=flat-square)](https://github.com/numencode/wn-widgets-plugin/actions)
11+
[![License](https://img.shields.io/github/license/numencode/wn-widgets-plugin?label=open%20source&style=flat-square&color=0099FF)](https://packagist.org/packages/numencode/wn-widgets-plugin/blob/main/LICENSE.md)
612

7-
This package requires [Winter CMS](https://wintercms.com/) application.
13+
---
814

9-
Install the package with Composer:
15+
## Target Audience
16+
17+
The target audience for this plugin includes developers and designers who want to enhance their Winter CMS projects
18+
by incorporating reusable, visually appealing widgets. The provided widgets, such as counters, promotions, features,
19+
and highlights, are commonly used in modern web design and are often found in templates and themes available on
20+
various marketplaces. This plugin bridges the gap between static designs and dynamic functionality.
21+
22+
## Installation
23+
24+
This plugin is available for installation via [Composer](http://getcomposer.org/).
1025

1126
```bash
1227
composer require numencode/wn-widgets-plugin
1328
```
1429

15-
## Details
30+
After installing the plugin you will need to run the migrations.
31+
32+
```bash
33+
php artisan migrate
34+
```
35+
36+
## Requirements
1637

17-
This plugin allows end users to create and edit various website widgets with a simple user interface.
18-
The plugin has full multilingual support and implements Winter.Translate plugin.
38+
* Winter CMS 1.2.7 or higher.
39+
* PHP version 8.0 or higher.
40+
41+
---
42+
43+
## Features Overview
44+
45+
This plugin provides an intuitive interface to create and manage a variety of widgets, enabling end users
46+
to customize their websites with ease. With multilingual support via the `Winter.Translate` plugin,
47+
it ensures global usability.
1948

2049
### Counters
2150

22-
Display statistics or numeric information on your website with an animated attention-grabbing dynamic element
23-
that draws visitors in. Simply enter the number to display, fill in the text that explains what the number is
24-
about, and set an optional CSS class for the icon. Counters are managed via the component properties.
51+
Showcase statistics or numeric information on your website using dynamic and engaging animated counters.
52+
Enter the desired number, provide explanatory text, and optionally include an icon class for added flair.
53+
Counters can be easily configured through component properties.
2554

2655
### Promotions
2756

28-
Promotions, such as content sliders and carousels, are simple to set up, totally customisable to the look and
29-
feel of your website, and allow you to showcase creative content in a relatively small footprint. Promotions
30-
are managed on the Promotions tab of the Widgets plugin.
57+
Create attention-grabbing promotional content such as sliders and carousels that seamlessly integrate
58+
into your website's aesthetic. Perfect for highlighting creative content within a compact space.
59+
Promotions are managed via the `Promotions` tab in the Widgets plugin.
3160

3261
### Features
3362

34-
Features can be used to display multiple items, either as a list of items or as a slider/carousel.
35-
Features are managed on the Features tab of the Widgets plugin.
63+
Display multiple items in an organized list or an eye-catching slider/carousel format. This is ideal
64+
for showcasing services, products, or other grouped content. Manage features directly from the `Features` tab.
3665

3766
### Highlights
3867

39-
Highlights are visuals with descriptions and can be displayed as content cards which should be
40-
exposed on the website. Highlights are managed on the Highlights tab of the Widgets plugin.
68+
Create visually striking content cards with accompanying descriptions to emphasize key aspects of your website.
69+
Highlights are perfect for promoting unique selling points or key features and are managed through the `Highlights` tab.
70+
71+
---
72+
73+
## Changelog
74+
75+
All notable changes are documented in the [CHANGELOG](CHANGELOG.md).
76+
77+
---
4178

42-
# Changelog
79+
## Contributing
4380

44-
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
81+
Please refer to the [CONTRIBUTING](CONTRIBUTING.md) guide for details on contributing to this project.
4582

46-
# Contributing
83+
---
4784

48-
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
85+
## Security
4986

50-
# Security
87+
If you identify any security issues, email [email protected] rather than using the issue tracker.
5188

52-
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
89+
---
5390

54-
# Author
91+
## Author
5592

56-
**NumenCode.Widgets** plugin was created by and is maintained by [Blaz Orazem](https://orazem.si/).
93+
The **NumenCode.Fundamentals** plugin is created and maintained by [Blaz Orazem](https://orazem.si/).
5794

58-
Please write an email to [email protected] about all the things concerning this project.
95+
For inquiries, contact: [email protected]
5996

60-
Follow [@blazorazem](https://twitter.com/blazorazem) on Twitter.
97+
---
6198

62-
# License
99+
## License
63100

64101
This project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
65102

66-
[![MIT License](https://img.shields.io/github/license/numencode/widgets-plugin?label=License&color=blue&style=flat-square&cacheSeconds=600)](https://github.com/numencode/widgets-plugin/blob/main/LICENSE.md)
103+
[![License](https://img.shields.io/github/license/numencode/wn-widgets-plugin?style=flat-square&color=0099FF)](https://packagist.org/packages/numencode/wn-widgets-plugin/blob/main/LICENSE.md)

0 commit comments

Comments
 (0)