Changeset 711146
- Timestamp:
- 05/11/2013 12:00:25 AM (13 years ago)
- Location:
- shopsite-plugin/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
shopsite.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shopsite-plugin/trunk/readme.txt
r573301 r711146 3 3 Tags: e-commerce, shopping, shopsite 4 4 Requires at least: 3.2.0 5 Tested up to: 3. 3.15 Tested up to: 3.5.1 6 6 Stable tag: trunk 7 7 … … 29 29 30 30 == Changelog == 31 = 1.3 = 32 * Changed shopper-facing product download method to allow product display in the blog for some PHP config settings. 33 31 34 = 1.2 = 32 35 * Added a Test Connection button on the configuration screen. Added a 30-second connection timeout. -
shopsite-plugin/trunk/shopsite.php
r573301 r711146 300 300 ); 301 301 302 303 302 304 if (!$products_xml['success']) { 303 305 echo $products_xml['error']; … … 498 500 $url = $shopsite_url."&operation=get_products&".$identifier."_list=".$id_list."&signature=".$signature; 499 501 ///debug_print($url); 500 $url_openable = ini_get('allow_url_fopen');502 /*$url_openable = ini_get('allow_url_fopen'); 501 503 ini_set('allow_url_fopen', true); 502 504 $handle = fopen($url,'r'); 503 505 ini_set('allow_url_fopen', $url_openable); 504 print(stream_get_contents($handle)); 506 print(stream_get_contents($handle));*/ 507 print(curl_open($url)); 505 508 } 506 509 507 510 function test_connection() { 511 512 if (!in_array ('curl', get_loaded_extensions())) { 513 return array("success"=>false, "error"=>"CURL PHP extension is not installed on your server. Contact your hosting provider."); 514 } 515 508 516 $test_download_xml = oauth( 509 517 get_option('clientid'), get_option('secretkey'), get_option('code'), get_option('authorizationurl'), … … 516 524 517 525 518 $shopsite_url = get_option('shopsite_url');526 /*$shopsite_url = get_option('shopsite_url'); 519 527 $url_openable = ini_get('allow_url_fopen'); 520 528 ini_set('allow_url_fopen', true); … … 524 532 525 533 if ($handle == false) 534 return array("success"=>false, "error"=>"Check your callback URL");*/ 535 536 if (curl_open(get_option('shopsite_url')) == false) 526 537 return array("success"=>false, "error"=>"Check your callback URL"); 527 538 … … 533 544 } 534 545 546 function curl_open($url) { 547 $ch = curl_init(); 548 curl_setopt($ch, CURLOPT_URL, $url); 549 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 550 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); 551 $html = curl_exec($ch); 552 curl_close($ch); 553 554 return $html; 555 } 556 535 557 ?>
Note: See TracChangeset
for help on using the changeset viewer.