This is due to the wp_get_sites function being deprecated (I think the breaking change may have happened in 4.7?). There are 4 calls to this function in the plugin – one in include/functions.php and three in lib/option.php. The code needs to be edited so it uses the new get_sites
function, which has a different parameter for the maximum number of sites to get (number
rather than limit
). It also needs to be changed so the list of sites are treated as objects instead of associative arrays. These are the edits which are working on my installs:
in functions.php
/**
* Get all duplicable sites
* @since 0.2.0
* @return array of blog data
*/
public static function get_site_list() {
$site_list = array();
$network_blogs = get_sites(array('number' => MUCD_MAX_NUMBER_OF_SITE));
foreach( $network_blogs as $blogobj ){
$blog = (array) $blogobj;
if (MUCD_Functions::is_duplicable($blog['blog_id']) && MUCD_SITE_DUPLICATION_EXCLUDE != $blog['blog_id']) {
$site_list[] = $blog;
}
}
return $site_list;
}
in option.php
/**
* Init 'mucd_duplicable' options
* @param string $blogs_value the value for blogs options
* @param string $network_value the value for site option
* @since 0.2.0
*/
public static function init_duplicable_option($blogs_value = "no", $network_value = "all") {
$network_blogs = get_sites(array('number' => MUCD_MAX_NUMBER_OF_SITE));
foreach( $network_blogs as $blog ){
$blog_id = $blog->blog_id;
add_blog_option( $blog_id, 'mucd_duplicable', $blogs_value);
}
add_site_option( 'mucd_duplicables', $network_value );
}
/**
* Delete 'mucd_duplicable' option for all sites
* @since 0.2.0
*/
public static function delete_duplicable_option() {
$network_blogs = get_sites(array('number' => MUCD_MAX_NUMBER_OF_SITE));
foreach( $network_blogs as $blog ){
$blog_id = $blog->blog_id;
delete_blog_option( $blog_id, 'mucd_duplicable');
}
delete_site_option( 'mucd_duplicables');
}
/**
* Set 'mucd_duplicable' option to "yes" for the list of blogs, other to "no"
* @since 0.2.0
* @param array $blogs list of blogs we want the option set to "yes"
*/
public static function set_duplicable_option($blogs) {
$network_blogs = get_sites(array('number' => MUCD_MAX_NUMBER_OF_SITE));
foreach( $network_blogs as $blog ){
if(in_array($blog->blog_id, $blogs)) {
update_blog_option( $blog->blog_id, 'mucd_duplicable', "yes");
}
else {
update_blog_option($blog->blog_id, 'mucd_duplicable', "no");
}
}
}
Hope this helps…