Completed
Push — develop ( f9bbe0...9e14e8 )
by David
20:43 queued 01:18
created
src/admin/partials/wordlift-admin-dashboard-v2.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
         </div>
229 229
     </header>
230 230
 	<?php
231
-	if ( in_array( $configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) { ?>
231
+    if ( in_array( $configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) { ?>
232 232
         <div class="wl-dashboard__block__body">
233 233
             <div><?php echo esc_html( _x( 'Keywords', 'Dashboard', 'wordlift' ) ); ?>:
234 234
                 <a href="<?php echo admin_url( 'admin.php?page=wl_configuration_admin_menu&tab=search-keywords' ); ?>"><?php echo wp_count_terms( Wordlift_Search_Keyword_Taxonomy::TAXONOMY_NAME ); ?></a>
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 <?php
250 250
 $top_entities = $this->get_top_entities();
251 251
 if ( ! empty( $top_entities ) ) {
252
-	?>
252
+    ?>
253 253
     <div class="wl-dashboard__block wl-dashboard__block--top-entities">
254 254
         <header>
255 255
             <span class="dashicons dashicons-editor-help"></span>
@@ -259,24 +259,24 @@  discard block
 block discarded – undo
259 259
         </header>
260 260
         <div class="wl-dashboard__block__body">
261 261
 			<?php
262
-			$max         = $top_entities[0]->total;
263
-			$unit        = intval( '1' . str_repeat( '0', strlen( $max ) - 1 ) );
264
-			$max_value   = ceil( (float) $max / $unit ) * $unit;
265
-			$chunk_value = $max_value / 4;
266
-			?>
262
+            $max         = $top_entities[0]->total;
263
+            $unit        = intval( '1' . str_repeat( '0', strlen( $max ) - 1 ) );
264
+            $max_value   = ceil( (float) $max / $unit ) * $unit;
265
+            $chunk_value = $max_value / 4;
266
+            ?>
267 267
             <div></div>
268 268
             <div class="wl-dashboard__block__body__table-header">
269 269
 				<?php for ( $i = 0; $i <= $max_value; $i += $chunk_value ) { ?><span><?php echo $i; ?></span><?php } ?>
270 270
             </div>
271 271
 			<?php
272
-			$i = 0;
273
-			foreach ( $this->get_top_entities() as $post ) {
274
-				$permalink    = get_permalink( $post->ID );
275
-				$title        = $post->post_title;
276
-				$entities_100 = 100 * $post->entities / $max_value;
277
-				$posts_100    = 100 * $post->posts / $max_value;
278
-
279
-				?>
272
+            $i = 0;
273
+            foreach ( $this->get_top_entities() as $post ) {
274
+                $permalink    = get_permalink( $post->ID );
275
+                $title        = $post->post_title;
276
+                $entities_100 = 100 * $post->entities / $max_value;
277
+                $posts_100    = 100 * $post->posts / $max_value;
278
+
279
+                ?>
280 280
                 <div><a href="<?php echo esc_attr( $permalink ); ?>"><?php echo esc_html( $title ); ?></a></div>
281 281
                 <div>
282 282
                     <div class="wl-dashboard__bar wl-dashboard__bar--posts" style="width: <?php echo $posts_100 ?>%;">
@@ -286,8 +286,8 @@  discard block
 block discarded – undo
286 286
                     </div>
287 287
                 </div>
288 288
 				<?php
289
-				if ( 4 === $i ++ ) {
290
-					?>
289
+                if ( 4 === $i ++ ) {
290
+                    ?>
291 291
                     <input id="wl-dashboard__show-more" type="checkbox">
292 292
                     <label for="wl-dashboard__show-more">
293 293
                         <span>
@@ -298,9 +298,9 @@  discard block
 block discarded – undo
298 298
                         </span>
299 299
                     </label>
300 300
 					<?php
301
-				}
302
-			}
303
-			?>
301
+                }
302
+            }
303
+            ?>
304 304
         </div>
305 305
     </div>
306 306
 	<?php
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         white-space: nowrap;
116 116
     }
117 117
 
118
-    <?php $blu_dot_url = plugin_dir_url( dirname( dirname( __FILE__ ) ) ) . 'images/blu-dot.gif'; ?>
118
+    <?php $blu_dot_url = plugin_dir_url(dirname(dirname(__FILE__))).'images/blu-dot.gif'; ?>
119 119
     #wl-dashboard-v2 .wl-dashboard__block--top-entities .wl-dashboard__block__body > div:nth-child(even) {
120 120
         flex: calc(100% - 120px);
121 121
         background-color: #ebf6ff;
@@ -219,65 +219,65 @@  discard block
 block discarded – undo
219 219
 <div class="wl-dashboard__block wl-dashboard__block--search-rankings">
220 220
     <header>
221 221
         <span class="dashicons dashicons-editor-help"></span>
222
-        <h3><?php echo __( 'Search rankings', 'wordlift' ); ?></h3>
222
+        <h3><?php echo __('Search rankings', 'wordlift'); ?></h3>
223 223
         <div class="pull-right">
224
-			<?php echo esc_html( __( Wordlift_Countries::get_country_name( $country_code ) ) ); ?>
225
-            <img width="16" height="16" src="<?php echo Wordlift_Countries::get_flag_url( $country_code ); ?>">
224
+			<?php echo esc_html(__(Wordlift_Countries::get_country_name($country_code))); ?>
225
+            <img width="16" height="16" src="<?php echo Wordlift_Countries::get_flag_url($country_code); ?>">
226 226
             <img width="16" height="16"
227
-                 src="<?php echo plugin_dir_url( dirname( dirname( __FILE__ ) ) ) . 'images/woorank-16x16.png'; ?>">
227
+                 src="<?php echo plugin_dir_url(dirname(dirname(__FILE__))).'images/woorank-16x16.png'; ?>">
228 228
         </div>
229 229
     </header>
230 230
 	<?php
231
-	if ( in_array( $configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) { ?>
231
+	if (in_array($configuration_service->get_package_type(), array('editorial', 'business'))) { ?>
232 232
         <div class="wl-dashboard__block__body">
233
-            <div><?php echo esc_html( _x( 'Keywords', 'Dashboard', 'wordlift' ) ); ?>:
234
-                <a href="<?php echo admin_url( 'admin.php?page=wl_configuration_admin_menu&tab=search-keywords' ); ?>"><?php echo wp_count_terms( Wordlift_Search_Keyword_Taxonomy::TAXONOMY_NAME ); ?></a>
233
+            <div><?php echo esc_html(_x('Keywords', 'Dashboard', 'wordlift')); ?>:
234
+                <a href="<?php echo admin_url('admin.php?page=wl_configuration_admin_menu&tab=search-keywords'); ?>"><?php echo wp_count_terms(Wordlift_Search_Keyword_Taxonomy::TAXONOMY_NAME); ?></a>
235 235
             </div>
236
-            <div><?php echo esc_html( _x( 'Average position', 'Dashboard', 'wordlift' ) ); ?>:
237
-                <a href="<?php echo admin_url( 'admin.php?page=wl_search_rankings' ); ?>"><?php echo $average_position_string; ?></a>
236
+            <div><?php echo esc_html(_x('Average position', 'Dashboard', 'wordlift')); ?>:
237
+                <a href="<?php echo admin_url('admin.php?page=wl_search_rankings'); ?>"><?php echo $average_position_string; ?></a>
238 238
             </div>
239 239
         </div>
240 240
 	<?php } else { ?>
241 241
         <div class="wl-dashboard__block__body wl-dashboard__block__body--locked">
242
-			<?php echo esc_html( _x( 'Search Rankings are only available to Business and Editorial users', 'Dashboard', 'wordlift' ) ); ?>
242
+			<?php echo esc_html(_x('Search Rankings are only available to Business and Editorial users', 'Dashboard', 'wordlift')); ?>
243 243
             <a href="https://wordlift.io/upgrade" target="_blank"
244
-               class="button button-primary"><?php echo esc_html( __( 'Upgrade', 'wordlift' ) ); ?></a>
244
+               class="button button-primary"><?php echo esc_html(__('Upgrade', 'wordlift')); ?></a>
245 245
         </div>
246 246
 	<?php } ?>
247 247
 </div>
248 248
 
249 249
 <?php
250 250
 $top_entities = $this->get_top_entities();
251
-if ( ! empty( $top_entities ) ) {
251
+if ( ! empty($top_entities)) {
252 252
 	?>
253 253
     <div class="wl-dashboard__block wl-dashboard__block--top-entities">
254 254
         <header>
255 255
             <span class="dashicons dashicons-editor-help"></span>
256
-            <h3><?php echo __( 'Top entities', 'wordlift' ); ?></h3>
257
-            <span class="wl-dashboard__legend wl-dashboard__legend--entities"><?php echo esc_html( _x( 'Links with entities', 'Dashboard', 'wordlift' ) ); ?></span>
258
-            <span class="wl-dashboard__legend wl-dashboard__legend--posts"><?php echo esc_html( _x( 'Post with entities', 'Dashboard', 'wordlift' ) ); ?></span>
256
+            <h3><?php echo __('Top entities', 'wordlift'); ?></h3>
257
+            <span class="wl-dashboard__legend wl-dashboard__legend--entities"><?php echo esc_html(_x('Links with entities', 'Dashboard', 'wordlift')); ?></span>
258
+            <span class="wl-dashboard__legend wl-dashboard__legend--posts"><?php echo esc_html(_x('Post with entities', 'Dashboard', 'wordlift')); ?></span>
259 259
         </header>
260 260
         <div class="wl-dashboard__block__body">
261 261
 			<?php
262 262
 			$max         = $top_entities[0]->total;
263
-			$unit        = intval( '1' . str_repeat( '0', strlen( $max ) - 1 ) );
264
-			$max_value   = ceil( (float) $max / $unit ) * $unit;
263
+			$unit        = intval('1'.str_repeat('0', strlen($max) - 1));
264
+			$max_value   = ceil((float) $max / $unit) * $unit;
265 265
 			$chunk_value = $max_value / 4;
266 266
 			?>
267 267
             <div></div>
268 268
             <div class="wl-dashboard__block__body__table-header">
269
-				<?php for ( $i = 0; $i <= $max_value; $i += $chunk_value ) { ?><span><?php echo $i; ?></span><?php } ?>
269
+				<?php for ($i = 0; $i <= $max_value; $i += $chunk_value) { ?><span><?php echo $i; ?></span><?php } ?>
270 270
             </div>
271 271
 			<?php
272 272
 			$i = 0;
273
-			foreach ( $this->get_top_entities() as $post ) {
274
-				$permalink    = get_permalink( $post->ID );
273
+			foreach ($this->get_top_entities() as $post) {
274
+				$permalink    = get_permalink($post->ID);
275 275
 				$title        = $post->post_title;
276 276
 				$entities_100 = 100 * $post->entities / $max_value;
277 277
 				$posts_100    = 100 * $post->posts / $max_value;
278 278
 
279 279
 				?>
280
-                <div><a href="<?php echo esc_attr( $permalink ); ?>"><?php echo esc_html( $title ); ?></a></div>
280
+                <div><a href="<?php echo esc_attr($permalink); ?>"><?php echo esc_html($title); ?></a></div>
281 281
                 <div>
282 282
                     <div class="wl-dashboard__bar wl-dashboard__bar--posts" style="width: <?php echo $posts_100 ?>%;">
283 283
                     </div>
@@ -286,15 +286,15 @@  discard block
 block discarded – undo
286 286
                     </div>
287 287
                 </div>
288 288
 				<?php
289
-				if ( 4 === $i ++ ) {
289
+				if (4 === $i++) {
290 290
 					?>
291 291
                     <input id="wl-dashboard__show-more" type="checkbox">
292 292
                     <label for="wl-dashboard__show-more">
293 293
                         <span>
294
-						    <?php echo esc_html( __( 'Show more', 'Dashboard', 'wordlift' ) ); ?>
294
+						    <?php echo esc_html(__('Show more', 'Dashboard', 'wordlift')); ?>
295 295
                         </span>
296 296
                         <span>
297
-                            <?php echo esc_html( __( 'Hide', 'Dashboard', 'wordlift' ) ); ?>
297
+                            <?php echo esc_html(__('Hide', 'Dashboard', 'wordlift')); ?>
298 298
                         </span>
299 299
                     </label>
300 300
 					<?php
@@ -306,52 +306,52 @@  discard block
 block discarded – undo
306 306
 	<?php
307 307
 }
308 308
 
309
-$not_enriched_url = admin_url( 'edit.php?post_type=post&wl_enriched=no' ); ?>
309
+$not_enriched_url = admin_url('edit.php?post_type=post&wl_enriched=no'); ?>
310 310
 <div class="wl-dashboard__block wl-dashboard__block--enriched-posts">
311 311
     <header>
312 312
         <span class="dashicons dashicons-editor-help"></span>
313
-        <h3><?php echo __( 'Enriched posts', 'wordlift' ); ?></h3>
313
+        <h3><?php echo __('Enriched posts', 'wordlift'); ?></h3>
314 314
     </header>
315 315
     <div class="wl-dashboard__block__body">
316 316
         <a href="<?php echo $not_enriched_url; ?>"><?php echo $this->dashboard_service->count_annotated_posts(); ?></a>
317 317
         / <?php echo $this->dashboard_service->count_posts(); ?>
318
-        <a href="<?php echo $not_enriched_url; ?>"><?php echo esc_html( _x( 'Enrich', 'Dashboard', 'wordlift' ) ); ?></a>
318
+        <a href="<?php echo $not_enriched_url; ?>"><?php echo esc_html(_x('Enrich', 'Dashboard', 'wordlift')); ?></a>
319 319
     </div>
320 320
 </div>
321 321
 
322
-<?php $vocabulary_url = admin_url( 'edit.php?post_type=entity' ); ?>
322
+<?php $vocabulary_url = admin_url('edit.php?post_type=entity'); ?>
323 323
 <div class="wl-dashboard__block wl-dashboard__block--created-entities">
324 324
     <header>
325 325
         <span class="dashicons dashicons-editor-help"></span>
326
-        <h3><?php echo __( 'Created entities', 'wordlift' ); ?></h3>
326
+        <h3><?php echo __('Created entities', 'wordlift'); ?></h3>
327 327
     </header>
328 328
     <div class="wl-dashboard__block__body">
329 329
         <a href="<?php echo $vocabulary_url; ?>"><?php echo $this->entity_service->count(); ?></a>
330
-        <a href="<?php echo $vocabulary_url; ?>"><?php echo esc_html( _x( 'Vocabulary', 'Dashboard', 'wordlift' ) ); ?></a>
330
+        <a href="<?php echo $vocabulary_url; ?>"><?php echo esc_html(_x('Vocabulary', 'Dashboard', 'wordlift')); ?></a>
331 331
     </div>
332 332
 </div>
333 333
 
334
-<?php $boost_url = admin_url( 'admin.php?page=wl_search_rankings' ); ?>
334
+<?php $boost_url = admin_url('admin.php?page=wl_search_rankings'); ?>
335 335
 <div class="wl-dashboard__block wl-dashboard__block--average-entity-rating">
336 336
     <header>
337 337
         <span class="dashicons dashicons-editor-help"></span>
338
-        <h3><?php echo __( 'Average entity rating', 'wordlift' ); ?></h3>
338
+        <h3><?php echo __('Average entity rating', 'wordlift'); ?></h3>
339 339
     </header>
340 340
     <div class="wl-dashboard__block__body">
341 341
         <a href="<?php echo $boost_url; ?>"><?php echo $this->dashboard_service->average_entities_rating(); ?></a>
342
-        <a href="<?php echo $boost_url; ?>"><?php echo esc_html( _x( 'Boost', 'Dashboard', 'wordlift' ) ); ?></a>
342
+        <a href="<?php echo $boost_url; ?>"><?php echo esc_html(_x('Boost', 'Dashboard', 'wordlift')); ?></a>
343 343
     </div>
344 344
 </div>
345 345
 
346 346
 <div>
347 347
     <header>
348 348
         <span class="dashicons dashicons-editor-help"></span>
349
-        <h3><?php echo __( 'Graph data', 'wordlift' ); ?></h3>
349
+        <h3><?php echo __('Graph data', 'wordlift'); ?></h3>
350 350
     </header>
351 351
     <div>
352
-		<?php echo esc_html( _x( 'Created triples', 'Dashboard', 'wordlift' ) ); ?>
353
-        : <?php echo number_format( $this->dashboard_service->count_triples() ); ?><br/>
354
-		<?php echo esc_html( _x( 'Ratio on Wikidata', 'Dashboard', 'wordlift' ) ); ?>:
355
-		<?php echo number_format( $this->dashboard_service->count_triples() * 100 / 947690143, 4 ); ?>%
352
+		<?php echo esc_html(_x('Created triples', 'Dashboard', 'wordlift')); ?>
353
+        : <?php echo number_format($this->dashboard_service->count_triples()); ?><br/>
354
+		<?php echo esc_html(_x('Ratio on Wikidata', 'Dashboard', 'wordlift')); ?>:
355
+		<?php echo number_format($this->dashboard_service->count_triples() * 100 / 947690143, 4); ?>%
356 356
     </div>
357 357
 </div>
Please login to merge, or discard this patch.