-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #333 from OneSignal/3.0.0
3.0.0
- Loading branch information
Showing
193 changed files
with
1,708 additions
and
306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
importScripts('https://cdn.onesignal.com/sdks/OneSignalSDKWorker.js'); | ||
importScripts("https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.sw.js"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
<?php | ||
/** | ||
* Note: This file is intended to be publicly accessible. | ||
* Reference: https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers | ||
*/ | ||
|
||
header("Service-Worker-Allowed: /"); | ||
header("Content-Type: application/javascript"); | ||
header("X-Robots-Tag: none"); | ||
if (defined('ONESIGNAL_DEBUG') && defined('ONESIGNAL_LOCAL')) { | ||
echo "importScripts('https://localhost:3001/dev_sdks/OneSignalSDK.js');"; | ||
} else { | ||
echo "importScripts('https://cdn.onesignal.com/sdks/OneSignalSDKWorker.js');"; | ||
} | ||
/** | ||
* Note: This file is intended to be publicly accessible. | ||
* Reference: https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers | ||
*/ | ||
|
||
header("Service-Worker-Allowed: /"); | ||
header("Content-Type: application/javascript"); | ||
header("X-Robots-Tag: none"); | ||
echo "importScripts('https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.sw.js');"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
<!-- Prevent search bots from indexing this folder if directory listing is enabled on the server --> | ||
<html><head><meta name="robots" content="noindex, nofollow"></head><body></body></html> | ||
<html> | ||
<head> | ||
<meta name="robots" content="noindex, nofollow" /> | ||
</head> | ||
<body></body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<!-- Prevent search bots from indexing this folder if directory listing is enabled on the server --> | ||
<html><head><meta name="robots" content="noindex, nofollow"></head><body></body></html> | ||
<html><head><meta name="robots" content="noindex, nofollow"></head><body></body></html> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
function onesignal_complete_migration() | ||
{ | ||
if (isset($_POST['plugin_action']) && $_POST['plugin_action'] === 'complete_migration') { | ||
|
||
// Security check | ||
if (!check_admin_referer('onesignal_migration_nonce')) { | ||
wp_die(__('Security check failed', 'onesignal-push')); | ||
} | ||
|
||
// Mark the plugin as migrated | ||
update_option('onesignal_plugin_migrated', true); | ||
|
||
// Provide feedback to the user | ||
wp_redirect(admin_url('admin.php?page=onesignal-admin-page.php')); | ||
exit; | ||
} | ||
} | ||
|
||
add_action('admin_init', 'onesignal_complete_migration'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
function onesignal_handle_export() | ||
{ | ||
if (isset($_POST['plugin_action']) && $_POST['plugin_action'] === 'export_settings') { | ||
|
||
if (!check_admin_referer('onesignal_export_nonce')) { | ||
wp_die(__('Security check failed', 'onesignal-push')); | ||
} | ||
|
||
$settings = get_option('OneSignalWPSetting'); | ||
|
||
// name and define settings groups | ||
$groups = [ | ||
'OneSignal App ID' => '/^app_id/', | ||
'General Options' => '/^(chrome_auto_|persist_|default_|utm_additional_)/', | ||
'Slide Prompt Customizations' => '/^(prompt_customize_|prompt_action_|prompt_accept_|prompt_cancel_|prompt_auto_register)/', | ||
'Subscription Bell Customizations' => '/^notifyButton_/', | ||
'Welcome Notification Customizations' => '/^(send_welcome_|welcome_)/', | ||
'Plugin Settings & HTTP Setup - NO LONGER REQUIRED / DEPRECATED' => '/^(allowed_custom_|customize_http_|custom_manifest_|gcm_|is_site_|notification_on_|notification_title|onesignal_sw_|origin|prompt_auto_accept_title|prompt_example_|prompt_site_name|send_to_mobile_|showNotification|show_gcm_|how_notification_send_|subdomain|use_)/' | ||
]; | ||
|
||
// sort settings into the defined groups | ||
foreach ($settings as $key => $value) { | ||
foreach ($groups as $group_name => $pattern) { | ||
if (preg_match($pattern, $key)) { | ||
$grouped_settings[$group_name][$key] = is_array($value) ? json_encode($value) : $value; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
// create txt file with main title, group names, and settings. | ||
$txt_data = "OneSignal Push Configuration Export\n\n\n"; | ||
|
||
foreach ($groups as $group_name => $pattern) { | ||
if (isset($grouped_settings[$group_name])) { | ||
$txt_data .= "=== $group_name ===\n"; | ||
|
||
foreach ($grouped_settings[$group_name] as $key => $value) { | ||
$txt_data .= "$key: $value\n"; | ||
} | ||
|
||
$txt_data .= "\n\n"; | ||
} | ||
} | ||
|
||
header('Content-Type: text/plain'); | ||
header('Content-Disposition: attachment; filename="onesignal-configuration-export.txt"'); | ||
header('Content-Length: ' . strlen($txt_data)); | ||
header('Pragma: public'); | ||
|
||
echo $txt_data; | ||
exit; | ||
} | ||
} | ||
|
||
add_action('admin_init', 'onesignal_handle_export'); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.