@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | - exit; |
|
| 10 | + exit; |
|
| 11 | 11 | } |
| 12 | 12 | ?> |
| 13 | 13 | |
@@ -15,8 +15,8 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | <form action="options.php" method="post"> |
| 17 | 17 | <?php |
| 18 | - settings_fields( 'wl_general_settings' ); |
|
| 19 | - do_settings_sections( 'wl_general_settings' ); |
|
| 20 | - submit_button(); |
|
| 21 | - ?> |
|
| 18 | + settings_fields( 'wl_general_settings' ); |
|
| 19 | + do_settings_sections( 'wl_general_settings' ); |
|
| 20 | + submit_button(); |
|
| 21 | + ?> |
|
| 22 | 22 | </form> |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * @package Wordlift/admin |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 9 | +if ( ! defined('ABSPATH')) { |
|
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | 12 | ?> |
@@ -15,8 +15,8 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | <form action="options.php" method="post"> |
| 17 | 17 | <?php |
| 18 | - settings_fields( 'wl_general_settings' ); |
|
| 19 | - do_settings_sections( 'wl_general_settings' ); |
|
| 18 | + settings_fields('wl_general_settings'); |
|
| 19 | + do_settings_sections('wl_general_settings'); |
|
| 20 | 20 | submit_button(); |
| 21 | 21 | ?> |
| 22 | 22 | </form> |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 224 | 224 | $top_entities = $this->get_top_entities(); |
| 225 | 225 | if ( ! empty( $top_entities ) ) { |
| 226 | - ?> |
|
| 226 | + ?> |
|
| 227 | 227 | <div class="wl-dashboard__block wl-dashboard__block--top-entities"> |
| 228 | 228 | <header> |
| 229 | 229 | <span class="dashicons dashicons-editor-help"></span> |
@@ -233,26 +233,26 @@ discard block |
||
| 233 | 233 | </header> |
| 234 | 234 | <div class="wl-dashboard__block__body"> |
| 235 | 235 | <?php |
| 236 | - $max = $top_entities[0]->total; |
|
| 237 | - $unit = intval( '1' . str_repeat( '0', strlen( $max ) - 1 ) ); |
|
| 238 | - $max_value = ceil( (float) $max / $unit ) * $unit; |
|
| 239 | - $chunk_value = $max_value / 4; |
|
| 240 | - ?> |
|
| 236 | + $max = $top_entities[0]->total; |
|
| 237 | + $unit = intval( '1' . str_repeat( '0', strlen( $max ) - 1 ) ); |
|
| 238 | + $max_value = ceil( (float) $max / $unit ) * $unit; |
|
| 239 | + $chunk_value = $max_value / 4; |
|
| 240 | + ?> |
|
| 241 | 241 | <div></div> |
| 242 | 242 | <div class="wl-dashboard__block__body__table-header"> |
| 243 | 243 | <?php for ( $i = 0; $i <= $max_value; $i += $chunk_value ) { ?> |
| 244 | 244 | <span><?php echo esc_html( $i ); ?></span><?php } ?> |
| 245 | 245 | </div> |
| 246 | 246 | <?php |
| 247 | - $i = 0; |
|
| 248 | - // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
|
| 249 | - foreach ( $this->get_top_entities() as $top_entity ) { |
|
| 250 | - $permalink = get_permalink( $top_entity->ID ); |
|
| 251 | - $post_title = $top_entity->post_title; |
|
| 252 | - $entities_100 = 100 * $top_entity->entities / $max_value; |
|
| 253 | - $posts_100 = 100 * $top_entity->posts / $max_value; |
|
| 254 | - |
|
| 255 | - ?> |
|
| 247 | + $i = 0; |
|
| 248 | + // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
|
| 249 | + foreach ( $this->get_top_entities() as $top_entity ) { |
|
| 250 | + $permalink = get_permalink( $top_entity->ID ); |
|
| 251 | + $post_title = $top_entity->post_title; |
|
| 252 | + $entities_100 = 100 * $top_entity->entities / $max_value; |
|
| 253 | + $posts_100 = 100 * $top_entity->posts / $max_value; |
|
| 254 | + |
|
| 255 | + ?> |
|
| 256 | 256 | <div><a href="<?php echo esc_attr( $permalink ); ?>"><?php echo esc_html( $post_title ); ?></a></div> |
| 257 | 257 | <div> |
| 258 | 258 | <div class="wl-dashboard__bar wl-dashboard__bar--posts" |
@@ -263,8 +263,8 @@ discard block |
||
| 263 | 263 | </div> |
| 264 | 264 | </div> |
| 265 | 265 | <?php |
| 266 | - if ( 4 === $i ++ ) { |
|
| 267 | - ?> |
|
| 266 | + if ( 4 === $i ++ ) { |
|
| 267 | + ?> |
|
| 268 | 268 | <input id="wl-dashboard__show-more" type="checkbox"> |
| 269 | 269 | <label for="wl-dashboard__show-more"> |
| 270 | 270 | <span> |
@@ -275,9 +275,9 @@ discard block |
||
| 275 | 275 | </span> |
| 276 | 276 | </label> |
| 277 | 277 | <?php |
| 278 | - } |
|
| 279 | - } |
|
| 280 | - ?> |
|
| 278 | + } |
|
| 279 | + } |
|
| 280 | + ?> |
|
| 281 | 281 | </div> |
| 282 | 282 | </div> |
| 283 | 283 | <?php |
@@ -307,9 +307,9 @@ discard block |
||
| 307 | 307 | <div class="wl-dashboard__block__body"> |
| 308 | 308 | <a href="<?php echo esc_url( $vocabulary_url ); ?>"> |
| 309 | 309 | <?php |
| 310 | - // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
|
| 311 | - echo esc_html( $this->entity_service->count() ); |
|
| 312 | - ?> |
|
| 310 | + // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
|
| 311 | + echo esc_html( $this->entity_service->count() ); |
|
| 312 | + ?> |
|
| 313 | 313 | </a> |
| 314 | 314 | <a href="<?php echo esc_url( $vocabulary_url ); ?>"><?php echo esc_html( _x( 'Vocabulary', 'Dashboard', 'wordlift' ) ); ?></a> |
| 315 | 315 | </div> |
@@ -119,11 +119,11 @@ discard block |
||
| 119 | 119 | white-space: nowrap; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - <?php $blu_dot_url = plugin_dir_url( dirname( __DIR__ ) ) . 'images/blu-dot.gif'; ?> |
|
| 122 | + <?php $blu_dot_url = plugin_dir_url(dirname(__DIR__)).'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; |
@@ -222,56 +222,56 @@ discard block |
||
| 222 | 222 | |
| 223 | 223 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 224 | 224 | $top_entities = $this->get_top_entities(); |
| 225 | -if ( ! empty( $top_entities ) ) { |
|
| 225 | +if ( ! empty($top_entities)) { |
|
| 226 | 226 | ?> |
| 227 | 227 | <div class="wl-dashboard__block wl-dashboard__block--top-entities"> |
| 228 | 228 | <header> |
| 229 | 229 | <span class="dashicons dashicons-editor-help"></span> |
| 230 | - <h3><?php esc_html_e( 'Top entities', 'wordlift' ); ?></h3> |
|
| 231 | - <span class="wl-dashboard__legend wl-dashboard__legend--entities"><?php echo esc_html( _x( 'Links with entities', 'Dashboard', 'wordlift' ) ); ?></span> |
|
| 232 | - <span class="wl-dashboard__legend wl-dashboard__legend--posts"><?php echo esc_html( _x( 'Post with entities', 'Dashboard', 'wordlift' ) ); ?></span> |
|
| 230 | + <h3><?php esc_html_e('Top entities', 'wordlift'); ?></h3> |
|
| 231 | + <span class="wl-dashboard__legend wl-dashboard__legend--entities"><?php echo esc_html(_x('Links with entities', 'Dashboard', 'wordlift')); ?></span> |
|
| 232 | + <span class="wl-dashboard__legend wl-dashboard__legend--posts"><?php echo esc_html(_x('Post with entities', 'Dashboard', 'wordlift')); ?></span> |
|
| 233 | 233 | </header> |
| 234 | 234 | <div class="wl-dashboard__block__body"> |
| 235 | 235 | <?php |
| 236 | 236 | $max = $top_entities[0]->total; |
| 237 | - $unit = intval( '1' . str_repeat( '0', strlen( $max ) - 1 ) ); |
|
| 238 | - $max_value = ceil( (float) $max / $unit ) * $unit; |
|
| 237 | + $unit = intval('1'.str_repeat('0', strlen($max) - 1)); |
|
| 238 | + $max_value = ceil((float) $max / $unit) * $unit; |
|
| 239 | 239 | $chunk_value = $max_value / 4; |
| 240 | 240 | ?> |
| 241 | 241 | <div></div> |
| 242 | 242 | <div class="wl-dashboard__block__body__table-header"> |
| 243 | - <?php for ( $i = 0; $i <= $max_value; $i += $chunk_value ) { ?> |
|
| 244 | - <span><?php echo esc_html( $i ); ?></span><?php } ?> |
|
| 243 | + <?php for ($i = 0; $i <= $max_value; $i += $chunk_value) { ?> |
|
| 244 | + <span><?php echo esc_html($i); ?></span><?php } ?> |
|
| 245 | 245 | </div> |
| 246 | 246 | <?php |
| 247 | 247 | $i = 0; |
| 248 | 248 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 249 | - foreach ( $this->get_top_entities() as $top_entity ) { |
|
| 250 | - $permalink = get_permalink( $top_entity->ID ); |
|
| 249 | + foreach ($this->get_top_entities() as $top_entity) { |
|
| 250 | + $permalink = get_permalink($top_entity->ID); |
|
| 251 | 251 | $post_title = $top_entity->post_title; |
| 252 | 252 | $entities_100 = 100 * $top_entity->entities / $max_value; |
| 253 | 253 | $posts_100 = 100 * $top_entity->posts / $max_value; |
| 254 | 254 | |
| 255 | 255 | ?> |
| 256 | - <div><a href="<?php echo esc_attr( $permalink ); ?>"><?php echo esc_html( $post_title ); ?></a></div> |
|
| 256 | + <div><a href="<?php echo esc_attr($permalink); ?>"><?php echo esc_html($post_title); ?></a></div> |
|
| 257 | 257 | <div> |
| 258 | 258 | <div class="wl-dashboard__bar wl-dashboard__bar--posts" |
| 259 | - style="width: <?php echo esc_attr( $posts_100 ); ?>%;"> |
|
| 259 | + style="width: <?php echo esc_attr($posts_100); ?>%;"> |
|
| 260 | 260 | </div> |
| 261 | 261 | <div class="wl-dashboard__bar wl-dashboard__bar--entities" |
| 262 | - style="width: <?php echo esc_attr( $entities_100 ); ?>%;"> |
|
| 262 | + style="width: <?php echo esc_attr($entities_100); ?>%;"> |
|
| 263 | 263 | </div> |
| 264 | 264 | </div> |
| 265 | 265 | <?php |
| 266 | - if ( 4 === $i ++ ) { |
|
| 266 | + if (4 === $i++) { |
|
| 267 | 267 | ?> |
| 268 | 268 | <input id="wl-dashboard__show-more" type="checkbox"> |
| 269 | 269 | <label for="wl-dashboard__show-more"> |
| 270 | 270 | <span> |
| 271 | - <?php echo esc_html( __( 'Show more', 'wordlift' ) ); ?> |
|
| 271 | + <?php echo esc_html(__('Show more', 'wordlift')); ?> |
|
| 272 | 272 | </span> |
| 273 | 273 | <span> |
| 274 | - <?php echo esc_html( __( 'Hide', 'wordlift' ) ); ?> |
|
| 274 | + <?php echo esc_html(__('Hide', 'wordlift')); ?> |
|
| 275 | 275 | </span> |
| 276 | 276 | </label> |
| 277 | 277 | <?php |
@@ -283,46 +283,46 @@ discard block |
||
| 283 | 283 | <?php |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | -$not_enriched_url = admin_url( 'edit.php?post_type=post&wl_enriched=no' ); |
|
| 286 | +$not_enriched_url = admin_url('edit.php?post_type=post&wl_enriched=no'); |
|
| 287 | 287 | $dashboard_service = Wordlift_Dashboard_Service::get_instance(); |
| 288 | 288 | ?> |
| 289 | 289 | <div class="wl-dashboard__block wl-dashboard__block--enriched-posts"> |
| 290 | 290 | <header> |
| 291 | 291 | <span class="dashicons dashicons-editor-help"></span> |
| 292 | - <h3><?php echo esc_html__( 'Enriched posts', 'wordlift' ); ?></h3> |
|
| 292 | + <h3><?php echo esc_html__('Enriched posts', 'wordlift'); ?></h3> |
|
| 293 | 293 | </header> |
| 294 | 294 | <div class="wl-dashboard__block__body"> |
| 295 | - <a href="<?php echo esc_url( $not_enriched_url ); ?>"><?php echo esc_html( $dashboard_service->count_annotated_posts() ); ?></a> |
|
| 296 | - / <?php echo esc_html( $dashboard_service->count_posts() ); ?> |
|
| 297 | - <a href="<?php echo esc_url( $not_enriched_url ); ?>"><?php echo esc_html( _x( 'Enrich', 'Dashboard', 'wordlift' ) ); ?></a> |
|
| 295 | + <a href="<?php echo esc_url($not_enriched_url); ?>"><?php echo esc_html($dashboard_service->count_annotated_posts()); ?></a> |
|
| 296 | + / <?php echo esc_html($dashboard_service->count_posts()); ?> |
|
| 297 | + <a href="<?php echo esc_url($not_enriched_url); ?>"><?php echo esc_html(_x('Enrich', 'Dashboard', 'wordlift')); ?></a> |
|
| 298 | 298 | </div> |
| 299 | 299 | </div> |
| 300 | 300 | |
| 301 | -<?php $vocabulary_url = admin_url( 'edit.php?post_type=entity' ); ?> |
|
| 301 | +<?php $vocabulary_url = admin_url('edit.php?post_type=entity'); ?> |
|
| 302 | 302 | <div class="wl-dashboard__block wl-dashboard__block--created-entities"> |
| 303 | 303 | <header> |
| 304 | 304 | <span class="dashicons dashicons-editor-help"></span> |
| 305 | - <h3><?php esc_html_e( 'Created entities', 'wordlift' ); ?></h3> |
|
| 305 | + <h3><?php esc_html_e('Created entities', 'wordlift'); ?></h3> |
|
| 306 | 306 | </header> |
| 307 | 307 | <div class="wl-dashboard__block__body"> |
| 308 | - <a href="<?php echo esc_url( $vocabulary_url ); ?>"> |
|
| 308 | + <a href="<?php echo esc_url($vocabulary_url); ?>"> |
|
| 309 | 309 | <?php |
| 310 | 310 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 311 | - echo esc_html( $this->entity_service->count() ); |
|
| 311 | + echo esc_html($this->entity_service->count()); |
|
| 312 | 312 | ?> |
| 313 | 313 | </a> |
| 314 | - <a href="<?php echo esc_url( $vocabulary_url ); ?>"><?php echo esc_html( _x( 'Vocabulary', 'Dashboard', 'wordlift' ) ); ?></a> |
|
| 314 | + <a href="<?php echo esc_url($vocabulary_url); ?>"><?php echo esc_html(_x('Vocabulary', 'Dashboard', 'wordlift')); ?></a> |
|
| 315 | 315 | </div> |
| 316 | 316 | </div> |
| 317 | 317 | |
| 318 | 318 | <div class="wl-dashboard__block wl-dashboard__block--average-entity-rating"> |
| 319 | 319 | <header> |
| 320 | 320 | <span class="dashicons dashicons-editor-help"></span> |
| 321 | - <h3><?php echo esc_html__( 'Average entity rating', 'wordlift' ); ?></h3> |
|
| 321 | + <h3><?php echo esc_html__('Average entity rating', 'wordlift'); ?></h3> |
|
| 322 | 322 | </header> |
| 323 | 323 | <div class="wl-dashboard__block__body"> |
| 324 | - <?php echo esc_html( $dashboard_service->average_entities_rating() ); ?> |
|
| 325 | - <?php echo esc_html( _x( 'Boost', 'Dashboard', 'wordlift' ) ); ?> |
|
| 324 | + <?php echo esc_html($dashboard_service->average_entities_rating()); ?> |
|
| 325 | + <?php echo esc_html(_x('Boost', 'Dashboard', 'wordlift')); ?> |
|
| 326 | 326 | </div> |
| 327 | 327 | </div> |
| 328 | 328 | <?php |
@@ -333,4 +333,4 @@ discard block |
||
| 333 | 333 | * @author Naveen Muthusamy <[email protected]> |
| 334 | 334 | * Action name : wl_admin_dashboard_widgets |
| 335 | 335 | */ |
| 336 | -do_action( 'wl_admin_dashboard_widgets' ); |
|
| 336 | +do_action('wl_admin_dashboard_widgets'); |
|
@@ -2,17 +2,17 @@ |
||
| 2 | 2 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 3 | 3 | $articles = $this->get_last_wordlift_articles(); ?> |
| 4 | 4 | <div id='news_container'> |
| 5 | - <?php if ( ! empty( $articles['posts_data'] ) ) { ?> |
|
| 6 | - <?php foreach ( $articles['posts_data'] as $key => $item ) { ?> |
|
| 5 | + <?php if ( ! empty($articles['posts_data'])) { ?> |
|
| 6 | + <?php foreach ($articles['posts_data'] as $key => $item) { ?> |
|
| 7 | 7 | <div> |
| 8 | 8 | <a target="_blank" |
| 9 | - href="<?php echo esc_url( $item['post_url'] ); ?>"><?php echo esc_html( $item['post_title'] ); ?></a> |
|
| 10 | - <p><?php echo wp_kses( $item['post_description'], wp_kses_allowed_html( 'post' ) ); ?></p> |
|
| 9 | + href="<?php echo esc_url($item['post_url']); ?>"><?php echo esc_html($item['post_title']); ?></a> |
|
| 10 | + <p><?php echo wp_kses($item['post_description'], wp_kses_allowed_html('post')); ?></p> |
|
| 11 | 11 | </div> |
| 12 | 12 | <?php } ?> |
| 13 | 13 | <?php } ?> |
| 14 | 14 | <div> |
| 15 | 15 | <a href="#" id="max_posts_count_3" |
| 16 | - class="wl_more_posts"><?php echo esc_html__( 'More posts', 'wordlift' ); ?></a> |
|
| 16 | + class="wl_more_posts"><?php echo esc_html__('More posts', 'wordlift'); ?></a> |
|
| 17 | 17 | </div> |
| 18 | 18 | </div> |
@@ -11,10 +11,10 @@ discard block |
||
| 11 | 11 | <?php settings_errors(); ?> |
| 12 | 12 | <form action="options.php" method="post"> |
| 13 | 13 | <?php |
| 14 | - settings_fields( 'wl_analytics_settings' ); |
|
| 15 | - do_settings_sections( 'wl_analytics_settings' ); |
|
| 16 | - submit_button(); |
|
| 17 | - ?> |
|
| 14 | + settings_fields( 'wl_analytics_settings' ); |
|
| 15 | + do_settings_sections( 'wl_analytics_settings' ); |
|
| 16 | + submit_button(); |
|
| 17 | + ?> |
|
| 18 | 18 | </form> |
| 19 | 19 | <div class="info"> |
| 20 | 20 | <b><?php esc_html_e( 'For Google Tag Manager there is additional setup steps needed in the GTM interface. These are the general instructions:', 'wordlift' ); ?></b> |
@@ -22,13 +22,13 @@ discard block |
||
| 22 | 22 | <li><?php esc_html_e( 'You should already have a configuration variable setup to pass data along to your provider. This is assumed to be Google Analytics and a google analytics configuration object. If you don\'t have this setup then set it up now.', 'wordlift' ); ?></li> |
| 23 | 23 | <li> |
| 24 | 24 | <?php |
| 25 | - printf( |
|
| 26 | - /* translators: 1: Variables, 2: Data Layer Variable. */ |
|
| 27 | - esc_html__( 'Visit the GTM dashboard and head to the %1$s menu. Add a new user-defined variable of type %2$s for each of the following items:', 'wordlift' ), |
|
| 28 | - '<b>Variables</b>', |
|
| 29 | - '<i>Data Layer Variable</i>' |
|
| 30 | - ); |
|
| 31 | - ?> |
|
| 25 | + printf( |
|
| 26 | + /* translators: 1: Variables, 2: Data Layer Variable. */ |
|
| 27 | + esc_html__( 'Visit the GTM dashboard and head to the %1$s menu. Add a new user-defined variable of type %2$s for each of the following items:', 'wordlift' ), |
|
| 28 | + '<b>Variables</b>', |
|
| 29 | + '<i>Data Layer Variable</i>' |
|
| 30 | + ); |
|
| 31 | + ?> |
|
| 32 | 32 | <ol> |
| 33 | 33 | <li><i>event</i></li> |
| 34 | 34 | <li><i>wl_event_action</i></li> |
@@ -44,56 +44,56 @@ discard block |
||
| 44 | 44 | </li> |
| 45 | 45 | <li> |
| 46 | 46 | <?php |
| 47 | - printf( |
|
| 48 | - /* translators: 1: Google Analytics Settings. */ |
|
| 49 | - esc_html__( 'Create another variable to pass along the 2 custom dimensions with the type %1$s. For each of the 2 items set the following:', 'wordlift' ), |
|
| 50 | - '<i>Google Analytics Settings</i>' |
|
| 51 | - ); |
|
| 52 | - ?> |
|
| 47 | + printf( |
|
| 48 | + /* translators: 1: Google Analytics Settings. */ |
|
| 49 | + esc_html__( 'Create another variable to pass along the 2 custom dimensions with the type %1$s. For each of the 2 items set the following:', 'wordlift' ), |
|
| 50 | + '<i>Google Analytics Settings</i>' |
|
| 51 | + ); |
|
| 52 | + ?> |
|
| 53 | 53 | <ol> |
| 54 | 54 | <li><?php esc_html_e( 'Set the index to the index of the custom event you want to push this into at Google Analytics, this will usually be a number between 1 and 9.', 'wordlift' ); ?></li> |
| 55 | 55 | <li> |
| 56 | 56 | <?php |
| 57 | - printf( |
|
| 58 | - /* translators: 1: wl_index_uri, 2: wl_index_type. */ |
|
| 59 | - esc_html__( 'Set the values of each one to the %1$s and the %2$s respectively.', 'wordlift' ), |
|
| 60 | - '<i>wl_index_uri</i> - <i>wl_event_uri</i>', |
|
| 61 | - '<i>wl_index_type</i> - <i>wl_event_type</i>' |
|
| 62 | - ); |
|
| 63 | - ?> |
|
| 57 | + printf( |
|
| 58 | + /* translators: 1: wl_index_uri, 2: wl_index_type. */ |
|
| 59 | + esc_html__( 'Set the values of each one to the %1$s and the %2$s respectively.', 'wordlift' ), |
|
| 60 | + '<i>wl_index_uri</i> - <i>wl_event_uri</i>', |
|
| 61 | + '<i>wl_index_type</i> - <i>wl_event_type</i>' |
|
| 62 | + ); |
|
| 63 | + ?> |
|
| 64 | 64 | </li> |
| 65 | 65 | </ol> |
| 66 | 66 | </li> |
| 67 | 67 | <li> |
| 68 | 68 | <?php |
| 69 | - printf( |
|
| 70 | - /* translators: 1: Triggers, 2: Custom Events. */ |
|
| 71 | - esc_html__( 'Go to the %1$s menu and create a new trigger of the type: %2$s.', 'wordlift' ), |
|
| 72 | - '<b>Triggers</b>', |
|
| 73 | - '<i>Custom Event</i>' |
|
| 74 | - ); |
|
| 75 | - ?> |
|
| 69 | + printf( |
|
| 70 | + /* translators: 1: Triggers, 2: Custom Events. */ |
|
| 71 | + esc_html__( 'Go to the %1$s menu and create a new trigger of the type: %2$s.', 'wordlift' ), |
|
| 72 | + '<b>Triggers</b>', |
|
| 73 | + '<i>Custom Event</i>' |
|
| 74 | + ); |
|
| 75 | + ?> |
|
| 76 | 76 | <ol> |
| 77 | 77 | <li> |
| 78 | 78 | |
| 79 | 79 | <?php |
| 80 | - printf( |
|
| 81 | - /* translators: 1: Event name, 2: Mentions. */ |
|
| 82 | - esc_html__( 'In the %1$s field input %2$s.', 'wordlift' ), |
|
| 83 | - '<i>Event name</i>', |
|
| 84 | - '<i>Mentions</i>' |
|
| 85 | - ); |
|
| 86 | - ?> |
|
| 80 | + printf( |
|
| 81 | + /* translators: 1: Event name, 2: Mentions. */ |
|
| 82 | + esc_html__( 'In the %1$s field input %2$s.', 'wordlift' ), |
|
| 83 | + '<i>Event name</i>', |
|
| 84 | + '<i>Mentions</i>' |
|
| 85 | + ); |
|
| 86 | + ?> |
|
| 87 | 87 | </li> |
| 88 | 88 | <li> |
| 89 | 89 | |
| 90 | 90 | <?php |
| 91 | - printf( |
|
| 92 | - /* translators: 1: Some Custom Events. */ |
|
| 93 | - esc_html__( 'Set this to fire on %1$s and in the filter set:', 'wordlift' ), |
|
| 94 | - '<i>Some Custom Events</i>' |
|
| 95 | - ); |
|
| 96 | - ?> |
|
| 91 | + printf( |
|
| 92 | + /* translators: 1: Some Custom Events. */ |
|
| 93 | + esc_html__( 'Set this to fire on %1$s and in the filter set:', 'wordlift' ), |
|
| 94 | + '<i>Some Custom Events</i>' |
|
| 95 | + ); |
|
| 96 | + ?> |
|
| 97 | 97 | <ol> |
| 98 | 98 | <li><i>event_action</i> - <i>equals</i> - <i>Mentions</i>.</li> |
| 99 | 99 | </ol> |
@@ -102,86 +102,86 @@ discard block |
||
| 102 | 102 | </li> |
| 103 | 103 | <li> |
| 104 | 104 | <?php |
| 105 | - printf( |
|
| 106 | - /* translators: 1: Tags. */ |
|
| 107 | - esc_html__( 'Go to the %1$s menu and create a new tag.', 'wordlift' ), |
|
| 108 | - '<b>Tags</b>' |
|
| 109 | - ); |
|
| 110 | - ?> |
|
| 105 | + printf( |
|
| 106 | + /* translators: 1: Tags. */ |
|
| 107 | + esc_html__( 'Go to the %1$s menu and create a new tag.', 'wordlift' ), |
|
| 108 | + '<b>Tags</b>' |
|
| 109 | + ); |
|
| 110 | + ?> |
|
| 111 | 111 | <ol> |
| 112 | 112 | <li> |
| 113 | 113 | |
| 114 | 114 | <?php |
| 115 | - printf( |
|
| 116 | - /* translators: 1: Google Analytics. */ |
|
| 117 | - esc_html__( 'In the tag configuration section choose %1$s. Assuming you have used variable names that match those mentioned enter:', 'wordlift' ), |
|
| 118 | - '<i>Google Analytics - Universal Analytics</i>' |
|
| 119 | - ); |
|
| 120 | - ?> |
|
| 115 | + printf( |
|
| 116 | + /* translators: 1: Google Analytics. */ |
|
| 117 | + esc_html__( 'In the tag configuration section choose %1$s. Assuming you have used variable names that match those mentioned enter:', 'wordlift' ), |
|
| 118 | + '<i>Google Analytics - Universal Analytics</i>' |
|
| 119 | + ); |
|
| 120 | + ?> |
|
| 121 | 121 | <ol> |
| 122 | 122 | <li> |
| 123 | 123 | <?php |
| 124 | - printf( |
|
| 125 | - /* translators: 1: Track Type, 2: Event. */ |
|
| 126 | - esc_html__( 'Set the %1$s to %2$s.', 'wordlift' ), |
|
| 127 | - 'Track Type', |
|
| 128 | - '<i>Event</i>' |
|
| 129 | - ); |
|
| 130 | - ?> |
|
| 124 | + printf( |
|
| 125 | + /* translators: 1: Track Type, 2: Event. */ |
|
| 126 | + esc_html__( 'Set the %1$s to %2$s.', 'wordlift' ), |
|
| 127 | + 'Track Type', |
|
| 128 | + '<i>Event</i>' |
|
| 129 | + ); |
|
| 130 | + ?> |
|
| 131 | 131 | </li> |
| 132 | 132 | <li> |
| 133 | 133 | <?php |
| 134 | - printf( |
|
| 135 | - /* translators: 1: wl_event_category. */ |
|
| 136 | - esc_html__( 'Set Category to %1$s.', 'wordlift' ), |
|
| 137 | - '<i>{{wl_event_category}}</i>' |
|
| 138 | - ); |
|
| 139 | - ?> |
|
| 134 | + printf( |
|
| 135 | + /* translators: 1: wl_event_category. */ |
|
| 136 | + esc_html__( 'Set Category to %1$s.', 'wordlift' ), |
|
| 137 | + '<i>{{wl_event_category}}</i>' |
|
| 138 | + ); |
|
| 139 | + ?> |
|
| 140 | 140 | </li> |
| 141 | 141 | <li> |
| 142 | 142 | <?php |
| 143 | - printf( |
|
| 144 | - /* translators: 1: wl_event_action. */ |
|
| 145 | - esc_html__( 'Set Action to %1$s.', 'wordlift' ), |
|
| 146 | - '<i>{{wl_event_action}}</i>' |
|
| 147 | - ); |
|
| 148 | - ?> |
|
| 143 | + printf( |
|
| 144 | + /* translators: 1: wl_event_action. */ |
|
| 145 | + esc_html__( 'Set Action to %1$s.', 'wordlift' ), |
|
| 146 | + '<i>{{wl_event_action}}</i>' |
|
| 147 | + ); |
|
| 148 | + ?> |
|
| 149 | 149 | </li> |
| 150 | 150 | <li> |
| 151 | 151 | <?php |
| 152 | - printf( |
|
| 153 | - /* translators: 1: wl_event_label. */ |
|
| 154 | - esc_html__( 'Set Label to %1$s.', 'wordlift' ), |
|
| 155 | - '<i>{{wl_event_label}}</i>' |
|
| 156 | - ); |
|
| 157 | - ?> |
|
| 152 | + printf( |
|
| 153 | + /* translators: 1: wl_event_label. */ |
|
| 154 | + esc_html__( 'Set Label to %1$s.', 'wordlift' ), |
|
| 155 | + '<i>{{wl_event_label}}</i>' |
|
| 156 | + ); |
|
| 157 | + ?> |
|
| 158 | 158 | </li> |
| 159 | 159 | <li> |
| 160 | 160 | <?php |
| 161 | - printf( |
|
| 162 | - /* translators: 1: wl_event_value. */ |
|
| 163 | - esc_html__( 'Set Value to %1$s.', 'wordlift' ), |
|
| 164 | - '<i>{{wl_event_value}}</i>' |
|
| 165 | - ); |
|
| 166 | - ?> |
|
| 161 | + printf( |
|
| 162 | + /* translators: 1: wl_event_value. */ |
|
| 163 | + esc_html__( 'Set Value to %1$s.', 'wordlift' ), |
|
| 164 | + '<i>{{wl_event_value}}</i>' |
|
| 165 | + ); |
|
| 166 | + ?> |
|
| 167 | 167 | </li> |
| 168 | 168 | <li> |
| 169 | 169 | <?php |
| 170 | - printf( |
|
| 171 | - /* translators: 1: True. */ |
|
| 172 | - esc_html__( 'Set Non-Interaction Hit to %1$s.', 'wordlift' ), |
|
| 173 | - '<i>True</i>' |
|
| 174 | - ); |
|
| 175 | - ?> |
|
| 170 | + printf( |
|
| 171 | + /* translators: 1: True. */ |
|
| 172 | + esc_html__( 'Set Non-Interaction Hit to %1$s.', 'wordlift' ), |
|
| 173 | + '<i>True</i>' |
|
| 174 | + ); |
|
| 175 | + ?> |
|
| 176 | 176 | </li> |
| 177 | 177 | <li> |
| 178 | 178 | <?php |
| 179 | - printf( |
|
| 180 | - /* translators: 1: Google Analytics Settings. */ |
|
| 181 | - esc_html__( 'Set the %1$s dropdown to the settings object for the Google Analytics tracking.', 'wordlift' ), |
|
| 182 | - '<i>Google Analytics Settings</i>' |
|
| 183 | - ); |
|
| 184 | - ?> |
|
| 179 | + printf( |
|
| 180 | + /* translators: 1: Google Analytics Settings. */ |
|
| 181 | + esc_html__( 'Set the %1$s dropdown to the settings object for the Google Analytics tracking.', 'wordlift' ), |
|
| 182 | + '<i>Google Analytics Settings</i>' |
|
| 183 | + ); |
|
| 184 | + ?> |
|
| 185 | 185 | </li> |
| 186 | 186 | </ol> |
| 187 | 187 | </li> |
@@ -11,20 +11,20 @@ discard block |
||
| 11 | 11 | <?php settings_errors(); ?> |
| 12 | 12 | <form action="options.php" method="post"> |
| 13 | 13 | <?php |
| 14 | - settings_fields( 'wl_analytics_settings' ); |
|
| 15 | - do_settings_sections( 'wl_analytics_settings' ); |
|
| 14 | + settings_fields('wl_analytics_settings'); |
|
| 15 | + do_settings_sections('wl_analytics_settings'); |
|
| 16 | 16 | submit_button(); |
| 17 | 17 | ?> |
| 18 | 18 | </form> |
| 19 | 19 | <div class="info"> |
| 20 | - <b><?php esc_html_e( 'For Google Tag Manager there is additional setup steps needed in the GTM interface. These are the general instructions:', 'wordlift' ); ?></b> |
|
| 20 | + <b><?php esc_html_e('For Google Tag Manager there is additional setup steps needed in the GTM interface. These are the general instructions:', 'wordlift'); ?></b> |
|
| 21 | 21 | <ol> |
| 22 | - <li><?php esc_html_e( 'You should already have a configuration variable setup to pass data along to your provider. This is assumed to be Google Analytics and a google analytics configuration object. If you don\'t have this setup then set it up now.', 'wordlift' ); ?></li> |
|
| 22 | + <li><?php esc_html_e('You should already have a configuration variable setup to pass data along to your provider. This is assumed to be Google Analytics and a google analytics configuration object. If you don\'t have this setup then set it up now.', 'wordlift'); ?></li> |
|
| 23 | 23 | <li> |
| 24 | 24 | <?php |
| 25 | 25 | printf( |
| 26 | 26 | /* translators: 1: Variables, 2: Data Layer Variable. */ |
| 27 | - esc_html__( 'Visit the GTM dashboard and head to the %1$s menu. Add a new user-defined variable of type %2$s for each of the following items:', 'wordlift' ), |
|
| 27 | + esc_html__('Visit the GTM dashboard and head to the %1$s menu. Add a new user-defined variable of type %2$s for each of the following items:', 'wordlift'), |
|
| 28 | 28 | '<b>Variables</b>', |
| 29 | 29 | '<i>Data Layer Variable</i>' |
| 30 | 30 | ); |
@@ -35,10 +35,10 @@ discard block |
||
| 35 | 35 | <li><i>wl_event_category</i></li> |
| 36 | 36 | <li><i>wl_event_label</i></li> |
| 37 | 37 | <li><i>wl_event_value</i></li> |
| 38 | - <li><i>wl_event_uri</i> <?php esc_html_e( '(which is the first custom dimension number the plugin offers)', 'wordlift' ); ?></li> |
|
| 39 | - <li><i>wl_index_uri</i> <?php esc_html_e( '(this is the index number sent to use as the custom dimention for uri)', 'wordlift' ); ?></li> |
|
| 40 | - <li><i>wl_event_type</i> <?php esc_html_e( '(which is the second custom dimension number the plugin offers)', 'wordlift' ); ?></li> |
|
| 41 | - <li><i>wl_index_type</i> <?php esc_html_e( '(this is the index number sent to use as the custom dimention for type)', 'wordlift' ); ?></li> |
|
| 38 | + <li><i>wl_event_uri</i> <?php esc_html_e('(which is the first custom dimension number the plugin offers)', 'wordlift'); ?></li> |
|
| 39 | + <li><i>wl_index_uri</i> <?php esc_html_e('(this is the index number sent to use as the custom dimention for uri)', 'wordlift'); ?></li> |
|
| 40 | + <li><i>wl_event_type</i> <?php esc_html_e('(which is the second custom dimension number the plugin offers)', 'wordlift'); ?></li> |
|
| 41 | + <li><i>wl_index_type</i> <?php esc_html_e('(this is the index number sent to use as the custom dimention for type)', 'wordlift'); ?></li> |
|
| 42 | 42 | |
| 43 | 43 | </ol> |
| 44 | 44 | </li> |
@@ -46,17 +46,17 @@ discard block |
||
| 46 | 46 | <?php |
| 47 | 47 | printf( |
| 48 | 48 | /* translators: 1: Google Analytics Settings. */ |
| 49 | - esc_html__( 'Create another variable to pass along the 2 custom dimensions with the type %1$s. For each of the 2 items set the following:', 'wordlift' ), |
|
| 49 | + esc_html__('Create another variable to pass along the 2 custom dimensions with the type %1$s. For each of the 2 items set the following:', 'wordlift'), |
|
| 50 | 50 | '<i>Google Analytics Settings</i>' |
| 51 | 51 | ); |
| 52 | 52 | ?> |
| 53 | 53 | <ol> |
| 54 | - <li><?php esc_html_e( 'Set the index to the index of the custom event you want to push this into at Google Analytics, this will usually be a number between 1 and 9.', 'wordlift' ); ?></li> |
|
| 54 | + <li><?php esc_html_e('Set the index to the index of the custom event you want to push this into at Google Analytics, this will usually be a number between 1 and 9.', 'wordlift'); ?></li> |
|
| 55 | 55 | <li> |
| 56 | 56 | <?php |
| 57 | 57 | printf( |
| 58 | 58 | /* translators: 1: wl_index_uri, 2: wl_index_type. */ |
| 59 | - esc_html__( 'Set the values of each one to the %1$s and the %2$s respectively.', 'wordlift' ), |
|
| 59 | + esc_html__('Set the values of each one to the %1$s and the %2$s respectively.', 'wordlift'), |
|
| 60 | 60 | '<i>wl_index_uri</i> - <i>wl_event_uri</i>', |
| 61 | 61 | '<i>wl_index_type</i> - <i>wl_event_type</i>' |
| 62 | 62 | ); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | <?php |
| 69 | 69 | printf( |
| 70 | 70 | /* translators: 1: Triggers, 2: Custom Events. */ |
| 71 | - esc_html__( 'Go to the %1$s menu and create a new trigger of the type: %2$s.', 'wordlift' ), |
|
| 71 | + esc_html__('Go to the %1$s menu and create a new trigger of the type: %2$s.', 'wordlift'), |
|
| 72 | 72 | '<b>Triggers</b>', |
| 73 | 73 | '<i>Custom Event</i>' |
| 74 | 74 | ); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | <?php |
| 80 | 80 | printf( |
| 81 | 81 | /* translators: 1: Event name, 2: Mentions. */ |
| 82 | - esc_html__( 'In the %1$s field input %2$s.', 'wordlift' ), |
|
| 82 | + esc_html__('In the %1$s field input %2$s.', 'wordlift'), |
|
| 83 | 83 | '<i>Event name</i>', |
| 84 | 84 | '<i>Mentions</i>' |
| 85 | 85 | ); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | <?php |
| 91 | 91 | printf( |
| 92 | 92 | /* translators: 1: Some Custom Events. */ |
| 93 | - esc_html__( 'Set this to fire on %1$s and in the filter set:', 'wordlift' ), |
|
| 93 | + esc_html__('Set this to fire on %1$s and in the filter set:', 'wordlift'), |
|
| 94 | 94 | '<i>Some Custom Events</i>' |
| 95 | 95 | ); |
| 96 | 96 | ?> |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | <?php |
| 105 | 105 | printf( |
| 106 | 106 | /* translators: 1: Tags. */ |
| 107 | - esc_html__( 'Go to the %1$s menu and create a new tag.', 'wordlift' ), |
|
| 107 | + esc_html__('Go to the %1$s menu and create a new tag.', 'wordlift'), |
|
| 108 | 108 | '<b>Tags</b>' |
| 109 | 109 | ); |
| 110 | 110 | ?> |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | <?php |
| 115 | 115 | printf( |
| 116 | 116 | /* translators: 1: Google Analytics. */ |
| 117 | - esc_html__( 'In the tag configuration section choose %1$s. Assuming you have used variable names that match those mentioned enter:', 'wordlift' ), |
|
| 117 | + esc_html__('In the tag configuration section choose %1$s. Assuming you have used variable names that match those mentioned enter:', 'wordlift'), |
|
| 118 | 118 | '<i>Google Analytics - Universal Analytics</i>' |
| 119 | 119 | ); |
| 120 | 120 | ?> |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | <?php |
| 124 | 124 | printf( |
| 125 | 125 | /* translators: 1: Track Type, 2: Event. */ |
| 126 | - esc_html__( 'Set the %1$s to %2$s.', 'wordlift' ), |
|
| 126 | + esc_html__('Set the %1$s to %2$s.', 'wordlift'), |
|
| 127 | 127 | 'Track Type', |
| 128 | 128 | '<i>Event</i>' |
| 129 | 129 | ); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | <?php |
| 134 | 134 | printf( |
| 135 | 135 | /* translators: 1: wl_event_category. */ |
| 136 | - esc_html__( 'Set Category to %1$s.', 'wordlift' ), |
|
| 136 | + esc_html__('Set Category to %1$s.', 'wordlift'), |
|
| 137 | 137 | '<i>{{wl_event_category}}</i>' |
| 138 | 138 | ); |
| 139 | 139 | ?> |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | <?php |
| 143 | 143 | printf( |
| 144 | 144 | /* translators: 1: wl_event_action. */ |
| 145 | - esc_html__( 'Set Action to %1$s.', 'wordlift' ), |
|
| 145 | + esc_html__('Set Action to %1$s.', 'wordlift'), |
|
| 146 | 146 | '<i>{{wl_event_action}}</i>' |
| 147 | 147 | ); |
| 148 | 148 | ?> |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | <?php |
| 152 | 152 | printf( |
| 153 | 153 | /* translators: 1: wl_event_label. */ |
| 154 | - esc_html__( 'Set Label to %1$s.', 'wordlift' ), |
|
| 154 | + esc_html__('Set Label to %1$s.', 'wordlift'), |
|
| 155 | 155 | '<i>{{wl_event_label}}</i>' |
| 156 | 156 | ); |
| 157 | 157 | ?> |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | <?php |
| 161 | 161 | printf( |
| 162 | 162 | /* translators: 1: wl_event_value. */ |
| 163 | - esc_html__( 'Set Value to %1$s.', 'wordlift' ), |
|
| 163 | + esc_html__('Set Value to %1$s.', 'wordlift'), |
|
| 164 | 164 | '<i>{{wl_event_value}}</i>' |
| 165 | 165 | ); |
| 166 | 166 | ?> |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | <?php |
| 170 | 170 | printf( |
| 171 | 171 | /* translators: 1: True. */ |
| 172 | - esc_html__( 'Set Non-Interaction Hit to %1$s.', 'wordlift' ), |
|
| 172 | + esc_html__('Set Non-Interaction Hit to %1$s.', 'wordlift'), |
|
| 173 | 173 | '<i>True</i>' |
| 174 | 174 | ); |
| 175 | 175 | ?> |
@@ -178,14 +178,14 @@ discard block |
||
| 178 | 178 | <?php |
| 179 | 179 | printf( |
| 180 | 180 | /* translators: 1: Google Analytics Settings. */ |
| 181 | - esc_html__( 'Set the %1$s dropdown to the settings object for the Google Analytics tracking.', 'wordlift' ), |
|
| 181 | + esc_html__('Set the %1$s dropdown to the settings object for the Google Analytics tracking.', 'wordlift'), |
|
| 182 | 182 | '<i>Google Analytics Settings</i>' |
| 183 | 183 | ); |
| 184 | 184 | ?> |
| 185 | 185 | </li> |
| 186 | 186 | </ol> |
| 187 | 187 | </li> |
| 188 | - <li><?php esc_html_e( 'In the triggering tag select the firing trigger you created previously.', 'wordlift' ); ?></li> |
|
| 188 | + <li><?php esc_html_e('In the triggering tag select the firing trigger you created previously.', 'wordlift'); ?></li> |
|
| 189 | 189 | </ol> |
| 190 | 190 | </li> |
| 191 | 191 | </ol> |
@@ -5,32 +5,32 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | if ( isset( $_POST['wordlift_videoobject_settings_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['wordlift_videoobject_settings_nonce'] ) ), 'wordlift_videoobject_settings' ) ) { |
| 7 | 7 | |
| 8 | - if ( isset( $_POST['wordlift_videoobject_youtube_api_key'] ) || isset( $_POST['wordlift_videoobject_vimeo_api_key'] ) ) { |
|
| 8 | + if ( isset( $_POST['wordlift_videoobject_youtube_api_key'] ) || isset( $_POST['wordlift_videoobject_vimeo_api_key'] ) ) { |
|
| 9 | 9 | |
| 10 | - /** |
|
| 11 | - * @todo: does this fields need to be encrypted before saving ? |
|
| 12 | - */ |
|
| 13 | - $youtube_api_key = sanitize_text_field( wp_unslash( (string) $_POST['wordlift_videoobject_youtube_api_key'] ) ); |
|
| 14 | - $vimeo_api_key = sanitize_text_field( wp_unslash( (string) $_POST['wordlift_videoobject_vimeo_api_key'] ) ); |
|
| 10 | + /** |
|
| 11 | + * @todo: does this fields need to be encrypted before saving ? |
|
| 12 | + */ |
|
| 13 | + $youtube_api_key = sanitize_text_field( wp_unslash( (string) $_POST['wordlift_videoobject_youtube_api_key'] ) ); |
|
| 14 | + $vimeo_api_key = sanitize_text_field( wp_unslash( (string) $_POST['wordlift_videoobject_vimeo_api_key'] ) ); |
|
| 15 | 15 | |
| 16 | - if ( $youtube_api_key ) { |
|
| 17 | - update_option( Youtube_Client::get_api_key_option_name(), $youtube_api_key ); |
|
| 18 | - } |
|
| 16 | + if ( $youtube_api_key ) { |
|
| 17 | + update_option( Youtube_Client::get_api_key_option_name(), $youtube_api_key ); |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - if ( $vimeo_api_key ) { |
|
| 21 | - update_option( Vimeo_Client::get_api_key_option_name(), $vimeo_api_key ); |
|
| 22 | - } |
|
| 23 | - } |
|
| 20 | + if ( $vimeo_api_key ) { |
|
| 21 | + update_option( Vimeo_Client::get_api_key_option_name(), $vimeo_api_key ); |
|
| 22 | + } |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - if ( isset( $_POST['wl_enable_video_sitemap'] ) ) { |
|
| 26 | - update_option( '_wl_video_sitemap_generation', 1 ); |
|
| 27 | - // flush the rewrite rules. |
|
| 28 | - flush_rewrite_rules(); |
|
| 29 | - } else { |
|
| 30 | - update_option( '_wl_video_sitemap_generation', 0 ); |
|
| 31 | - // flush the rewrite rules. |
|
| 32 | - flush_rewrite_rules(); |
|
| 33 | - } |
|
| 25 | + if ( isset( $_POST['wl_enable_video_sitemap'] ) ) { |
|
| 26 | + update_option( '_wl_video_sitemap_generation', 1 ); |
|
| 27 | + // flush the rewrite rules. |
|
| 28 | + flush_rewrite_rules(); |
|
| 29 | + } else { |
|
| 30 | + update_option( '_wl_video_sitemap_generation', 0 ); |
|
| 31 | + // flush the rewrite rules. |
|
| 32 | + flush_rewrite_rules(); |
|
| 33 | + } |
|
| 34 | 34 | } |
| 35 | 35 | ?> |
| 36 | 36 | <h1><?php esc_html_e( 'API Settings', 'wordlift' ); ?></h1> |
@@ -43,15 +43,15 @@ discard block |
||
| 43 | 43 | </td> |
| 44 | 44 | <td> |
| 45 | 45 | <?php |
| 46 | - $element = new Wordlift_Admin_Input_Element(); |
|
| 47 | - $element->render( |
|
| 48 | - array( |
|
| 49 | - 'id' => 'wordlift_videoobject_youtube_api_key', |
|
| 50 | - 'name' => 'wordlift_videoobject_youtube_api_key', |
|
| 51 | - 'value' => Youtube_Client::get_api_key(), |
|
| 52 | - ) |
|
| 53 | - ); |
|
| 54 | - ?> |
|
| 46 | + $element = new Wordlift_Admin_Input_Element(); |
|
| 47 | + $element->render( |
|
| 48 | + array( |
|
| 49 | + 'id' => 'wordlift_videoobject_youtube_api_key', |
|
| 50 | + 'name' => 'wordlift_videoobject_youtube_api_key', |
|
| 51 | + 'value' => Youtube_Client::get_api_key(), |
|
| 52 | + ) |
|
| 53 | + ); |
|
| 54 | + ?> |
|
| 55 | 55 | </td> |
| 56 | 56 | <td> |
| 57 | 57 | <a href="https://developers.google.com/youtube/registering_an_application"><?php esc_html_e( 'Click here', 'wordlift' ); ?></a> |
@@ -65,15 +65,15 @@ discard block |
||
| 65 | 65 | </td> |
| 66 | 66 | <td> |
| 67 | 67 | <?php |
| 68 | - $element = new Wordlift_Admin_Input_Element(); |
|
| 69 | - $element->render( |
|
| 70 | - array( |
|
| 71 | - 'id' => 'wordlift_videoobject_vimeo_api_key', |
|
| 72 | - 'name' => 'wordlift_videoobject_vimeo_api_key', |
|
| 73 | - 'value' => Vimeo_Client::get_api_key(), |
|
| 74 | - ) |
|
| 75 | - ); |
|
| 76 | - ?> |
|
| 68 | + $element = new Wordlift_Admin_Input_Element(); |
|
| 69 | + $element->render( |
|
| 70 | + array( |
|
| 71 | + 'id' => 'wordlift_videoobject_vimeo_api_key', |
|
| 72 | + 'name' => 'wordlift_videoobject_vimeo_api_key', |
|
| 73 | + 'value' => Vimeo_Client::get_api_key(), |
|
| 74 | + ) |
|
| 75 | + ); |
|
| 76 | + ?> |
|
| 77 | 77 | </td> |
| 78 | 78 | <td> |
| 79 | 79 | <a href="https://developer.vimeo.com/api/guides/start"><?php esc_html_e( 'Click here', 'wordlift' ); ?></a> |
@@ -92,12 +92,12 @@ discard block |
||
| 92 | 92 | value="1" <?php echo esc_html( $wl_is_sitemap_enabled ); ?> ></p> |
| 93 | 93 | <p> |
| 94 | 94 | <?php |
| 95 | - if ( $wl_is_sitemap_enabled ) { |
|
| 96 | - $wl_sitemap_link = esc_attr( get_home_url( null, 'wl-video-sitemap.xml' ) ); |
|
| 97 | - /* translators: %s: The link to the Video Sitemap. */ |
|
| 98 | - echo wp_kses( sprintf( __( 'Here is <a href="%s">link</a> to your Video Sitemap. Add it now, to Google Search Console.', 'wordlift' ), $wl_sitemap_link ), array( 'a' => array( 'href' => array() ) ) ); |
|
| 99 | - } |
|
| 100 | - ?> |
|
| 95 | + if ( $wl_is_sitemap_enabled ) { |
|
| 96 | + $wl_sitemap_link = esc_attr( get_home_url( null, 'wl-video-sitemap.xml' ) ); |
|
| 97 | + /* translators: %s: The link to the Video Sitemap. */ |
|
| 98 | + echo wp_kses( sprintf( __( 'Here is <a href="%s">link</a> to your Video Sitemap. Add it now, to Google Search Console.', 'wordlift' ), $wl_sitemap_link ), array( 'a' => array( 'href' => array() ) ) ); |
|
| 99 | + } |
|
| 100 | + ?> |
|
| 101 | 101 | </p> |
| 102 | 102 | <?php wp_nonce_field( 'wordlift_videoobject_settings', 'wordlift_videoobject_settings_nonce', false ); ?> |
| 103 | 103 | <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" |
@@ -3,43 +3,43 @@ discard block |
||
| 3 | 3 | use Wordlift\Videoobject\Provider\Client\Vimeo_Client; |
| 4 | 4 | use Wordlift\Videoobject\Provider\Client\Youtube_Client; |
| 5 | 5 | |
| 6 | -if ( isset( $_POST['wordlift_videoobject_settings_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['wordlift_videoobject_settings_nonce'] ) ), 'wordlift_videoobject_settings' ) ) { |
|
| 6 | +if (isset($_POST['wordlift_videoobject_settings_nonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['wordlift_videoobject_settings_nonce'])), 'wordlift_videoobject_settings')) { |
|
| 7 | 7 | |
| 8 | - if ( isset( $_POST['wordlift_videoobject_youtube_api_key'] ) || isset( $_POST['wordlift_videoobject_vimeo_api_key'] ) ) { |
|
| 8 | + if (isset($_POST['wordlift_videoobject_youtube_api_key']) || isset($_POST['wordlift_videoobject_vimeo_api_key'])) { |
|
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * @todo: does this fields need to be encrypted before saving ? |
| 12 | 12 | */ |
| 13 | - $youtube_api_key = sanitize_text_field( wp_unslash( (string) $_POST['wordlift_videoobject_youtube_api_key'] ) ); |
|
| 14 | - $vimeo_api_key = sanitize_text_field( wp_unslash( (string) $_POST['wordlift_videoobject_vimeo_api_key'] ) ); |
|
| 13 | + $youtube_api_key = sanitize_text_field(wp_unslash((string) $_POST['wordlift_videoobject_youtube_api_key'])); |
|
| 14 | + $vimeo_api_key = sanitize_text_field(wp_unslash((string) $_POST['wordlift_videoobject_vimeo_api_key'])); |
|
| 15 | 15 | |
| 16 | - if ( $youtube_api_key ) { |
|
| 17 | - update_option( Youtube_Client::get_api_key_option_name(), $youtube_api_key ); |
|
| 16 | + if ($youtube_api_key) { |
|
| 17 | + update_option(Youtube_Client::get_api_key_option_name(), $youtube_api_key); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - if ( $vimeo_api_key ) { |
|
| 21 | - update_option( Vimeo_Client::get_api_key_option_name(), $vimeo_api_key ); |
|
| 20 | + if ($vimeo_api_key) { |
|
| 21 | + update_option(Vimeo_Client::get_api_key_option_name(), $vimeo_api_key); |
|
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - if ( isset( $_POST['wl_enable_video_sitemap'] ) ) { |
|
| 26 | - update_option( '_wl_video_sitemap_generation', 1 ); |
|
| 25 | + if (isset($_POST['wl_enable_video_sitemap'])) { |
|
| 26 | + update_option('_wl_video_sitemap_generation', 1); |
|
| 27 | 27 | // flush the rewrite rules. |
| 28 | 28 | flush_rewrite_rules(); |
| 29 | 29 | } else { |
| 30 | - update_option( '_wl_video_sitemap_generation', 0 ); |
|
| 30 | + update_option('_wl_video_sitemap_generation', 0); |
|
| 31 | 31 | // flush the rewrite rules. |
| 32 | 32 | flush_rewrite_rules(); |
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | ?> |
| 36 | -<h1><?php esc_html_e( 'API Settings', 'wordlift' ); ?></h1> |
|
| 37 | -<p><?php esc_html_e( 'To let WordLift access metadata from YouTube or Vimeo you will need to add here your API Key.', 'wordlift' ); ?></p> |
|
| 36 | +<h1><?php esc_html_e('API Settings', 'wordlift'); ?></h1> |
|
| 37 | +<p><?php esc_html_e('To let WordLift access metadata from YouTube or Vimeo you will need to add here your API Key.', 'wordlift'); ?></p> |
|
| 38 | 38 | <form method="post"> |
| 39 | 39 | <table> |
| 40 | 40 | <tr> |
| 41 | 41 | <td> |
| 42 | - <?php esc_html_e( 'YouTube API Key', 'wordlift' ); ?> |
|
| 42 | + <?php esc_html_e('YouTube API Key', 'wordlift'); ?> |
|
| 43 | 43 | </td> |
| 44 | 44 | <td> |
| 45 | 45 | <?php |
@@ -54,14 +54,14 @@ discard block |
||
| 54 | 54 | ?> |
| 55 | 55 | </td> |
| 56 | 56 | <td> |
| 57 | - <a href="https://developers.google.com/youtube/registering_an_application"><?php esc_html_e( 'Click here', 'wordlift' ); ?></a> |
|
| 58 | - <?php esc_html_e( ' for instructions on getting your YouTube API Key', 'wordlift' ); ?> |
|
| 57 | + <a href="https://developers.google.com/youtube/registering_an_application"><?php esc_html_e('Click here', 'wordlift'); ?></a> |
|
| 58 | + <?php esc_html_e(' for instructions on getting your YouTube API Key', 'wordlift'); ?> |
|
| 59 | 59 | </td> |
| 60 | 60 | </tr> |
| 61 | 61 | |
| 62 | 62 | <tr> |
| 63 | 63 | <td> |
| 64 | - <?php esc_html_e( 'Vimeo API Key', 'wordlift' ); ?> |
|
| 64 | + <?php esc_html_e('Vimeo API Key', 'wordlift'); ?> |
|
| 65 | 65 | </td> |
| 66 | 66 | <td> |
| 67 | 67 | <?php |
@@ -76,30 +76,30 @@ discard block |
||
| 76 | 76 | ?> |
| 77 | 77 | </td> |
| 78 | 78 | <td> |
| 79 | - <a href="https://developer.vimeo.com/api/guides/start"><?php esc_html_e( 'Click here', 'wordlift' ); ?></a> |
|
| 80 | - <?php esc_html_e( ' for instructions on getting your Vimeo API Key', 'wordlift' ); ?> |
|
| 79 | + <a href="https://developer.vimeo.com/api/guides/start"><?php esc_html_e('Click here', 'wordlift'); ?></a> |
|
| 80 | + <?php esc_html_e(' for instructions on getting your Vimeo API Key', 'wordlift'); ?> |
|
| 81 | 81 | </td> |
| 82 | 82 | </tr> |
| 83 | 83 | |
| 84 | 84 | </table> |
| 85 | - <h1><?php esc_html_e( 'Video Sitemap', 'wordlift' ); ?></h1> |
|
| 85 | + <h1><?php esc_html_e('Video Sitemap', 'wordlift'); ?></h1> |
|
| 86 | 86 | <p> |
| 87 | - <?php esc_html_e( 'The Video Sitemap works like any other XML Sitemap. Search engines will use it to display rich snippets in result pages.', 'wordlift' ); ?> |
|
| 87 | + <?php esc_html_e('The Video Sitemap works like any other XML Sitemap. Search engines will use it to display rich snippets in result pages.', 'wordlift'); ?> |
|
| 88 | 88 | </p> |
| 89 | - <?php $wl_is_sitemap_enabled = esc_attr( get_option( '_wl_video_sitemap_generation', false ) ? 'checked' : '' ); ?> |
|
| 90 | - <p> <?php esc_html_e( 'Enable Video Sitemap', 'wordlift' ); ?> |
|
| 89 | + <?php $wl_is_sitemap_enabled = esc_attr(get_option('_wl_video_sitemap_generation', false) ? 'checked' : ''); ?> |
|
| 90 | + <p> <?php esc_html_e('Enable Video Sitemap', 'wordlift'); ?> |
|
| 91 | 91 | <input type="checkbox" name="wl_enable_video_sitemap" |
| 92 | - value="1" <?php echo esc_html( $wl_is_sitemap_enabled ); ?> ></p> |
|
| 92 | + value="1" <?php echo esc_html($wl_is_sitemap_enabled); ?> ></p> |
|
| 93 | 93 | <p> |
| 94 | 94 | <?php |
| 95 | - if ( $wl_is_sitemap_enabled ) { |
|
| 96 | - $wl_sitemap_link = esc_attr( get_home_url( null, 'wl-video-sitemap.xml' ) ); |
|
| 95 | + if ($wl_is_sitemap_enabled) { |
|
| 96 | + $wl_sitemap_link = esc_attr(get_home_url(null, 'wl-video-sitemap.xml')); |
|
| 97 | 97 | /* translators: %s: The link to the Video Sitemap. */ |
| 98 | - echo wp_kses( sprintf( __( 'Here is <a href="%s">link</a> to your Video Sitemap. Add it now, to Google Search Console.', 'wordlift' ), $wl_sitemap_link ), array( 'a' => array( 'href' => array() ) ) ); |
|
| 98 | + echo wp_kses(sprintf(__('Here is <a href="%s">link</a> to your Video Sitemap. Add it now, to Google Search Console.', 'wordlift'), $wl_sitemap_link), array('a' => array('href' => array()))); |
|
| 99 | 99 | } |
| 100 | 100 | ?> |
| 101 | 101 | </p> |
| 102 | - <?php wp_nonce_field( 'wordlift_videoobject_settings', 'wordlift_videoobject_settings_nonce', false ); ?> |
|
| 102 | + <?php wp_nonce_field('wordlift_videoobject_settings', 'wordlift_videoobject_settings_nonce', false); ?> |
|
| 103 | 103 | <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" |
| 104 | 104 | value="Save Changes"> |
| 105 | 105 | </p> |
@@ -1,63 +1,63 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | $too_complicate_reason_label = sprintf( |
| 3 | - '<a target="_blank" href="%s">%s</a>', |
|
| 4 | - /* translators: the link https://wordlift.io/contact-us/ should be changed to language version of the page */ |
|
| 5 | - esc_attr__( 'https://wordlift.io/contact-us/', 'wordlift' ), |
|
| 6 | - esc_html__( 'Contact Us', 'wordlift' ) |
|
| 3 | + '<a target="_blank" href="%s">%s</a>', |
|
| 4 | + /* translators: the link https://wordlift.io/contact-us/ should be changed to language version of the page */ |
|
| 5 | + esc_attr__( 'https://wordlift.io/contact-us/', 'wordlift' ), |
|
| 6 | + esc_html__( 'Contact Us', 'wordlift' ) |
|
| 7 | 7 | ); |
| 8 | 8 | |
| 9 | 9 | $reasons = array( |
| 10 | - array( |
|
| 11 | - 'id' => 'TOO_COMPLICATED', |
|
| 12 | - 'text' => esc_html__( 'It was too complicated and unclear to me', 'wordlift' ), |
|
| 13 | - 'message' => array( |
|
| 14 | - 'text' => sprintf( |
|
| 15 | - /* translators: %s: Too complicate reason. */ |
|
| 16 | - esc_html__( 'Need help? We are ready to answer your questions. %s', 'wordlift' ), |
|
| 17 | - $too_complicate_reason_label |
|
| 18 | - ), |
|
| 19 | - ), |
|
| 20 | - ), |
|
| 21 | - array( |
|
| 22 | - 'id' => 'NOT_ENOUGH_FEATURES', |
|
| 23 | - 'text' => esc_html__( 'It misses some important feature to me', 'wordlift' ), |
|
| 24 | - 'message' => array( |
|
| 25 | - 'field' => 'text', |
|
| 26 | - 'text' => esc_html__( 'Tell us what this feature is.', 'wordlift' ), |
|
| 27 | - ), |
|
| 28 | - ), |
|
| 29 | - array( |
|
| 30 | - 'id' => 'COSTS_TOO_MUCH', |
|
| 31 | - 'text' => esc_html__( 'It costs too much', 'wordlift' ), |
|
| 32 | - 'message' => array( |
|
| 33 | - 'field' => 'text', |
|
| 34 | - 'text' => esc_html__( 'How much you would like to pay?', 'wordlift' ), |
|
| 35 | - ), |
|
| 36 | - ), |
|
| 37 | - array( |
|
| 38 | - 'id' => 'FOUND_ANOTHER_TOOL', |
|
| 39 | - 'text' => esc_html__( 'I found another tool that I like better', 'wordlift' ), |
|
| 40 | - 'message' => array( |
|
| 41 | - 'field' => 'text', |
|
| 42 | - 'text' => esc_html__( 'Please tell us some more details.', 'wordlift' ), |
|
| 43 | - ), |
|
| 44 | - ), |
|
| 45 | - array( |
|
| 46 | - 'id' => 'I_DONT_USE_IT', |
|
| 47 | - 'text' => esc_html__( 'I\'m not using it right now', 'wordlift' ), |
|
| 48 | - ), |
|
| 49 | - array( |
|
| 50 | - 'id' => 'SOMETHING_DIDNT_WORK', |
|
| 51 | - 'text' => esc_html__( 'Something didn\'t work right', 'wordlift' ), |
|
| 52 | - ), |
|
| 53 | - array( |
|
| 54 | - 'id' => 'ANOTHER_REASON', |
|
| 55 | - 'text' => esc_html__( 'Another reason', 'wordlift' ), |
|
| 56 | - 'message' => array( |
|
| 57 | - 'field' => 'textarea', |
|
| 58 | - 'text' => esc_html__( 'Please tell us the reason so we can improve it.', 'wordlift' ), |
|
| 59 | - ), |
|
| 60 | - ), |
|
| 10 | + array( |
|
| 11 | + 'id' => 'TOO_COMPLICATED', |
|
| 12 | + 'text' => esc_html__( 'It was too complicated and unclear to me', 'wordlift' ), |
|
| 13 | + 'message' => array( |
|
| 14 | + 'text' => sprintf( |
|
| 15 | + /* translators: %s: Too complicate reason. */ |
|
| 16 | + esc_html__( 'Need help? We are ready to answer your questions. %s', 'wordlift' ), |
|
| 17 | + $too_complicate_reason_label |
|
| 18 | + ), |
|
| 19 | + ), |
|
| 20 | + ), |
|
| 21 | + array( |
|
| 22 | + 'id' => 'NOT_ENOUGH_FEATURES', |
|
| 23 | + 'text' => esc_html__( 'It misses some important feature to me', 'wordlift' ), |
|
| 24 | + 'message' => array( |
|
| 25 | + 'field' => 'text', |
|
| 26 | + 'text' => esc_html__( 'Tell us what this feature is.', 'wordlift' ), |
|
| 27 | + ), |
|
| 28 | + ), |
|
| 29 | + array( |
|
| 30 | + 'id' => 'COSTS_TOO_MUCH', |
|
| 31 | + 'text' => esc_html__( 'It costs too much', 'wordlift' ), |
|
| 32 | + 'message' => array( |
|
| 33 | + 'field' => 'text', |
|
| 34 | + 'text' => esc_html__( 'How much you would like to pay?', 'wordlift' ), |
|
| 35 | + ), |
|
| 36 | + ), |
|
| 37 | + array( |
|
| 38 | + 'id' => 'FOUND_ANOTHER_TOOL', |
|
| 39 | + 'text' => esc_html__( 'I found another tool that I like better', 'wordlift' ), |
|
| 40 | + 'message' => array( |
|
| 41 | + 'field' => 'text', |
|
| 42 | + 'text' => esc_html__( 'Please tell us some more details.', 'wordlift' ), |
|
| 43 | + ), |
|
| 44 | + ), |
|
| 45 | + array( |
|
| 46 | + 'id' => 'I_DONT_USE_IT', |
|
| 47 | + 'text' => esc_html__( 'I\'m not using it right now', 'wordlift' ), |
|
| 48 | + ), |
|
| 49 | + array( |
|
| 50 | + 'id' => 'SOMETHING_DIDNT_WORK', |
|
| 51 | + 'text' => esc_html__( 'Something didn\'t work right', 'wordlift' ), |
|
| 52 | + ), |
|
| 53 | + array( |
|
| 54 | + 'id' => 'ANOTHER_REASON', |
|
| 55 | + 'text' => esc_html__( 'Another reason', 'wordlift' ), |
|
| 56 | + 'message' => array( |
|
| 57 | + 'field' => 'textarea', |
|
| 58 | + 'text' => esc_html__( 'Please tell us the reason so we can improve it.', 'wordlift' ), |
|
| 59 | + ), |
|
| 60 | + ), |
|
| 61 | 61 | ); |
| 62 | 62 | ?> |
| 63 | 63 | <div class="wl-modal-deactivation-feedback" style="display: none"> |
@@ -93,15 +93,15 @@ discard block |
||
| 93 | 93 | <?php if ( ! empty( $reason['message'] ) ) : ?> |
| 94 | 94 | <div class="additional-info <?php echo ( ! empty( $reason['message']['field'] ) ) ? 'has-field' : ''; ?>"> |
| 95 | 95 | <?php |
| 96 | - if ( ! empty( $reason['message']['field'] ) ) { |
|
| 97 | - if ( 'text' === $reason['message']['field'] ) { |
|
| 98 | - echo '<input type="text" name="wl-details" class="wl-details"/>'; |
|
| 99 | - } else { |
|
| 100 | - echo '<textarea name="wl-details" class="wl-details"></textarea>'; |
|
| 101 | - } |
|
| 102 | - } |
|
| 103 | - echo wp_kses( wpautop( $reason['message']['text'] ), array( 'p' => array() ) ) |
|
| 104 | - ?> |
|
| 96 | + if ( ! empty( $reason['message']['field'] ) ) { |
|
| 97 | + if ( 'text' === $reason['message']['field'] ) { |
|
| 98 | + echo '<input type="text" name="wl-details" class="wl-details"/>'; |
|
| 99 | + } else { |
|
| 100 | + echo '<textarea name="wl-details" class="wl-details"></textarea>'; |
|
| 101 | + } |
|
| 102 | + } |
|
| 103 | + echo wp_kses( wpautop( $reason['message']['text'] ), array( 'p' => array() ) ) |
|
| 104 | + ?> |
|
| 105 | 105 | </div> |
| 106 | 106 | <?php endif ?> |
| 107 | 107 | </li> |
@@ -112,21 +112,21 @@ discard block |
||
| 112 | 112 | <div class="notes"> |
| 113 | 113 | <p> |
| 114 | 114 | <?php |
| 115 | - echo wp_kses( |
|
| 116 | - sprintf( |
|
| 117 | - /* translators: %s: link to the download your data page. */ |
|
| 118 | - __( 'Important notice: Uninstalling the plugin will delete your vocabulary.<br>Maybe you would like to <a href="%s" target="_blank">download your data</a> first.', 'wordlift' ), |
|
| 119 | - add_query_arg( array( 'page' => 'wl_download_your_data' ), admin_url( 'admin.php' ) ) |
|
| 120 | - ), |
|
| 121 | - array( |
|
| 122 | - 'br' => array(), |
|
| 123 | - 'a' => array( |
|
| 124 | - 'href' => array(), |
|
| 125 | - 'target' => array(), |
|
| 126 | - ), |
|
| 127 | - ) |
|
| 128 | - ); |
|
| 129 | - ?> |
|
| 115 | + echo wp_kses( |
|
| 116 | + sprintf( |
|
| 117 | + /* translators: %s: link to the download your data page. */ |
|
| 118 | + __( 'Important notice: Uninstalling the plugin will delete your vocabulary.<br>Maybe you would like to <a href="%s" target="_blank">download your data</a> first.', 'wordlift' ), |
|
| 119 | + add_query_arg( array( 'page' => 'wl_download_your_data' ), admin_url( 'admin.php' ) ) |
|
| 120 | + ), |
|
| 121 | + array( |
|
| 122 | + 'br' => array(), |
|
| 123 | + 'a' => array( |
|
| 124 | + 'href' => array(), |
|
| 125 | + 'target' => array(), |
|
| 126 | + ), |
|
| 127 | + ) |
|
| 128 | + ); |
|
| 129 | + ?> |
|
| 130 | 130 | </p> |
| 131 | 131 | </div> |
| 132 | 132 | |
@@ -2,60 +2,60 @@ discard block |
||
| 2 | 2 | $too_complicate_reason_label = sprintf( |
| 3 | 3 | '<a target="_blank" href="%s">%s</a>', |
| 4 | 4 | /* translators: the link https://wordlift.io/contact-us/ should be changed to language version of the page */ |
| 5 | - esc_attr__( 'https://wordlift.io/contact-us/', 'wordlift' ), |
|
| 6 | - esc_html__( 'Contact Us', 'wordlift' ) |
|
| 5 | + esc_attr__('https://wordlift.io/contact-us/', 'wordlift'), |
|
| 6 | + esc_html__('Contact Us', 'wordlift') |
|
| 7 | 7 | ); |
| 8 | 8 | |
| 9 | 9 | $reasons = array( |
| 10 | 10 | array( |
| 11 | 11 | 'id' => 'TOO_COMPLICATED', |
| 12 | - 'text' => esc_html__( 'It was too complicated and unclear to me', 'wordlift' ), |
|
| 12 | + 'text' => esc_html__('It was too complicated and unclear to me', 'wordlift'), |
|
| 13 | 13 | 'message' => array( |
| 14 | 14 | 'text' => sprintf( |
| 15 | 15 | /* translators: %s: Too complicate reason. */ |
| 16 | - esc_html__( 'Need help? We are ready to answer your questions. %s', 'wordlift' ), |
|
| 16 | + esc_html__('Need help? We are ready to answer your questions. %s', 'wordlift'), |
|
| 17 | 17 | $too_complicate_reason_label |
| 18 | 18 | ), |
| 19 | 19 | ), |
| 20 | 20 | ), |
| 21 | 21 | array( |
| 22 | 22 | 'id' => 'NOT_ENOUGH_FEATURES', |
| 23 | - 'text' => esc_html__( 'It misses some important feature to me', 'wordlift' ), |
|
| 23 | + 'text' => esc_html__('It misses some important feature to me', 'wordlift'), |
|
| 24 | 24 | 'message' => array( |
| 25 | 25 | 'field' => 'text', |
| 26 | - 'text' => esc_html__( 'Tell us what this feature is.', 'wordlift' ), |
|
| 26 | + 'text' => esc_html__('Tell us what this feature is.', 'wordlift'), |
|
| 27 | 27 | ), |
| 28 | 28 | ), |
| 29 | 29 | array( |
| 30 | 30 | 'id' => 'COSTS_TOO_MUCH', |
| 31 | - 'text' => esc_html__( 'It costs too much', 'wordlift' ), |
|
| 31 | + 'text' => esc_html__('It costs too much', 'wordlift'), |
|
| 32 | 32 | 'message' => array( |
| 33 | 33 | 'field' => 'text', |
| 34 | - 'text' => esc_html__( 'How much you would like to pay?', 'wordlift' ), |
|
| 34 | + 'text' => esc_html__('How much you would like to pay?', 'wordlift'), |
|
| 35 | 35 | ), |
| 36 | 36 | ), |
| 37 | 37 | array( |
| 38 | 38 | 'id' => 'FOUND_ANOTHER_TOOL', |
| 39 | - 'text' => esc_html__( 'I found another tool that I like better', 'wordlift' ), |
|
| 39 | + 'text' => esc_html__('I found another tool that I like better', 'wordlift'), |
|
| 40 | 40 | 'message' => array( |
| 41 | 41 | 'field' => 'text', |
| 42 | - 'text' => esc_html__( 'Please tell us some more details.', 'wordlift' ), |
|
| 42 | + 'text' => esc_html__('Please tell us some more details.', 'wordlift'), |
|
| 43 | 43 | ), |
| 44 | 44 | ), |
| 45 | 45 | array( |
| 46 | 46 | 'id' => 'I_DONT_USE_IT', |
| 47 | - 'text' => esc_html__( 'I\'m not using it right now', 'wordlift' ), |
|
| 47 | + 'text' => esc_html__('I\'m not using it right now', 'wordlift'), |
|
| 48 | 48 | ), |
| 49 | 49 | array( |
| 50 | 50 | 'id' => 'SOMETHING_DIDNT_WORK', |
| 51 | - 'text' => esc_html__( 'Something didn\'t work right', 'wordlift' ), |
|
| 51 | + 'text' => esc_html__('Something didn\'t work right', 'wordlift'), |
|
| 52 | 52 | ), |
| 53 | 53 | array( |
| 54 | 54 | 'id' => 'ANOTHER_REASON', |
| 55 | - 'text' => esc_html__( 'Another reason', 'wordlift' ), |
|
| 55 | + 'text' => esc_html__('Another reason', 'wordlift'), |
|
| 56 | 56 | 'message' => array( |
| 57 | 57 | 'field' => 'textarea', |
| 58 | - 'text' => esc_html__( 'Please tell us the reason so we can improve it.', 'wordlift' ), |
|
| 58 | + 'text' => esc_html__('Please tell us the reason so we can improve it.', 'wordlift'), |
|
| 59 | 59 | ), |
| 60 | 60 | ), |
| 61 | 61 | ); |
@@ -64,43 +64,43 @@ discard block |
||
| 64 | 64 | <div class="wl-modal"> |
| 65 | 65 | <div class="wl-modal-body"> |
| 66 | 66 | <h2> |
| 67 | - <?php esc_html_e( 'We\'re sorry to see you go!', 'wordlift' ); ?> |
|
| 67 | + <?php esc_html_e('We\'re sorry to see you go!', 'wordlift'); ?> |
|
| 68 | 68 | </h2> |
| 69 | 69 | |
| 70 | 70 | <div class="wl-modal-panel active"> |
| 71 | 71 | <h4> |
| 72 | - <?php esc_html_e( 'If you have a moment, please let us know why you are deactivating', 'wordlift' ); ?> |
|
| 72 | + <?php esc_html_e('If you have a moment, please let us know why you are deactivating', 'wordlift'); ?> |
|
| 73 | 73 | : |
| 74 | 74 | </h4> |
| 75 | 75 | |
| 76 | 76 | <ul> |
| 77 | - <?php foreach ( $reasons as $reason ) : ?> |
|
| 78 | - <li class="wl-reason-item <?php echo ( 'I_DONT_USE_IT' === $reason['id'] ) ? 'selected' : ''; ?>"> |
|
| 77 | + <?php foreach ($reasons as $reason) : ?> |
|
| 78 | + <li class="wl-reason-item <?php echo ('I_DONT_USE_IT' === $reason['id']) ? 'selected' : ''; ?>"> |
|
| 79 | 79 | <label> |
| 80 | 80 | <input |
| 81 | 81 | type="radio" |
| 82 | 82 | name="wl-code" |
| 83 | 83 | class="wl-code" |
| 84 | - <?php checked( 'I_DONT_USE_IT', $reason['id'], true ); ?> |
|
| 85 | - value="<?php echo esc_attr( $reason['id'] ); ?>" |
|
| 84 | + <?php checked('I_DONT_USE_IT', $reason['id'], true); ?> |
|
| 85 | + value="<?php echo esc_attr($reason['id']); ?>" |
|
| 86 | 86 | /> |
| 87 | 87 | |
| 88 | 88 | <span class="description"> |
| 89 | - <?php echo esc_html( $reason['text'] ); ?> |
|
| 89 | + <?php echo esc_html($reason['text']); ?> |
|
| 90 | 90 | </span> |
| 91 | 91 | </label> |
| 92 | 92 | |
| 93 | - <?php if ( ! empty( $reason['message'] ) ) : ?> |
|
| 94 | - <div class="additional-info <?php echo ( ! empty( $reason['message']['field'] ) ) ? 'has-field' : ''; ?>"> |
|
| 93 | + <?php if ( ! empty($reason['message'])) : ?> |
|
| 94 | + <div class="additional-info <?php echo ( ! empty($reason['message']['field'])) ? 'has-field' : ''; ?>"> |
|
| 95 | 95 | <?php |
| 96 | - if ( ! empty( $reason['message']['field'] ) ) { |
|
| 97 | - if ( 'text' === $reason['message']['field'] ) { |
|
| 96 | + if ( ! empty($reason['message']['field'])) { |
|
| 97 | + if ('text' === $reason['message']['field']) { |
|
| 98 | 98 | echo '<input type="text" name="wl-details" class="wl-details"/>'; |
| 99 | 99 | } else { |
| 100 | 100 | echo '<textarea name="wl-details" class="wl-details"></textarea>'; |
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | - echo wp_kses( wpautop( $reason['message']['text'] ), array( 'p' => array() ) ) |
|
| 103 | + echo wp_kses(wpautop($reason['message']['text']), array('p' => array())) |
|
| 104 | 104 | ?> |
| 105 | 105 | </div> |
| 106 | 106 | <?php endif ?> |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | echo wp_kses( |
| 116 | 116 | sprintf( |
| 117 | 117 | /* translators: %s: link to the download your data page. */ |
| 118 | - __( 'Important notice: Uninstalling the plugin will delete your vocabulary.<br>Maybe you would like to <a href="%s" target="_blank">download your data</a> first.', 'wordlift' ), |
|
| 119 | - add_query_arg( array( 'page' => 'wl_download_your_data' ), admin_url( 'admin.php' ) ) |
|
| 118 | + __('Important notice: Uninstalling the plugin will delete your vocabulary.<br>Maybe you would like to <a href="%s" target="_blank">download your data</a> first.', 'wordlift'), |
|
| 119 | + add_query_arg(array('page' => 'wl_download_your_data'), admin_url('admin.php')) |
|
| 120 | 120 | ), |
| 121 | 121 | array( |
| 122 | 122 | 'br' => array(), |
@@ -135,11 +135,11 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | <div class="wl-modal-footer"> |
| 137 | 137 | <a href="#" class="button button-secondary wl-modal-button-close"> |
| 138 | - <?php esc_html_e( 'Cancel', 'wordlift' ); ?> |
|
| 138 | + <?php esc_html_e('Cancel', 'wordlift'); ?> |
|
| 139 | 139 | </a> |
| 140 | 140 | |
| 141 | 141 | <a href="#" class="button button-primary wl-modal-button-deactivate"> |
| 142 | - <?php esc_html_e( 'Deactivate', 'wordlift' ); ?> |
|
| 142 | + <?php esc_html_e('Deactivate', 'wordlift'); ?> |
|
| 143 | 143 | </a> |
| 144 | 144 | <div class="clear"></div> |
| 145 | 145 | </div> |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | type="hidden" |
| 149 | 149 | name="wl_deactivation_feedback_nonce" |
| 150 | 150 | class="wl_deactivation_feedback_nonce" |
| 151 | - value="<?php echo esc_attr( wp_create_nonce( 'wl_deactivation_feedback_nonce' ) ); ?>" |
|
| 151 | + value="<?php echo esc_attr(wp_create_nonce('wl_deactivation_feedback_nonce')); ?>" |
|
| 152 | 152 | > |
| 153 | 153 | </div> |
| 154 | 154 | </div> |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | if ( ! defined( 'ABSPATH' ) ) { |
| 15 | - exit; |
|
| 15 | + exit; |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | // Get a list of tabs filtered in by the classes that want to add them. |
@@ -20,12 +20,12 @@ discard block |
||
| 20 | 20 | // Generate a list of valid tabs that we could have to validate the input against. |
| 21 | 21 | $valid_tabs = array(); |
| 22 | 22 | foreach ( $admin_tabs as $admin_tab ) { |
| 23 | - $valid_tabs[] = $admin_tab['slug']; |
|
| 23 | + $valid_tabs[] = $admin_tab['slug']; |
|
| 24 | 24 | } |
| 25 | 25 | $input_tab = filter_input( INPUT_GET, 'tab' ); |
| 26 | 26 | $current_tab = ( in_array( $input_tab, $valid_tabs, true ) ) |
| 27 | - ? $input_tab |
|
| 28 | - : 'general'; |
|
| 27 | + ? $input_tab |
|
| 28 | + : 'general'; |
|
| 29 | 29 | |
| 30 | 30 | ?> |
| 31 | 31 | |
@@ -35,13 +35,13 @@ discard block |
||
| 35 | 35 | <a class="nav-tab<?php echo 'general' === $current_tab ? ' nav-tab-active' : ''; ?>" |
| 36 | 36 | href="<?php echo esc_html( admin_url( 'admin.php?page=wl_configuration_admin_menu' ) ); ?>"><?php echo esc_html( __( 'General', 'wordlift' ) ); ?></a> |
| 37 | 37 | <?php |
| 38 | - foreach ( $admin_tabs as $admin_tab ) { |
|
| 39 | - ?> |
|
| 38 | + foreach ( $admin_tabs as $admin_tab ) { |
|
| 39 | + ?> |
|
| 40 | 40 | <a class="nav-tab<?php echo esc_attr( $admin_tab['slug'] === $current_tab ? ' nav-tab-active' : '' ); ?>" |
| 41 | 41 | href="<?php echo esc_url( admin_url( 'admin.php?page=wl_configuration_admin_menu&tab=' . $admin_tab['slug'] ) ); ?>"><?php echo esc_html( $admin_tab['title'] ); ?></a> |
| 42 | 42 | <?php |
| 43 | - } |
|
| 44 | - ?> |
|
| 43 | + } |
|
| 44 | + ?> |
|
| 45 | 45 | </h2> |
| 46 | 46 | |
| 47 | 47 | <?php require plugin_dir_path( __DIR__ ) . "partials/wordlift-admin-settings-$current_tab-page.php"; ?> |
@@ -11,39 +11,39 @@ |
||
| 11 | 11 | * @package Wordlift/admin |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 14 | +if ( ! defined('ABSPATH')) { |
|
| 15 | 15 | exit; |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | // Get a list of tabs filtered in by the classes that want to add them. |
| 19 | -$admin_tabs = apply_filters( 'wl_admin_page_tabs', array() ); |
|
| 19 | +$admin_tabs = apply_filters('wl_admin_page_tabs', array()); |
|
| 20 | 20 | // Generate a list of valid tabs that we could have to validate the input against. |
| 21 | 21 | $valid_tabs = array(); |
| 22 | -foreach ( $admin_tabs as $admin_tab ) { |
|
| 22 | +foreach ($admin_tabs as $admin_tab) { |
|
| 23 | 23 | $valid_tabs[] = $admin_tab['slug']; |
| 24 | 24 | } |
| 25 | -$input_tab = filter_input( INPUT_GET, 'tab' ); |
|
| 26 | -$current_tab = ( in_array( $input_tab, $valid_tabs, true ) ) |
|
| 25 | +$input_tab = filter_input(INPUT_GET, 'tab'); |
|
| 26 | +$current_tab = (in_array($input_tab, $valid_tabs, true)) |
|
| 27 | 27 | ? $input_tab |
| 28 | 28 | : 'general'; |
| 29 | 29 | |
| 30 | 30 | ?> |
| 31 | 31 | |
| 32 | 32 | <div class="wrap" id="wl-settings-page"> |
| 33 | - <h2><?php esc_html_e( 'WordLift Settings', 'wordlift' ); ?></h2> |
|
| 33 | + <h2><?php esc_html_e('WordLift Settings', 'wordlift'); ?></h2> |
|
| 34 | 34 | <h2 class="nav-tab-wrapper"> |
| 35 | 35 | <a class="nav-tab<?php echo 'general' === $current_tab ? ' nav-tab-active' : ''; ?>" |
| 36 | - href="<?php echo esc_html( admin_url( 'admin.php?page=wl_configuration_admin_menu' ) ); ?>"><?php echo esc_html( __( 'General', 'wordlift' ) ); ?></a> |
|
| 36 | + href="<?php echo esc_html(admin_url('admin.php?page=wl_configuration_admin_menu')); ?>"><?php echo esc_html(__('General', 'wordlift')); ?></a> |
|
| 37 | 37 | <?php |
| 38 | - foreach ( $admin_tabs as $admin_tab ) { |
|
| 38 | + foreach ($admin_tabs as $admin_tab) { |
|
| 39 | 39 | ?> |
| 40 | - <a class="nav-tab<?php echo esc_attr( $admin_tab['slug'] === $current_tab ? ' nav-tab-active' : '' ); ?>" |
|
| 41 | - href="<?php echo esc_url( admin_url( 'admin.php?page=wl_configuration_admin_menu&tab=' . $admin_tab['slug'] ) ); ?>"><?php echo esc_html( $admin_tab['title'] ); ?></a> |
|
| 40 | + <a class="nav-tab<?php echo esc_attr($admin_tab['slug'] === $current_tab ? ' nav-tab-active' : ''); ?>" |
|
| 41 | + href="<?php echo esc_url(admin_url('admin.php?page=wl_configuration_admin_menu&tab='.$admin_tab['slug'])); ?>"><?php echo esc_html($admin_tab['title']); ?></a> |
|
| 42 | 42 | <?php |
| 43 | 43 | } |
| 44 | 44 | ?> |
| 45 | 45 | </h2> |
| 46 | 46 | |
| 47 | - <?php require plugin_dir_path( __DIR__ ) . "partials/wordlift-admin-settings-$current_tab-page.php"; ?> |
|
| 47 | + <?php require plugin_dir_path(__DIR__)."partials/wordlift-admin-settings-$current_tab-page.php"; ?> |
|
| 48 | 48 | |
| 49 | 49 | </div> |
@@ -16,49 +16,49 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | <?php |
| 18 | 18 | |
| 19 | - // Enqueue wp.media functions. |
|
| 20 | - wp_enqueue_media(); |
|
| 19 | + // Enqueue wp.media functions. |
|
| 20 | + wp_enqueue_media(); |
|
| 21 | 21 | |
| 22 | - // Enqueue styles and scripts. |
|
| 23 | - wp_enqueue_style( 'wl-font-awesome', plugin_dir_url( dirname( __DIR__ ) ) . 'css/font-awesome.min.css', array(), WORDLIFT_VERSION ); |
|
| 24 | - wp_enqueue_style( |
|
| 25 | - 'wordlift-admin-setup', |
|
| 26 | - plugin_dir_url( __DIR__ ) . 'css/wordlift-admin-setup.css', |
|
| 27 | - array( |
|
| 28 | - 'wp-admin', |
|
| 29 | - 'wl-font-awesome', |
|
| 30 | - ), |
|
| 31 | - WORDLIFT_VERSION |
|
| 32 | - ); |
|
| 33 | - wp_enqueue_script( 'wordlift-admin-setup', plugin_dir_url( __DIR__ ) . 'js/1/setup.js', array( 'jquery' ), WORDLIFT_VERSION, false ); |
|
| 22 | + // Enqueue styles and scripts. |
|
| 23 | + wp_enqueue_style( 'wl-font-awesome', plugin_dir_url( dirname( __DIR__ ) ) . 'css/font-awesome.min.css', array(), WORDLIFT_VERSION ); |
|
| 24 | + wp_enqueue_style( |
|
| 25 | + 'wordlift-admin-setup', |
|
| 26 | + plugin_dir_url( __DIR__ ) . 'css/wordlift-admin-setup.css', |
|
| 27 | + array( |
|
| 28 | + 'wp-admin', |
|
| 29 | + 'wl-font-awesome', |
|
| 30 | + ), |
|
| 31 | + WORDLIFT_VERSION |
|
| 32 | + ); |
|
| 33 | + wp_enqueue_script( 'wordlift-admin-setup', plugin_dir_url( __DIR__ ) . 'js/1/setup.js', array( 'jquery' ), WORDLIFT_VERSION, false ); |
|
| 34 | 34 | |
| 35 | - // Get wp_permalink structure |
|
| 36 | - $permalink_structure = get_option( 'permalink_structure' ); |
|
| 35 | + // Get wp_permalink structure |
|
| 36 | + $permalink_structure = get_option( 'permalink_structure' ); |
|
| 37 | 37 | |
| 38 | - // Set configuration settings. |
|
| 39 | - wp_localize_script( |
|
| 40 | - 'wordlift-admin-setup', |
|
| 41 | - '_wlAdminSetup', |
|
| 42 | - array( |
|
| 43 | - 'ajaxUrl' => wp_parse_url( self_admin_url( 'admin-ajax.php' ), PHP_URL_PATH ), |
|
| 44 | - 'action' => 'wl_validate_key', |
|
| 45 | - 'permalink' => $permalink_structure, |
|
| 46 | - 'media' => array( |
|
| 47 | - 'title' => __( 'WordLift Choose Logo', 'wordlift' ), |
|
| 48 | - 'button' => array( 'text' => __( 'Choose Logo', 'wordlift' ) ), |
|
| 49 | - ), |
|
| 50 | - ) |
|
| 51 | - ); |
|
| 38 | + // Set configuration settings. |
|
| 39 | + wp_localize_script( |
|
| 40 | + 'wordlift-admin-setup', |
|
| 41 | + '_wlAdminSetup', |
|
| 42 | + array( |
|
| 43 | + 'ajaxUrl' => wp_parse_url( self_admin_url( 'admin-ajax.php' ), PHP_URL_PATH ), |
|
| 44 | + 'action' => 'wl_validate_key', |
|
| 45 | + 'permalink' => $permalink_structure, |
|
| 46 | + 'media' => array( |
|
| 47 | + 'title' => __( 'WordLift Choose Logo', 'wordlift' ), |
|
| 48 | + 'button' => array( 'text' => __( 'Choose Logo', 'wordlift' ) ), |
|
| 49 | + ), |
|
| 50 | + ) |
|
| 51 | + ); |
|
| 52 | 52 | |
| 53 | - // Finally print styles and scripts. |
|
| 54 | - do_action( 'admin_print_scripts' ); |
|
| 55 | - wp_print_styles(); |
|
| 56 | - wp_print_scripts(); |
|
| 53 | + // Finally print styles and scripts. |
|
| 54 | + do_action( 'admin_print_scripts' ); |
|
| 55 | + wp_print_styles(); |
|
| 56 | + wp_print_scripts(); |
|
| 57 | 57 | |
| 58 | - for ( $i = 1; $i <= 6; $i ++ ) { |
|
| 59 | - include 'admin-setup/step-' . $i . '.php'; |
|
| 60 | - } |
|
| 61 | - ?> |
|
| 58 | + for ( $i = 1; $i <= 6; $i ++ ) { |
|
| 59 | + include 'admin-setup/step-' . $i . '.php'; |
|
| 60 | + } |
|
| 61 | + ?> |
|
| 62 | 62 | </head> |
| 63 | 63 | <body> |
| 64 | 64 | |
@@ -82,10 +82,10 @@ discard block |
||
| 82 | 82 | <div class="viewport"></div> |
| 83 | 83 | </form> |
| 84 | 84 | <?php |
| 85 | - if ( function_exists( 'wp_print_media_templates' ) ) { |
|
| 86 | - wp_print_media_templates(); |
|
| 87 | - } |
|
| 88 | - ?> |
|
| 85 | + if ( function_exists( 'wp_print_media_templates' ) ) { |
|
| 86 | + wp_print_media_templates(); |
|
| 87 | + } |
|
| 88 | + ?> |
|
| 89 | 89 | </div> |
| 90 | 90 | |
| 91 | 91 | </body> |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | <!-- Defining responsive ambient. --> |
| 13 | 13 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 14 | 14 | |
| 15 | - <title><?php esc_html_e( 'WordLift Setup', 'wordlift' ); ?></title> |
|
| 15 | + <title><?php esc_html_e('WordLift Setup', 'wordlift'); ?></title> |
|
| 16 | 16 | |
| 17 | 17 | <?php |
| 18 | 18 | |
@@ -20,43 +20,43 @@ discard block |
||
| 20 | 20 | wp_enqueue_media(); |
| 21 | 21 | |
| 22 | 22 | // Enqueue styles and scripts. |
| 23 | - wp_enqueue_style( 'wl-font-awesome', plugin_dir_url( dirname( __DIR__ ) ) . 'css/font-awesome.min.css', array(), WORDLIFT_VERSION ); |
|
| 23 | + wp_enqueue_style('wl-font-awesome', plugin_dir_url(dirname(__DIR__)).'css/font-awesome.min.css', array(), WORDLIFT_VERSION); |
|
| 24 | 24 | wp_enqueue_style( |
| 25 | 25 | 'wordlift-admin-setup', |
| 26 | - plugin_dir_url( __DIR__ ) . 'css/wordlift-admin-setup.css', |
|
| 26 | + plugin_dir_url(__DIR__).'css/wordlift-admin-setup.css', |
|
| 27 | 27 | array( |
| 28 | 28 | 'wp-admin', |
| 29 | 29 | 'wl-font-awesome', |
| 30 | 30 | ), |
| 31 | 31 | WORDLIFT_VERSION |
| 32 | 32 | ); |
| 33 | - wp_enqueue_script( 'wordlift-admin-setup', plugin_dir_url( __DIR__ ) . 'js/1/setup.js', array( 'jquery' ), WORDLIFT_VERSION, false ); |
|
| 33 | + wp_enqueue_script('wordlift-admin-setup', plugin_dir_url(__DIR__).'js/1/setup.js', array('jquery'), WORDLIFT_VERSION, false); |
|
| 34 | 34 | |
| 35 | 35 | // Get wp_permalink structure |
| 36 | - $permalink_structure = get_option( 'permalink_structure' ); |
|
| 36 | + $permalink_structure = get_option('permalink_structure'); |
|
| 37 | 37 | |
| 38 | 38 | // Set configuration settings. |
| 39 | 39 | wp_localize_script( |
| 40 | 40 | 'wordlift-admin-setup', |
| 41 | 41 | '_wlAdminSetup', |
| 42 | 42 | array( |
| 43 | - 'ajaxUrl' => wp_parse_url( self_admin_url( 'admin-ajax.php' ), PHP_URL_PATH ), |
|
| 43 | + 'ajaxUrl' => wp_parse_url(self_admin_url('admin-ajax.php'), PHP_URL_PATH), |
|
| 44 | 44 | 'action' => 'wl_validate_key', |
| 45 | 45 | 'permalink' => $permalink_structure, |
| 46 | 46 | 'media' => array( |
| 47 | - 'title' => __( 'WordLift Choose Logo', 'wordlift' ), |
|
| 48 | - 'button' => array( 'text' => __( 'Choose Logo', 'wordlift' ) ), |
|
| 47 | + 'title' => __('WordLift Choose Logo', 'wordlift'), |
|
| 48 | + 'button' => array('text' => __('Choose Logo', 'wordlift')), |
|
| 49 | 49 | ), |
| 50 | 50 | ) |
| 51 | 51 | ); |
| 52 | 52 | |
| 53 | 53 | // Finally print styles and scripts. |
| 54 | - do_action( 'admin_print_scripts' ); |
|
| 54 | + do_action('admin_print_scripts'); |
|
| 55 | 55 | wp_print_styles(); |
| 56 | 56 | wp_print_scripts(); |
| 57 | 57 | |
| 58 | - for ( $i = 1; $i <= 6; $i ++ ) { |
|
| 59 | - include 'admin-setup/step-' . $i . '.php'; |
|
| 58 | + for ($i = 1; $i <= 6; $i++) { |
|
| 59 | + include 'admin-setup/step-'.$i.'.php'; |
|
| 60 | 60 | } |
| 61 | 61 | ?> |
| 62 | 62 | </head> |
@@ -64,25 +64,25 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | <div class="wl-container"> |
| 66 | 66 | |
| 67 | - <a href="<?php echo esc_url( admin_url() ); ?>" |
|
| 67 | + <a href="<?php echo esc_url(admin_url()); ?>" |
|
| 68 | 68 | class="fa fa-times wl-close"></a> |
| 69 | 69 | |
| 70 | 70 | <header> |
| 71 | 71 | <h1><img class="wizard-logo" |
| 72 | - src="<?php echo esc_attr( plugin_dir_url( dirname( __DIR__ ) ) . 'images/logo-wl-transparent-240x90.png' ); ?>"/> |
|
| 72 | + src="<?php echo esc_attr(plugin_dir_url(dirname(__DIR__)).'images/logo-wl-transparent-240x90.png'); ?>"/> |
|
| 73 | 73 | </h1> |
| 74 | 74 | <img class="shapes" |
| 75 | - src="<?php echo esc_attr( plugin_dir_url( dirname( __DIR__ ) ) . 'images/shapes.png' ); ?>"/> |
|
| 75 | + src="<?php echo esc_attr(plugin_dir_url(dirname(__DIR__)).'images/shapes.png'); ?>"/> |
|
| 76 | 76 | </header> |
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | <form method="post"> |
| 80 | - <?php wp_nonce_field( 'wl-save-configuration' ); ?> |
|
| 80 | + <?php wp_nonce_field('wl-save-configuration'); ?> |
|
| 81 | 81 | <input type="hidden" name="action" value="wl-save-configuration"/> |
| 82 | 82 | <div class="viewport"></div> |
| 83 | 83 | </form> |
| 84 | 84 | <?php |
| 85 | - if ( function_exists( 'wp_print_media_templates' ) ) { |
|
| 85 | + if (function_exists('wp_print_media_templates')) { |
|
| 86 | 86 | wp_print_media_templates(); |
| 87 | 87 | } |
| 88 | 88 | ?> |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | - exit; |
|
| 14 | + exit; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 21 | 21 | $term_settings = $settings !== null ? $settings : array( |
| 22 | - 'title' => '', |
|
| 23 | - 'description' => '', |
|
| 22 | + 'title' => '', |
|
| 23 | + 'description' => '', |
|
| 24 | 24 | ); |
| 25 | 25 | |
| 26 | 26 | ?> |
@@ -33,36 +33,36 @@ discard block |
||
| 33 | 33 | <input type="hidden" name="tag_ID" |
| 34 | 34 | value=" |
| 35 | 35 | <?php |
| 36 | - // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
|
| 37 | - echo esc_attr( $term_id ); |
|
| 38 | - ?> |
|
| 36 | + // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
|
| 37 | + echo esc_attr( $term_id ); |
|
| 38 | + ?> |
|
| 39 | 39 | " /> |
| 40 | 40 | <input type="hidden" name="action" value="wl_edit_entity_type_term" /> |
| 41 | 41 | <?php |
| 42 | - // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
|
| 43 | - wp_nonce_field( 'update-entity_type_term_' . $term_id ); |
|
| 44 | - ?> |
|
| 42 | + // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
|
| 43 | + wp_nonce_field( 'update-entity_type_term_' . $term_id ); |
|
| 44 | + ?> |
|
| 45 | 45 | <table class="form-table"> |
| 46 | 46 | <tr class="form-field form-required term-name-wrap"> |
| 47 | 47 | <th scope="row"> |
| 48 | 48 | <label> |
| 49 | 49 | <?php |
| 50 | - esc_html_e( 'Name', 'wordlift' ); |
|
| 51 | - ?> |
|
| 50 | + esc_html_e( 'Name', 'wordlift' ); |
|
| 51 | + ?> |
|
| 52 | 52 | </label> |
| 53 | 53 | </th> |
| 54 | 54 | <td> |
| 55 | 55 | <?php |
| 56 | - echo esc_html( $current_term->name ) |
|
| 57 | - ?> |
|
| 56 | + echo esc_html( $current_term->name ) |
|
| 57 | + ?> |
|
| 58 | 58 | </td> |
| 59 | 59 | </tr> |
| 60 | 60 | <tr class="form-field form-required term-name-wrap"> |
| 61 | 61 | <th scope="row"> |
| 62 | 62 | <label for="title"> |
| 63 | 63 | <?php |
| 64 | - esc_html_e( 'Title', 'wordlift' ); |
|
| 65 | - ?> |
|
| 64 | + esc_html_e( 'Title', 'wordlift' ); |
|
| 65 | + ?> |
|
| 66 | 66 | </label> |
| 67 | 67 | </th> |
| 68 | 68 | <td><input name="title" id="title" type="text" |
@@ -70,24 +70,24 @@ discard block |
||
| 70 | 70 | size="40" /> |
| 71 | 71 | <p class="description"> |
| 72 | 72 | <?php |
| 73 | - esc_html_e( 'The HTML title to be used in the entity type archive page.', 'wordlift' ); |
|
| 74 | - ?> |
|
| 73 | + esc_html_e( 'The HTML title to be used in the entity type archive page.', 'wordlift' ); |
|
| 74 | + ?> |
|
| 75 | 75 | </p> |
| 76 | 76 | </td> |
| 77 | 77 | </tr> |
| 78 | 78 | <tr class="form-field term-description-wrap"> |
| 79 | 79 | <th scope="row"><label for="description"> |
| 80 | 80 | <?php |
| 81 | - esc_html_e( 'Description', 'wordlift' ); |
|
| 82 | - ?> |
|
| 81 | + esc_html_e( 'Description', 'wordlift' ); |
|
| 82 | + ?> |
|
| 83 | 83 | </label> |
| 84 | 84 | </th> |
| 85 | 85 | <td><textarea name="description" id="description" rows="5" |
| 86 | 86 | cols="50" class="large-text"><?php echo esc_html( $term_settings['description'] ); ?></textarea> |
| 87 | 87 | <p class="description"> |
| 88 | 88 | <?php |
| 89 | - esc_html_e( 'The description to be used in the entity type archive page.', 'wordlift' ); |
|
| 90 | - ?> |
|
| 89 | + esc_html_e( 'The description to be used in the entity type archive page.', 'wordlift' ); |
|
| 90 | + ?> |
|
| 91 | 91 | </p> |
| 92 | 92 | </td> |
| 93 | 93 | </tr> |
@@ -10,12 +10,12 @@ discard block |
||
| 10 | 10 | * @subpackage Wordlift/admin/partials |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 18 | -$current_term = get_term( $term_id, 'wl_entity_type' ); |
|
| 18 | +$current_term = get_term($term_id, 'wl_entity_type'); |
|
| 19 | 19 | |
| 20 | 20 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 21 | 21 | $term_settings = $settings !== null ? $settings : array( |
@@ -25,35 +25,35 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | ?> |
| 27 | 27 | <div class="wrap"> |
| 28 | - <h1><?php esc_html_e( 'Edit Entity Type', 'wordlift' ); ?></h1> |
|
| 28 | + <h1><?php esc_html_e('Edit Entity Type', 'wordlift'); ?></h1> |
|
| 29 | 29 | |
| 30 | 30 | <form name="edittag" id="edittag" method="post" |
| 31 | - action="<?php echo esc_html( admin_url( 'admin.php?page=wl_entity_type_settings' ) ); ?>" |
|
| 31 | + action="<?php echo esc_html(admin_url('admin.php?page=wl_entity_type_settings')); ?>" |
|
| 32 | 32 | class="validate"> |
| 33 | 33 | <input type="hidden" name="tag_ID" |
| 34 | 34 | value=" |
| 35 | 35 | <?php |
| 36 | 36 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 37 | - echo esc_attr( $term_id ); |
|
| 37 | + echo esc_attr($term_id); |
|
| 38 | 38 | ?> |
| 39 | 39 | " /> |
| 40 | 40 | <input type="hidden" name="action" value="wl_edit_entity_type_term" /> |
| 41 | 41 | <?php |
| 42 | 42 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 43 | - wp_nonce_field( 'update-entity_type_term_' . $term_id ); |
|
| 43 | + wp_nonce_field('update-entity_type_term_'.$term_id); |
|
| 44 | 44 | ?> |
| 45 | 45 | <table class="form-table"> |
| 46 | 46 | <tr class="form-field form-required term-name-wrap"> |
| 47 | 47 | <th scope="row"> |
| 48 | 48 | <label> |
| 49 | 49 | <?php |
| 50 | - esc_html_e( 'Name', 'wordlift' ); |
|
| 50 | + esc_html_e('Name', 'wordlift'); |
|
| 51 | 51 | ?> |
| 52 | 52 | </label> |
| 53 | 53 | </th> |
| 54 | 54 | <td> |
| 55 | 55 | <?php |
| 56 | - echo esc_html( $current_term->name ) |
|
| 56 | + echo esc_html($current_term->name) |
|
| 57 | 57 | ?> |
| 58 | 58 | </td> |
| 59 | 59 | </tr> |
@@ -61,16 +61,16 @@ discard block |
||
| 61 | 61 | <th scope="row"> |
| 62 | 62 | <label for="title"> |
| 63 | 63 | <?php |
| 64 | - esc_html_e( 'Title', 'wordlift' ); |
|
| 64 | + esc_html_e('Title', 'wordlift'); |
|
| 65 | 65 | ?> |
| 66 | 66 | </label> |
| 67 | 67 | </th> |
| 68 | 68 | <td><input name="title" id="title" type="text" |
| 69 | - value="<?php echo esc_attr( $term_settings['title'] ); ?>" |
|
| 69 | + value="<?php echo esc_attr($term_settings['title']); ?>" |
|
| 70 | 70 | size="40" /> |
| 71 | 71 | <p class="description"> |
| 72 | 72 | <?php |
| 73 | - esc_html_e( 'The HTML title to be used in the entity type archive page.', 'wordlift' ); |
|
| 73 | + esc_html_e('The HTML title to be used in the entity type archive page.', 'wordlift'); |
|
| 74 | 74 | ?> |
| 75 | 75 | </p> |
| 76 | 76 | </td> |
@@ -78,20 +78,20 @@ discard block |
||
| 78 | 78 | <tr class="form-field term-description-wrap"> |
| 79 | 79 | <th scope="row"><label for="description"> |
| 80 | 80 | <?php |
| 81 | - esc_html_e( 'Description', 'wordlift' ); |
|
| 81 | + esc_html_e('Description', 'wordlift'); |
|
| 82 | 82 | ?> |
| 83 | 83 | </label> |
| 84 | 84 | </th> |
| 85 | 85 | <td><textarea name="description" id="description" rows="5" |
| 86 | - cols="50" class="large-text"><?php echo esc_html( $term_settings['description'] ); ?></textarea> |
|
| 86 | + cols="50" class="large-text"><?php echo esc_html($term_settings['description']); ?></textarea> |
|
| 87 | 87 | <p class="description"> |
| 88 | 88 | <?php |
| 89 | - esc_html_e( 'The description to be used in the entity type archive page.', 'wordlift' ); |
|
| 89 | + esc_html_e('The description to be used in the entity type archive page.', 'wordlift'); |
|
| 90 | 90 | ?> |
| 91 | 91 | </p> |
| 92 | 92 | </td> |
| 93 | 93 | </tr> |
| 94 | 94 | </table> |
| 95 | - <?php submit_button( __( 'Update', 'default' ) ); ?> |
|
| 95 | + <?php submit_button(__('Update', 'default')); ?> |
|
| 96 | 96 | </form> |
| 97 | 97 | </div> |