Skip to content

Commit c2a14e8

Browse files
committed
Fix node-sass deprecation warnings, adds GH templates
1 parent 6e6cb9b commit c2a14e8

18 files changed

+455
-224
lines changed

.cursor/rules/general.mdc

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: false
5+
---
6+
---
7+
description: WPForms Cursor General Rules
8+
globs:
9+
alwaysApply: true
10+
---
11+
By default use git repository in plugins directory.
12+
13+
# General code style rules:
14+
- Use tabs instead of spaces for indentation at the beginning of the line.
15+
- Comments in the code must be in English and end with a period.
16+
17+
# Core Principles
18+
- Adhere to PHP and WordPress best practices for consistency and readability.
19+
- Emphasize object-oriented programming (OOP) for better modularity.
20+
- Focus on code reusability through iteration and modularization, avoiding duplication.
21+
- Use descriptive and meaningful functions, variables, and file names.
22+
- Follow existing project directory naming conventions.
23+
- Use WordPress hooks (actions and filters) to extend functionality.
24+
- Add explicit, descriptive comments to improve code clarity and maintainability.
25+
26+
# PHP/WordPress Coding Practices
27+
- Utilize features of PHP 7.2+ where applicable.
28+
- Follow WordPress PHP coding standards throughout the codebase.
29+
- Values inside parentheses must have one space between value and each parenthesis. This is also required for brackets and curly braces.
30+
- Leverage core WordPress functions and APIs wherever possible.
31+
- Maintain WordPress theme and plugin directory structure and naming conventions.
32+
- Implement robust error handling:
33+
- Use WordPress's built-in debug logging (WP_DEBUG_LOG).
34+
- Apply try-catch blocks for controlled exception handling.
35+
- Always use WordPress's built-in functions for data validation and sanitization.
36+
- Ensure secure form handling by verifying nonces in submissions.
37+
- For database interactions:
38+
- Use WordPress's $wpdb abstraction layer.
39+
- Apply prepare() statements for all dynamic queries to prevent SQL injection.
40+
- Use the dbDelta() function to manage database schema changes.
41+
42+
# JavaScript
43+
- Use short arrow function syntax.
44+
45+
# Dependencies
46+
- Ensure compatibility with the latest stable version of WordPress.
47+
- Use Composer for dependency management in advanced plugins or themes.
48+
49+
# WordPress Best Practices
50+
- Use WordPress's user roles and capabilities to manage permissions.
51+
- Apply the transients API to cache data and optimize performance.
52+
- Follow best practices for internationalization (i18n) by using WordPress localization functions.
53+
- Apply proper security practices such as nonce verification, input sanitization, and data escaping.
54+
- Manage scripts and styles by using wp_enqueue_script() and wp_enqueue_style().
55+
- Store configuration data securely using WordPress's options API.
56+
57+
# Key Conventions
58+
- Follow WordPress's plugin API to extend functionality in a modular and scalable manner.
59+
- Apply WordPress's built-in functions for data sanitization and validation to secure user inputs.
60+
- For custom queries, use $wpdb or WP_Query for database interactions.
61+
- For AJAX requests, use admin-ajax.php or the WordPress REST API to handle backend requests.
62+
- Always apply WordPress's hook system (actions and filters) for extensible and modular code.
63+
- Implement database operations using transactional functions where needed.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "\U0001F41E Bug Report"
2+
description: Found a bug? Please fill in the report below to help us improve
3+
labels: bug
4+
body:
5+
- type: textarea
6+
id: current_behaviour
7+
attributes:
8+
label: Current Behavior
9+
description: Describe what happens when you encounter the issue. Feel free to include errors or attachments to highlight the incorrect behavior.
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: expected_behaviour
14+
attributes:
15+
label: Expected Behavior
16+
description: Outline the intended behavior of the functionality.
17+
validations:
18+
required: true
19+
- type: textarea
20+
id: steps
21+
attributes:
22+
label: Steps to Reproduce
23+
description: |
24+
List the steps needed to replicate the issue, including relevant links, code snippets, etc.
25+
value: |
26+
1.
27+
2.
28+
3.
29+
validations:
30+
required: true
31+
- type: input
32+
id: athemesblocks_version_is
33+
attributes:
34+
label: Environment Where the Issue is Reproducible
35+
description: Specify the aThemes Blocks Core version or branch where the issue occurs.
36+
placeholder: e.g. Core 1.8.4 or Core 1.8.5 (develop).
37+
validations:
38+
required: false
39+
- type: input
40+
id: athemesblocks_version_is_not
41+
attributes:
42+
label: Environment Where the Issue is NOT Reproducible
43+
description: Specify the aThemes Blocks Core version, or branch where the issue is NOT present.
44+
placeholder: e.g. Core 1.8.4 or Core 1.8.5 (develop).
45+
validations:
46+
required: false
47+
- type: textarea
48+
id: notes
49+
attributes:
50+
label: Additional Notes & Attachments
51+
description: Share any extra details or attachments that might help, such as a suggested fix, related HelpScout ticket, or end-to-end test references.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: "✨ Enhancement"
3+
about: Suggest an enhancement/improvement.
4+
title: ''
5+
labels: 'enhancement'
6+
assignees: ''
7+
8+
---
9+
10+
## Expected Behavior
11+
<!--- Tell us how it should work. -->
12+
13+
14+
## Current Behavior
15+
<!--- Explain the difference from the current behavior. -->
16+
17+
18+
## Screenshots
19+
<!--- Remove section if no screenshots to share. -->
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: "\U0001F680 New Feature"
3+
about: New feature.
4+
title: ''
5+
labels: 'feature'
6+
assignees: ''
7+
8+
---
9+
10+
| What | Where |
11+
| ---- | ----- |
12+
| Asana | [link] |
13+
| Pitch | [Google Doc link] |
14+
| License | [Lite, Basic+, Plus+, Pro+, Elite] |
15+
16+
## Description
17+
<!--- If this feature doesn't have a pitch, provide here all -->
18+
<!--- the relevant information: why it's needed, who will use it etc. -->
19+
<!--- Be as concise and descriptive as possible. -->
20+
21+
## Screenshots
22+
<!--- Remove this section if inrrelevant. -->
23+
<!--- Share here any mockups/screenshots that you have. -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
## Description
2+
<!---
3+
Provide a general summary of your changes in the Title above. Most of the time, we copy a connected issue title.
4+
Describe your changes and technical choices in detail.
5+
If this is fixing a bug/regression, please include when and where this was introduced.
6+
-->
7+
8+
9+
## Motivation and Context
10+
<!---
11+
Why is this change required? What problem does it solve?
12+
Please link to the issue here (example: Fixes #42).
13+
-->
14+
15+
16+
## Changelog
17+
<!---
18+
Read the detailed description on how to write changelog: https://github.com/awesomemotive/wpforms-plugin/wiki/How-to-write-CHANGELOG.md-records.
19+
-->
20+
The changes in this PR can be summarized with this [changelog](https://github.com/awesomemotive/wpforms-plugin/wiki/How-to-write-CHANGELOG.md-records) record:
21+
22+
*
23+
24+
## Content Review
25+
- [ ] The text/copy used in PR has been reviewed by the content team.
26+
- [ ] The URLs introduced in PR have been reviewed by the content team.
27+
28+
## QA Review
29+
<!---
30+
Please describe in detail how you tested your changes.
31+
Include details of your testing environment and the tests you ran to
32+
see how your change affects other areas of the code, etc.
33+
-->
34+
1. Do this.
35+
2. Do that.
36+
3. Profit!
37+
38+
### Impact
39+
<!--
40+
Sometimes PRs have a bigger impact than it's mentioned in the changelog record.
41+
In such cases, additional regression testing might be necessary.
42+
To make it clear which parts of the plugin may need additional testing,
43+
please outline here what is impacted by this PR.
44+
-->
45+
This PR affects the following parts of the plugin/addons, which may require extra testing:
46+
47+
*
48+
49+
## Self-Testing Checklist
50+
<!---
51+
The PR author fills in this section.
52+
If the checkbox is not relevant - still mark it as checked.
53+
-->
54+
- [ ] I tested both **Free** and **paid** version of the plugin.
55+
- [ ] I tested these changes to the best of my abilities with browser console opened and debug.log monitored.
56+
- [ ] I checked situations when users **update free/pro in a different order**.
57+
- [ ] **Backward compatibility** with users updating from an older version to the one with these changes has been checked.
58+
- [ ] For the Block Editor related changes, I checked in both Sydney and Botiga theme.
59+
- [ ] For the front-end related changes, I checked in both Sydney and Botiga theme.
60+
- [ ] I tested in different browsers (Chrome/Firefox/Safari/Edge).
61+
- [ ] I tested on Multisite OR this change does not affect Multisite in any way.
62+
- [ ] I tested with LTR and RTL languages.
63+
<!--
64+
If you have checked any of the above cases, please add some context about the reason, which editor/browser/functionality should be tested in particular, etc.
65+
-->
66+
67+
## Screenshots / Screencasts
68+
<!--- Provide screenshots how the completed change is displayed/presented to users (if relevant). -->
69+
<!--- Please remove this section if not relevant. -->

assets/sass/abstracts/mixins/_mixins.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
// Column width with margin
99
@mixin column-width($numberColumns: 3) {
10-
width: map-get($columns, $numberColumns) - ( ( $columns__margin * ( $numberColumns - 1 ) ) / $numberColumns );
10+
width: map-get($columns, $numberColumns) - ( calc(($columns--margin * ($numberColumns - 1)) / $numberColumns) );
1111
}
1212

1313
@mixin font-size($sizeValue: 1) {
1414
font-size: ($sizeValue) * 1px;
15-
font-size: ($sizeValue / 16) * 1rem;
15+
font-size: calc($sizeValue / 16) * 1rem;
1616
}
1717

1818
@mixin valign {

composer.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
"phpcompatibility/phpcompatibility-wp": "*"
3636
},
3737
"config": {
38+
"vendor-dir": "vendor",
39+
"preferred-install": "dist",
40+
"sort-packages": true,
41+
"platform": {
42+
"php": "7.4"
43+
},
3844
"allow-plugins": {
3945
"dealerdirect/phpcodesniffer-composer-installer": true
4046
}

composer.lock

Lines changed: 35 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)