Changeset 1067497
- Timestamp:
- 01/13/2015 11:50:24 PM (11 years ago)
- Location:
- segmentio/trunk
- Files:
-
- 6 edited
-
. (modified) (1 prop)
-
Readme.md (modified) (2 diffs)
-
analytics-wordpress.php (modified) (3 diffs)
-
bin/deploy (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
templates/snippet.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
segmentio/trunk
-
Property
svn:ignore
set to
Readme.md
.git
.gitignore
-
Property
svn:ignore
set to
-
segmentio/trunk/Readme.md
r980785 r1067497 2 2 # Analytics for WordPress 3 3 4 **Analytics for WordPress** is a WordPress plugin for [Segment](https://segment. io) that lets you send data to any analytics service you want without touching any code.4 **Analytics for WordPress** is a WordPress plugin for [Segment](https://segment.com) that lets you send data to any analytics service you want without touching any code. 5 5 6 6 7 7 ## Installation 8 8 9 To get up and running, checkout our documentation at [segment. io/plugins/wordpress](https://segment.io/plugins/wordpress)—installation takes less than five minutes!9 To get up and running, checkout our documentation at [segment.com/plugins/wordpress](https://segment.com/plugins/wordpress)—installation takes less than five minutes! 10 10 11 11 … … 31 31 ## Support 32 32 33 If you run into issues, be sure to check out the [documentation](https://segment. io/plugins/wordpress), and you can always reach out to our [support team](https://segment.io/support) for help!33 If you run into issues, be sure to check out the [documentation](https://segment.com/plugins/wordpress), and you can always reach out to our [support team](https://segment.com/support) for help! 34 34 35 35 -
segmentio/trunk/analytics-wordpress.php
r986769 r1067497 4 4 Plugin URI: https://segment.io/plugins/wordpress 5 5 Description: The hassle-free way to integrate any analytics service into your WordPress site. 6 Version: 1.0. 46 Version: 1.0.10 7 7 License: GPLv2 8 8 Author: Segment.io … … 182 182 * Current plugin version. 183 183 */ 184 const VERSION = '1.0. 5';184 const VERSION = '1.0.8'; 185 185 186 186 /** … … 821 821 822 822 if ( ! self::is_excluded_post_type() ) { 823 $categories = implode( ', ', wp_list_pluck( get_ categories( get_the_ID() ), 'name' ) );823 $categories = implode( ', ', wp_list_pluck( get_the_category( get_the_ID() ), 'name' ) ); 824 824 $track = array( 825 825 'event' => sprintf( __( 'Viewed %s', 'segment' ), ucfirst( get_post_type() ) ), -
segmentio/trunk/bin/deploy
r950000 r1067497 1 #!/bin/sh 1 #! /bin/bash 2 # 3 # Script to deploy from Github to WordPress.org Plugin Repository 4 # A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn 5 # The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo. 6 # Source: https://github.com/thenbrent/multisite-user-management/blob/master/deploy.sh 2 7 3 # 4 # Fetch form GitHub. 5 # 8 # plugin slug 9 PLUGINSLUG="analytics-wordpress" 6 10 11 # main config, set off of plugin slug 12 CURRENTDIR=`pwd` 13 MAINFILE="$PLUGINSLUG.php" # this should be the name of your main php file in the wordpress plugin 14 15 # git config 16 GITPATH="$CURRENTDIR" # this file should be in the base of your git repository 17 18 # svn config 19 SVNPATH="/tmp/$PLUGINSLUG" # path to a temp SVN repo. No trailing slash required and don't add trunk. 20 SVNURL="http://plugins.svn.wordpress.org/segmentio/" # Remote SVN repo on WordPress.org, with no trailing slash 21 SVNUSER="segmentio" # your svn username 22 23 # Let's begin... 24 echo ".........................................." 7 25 echo 8 echo "Fetching latest tags from GitHub..." 9 git fetch 26 echo "Preparing to deploy WordPress plugin" 27 echo 28 echo ".........................................." 29 echo 10 30 11 # 12 # Prompt for the tag to deploy. 13 # 31 # Check version in readme.txt is the same as plugin file 32 NEWVERSION1=`grep "^Stable tag" $GITPATH/readme.txt | awk -F' ' '{print $3}'` 33 echo "readme version: $NEWVERSION1" 34 NEWVERSION2=`grep "^Version" $GITPATH/$MAINFILE | awk -F' ' '{print $2}'` 35 echo "$MAINFILE version: $NEWVERSION2" 14 36 15 read -p "☛ Which version (eg. '1.0.3') do you want to deploy? " version 37 if [ "$NEWVERSION1" != "$NEWVERSION2" ]; then echo "Versions don't match. Fix that! ...."; exit 1; fi 16 38 17 # 18 # Make sure the version is valid. 19 # 39 echo "Versions match in readme.txt and PHP file. Let's proceed..." 20 40 21 if [[ ! $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] 22 then 41 cd $GITPATH 42 git commit -am "$NEWVERSION1" 43 44 echo "Tagging new version in git" 45 git tag -a "$NEWVERSION1" -m "Tagging version $NEWVERSION1" 46 47 echo "Pushing latest commit to origin, with tags" 48 git push origin master 49 git push origin master --tags 50 23 51 echo 24 echo "Error: \"$version\" is not a valid version string." 25 echo 26 exit 1 27 fi 52 echo "Creating local copy of SVN repo ..." 53 svn co $SVNURL $SVNPATH 28 54 29 # 30 # Make sure the version exists. 31 # 55 echo "Ignoring github specific files and deployment script" 56 svn propset svn:ignore " 57 Readme.md 58 .git 59 .gitignore" "$SVNPATH/trunk/" 32 60 33 if [[ -n $(git ls-remote --tags origin $version) ]] 34 then 35 echo "Found $version on GitHub." 36 else 37 echo 38 echo "Error: $version has not been pushed to GitHub." 39 echo 40 exit 1 41 fi 61 #export git -> SVN 62 echo "Exporting the HEAD of master from git to the trunk of SVN" 63 git checkout-index -a -f --prefix=$SVNPATH/trunk/ 42 64 43 #44 # Reset the local SVN branch.45 #46 65 47 echo "Updating local SVN branch..." 48 git checkout svn 49 git reset --hard origin/svn 66 echo "Changing directory to SVN and committing to trunk" 67 cd $SVNPATH/trunk/ 68 # Add all new files that are not set to be ignored 69 svn status | grep -v "^.[ \t]*\..*" | grep "^?" | awk '{print $2}' | xargs svn add 70 svn commit --username=$SVNUSER -m "$NEWVERSION1" 50 71 51 # 52 # Merge changes from the chosen tag. 53 # 72 echo "Creating new SVN tag & committing it" 73 cd $SVNPATH 74 svn copy trunk/ tags/$NEWVERSION1/ 75 cd $SVNPATH/tags/$NEWVERSION1 76 svn commit --username=$SVNUSER -m "Tagging version $NEWVERSION1" 54 77 55 echo "Merging changes into local SVN branch..."56 git merge $version -X theirs -m "merge $version into svn" 78 echo "Removing temporary directory $SVNPATH" 79 rm -fr $SVNPATH/ 57 80 58 # 59 # Commit, tag and push svn. 60 # 61 62 git svn dcommit 63 git svn tag $version 64 git push origin svn --force 65 66 # 67 # Exit gracefully. 68 # 69 70 git checkout master 71 echo 72 echo "Successfully pushed $version to the WordPress Plugin Directory!" 73 echo "https://wordpress.org/plugins/segmentio" 74 echo 75 exit 0 81 echo "*** FIN ***" 82 -
segmentio/trunk/readme.txt
r986769 r1067497 4 4 Requires at least: 3.6 5 5 Tested up to: 4.0 6 Stable tag: 1.0. 56 Stable tag: 1.0.10 7 7 License: GPLv2 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 76 76 == Changelog == 77 77 78 = 1.0.6 = 79 * Bump snippet to version 3.0.0 80 * Fix for category retrieval bug 81 78 82 = 1.0.5 = 79 83 * Add context information to page calls. -
segmentio/trunk/templates/snippet.php
r948394 r1067497 1 1 <script type="text/javascript"> 2 window.analytics=window.analytics||[],window.analytics.methods=["identify","group","track","page","pageview","alias","ready","on","once","off","trackLink","trackForm","trackClick","trackSubmit"],window.analytics.factory=function(t){return function(){var a=Array.prototype.slice.call(arguments);return a.unshift(t),window.analytics.push(a),window.analytics}};for(var i=0;i<window.analytics.methods.length;i++){var key=window.analytics.methods[i];window.analytics[key]=window.analytics.factory(key)}window.analytics.load=function(t){if(!document.getElementById("analytics-js")){var a=document.createElement("script");a.type="text/javascript",a.id="analytics-js",a.async=!0,a.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.io/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n)}},window.analytics.SNIPPET_VERSION="2.0.9";2 !function(){var analytics=window.analytics=window.analytics||[];if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.0.0"; 3 3 <?php if ( ! $ignore ) : ?> 4 4 window.analytics.load("<?php echo esc_js( $settings['api_key'] ); ?>");
Note: See TracChangeset
for help on using the changeset viewer.