Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

role problem! #5

Open
wants to merge 97 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
f581da3
Changed readme version to 1.0 to match plugin file.
ideadude Dec 23, 2016
45e6208
Added a "Delete Roles and Deactivate" link to the plugins page to
Aug 17, 2017
7c334f2
BUG FIX: delete roles and deactivate fix.
andrewlimaza Jul 29, 2019
e560aab
Enhancement: Assign default capabilities
andrewlimaza Jul 29, 2019
1dc7a44
Merge pull request #3 from andrewlimaza/plugin-action-links
kimcoleman May 14, 2020
95ab61b
Merge pull request #4 from andrewlimaza/capabilities-filter
kimcoleman May 14, 2020
4d2e641
Updating readme and plugin main file.
kimcoleman May 18, 2020
12d6e3a
Updating readme release date and changelog
kimcoleman May 18, 2020
1caa0c8
Merge pull request #9 from kimcoleman/readme-updates
kimcoleman May 18, 2020
72ee166
Updating release date
kimcoleman May 21, 2020
5921917
Merge pull request #10 from kimcoleman/dev
kimcoleman May 21, 2020
8c61af0
Updating to version 1.2 (version 1.1 was pushed in 2017 but not prope…
kimcoleman May 21, 2020
4eaa7f1
Merge pull request #11 from kimcoleman/dev
kimcoleman May 21, 2020
cb03550
Adds multiple roles to level settings
JarrydLong Oct 8, 2020
2a83ba6
Backwards compatibility added
JarrydLong Oct 8, 2020
24560a2
Formatting of checkboxes in settings page cleaned up
JarrydLong Oct 8, 2020
43585ec
Improvements made to the list of roles
JarrydLong Oct 8, 2020
785aff6
Additional checks in place when handling caps
JarrydLong Oct 8, 2020
b1c7500
Merge pull request #12 from JarrydLong/multiple-roles-on-levels
andrewlimaza Oct 12, 2020
502a436
Big fixes and enhancements to multiple roles
JarrydLong Oct 12, 2020
c5d8c3e
Bug Fixes
JarrydLong Oct 12, 2020
b826809
Improvements and Bug Fixes
JarrydLong Oct 13, 2020
e906036
Remove var_dump + adjust function name + docblocks
andrewlimaza Oct 13, 2020
4a67980
Update role assignment
andrewlimaza Oct 14, 2020
450ecc5
Enhancements: i18n, WPCS and escaping
andrewlimaza Oct 14, 2020
caea5f8
Version bump + readme
andrewlimaza Oct 14, 2020
35b6f76
Update MD file
andrewlimaza Oct 15, 2020
3b7f6b8
Replace roles instead of adding to them
JarrydLong Oct 20, 2020
52a05eb
Count removed from loop
JarrydLong Oct 20, 2020
eb26a43
Merge pull request #14 from JarrydLong/multiple-roles-on-levels
andrewlimaza Oct 20, 2020
820c6be
Checks for MMPU, Var renamed
JarrydLong Oct 20, 2020
9bad6bf
Merge pull request #15 from JarrydLong/multiple-roles-on-levels
andrewlimaza Oct 20, 2020
438550e
Adjustments to frontend layout and descriptive text.
kimcoleman Oct 20, 2020
9007a87
UX Changes
JarrydLong Oct 21, 2020
662bf7b
Sub heading text updated
JarrydLong Oct 21, 2020
19ea0cb
Merge pull request #16 from kimcoleman/dev
andrewlimaza Oct 22, 2020
12f1e69
Merge branch 'dev' into multiple-roles-on-levels
andrewlimaza Oct 22, 2020
8a52e86
Fix some merge conflicts.
andrewlimaza Oct 22, 2020
5e7a72d
Escaping text.
andrewlimaza Oct 22, 2020
5cdf2a6
Merge pull request #17 from JarrydLong/multiple-roles-on-levels
andrewlimaza Oct 22, 2020
c73fa5d
Adjusting padding in fixed height div roles list.
kimcoleman Oct 23, 2020
fe74cd2
Merge pull request #18 from kimcoleman/padding-in-fixed-height-div
andrewlimaza Oct 26, 2020
6ce60ed
Change readme date
andrewlimaza Oct 26, 2020
717fa75
Unset admin role only for level settings
andrewlimaza Oct 27, 2020
d15b48d
V1.3.1
andrewlimaza Oct 28, 2020
eaacf21
spelling fix.
andrewlimaza Oct 28, 2020
ed6ff3a
Error fixed. Filters added
JarrydLong Oct 29, 2020
1b6b178
Add templates to repo.
andrewlimaza Oct 29, 2020
8b64ac8
Merge branch 'dev'
andrewlimaza Oct 29, 2020
ef22191
Merge pull request #21 from JarrydLong/errors-fixed-filters-added
andrewlimaza Nov 3, 2020
164465b
Bug Fix: PMPro WooCommerce
andrewlimaza Nov 3, 2020
d36234f
Updated version + readme
andrewlimaza Nov 24, 2020
13a1b28
Merge branch 'dev'
andrewlimaza Nov 24, 2020
cd2b715
Adds in a check for new installs
JarrydLong Aug 3, 2021
00f6ca6
Now using pmpro_after_all_membership_level_changes action
dparker1005 Aug 4, 2021
9804043
Merge pull request #25 from JarrydLong/bug-fix-new-install
andrewlimaza Aug 18, 2021
567e59f
Merge pull request #27 from dparker1005/after_all_level_changes
andrewlimaza Aug 18, 2021
317c582
Add action for 'pmpro_roles_after_role_change'
andrewlimaza Aug 18, 2021
f4c8528
Add more parameters to action
andrewlimaza Aug 18, 2021
a4976a5
V1.4 release bump (todo: generate updated POT)
andrewlimaza Aug 18, 2021
747495d
🔄 Regenerate translation files
github-actions[bot] Aug 18, 2021
37385c1
Merge branch 'dev'
andrewlimaza Aug 18, 2021
868fbef
Fixed issue where level role settings weren't being honored sometimes…
ideadude Aug 26, 2021
59cb2b5
Replace PMPro_Roles class usage with self when in the class
sc0ttkclark Aug 26, 2021
b4370db
Whitespace tweak
sc0ttkclark Aug 26, 2021
0d4733c
Merge pull request #28 from strangerstudios/fix/role-options
ideadude Aug 27, 2021
632b6df
Adjusting to use the core PMPro clickable and scroll box selectors.
kimcoleman Aug 27, 2021
ffc1e8a
Merge branch 'dev' into dev
ideadude Aug 27, 2021
7f067cd
Merge pull request #29 from kimcoleman/dev
ideadude Aug 27, 2021
8c7fd7d
updated release date. stripslashes => esc_attr and esc_html
ideadude Aug 27, 2021
6707f6c
Updating to use new css selectors for PMPro and build array method
kimcoleman Aug 30, 2021
99259f8
Special styling for the level-specific role
kimcoleman Aug 31, 2021
acd45a2
Fixes critical error when PMPro is inactive
JarrydLong May 24, 2022
79ea894
Merge pull request #37 from JarrydLong/fixes-error
andrewlimaza Dec 1, 2022
15f5476
Load class on plugins_loaded
andrewlimaza Dec 1, 2022
87abbe7
Merge pull request #30 from kimcoleman/selectors-update-array-method
andrewlimaza Dec 1, 2022
8ce6eb1
Separate hooks into their own methods so that we control to load some…
andrewlimaza Dec 2, 2022
bc99ee8
Version bump and readme update
andrewlimaza Dec 12, 2022
4f10c6a
Banner update for new icon
kimcoleman May 23, 2023
ac52646
Default role removal after level change
becleung Aug 15, 2023
9ed35f9
add a period to the end of a comment
becleung Aug 15, 2023
1652e5a
Merge pull request #41 from becleung/default-role-removal-after-level…
andrewlimaza Oct 3, 2023
6e28abb
Default to site default role
andrewlimaza Oct 3, 2023
730de91
Default to site default on level change.
andrewlimaza Oct 3, 2023
e013fc0
Add help text.
andrewlimaza Oct 3, 2023
becc8e2
Adding column 'role' to members list
kimcoleman Nov 14, 2023
bae5c3e
Check that edit array key is set
ipokkel Apr 4, 2024
3085379
Merge pull request #46 from ipokkel/Fix-undefined-array-key
andrewlimaza Apr 11, 2024
12c1b73
Merge in the latest change to fix a warning.
andrewlimaza Apr 11, 2024
c80e925
Remove static from function.
andrewlimaza Apr 11, 2024
4da521a
Merge pull request #45 from kimcoleman/role-column-members-list
andrewlimaza Apr 11, 2024
a91b814
Merge branch 'dev' into dev
andrewlimaza Apr 11, 2024
49f50e7
Remove the draft role on plugin deletion
andrewlimaza Apr 22, 2024
b744c2e
Merge pull request #42 from andrewlimaza/dev
andrewlimaza Oct 23, 2024
0c929ed
Merge pull request #47 from andrewlimaza/delete-draft-role
andrewlimaza Oct 23, 2024
854340a
Version bump + Sanitization
andrewlimaza Oct 29, 2024
f7ddaaf
Fixed issue with pmpro_draft_role
andrewlimaza Oct 29, 2024
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
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.gitattributes export-ignore
languages/gettext.sh export-ignore
README.md export-ignore
roles-for-membership-levels.jpg export-ignore
.github export-ignore
49 changes: 49 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Contribute to Paid Memberships Pro - Roles for Membership Levels

Paid Memberships Pro is the "community solution" for membership sites on WordPress, and so contributions of all kinds are appreciated.

When contributing, please follow these guidelines to ensure things work as smoothly as possible.

__Please Note:__ GitHub is for bug reports and contributions only. If you have a support or customization question, go to our [Member Support Page](http://www.paidmembershipspro.com/support/) instead.

## Getting Started

* __Do not report potential security vulnerabilities here. Email them privately to [[email protected]](mailto:[email protected]) with the words "Security Vulnerability" in the subject.__
* Submit a ticket for your issue, assuming one does not already exist.
* Raise it on our [Issue Tracker](https://github.com/strangerstudios/pmpro-roles/issues)
* Clearly describe the issue including steps to reproduce the bug.
* Make sure you fill in the earliest version that you know has the issue as well as the version of WordPress you're using.

## Making Changes

* Fork the repository on GitHub
* For bug fixes, checkout the DEV branch of the PMPro repository.
* For new features and enhancements, checkout the branch for the version the feature is milestoned for.
* Make sure to pull in any "upstream" changes first.
* Use `git remote add upstream https://github.com/strangerstudios/pmpro-roles.git` to set the upstream repo
* Use `git checkout dev` to get on the development branch.
* Use `git pull upstream dev` to get the latest updates.
* Use `git push` to push those updates to your fork.
* Create a new local branch for each separate bug fix or feature. This will ensure that each pull request is for one issue only and easier to process.
* Use `git checkout -b nameofmybugfixorfeature` to create the new branch
* Make the changes to your local repository.
* Ensure you stick to the [WordPress Coding Standards](https://codex.wordpress.org/WordPress_Coding_Standards) (even though much of the PMPro code does not currently)
* If you have an automatic beautifier in your IDE or dev environment, turn it off. Unrelated style changes in your pull requests will make them harder to process. Feel free to message the core development team to ask them to clean up a file you are working on if the inconsitent coding styles is bothering you.
* You can update the readme.txt to include a comment about your fix or feature in the changelog, but if you do not the core team will do it for you.
* When committing, reference your issue (if present) and include a note about the fix in the commit message.
* Push the changes to your fork.
* For bug fixes, submit a pull request to the DEV branch of the PMPro repository.
* For new features and enhancements, submit a pull request to the version the feature is milestoned for. This will usually be the version number following the current release unless the core dev team has milestoned the feature for a later release.
* We will process all pull requests and make suggestions or changes as soon as possible. Feel free to ping us politely via email or social networks to take a look at your pulls.

## Code Documentation

* We would like for every function, filter, class, and class method to be documented using phpDoc standards.
* An example of [how PMPro uses phpDoc blocks can be found here](https://gist.github.com/sunnyratilal/5308969).
* Please make sure that every function is documented so that when we update our API Documentation things don't go awry!
* If you're adding/editing a function in a class, make sure to add `@access {private|public|protected}`
* Finally, please use tabs and not spaces. The tab indent size should be 4 for all Paid Memberships Pro code.

# Additional Resources
* [General GitHub Documentation](https://help.github.com/)
* [GitHub Pull Request documentation](https://help.github.com/send-pull-requests/)
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!-- This form is for reporting bugs and issues specific to the Paid Memberships Pro plugin. This is not a support portal. If you need technical support from a human being, please submit a ticket via the helpdesk instead: https://www.paidmembershipspro.com/support/ -->

<!-- Usage questions can also be directed to the public support forum here: https://wordpress.org/support/plugin/paid-memberships-pro, unless this is a question about a premium extension in which case you should use the helpdesk. -->

<!-- If you are a developer who needs a new filter/hook raise a PR instead :) -->

<!-- Please be as descriptive as possible; issues lacking the below details, or for any other reason than to report a bug, may be closed without action. -->

## Prerequisites

<!-- MARK COMPLETED ITEMS WITH AN [x] -->

- [ ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- [ ] The issue still exists against the latest `dev` branch of Paid Memberships Pro on Github (this is **not** the same version as on WordPress.org!)
- [ ] I have attempted to find the simplest possible steps to reproduce the issue

## Steps to reproduce the issue

<!-- We need to be able to reproduce the bug in order to fix it so please be descriptive! -->

1.
2.
3.

## Expected/actual behavior

When I follow those steps, I see...

I was expecting to see...

## Isolating the problem

<!-- MARK COMPLETED ITEMS WITH AN [x] -->

- [ ] This bug happens with only Paid Memberships Pro plugin active
- [ ] This bug happens with a default WordPress theme active, or [Memberlite](https://wordpress.org/themes/memberlite/)
- [ ] I can reproduce this bug consistently using the steps above

## WordPress Environment

<details>
```
Please share non-sensitive information about your hosting environment such as WordPress version, PHP version, Paid Memberships Pro and any related plugins versions.
```
</details>
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: "🐛 Bug Report"
about: Report a bug if something isn't working as expected in Paid Memberships Pro - Roles for Membership Levels.
title: ''
labels: 'bug'
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is. Please be as descriptive as possible; issues lacking detail, or for any other reason than to report a bug, may be closed or left unattended.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Screenshots**
If applicable, please attach a screenshot to make your issue clearer.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Isolating the problem (mark completed items with an [x]):**
- [ ] I have deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro plugin is active.
- [ ] This bug happens with a default WordPress theme active, or [Memberlite](https://wordpress.org/themes/memberlite/).
- [ ] I can reproduce this bug consistently using the steps above.

**WordPress Environment**
<details>
```
Please share non-sensitive information about your hosting environment such as WordPress version, PHP version, Paid Memberships Pro and any related plugins versions.
```
</details>
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: "⭐️ Enhancement"
about: If you have an idea to improve an existing feature or need something
for development (such as a new hook) please let us know or submit a Pull Request.
title: ''
labels: 'enhancement'
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
If applicable, add any other context or screenshots about the enhancement here.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: "➕ Feature Request"
about: "Suggest a new feature. We'll consider building it if it receives
sufficient interest!"
title: ''
labels: 'feature request'
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
If applicable, add any other context or screenshots about your feature request here.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: "💬 Support Question"
about: "If you have a question, please see our docs or use our helpdesk."
title: ''
labels: 'Type: support'
assignees: ''

---

We don't offer technical support on GitHub so we recommend using the following:

**Reading our documentation**
Usage docs can be found here: https://www.paidmembershipspro.com/documentation/

**Technical support for premium extensions or if you're a Paid Memberships Pro Plus member**
Submit a ticket on our helpdesk by visiting https://www.paidmembershipspro.com/new-topic/ (Please note that an [active membership] (https://www.paidmembershipspro.com/pricing) is required for paid support.)

**General usage and development questions**
- Website: https://www.paidmembershipspro.com/contact/
32 changes: 32 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
### All Submissions:

* [ ] Have you followed the [Contributing guideline](CONTRIBUTING.MD)?
* [ ] Does your code follow the [WordPress' coding standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/)?
* [ ] Have you checked to ensure there aren't other open [Pull Requests](../../pulls) for the same update/change?

<!-- Mark completed items with an [x] -->

<!-- You can erase any parts of this template not applicable to your Pull Request. -->

### Changes proposed in this Pull Request:

<!-- Describe the changes made to this Pull Request and the reason for such changes. -->

Resolves XXX.

### How to test the changes in this Pull Request:

1.
2.
3.

### Other information:

* [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
* [ ] Have you successfully run tests with your changes locally?

<!-- Mark completed items with an [x] -->

### Changelog entry

> Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.
18 changes: 18 additions & 0 deletions .github/workflows/generate-translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Generate Translations
on: workflow_dispatch
jobs:
generate-translations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: WordPress POT/PO/MO Generator
uses: strangerstudios/action-wp-pot-po-mo-generator@main
with:
generate_pot: 1
generate_po: 1
generate_mo: 1
generate_lang_packs: 1
merge_changes: 1
headers: '{"Report-Msgid-Bugs-To":"[email protected]","Last-Translator":"Paid Memberships Pro <[email protected]>","Language-Team":"Paid Memberships Pro <[email protected]>"}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
![](roles-for-membership-levels.jpg)

# [Roles for Membership Levels](https://www.paidmembershipspro.com/add-ons/pmpro-roles/) #
[comment]: # (Generate badges from shields.io, only works for .org plugins to get other stats etc. We'd have to create our own endpoints for Premium plugins)

![License](https://img.shields.io/badge/license-GPL--2.0%2B-red.svg?style=flat-square)

### Welcome to the Roles for Membership Levels GitHub Repository
Adds a new WordPress Role for each Membership Level. A member’s role will be set to the role for their membership level after checkout. Assign roles to members based on their membership level.

For more information please visit [paidmembershipspro.com/add-ons/pmpro-roles/](https://www.paidmembershipspro.com/add-ons/pmpro-roles/)

## Installation ##
For detailed installation steps, visit the [documentation](https://www.paidmembershipspro.com/add-ons/pmpro-roles/) page.

1. Download the current development ZIP file directly: `https://github.com/strangerstudios/pmpro-roles/archive/dev.zip`

**Please ensure that once installing this version of the plugin to remove `-dev` from the plugin's folder name.**

## Bugs ##
If you find an issue/bug, let us know by [creating a detailed GitHub issue](https://github.com/strangerstudios/pmpro-roles/issues/new).

## Support ##
This is a developer's portal for Roles for Membership Levels. We do not offer support on this channel. **Any support related questions should be directed to [paidmembershipspro.com/add-ons/pmpro-roles/](https://www.paidmembershipspro.com/add-ons/pmpro-roles/).**

## Contributing to Roles for Membership Levels ##
We encourage and welcome any contribution to Roles for Membership Levels. Please read the [guidelines for contributing](https://github.com/strangerstudios/pmpro-roles/blob/dev/.github/CONTRIBUTING.md) to this repository.

There are various **ways to the help development** of Roles for Membership Levels:

1. Report [bugs/issues](https://github.com/strangerstudios/pmpro-roles/issues/new) on GitHub.
2. Work on any issues by submitting a Pull Request.

Here are some ways for **non-developers to contribute** to Roles for Membership Levels:

1. Translate Roles for Membership Levels into your own [language](https://www.paidmembershipspro.com/paid-memberships-pro-in-your-language/).
2. [Purchase a plus membership](https://paidmembershipspro.com/pricing) to help fund ongoing development and bug fixes.
9 changes: 5 additions & 4 deletions admin.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#repair_roles_container{
#repair_roles_container {
background: #fff;
float: left;
padding: 8px 10px;
margin-top: 25px;
}
#repaired_roles{
#repaired_roles {
display: none;
margin-bottom: 0;
}
#repair_roles, #repair_roles:active{
#repair_roles,
#repair_roles:active {
vertical-align: middle;
margin-left: 15px;
}
}
25 changes: 25 additions & 0 deletions languages/gettext.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#---------------------------
# This script generates a new pmpro-roles.pot file for use in translations.
# To generate a new pmpro-roles.pot, cd to the main /pmpro-roles/ directory,
# then execute `languages/gettext.sh` from the command line.
# then fix the header info (helps to have the old pmpro.pot open before running script above)
# then execute `cp languages/pmpro-roles.pot languages/pmpro-roles.po` to copy the .pot to .po
# then execute `msgfmt languages/pmpro-roles.po --output-file languages/pmpro-roles.mo` to generate the .mo
#---------------------------
echo "Updating pmpro-roles.pot... "
xgettext -j -o languages/pmpro-roles.pot \
--default-domain=pmpro-roles \
--language=PHP \
--keyword=_ \
--keyword=__ \
--keyword=_e \
--keyword=_ex \
--keyword=_n \
--keyword=_x \
--keyword=esc_html_e \
--keyword=esc_html__ \
--sort-by-file \
--package-version=1.0 \
--msgid-bugs-address="[email protected]" \
$(find . -name "*.php")
echo "Done!"
Binary file added languages/pmpro-roles.mo
Binary file not shown.
Loading