0 ) { $amp_pos = strpos( $url, '&', $pos ); $accesskey = substr( $url, $pos + 10, $amp_pos - $pos - 10); $url = str_replace( $accesskey, 'UNDISCLOSED', $url) ; } self::add_to_log( 'call - ' . $url . ' - ' . json_encode( $params ) ); } public static function log_response( $response ) { self::add_to_log( 'response - ' . $response ); } public static function log_error( $message ) { self::add_to_log( 'error - ' . $message ); } public static function log_xml_rpc( $data ) { self::add_to_log('xml-rpc - ' . json_encode( $data ) ); } public static function get_log( ) { return get_option( 'wpml_tp_com_log', '' ); } public static function clear_log( ) { self::save_log( '' ); } public static function is_logging_enabled( ) { global $sitepress; return $sitepress->get_setting( 'tp-com-logging', true ); } public static function set_logging_state( $state ) { global $sitepress; $sitepress->set_setting( 'tp-com-logging', $state ); $sitepress->save_settings( ); } public static function add_com_log_link( ) { if ( self::get_log() != '' ) { $url = esc_attr( 'admin.php?page=' . WPML_TM_FOLDER . '/menu/main.php&sm=com-log' ); ?>

communication log page.', 'sitepress'), $url ); ?>

$max_log_length ) { $log = substr( $log, $log_length - $max_log_length ); } self::save_log( $log ); } } private static function save_log( $log ) { update_option( 'wpml_tp_com_log', $log ); } } }