WooCommerce Checkout Manager - Version 5.4.9

Version Description

Download this release

Release Info

Developer quadlayers
Plugin Icon 128x128 WooCommerce Checkout Manager
Version 5.4.9
Comparing to
See all releases

Code changes from version 5.4.8 to 5.4.9

includes/quadlayers/widget.php CHANGED
@@ -23,19 +23,8 @@ class QL_Widget
23
 
24
  public function display_dashboard_widget()
25
  {
26
- $rss = fetch_feed('https://quadlayers.com/news/feed/');
27
 
28
- if (is_wp_error($rss)) {
29
- printf('<p><strong>%s: </strong>%s</p>', __('Error', 'woocommerce-checkout-manager'), $rss->get_error_message());
30
- return;
31
- }
32
-
33
- if (!$rss->get_item_quantity()) {
34
- printf('<ul><li>%s</li></ul>', __('An error has occurred, which probably means the feed is down. Try again later', 'woocommerce-checkout-manager'));
35
- $rss->__destruct();
36
- unset($rss);
37
- return;
38
- }
39
  ?>
40
  <div>
41
  <div>
@@ -49,35 +38,38 @@ class QL_Widget
49
  </div>
50
  <div style="margin: 16px -12px 0; padding: 12px 12px 0;border-top: 1px solid #eee;">
51
  <ul>
52
- <?php
53
- foreach ($rss->get_items(0, 3) as $item) {
54
- $link = $item->get_link();
55
- while (stristr($link, 'http') !== $link) {
56
- $link = substr($link, 1);
57
- }
58
-
59
- $link = esc_url(strip_tags($link . '?utm_source=ql_dashboard'));
60
- $title = esc_html(trim(strip_tags($item->get_title())));
61
-
62
- if (empty($title)) {
63
- $title = __('Untitled', 'woocommerce-checkout-manager');
64
- }
65
-
66
- $desc = html_entity_decode($item->get_description(), ENT_QUOTES, get_option('blog_charset'));
67
- $desc = esc_attr(wp_trim_words($desc, 15, '...'));
68
- $summary = $desc;
69
- $summary = '<div class="rssSummary">' . $summary . '</div>';
70
-
71
- $date = $item->get_date('U');
72
- if ($date) {
73
- $date = '<span class="rss-date">' . date_i18n(get_option('date_format'), $date) . '</span>';
74
- }
75
- $author = $item->get_author();
76
- $author = ucfirst($author->get_name());
77
- $author = ' <cite>' . esc_html(strip_tags($author)) . '</cite>';
78
-
79
- printf(__('<li><a href="%s" target="_blank">%s </a>%s%s%s</li>', 'woocommerce-checkout-manager'), $link, $title, $date, $summary, $author);
80
- } ?>
 
 
 
81
  </ul>
82
  </div>
83
  <div style="display: flex; justify-content: space-between;align-items: center;margin: 16px -12px 0;padding: 12px 12px 0; border-top: 1px solid #eee;">
@@ -87,6 +79,41 @@ class QL_Widget
87
  <?php
88
  }
89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  public static function instance()
91
  {
92
  if (!isset(self::$instance)) {
23
 
24
  public function display_dashboard_widget()
25
  {
26
+ $feed_items = $this->get_feed();
27
 
 
 
 
 
 
 
 
 
 
 
 
28
  ?>
29
  <div>
30
  <div>
38
  </div>
39
  <div style="margin: 16px -12px 0; padding: 12px 12px 0;border-top: 1px solid #eee;">
40
  <ul>
41
+ <?php if (is_array($feed_items)) { ?>
42
+ <?php
43
+ foreach ($feed_items as $item) {
44
+
45
+ $link = $item['link'];
46
+ while (stristr($link, 'http') !== $link) {
47
+ $link = substr($link, 1);
48
+ }
49
+
50
+ $link = esc_url(strip_tags($link . '?utm_source=ql_dashboard'));
51
+ $title = esc_html(trim(strip_tags($item['title'])));
52
+
53
+ if (empty($title)) {
54
+ $title = __('Untitled', 'woocommerce-checkout-manager');
55
+ }
56
+
57
+ $desc = html_entity_decode($item['desc'], ENT_QUOTES, get_option('blog_charset'));
58
+ $desc = esc_attr(wp_trim_words($desc, 15, '...'));
59
+ $summary = $desc;
60
+ $summary = '<div class="rssSummary">' . $summary . '</div>';
61
+ $date = $item['date'];
62
+ if ($date) {
63
+ $date = '<span class="rss-date">' . date_i18n(get_option('date_format'), $date) . '</span>';
64
+ }
65
+ $author = $item['author'];
66
+ $author = ucfirst($author);
67
+ $author = ' <cite>' . esc_html(strip_tags($author)) . '</cite>';
68
+ printf(__('<li><a href="%s" target="_blank">%s </a>%s%s%s</li>', 'woocommerce-checkout-manager'), $link, $title, $date, $summary, $author);
69
+ } ?>
70
+ <?php } else {
71
+ printf(__('<li>%s</li>', 'woocommerce-checkout-manager'), $feed_items);
72
+ } ?>
73
  </ul>
74
  </div>
75
  <div style="display: flex; justify-content: space-between;align-items: center;margin: 16px -12px 0;padding: 12px 12px 0; border-top: 1px solid #eee;">
79
  <?php
80
  }
81
 
82
+ public function get_feed()
83
+ {
84
+ $rss_items = get_transient('quadlayers_news_feed');
85
+
86
+ if ($rss_items === false) {
87
+ $rss = fetch_feed('https://quadlayers.com/news/feed/');
88
+
89
+ if (is_wp_error($rss)) {
90
+ return "An error has occurred, which probably means the feed is down. Try again later";
91
+ }
92
+
93
+ if (!$rss->get_item_quantity()) {
94
+ $rss->__destruct();
95
+ unset($rss);
96
+ return "An error has occurred, which probably means the feed is down. Try again later";
97
+ }
98
+
99
+ $rss_items = [];
100
+
101
+ foreach ($rss->get_items(0, 3) as $item) {
102
+ $rss_items[] = [
103
+ 'link' => $item->get_link(),
104
+ 'author' => $item->get_author()->get_name(),
105
+ 'title' => $item->get_title(),
106
+ 'desc' => $item->get_description(),
107
+ 'date' => $item->get_date('U')
108
+ ];
109
+ }
110
+
111
+ set_transient('quadlayers_news_feed', $rss_items, DAY_IN_SECONDS);
112
+ }
113
+
114
+ return $rss_items;
115
+ }
116
+
117
  public static function instance()
118
  {
119
  if (!isset(self::$instance)) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://quadlayers.com/
4
  Tags: woocommerce, woocommerce checkout, field manager, checkout editor, checkout field, shipping field, billing field, order field, additional field
5
  Requires at least: 3.4
6
  Tested up to: 5.8
7
- Stable tag: 5.4.8
8
  WC requires at least: 3.1.0
9
  WC tested up to: 5.5
10
  License: GPLv3
@@ -107,6 +107,9 @@ Your Order data can be reviewed in each order within the default WooCommerce Ord
107
 
108
  == Changelog ==
109
 
 
 
 
110
  = 5.4.8 =
111
  * Fix: WordPress compatibility
112
 
4
  Tags: woocommerce, woocommerce checkout, field manager, checkout editor, checkout field, shipping field, billing field, order field, additional field
5
  Requires at least: 3.4
6
  Tested up to: 5.8
7
+ Stable tag: 5.4.9
8
  WC requires at least: 3.1.0
9
  WC tested up to: 5.5
10
  License: GPLv3
107
 
108
  == Changelog ==
109
 
110
+ = 5.4.9 =
111
+ * Fix. QuadLayers widget cache
112
+
113
  = 5.4.8 =
114
  * Fix: WordPress compatibility
115
 
woocommerce-checkout-manager.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Checkout Fields Manager for WooCommerce
5
  * Plugin URI: https://quadlayers.com/portfolio/woocommerce-checkout-manager/
6
  * Description: Manages WooCommerce Checkout, the advanced way.
7
- * Version: 5.4.8
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
@@ -20,7 +20,7 @@ if (!defined('WOOCCM_PLUGIN_NAME')) {
20
  define('WOOCCM_PLUGIN_NAME', 'Checkout Fields Manager for WooCommerce');
21
  }
22
  if (!defined('WOOCCM_PLUGIN_VERSION')) {
23
- define('WOOCCM_PLUGIN_VERSION', '5.4.8');
24
  }
25
  if (!defined('WOOCCM_PLUGIN_FILE')) {
26
  define('WOOCCM_PLUGIN_FILE', __FILE__);
4
  * Plugin Name: Checkout Fields Manager for WooCommerce
5
  * Plugin URI: https://quadlayers.com/portfolio/woocommerce-checkout-manager/
6
  * Description: Manages WooCommerce Checkout, the advanced way.
7
+ * Version: 5.4.9
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * License: GPLv3
20
  define('WOOCCM_PLUGIN_NAME', 'Checkout Fields Manager for WooCommerce');
21
  }
22
  if (!defined('WOOCCM_PLUGIN_VERSION')) {
23
+ define('WOOCCM_PLUGIN_VERSION', '5.4.9');
24
  }
25
  if (!defined('WOOCCM_PLUGIN_FILE')) {
26
  define('WOOCCM_PLUGIN_FILE', __FILE__);