/
wpmudev-dash-notification.php
692 lines (596 loc) · 37.1 KB
/
wpmudev-dash-notification.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
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
<?php
/////////////////////////////////////////////////////////////////////////
/* -------- WPMU DEV Dashboard Notice - Aaron Edwards (Incsub) ------- */
if ( !class_exists('WPMUDEV_Dashboard_Notice3') ) {
class WPMUDEV_Dashboard_Notice3 {
var $version = '3.1';
var $screen_id = false;
var $product_name = false;
var $product_update = false;
var $theme_pack = 128;
var $server_url = 'http://premium.wpmudev.org/wdp-un.php';
var $update_count = 0;
function __construct() {
add_action( 'init', array( &$this, 'init' ) );
}
function init() {
global $wpmudev_un;
if ( class_exists( 'WPMUDEV_Dashboard' ) || ( isset($wpmudev_un->version) && version_compare($wpmudev_un->version, '3.4', '<') ) )
return;
// Schedule update cron on main site only
if ( is_main_site() ) {
if ( ! wp_next_scheduled( 'wpmudev_scheduled_jobs' ) ) {
wp_schedule_event( time(), 'twicedaily', 'wpmudev_scheduled_jobs' );
}
add_action( 'wpmudev_scheduled_jobs', array( $this, 'updates_check') );
}
add_action( 'delete_site_transient_update_plugins', array( &$this, 'updates_check' ) ); //refresh after upgrade/install
add_action( 'delete_site_transient_update_themes', array( &$this, 'updates_check' ) ); //refresh after upgrade/install
if ( is_admin() && current_user_can( 'install_plugins' ) ) {
add_action( 'site_transient_update_plugins', array( &$this, 'filter_plugin_count' ) );
add_action( 'site_transient_update_themes', array( &$this, 'filter_theme_count' ) );
add_filter( 'plugins_api', array( &$this, 'filter_plugin_info' ), 101, 3 ); //run later to work with bad autoupdate plugins
add_filter( 'themes_api', array( &$this, 'filter_plugin_info' ), 101, 3 ); //run later to work with bad autoupdate plugins
add_action( 'admin_init', array( &$this, 'filter_plugin_rows' ), 15 ); //make sure it runs after WP's
add_action( 'core_upgrade_preamble', array( &$this, 'disable_checkboxes' ) );
add_action( 'activated_plugin', array( &$this, 'set_activate_flag' ) );
//remove version 1.0
remove_action( 'admin_notices', 'wdp_un_check', 5 );
remove_action( 'network_admin_notices', 'wdp_un_check', 5 );
//remove version 2.0, a bit nasty but only way
remove_all_actions( 'all_admin_notices', 5 );
//if dashboard is installed but not activated
if ( file_exists(WP_PLUGIN_DIR . '/wpmudev-updates/update-notifications.php') ) {
if ( !get_site_option('wdp_un_autoactivated') ) {
//include plugin API if necessary
if ( !function_exists('activate_plugin') ) require_once(ABSPATH . 'wp-admin/includes/plugin.php');
$result = activate_plugin( '/wpmudev-updates/update-notifications.php', network_admin_url('admin.php?page=wpmudev'), is_multisite() );
if ( !is_wp_error($result) ) { //if autoactivate successful don't show notices
update_site_option('wdp_un_autoactivated', 1);
return;
}
}
add_action( 'admin_print_styles', array( &$this, 'notice_styles' ) );
add_action( 'all_admin_notices', array( &$this, 'activate_notice' ), 5 );
} else { //dashboard not installed at all
if ( get_site_option('wdp_un_autoactivated') ) {
update_site_option('wdp_un_autoactivated', 0);//reset flag when dashboard is deleted
}
add_action( 'admin_print_styles', array( &$this, 'notice_styles' ) );
add_action( 'all_admin_notices', array( &$this, 'install_notice' ), 5 );
}
}
}
function is_allowed_screen() {
global $wpmudev_notices;
$screen = get_current_screen();
$this->screen_id = $screen->id;
//Show special message right after plugin activation
if ( in_array( $this->screen_id, array('plugins', 'plugins-network') ) && ( isset($_GET['activate']) || isset($_GET['activate-multi']) ) ) {
$activated = get_site_option('wdp_un_activated_flag');
if ($activated === false) $activated = 1; //on first encounter of new installed notice show
if ($activated) {
if ($activated >= 2)
update_site_option('wdp_un_activated_flag', 0);
else
update_site_option('wdp_un_activated_flag', 2);
return true;
}
}
//always show on certain core pages if updates are available
$updates = get_site_option('wdp_un_updates_available');
if (is_array($updates) && count($updates)) {
$this->update_count = count($updates);
if ( in_array( $this->screen_id, array('plugins', 'update-core', /*'plugin-install', 'theme-install',*/ 'plugins-network', 'themes-network', /*'theme-install-network', 'plugin-install-network',*/ 'update-core-network') ) )
return true;
}
//check our registered plugins for hooks
if ( isset($wpmudev_notices) && is_array($wpmudev_notices) ) {
foreach ( $wpmudev_notices as $product ) {
if ( isset($product['screens']) && is_array($product['screens']) && in_array( $this->screen_id, $product['screens'] ) ) {
$this->product_name = $product['name'];
//if this plugin needs updating flag it
if ( isset($product['id']) && isset($updates[$product['id']]) )
$this->product_update = true;
return true;
}
}
}
if ( defined('WPMUDEV_SCREEN_ID') ) var_dump($this->screen_id); //for internal debugging
return false;
}
function auto_install_url() {
$function = is_multisite() ? 'network_admin_url' : 'admin_url';
return wp_nonce_url($function("update.php?action=install-plugin&plugin=install_wpmudev_dash"), "install-plugin_install_wpmudev_dash");
}
function activate_url() {
$function = is_multisite() ? 'network_admin_url' : 'admin_url';
return wp_nonce_url($function('plugins.php?action=activate&plugin=wpmudev-updates%2Fupdate-notifications.php'), 'activate-plugin_wpmudev-updates/update-notifications.php');
}
function install_notice() {
if ( !$this->is_allowed_screen() ) return;
echo '<div class="updated" id="wpmu-install-dashboard"><div class="wpmu-install-wrap"><p class="wpmu-message">';
if ($this->product_name) {
if ($this->product_update)
echo 'Important updates are available for <strong>' . esc_html($this->product_name) . '</strong>. Install the free WPMU DEV Dashboard plugin now for updates and support!';
else
echo '<strong>' . esc_html($this->product_name) . '</strong> is almost ready - install the free WPMU DEV Dashboard plugin for updates and support!';
} else if ($this->update_count) {
echo "Important updates are available for your WPMU DEV plugins/themes. Install the free WPMU DEV Dashboard plugin now for updates and support!";
} else {
echo 'Almost ready - install the free WPMU DEV Dashboard plugin for updates and support!';
}
echo '</p><a class="wpmu-button" href="' . $this->auto_install_url() . '">Install WPMU DEV Dashboard</a>';
echo '</div>';
echo '<div class="wpmu-more-wrap"><a href="http://premium.wpmudev.org/update-notifications-plugin-information/" class="wpmu-more-info">More Info»</a></div>';
echo '</div>';
}
function activate_notice() {
if ( !$this->is_allowed_screen() ) return;
echo '<div class="updated" id="wpmu-install-dashboard"><div class="wpmu-install-wrap"><p class="wpmu-message">';
if ($this->product_name) {
if ($this->product_update)
echo 'Important updates are available for <strong>' . esc_html($this->product_name) . '</strong>. Activate the WPMU DEV Dashboard to update now!';
else
echo "Just one more step to enable updates and support for <strong>" . esc_html($this->product_name) . '</strong>!';
} else if ($this->update_count) {
echo "Important updates are available for your WPMU DEV plugins/themes. Activate the WPMU DEV Dashboard to update now!";
} else {
echo "Just one more step - activate the WPMU DEV Dashboard plugin and you're all done!";
}
echo '</p><a class="wpmu-button" href="' . $this->activate_url() . '">Activate WPMU DEV Dashboard</a></div></div>';
}
function notice_styles() {
if ( !$this->is_allowed_screen() ) return;
?>
<!-- WPMU DEV Dashboard notice -->
<style type="text/css" media="all">
#wpmu-install-dashboard{background-color:#031f34;font-family:sans-serif;display:block;border-radius:5px;position:relative;border:none;padding:14px 0.6em;font-size:1.3em;line-height:1.4em}
#wpmu-install-dashboard .wpmu-button{width:auto;position:absolute;top:0;bottom:0;right:0;padding:10px;margin:auto 14px auto 10px;line-height:1em;max-height:1em;background-color:#06385e;color:#3bb2df;text-decoration:none;border:5px solid rgba(53,131,191,0.4);vertical-align:middle;text-shadow:0 1px 0 rgba(0,0,0,0.6)}
#wpmu-install-dashboard .wpmu-button:hover{color:#e8da42;border-color:rgba(53,131,191,0.9);-webkit-transition:0.2s}
#wpmu-install-dashboard .wpmu-message{color:#c0d7eb;margin:0 280px 0 15px;padding:12px 0;text-shadow:0 1px 0 rgba(0,0,0,1);font-size:1em}
#wpmu-install-dashboard .wpmu-button,#wpmu-install-dashboard .wpmu-button:hover{-webkit-transition:0.2s}
#wpmu-install-dashboard .wpmu-btn-wrap{min-width:10%;background-color:#fff}
#wpmu-install-dashboard .wpmu-install-wrap{max-width:1050px;margin:0 auto;position:relative}#wpmu-install-dashboard .wpmu-more-wrap{max-width:1050px;margin:0 auto -9px;padding:5px 0 0;text-align:right}
#wpmu-install-dashboard .wpmu-more-info{color:#e8da42;font-size:0.9em;margin:0 14px}
#wpmu-install-dashboard, .wpmu-update-row{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAYAAACAvzbMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpCM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aLY7wAQIBM6jlmH/Q4AATIx+x0AAuTK3sfM48DHDiBAJjHa76j3d5z6yAEEyCTqfke9v+ONjxpAgEzK86wABMiV2e8AECBXYr8DQIBc2UnMOux3AAiQie2Vi/s77HcACJCJ2e8AECBXUvc7fi0Xz7Oy3wEgQCZivwNAgFyZ/Q4AAXJl7yM8fH8HgACZiP0OAAFyZXW/oz7P6rWPC0CATGq/XCxZ7fioAATI1yzGT/sdAALkSup+R12uqstWJz4iAAEyqZ+G5UMECQBJLZyf66cBuLpFVQCAAAFAgAAgQAAQIAAgQAAQIAAIEAAECAACBAAECAACBAABAoAAAUCAAIAAAUCAACBAABAgAAgQABAgAAgQAAQIAAIEgJ75fwEGABxQF9Ke8fBQAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:95% 64%}
#the-list .wpmu-update-row{background-color:#031f34;border:none;color:#c0d7eb;background-size:100px}
#the-list .wpmu-update-row a{color:#3bb2df}
#the-list .wpmu-update-row a:hover{color:#e8da42;-webkit-transition:0.2s}
</style>
<?php
}
function get_id_plugin($plugin_file) {
return get_file_data( $plugin_file, array('name' => 'Plugin Name', 'id' => 'WDP ID', 'version' => 'Version') );
}
//simple check for updates
function updates_check() {
global $wp_version;
$local_projects = array();
//----------------------------------------------------------------------------------//
//plugins directory
//----------------------------------------------------------------------------------//
$plugins_root = WP_PLUGIN_DIR;
if( empty($plugins_root) ) {
$plugins_root = ABSPATH . 'wp-content/plugins';
}
$plugins_dir = @opendir($plugins_root);
$plugin_files = array();
if ( $plugins_dir ) {
while (($file = readdir( $plugins_dir ) ) !== false ) {
if ( substr($file, 0, 1) == '.' )
continue;
if ( is_dir( $plugins_root.'/'.$file ) ) {
$plugins_subdir = @ opendir( $plugins_root.'/'.$file );
if ( $plugins_subdir ) {
while (($subfile = readdir( $plugins_subdir ) ) !== false ) {
if ( substr($subfile, 0, 1) == '.' )
continue;
if ( substr($subfile, -4) == '.php' )
$plugin_files[] = "$file/$subfile";
}
}
} else {
if ( substr($file, -4) == '.php' )
$plugin_files[] = $file;
}
}
}
@closedir( $plugins_dir );
@closedir( $plugins_subdir );
if ( $plugins_dir && !empty($plugin_files) ) {
foreach ( $plugin_files as $plugin_file ) {
if ( is_readable( "$plugins_root/$plugin_file" ) ) {
unset($data);
$data = $this->get_id_plugin( "$plugins_root/$plugin_file" );
if ( isset($data['id']) && !empty($data['id']) ) {
$local_projects[$data['id']]['type'] = 'plugin';
$local_projects[$data['id']]['version'] = $data['version'];
$local_projects[$data['id']]['filename'] = $plugin_file;
}
}
}
}
//----------------------------------------------------------------------------------//
// mu-plugins directory
//----------------------------------------------------------------------------------//
$mu_plugins_root = WPMU_PLUGIN_DIR;
if( empty($mu_plugins_root) ) {
$mu_plugins_root = ABSPATH . 'wp-content/mu-plugins';
}
if ( is_dir($mu_plugins_root) && $mu_plugins_dir = @opendir($mu_plugins_root) ) {
while (($file = readdir( $mu_plugins_dir ) ) !== false ) {
if ( substr($file, -4) == '.php' ) {
if ( is_readable( "$mu_plugins_root/$file" ) ) {
unset($data);
$data = $this->get_id_plugin( "$mu_plugins_root/$file" );
if ( isset($data['id']) && !empty($data['id']) ) {
$local_projects[$data['id']]['type'] = 'mu-plugin';
$local_projects[$data['id']]['version'] = $data['version'];
$local_projects[$data['id']]['filename'] = $file;
}
}
}
}
@closedir( $mu_plugins_dir );
}
//----------------------------------------------------------------------------------//
// wp-content directory
//----------------------------------------------------------------------------------//
$content_plugins_root = WP_CONTENT_DIR;
if( empty($content_plugins_root) ) {
$content_plugins_root = ABSPATH . 'wp-content';
}
$content_plugins_dir = @opendir($content_plugins_root);
$content_plugin_files = array();
if ( $content_plugins_dir ) {
while (($file = readdir( $content_plugins_dir ) ) !== false ) {
if ( substr($file, 0, 1) == '.' )
continue;
if ( !is_dir( $content_plugins_root.'/'.$file ) ) {
if ( substr($file, -4) == '.php' )
$content_plugin_files[] = $file;
}
}
}
@closedir( $content_plugins_dir );
if ( $content_plugins_dir && !empty($content_plugin_files) ) {
foreach ( $content_plugin_files as $content_plugin_file ) {
if ( is_readable( "$content_plugins_root/$content_plugin_file" ) ) {
unset($data);
$data = $this->get_id_plugin( "$content_plugins_root/$content_plugin_file" );
if ( isset($data['id']) && !empty($data['id']) ) {
$local_projects[$data['id']]['type'] = 'drop-in';
$local_projects[$data['id']]['version'] = $data['version'];
$local_projects[$data['id']]['filename'] = $content_plugin_file;
}
}
}
}
//----------------------------------------------------------------------------------//
//themes directory
//----------------------------------------------------------------------------------//
$themes_root = WP_CONTENT_DIR . '/themes';
if ( empty($themes_root) ) {
$themes_root = ABSPATH . 'wp-content/themes';
}
$themes_dir = @opendir($themes_root);
$themes_files = array();
$local_themes = array();
if ( $themes_dir ) {
while (($file = readdir( $themes_dir ) ) !== false ) {
if ( substr($file, 0, 1) == '.' )
continue;
if ( is_dir( $themes_root.'/'.$file ) ) {
$themes_subdir = @ opendir( $themes_root.'/'.$file );
if ( $themes_subdir ) {
while (($subfile = readdir( $themes_subdir ) ) !== false ) {
if ( substr($subfile, 0, 1) == '.' )
continue;
if ( substr($subfile, -4) == '.css' )
$themes_files[] = "$file/$subfile";
}
}
} else {
if ( substr($file, -4) == '.css' )
$themes_files[] = $file;
}
}
}
@closedir( $themes_dir );
@closedir( $themes_subdir );
if ( $themes_dir && !empty($themes_files) ) {
foreach ( $themes_files as $themes_file ) {
//skip child themes
if ( strpos( $themes_file, '-child' ) !== false )
continue;
if ( is_readable( "$themes_root/$themes_file" ) ) {
unset($data);
$data = $this->get_id_plugin( "$themes_root/$themes_file" );
if ( isset($data['id']) && !empty($data['id']) ) {
$local_projects[$data['id']]['type'] = 'theme';
$local_projects[$data['id']]['filename'] = substr( $themes_file, 0, strpos( $themes_file, '/' ) );
//keep record of all themes for 133 themepack
if ($data['id'] == $this->theme_pack) {
$local_themes[$themes_file]['id'] = $data['id'];
$local_themes[$themes_file]['filename'] = substr( $themes_file, 0, strpos( $themes_file, '/' ) );
$local_themes[$themes_file]['version'] = $data['version'];
//increment 133 theme pack version to lowest in all of them
if ( isset($local_projects[$data['id']]['version']) && version_compare($data['version'], $local_projects[$data['id']]['version'], '<') ) {
$local_projects[$data['id']]['version'] = $data['version'];
} else if ( !isset($local_projects[$data['id']]['version']) ) {
$local_projects[$data['id']]['version'] = $data['version'];
}
} else {
$local_projects[$data['id']]['version'] = $data['version'];
}
}
}
}
}
update_site_option('wdp_un_local_themes', $local_themes);
update_site_option('wdp_un_local_projects', $local_projects);
//now check the API
$projects = '';
foreach ($local_projects as $pid => $project)
$projects .= "&p[$pid]=" . $project['version'];
//get WP/BP version string to help with support
$wp = is_multisite() ? "WordPress Multisite $wp_version" : "WordPress $wp_version";
if ( defined( 'BP_VERSION' ) )
$wp .= ', BuddyPress ' . BP_VERSION;
//add blog count if multisite
$blog_count = is_multisite() ? get_blog_count() : 1;
$url = $this->server_url . '?action=check&un-version=3.3.3&wp=' . urlencode($wp) . '&bcount=' . $blog_count . '&domain=' . urlencode(network_site_url()) . $projects;
$options = array(
'timeout' => 15,
'user-agent' => 'Dashboard Notification/' . $this->version
);
$response = wp_remote_get($url, $options);
if ( wp_remote_retrieve_response_code($response) == 200 ) {
$data = $response['body'];
if ( $data != 'error' ) {
$data = unserialize($data);
if ( is_array($data) ) {
//we've made it here with no errors, now check for available updates
$remote_projects = isset($data['projects']) ? $data['projects'] : array();
$updates = array();
//check for updates
if ( is_array($remote_projects) ) {
foreach ( $remote_projects as $id => $remote_project ) {
if ( isset($local_projects[$id]) && is_array($local_projects[$id]) ) {
//match
$local_version = $local_projects[$id]['version'];
$remote_version = $remote_project['version'];
if ( version_compare($remote_version, $local_version, '>') ) {
//add to array
$updates[$id] = $local_projects[$id];
$updates[$id]['url'] = $remote_project['url'];
$updates[$id]['instructions_url'] = $remote_project['instructions_url'];
$updates[$id]['support_url'] = $remote_project['support_url'];
$updates[$id]['name'] = $remote_project['name'];
$updates[$id]['thumbnail'] = $remote_project['thumbnail'];
$updates[$id]['version'] = $local_version;
$updates[$id]['new_version'] = $remote_version;
$updates[$id]['changelog'] = $remote_project['changelog'];
$updates[$id]['autoupdate'] = $remote_project['autoupdate'];
}
}
}
//record results
update_site_option('wdp_un_updates_available', $updates);
} else {
return false;
}
}
}
}
}
function filter_plugin_info($res, $action, $args) {
global $wp_version;
$cur_wp_version = preg_replace('/-.*$/', '', $wp_version);
//if in details iframe on update core page short-curcuit it
if ( ($action == 'plugin_information' || $action == 'theme_information') && strpos($args->slug, 'wpmudev_install') !== false ) {
$string = explode('-', $args->slug);
$id = intval($string[1]);
$updates = get_site_option('wdp_un_updates_available');
if ( did_action( 'install_plugins_pre_plugin-information' ) && is_array( $updates ) && isset($updates[$id]) ) {
echo '<iframe width="100%" height="100%" border="0" style="border:none;" src="' . $this->server_url . '?action=details&id=' . $id . '"></iframe>';
exit;
}
$res = new stdClass;
$res->name = $updates[$id]['name'];
$res->slug = sanitize_title($updates[$id]['name']);
$res->version = $updates[$id]['version'];
$res->rating = 100;
$res->homepage = $updates[$id]['url'];
$res->download_link = '';
$res->tested = $cur_wp_version;
return $res;
}
if ( $action == 'plugin_information' && strpos($args->slug, 'install_wpmudev_dash') !== false ) {
$res = new stdClass;
$res->name = 'WPMU DEV Dashboard';
$res->slug = 'wpmu-dev-dashboard';
$res->version = '';
$res->rating = 100;
$res->homepage = 'http://premium.wpmudev.org/project/wpmu-dev-dashboard/';
$res->download_link = $this->server_url . "?action=install_wpmudev_dash";
$res->tested = $cur_wp_version;
return $res;
}
return $res;
}
function filter_plugin_rows() {
if ( !current_user_can( 'update_plugins' ) )
return;
$updates = get_site_option('wdp_un_updates_available');
if ( is_array($updates) && count($updates) ) {
foreach ( $updates as $id => $plugin ) {
if ( $plugin['autoupdate'] != '2' ) {
if ( $plugin['type'] == 'theme' ) {
remove_all_actions( 'after_theme_row_' . $plugin['filename'] );
add_action('after_theme_row_' . $plugin['filename'], array( &$this, 'plugin_row'), 9, 2 );
} else {
remove_all_actions( 'after_plugin_row_' . $plugin['filename'] );
add_action('after_plugin_row_' . $plugin['filename'], array( &$this, 'plugin_row'), 9, 2 );
}
}
}
}
$local_themes = get_site_option('wdp_un_local_themes');
if ( is_array($local_themes) && count($local_themes) ) {
foreach ( $local_themes as $id => $plugin ) {
remove_all_actions( 'after_theme_row_' . $plugin['filename'] );
//only add the notice if specific version is wrong
if ( isset($updates[$this->theme_pack]) && version_compare($plugin['version'], $updates[$this->theme_pack]['new_version'], '<') ) {
add_action('after_theme_row_' . $plugin['filename'], array( &$this, 'themepack_row'), 9, 2 );
}
}
}
}
function filter_plugin_count( $value ) {
//remove any conflicting slug local WPMU DEV plugins from WP update notifications
$local_projects = get_site_option('wdp_un_local_projects');
if ( is_array($local_projects) && count($local_projects) ) {
foreach ( $local_projects as $id => $plugin ) {
if (isset($value->response[$plugin['filename']]))
unset($value->response[$plugin['filename']]);
}
}
$updates = get_site_option('wdp_un_updates_available');
if ( is_array($updates) && count($updates) ) {
foreach ( $updates as $id => $plugin ) {
if ( $plugin['type'] != 'theme' && $plugin['autoupdate'] != '2' ) {
//build plugin class
$object = new stdClass;
$object->url = $plugin['url'];
$object->slug = "wpmudev_install-$id";
$object->upgrade_notice = $plugin['changelog'];
$object->new_version = $plugin['new_version'];
$object->package = '';
//add to class
$value->response[$plugin['filename']] = $object;
}
}
}
return $value;
}
function filter_theme_count( $value ) {
$updates = get_site_option('wdp_un_updates_available');
if ( is_array($updates) && count($updates) ) {
foreach ( $updates as $id => $theme ) {
if ( $theme['type'] == 'theme' && $theme['autoupdate'] != '2' ) {
//build theme listing
$value->response[$theme['filename']]['url'] = $this->server_url . '?action=details&id=' . $id;
$value->response[$theme['filename']]['new_version'] = $theme['new_version'];
$value->response[$theme['filename']]['package'] = '';
}
}
}
//filter 133 theme pack themes from the list unless update is available
$local_themes = get_site_option('wdp_un_local_themes');
if ( is_array($local_themes) && count($local_themes) ) {
foreach ( $local_themes as $id => $theme ) {
//add to count only if new version exists, otherwise remove
if (isset($updates[$theme['id']]) && isset($updates[$theme['id']]['new_version']) && version_compare($theme['version'], $updates[$theme['id']]['new_version'], '<')) {
$value->response[$theme['filename']]['new_version'] = $updates[$theme['id']]['new_version'];
$value->response[$theme['filename']]['package'] = '';
} else if (isset($value) && isset($value->response) && isset($theme['filename']) && isset($value->response[$theme['filename']])) {
unset($value->response[$theme['filename']]);
}
}
}
return $value;
}
function plugin_row( $file, $plugin_data ) {
//get new version and update url
$updates = get_site_option('wdp_un_updates_available');
if ( is_array($updates) && count($updates) ) {
foreach ( $updates as $id => $plugin ) {
if ($plugin['filename'] == $file) {
$project_id = $id;
$version = $plugin['new_version'];
$plugin_url = $plugin['url'];
$autoupdate = $plugin['autoupdate'];
$filename = $plugin['filename'];
$type = $plugin['type'];
break;
}
}
} else {
return false;
}
$plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array());
$plugin_name = wp_kses( $plugin_data['Name'], $plugins_allowedtags );
$info_url = $this->server_url . '?action=details&id=' . $project_id . '&TB_iframe=true&width=640&height=800';
if ( file_exists(WP_PLUGIN_DIR . '/wpmudev-updates/update-notifications.php') ) {
$message = "Activate WPMU DEV Dashboard";
$action_url = $this->activate_url();
} else { //dashboard not installed at all
$message = "Install WPMU DEV Dashboard";
$action_url = $this->auto_install_url();
}
if ( current_user_can('update_plugins') ) {
echo '<tr class="plugin-update-tr"><td colspan="3" class="plugin-update colspanchange"><div class="update-message wpmu-update-row">';
printf( 'There is a new version of %1$s available on WPMU DEV. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s">%6$s</a> to update.', $plugin_name, esc_url($info_url), esc_attr($plugin_name), $version, esc_url($action_url), $message );
echo '</div></td></tr>';
}
}
function themepack_row( $file, $plugin_data ) {
//get new version and update url
$updates = get_site_option('wdp_un_updates_available');
if ( isset($updates[$this->theme_pack]) ) {
$plugin = $updates[$this->theme_pack];
$project_id = $this->theme_pack;
$version = $plugin['new_version'];
$plugin_url = $plugin['url'];
} else {
return false;
}
$plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array());
$plugin_name = wp_kses( $plugin_data['Name'], $plugins_allowedtags );
$info_url = $this->server_url . '?action=details&id=' . $project_id . '&TB_iframe=true&width=640&height=800';
if ( file_exists(WP_PLUGIN_DIR . '/wpmudev-updates/update-notifications.php') ) {
$message = "Activate WPMU DEV Dashboard";
$action_url = $this->activate_url();
} else { //dashboard not installed at all
$message = "Install WPMU DEV Dashboard";
$action_url = $this->auto_install_url();
}
if ( current_user_can('update_themes') ) {
echo '<tr class="plugin-update-tr"><td colspan="3" class="plugin-update colspanchange"><div class="update-message">';
printf( 'There is a new version of %1$s available on WPMU DEV. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s">%6$s</a> to update.', $plugin_name, esc_url($info_url), esc_attr($plugin_name), $version, esc_url($action_url), $message );
echo '</div></td></tr>';
}
}
function disable_checkboxes() {
$updates = get_site_option('wdp_un_updates_available');
if ( !is_array( $updates ) || ( is_array( $updates ) && !count( $updates ) ) ) {
return;
}
$jquery = '';
foreach ( (array) $updates as $id => $plugin) {
$jquery .= "<script type='text/javascript'>jQuery(\"input:checkbox[value='".esc_attr($plugin['filename'])."']\").remove();</script>\n";
}
//disable checkboxes for 133 theme pack themes
$local_themes = get_site_option('wdp_un_local_themes');
if ( is_array($local_themes) && count($local_themes) ) {
foreach ( $local_themes as $id => $theme ) {
$jquery .= "<script type='text/javascript'>jQuery(\"input:checkbox[value='".esc_attr($theme['filename'])."']\").remove();</script>\n";
}
}
echo $jquery;
}
function set_activate_flag($plugin) {
$data = $this->get_id_plugin( WP_PLUGIN_DIR . '/' . $plugin );
if ( isset($data['id']) && !empty($data['id']) ) {
update_site_option('wdp_un_activated_flag', 1);
}
}
}
$WPMUDEV_Dashboard_Notice3 = new WPMUDEV_Dashboard_Notice3();
}
//disable older version
if ( !class_exists('WPMUDEV_Dashboard_Notice') ) {
class WPMUDEV_Dashboard_Notice {}
}