Completed
Push — master ( 266d66...a823bd )
by David
55s
created
src/admin/partials/wordlift-admin-dashboard-v2.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
             white-space: nowrap;
120 120
         }
121 121
 
122
-        <?php $blu_dot_url = plugin_dir_url( dirname( dirname( __FILE__ ) ) ) . 'images/blu-dot.gif'; ?>
122
+        <?php $blu_dot_url = plugin_dir_url(dirname(dirname(__FILE__))).'images/blu-dot.gif'; ?>
123 123
         #wl-dashboard-v2 .wl-dashboard__block--top-entities .wl-dashboard__block__body > div:nth-child(even) {
124 124
             flex: calc(100% - 120px);
125 125
             background-color: #ebf6ff;
126
-            background-image: url('<?php echo esc_url( $blu_dot_url ); ?>'), url('<?php echo esc_url( $blu_dot_url ); ?>'), url('<?php echo esc_url( $blu_dot_url ); ?>');
126
+            background-image: url('<?php echo esc_url($blu_dot_url); ?>'), url('<?php echo esc_url($blu_dot_url); ?>'), url('<?php echo esc_url($blu_dot_url); ?>');
127 127
             background-position: 25% center, 50%, 75%;
128 128
             background-size: 1px 4px;
129 129
             background-repeat: repeat-y;
@@ -220,55 +220,55 @@  discard block
 block discarded – undo
220 220
 $country_code          = $configuration_service->get_country_code();
221 221
 
222 222
 $top_entities = $this->get_top_entities();
223
-if ( ! empty( $top_entities ) ) {
223
+if ( ! empty($top_entities)) {
224 224
 	?>
225 225
     <div class="wl-dashboard__block wl-dashboard__block--top-entities">
226 226
         <header>
227 227
             <span class="dashicons dashicons-editor-help"></span>
228
-            <h3><?php echo __( 'Top entities', 'wordlift' ); ?></h3>
229
-            <span class="wl-dashboard__legend wl-dashboard__legend--entities"><?php echo esc_html( _x( 'Links with entities', 'Dashboard', 'wordlift' ) ); ?></span>
230
-            <span class="wl-dashboard__legend wl-dashboard__legend--posts"><?php echo esc_html( _x( 'Post with entities', 'Dashboard', 'wordlift' ) ); ?></span>
228
+            <h3><?php echo __('Top entities', 'wordlift'); ?></h3>
229
+            <span class="wl-dashboard__legend wl-dashboard__legend--entities"><?php echo esc_html(_x('Links with entities', 'Dashboard', 'wordlift')); ?></span>
230
+            <span class="wl-dashboard__legend wl-dashboard__legend--posts"><?php echo esc_html(_x('Post with entities', 'Dashboard', 'wordlift')); ?></span>
231 231
         </header>
232 232
         <div class="wl-dashboard__block__body">
233 233
 			<?php
234 234
 			$max         = $top_entities[0]->total;
235
-			$unit        = intval( '1' . str_repeat( '0', strlen( $max ) - 1 ) );
236
-			$max_value   = ceil( (float) $max / $unit ) * $unit;
235
+			$unit        = intval('1'.str_repeat('0', strlen($max) - 1));
236
+			$max_value   = ceil((float) $max / $unit) * $unit;
237 237
 			$chunk_value = $max_value / 4;
238 238
 			?>
239 239
             <div></div>
240 240
             <div class="wl-dashboard__block__body__table-header">
241
-				<?php for ( $i = 0; $i <= $max_value; $i += $chunk_value ) { ?>
242
-                    <span><?php echo esc_html( $i ); ?></span><?php } ?>
241
+				<?php for ($i = 0; $i <= $max_value; $i += $chunk_value) { ?>
242
+                    <span><?php echo esc_html($i); ?></span><?php } ?>
243 243
             </div>
244 244
 			<?php
245 245
 			$i = 0;
246
-			foreach ( $this->get_top_entities() as $post ) {
247
-				$permalink    = get_permalink( $post->ID );
246
+			foreach ($this->get_top_entities() as $post) {
247
+				$permalink    = get_permalink($post->ID);
248 248
 				$title        = $post->post_title;
249 249
 				$entities_100 = 100 * $post->entities / $max_value;
250 250
 				$posts_100    = 100 * $post->posts / $max_value;
251 251
 
252 252
 				?>
253
-                <div><a href="<?php echo esc_attr( $permalink ); ?>"><?php echo esc_html( $title ); ?></a></div>
253
+                <div><a href="<?php echo esc_attr($permalink); ?>"><?php echo esc_html($title); ?></a></div>
254 254
                 <div>
255 255
                     <div class="wl-dashboard__bar wl-dashboard__bar--posts"
256
-                         style="width: <?php echo esc_attr( $posts_100 ); ?>%;">
256
+                         style="width: <?php echo esc_attr($posts_100); ?>%;">
257 257
                     </div>
258 258
                     <div class="wl-dashboard__bar wl-dashboard__bar--entities"
259
-                         style="width: <?php echo esc_attr( $entities_100 ); ?>%;">
259
+                         style="width: <?php echo esc_attr($entities_100); ?>%;">
260 260
                     </div>
261 261
                 </div>
262 262
 				<?php
263
-				if ( 4 === $i ++ ) {
263
+				if (4 === $i++) {
264 264
 					?>
265 265
                     <input id="wl-dashboard__show-more" type="checkbox">
266 266
                     <label for="wl-dashboard__show-more">
267 267
 						<span>
268
-							<?php echo esc_html( __( 'Show more', 'wordlift' ) ); ?>
268
+							<?php echo esc_html(__('Show more', 'wordlift')); ?>
269 269
 						</span>
270 270
                         <span>
271
-							<?php echo esc_html( __( 'Hide', 'wordlift' ) ); ?>
271
+							<?php echo esc_html(__('Hide', 'wordlift')); ?>
272 272
 						</span>
273 273
                     </label>
274 274
 					<?php
@@ -280,41 +280,41 @@  discard block
 block discarded – undo
280 280
 	<?php
281 281
 }
282 282
 
283
-$not_enriched_url  = admin_url( 'edit.php?post_type=post&wl_enriched=no' );
283
+$not_enriched_url  = admin_url('edit.php?post_type=post&wl_enriched=no');
284 284
 $dashboard_service = Wordlift_Dashboard_Service::get_instance();
285 285
 ?>
286 286
     <div class="wl-dashboard__block wl-dashboard__block--enriched-posts">
287 287
         <header>
288 288
             <span class="dashicons dashicons-editor-help"></span>
289
-            <h3><?php echo esc_html__( 'Enriched posts', 'wordlift' ); ?></h3>
289
+            <h3><?php echo esc_html__('Enriched posts', 'wordlift'); ?></h3>
290 290
         </header>
291 291
         <div class="wl-dashboard__block__body">
292
-            <a href="<?php echo esc_url( $not_enriched_url ); ?>"><?php echo esc_html( $dashboard_service->count_annotated_posts() ); ?></a>
293
-            / <?php echo esc_html( $dashboard_service->count_posts() ); ?>
294
-            <a href="<?php echo esc_url( $not_enriched_url ); ?>"><?php echo esc_html( _x( 'Enrich', 'Dashboard', 'wordlift' ) ); ?></a>
292
+            <a href="<?php echo esc_url($not_enriched_url); ?>"><?php echo esc_html($dashboard_service->count_annotated_posts()); ?></a>
293
+            / <?php echo esc_html($dashboard_service->count_posts()); ?>
294
+            <a href="<?php echo esc_url($not_enriched_url); ?>"><?php echo esc_html(_x('Enrich', 'Dashboard', 'wordlift')); ?></a>
295 295
         </div>
296 296
     </div>
297 297
 
298
-<?php $vocabulary_url = admin_url( 'edit.php?post_type=entity' ); ?>
298
+<?php $vocabulary_url = admin_url('edit.php?post_type=entity'); ?>
299 299
     <div class="wl-dashboard__block wl-dashboard__block--created-entities">
300 300
         <header>
301 301
             <span class="dashicons dashicons-editor-help"></span>
302
-            <h3><?php esc_html_e( 'Created entities', 'wordlift' ); ?></h3>
302
+            <h3><?php esc_html_e('Created entities', 'wordlift'); ?></h3>
303 303
         </header>
304 304
         <div class="wl-dashboard__block__body">
305
-            <a href="<?php echo esc_url( $vocabulary_url ); ?>"><?php echo esc_html( $this->entity_service->count() ); ?></a>
306
-            <a href="<?php echo esc_url( $vocabulary_url ); ?>"><?php echo esc_html( _x( 'Vocabulary', 'Dashboard', 'wordlift' ) ); ?></a>
305
+            <a href="<?php echo esc_url($vocabulary_url); ?>"><?php echo esc_html($this->entity_service->count()); ?></a>
306
+            <a href="<?php echo esc_url($vocabulary_url); ?>"><?php echo esc_html(_x('Vocabulary', 'Dashboard', 'wordlift')); ?></a>
307 307
         </div>
308 308
     </div>
309 309
 
310 310
     <div class="wl-dashboard__block wl-dashboard__block--average-entity-rating">
311 311
         <header>
312 312
             <span class="dashicons dashicons-editor-help"></span>
313
-            <h3><?php echo esc_html__( 'Average entity rating', 'wordlift' ); ?></h3>
313
+            <h3><?php echo esc_html__('Average entity rating', 'wordlift'); ?></h3>
314 314
         </header>
315 315
         <div class="wl-dashboard__block__body">
316
-			<?php echo esc_html( $dashboard_service->average_entities_rating() ); ?>
317
-			<?php echo esc_html( _x( 'Boost', 'Dashboard', 'wordlift' ) ); ?>
316
+			<?php echo esc_html($dashboard_service->average_entities_rating()); ?>
317
+			<?php echo esc_html(_x('Boost', 'Dashboard', 'wordlift')); ?>
318 318
         </div>
319 319
     </div>
320 320
 <?php
@@ -325,4 +325,4 @@  discard block
 block discarded – undo
325 325
  * @author Naveen Muthusamy <[email protected]>
326 326
  * Action name : wl_admin_dashboard_widgets
327 327
  */
328
-do_action( 'wl_admin_dashboard_widgets' );
328
+do_action('wl_admin_dashboard_widgets');
Please login to merge, or discard this patch.