Project

General

Profile

Feature #10380 » deprecated-plugin-report.php

Boone Gorges, 2018-09-27 11:46 AM

 
1
<?php
2

    
3
global $wpdb, $bp;
4

    
5
$start = 3000;
6
$count = 500;
7
$blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->blogs} WHERE deleted = 0 AND archived = 0 AND spam = 0 LIMIT %d, %d", $start, $count ) );
8

    
9
$data  = array();
10
$stats = array();
11

    
12
$disabled_plugins = array(
13
	'_bp_rbe_imap_object_cache.php',
14
	'bp-external-activity/loader.php',
15
	'bp-groups-social-media/bp-groups-social-media.php',
16
	'bp-import-blog-activity/bp-import-blog-activity.php',
17
	'bp-lazyload-avatars/loader.php',
18
	'bp-lotsa-feeds/loader.php',
19
	'bp-rbe-inbound-forum-attachments/loader.php',
20
	'bp-relative-time/loader.php',
21
	'bp-reply-by-email/loader.php',
22
	'bp-social-media-profiles/loader.php',
23
//	'bp-system-report/bp-system-report.php',
24
//	'bp_tos_check/bp-tos-check.php',
25
	'btcnew/btcnew.php', // #10348
26
	'buddypress-docs-in-group/loader.php',
27
	'cac-advanced-profiles/cac-advanced-profiles.php',
28
	'cac-bp-blogs-directory-enhancements/cac-bp-blogs-directory-enhancements.php',
29
	'cac-group-announcements/cac-group-announcements.php',
30
	'cac-non-cuny-signup/loader.php',
31
	'cac-plugin-updates/cac-plugin-updates.php',
32
	'cacap-cac/cacap-cac.php',
33
	'cacap-notices/cacap-notices.php',
34
	'cacap-profiles-overlay/cacap-profiles-overlay.php',
35
	'cforms/cforms.php',
36
	'commentpress/commentpress.php',
37
	'cp-ajax-comments/cp-ajax-comments.php',
38
	'customizer-remove-all-parts/wp-crap.php',
39
	'daikosvideowidget.php', // #10348
40
	'dandyid-services/dandyid-services.php', // #10348
41
	'dd-formmailer/dd-formmailer.php', // #10348
42
	'dirt-directory-client/loader.php',
43
	//'email-users/email-users.php',
44
	'external-group-blogs/loader.php',
45
//	'fd-footnotes/fdfootnotes.php',
46
//	'firestats/firestats-wordpress.php',
47
//	'flickr-rss/flickrrss.php', // #10348
48
	'garees-twitter-stream/garees_twitter_stream.php', // #10344
49
//	'google-maps-embed/cets_EmbedGmaps.php',
50
	'kimili-flash-embed/kml_flashembed.php', // #10348
51
	'multisite-clone-duplicator/multisite-clone-duplicator.php',
52
	'oauth2-provider/wp-oauth-main.php',
53
	'page-tagger/page-tagger.php',
54
	'post-rich-videos-and-photos-galleries/wp-media-cincopa.php',
55
//	'share-this/sharethis.php',
56
	'sociable/sociable.php', // #10345
57
	//'social/social.php',
58
	'social-paper/social-paper.php',
59
	//'tantan-spam/plugin.php', // #10348
60
//	'tweetable/tweetable.php', // #10344
61
	'tubepress/tubepress.php', // #10348
62
	'twitter-mentions-as-comments/twitter-mentions-as-comments.php', // #10344
63
//	'twitter-tools/twitter-tools.php', // #10344
64
	//'wordtube/wordtube.php', // #10348
65
	'wp-rss-multi-importer/wp-rss-multi-importer.php',
66
	'wp-ui/wp-ui.php',
67
//	'wpng-calendar/wpng-calendar.php',
68
//	'wysija-newsletters/index.php',
69
	'unconfirmed/unconfirmed.php',
70
);
71

    
72
foreach ( $blog_ids as $blog_id ) {
73
	$active_plugins = get_blog_option( $blog_id, 'active_plugins' );
74
	$home = get_home_url( $blog_id );
75

    
76
	foreach ( $active_plugins as $p ) {
77
		if ( ! in_array( $p, $disabled_plugins, true ) ) {
78
			continue;
79
		}
80

    
81
		if ( is_plugin_active_for_network( $p ) ) {
82
			continue;
83
		}
84

    
85
		if ( ! isset( $stats[ $p ] ) ) {
86
			$stats[ $p ] = array();
87
		}
88

    
89
		$stats[ $p ][] = $home;
90

    
91
		$data[ $home ][] = $p;
92
	}
93
}
94

    
95
print_r( $stats );
96
print_r( $data );
    (1-1/1)