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