dbManager = $dbManager;
$this->addons = new WpdiscuzAddons($this);
$this->wmuUploadMaxFileSize = $this->getSizeInBytes(ini_get('upload_max_filesize'));
$this->wmuPostMaxSize = $this->getSizeInBytes(ini_get('post_max_size'));
//$this->initAddons();
//$this->initTips();
add_option(self::OPTION_SLUG_HASH_KEY, md5(time() . uniqid()), "", "no");
$this->initPhrases();
$this->addOptions();
$this->initOptions(get_option(self::OPTION_SLUG_OPTIONS));
$this->wp["dateFormat"] = get_option("date_format");
$this->wp["timeFormat"] = get_option("time_format");
$this->wp["threadComments"] = get_option("thread_comments");
$this->wp["threadCommentsDepth"] = get_option("thread_comments_depth");
$this->wp["isPaginate"] = get_option("page_comments");
$wordpressCommentOrder = strtolower(get_option("comment_order"));
$this->wp["commentOrder"] = in_array($wordpressCommentOrder, ["asc", "desc",]) ? $wordpressCommentOrder : "desc";
$this->wp["commentPerPage"] = get_option("comments_per_page");
$this->wp["showAvatars"] = get_option("show_avatars");
$this->wp["defaultCommentsPage"] = get_option("default_comments_page");
$this->general["humanReadableNumbers"] = apply_filters("wpdiscuz_enable_human_readable_numbers", true);
$this->initFormRelations();
$this->initGoodbyeCaptchaField();
add_action("wpdiscuz_init", [&$this, "initPhrasesOnLoad"], 2126);
add_action("admin_init", [&$this, "saveAndResetOptionsAndPhrases"], 1);
add_action("admin_init", [&$this, "exportOptionsOrPhrases"], 1);
add_action("admin_notices", [&$this, "adminNotices"]);
add_action('switch_blog', [$this, "reInitFormOptions"], 10, 3);
}
public function getOptions()
{
$options = $this->toArray();
$optionsWp = ['wp' => $this->wp];
$options = array_merge($options, $optionsWp);
return $options;
}
public function getOption($key, $tab = null)
{
if (!$key) {
return null;
}
$options = $this->getOptions();
if (!is_array($options)) {
return new WP_Error("wpdiscuz_invalid_options", __("wpDiscuz options are invalid", "wpdiscuz"));
}
if ($tab) {
if (array_key_exists($tab, $options) && is_array($options[$tab]) && array_key_exists($key, $options[$tab])) {
return $options[$tab][$key];
}
} else {
foreach ($options as $optionKey => $optionValue) {
if (is_array($optionValue) && array_key_exists($key, $optionValue)) {
return $optionValue[$key];
}
}
}
return new WP_Error("wpdiscuz_option_not_found", __("The option not exists in the wpDiscuz options", "wpdiscuz"));
}
public function initOptions($serialize_options)
{
$options = maybe_unserialize($serialize_options);
$defaultOptions = $this->getDefaultOptions();
/* form */
$this->form["commentFormView"] = isset($options[self::TAB_FORM]["commentFormView"]) ? $options[self::TAB_FORM]["commentFormView"] : $defaultOptions[self::TAB_FORM]["commentFormView"];
$this->form["enableDropAnimation"] = isset($options[self::TAB_FORM]["enableDropAnimation"]) ? $options[self::TAB_FORM]["enableDropAnimation"] : $defaultOptions[self::TAB_FORM]["enableDropAnimation"];
$this->form["richEditor"] = isset($options[self::TAB_FORM]["richEditor"]) ? $options[self::TAB_FORM]["richEditor"] : $defaultOptions[self::TAB_FORM]["richEditor"];
$this->form["boldButton"] = isset($options[self::TAB_FORM]["boldButton"]) ? $options[self::TAB_FORM]["boldButton"] : $defaultOptions[self::TAB_FORM]["boldButton"];
$this->form["italicButton"] = isset($options[self::TAB_FORM]["italicButton"]) ? $options[self::TAB_FORM]["italicButton"] : $defaultOptions[self::TAB_FORM]["italicButton"];
$this->form["underlineButton"] = isset($options[self::TAB_FORM]["underlineButton"]) ? $options[self::TAB_FORM]["underlineButton"] : $defaultOptions[self::TAB_FORM]["underlineButton"];
$this->form["strikeButton"] = isset($options[self::TAB_FORM]["strikeButton"]) ? $options[self::TAB_FORM]["strikeButton"] : $defaultOptions[self::TAB_FORM]["strikeButton"];
$this->form["olButton"] = isset($options[self::TAB_FORM]["olButton"]) ? $options[self::TAB_FORM]["olButton"] : $defaultOptions[self::TAB_FORM]["olButton"];
$this->form["ulButton"] = isset($options[self::TAB_FORM]["ulButton"]) ? $options[self::TAB_FORM]["ulButton"] : $defaultOptions[self::TAB_FORM]["ulButton"];
$this->form["blockquoteButton"] = isset($options[self::TAB_FORM]["blockquoteButton"]) ? $options[self::TAB_FORM]["blockquoteButton"] : $defaultOptions[self::TAB_FORM]["blockquoteButton"];
$this->form["codeblockButton"] = isset($options[self::TAB_FORM]["codeblockButton"]) ? $options[self::TAB_FORM]["codeblockButton"] : $defaultOptions[self::TAB_FORM]["codeblockButton"];
$this->form["linkButton"] = isset($options[self::TAB_FORM]["linkButton"]) ? $options[self::TAB_FORM]["linkButton"] : $defaultOptions[self::TAB_FORM]["linkButton"];
$this->form["sourcecodeButton"] = isset($options[self::TAB_FORM]["sourcecodeButton"]) ? $options[self::TAB_FORM]["sourcecodeButton"] : $defaultOptions[self::TAB_FORM]["sourcecodeButton"];
$this->form["spoilerButton"] = isset($options[self::TAB_FORM]["spoilerButton"]) ? $options[self::TAB_FORM]["spoilerButton"] : $defaultOptions[self::TAB_FORM]["spoilerButton"];
$this->form["enableQuickTags"] = isset($options[self::TAB_FORM]["enableQuickTags"]) ? $options[self::TAB_FORM]["enableQuickTags"] : $defaultOptions[self::TAB_FORM]["enableQuickTags"];
$this->form["commenterNameMinLength"] = isset($options[self::TAB_FORM]["commenterNameMinLength"]) ? $options[self::TAB_FORM]["commenterNameMinLength"] : $defaultOptions[self::TAB_FORM]["commenterNameMinLength"];
$this->form["commenterNameMaxLength"] = isset($options[self::TAB_FORM]["commenterNameMaxLength"]) ? $options[self::TAB_FORM]["commenterNameMaxLength"] : $defaultOptions[self::TAB_FORM]["commenterNameMaxLength"];
$this->form["storeCommenterData"] = isset($options[self::TAB_FORM]["storeCommenterData"]) ? $options[self::TAB_FORM]["storeCommenterData"] : $defaultOptions[self::TAB_FORM]["storeCommenterData"];
/* recaptcha */
$this->recaptcha["version"] = "2.0";
$this->recaptcha["score"] = "";
$this->recaptcha["siteKey"] = isset($options[self::TAB_RECAPTCHA]["siteKey"]) ? $options[self::TAB_RECAPTCHA]["siteKey"] : $defaultOptions[self::TAB_RECAPTCHA]["siteKey"];
$this->recaptcha["secretKey"] = isset($options[self::TAB_RECAPTCHA]["secretKey"]) ? $options[self::TAB_RECAPTCHA]["secretKey"] : $defaultOptions[self::TAB_RECAPTCHA]["secretKey"];
$this->recaptcha["theme"] = isset($options[self::TAB_RECAPTCHA]["theme"]) ? $options[self::TAB_RECAPTCHA]["theme"] : $defaultOptions[self::TAB_RECAPTCHA]["theme"];
$this->recaptcha["lang"] = isset($options[self::TAB_RECAPTCHA]["lang"]) ? $options[self::TAB_RECAPTCHA]["lang"] : $defaultOptions[self::TAB_RECAPTCHA]["lang"];
$this->recaptcha["requestMethod"] = isset($options[self::TAB_RECAPTCHA]["requestMethod"]) ? $options[self::TAB_RECAPTCHA]["requestMethod"] : $defaultOptions[self::TAB_RECAPTCHA]["requestMethod"];
$this->recaptcha["showForGuests"] = isset($options[self::TAB_RECAPTCHA]["showForGuests"]) ? $options[self::TAB_RECAPTCHA]["showForGuests"] : $defaultOptions[self::TAB_RECAPTCHA]["showForGuests"];
$this->recaptcha["showForUsers"] = isset($options[self::TAB_RECAPTCHA]["showForUsers"]) ? $options[self::TAB_RECAPTCHA]["showForUsers"] : $defaultOptions[self::TAB_RECAPTCHA]["showForUsers"];
$this->recaptcha["isShowOnSubscribeForm"] = isset($options[self::TAB_RECAPTCHA]["isShowOnSubscribeForm"]) ? $options[self::TAB_RECAPTCHA]["isShowOnSubscribeForm"] : $defaultOptions[self::TAB_RECAPTCHA]["isShowOnSubscribeForm"];
$lang = $this->recaptcha["lang"] ? "&hl=" . $this->recaptcha["lang"] : "";
$this->recaptcha["reCaptchaUrl"] = "https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit$lang";
/* login */
$this->login["showLoggedInUsername"] = isset($options[self::TAB_LOGIN]["showLoggedInUsername"]) ? $options[self::TAB_LOGIN]["showLoggedInUsername"] : $defaultOptions[self::TAB_LOGIN]["showLoggedInUsername"];
$this->login["showLoginLinkForGuests"] = isset($options[self::TAB_LOGIN]["showLoginLinkForGuests"]) ? $options[self::TAB_LOGIN]["showLoginLinkForGuests"] : $defaultOptions[self::TAB_LOGIN]["showLoginLinkForGuests"];
$this->login["showActivityTab"] = isset($options[self::TAB_LOGIN]["showActivityTab"]) ? $options[self::TAB_LOGIN]["showActivityTab"] : $defaultOptions[self::TAB_LOGIN]["showActivityTab"];
$this->login["showSubscriptionsTab"] = isset($options[self::TAB_LOGIN]["showSubscriptionsTab"]) ? $options[self::TAB_LOGIN]["showSubscriptionsTab"] : $defaultOptions[self::TAB_LOGIN]["showSubscriptionsTab"];
$this->login["showFollowsTab"] = isset($options[self::TAB_LOGIN]["showFollowsTab"]) ? $options[self::TAB_LOGIN]["showFollowsTab"] : $defaultOptions[self::TAB_LOGIN]["showFollowsTab"];
$this->login["enableProfileURLs"] = isset($options[self::TAB_LOGIN]["enableProfileURLs"]) ? $options[self::TAB_LOGIN]["enableProfileURLs"] : $defaultOptions[self::TAB_LOGIN]["enableProfileURLs"];
$this->login["websiteAsProfileUrl"] = isset($options[self::TAB_LOGIN]["websiteAsProfileUrl"]) ? $options[self::TAB_LOGIN]["websiteAsProfileUrl"] : $defaultOptions[self::TAB_LOGIN]["websiteAsProfileUrl"];
$this->login["isUserByEmail"] = isset($options[self::TAB_LOGIN]["isUserByEmail"]) ? $options[self::TAB_LOGIN]["isUserByEmail"] : $defaultOptions[self::TAB_LOGIN]["isUserByEmail"];
$this->login["loginUrl"] = isset($options[self::TAB_LOGIN]["loginUrl"]) ? $options[self::TAB_LOGIN]["loginUrl"] : $defaultOptions[self::TAB_LOGIN]["loginUrl"];
/* social */
$this->social["socialLoginAgreementCheckbox"] = isset($options[self::TAB_SOCIAL]["socialLoginAgreementCheckbox"]) ? $options[self::TAB_SOCIAL]["socialLoginAgreementCheckbox"] : $defaultOptions[self::TAB_SOCIAL]["socialLoginAgreementCheckbox"];
$this->social["socialLoginInSecondaryForm"] = isset($options[self::TAB_SOCIAL]["socialLoginInSecondaryForm"]) ? $options[self::TAB_SOCIAL]["socialLoginInSecondaryForm"] : $defaultOptions[self::TAB_SOCIAL]["socialLoginInSecondaryForm"];
$this->social["displaySocialAvatar"] = isset($options[self::TAB_SOCIAL]["displaySocialAvatar"]) ? $options[self::TAB_SOCIAL]["displaySocialAvatar"] : $defaultOptions[self::TAB_SOCIAL]["displaySocialAvatar"];
$this->social["displayIconOnAvatar"] = isset($options[self::TAB_SOCIAL]["displayIconOnAvatar"]) ? $options[self::TAB_SOCIAL]["displayIconOnAvatar"] : $defaultOptions[self::TAB_SOCIAL]["displayIconOnAvatar"];
$this->social["rememberLoggedinUser"] = isset($options[self::TAB_SOCIAL]["rememberLoggedinUser"]) ? $options[self::TAB_SOCIAL]["rememberLoggedinUser"] : $defaultOptions[self::TAB_SOCIAL]["rememberLoggedinUser"];
// fb
$this->social["enableFbLogin"] = isset($options[self::TAB_SOCIAL]["enableFbLogin"]) ? $options[self::TAB_SOCIAL]["enableFbLogin"] : $defaultOptions[self::TAB_SOCIAL]["enableFbLogin"];
$this->social["enableFbShare"] = isset($options[self::TAB_SOCIAL]["enableFbShare"]) ? $options[self::TAB_SOCIAL]["enableFbShare"] : $defaultOptions[self::TAB_SOCIAL]["enableFbShare"];
$this->social["fbAppID"] = isset($options[self::TAB_SOCIAL]["fbAppID"]) ? $options[self::TAB_SOCIAL]["fbAppID"] : $defaultOptions[self::TAB_SOCIAL]["fbAppID"];
$this->social["fbAppSecret"] = isset($options[self::TAB_SOCIAL]["fbAppSecret"]) ? $options[self::TAB_SOCIAL]["fbAppSecret"] : $defaultOptions[self::TAB_SOCIAL]["fbAppSecret"];
$this->social["fbUseOAuth2"] = isset($options[self::TAB_SOCIAL]["fbUseOAuth2"]) ? $options[self::TAB_SOCIAL]["fbUseOAuth2"] : $defaultOptions[self::TAB_SOCIAL]["fbUseOAuth2"];
// twitter
$this->social["enableTwitterLogin"] = isset($options[self::TAB_SOCIAL]["enableTwitterLogin"]) ? $options[self::TAB_SOCIAL]["enableTwitterLogin"] : $defaultOptions[self::TAB_SOCIAL]["enableTwitterLogin"];
$this->social["enableTwitterShare"] = isset($options[self::TAB_SOCIAL]["enableTwitterShare"]) ? $options[self::TAB_SOCIAL]["enableTwitterShare"] : $defaultOptions[self::TAB_SOCIAL]["enableTwitterShare"];
$this->social["twitterAppID"] = isset($options[self::TAB_SOCIAL]["twitterAppID"]) ? $options[self::TAB_SOCIAL]["twitterAppID"] : $defaultOptions[self::TAB_SOCIAL]["twitterAppID"];
$this->social["twitterAppSecret"] = isset($options[self::TAB_SOCIAL]["twitterAppSecret"]) ? $options[self::TAB_SOCIAL]["twitterAppSecret"] : $defaultOptions[self::TAB_SOCIAL]["twitterAppSecret"];
// google
$this->social["enableGoogleLogin"] = isset($options[self::TAB_SOCIAL]["enableGoogleLogin"]) ? $options[self::TAB_SOCIAL]["enableGoogleLogin"] : $defaultOptions[self::TAB_SOCIAL]["enableGoogleLogin"];
$this->social["googleClientID"] = isset($options[self::TAB_SOCIAL]["googleClientID"]) ? $options[self::TAB_SOCIAL]["googleClientID"] : $defaultOptions[self::TAB_SOCIAL]["googleClientID"];
$this->social["googleClientSecret"] = isset($options[self::TAB_SOCIAL]["googleClientSecret"]) ? $options[self::TAB_SOCIAL]["googleClientSecret"] : $defaultOptions[self::TAB_SOCIAL]["googleClientSecret"];
// telegram
$this->social["enableTelegramLogin"] = isset($options[self::TAB_SOCIAL]["enableTelegramLogin"]) ? $options[self::TAB_SOCIAL]["enableTelegramLogin"] : $defaultOptions[self::TAB_SOCIAL]["enableTelegramLogin"];
$this->social["telegramToken"] = isset($options[self::TAB_SOCIAL]["telegramToken"]) ? $options[self::TAB_SOCIAL]["telegramToken"] : $defaultOptions[self::TAB_SOCIAL]["telegramToken"];
// disqus
$this->social["enableDisqusLogin"] = isset($options[self::TAB_SOCIAL]["enableDisqusLogin"]) ? $options[self::TAB_SOCIAL]["enableDisqusLogin"] : $defaultOptions[self::TAB_SOCIAL]["enableDisqusLogin"];
$this->social["disqusPublicKey"] = isset($options[self::TAB_SOCIAL]["disqusPublicKey"]) ? $options[self::TAB_SOCIAL]["disqusPublicKey"] : $defaultOptions[self::TAB_SOCIAL]["disqusPublicKey"];
$this->social["disqusSecretKey"] = isset($options[self::TAB_SOCIAL]["disqusSecretKey"]) ? $options[self::TAB_SOCIAL]["disqusSecretKey"] : $defaultOptions[self::TAB_SOCIAL]["disqusSecretKey"];
// wordpress
$this->social["enableWordpressLogin"] = isset($options[self::TAB_SOCIAL]["enableWordpressLogin"]) ? $options[self::TAB_SOCIAL]["enableWordpressLogin"] : $defaultOptions[self::TAB_SOCIAL]["enableWordpressLogin"];
$this->social["wordpressClientID"] = isset($options[self::TAB_SOCIAL]["wordpressClientID"]) ? $options[self::TAB_SOCIAL]["wordpressClientID"] : $defaultOptions[self::TAB_SOCIAL]["wordpressClientID"];
$this->social["wordpressClientSecret"] = isset($options[self::TAB_SOCIAL]["wordpressClientSecret"]) ? $options[self::TAB_SOCIAL]["wordpressClientSecret"] : $defaultOptions[self::TAB_SOCIAL]["wordpressClientSecret"];
// instagram
$this->social["enableInstagramLogin"] = isset($options[self::TAB_SOCIAL]["enableInstagramLogin"]) ? $options[self::TAB_SOCIAL]["enableInstagramLogin"] : $defaultOptions[self::TAB_SOCIAL]["enableInstagramLogin"];
$this->social["instagramAppID"] = isset($options[self::TAB_SOCIAL]["instagramAppID"]) ? $options[self::TAB_SOCIAL]["instagramAppID"] : $defaultOptions[self::TAB_SOCIAL]["instagramAppID"];
$this->social["instagramAppSecret"] = isset($options[self::TAB_SOCIAL]["instagramAppSecret"]) ? $options[self::TAB_SOCIAL]["instagramAppSecret"] : $defaultOptions[self::TAB_SOCIAL]["instagramAppSecret"];
// linkedin
$this->social["enableLinkedinLogin"] = isset($options[self::TAB_SOCIAL]["enableLinkedinLogin"]) ? $options[self::TAB_SOCIAL]["enableLinkedinLogin"] : $defaultOptions[self::TAB_SOCIAL]["enableLinkedinLogin"];
$this->social["enableLinkedinLoginOpenID"] = isset($options[self::TAB_SOCIAL]["enableLinkedinLoginOpenID"]) ? $options[self::TAB_SOCIAL]["enableLinkedinLoginOpenID"] : $defaultOptions[self::TAB_SOCIAL]["enableLinkedinLoginOpenID"];
$this->social["linkedinClientID"] = isset($options[self::TAB_SOCIAL]["linkedinClientID"]) ? $options[self::TAB_SOCIAL]["linkedinClientID"] : $defaultOptions[self::TAB_SOCIAL]["linkedinClientID"];
$this->social["linkedinClientSecret"] = isset($options[self::TAB_SOCIAL]["linkedinClientSecret"]) ? $options[self::TAB_SOCIAL]["linkedinClientSecret"] : $defaultOptions[self::TAB_SOCIAL]["linkedinClientSecret"];
// whatsapp
$this->social["enableWhatsappShare"] = isset($options[self::TAB_SOCIAL]["enableWhatsappShare"]) ? $options[self::TAB_SOCIAL]["enableWhatsappShare"] : $defaultOptions[self::TAB_SOCIAL]["enableWhatsappShare"];
// yandex
$this->social["enableYandexLogin"] = isset($options[self::TAB_SOCIAL]["enableYandexLogin"]) ? $options[self::TAB_SOCIAL]["enableYandexLogin"] : $defaultOptions[self::TAB_SOCIAL]["enableYandexLogin"];
$this->social["yandexID"] = isset($options[self::TAB_SOCIAL]["yandexID"]) ? $options[self::TAB_SOCIAL]["yandexID"] : $defaultOptions[self::TAB_SOCIAL]["yandexID"];
$this->social["yandexPassword"] = isset($options[self::TAB_SOCIAL]["yandexPassword"]) ? $options[self::TAB_SOCIAL]["yandexPassword"] : $defaultOptions[self::TAB_SOCIAL]["yandexPassword"];
// mail.ru
$this->social["enableMailruLogin"] = isset($options[self::TAB_SOCIAL]["enableMailruLogin"]) ? $options[self::TAB_SOCIAL]["enableMailruLogin"] : $defaultOptions[self::TAB_SOCIAL]["enableMailruLogin"];
$this->social["mailruClientID"] = isset($options[self::TAB_SOCIAL]["mailruClientID"]) ? $options[self::TAB_SOCIAL]["mailruClientID"] : $defaultOptions[self::TAB_SOCIAL]["mailruClientID"];
$this->social["mailruClientSecret"] = isset($options[self::TAB_SOCIAL]["mailruClientSecret"]) ? $options[self::TAB_SOCIAL]["mailruClientSecret"] : $defaultOptions[self::TAB_SOCIAL]["mailruClientSecret"];
// weibo
$this->social["enableWeiboLogin"] = isset($options[self::TAB_SOCIAL]["enableWeiboLogin"]) ? $options[self::TAB_SOCIAL]["enableWeiboLogin"] : $defaultOptions[self::TAB_SOCIAL]["enableWeiboLogin"];
$this->social["weiboKey"] = isset($options[self::TAB_SOCIAL]["weiboKey"]) ? $options[self::TAB_SOCIAL]["weiboKey"] : $defaultOptions[self::TAB_SOCIAL]["weiboKey"];
$this->social["weiboSecret"] = isset($options[self::TAB_SOCIAL]["weiboSecret"]) ? $options[self::TAB_SOCIAL]["weiboSecret"] : $defaultOptions[self::TAB_SOCIAL]["weiboSecret"];
// wechat
$this->social["enableWechatLogin"] = isset($options[self::TAB_SOCIAL]["enableWechatLogin"]) ? $options[self::TAB_SOCIAL]["enableWechatLogin"] : $defaultOptions[self::TAB_SOCIAL]["enableWechatLogin"];
$this->social["wechatAppID"] = isset($options[self::TAB_SOCIAL]["wechatAppID"]) ? $options[self::TAB_SOCIAL]["wechatAppID"] : $defaultOptions[self::TAB_SOCIAL]["wechatAppID"];
$this->social["wechatSecret"] = isset($options[self::TAB_SOCIAL]["wechatSecret"]) ? $options[self::TAB_SOCIAL]["wechatSecret"] : $defaultOptions[self::TAB_SOCIAL]["wechatSecret"];
// qq
$this->social["enableQQLogin"] = isset($options[self::TAB_SOCIAL]["enableQQLogin"]) ? $options[self::TAB_SOCIAL]["enableQQLogin"] : $defaultOptions[self::TAB_SOCIAL]["enableQQLogin"];
$this->social["qqAppID"] = isset($options[self::TAB_SOCIAL]["qqAppID"]) ? $options[self::TAB_SOCIAL]["qqAppID"] : $defaultOptions[self::TAB_SOCIAL]["qqAppID"];
$this->social["qqSecret"] = isset($options[self::TAB_SOCIAL]["qqSecret"]) ? $options[self::TAB_SOCIAL]["qqSecret"] : $defaultOptions[self::TAB_SOCIAL]["qqSecret"];
// baidu
$this->social["enableBaiduLogin"] = isset($options[self::TAB_SOCIAL]["enableBaiduLogin"]) ? $options[self::TAB_SOCIAL]["enableBaiduLogin"] : $defaultOptions[self::TAB_SOCIAL]["enableBaiduLogin"];
$this->social["baiduAppID"] = isset($options[self::TAB_SOCIAL]["baiduAppID"]) ? $options[self::TAB_SOCIAL]["baiduAppID"] : $defaultOptions[self::TAB_SOCIAL]["baiduAppID"];
$this->social["baiduSecret"] = isset($options[self::TAB_SOCIAL]["baiduSecret"]) ? $options[self::TAB_SOCIAL]["baiduSecret"] : $defaultOptions[self::TAB_SOCIAL]["baiduSecret"];
// vk
$this->social["enableVkLogin"] = isset($options[self::TAB_SOCIAL]["enableVkLogin"]) ? $options[self::TAB_SOCIAL]["enableVkLogin"] : $defaultOptions[self::TAB_SOCIAL]["enableVkLogin"];
$this->social["enableVkShare"] = isset($options[self::TAB_SOCIAL]["enableVkShare"]) ? $options[self::TAB_SOCIAL]["enableVkShare"] : $defaultOptions[self::TAB_SOCIAL]["enableVkShare"];
$this->social["vkAppID"] = isset($options[self::TAB_SOCIAL]["vkAppID"]) ? $options[self::TAB_SOCIAL]["vkAppID"] : $defaultOptions[self::TAB_SOCIAL]["vkAppID"];
$this->social["vkAppSecret"] = isset($options[self::TAB_SOCIAL]["vkAppSecret"]) ? $options[self::TAB_SOCIAL]["vkAppSecret"] : $defaultOptions[self::TAB_SOCIAL]["vkAppSecret"];
// ok
$this->social["enableOkLogin"] = isset($options[self::TAB_SOCIAL]["enableOkLogin"]) ? $options[self::TAB_SOCIAL]["enableOkLogin"] : $defaultOptions[self::TAB_SOCIAL]["enableOkLogin"];
$this->social["enableOkShare"] = isset($options[self::TAB_SOCIAL]["enableOkShare"]) ? $options[self::TAB_SOCIAL]["enableOkShare"] : $defaultOptions[self::TAB_SOCIAL]["enableOkShare"];
$this->social["okAppID"] = isset($options[self::TAB_SOCIAL]["okAppID"]) ? $options[self::TAB_SOCIAL]["okAppID"] : $defaultOptions[self::TAB_SOCIAL]["okAppID"];
$this->social["okAppKey"] = isset($options[self::TAB_SOCIAL]["okAppKey"]) ? $options[self::TAB_SOCIAL]["okAppKey"] : $defaultOptions[self::TAB_SOCIAL]["okAppKey"];
$this->social["okAppSecret"] = isset($options[self::TAB_SOCIAL]["okAppSecret"]) ? $options[self::TAB_SOCIAL]["okAppSecret"] : $defaultOptions[self::TAB_SOCIAL]["okAppSecret"];
/* rating */
$this->rating["enablePostRatingSchema"] = isset($options[self::TAB_RATING]["enablePostRatingSchema"]) ? $options[self::TAB_RATING]["enablePostRatingSchema"] : $defaultOptions[self::TAB_RATING]["enablePostRatingSchema"];
$this->rating["displayRatingOnPost"] = isset($options[self::TAB_RATING]["displayRatingOnPost"]) ? $options[self::TAB_RATING]["displayRatingOnPost"] : $defaultOptions[self::TAB_RATING]["displayRatingOnPost"];
$this->rating["ratingCssOnNoneSingular"] = isset($options[self::TAB_RATING]["ratingCssOnNoneSingular"]) ? $options[self::TAB_RATING]["ratingCssOnNoneSingular"] : $defaultOptions[self::TAB_RATING]["ratingCssOnNoneSingular"];
$this->rating["ratingHoverColor"] = isset($options[self::TAB_RATING]["ratingHoverColor"]) ? $options[self::TAB_RATING]["ratingHoverColor"] : $defaultOptions[self::TAB_RATING]["ratingHoverColor"];
$this->rating["ratingInactiveColor"] = isset($options[self::TAB_RATING]["ratingInactiveColor"]) ? $options[self::TAB_RATING]["ratingInactiveColor"] : $defaultOptions[self::TAB_RATING]["ratingInactiveColor"];
$this->rating["ratingActiveColor"] = isset($options[self::TAB_RATING]["ratingActiveColor"]) ? $options[self::TAB_RATING]["ratingActiveColor"] : $defaultOptions[self::TAB_RATING]["ratingActiveColor"];
/* thread_display */
$this->thread_display["firstLoadWithAjax"] = isset($options[self::TAB_THREAD_DISPLAY]["firstLoadWithAjax"]) ? $options[self::TAB_THREAD_DISPLAY]["firstLoadWithAjax"] : $defaultOptions[self::TAB_THREAD_DISPLAY]["firstLoadWithAjax"];
$this->thread_display["commentListLoadType"] = isset($options[self::TAB_THREAD_DISPLAY]["commentListLoadType"]) ? $options[self::TAB_THREAD_DISPLAY]["commentListLoadType"] : $defaultOptions[self::TAB_THREAD_DISPLAY]["commentListLoadType"];
$this->thread_display["isLoadOnlyParentComments"] = isset($options[self::TAB_THREAD_DISPLAY]["isLoadOnlyParentComments"]) ? $options[self::TAB_THREAD_DISPLAY]["isLoadOnlyParentComments"] : $defaultOptions[self::TAB_THREAD_DISPLAY]["isLoadOnlyParentComments"];
$this->thread_display["showReactedFilterButton"] = isset($options[self::TAB_THREAD_DISPLAY]["showReactedFilterButton"]) ? $options[self::TAB_THREAD_DISPLAY]["showReactedFilterButton"] : $defaultOptions[self::TAB_THREAD_DISPLAY]["showReactedFilterButton"];
$this->thread_display["showHottestFilterButton"] = isset($options[self::TAB_THREAD_DISPLAY]["showHottestFilterButton"]) ? $options[self::TAB_THREAD_DISPLAY]["showHottestFilterButton"] : $defaultOptions[self::TAB_THREAD_DISPLAY]["showHottestFilterButton"];
$this->thread_display["showSortingButtons"] = isset($options[self::TAB_THREAD_DISPLAY]["showSortingButtons"]) ? $options[self::TAB_THREAD_DISPLAY]["showSortingButtons"] : $defaultOptions[self::TAB_THREAD_DISPLAY]["showSortingButtons"];
$this->thread_display["mostVotedByDefault"] = isset($options[self::TAB_THREAD_DISPLAY]["mostVotedByDefault"]) ? $options[self::TAB_THREAD_DISPLAY]["mostVotedByDefault"] : $defaultOptions[self::TAB_THREAD_DISPLAY]["mostVotedByDefault"];
$this->thread_display["reverseChildren"] = isset($options[self::TAB_THREAD_DISPLAY]["reverseChildren"]) ? $options[self::TAB_THREAD_DISPLAY]["reverseChildren"] : $defaultOptions[self::TAB_THREAD_DISPLAY]["reverseChildren"];
$this->thread_display["highlightUnreadComments"] = isset($options[self::TAB_THREAD_DISPLAY]["highlightUnreadComments"]) ? $options[self::TAB_THREAD_DISPLAY]["highlightUnreadComments"] : $defaultOptions[self::TAB_THREAD_DISPLAY]["highlightUnreadComments"];
$this->thread_display["scrollToComment"] = isset($options[self::TAB_THREAD_DISPLAY]["scrollToComment"]) ? $options[self::TAB_THREAD_DISPLAY]["scrollToComment"] : $defaultOptions[self::TAB_THREAD_DISPLAY]["scrollToComment"];
$this->thread_display["orderCommentsBy"] = isset($options[self::TAB_THREAD_DISPLAY]["orderCommentsBy"]) ? $options[self::TAB_THREAD_DISPLAY]["orderCommentsBy"] : $defaultOptions[self::TAB_THREAD_DISPLAY]["orderCommentsBy"];
/* thread_layouts */
$this->thread_layouts["showCommentLink"] = isset($options[self::TAB_THREAD_LAYOUTS]["showCommentLink"]) ? $options[self::TAB_THREAD_LAYOUTS]["showCommentLink"] : $defaultOptions[self::TAB_THREAD_LAYOUTS]["showCommentLink"];
$this->thread_layouts["showCommentDate"] = isset($options[self::TAB_THREAD_LAYOUTS]["showCommentDate"]) ? $options[self::TAB_THREAD_LAYOUTS]["showCommentDate"] : $defaultOptions[self::TAB_THREAD_LAYOUTS]["showCommentDate"];
$this->thread_layouts["showVotingButtons"] = isset($options[self::TAB_THREAD_LAYOUTS]["showVotingButtons"]) ? $options[self::TAB_THREAD_LAYOUTS]["showVotingButtons"] : $defaultOptions[self::TAB_THREAD_LAYOUTS]["showVotingButtons"];
$this->thread_layouts["votingButtonsIcon"] = isset($options[self::TAB_THREAD_LAYOUTS]["votingButtonsIcon"]) ? $options[self::TAB_THREAD_LAYOUTS]["votingButtonsIcon"] : $defaultOptions[self::TAB_THREAD_LAYOUTS]["votingButtonsIcon"];
$this->thread_layouts["votingButtonsStyle"] = isset($options[self::TAB_THREAD_LAYOUTS]["votingButtonsStyle"]) ? $options[self::TAB_THREAD_LAYOUTS]["votingButtonsStyle"] : $defaultOptions[self::TAB_THREAD_LAYOUTS]["votingButtonsStyle"];
$this->thread_layouts["enableDislikeButton"] = isset($options[self::TAB_THREAD_LAYOUTS]["enableDislikeButton"]) ? $options[self::TAB_THREAD_LAYOUTS]["enableDislikeButton"] : $defaultOptions[self::TAB_THREAD_LAYOUTS]["enableDislikeButton"];
$this->thread_layouts["isGuestCanVote"] = isset($options[self::TAB_THREAD_LAYOUTS]["isGuestCanVote"]) ? $options[self::TAB_THREAD_LAYOUTS]["isGuestCanVote"] : $defaultOptions[self::TAB_THREAD_LAYOUTS]["isGuestCanVote"];
$this->thread_layouts["highlightVotingButtons"] = isset($options[self::TAB_THREAD_LAYOUTS]["highlightVotingButtons"]) ? $options[self::TAB_THREAD_LAYOUTS]["highlightVotingButtons"] : $defaultOptions[self::TAB_THREAD_LAYOUTS]["highlightVotingButtons"];
$this->thread_layouts["showAvatars"] = isset($options[self::TAB_THREAD_LAYOUTS]["showAvatars"]) ? $options[self::TAB_THREAD_LAYOUTS]["showAvatars"] : $defaultOptions[self::TAB_THREAD_LAYOUTS]["showAvatars"];
$this->thread_layouts["defaultAvatarUrlForUser"] = isset($options[self::TAB_THREAD_LAYOUTS]["defaultAvatarUrlForUser"]) ? $options[self::TAB_THREAD_LAYOUTS]["defaultAvatarUrlForUser"] : $defaultOptions[self::TAB_THREAD_LAYOUTS]["defaultAvatarUrlForUser"];
$this->thread_layouts["defaultAvatarUrlForGuest"] = isset($options[self::TAB_THREAD_LAYOUTS]["defaultAvatarUrlForGuest"]) ? $options[self::TAB_THREAD_LAYOUTS]["defaultAvatarUrlForGuest"] : $defaultOptions[self::TAB_THREAD_LAYOUTS]["defaultAvatarUrlForGuest"];
$this->thread_layouts["changeAvatarsEverywhere"] = isset($options[self::TAB_THREAD_LAYOUTS]["changeAvatarsEverywhere"]) ? $options[self::TAB_THREAD_LAYOUTS]["changeAvatarsEverywhere"] : $defaultOptions[self::TAB_THREAD_LAYOUTS]["changeAvatarsEverywhere"];
/* thread_styles */
$this->thread_styles["theme"] = isset($options[self::TAB_THREAD_STYLES]["theme"]) ? $options[self::TAB_THREAD_STYLES]["theme"] : $defaultOptions[self::TAB_THREAD_STYLES]["theme"];
$this->thread_styles["primaryColor"] = isset($options[self::TAB_THREAD_STYLES]["primaryColor"]) ? $options[self::TAB_THREAD_STYLES]["primaryColor"] : $defaultOptions[self::TAB_THREAD_STYLES]["primaryColor"];
$this->thread_styles["newLoadedCommentBGColor"] = isset($options[self::TAB_THREAD_STYLES]["newLoadedCommentBGColor"]) ? $options[self::TAB_THREAD_STYLES]["newLoadedCommentBGColor"] : $defaultOptions[self::TAB_THREAD_STYLES]["newLoadedCommentBGColor"];
$this->thread_styles["primaryButtonColor"] = isset($options[self::TAB_THREAD_STYLES]["primaryButtonColor"]) ? $options[self::TAB_THREAD_STYLES]["primaryButtonColor"] : $defaultOptions[self::TAB_THREAD_STYLES]["primaryButtonColor"];
$this->thread_styles["primaryButtonBG"] = isset($options[self::TAB_THREAD_STYLES]["primaryButtonBG"]) ? $options[self::TAB_THREAD_STYLES]["primaryButtonBG"] : $defaultOptions[self::TAB_THREAD_STYLES]["primaryButtonBG"];
$this->thread_styles["bubbleColors"] = isset($options[self::TAB_THREAD_STYLES]["bubbleColors"]) ? $options[self::TAB_THREAD_STYLES]["bubbleColors"] : $defaultOptions[self::TAB_THREAD_STYLES]["bubbleColors"];
$this->thread_styles["inlineFeedbackColors"] = isset($options[self::TAB_THREAD_STYLES]["inlineFeedbackColors"]) ? $options[self::TAB_THREAD_STYLES]["inlineFeedbackColors"] : $defaultOptions[self::TAB_THREAD_STYLES]["inlineFeedbackColors"];
$this->thread_styles["defaultCommentAreaBG"] = isset($options[self::TAB_THREAD_STYLES]["defaultCommentAreaBG"]) ? $options[self::TAB_THREAD_STYLES]["defaultCommentAreaBG"] : $defaultOptions[self::TAB_THREAD_STYLES]["defaultCommentAreaBG"];
$this->thread_styles["defaultCommentTextColor"] = isset($options[self::TAB_THREAD_STYLES]["defaultCommentTextColor"]) ? $options[self::TAB_THREAD_STYLES]["defaultCommentTextColor"] : $defaultOptions[self::TAB_THREAD_STYLES]["defaultCommentTextColor"];
$this->thread_styles["defaultCommentFieldsBG"] = isset($options[self::TAB_THREAD_STYLES]["defaultCommentFieldsBG"]) ? $options[self::TAB_THREAD_STYLES]["defaultCommentFieldsBG"] : $defaultOptions[self::TAB_THREAD_STYLES]["defaultCommentFieldsBG"];
$this->thread_styles["defaultCommentFieldsBorderColor"] = isset($options[self::TAB_THREAD_STYLES]["defaultCommentFieldsBorderColor"]) ? $options[self::TAB_THREAD_STYLES]["defaultCommentFieldsBorderColor"] : $defaultOptions[self::TAB_THREAD_STYLES]["defaultCommentFieldsBorderColor"];
$this->thread_styles["defaultCommentFieldsTextColor"] = isset($options[self::TAB_THREAD_STYLES]["defaultCommentFieldsTextColor"]) ? $options[self::TAB_THREAD_STYLES]["defaultCommentFieldsTextColor"] : $defaultOptions[self::TAB_THREAD_STYLES]["defaultCommentFieldsTextColor"];
$this->thread_styles["defaultCommentFieldsPlaceholderColor"] = isset($options[self::TAB_THREAD_STYLES]["defaultCommentFieldsPlaceholderColor"]) ? $options[self::TAB_THREAD_STYLES]["defaultCommentFieldsPlaceholderColor"] : $defaultOptions[self::TAB_THREAD_STYLES]["defaultCommentFieldsPlaceholderColor"];
$this->thread_styles["darkCommentAreaBG"] = isset($options[self::TAB_THREAD_STYLES]["darkCommentAreaBG"]) ? $options[self::TAB_THREAD_STYLES]["darkCommentAreaBG"] : $defaultOptions[self::TAB_THREAD_STYLES]["darkCommentAreaBG"];
$this->thread_styles["darkCommentTextColor"] = isset($options[self::TAB_THREAD_STYLES]["darkCommentTextColor"]) ? $options[self::TAB_THREAD_STYLES]["darkCommentTextColor"] : $defaultOptions[self::TAB_THREAD_STYLES]["darkCommentTextColor"];
$this->thread_styles["darkCommentFieldsBG"] = isset($options[self::TAB_THREAD_STYLES]["darkCommentFieldsBG"]) ? $options[self::TAB_THREAD_STYLES]["darkCommentFieldsBG"] : $defaultOptions[self::TAB_THREAD_STYLES]["darkCommentFieldsBG"];
$this->thread_styles["darkCommentFieldsBorderColor"] = isset($options[self::TAB_THREAD_STYLES]["darkCommentFieldsBorderColor"]) ? $options[self::TAB_THREAD_STYLES]["darkCommentFieldsBorderColor"] : $defaultOptions[self::TAB_THREAD_STYLES]["darkCommentFieldsBorderColor"];
$this->thread_styles["darkCommentFieldsTextColor"] = isset($options[self::TAB_THREAD_STYLES]["darkCommentFieldsTextColor"]) ? $options[self::TAB_THREAD_STYLES]["darkCommentFieldsTextColor"] : $defaultOptions[self::TAB_THREAD_STYLES]["darkCommentFieldsTextColor"];
$this->thread_styles["darkCommentFieldsPlaceholderColor"] = isset($options[self::TAB_THREAD_STYLES]["darkCommentFieldsPlaceholderColor"]) ? $options[self::TAB_THREAD_STYLES]["darkCommentFieldsPlaceholderColor"] : $defaultOptions[self::TAB_THREAD_STYLES]["darkCommentFieldsPlaceholderColor"];
$this->thread_styles["commentTextSize"] = isset($options[self::TAB_THREAD_STYLES]["commentTextSize"]) ? $options[self::TAB_THREAD_STYLES]["commentTextSize"] : $defaultOptions[self::TAB_THREAD_STYLES]["commentTextSize"];
$this->thread_styles["enableFontAwesome"] = isset($options[self::TAB_THREAD_STYLES]["enableFontAwesome"]) ? $options[self::TAB_THREAD_STYLES]["enableFontAwesome"] : $defaultOptions[self::TAB_THREAD_STYLES]["enableFontAwesome"];
$this->thread_styles["customCss"] = isset($options[self::TAB_THREAD_STYLES]["customCss"]) ? $options[self::TAB_THREAD_STYLES]["customCss"] : $defaultOptions[self::TAB_THREAD_STYLES]["customCss"];
/* subscription */
$this->subscription["enableUserMentioning"] = isset($options[self::TAB_SUBSCRIPTION]["enableUserMentioning"]) ? $options[self::TAB_SUBSCRIPTION]["enableUserMentioning"] : $defaultOptions[self::TAB_SUBSCRIPTION]["enableUserMentioning"];
$this->subscription["sendMailToMentionedUsers"] = isset($options[self::TAB_SUBSCRIPTION]["sendMailToMentionedUsers"]) ? $options[self::TAB_SUBSCRIPTION]["sendMailToMentionedUsers"] : $defaultOptions[self::TAB_SUBSCRIPTION]["sendMailToMentionedUsers"];
$this->subscription["isNotifyOnCommentApprove"] = isset($options[self::TAB_SUBSCRIPTION]["isNotifyOnCommentApprove"]) ? $options[self::TAB_SUBSCRIPTION]["isNotifyOnCommentApprove"] : $defaultOptions[self::TAB_SUBSCRIPTION]["isNotifyOnCommentApprove"];
$this->subscription["enableMemberConfirm"] = isset($options[self::TAB_SUBSCRIPTION]["enableMemberConfirm"]) ? $options[self::TAB_SUBSCRIPTION]["enableMemberConfirm"] : $defaultOptions[self::TAB_SUBSCRIPTION]["enableMemberConfirm"];
$this->subscription["enableGuestsConfirm"] = isset($options[self::TAB_SUBSCRIPTION]["enableGuestsConfirm"]) ? $options[self::TAB_SUBSCRIPTION]["enableGuestsConfirm"] : $defaultOptions[self::TAB_SUBSCRIPTION]["enableGuestsConfirm"];
$this->subscription["subscriptionType"] = isset($options[self::TAB_SUBSCRIPTION]["subscriptionType"]) ? $options[self::TAB_SUBSCRIPTION]["subscriptionType"] : $defaultOptions[self::TAB_SUBSCRIPTION]["subscriptionType"];
$this->subscription["showReplyCheckbox"] = isset($options[self::TAB_SUBSCRIPTION]["showReplyCheckbox"]) ? $options[self::TAB_SUBSCRIPTION]["showReplyCheckbox"] : $defaultOptions[self::TAB_SUBSCRIPTION]["showReplyCheckbox"];
$this->subscription["isReplyDefaultChecked"] = isset($options[self::TAB_SUBSCRIPTION]["isReplyDefaultChecked"]) ? $options[self::TAB_SUBSCRIPTION]["isReplyDefaultChecked"] : $defaultOptions[self::TAB_SUBSCRIPTION]["isReplyDefaultChecked"];
$this->subscription["usePostmaticForCommentNotification"] = isset($options[self::TAB_SUBSCRIPTION]["usePostmaticForCommentNotification"]) ? $options[self::TAB_SUBSCRIPTION]["usePostmaticForCommentNotification"] : $defaultOptions[self::TAB_SUBSCRIPTION]["usePostmaticForCommentNotification"];
$this->subscription["isFollowActive"] = isset($options[self::TAB_SUBSCRIPTION]["isFollowActive"]) ? $options[self::TAB_SUBSCRIPTION]["isFollowActive"] : $defaultOptions[self::TAB_SUBSCRIPTION]["isFollowActive"];
$this->subscription["disableFollowConfirmForUsers"] = isset($options[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"]) ? $options[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"] : $defaultOptions[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"];
$this->subscription["emailSubjectPostComment"] = isset($options[self::TAB_SUBSCRIPTION]["emailSubjectPostComment"]) ? wp_kses_post(__($options[self::TAB_SUBSCRIPTION]["emailSubjectPostComment"], "wpdiscuz")) : __($defaultOptions[self::TAB_SUBSCRIPTION]["emailSubjectPostComment"], "wpdiscuz");
$this->subscription["emailContentPostComment"] = isset($options[self::TAB_SUBSCRIPTION]["emailContentPostComment"]) ? __($options[self::TAB_SUBSCRIPTION]["emailContentPostComment"], "wpdiscuz") : __($defaultOptions[self::TAB_SUBSCRIPTION]["emailContentPostComment"], "wpdiscuz");
$this->subscription["emailSubjectAllCommentReply"] = isset($options[self::TAB_SUBSCRIPTION]["emailSubjectAllCommentReply"]) ? __($options[self::TAB_SUBSCRIPTION]["emailSubjectAllCommentReply"], "wpdiscuz") : __($defaultOptions[self::TAB_SUBSCRIPTION]["emailSubjectAllCommentReply"], "wpdiscuz");
$this->subscription["emailContentAllCommentReply"] = isset($options[self::TAB_SUBSCRIPTION]["emailContentAllCommentReply"]) ? __($options[self::TAB_SUBSCRIPTION]["emailContentAllCommentReply"], "wpdiscuz") : __($defaultOptions[self::TAB_SUBSCRIPTION]["emailContentAllCommentReply"], "wpdiscuz");
$this->subscription["emailSubjectCommentReply"] = isset($options[self::TAB_SUBSCRIPTION]["emailSubjectCommentReply"]) ? __($options[self::TAB_SUBSCRIPTION]["emailSubjectCommentReply"], "wpdiscuz") : __($defaultOptions[self::TAB_SUBSCRIPTION]["emailSubjectCommentReply"], "wpdiscuz");
$this->subscription["emailContentCommentReply"] = isset($options[self::TAB_SUBSCRIPTION]["emailContentCommentReply"]) ? __($options[self::TAB_SUBSCRIPTION]["emailContentCommentReply"], "wpdiscuz") : __($defaultOptions[self::TAB_SUBSCRIPTION]["emailContentCommentReply"], "wpdiscuz");
$this->subscription["emailSubjectSubscriptionConfirmation"] = isset($options[self::TAB_SUBSCRIPTION]["emailSubjectSubscriptionConfirmation"]) ? __($options[self::TAB_SUBSCRIPTION]["emailSubjectSubscriptionConfirmation"], "wpdiscuz") : __($defaultOptions[self::TAB_SUBSCRIPTION]["emailSubjectSubscriptionConfirmation"], "wpdiscuz");
$this->subscription["emailContentSubscriptionConfirmation"] = isset($options[self::TAB_SUBSCRIPTION]["emailContentSubscriptionConfirmation"]) ? __($options[self::TAB_SUBSCRIPTION]["emailContentSubscriptionConfirmation"], "wpdiscuz") : __($defaultOptions[self::TAB_SUBSCRIPTION]["emailContentSubscriptionConfirmation"], "wpdiscuz");
$this->subscription["emailSubjectCommentApproved"] = isset($options[self::TAB_SUBSCRIPTION]["emailSubjectCommentApproved"]) ? __($options[self::TAB_SUBSCRIPTION]["emailSubjectCommentApproved"], "wpdiscuz") : __($defaultOptions[self::TAB_SUBSCRIPTION]["emailSubjectCommentApproved"], "wpdiscuz");
$this->subscription["emailContentCommentApproved"] = isset($options[self::TAB_SUBSCRIPTION]["emailContentCommentApproved"]) ? __($options[self::TAB_SUBSCRIPTION]["emailContentCommentApproved"], "wpdiscuz") : __($defaultOptions[self::TAB_SUBSCRIPTION]["emailContentCommentApproved"], "wpdiscuz");
$this->subscription["emailSubjectUserMentioned"] = isset($options[self::TAB_SUBSCRIPTION]["emailSubjectUserMentioned"]) ? __($options[self::TAB_SUBSCRIPTION]["emailSubjectUserMentioned"], "wpdiscuz") : __($defaultOptions[self::TAB_SUBSCRIPTION]["emailSubjectUserMentioned"], "wpdiscuz");
$this->subscription["emailContentUserMentioned"] = isset($options[self::TAB_SUBSCRIPTION]["emailContentUserMentioned"]) ? __($options[self::TAB_SUBSCRIPTION]["emailContentUserMentioned"], "wpdiscuz") : __($defaultOptions[self::TAB_SUBSCRIPTION]["emailContentUserMentioned"], "wpdiscuz");
$this->subscription["emailSubjectFollowConfirmation"] = isset($options[self::TAB_SUBSCRIPTION]["emailSubjectFollowConfirmation"]) ? __($options[self::TAB_SUBSCRIPTION]["emailSubjectFollowConfirmation"], "wpdiscuz") : __($defaultOptions[self::TAB_SUBSCRIPTION]["emailSubjectFollowConfirmation"], "wpdiscuz");
$this->subscription["emailContentFollowConfirmation"] = isset($options[self::TAB_SUBSCRIPTION]["emailContentFollowConfirmation"]) ? __($options[self::TAB_SUBSCRIPTION]["emailContentFollowConfirmation"], "wpdiscuz") : __($defaultOptions[self::TAB_SUBSCRIPTION]["emailContentFollowConfirmation"], "wpdiscuz");
$this->subscription["emailSubjectFollowComment"] = isset($options[self::TAB_SUBSCRIPTION]["emailSubjectFollowComment"]) ? __($options[self::TAB_SUBSCRIPTION]["emailSubjectFollowComment"], "wpdiscuz") : __($defaultOptions[self::TAB_SUBSCRIPTION]["emailSubjectFollowComment"], "wpdiscuz");
$this->subscription["emailContentFollowComment"] = isset($options[self::TAB_SUBSCRIPTION]["emailContentFollowComment"]) ? __($options[self::TAB_SUBSCRIPTION]["emailContentFollowComment"], "wpdiscuz") : __($defaultOptions[self::TAB_SUBSCRIPTION]["emailContentFollowComment"], "wpdiscuz");
/* labels */
$this->labels["blogRoleLabels"] = isset($options[self::TAB_LABELS]["blogRoleLabels"]) ? $options[self::TAB_LABELS]["blogRoleLabels"] : $defaultOptions[self::TAB_LABELS]["blogRoleLabels"];
$this->labels["blogRoles"] = isset($options[self::TAB_LABELS]["blogRoles"]) ? $options[self::TAB_LABELS]["blogRoles"] : $defaultOptions[self::TAB_LABELS]["blogRoles"];
/* moderation */
$this->moderation["commentEditableTime"] = isset($options[self::TAB_MODERATION]["commentEditableTime"]) ? $options[self::TAB_MODERATION]["commentEditableTime"] : $defaultOptions[self::TAB_MODERATION]["commentEditableTime"];
$this->moderation["enableEditingWhenHaveReplies"] = isset($options[self::TAB_MODERATION]["enableEditingWhenHaveReplies"]) ? $options[self::TAB_MODERATION]["enableEditingWhenHaveReplies"] : $defaultOptions[self::TAB_MODERATION]["enableEditingWhenHaveReplies"];
$this->moderation["displayEditingInfo"] = isset($options[self::TAB_MODERATION]["displayEditingInfo"]) ? $options[self::TAB_MODERATION]["displayEditingInfo"] : $defaultOptions[self::TAB_MODERATION]["displayEditingInfo"];
$this->moderation["enableStickButton"] = isset($options[self::TAB_MODERATION]["enableStickButton"]) ? $options[self::TAB_MODERATION]["enableStickButton"] : $defaultOptions[self::TAB_MODERATION]["enableStickButton"];
$this->moderation["enableCloseButton"] = isset($options[self::TAB_MODERATION]["enableCloseButton"]) ? $options[self::TAB_MODERATION]["enableCloseButton"] : $defaultOptions[self::TAB_MODERATION]["enableCloseButton"];
$this->moderation["restrictCommentingPerUser"] = isset($options[self::TAB_MODERATION]["restrictCommentingPerUser"]) ? $options[self::TAB_MODERATION]["restrictCommentingPerUser"] : $defaultOptions[self::TAB_MODERATION]["restrictCommentingPerUser"];
$this->moderation["commentRestrictionType"] = isset($options[self::TAB_MODERATION]["commentRestrictionType"]) ? $options[self::TAB_MODERATION]["commentRestrictionType"] : $defaultOptions[self::TAB_MODERATION]["commentRestrictionType"];
$this->moderation["userCommentsLimit"] = isset($options[self::TAB_MODERATION]["userCommentsLimit"]) ? $options[self::TAB_MODERATION]["userCommentsLimit"] : $defaultOptions[self::TAB_MODERATION]["userCommentsLimit"];
/* content */
$this->content["commentTextMinLength"] = isset($options[self::TAB_CONTENT]["commentTextMinLength"]) ? $options[self::TAB_CONTENT]["commentTextMinLength"] : $defaultOptions[self::TAB_CONTENT]["commentTextMinLength"];
$this->content["replyTextMinLength"] = isset($options[self::TAB_CONTENT]["replyTextMinLength"]) ? $options[self::TAB_CONTENT]["replyTextMinLength"] : $defaultOptions[self::TAB_CONTENT]["replyTextMinLength"];
$this->content["commentTextMaxLength"] = isset($options[self::TAB_CONTENT]["commentTextMaxLength"]) ? $options[self::TAB_CONTENT]["commentTextMaxLength"] : $defaultOptions[self::TAB_CONTENT]["commentTextMaxLength"];
$this->content["replyTextMaxLength"] = isset($options[self::TAB_CONTENT]["replyTextMaxLength"]) ? $options[self::TAB_CONTENT]["replyTextMaxLength"] : $defaultOptions[self::TAB_CONTENT]["replyTextMaxLength"];
$this->content["enableImageConversion"] = isset($options[self::TAB_CONTENT]["enableImageConversion"]) ? $options[self::TAB_CONTENT]["enableImageConversion"] : $defaultOptions[self::TAB_CONTENT]["enableImageConversion"];
$this->content["enableShortcodes"] = isset($options[self::TAB_CONTENT]["enableShortcodes"]) ? $options[self::TAB_CONTENT]["enableShortcodes"] : $defaultOptions[self::TAB_CONTENT]["enableShortcodes"];
$this->content["commentReadMoreLimit"] = isset($options[self::TAB_CONTENT]["commentReadMoreLimit"]) ? $options[self::TAB_CONTENT]["commentReadMoreLimit"] : $defaultOptions[self::TAB_CONTENT]["commentReadMoreLimit"];
$this->content["wmuIsEnabled"] = isset($options[self::TAB_CONTENT]["wmuIsEnabled"]) ? $options[self::TAB_CONTENT]["wmuIsEnabled"] : $defaultOptions[self::TAB_CONTENT]["wmuIsEnabled"];
$this->content["wmuIsGuestAllowed"] = isset($options[self::TAB_CONTENT]["wmuIsGuestAllowed"]) ? $options[self::TAB_CONTENT]["wmuIsGuestAllowed"] : $defaultOptions[self::TAB_CONTENT]["wmuIsGuestAllowed"];
$this->content["wmuIsLightbox"] = isset($options[self::TAB_CONTENT]["wmuIsLightbox"]) ? $options[self::TAB_CONTENT]["wmuIsLightbox"] : $defaultOptions[self::TAB_CONTENT]["wmuIsLightbox"];
$this->content["wmuMimeTypes"] = isset($options[self::TAB_CONTENT]["wmuMimeTypes"]) ? $options[self::TAB_CONTENT]["wmuMimeTypes"] : $defaultOptions[self::TAB_CONTENT]["wmuMimeTypes"];
$this->content["wmuMaxFileSize"] = isset($options[self::TAB_CONTENT]["wmuMaxFileSize"]) ? $options[self::TAB_CONTENT]["wmuMaxFileSize"] : $defaultOptions[self::TAB_CONTENT]["wmuMaxFileSize"];
$this->content["wmuIsShowFilesDashboard"] = isset($options[self::TAB_CONTENT]["wmuIsShowFilesDashboard"]) ? $options[self::TAB_CONTENT]["wmuIsShowFilesDashboard"] : $defaultOptions[self::TAB_CONTENT]["wmuIsShowFilesDashboard"];
$this->content["wmuSingleImageWidth"] = isset($options[self::TAB_CONTENT]["wmuSingleImageWidth"]) ? $options[self::TAB_CONTENT]["wmuSingleImageWidth"] : $defaultOptions[self::TAB_CONTENT]["wmuSingleImageWidth"];
$this->content["wmuSingleImageHeight"] = isset($options[self::TAB_CONTENT]["wmuSingleImageHeight"]) ? $options[self::TAB_CONTENT]["wmuSingleImageHeight"] : $defaultOptions[self::TAB_CONTENT]["wmuSingleImageHeight"];
$this->content["wmuThumbnailSizes"] = isset($options[self::TAB_CONTENT]["wmuThumbnailSizes"]) ? array_filter($options[self::TAB_CONTENT]["wmuThumbnailSizes"]) : $defaultOptions[self::TAB_CONTENT]["wmuThumbnailSizes"];
$this->content["wmuIsThumbnailsViaCron"] = isset($options[self::TAB_CONTENT]["wmuIsThumbnailsViaCron"]) ? $options[self::TAB_CONTENT]["wmuIsThumbnailsViaCron"] : $defaultOptions[self::TAB_CONTENT]["wmuIsThumbnailsViaCron"];
/* live */
$this->live["userInteractionCheck"] = isset($options[self::TAB_LIVE]["userInteractionCheck"]) ? $options[self::TAB_LIVE]["userInteractionCheck"] : $defaultOptions[self::TAB_LIVE]["userInteractionCheck"];
$this->live["enableBubble"] = isset($options[self::TAB_LIVE]["enableBubble"]) ? $options[self::TAB_LIVE]["enableBubble"] : $defaultOptions[self::TAB_LIVE]["enableBubble"];
$this->live["bubbleLiveUpdate"] = isset($options[self::TAB_LIVE]["bubbleLiveUpdate"]) ? $options[self::TAB_LIVE]["bubbleLiveUpdate"] : $defaultOptions[self::TAB_LIVE]["bubbleLiveUpdate"];
$this->live["bubbleLocation"] = isset($options[self::TAB_LIVE]["bubbleLocation"]) ? $options[self::TAB_LIVE]["bubbleLocation"] : $defaultOptions[self::TAB_LIVE]["bubbleLocation"];
$this->live["bubbleShowNewCommentMessage"] = isset($options[self::TAB_LIVE]["bubbleShowNewCommentMessage"]) ? $options[self::TAB_LIVE]["bubbleShowNewCommentMessage"] : $defaultOptions[self::TAB_LIVE]["bubbleShowNewCommentMessage"];
$this->live["bubbleHintTimeout"] = isset($options[self::TAB_LIVE]["bubbleHintTimeout"]) ? $options[self::TAB_LIVE]["bubbleHintTimeout"] : $defaultOptions[self::TAB_LIVE]["bubbleHintTimeout"];
$this->live["bubbleHintHideTimeout"] = isset($options[self::TAB_LIVE]["bubbleHintHideTimeout"]) ? $options[self::TAB_LIVE]["bubbleHintHideTimeout"] : $defaultOptions[self::TAB_LIVE]["bubbleHintHideTimeout"];
$this->live["commentListUpdateType"] = isset($options[self::TAB_LIVE]["commentListUpdateType"]) ? $options[self::TAB_LIVE]["commentListUpdateType"] : $defaultOptions[self::TAB_LIVE]["commentListUpdateType"];
$this->live["liveUpdateGuests"] = isset($options[self::TAB_LIVE]["liveUpdateGuests"]) ? $options[self::TAB_LIVE]["liveUpdateGuests"] : $defaultOptions[self::TAB_LIVE]["liveUpdateGuests"];
$this->live["commentListUpdateTimer"] = isset($options[self::TAB_LIVE]["commentListUpdateTimer"]) ? $options[self::TAB_LIVE]["commentListUpdateTimer"] : $defaultOptions[self::TAB_LIVE]["commentListUpdateTimer"];
/* inline */
$this->inline["showInlineFilterButton"] = isset($options[self::TAB_INLINE]["showInlineFilterButton"]) ? $options[self::TAB_INLINE]["showInlineFilterButton"] : $defaultOptions[self::TAB_INLINE]["showInlineFilterButton"];
$this->inline["inlineFeedbackAttractionType"] = isset($options[self::TAB_INLINE]["inlineFeedbackAttractionType"]) ? $options[self::TAB_INLINE]["inlineFeedbackAttractionType"] : $defaultOptions[self::TAB_INLINE]["inlineFeedbackAttractionType"];
/* general */
$this->general["isEnableOnHome"] = isset($options[self::TAB_GENERAL]["isEnableOnHome"]) ? $options[self::TAB_GENERAL]["isEnableOnHome"] : $defaultOptions[self::TAB_GENERAL]["isEnableOnHome"];
$this->general["isNativeAjaxEnabled"] = isset($options[self::TAB_GENERAL]["isNativeAjaxEnabled"]) ? $options[self::TAB_GENERAL]["isNativeAjaxEnabled"] : $defaultOptions[self::TAB_GENERAL]["isNativeAjaxEnabled"];
$this->general["loadComboVersion"] = isset($options[self::TAB_GENERAL]["loadComboVersion"]) ? $options[self::TAB_GENERAL]["loadComboVersion"] : $defaultOptions[self::TAB_GENERAL]["loadComboVersion"];
$this->general["loadMinVersion"] = isset($options[self::TAB_GENERAL]["loadMinVersion"]) ? $options[self::TAB_GENERAL]["loadMinVersion"] : $defaultOptions[self::TAB_GENERAL]["loadMinVersion"];
$this->general["commentLinkFilter"] = isset($options[self::TAB_GENERAL]["commentLinkFilter"]) ? $options[self::TAB_GENERAL]["commentLinkFilter"] : $defaultOptions[self::TAB_GENERAL]["commentLinkFilter"];
$this->general["redirectPage"] = isset($options[self::TAB_GENERAL]["redirectPage"]) ? $options[self::TAB_GENERAL]["redirectPage"] : $defaultOptions[self::TAB_GENERAL]["redirectPage"];
$this->general["simpleCommentDate"] = isset($options[self::TAB_GENERAL]["simpleCommentDate"]) ? $options[self::TAB_GENERAL]["simpleCommentDate"] : $defaultOptions[self::TAB_GENERAL]["simpleCommentDate"];
$this->general["dateDiffFormat"] = isset($options[self::TAB_GENERAL]["dateDiffFormat"]) ? $options[self::TAB_GENERAL]["dateDiffFormat"] : $defaultOptions[self::TAB_GENERAL]["dateDiffFormat"];
$this->general["isUsePoMo"] = isset($options[self::TAB_GENERAL]["isUsePoMo"]) ? $options[self::TAB_GENERAL]["isUsePoMo"] : $defaultOptions[self::TAB_GENERAL]["isUsePoMo"];
$this->general["showPluginPoweredByLink"] = isset($options[self::TAB_GENERAL]["showPluginPoweredByLink"]) ? $options[self::TAB_GENERAL]["showPluginPoweredByLink"] : $defaultOptions[self::TAB_GENERAL]["showPluginPoweredByLink"];
$this->general["isCacheEnabled"] = isset($options[self::TAB_GENERAL]["isCacheEnabled"]) ? $options[self::TAB_GENERAL]["isCacheEnabled"] : $defaultOptions[self::TAB_GENERAL]["isCacheEnabled"];
$this->general["cacheTimeout"] = isset($options[self::TAB_GENERAL]["cacheTimeout"]) ? $options[self::TAB_GENERAL]["cacheTimeout"] : $defaultOptions[self::TAB_GENERAL]["cacheTimeout"];
do_action("wpdiscuz_init_options", $this);
}
/**
* initialize default phrases
*/
public function initPhrases()
{
$this->phrases = [
"wc_be_the_first_text" => esc_html__("Be the First to Comment!", "wpdiscuz"),
"wc_comment_start_text" => esc_html__("Start the discussion", "wpdiscuz"),
"wc_comment_join_text" => esc_html__("Join the discussion", "wpdiscuz"),
"wc_most_reacted_comment" => esc_html__("Most reacted comment", "wpdiscuz"),
"wc_hottest_comment_thread" => esc_html__("Hottest comment thread", "wpdiscuz"),
"wc_inline_comments" => esc_html__("Inline Comments", "wpdiscuz"),
"wc_email_text" => esc_html__("Email", "wpdiscuz"),
"wc_subscribe_anchor" => esc_html__("Subscribe", "wpdiscuz"),
"wc_notify_of" => esc_html__("Notify of", "wpdiscuz"),
"wc_notify_on_new_comment" => esc_html__("new follow-up comments", "wpdiscuz"),
"wc_notify_on_all_new_reply" => esc_html__("new replies to my comments", "wpdiscuz"),
"wc_notify_on_new_reply" => esc_html__("Notify of new replies to this comment", "wpdiscuz"),
"wc_newest" => esc_html__("Newest", "wpdiscuz"),
"wc_oldest" => esc_html__("Oldest", "wpdiscuz"),
"wc_most_voted" => esc_html__("Most Voted", "wpdiscuz"),
"wc_load_more_submit_text" => esc_html__("Load More Comments", "wpdiscuz"),
"wc_load_rest_comments_submit_text" => esc_html__("Load Rest of Comments", "wpdiscuz"),
"wc_reply_text" => esc_html__("Reply", "wpdiscuz"),
"wc_share_text" => esc_html__("Share", "wpdiscuz"),
"wc_edit_text" => esc_html__("Edit", "wpdiscuz"),
"wc_share_facebook" => esc_html__("Share On Facebook", "wpdiscuz"),
"wc_share_twitter" => esc_html__("Share On X", "wpdiscuz"),
"wc_share_whatsapp" => esc_html__("Share On WhatsApp", "wpdiscuz"),
"wc_share_vk" => esc_html__("Share On VKontakte", "wpdiscuz"),
"wc_share_ok" => esc_html__("Share On Odnoklassniki", "wpdiscuz"),
"wc_hide_replies_text" => esc_html__("Hide Replies", "wpdiscuz"),
"wc_show_replies_text" => esc_html__("View Replies", "wpdiscuz"),
"wc_email_subject" => esc_html__("New Comment", "wpdiscuz"),
"wc_email_message" => __("Hi [SUBSCRIBER_NAME],
new comment has been posted by the [COMMENT_AUTHOR] on the discussion section you've been interested in
[COMMENT_URL]
[COMMENT_CONTENT]
Unsubscribe", "wpdiscuz"),
"wc_all_comment_new_reply_subject" => esc_html__("New Reply", "wpdiscuz"),
"wc_all_comment_new_reply_message" => __("Hi [SUBSCRIBER_NAME],
new reply has been posted by the [COMMENT_AUTHOR] on the discussion section you've been interested in
[COMMENT_URL]
[COMMENT_CONTENT]
Unsubscribe", "wpdiscuz"),
"wc_new_reply_email_subject" => esc_html__("New Reply", "wpdiscuz"),
"wc_new_reply_email_message" => __("Hi [SUBSCRIBER_NAME],
new reply has been posted by the [COMMENT_AUTHOR] on the discussion section you've been interested in
[COMMENT_URL]
[COMMENT_CONTENT]
Unsubscribe", "wpdiscuz"),
"wc_subscribed_on_comment" => esc_html__("You're subscribed for new replies on this comment", "wpdiscuz"),
"wc_subscribed_on_all_comment" => esc_html__("You're subscribed for new replies on all your comments", "wpdiscuz"),
"wc_subscribed_on_post" => esc_html__("You're subscribed for new follow-up comments on this post", "wpdiscuz"),
"wc_unsubscribe" => esc_html__("Unsubscribe", "wpdiscuz"),
"wc_ignore_subscription" => esc_html__("Cancel subscription", "wpdiscuz"),
"wc_unsubscribe_message" => esc_html__("You've successfully unsubscribed.", "wpdiscuz"),
"wc_subscribe_message" => esc_html__("You've successfully subscribed.", "wpdiscuz"),
"wc_confirm_email" => esc_html__("Confirm your subscription", "wpdiscuz"),
"wc_comfirm_success_message" => esc_html__("You've successfully confirmed your subscription.", "wpdiscuz"),
"wc_confirm_email_subject" => esc_html__("Subscription Confirmation", "wpdiscuz"),
"wc_confirm_email_message" => __("Hi,
You just subscribed for new comments on our website. This means you will receive an email when new comments are posted according to subscription option you've chosen.
To activate, click confirm below. If you believe this is an error, ignore this message and we'll never bother you again.
[POST_TITLE]
Confirm Your Subscription
Cancel Subscription", "wpdiscuz"),
"wc_error_empty_text" => esc_html__("please fill out this field to comment", "wpdiscuz"),
"wc_error_email_text" => esc_html__("email address is invalid", "wpdiscuz"),
"wc_error_url_text" => esc_html__("url is invalid", "wpdiscuz"),
"wc_year_text" => esc_html__("year", "wpdiscuz"),
"wc_year_text_plural" => esc_html__("years", "wpdiscuz"), // PLURAL
"wc_month_text" => esc_html__("month", "wpdiscuz"),
"wc_month_text_plural" => esc_html__("months", "wpdiscuz"), // PLURAL
"wc_day_text" => esc_html__("day", "wpdiscuz"),
"wc_day_text_plural" => esc_html__("days", "wpdiscuz"), // PLURAL
"wc_hour_text" => esc_html__("hour", "wpdiscuz"),
"wc_hour_text_plural" => esc_html__("hours", "wpdiscuz"), // PLURAL
"wc_minute_text" => esc_html__("minute", "wpdiscuz"),
"wc_minute_text_plural" => esc_html__("minutes", "wpdiscuz"), // PLURAL
"wc_second_text" => esc_html__("second", "wpdiscuz"),
"wc_second_text_plural" => esc_html__("seconds", "wpdiscuz"), // PLURAL
"wc_right_now_text" => esc_html__("right now", "wpdiscuz"),
"wc_ago_text" => esc_html__("ago", "wpdiscuz"),
"wc_you_must_be_text" => esc_html__("You must be", "wpdiscuz"),
"wc_logged_in_as" => esc_html__("You are logged in as", "wpdiscuz"),
"wc_log_in" => esc_html__("Login", "wpdiscuz"),
"wc_login_please" => esc_html__("Please %s to comment", "wpdiscuz"),
"wc_log_out" => esc_html__("Log out", "wpdiscuz"),
"wc_logged_in_text" => esc_html__("logged in", "wpdiscuz"),
"wc_to_post_comment_text" => esc_html__("to post a comment.", "wpdiscuz"),
"wc_vote_up" => esc_html__("Vote Up", "wpdiscuz"),
"wc_vote_down" => esc_html__("Vote Down", "wpdiscuz"),
"wc_vote_counted" => esc_html__("Vote Counted", "wpdiscuz"),
"wc_vote_only_one_time" => esc_html__("You've already voted for this comment", "wpdiscuz"),
"wc_voting_error" => esc_html__("Voting Error", "wpdiscuz"),
"wc_banned_user" => esc_html__("You are banned", "wpdiscuz"),
"wc_login_to_vote" => esc_html__("You Must Be Logged In To Vote", "wpdiscuz"),
"wc_self_vote" => esc_html__("You cannot vote for your comment", "wpdiscuz"),
"wc_deny_voting_from_same_ip" => esc_html__("You are not allowed to vote for this comment", "wpdiscuz"),
"wc_invalid_captcha" => esc_html__("Invalid Captcha Code", "wpdiscuz"),
"wc_invalid_field" => esc_html__("Some of field value is invalid", "wpdiscuz"),
"wc_awaiting_for_approval" => esc_html__("Awaiting for approval", "wpdiscuz"),
"wc_comment_not_updated" => esc_html__("Sorry, the comment was not updated", "wpdiscuz"),
"wc_comment_edit_not_possible" => esc_html__("Sorry, this comment is no longer possible to edit", "wpdiscuz"),
"wc_comment_not_edited" => esc_html__("You've not made any changes", "wpdiscuz"),
"wc_comment_edit_save_button" => esc_html__("Save", "wpdiscuz"),
"wc_comment_edit_cancel_button" => esc_html__("Cancel", "wpdiscuz"),
"wc_msg_input_min_length" => esc_html__("Input is too short", "wpdiscuz"),
"wc_msg_input_max_length" => esc_html__("Input is too long", "wpdiscuz"),
"wc_read_more" => esc_html__("Read more »", "wpdiscuz"),
"wc_anonymous" => esc_html__("Anonymous", "wpdiscuz"),
"wc_msg_required_fields" => esc_html__("Please fill out required fields", "wpdiscuz"),
"wc_connect_with" => esc_html__("Connect with", "wpdiscuz"),
"wc_subscribed_to" => esc_html__("You're subscribed to", "wpdiscuz"),
"wc_postmatic_subscription_label" => esc_html__("Participate in this discussion via email", "wpdiscuz"),
"wc_form_subscription_submit" => esc_html__("›", "wpdiscuz"),
"wc_comment_approved_email_subject" => esc_html__("Your comment is approved!", "wpdiscuz"),
"wc_comment_approved_email_message" => __('Hi [COMMENT_AUTHOR],
your comment was approved.
[COMMENT_URL]
[COMMENT_CONTENT]', "wpdiscuz"),
"wc_roles_cannot_comment_message" => esc_html__("Comments are closed.", "wpdiscuz"),
"wc_stick_comment_btn_title" => esc_html__("Stick this comment", "wpdiscuz"),
"wc_stick_comment" => esc_html__("Stick", "wpdiscuz"),
"wc_unstick_comment" => esc_html__("Unstick", "wpdiscuz"),
"wc_sticky_comment_icon_title" => esc_html__("Sticky Comment Thread", "wpdiscuz"),
"wc_close_comment_btn_title" => esc_html__("Close this thread", "wpdiscuz"),
"wc_close_comment" => esc_html__("Close", "wpdiscuz"),
"wc_open_comment" => esc_html__("Open", "wpdiscuz"),
"wc_closed_comment_icon_title" => esc_html__("Closed Comment Thread", "wpdiscuz"),
"wc_social_login_agreement_label" => esc_html__("I allow to create an account", "wpdiscuz"),
"wc_social_login_agreement_desc" => esc_html__("When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.", "wpdiscuz"),
"wc_agreement_button_disagree" => esc_html__("Disagree", "wpdiscuz"),
"wc_agreement_button_agree" => esc_html__("Agree", "wpdiscuz"),
"wc_content_and_settings" => esc_html__("My content and settings", "wpdiscuz"),
"wc_user_settings_activity" => esc_html__("Activity", "wpdiscuz"),
"wc_user_settings_subscriptions" => esc_html__("Subscriptions", "wpdiscuz"),
"wc_user_settings_follows" => esc_html__("Follows", "wpdiscuz"),
"wc_user_settings_response_to" => esc_html__("In response to:", "wpdiscuz"),
"wc_user_settings_email_me_delete_links" => esc_html__("Bulk management via email", "wpdiscuz"),
"wc_user_settings_email_me_delete_links_desc" => esc_html__("Click the button above to get an email with bulk delete and unsubscribe links.", "wpdiscuz"),
"wc_user_settings_no_data" => esc_html__("No data found!", "wpdiscuz"),
"wc_user_settings_request_deleting_comments" => esc_html__("Delete all my comments", "wpdiscuz"),
"wc_user_settings_cancel_subscriptions" => esc_html__("Cancel all comment subscriptions", "wpdiscuz"),
"wc_user_settings_clear_cookie" => esc_html__("Clear cookies with my personal data", "wpdiscuz"),
"wc_user_settings_delete_links" => esc_html__("Bulk management via email", "wpdiscuz"),
"wc_user_settings_delete_all_comments" => esc_html__("Delete all my comments", "wpdiscuz"),
"wc_user_settings_delete_all_comments_message" => __('Please use this link to delete all your comments. Please note, that this action cannot be undone.
Delete all my comments
', "wpdiscuz"),
"wc_user_settings_delete_all_subscriptions" => esc_html__("Delete all my subscriptions", "wpdiscuz"),
"wc_user_settings_delete_all_subscriptions_message" => __('Please use this link to cancel all subscriptions for new comments. Please note, that this action cannot be undone.
Delete all my subscriptions
', "wpdiscuz"),
"wc_user_settings_delete_all_follows" => esc_html__("Delete all my follows", "wpdiscuz"),
"wc_user_settings_delete_all_follows_message" => __('Please use this link to cancel all follows for new comments. Please note, that this action cannot be undone.
Delete all my follows
', "wpdiscuz"),
"wc_user_settings_subscribed_to_replies" => esc_html__("subscribed to this comment", "wpdiscuz"),
"wc_user_settings_subscribed_to_replies_own" => esc_html__("subscribed to my comments", "wpdiscuz"),
"wc_user_settings_subscribed_to_all_comments" => esc_html__("subscribed to all follow-up comments of this post", "wpdiscuz"),
"wc_user_settings_check_email" => esc_html__("Please check your email."),
"wc_user_settings_email_error" => esc_html__("Error : Can't send email.", "wpdiscuz"),
"wc_delete_this_comment" => esc_html__("Delete this comment", "wpdiscuz"),
"wc_cancel_this_subscription" => esc_html__("Cancel this subscription", "wpdiscuz"),
"wc_cancel_this_follow" => esc_html__("Cancel this follow", "wpdiscuz"),
"wc_confirm_comment_delete" => esc_html__("Are you sure you want to delete this comment?", "wpdiscuz"),
"wc_confirm_cancel_subscription" => esc_html__("Are you sure you want to cancel this subscription?", "wpdiscuz"),
"wc_confirm_cancel_follow" => esc_html__("Are you sure you want to cancel this follow?", "wpdiscuz"),
"wc_follow_user" => esc_html__("Follow this user", "wpdiscuz"),
"wc_unfollow_user" => esc_html__("Unfollow this user", "wpdiscuz"),
"wc_follow_success" => esc_html__("You started following this comment author", "wpdiscuz"),
"wc_follow_canceled" => esc_html__("You stopped following this comment author.", "wpdiscuz"),
"wc_follow_email_confirm" => esc_html__("Please check your email and confirm the user following request.", "wpdiscuz"),
"wc_follow_email_confirm_fail" => esc_html__("Sorry, we couldn't send confirmation email.", "wpdiscuz"),
"wc_follow_login_to_follow" => esc_html__("Please login to follow users.", "wpdiscuz"),
"wc_follow_impossible" => esc_html__("We are sorry, but you can't follow this user.", "wpdiscuz"),
"wc_follow_not_added" => esc_html__("Following failed. Please try again later.", "wpdiscuz"),
"wc_follow_confirm" => esc_html__("Confirm user following request", "wpdiscuz"),
"wc_follow_cancel" => esc_html__("Cancel user following request", "wpdiscuz"),
"wc_follow_confirm_email_subject" => esc_html__("User Following Confirmation", "wpdiscuz"),
"wc_follow_confirm_email_message" => __('Hi,
You just started following a new user. You\'ll get email notification once new comment is posted by this user.
Please click on "user following confirmation" link to confirm your request. If you believe this is an error, ignore this message and we\'ll never bother you again.
[POST_TITLE]
' . __("Confirm Follow", "wpdiscuz") . '
' . esc_html__("Unfollow", "wpdiscuz") . "", "wpdiscuz"),
"wc_follow_email_subject" => esc_html__("New Comment", "wpdiscuz"),
"wc_follow_email_message" => __('Hi [FOLLOWER_NAME],
new comment has been posted by the [COMMENT_AUTHOR] you are following
[COMMENT_URL]
[COMMENT_CONTENT]
' . esc_html__("Unfollow", "wpdiscuz") . '', "wpdiscuz"),
"wc_mentioned_email_subject" => esc_html__("You have been mentioned in comment", "wpdiscuz"),
"wc_mentioned_email_message" => __('Hi [MENTIONED_USER_NAME]!
You have been mentioned in a comment posted on "[POST_TITLE]" post by [COMMENT_AUTHOR].
Comment URL: [COMMENT_URL]', "wpdiscuz"),
"wc_copied_to_clipboard" => esc_html__("Copied to clipboard!", "wpdiscuz"),
"wc_feedback_shortcode_tooltip" => esc_html__("Select a part of text and ask readers for feedback (inline commenting)", "wpdiscuz"),
"wc_feedback_popup_title" => esc_html__("Ask for Feedback", "wpdiscuz"),
"wc_please_leave_feebdack" => esc_html__("Please leave a feedback on this", "wpdiscuz"),
"wc_feedback_content_text" => "",
"wc_feedback_comment_success" => esc_html__("Thank you for your feedback!", "wpdiscuz"),
"wc_commenting_is_closed" => esc_html__("Commenting is closed!", "wpdiscuz"),
"wc_closed_comment_thread" => esc_html__("This is closed comment thread", "wpdiscuz"),
"wc_bubble_invite_message" => esc_html__("Would love your thoughts, please comment.", "wpdiscuz"),
"wc_vote_phrase" => esc_html__("vote", "wpdiscuz"),
"wc_votes_phrase" => esc_html__("votes", "wpdiscuz"),
"wc_comment_link" => esc_html__("Comment Link", "wpdiscuz"),
"wc_not_allowed_to_comment_more_than" => esc_html__("We are sorry, you are not allowed to comment more than %d time(s)!", "wpdiscuz"),
"wc_not_allowed_to_create_comment_thread_more_than" => esc_html__("We are sorry, you are not allowed to comment more than %d time(s)!", "wpdiscuz"),
"wc_not_allowed_to_reply_more_than" => esc_html__("We are sorry, you are not allowed to reply more than %d time(s)!", "wpdiscuz"),
"wc_inline_form_comment" => esc_html__("Your comment here...", "wpdiscuz"),
"wc_inline_form_notify" => esc_html__("Notify me via email when a new reply is posted", "wpdiscuz"),
"wc_inline_form_name" => esc_html__("Your Name*", "wpdiscuz"),
"wc_inline_form_email" => esc_html__("Your Email", "wpdiscuz"),
"wc_inline_form_comment_button" => esc_html__("COMMENT", "wpdiscuz"),
"wc_inline_comments_view_all" => esc_html__("View all comments", "wpdiscuz"),
"wc_inline_feedbacks" => esc_html__("Inline Feedbacks", "wpdiscuz"),
"wc_unable_sent_email" => esc_html__("Unable to send an email", "wpdiscuz"),
"wc_subscription_fault" => esc_html__("Subscription Fault", "wpdiscuz"),
"wc_comments_are_deleted" => esc_html__("Your comments have been deleted from database", "wpdiscuz"),
"wc_cancel_subs_success" => esc_html__("You cancel all your subscriptions successfully", "wpdiscuz"),
"wc_cancel_follows_success" => esc_html__("You cancel all your follows successfully", "wpdiscuz"),
"wc_follow_confirm_success" => esc_html__("Follow has been confirmed successfully", "wpdiscuz"),
"wc_follow_cancel_success" => esc_html__("Follow has been canceled successfully", "wpdiscuz"),
"wc_login_to_comment" => esc_html__("Please login to comment", "wpdiscuz"),
"wc_view_comments" => esc_html__("View Comments", "wpdiscuz"),
"wc_spoiler" => esc_html__("Spoiler", "wpdiscuz"),
"wc_last_edited" => esc_html__('Last edited %1$s by %2$s', "wpdiscuz"),
"wc_reply_to" => esc_html__("Reply to", "wpdiscuz"),
"wc_manage_comment" => esc_html__("Manage Comment", "wpdiscuz"),
"wc_spoiler_title" => esc_html__("Spoiler Title", "wpdiscuz"),
"wc_cannot_rate_again" => esc_html__("You cannot rate again", "wpdiscuz"),
"wc_not_allowed_to_rate" => esc_html__("You're not allowed to rate here", "wpdiscuz"),
"wc_confirm_rate_edit" => esc_html__("Are you sure you want to edit your rate?", "wpdiscuz"),
// Media Upload
"wmuPhraseConfirmDelete" => esc_html__("Are you sure you want to delete this attachment?", "wpdiscuz"),
"wmuPhraseNotAllowedFile" => esc_html__("Not allowed file type", "wpdiscuz"),
"wmuPhraseMaxFileCount" => esc_html__("Maximum number of uploaded files is", "wpdiscuz"),
"wmuPhraseMaxFileSize" => esc_html__("Maximum upload file size is", "wpdiscuz"),
"wmuPhrasePostMaxSize" => esc_html__("Maximum post size is", "wpdiscuz"),
"wmuPhraseDoingUpload" => esc_html__("Uploading in progress! Please wait.", "wpdiscuz"),
"wmuAttachImage" => esc_html__("Attach an image to this comment", "wpdiscuz"),
"wmuChangeImage" => esc_html__("Change the attached image", "wpdiscuz"),
];
}
/**
* Method to get phrase and apply filter on it for more dynamic control over it
*
* @param $key string key of phrase
* @param array $args custom arguments for filtering
* @return string|null phrase as string (if exists), default phrase (if exists in $args) or null
*/
public function getPhrase($key, $args = [])
{
$args = wp_parse_args($args, [
"default" => null,
"apply_filter" => true,
]);
if (isset($this->phrases[$key])) {
return $args["apply_filter"] ? apply_filters("wpdiscuz_phrase", $this->phrases[$key], $key, $args) : $this->phrases[$key];
}
return $args["default"];
}
public function toArray()
{
$options = [
self::TAB_FORM => [
"commentFormView" => $this->form["commentFormView"],
"enableDropAnimation" => $this->form["enableDropAnimation"],
"richEditor" => $this->form["richEditor"],
"boldButton" => $this->form["boldButton"],
"italicButton" => $this->form["italicButton"],
"underlineButton" => $this->form["underlineButton"],
"strikeButton" => $this->form["strikeButton"],
"olButton" => $this->form["olButton"],
"ulButton" => $this->form["ulButton"],
"blockquoteButton" => $this->form["blockquoteButton"],
"codeblockButton" => $this->form["codeblockButton"],
"linkButton" => $this->form["linkButton"],
"sourcecodeButton" => $this->form["sourcecodeButton"],
"spoilerButton" => $this->form["spoilerButton"],
"enableQuickTags" => $this->form["enableQuickTags"],
"commenterNameMinLength" => $this->form["commenterNameMinLength"],
"commenterNameMaxLength" => $this->form["commenterNameMaxLength"],
"storeCommenterData" => $this->form["storeCommenterData"],
],
self::TAB_RECAPTCHA => [
"siteKey" => $this->recaptcha["siteKey"],
"secretKey" => $this->recaptcha["secretKey"],
"theme" => $this->recaptcha["theme"],
"lang" => $this->recaptcha["lang"],
"requestMethod" => $this->recaptcha["requestMethod"],
"showForGuests" => $this->recaptcha["showForGuests"],
"showForUsers" => $this->recaptcha["showForUsers"],
"isShowOnSubscribeForm" => $this->recaptcha["isShowOnSubscribeForm"],
],
self::TAB_LOGIN => [
"showLoggedInUsername" => $this->login["showLoggedInUsername"],
"showLoginLinkForGuests" => $this->login["showLoginLinkForGuests"],
"showActivityTab" => $this->login["showActivityTab"],
"showSubscriptionsTab" => $this->login["showSubscriptionsTab"],
"showFollowsTab" => $this->login["showFollowsTab"],
"enableProfileURLs" => $this->login["enableProfileURLs"],
"websiteAsProfileUrl" => $this->login["websiteAsProfileUrl"],
"isUserByEmail" => $this->login["isUserByEmail"],
"loginUrl" => $this->login["loginUrl"],
],
self::TAB_SOCIAL => [
"socialLoginAgreementCheckbox" => $this->social["socialLoginAgreementCheckbox"],
"socialLoginInSecondaryForm" => $this->social["socialLoginInSecondaryForm"],
"displaySocialAvatar" => $this->social["displaySocialAvatar"],
"displayIconOnAvatar" => $this->social["displayIconOnAvatar"],
"rememberLoggedinUser" => $this->social["rememberLoggedinUser"],
// fb
"enableFbLogin" => $this->social["enableFbLogin"],
"enableFbShare" => $this->social["enableFbShare"],
"fbAppID" => $this->social["fbAppID"],
"fbAppSecret" => $this->social["fbAppSecret"],
"fbUseOAuth2" => $this->social["fbUseOAuth2"],
// twitter
"enableTwitterLogin" => $this->social["enableTwitterLogin"],
"enableTwitterShare" => $this->social["enableTwitterShare"],
"twitterAppID" => $this->social["twitterAppID"],
"twitterAppSecret" => $this->social["twitterAppSecret"],
// google
"enableGoogleLogin" => $this->social["enableGoogleLogin"],
"googleClientID" => $this->social["googleClientID"],
"googleClientSecret" => $this->social["googleClientSecret"],
// telegram
"enableTelegramLogin" => $this->social["enableTelegramLogin"],
"telegramToken" => $this->social["telegramToken"],
// disqus
"enableDisqusLogin" => $this->social["enableDisqusLogin"],
"disqusPublicKey" => $this->social["disqusPublicKey"],
"disqusSecretKey" => $this->social["disqusSecretKey"],
// wordpress
"enableWordpressLogin" => $this->social["enableWordpressLogin"],
"wordpressClientID" => $this->social["wordpressClientID"],
"wordpressClientSecret" => $this->social["wordpressClientSecret"],
// instagram
"enableInstagramLogin" => $this->social["enableInstagramLogin"],
"instagramAppID" => $this->social["instagramAppID"],
"instagramAppSecret" => $this->social["instagramAppSecret"],
// linkedin
"enableLinkedinLogin" => $this->social["enableLinkedinLogin"],
"enableLinkedinLoginOpenID" => $this->social["enableLinkedinLoginOpenID"],
"linkedinClientID" => $this->social["linkedinClientID"],
"linkedinClientSecret" => $this->social["linkedinClientSecret"],
// whatsapp
"enableWhatsappShare" => $this->social["enableWhatsappShare"],
// yandex
"enableYandexLogin" => $this->social["enableYandexLogin"],
"yandexID" => $this->social["yandexID"],
"yandexPassword" => $this->social["yandexPassword"],
// mail.ru
"enableMailruLogin" => $this->social["enableMailruLogin"],
"mailruClientID" => $this->social["mailruClientID"],
"mailruClientSecret" => $this->social["mailruClientSecret"],
// weibo
"enableWeiboLogin" => $this->social["enableWeiboLogin"],
"weiboKey" => $this->social["weiboKey"],
"weiboSecret" => $this->social["weiboSecret"],
// wechat
"enableWechatLogin" => $this->social["enableWechatLogin"],
"wechatAppID" => $this->social["wechatAppID"],
"wechatSecret" => $this->social["wechatSecret"],
// qq
"enableQQLogin" => $this->social["enableQQLogin"],
"qqAppID" => $this->social["qqAppID"],
"qqSecret" => $this->social["qqSecret"],
// baidu
"enableBaiduLogin" => $this->social["enableBaiduLogin"],
"baiduAppID" => $this->social["baiduAppID"],
"baiduSecret" => $this->social["baiduSecret"],
// vk
"enableVkLogin" => $this->social["enableVkLogin"],
"enableVkShare" => $this->social["enableVkShare"],
"vkAppID" => $this->social["vkAppID"],
"vkAppSecret" => $this->social["vkAppSecret"],
// ok
"enableOkLogin" => $this->social["enableOkLogin"],
"enableOkShare" => $this->social["enableOkShare"],
"okAppID" => $this->social["okAppID"],
"okAppKey" => $this->social["okAppKey"],
"okAppSecret" => $this->social["okAppSecret"],
],
self::TAB_RATING => [
"enablePostRatingSchema" => $this->rating["enablePostRatingSchema"],
"displayRatingOnPost" => $this->rating["displayRatingOnPost"],
"ratingCssOnNoneSingular" => $this->rating["ratingCssOnNoneSingular"],
"ratingHoverColor" => $this->rating["ratingHoverColor"],
"ratingInactiveColor" => $this->rating["ratingInactiveColor"],
"ratingActiveColor" => $this->rating["ratingActiveColor"],
],
self::TAB_THREAD_DISPLAY => [
"firstLoadWithAjax" => $this->thread_display["firstLoadWithAjax"],
"commentListLoadType" => $this->thread_display["commentListLoadType"],
"isLoadOnlyParentComments" => $this->thread_display["isLoadOnlyParentComments"],
"showReactedFilterButton" => $this->thread_display["showReactedFilterButton"],
"showHottestFilterButton" => $this->thread_display["showHottestFilterButton"],
"showSortingButtons" => $this->thread_display["showSortingButtons"],
"mostVotedByDefault" => $this->thread_display["mostVotedByDefault"],
"reverseChildren" => $this->thread_display["reverseChildren"],
"highlightUnreadComments" => $this->thread_display["highlightUnreadComments"],
"scrollToComment" => $this->thread_display["scrollToComment"],
"orderCommentsBy" => $this->thread_display["orderCommentsBy"],
],
self::TAB_THREAD_LAYOUTS => [
"showCommentLink" => $this->thread_layouts["showCommentLink"],
"showCommentDate" => $this->thread_layouts["showCommentDate"],
"showVotingButtons" => $this->thread_layouts["showVotingButtons"],
"votingButtonsIcon" => $this->thread_layouts["votingButtonsIcon"],
"votingButtonsStyle" => $this->thread_layouts["votingButtonsStyle"],
"enableDislikeButton" => $this->thread_layouts["enableDislikeButton"],
"isGuestCanVote" => $this->thread_layouts["isGuestCanVote"],
"highlightVotingButtons" => $this->thread_layouts["highlightVotingButtons"],
"showAvatars" => $this->thread_layouts["showAvatars"],
"defaultAvatarUrlForUser" => $this->thread_layouts["defaultAvatarUrlForUser"],
"defaultAvatarUrlForGuest" => $this->thread_layouts["defaultAvatarUrlForGuest"],
"changeAvatarsEverywhere" => $this->thread_layouts["changeAvatarsEverywhere"],
],
self::TAB_THREAD_STYLES => [
"theme" => $this->thread_styles["theme"],
"primaryColor" => $this->thread_styles["primaryColor"],
"newLoadedCommentBGColor" => $this->thread_styles["newLoadedCommentBGColor"],
"primaryButtonColor" => $this->thread_styles["primaryButtonColor"],
"primaryButtonBG" => $this->thread_styles["primaryButtonBG"],
"bubbleColors" => $this->thread_styles["bubbleColors"],
"inlineFeedbackColors" => $this->thread_styles["inlineFeedbackColors"],
"defaultCommentAreaBG" => $this->thread_styles["defaultCommentAreaBG"],
"defaultCommentTextColor" => $this->thread_styles["defaultCommentTextColor"],
"defaultCommentFieldsBG" => $this->thread_styles["defaultCommentFieldsBG"],
"defaultCommentFieldsBorderColor" => $this->thread_styles["defaultCommentFieldsBorderColor"],
"defaultCommentFieldsTextColor" => $this->thread_styles["defaultCommentFieldsTextColor"],
"defaultCommentFieldsPlaceholderColor" => $this->thread_styles["defaultCommentFieldsPlaceholderColor"],
"darkCommentAreaBG" => $this->thread_styles["darkCommentAreaBG"],
"darkCommentTextColor" => $this->thread_styles["darkCommentTextColor"],
"darkCommentFieldsBG" => $this->thread_styles["darkCommentFieldsBG"],
"darkCommentFieldsBorderColor" => $this->thread_styles["darkCommentFieldsBorderColor"],
"darkCommentFieldsTextColor" => $this->thread_styles["darkCommentFieldsTextColor"],
"darkCommentFieldsPlaceholderColor" => $this->thread_styles["darkCommentFieldsPlaceholderColor"],
"commentTextSize" => $this->thread_styles["commentTextSize"],
"enableFontAwesome" => $this->thread_styles["enableFontAwesome"],
"customCss" => $this->thread_styles["customCss"],
],
self::TAB_SUBSCRIPTION => [
"enableUserMentioning" => $this->subscription["enableUserMentioning"],
"sendMailToMentionedUsers" => $this->subscription["sendMailToMentionedUsers"],
"isNotifyOnCommentApprove" => $this->subscription["isNotifyOnCommentApprove"],
"enableMemberConfirm" => $this->subscription["enableMemberConfirm"],
"enableGuestsConfirm" => $this->subscription["enableGuestsConfirm"],
"subscriptionType" => $this->subscription["subscriptionType"],
"showReplyCheckbox" => $this->subscription["showReplyCheckbox"],
"isReplyDefaultChecked" => $this->subscription["isReplyDefaultChecked"],
"usePostmaticForCommentNotification" => $this->subscription["usePostmaticForCommentNotification"],
"isFollowActive" => $this->subscription["isFollowActive"],
"disableFollowConfirmForUsers" => $this->subscription["disableFollowConfirmForUsers"],
"emailSubjectPostComment" => $this->subscription["emailSubjectPostComment"],
"emailContentPostComment" => $this->subscription["emailContentPostComment"],
"emailSubjectAllCommentReply" => $this->subscription["emailSubjectAllCommentReply"],
"emailContentAllCommentReply" => $this->subscription["emailContentAllCommentReply"],
"emailSubjectCommentReply" => $this->subscription["emailSubjectCommentReply"],
"emailContentCommentReply" => $this->subscription["emailContentCommentReply"],
"emailSubjectSubscriptionConfirmation" => $this->subscription["emailSubjectSubscriptionConfirmation"],
"emailContentSubscriptionConfirmation" => $this->subscription["emailContentSubscriptionConfirmation"],
"emailSubjectCommentApproved" => $this->subscription["emailSubjectCommentApproved"],
"emailContentCommentApproved" => $this->subscription["emailContentCommentApproved"],
"emailSubjectUserMentioned" => $this->subscription["emailSubjectUserMentioned"],
"emailContentUserMentioned" => $this->subscription["emailContentUserMentioned"],
"emailSubjectFollowConfirmation" => $this->subscription["emailSubjectFollowConfirmation"],
"emailContentFollowConfirmation" => $this->subscription["emailContentFollowConfirmation"],
"emailSubjectFollowComment" => $this->subscription["emailSubjectFollowComment"],
"emailContentFollowComment" => $this->subscription["emailContentFollowComment"],
],
self::TAB_LABELS => [
"blogRoleLabels" => $this->labels["blogRoleLabels"],
"blogRoles" => $this->labels["blogRoles"],
],
self::TAB_MODERATION => [
"commentEditableTime" => $this->moderation["commentEditableTime"],
"enableEditingWhenHaveReplies" => $this->moderation["enableEditingWhenHaveReplies"],
"displayEditingInfo" => $this->moderation["displayEditingInfo"],
"enableStickButton" => $this->moderation["enableStickButton"],
"enableCloseButton" => $this->moderation["enableCloseButton"],
"restrictCommentingPerUser" => $this->moderation["restrictCommentingPerUser"],
"commentRestrictionType" => $this->moderation["commentRestrictionType"],
"userCommentsLimit" => $this->moderation["userCommentsLimit"],
],
self::TAB_CONTENT => [
"commentTextMinLength" => $this->content["commentTextMinLength"],
"replyTextMinLength" => $this->content["replyTextMinLength"],
"commentTextMaxLength" => $this->content["commentTextMaxLength"],
"replyTextMaxLength" => $this->content["replyTextMaxLength"],
"enableImageConversion" => $this->content["enableImageConversion"],
"enableShortcodes" => $this->content["enableShortcodes"],
"commentReadMoreLimit" => $this->content["commentReadMoreLimit"],
"wmuIsEnabled" => $this->content["wmuIsEnabled"],
"wmuIsGuestAllowed" => $this->content["wmuIsGuestAllowed"],
"wmuIsLightbox" => $this->content["wmuIsLightbox"],
"wmuMimeTypes" => $this->content["wmuMimeTypes"],
"wmuMaxFileSize" => $this->content["wmuMaxFileSize"],
"wmuIsShowFilesDashboard" => $this->content["wmuIsShowFilesDashboard"],
"wmuSingleImageWidth" => $this->content["wmuSingleImageWidth"],
"wmuSingleImageHeight" => $this->content["wmuSingleImageHeight"],
"wmuThumbnailSizes" => $this->content["wmuThumbnailSizes"],
"wmuIsThumbnailsViaCron" => $this->content["wmuIsThumbnailsViaCron"],
],
self::TAB_LIVE => [
"userInteractionCheck" => $this->live["userInteractionCheck"],
"enableBubble" => $this->live["enableBubble"],
"bubbleLiveUpdate" => $this->live["bubbleLiveUpdate"],
"bubbleLocation" => $this->live["bubbleLocation"],
"bubbleShowNewCommentMessage" => $this->live["bubbleShowNewCommentMessage"],
"bubbleHintTimeout" => $this->live["bubbleHintTimeout"],
"bubbleHintHideTimeout" => $this->live["bubbleHintHideTimeout"],
"commentListUpdateType" => $this->live["commentListUpdateType"],
"liveUpdateGuests" => $this->live["liveUpdateGuests"],
"commentListUpdateTimer" => $this->live["commentListUpdateTimer"],
],
self::TAB_INLINE => [
"showInlineFilterButton" => $this->inline["showInlineFilterButton"],
"inlineFeedbackAttractionType" => $this->inline["inlineFeedbackAttractionType"],
],
self::TAB_GENERAL => [
"isEnableOnHome" => $this->general["isEnableOnHome"],
"isNativeAjaxEnabled" => $this->general["isNativeAjaxEnabled"],
"loadComboVersion" => $this->general["loadComboVersion"],
"loadMinVersion" => $this->general["loadMinVersion"],
"commentLinkFilter" => $this->general["commentLinkFilter"],
"redirectPage" => $this->general["redirectPage"],
"simpleCommentDate" => $this->general["simpleCommentDate"],
"dateDiffFormat" => $this->general["dateDiffFormat"],
"isUsePoMo" => $this->general["isUsePoMo"],
"showPluginPoweredByLink" => $this->general["showPluginPoweredByLink"],
"isCacheEnabled" => $this->general["isCacheEnabled"],
"cacheTimeout" => $this->general["cacheTimeout"],
],
];
return $options;
}
public function updateOptions()
{
update_option(self::OPTION_SLUG_OPTIONS, $this->toArray());
}
public function addOptions()
{
add_option(self::OPTION_SLUG_OPTIONS, $this->getDefaultOptions());
}
public function getDefaultOptions()
{
return [
self::TAB_FORM => [
"commentFormView" => "collapsed",
"enableDropAnimation" => 1,
"richEditor" => "desktop",
"boldButton" => 1,
"italicButton" => 1,
"underlineButton" => 1,
"strikeButton" => 1,
"olButton" => 1,
"ulButton" => 1,
"blockquoteButton" => 1,
"codeblockButton" => 1,
"linkButton" => 1,
"sourcecodeButton" => 1,
"spoilerButton" => 1,
"enableQuickTags" => 0,
"commenterNameMinLength" => 3,
"commenterNameMaxLength" => 50,
"storeCommenterData" => -1,
],
self::TAB_RECAPTCHA => [
"siteKey" => "",
"secretKey" => "",
"theme" => "light",
"lang" => "",
"requestMethod" => "auto",
"showForGuests" => 0,
"showForUsers" => 0,
"isShowOnSubscribeForm" => 0,
],
self::TAB_LOGIN => [
"showLoggedInUsername" => 1,
"showLoginLinkForGuests" => 1,
"showActivityTab" => 1,
"showSubscriptionsTab" => 1,
"showFollowsTab" => 1,
"enableProfileURLs" => 1,
"websiteAsProfileUrl" => 1,
"isUserByEmail" => 0,
"loginUrl" => "",
],
self::TAB_SOCIAL => [
"socialLoginAgreementCheckbox" => 1,
"socialLoginInSecondaryForm" => 0,
"displaySocialAvatar" => 1,
"displayIconOnAvatar" => 1,
"rememberLoggedinUser" => 1,
"enableFbLogin" => 0,
"enableFbShare" => 0,
"fbUseOAuth2" => 0,
"fbAppID" => "",
"fbAppSecret" => "",
"enableTwitterLogin" => 0,
"enableTwitterShare" => 1,
"twitterAppID" => "",
"twitterAppSecret" => "",
"enableGoogleLogin" => 0,
"googleClientID" => "",
"googleClientSecret" => "",
"enableTelegramLogin" => 0,
"telegramToken" => "",
"enableDisqusLogin" => 0,
"disqusPublicKey" => "",
"disqusSecretKey" => "",
"enableWordpressLogin" => 0,
"wordpressClientID" => "",
"wordpressClientSecret" => "",
"enableInstagramLogin" => 0,
"instagramAppID" => "",
"instagramAppSecret" => "",
"enableLinkedinLogin" => 0,
"enableLinkedinLoginOpenID" => 0,
"linkedinClientID" => "",
"linkedinClientSecret" => "",
"enableWhatsappShare" => 0,
"enableYandexLogin" => 0,
"yandexID" => "",
"yandexPassword" => "",
"enableMailruLogin" => 0,
"mailruClientID" => "",
"mailruClientSecret" => "",
"enableWeiboLogin" => 0,
"weiboKey" => "",
"weiboSecret" => "",
"enableWechatLogin" => 0,
"wechatAppID" => "",
"wechatSecret" => "",
"enableQQLogin" => 0,
"qqAppID" => "",
"qqSecret" => "",
"enableBaiduLogin" => 0,
"baiduAppID" => "",
"baiduSecret" => "",
"enableVkLogin" => 0,
"enableVkShare" => 1,
"vkAppID" => "",
"vkAppSecret" => "",
"enableOkLogin" => 0,
"enableOkShare" => 1,
"okAppID" => "",
"okAppKey" => "",
"okAppSecret" => "",
],
self::TAB_RATING => [
"enablePostRatingSchema" => 0,
"displayRatingOnPost" => ["before_comment_form"],
"ratingCssOnNoneSingular" => 0,
"ratingHoverColor" => "#FFED85",
"ratingInactiveColor" => "#DDDDDD",
"ratingActiveColor" => "#FFD700",
],
self::TAB_THREAD_DISPLAY => [
"firstLoadWithAjax" => 0,
"commentListLoadType" => 0,
"isLoadOnlyParentComments" => 0,
"showReactedFilterButton" => 1,
"showHottestFilterButton" => 1,
"showSortingButtons" => 1,
"mostVotedByDefault" => 0,
"reverseChildren" => 0,
"highlightUnreadComments" => 0,
"scrollToComment" => 1,
"orderCommentsBy" => "comment_ID",
],
self::TAB_THREAD_LAYOUTS => [
"showCommentLink" => 1,
"showCommentDate" => 1,
"showVotingButtons" => 1,
"votingButtonsIcon" => "fa-plus|fa-minus",
"votingButtonsStyle" => 0,
"enableDislikeButton" => 1,
"isGuestCanVote" => 1,
"highlightVotingButtons" => 1,
"showAvatars" => 1,
"defaultAvatarUrlForUser" => "",
"defaultAvatarUrlForGuest" => "",
"changeAvatarsEverywhere" => 1,
],
self::TAB_THREAD_STYLES => [
"theme" => "wpd-default",
"primaryColor" => "#00B38F",
"newLoadedCommentBGColor" => "#FFFAD6",
"primaryButtonColor" => "#FFFFFF",
"primaryButtonBG" => "#07B290",
"bubbleColors" => "#1DB99A",
"inlineFeedbackColors" => "#1DB99A",
"defaultCommentAreaBG" => "",
"defaultCommentTextColor" => "#777777",
"defaultCommentFieldsBG" => "",
"defaultCommentFieldsBorderColor" => "#DDDDDD",
"defaultCommentFieldsTextColor" => "#777777",
"defaultCommentFieldsPlaceholderColor" => "",
"darkCommentAreaBG" => "#111111",
"darkCommentTextColor" => "#CCCCCC",
"darkCommentFieldsBG" => "#999999",
"darkCommentFieldsBorderColor" => "#D1D1D1",
"darkCommentFieldsTextColor" => "#000000",
"darkCommentFieldsPlaceholderColor" => "#DDDDDD",
"commentTextSize" => "14px",
"enableFontAwesome" => 1,
"customCss" => ".comments-area{width:auto;}",
],
self::TAB_SUBSCRIPTION => [
"enableUserMentioning" => 1,
"sendMailToMentionedUsers" => 1,
"isNotifyOnCommentApprove" => 1,
"enableMemberConfirm" => 0,
"enableGuestsConfirm" => 1,
"subscriptionType" => 1,
"showReplyCheckbox" => 1,
"isReplyDefaultChecked" => 0,
"usePostmaticForCommentNotification" => 0,
"isFollowActive" => 1,
"disableFollowConfirmForUsers" => 1,
"emailSubjectPostComment" => esc_html__("New Comment", "wpdiscuz"),
"emailContentPostComment" => __("Hi [SUBSCRIBER_NAME],
new comment has been posted by the [COMMENT_AUTHOR] on the discussion section you've been interested in
[COMMENT_URL]
[COMMENT_CONTENT]
Unsubscribe", "wpdiscuz"),
"emailSubjectAllCommentReply" => esc_html__("New Reply ( your comments )", "wpdiscuz"),
"emailContentAllCommentReply" => __("Hi [SUBSCRIBER_NAME],
new reply has been posted by the [COMMENT_AUTHOR] on the discussion section you've been interested in
[COMMENT_URL]
[COMMENT_CONTENT]
Unsubscribe", "wpdiscuz"),
"emailSubjectCommentReply" => esc_html__("New Reply ( your specific comment )", "wpdiscuz"),
"emailContentCommentReply" => __("Hi [SUBSCRIBER_NAME],
new reply has been posted by the [COMMENT_AUTHOR] on the discussion section you've been interested in
[COMMENT_URL]
[COMMENT_CONTENT]
Unsubscribe", "wpdiscuz"),
"emailSubjectSubscriptionConfirmation" => esc_html__("Subscription Confirmation", "wpdiscuz"),
"emailContentSubscriptionConfirmation" => __("Hi,
You just subscribed for new comments on our website. This means you will receive an email when new comments are posted according to subscription option you've chosen.
To activate, click confirm below. If you believe this is an error, ignore this message and we'll never bother you again.
[POST_TITLE]
Confirm Your Subscription
Cancel Subscription", "wpdiscuz"),
"emailSubjectCommentApproved" => esc_html__("Your comment is approved!", "wpdiscuz"),
"emailContentCommentApproved" => __('Hi [COMMENT_AUTHOR],
your comment has been approved.
[COMMENT_URL]
[COMMENT_CONTENT]', "wpdiscuz"),
"emailSubjectUserMentioned" => __('You have been mentioned in comment', "wpdiscuz"),
"emailContentUserMentioned" => __('Hi [MENTIONED_USER_NAME]!
You have been mentioned in a comment posted on "[POST_TITLE]" post by [COMMENT_AUTHOR].
Comment URL: [COMMENT_URL]', "wpdiscuz"),
"emailSubjectFollowConfirmation" => esc_html__('User Following Confirmation', "wpdiscuz"),
"emailContentFollowConfirmation" => __('Hi,
You just started following a new user. You\'ll get email notification once new comment is posted by this user.
Please click on "user following confirmation" link to confirm your request. If you believe this is an error, ignore this message and we\'ll never bother you again.
[POST_TITLE]
Confirm Follow
Unfollow', "wpdiscuz"),
"emailSubjectFollowComment" => esc_html__("New Comment", "wpdiscuz"),
"emailContentFollowComment" => __('Hi [FOLLOWER_NAME],
new comment has been posted by the [COMMENT_AUTHOR] you are following
[COMMENT_URL]
[COMMENT_CONTENT]
Unfollow', "wpdiscuz"),
],
self::TAB_LABELS => [
"blogRoleLabels" => isset($this->labels["blogRoleLabels"]) ? $this->labels["blogRoleLabels"] : [],
"blogRoles" => isset($this->labels["blogRoles"]) ? $this->labels["blogRoles"] : [],
],
self::TAB_MODERATION => [
"commentEditableTime" => 900,
"enableEditingWhenHaveReplies" => 0,
"displayEditingInfo" => 1,
"enableStickButton" => 1,
"enableCloseButton" => 1,
"restrictCommentingPerUser" => "disable",
"commentRestrictionType" => "both",
"userCommentsLimit" => 1,
],
self::TAB_CONTENT => [
"commentTextMinLength" => 1,
"replyTextMinLength" => 1,
"commentTextMaxLength" => "",
"replyTextMaxLength" => "",
"enableImageConversion" => 1,
"enableShortcodes" => 0,
"commentReadMoreLimit" => 0,
"wmuIsEnabled" => 1,
"wmuIsGuestAllowed" => 1,
"wmuIsLightbox" => 1,
"wmuMimeTypes" => $this->getDefaultFileTypes(),
"wmuMaxFileSize" => 2,
"wmuIsShowFilesDashboard" => 1,
"wmuSingleImageWidth" => "auto",
"wmuSingleImageHeight" => 200,
"wmuThumbnailSizes" => $this->getDefaultThumbnailSizes(),
"wmuIsThumbnailsViaCron" => 1,
],
self::TAB_LIVE => [
"userInteractionCheck" => 1,
"enableBubble" => 0,
"bubbleLiveUpdate" => 0,
"bubbleLocation" => "content_left",
"bubbleShowNewCommentMessage" => 1,
"bubbleHintTimeout" => 45,
"bubbleHintHideTimeout" => 10,
"commentListUpdateType" => 0,
"liveUpdateGuests" => 0,
"commentListUpdateTimer" => 60,
],
self::TAB_INLINE => [
"showInlineFilterButton" => 1,
"inlineFeedbackAttractionType" => "blink",
],
self::TAB_GENERAL => [
"isEnableOnHome" => 1,
"isNativeAjaxEnabled" => 1,
"loadComboVersion" => 1,
"loadMinVersion" => 1,
"commentLinkFilter" => 1,
"redirectPage" => 0,
"simpleCommentDate" => 0,
"dateDiffFormat" => "[number] [time_unit] [adjective]",
"isUsePoMo" => 0,
"showPluginPoweredByLink" => 0,
"isCacheEnabled" => 1,
"cacheTimeout" => 10,
],
];
}
public function initPhrasesOnLoad()
{
if (!$this->general["isUsePoMo"] && $this->dbManager->isPhraseExists("wc_be_the_first_text")) {
$this->phrases = $this->dbManager->getPhrases();
} else {
$this->initPhrases();
}
do_action("wpdiscuz_phrases_loaded", $this->phrases);
}
private function initFormRelations()
{
$this->formContentTypeRel = get_option("wpdiscuz_form_content_type_rel", []);
$this->formPostRel = get_option("wpdiscuz_form_post_rel", []);
}
public function reInitFormOptions($new_blog_id, $prev_blog_id, $switch)
{
$this->initFormRelations();
}
public function isShareEnabled()
{
return $this->social["enableFbShare"] || $this->social["enableTwitterShare"] || $this->social["enableVkShare"] || $this->social["enableOkShare"];
}
public function getOptionsForJs()
{
global $post;
$jsArgs = [];
$jsArgs["wc_hide_replies_text"] = esc_html($this->phrases["wc_hide_replies_text"]);
$jsArgs["wc_show_replies_text"] = esc_html($this->phrases["wc_show_replies_text"]);
$jsArgs["wc_msg_required_fields"] = esc_html($this->phrases["wc_msg_required_fields"]);
$jsArgs["wc_invalid_field"] = esc_html($this->phrases["wc_invalid_field"]);
$jsArgs["wc_error_empty_text"] = esc_html($this->phrases["wc_error_empty_text"]);
$jsArgs["wc_error_url_text"] = esc_html($this->phrases["wc_error_url_text"]);
$jsArgs["wc_error_email_text"] = esc_html($this->phrases["wc_error_email_text"]);
$jsArgs["wc_invalid_captcha"] = esc_html($this->phrases["wc_invalid_captcha"]);
$jsArgs["wc_login_to_vote"] = esc_html($this->phrases["wc_login_to_vote"]);
$jsArgs["wc_deny_voting_from_same_ip"] = esc_html($this->phrases["wc_deny_voting_from_same_ip"]);
$jsArgs["wc_self_vote"] = esc_html($this->phrases["wc_self_vote"]);
$jsArgs["wc_vote_only_one_time"] = esc_html($this->phrases["wc_vote_only_one_time"]);
$jsArgs["wc_voting_error"] = esc_html($this->phrases["wc_voting_error"]);
$jsArgs["wc_banned_user"] = isset($this->phrases["wc_banned_user"]) ? esc_html($this->phrases["wc_banned_user"]) : esc_html__("You are banned", "wpdiscuz");
$jsArgs["wc_comment_edit_not_possible"] = esc_html($this->phrases["wc_comment_edit_not_possible"]);
$jsArgs["wc_comment_not_updated"] = esc_html($this->phrases["wc_comment_not_updated"]);
$jsArgs["wc_comment_not_edited"] = esc_html($this->phrases["wc_comment_not_edited"]);
$jsArgs["wc_msg_input_min_length"] = esc_html($this->phrases["wc_msg_input_min_length"]);
$jsArgs["wc_msg_input_max_length"] = esc_html($this->phrases["wc_msg_input_max_length"]);
$jsArgs["wc_spoiler_title"] = esc_html($this->phrases["wc_spoiler_title"]);
$jsArgs["wc_cannot_rate_again"] = esc_html($this->phrases["wc_cannot_rate_again"]);
$jsArgs["wc_not_allowed_to_rate"] = esc_html($this->phrases["wc_not_allowed_to_rate"]);
$jsArgs["wc_confirm_rate_edit"] = esc_html($this->phrases["wc_confirm_rate_edit"]);
//
$jsArgs["is_user_logged_in"] = is_user_logged_in();
$jsArgs["commentListLoadType"] = $this->thread_display["commentListLoadType"];
$jsArgs["commentListUpdateType"] = $this->live["commentListUpdateType"];
$jsArgs["commentListUpdateTimer"] = apply_filters('wpdiscuz_commentlist_liveupdate_timer', $this->live["commentListUpdateTimer"]);
$jsArgs["liveUpdateGuests"] = $this->live["liveUpdateGuests"];
$jsArgs["wordpressThreadCommentsDepth"] = $this->wp["threadCommentsDepth"];
$jsArgs["wordpressIsPaginate"] = $this->wp["isPaginate"];
$jsArgs["commentTextMaxLength"] = $this->content["commentTextMaxLength"] ? $this->content["commentTextMaxLength"] : 0;
$jsArgs["replyTextMaxLength"] = $this->content["replyTextMaxLength"] ? $this->content["replyTextMaxLength"] : 0;
$jsArgs["commentTextMinLength"] = $this->content["commentTextMinLength"];
$jsArgs["replyTextMinLength"] = $this->content["replyTextMinLength"];
if ($this->form["storeCommenterData"] < 0) {
$jsArgs["storeCommenterData"] = 100000;
} else if ($this->form["storeCommenterData"] == 0) {
$jsArgs["storeCommenterData"] = null;
} else {
$jsArgs["storeCommenterData"] = $this->form["storeCommenterData"];
}
if (function_exists("zerospam_get_key")) {
$jsArgs["wpdiscuz_zs"] = md5(zerospam_get_key());
}
$jsArgs["socialLoginAgreementCheckbox"] = $this->social["socialLoginAgreementCheckbox"];
$jsArgs["enableFbLogin"] = $this->social["enableFbLogin"];
$jsArgs["fbUseOAuth2"] = $this->social["fbUseOAuth2"];
$jsArgs["enableFbShare"] = $this->social["enableFbShare"];
$jsArgs["facebookAppID"] = $this->social["fbAppID"];
$jsArgs["facebookUseOAuth2"] = $this->social["fbUseOAuth2"];
$jsArgs["enableGoogleLogin"] = $this->social["enableGoogleLogin"];
$jsArgs["googleClientID"] = $this->social["googleClientID"];
$jsArgs["googleClientSecret"] = $this->social["googleClientSecret"];
$jsArgs["cookiehash"] = COOKIEHASH;
$jsArgs["isLoadOnlyParentComments"] = $this->thread_display["isLoadOnlyParentComments"];
$jsArgs["scrollToComment"] = $this->thread_display["scrollToComment"];
$jsArgs["commentFormView"] = $this->form["commentFormView"];
$jsArgs["enableDropAnimation"] = $this->form["enableDropAnimation"];
$jsArgs["isNativeAjaxEnabled"] = $this->general["isNativeAjaxEnabled"];
$jsArgs["userInteractionCheck"] = $this->live["userInteractionCheck"];
$jsArgs["enableBubble"] = $this->live["enableBubble"];
$jsArgs["bubbleLiveUpdate"] = $this->live["bubbleLiveUpdate"];
$jsArgs["bubbleHintTimeout"] = $this->live["bubbleHintTimeout"];
$jsArgs["bubbleHintHideTimeout"] = $this->live["bubbleHintHideTimeout"];
$jsArgs["cookieHideBubbleHint"] = self::COOKIE_HIDE_BUBBLE_HINT;
$jsArgs["bubbleHintShowOnce"] = apply_filters("wpdiscuz_bubble_hint_show_once", true);
$jsArgs["bubbleHintCookieExpires"] = apply_filters("wpdiscuz_bubble_hint_cookie_expires", 7);
$jsArgs["bubbleShowNewCommentMessage"] = $this->live["bubbleShowNewCommentMessage"];
$jsArgs["bubbleLocation"] = $this->live["bubbleLocation"];
$jsArgs["firstLoadWithAjax"] = $this->thread_display["firstLoadWithAjax"];
$jsArgs["wc_copied_to_clipboard"] = esc_html($this->phrases["wc_copied_to_clipboard"]);
$jsArgs["inlineFeedbackAttractionType"] = $this->inline["inlineFeedbackAttractionType"];
$jsArgs["loadRichEditor"] = intval($this->form["richEditor"] === "both" || (!wp_is_mobile() && $this->form["richEditor"] === "desktop"));
//**reCaptcha**//
$jsArgs["wpDiscuzReCaptchaSK"] = apply_filters("wpdiscuz_recaptcha_site_key", $this->recaptcha["siteKey"]);
$jsArgs["wpDiscuzReCaptchaTheme"] = $this->recaptcha["theme"];
$jsArgs["wpDiscuzReCaptchaVersion"] = apply_filters("wpdiscuz_recaptcha_version", $this->recaptcha["version"]);
$jsArgs["wc_captcha_show_for_guest"] = $this->recaptcha["showForGuests"];
$jsArgs["wc_captcha_show_for_members"] = $this->recaptcha["showForUsers"];
$jsArgs["wpDiscuzIsShowOnSubscribeForm"] = $this->recaptcha["isShowOnSubscribeForm"];
// Media Upload //
$jsArgs["wmuEnabled"] = $this->content["wmuIsEnabled"];
$jsArgs["wmuInput"] = self::INPUT_NAME;
$jsArgs["wmuMaxFileCount"] = 1;
$jsArgs["wmuMaxFileSize"] = $this->content["wmuMaxFileSize"] * 1024 * 1024;
$jsArgs["wmuPostMaxSize"] = $this->wmuPostMaxSize;
$jsArgs["wmuIsLightbox"] = $this->content["wmuIsLightbox"];
$jsArgs["wmuMimeTypes"] = $this->content["wmuMimeTypes"];
$jsArgs["wmuPhraseConfirmDelete"] = esc_html($this->phrases["wmuPhraseConfirmDelete"]);
$jsArgs["wmuPhraseNotAllowedFile"] = esc_html($this->phrases["wmuPhraseNotAllowedFile"]);
$jsArgs["wmuPhraseMaxFileCount"] = esc_html(preg_replace("#(\d+$)#is", "", $this->phrases["wmuPhraseMaxFileCount"]) . " " . apply_filters("wpdiscuz_mu_file_count", 1));
$jsArgs["wmuPhraseMaxFileSize"] = esc_html($this->phrases["wmuPhraseMaxFileSize"] . " " . $this->content["wmuMaxFileSize"] . "MB");
$jsArgs["wmuPhrasePostMaxSize"] = esc_html($this->phrases["wmuPhrasePostMaxSize"] . " " . ($this->wmuPostMaxSize / (1024 * 1024)) . "MB");
$jsArgs["wmuPhraseDoingUpload"] = esc_html($this->phrases["wmuPhraseDoingUpload"]);
$jsArgs["msgEmptyFile"] = esc_html__("File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.");
$jsArgs["msgPostIdNotExists"] = esc_html__("Post ID not exists", "wpdiscuz");
$jsArgs["msgUploadingNotAllowed"] = esc_html__("Sorry, uploading not allowed for this post", "wpdiscuz");
$jsArgs["msgPermissionDenied"] = esc_html__("You do not have sufficient permissions to perform this action", "wpdiscuz");
$jsArgs["wmuKeyImages"] = self::KEY_IMAGES;
$jsArgs["wmuSingleImageWidth"] = $this->content["wmuSingleImageWidth"];
$jsArgs["wmuSingleImageHeight"] = $this->content["wmuSingleImageHeight"];
ob_start();
include_once WPDISCUZ_DIR_PATH . '/utils/layouts/media-preview/preview.php';
$jsArgs["previewTemplate"] = ob_get_clean();
if ($currentUserId = get_current_user_id()) {
$jsArgs["isUserRated"] = $this->dbManager->isUserRated($currentUserId, "", $post->ID);
} else {
$jsArgs["isUserRated"] = $this->dbManager->isUserRated(0, md5(wpDiscuz()->helper->getRealIPAddr()), $post->ID);
}
return $jsArgs;
}
private function initGoodbyeCaptchaField()
{
$this->isGoodbyeCaptchaActive = is_callable([
"GdbcWordPressPublicModule",
"isCommentsProtectionActivated",
]) && GdbcWordPressPublicModule::isCommentsProtectionActivated();
if ($this->isGoodbyeCaptchaActive) {
$this->goodbyeCaptchaTocken = GdbcWordPressPublicModule::getInstance()->getTokenFieldHtml();
}
}
public function editorOptions()
{
ob_start();
?>
var wpdiscuzEditorOptions = {
modules: {
toolbar: "",
counter: {
uniqueID: "",
commentmaxcount : content["commentTextMaxLength"] ? absint($this->content["commentTextMaxLength"]) : 0; ?>,
replymaxcount : content["replyTextMaxLength"] ? absint($this->content["replyTextMaxLength"]) : 0; ?>,
commentmincount : content["commentTextMinLength"]); ?>,
replymincount : content["replyTextMinLength"]); ?>,
},
},
wc_be_the_first_text: getPhrase("wc_be_the_first_text", ["unique_id" => "0_0"])); ?>,
wc_comment_join_text: getPhrase("wc_comment_join_text", ["unique_id" => "0_0"])); ?>,
theme: 'snow',
debug: 'general["loadComboVersion"] || $this->general["loadMinVersion"] ? 'error' : 'warn'; ?>'
};
"wpdiscuz_form",
"post_status" => "publish",
"posts_per_page" => -1,
]);
foreach ($forms as $k => $form) {
$formMeta = get_post_meta($form->ID, "wpdiscuz_form_general_options", true);
$formMeta["layout"] = isset($_POST["layout"]) ? absint($_POST["layout"]) : 1;
update_post_meta($form->ID, "wpdiscuz_form_general_options", $formMeta);
}
$this->thread_styles["theme"] = trim(WpdiscuzHelper::sanitize(INPUT_POST, "theme", "FILTER_SANITIZE_STRING", "wpd-default"));
$this->updateOptions();
} else if ($wizard === 3) {
$this->live["enableBubble"] = isset($_POST["enableBubble"]) ? absint($_POST["enableBubble"]) : 0;
$this->live["bubbleLiveUpdate"] = isset($_POST["bubbleLiveUpdate"]) ? absint($_POST["bubbleLiveUpdate"]) : 0;
$this->live["bubbleLocation"] = trim(WpdiscuzHelper::sanitize(INPUT_POST, "bubbleLocation", "FILTER_SANITIZE_STRING", "content_left"));
$this->updateOptions();
} else if ($wizard === 4) {
$forms = get_posts([
"post_type" => "wpdiscuz_form",
"post_status" => "publish",
"posts_per_page" => -1,
]);
foreach ($forms as $k => $form) {
$formMeta = get_post_meta($form->ID, "wpdiscuz_form_general_options", true);
$formMeta["enable_post_rating"] = isset($_POST["enable_post_rating"]) ? absint($_POST["enable_post_rating"]) : 1;
update_post_meta($form->ID, "wpdiscuz_form_general_options", $formMeta);
}
}
} else {
$this->resetOptions();
$this->saveOptions();
$this->savePhrases();
}
do_action("wpdiscuz_addons_check");
}
public function saveOptions()
{
if (isset($_POST["wc_submit_options"]) && !empty($_POST["wpd_tab"])) {
if (!current_user_can("manage_options")) {
die(esc_html_e("Hacker?", "wpdiscuz"));
}
$defaultOptions = $this->getDefaultOptions();
check_admin_referer("wc_options_form-" . sanitize_text_field($_POST["wpd_tab"]));
if (self::TAB_FORM === sanitize_text_field($_POST["wpd_tab"])) {
$this->form["commentFormView"] = isset($_POST[self::TAB_FORM]["commentFormView"]) ? trim(sanitize_text_field($_POST[self::TAB_FORM]["commentFormView"])) : "collapsed";
$this->form["enableDropAnimation"] = isset($_POST[self::TAB_FORM]["enableDropAnimation"]) ? absint($_POST[self::TAB_FORM]["enableDropAnimation"]) : 0;
$this->form["richEditor"] = isset($_POST[self::TAB_FORM]["richEditor"]) ? trim(sanitize_text_field($_POST[self::TAB_FORM]["richEditor"])) : "desktop";
$this->form["boldButton"] = isset($_POST[self::TAB_FORM]["boldButton"]) ? intval($_POST[self::TAB_FORM]["boldButton"]) : 0;
$this->form["italicButton"] = isset($_POST[self::TAB_FORM]["italicButton"]) ? intval($_POST[self::TAB_FORM]["italicButton"]) : 0;
$this->form["underlineButton"] = isset($_POST[self::TAB_FORM]["underlineButton"]) ? intval($_POST[self::TAB_FORM]["underlineButton"]) : 0;
$this->form["strikeButton"] = isset($_POST[self::TAB_FORM]["strikeButton"]) ? intval($_POST[self::TAB_FORM]["strikeButton"]) : 0;
$this->form["olButton"] = isset($_POST[self::TAB_FORM]["olButton"]) ? intval($_POST[self::TAB_FORM]["olButton"]) : 0;
$this->form["ulButton"] = isset($_POST[self::TAB_FORM]["ulButton"]) ? intval($_POST[self::TAB_FORM]["ulButton"]) : 0;
$this->form["blockquoteButton"] = isset($_POST[self::TAB_FORM]["blockquoteButton"]) ? intval($_POST[self::TAB_FORM]["blockquoteButton"]) : 0;
$this->form["codeblockButton"] = isset($_POST[self::TAB_FORM]["codeblockButton"]) ? intval($_POST[self::TAB_FORM]["codeblockButton"]) : 0;
$this->form["linkButton"] = isset($_POST[self::TAB_FORM]["linkButton"]) ? intval($_POST[self::TAB_FORM]["linkButton"]) : 0;
$this->form["sourcecodeButton"] = isset($_POST[self::TAB_FORM]["sourcecodeButton"]) ? intval($_POST[self::TAB_FORM]["sourcecodeButton"]) : 0;
$this->form["spoilerButton"] = isset($_POST[self::TAB_FORM]["spoilerButton"]) ? intval($_POST[self::TAB_FORM]["spoilerButton"]) : 0;
$this->form["enableQuickTags"] = isset($_POST[self::TAB_FORM]["enableQuickTags"]) ? intval($_POST[self::TAB_FORM]["enableQuickTags"]) : 0;
$this->form["commenterNameMinLength"] = isset($_POST[self::TAB_FORM]["commenterNameMinLength"]) && absint($_POST[self::TAB_FORM]["commenterNameMinLength"]) >= 1 ? absint($_POST[self::TAB_FORM]["commenterNameMinLength"]) : 1;
$this->form["commenterNameMaxLength"] = isset($_POST[self::TAB_FORM]["commenterNameMaxLength"]) && absint($_POST[self::TAB_FORM]["commenterNameMaxLength"]) >= 3 && absint($_POST[self::TAB_FORM]["commenterNameMaxLength"]) <= 50 ? absint($_POST[self::TAB_FORM]["commenterNameMaxLength"]) : 50;
$this->form["storeCommenterData"] = isset($_POST[self::TAB_FORM]["storeCommenterData"]) && (intval($_POST[self::TAB_FORM]["storeCommenterData"]) || $_POST[self::TAB_FORM]["storeCommenterData"] == 0) ? intval($_POST[self::TAB_FORM]["storeCommenterData"]) : -1;
} else if (self::TAB_RECAPTCHA === $_POST["wpd_tab"]) {
$this->recaptcha["siteKey"] = isset($_POST[self::TAB_RECAPTCHA]["siteKey"]) ? trim(sanitize_text_field($_POST[self::TAB_RECAPTCHA]["siteKey"])) : "";
$this->recaptcha["secretKey"] = isset($_POST[self::TAB_RECAPTCHA]["secretKey"]) ? trim(sanitize_text_field($_POST[self::TAB_RECAPTCHA]["secretKey"])) : "";
$this->recaptcha["theme"] = isset($_POST[self::TAB_RECAPTCHA]["theme"]) ? trim(sanitize_text_field($_POST[self::TAB_RECAPTCHA]["theme"])) : "light";
$this->recaptcha["lang"] = isset($_POST[self::TAB_RECAPTCHA]["lang"]) ? trim(sanitize_text_field($_POST[self::TAB_RECAPTCHA]["lang"])) : "";
$this->recaptcha["requestMethod"] = isset($_POST[self::TAB_RECAPTCHA]["requestMethod"]) ? trim(sanitize_text_field($_POST[self::TAB_RECAPTCHA]["requestMethod"])) : "auto";
if (empty($_POST[self::TAB_RECAPTCHA]["useV3"])) {
if ($this->recaptcha["siteKey"] && $this->recaptcha["secretKey"]) {
$this->recaptcha["showForGuests"] = isset($_POST[self::TAB_RECAPTCHA]["showForGuests"]) ? absint($_POST[self::TAB_RECAPTCHA]["showForGuests"]) : 0;
$this->recaptcha["showForUsers"] = isset($_POST[self::TAB_RECAPTCHA]["showForUsers"]) ? absint($_POST[self::TAB_RECAPTCHA]["showForUsers"]) : 0;
$this->recaptcha["isShowOnSubscribeForm"] = isset($_POST[self::TAB_RECAPTCHA]["isShowOnSubscribeForm"]) ? absint($_POST[self::TAB_RECAPTCHA]["isShowOnSubscribeForm"]) : 0;
} else {
$this->recaptcha["showForGuests"] = 0;
$this->recaptcha["showForUsers"] = 0;
$this->recaptcha["isShowOnSubscribeForm"] = 0;
}
} else {
$this->recaptcha["showForGuests"] = isset($_POST[self::TAB_RECAPTCHA]["showForGuests"]) ? absint($_POST[self::TAB_RECAPTCHA]["showForGuests"]) : 0;
$this->recaptcha["showForUsers"] = isset($_POST[self::TAB_RECAPTCHA]["showForUsers"]) ? absint($_POST[self::TAB_RECAPTCHA]["showForUsers"]) : 0;
$this->recaptcha["isShowOnSubscribeForm"] = isset($_POST[self::TAB_RECAPTCHA]["isShowOnSubscribeForm"]) ? absint($_POST[self::TAB_RECAPTCHA]["isShowOnSubscribeForm"]) : 0;
}
} else if (self::TAB_LOGIN === $_POST["wpd_tab"]) {
$this->login["showLoggedInUsername"] = isset($_POST[self::TAB_LOGIN]["showLoggedInUsername"]) ? absint($_POST[self::TAB_LOGIN]["showLoggedInUsername"]) : 0;
$this->login["showLoginLinkForGuests"] = isset($_POST[self::TAB_LOGIN]["showLoginLinkForGuests"]) ? absint($_POST[self::TAB_LOGIN]["showLoginLinkForGuests"]) : 0;
$this->login["showActivityTab"] = isset($_POST[self::TAB_LOGIN]["showActivityTab"]) ? absint($_POST[self::TAB_LOGIN]["showActivityTab"]) : 0;
$this->login["showSubscriptionsTab"] = isset($_POST[self::TAB_LOGIN]["showSubscriptionsTab"]) ? absint($_POST[self::TAB_LOGIN]["showSubscriptionsTab"]) : 0;
$this->login["showFollowsTab"] = isset($_POST[self::TAB_LOGIN]["showFollowsTab"]) ? absint($_POST[self::TAB_LOGIN]["showFollowsTab"]) : 0;
$this->login["enableProfileURLs"] = isset($_POST[self::TAB_LOGIN]["enableProfileURLs"]) ? absint($_POST[self::TAB_LOGIN]["enableProfileURLs"]) : 0;
$this->login["websiteAsProfileUrl"] = isset($_POST[self::TAB_LOGIN]["websiteAsProfileUrl"]) ? absint($_POST[self::TAB_LOGIN]["websiteAsProfileUrl"]) : 0;
$this->login["isUserByEmail"] = isset($_POST[self::TAB_LOGIN]["isUserByEmail"]) ? absint($_POST[self::TAB_LOGIN]["isUserByEmail"]) : 0;
$this->login["loginUrl"] = isset($_POST[self::TAB_LOGIN]["loginUrl"]) && ($l = trim(sanitize_text_field($_POST[self::TAB_LOGIN]["loginUrl"]))) ? $l : "";
} else if (self::TAB_SOCIAL === $_POST["wpd_tab"]) {
$this->social["socialLoginAgreementCheckbox"] = isset($_POST[self::TAB_SOCIAL]["socialLoginAgreementCheckbox"]) ? absint($_POST[self::TAB_SOCIAL]["socialLoginAgreementCheckbox"]) : 0;
$this->social["socialLoginInSecondaryForm"] = isset($_POST[self::TAB_SOCIAL]["socialLoginInSecondaryForm"]) ? absint($_POST[self::TAB_SOCIAL]["socialLoginInSecondaryForm"]) : 0;
$this->social["displaySocialAvatar"] = isset($_POST[self::TAB_SOCIAL]["displaySocialAvatar"]) ? absint($_POST[self::TAB_SOCIAL]["displaySocialAvatar"]) : 0;
$this->social["displayIconOnAvatar"] = isset($_POST[self::TAB_SOCIAL]["displayIconOnAvatar"]) ? absint($_POST[self::TAB_SOCIAL]["displayIconOnAvatar"]) : 0;
$this->social["rememberLoggedinUser"] = isset($_POST[self::TAB_SOCIAL]["rememberLoggedinUser"]) ? absint($_POST[self::TAB_SOCIAL]["rememberLoggedinUser"]) : 0;
// fb
$this->social["enableFbLogin"] = isset($_POST[self::TAB_SOCIAL]["enableFbLogin"]) ? absint($_POST[self::TAB_SOCIAL]["enableFbLogin"]) : 0;
$this->social["enableFbShare"] = isset($_POST[self::TAB_SOCIAL]["enableFbShare"]) ? absint($_POST[self::TAB_SOCIAL]["enableFbShare"]) : 0;
$this->social["fbAppID"] = isset($_POST[self::TAB_SOCIAL]["fbAppID"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["fbAppID"])) : "";
$this->social["fbAppSecret"] = isset($_POST[self::TAB_SOCIAL]["fbAppSecret"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["fbAppSecret"])) : "";
$this->social["fbUseOAuth2"] = isset($_POST[self::TAB_SOCIAL]["fbUseOAuth2"]) ? absint($_POST[self::TAB_SOCIAL]["fbUseOAuth2"]) : 0;
// twitter
$this->social["enableTwitterLogin"] = isset($_POST[self::TAB_SOCIAL]["enableTwitterLogin"]) ? absint($_POST[self::TAB_SOCIAL]["enableTwitterLogin"]) : 0;
$this->social["enableTwitterShare"] = isset($_POST[self::TAB_SOCIAL]["enableTwitterShare"]) ? absint($_POST[self::TAB_SOCIAL]["enableTwitterShare"]) : 0;
$this->social["twitterAppID"] = isset($_POST[self::TAB_SOCIAL]["twitterAppID"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["twitterAppID"])) : "";
$this->social["twitterAppSecret"] = isset($_POST[self::TAB_SOCIAL]["twitterAppSecret"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["twitterAppSecret"])) : "";
// google
$this->social["enableGoogleLogin"] = isset($_POST[self::TAB_SOCIAL]["enableGoogleLogin"]) ? absint($_POST[self::TAB_SOCIAL]["enableGoogleLogin"]) : 0;
$this->social["googleClientID"] = isset($_POST[self::TAB_SOCIAL]["googleClientID"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["googleClientID"])) : "";
$this->social["googleClientSecret"] = isset($_POST[self::TAB_SOCIAL]["googleClientSecret"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["googleClientSecret"])) : "";
// telegram
$this->social["enableTelegramLogin"] = isset($_POST[self::TAB_SOCIAL]["enableTelegramLogin"]) ? absint($_POST[self::TAB_SOCIAL]["enableTelegramLogin"]) : 0;
$this->social["telegramToken"] = isset($_POST[self::TAB_SOCIAL]["telegramToken"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["telegramToken"])) : "";
// disqus
$this->social["enableDisqusLogin"] = isset($_POST[self::TAB_SOCIAL]["enableDisqusLogin"]) ? absint($_POST[self::TAB_SOCIAL]["enableDisqusLogin"]) : 0;
$this->social["disqusPublicKey"] = isset($_POST[self::TAB_SOCIAL]["disqusPublicKey"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["disqusPublicKey"])) : "";
$this->social["disqusSecretKey"] = isset($_POST[self::TAB_SOCIAL]["disqusSecretKey"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["disqusSecretKey"])) : "";
// wordpress
$this->social["enableWordpressLogin"] = isset($_POST[self::TAB_SOCIAL]["enableWordpressLogin"]) ? absint($_POST[self::TAB_SOCIAL]["enableWordpressLogin"]) : 0;
$this->social["wordpressClientID"] = isset($_POST[self::TAB_SOCIAL]["wordpressClientID"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["wordpressClientID"])) : "";
$this->social["wordpressClientSecret"] = isset($_POST[self::TAB_SOCIAL]["wordpressClientSecret"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["wordpressClientSecret"])) : "";
// instagram
$this->social["enableInstagramLogin"] = isset($_POST[self::TAB_SOCIAL]["enableInstagramLogin"]) ? absint($_POST[self::TAB_SOCIAL]["enableInstagramLogin"]) : 0;
$this->social["instagramAppID"] = isset($_POST[self::TAB_SOCIAL]["instagramAppID"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["instagramAppID"])) : "";
$this->social["instagramAppSecret"] = isset($_POST[self::TAB_SOCIAL]["instagramAppSecret"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["instagramAppSecret"])) : "";
// linkedin
$this->social["enableLinkedinLogin"] = isset($_POST[self::TAB_SOCIAL]["enableLinkedinLogin"]) ? absint($_POST[self::TAB_SOCIAL]["enableLinkedinLogin"]) : 0;
$this->social["enableLinkedinLoginOpenID"] = isset($_POST[self::TAB_SOCIAL]["enableLinkedinLoginOpenID"]) ? absint($_POST[self::TAB_SOCIAL]["enableLinkedinLoginOpenID"]) : 0;
$this->social["linkedinClientID"] = isset($_POST[self::TAB_SOCIAL]["linkedinClientID"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["linkedinClientID"])) : "";
$this->social["linkedinClientSecret"] = isset($_POST[self::TAB_SOCIAL]["linkedinClientSecret"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["linkedinClientSecret"])) : "";
// whatsapp
$this->social["enableWhatsappShare"] = isset($_POST[self::TAB_SOCIAL]["enableWhatsappShare"]) ? absint($_POST[self::TAB_SOCIAL]["enableWhatsappShare"]) : 0;
// yandex
$this->social["enableYandexLogin"] = isset($_POST[self::TAB_SOCIAL]["enableYandexLogin"]) ? absint($_POST[self::TAB_SOCIAL]["enableYandexLogin"]) : 0;
$this->social["yandexID"] = isset($_POST[self::TAB_SOCIAL]["yandexID"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["yandexID"])) : "";
$this->social["yandexPassword"] = isset($_POST[self::TAB_SOCIAL]["yandexPassword"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["yandexPassword"])) : "";
// mail.ru
$this->social["enableMailruLogin"] = isset($_POST[self::TAB_SOCIAL]["enableMailruLogin"]) ? absint($_POST[self::TAB_SOCIAL]["enableMailruLogin"]) : 0;
$this->social["mailruClientID"] = isset($_POST[self::TAB_SOCIAL]["mailruClientID"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["mailruClientID"])) : "";
$this->social["mailruClientSecret"] = isset($_POST[self::TAB_SOCIAL]["mailruClientSecret"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["mailruClientSecret"])) : "";
// weibo
$this->social["enableWeiboLogin"] = isset($_POST[self::TAB_SOCIAL]["enableWeiboLogin"]) ? absint($_POST[self::TAB_SOCIAL]["enableWeiboLogin"]) : 0;
$this->social["weiboKey"] = isset($_POST[self::TAB_SOCIAL]["weiboKey"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["weiboKey"])) : "";
$this->social["weiboSecret"] = isset($_POST[self::TAB_SOCIAL]["weiboSecret"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["weiboSecret"])) : "";
// wechat
$this->social["enableWechatLogin"] = isset($_POST[self::TAB_SOCIAL]["enableWechatLogin"]) ? absint($_POST[self::TAB_SOCIAL]["enableWechatLogin"]) : 0;
$this->social["wechatAppID"] = isset($_POST[self::TAB_SOCIAL]["wechatAppID"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["wechatAppID"])) : "";
$this->social["wechatSecret"] = isset($_POST[self::TAB_SOCIAL]["wechatSecret"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["wechatSecret"])) : "";
// qq
$this->social["enableQQLogin"] = isset($_POST[self::TAB_SOCIAL]["enableQQLogin"]) ? absint($_POST[self::TAB_SOCIAL]["enableQQLogin"]) : 0;
$this->social["qqAppID"] = isset($_POST[self::TAB_SOCIAL]["qqAppID"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["qqAppID"])) : "";
$this->social["qqSecret"] = isset($_POST[self::TAB_SOCIAL]["qqSecret"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["qqSecret"])) : "";
// baidu
$this->social["enableBaiduLogin"] = isset($_POST[self::TAB_SOCIAL]["enableBaiduLogin"]) ? absint($_POST[self::TAB_SOCIAL]["enableBaiduLogin"]) : 0;
$this->social["baiduAppID"] = isset($_POST[self::TAB_SOCIAL]["baiduAppID"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["baiduAppID"])) : "";
$this->social["baiduSecret"] = isset($_POST[self::TAB_SOCIAL]["baiduSecret"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["baiduSecret"])) : "";
// vk
$this->social["enableVkLogin"] = isset($_POST[self::TAB_SOCIAL]["enableVkLogin"]) ? absint($_POST[self::TAB_SOCIAL]["enableVkLogin"]) : 0;
$this->social["enableVkShare"] = isset($_POST[self::TAB_SOCIAL]["enableVkShare"]) ? absint($_POST[self::TAB_SOCIAL]["enableVkShare"]) : 0;
$this->social["vkAppID"] = isset($_POST[self::TAB_SOCIAL]["vkAppID"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["vkAppID"])) : "";
$this->social["vkAppSecret"] = isset($_POST[self::TAB_SOCIAL]["vkAppSecret"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["vkAppSecret"])) : "";
// ok
$this->social["enableOkLogin"] = isset($_POST[self::TAB_SOCIAL]["enableOkLogin"]) ? absint($_POST[self::TAB_SOCIAL]["enableOkLogin"]) : 0;
$this->social["enableOkShare"] = isset($_POST[self::TAB_SOCIAL]["enableOkShare"]) ? absint($_POST[self::TAB_SOCIAL]["enableOkShare"]) : 0;
$this->social["okAppID"] = isset($_POST[self::TAB_SOCIAL]["okAppID"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["okAppID"])) : "";
$this->social["okAppKey"] = isset($_POST[self::TAB_SOCIAL]["okAppKey"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["okAppKey"])) : "";
$this->social["okAppSecret"] = isset($_POST[self::TAB_SOCIAL]["okAppSecret"]) ? trim(sanitize_text_field($_POST[self::TAB_SOCIAL]["okAppSecret"])) : "";
} else if (self::TAB_RATING === $_POST["wpd_tab"]) {
$this->rating["enablePostRatingSchema"] = isset($_POST[self::TAB_RATING]["enablePostRatingSchema"]) ? absint($_POST[self::TAB_RATING]["enablePostRatingSchema"]) : 0;
$this->rating["displayRatingOnPost"] = isset($_POST[self::TAB_RATING]["displayRatingOnPost"]) ? $_POST[self::TAB_RATING]["displayRatingOnPost"] : [];
$this->rating["ratingCssOnNoneSingular"] = isset($_POST[self::TAB_RATING]["ratingCssOnNoneSingular"]) ? absint($_POST[self::TAB_RATING]["ratingCssOnNoneSingular"]) : 0;
$this->rating["ratingHoverColor"] = isset($_POST[self::TAB_RATING]["ratingHoverColor"]) ? sanitize_hex_color($_POST[self::TAB_RATING]["ratingHoverColor"]) : "#FFED85";
$this->rating["ratingInactiveColor"] = isset($_POST[self::TAB_RATING]["ratingInactiveColor"]) ? sanitize_hex_color($_POST[self::TAB_RATING]["ratingInactiveColor"]) : "#DDDDDD";
$this->rating["ratingActiveColor"] = isset($_POST[self::TAB_RATING]["ratingActiveColor"]) ? sanitize_hex_color($_POST[self::TAB_RATING]["ratingActiveColor"]) : "#FFD700";
} else if (self::TAB_THREAD_DISPLAY === $_POST["wpd_tab"]) {
$this->thread_display["firstLoadWithAjax"] = isset($_POST[self::TAB_THREAD_DISPLAY]["firstLoadWithAjax"]) ? absint($_POST[self::TAB_THREAD_DISPLAY]["firstLoadWithAjax"]) : 0;
$this->thread_display["commentListLoadType"] = isset($_POST[self::TAB_THREAD_DISPLAY]["commentListLoadType"]) ? absint($_POST[self::TAB_THREAD_DISPLAY]["commentListLoadType"]) : 0;
$this->thread_display["isLoadOnlyParentComments"] = isset($_POST[self::TAB_THREAD_DISPLAY]["isLoadOnlyParentComments"]) ? absint($_POST[self::TAB_THREAD_DISPLAY]["isLoadOnlyParentComments"]) : 0;
$this->thread_display["showReactedFilterButton"] = isset($_POST[self::TAB_THREAD_DISPLAY]["showReactedFilterButton"]) ? absint($_POST[self::TAB_THREAD_DISPLAY]["showReactedFilterButton"]) : 0;
$this->thread_display["showHottestFilterButton"] = isset($_POST[self::TAB_THREAD_DISPLAY]["showHottestFilterButton"]) ? absint($_POST[self::TAB_THREAD_DISPLAY]["showHottestFilterButton"]) : 0;
$this->thread_display["showSortingButtons"] = isset($_POST[self::TAB_THREAD_DISPLAY]["showSortingButtons"]) ? absint($_POST[self::TAB_THREAD_DISPLAY]["showSortingButtons"]) : 0;
$this->thread_display["mostVotedByDefault"] = isset($_POST[self::TAB_THREAD_DISPLAY]["mostVotedByDefault"]) ? absint($_POST[self::TAB_THREAD_DISPLAY]["mostVotedByDefault"]) : 0;
$this->thread_display["reverseChildren"] = isset($_POST[self::TAB_THREAD_DISPLAY]["reverseChildren"]) ? absint($_POST[self::TAB_THREAD_DISPLAY]["reverseChildren"]) : 0;
$this->thread_display["highlightUnreadComments"] = isset($_POST[self::TAB_THREAD_DISPLAY]["highlightUnreadComments"]) ? absint($_POST[self::TAB_THREAD_DISPLAY]["highlightUnreadComments"]) : 0;
$this->thread_display["scrollToComment"] = isset($_POST[self::TAB_THREAD_DISPLAY]["scrollToComment"]) ? absint($_POST[self::TAB_THREAD_DISPLAY]["scrollToComment"]) : 0;
$this->thread_display["orderCommentsBy"] = isset($_POST[self::TAB_THREAD_DISPLAY]["orderCommentsBy"]) && ($o = trim(sanitize_text_field($_POST[self::TAB_THREAD_DISPLAY]["orderCommentsBy"]))) && in_array($o, [
"comment_ID",
"comment_date_gmt",
]) ? $o : "comment_ID";
} else if (self::TAB_THREAD_LAYOUTS === $_POST["wpd_tab"]) {
$this->thread_layouts["showCommentLink"] = isset($_POST[self::TAB_THREAD_LAYOUTS]["showCommentLink"]) ? absint($_POST[self::TAB_THREAD_LAYOUTS]["showCommentLink"]) : 0;
$this->thread_layouts["showCommentDate"] = isset($_POST[self::TAB_THREAD_LAYOUTS]["showCommentDate"]) ? absint($_POST[self::TAB_THREAD_LAYOUTS]["showCommentDate"]) : 0;
$this->thread_layouts["showVotingButtons"] = isset($_POST[self::TAB_THREAD_LAYOUTS]["showVotingButtons"]) ? absint($_POST[self::TAB_THREAD_LAYOUTS]["showVotingButtons"]) : 0;
$this->thread_layouts["votingButtonsIcon"] = isset($_POST[self::TAB_THREAD_LAYOUTS]["votingButtonsIcon"]) ? sanitize_text_field($_POST[self::TAB_THREAD_LAYOUTS]["votingButtonsIcon"]) : "fa-plus|fa-minus";
$this->thread_layouts["votingButtonsStyle"] = isset($_POST[self::TAB_THREAD_LAYOUTS]["votingButtonsStyle"]) ? absint($_POST[self::TAB_THREAD_LAYOUTS]["votingButtonsStyle"]) : 0;
$this->thread_layouts["enableDislikeButton"] = isset($_POST[self::TAB_THREAD_LAYOUTS]["enableDislikeButton"]) ? absint($_POST[self::TAB_THREAD_LAYOUTS]["enableDislikeButton"]) : 0;
$this->thread_layouts["isGuestCanVote"] = isset($_POST[self::TAB_THREAD_LAYOUTS]["isGuestCanVote"]) ? absint($_POST[self::TAB_THREAD_LAYOUTS]["isGuestCanVote"]) : 0;
$this->thread_layouts["highlightVotingButtons"] = isset($_POST[self::TAB_THREAD_LAYOUTS]["highlightVotingButtons"]) ? absint($_POST[self::TAB_THREAD_LAYOUTS]["highlightVotingButtons"]) : 0;
$this->thread_layouts["showAvatars"] = isset($_POST[self::TAB_THREAD_LAYOUTS]["showAvatars"]) ? absint($_POST[self::TAB_THREAD_LAYOUTS]["showAvatars"]) : 0;
$this->thread_layouts["defaultAvatarUrlForUser"] = isset($_POST[self::TAB_THREAD_LAYOUTS]["defaultAvatarUrlForUser"]) ? trim(sanitize_text_field($_POST[self::TAB_THREAD_LAYOUTS]["defaultAvatarUrlForUser"])) : "";
$this->thread_layouts["defaultAvatarUrlForGuest"] = isset($_POST[self::TAB_THREAD_LAYOUTS]["defaultAvatarUrlForGuest"]) ? trim(sanitize_text_field($_POST[self::TAB_THREAD_LAYOUTS]["defaultAvatarUrlForGuest"])) : "";
$this->thread_layouts["changeAvatarsEverywhere"] = isset($_POST[self::TAB_THREAD_LAYOUTS]["changeAvatarsEverywhere"]) ? absint($_POST[self::TAB_THREAD_LAYOUTS]["changeAvatarsEverywhere"]) : 0;
} else if (self::TAB_THREAD_STYLES === $_POST["wpd_tab"]) {
$this->thread_styles["theme"] = isset($_POST[self::TAB_THREAD_STYLES]["theme"]) ? trim(sanitize_text_field($_POST[self::TAB_THREAD_STYLES]["theme"])) : "wpd-default";
$this->thread_styles["primaryColor"] = isset($_POST[self::TAB_THREAD_STYLES]["primaryColor"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["primaryColor"]) : "#00B38F";
$this->thread_styles["newLoadedCommentBGColor"] = isset($_POST[self::TAB_THREAD_STYLES]["newLoadedCommentBGColor"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["newLoadedCommentBGColor"]) : "#FFFAD6";
$this->thread_styles["primaryButtonColor"] = isset($_POST[self::TAB_THREAD_STYLES]["primaryButtonColor"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["primaryButtonColor"]) : "#FFFFFF";
$this->thread_styles["primaryButtonBG"] = isset($_POST[self::TAB_THREAD_STYLES]["primaryButtonBG"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["primaryButtonBG"]) : "#07B290";
$this->thread_styles["bubbleColors"] = isset($_POST[self::TAB_THREAD_STYLES]["bubbleColors"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["bubbleColors"]) : "#1DB99A";
$this->thread_styles["inlineFeedbackColors"] = isset($_POST[self::TAB_THREAD_STYLES]["inlineFeedbackColors"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["inlineFeedbackColors"]) : "#1DB99A";
$this->thread_styles["defaultCommentAreaBG"] = isset($_POST[self::TAB_THREAD_STYLES]["defaultCommentAreaBG"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["defaultCommentAreaBG"]) : "";
$this->thread_styles["defaultCommentTextColor"] = isset($_POST[self::TAB_THREAD_STYLES]["defaultCommentTextColor"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["defaultCommentTextColor"]) : "#777777";
$this->thread_styles["defaultCommentFieldsBG"] = isset($_POST[self::TAB_THREAD_STYLES]["defaultCommentFieldsBG"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["defaultCommentFieldsBG"]) : "";
$this->thread_styles["defaultCommentFieldsBorderColor"] = isset($_POST[self::TAB_THREAD_STYLES]["defaultCommentFieldsBorderColor"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["defaultCommentFieldsBorderColor"]) : "#DDDDDD";
$this->thread_styles["defaultCommentFieldsTextColor"] = isset($_POST[self::TAB_THREAD_STYLES]["defaultCommentFieldsTextColor"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["defaultCommentFieldsTextColor"]) : "#777777";
$this->thread_styles["defaultCommentFieldsPlaceholderColor"] = isset($_POST[self::TAB_THREAD_STYLES]["defaultCommentFieldsPlaceholderColor"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["defaultCommentFieldsPlaceholderColor"]) : "";
$this->thread_styles["darkCommentAreaBG"] = isset($_POST[self::TAB_THREAD_STYLES]["darkCommentAreaBG"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["darkCommentAreaBG"]) : "#111111";
$this->thread_styles["darkCommentTextColor"] = isset($_POST[self::TAB_THREAD_STYLES]["darkCommentTextColor"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["darkCommentTextColor"]) : "#CCCCCC";
$this->thread_styles["darkCommentFieldsBG"] = isset($_POST[self::TAB_THREAD_STYLES]["darkCommentFieldsBG"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["darkCommentFieldsBG"]) : "#999999";
$this->thread_styles["darkCommentFieldsBorderColor"] = isset($_POST[self::TAB_THREAD_STYLES]["darkCommentFieldsBorderColor"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["darkCommentFieldsBorderColor"]) : "#D1D1D1";
$this->thread_styles["darkCommentFieldsTextColor"] = isset($_POST[self::TAB_THREAD_STYLES]["darkCommentFieldsTextColor"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["darkCommentFieldsTextColor"]) : "#000000";
$this->thread_styles["darkCommentFieldsPlaceholderColor"] = isset($_POST[self::TAB_THREAD_STYLES]["darkCommentFieldsPlaceholderColor"]) ? sanitize_hex_color($_POST[self::TAB_THREAD_STYLES]["darkCommentFieldsPlaceholderColor"]) : "#DDDDDD";
$this->thread_styles["commentTextSize"] = isset($_POST[self::TAB_THREAD_STYLES]["commentTextSize"]) ? sanitize_term_field($_POST[self::TAB_THREAD_STYLES]["commentTextSize"]) : "14px";
$this->thread_styles["enableFontAwesome"] = isset($_POST[self::TAB_THREAD_STYLES]["enableFontAwesome"]) ? absint($_POST[self::TAB_THREAD_STYLES]["enableFontAwesome"]) : 0;
$this->thread_styles["customCss"] = isset($_POST[self::TAB_THREAD_STYLES]["customCss"]) ? sanitize_textarea_field($_POST[self::TAB_THREAD_STYLES]["customCss"]) : ".comments-area{width:auto;}";
} else if (self::TAB_SUBSCRIPTION === $_POST["wpd_tab"]) {
$this->subscription["enableUserMentioning"] = isset($_POST[self::TAB_SUBSCRIPTION]["enableUserMentioning"]) ? absint($_POST[self::TAB_SUBSCRIPTION]["enableUserMentioning"]) : 0;
$this->subscription["sendMailToMentionedUsers"] = isset($_POST[self::TAB_SUBSCRIPTION]["sendMailToMentionedUsers"]) ? absint($_POST[self::TAB_SUBSCRIPTION]["sendMailToMentionedUsers"]) : 0;
$this->subscription["isNotifyOnCommentApprove"] = isset($_POST[self::TAB_SUBSCRIPTION]["isNotifyOnCommentApprove"]) ? absint($_POST[self::TAB_SUBSCRIPTION]["isNotifyOnCommentApprove"]) : 0;
$this->subscription["enableMemberConfirm"] = isset($_POST[self::TAB_SUBSCRIPTION]["enableMemberConfirm"]) ? absint($_POST[self::TAB_SUBSCRIPTION]["enableMemberConfirm"]) : 0;
$this->subscription["enableGuestsConfirm"] = isset($_POST[self::TAB_SUBSCRIPTION]["enableGuestsConfirm"]) ? absint($_POST[self::TAB_SUBSCRIPTION]["enableGuestsConfirm"]) : 0;
$this->subscription["subscriptionType"] = isset($_POST[self::TAB_SUBSCRIPTION]["subscriptionType"]) ? absint($_POST[self::TAB_SUBSCRIPTION]["subscriptionType"]) : 1;
$this->subscription["showReplyCheckbox"] = isset($_POST[self::TAB_SUBSCRIPTION]["showReplyCheckbox"]) ? absint($_POST[self::TAB_SUBSCRIPTION]["showReplyCheckbox"]) : 0;
$this->subscription["isReplyDefaultChecked"] = isset($_POST[self::TAB_SUBSCRIPTION]["isReplyDefaultChecked"]) ? absint($_POST[self::TAB_SUBSCRIPTION]["isReplyDefaultChecked"]) : 0;
$this->subscription["usePostmaticForCommentNotification"] = isset($_POST[self::TAB_SUBSCRIPTION]["usePostmaticForCommentNotification"]) ? absint($_POST[self::TAB_SUBSCRIPTION]["usePostmaticForCommentNotification"]) : 0;
$this->subscription["isFollowActive"] = isset($_POST[self::TAB_SUBSCRIPTION]["isFollowActive"]) ? absint($_POST[self::TAB_SUBSCRIPTION]["isFollowActive"]) : 0;
$this->subscription["disableFollowConfirmForUsers"] = isset($_POST[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"]) ? absint($_POST[self::TAB_SUBSCRIPTION]["disableFollowConfirmForUsers"]) : 0;
$this->subscription["emailSubjectPostComment"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailSubjectPostComment"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailSubjectPostComment"])) : wp_kses_post(wp_unslash($defaultOptions['emailSubjectPostComment']));
$this->subscription["emailContentPostComment"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailContentPostComment"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailContentPostComment"])) : wp_kses_post(wp_unslash($defaultOptions['emailContentPostComment']));
$this->subscription["emailSubjectAllCommentReply"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailSubjectAllCommentReply"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailSubjectAllCommentReply"])) : wp_kses_post(wp_unslash($defaultOptions['emailSubjectAllCommentReply']));
$this->subscription["emailContentAllCommentReply"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailContentAllCommentReply"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailContentAllCommentReply"])) : wp_kses_post(wp_unslash($defaultOptions['emailContentAllCommentReply']));
$this->subscription["emailSubjectCommentReply"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailSubjectCommentReply"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailSubjectCommentReply"])) : wp_kses_post(wp_unslash($defaultOptions['emailSubjectCommentReply']));
$this->subscription["emailContentCommentReply"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailContentCommentReply"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailContentCommentReply"])) : wp_kses_post(wp_unslash($defaultOptions['emailContentCommentReply']));
$this->subscription["emailSubjectSubscriptionConfirmation"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailSubjectSubscriptionConfirmation"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailSubjectSubscriptionConfirmation"])) : wp_kses_post(wp_unslash($defaultOptions['emailSubjectSubscriptionConfirmation']));
$this->subscription["emailContentSubscriptionConfirmation"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailContentSubscriptionConfirmation"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailContentSubscriptionConfirmation"])) : wp_kses_post(wp_unslash($defaultOptions['emailContentSubscriptionConfirmation']));
$this->subscription["emailSubjectCommentApproved"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailSubjectCommentApproved"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailSubjectCommentApproved"])) : wp_kses_post(wp_unslash($defaultOptions['emailSubjectCommentApproved']));
$this->subscription["emailContentCommentApproved"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailContentCommentApproved"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailContentCommentApproved"])) : wp_kses_post(wp_unslash($defaultOptions['emailContentCommentApproved']));
$this->subscription["emailSubjectUserMentioned"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailSubjectUserMentioned"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailSubjectUserMentioned"])) : wp_kses_post(wp_unslash($defaultOptions['emailSubjectUserMentioned']));
$this->subscription["emailContentUserMentioned"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailContentUserMentioned"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailContentUserMentioned"])) : wp_kses_post(wp_unslash($defaultOptions['emailContentUserMentioned']));
$this->subscription["emailSubjectFollowConfirmation"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailSubjectFollowConfirmation"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailSubjectFollowConfirmation"])) : wp_kses_post(wp_unslash($defaultOptions['emailSubjectFollowConfirmation']));
$this->subscription["emailContentFollowConfirmation"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailContentFollowConfirmation"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailContentFollowConfirmation"])) : wp_kses_post(wp_unslash($defaultOptions['emailContentFollowConfirmation']));
$this->subscription["emailSubjectFollowComment"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailSubjectFollowComment"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailSubjectFollowComment"])) : wp_kses_post(wp_unslash($defaultOptions['emailSubjectFollowComment']));
$this->subscription["emailContentFollowComment"] = isset($_POST[self::TAB_SUBSCRIPTION]["emailContentFollowComment"]) ? wp_kses_post(wp_unslash($_POST[self::TAB_SUBSCRIPTION]["emailContentFollowComment"])) : wp_kses_post(wp_unslash($defaultOptions['emailContentFollowComment']));
} else if (self::TAB_LABELS === $_POST["wpd_tab"]) {
$emptyRolesArray = array_combine(array_keys($this->labels["blogRoleLabels"]), array_pad([], count($this->labels["blogRoleLabels"]), 0));
$this->labels["blogRoleLabels"] = isset($_POST[self::TAB_LABELS]["blogRoleLabels"]) ? wp_parse_args($_POST[self::TAB_LABELS]["blogRoleLabels"], $emptyRolesArray) : $emptyRolesArray;
$this->labels["blogRoles"] = isset($_POST[self::TAB_LABELS]["blogRoles"]) ? wp_parse_args($_POST[self::TAB_LABELS]["blogRoles"], $this->labels["blogRoles"]) : $this->labels["blogRoles"];
} else if (self::TAB_MODERATION === $_POST["wpd_tab"]) {
$this->moderation["commentEditableTime"] = isset($_POST[self::TAB_MODERATION]["commentEditableTime"]) ? sanitize_text_field($_POST[self::TAB_MODERATION]["commentEditableTime"]) : 900;
$this->moderation["enableEditingWhenHaveReplies"] = isset($_POST[self::TAB_MODERATION]["enableEditingWhenHaveReplies"]) ? absint($_POST[self::TAB_MODERATION]["enableEditingWhenHaveReplies"]) : 0;
$this->moderation["displayEditingInfo"] = isset($_POST[self::TAB_MODERATION]["displayEditingInfo"]) ? absint($_POST[self::TAB_MODERATION]["displayEditingInfo"]) : 0;
$this->moderation["enableStickButton"] = isset($_POST[self::TAB_MODERATION]["enableStickButton"]) ? absint($_POST[self::TAB_MODERATION]["enableStickButton"]) : 0;
$this->moderation["enableCloseButton"] = isset($_POST[self::TAB_MODERATION]["enableCloseButton"]) ? absint($_POST[self::TAB_MODERATION]["enableCloseButton"]) : 0;
$this->moderation["restrictCommentingPerUser"] = isset($_POST[self::TAB_MODERATION]["restrictCommentingPerUser"]) ? trim(sanitize_text_field($_POST[self::TAB_MODERATION]["restrictCommentingPerUser"])) : "disable";
$this->moderation["commentRestrictionType"] = isset($_POST[self::TAB_MODERATION]["commentRestrictionType"]) ? trim(sanitize_text_field($_POST[self::TAB_MODERATION]["commentRestrictionType"])) : "both";
$this->moderation["userCommentsLimit"] = isset($_POST[self::TAB_MODERATION]["userCommentsLimit"]) ? absint($_POST[self::TAB_MODERATION]["userCommentsLimit"]) : 1;
} else if (self::TAB_CONTENT === $_POST["wpd_tab"]) {
$this->content["commentTextMinLength"] = isset($_POST[self::TAB_CONTENT]["commentTextMinLength"]) && absint($_POST[self::TAB_CONTENT]["commentTextMinLength"]) > 0 ? absint($_POST[self::TAB_CONTENT]["commentTextMinLength"]) : 0;
$this->content["replyTextMinLength"] = isset($_POST[self::TAB_CONTENT]["replyTextMinLength"]) && absint($_POST[self::TAB_CONTENT]["replyTextMinLength"]) > 0 ? absint($_POST[self::TAB_CONTENT]["replyTextMinLength"]) : 0;
$this->content["commentTextMaxLength"] = isset($_POST[self::TAB_CONTENT]["commentTextMaxLength"]) && absint($_POST[self::TAB_CONTENT]["commentTextMaxLength"]) > 0 ? absint($_POST[self::TAB_CONTENT]["commentTextMaxLength"]) : "";
$this->content["replyTextMaxLength"] = isset($_POST[self::TAB_CONTENT]["replyTextMaxLength"]) && absint($_POST[self::TAB_CONTENT]["replyTextMaxLength"]) > 0 ? absint($_POST[self::TAB_CONTENT]["replyTextMaxLength"]) : "";
$this->content["enableImageConversion"] = isset($_POST[self::TAB_CONTENT]["enableImageConversion"]) ? absint($_POST[self::TAB_CONTENT]["enableImageConversion"]) : 0;
$this->content["enableShortcodes"] = isset($_POST[self::TAB_CONTENT]["enableShortcodes"]) ? absint($_POST[self::TAB_CONTENT]["enableShortcodes"]) : 0;
$this->content["commentReadMoreLimit"] = isset($_POST[self::TAB_CONTENT]["commentReadMoreLimit"]) && absint($_POST[self::TAB_CONTENT]["commentReadMoreLimit"]) >= 0 ? absint($_POST[self::TAB_CONTENT]["commentReadMoreLimit"]) : 0;
$this->content["wmuIsEnabled"] = isset($_POST[self::TAB_CONTENT]["wmuIsEnabled"]) ? absint($_POST[self::TAB_CONTENT]["wmuIsEnabled"]) : 0;
$this->content["wmuIsGuestAllowed"] = isset($_POST[self::TAB_CONTENT]["wmuIsGuestAllowed"]) ? absint($_POST[self::TAB_CONTENT]["wmuIsGuestAllowed"]) : 0;
$this->content["wmuIsLightbox"] = isset($_POST[self::TAB_CONTENT]["wmuIsLightbox"]) ? absint($_POST[self::TAB_CONTENT]["wmuIsLightbox"]) : 0;
$this->content["wmuMimeTypes"] = isset($_POST[self::TAB_CONTENT]["wmuMimeTypes"]) ? $_POST[self::TAB_CONTENT]["wmuMimeTypes"] : [];
$this->content["wmuMaxFileSize"] = isset($_POST[self::TAB_CONTENT]["wmuMaxFileSize"]) ? absint($_POST[self::TAB_CONTENT]["wmuMaxFileSize"]) : $this->wmuUploadMaxFileSize / (1024 * 1024);
$this->content["wmuIsShowFilesDashboard"] = isset($_POST[self::TAB_CONTENT]["wmuIsShowFilesDashboard"]) ? absint($_POST[self::TAB_CONTENT]["wmuIsShowFilesDashboard"]) : 0;
$this->content["wmuSingleImageWidth"] = isset($_POST[self::TAB_CONTENT]["wmuSingleImageWidth"]) && ($v = trim(sanitize_text_field($_POST[self::TAB_CONTENT]["wmuSingleImageWidth"]))) && ($v === "auto" || ($v = absint($v))) ? $v : 320;
$this->content["wmuSingleImageHeight"] = isset($_POST[self::TAB_CONTENT]["wmuSingleImageHeight"]) && ($v = trim(sanitize_text_field($_POST[self::TAB_CONTENT]["wmuSingleImageHeight"]))) && ($v === "auto" || ($v = absint($v))) ? $v : 200;
$this->content["wmuThumbnailSizes"] = isset($_POST[self::TAB_CONTENT]["wmuThumbnailSizes"]) && is_array($_POST[self::TAB_CONTENT]["wmuThumbnailSizes"]) && ($sizes = array_filter($_POST[self::TAB_CONTENT]["wmuThumbnailSizes"])) ? $sizes : [];
$this->content["wmuIsThumbnailsViaCron"] = isset($_POST[self::TAB_CONTENT]["wmuIsThumbnailsViaCron"]) ? absint($_POST[self::TAB_CONTENT]["wmuIsThumbnailsViaCron"]) : 0;
} else if (self::TAB_LIVE === $_POST["wpd_tab"]) {
$this->live["userInteractionCheck"] = isset($_POST[self::TAB_LIVE]["userInteractionCheck"]) ? absint($_POST[self::TAB_LIVE]["userInteractionCheck"]) : 0;
$this->live["enableBubble"] = isset($_POST[self::TAB_LIVE]["enableBubble"]) ? absint($_POST[self::TAB_LIVE]["enableBubble"]) : 0;
$this->live["bubbleLiveUpdate"] = isset($_POST[self::TAB_LIVE]["bubbleLiveUpdate"]) ? absint($_POST[self::TAB_LIVE]["bubbleLiveUpdate"]) : 0;
$this->live["bubbleLocation"] = isset($_POST[self::TAB_LIVE]["bubbleLocation"]) ? trim(sanitize_text_field($_POST[self::TAB_LIVE]["bubbleLocation"])) : "content_left";
$this->live["bubbleShowNewCommentMessage"] = isset($_POST[self::TAB_LIVE]["bubbleShowNewCommentMessage"]) ? absint($_POST[self::TAB_LIVE]["bubbleShowNewCommentMessage"]) : 0;
$this->live["bubbleHintTimeout"] = isset($_POST[self::TAB_LIVE]["bubbleHintTimeout"]) ? absint($_POST[self::TAB_LIVE]["bubbleHintTimeout"]) : 0;
$this->live["bubbleHintHideTimeout"] = isset($_POST[self::TAB_LIVE]["bubbleHintHideTimeout"]) ? absint($_POST[self::TAB_LIVE]["bubbleHintHideTimeout"]) : 0;
$this->live["commentListUpdateType"] = isset($_POST[self::TAB_LIVE]["commentListUpdateType"]) ? absint($_POST[self::TAB_LIVE]["commentListUpdateType"]) : 0;
$this->live["liveUpdateGuests"] = isset($_POST[self::TAB_LIVE]["liveUpdateGuests"]) ? absint($_POST[self::TAB_LIVE]["liveUpdateGuests"]) : 0;
$this->live["commentListUpdateTimer"] = isset($_POST[self::TAB_LIVE]["commentListUpdateTimer"]) ? absint($_POST[self::TAB_LIVE]["commentListUpdateTimer"]) : 30;
} else if (self::TAB_INLINE === $_POST["wpd_tab"]) {
$this->inline["showInlineFilterButton"] = isset($_POST[self::TAB_INLINE]["showInlineFilterButton"]) ? absint($_POST[self::TAB_INLINE]["showInlineFilterButton"]) : 0;
$this->inline["inlineFeedbackAttractionType"] = isset($_POST[self::TAB_INLINE]["inlineFeedbackAttractionType"]) ? trim(sanitize_text_field($_POST[self::TAB_INLINE]["inlineFeedbackAttractionType"])) : "disable";
} else if (self::TAB_GENERAL === $_POST["wpd_tab"]) {
$this->general["isEnableOnHome"] = isset($_POST[self::TAB_GENERAL]["isEnableOnHome"]) ? absint($_POST[self::TAB_GENERAL]["isEnableOnHome"]) : 0;
$this->general["isNativeAjaxEnabled"] = isset($_POST[self::TAB_GENERAL]["isNativeAjaxEnabled"]) ? absint($_POST[self::TAB_GENERAL]["isNativeAjaxEnabled"]) : 0;
$this->general["loadComboVersion"] = isset($_POST[self::TAB_GENERAL]["loadComboVersion"]) ? absint($_POST[self::TAB_GENERAL]["loadComboVersion"]) : 0;
$this->general["loadMinVersion"] = isset($_POST[self::TAB_GENERAL]["loadMinVersion"]) ? absint($_POST[self::TAB_GENERAL]["loadMinVersion"]) : 0;
$this->general["commentLinkFilter"] = isset($_POST[self::TAB_GENERAL]["commentLinkFilter"]) ? absint($_POST[self::TAB_GENERAL]["commentLinkFilter"]) : 1;
$this->general["simpleCommentDate"] = isset($_POST[self::TAB_GENERAL]["simpleCommentDate"]) ? absint($_POST[self::TAB_GENERAL]["simpleCommentDate"]) : 0;
$this->general["dateDiffFormat"] = isset($_POST[self::TAB_GENERAL]["dateDiffFormat"]) ? trim($_POST[self::TAB_GENERAL]["dateDiffFormat"]) : "";
$this->general["isUsePoMo"] = isset($_POST[self::TAB_GENERAL]["isUsePoMo"]) ? absint($_POST[self::TAB_GENERAL]["isUsePoMo"]) : 0;
$this->general["showPluginPoweredByLink"] = isset($_POST[self::TAB_GENERAL]["showPluginPoweredByLink"]) ? absint($_POST[self::TAB_GENERAL]["showPluginPoweredByLink"]) : 0;
$this->general["redirectPage"] = isset($_POST[self::TAB_GENERAL]["redirectPage"]) ? absint($_POST[self::TAB_GENERAL]["redirectPage"]) : 0;
$this->general["isCacheEnabled"] = isset($_POST[self::TAB_GENERAL]["isCacheEnabled"]) ? absint($_POST[self::TAB_GENERAL]["isCacheEnabled"]) : 0;
$this->general["cacheTimeout"] = isset($_POST[self::TAB_GENERAL]["cacheTimeout"]) ? absint($_POST[self::TAB_GENERAL]["cacheTimeout"]) : 10;
}
do_action("wpdiscuz_save_options");
$this->updateOptions();
do_action("wpdiscuz_reset_comments_cache");
do_action("wpdiscuz_reset_users_cache");
}
}
public function savePhrases()
{
if (isset($_POST["wc_submit_phrases"])) {
if (!current_user_can("manage_options")) {
die(esc_html_e("Hacker?", "wpdiscuz"));
}
check_admin_referer("wc_phrases_form");
$this->phrases["wc_be_the_first_text"] = sanitize_text_field($_POST["wc_be_the_first_text"]);
$this->phrases["wc_comment_start_text"] = sanitize_text_field($_POST["wc_comment_start_text"]);
$this->phrases["wc_comment_join_text"] = sanitize_text_field($_POST["wc_comment_join_text"]);
$this->phrases["wc_content_and_settings"] = sanitize_text_field($_POST["wc_content_and_settings"]);
$this->phrases["wc_hottest_comment_thread"] = sanitize_text_field($_POST["wc_hottest_comment_thread"]);
$this->phrases["wc_most_reacted_comment"] = sanitize_text_field($_POST["wc_most_reacted_comment"]);
$this->phrases["wc_inline_comments"] = sanitize_text_field($_POST["wc_inline_comments"]);
$this->phrases["wc_email_text"] = sanitize_text_field($_POST["wc_email_text"]);
$this->phrases["wc_subscribe_anchor"] = sanitize_text_field($_POST["wc_subscribe_anchor"]);
$this->phrases["wc_notify_of"] = sanitize_text_field($_POST["wc_notify_of"]);
$this->phrases["wc_notify_on_new_comment"] = sanitize_text_field($_POST["wc_notify_on_new_comment"]);
$this->phrases["wc_notify_on_all_new_reply"] = sanitize_text_field($_POST["wc_notify_on_all_new_reply"]);
$this->phrases["wc_notify_on_new_reply"] = sanitize_text_field($_POST["wc_notify_on_new_reply"]);
$this->phrases["wc_newest"] = sanitize_text_field($_POST["wc_newest"]);
$this->phrases["wc_oldest"] = sanitize_text_field($_POST["wc_oldest"]);
$this->phrases["wc_most_voted"] = sanitize_text_field($_POST["wc_most_voted"]);
$this->phrases["wc_load_more_submit_text"] = sanitize_text_field($_POST["wc_load_more_submit_text"]);
$this->phrases["wc_load_rest_comments_submit_text"] = sanitize_text_field($_POST["wc_load_rest_comments_submit_text"]);
$this->phrases["wc_reply_text"] = sanitize_text_field($_POST["wc_reply_text"]);
$this->phrases["wc_share_text"] = sanitize_text_field($_POST["wc_share_text"]);
$this->phrases["wc_edit_text"] = sanitize_text_field($_POST["wc_edit_text"]);
$this->phrases["wc_share_facebook"] = sanitize_text_field($_POST["wc_share_facebook"]);
$this->phrases["wc_share_twitter"] = sanitize_text_field($_POST["wc_share_twitter"]);
$this->phrases["wc_share_whatsapp"] = sanitize_text_field($_POST["wc_share_whatsapp"]);
$this->phrases["wc_share_vk"] = sanitize_text_field($_POST["wc_share_vk"]);
$this->phrases["wc_share_ok"] = sanitize_text_field($_POST["wc_share_ok"]);
$this->phrases["wc_hide_replies_text"] = sanitize_text_field($_POST["wc_hide_replies_text"]);
$this->phrases["wc_show_replies_text"] = sanitize_text_field($_POST["wc_show_replies_text"]);
$this->phrases["wc_email_subject"] = sanitize_text_field($_POST["wc_email_subject"]);
$this->phrases["wc_email_message"] = wp_kses(wpautop($_POST["wc_email_message"]), wp_kses_allowed_html("post"));
$this->phrases["wc_all_comment_new_reply_subject"] = sanitize_text_field($_POST["wc_all_comment_new_reply_subject"]);
$this->phrases["wc_all_comment_new_reply_message"] = wp_kses(wpautop($_POST["wc_all_comment_new_reply_message"]), wp_kses_allowed_html("post"));
$this->phrases["wc_new_reply_email_subject"] = sanitize_text_field($_POST["wc_new_reply_email_subject"]);
$this->phrases["wc_new_reply_email_message"] = wp_kses(wpautop($_POST["wc_new_reply_email_message"]), wp_kses_allowed_html("post"));
$this->phrases["wc_subscribed_on_comment"] = sanitize_textarea_field($_POST["wc_subscribed_on_comment"]);
$this->phrases["wc_subscribed_on_all_comment"] = sanitize_textarea_field($_POST["wc_subscribed_on_all_comment"]);
$this->phrases["wc_subscribed_on_post"] = sanitize_textarea_field($_POST["wc_subscribed_on_post"]);
$this->phrases["wc_unsubscribe"] = sanitize_text_field($_POST["wc_unsubscribe"]);
$this->phrases["wc_ignore_subscription"] = sanitize_text_field($_POST["wc_ignore_subscription"]);
$this->phrases["wc_unsubscribe_message"] = sanitize_textarea_field($_POST["wc_unsubscribe_message"]);
$this->phrases["wc_subscribe_message"] = sanitize_textarea_field($_POST["wc_subscribe_message"]);
$this->phrases["wc_confirm_email"] = sanitize_text_field($_POST["wc_confirm_email"]);
$this->phrases["wc_comfirm_success_message"] = sanitize_textarea_field($_POST["wc_comfirm_success_message"]);
$this->phrases["wc_confirm_email_subject"] = sanitize_text_field($_POST["wc_confirm_email_subject"]);
$this->phrases["wc_confirm_email_message"] = wp_kses(wpautop($_POST["wc_confirm_email_message"]), wp_kses_allowed_html("post"));
$this->phrases["wc_error_empty_text"] = sanitize_text_field($_POST["wc_error_empty_text"]);
$this->phrases["wc_error_email_text"] = sanitize_text_field($_POST["wc_error_email_text"]);
$this->phrases["wc_error_url_text"] = sanitize_text_field($_POST["wc_error_url_text"]);
$this->phrases["wc_year_text"] = sanitize_text_field($_POST["wc_year_text"]);
$this->phrases["wc_year_text_plural"] = sanitize_text_field($_POST["wc_year_text_plural"]);
$this->phrases["wc_month_text"] = sanitize_text_field($_POST["wc_month_text"]);
$this->phrases["wc_month_text_plural"] = sanitize_text_field($_POST["wc_month_text_plural"]);
$this->phrases["wc_day_text"] = sanitize_text_field($_POST["wc_day_text"]);
$this->phrases["wc_day_text_plural"] = sanitize_text_field($_POST["wc_day_text_plural"]);
$this->phrases["wc_hour_text"] = sanitize_text_field($_POST["wc_hour_text"]);
$this->phrases["wc_hour_text_plural"] = sanitize_text_field($_POST["wc_hour_text_plural"]);
$this->phrases["wc_minute_text"] = sanitize_text_field($_POST["wc_minute_text"]);
$this->phrases["wc_minute_text_plural"] = sanitize_text_field($_POST["wc_minute_text_plural"]);
$this->phrases["wc_second_text"] = sanitize_text_field($_POST["wc_second_text"]);
$this->phrases["wc_second_text_plural"] = sanitize_text_field($_POST["wc_second_text_plural"]);
$this->phrases["wc_right_now_text"] = sanitize_text_field($_POST["wc_right_now_text"]);
$this->phrases["wc_ago_text"] = sanitize_text_field($_POST["wc_ago_text"]);
$this->phrases["wc_you_must_be_text"] = sanitize_text_field($_POST["wc_you_must_be_text"]);
$this->phrases["wc_logged_in_as"] = sanitize_text_field($_POST["wc_logged_in_as"]);
$this->phrases["wc_log_out"] = sanitize_text_field($_POST["wc_log_out"]);
$this->phrases["wc_log_in"] = sanitize_text_field($_POST["wc_log_in"]);
$this->phrases["wc_login_please"] = sanitize_text_field($_POST["wc_login_please"]);
$this->phrases["wc_logged_in_text"] = sanitize_text_field($_POST["wc_logged_in_text"]);
$this->phrases["wc_to_post_comment_text"] = sanitize_text_field($_POST["wc_to_post_comment_text"]);
$this->phrases["wc_vote_counted"] = sanitize_text_field($_POST["wc_vote_counted"]);
$this->phrases["wc_vote_up"] = sanitize_text_field($_POST["wc_vote_up"]);
$this->phrases["wc_vote_down"] = sanitize_text_field($_POST["wc_vote_down"]);
$this->phrases["wc_awaiting_for_approval"] = sanitize_text_field($_POST["wc_awaiting_for_approval"]);
$this->phrases["wc_vote_only_one_time"] = sanitize_text_field($_POST["wc_vote_only_one_time"]);
$this->phrases["wc_voting_error"] = sanitize_text_field($_POST["wc_voting_error"]);
$this->phrases["wc_banned_user"] = sanitize_text_field($_POST["wc_banned_user"]);
$this->phrases["wc_self_vote"] = sanitize_text_field($_POST["wc_self_vote"]);
$this->phrases["wc_deny_voting_from_same_ip"] = sanitize_text_field($_POST["wc_deny_voting_from_same_ip"]);
$this->phrases["wc_login_to_vote"] = sanitize_text_field($_POST["wc_login_to_vote"]);
$this->phrases["wc_invalid_captcha"] = sanitize_text_field($_POST["wc_invalid_captcha"]);
$this->phrases["wc_invalid_field"] = sanitize_text_field($_POST["wc_invalid_field"]);
$this->phrases["wc_comment_not_updated"] = sanitize_text_field($_POST["wc_comment_not_updated"]);
$this->phrases["wc_comment_edit_not_possible"] = sanitize_text_field($_POST["wc_comment_edit_not_possible"]);
$this->phrases["wc_comment_not_edited"] = sanitize_text_field($_POST["wc_comment_not_edited"]);
$this->phrases["wc_comment_edit_save_button"] = sanitize_text_field($_POST["wc_comment_edit_save_button"]);
$this->phrases["wc_comment_edit_cancel_button"] = sanitize_text_field($_POST["wc_comment_edit_cancel_button"]);
$this->phrases["wc_msg_input_min_length"] = sanitize_text_field($_POST["wc_msg_input_min_length"]);
$this->phrases["wc_msg_input_max_length"] = sanitize_text_field($_POST["wc_msg_input_max_length"]);
$this->phrases["wc_read_more"] = sanitize_text_field($_POST["wc_read_more"]);
$this->phrases["wc_anonymous"] = sanitize_text_field($_POST["wc_anonymous"]);
$this->phrases["wc_msg_required_fields"] = sanitize_text_field($_POST["wc_msg_required_fields"]);
$this->phrases["wc_connect_with"] = sanitize_text_field($_POST["wc_connect_with"]);
$this->phrases["wc_subscribed_to"] = sanitize_text_field($_POST["wc_subscribed_to"]);
$this->phrases["wc_form_subscription_submit"] = sanitize_text_field($_POST["wc_form_subscription_submit"]);
$this->phrases["wc_comment_approved_email_subject"] = sanitize_text_field($_POST["wc_comment_approved_email_subject"]);
$this->phrases["wc_comment_approved_email_message"] = wp_kses(wpautop($_POST["wc_comment_approved_email_message"]), wp_kses_allowed_html("post"));
$this->phrases["wc_roles_cannot_comment_message"] = sanitize_text_field($_POST["wc_roles_cannot_comment_message"]);
$this->phrases["wc_stick_comment_btn_title"] = sanitize_text_field($_POST["wc_stick_comment_btn_title"]);
$this->phrases["wc_stick_comment"] = sanitize_text_field($_POST["wc_stick_comment"]);
$this->phrases["wc_unstick_comment"] = sanitize_text_field($_POST["wc_unstick_comment"]);
$this->phrases["wc_sticky_comment_icon_title"] = sanitize_text_field($_POST["wc_sticky_comment_icon_title"]);
$this->phrases["wc_close_comment_btn_title"] = sanitize_text_field($_POST["wc_close_comment_btn_title"]);
$this->phrases["wc_close_comment"] = sanitize_text_field($_POST["wc_close_comment"]);
$this->phrases["wc_open_comment"] = sanitize_text_field($_POST["wc_open_comment"]);
$this->phrases["wc_closed_comment_icon_title"] = sanitize_text_field($_POST["wc_closed_comment_icon_title"]);
$this->phrases["wc_social_login_agreement_label"] = sanitize_text_field($_POST["wc_social_login_agreement_label"]);
$this->phrases["wc_social_login_agreement_desc"] = wp_kses($_POST["wc_social_login_agreement_desc"], wp_kses_allowed_html("post"));
$this->phrases["wc_agreement_button_disagree"] = sanitize_text_field($_POST["wc_agreement_button_disagree"]);
$this->phrases["wc_agreement_button_agree"] = sanitize_text_field($_POST["wc_agreement_button_agree"]);
$this->phrases["wc_content_and_settings"] = sanitize_text_field($_POST["wc_content_and_settings"]);
$this->phrases["wc_user_settings_activity"] = sanitize_text_field($_POST["wc_user_settings_activity"]);
$this->phrases["wc_user_settings_subscriptions"] = sanitize_text_field($_POST["wc_user_settings_subscriptions"]);
$this->phrases["wc_user_settings_follows"] = sanitize_text_field($_POST["wc_user_settings_follows"]);
$this->phrases["wc_user_settings_response_to"] = sanitize_text_field($_POST["wc_user_settings_response_to"]);
$this->phrases["wc_user_settings_email_me_delete_links"] = sanitize_text_field($_POST["wc_user_settings_email_me_delete_links"]);
$this->phrases["wc_user_settings_email_me_delete_links_desc"] = sanitize_textarea_field($_POST["wc_user_settings_email_me_delete_links_desc"]);
$this->phrases["wc_user_settings_no_data"] = sanitize_text_field($_POST["wc_user_settings_no_data"]);
$this->phrases["wc_user_settings_request_deleting_comments"] = sanitize_text_field($_POST["wc_user_settings_request_deleting_comments"]);
$this->phrases["wc_user_settings_cancel_subscriptions"] = sanitize_text_field($_POST["wc_user_settings_cancel_subscriptions"]);
$this->phrases["wc_user_settings_clear_cookie"] = sanitize_text_field($_POST["wc_user_settings_clear_cookie"]);
$this->phrases["wc_user_settings_delete_links"] = sanitize_text_field($_POST["wc_user_settings_delete_links"]);
$this->phrases["wc_user_settings_delete_all_comments"] = sanitize_text_field($_POST["wc_user_settings_delete_all_comments"]);
$this->phrases["wc_user_settings_delete_all_comments_message"] = wp_kses(wpautop($_POST["wc_user_settings_delete_all_comments_message"]), wp_kses_allowed_html("post"));
$this->phrases["wc_user_settings_delete_all_subscriptions"] = sanitize_text_field($_POST["wc_user_settings_delete_all_subscriptions"]);
$this->phrases["wc_user_settings_delete_all_subscriptions_message"] = wp_kses(wpautop($_POST["wc_user_settings_delete_all_subscriptions_message"]), wp_kses_allowed_html("post"));
$this->phrases["wc_user_settings_delete_all_follows"] = sanitize_text_field($_POST["wc_user_settings_delete_all_follows"]);
$this->phrases["wc_user_settings_delete_all_follows_message"] = wp_kses(wpautop($_POST["wc_user_settings_delete_all_follows_message"]), wp_kses_allowed_html("post"));
$this->phrases["wc_user_settings_subscribed_to_replies"] = sanitize_text_field($_POST["wc_user_settings_subscribed_to_replies"]);
$this->phrases["wc_user_settings_subscribed_to_replies_own"] = sanitize_text_field($_POST["wc_user_settings_subscribed_to_replies_own"]);
$this->phrases["wc_user_settings_subscribed_to_all_comments"] = sanitize_text_field($_POST["wc_user_settings_subscribed_to_all_comments"]);
$this->phrases["wc_user_settings_check_email"] = sanitize_text_field($_POST["wc_user_settings_check_email"]);
$this->phrases["wc_user_settings_email_error"] = sanitize_text_field($_POST["wc_user_settings_email_error"]);
$this->phrases["wc_delete_this_comment"] = sanitize_text_field($_POST["wc_delete_this_comment"]);
$this->phrases["wc_cancel_this_subscription"] = sanitize_text_field($_POST["wc_cancel_this_subscription"]);
$this->phrases["wc_cancel_this_follow"] = sanitize_text_field($_POST["wc_cancel_this_follow"]);
$this->phrases["wc_confirm_comment_delete"] = sanitize_text_field($_POST["wc_confirm_comment_delete"]);
$this->phrases["wc_confirm_cancel_subscription"] = sanitize_text_field($_POST["wc_confirm_cancel_subscription"]);
$this->phrases["wc_confirm_cancel_follow"] = sanitize_text_field($_POST["wc_confirm_cancel_follow"]);
$this->phrases["wc_follow_user"] = sanitize_text_field($_POST["wc_follow_user"]);
$this->phrases["wc_unfollow_user"] = sanitize_text_field($_POST["wc_unfollow_user"]);
$this->phrases["wc_follow_success"] = sanitize_text_field($_POST["wc_follow_success"]);
$this->phrases["wc_follow_canceled"] = sanitize_text_field($_POST["wc_follow_canceled"]);
$this->phrases["wc_follow_email_confirm"] = sanitize_text_field($_POST["wc_follow_email_confirm"]);
$this->phrases["wc_follow_email_confirm_fail"] = sanitize_text_field($_POST["wc_follow_email_confirm_fail"]);
$this->phrases["wc_follow_login_to_follow"] = sanitize_text_field($_POST["wc_follow_login_to_follow"]);
$this->phrases["wc_follow_impossible"] = sanitize_text_field($_POST["wc_follow_impossible"]);
$this->phrases["wc_follow_not_added"] = sanitize_text_field($_POST["wc_follow_not_added"]);
$this->phrases["wc_follow_confirm"] = sanitize_text_field($_POST["wc_follow_confirm"]);
$this->phrases["wc_follow_cancel"] = sanitize_text_field($_POST["wc_follow_cancel"]);
$this->phrases["wc_follow_confirm_email_subject"] = sanitize_text_field($_POST["wc_follow_confirm_email_subject"]);
$this->phrases["wc_follow_confirm_email_message"] = wp_kses(wpautop($_POST["wc_follow_confirm_email_message"]), wp_kses_allowed_html("post"));
$this->phrases["wc_follow_email_subject"] = sanitize_text_field($_POST["wc_follow_email_subject"]);
$this->phrases["wc_follow_email_message"] = wp_kses(wpautop($_POST["wc_follow_email_message"]), wp_kses_allowed_html("post"));
$this->phrases["wc_mentioned_email_subject"] = sanitize_text_field($_POST["wc_mentioned_email_subject"]);
$this->phrases["wc_mentioned_email_message"] = wp_kses(wpautop($_POST["wc_mentioned_email_message"]), wp_kses_allowed_html("post"));
$this->phrases["wc_copied_to_clipboard"] = sanitize_text_field($_POST["wc_copied_to_clipboard"]);
$this->phrases["wc_feedback_shortcode_tooltip"] = sanitize_text_field($_POST["wc_feedback_shortcode_tooltip"]);
$this->phrases["wc_feedback_popup_title"] = sanitize_text_field($_POST["wc_feedback_popup_title"]);
$this->phrases["wc_please_leave_feebdack"] = sanitize_text_field($_POST["wc_please_leave_feebdack"]);
$this->phrases["wc_feedback_content_text"] = sanitize_text_field($_POST["wc_feedback_content_text"]);
$this->phrases["wc_feedback_comment_success"] = sanitize_text_field($_POST["wc_feedback_comment_success"]);
$this->phrases["wc_commenting_is_closed"] = sanitize_text_field($_POST["wc_commenting_is_closed"]);
$this->phrases["wc_closed_comment_thread"] = sanitize_text_field($_POST["wc_closed_comment_thread"]);
$this->phrases["wc_bubble_invite_message"] = sanitize_text_field($_POST["wc_bubble_invite_message"]);
$this->phrases["wc_vote_phrase"] = sanitize_text_field($_POST["wc_vote_phrase"]);
$this->phrases["wc_votes_phrase"] = sanitize_text_field($_POST["wc_votes_phrase"]);
$this->phrases["wc_comment_link"] = sanitize_text_field($_POST["wc_comment_link"]);
$this->phrases["wc_not_allowed_to_comment_more_than"] = sanitize_text_field($_POST["wc_not_allowed_to_comment_more_than"]);
$this->phrases["wc_not_allowed_to_create_comment_thread_more_than"] = sanitize_text_field($_POST["wc_not_allowed_to_create_comment_thread_more_than"]);
$this->phrases["wc_not_allowed_to_reply_more_than"] = sanitize_text_field($_POST["wc_not_allowed_to_reply_more_than"]);
$this->phrases["wc_inline_form_comment"] = sanitize_text_field($_POST["wc_inline_form_comment"]);
$this->phrases["wc_inline_form_notify"] = sanitize_text_field($_POST["wc_inline_form_notify"]);
$this->phrases["wc_inline_form_name"] = sanitize_text_field($_POST["wc_inline_form_name"]);
$this->phrases["wc_inline_form_email"] = sanitize_text_field($_POST["wc_inline_form_email"]);
$this->phrases["wc_inline_form_comment_button"] = sanitize_text_field($_POST["wc_inline_form_comment_button"]);
$this->phrases["wc_inline_comments_view_all"] = sanitize_text_field($_POST["wc_inline_comments_view_all"]);
$this->phrases["wc_inline_feedbacks"] = sanitize_text_field($_POST["wc_inline_feedbacks"]);
$this->phrases["wc_unable_sent_email"] = sanitize_text_field($_POST["wc_unable_sent_email"]);
$this->phrases["wc_subscription_fault"] = sanitize_text_field($_POST["wc_subscription_fault"]);
$this->phrases["wc_comments_are_deleted"] = sanitize_text_field($_POST["wc_comments_are_deleted"]);
$this->phrases["wc_cancel_subs_success"] = sanitize_text_field($_POST["wc_cancel_subs_success"]);
$this->phrases["wc_cancel_follows_success"] = sanitize_text_field($_POST["wc_cancel_follows_success"]);
$this->phrases["wc_follow_confirm_success"] = sanitize_text_field($_POST["wc_follow_confirm_success"]);
$this->phrases["wc_follow_cancel_success"] = sanitize_text_field($_POST["wc_follow_cancel_success"]);
$this->phrases["wc_login_to_comment"] = sanitize_text_field($_POST["wc_login_to_comment"]);
$this->phrases["wc_view_comments"] = sanitize_text_field($_POST["wc_view_comments"]);
$this->phrases["wc_spoiler"] = sanitize_text_field($_POST["wc_spoiler"]);
$this->phrases["wc_last_edited"] = sanitize_text_field($_POST["wc_last_edited"]);
$this->phrases["wc_reply_to"] = sanitize_text_field($_POST["wc_reply_to"]);
$this->phrases["wc_manage_comment"] = sanitize_text_field($_POST["wc_manage_comment"]);
$this->phrases["wc_spoiler_title"] = sanitize_text_field($_POST["wc_spoiler_title"]);
$this->phrases["wc_cannot_rate_again"] = sanitize_text_field($_POST["wc_cannot_rate_again"]);
$this->phrases["wc_not_allowed_to_rate"] = sanitize_text_field($_POST["wc_not_allowed_to_rate"]);
$this->phrases["wc_confirm_rate_edit"] = sanitize_text_field($_POST["wc_confirm_rate_edit"]);
// Media Upload //
$this->phrases["wmuPhraseConfirmDelete"] = sanitize_text_field($_POST["wmuPhraseConfirmDelete"]);
$this->phrases["wmuPhraseNotAllowedFile"] = sanitize_text_field($_POST["wmuPhraseNotAllowedFile"]);
$this->phrases["wmuPhraseMaxFileCount"] = sanitize_text_field($_POST["wmuPhraseMaxFileCount"]);
$this->phrases["wmuPhraseMaxFileSize"] = sanitize_text_field($_POST["wmuPhraseMaxFileSize"]);
$this->phrases["wmuPhrasePostMaxSize"] = sanitize_text_field($_POST["wmuPhrasePostMaxSize"]);
$this->phrases["wmuPhraseDoingUpload"] = sanitize_text_field($_POST["wmuPhraseDoingUpload"]);
$this->phrases["wmuAttachImage"] = sanitize_text_field($_POST["wmuAttachImage"]);
$this->phrases["wmuChangeImage"] = sanitize_text_field($_POST["wmuChangeImage"]);
if (class_exists("Prompt_Comment_Form_Handling") && $this->subscription["usePostmaticForCommentNotification"]) {
$this->phrases["wc_postmatic_subscription_label"] = sanitize_text_field($_POST["wc_postmatic_subscription_label"]);
}
foreach ($this->labels["blogRoles"] as $roleName => $roleVal) {
$this->phrases["wc_blog_role_" . $roleName] = sanitize_text_field($_POST["wc_blog_role_" . $roleName]);
}
$this->phrases = apply_filters("wpdiscuz_phrases", $this->phrases);
$this->dbManager->updatePhrases($this->phrases);
}
}
public function resetOptions()
{
$nonce = WpdiscuzHelper::sanitize(INPUT_GET, "_wpnonce", "FILTER_SANITIZE_STRING");
$page = WpdiscuzHelper::sanitize(INPUT_GET, "page", "FILTER_SANITIZE_STRING");
$tab = WpdiscuzHelper::sanitize(INPUT_GET, "wpd_tab", "FILTER_SANITIZE_STRING");
$redirect_to = WpdiscuzHelper::sanitize(INPUT_GET, "redirect_to", FILTER_SANITIZE_URL);
if (!current_user_can("manage_options") || empty($nonce) || empty($page) || empty($tab) || empty($redirect_to)) {
return;
}
if ($page !== WpdiscuzCore::PAGE_SETTINGS || !wp_verify_nonce($nonce, md5(ABSPATH . get_home_url()))) {
die(esc_html__("Stop doing this!!!", "wpdiscuz"));
}
$roleColors = [
"guest" => "#898989",
"post_author" => "#07B290",
"administrator" => "#ff451f",
"editor" => "#d36000",
"author" => "#327324",
"contributor" => "#a240cd",
"subscriber" => "#31839e",
];
if ($tab === "all") {
delete_option(self::OPTION_SLUG_OPTIONS);
$this->addOptions();
$this->initOptions(get_option(self::OPTION_SLUG_OPTIONS));
$this->general["showPluginPoweredByLink"] = 1;
$blogRoles = get_editable_roles();
$this->labels["blogRoles"]["guest"] = $roleColors["guest"];
$this->labels["blogRoles"]["post_author"] = $roleColors["post_author"];
$this->labels["blogRoleLabels"]["post_author"] = 1;
$this->labels["blogRoleLabels"]["guest"] = 0;
foreach ($blogRoles as $roleName => $roleInfo) {
$this->labels["blogRoles"][$roleName] = isset($roleColors[$roleName]) ? $roleColors[$roleName] : "#31839e";
$this->labels["blogRoleLabels"][$roleName] = $roleName === "editor" || $roleName === "administrator" ? 1 : 0;
}
$this->updateOptions();
} else if (isset($this->{$tab})) {
$defaultOptions = $this->getDefaultOptions();
$this->{$tab} = $defaultOptions[sanitize_text_field($_GET["wpd_tab"])];
if ($tab === WpdiscuzCore::TAB_GENERAL) {
$this->general["showPluginPoweredByLink"] = 1;
} else if ($tab === WpdiscuzCore::TAB_LABELS) {
$blogRoles = get_editable_roles();
$this->labels["blogRoles"]["guest"] = $roleColors["guest"];
$this->labels["blogRoles"]["post_author"] = $roleColors["post_author"];
$this->labels["blogRoleLabels"]["post_author"] = 1;
$this->labels["blogRoleLabels"]["guest"] = 0;
foreach ($blogRoles as $roleName => $roleInfo) {
$this->labels["blogRoles"][$roleName] = isset($roleColors[$roleName]) ? $roleColors[$roleName] : "#31839e";
$this->labels["blogRoleLabels"][$roleName] = $roleName === "editor" || $roleName === "administrator" ? 1 : 0;
}
}
$this->updateOptions();
}
do_action("wpdiscuz_reset_options", $tab);
do_action("wpdiscuz_reset_comments_cache");
do_action("wpdiscuz_reset_users_cache");
exit(wp_safe_redirect($redirect_to));
}
public function mainOptionsForm()
{
if (isset($_POST["wc_submit_options"])) {
add_settings_error("wpdiscuz", "settings_updated", esc_html__("Settings updated", "wpdiscuz"), "updated");
}
include_once WPDISCUZ_DIR_PATH . "/options/html-options.php";
}
public function phrasesOptionsForm()
{
if (isset($_POST["wc_submit_phrases"])) {
add_settings_error("wpdiscuz", "phrases_updated", esc_html__("Phrases updated", "wpdiscuz"), "updated");
}
$this->initPhrasesOnLoad();
include_once WPDISCUZ_DIR_PATH . "/options/html-phrases.php";
}
public function exportOptionsOrPhrases()
{
if (current_user_can("manage_options")) {
if (isset($_POST["tools-action"])) {
$action = $_POST["tools-action"];
$data = [];
if ($action === "export-options") {
check_admin_referer("wc_tools_form", "wpd-options-export");
$options = @maybe_unserialize(get_option(self::OPTION_SLUG_OPTIONS));
if ($options) {
$file_name = "wpdiscuz-options-";
$data = $options;
}
} else if ($action === "export-phrases") {
check_admin_referer("wc_tools_form", "wpd-phrases-export");
$phrases = $this->dbManager->getPhrases();
if ($phrases) {
$file_name = "wpdiscuz-phrases-";
$data = $phrases;
}
}
if ($data) {
$file_name .= date('Y-m-d') . '.txt';
header('Content-Description: File Transfer');
header("Content-Disposition: attachment; filename={$file_name}");
header('Content-Type: text/plain; charset=utf-8');
echo json_encode($data);
die;
}
}
}
}
public function tools()
{
if (current_user_can("manage_options")) {
if (isset($_POST["tools-action"])) {
$action = $_POST["tools-action"];
if ($action === "import-options") {
check_admin_referer("wc_tools_form", "wpd-options-import");
$file = isset($_FILES["wpdiscuz-options-file"]) ? $_FILES["wpdiscuz-options-file"] : "";
if ($file && is_array($file) && !empty($file["tmp_name"])) {
if ($data = file_get_contents($file["tmp_name"])) {
$options = json_decode($data, true);
if ($options && is_array($options)) {
update_option(self::OPTION_SLUG_OPTIONS, $this->replaceOldOptions($options, false));
add_settings_error("wpdiscuz", "settings_updated", esc_html__("Options Imported Successfully!", "wpdiscuz"), "updated");
} else {
add_settings_error("wpdiscuz", "settings_error", esc_html__("Error occured! File content is empty or data is not valid!", "wpdiscuz"), "error");
}
} else {
add_settings_error("wpdiscuz", "settings_error", esc_html__("Error occured! Can not get file content!", "wpdiscuz"), "error");
}
} else {
add_settings_error("wpdiscuz", "settings_error", esc_html__("Error occured! Please choose file!", "wpdiscuz"), "error");
}
} else if ($action === "import-phrases") {
check_admin_referer("wc_tools_form", "wpd-phrases-import");
$file = isset($_FILES["wpdiscuz-phrases-file"]) ? $_FILES["wpdiscuz-phrases-file"] : "";
if ($file && is_array($file) && !empty($file["tmp_name"])) {
if ($data = file_get_contents($file["tmp_name"])) {
$phrases = json_decode($data, true);
if ($phrases && is_array($phrases)) {
$this->dbManager->updatePhrases($phrases);
add_settings_error("wpdiscuz", "settings_updated", esc_html__("Phrases Imported Successfully!", "wpdiscuz"), "updated");
} else {
add_settings_error("wpdiscuz", "settings_error", esc_html__("Error occured! File content is empty or data is not valid!", "wpdiscuz"), "error");
}
} else {
add_settings_error("wpdiscuz", "settings_error", esc_html__("Error occured! Can not get file content!", "wpdiscuz"), "error");
}
} else {
add_settings_error("wpdiscuz", "settings_error", esc_html__("Error occured! Please choose file!", "wpdiscuz"), "error");
}
}
}
} else {
die(esc_html_e("Hacker?", "wpdiscuz"));
}
include_once WPDISCUZ_DIR_PATH . "/options/html-tools.php";
}
public function adminNotices()
{
if (current_user_can("manage_options")) {
$this->regenerateMessage();
$this->addonActivationMessages();
}
}
private function regenerateMessage()
{
global $pagenow;
$notWpdiscuzSettingsPage = $pagenow !== "admin.php" || ($pagenow === "admin.php" && (!isset($_GET["page"]) || (isset($_GET["page"]) && $_GET["page"] !== self::PAGE_SETTINGS)));
$wizardCompleted = intval(get_option(self::OPTION_SLUG_WIZARD_COMPLETED));
if (!$wizardCompleted && $notWpdiscuzSettingsPage) {
?>