Skip to content
Snippets Groups Projects
Commit 3bc7439b authored by Erick Hitter's avatar Erick Hitter
Browse files

PHPDoc and minor cleanup

parent bdcfbfa5
Branches
No related tags found
1 merge request!1WIP: Initial release
......@@ -23,6 +23,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ETH_AMP_Analytics_WP {
/**
* PLUGIN SETUP
*/
/**
* Singleton
*/
......@@ -75,7 +79,7 @@ class ETH_AMP_Analytics_WP {
}
/**
*
* Clean up plugin data when it's removed
*/
public static function uninstall() {
delete_option( 'eth_amp_analytics_wp' );
......@@ -96,15 +100,16 @@ class ETH_AMP_Analytics_WP {
*/
/**
* Add component script to header
*
* Must appear before AMP JS library, per https://developers.google.com/analytics/devguides/collection/amp-analytics/
*/
public function action_amp_post_template_head( $scripts ) {
?><script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
<?php
?><script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script><?php
}
/**
*
* Add GA settings to post body
*/
public function action_amp_post_template_footer( $amp_template ) {
$output = array(
......@@ -133,7 +138,7 @@ class ETH_AMP_Analytics_WP {
*/
/**
*
* Register admin additions
*/
public function action_admin_init() {
register_setting( 'reading', $this->plugin_option_name, array( $this, 'sanitize_options' ) );
......@@ -143,7 +148,7 @@ class ETH_AMP_Analytics_WP {
}
/**
*
* Render Property ID input field
*/
public function settings_field_property_id() {
?>
......@@ -156,7 +161,7 @@ class ETH_AMP_Analytics_WP {
}
/**
*
* Sanitize options
*/
public function sanitize_options( $options ) {
$sanitized_options = $this->plugin_option_defaults;
......@@ -185,7 +190,7 @@ class ETH_AMP_Analytics_WP {
*/
/**
*
* Retrieve one of the plugin's options
*/
private function get_option( $name ) {
// Prepare options if this is the first request
......@@ -210,4 +215,4 @@ class ETH_AMP_Analytics_WP {
}
}
ETH_AMP_Analytics_WP::get_instance();
\ No newline at end of file
ETH_AMP_Analytics_WP::get_instance();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment