Plugin Directory

Changeset 1438050


Ignore:
Timestamp:
06/16/2016 08:45:47 PM (10 years ago)
Author:
lewisself
Message:

Removed in-line styling on admin page with external style sheet. Responsive admin panel.

Location:
easy-google-analytics-tracking/trunk
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • easy-google-analytics-tracking/trunk/easy-google-analytics-tracking.php

    r1403255 r1438050  
    5151    add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'egat_add_setting_link');
    5252   
     53    function egat_enqueue_css()
     54    {
     55      if($_GET['page'] == 'easy-google-analytics-tracking')
     56      {
     57        wp_enqueue_style('admin', plugins_url('/css/admin.css', __FILE__));
     58      }
     59    }
     60    add_action('admin_print_styles', 'egat_enqueue_css');
     61       
    5362    function egat_google_analytics_script_menu() // Creates settings page
    5463    {
     
    6877      ?>
    6978
    70       <div class="wrap" style="width:600px;">
     79      <div class="wrap" id="main-content">
    7180        <h2>Google Analytics Script</h2>
    7281        <form method="post" action="options.php">
    7382          <?php settings_fields('google-analytics-script-settings'); ?>
    7483          <?php do_settings_sections('google-analytics-script-settings'); ?>
    75           <p>
    76             <span>You can find the google tracking Id in your google analytics admin. Property > Tracking Info > Tracking Code.</span>
    77             <br />
    78             <br />
    79             <span>Once you generate the Google Analytics Code, you can find the Google Tracking Id under the ga function with the first paramiter as "create" For example, ga('create', <b>'YOUR TRACKING CODE'</b>, 'auto').</span>
    80           </p>
    81           <label>
     84          <div>
     85            <p>You can find the google tracking Id in your google analytics admin. Property > Tracking Info > Tracking Code.</p>
     86            <p>Once you generate the Google Analytics Code, you can find the Google Tracking Id under the ga function with the first paramiter as "create" For example, ga('create', <b>'YOUR TRACKING CODE'</b>, 'auto').</p>
     87          </div>
     88          <label class="tracking-id">
    8289            <span>Google Analytics Tracking ID:</span>
    83             </br >
    84             <input name="google_analytics_tracking_id" value="<?php echo esc_attr(get_option('google_analytics_tracking_id')); ?>" style="width:300px;" />
     90            <input name="google_analytics_tracking_id" value="<?php echo esc_attr(get_option('google_analytics_tracking_id')); ?>" />
    8591          </label>
    86           <br />
    87           <br />
    88           <label>
    89             <span style="margin:0 5px 0 0;">Enable Google Analytics:</span>
     92          <label class="enable-tracking-id">
     93            <span>Enable Google Analytics:</span>
    9094            <input type="checkbox" name="google_analytics_enabled" value="1" <?php checked(1, get_option('google_analytics_enabled'), true); ?> />
    9195          </label>
     
    99103      function egat_uninstall() // Cleans up database and WordPress files on uninstall
    100104      {
     105        delete_option('google_analytics_tracking_id');
    101106        delete_option('google_analytics_enabled');
    102         delete_option('google_analytics_tracking_id');
    103107      }
    104108      register_uninstall_hook(__FILE__, 'egat_uninstall');
  • easy-google-analytics-tracking/trunk/readme.txt

    r1411971 r1438050  
    33Contributors: Lewis Self
    44Donate Link: http://selfdesigns.co.uk
    5 Tags: google, analytics, website, data, tracking, simple, information, track, count, counter
     5Tags: Google, Analytics, website data, tracking, simple
    66Requires at least: 4.0
    77Tested up to: 4.5
     
    2727You can find the settings for the plugin either under the wp-admin settings drop down or as a link on the plugin in the WordPress admin "plugins" menu.
    2828
    29 = How do I find my tracking ID? =
    30 
    31 The Google Tracking ID is located inside of your google analytics script. the "ga()" function should hold your ID. See the second screenshot to see the provided example.
    32 
    3329= I have entered my tracking ID, but the script is not being executed. =
    3430
    35 Make sure you have the "Enable Google Analytics" section checked. This isn't defaulted on activation so you will have to check it in the settings when entering the google tracking ID.
     31Make sure you have the "Enable Google Analytics" section checked. This isn't defaulted on activation so you will have to check it in the settings after entering the google tracking ID.
    3632
    3733== Screenshots ==
    3834
    39351. The plugin settings page. The tracking ID should look something like the one on the page.
    40 2. Google Analytics script. The red highlighed box shows the tracking code needed to input inside of the "tracking code" box.
    4136
    4237== Upgrade Notice ==
     
    4641= 1.0.0 =
    4742* Initial release: 17/04/2016
     43
     44= 1.0.1 =
     45* Changed admin settings from inline style to external Style Sheet: 16/06/2016
     46* Responsive admin settings: 16/06/2016
Note: See TracChangeset for help on using the changeset viewer.