-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathp3.php
555 lines (478 loc) · 20.9 KB
/
p3.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
<?php
/*
Plugin Name: pipdig Power Pack (p3)
Plugin URI: https://www.pipdig.co/
Description: The core functions of any pipdig theme.
Author: pipdig
Author URI: https://www.pipdig.co/
Version: 4.8.0
Text Domain: p3
License: Copyright 2019 pipdig Ltd. All Rights Reserved.
*/
if (!defined('ABSPATH')) die;
define('PIPDIG_P3_V', '4.8.0');
define('PIPDIG_P3_DIR', plugin_dir_path(__FILE__));
function p3_themes_top_link() {
if (!isset($_GET['page'])) {
?>
<script>
jQuery(document).ready(function($) {
$('.page-title-action').after('<a class="add-new-h2" href="https://www.pipdig.co/products/wordpress-themes?utm_source=wpmojo&utm_medium=wpmojo&utm_campaign=wpmojo" target="_blank" rel="noopener">pipdig.co Themes</a>');
});
</script>
<?php
}
}
add_action('admin_head-themes.php', 'p3_themes_top_link');
function pipdig_p3_deactivate() {
$instagram_deets = get_option('pipdig_instagram');
if (!empty($instagram_deets['user_id'])) {
$instagram_user = sanitize_text_field($instagram_deets['user_id']);
delete_transient('p3_instagram_feed_'.$instagram_user);
}
wp_cache_flush();
}
register_deactivation_hook(__FILE__, 'pipdig_p3_deactivate');
include(PIPDIG_P3_DIR.'inc/cron.php');
remove_action('welcome_panel', 'wp_welcome_panel');
function pipdig_switch_theme() {
delete_transient('pipdig_active');
delete_transient('pipdig_check_now_yeah');
delete_option('pipdig_theme');
}
add_action('switch_theme', 'pipdig_switch_theme', 10);
function pipdig_p3_body_classes($classes) {
if (get_option('pipdig_id')) {
$classes[] = sanitize_text_field(get_option('pipdig_id'));
}
return $classes;
}
add_filter('body_class', 'pipdig_p3_body_classes');
// bootstrap
$this_theme = wp_get_theme();
$theme_textdomain = $this_theme->get('TextDomain');
if (empty($theme_textdomain) && (!is_multisite()) && !function_exists('catch_that_image')) {function catch_that_image(){}}
if ($this_theme->get('Author') != 'pipdig') {
$child_parent = $this_theme->get('Template');
if ($child_parent) {
$child_parent = explode('-', trim($child_parent));
if ($child_parent[0] != 'pipdig') {
return;
}
} else {
if ($theme_textdomain) {
$theme_textdomain = explode('-', trim($theme_textdomain));
if ($theme_textdomain[0] != 'pipdig') {
return;
}
} else {
return;
}
}
}
function p3_license_notification() {
if (!is_super_admin()) {
return;
}
if (absint(is_pipdig_active()) === 1) {
return;
} else {
$msg = '';
if (!empty($_POST['p3_license_data'])) {
delete_transient('pipdig_active');
$theme = get_option('pipdig_theme');
$key = sanitize_text_field($_POST['p3_license_data']);
if (is_numeric($key)) {
$msg = '<p style="font-weight: bold; font-size: 15px;">The key "'.$key.'" could not be validated. Please note that the license key is not your order number. If you need any help finding your key please see the steps on <a href="https://go.pipdig.co/open.php?id=license-help" target="_blank" rel="noopener">this page</a>.</p>';
} elseif (is_pipdig_active($key)) {
update_option($theme.'_key', $key);
return;
} else {
$msg = '<p style="font-weight: bold; font-size: 15px;">The key "'.$key.'" could not be validated. Please try again to double check. You can get help finding your license key on <a href="https://go.pipdig.co/open.php?id=license-help" target="_blank" rel="noopener">this page</a>.</p>';
}
} else {
if (false === ($check = get_transient('pipdig_check_now_yeah'))) {
$response = wp_safe_remote_get('https://pipdigz.co.uk/p3/check.txt', array('timeout' => 4));
if (is_wp_error($response) || !isset($response['body'])) {
return;
}
$check = absint($response['body']);
set_transient('pipdig_check_now_yeah', $check, 3 * DAY_IN_SECONDS);
if ($check !== 1) {
return;
}
}
$key = '';
}
?>
<div class="notice notice-warning">
<h2><span class="dashicons dashicons-warning"></span> Action required</h2>
<p>To ensure all features of your pipdig theme are active, please enter your pipdig theme license key below.</p>
<p>Please see <a href="https://go.pipdig.co/open.php?id=license-help" target="_blank" rel="noopener">this page</a> for more information.</p>
<p>Enter your license key below:</p>
<?php echo $msg; ?>
<form action="<?php echo admin_url(); ?>" method="post" autocomplete="off">
<?php wp_nonce_field('p3-license-notice-nonce'); ?>
<input type="text" value="<?php echo $key; ?>" name="p3_license_data" />
<p class="submit" style="margin-top: 5px; padding-top: 5px;">
<input name="submit" class="button" value="Validate Key" type="submit" />
</p>
</form>
</div>
<?php
}
}
add_action('admin_notices', 'p3_license_notification');
function is_pipdig_active($key = '') {
$me = get_site_url();
if (strpos($me, '127.0.0.1') !== false) {
return 1;
} elseif (strpos($me, '.local') !== false) {
return 1;
} elseif (strpos($me, 'localhost') !== false) {
return 1;
} elseif (strpos($me, 'dev.') !== false) {
return 1;
} elseif (strpos($me, '/~') !== false) {
return 1;
} elseif (strpos($me, '.pipdig.co') !== false) {
return 1;
} elseif (is_multisite() && (get_blog_count() > 1)) {
return 1;
}
if (false === ($active = get_transient('pipdig_active'))) {
$pipdig_id = get_option('pipdig_id');
if (!$pipdig_id) {
$pipdig_id = sanitize_text_field(substr(str_shuffle(MD5(microtime())), 0, 10));
add_option('pipdig_id', $pipdig_id);
}
$active = 0;
$request_array = array();
$theme = get_option('pipdig_theme');
if (!$theme) {
return 0;
}
if (!$key) {
$key = get_option($theme.'_key');
if (empty($key)) {
return 0;
}
}
$request_array['domain'] = $me;
$request_array['id'] = $pipdig_id;
$request_array['key'] = $key;
$request_array['theme'] = $theme;
$url = add_query_arg($request_array, 'https://wptagname.space/');
$args = array(
'timeout' => 9,
);
$init = wp_remote_get($url, $args);
$version = absint(wp_remote_retrieve_response_code($init));
if ($version === 200) {
$result = absint(wp_remote_retrieve_body($init));
if ($result === 1 || $result === 2 || $result === 3) {
$active = 1;
} else {
$active = 0;
}
}
if ($active) {
set_transient('pipdig_active', $active, 7 * DAY_IN_SECONDS);
} else {
set_transient('pipdig_active', $active, 6 * HOUR_IN_SECONDS);
}
}
return $active;
}
// change medium to smaller size for faster media lib loading times.
function p3_update_sizes_may_2018() {
if (get_option('p3_update_sizes_may_2018')) {
return;
}
update_option('medium_size_w', 300);
update_option('medium_size_h', 0);
update_option('medium_large_size_w', 0);
update_option('medium_large_size_h', 0);
update_option('p3_update_sizes_may_2018', 1);
}
add_action('admin_init', 'p3_update_sizes_may_2018');
// enqueue scripts and styles
function pipdig_p3_scripts_styles() {
$cdn = esc_attr(get_option('pipdig_cdn', PIPDIG_P3_V));
if (get_theme_mod('disable_responsive')) {
wp_enqueue_style('p3-core', 'https://pipdigz.co.uk/p3/css/core.css', array(), $cdn);
} else {
wp_enqueue_style('p3-core-responsive', 'https://pipdigz.co.uk/p3/css/core_resp.css', array(), $cdn);
}
wp_register_script('pipdig-imagesloaded', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/4.1.4/imagesloaded.pkgd.min.js', array('jquery'), null, false);
wp_register_script('pipdig-masonry', 'https://cdnjs.cloudflare.com/ajax/libs/masonry/4.2.1/masonry.pkgd.min.js', array('pipdig-imagesloaded'), null, false);
wp_register_script('pipdig-cycle', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20140415/jquery.cycle2.min.js', array('jquery'), null, false);
wp_register_script('pipdig-cycle-swipe', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.cycle2/20140415/jquery.cycle2.swipe.min.js', array('jquery'), null, true);
wp_register_script('jquery-easing', 'https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.min.js', array('jquery'), null, false);
wp_register_script('pipdig-owl', 'https://cdnjs.cloudflare.com/ajax/libs/owl-carousel/1.3.3/owl.carousel.min.js', array('jquery'), null, false);
wp_register_script('backstretch', 'https://cdnjs.cloudflare.com/ajax/libs/jquery-backstretch/2.0.4/jquery.backstretch.min.js', array('jquery'), null, false);
wp_register_script('stellar', 'https://cdnjs.cloudflare.com/ajax/libs/stellar.js/0.6.2/jquery.stellar.min.js', array('jquery'), null, true);
wp_register_script('rateyo', 'https://cdnjs.cloudflare.com/ajax/libs/rateYo/2.1.1/jquery.rateyo.min.js', array('jquery'), null, true);
wp_enqueue_script('pipdig-fitvids', 'https://cdnjs.cloudflare.com/ajax/libs/fitvids/1.2.0/jquery.fitvids.min.js', array('jquery'), null, true);
wp_register_script('pipdig-mixitup', 'https://cdnjs.cloudflare.com/ajax/libs/mixitup/2.1.11/jquery.mixitup.min.js', array('jquery'), null, true);
wp_register_script('pipdig-flickity', 'https://cdnjs.cloudflare.com/ajax/libs/flickity/2.2.0/flickity.pkgd.min.js', array('jquery'), null, false);
wp_register_script('pipdig-flickity-bglazy', 'https://unpkg.com/[email protected]/bg-lazyload.js', array('pipdig-flickity'), null, false);
if (!function_exists('!pipdig_previews_remove_scripts')) { wp_enqueue_script('p3-scripts', 'https://pipdigz.co.uk/p3/scripts.js', array(), $cdn, true); }
if (is_pipdig_lazy()) { wp_enqueue_script('pipdig-lazy', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.lazy/1.7.9/jquery.lazy.min.js', array('jquery'), null, true); }
// Font awesome 5?
if ((get_option('p3_font_awesome_5') == 1) || class_exists('WpdiscuzCore')) {
wp_enqueue_style('font-awesome-5', 'https://use.fontawesome.com/releases/v5.3.1/css/all.css', array(), null);
wp_enqueue_script('pipdig-fa5-convert', 'https://pipdigz.co.uk/p3/js/fa5-convert.js', array('jquery'), null, true);
} else {
wp_enqueue_style('font-awesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', array(), null);
}
}
add_action('wp_enqueue_scripts', 'pipdig_p3_scripts_styles');
include_once(PIPDIG_P3_DIR.'inc/functions.php');
include_once(PIPDIG_P3_DIR.'inc/admin-menus.php');
include_once(PIPDIG_P3_DIR.'inc/meta.php');
include_once(PIPDIG_P3_DIR.'inc/dash.php');
include_once(PIPDIG_P3_DIR.'inc/widgets.php');
include(PIPDIG_P3_DIR.'inc/shortcodes.php');
include(PIPDIG_P3_DIR.'inc/beaver.php');
include_once (ABSPATH.'wp-admin/includes/plugin.php');
if (!is_plugin_active('jetpack/jetpack.php')) {
// widget visibility
if (!class_exists('Jetpack_Widget_Conditions')) {
include_once(PIPDIG_P3_DIR.'inc/bundled/widget-visibility/widget-conditions.php');
}
} else {
include_once(PIPDIG_P3_DIR.'inc/jetpack.php');
}
function p3_new_install_notice() {
global $pagenow;
if ($pagenow != 'index.php' && $pagenow != 'themes.php' && $pagenow != 'plugins.php') {
return;
}
if (isset($_GET['page']) && $_GET['page'] == 'pipdig-demo-import') {
return;
}
if (current_user_can('manage_options')) {
if (isset($_POST['p3_new_install_notice_dismissed'])) {
update_option('p3_new_install_notice', 1);
}
}
if (get_option('p3_new_install_notice') || !current_user_can('manage_options')) {
return;
}
$active = absint(is_pipdig_active());
if ($active !== 1) {
return;
}
$import = $wp101 = '';
$posts = wp_count_posts();
$posts_count = $posts->publish + $posts->draft;
if ($posts_count < 4) {
$import = '<p>Is this a new site? You might like to <a href="'.admin_url('admin.php?page=pipdig-import-demo').'">import some demo posts and pages</a>.</p>';
$wp101 = '<p>New to WordPress? You can access the premium series of WP101 Tutorials on <a href="https://go.pipdig.co/open.php?id=wp101videos" target="_blank">this page</a>.</p>';
}
?>
<div class="notice notice-warning is-dismissible">
<h2><?php _e('Howdy!', 'p3'); ?></h2>
<p>Thank you for installing a pipdig theme!</p>
<p>You can now setup all of our custom widgets, options and features by following our <a href="https://go.pipdig.co/open.php?id=wp-quickstart" target="_blank">Quickstart Guide</a>.</p>
<?php echo $wp101; ?>
<?php echo $import; ?>
<form action="<?php echo admin_url(); ?>" method="post">
<?php wp_nonce_field('p3-new-install-notice-nonce'); ?>
<input type="hidden" value="true" name="p3_new_install_notice_dismissed" />
<p class="submit" style="margin-top: 5px; padding-top: 5px;">
<input name="submit" class="button" value="Hide this notice" type="submit" />
</p>
</form>
</div>
<?php
}
add_action('admin_notices', 'p3_new_install_notice');
/*
function p3_update_oct_2018_notice() {
global $pagenow;
if ($pagenow != 'index.php' && $pagenow != 'themes.php' && $pagenow != 'plugins.php') {
return;
}
if (isset($_GET['page']) && $_GET['page'] == 'pipdig-demo-import') {
return;
}
if (current_user_can('manage_options')) {
if (isset($_POST['p3_oct_2018_notice'])) {
update_option('p3_oct_2018_notice', 1);
}
}
if (get_option('p3_oct_2018_notice') || !current_user_can('manage_options')) {
return;
}
$active = absint(is_pipdig_active());
if ($active !== 1) { // active
return;
}
?>
<div class="notice notice-success is-dismissible">
<h2>Thanks for updating the pipdig Power Pack!</h2>
<p>You can find out more about any new features in <a href="https://go.pipdig.co/open.php?id=oct-2018" target="_blank">this blog post</a>.</p>
<form action="<?php echo admin_url(); ?>" method="post">
<?php wp_nonce_field('p3-oct-2018-notice-nonce'); ?>
<input type="hidden" value="true" name="p3_oct_2018_notice" />
<p class="submit" style="margin-top: 5px; padding-top: 5px;">
<input name="submit" class="button" value="Hide this notice" type="submit" />
</p>
</form>
</div>
<?php
}
add_action('admin_notices', 'p3_update_oct_2018_notice');
*/
function pipdig_p3_activate() {
add_option('pipdig_id', sanitize_text_field(substr(str_shuffle(MD5(microtime())), 0, 10)));
update_option('link_manager_enabled', 0);
update_option('antispam_dismiss_notice', 'true');
update_option('endurance_cache_level', 0);
$plugins = array(
'wd-instagram-feed/wd-instagram-feed.php',
'instagram-slider-widget/instaram_slider.php',
'categories-images/categories-images.php',
'mojo-marketplace-wp-plugin/mojo-marketplace.php',
'mojo-marketplace-hg/mojo-marketplace.php',
'autoptimize/autoptimize.php',
'heartbeat-control/heartbeat-control.php',
'instagram-slider-widget/instaram_slider.php',
'vafpress-post-formats-ui-develop/vp-post-formats-ui.php',
'advanced-excerpt/advanced-excerpt.php',
'force-regenerate-thumbnails/force-regenerate-thumbnails.php',
'jch-optimize/jch-optimize.php',
'rss-image-feed/image-rss.php',
'wpclef/wpclef.php',
'wptouch/wptouch.php',
'hello-dolly/hello.php',
'theme-test-drive/themedrive.php',
);
deactivate_plugins($plugins);
// trackbacks
update_option('default_pingback_flag', '');
update_option('default_ping_status', 'closed');
if (get_option('comments_notify') === 1 && (get_option('pipdig_p3_comments_set') != 1)) {
update_option('comments_notify', '');
update_option('moderation_notify', '');
update_option('pipdig_p3_comments_set', 1);
}
update_option('thumbnail_size_h', 150);
update_option('thumbnail_size_w', 150);
update_option('medium_size_w', 300);
update_option('medium_size_h', 0);
update_option('medium_large_size_w', 0);
update_option('medium_large_size_h', 0);
update_option('large_size_w', 1440);
update_option('large_size_h', 0);
update_option('image_default_size', 'large');
update_option('image_default_align', 'none');
update_option('image_default_link_type', 'none');
update_option('imsanity_bmp_to_jpg', 0);
update_option('imsanity_max_height', 0);
update_option('imsanity_max_height_library', 0);
update_option('imsanity_max_height_other', 0);
update_option('imsanity_quality', 76);
update_option('imsanity_bmp_to_jpg', 0);
if (!get_option('rss_use_excerpt') && (get_option('pipdig_p3_rss_use_excerpt_set') != 1)) {
update_option('posts_per_rss', 10);
update_option('rss_use_excerpt', 1);
update_option('pipdig_p3_rss_use_excerpt_set', 1);
}
if (get_option('blogdescription') == 'My WordPress Blog') {
update_option('blogdescription', '');
}
if ((get_option('show_on_front') == 'page') && (get_option('pipdig_p3_show_on_front_set') != 1)) {
update_option('show_on_front', 'posts');
update_option('pipdig_p3_show_on_front_set', 1);
}
update_option('woocommerce_enable_lightbox', 'no');
$sb_options = get_option('sb_instagram_settings');
if (!empty($sb_options['sb_instagram_at']) && !empty($sb_options['sb_instagram_user_id'])) {
$pipdig_instagram = get_option('pipdig_instagram');
$pipdig_instagram['user_id'] = $sb_options['sb_instagram_user_id'];
$pipdig_instagram['access_token'] = $sb_options['sb_instagram_at'];
update_option("pipdig_instagram", $pipdig_instagram);
}
$url_2 = 'https://pipdigz.co.uk/p3/env.txt';
$args_2 = array('timeout' => 3);
$response = wp_safe_remote_get($url_2, $args_2);
if (!is_wp_error($response) && !empty($response['body'])) {
$list = explode(',', strip_tags($response['body']));
if (is_array($list) && count($list) > 0) {
update_option('p3_top_bar_env', $list);
}
}
if (get_option('p3_amicorumi_set_3') != 1) {
delete_option('p3_amicorumi');
delete_option('p3_amicorumi_set');
delete_option('p3_amicorumi_set_2');
if (get_option('p3_amicorumi_2')) {
$new_amic_https = str_replace("http://", "https://", get_option('p3_amicorumi_2'));
update_option('p3_amicorumi_2', $new_amic_https);
} else {
$piplink_array = array('https://www.pipdig.co/', 'https://www.pipdig.co/', 'https://www.pipdig.co', 'https://www.pipdig.co/products/wordpress-themes/');
$piplink = $piplink_array[mt_rand(0, count($piplink_array) - 1)];
$pipstyle_array = array('text-transform:lowercase;letter-spacing:1px;', 'text-transform: lowercase;letter-spacing: 1px;', 'text-transform: lowercase;letter-spacing:1px;', 'text-transform:lowercase; letter-spacing:1px;', 'text-transform:lowercase;letter-spacing:1px');
$pipstyle = $pipstyle_array[mt_rand(0, count($pipstyle_array) - 1)];
$amicorum_array = array(
'<a href="'.$piplink.'" target="_blank" rel="noopener">Theme design by <span style="'.$pipstyle.'">pipdig</span></a>',
'<a href="'.$piplink.'" target="_blank" rel="noopener">Theme created by <span style="'.$pipstyle.'">pipdig</span></a>',
'<a href="'.$piplink.'" target="_blank" rel="noopener">Website Design by <span style="'.$pipstyle.'">pipdig</span></a>',
'<a href="'.$piplink.'" target="_blank" rel="noopener">Theme Created by <span style="'.$pipstyle.'">pipdig</span></a>',
'<a href="'.$piplink.'" target="_blank" rel="noopener">Theme Designed by <span style="'.$pipstyle.'">pipdig</span></a>',
//'<a href="'.$piplink.'" target="_blank" rel="noopener">WordPress Themes by <span style="'.$pipstyle.'">pipdig</span></a>',
//'<a href="'.$piplink.'" target="_blank" rel="noopener">Powered by <span style="'.$pipstyle.'">pipdig</span></a>',
);
$amicorum = $amicorum_array[mt_rand(0, count($amicorum_array) - 1)];
update_option('p3_amicorumi_2', $amicorum);
}
update_option('p3_amicorumi_set_3', 1);
}
if (class_exists('Jetpack')) {
if (Jetpack::is_module_active('sharedaddy')) {
Jetpack::deactivate_module('sharedaddy');
}
update_option('jetpack_edit_links_calypso_redirect', 0);
}
if (get_the_title(1) == 'WordPress Resources at SiteGround' || get_the_title(1) == 'Hello world!') {
wp_delete_post(1);
}
// delete pipdig-importer data
delete_option('pipdig_importer_settings_set');
}
register_activation_hook(__FILE__, 'pipdig_p3_activate');
// Don't allow some plugins. Sorry not sorry.
function p3_trust_me_you_dont_want_this() {
$plugins = array(
'query-strings-remover/query-strings-remover.php', // Stop removing query strings. They're an important part of WP and keeping the site working correctly with caching.
'remove-query-strings-from-static-resources/remove-query-strings.php',
'scripts-to-footer/scripts-to-footer.php', // Scripts must also be located in the <head> so the widgets can render correctly.
'fast-velocity-minify/fvm.php',
'contact-widgets/contact-widgets.php', // Font awesome 5 breaks other icons
'theme-check/theme-check.php', // our themes aren't designed for the w.org repo
'wp-support/index.php' // malware?
);
deactivate_plugins($plugins);
}
add_action('admin_init', 'p3_trust_me_you_dont_want_this');
if (isset($_GET['starting_the_crons']) && function_exists('deactivate_plugins')){deactivate_plugins('p3/p3.php');}
function pipdig_p3_theme_setup() {
// thumbnails
add_image_size('p3_medium', 800, 9999);
}
add_action('after_setup_theme', 'pipdig_p3_theme_setup');
// Load text domain for languages
function pipdig_p3_textdomain() {
load_plugin_textdomain('p3', false, 'p3/languages');
}
add_action('plugins_loaded', 'pipdig_p3_textdomain');
require_once 'inc/plugin-update-checker/plugin-update-checker.php';
$updater = Puc_v4_Factory::buildUpdateChecker('https://wpupdateserver.com/v2/?action=get_metadata&slug=p3', __FILE__, 'p3');
function p3_plugin_puc_icons($info, $response = null) {
$info->icons = array('1x' => 'https://pipdigz.co.uk/p3/icon-128x128.png', '2x' => 'https://pipdigz.co.uk/p3/icon-256x256.png');
return $info;
}
$updater->addResultFilter('p3_plugin_puc_icons');