Changeset 832241
- Timestamp:
- 01/03/2014 01:27:40 PM (12 years ago)
- Location:
- zemanta
- Files:
-
- 4 edited
- 1 copied
-
tags/1.2.3 (copied) (copied from zemanta/trunk)
-
tags/1.2.3/readme.txt (modified) (2 diffs)
-
tags/1.2.3/zemanta.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/zemanta.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
zemanta/tags/1.2.3/readme.txt
r699660 r832241 3 3 Tags: related posts, posts, thumbnails, images, post, seo, related content, widget, plugin, popular posts, similar posts, related, nrelate, outbrain 4 4 Requires at least: 2.8 5 Tested up to: 3. 56 Stable Tag: 1.2. 25 Tested up to: 3.8 6 Stable Tag: 1.2.3 7 7 8 8 This plugin finds related posts and related images while you write your post. Pick related posts manually! … … 80 80 == Changelog == 81 81 82 = 1.2.3 = 83 * Code clean-up, remove unused functions 84 * Changed default image size from 300 to 350 pixels (resolutions are increasing) 85 * Tested with 3.8 86 82 87 = 1.2.2 = 83 88 * Dropped custom path support for uploader -
zemanta/tags/1.2.3/zemanta.php
r650146 r832241 7 7 Plugin URI: http://wordpress.org/extend/plugins/zemanta/ 8 8 Description: Contextual suggestions of related posts, images and tags that makes your blogging fun and efficient. 9 Version: 1.2. 29 Version: 1.2.3 10 10 Author: Zemanta Ltd. 11 11 Author URI: http://www.zemanta.com/ … … 39 39 class Zemanta { 40 40 41 var $version = '1.2. 2';41 var $version = '1.2.3'; 42 42 var $api_url = 'http://api.zemanta.com/services/rest/0.0/'; 43 43 var $api_key = ''; … … 78 78 public function init() 79 79 { 80 add_action('wp_ajax_zemanta', array($this, 'proxy'));81 80 add_action('wp_ajax_zemanta_set_featured_image', array($this, 'ajax_zemanta_set_featured_image')); 82 81 add_action('edit_form_advanced', array($this, 'assets'), 1); … … 381 380 $this->render('options', array( 382 381 'api_key' => $this->api_key, 383 //'api_test' => $this->api_test(),384 382 'is_pro' => $this->is_pro() 385 383 )); … … 627 625 } 628 626 629 /**630 * api_test631 *632 * Test the API633 */634 public function api_test()635 {636 $response = $this->api(array(637 'method' => 'zemanta.suggest'638 ,'text'=> ''639 ));640 641 if (is_wp_error($response)) {642 return __('API ERROR', 'zemanta');643 } else {644 $matches = $this->match('/<status>(.+?)<\/status>/', $response['body']);645 646 return !$matches ? __('Invalid Response', 'zemanta') . ': "' . @htmlspecialchars($response) . '"' : $matches[1];647 }648 }649 650 /**651 * proxy652 *653 * Work as a proxy for the embedded Zemanta widget654 */655 public function proxy()656 {657 if (!isset($_POST['api_key']))658 {659 header($_SERVER['SERVER_PROTOCOL'] . ' 500');660 header('Content-Type: text/plain');661 662 die('No API Key.');663 }664 665 $arguments = $_POST;666 667 $base = dirname(__FILE__);668 669 if (file_exists($base . '/SECRET.php'))670 {671 require_once($base . '/SECRET.php');672 673 if (defined('ZEMANTA_SECRET'))674 {675 $arguments['signature'] = ZEMANTA_SECRET . join('', $arguments);676 }677 }678 679 $arguments['format'] = 'json';680 681 if (isset($arguments['text']) && $arguments['method'] == 'zemanta.suggest')682 {683 $arguments['text'] = apply_filters('zemanta_proxy_text_filter', $arguments['text']);684 }685 686 $response = $this->api($arguments);687 688 if ($response['response']['code'] != 200)689 {690 header($_SERVER['SERVER_PROTOCOL'] . ' 500');691 header('Content-Type: text/plain');692 693 die($response['response']['message']);694 }695 else696 {697 header('Content-Type: text/plain');698 699 echo $response['body'];700 }701 702 die('');703 }704 627 705 628 /** -
zemanta/trunk/readme.txt
r699660 r832241 3 3 Tags: related posts, posts, thumbnails, images, post, seo, related content, widget, plugin, popular posts, similar posts, related, nrelate, outbrain 4 4 Requires at least: 2.8 5 Tested up to: 3. 56 Stable Tag: 1.2. 25 Tested up to: 3.8 6 Stable Tag: 1.2.3 7 7 8 8 This plugin finds related posts and related images while you write your post. Pick related posts manually! … … 80 80 == Changelog == 81 81 82 = 1.2.3 = 83 * Code clean-up, remove unused functions 84 * Changed default image size from 300 to 350 pixels (resolutions are increasing) 85 * Tested with 3.8 86 82 87 = 1.2.2 = 83 88 * Dropped custom path support for uploader -
zemanta/trunk/zemanta.php
r650146 r832241 7 7 Plugin URI: http://wordpress.org/extend/plugins/zemanta/ 8 8 Description: Contextual suggestions of related posts, images and tags that makes your blogging fun and efficient. 9 Version: 1.2. 29 Version: 1.2.3 10 10 Author: Zemanta Ltd. 11 11 Author URI: http://www.zemanta.com/ … … 39 39 class Zemanta { 40 40 41 var $version = '1.2. 2';41 var $version = '1.2.3'; 42 42 var $api_url = 'http://api.zemanta.com/services/rest/0.0/'; 43 43 var $api_key = ''; … … 78 78 public function init() 79 79 { 80 add_action('wp_ajax_zemanta', array($this, 'proxy'));81 80 add_action('wp_ajax_zemanta_set_featured_image', array($this, 'ajax_zemanta_set_featured_image')); 82 81 add_action('edit_form_advanced', array($this, 'assets'), 1); … … 381 380 $this->render('options', array( 382 381 'api_key' => $this->api_key, 383 //'api_test' => $this->api_test(),384 382 'is_pro' => $this->is_pro() 385 383 )); … … 627 625 } 628 626 629 /**630 * api_test631 *632 * Test the API633 */634 public function api_test()635 {636 $response = $this->api(array(637 'method' => 'zemanta.suggest'638 ,'text'=> ''639 ));640 641 if (is_wp_error($response)) {642 return __('API ERROR', 'zemanta');643 } else {644 $matches = $this->match('/<status>(.+?)<\/status>/', $response['body']);645 646 return !$matches ? __('Invalid Response', 'zemanta') . ': "' . @htmlspecialchars($response) . '"' : $matches[1];647 }648 }649 650 /**651 * proxy652 *653 * Work as a proxy for the embedded Zemanta widget654 */655 public function proxy()656 {657 if (!isset($_POST['api_key']))658 {659 header($_SERVER['SERVER_PROTOCOL'] . ' 500');660 header('Content-Type: text/plain');661 662 die('No API Key.');663 }664 665 $arguments = $_POST;666 667 $base = dirname(__FILE__);668 669 if (file_exists($base . '/SECRET.php'))670 {671 require_once($base . '/SECRET.php');672 673 if (defined('ZEMANTA_SECRET'))674 {675 $arguments['signature'] = ZEMANTA_SECRET . join('', $arguments);676 }677 }678 679 $arguments['format'] = 'json';680 681 if (isset($arguments['text']) && $arguments['method'] == 'zemanta.suggest')682 {683 $arguments['text'] = apply_filters('zemanta_proxy_text_filter', $arguments['text']);684 }685 686 $response = $this->api($arguments);687 688 if ($response['response']['code'] != 200)689 {690 header($_SERVER['SERVER_PROTOCOL'] . ' 500');691 header('Content-Type: text/plain');692 693 die($response['response']['message']);694 }695 else696 {697 header('Content-Type: text/plain');698 699 echo $response['body'];700 }701 702 die('');703 }704 627 705 628 /**
Note: See TracChangeset
for help on using the changeset viewer.