77
88namespace Activitypub \Table ;
99
10- use WP_List_Table ;
1110use Activitypub \Collection \Actors ;
1211use Activitypub \Collection \Followers as FollowerCollection ;
1312
2019/**
2120 * Followers Table-Class.
2221 */
23- class Followers extends WP_List_Table {
22+ class Followers extends \ WP_List_Table {
2423 /**
2524 * User ID.
2625 *
@@ -94,17 +93,17 @@ public function prepare_items() {
9493
9594 // phpcs:disable WordPress.Security.NonceVerification.Recommended
9695 if ( isset ( $ _GET ['orderby ' ] ) ) {
97- $ args ['orderby ' ] = sanitize_text_field ( wp_unslash ( $ _GET ['orderby ' ] ) );
96+ $ args ['orderby ' ] = \ sanitize_text_field ( \ wp_unslash ( $ _GET ['orderby ' ] ) );
9897 }
9998
10099 if ( isset ( $ _GET ['order ' ] ) ) {
101- $ args ['order ' ] = sanitize_text_field ( wp_unslash ( $ _GET ['order ' ] ) );
100+ $ args ['order ' ] = \ sanitize_text_field ( \ wp_unslash ( $ _GET ['order ' ] ) );
102101 }
103102
104103 if ( isset ( $ _GET ['s ' ] ) && isset ( $ _REQUEST ['_wpnonce ' ] ) ) {
105- $ nonce = sanitize_text_field ( wp_unslash ( $ _REQUEST ['_wpnonce ' ] ) );
106- if ( wp_verify_nonce ( $ nonce , 'bulk- ' . $ this ->_args ['plural ' ] ) ) {
107- $ args ['s ' ] = sanitize_text_field ( wp_unslash ( $ _GET ['s ' ] ) );
104+ $ nonce = \ sanitize_text_field ( \ wp_unslash ( $ _REQUEST ['_wpnonce ' ] ) );
105+ if ( \ wp_verify_nonce ( $ nonce , 'bulk- ' . $ this ->_args ['plural ' ] ) ) {
106+ $ args ['s ' ] = \ sanitize_text_field ( \ wp_unslash ( $ _GET ['s ' ] ) );
108107 }
109108 }
110109 // phpcs:enable WordPress.Security.NonceVerification.Recommended
@@ -125,13 +124,13 @@ public function prepare_items() {
125124 foreach ( $ followers as $ follower ) {
126125 $ actor = Actors::get_actor ( $ follower );
127126 $ item = array (
128- 'icon ' => esc_attr ( $ actor ->get_icon ()['url ' ] ?? '' ),
129- 'post_title ' => esc_attr ( $ actor ->get_name () ),
130- 'username ' => esc_attr ( $ actor ->get_preferred_username () ),
131- 'url ' => esc_attr ( object_to_uri ( $ actor ->get_url () ) ),
132- 'identifier ' => esc_attr ( $ actor ->get_id () ),
133- 'published ' => esc_attr ( $ actor ->get_published () ),
134- 'modified ' => esc_attr ( $ actor ->get_updated () ),
127+ 'icon ' => \ esc_attr ( $ actor ->get_icon ()['url ' ] ?? '' ),
128+ 'post_title ' => \ esc_attr ( $ actor ->get_name () ),
129+ 'username ' => \ esc_attr ( $ actor ->get_preferred_username () ),
130+ 'url ' => \ esc_attr ( object_to_uri ( $ actor ->get_url () ) ),
131+ 'identifier ' => \ esc_attr ( $ actor ->get_id () ),
132+ 'published ' => \ esc_attr ( $ actor ->get_published () ),
133+ 'modified ' => \ esc_attr ( $ actor ->get_updated () ),
135134 );
136135
137136 $ this ->items [] = $ item ;
@@ -145,7 +144,7 @@ public function prepare_items() {
145144 */
146145 public function get_bulk_actions () {
147146 return array (
148- 'delete ' => __ ( 'Delete ' , 'activitypub ' ),
147+ 'delete ' => \ __ ( 'Delete ' , 'activitypub ' ),
149148 );
150149 }
151150
@@ -158,7 +157,7 @@ public function get_bulk_actions() {
158157 */
159158 public function column_default ( $ item , $ column_name ) {
160159 if ( ! array_key_exists ( $ column_name , $ item ) ) {
161- return __ ( 'None ' , 'activitypub ' );
160+ return \ __ ( 'None ' , 'activitypub ' );
162161 }
163162 return $ item [ $ column_name ];
164163 }
@@ -170,7 +169,7 @@ public function column_default( $item, $column_name ) {
170169 * @return string
171170 */
172171 public function column_avatar ( $ item ) {
173- return sprintf (
172+ return \ sprintf (
174173 '<img src="%s" width="25px;" alt="" /> ' ,
175174 $ item ['icon ' ]
176175 );
@@ -183,9 +182,9 @@ public function column_avatar( $item ) {
183182 * @return string
184183 */
185184 public function column_url ( $ item ) {
186- return sprintf (
185+ return \ sprintf (
187186 '<a href="%s" target="_blank">%s</a> ' ,
188- esc_url ( $ item ['url ' ] ),
187+ \ esc_url ( $ item ['url ' ] ),
189188 $ item ['url ' ]
190189 );
191190 }
@@ -197,7 +196,7 @@ public function column_url( $item ) {
197196 * @return string
198197 */
199198 public function column_cb ( $ item ) {
200- return sprintf ( '<input type="checkbox" name="followers[]" value="%s" /> ' , esc_attr ( $ item ['identifier ' ] ) );
199+ return \ sprintf ( '<input type="checkbox" name="followers[]" value="%s" /> ' , \ esc_attr ( $ item ['identifier ' ] ) );
201200 }
202201
203202 /**
@@ -207,12 +206,12 @@ public function process_action() {
207206 if ( ! isset ( $ _REQUEST ['followers ' ] ) || ! isset ( $ _REQUEST ['_wpnonce ' ] ) ) {
208207 return ;
209208 }
210- $ nonce = sanitize_text_field ( wp_unslash ( $ _REQUEST ['_wpnonce ' ] ) );
211- if ( ! wp_verify_nonce ( $ nonce , 'bulk- ' . $ this ->_args ['plural ' ] ) ) {
209+ $ nonce = \ sanitize_text_field ( \ wp_unslash ( $ _REQUEST ['_wpnonce ' ] ) );
210+ if ( ! \ wp_verify_nonce ( $ nonce , 'bulk- ' . $ this ->_args ['plural ' ] ) ) {
212211 return ;
213212 }
214213
215- if ( ! current_user_can ( 'edit_user ' , $ this ->user_id ) ) {
214+ if ( ! \ current_user_can ( 'edit_user ' , $ this ->user_id ) ) {
216215 return ;
217216 }
218217
0 commit comments