Git Product home page Git Product logo

edd-slack's Introduction

=== Easy Digital Downloads - Slack ===
Author URI: https://easydigitaldownloads.com
Plugin URI: https://easydigitaldownloads.com/downloads/slack/
Contributors: d4mation
Requires at least: 4.4
Tested up to: 5.5
Stable Tag: 1.1.2

== Description ==

Slack Integration for Easy Digital Downloads

== Changelog ==
= v1.1.2, August 21, 2020 =
* Fix: Improved compatibility with EDD Software Licensing 3.6
* Fix: Improved PHP 7.3 and 7.4 compatibility.
* Fix: When reviews was active, but FES was not, a fatal error occured in the settings.
* Fix: Updated Slack icon on the welcome page.
* Fix: Removed dependency of markdown parser for changelog by linking directly to the changelog.
* Dev: Rebuilt the build system for Gulp 4.

= v1.1.1, February 7, 2018 =

* Fixed bug causing `%active_site%` to sometimes fail when using a license activation or deactivation trigger

= v1.1.0, September 22, 2017 =

* **New:** Slack Team Invites are now incorporated into EDD Slack
  * This is activated separately from Interactive Notifications/Slash Commands and must be done by a Slack User with the ability to invite other Users to the Team normally (This is often only Slack Team Admins)
  * Activating this functionality adds a Checkbox to the Customer Checkout Form as well as the Vendor Registration Form from EDD Frontend Submissions that will send a Slack Team Invite to that Email Address.
  * Customers/Vendors can also be added to the Slack Team manually by accessing the Tools tab on the Customer screen or the Profile tab under the Vendor screen respectively.
* **New:** Three New Slash Commands
  * `/edd version`: Outputs the current version of Easy Digital Downloads.
  * `/edd discount`: Outputs information about a Discount Code. This can also be used to create new Discount Codes.
  * `/edd customer`: Outputs information about a Customer. You can use either their Customer ID or their Primary Email Address for this command.
* **New:** Now you can choose Multiple Downloads for a single Notification
  * If "All Downloads" is chosen, you can also optionally set Exclusions
* **New:** EDD Reviews Triggers added
  * New Review Trigger
  * New Vendor Feedback Trigger (Requires EDD Frontend Submissions to be active as well)
* **New:** EDD Fraud Monitor Trigger added
  * New Suspected Fraudulent Transaction
      * This can also be made into an Interactive Notification to Accept the Payment as Valid or to Confirm it as Fraud directly from Slack
          * When the log is added to EDD for this, it will say that this action was processed by EDD Slack and by which Slack User
* **New:** Recurring Payments Triggers added
  * New Subscription Created Trigger
  * Subscription Cancelled Trigger
* **New:** Add a Message about additional SSL-only functionality on non-SSL sites
* **New:** Responsive Settings Screen
* **New:** Admin Color Scheme taken into account for Notification Delete buttons
* **Change:** Use Customer Information rather than User Information where applicable.
  * In cases where a Notification uses User information instead (New Vendor, etc.), the text replacement description text is changed accordingly
* **Change:** The layout of information for the `/edd sales` Slash Command has been updated to match the new Slash Commands in this release.
* **Change:** EDD Software Licenses Integration Changes
  * License Activation Triggers are now specific to Activation/Deactivation via EDD's web API. Activating/Deactivating manually from the Licenses screen no longer triggers these.
    * This can cause problems in some server configurations due to caching. `edd_action=activate` and `edd_action=deactivate` URL Parameters should be excluded from caching on the Home Page.
  * `%active_site%` text replacement for License Activation/Deactivation Triggers
  * `%license_link%` text replacement for License Generation/Activation/Deactivation Triggers
* **Change:** No longer using a PHP Constant for the Text Domain
* **Change:** Restrict Slash Commands to Slack Team Admins by default. Specific Users can be allowed via an interface on the Settings screen.
  * This requires the OAUTH Token to need new permissions, so unlinking and relinking the application is necessary.
* **Change**: Labels for Fields are now above the Fields in the Notification Modal
* **Fix:** When Saving a Notification, the "Save Notification" button now updates to show that it is in the process of Saving.
* **Fix:** Notification Forms can be re-filled out after failure to fill a required field
* **Fix**: Fix bug with the Purchase Limit Trigger when a Price ID was not set (No Variable Pricing enabled)
* **Fix**: `%site_count%` added to text replacements for License Activation/Deactivation Triggers. This existed in v1.0.X, but it was accidentally excluded from the list of text replacements.
* **Fix**: Fully bails on loading the plugin if base conditions weren't met. Before it just threw up a notice but still attempted to run.
* **Fix**: If no Message Text was defined for a Notification, while it *would* go through properly, the notification pop-up on a desktop client would show a weird error. This now no longer happens.

= v1.0.3, January 21, 2017 =

* **Fix:** `%purchase_link%` and `%download_link%` returning malformed URLs to Slack
* **Fix:** Stop Vendor Feedback triggering a New Comment.

= v1.0.2, January 4, 2017 =

* **Fix:** Plugin name did not match download name on easydigitaldownloads.com which would cause licensing to fail.

= v1.0.1, January 4, 2017 =

* **Fix:** Minor bug prevented Slash Commands from sending properly

= v1.0.0, January 4, 2017 =

* Initial Release

edd-slack's People

Contributors

ashleyfae avatar brashrebel avatar cklosowski avatar d4mation avatar dependabot[bot] avatar mihaijoldis avatar robincornett avatar rwebster85 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

edd-slack's Issues

Add some response buttons to a few triggers

As documented here it is possible to pass in buttons with slack messages. Here's a few I think we could include:

Now

  • Approve / Spam comment (at least just approve, others we could play with)
  • Approve / Decline vendor application
  • Approve / Decline vendor submission
  • Approve / Decline vendor product edit

For later (open new issues at some point, just recording them here for now):

  • Same as comments but for reviews
  • Actions for Fraud Monitor
  • Actions for Bookings (not possible yet since booking management is still on their roadmap, but it will be way cool once they finish it)

Triggers

With LearnDash Slack I had a guide somewhat of what triggers should be added, but outside of obvious ones (Sale complete, etc.) I'm not sure what I should really include in EDD Slack.

I'm also considering using this part of the Slack API for showing things like sales history for different Downloads. Although maybe that's more of a v1.1 item?

Reviews Triggers

  • New review
  • New Vendor Feedback (Also Requires FES. Referencing #46)

See #4 for some blocking issues with this Integration

Documentation/Clearer Instructions for Slack App Fields

When a site has SSL it could be clearer to the User how to utilize the Slack App Integration. That section on the Admin is functional but lacking in clarity.

  • Ideally create a Filter that will show Integrations that support Integration Buttons in that same area.
  • Maybe create a Filter that shows Slash Commands and their Endpoints? Technically the User has to enter in the name, help text, etc. for Slash Commands so this may be more clutter than anything. This could be useful as a Table I suppose.
    • Command | Help Text | Parameters | Endpoint

Ideally the less the User has to view our Documentation for understanding the better in my opinion.

Horizontal Scrolling in Modal

Not sure when this happened. Noticed it while fixing those Safari bugs but assumed it was Safari being weird. However, it also exists in Chrome.

Slash command and parameter naming

Soooooooo excited about the slash commands. Did a little reflecting and am just thinking we should nail down the naming scheme for everything to establish the right precedence. Here's some options:

  • /eddsales this_month
  • /edd sales this_month
  • /sales this_month

The first is what we have now. It is nice because it is simple. The command and the optional arguments.

The second I like a lot because we'll at some point have other commands so they could all start with /edd and the second argument would be required as the endpoint with the third argument being the optional specification.

The last option is also nice because it is straight to the purpose and doesn't bother with the EDD identifier. I suppose there's the possibility of a conflict but that's likely slim.

Thoughts on favorite? If it is possible, I think the second is my favorite. I want to be mindful of the fact that we'll be adding more in the future so whichever makes it easiest for users is probably best.

Integration with EDD Message

Latest version of EDD Message includes a edd_message_after hook which fires after a message sends successfully. So we could make a trigger for whenever a message is sent to a customer.

However, we'd probably want to break it apart so that it isn't just all messages but based on type. I'll make sure $type is passed with the hook.

Minor wording issues

  • "slack" should be capitalized in all strings. It isn't next to the main webhook setting field.
  • screenshots on welcome page do show quite a lot in a small amount of space so they're hard to read (input from someone else)
  • on welcome screen, excerpt reads "create a incoming webhook..." should be "an"

User ID bug in comments integration

From Sean:

Got this notice when submitting vendor feedback (Reviews + FES): https://cl.ly/0D170U2w0131

Notice: Undefined index: user_ID in /Applications/MAMP/htdocs/edd/wp-content/plugins/edd-slack/core/integrations/edd-comments/class-edd-slack-comments.php on line 128

I dumped $commentdata and it looks like the user ID key used for the vendor feedback comment type is user_id instead of user_ID. That fixed the notice for me.

Notification status indicator

Joel put a feature like this in Client Dash for menus and maybe something else. Basically for all the notifications it might be a nice visual addition to include green and red indicators on each to show whether they're active or not. Right now you can save notifications that, if no trigger is selected, will not actually do anything. But you have to open them to figure that out.

I'm not positive about this but I think some visual indicator by either separating those that are on from those that are off or having some element or fading the colors on the inactive ones or something might be nice. If we do that, a separate issue later on might be introducing quick on/off switches.

Alternate UI for notifications

Got some feedback regarding the notifications UI:

It's a bit slower in terms of making changes, but could the add/edit view for notifications be a separate screen like they are in Software Licensing and Recurring?
Pippin Williamson

They threw me off a bit too. Just he page reaction when one is expanded/collapsed.
Sean Davis

Another option would be a modal that pops up
A modal would leave you on the screen without shifting all the page elements
Pippin Williamson

Basically the feedback I was getting is that the accordions might not be a great experience. Some other EDD extensions load their form in another page. Or it could be in a modal that pops up so the list of created notifications is really concise while the modal form doesn't disrupt the page.

What do you think? The more I think about it, the more I agree that a modal would be a very pleasant experience.

Potential Multisite Issues with Interactive Buttons and Slash Commands

It works on rbmtest just fine, but when running the code on Real Big Plugins the WP REST API endpoints simply don't appear.

Real Big Plugins is currently running v1 of the WP REST API as the feature plugin and deactivating that or updating it to v2 does not seem to fix things. In fact, if the feature plugin is disabled /wp-json doesn't even work which is odd considering that the site is at WP 4.6.1.

It is possible this is localized to Real Big Plugins (Which would be unfortunate) but at least then it wouldn't be an issue with the code.

%payment_link% appears Broken

URL is too encoded I guess

New Purchase Made by Jun Loayza
Purchase Complete
• LearnDash – Slack
    • Single Site License - $29.00


Discount Code Used: No Discount Code Applied
Total: $29.00

<https%3A%2F%2Frealbigplugins.com%2Fwp-admin%2Fedit.php%3Fpost_type%3Ddownload%26page%3Dedd-payment-history%26view%3Dview-order-details%26id%3D1974|View Payment Details>

Response Buttons for Bookings

(not possible yet since booking management is still on their roadmap, but it will be way cool once they finish it)

Enable slash commands

Holy Keewana Peninsula Batman! This would be a freaking legit feature!

https://api.slack.com/slash-commands

We should totally expand the scope of this extension to include slash commands. How I see it, users would have a settings interface (just more fields on this plugin's existing page) where they could input the token and...whatever else. Then they could enable custom slash commands on their Slack team account and paste in the URL which this plugin gives them. Something like https://realbigplugins.com/?edd-slack or whatever.

Then they can have whatever slash commands we enable. Or something like that. I'd say let's maybe create a test command and make separate issues for individual commands we wish to add.

To pursue this we'll need to investigate the difference between creating a custom slash command and publishing an official EDD Slack app on that marketplace. Not sure which makes more sense. I'm just guessing but I think if we made an official EDD Slack app then some of the setup would be simplified for site owners. Either way, they'd be required to have SSL and the plugin.

Excited about this possibility. Certainly complicates the plugin a bit but also would make it vastly superior to the various free EDD Slack plugins out there to the point where a premium price is justified.

Inline oauth message

When hitting the Link Slack App button on the RBP site, I'm given the following message:

OAuth Error: redirect_uri did not match any configured URIs.

Passed URI : https://realbigplugins.com/wp-admin/edit.php?post_type=download&page=edd-settings&tab=extensions&section=edd-slack-settings
Allowed URI : https://dev.realbigplugins.com/wp-admin/edit.php?post_type=download&page=edd-settings&tab=extensions&section=edd-slack-settings

Which is fine, this isn't about the error. Just can we possibly load this without navigating to a new page with no way to go back? I hit the button and got a white page with this text. Would be awesome to just load our failure/success message inline on the settings page or something.

IP address results in an error

Getting closer than ever but hit this. Upon hitting the purchase button with some notifications configured that included the IP address as a merge tag, I get a page of PHP errors:

Notice: Undefined index: ip_address in /Users/kylemaurer/Documents/Websites/temp.dev/wp-content/plugins/edd-slack/core/slack/class-edd-slack-notification-integration.php on line 208
Notice: Undefined index: ip_address in /Users/kylemaurer/Documents/Websites/temp.dev/wp-content/plugins/edd-slack/core/slack/class-edd-slack-notification-integration.php on line 208
Warning: Cannot modify header information - headers already sent by (output started at /Users/kylemaurer/Documents/Websites/temp.dev/wp-content/plugins/edd-slack/core/slack/class-edd-slack-notification-integration.php:208) in /Users/kylemaurer/Documents/Websites/temp.dev/wp-includes/pluggable.php on line 1179

Welcome Page

This would be really neat and help with #20. @joelworsham set something like this up for LearnDash Gradebook which I think really helped make sense of all of its options.

EDD Slack only has the one screen for its Settings, but there's a fair amount of them in the case of SSL-enabled sites.

EDD FES Customized Forms don't always pass into Slack well

EDD FES lets the User customize their Forms:

image

EDD Slack currently grabs each Field by Key from the Form for both the Vendor Registration and Vendor Contact Forms and uses those for the Merge Tags. However, some fields (Like variable pricing) are not a simple, flat Key=>Value relationship so it tries to pass an Array or something that Slack cannot interpret.

We will likely need to create special conditions for each non-standard Field Type.

Notification System

The Repeater is in a very nice state right now and changes are now even between EDD-Slack and EDD-Fields.

I've been tearing through PSP-Slack and Project Panorama to determine how PSP-Slack works. So far I've determined this much:

  • Hidden Post Types for each Notification Type (Generated via a Filter)
  • Special instance of the psp_repeater specific to the Notifications Tab that includes all the Notification Triggers in a <select> by default
  • Posts created/updated/deleted for each Notification in the Repeater Feed, with each Field being Post Meta
  • psp_notifications_replacements() returns replacement info for things like %project_title% within the Notification Body with the ability to add more replacements via Filter
  • Hook psp_notify that is fired on different Actions (Such as comment_post) that passes its Notification Trigger as well as extra data.
  • Hook psp_notify_$type that fires on psp_notify which calls the function psp_notifications_do_notifcation().
  • psp_notifications_do_notification() fires the psp_do_notification_$notification_ID Action which allows your custom Notification to run based on all the parameters that have been passed Hook to Hook.

Since Project Panorama was extended with its new Email Notification System and PSP-Slack in mind, this has worked out very well. This also led to it being very flexible in ways that we may not entirely need (Since this plugin is more about Slack Notifications rather than Notifications in general).

As @joelworsham mentioned in a past Dev Meeting, this functionality can be condensed down to be included within an addon plugin such as this one rather than being PR'd into a parent codebase.

However, would it make more sense to do a PR? While this could potentially delay the release of this plugin further (As it would end up being a pretty big PR functionality-wise adding in an extensible Notification System like PSP's) it would arguably be a very good addition to EDD.

Pinging @brashrebel as well since I'd like his input on this too.

FES related notices when selecting a notification

Notice: Undefined property: FES_Post_Title_Field::$help in /Applications/MAMP/htdocs/edd/wp-content/plugins/edd-slack/core/integrations/edd-frontend-submissions/class-edd-slack-frontend-submissions.php on line 334

Notice: Undefined property: FES_Post_Content_Field::$help in /Applications/MAMP/htdocs/edd/wp-content/plugins/edd-slack/core/integrations/edd-frontend-submissions/class-edd-slack-frontend-submissions.php on line 334

Notice: Undefined property: FES_File_Upload_Field::$help in /Applications/MAMP/htdocs/edd/wp-content/plugins/edd-slack/core/integrations/edd-frontend-submissions/class-edd-slack-frontend-submissions.php on line 334

Notice: Undefined property: FES_Multiple_Pricing_Field::$help in /Applications/MAMP/htdocs/edd/wp-content/plugins/edd-slack/core/integrations/edd-frontend-submissions/class-edd-slack-frontend-submissions.php on line 334

Notice: Undefined property: FES_Name_Field::$help in /Applications/MAMP/htdocs/edd/wp-content/plugins/edd-slack/core/integrations/edd-frontend-submissions/class-edd-slack-frontend-submissions.php on line 334

Notice: Undefined property: FES_Email_Field::$help in /Applications/MAMP/htdocs/edd/wp-content/plugins/edd-slack/core/integrations/edd-frontend-submissions/class-edd-slack-frontend-submissions.php on line 334

Notice: Undefined property: FES_Textarea_Field::$help in /Applications/MAMP/htdocs/edd/wp-content/plugins/edd-slack/core/integrations/edd-frontend-submissions/class-edd-slack-frontend-submissions.php on line 334

Notice: Undefined property: FES_Recaptcha_Field::$help in /Applications/MAMP/htdocs/edd/wp-content/plugins/edd-slack/core/integrations/edd-frontend-submissions/class-edd-slack-frontend-submissions.php on line 334

Reported by someone else running 2.4.5 of FES with it active. After opening the modal, the errors are displayed in the modal.

Version bump and docs links

Don't do this yet! But once this has been reviewed, the logo and product page are done and the docs have been moved to EDD Help Scout pages, we will bump version to 1.0 and also change the inline links to docs so they point to the right place.

Sticky Submit Button for the Modal Form

The Alternate UI in #28 is shaping up and @joelworsham mentioned the possibility to have the Submit button for creating new Notifications within the Modal to be sticky along the bottom so that it was never out of sight.

I think it is a good idea, but I'm thinking it is best to push it off to v1.1 at this point.

Multi-Select for Downloads Field

This way the User does not have to make Multiple Triggers to watch maybe 2 or 3 Downloads if they don't want to.

Could be good to have for the Discount Code field as well. This is going to be its own Issue. Forgot I put this here and Multi-Select for Downloads was enough of a chore to implement 🤐

Enforce Minimum Versions

Minimum EDD Version: 2.6.11
Minimum WP Version: 4.4

Should we also try to check for Integration Versions?

Field validation not working in Safari

If I try to save a notification with empty required fields in Chrome, I get a little field notice telling me to fill in the field. But in Safari nothing happens at all. Clicking Save just does nothing. Modal stays open, nothing moves or appears at all.

Can't save notification at all in Safari

I've filled out all the fields for a notification in Safari. Without validation I can't be positive I don't have one wrong but I think I do. Anyway, hitting Save doesn't do anything still. Modal stays open.

Commissions integration: Allow users to setup their own notifications

Crazy but neat idea. The EDD Commissions extension currently sends an email to the user assigned to receive commissions on a download when it is purchased. Admins can customize the email in the settings.

But in awesome world, the commission recipients could optionally get those alerts in Slack in addition to or instead of email. This would require some setting for enabling the option and then probably a profile field where commission recipients could input their own webhook URL and possibly configure the contents of the alert. Maybe configuring the message would be a later feature and the admin would configure it globally thereby only requiring the webhook URL for recipients.

As an example, whenever one of our EDD extensions sells, I get an email. It would be awesome if I could get those in Slack form instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.