PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / 3.3.3
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar v3.3.3
3.3.3 3.3.2 3.3.1 3.3.0 3.2.14 3.2.13 3.2.12 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 trunk 0.2.5.5 0.2.5.6 0.2.5.7 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 All 158 releases
← All changes | includes/Admin/XSS.php +60 -0 0.2.5.5 → 3.3.3 View file →
@@ -1,0 +1,60 @@
1 +<?php
2 +
3 +/**
4 + * Extension Factory
5 + *
6 + * @package NotificationX\Extensions
7 + */
8 +
9 +namespace NotificationX\Admin;
10 +
11 +use NotificationX\GetInstance;
12 +
13 +/**
14 + * @method static XSS get_instance($args = null)
15 + */
16 +class XSS {
17 + use GetInstance;
18 +
19 + public function __construct() {
20 + add_filter( 'nx_settings', [ $this, 'save_settings' ] );
21 + add_filter( 'nx_settings_tab_miscellaneous', [ $this, 'settings_tab_help' ] );
22 + }
23 +
24 + public function save_settings( $settings ) {
25 + if ( isset( $settings['xss_code'] ) ) {
26 + unset( $settings['xss_code'] );
27 + }
28 + return $settings;
29 + }
30 +
31 +
32 + public function settings_tab_help( $tabs ) {
33 +
34 + $tabs['fields']['xss_settings'] = array(
35 + 'name' => 'xss_settings',
36 + 'type' => 'section',
37 + 'label' => __( 'Cross Domain Notice', 'notificationx' ),
38 + 'priority' => 30,
39 + 'fields' => array(
40 + 'xss_code' => array(
41 + 'name' => 'xss_code',
42 + 'type' => 'codeviewer',
43 + 'label' => __( 'Cross Domain Notice', 'notificationx' ),
44 + 'button_text' => __( 'Click to Copy', 'notificationx' ),
45 + 'success_text' => __( 'Copied to clipboard.', 'notificationx' ),
46 + 'is_pro' => true,
47 + 'copyOnClick' => true,
48 + 'readOnly' => true,
49 + /* translators: %s: Cross Domain Notice link URL */
50 + 'help' => sprintf( __( 'Show your Notification Alerts in another website using <a target="_blank" href="%s">Cross Domain Notice</a>.', 'notificationx' ), 'https://notificationx.com/docs/notificationx-cross-domain-notice/' ),
51 + // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript, WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Default value of a setting shown to the user to copy, not output by the plugin; nx_ is this plugin's established hook prefix.
52 + 'default' => apply_filters( 'nx_settings_xss_code_default', "<div id='notificationx-frontend'></div>\n<script>....</script>\n<script src='....../crossSite.js'></script>" ),
53 + 'priority' => 1,
54 + ),
55 + ),
56 + );
57 +
58 + return $tabs;
59 + }
60 +}