PluginProbe
Groups – Memberships and Access Control / 3.9.0
Groups – Memberships and Access Control v3.9.0
4.7.1 4.7.0 4.6.0 4.5.0 4.4.0 4.3.0 trunk 1.0.0-beta-1 1.0.0-beta-2 1.0.0-beta-3 1.0.0-beta-3b 1.0.0-beta-3c 1.0.0-beta-3d 1.1.4 1.1.5 1.10.0 1.10.1 1.10.2 1.10.3 1.11.0 1.11.1 1.11.2 1.11.3 1.12.0 1.13.0 All 131 releases
groups / lib / admin / groups-admin-add-ons.php

groups-admin-add-ons.php in Groups – Memberships and Access Control 3.9.0, at lib/admin/groups-admin-add-ons.php

297 lines 13.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * groups-admin-add-ons.php
4 *
5 * Copyright (c) "kento" Karim Rahimpur www.itthinx.com
6 *
7 * This code is released under the GNU General Public License.
8 * See COPYRIGHT.txt and LICENSE.txt.
9 *
10 * This code is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * This header and all notices must be kept intact.
16 *
17 * @author Karim Rahimpur
18 * @package groups
19 * @since groups 1.8.0
20 */
21
22 if ( !defined( 'ABSPATH' ) ) {
23 exit;
24 }
25
26 /**
27 * Renders the heading and content container for the Add-Ons section.
28 */
29 function groups_admin_add_ons() {
30 echo '<div class="groups-admin-add-ons wrap">';
31 echo '<h1>';
32 echo esc_html__( 'Add-Ons', 'groups' );
33 echo '</h1>';
34
35 echo '<div class="groups-extensions-support-contribute">';
36 $extensions_box = '<div id="groups-extensions-support">';
37 $extensions_box .= '<div id="groups-extensions-support-inside">';
38 $extensions_box .= '<h2>';
39 $extensions_box .= esc_html__( 'Your support matters!', 'groups' );
40 $extensions_box .= '</h2>';
41 $extensions_box .= '<p>';
42 $extensions_box .= esc_html__( 'Enhanced functionality is available via official extensions for Groups.', 'groups' );
43 $extensions_box .= '</p>';
44 $extensions_box .= '<p>';
45 $extensions_box .= esc_html__( 'By getting an official extension, you fund the work that is necessary to maintain and improve Groups.', 'groups' );
46 $extensions_box .= '</p>';
47 $extensions_box .= '</div>';
48 $extensions_box .= Groups_Admin_Notice::get_groups_bitcoin_box( array( 'type' => 'horizontal', 'where' => 'add-ons' ) );
49 $extensions_box .= '</div>';
50 echo $extensions_box; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
51
52 // echo Groups_Admin_Notice::get_groups_bitcoin_box( array( 'type' => 'horizontal', 'where' => 'add-ons' ) );
53
54 echo '</div>'; // .groups-extensions-support-contribute
55
56 groups_admin_add_ons_content();
57 echo '</div>'; // .groups-admin-add-ons.wrap
58 }
59
60 /**
61 * Renders the content of the Add-Ons section.
62 *
63 * @param $params array of options (offset is 0 by default and used to adjust heading h2)
64 */
65 function groups_admin_add_ons_content( $params = array( 'offset' => 0 ) ) {
66
67 $d = intval( $params['offset'] );
68 $h2 = sprintf( 'h%d', 2+$d );
69
70 echo "<$h2 class='woocommerce'>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
71 echo esc_html__( 'Discover our favorite Extensions for Groups and WooCommerce', 'groups' );
72 echo "</$h2>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
73
74 $entries = array(
75 'groups-woocommerce' => array(
76 'title' => 'Groups for WooCommerce',
77 'content' => 'Sell Memberships with Groups and WooCommerce – the best Group Membership and Access Control solution for WordPress and WooCommerce.',
78 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/groups-woocommerce.png',
79 'url' => 'https://woocommerce.com/products/groups-woocommerce/',
80 'index' => 10
81 ),
82 'woocommerce-group-coupons' => array(
83 'title' => 'Group Coupons',
84 'content' => 'Automatically apply and restrict coupon validity for user groups. Offer exclusive, automatic and targeted discounts for your customers.',
85 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/group-coupons.png',
86 'url' => 'https://woocommerce.com/products/group-coupons/',
87 'index' => 20
88 ),
89 'woocommerce-product-search' => array(
90 'title' => 'WooCommerce Product Search',
91 'content' => 'The perfect Search Engine helps customers to find and buy products quickly – essential for every WooCommerce store.',
92 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/woocommerce-product-search.png',
93 'url' => 'https://woocommerce.com/products/woocommerce-product-search/',
94 'index' => 30
95 ),
96 'woocommerce-sales-analysis' => array(
97 'title' => 'Sales Analysis',
98 'content' => 'Sales Analysis for WooCommerce offers reporting for Marketers & Managers. Get insights on key metrics, international sales, revenue, product and customer trends.',
99 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/sales-analysis.png',
100 'url' => 'https://woocommerce.com/products/sales-analysis-for-woocommerce/',
101 'index' => 40
102 ),
103 'volume-discount-coupons' => array(
104 'title' => 'Volume Discount Coupons',
105 'content' => 'Increase your sales by giving customers coupons and automatic discounts based on the quantities purchased.',
106 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/volume-discount-coupons.png',
107 'url' => 'https://woocommerce.com/shop/volume-discount-coupons/',
108 'index' => 50
109 ),
110 'restrict-payment-methods' => array(
111 'title' => 'Restrict Payment Methods',
112 'content' => 'Limit the use of Payment Methods by Group Memberships, Roles, Countries, and Order Amounts.',
113 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/restrict-payment-methods.png',
114 'url' => 'https://woocommerce.com/products/restrict-payment-methods/',
115 'index' => 60
116 ),
117 'woopayments' => array(
118 'title' => 'WooPayments',
119 'content' => 'The only payment solution fully integrated to Woo. Accept credit/debit cards and local payment options with no setup or monthly fees.',
120 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/woopayments.png',
121 'url' => 'https://woocommerce.com/products/woopayments/',
122 'index' => 70
123 ),
124 'woocommerce-subscriptions' => array(
125 'title' => 'WooCommerce Subscriptions',
126 'content' => 'Let customers subscribe to your products or services and pay on a weekly, monthly or annual basis.',
127 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/woocommerce-subscriptions.png',
128 'url' => 'https://woocommerce.com/products/woocommerce-subscriptions/',
129 'index' => 80
130 ),
131 'woo' => array(
132 'title' => 'WooCommerce Marketplace',
133 'content' => 'Explore more extensions on the WooCommerce Marketplace. Products you can trust, built by the WooCommerce team and trusted partners.',
134 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/woo.png',
135 'url' => 'https://woocommerce.com/products/',
136 'index' => 90
137 )
138 );
139 usort( $entries, 'groups_admin_add_ons_sort' );
140
141 echo '<ul class="woocommerce add-ons">';
142 foreach( $entries as $key => $entry ) {
143 echo '<li class="add-on">';
144 echo sprintf( '<a href="%s">', esc_url( $entry['url'] ) );
145 echo '<h3>';
146 echo sprintf( '<img src="%s"/>', esc_url( $entry['image'] ) );
147 echo '<span class="title">';
148 echo esc_html( $entry['title'] );
149 echo '</span>';
150 echo '</h3>';
151 echo '<p class="content">';
152 echo wp_kses_post( $entry['content'] );
153 echo '</p>';
154 echo '</a>';
155 echo '</li>'; // .add-on
156 }
157 echo '</ul>'; // .add-ons
158
159 echo "<$h2>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
160 echo esc_html__( 'More recommended Extensions for Groups', 'groups' );
161 echo "</$h2>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
162
163 $entries = array(
164 'groups-drip-content' => array(
165 'title' => 'Groups Drip Content',
166 'content' => 'Release posts, pages, other post types and embedded content on a schedule. Drip content to members based on user account creation, group memberships or specific dates and times.',
167 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/groups-drip-content.png',
168 'url' => 'https://www.itthinx.com/shop/groups-drip-content/',
169 'index' => 10
170 ),
171 'groups-file-access' => array(
172 'title' => 'Groups File Access',
173 'content' => 'Groups File Access is a WordPress plugin that allows to provide file download links for authorized users. Access to files is restricted to users by their group membership.',
174 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/groups-file-access.png',
175 'url' => 'https://www.itthinx.com/shop/groups-file-access/',
176 'index' => 50
177 ),
178 'groups-forums' => array(
179 'title' => 'Groups Forums',
180 'content' => 'Groups Forums provides a powerful and yet light-weight forum system for WordPress sites.',
181 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/groups-forums.png',
182 'url' => 'https://www.itthinx.com/shop/groups-forums/',
183 'index' => 100
184 ),
185 'groups-gravity-forms' => array(
186 'title' => 'Groups Gravity Forms',
187 'content' => 'This extension integrates Groups with Gravity Forms. It allows to add users to groups automatically, based on form submissions.',
188 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/groups-gravity-forms.png',
189 'url' => 'https://www.itthinx.com/shop/groups-gravity-forms/',
190 'index' => 100
191 ),
192 'groups-import-export' => array(
193 'title' => 'Groups Import Export',
194 'content' => 'This is an extension for Groups, providing import and export facilities. Users can be imported and assigned to groups in bulk from a text file. Users can be exported in bulk, including all users or users that belong to specific groups.',
195 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/groups-import-export.png',
196 'url' => 'https://www.itthinx.com/shop/groups-import-export/',
197 'index' => 100
198 ),
199 'groups-newsletters' => array(
200 'title' => 'Groups Newsletters',
201 'content' => 'Newsletter Campaigns for Subscribers and Groups. Groups Newsletters helps you to communicate efficiently, providing targeted information to groups of recipients through automated campaigns. Integrated with WooCommerce, lets customers subscribe to newsletters at checkout.',
202 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/groups-newsletters.png',
203 'url' => 'https://www.itthinx.com/shop/groups-newsletters/',
204 'index' => 100
205 ),
206 'groups-restrict-categories' => array(
207 'title' => 'Groups Restrict Categories',
208 'content' => 'Access restrictions for categories and tags, also supporting custom post types and taxonomies.',
209 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/groups-restrict-categories.png',
210 'url' => 'https://www.itthinx.com/shop/groups-restrict-categories/',
211 'index' => 20
212 ),
213 'widgets-control-pro' => array(
214 'title' => 'Widgets Control Pro',
215 'content' => 'An advanced Widget toolbox that adds visibility management and helps to control where widgets are shown efficiently. Show or hide widgets based on a user’s group membership.',
216 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/widgets-control-pro.png',
217 'url' => 'https://www.itthinx.com/shop/widgets-control-pro/',
218 'index' => 100
219 )
220 );
221 usort( $entries, 'groups_admin_add_ons_sort' );
222
223 echo '<ul class="groups add-ons">';
224 foreach( $entries as $key => $entry ) {
225 echo '<li class="add-on">';
226 echo sprintf( '<a href="%s">', esc_url( $entry['url'] ) );
227 echo '<h3>';
228 echo sprintf( '<img src="%s"/>', esc_url( $entry['image'] ) );
229 echo '<span class="title">';
230 echo esc_html( $entry['title'] );
231 echo '</span>';
232 echo '</h3>';
233 echo '<p>';
234 echo wp_kses_post( $entry['content'] );
235 echo '</p>';
236 echo '</a>';
237 echo '</li>'; // .add-on
238 }
239 echo '</ul>'; // .add-ons
240
241 echo "<$h2>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
242 echo esc_html__( 'Other recommended Tools', 'groups' );
243 echo "</$h2>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
244
245 $entries = array(
246 'affiliates-pro' => array(
247 'title' => 'Affiliates Pro',
248 'content' => 'Boost Sales with Affiliate Marketing for your WordPress site.',
249 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/affiliates-pro.png',
250 'url' => 'https://www.itthinx.com/shop/affiliates-pro/',
251 'index' => 10
252 ),
253 'affiliates-enterprise' => array(
254 'title' => 'Affiliates Enterprise',
255 'content' => 'Affiliates Enterprise provides an affiliate management system for sellers, shops and developers, who want to boost sales with their own affiliate program. Features affiliate campaigns, tracking pixels and multiple tiers.',
256 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/affiliates-enterprise.png',
257 'url' => 'https://www.itthinx.com/shop/affiliates-enterprise/',
258 'index' => 20
259 ),
260 'itthinx-mail-queue' => array(
261 'title' => 'Itthinx Mail Queue',
262 'content' => 'Features a fully automated SMTP email queue that substantially improves the way emails are sent out from your site. Prioritize sending by origin, eliminate delays for your visitors and balance your resources.',
263 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/itthinx-mail-queue.png',
264 'url' => 'https://www.itthinx.com/shop/itthinx-mail-queue/',
265 'index' => 30
266 )
267 );
268 usort( $entries, 'groups_admin_add_ons_sort' );
269
270 echo '<ul class="other add-ons">';
271 foreach( $entries as $key => $entry ) {
272 echo '<li class="add-on">';
273 echo sprintf( '<a href="%s">', esc_url( $entry['url'] ) );
274 echo '<h3>';
275 echo sprintf( '<img src="%s"/>', esc_url( $entry['image'] ) );
276 echo '<span class="title">';
277 echo esc_html( $entry['title'] );
278 echo '</span>';
279 echo '</h3>';
280 echo '<p>';
281 echo wp_kses_post( $entry['content'] );
282 echo '</p>';
283 echo '</a>';
284 echo '</li>'; // .add-on
285 }
286 echo '</ul>'; // .add-ons
287 }
288
289 function groups_admin_add_ons_sort( $e1, $e2 ) {
290 $i1 = isset( $e1['index'] ) ? $e1['index'] : 0;
291 $i2 = isset( $e2['index'] ) ? $e2['index'] : 0;
292 $t1 = isset( $e1['title'] ) ? $e1['title'] : '';
293 $t2 = isset( $e2['title'] ) ? $e2['title'] : '';
294
295 return $i1 - $i2 + strnatcmp( $t1, $t2 );
296 }
297