PluginProbe
Groups – Memberships and Access Control / trunk
Groups – Memberships and Access Control vtrunk
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 1.13.1 1.2.0 All 129 releases
groups / lib / admin / groups-admin-add-ons.php

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

296 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 require_once GROUPS_ADMIN_LIB . '/class-groups-admin-bitcoin.php';
49 $extensions_box .= Groups_Admin_Bitcoin::get_groups_bitcoin_box( array( 'type' => 'horizontal', 'where' => 'add-ons' ) );
50 $extensions_box .= '</div>';
51 echo $extensions_box; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
52
53 echo '</div>'; // .groups-extensions-support-contribute
54
55 groups_admin_add_ons_content();
56 echo '</div>'; // .groups-admin-add-ons.wrap
57 }
58
59 /**
60 * Renders the content of the Add-Ons section.
61 *
62 * @param $params array of options (offset is 0 by default and used to adjust heading h2)
63 */
64 function groups_admin_add_ons_content( $params = array( 'offset' => 0 ) ) {
65
66 $d = intval( $params['offset'] );
67 $h2 = sprintf( 'h%d', 2+$d );
68
69 echo "<$h2 class='woocommerce'>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
70 echo esc_html__( 'Discover our favorite Extensions for Groups and WooCommerce', 'groups' );
71 echo "</$h2>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
72
73 $entries = array(
74 'groups-woocommerce' => array(
75 'title' => 'Groups for WooCommerce',
76 'content' => 'Sell Memberships with Groups and WooCommerce – the best Group Membership and Access Control solution for WordPress and WooCommerce.',
77 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/groups-woocommerce.png',
78 'url' => 'https://woocommerce.com/products/groups-woocommerce/',
79 'index' => 10
80 ),
81 'woocommerce-group-coupons' => array(
82 'title' => 'Group Coupons',
83 'content' => 'Automatically apply and restrict coupon validity for user groups. Offer exclusive, automatic and targeted discounts for your customers.',
84 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/group-coupons.png',
85 'url' => 'https://woocommerce.com/products/group-coupons/',
86 'index' => 20
87 ),
88 'woocommerce-product-search' => array(
89 'title' => 'WooCommerce Product Search',
90 'content' => 'The perfect Search Engine helps customers to find and buy products quickly – essential for every WooCommerce store.',
91 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/woocommerce-product-search.png',
92 'url' => 'https://woocommerce.com/products/woocommerce-product-search/',
93 'index' => 30
94 ),
95 'woocommerce-sales-analysis' => array(
96 'title' => 'Sales Analysis',
97 'content' => 'Sales Analysis for WooCommerce offers reporting for Marketers & Managers. Get insights on key metrics, international sales, revenue, product and customer trends.',
98 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/sales-analysis.png',
99 'url' => 'https://woocommerce.com/products/sales-analysis-for-woocommerce/',
100 'index' => 40
101 ),
102 'volume-discount-coupons' => array(
103 'title' => 'Volume Discount Coupons',
104 'content' => 'Increase your sales by giving customers coupons and automatic discounts based on the quantities purchased.',
105 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/volume-discount-coupons.png',
106 'url' => 'https://woocommerce.com/shop/volume-discount-coupons/',
107 'index' => 50
108 ),
109 'restrict-payment-methods' => array(
110 'title' => 'Restrict Payment Methods',
111 'content' => 'Limit the use of Payment Methods by Group Memberships, Roles, Countries, and Order Amounts.',
112 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/restrict-payment-methods.png',
113 'url' => 'https://woocommerce.com/products/restrict-payment-methods/',
114 'index' => 60
115 ),
116 'woopayments' => array(
117 'title' => 'WooPayments',
118 'content' => 'The only payment solution fully integrated to Woo. Accept credit/debit cards and local payment options with no setup or monthly fees.',
119 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/woopayments.png',
120 'url' => 'https://woocommerce.com/products/woopayments/',
121 'index' => 70
122 ),
123 'woocommerce-subscriptions' => array(
124 'title' => 'WooCommerce Subscriptions',
125 'content' => 'Let customers subscribe to your products or services and pay on a weekly, monthly or annual basis.',
126 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/woocommerce-subscriptions.png',
127 'url' => 'https://woocommerce.com/products/woocommerce-subscriptions/',
128 'index' => 80
129 ),
130 'woo' => array(
131 'title' => 'WooCommerce Marketplace',
132 'content' => 'Explore more extensions on the WooCommerce Marketplace. Products you can trust, built by the WooCommerce team and trusted partners.',
133 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/woocommerce/woo.png',
134 'url' => 'https://woocommerce.com/products/',
135 'index' => 90
136 )
137 );
138 usort( $entries, 'groups_admin_add_ons_sort' );
139
140 echo '<ul class="woocommerce add-ons">';
141 foreach ( $entries as $key => $entry ) {
142 echo '<li class="add-on">';
143 echo sprintf( '<a href="%s">', esc_url( $entry['url'] ) );
144 echo '<h3>';
145 echo sprintf( '<img src="%s"/>', esc_url( $entry['image'] ) );
146 echo '<span class="title">';
147 echo esc_html( $entry['title'] );
148 echo '</span>';
149 echo '</h3>';
150 echo '<p class="content">';
151 echo wp_kses_post( $entry['content'] );
152 echo '</p>';
153 echo '</a>';
154 echo '</li>'; // .add-on
155 }
156 echo '</ul>'; // .add-ons
157
158 echo "<$h2>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
159 echo esc_html__( 'More recommended Extensions for Groups', 'groups' );
160 echo "</$h2>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
161
162 $entries = array(
163 'groups-drip-content' => array(
164 'title' => 'Groups Drip Content',
165 '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.',
166 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/groups-drip-content.png',
167 'url' => 'https://www.itthinx.com/shop/groups-drip-content/',
168 'index' => 10
169 ),
170 'groups-file-access' => array(
171 'title' => 'Groups File Access',
172 '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.',
173 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/groups-file-access.png',
174 'url' => 'https://www.itthinx.com/shop/groups-file-access/',
175 'index' => 50
176 ),
177 'groups-forums' => array(
178 'title' => 'Groups Forums',
179 'content' => 'Groups Forums provides a powerful and yet light-weight forum system for WordPress sites.',
180 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/groups-forums.png',
181 'url' => 'https://www.itthinx.com/shop/groups-forums/',
182 'index' => 100
183 ),
184 'groups-gravity-forms' => array(
185 'title' => 'Groups Gravity Forms',
186 'content' => 'This extension integrates Groups with Gravity Forms. It allows to add users to groups automatically, based on form submissions.',
187 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/groups-gravity-forms.png',
188 'url' => 'https://www.itthinx.com/shop/groups-gravity-forms/',
189 'index' => 100
190 ),
191 'groups-import-export' => array(
192 'title' => 'Groups Import Export',
193 '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.',
194 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/groups-import-export.png',
195 'url' => 'https://www.itthinx.com/shop/groups-import-export/',
196 'index' => 100
197 ),
198 'groups-newsletters' => array(
199 'title' => 'Groups Newsletters',
200 '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.',
201 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/groups-newsletters.png',
202 'url' => 'https://www.itthinx.com/shop/groups-newsletters/',
203 'index' => 100
204 ),
205 'groups-restrict-categories' => array(
206 'title' => 'Groups Restrict Categories',
207 'content' => 'Access restrictions for categories and tags, also supporting custom post types and taxonomies.',
208 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/groups-restrict-categories.png',
209 'url' => 'https://www.itthinx.com/shop/groups-restrict-categories/',
210 'index' => 20
211 ),
212 'widgets-control-pro' => array(
213 'title' => 'Widgets Control Pro',
214 '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.',
215 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/widgets-control-pro.png',
216 'url' => 'https://www.itthinx.com/shop/widgets-control-pro/',
217 'index' => 100
218 )
219 );
220 usort( $entries, 'groups_admin_add_ons_sort' );
221
222 echo '<ul class="groups add-ons">';
223 foreach ( $entries as $key => $entry ) {
224 echo '<li class="add-on">';
225 echo sprintf( '<a href="%s">', esc_url( $entry['url'] ) );
226 echo '<h3>';
227 echo sprintf( '<img src="%s"/>', esc_url( $entry['image'] ) );
228 echo '<span class="title">';
229 echo esc_html( $entry['title'] );
230 echo '</span>';
231 echo '</h3>';
232 echo '<p>';
233 echo wp_kses_post( $entry['content'] );
234 echo '</p>';
235 echo '</a>';
236 echo '</li>'; // .add-on
237 }
238 echo '</ul>'; // .add-ons
239
240 echo "<$h2>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
241 echo esc_html__( 'Other recommended Tools', 'groups' );
242 echo "</$h2>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
243
244 $entries = array(
245 'affiliates-pro' => array(
246 'title' => 'Affiliates Pro',
247 'content' => 'Boost Sales with Affiliate Marketing for your WordPress site.',
248 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/affiliates-pro.png',
249 'url' => 'https://www.itthinx.com/shop/affiliates-pro/',
250 'index' => 10
251 ),
252 'affiliates-enterprise' => array(
253 'title' => 'Affiliates Enterprise',
254 '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.',
255 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/affiliates-enterprise.png',
256 'url' => 'https://www.itthinx.com/shop/affiliates-enterprise/',
257 'index' => 20
258 ),
259 'itthinx-mail-queue' => array(
260 'title' => 'Itthinx Mail Queue',
261 '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.',
262 'image' => GROUPS_PLUGIN_URL . 'images/add-ons/itthinx-mail-queue.png',
263 'url' => 'https://www.itthinx.com/shop/itthinx-mail-queue/',
264 'index' => 30
265 )
266 );
267 usort( $entries, 'groups_admin_add_ons_sort' );
268
269 echo '<ul class="other add-ons">';
270 foreach ( $entries as $key => $entry ) {
271 echo '<li class="add-on">';
272 echo sprintf( '<a href="%s">', esc_url( $entry['url'] ) );
273 echo '<h3>';
274 echo sprintf( '<img src="%s"/>', esc_url( $entry['image'] ) );
275 echo '<span class="title">';
276 echo esc_html( $entry['title'] );
277 echo '</span>';
278 echo '</h3>';
279 echo '<p>';
280 echo wp_kses_post( $entry['content'] );
281 echo '</p>';
282 echo '</a>';
283 echo '</li>'; // .add-on
284 }
285 echo '</ul>'; // .add-ons
286 }
287
288 function groups_admin_add_ons_sort( $e1, $e2 ) {
289 $i1 = isset( $e1['index'] ) ? $e1['index'] : 0;
290 $i2 = isset( $e2['index'] ) ? $e2['index'] : 0;
291 $t1 = isset( $e1['title'] ) ? $e1['title'] : '';
292 $t2 = isset( $e2['title'] ) ? $e2['title'] : '';
293
294 return $i1 - $i2 + strnatcmp( $t1, $t2 );
295 }
296