Skip to content

Commit d1788d3

Browse files
committed
WIP
1 parent a7ba17f commit d1788d3

Some content is hidden

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

54 files changed

+2251
-0
lines changed

.gitattributes

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
* text=auto
2+
3+
/.github export-ignore
4+
/.gitattributes export-ignore
5+
/.gitignore export-ignore
6+
/.scrutinizer.yml export-ignore
7+
/.travis.yml export-ignore
8+
/phpunit.xml export-ignore
9+
/tests export-ignore
10+
/webpack.mix.js export-ignore
11+
/yarn.lock export-ignore
12+
/qa-checklist.md export-ignore
13+
/package.json export-ignore

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: [mikebronner]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
composer.lock
2+
/vendor
3+
/node_modules
4+
yarn.lock
5+
.phpunit.result.cache
6+
package-lock.json

.scrutinizer.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
filter:
2+
excluded_paths:
3+
- "public/"
4+
- "tests/"
5+
- "resources/assets/js/mixpanel.js"

.travis.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
language: php
2+
3+
php:
4+
- 7.2.5
5+
- 7.3
6+
- 7.4
7+
8+
before_script:
9+
- travis_retry composer self-update
10+
- travis_retry composer install --no-interaction --prefer-source --dev
11+
12+
script:
13+
- mkdir -p ./build/logs
14+
- ./vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml
15+
16+
after_success:
17+
- travis_retry php vendor/bin/php-coveralls -v
18+
19+
notifications:
20+
webhooks:
21+
urls:
22+
- https://webhooks.gitter.im/e/30886f28c25b1e31088f
23+
on_success: change # options: [always|never|change] default: always
24+
on_failure: always # options: [always|never|change] default: always
25+
on_start: never # options: [always|never|change] default: always

CHANGELOG.md

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
# Change Log
2+
All notable changes to this project will be documented in this file.
3+
This project adheres to [Semantic Versioning](http://semver.org/).
4+
5+
## TODO
6+
- http://phppackagechecklist.com/#1,2,3,4,5,6,9,10,11,12,13,14
7+
Complete check list items.
8+
- Detect through subscription create when a user had previously unsubscribed (churn), then resubscribes (unchurn).
9+
(This is already detected in subscription update.)
10+
- Filter any incoming web-hook events that are in test mode.
11+
12+
## [0.10.3] - 2020-08-05
13+
### Added
14+
- configuration option for MixPanel Host.
15+
16+
## [0.10.1] - 2020-03-04
17+
### Updated
18+
- Laravel dependency to release version.
19+
20+
## [0.10.0] - 2020-02-29
21+
### Added
22+
- Laravel 7 compatibility.
23+
24+
## [0.9.1] - 2019-10-18
25+
### Added
26+
- functionality to inject custom data points into track events.
27+
28+
### Fixed
29+
- Laravel 6.x compatibility.
30+
31+
## [0.9.0] - 2019-08-28
32+
### Added
33+
- Laravel 6.0 compatibility.
34+
35+
## [0.8.1] - 2019-07-28
36+
### Fixed
37+
- tracking of user information.
38+
39+
## [0.8.0] - 2019-04-05
40+
### Added
41+
- Laravel 5.8 compatibility.
42+
43+
## [0.7.11] - 5 Oct 2018
44+
### Added
45+
- Laravel 5.7 compatibility.
46+
47+
### Fixed
48+
- Stripe API compatibility.
49+
- disabling of default tracking.
50+
51+
## [0.7.4] - 7 Jan 2018
52+
### Added
53+
- Laravel 5.6 compatibility.
54+
55+
## [0.7.4] - 7 Jan 2018
56+
### Added
57+
- `Mixpanel::xxx()` facade.
58+
- `thanks` package as dev-dependency, as well as pretty phpunit printer package.
59+
60+
## [0.7.3] - 5 Nov 2017
61+
### Added
62+
- initial integration tests.
63+
64+
### Changed
65+
- class structure as part of refactoring.
66+
67+
## [0.7.2] - 5 Nov 2017
68+
### Fixed
69+
- inclusion of auto-track JS scripts. NPM library is broken and seems to not be maintained anymore, switched to script provided by mixpanel setup instructions.
70+
71+
## [0.7.1] - 18 Oct 2017
72+
### Updated
73+
- user model listener to not fail if timestamps are turned off.
74+
75+
### Added
76+
- basic configuration in preparation for unit tests and code quality analysis.
77+
78+
## [0.7.0] - 31 Aug 2017
79+
### Added
80+
- compatibility with Laravel 5.5.
81+
- auto-detection of package's service provider for automatic installation.
82+
- Console error to warn of missing ENV variable.
83+
84+
### Updated
85+
- README with L5.5 particulars.
86+
- CHANGELOG with new entries.
87+
88+
## [0.5.3] - 4 Apr 2016
89+
### Added
90+
- configuration setting to disable the default-bundled tracking hooks.
91+
92+
## [0.5.2] - 16 Jan 2016
93+
### Fixed
94+
- event listeners to properly detect new laravel 5.2 events.
95+
96+
## [0.5.1] - 11 Jan 2016
97+
### Fixed
98+
- event listener to work with Laravel 5.2 core events.
99+
100+
## [0.4.10 - 0.4.12] - 28 Oct 2015
101+
### Added
102+
- tracking of robots, if a browser isn't detected, and it is confirmed as a robot.
103+
104+
### Fixed
105+
- incorrect usage of array_filter, causing empty strings to be passed.
106+
107+
### Changed
108+
- reverted from using getAttribute(), as it is redundant.
109+
- refactored `track()` method to track: Url, Operating System, Hardware, Browser, Referring Domain, IP (For GeoLocation)
110+
111+
### Removed
112+
- any "unknown" values from being passed.
113+
114+
## [0.4.7 - 0.4.8] - 25 Oct 2015
115+
### Changed
116+
- referenced to user model properties to use `getAttribute()` instead of referencing them directly.
117+
118+
### Added
119+
- tracking of `name` in addition to `first name` and `last name`.
120+
- tracking of `referrer` and `referring domain` to help get additional information for Live View (may not yet work
121+
fully).
122+
123+
### Fixed
124+
- improper tracking of user details, which caused users' names to be blank and a `0 Object [object]` field to be tracked
125+
erroneously.
126+
- fixed tracking to not depend on `$user->id` when referencing the primary key, but pulling it dynamically instead.
127+
128+
## [0.4.6] - 25 Sep 2015
129+
### Fixed
130+
- documentation references to old Mixpanel class.
131+
- usage of first_name and last_name attributes on User classes that don't have them.
132+
133+
## [0.4.5] - 24 Sep 2015
134+
### Fixed
135+
- Exception if no `$user->created_at` attribute exists.
136+
137+
## [0.4.0 - 0.4.4] - 13 Sep 2015
138+
### Fixed
139+
- FQCN references in event handler.
140+
- namespace for controller in routes file.
141+
- namespace for service provider.
142+
- path to routes file.
143+
144+
### Changed
145+
- Move to new repository, change namespace.
146+
- Change referer detection.
147+
148+
## [0.3.12 - 0.3.13] - 2015-06-18
149+
### Added
150+
- Identify user when tracking Page View if logged in.
151+
- Update "Last Seen" timestamp when logged-in user views a page.
152+
153+
## [0.3.1 - 0.3.11] - 2015-06-17
154+
### Added
155+
- Referrer is now also recorded in Page View tracks.
156+
157+
### Removed
158+
- Temporarily disabled alias() until its purpose and usefulness is better assessed.
159+
160+
### Changed
161+
- Namespace HTTP/Controllers changed to Http/Controllers.
162+
- Fixed method to detect current URL.
163+
164+
### Fixed
165+
- Attempt at fixing client IP detection.
166+
- PHP version requirement updated to >5.5.
167+
- Fix namespace and path references.
168+
- Fix URL and Route detection for 'Page View' tracking.
169+
- Fixed detection of Page View elements to only be added if they exist.
170+
171+
## [0.3.0] - 2015-06-16
172+
### Changed
173+
- Upgraded to Laravel 5.1
174+
175+
### Added
176+
- Page View tracking.
177+
- MixPanel alias() on registration to enabled proper funneling.
178+
179+
## [0.2.13] - 2015-06-10
180+
### Added
181+
- Ignore transfer transactions.
182+
183+
## [0.2.11 - 0.2.12] - 2015-06-09
184+
### Added
185+
- Additional check to detect stripe customer number.
186+
- Tightened sanity checks on subscription user detection.
187+
188+
## [0.2.10] - 2015-06-06
189+
### Fixed
190+
- Extracted logic to get stripe customer id and throw exception if not found.
191+
192+
## [0.2.8 - 0.2.9] - 2015-06-05
193+
### Fixed
194+
- Fixed logic error in customer ID parsing.
195+
196+
## [0.2.7] - 2015-06-04
197+
### Fixed
198+
- Refactored subscription update functionality to be a little more robust. Testing all aspects of this has proven
199+
difficult, as Stripes webhook tests don't account for all variations possible in a given webhook request type.
200+
201+
## [0.2.6] - 2015-06-03
202+
### Changed
203+
- Added FromPlan and ToPlan when tracking subscription changes.
204+
205+
### Fixed
206+
- Subscription updates check for previous subscription information, as not all subscription changes have it.
207+
208+
## [0.2.5] - 2015-06-2
209+
### Fixed
210+
- Checked for existence of user when logging out before identifying with MixPanel.
211+
212+
## [0.1.6 - 0.2.4] - 2015-05-30
213+
### Added
214+
- Webhook for tracking Stripe events.
215+
- Documented MixPanel events in README.
216+
217+
### Fixed
218+
- Sanitize People data before setting it, so that values don't get erased if something is not set.
219+
- Fix method parameters.
220+
- Track client IP address.
221+
- Ignore charge updates.
222+
- Formatting of non-existent dates during profile setting.
223+
- Detection of stripe customer id in webhook.
224+
225+
## [0.1.0 - 0.1.4] - 2015-05-30
226+
### Changed
227+
- Updated `composer.json` details.
228+
- Updated README details.
229+
- Renamed events to model the formula <what + action>, i.e. "Login Succeeded" or "Page Viewed".
230+
231+
### Fixed
232+
- Update profile information if not set (i.e. for prior existing users).
233+
- Log signup date as string, not as object.
234+
- Name detection on user model.
235+
236+
### Added
237+
- Initial package development.
238+
- User observer.
239+
- User events handler.
240+
- DocBlocks.

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# How to contribute
2+
We welcome everyone to submit pull requests with:
3+
- fixes for issues
4+
- change suggestions
5+
- updateing of documentation
6+
7+
However, not every pull request will automatically be accepted. I will review each carefully to make sure it is in line with
8+
the direction I want the package to continue in. This might mean that some pull requests are not accepted, or might stay
9+
unmerged until a place for them can be determined.
10+
11+
## Testing
12+
- [ ] After making your changes, make sure the tests still pass.
13+
- [ ] When adding new functionality, also add new tests.
14+
- [ ] When fixing errors write and satisfy new unit tests that replicate the issue.
15+
- [ ] Make sure there are no build errors on our CI server (https://ci.genealabs.com/build-status/view/11)
16+
- [ ] All code must past PHPCS and PHPMD PSR2 validation.
17+
18+
## Submitting changes
19+
When submitting a pull request, it is important to make sure to complete the following:
20+
- [ ] Add a descriptive header that explains in a single sentence what problem the PR solves.
21+
- [ ] Add a detailed description with animated screen-grab GIFs visualizing how it works.
22+
- [ ] Explain why you think it should be implemented one way vs. another, highlight performance improvements, etc.
23+
24+
## Coding conventions
25+
Start reading our code and you'll get the hang of it. We optimize for readability:
26+
- indent using four spaces (soft tabs)
27+
- use Blade for all views
28+
- avoid logic in views, put it in controllers or service classes
29+
- ALWAYS put spaces after list items and method parameters (`[1, 2, 3]`, not `[1,2,3]`), around operators (`x += 1`, not `x+=1`), and around hash arrows.
30+
- this is open source software. Consider the people who will read your code, and make it look nice for them. It's sort of like driving a car: Perhaps you love doing donuts when you're alone, but with passengers the goal is to make the ride as smooth as possible.
31+
- emphasis readability of code over patterns to reduce mental debt
32+
- always add an empty line around structures (if statements, loops, etc.)
33+
34+
Thanks!
35+
Mike Bronner, GeneaLabs

0 commit comments

Comments
 (0)