├── .github ├── ISSUE_TEMPLATE │ ├── ask-question.yml │ ├── bug-report.yml │ └── general-feedback.yml ├── os_probot_metadata.js ├── release-drafter.yml ├── set_response_times.js └── workflows │ ├── Zapier.yml │ ├── project.yml │ ├── release-drafter.yml │ └── set_response_time.yml ├── .gitignore ├── README.md ├── build_release.sh ├── onesignal.php ├── readme.txt ├── sdk_files ├── OneSignalSDKWorker.js ├── OneSignalSDKWorker.js.php ├── amp-helper-frame.html ├── amp-permission-dialog.html ├── index.html └── push │ └── onesignal │ └── index.html ├── v2 ├── .env ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── PluginDevDockerUsage.md ├── build_release.sh ├── complete-migration.php ├── configuration-export.php ├── css │ └── onsignal-amp-style.css ├── docker-compose.yml ├── docker-instance-files │ └── uploads.ini ├── docker.sh ├── index.php ├── notice.js ├── onesignal-admin.php ├── onesignal-public.php ├── onesignal-settings.php ├── onesignal-utils.php ├── onesignal-widget.php └── views │ ├── config.php │ ├── css │ ├── callout.css │ ├── callout.scss │ ├── icons.css │ ├── icons.scss │ ├── link.css │ ├── link.scss │ ├── lusitana.css │ ├── lusitana.scss │ ├── lusitana │ │ ├── Lusitana-Bold-OTF.ttf │ │ ├── Lusitana-BoldItalic-OTF.ttf │ │ ├── Lusitana-Italic-OTF.ttf │ │ └── Lusitana-Regular-OTF.ttf │ ├── onesignal-font.scss │ ├── onesignal-font │ │ ├── OneSignal.eot │ │ ├── OneSignal.svg │ │ ├── OneSignal.ttf │ │ └── OneSignal.woff │ ├── onesignal-menu-styles.css │ ├── onesignal-menu-styles.scss │ ├── semantic-ui.css │ ├── semantic-ui.scss │ ├── semantic-ui │ │ ├── collections │ │ │ ├── _all.scss │ │ │ ├── _breadcrumb.scss │ │ │ ├── _form.scss │ │ │ ├── _grid.scss │ │ │ ├── _menu.scss │ │ │ ├── _message.scss │ │ │ └── _table.scss │ │ ├── elements │ │ │ ├── _all.scss │ │ │ ├── _button.scss │ │ │ ├── _container.scss │ │ │ ├── _divider.scss │ │ │ ├── _flag.scss │ │ │ ├── _header.scss │ │ │ ├── _icon.scss │ │ │ ├── _image.scss │ │ │ ├── _input.scss │ │ │ ├── _label.scss │ │ │ ├── _list.scss │ │ │ ├── _loader.scss │ │ │ ├── _rail.scss │ │ │ ├── _reveal.scss │ │ │ ├── _segment.scss │ │ │ └── _step.scss │ │ ├── globals │ │ │ ├── _all.scss │ │ │ ├── _reset.scss │ │ │ └── _site.scss │ │ ├── modules │ │ │ ├── _accordion.scss │ │ │ ├── _all.scss │ │ │ ├── _checkbox.scss │ │ │ ├── _dimmer.scss │ │ │ ├── _dropdown.scss │ │ │ ├── _embed.scss │ │ │ ├── _modal.scss │ │ │ ├── _nag.scss │ │ │ ├── _popup.scss │ │ │ ├── _progress.scss │ │ │ ├── _rating.scss │ │ │ ├── _search.scss │ │ │ ├── _shape.scss │ │ │ ├── _sidebar.scss │ │ │ ├── _sticky.scss │ │ │ ├── _tab.scss │ │ │ ├── _transition.scss │ │ │ └── _video.scss │ │ └── views │ │ │ ├── _ad.scss │ │ │ ├── _all.scss │ │ │ ├── _card.scss │ │ │ ├── _comment.scss │ │ │ ├── _feed.scss │ │ │ ├── _item.scss │ │ │ └── _statistic.scss │ ├── site.css │ └── site.scss │ ├── fonts │ └── semantic-ui │ │ ├── icons.eot │ │ ├── icons.otf │ │ ├── icons.svg │ │ ├── icons.ttf │ │ ├── icons.woff │ │ └── icons.woff2 │ ├── images │ ├── SampleNotification.png │ ├── bell-prenotify.jpg │ ├── bell.jpg │ └── settings │ │ ├── SafariRequiredSettings.png │ │ ├── SafariWebId.png │ │ ├── SampleNotification.png │ │ ├── app_id-1.jpg │ │ ├── chrome-http.jpg │ │ ├── chrome-https.jpg │ │ ├── chrome-push.jpg │ │ ├── chrome-push.png │ │ ├── create-1.jpg │ │ ├── create-10.jpg │ │ ├── create-2.jpg │ │ ├── create-3.jpg │ │ ├── create-4.jpg │ │ ├── create-5.jpg │ │ ├── create-6.jpg │ │ ├── create-7a.jpg │ │ ├── create-7b.jpg │ │ ├── create-8.jpg │ │ ├── create-9.jpg │ │ ├── firefox-1.jpg │ │ ├── firefox-http.jpg │ │ ├── firefox-https.jpg │ │ ├── firefox-push.jpg │ │ ├── firefox-push.png │ │ ├── gcm-1-2.jpg │ │ ├── gcm-1.jpg │ │ ├── gcm-10.jpg │ │ ├── gcm-11.jpg │ │ ├── gcm-12.jpg │ │ ├── gcm-2.jpg │ │ ├── gcm-3-1.jpg │ │ ├── gcm-3.jpg │ │ ├── gcm-4.jpg │ │ ├── gcm-5.jpg │ │ ├── gcm-6.jpg │ │ ├── gcm-7.jpg │ │ ├── gcm-8.jpg │ │ ├── gcm-9.jpg │ │ ├── http-permission-request-post-modal.png │ │ ├── http-prompt.jpg │ │ ├── http-prompt.png │ │ ├── https-prompt.png │ │ ├── https-url.png │ │ ├── keys-1.jpg │ │ ├── keys-2.jpg │ │ ├── keys-2b.jpg │ │ ├── keys-2c.jpg │ │ ├── keys-3.jpg │ │ ├── nb-unsubscribe.png │ │ ├── notify-button.jpg │ │ ├── safari-1.jpg │ │ ├── safari-2.jpg │ │ ├── safari-3.jpg │ │ ├── safari-4.jpg │ │ ├── safari-https.jpg │ │ ├── safari-prompt.jpg │ │ ├── safari-push.jpg │ │ ├── safari-push.png │ │ ├── test.jpg │ │ ├── web-push.jpg │ │ ├── welcome-notification.jpg │ │ └── widget.jpg │ ├── index.html │ └── javascript │ ├── semantic-ui.js │ └── site-admin.js └── v3 ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── build_release.sh ├── index.php ├── onesignal-admin ├── images │ └── onesignal.svg ├── onesignal-admin.css ├── onesignal-admin.js └── onesignal-admin.php ├── onesignal-helpers.php ├── onesignal-init.php ├── onesignal-metabox ├── onesignal-metabox.css ├── onesignal-metabox.js └── onesignal-metabox.php └── onesignal-notification.php /.github/ISSUE_TEMPLATE/ask-question.yml: -------------------------------------------------------------------------------- 1 | name: 🙋 Ask a question 2 | description: Tell us what's on your mind 3 | title: "[question]: " 4 | labels: ["Question"] 5 | 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: | 10 | Having issues integrating the plugin? 11 | - type: textarea 12 | id: question 13 | attributes: 14 | label: How can we help? 15 | description: Specific question regarding integrating this plugin. 16 | placeholder: How do I...? 17 | validations: 18 | required: true 19 | - type: checkboxes 20 | id: terms 21 | attributes: 22 | label: Code of Conduct 23 | description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/OneSignal-WordPress-Plugin/blob/main/CONTRIBUTING.md) 24 | options: 25 | - label: I agree to follow this project's Code of Conduct 26 | required: true 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.yml: -------------------------------------------------------------------------------- 1 | name: 🪳 Bug report 2 | description: File a bug report 3 | title: "[Bug]: " 4 | labels: ["Bug"] 5 | 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: | 10 | Thanks for taking the time to fill out this bug report! 11 | - type: textarea 12 | id: what-happened 13 | attributes: 14 | label: What happened? 15 | description: Provide a thorough description of whats going on. 16 | placeholder: The latest version of the plugin causes a runtime error. 17 | validations: 18 | required: true 19 | - type: input 20 | id: wp-version 21 | attributes: 22 | label: Wordpress version 23 | description: What version of Wordpress are you running? 24 | placeholder: 6.0.2 25 | validations: 26 | required: true 27 | - type: input 28 | id: plugin-version 29 | attributes: 30 | label: OneSignal Plugin version 31 | description: What version of the plugin are you running? 32 | placeholder: 2.2.7 33 | validations: 34 | required: true 35 | - type: textarea 36 | id: reproduction-steps 37 | attributes: 38 | label: Steps to reproduce? 39 | description: Provide as much detail as posible to reproduce the issue. 40 | placeholder: | 41 | 1. Install and set up the plugin (version X.Y.Z), etc... 42 | 2. Visit website 43 | 3. Click on the notification prompt 44 | 4. Note that this causes a runtime error and a failed subscription. 45 | render: Markdown 46 | validations: 47 | required: true 48 | - type: textarea 49 | id: what-are-expectations 50 | attributes: 51 | label: What did you expect to happen? 52 | description: Also tell us, what did you expect to happen? 53 | placeholder: I expected the notification prompt to cause a native permission change in the browser. 54 | validations: 55 | required: true 56 | - type: textarea 57 | id: logs 58 | attributes: 59 | label: Relevant log output 60 | description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. 61 | render: Shell 62 | - type: checkboxes 63 | id: terms 64 | attributes: 65 | label: Code of Conduct 66 | description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/OneSignal-WordPress-Plugin/blob/main/CONTRIBUTING.md) 67 | options: 68 | - label: I agree to follow this project's Code of Conduct 69 | required: true 70 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/general-feedback.yml: -------------------------------------------------------------------------------- 1 | name: 📣 General feedback 2 | description: Tell us what's on your mind 3 | title: "[Feedback]: " 4 | labels: ["Feedback"] 5 | 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: | 10 | Thanks for sharing your valuable feedback! 11 | - type: textarea 12 | id: feedback 13 | attributes: 14 | label: What's on your mind? 15 | description: Feedback regarding this SDK. 16 | placeholder: Share your feedback... 17 | validations: 18 | required: true 19 | - type: checkboxes 20 | id: terms 21 | attributes: 22 | label: Code of Conduct 23 | description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/OneSignal-WordPress-Plugin/blob/main/CONTRIBUTING.md) 24 | options: 25 | - label: I agree to follow this project's Code of Conduct 26 | required: true 27 | -------------------------------------------------------------------------------- /.github/os_probot_metadata.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Based on probot-metadata - https://github.com/probot/metadata 3 | */ 4 | const regex = /\n\n/ 5 | 6 | const { Octokit } = require("@octokit/action") 7 | 8 | const octokit = new Octokit() 9 | 10 | module.exports = (context, issue = null) => { 11 | console.log(context) 12 | const prefix = "onesignal-probot" 13 | 14 | if (!issue) issue = context.payload.issue 15 | 16 | return { 17 | async get (key = null) { 18 | let body = issue.body 19 | 20 | if (!body) { 21 | body = (await octokit.issues.get(issue)).data.body || '' 22 | } 23 | 24 | const match = body.match(regex) 25 | 26 | if (match) { 27 | const data = JSON.parse(match[1])[prefix] 28 | return key ? data && data[key] : data 29 | } 30 | }, 31 | 32 | async set (key, value) { 33 | let body = issue.body 34 | let data = {} 35 | 36 | if (!body) body = (await octokit.issues.get(issue)).data.body || '' 37 | 38 | body = body.replace(regex, (_, json) => { 39 | data = JSON.parse(json) 40 | return '' 41 | }) 42 | 43 | if (!data[prefix]) data[prefix] = {} 44 | 45 | if (typeof key === 'object') { 46 | Object.assign(data[prefix], key) 47 | } else { 48 | data[prefix][key] = value 49 | } 50 | 51 | body = `${body}\n\n` 52 | 53 | const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/") 54 | const issue_number = context.payload.issue.number 55 | return octokit.issues.update({ owner, repo, issue_number, body }) 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name-template: $RESOLVED_VERSION 2 | tag-template: $RESOLVED_VERSION 3 | categories: 4 | - title: 🚀 Features 5 | label: Enhancement / Feature 6 | - title: 🐛 Bug Fixes 7 | label: Bug 8 | - title: 🧰 Improvements 9 | label: Improvement 10 | - title: down arrow Dependency Updates 11 | label: Dependencies 12 | change-template: '- $TITLE (#$NUMBER)' 13 | version-resolver: 14 | major: 15 | labels: 16 | - 'major' 17 | minor: 18 | labels: 19 | - 'minor' 20 | patch: 21 | labels: 22 | - 'patch' 23 | default: patch 24 | template: | 25 | ## Other Changes 26 | 27 | $CHANGES 28 | -------------------------------------------------------------------------------- /.github/set_response_times.js: -------------------------------------------------------------------------------- 1 | function calcResponseTimeForIssueCreatedAt(createdAt) { 2 | const issueOpenedDate = new Date(createdAt); 3 | const issueTriagedDate = new Date(); 4 | const businessDaysResponseTime = calcBusinessDaysBetweenDates(issueOpenedDate, issueTriagedDate); 5 | return businessDaysResponseTime; 6 | } 7 | 8 | function calcBusinessDaysBetweenDates(openedDate, triagedDate) { 9 | let differenceInWeeks, responseTime; 10 | if (triagedDate < openedDate) 11 | return -1; // error code if dates transposed 12 | let openedDay = openedDate.getDay(); // day of week 13 | let triagedDay = triagedDate.getDay(); 14 | openedDay = (openedDay == 0) ? 7 : openedDay; // change Sunday from 0 to 7 15 | triagedDay = (triagedDay == 0) ? 7 : triagedDay; 16 | openedDay = (openedDay > 5) ? 5 : openedDay; // only count weekdays 17 | triagedDay = (triagedDay > 5) ? 5 : triagedDay; 18 | // calculate differnece in weeks (1000mS * 60sec * 60min * 24hrs * 7 days = 604800000) 19 | differenceInWeeks = Math.floor((triagedDate.getTime() - openedDate.getTime()) / 604800000); 20 | if (openedDay < triagedDay) { //Equal to makes it reduce 5 days 21 | responseTime = (differenceInWeeks * 5) + (triagedDay - openedDay); 22 | } 23 | else if (openedDay == triagedDay) { 24 | responseTime = differenceInWeeks * 5; 25 | } 26 | else { 27 | responseTime = ((differenceInWeeks + 1) * 5) - (openedDay - triagedDay); 28 | } 29 | return (responseTime); 30 | } 31 | 32 | module.exports = async(context, osmetadata) => { 33 | const foundResponseTime = await osmetadata(context).get('response_time_in_business_days'); 34 | if (foundResponseTime) { 35 | const foundString = "already found response time in business days: " + foundResponseTime 36 | console.log(foundString); 37 | return foundString; 38 | } 39 | if (context.payload.comment && context.payload.comment.author_association != "MEMBER" && context.payload.comment.author_association != "OWNER" && context.payload.comment.author_association != "CONTRIBUTOR") { 40 | return; 41 | } 42 | const businessDaysResponseTime = calcResponseTimeForIssueCreatedAt(context.payload.issue.created_at); 43 | console.log("response time in business days: " + businessDaysResponseTime); 44 | const result = osmetadata(context, context.payload.issue).set('response_time_in_business_days', businessDaysResponseTime) 45 | console.log("osmetadata update result: " + result); 46 | return "set response time in business days: " + businessDaysResponseTime; 47 | } 48 | -------------------------------------------------------------------------------- /.github/workflows/Zapier.yml: -------------------------------------------------------------------------------- 1 | # This is an action to close asana tasks that were generated by Github issues 2 | 3 | name: Zapier web hook 4 | 5 | # Controls when the workflow will run 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the "main" branch 8 | issues: 9 | types: [closed] 10 | 11 | permissions: 12 | issues: read 13 | 14 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 15 | jobs: 16 | # This workflow contains a single job called "build" 17 | build: 18 | # The type of runner that the job will run on 19 | runs-on: ubuntu-latest 20 | 21 | # Steps represent a sequence of tasks that will be executed as part of the job 22 | steps: 23 | # Runs a set of commands using the runners shell 24 | - name: Call Zapier web hook to close Asana task 25 | if: ${{ !github.event.issue.pull_request }} 26 | env: 27 | ISSUE_TITLE: ${{ github.event.issue.title }} 28 | run: | 29 | curl --location --request POST 'https://hooks.zapier.com/hooks/catch/12728683/b7009qc/' \ 30 | --header 'Content-Type: application/json' \ 31 | --header 'Accept: application/json' \ 32 | --data-raw '{ 33 | "task_name" : "$ISSUE_TITLE" 34 | }' 35 | -------------------------------------------------------------------------------- /.github/workflows/project.yml: -------------------------------------------------------------------------------- 1 | name: Add issues to project 2 | 3 | on: 4 | issues: 5 | types: 6 | - opened 7 | 8 | jobs: 9 | add-to-project: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Add issue to project 13 | uses: actions/add-to-project@v1.0.2 14 | with: 15 | # SDK Web Project 16 | project-url: https://github.com/orgs/OneSignal/projects/9 17 | github-token: ${{ secrets.GH_PROJECTS_TOKEN }} 18 | -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name: Release Drafter 2 | 3 | on: 4 | push: 5 | # branches to consider in the event; optional, defaults to all 6 | branches: 7 | - main 8 | # pull_request event is required only for autolabeler 9 | pull_request: 10 | # Only following types are handled by the action, but one can default to all as well 11 | types: [opened, reopened, synchronize] 12 | # pull_request_target event is required for autolabeler to support PRs from forks 13 | # pull_request_target: 14 | # types: [opened, reopened, synchronize] 15 | 16 | permissions: 17 | contents: read 18 | 19 | jobs: 20 | update_release_draft: 21 | permissions: 22 | # write permission is required to create a github release 23 | contents: write 24 | # write permission is required for autolabeler 25 | # otherwise, read permission is required at least 26 | pull-requests: write 27 | runs-on: ubuntu-latest 28 | steps: 29 | # (Optional) GitHub Enterprise requires GHE_HOST variable set 30 | #- name: Set GHE_HOST 31 | # run: | 32 | # echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV 33 | 34 | # Drafts your next Release notes as Pull Requests are merged into "master" 35 | - uses: release-drafter/release-drafter@v5 36 | # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml 37 | # with: 38 | # config-name: my-config.yml 39 | # disable-autolabeler: true 40 | env: 41 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 42 | -------------------------------------------------------------------------------- /.github/workflows/set_response_time.yml: -------------------------------------------------------------------------------- 1 | name: Set Response Time 2 | on: 3 | issue_comment: 4 | types: 5 | - created 6 | issues: 7 | types: 8 | - closed 9 | jobs: 10 | calculate: 11 | name: set reponse time for the issue 12 | if: github.event.issue.pull_request == null 13 | runs-on: ubuntu-latest 14 | permissions: 15 | issues: write 16 | steps: 17 | - uses: actions/checkout@v3 18 | with: 19 | token: ${{ secrets.GITHUB_TOKEN }} 20 | - run: npm install @octokit/action 21 | - uses: actions/github-script@v6 22 | id: set-time 23 | with: 24 | result-encoding: string 25 | script: | 26 | const os_probot_metadata = require('./.github/os_probot_metadata.js') 27 | const set_response_time = require('./.github/set_response_times.js') 28 | return await set_response_time(context, os_probot_metadata) 29 | env: 30 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 31 | - name: Get result 32 | run: echo "${{steps.set-time.outputs.result}}" >> $GITHUB_STEP_SUMMARY 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ChromePhp.php 2 | onesignal-free-web-push-notifications.zip 3 | views/images/settings/ParseToOneSignal.png 4 | .vscode/ 5 | 6 | .map 7 | **/*.map 8 | onesignal-free-push-notifications.zip 9 | 10 | ### JetBrains template 11 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio 12 | 13 | *.iml 14 | 15 | ## Directory-based project format: 16 | .idea/ 17 | # if you remove the above rule, at least ignore the following: 18 | 19 | # User-specific stuff: 20 | # .idea/workspace.xml 21 | # .idea/tasks.xml 22 | # .idea/dictionaries 23 | 24 | # Sensitive or high-churn files: 25 | # .idea/dataSources.ids 26 | # .idea/dataSources.xml 27 | # .idea/sqlDataSources.xml 28 | # .idea/dynamic.xml 29 | # .idea/uiDesigner.xml 30 | 31 | # Gradle: 32 | # .idea/gradle.xml 33 | # .idea/libraries 34 | 35 | # Mongo Explorer plugin: 36 | # .idea/mongoSettings.xml 37 | 38 | ## File-based project format: 39 | *.ipr 40 | *.iws 41 | 42 | ## Plugin-specific files: 43 | 44 | # IntelliJ 45 | /out/ 46 | 47 | # mpeltonen/sbt-idea plugin 48 | .idea_modules/ 49 | 50 | # JIRA plugin 51 | atlassian-ide-plugin.xml 52 | 53 | # Crashlytics plugin (for Android Studio and IntelliJ) 54 | com_crashlytics_export_strings.xml 55 | crashlytics.properties 56 | crashlytics-build.properties 57 | 58 | # Created by .ignore support plugin (hsz.mobi) 59 | 60 | .DS_Store 61 | 62 | onesignal-extra.php 63 | 64 | docker-instance-files/* 65 | # Expection to the rule as we need this files to modify plugin upload limits 66 | !uploads.ini 67 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | OneSignal WordPress Push Notification Plugin 2 | ==================================== 3 | 4 | OneSignal is a push notification service for web and mobile apps. This plugin makes it easy to integrate your WordPress site with OneSignal Push Notifications. 5 | 6 | - Download and install from the [WordPress Plugin Directory](https://wordpress.org/plugins/onesignal-free-web-push-notifications/) -------------------------------------------------------------------------------- /build_release.sh: -------------------------------------------------------------------------------- 1 | WORDPRESS_GIT_SRC_PATH="." 2 | DESTINATION_PATH="../onesignal-free-web-push-notifications/trunk/" 3 | RELEASE_ARCHIVE_FILENAME="onesignal-free-web-push-notifications.zip" 4 | 5 | # Prevent accidental rm -rf issues if running as root 6 | if (( EUID == 0 )); then 7 | echo "Please do not run this script as root for removing directory safety reasons." 8 | exit 1 9 | fi 10 | 11 | # Using exclude .* excludes dot files and dot directories like .git, .vscode 12 | if [[ $DESTINATION_PATH != *onesignal-free-web-push-notifications/trunk/ ]]; then 13 | echo "Script was going to remove ${DESTINATION_PATH}, but quitting because destination path unexpectedly does not end in ...onesignal-free-web-push-notifications/trunk/. Exiting to prevent removing unexpected directory." 14 | exit 1 15 | fi 16 | 17 | echo "Building Release Version of OneSignal WordPress Plugin" 18 | echo "──────────────────────────────────────────────────────" 19 | 20 | echo "Removing destination folder '${DESTINATION_PATH}'." 21 | rm -rf $DESTINATION_PATH 22 | 23 | echo "Creating new empty destination folder '${DESTINATION_PATH}'." 24 | mkdir -p $DESTINATION_PATH 25 | 26 | # The --delete option remove files from destination that are not present in source 27 | exclude_options=( 28 | "--exclude=.git/" 29 | "--exclude=.env" 30 | "--exclude=.gitignore" 31 | "--exclude=.github" 32 | "--exclude=.vscode/" 33 | "--exclude=build_release.sh" 34 | "--exclude=*.zip" 35 | "--exclude=onesignal-free-web-push-notifications" 36 | "--exclude=onesignal-free-web-push-notifications.zip" 37 | "--exclude=CONTRIBUTING.md" 38 | "--exclude=LICENSE" 39 | "--exclude=docker*" 40 | "--exclude=PluginDevDockerUsage.md" 41 | "--exclude=README.md" 42 | "--exclude=index.php" 43 | "--exclude=views/css/*.scss" 44 | "--exclude=views/css/callout.css" 45 | "--exclude=views/css/link.css" 46 | "--exclude=views/css/link.css" 47 | "--exclude=views/css/semantic-ui" 48 | ) 49 | rsync --archive --delete "${exclude_options[@]}" $WORDPRESS_GIT_SRC_PATH/ $DESTINATION_PATH 50 | 51 | # Add new unversioned directories to SVN 52 | svn status $DESTINATION_PATH | grep "^\?" | awk '{print $2}' | xargs -I {} svn add {} 53 | 54 | echo "Creating archive of release contents as '${RELEASE_ARCHIVE_FILENAME}' in source directory '${WORDPRESS_GIT_SRC_PATH}'." 55 | cd $WORDPRESS_GIT_SRC_PATH 56 | zip -qr -x ".*" -x="build_release.sh" -x="*.zip" -x="onesignal-free-web-push-notifications" ${RELEASE_ARCHIVE_FILENAME} ./* 57 | cd - 58 | -------------------------------------------------------------------------------- /onesignal.php: -------------------------------------------------------------------------------- 1 | id === 'plugins') { 71 | echo '
OneSignal Migration Needed: All OneSignal prompt configurations are moving to OneSignal.com. See the plugin page for more info.
73 |