Changeset 1191569
- Timestamp:
- 07/03/2015 02:58:56 AM (11 years ago)
- Location:
- iterative-headlines
- Files:
-
- 3 edited
- 16 copied
-
tags/1.3 (copied) (copied from iterative-headlines/trunk)
-
tags/1.3/atom_24.png (copied) (copied from iterative-headlines/trunk/atom_24.png)
-
tags/1.3/atom_512.png (copied) (copied from iterative-headlines/trunk/atom_512.png)
-
tags/1.3/headlines.php (copied) (copied from iterative-headlines/trunk/headlines.php) (7 diffs)
-
tags/1.3/headlines_api.php (copied) (copied from iterative-headlines/trunk/headlines_api.php) (3 diffs)
-
tags/1.3/headlines_calculator.php (copied) (copied from iterative-headlines/trunk/headlines_calculator.php)
-
tags/1.3/headlines_cron.php (copied) (copied from iterative-headlines/trunk/headlines_cron.php)
-
tags/1.3/headlines_mac.php (copied) (copied from iterative-headlines/trunk/headlines_mac.php)
-
tags/1.3/headlines_options.php (copied) (copied from iterative-headlines/trunk/headlines_options.php)
-
tags/1.3/headlines_pointer.php (copied) (copied from iterative-headlines/trunk/headlines_pointer.php)
-
tags/1.3/iterative.png (copied) (copied from iterative-headlines/trunk/iterative.png)
-
tags/1.3/iterativei.png (copied) (copied from iterative-headlines/trunk/iterativei.png)
-
tags/1.3/js (copied) (copied from iterative-headlines/trunk/js)
-
tags/1.3/light_24.png (copied) (copied from iterative-headlines/trunk/light_24.png)
-
tags/1.3/readme.txt (copied) (copied from iterative-headlines/trunk/readme.txt) (1 diff)
-
tags/1.3/star_16.png (copied) (copied from iterative-headlines/trunk/star_16.png)
-
trunk/headlines.php (modified) (7 diffs)
-
trunk/headlines_api.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
iterative-headlines/tags/1.3/headlines.php
r1190469 r1191569 5 5 Description: Test your post titles and headlines with state-of-the-art artificial intelligence. 6 6 Author: Iterative Research Inc. 7 Version: 1. 27 Version: 1.3 8 8 Author URI: mailto:joe@iterative.ca 9 9 License: GPLv2+ … … 16 16 require_once dirname(__FILE__) . "/headlines_pointer.php"; 17 17 require_once dirname(__FILE__) . "/headlines_options.php"; 18 require_once dirname(__FILE__) . "/headlines_functions.php"; 18 19 require_once dirname(__FILE__) . "/headlines_calculator.php"; 19 20 … … 117 118 118 119 function iterative_add_javascript() { 119 //if(!is_admin()) {120 if(!is_admin()) { 120 121 echo "<script type='text/javascript' src='" . IterativeAPI::getTrackerURL() . "'></script>"; 121 122 122 123 // record a click conversion 123 124 124 if(is_single() && parse_url(wp_get_referer(), PHP_URL_HOST) == parse_url($_SERVER["HTTP_HOST"], PHP_URL_HOST)) {125 if(is_single() && (iterative_get_referring_host() == iterative_remove_www(parse_url($_SERVER["HTTP_HOST"], PHP_URL_HOST)))) { 125 126 global $post; 126 127 $id = $post->ID; … … 128 129 129 130 $variant = IterativeAPI::selectVariant($id, array_keys($variants)); 130 131 131 if(count($variants) >= 1) { 132 132 echo "<script type='text/javascript' src='" . IterativeAPI::getSuccessURL(ITERATIVE_GOAL_CLICKS, $variant, $id) . "'></script>"; … … 146 146 unset($_SESSION['iterative_comments_posted']); 147 147 } 148 //}148 } 149 149 } 150 150 … … 168 168 if ( isset( $_REQUEST['iterative_post_title_variants'] ) ) { 169 169 $result = array(); 170 170 171 foreach($_REQUEST['iterative_post_title_variants'] as $iptv) { 171 172 $iptv = trim($iptv); … … 174 175 $result[] = $iptv; 175 176 } 176 177 if(!empty($result)) 178 update_post_meta( $post_id, 'iterative_post_title_variants', $result); // ( $_REQUEST['iterative_post_title_variants'] ) ); 177 update_post_meta( $post_id, 'iterative_post_title_variants', $result); // ( $_REQUEST['iterative_post_title_variants'] ) ); 179 178 } 180 179 -
iterative-headlines/tags/1.3/headlines_api.php
r1190425 r1191569 8 8 // -> Receive probabilities for each variant. 9 9 private static $api_endpoint = "http://api.pathfinding.ca/"; 10 private static $api_version = 1. 2;10 private static $api_version = 1.3; 11 11 private static $reject_age = 86400; 12 12 private static $request_age = 14440; … … 110 110 111 111 // get the most recent parameters. if they don't exist, call serverProbabilities. 112 if($model_type === null) die("NO MT?");113 112 $post_meta = get_post_meta($post_id, "_iterative_parameters_{$model_type}_{$type}", true); 114 113 if($post_meta == "" || $response['timestamp'] > time()+static::$request_age) … … 261 260 public static function getTrackerURL() { 262 261 // the logger should set an identical UID/hash cookie on api.pathfinding.ca 263 return static::$api_endpoint . "js/log?user=" . static::getUserID() . "&unique_id=" . static::getGUID() ;262 return static::$api_endpoint . "js/log?user=" . static::getUserID() . "&unique_id=" . static::getGUID() . "&refclass=" . iterative_get_referring_type();; 264 263 } 265 264 public static function getSuccessURL($type, $variant_id, $experiment_id) { -
iterative-headlines/tags/1.3/readme.txt
r1190443 r1191569 4 4 Requires at least: 3.0.1 5 5 Tested up to: 4.2.2 6 Stable tag: 1. 26 Stable tag: 1.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
iterative-headlines/trunk/headlines.php
r1190469 r1191569 5 5 Description: Test your post titles and headlines with state-of-the-art artificial intelligence. 6 6 Author: Iterative Research Inc. 7 Version: 1. 27 Version: 1.3 8 8 Author URI: mailto:joe@iterative.ca 9 9 License: GPLv2+ … … 16 16 require_once dirname(__FILE__) . "/headlines_pointer.php"; 17 17 require_once dirname(__FILE__) . "/headlines_options.php"; 18 require_once dirname(__FILE__) . "/headlines_functions.php"; 18 19 require_once dirname(__FILE__) . "/headlines_calculator.php"; 19 20 … … 117 118 118 119 function iterative_add_javascript() { 119 //if(!is_admin()) {120 if(!is_admin()) { 120 121 echo "<script type='text/javascript' src='" . IterativeAPI::getTrackerURL() . "'></script>"; 121 122 122 123 // record a click conversion 123 124 124 if(is_single() && parse_url(wp_get_referer(), PHP_URL_HOST) == parse_url($_SERVER["HTTP_HOST"], PHP_URL_HOST)) {125 if(is_single() && (iterative_get_referring_host() == iterative_remove_www(parse_url($_SERVER["HTTP_HOST"], PHP_URL_HOST)))) { 125 126 global $post; 126 127 $id = $post->ID; … … 128 129 129 130 $variant = IterativeAPI::selectVariant($id, array_keys($variants)); 130 131 131 if(count($variants) >= 1) { 132 132 echo "<script type='text/javascript' src='" . IterativeAPI::getSuccessURL(ITERATIVE_GOAL_CLICKS, $variant, $id) . "'></script>"; … … 146 146 unset($_SESSION['iterative_comments_posted']); 147 147 } 148 //}148 } 149 149 } 150 150 … … 168 168 if ( isset( $_REQUEST['iterative_post_title_variants'] ) ) { 169 169 $result = array(); 170 170 171 foreach($_REQUEST['iterative_post_title_variants'] as $iptv) { 171 172 $iptv = trim($iptv); … … 174 175 $result[] = $iptv; 175 176 } 176 177 if(!empty($result)) 178 update_post_meta( $post_id, 'iterative_post_title_variants', $result); // ( $_REQUEST['iterative_post_title_variants'] ) ); 177 update_post_meta( $post_id, 'iterative_post_title_variants', $result); // ( $_REQUEST['iterative_post_title_variants'] ) ); 179 178 } 180 179 -
iterative-headlines/trunk/headlines_api.php
r1190425 r1191569 8 8 // -> Receive probabilities for each variant. 9 9 private static $api_endpoint = "http://api.pathfinding.ca/"; 10 private static $api_version = 1. 2;10 private static $api_version = 1.3; 11 11 private static $reject_age = 86400; 12 12 private static $request_age = 14440; … … 110 110 111 111 // get the most recent parameters. if they don't exist, call serverProbabilities. 112 if($model_type === null) die("NO MT?");113 112 $post_meta = get_post_meta($post_id, "_iterative_parameters_{$model_type}_{$type}", true); 114 113 if($post_meta == "" || $response['timestamp'] > time()+static::$request_age) … … 261 260 public static function getTrackerURL() { 262 261 // the logger should set an identical UID/hash cookie on api.pathfinding.ca 263 return static::$api_endpoint . "js/log?user=" . static::getUserID() . "&unique_id=" . static::getGUID() ;262 return static::$api_endpoint . "js/log?user=" . static::getUserID() . "&unique_id=" . static::getGUID() . "&refclass=" . iterative_get_referring_type();; 264 263 } 265 264 public static function getSuccessURL($type, $variant_id, $experiment_id) { -
iterative-headlines/trunk/readme.txt
r1190443 r1191569 4 4 Requires at least: 3.0.1 5 5 Tested up to: 4.2.2 6 Stable tag: 1. 26 Stable tag: 1.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.