PluginProbe
Button Generator – Easily Create Custom Buttons with Icons and Analytics / trunk
Button Generator – Easily Create Custom Buttons with Icons and Analytics vtrunk
trunk 1.1.1 2.0 2.1 2.2 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 3.0 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.2 3.1.3 3.2 3.2.1 3.2.2 3.2.3 All 28 releases
button-generation / admin / settings / statics.php

statics.php in Button Generator – Easily Create Custom Buttons with Icons and Analytics trunk, at admin/settings/statics.php

62 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use ButtonGenerator\Admin\Link;
4
5 defined( 'ABSPATH' ) || exit;
6
7 $prefix = 'button_generator';
8 // Counters
9 $option_name_view = '_' . $prefix . '_view_counter_' . $id;
10 $option_name_action = '_' . $prefix . '_action_counter_' . $id;
11 $tool_view = get_option( $option_name_view, '0' );
12 $tool_action = get_option( $option_name_action, '0' );
13 if ( ! empty( $tool_view ) ) {
14 $conversion = round( $tool_action / $tool_view * 100, 2 ) . '%';
15 } else {
16 $conversion = '0%';
17 }
18
19
20 ?>
21
22 <div class="wpie-sidebar">
23
24 <h2 class="wpie-title"><?php esc_html_e( 'Analytics', 'button-generation' ); ?></h2>
25 <div class="wpie-fields__box">
26 <div class="wpie-field">
27 <div class="wpie-field__title"><?php esc_html_e( 'Views', 'button-generation' ); ?></div>
28 <label class="wpie-field__label has-icon">
29 <span class="wpie-icon wpie_icon-eye-open"></span>
30 <input type="text" id="tool_view" value="<?php echo absint( $tool_view ); ?>" readonly>
31 </label>
32 </div>
33
34 <div class="wpie-field">
35 <div class="wpie-field__title"><?php esc_html_e( 'Actions', 'button-generation' ); ?></div>
36 <label class="wpie-field__label has-icon">
37 <span class="wpie-icon wpie_icon-target"></span>
38 <input type="text" id="tool_action" value="<?php echo absint( $tool_action ); ?>" readonly>
39 </label>
40 </div>
41
42 <div class="wpie-field">
43 <div class="wpie-field__title"><?php esc_html_e( 'Conversion', 'button-generation' ); ?></div>
44 <label class="wpie-field__label has-icon">
45 <span class="wpie-icon wpie_icon-filter"></span>
46 <input type="text" id="conversion" value="<?php echo esc_attr( $conversion ); ?>" readonly>
47 </label>
48 </div>
49 </div>
50
51 <div class="wpie-actions__box">
52 <div class="wpie-action__link">
53 <?php if ( ! empty( $options['id'] ) ): ?>
54 <a class="wpie-link-reset-static" href="<?php echo esc_url( Link::reset_count( $options['id'] ) ); ?>">
55 <?php esc_html_e( 'Reset', 'button-generation' ); ?>
56 </a>
57 <?php endif; ?>
58 </div>
59 </div>
60 </div>
61 <?php
62