Comments – wpDiscuz - Version 7.3.12

Version Description

Download this release

Release Info

Developer AdvancedCoding
Plugin Icon 128x128 Comments – wpDiscuz
Version 7.3.12
Comparing to
See all releases

Code changes from version 7.3.11 to 7.3.12

class.WpdiscuzCore.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: wpDiscuz
4
  * Description: #1 WordPress Comment Plugin. Innovative, modern and feature-rich comment system to supercharge your website comment section.
5
- * Version: 7.3.11
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
@@ -81,7 +81,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
81
  /* /CRON JOBS */
82
  add_action("wp_insert_site", [&$this, "addNewBlog"]);
83
  add_action("delete_blog", [&$this, "deleteBlog"]);
84
- add_action("wp_head", [&$this, "initCurrentPostType"]);
85
 
86
  add_action("admin_init", [&$this, "uninstall"], 1);
87
  add_action("init", [&$this, "wpdiscuzTextDomain"]);
@@ -1163,7 +1163,6 @@ class WpdiscuzCore implements WpDiscuzConstants {
1163
  */
1164
  public function frontendFiles() {
1165
  global $post;
1166
- $this->isWpdiscuzLoaded = $this->helper->isLoadWpdiscuz($post);
1167
  $suf = $this->options->general["loadMinVersion"] ? ".min" : "";
1168
  wp_register_style("wpdiscuz-font-awesome", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/font-awesome-5.13.0/css/fontawesome-all.min.css"), null, $this->version);
1169
  wp_register_style("wpdiscuz-ratings", plugins_url(WPDISCUZ_DIR_NAME . "/assets/css/wpdiscuz-ratings$suf.css"), null, $this->version);
@@ -1615,6 +1614,7 @@ class WpdiscuzCore implements WpDiscuzConstants {
1615
 
1616
  public function initCurrentPostType() {
1617
  global $post;
 
1618
  if ($this->isWpdiscuzLoaded) {
1619
  $this->form = $this->wpdiscuzForm->getForm($post->ID);
1620
  add_filter("comments_template", [&$this, "addCommentForm"], 9999999);
2
  /*
3
  * Plugin Name: wpDiscuz
4
  * Description: #1 WordPress Comment Plugin. Innovative, modern and feature-rich comment system to supercharge your website comment section.
5
+ * Version: 7.3.12
6
  * Author: gVectors Team
7
  * Author URI: https://gvectors.com/
8
  * Plugin URI: https://wpdiscuz.com/
81
  /* /CRON JOBS */
82
  add_action("wp_insert_site", [&$this, "addNewBlog"]);
83
  add_action("delete_blog", [&$this, "deleteBlog"]);
84
+ add_action("wp", [&$this, "initCurrentPostType"]);
85
 
86
  add_action("admin_init", [&$this, "uninstall"], 1);
87
  add_action("init", [&$this, "wpdiscuzTextDomain"]);
1163
  */
1164
  public function frontendFiles() {
1165
  global $post;
 
1166
  $suf = $this->options->general["loadMinVersion"] ? ".min" : "";
1167
  wp_register_style("wpdiscuz-font-awesome", plugins_url(WPDISCUZ_DIR_NAME . "/assets/third-party/font-awesome-5.13.0/css/fontawesome-all.min.css"), null, $this->version);
1168
  wp_register_style("wpdiscuz-ratings", plugins_url(WPDISCUZ_DIR_NAME . "/assets/css/wpdiscuz-ratings$suf.css"), null, $this->version);
1614
 
1615
  public function initCurrentPostType() {
1616
  global $post;
1617
+ $this->isWpdiscuzLoaded = $this->helper->isLoadWpdiscuz($post);
1618
  if ($this->isWpdiscuzLoaded) {
1619
  $this->form = $this->wpdiscuzForm->getForm($post->ID);
1620
  add_filter("comments_template", [&$this, "addCommentForm"], 9999999);
options/class.WpdiscuzOptions.php CHANGED
@@ -67,6 +67,7 @@ class WpdiscuzOptions implements WpDiscuzConstants {
67
  $this->initGoodbyeCaptchaField();
68
  add_action("init", [&$this, "initPhrasesOnLoad"], 2126);
69
  add_action("admin_init", [&$this, "saveAndResetOptionsAndPhrases"], 1);
 
70
  add_action("wp_ajax_dismiss_wpdiscuz_addon_note", [&$this, "dismissAddonNote"]);
71
  add_action("admin_notices", [&$this, "adminNotices"]);
72
  }
@@ -1471,7 +1472,7 @@ class WpdiscuzOptions implements WpDiscuzConstants {
1471
  $this->content["wmuIsGuestAllowed"] = isset($_POST[self::TAB_CONTENT]["wmuIsGuestAllowed"]) ? absint($_POST[self::TAB_CONTENT]["wmuIsGuestAllowed"]) : 0;
1472
  $this->content["wmuIsLightbox"] = isset($_POST[self::TAB_CONTENT]["wmuIsLightbox"]) ? absint($_POST[self::TAB_CONTENT]["wmuIsLightbox"]) : 0;
1473
  $this->content["wmuMimeTypes"] = isset($_POST[self::TAB_CONTENT]["wmuMimeTypes"]) ? $_POST[self::TAB_CONTENT]["wmuMimeTypes"] : [];
1474
- $this->content["wmuMaxFileSize"] = isset($_POST[self::TAB_CONTENT]["wmuMaxFileSize"]) ? sanitize_text_field($_POST[self::TAB_CONTENT]["wmuMaxFileSize"]) : $this->wmuUploadMaxFileSize / (1024 * 1024);
1475
  $this->content["wmuIsShowFilesDashboard"] = isset($_POST[self::TAB_CONTENT]["wmuIsShowFilesDashboard"]) ? absint($_POST[self::TAB_CONTENT]["wmuIsShowFilesDashboard"]) : 0;
1476
  $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;
1477
  $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;
@@ -1807,33 +1808,46 @@ class WpdiscuzOptions implements WpDiscuzConstants {
1807
  include_once WPDISCUZ_DIR_PATH . "/options/html-phrases.php";
1808
  }
1809
 
1810
- public function tools() {
1811
  if (current_user_can("manage_options")) {
1812
-
1813
- $wpUploadsDir = wp_upload_dir();
1814
- $wpdiscuzOptionsDir = $wpUploadsDir["basedir"] . self::OPTIONS_DIR;
1815
- $wpdiscuzOptionsUrl = $wpUploadsDir["baseurl"] . self::OPTIONS_DIR;
1816
-
1817
  if (isset($_POST["tools-action"])) {
1818
-
1819
  $action = $_POST["tools-action"];
1820
-
1821
  if ($action === "export-options") {
1822
  check_admin_referer("wc_tools_form", "wpd-options-export");
1823
- wp_mkdir_p($wpdiscuzOptionsDir);
1824
  $options = @maybe_unserialize(get_option(self::OPTION_SLUG_OPTIONS));
1825
  if ($options) {
1826
- $json = json_encode($options);
1827
- if (file_put_contents($wpdiscuzOptionsDir . self::OPTIONS_FILENAME . ".txt", $json)) {
1828
- add_settings_error("wpdiscuz", "settings_updated", esc_html__("Options were backed up!", "wpdiscuz"), "updated");
1829
- } else {
1830
- add_settings_error("wpdiscuz", "settings_updated", esc_html__("Cannot back up the options!", "wpdiscuz"), "error");
1831
- }
1832
  }
1833
- } else if ($action === "import-options") {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1834
  check_admin_referer("wc_tools_form", "wpd-options-import");
1835
  $file = isset($_FILES["wpdiscuz-options-file"]) ? $_FILES["wpdiscuz-options-file"] : "";
1836
- if ($file && is_array($file) && isset($file["tmp_name"])) {
1837
  if ($data = file_get_contents($file["tmp_name"])) {
1838
  $options = json_decode($data, true);
1839
  if ($options && is_array($options)) {
@@ -1848,22 +1862,10 @@ class WpdiscuzOptions implements WpDiscuzConstants {
1848
  } else {
1849
  add_settings_error("wpdiscuz", "settings_error", esc_html__("Error occured! Please choose file!", "wpdiscuz"), "error");
1850
  }
1851
- } else if ($action === "export-phrases") {
1852
- check_admin_referer("wc_tools_form", "wpd-phrases-export");
1853
- wp_mkdir_p($wpdiscuzOptionsDir);
1854
- $phrases = $this->dbManager->getPhrases();
1855
- if ($phrases) {
1856
- $json = json_encode($phrases);
1857
- if (file_put_contents($wpdiscuzOptionsDir . self::PHRASES_FILENAME . ".txt", $json)) {
1858
- add_settings_error("wpdiscuz", "settings_updated", esc_html__("Phrases were backed up!", "wpdiscuz"), "updated");
1859
- } else {
1860
- add_settings_error("wpdiscuz", "settings_updated", esc_html__("Cannot back up the phrases!", "wpdiscuz"), "error");
1861
- }
1862
- }
1863
  } else if ($action === "import-phrases") {
1864
  check_admin_referer("wc_tools_form", "wpd-phrases-import");
1865
  $file = isset($_FILES["wpdiscuz-phrases-file"]) ? $_FILES["wpdiscuz-phrases-file"] : "";
1866
- if ($file && is_array($file) && isset($file["tmp_name"])) {
1867
  if ($data = file_get_contents($file["tmp_name"])) {
1868
  $phrases = json_decode($data, true);
1869
  if ($phrases && is_array($phrases)) {
@@ -2198,30 +2200,30 @@ class WpdiscuzOptions implements WpDiscuzConstants {
2198
  <?php esc_html_e("New wpDiscuz addon!"); ?>
2199
  </p>
2200
  <div style="font-size:14px;">
2201
- <!-- --><?php //if(!in_array("BuddyPress Integration", $lastHashArray)): ?>
2202
  <!-- <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">-->
2203
- <!-- <img src="--><?php //echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/buddypress/header.png"); ?><!--" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>-->
2204
- <!-- <a href="https://gvectors.com/product/wpdiscuz-buddypress-integration/" target="_blank" style="color:#444; text-decoration:none;" title="--><?php //esc_attr_e("Go to the addon page", "wpdiscuz"); ?><!--">wpDiscuz - BuddyPress Integration <br><span style="margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">This addon integrates wpDiscuz with BuddyPress plugin. Creates &laquoDiscussion&raquo; tab in the users profile page, intgartes notifications, activities, and more...</span></a>-->
2205
  <!-- </div>-->
2206
- <!-- --><?php //endif; ?>
2207
  <?php if (!in_array("User Notifications", $lastHashArray)): ?>
2208
  <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">
2209
  <img src="<?php echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/notifications/header.png"); ?>" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>
2210
  <a href="https://gvectors.com/product/wpdiscuz-user-notifications/" target="_blank" style="color:#444; text-decoration:none;" title="<?php esc_attr_e("Go to the addon page", "wpdiscuz"); ?>">wpDiscuz - User Notifications <br><span style="width: 60%; margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">Adds a real-time user notification system to your site, so users can receive updates and notifications directly on your website as they happen (when someone likes your comment, rates your post, mentions you, replies to your comment).</span></a>
2211
  </div>
2212
  <?php endif; ?>
2213
- <!-- --><?php //if(!in_array("GIPHY Integration", $lastHashArray)): ?>
2214
  <!-- <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">-->
2215
- <!-- <img src="--><?php //echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/giphy/header.png"); ?><!--" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>-->
2216
- <!-- <a href="https://gvectors.com/product/wpdiscuz-giphy-integration/" target="_blank" style="color:#444; text-decoration:none;" title="--><?php //esc_attr_e("Go to the addon page", "wpdiscuz"); ?><!--">wpDiscuz - GIPHY Integration <br><span style="margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">This adds GIPHY [GIF] button on the toolbar of comment editor. Clicking this will open a new popup where you can search for your favorite gifs and insert them in your comment content.</span></a>-->
2217
  <!-- </div>-->
2218
- <!-- --><?php //endif; ?>
2219
- <!-- --><?php //if(!in_array("Tenor GIFs Integration", $lastHashArray)): ?>
2220
  <!-- <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">-->
2221
- <!-- <img src="--><?php //echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/tenor/header.png"); ?><!--" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>-->
2222
- <!-- <a href="https://gvectors.com/product/wpdiscuz-tenor-integration/" target="_blank" style="color:#444; text-decoration:none;" title="--><?php //esc_attr_e("Go to the addon page", "wpdiscuz"); ?><!--">wpDiscuz - Tenor GIFs Integration <br><span style="margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">This adds Tenor [GIF] button on the toolbar of comment editor. Clicking this will open a new popup where you can search for your favorite gifs and insert them in your comment content.</span></a>-->
2223
  <!-- </div>-->
2224
- <!-- --><?php //endif; ?>
2225
  <div style="clear:both;"></div>
2226
  </div>
2227
  <p>&nbsp;&nbsp;&nbsp;<a href="<?php echo esc_url_raw(admin_url("admin.php?page=" . self::PAGE_ADDONS)); ?>"><?php esc_html_e("Go to wpDiscuz Addons subMenu"); ?> &raquo;</a></p>
67
  $this->initGoodbyeCaptchaField();
68
  add_action("init", [&$this, "initPhrasesOnLoad"], 2126);
69
  add_action("admin_init", [&$this, "saveAndResetOptionsAndPhrases"], 1);
70
+ add_action("admin_init", [&$this, "exportOptionsOrPhrases"], 1);
71
  add_action("wp_ajax_dismiss_wpdiscuz_addon_note", [&$this, "dismissAddonNote"]);
72
  add_action("admin_notices", [&$this, "adminNotices"]);
73
  }
1472
  $this->content["wmuIsGuestAllowed"] = isset($_POST[self::TAB_CONTENT]["wmuIsGuestAllowed"]) ? absint($_POST[self::TAB_CONTENT]["wmuIsGuestAllowed"]) : 0;
1473
  $this->content["wmuIsLightbox"] = isset($_POST[self::TAB_CONTENT]["wmuIsLightbox"]) ? absint($_POST[self::TAB_CONTENT]["wmuIsLightbox"]) : 0;
1474
  $this->content["wmuMimeTypes"] = isset($_POST[self::TAB_CONTENT]["wmuMimeTypes"]) ? $_POST[self::TAB_CONTENT]["wmuMimeTypes"] : [];
1475
+ $this->content["wmuMaxFileSize"] = isset($_POST[self::TAB_CONTENT]["wmuMaxFileSize"]) ? absint($_POST[self::TAB_CONTENT]["wmuMaxFileSize"]) : $this->wmuUploadMaxFileSize / (1024 * 1024);
1476
  $this->content["wmuIsShowFilesDashboard"] = isset($_POST[self::TAB_CONTENT]["wmuIsShowFilesDashboard"]) ? absint($_POST[self::TAB_CONTENT]["wmuIsShowFilesDashboard"]) : 0;
1477
  $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;
1478
  $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;
1808
  include_once WPDISCUZ_DIR_PATH . "/options/html-phrases.php";
1809
  }
1810
 
1811
+ public function exportOptionsOrPhrases() {
1812
  if (current_user_can("manage_options")) {
 
 
 
 
 
1813
  if (isset($_POST["tools-action"])) {
 
1814
  $action = $_POST["tools-action"];
1815
+ $data = [];
1816
  if ($action === "export-options") {
1817
  check_admin_referer("wc_tools_form", "wpd-options-export");
 
1818
  $options = @maybe_unserialize(get_option(self::OPTION_SLUG_OPTIONS));
1819
  if ($options) {
1820
+ $file_name = "wpdiscuz-options-";
1821
+ $data = $options;
 
 
 
 
1822
  }
1823
+ } else if ($action === "export-phrases") {
1824
+ check_admin_referer("wc_tools_form", "wpd-phrases-export");
1825
+ $phrases = $this->dbManager->getPhrases();
1826
+ if ($phrases) {
1827
+ $file_name = "wpdiscuz-phrases-";
1828
+ $data = $phrases;
1829
+ }
1830
+ }
1831
+ if($data) {
1832
+ $file_name .= date('Y-m-d') . '.txt';
1833
+ header('Content-Description: File Transfer');
1834
+ header("Content-Disposition: attachment; filename={$file_name}");
1835
+ header('Content-Type: text/plain; charset=utf-8');
1836
+ echo json_encode($data);
1837
+ die;
1838
+ }
1839
+ }
1840
+ }
1841
+ }
1842
+
1843
+ public function tools() {
1844
+ if (current_user_can("manage_options")) {
1845
+ if (isset($_POST["tools-action"])) {
1846
+ $action = $_POST["tools-action"];
1847
+ if ($action === "import-options") {
1848
  check_admin_referer("wc_tools_form", "wpd-options-import");
1849
  $file = isset($_FILES["wpdiscuz-options-file"]) ? $_FILES["wpdiscuz-options-file"] : "";
1850
+ if ($file && is_array($file) && !empty($file["tmp_name"])) {
1851
  if ($data = file_get_contents($file["tmp_name"])) {
1852
  $options = json_decode($data, true);
1853
  if ($options && is_array($options)) {
1862
  } else {
1863
  add_settings_error("wpdiscuz", "settings_error", esc_html__("Error occured! Please choose file!", "wpdiscuz"), "error");
1864
  }
 
 
 
 
 
 
 
 
 
 
 
 
1865
  } else if ($action === "import-phrases") {
1866
  check_admin_referer("wc_tools_form", "wpd-phrases-import");
1867
  $file = isset($_FILES["wpdiscuz-phrases-file"]) ? $_FILES["wpdiscuz-phrases-file"] : "";
1868
+ if ($file && is_array($file) && !empty($file["tmp_name"])) {
1869
  if ($data = file_get_contents($file["tmp_name"])) {
1870
  $phrases = json_decode($data, true);
1871
  if ($phrases && is_array($phrases)) {
2200
  <?php esc_html_e("New wpDiscuz addon!"); ?>
2201
  </p>
2202
  <div style="font-size:14px;">
2203
+ <!-- --><?php //if(!in_array("BuddyPress Integration", $lastHashArray)): ?>
2204
  <!-- <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">-->
2205
+ <!-- <img src="--><?php //echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/buddypress/header.png"); ?><!--" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>-->
2206
+ <!-- <a href="https://gvectors.com/product/wpdiscuz-buddypress-integration/" target="_blank" style="color:#444; text-decoration:none;" title="--><?php //esc_attr_e("Go to the addon page", "wpdiscuz"); ?><!--">wpDiscuz - BuddyPress Integration <br><span style="margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">This addon integrates wpDiscuz with BuddyPress plugin. Creates &laquoDiscussion&raquo; tab in the users profile page, intgartes notifications, activities, and more...</span></a>-->
2207
  <!-- </div>-->
2208
+ <!-- --><?php //endif; ?>
2209
  <?php if (!in_array("User Notifications", $lastHashArray)): ?>
2210
  <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">
2211
  <img src="<?php echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/notifications/header.png"); ?>" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>
2212
  <a href="https://gvectors.com/product/wpdiscuz-user-notifications/" target="_blank" style="color:#444; text-decoration:none;" title="<?php esc_attr_e("Go to the addon page", "wpdiscuz"); ?>">wpDiscuz - User Notifications <br><span style="width: 60%; margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">Adds a real-time user notification system to your site, so users can receive updates and notifications directly on your website as they happen (when someone likes your comment, rates your post, mentions you, replies to your comment).</span></a>
2213
  </div>
2214
  <?php endif; ?>
2215
+ <!-- --><?php //if(!in_array("GIPHY Integration", $lastHashArray)): ?>
2216
  <!-- <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">-->
2217
+ <!-- <img src="--><?php //echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/giphy/header.png"); ?><!--" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>-->
2218
+ <!-- <a href="https://gvectors.com/product/wpdiscuz-giphy-integration/" target="_blank" style="color:#444; text-decoration:none;" title="--><?php //esc_attr_e("Go to the addon page", "wpdiscuz"); ?><!--">wpDiscuz - GIPHY Integration <br><span style="margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">This adds GIPHY [GIF] button on the toolbar of comment editor. Clicking this will open a new popup where you can search for your favorite gifs and insert them in your comment content.</span></a>-->
2219
  <!-- </div>-->
2220
+ <!-- --><?php //endif; ?>
2221
+ <!-- --><?php //if(!in_array("Tenor GIFs Integration", $lastHashArray)): ?>
2222
  <!-- <div style="display:inline-block; min-width:27%; padding-right:10px; margin-bottom:10px;">-->
2223
+ <!-- <img src="--><?php //echo plugins_url(WPDISCUZ_DIR_NAME . "/assets/addons/tenor/header.png"); ?><!--" style="height:50px; width:auto; vertical-align:middle; margin:0px 10px; text-decoration:none; float: left;"/>-->
2224
+ <!-- <a href="https://gvectors.com/product/wpdiscuz-tenor-integration/" target="_blank" style="color:#444; text-decoration:none;" title="--><?php //esc_attr_e("Go to the addon page", "wpdiscuz"); ?><!--">wpDiscuz - Tenor GIFs Integration <br><span style="margin: 0; font-size: 12px; line-height: 15px; display: block; padding-top: 5px;">This adds Tenor [GIF] button on the toolbar of comment editor. Clicking this will open a new popup where you can search for your favorite gifs and insert them in your comment content.</span></a>-->
2225
  <!-- </div>-->
2226
+ <!-- --><?php //endif; ?>
2227
  <div style="clear:both;"></div>
2228
  </div>
2229
  <p>&nbsp;&nbsp;&nbsp;<a href="<?php echo esc_url_raw(admin_url("admin.php?page=" . self::PAGE_ADDONS)); ?>"><?php esc_html_e("Go to wpDiscuz Addons subMenu"); ?> &raquo;</a></p>
options/tools-layouts/tool-options.php CHANGED
@@ -15,13 +15,6 @@ if (!defined("ABSPATH")) {
15
  <form action="" method="post" class="wc-tools-settings-form wc-form">
16
  <?php wp_nonce_field("wc_tools_form", "wpd-options-export"); ?>
17
  <div class="wpdtool-block">
18
- <?php if (file_exists($wpdiscuzOptionsDir . self::OPTIONS_FILENAME . ".txt")) { ?>
19
- <div class="wpdtool-left">
20
- <a href="<?php echo esc_url_raw($wpdiscuzOptionsUrl . self::OPTIONS_FILENAME . ".txt"); ?>" download="<?php echo esc_attr(self::OPTIONS_FILENAME . ".txt"); ?>" class="button button-secondary">
21
- <?php esc_html_e("Download Options", "wpdiscuz"); ?>
22
- </a>
23
- </div>
24
- <?php } ?>
25
  <div class="wpdtool-right">
26
  <input type="submit" name="wpdiscuz-export-submit" class="button button-primary" value="<?php esc_attr_e("Backup Options", "wpdiscuz"); ?>">
27
  </div>
15
  <form action="" method="post" class="wc-tools-settings-form wc-form">
16
  <?php wp_nonce_field("wc_tools_form", "wpd-options-export"); ?>
17
  <div class="wpdtool-block">
 
 
 
 
 
 
 
18
  <div class="wpdtool-right">
19
  <input type="submit" name="wpdiscuz-export-submit" class="button button-primary" value="<?php esc_attr_e("Backup Options", "wpdiscuz"); ?>">
20
  </div>
options/tools-layouts/tool-phrases.php CHANGED
@@ -16,13 +16,6 @@ if (!defined("ABSPATH")) {
16
  <form action="" method="post" class="wc-tools-settings-form wc-form">
17
  <?php wp_nonce_field("wc_tools_form", "wpd-phrases-export"); ?>
18
  <div class="wpdtool-block">
19
- <?php if (file_exists($wpdiscuzOptionsDir . self::PHRASES_FILENAME . ".txt")) { ?>
20
- <div class="wpdtool-left">
21
- <a href="<?php echo esc_url_raw($wpdiscuzOptionsUrl . self::PHRASES_FILENAME . ".txt"); ?>" download="<?php echo esc_attr(self::PHRASES_FILENAME . ".txt"); ?>" class="button button-secondary">
22
- <?php esc_html_e("Download Phrases", "wpdiscuz"); ?>
23
- </a>
24
- </div>
25
- <?php } ?>
26
  <div class="wpdtool-right">
27
  <input type="submit" name="wpdiscuz-export-submit" class="button button-primary" value="<?php esc_attr_e("Backup Phrases", "wpdiscuz"); ?>">
28
  </div>
16
  <form action="" method="post" class="wc-tools-settings-form wc-form">
17
  <?php wp_nonce_field("wc_tools_form", "wpd-phrases-export"); ?>
18
  <div class="wpdtool-block">
 
 
 
 
 
 
 
19
  <div class="wpdtool-right">
20
  <input type="submit" name="wpdiscuz-export-submit" class="button button-primary" value="<?php esc_attr_e("Backup Phrases", "wpdiscuz"); ?>">
21
  </div>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: gVectors Team
3
  Tags: comment, comments, ajax comments, comment form, comment fields
4
  Requires at least: 5.0
5
  Tested up to: 5.9
6
- Stable tag: 7.3.11
7
  Requires PHP: 5.6 and higher
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
@@ -185,6 +185,14 @@ Nothing will be lost! **Comments - wpDiscuz** will show all old comments.
185
 
186
  == Changelog ==
187
 
 
 
 
 
 
 
 
 
188
  = Comments - wpDiscuz v7.3.11 - 25.01.2022 =
189
 
190
  * Added: WordPress v5.9 compatibility
3
  Tags: comment, comments, ajax comments, comment form, comment fields
4
  Requires at least: 5.0
5
  Tested up to: 5.9
6
+ Stable tag: 7.3.12
7
  Requires PHP: 5.6 and higher
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
185
 
186
  == Changelog ==
187
 
188
+ = Comments - wpDiscuz v7.3.12 - 10.02.2022 =
189
+
190
+ * Fixed Bug: Issues with the validation of the 'wmuMaxFileSize' variable
191
+ * Fixed Bug: Compatibility with the Twenty Twenty Two theme
192
+ * Fixed Bug: Issues on cache files removing
193
+ * Fixed Bug: More secure way of backup for options and phrases
194
+ * Fixed Bug: Error when submitting the import options/phrases form without a file
195
+
196
  = Comments - wpDiscuz v7.3.11 - 25.01.2022 =
197
 
198
  * Added: WordPress v5.9 compatibility
utils/class.WpdiscuzCache.php CHANGED
@@ -112,10 +112,8 @@ class WpdiscuzCache implements WpDiscuzConstants {
112
  }
113
 
114
  private function getCache($fileInfo) {
115
- // if ($this->options->wp["isPaginate"]) {
116
- // return [];
117
- // }
118
-
119
  if ($this->options->general["isCacheEnabled"] && file_exists($fileInfo["path"])) {
120
  $fileCreateTime = filemtime($fileInfo["path"]);
121
 
@@ -125,7 +123,7 @@ class WpdiscuzCache implements WpDiscuzConstants {
125
  * do not use current_time here as it returns WP time
126
  */
127
  if (time() > $fileCreateTime + ($this->options->general["cacheTimeout"] * DAY_IN_SECONDS)) {
128
- unlink($fileInfo["path"]);
129
  return [];
130
  }
131
  if (is_readable($fileInfo["path"]) && ($cache = maybe_unserialize(file_get_contents($fileInfo["path"])))) {
@@ -136,11 +134,9 @@ class WpdiscuzCache implements WpDiscuzConstants {
136
  }
137
 
138
  private function setCache($fileInfo, $data) {
139
- // if ($this->options->wp["isPaginate"]) {
140
- // return false;
141
- // }
142
-
143
  if ($this->options->general["isCacheEnabled"]) {
 
 
144
  if (!is_dir($fileInfo["dir"])) {
145
  wp_mkdir_p($fileInfo["dir"]);
146
  }
@@ -180,7 +176,7 @@ class WpdiscuzCache implements WpDiscuzConstants {
180
  private function getCommentsCacheFileinfo($commentsArgs) {
181
  $dirs = $this->getCacheDirectories();
182
  $fileDir = $dirs["comments"] . $commentsArgs["post_id"] . "/";
183
- $fileName = md5(implode(",", $commentsArgs["user_roles"]) . $commentsArgs["wpdType"] . $commentsArgs["last_parent_id"] . $commentsArgs["page"] . $commentsArgs["order"] . $commentsArgs["orderby"]) . "_" . $commentsArgs["last_parent_id"];
184
  return [
185
  "basedir" => $dirs["comments"],
186
  "name" => $fileName,
112
  }
113
 
114
  private function getCache($fileInfo) {
115
+ // removing stat caches to avoid unexpected results
116
+ clearstatcache();
 
 
117
  if ($this->options->general["isCacheEnabled"] && file_exists($fileInfo["path"])) {
118
  $fileCreateTime = filemtime($fileInfo["path"]);
119
 
123
  * do not use current_time here as it returns WP time
124
  */
125
  if (time() > $fileCreateTime + ($this->options->general["cacheTimeout"] * DAY_IN_SECONDS)) {
126
+ @unlink($fileInfo["path"]);
127
  return [];
128
  }
129
  if (is_readable($fileInfo["path"]) && ($cache = maybe_unserialize(file_get_contents($fileInfo["path"])))) {
134
  }
135
 
136
  private function setCache($fileInfo, $data) {
 
 
 
 
137
  if ($this->options->general["isCacheEnabled"]) {
138
+ // removing stat caches to avoid unexpected results
139
+ clearstatcache();
140
  if (!is_dir($fileInfo["dir"])) {
141
  wp_mkdir_p($fileInfo["dir"]);
142
  }
176
  private function getCommentsCacheFileinfo($commentsArgs) {
177
  $dirs = $this->getCacheDirectories();
178
  $fileDir = $dirs["comments"] . $commentsArgs["post_id"] . "/";
179
+ $fileName = md5(implode(",", $commentsArgs["user_roles"]) . $commentsArgs["wpdType"] . $commentsArgs["last_parent_id"] . $commentsArgs["page"] . $commentsArgs["order"] . $commentsArgs["orderby"]) . "_" . $commentsArgs["last_parent_id"];
180
  return [
181
  "basedir" => $dirs["comments"],
182
  "name" => $fileName,