Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
PUM_Admin_Popups::render_analytics_meta_box()

Display analytics metabox


Description Description


Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Return Return

(void)


Top ↑

Source Source

File: classes/Admin/Popups.php

	public static function render_analytics_meta_box() {
		global $post;

		$popup = pum_get_popup( $post->ID );
		?>
		<div id="pum-popup-analytics" class="pum-meta-box">

			<?php do_action( 'pum_popup_analytics_metabox_before', $post->ID ); ?>

			<?php
			$opens           = $popup->get_event_count( 'open' );
			$conversions     = $popup->get_event_count( 'conversion' );
			$conversion_rate = $opens > 0 && $opens >= $conversions ? $conversions / $opens * 100 : 0;
			?>

			<div id="pum-popup-analytics" class="pum-popup-analytics">

				<table class="form-table">
					<tbody>
					<tr>
						<td><?php esc_html_e( 'Opens', 'popup-maker' ); ?></td>
						<td><?php echo esc_html( $opens ); ?></td>
					</tr>
					<tr>
						<td><?php esc_html_e( 'Conversions', 'popup-maker' ); ?></td>
						<td><?php echo esc_html( $conversions ); ?></td>
					</tr>
					<tr>
						<td><?php esc_html_e( 'Conversion Rate', 'popup-maker' ); ?></td>
						<td><?php echo esc_html( round( $conversion_rate, 2 ) ); ?>%</td>
					</tr>
					<tr class="separator">
						<td colspan="2">
							<label> <input type="checkbox" name="popup_reset_counts" id="popup_reset_counts" value="1" />
								<?php esc_html_e( 'Reset Counts', 'popup-maker' ); ?>
							</label>
							<?php if ( ( $reset = $popup->get_last_count_reset() ) ) : ?><br />
								<small>
									<strong><?php esc_html_e( 'Last Reset', 'popup-maker' ); ?>:</strong> <?php echo esc_html( date( 'm-d-Y H:i', $reset['timestamp'] ) ); ?>
									<br /> <strong><?php esc_html_e( 'Previous Opens', 'popup-maker' ); ?>:</strong> <?php echo esc_html( $reset['opens'] ); ?>

									<?php if ( $reset['conversions'] > 0 ) : ?>
										<br />
										<strong><?php esc_html_e( 'Previous Conversions', 'popup-maker' ); ?>:</strong> <?php echo esc_html( $reset['conversions'] ); ?>
									<?php endif; ?>

									<br /> <strong><?php esc_html_e( 'Lifetime Opens', 'popup-maker' ); ?>:</strong> <?php echo esc_html( $popup->get_event_count( 'open', 'total' ) ); ?>

									<?php if ( $popup->get_event_count( 'conversion', 'total' ) > 0 ) : ?>
										<br />
										<strong><?php esc_html_e( 'Lifetime Conversions', 'popup-maker' ); ?>:</strong> <?php echo esc_html( $popup->get_event_count( 'conversion', 'total' ) ); ?>
									<?php endif; ?>
								</small>
							<?php endif; ?>
						</td>
					</tr>
					</tbody>
				</table>
			</div>

			<?php do_action( 'pum_popup_analytics_metabox_after', $post->ID ); ?>

		</div>

		<?php
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.