Changeset 1466398
- Timestamp:
- 08/02/2016 06:51:49 PM (10 years ago)
- Location:
- pixelshop-integration/trunk
- Files:
-
- 3 edited
-
core/controllers/export.php (modified) (2 diffs)
-
pixelshop.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pixelshop-integration/trunk/core/controllers/export.php
r1325817 r1466398 101 101 $products[$i] = array( 102 102 "sync_id" => $the_query->post->ID, 103 "link" => wp_get_shortlink($the_query->post->ID) ,103 "link" => wp_get_shortlink($the_query->post->ID) . '&pixelshop=true', 104 104 "title" => get_the_title(), 105 105 "description" => get_the_excerpt(), … … 134 134 add_option( 'pixelshop_message', $export, '', 'yes' ); 135 135 136 $time = 60*60*24;137 138 if( get_option('pxs_last_export') === false )139 add_option( 'pxs_last_export', time() + $time, '', 'no' );140 else141 update_option( 'pxs_last_export', time() + $time );136 // $time = 60*60*24; 137 138 // if( get_option('pxs_last_export') === false ) 139 // add_option( 'pxs_last_export', time() + $time, '', 'no' ); 140 // else 141 // update_option( 'pxs_last_export', time() + $time ); 142 142 } 143 143 } -
pixelshop-integration/trunk/pixelshop.php
r1325820 r1466398 4 4 Plugin URI: http://pixelshop.io 5 5 Description: Wordpress plugin for pixelshop.io Integration. 6 Version: 1. 1.06 Version: 1.2.0 7 7 Author: Pixelshop 8 8 Author URI: http://pixelshop.io/ … … 192 192 } 193 193 } 194 195 196 /** 197 * Get user location by IP 198 * @return array user info 199 */ 200 function get_user_location() 201 { 202 $source = "http://ip-api.com/json/" . $_SERVER['REMOTE_ADDR']; 203 204 $ch = curl_init(); 205 206 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 207 208 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 209 210 curl_setopt($ch, CURLOPT_URL, $source); 211 212 $result = curl_exec($ch); 213 214 curl_close($ch); 215 216 return json_decode($result, true); 217 } 194 218 195 219 … … 213 237 { 214 238 include_once('core/controllers/export.php'); 239 } 240 else 241 { 242 include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 243 244 if( isset($_GET['pixelshop']) && isset($_SERVER['REMOTE_ADDR']) && is_plugin_active('sitepress-multilingual-cms/sitepress.php') && function_exists('curl_version') ) 245 { 246 $info = $this->get_user_location(); 247 248 $post_id = intval($_GET['p']); 249 250 if( isset($info['countryCode']) ) 251 { 252 if( $info['countryCode'] == 'IL' ) 253 { 254 $translation = icl_object_id($post_id, 'post', false, 'he'); 255 } 256 257 if( $translation ) 258 { 259 $url = get_permalink($translation); 260 261 $_SERVER['REQUEST_URI'] = str_replace('pixelshop=true', '', $_SERVER['REQUEST_URI']); 262 263 wp_redirect($url); 264 } 265 } 266 } 215 267 } 216 268 … … 274 326 if( isset($_POST['nonce']) && wp_verify_nonce($_POST['nonce'], 'api_key') ) 275 327 { 276 $api_key = get_option(' api_key');328 $api_key = get_option('pixelshop_key'); 277 329 278 330 if( $api_key === false ) -
pixelshop-integration/trunk/readme.txt
r1336930 r1466398 3 3 Tags: pixelshop, 4 4 Requires at least: 3.5.0 5 Tested up to: 4. 4.15 Tested up to: 4.5.1 6 6 Stable tag: 4.4.3 7 7 License: GPLv2 or later … … 39 39 </p> 40 40 41 = 1.2.0 = 42 * WPML support for products. 43 * Allow multi export per day. 44 41 45 = 1.1.0 = 42 46 * Pixelshop Conversion Pixel.
Note: See TracChangeset
for help on using the changeset viewer.