Example #1
0
 /**
  * Create a form element to init a form
  *
  * @param string $namespace
  *
  * @return string
  */
 public static function create_form($namespace)
 {
     self::$form_namespace = $namespace;
     $action = admin_url('admin.php');
     if (isset($_GET['page'])) {
         $action .= '?page=' . $_GET['page'];
     }
     return '<form action="' . $action . '" method="post" id="yoast-ga-form-' . self::$form_namespace . '" class="yoast_ga_form">' . wp_nonce_field('save_settings', 'yoast_ga_nonce', null, false);
 }
Example #2
0
?>
" class="yoast-dashboard yoast-graph" data-label="<?php 
echo $settings['title'];
?>
" data-percent="<?php 
echo !empty($settings['data-percent']);
?>
">
	<h3>
		<span class='alignleft'><?php 
echo $settings['title'];
?>
</span>
		<?php 
if (!empty($settings['help'])) {
    echo Yoast_GA_Admin_Form::show_help('graph-' . $dashboard, $settings['help']);
}
?>
		<span class='alignright period'><?php 
echo __('Last month', 'google-analytics-for-wordpress');
?>
</span>
	</h3>

	<?php 
if (empty($settings['hide_y_axis'])) {
    echo "<div class='yoast-graph-yaxis'></div>";
}
?>
	<div class="yoast-graph-holder"></div>
Example #3
0
	<?php 
do_action('yst_ga_custom_tabs-content');
?>
	<div id="debugmode" class="gatab">
		<?php 
echo '<h2>' . __('Debug', 'google-analytics-for-wordpress') . '</h2>';
echo '<div id="ga-promote">';
echo '<p class="ga-topdescription">' . __('If you want to confirm that tracking on your blog is working as it should, enable this option and check the console of your browser. Be absolutely sure to disable debugging afterwards, as it is slower than normal tracking.', 'google-analytics-for-wordpress') . '</p>';
echo '<p class="ga-topdescription">' . __('<strong>Note</strong> the debugging is only loaded for administrators.', 'google-analytics-for-wordpress') . '</p>';
echo '</div>';
echo Yoast_GA_Admin_Form::input('checkbox', __('Enable debug mode', 'google-analytics-for-wordpress'), 'debug_mode');
?>
	</div>
</div>
<?php 
echo Yoast_GA_Admin_Form::end_form(__('Save changes', 'google-analytics-for-wordpress'), 'settings', 'yst_closepopupwindow();');
echo $yoast_ga_admin->content_footer();
?>
<script type="text/javascript">
	jQuery(document).ready(
		function () {
			jQuery('#yoast-ga-form-select-settings-analytics_profile').chosen({
				group_search: true
			});
			jQuery('#yoast-ga-form-select-settings-ignore_users').chosen({placeholder_text_multiple: '<?php 
echo __('Select the users to ignore', 'google-analytics-for-wordpress');
?>
'});
		}
	);
</script>
<?php

/**
 * @package GoogleAnalytics\Premium
 */
?>
<div id="custommetrics" class="gatab">
<?php 
echo '<h2>' . __('Custom Metrics', 'ga-premium') . '</h2>';
/** translators: %1$s / %2$s: links to an article about setting up the code to track your AdSense sites in Analytics  on google.com */
$integration_required = sprintf(__('This requires integration of your Analytics and AdSense account. For how to do this, see %1$sthis help page%2$s.', 'ga-premium'), '<a href="https://support.google.com/adsense/answer/94743?ref_topic=23415&hl=' . get_locale() . '" target="_blank">', '</a>');
// Showing checkbox for enabling/disabling adsense tracking
echo Yoast_GA_Admin_Form::input('checkbox', __('Google Metrics', 'ga-premium'), 'track_adsense', null, $integration_required);
?>
</div>
 /**
  * Get the render adsense option for the dashboard.
  *
  * @return string
  */
 protected function render_adsense_tracking()
 {
     /** translators: %1$s / %2$s: links to an article about setting up the code to track your AdSense sites in Google Analytics on google.com */
     $adsense_help = sprintf(__('This requires integration of your Analytics and AdSense account, for help, %1$slook here%2$s.', 'ga-premium'), '<a href="https://support.google.com/adsense/answer/94743?&ref_topic=23415?hl=' . get_locale() . '" target="_blank">', '</a>');
     return Yoast_GA_Admin_Form::input('checkbox', __('Google Adsense tracking', 'ga-premium'), 'track_adsense', null, $adsense_help);
 }
 /**
  * Test parse optgroups function
  *
  * @covers Yoast_GA_Admin_Form::parse_optgroups()
  */
 public function test_parse_optgroups()
 {
     $optgroups = array();
     $optgroups[] = array('name' => 'Name group 1', 'items' => array(array('name' => 'Name_group_1', 'items' => array(array('id' => 1, 'name' => 'Profile 1')))));
     $optgroups[] = array('name' => 'Name group 1', 'items' => array(array('name' => 'Name_group_2', 'items' => array(array('id' => 2, 'name' => 'Profile 2')))));
     $result = Yoast_GA_Admin_Form::parse_optgroups($optgroups);
     $output = array('Name_group_1' => array('items' => array(0 => array('id' => 1, 'name' => 'Profile 1'))), 'Name_group_2' => array('items' => array(0 => array('id' => 2, 'name' => 'Profile 2'))));
     $this->assertEquals($result, $output);
 }
Example #7
0
	<?php 
do_action('yst_ga_custom_tabs-content');
?>
	<div id="debugmode" class="gatab">
		<?php 
echo '<h2>' . __('Debug', 'google-analytics-for-wordpress') . '</h2>';
echo '<div id="ga-promote">';
echo '<p class="ga-topdescription">' . __('If you want to confirm that tracking on your blog is working as it should, enable this option and check the console of your browser. Be absolutely sure to disable debugging afterwards, as it is slower than normal tracking.', 'google-analytics-for-wordpress') . '</p>';
echo '<p class="ga-topdescription">' . __('<strong>Note</strong> the debugging is only loaded for administrators.', 'google-analytics-for-wordpress') . '</p>';
echo '</div>';
echo Yoast_GA_Admin_Form::input('checkbox', __('Enable debug mode', 'google-analytics-for-wordpress'), 'debug_mode');
?>
	</div>
</div>
<?php 
echo Yoast_GA_Admin_Form::end_form('Save changes', 'settings');
echo $yoast_ga_admin->content_footer();
?>
<script type="text/javascript">
	jQuery(document).ready(
		function () {
			jQuery('#yoast-ga-form-select-settings-analytics_profile').chosen({
				group_search: true
			});
			jQuery('#yoast-ga-form-select-settings-ignore_users').chosen({placeholder_text_multiple: '<?php 
echo __('Select the users to ignore', 'google-analytics-for-wordpress');
?>
'});
		}
	);
</script>