Hi,
You can find the wp.php in the mailpoet directory / lib/Segments/wp.php
Also, I suggest you to introduce this piece of code to repair the auto alimentation of users :
In the same file, replace the removeOrphanedSubscribers by this function :
private static function removeOrphanedSubscribers() {
//removeorphanedwpsegmentsubscribers(nothavingamatchingwpuserid),
//e.g.ifwpusersweredeleteddirectlyfromthedatabase
global $wpdb;
$wp_segment=Segment::getWPSegment();
$wp_segment->subscribers()
->leftOuterJoin($wpdb->users,array(MP_SUBSCRIBERS_TABLE.'.wp_user_id','=','wu.id'),'wu')
->whereNull('wu.id')
->findResultSet()
->set('wp_user_id',null)
->delete();
//Pour faire le menage du bug
$blogMembersID=get_users(array('blog_id'=>get_current_blog_id(),'fields'=>array('ID')));
$inID="";
foreach($blogMembersID as $id)
{
if($inID!="")
{
$inID.=",";
}
$inID.=$id->ID;
}
$subscribers_table=Subscriber::$_table;
$request=sprintf('DELETE FROM %s WHERE wp_user_id is not null AND wp_user_id not in('.$inID.')',$subscribers_table);
Subscriber::raw_execute($request);
}
Finally, to redo a correct synchronisation, call this :
\MailPoet\Segments\WP::synchronizeUsers();
Personnaly, I call this function within the contructor of the lib/Config/Menu.php.
Hope will help,
Jean-David