PluginProbe ʕ •ᴥ•ʔ
Hustle – Email Marketing, Lead Generation, Optins, Popups / 7.8.14.1
Hustle – Email Marketing, Lead Generation, Optins, Popups v7.8.14.1
7.8.14 7.8.14.1 7.8.13 7.8.13.1 trunk 3.0 3.1 3.1.1 3.1.2 3.1.3 3.1.4 4.3.2 4.4.4 4.4.5 4.4.5.1 4.4.5.4 4.6 4.6.1.1 4.6.1.4 4.7.0.2 4.7.0.3 4.7.0.7 4.7.0.9 4.7.1.0 4.7.1.1 4.8.0.0 5.0.0 5.0.1 5.0.1.1 5.0.1.2 5.1 5.1.1 5.1.2 5.1.3 5.1.3.1 5.1.3.2 5.1.4 5.1.5 6.0 6.0.1 6.0.2 6.0.3 6.0.4.2 6.0.5 6.0.6.1 6.0.7 6.0.8.1 6.0.9 7.0.0.1 7.0.2 7.0.3 7.0.4 7.1.0 7.1.1 7.2.0 7.2.1 7.3.0 7.3.1 7.3.3 7.3.5 7.3.6 7.3.7 7.4.0 7.4.1 7.4.11 7.4.13 7.4.13.1 7.4.2 7.4.3 7.4.4 7.4.5 7.4.5.1 7.4.5.2 7.4.6 7.4.7 7.5.0 7.6.0 7.6.1 7.6.3 7.6.4 7.6.6 7.7.0 7.7.1 7.8.0 7.8.1 7.8.10 7.8.10.1 7.8.10.2 7.8.11 7.8.12 7.8.12.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.8.9.1 7.8.9.2 7.8.9.3
wordpress-popup / views / admin / commons / sui-listing / elements / module.php
wordpress-popup / views / admin / commons / sui-listing / elements Last commit date
actions.php 1 month ago bulk-actions.php 3 years ago empty-message.php 2 years ago empty-search.php 2 years ago module.php 3 years ago pagination-list.php 5 months ago pagination.php 6 years ago summary.php 10 months ago tracking-data-chart.php 5 months ago tracking-data.php 6 years ago
module.php
213 lines
1 <?php
2 /**
3 * Displays the tracking charts in the listing page.
4 *
5 * @package Hustle
6 * @since 4.0.0
7 */
8
9 $is_tracking_disabled = empty( $module->get_tracking_types() );
10 $last_conversion_text = __( 'Last conversion', 'hustle' );
11
12 $global_tracking = Hustle_Settings_Admin::global_tracking();
13 $module_tag_class = $module->active ? ' sui-tag-blue' : '';
14 $tooltip_message = '';
15 $is_scheduled = false;
16
17 // Let's handle the icons and messages for the Schedule settings.
18 // Social sharing modules don't have schedules. And drafted modules disregard it.
19 if ( Hustle_Module_Model::SOCIAL_SHARING_MODULE !== $module->module_type ) {
20
21 $settings = $module->get_settings();
22 $settings_array = $settings->to_array();
23 $schedule = $settings_array['schedule'];
24 $is_scheduled = '1' === $settings_array['is_schedule'];
25
26 // If a schedule isn't set for the module, no need to add schedule icons.
27 if ( $is_scheduled ) {
28
29 /* translators: module type capitalized and in singular */
30 $tooltip_message = sprintf( __( "%s schedule has not started, so your visitors can't see it yet.", 'hustle' ), $capitalize_singular );
31
32 $module_tag_class .= ' hui-tag-scheduled sui-tooltip sui-tooltip-constrained sui-tooltip-top-left-mobile';
33
34 // Notify the admin that the module won't be shown again because of the schedule.
35 if ( ! $settings->will_be_shown_again() || $settings->is_schedule_finished() ) {
36
37 $module_tag_class .= ' hui-scheduled-error';
38
39 $tooltip_message = sprintf(
40 /* translators: 1. module type capitalized and in singular, 2. module type in lowercase and in singular. */
41 __( "%1\$s schedule is over and your visitors can't see this %2\$s anymore.", 'hustle' ),
42 $capitalize_singular,
43 $smallcaps_singular
44 );
45
46 // Notify the admin that this module is currently being displayed according to the schedule.
47 } elseif ( $settings->is_currently_scheduled() || $settings->is_between_start_and_end_date() ) {
48
49 $module_tag_class .= ' hui-scheduled-success';
50
51 $tooltip_message = sprintf(
52 /* translators: 1. module type capitalized and in singular, 2. module type in lowercase and in singular. */
53 __( '%1$s schedule is active now and the %2$s is visible to your visitors.', 'hustle' ),
54 $capitalize_singular,
55 $smallcaps_singular
56 );
57 }
58 }
59 } else {
60 $last_conversion_text = __( 'Last share', 'hustle' );
61 }
62
63 ?>
64 <div class="sui-accordion-item">
65
66 <?php
67 $module_id = $module->module_id;
68 $can_edit = Opt_In_Utils::is_user_allowed( 'hustle_edit_module', $module_id );
69 $view_stats = filter_input( INPUT_GET, 'view_stats', FILTER_VALIDATE_INT );
70
71 if ( $view_stats && intval( $module_id ) === $view_stats ) {
72 $display_chart_class = ' hustle-display-chart hustle-scroll-to';
73 } else {
74 $display_chart_class = '';
75 }
76
77 // START: Item header.
78 ?>
79 <div
80 class="sui-accordion-item-header<?php echo esc_attr( $display_chart_class ); ?>"
81 data-id="<?php echo esc_attr( $module->id ); ?>"
82 data-nonce="<?php echo esc_attr( wp_create_nonce( 'module_get_tracking_data' . $module->id ) ); ?>"
83 >
84
85 <?php // This should have sui-trim-title, but that class prevents the schedule tooltip from showing up. ?>
86 <div class="sui-accordion-item-title">
87
88 <label for="hustle-module-<?php echo esc_html( $module_id ); ?>" class="sui-checkbox sui-accordion-item-action">
89 <input
90 type="checkbox"
91 value="<?php echo esc_html( $module_id ); ?>"
92 id="hustle-module-<?php echo esc_html( $module_id ); ?>"
93 class="hustle-listing-checkbox"
94 />
95 <span aria-hidden="true"></span>
96 <span class="sui-screen-reader-text"><?php esc_html_e( 'Select this module', 'hustle' ); ?></span>
97 </label>
98
99 <span class="sui-trim-text"><?php echo esc_html( $module->module_name ); ?></span>
100
101 <span
102 class="sui-tag<?php echo esc_attr( $module_tag_class ); ?>"
103 <?php echo ! empty( $tooltip_message ) ? 'data-tooltip="' . esc_html( $tooltip_message ) . '"' : ''; ?>
104 >
105
106 <span class="hustle-toggle-status-button-description<?php echo $module->active ? ' sui-hidden' : ''; ?>">
107 <?php esc_html_e( 'Draft', 'hustle' ); ?>
108 </span>
109
110 <span class="hustle-toggle-status-button-description<?php echo $module->active ? '' : ' sui-hidden'; ?>">
111 <?php esc_html_e( 'Published', 'hustle' ); ?>
112 <?php if ( $is_scheduled ) { ?>
113 <span class="sui-icon-clock sui-sm" aria-hidden="true"></span>
114 <?php } ?>
115 </span>
116
117 </span>
118
119 <?php if ( $global_tracking ) { ?>
120 <span class="sui-tag sui-tag-disabled hustle-analytics-disabled-tag<?php echo ( $module->active && $is_tracking_disabled ) ? '' : ' sui-hidden-important'; ?>">
121 <?php esc_html_e( 'Tracking Disabled', 'hustle' ); ?>
122 </span>
123 <?php } ?>
124
125 </div>
126
127 <?php
128 if ( Hustle_Settings_Admin::global_tracking() ) {
129 $tracking_model = Hustle_Tracking_Model::get_instance();
130 $last_entry_time = $tracking_model->get_latest_conversion_time_by_module_id( $module_id );
131 ?>
132 <div class="sui-accordion-item-date">
133 <strong><?php echo esc_html( $last_conversion_text ); ?></strong>
134 <?php echo esc_html( $last_entry_time ); ?>
135 </div>
136 <?php } ?>
137
138 <div class="sui-accordion-col-auto">
139
140 <?php if ( $can_edit ) { ?>
141 <a
142 href="<?php echo esc_url( $module->get_edit_url() ); ?>"
143 class="sui-button sui-button-ghost sui-accordion-item-action sui-desktop-visible"
144 >
145 <span class="sui-icon-pencil" aria-hidden="true"></span> <?php esc_attr_e( 'Edit', 'hustle' ); ?>
146 </a>
147
148 <a
149 href="<?php echo esc_url( $module->get_edit_url() ); ?>"
150 class="sui-button-icon sui-accordion-item-action sui-mobile-visible"
151 >
152 <span class="sui-icon-pencil" aria-hidden="true"></span>
153 <span class="sui-screen-reader-text"><?php esc_attr_e( 'Edit', 'hustle' ); ?></span>
154 </a>
155 <?php } ?>
156
157 <div class="sui-dropdown sui-accordion-item-action">
158
159 <?php
160 // ELEMENT: Actions.
161 $this->render(
162 'admin/commons/sui-listing/elements/actions',
163 array(
164 'module' => $module,
165 'smallcaps_singular' => $smallcaps_singular,
166 'capitalize_singular' => $capitalize_singular,
167 'is_tracking_disabled' => $is_tracking_disabled,
168 )
169 );
170 ?>
171
172 </div>
173
174 <?php if ( $global_tracking ) { ?>
175 <button class="sui-button-icon sui-accordion-open-indicator">
176 <span class="sui-icon-chevron-down" aria-hidden="true"></span>
177 <span class="sui-screen-reader-text"><?php esc_html_e( 'View module stats', 'hustle' ); ?></span>
178 </button>
179 <?php } ?>
180
181 </div>
182
183 </div>
184
185 <?php if ( $global_tracking ) { ?>
186 <?php // START: Item body. ?>
187 <div class="sui-accordion-item-body">
188
189 <?php
190 $render_arguments = array(
191 'module' => $module,
192 'total_module_views' => 0,
193 'total_module_conversions' => 0,
194 'tracking_types' => $tracking_types,
195 'last_entry_time' => esc_html__( 'Never', 'hustle' ),
196 'rate' => 0,
197 );
198
199 // ELEMENT: Tracking data.
200 $this->render(
201 'admin/commons/sui-listing/elements/tracking-data',
202 array(
203 'render_arguments' => $render_arguments,
204 'multiple_charts' => false,
205 )
206 );
207 ?>
208
209 </div>
210 <?php } ?>
211
212 </div>
213