This method doesn't work anymore... 2.9.7 changed php. now looks like that and not sure how to register.
/**
* Register theme
*/
protected function register( $code ){
if( ! $code ){
return false;
}
$args = array(
'user-agent' => 'WordPress/'. get_bloginfo( 'version' ) .'; '. network_site_url(),
'timeout' => 30,
'body' => array(
'code' => urlencode( trim( $_POST[ 'betheme_purchase_code' ] ) ),
'register' => 1,
),
);
$response = $this->remote_post( 'register', $args );
if( is_wp_error( $response ) ){
add_settings_error( 'betheme_registration', 'registration_error', $response->get_error_message(), 'error inline mfn-dashboard-error' );
return false;
}
if( empty( $response['success'] ) ){
add_settings_error( 'betheme_registration', 'registration_error', $this->notices[ 'no_connection' ], 'error inline mfn-dashboard-error' );
return false;
}
update_site_option( 'betheme_registered', 1 );
add_settings_error( 'betheme_registration', 'registration_success', $this->notices[ 'registered' ], 'updated inline mfn-dashboard-error' );
$this->refresh_transients();
return $code;
}
/**
* Deregister theme
*/
protected function deregister(){
$code = mfn_get_purchase_code();
if( ! $code ){
return false;
}
$args = array(
'user-agent' => 'WordPress/'. get_bloginfo( 'version' ) .'; '. network_site_url(),
'timeout' => 30,
'body' => array(
'code' => urlencode( $code ),
'deregister' => 1,
),
);
$response = $this->remote_post( 'register', $args );
if( is_wp_error( $response ) ){
add_settings_error( 'betheme_registration', 'registration_error', $response->get_error_message(), 'error inline mfn-dashboard-error' );
return $code;
}
if( empty( $response['success'] ) ){
add_settings_error( 'betheme_registration', 'registration_error', $this->notices[ 'no_connection' ], 'error inline mfn-dashboard-error' );
return $code;
}
delete_site_option( 'betheme_registered' );
add_settings_error( 'betheme_registration', 'registration_success', $this->notices[ 'deregistered' ], 'updated inline mfn-dashboard-error' );
$this->refresh_transients();
return false;