PluginProbe
Stream – Activity Log & Audit Trail / 3.9.0
Stream – Activity Log & Audit Trail v3.9.0
4.4.0 4.3.0 4.2.2 4.2.1 trunk 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.1 3.1.1 3.10.0 3.2.0 3.2.1 3.2.2 3.2.3 All 50 releases
← All changes | classes/class-author.php +21 -17 trunk3.9.0 View file →
@@ -69,9 +69,9 @@
69 69 return $this->$getter();
70 70 default:
71 71 if ( ! empty( $this->user ) && 0 !== $this->user->ID ) {
72 72 if ( is_null( $this->user->$name ) ) {
73 - throw new \Exception( sprintf( "Unrecognized magic '%s'", esc_attr( $name ) ) );
73 + throw new \Exception( "Unrecognized magic '$name'" );
74 74 }
75 75 return $this->user->$name;
76 76 }
77 77
@@ -100,20 +100,22 @@
100 100 } elseif ( 'wp_cli' === $this->get_current_agent() ) {
101 101 return 'WP-CLI'; // No translation needed.
102 102 }
103 103 return esc_html__( 'N/A', 'stream' );
104 - } elseif ( $this->is_deleted() ) {
105 - if ( ! empty( $this->meta['display_name'] ) ) {
106 - return $this->meta['display_name'];
107 - } elseif ( ! empty( $this->meta['user_login'] ) ) {
108 - return $this->meta['user_login'];
104 + } else {
105 + if ( $this->is_deleted() ) {
106 + if ( ! empty( $this->meta['display_name'] ) ) {
107 + return $this->meta['display_name'];
108 + } elseif ( ! empty( $this->meta['user_login'] ) ) {
109 + return $this->meta['user_login'];
110 + } else {
111 + return esc_html__( 'N/A', 'stream' );
112 + }
113 + } elseif ( ! empty( $this->user->display_name ) ) {
114 + return $this->user->display_name;
109 115 } else {
110 - return $this->id;
116 + return $this->user->user_login;
111 117 }
112 - } elseif ( ! empty( $this->user->display_name ) ) {
113 - return $this->user->display_name;
114 - } else {
115 - return $this->user->user_login;
116 118 }
117 119 }
118 120
119 121 /**
@@ -148,15 +150,17 @@
148 150 }
149 151
150 152 if ( 0 === $this->id ) {
151 153 $stream = wp_stream_get_instance();
152 - $url = $stream->locations['url'] . 'assets/wp-cli.png';
154 + $url = $stream->locations['url'] . 'ui/stream-icons/wp-cli.png';
153 155 $avatar = sprintf( '<img alt="%1$s" src="%2$s" class="avatar avatar-%3$s photo" height="%3$s" width="%3$s">', esc_attr( $this->get_display_name() ), esc_url( $url ), esc_attr( $size ) );
154 - } elseif ( $this->is_deleted() && isset( $this->meta['user_email'] ) ) {
156 + } else {
157 + if ( $this->is_deleted() && isset( $this->meta['user_email'] ) ) {
155 158 $email = $this->meta['user_email'];
156 159 $avatar = get_avatar( $email, $size );
157 - } else {
158 - $avatar = get_avatar( $this->id, $size );
160 + } else {
161 + $avatar = get_avatar( $this->id, $size );
162 + }
159 163 }
160 164
161 165 return $avatar;
162 166 }
@@ -175,9 +179,9 @@
175 179 return false;
176 180 }
177 181
178 182 if ( 1 === preg_match( '/src=([\'"])(.*?)\1/', $img, $matches ) ) {
179 - $src = html_entity_decode( $matches[2], ENT_COMPAT );
183 + $src = html_entity_decode( $matches[2] );
180 184 } else {
181 185 return false;
182 186 }
183 187
@@ -205,9 +209,9 @@
205 209 } elseif ( ! empty( $this->meta['user_role_label'] ) ) {
206 210 $user_role = $this->meta['user_role_label'];
207 211 } elseif ( ! empty( $this->user->roles ) ) {
208 212 $roles = array_map(
209 - function ( $role ) use ( $wp_roles ) {
213 + function( $role ) use ( $wp_roles ) {
210 214 return $wp_roles->role_names[ $role ];
211 215 },
212 216 $this->user->roles
213 217 );