PluginProbe ʕ •ᴥ•ʔ
WP Chat App / 3.8.2
WP Chat App v3.8.2
3.8.1 3.8.2 trunk 2.6 3.4 3.4.1 3.4.2 3.4.4 3.4.5 3.4.6 3.5 3.6 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.6.9 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0
wp-whatsapp / includes / Fields.php
wp-whatsapp / includes Last commit date
Support 2 months ago Cross.php 2 months ago Fallback.php 2 months ago Fields.php 2 months ago Helper.php 2 months ago I18n.php 2 months ago Plugin.php 2 months ago Popup.php 2 months ago PostType.php 2 months ago Review.php 2 months ago Settings.php 2 months ago Shortcode.php 2 months ago Upgrade.php 2 months ago
Fields.php
146 lines
1 <?php
2
3 namespace NTA_WhatsApp;
4
5 defined( 'ABSPATH' ) || exit;
6
7 class Fields {
8
9 protected static $instance = null;
10
11 public static function getInstance() {
12 if ( null === self::$instance ) {
13 self::$instance = new self();
14 }
15 return self::$instance;
16 }
17
18 public function __construct() {
19 }
20
21 public static function getButtonStyles( $postId ) {
22 $meta = get_post_meta( $postId, 'nta_wa_button_styles', true );
23 return wp_parse_args(
24 $meta === false ? array() : $meta,
25 array(
26 'type' => 'round',
27 'backgroundColor' => '#2DB742',
28 'textColor' => '#fff',
29 'label' => __( 'Need Help? Chat with us', 'wp-whatsapp' ),
30 'width' => 300,
31 'height' => 64,
32 )
33 );
34 }
35
36
37 public static function getWidgetDisplay() {
38 return wp_parse_args(
39 get_option( 'nta_wa_widget_display', array() ),
40 array(
41 'displayCondition' => 'showAllPage',
42 'includePages' => array(),
43 'excludePages' => array(),
44 'includePosts' => array(),
45 'showOnDesktop' => 'ON',
46 'showOnMobile' => 'ON',
47 'time_symbols' => 'h:m',
48 )
49 );
50 }
51
52 public static function getURLSettings() {
53 return wp_parse_args(
54 get_option( 'nta_wa_url', array() ),
55 array(
56 'onDesktop' => 'api',
57 'onMobile' => 'api',
58 'openInNewTab' => 'ON',
59 )
60 );
61 }
62
63 public static function getUserRoleSettings() {
64 return wp_parse_args(
65 get_option( 'nta_wa_user_role', array() ),
66 array(
67 'administrator' => true,
68 )
69 );
70 }
71
72 public static function getWidgetStyles() {
73 return wp_parse_args(
74 get_option( 'nta_wa_widget_styles', array() ),
75 array(
76 'title' => __( 'Start a Conversation', 'wp-whatsapp' ),
77 'responseText' => __( 'The team typically replies in a few minutes.', 'wp-whatsapp' ),
78 'description' => __( 'Hi! Click one of our member below to chat on <strong>WhatsApp</strong>', 'wp-whatsapp' ),
79 'backgroundColor' => '#2db742',
80 'textColor' => '#fff',
81 'titleSize' => 18,
82 'accountNameSize' => 14,
83 'descriptionTextSize' => 12,
84 'regularTextSize' => 11,
85 'scrollHeight' => 500,
86 'isShowScroll' => 'OFF',
87 'isShowResponseText' => 'ON',
88 'btnLabel' => __( 'Need Help? <strong>Chat with us</strong>', 'wp-whatsapp' ),
89 'btnLabelWidth' => 156,
90 'btnPosition' => 'right',
91 'btnLeftDistance' => 30,
92 'btnRightDistance' => 30,
93 'btnBottomDistance' => 30,
94 'isShowBtnLabel' => 'ON',
95
96 'isShowGDPR' => 'OFF',
97 'gdprContent' => __( 'Please accept our <a href="https://ninjateam.org/privacy-policy/">privacy policy</a> first to start a conversation.', 'wp-whatsapp' ),
98 )
99 );
100 }
101
102 public static function getWoocommerceSetting() {
103 $option = get_option( 'nta_wa_woocommerce', array() );
104 return wp_parse_args(
105 $option,
106 array(
107 'position' => 'after_atc',
108 'isShow' => 'OFF',
109 )
110 );
111 }
112
113 public static function getAnalyticsSetting() {
114 return array(
115 'enabledGoogle' => 'OFF',
116 'enabledFacebook' => 'OFF',
117 'enabledGoogleGA4' => 'OFF',
118 );
119 }
120
121 public static function getDefaultMetaAccount( $daysOfWeek ) {
122 $meta = array(
123 'number' => '',
124 'title' => '',
125 'predefinedText' => '',
126 'willBeBackText' => __( 'I will be back in [njwa_time_work]', 'wp-whatsapp' ),
127 'dayOffsText' => __( 'I will be back soon', 'wp-whatsapp' ),
128 'isAlwaysAvailable' => 'ON',
129 );
130
131 foreach ( $daysOfWeek as $dayKey ) {
132 $meta['daysOfWeekWorking'][ $dayKey ] = array(
133 'isWorkingOnDay' => 'OFF',
134 'workHours' => array(
135 array(
136 'startTime' => '08:00',
137 'endTime' => '17:30',
138 ),
139 ),
140 );
141 }
142
143 return $meta;
144 }
145 }
146