time(), 'action' => $action, 'milestone' => $milestone, 'code' => isset( $response['code'] ) ? (int) $response['code'] : 0, 'error' => isset( $response['error'] ) ? mb_substr( (string) $response['error'], 0, 300 ) : '', ); update_post_meta( $id, self::META, array_slice( $log, -50 ) ); } /** * @param int $id Application ID. * @return array */ public static function entries( $id ) { $log = get_post_meta( $id, self::META, true ); return is_array( $log ) ? $log : array(); } }