Changeset 1734093
- Timestamp:
- 09/22/2017 06:35:47 AM (9 years ago)
- Location:
- sr-partner/trunk
- Files:
-
- 7 edited
-
includes/class-sr-partner-helper.php (modified) (2 diffs)
-
languages/sr-partner-en_US.po (modified) (1 diff)
-
languages/sr-partner.pot (modified) (1 diff)
-
public/class-sr-partner-public.php (modified) (2 diffs)
-
public/js/sr-partner-public.js (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
sr-partner.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sr-partner/trunk/includes/class-sr-partner-helper.php
r1725925 r1734093 135 135 $response = wp_remote_post( 136 136 $params['url'], 137 array( 138 'body' => $params['post_string'] 139 ) 137 [ 138 'body' => $params['post_string'], 139 'timeout' => SR_PARTNER_API_REQUEST_TIMEOUT, 140 ] 140 141 ); 142 143 $this->log($params, 'call_api'); 144 $this->log($response, 'call_api_response'); 145 146 if (is_wp_error($response)) { 147 return false; 148 } 141 149 142 150 if (is_object($response)) { 143 151 $response = $this->objectToArray($response); 144 } 145 146 $this->log($params, 'call_api'); 147 $this->log($response, 'call_api_response'); 152 } 148 153 149 154 if (isset($response['body'])) { … … 426 431 */ 427 432 public function objectToArray ($object) { 428 if (!is_object($object) && !is_array($object))433 if (!is_object($object) && !is_array($object)) { 429 434 return $object; 435 } 430 436 431 437 return array_map(array($this, 'objectToArray'), (array) $object); -
sr-partner/trunk/languages/sr-partner-en_US.po
r1717421 r1734093 492 492 msgstr "Oh snap!" 493 493 494 msgid " An unknown error occured. Please try again."495 msgstr " An unknown error occured. Please try again."494 msgid "There was a problem processing your request. Please try again." 495 msgstr "There was a problem processing your request. Please try again." 496 496 497 497 msgid "Website URL is required." -
sr-partner/trunk/languages/sr-partner.pot
r1717421 r1734093 492 492 msgstr "Oh snap!" 493 493 494 msgid " An unknown error occured. Please try again."495 msgstr " An unknown error occured. Please try again."494 msgid "There was a problem processing your request. Please try again." 495 msgstr "There was a problem processing your request. Please try again." 496 496 497 497 msgid "Website URL is required." -
sr-partner/trunk/public/class-sr-partner-public.php
r1717421 r1734093 77 77 success : "'. __("Success!","sr-partner") .'", 78 78 oh_snap : "'. __("Oh snap!","sr-partner") .'", 79 error_occured : "'. __(" An unknown error occured. Please try again.","sr-partner") .'",79 error_occured : "'. __("There was a problem processing your request. Please try again.","sr-partner") .'", 80 80 web_url_required : "'. __("Website URL is required.","sr-partner") .'", 81 81 web_url_invalid : "'. __("Website URL is invalid.","sr-partner") .'", … … 181 181 $api_params['post_string'] = $params; 182 182 183 $res = $this->_helper->call_api($api_params); 184 $post_response = json_decode($res, true); 183 $res = $this->_helper->call_api($api_params); 184 185 if (!empty($res)) { 186 $post_response = json_decode($res, true); 187 } else { 188 $post_response = [ 189 'statusCode' => '422', 190 'response' => ['error' => __("There was a problem processing your request. Please try again.","sr-partner")] 191 ]; 192 } 185 193 186 194 echo json_encode($post_response); -
sr-partner/trunk/public/js/sr-partner-public.js
r1717421 r1734093 435 435 data: data, 436 436 success : function(response,status,xhr) { 437 if (response.statusCode == 200 ) {437 if (response.hasOwnProperty('statusCode') && response.statusCode == 200 ) { 438 438 439 439 _parent.setHtmlAlert('<b>'+_parent.getLocalization('success', "Success!")+'</b> '+response.response.info+'','success'); 440 441 440 $email.val(''); 442 441 $url.val(''); 443 442 444 } else if(response. statusCode == 400 || response.statusCode == 422 ) {443 } else if(response.hasOwnProperty('statusCode') && response.statusCode == 400 || response.statusCode == 422 ) { 445 444 if (typeof(response.data) !== 'undefined' && typeof(response.data.error) !== 'undefined') { 446 445 _parent.setHtmlAlert('<b>'+_parent.getLocalization('oh_snap', "Oh snap!")+'</b> '+response.data.error+'','danger'); … … 448 447 _parent.setHtmlAlert('<b>'+_parent.getLocalization('oh_snap', "Oh snap!")+'</b> '+response.response.error+'','danger'); 449 448 } else { 450 _parent.setHtmlAlert('<b>'+_parent.getLocalization('oh_snap', "Oh snap!")+'</b> '+_parent.getLocalization('error_occured', " An unknown error occured. Please try again."),'danger');449 _parent.setHtmlAlert('<b>'+_parent.getLocalization('oh_snap', "Oh snap!")+'</b> '+_parent.getLocalization('error_occured', "There was a problem processing your request. Please try again."),'danger'); 451 450 } 452 451 453 452 } else { 454 _parent.setHtmlAlert('<b>'+_parent.getLocalization('oh_snap', "Oh snap!")+'</b> '+_parent.getLocalization('error_occured', " An unknown error occured. Please try again."),'danger');453 _parent.setHtmlAlert('<b>'+_parent.getLocalization('oh_snap', "Oh snap!")+'</b> '+_parent.getLocalization('error_occured', "There was a problem processing your request. Please try again."),'danger'); 455 454 } 456 455 _parent.addLoaderWrapperEvents(); 457 456 }, 458 457 error : function(xhr,status,error) { 459 _parent.setHtmlAlert('<b>'+_parent.getLocalization('oh_snap', "Oh snap!")+'</b> '+_parent.getLocalization('error_occured', " An unknown error occured. Please try again."),'danger');458 _parent.setHtmlAlert('<b>'+_parent.getLocalization('oh_snap', "Oh snap!")+'</b> '+_parent.getLocalization('error_occured', "There was a problem processing your request. Please try again."),'danger'); 460 459 _parent.addLoaderWrapperEvents(); 461 460 } -
sr-partner/trunk/readme.txt
r1725925 r1734093 4 4 Requires at least: 4.6 5 5 Tested up to: 4.8.1 6 Stable tag: 1.1. 46 Stable tag: 1.1.5 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 49 49 == Changelog == 50 50 51 = 1.1.5 = 52 53 * Release date: September 22, 2017 54 55 **Bug fixes** 56 * Fixed request timeouts on some cases when using web audit widget. 57 51 58 = 1.1.4 = 52 59 -
sr-partner/trunk/sr-partner.php
r1725925 r1734093 17 17 * Plugin URI: https://www.seoreseller.com/ 18 18 * Description: SEOReseller's suite of tools for building, managing, and growing your digital marketing agency. 19 * Version: 1.1. 419 * Version: 1.1.5 20 20 * Author: SEOReseller Team 21 21 * Author URI: https://www.seoreseller.com/ … … 27 27 28 28 // If this file is called directly, abort. 29 if ( ! defined( 'WPINC' )) {29 if (!defined('WPINC')) { 30 30 die; 31 31 } … … 39 39 */ 40 40 41 const SR_PARTNER_MIN_PHP_VERSION_REQUIRED = '5.0'; 42 43 const SR_PARTNER_PLUGIN_NAME = 'sr-partner'; 44 45 const SR_PARTNER_VERSION = '1.1.4'; 46 const SR_PARTNER_DEBUG = false; 47 48 const SR_PARTNER_GENERATE_URL = 'https://www.accesshub.co/web-audit-generator'; 49 const SR_PARTNER_DASHBOARD_URL = 'https://www.accesshub.co/'; 50 const SR_PARTNER_PORTFOLIO_URL = 'https://view.accesshub.co/'; 51 52 const SR_PARTNER_ACCOUNT_URL = 'https://account.seoreseller.com'; 53 const SR_PARTNER_HELPCENTER_URL = 'http://helpcenter.seoreseller.com'; 54 55 const SR_PARTNER_GEN_KEY = 'sr_partner_api_key'; 56 const SR_PARTNER_ADMIN_NOTICE = 'sr_partner_admin_notice'; 57 58 const SR_PARTNER_INSTALL_TO_ALL_PAGES = 'sr_partner_install_to_all_pages'; 59 const SR_PARTNER_INSTALLED_TO_ALL = 'sr_partner_installed_to_all'; 60 61 const SR_PARTNER_DASHBOARD_PAGE_TITLE = 'Dashboard'; 62 const SR_PARTNER_DASHBOARD_PAGE_INFO = 'sr_partner_dashboard_page_info'; 63 64 const SR_PARTNER_PORTFOLIO_PAGE_TITLE = 'Web Portfolio'; 65 const SR_PARTNER_PORTFOLIO_PAGE_INFO = 'sr_partner_portfolio_page_info'; 66 67 const SR_PARTNER_DASHBOARD_STATUS = 'sr_partner_dashboard_status'; 68 const SR_PARTNER_PORTFOLIO_STATUS = 'sr_partner_portfolio_status'; 69 const PARTNER_PLUGIN_STATUS = 'sr_partner_audit_status'; 70 const SR_PARTNER_LEAD_STATUS = 'sr_partner_lead_status'; 71 72 const SR_PARTNER_ALERT_MESSAGES = 'sr_partner_alert_messages'; 41 defined('SR_PARTNER_MIN_PHP_VERSION_REQUIRED') || define('SR_PARTNER_MIN_PHP_VERSION_REQUIRED', '5.0'); 42 43 defined('SR_PARTNER_PLUGIN_NAME') || define('SR_PARTNER_PLUGIN_NAME', 'sr-partner'); 44 45 defined('SR_PARTNER_VERSION') || define('SR_PARTNER_VERSION', '1.1.5'); 46 defined('SR_PARTNER_DEBUG') || define('SR_PARTNER_DEBUG', false); 47 48 defined('SR_PARTNER_GENERATE_URL') || define('SR_PARTNER_GENERATE_URL', 'https://www.accesshub.co/web-audit-generator'); 49 defined('SR_PARTNER_DASHBOARD_URL') || define('SR_PARTNER_DASHBOARD_URL', 'https://www.accesshub.co/'); 50 defined('SR_PARTNER_PORTFOLIO_URL') || define('SR_PARTNER_PORTFOLIO_URL', 'https://view.accesshub.co/'); 51 52 defined('SR_PARTNER_ACCOUNT_URL') || define('SR_PARTNER_ACCOUNT_URL', 'https://account.seoreseller.com'); 53 defined('SR_PARTNER_HELPCENTER_URL') || define('SR_PARTNER_HELPCENTER_URL', 'http://helpcenter.seoreseller.com'); 54 55 defined('SR_PARTNER_GEN_KEY') || define('SR_PARTNER_GEN_KEY', 'sr_partner_api_key'); 56 defined('SR_PARTNER_ADMIN_NOTICE') || define('SR_PARTNER_ADMIN_NOTICE', 'sr_partner_admin_notice'); 57 58 defined('SR_PARTNER_INSTALL_TO_ALL_PAGES') || define('SR_PARTNER_INSTALL_TO_ALL_PAGES', 'sr_partner_install_to_all_pages'); 59 defined('SR_PARTNER_INSTALLED_TO_ALL') || define('SR_PARTNER_INSTALLED_TO_ALL', 'sr_partner_installed_to_all'); 60 61 defined('SR_PARTNER_DASHBOARD_PAGE_TITLE') || define('SR_PARTNER_DASHBOARD_PAGE_TITLE', 'Dashboard'); 62 defined('SR_PARTNER_DASHBOARD_PAGE_INFO') || define('SR_PARTNER_DASHBOARD_PAGE_INFO', 'sr_partner_dashboard_page_info'); 63 64 defined('SR_PARTNER_PORTFOLIO_PAGE_TITLE') || define('SR_PARTNER_PORTFOLIO_PAGE_TITLE', 'Web Portfolio'); 65 defined('SR_PARTNER_PORTFOLIO_PAGE_INFO') || define('SR_PARTNER_PORTFOLIO_PAGE_INFO', 'sr_partner_portfolio_page_info'); 66 67 defined('SR_PARTNER_DASHBOARD_STATUS') || define('SR_PARTNER_DASHBOARD_STATUS', 'sr_partner_dashboard_status'); 68 defined('SR_PARTNER_PORTFOLIO_STATUS') || define('SR_PARTNER_PORTFOLIO_STATUS', 'sr_partner_portfolio_status'); 69 defined('PARTNER_PLUGIN_STATUS') || define('PARTNER_PLUGIN_STATUS', 'sr_partner_audit_status'); 70 defined('SR_PARTNER_LEAD_STATUS') || define('SR_PARTNER_LEAD_STATUS', 'sr_partner_lead_status'); 71 72 defined('SR_PARTNER_ALERT_MESSAGES') || define('SR_PARTNER_ALERT_MESSAGES', 'sr_partner_alert_messages'); 73 defined('SR_PARTNER_API_REQUEST_TIMEOUT') || define('SR_PARTNER_API_REQUEST_TIMEOUT', 30); 73 74 74 75 /**
Note: See TracChangeset
for help on using the changeset viewer.