Perfect Brands for WooCommerce - Version 1.9.3

Version Description

  • Fix: php error
Download this release

Release Info

Developer quadlayers
Plugin Icon 128x128 Perfect Brands for WooCommerce
Version 1.9.3
Comparing to
See all releases

Code changes from version 1.9.2 to 1.9.3

classes/admin/class-pwb-suggestions.php CHANGED
@@ -4,9 +4,11 @@ namespace Perfect_Woocommerce_Brands\Admin;
4
 
5
  defined('ABSPATH') or die('No script kiddies please!');
6
 
7
- class PWB_Suggestions {
 
8
 
9
- public function __construct() {
 
10
  add_action('admin_menu', array($this, 'add_menu'));
11
  add_action('admin_init', array($this, 'add_redirect'));
12
  add_action('admin_head', array($this, 'remove_menu'));
@@ -16,9 +18,24 @@ class PWB_Suggestions {
16
  // Admin
17
  // -------------------------------------------------------------------------
18
 
19
- public function add_page() {
20
- include_once( PWB_PLUGIN_DIR . 'classes/class-pwb-suggestions-list.php' );
21
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  <div class="wrap about-wrap full-width-layout">
23
 
24
  <h1><?php esc_html_e('Suggestions', 'perfect-woocommerce-brands'); ?></h1>
@@ -26,7 +43,7 @@ class PWB_Suggestions {
26
  <p class="about-text"><?php printf(esc_html__('Thanks for using our product! We recommend these extensions that will add new features to stand out your business and improve your sales.', 'perfect-woocommerce-brands'), PWB_PLUGIN_NAME); ?></p>
27
 
28
  <p class="about-text">
29
- <?php printf('<a href="%s" target="_blank">%s</a>', PWB_PURCHASE_URL, esc_html__('Purchase', 'perfect-woocommerce-brands')); ?></a> |
30
  <?php printf('<a href="%s" target="_blank">%s</a>', PWB_DOCUMENTATION_URL, esc_html__('Documentation', 'perfect-woocommerce-brands')); ?></a>
31
  </p>
32
 
@@ -50,24 +67,26 @@ class PWB_Suggestions {
50
  position: relative;
51
  margin: 25px 40px 0 20px;
52
  max-width: 1200px;">
53
- <?php
54
- $wp_list_table = new \Perfect_Woocommerce_Brands\PWB_Suggestions_List_Table();
55
- $wp_list_table->prepare_items();
56
- ?>
57
  <form id="plugin-filter" method="post" class="importer-item">
58
  <?php $wp_list_table->display(); ?>
59
  </form>
60
  </div>
61
- <?php
62
  }
63
 
64
- public function add_menu() {
 
65
  add_menu_page(PWB_PLUGIN_NAME, PWB_PLUGIN_NAME, 'manage_woocommerce', PWB_PREFIX, array($this, 'add_page'));
66
  add_submenu_page(PWB_PREFIX, esc_html__('Suggestions', 'perfect-woocommerce-brands'), esc_html__('Suggestions', 'perfect-woocommerce-brands'), 'manage_woocommerce', PWB_PREFIX . '_suggestions', array($this, 'add_page'));
67
  }
68
 
69
  // fix for activateUrl on install now button
70
- public function network_admin_url($url, $path) {
 
71
 
72
  if (wp_doing_ajax() && !is_network_admin()) {
73
  if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'install-plugin') {
@@ -80,7 +99,8 @@ class PWB_Suggestions {
80
  return $url;
81
  }
82
 
83
- public function add_redirect() {
 
84
 
85
  if (isset($_REQUEST['activate']) && $_REQUEST['activate'] == 'true') {
86
  if (wp_get_referer() == admin_url('admin.php?page=' . PWB_PREFIX . '_suggestions')) {
@@ -89,16 +109,14 @@ class PWB_Suggestions {
89
  }
90
  }
91
 
92
- public function remove_menu() {
93
- ?>
 
94
  <style>
95
-
96
  li.toplevel_page_<?php echo PWB_PREFIX; ?> {
97
- display:none;
98
  }
99
-
100
  </style>
101
- <?php
102
  }
103
-
104
  }
4
 
5
  defined('ABSPATH') or die('No script kiddies please!');
6
 
7
+ class PWB_Suggestions
8
+ {
9
 
10
+ public function __construct()
11
+ {
12
  add_action('admin_menu', array($this, 'add_menu'));
13
  add_action('admin_init', array($this, 'add_redirect'));
14
  add_action('admin_head', array($this, 'remove_menu'));
18
  // Admin
19
  // -------------------------------------------------------------------------
20
 
21
+ public function add_page()
22
+ {
23
+ include_once(PWB_PLUGIN_DIR . 'classes/class-pwb-suggestions-list.php');
24
+ ?>
25
+ <style>
26
+ @media screen and (max-width: 2299px) and (min-width: 1600px) {
27
+
28
+ #the-list {
29
+ display: flex;
30
+ flex-wrap: wrap;
31
+ }
32
+
33
+ .plugin-card {
34
+ margin: 8px !important;
35
+ width: calc(50% - 4px - 16px) !important;
36
+ }
37
+ }
38
+ </style>
39
  <div class="wrap about-wrap full-width-layout">
40
 
41
  <h1><?php esc_html_e('Suggestions', 'perfect-woocommerce-brands'); ?></h1>
43
  <p class="about-text"><?php printf(esc_html__('Thanks for using our product! We recommend these extensions that will add new features to stand out your business and improve your sales.', 'perfect-woocommerce-brands'), PWB_PLUGIN_NAME); ?></p>
44
 
45
  <p class="about-text">
46
+ <?php printf('<a href="%s" target="_blank">%s</a>', PWB_PURCHASE_URL, esc_html__('Purchase', 'perfect-woocommerce-brands')); ?></a> |
47
  <?php printf('<a href="%s" target="_blank">%s</a>', PWB_DOCUMENTATION_URL, esc_html__('Documentation', 'perfect-woocommerce-brands')); ?></a>
48
  </p>
49
 
67
  position: relative;
68
  margin: 25px 40px 0 20px;
69
  max-width: 1200px;">
70
+ <?php
71
+ $wp_list_table = new \Perfect_Woocommerce_Brands\PWB_Suggestions_List_Table();
72
+ $wp_list_table->prepare_items();
73
+ ?>
74
  <form id="plugin-filter" method="post" class="importer-item">
75
  <?php $wp_list_table->display(); ?>
76
  </form>
77
  </div>
78
+ <?php
79
  }
80
 
81
+ public function add_menu()
82
+ {
83
  add_menu_page(PWB_PLUGIN_NAME, PWB_PLUGIN_NAME, 'manage_woocommerce', PWB_PREFIX, array($this, 'add_page'));
84
  add_submenu_page(PWB_PREFIX, esc_html__('Suggestions', 'perfect-woocommerce-brands'), esc_html__('Suggestions', 'perfect-woocommerce-brands'), 'manage_woocommerce', PWB_PREFIX . '_suggestions', array($this, 'add_page'));
85
  }
86
 
87
  // fix for activateUrl on install now button
88
+ public function network_admin_url($url, $path)
89
+ {
90
 
91
  if (wp_doing_ajax() && !is_network_admin()) {
92
  if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'install-plugin') {
99
  return $url;
100
  }
101
 
102
+ public function add_redirect()
103
+ {
104
 
105
  if (isset($_REQUEST['activate']) && $_REQUEST['activate'] == 'true') {
106
  if (wp_get_referer() == admin_url('admin.php?page=' . PWB_PREFIX . '_suggestions')) {
109
  }
110
  }
111
 
112
+ public function remove_menu()
113
+ {
114
+ ?>
115
  <style>
 
116
  li.toplevel_page_<?php echo PWB_PREFIX; ?> {
117
+ display: none;
118
  }
 
119
  </style>
120
+ <?php
121
  }
 
122
  }
classes/class-pwb-suggestions-list.php CHANGED
@@ -2,20 +2,22 @@
2
 
3
  namespace Perfect_Woocommerce_Brands;
4
 
5
- require_once( ABSPATH . 'wp-admin/includes/class-wp-plugin-install-list-table.php' );
6
 
7
- class PWB_Suggestions_List_Table extends \WP_Plugin_Install_List_Table {
 
8
 
9
  public $promote = array(
10
- 'woocommerce-checkout-manager',
11
- 'woocommerce-direct-checkout',
12
- 'wp-whatsapp-chat',
13
- 'wp-tiktok-feed',
14
- 'insta-gallery',
15
- 'quadmenu',
16
  );
17
 
18
- private function remove_plugins($plugins) {
 
19
 
20
  $promote = array();
21
 
@@ -30,7 +32,8 @@ class PWB_Suggestions_List_Table extends \WP_Plugin_Install_List_Table {
30
  return $promote;
31
  }
32
 
33
- public function self_admin_url($url, $path) {
 
34
 
35
  if (strpos($url, 'tab=plugin-information') !== false) {
36
  $url = network_admin_url($path);
@@ -39,7 +42,8 @@ class PWB_Suggestions_List_Table extends \WP_Plugin_Install_List_Table {
39
  return $url;
40
  }
41
 
42
- public function network_admin_url($url, $path) {
 
43
 
44
  if (strpos($url, 'plugins.php') !== false) {
45
  $url = self_admin_url($path);
@@ -48,25 +52,28 @@ class PWB_Suggestions_List_Table extends \WP_Plugin_Install_List_Table {
48
  return $url;
49
  }
50
 
51
- public function display_rows() {
 
52
  add_filter('self_admin_url', array($this, 'self_admin_url'), 10, 2);
53
  add_filter('network_admin_url', array($this, 'network_admin_url'), 10, 2);
54
  parent::display_rows();
55
  }
56
 
57
- public function is_connected() {
 
58
 
59
  global $wp_version;
60
 
61
  $http_args = array(
62
- 'timeout' => 15,
63
- 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url('/'),
64
  );
65
 
66
  return is_wp_error(wp_remote_get('http://api.wordpress.org/plugins/info/1.2/', $http_args));
67
  }
68
 
69
- public function get_plugins() {
 
70
 
71
  $tk = PWB_PREFIX . '_suggestions_plugins';
72
 
@@ -75,9 +82,9 @@ class PWB_Suggestions_List_Table extends \WP_Plugin_Install_List_Table {
75
  if ($plugins === false) {
76
 
77
  $args = array(
78
- 'per_page' => 36,
79
- 'author' => 'quadlayers',
80
- 'locale' => get_user_locale(),
81
  );
82
 
83
  $api = plugins_api('query_plugins', $args);
@@ -93,9 +100,10 @@ class PWB_Suggestions_List_Table extends \WP_Plugin_Install_List_Table {
93
  return $plugins;
94
  }
95
 
96
- public function prepare_items() {
 
97
 
98
- include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
99
 
100
  global $tabs, $tab;
101
 
@@ -103,7 +111,7 @@ class PWB_Suggestions_List_Table extends \WP_Plugin_Install_List_Table {
103
  wp_enqueue_script('plugin-install');
104
  wp_enqueue_script('thickbox');
105
  wp_enqueue_script('updates');
106
- wp_localize_script('updates', 'pagenow', 'plugin-install-network');
107
 
108
  wp_reset_vars(array('tab'));
109
 
@@ -127,16 +135,19 @@ class PWB_Suggestions_List_Table extends \WP_Plugin_Install_List_Table {
127
  $nonmenu_tabs = apply_filters('install_plugins_nonmenu_tabs', $nonmenu_tabs);
128
 
129
  // If a non-valid menu tab has been selected, And it's not a non-menu action.
130
- if (empty($tab) || (!isset($tabs[$tab]) && !in_array($tab, (array) $nonmenu_tabs) )) {
131
  $tab = key($tabs);
132
  }
133
 
134
  $this->items = $this->get_plugins();
135
 
136
 
137
- wp_localize_script('updates', '_wpUpdatesItemCounts', array(
138
- 'totals' => wp_get_update_data())
 
 
 
 
139
  );
140
  }
141
-
142
  }
2
 
3
  namespace Perfect_Woocommerce_Brands;
4
 
5
+ require_once(ABSPATH . 'wp-admin/includes/class-wp-plugin-install-list-table.php');
6
 
7
+ class PWB_Suggestions_List_Table extends \WP_Plugin_Install_List_Table
8
+ {
9
 
10
  public $promote = array(
11
+ 'woocommerce-checkout-manager',
12
+ 'woocommerce-direct-checkout',
13
+ 'wp-whatsapp-chat',
14
+ 'wp-tiktok-feed',
15
+ 'insta-gallery',
16
+ 'quadmenu',
17
  );
18
 
19
+ private function remove_plugins($plugins)
20
+ {
21
 
22
  $promote = array();
23
 
32
  return $promote;
33
  }
34
 
35
+ public function self_admin_url($url, $path)
36
+ {
37
 
38
  if (strpos($url, 'tab=plugin-information') !== false) {
39
  $url = network_admin_url($path);
42
  return $url;
43
  }
44
 
45
+ public function network_admin_url($url, $path)
46
+ {
47
 
48
  if (strpos($url, 'plugins.php') !== false) {
49
  $url = self_admin_url($path);
52
  return $url;
53
  }
54
 
55
+ public function display_rows()
56
+ {
57
  add_filter('self_admin_url', array($this, 'self_admin_url'), 10, 2);
58
  add_filter('network_admin_url', array($this, 'network_admin_url'), 10, 2);
59
  parent::display_rows();
60
  }
61
 
62
+ public function is_connected()
63
+ {
64
 
65
  global $wp_version;
66
 
67
  $http_args = array(
68
+ 'timeout' => 15,
69
+ 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url('/'),
70
  );
71
 
72
  return is_wp_error(wp_remote_get('http://api.wordpress.org/plugins/info/1.2/', $http_args));
73
  }
74
 
75
+ public function get_plugins()
76
+ {
77
 
78
  $tk = PWB_PREFIX . '_suggestions_plugins';
79
 
82
  if ($plugins === false) {
83
 
84
  $args = array(
85
+ 'per_page' => 36,
86
+ 'author' => 'quadlayers',
87
+ 'locale' => get_user_locale(),
88
  );
89
 
90
  $api = plugins_api('query_plugins', $args);
100
  return $plugins;
101
  }
102
 
103
+ public function prepare_items()
104
+ {
105
 
106
+ include_once(ABSPATH . 'wp-admin/includes/plugin-install.php');
107
 
108
  global $tabs, $tab;
109
 
111
  wp_enqueue_script('plugin-install');
112
  wp_enqueue_script('thickbox');
113
  wp_enqueue_script('updates');
114
+ // wp_localize_script('updates', 'pagenow', array('plugin-install-network'))
115
 
116
  wp_reset_vars(array('tab'));
117
 
135
  $nonmenu_tabs = apply_filters('install_plugins_nonmenu_tabs', $nonmenu_tabs);
136
 
137
  // If a non-valid menu tab has been selected, And it's not a non-menu action.
138
+ if (empty($tab) || (!isset($tabs[$tab]) && !in_array($tab, (array) $nonmenu_tabs))) {
139
  $tab = key($tabs);
140
  }
141
 
142
  $this->items = $this->get_plugins();
143
 
144
 
145
+ wp_localize_script(
146
+ 'updates',
147
+ '_wpUpdatesItemCounts',
148
+ array(
149
+ 'totals' => wp_get_update_data()
150
+ )
151
  );
152
  }
 
153
  }
perfect-woocommerce-brands.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Perfect Brands for WooCommerce
5
  * Plugin URI: https://quadlayers.com/portfolio/perfect-woocommerce-brands/
6
  * Description: Perfect WooCommerce Brands allows you to show product brands in your WooCommerce based store.
7
- * Version: 1.9.2
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * Text Domain: perfect-woocommerce-brands
@@ -36,7 +36,7 @@ define('PWB_PLUGIN_FILE', __FILE__);
36
  define('PWB_PLUGIN_URL', plugins_url('', __FILE__));
37
  define('PWB_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR);
38
  define('PWB_PLUGIN_BASENAME', plugin_basename(__FILE__));
39
- define('PWB_PLUGIN_VERSION', '1.9.2');
40
  define('PWB_PLUGIN_NAME', 'Perfect WooCommerce Brands');
41
  define('PWB_PREFIX', 'pwb');
42
  define('PWB_REVIEW_URL', 'https://wordpress.org/support/plugin/perfect-woocommerce-brands/reviews/?filter=5#new-post');
4
  * Plugin Name: Perfect Brands for WooCommerce
5
  * Plugin URI: https://quadlayers.com/portfolio/perfect-woocommerce-brands/
6
  * Description: Perfect WooCommerce Brands allows you to show product brands in your WooCommerce based store.
7
+ * Version: 1.9.3
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * Text Domain: perfect-woocommerce-brands
36
  define('PWB_PLUGIN_URL', plugins_url('', __FILE__));
37
  define('PWB_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR);
38
  define('PWB_PLUGIN_BASENAME', plugin_basename(__FILE__));
39
+ define('PWB_PLUGIN_VERSION', '1.9.3');
40
  define('PWB_PLUGIN_NAME', 'Perfect WooCommerce Brands');
41
  define('PWB_PREFIX', 'pwb');
42
  define('PWB_REVIEW_URL', 'https://wordpress.org/support/plugin/perfect-woocommerce-brands/reviews/?filter=5#new-post');
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: woocommerce, woocommerce brands, woocommerce product, woocommerce manufact
5
  Requires at least: 4.7
6
  Tested up to: 5.8
7
  Requires PHP: 5.6
8
- Stable tag: 1.9.2
9
  WC requires at least: 3.0
10
  WC tested up to: 5.5
11
  License: GPLv3
@@ -90,6 +90,8 @@ You can also contribute [translating the plugin](https://translate.wordpress.org
90
 
91
 
92
  == Changelog ==
 
 
93
  = 1.9.2 =
94
  * Add: QuadLayers dashboard widget
95
  = 1.9.1 =
5
  Requires at least: 4.7
6
  Tested up to: 5.8
7
  Requires PHP: 5.6
8
+ Stable tag: 1.9.3
9
  WC requires at least: 3.0
10
  WC tested up to: 5.5
11
  License: GPLv3
90
 
91
 
92
  == Changelog ==
93
+ = 1.9.3 =
94
+ * Fix: php error
95
  = 1.9.2 =
96
  * Add: QuadLayers dashboard widget
97
  = 1.9.1 =