├── README.md ├── assets ├── css │ ├── jquery.timepicker.css │ ├── social.css │ └── social.less └── js │ ├── jquery.timepicker.min.js │ ├── jsbn.js │ ├── jsbn2.js │ ├── json2.js │ ├── prng4.js │ ├── rng.js │ ├── rsa.js │ ├── rsa2.js │ ├── sjcl.js │ └── social.js ├── classes ├── class-support-hub-account.php ├── class-support-hub-extension.php ├── class-support-hub-extra.php ├── class-support-hub-item.php ├── class-support-hub-message.php ├── class-support-hub-outbox.php ├── class-support-hub-product.php ├── class-support-hub-table.php ├── class-support-hub-user.php ├── class-support-hub.php ├── ucm.database.php └── ucm.form.php ├── composer.json ├── composer.lock ├── extensions ├── bbpress │ ├── bbpress_message.php │ ├── bbpress_settings.php │ ├── class.shub_bbpress.php │ ├── class.shub_bbpress_account.php │ ├── class.shub_bbpress_forum.php │ ├── class.shub_bbpress_message.php │ ├── class.shub_bbpress_user.php │ ├── default-user.jpg │ ├── init.bbpress.php │ ├── logo.png │ ├── shub_bbpress.css │ └── shub_bbpress.js ├── envato │ ├── class.envato-api.php │ ├── class.shub_envato.php │ ├── class.shub_envato_account.php │ ├── class.shub_envato_item.php │ ├── class.shub_envato_message.php │ ├── class.shub_envato_user.php │ ├── default-user.jpg │ ├── envato_message.php │ ├── envato_settings.php │ ├── init.envato.php │ ├── logo.png │ ├── shub_envato.css │ └── shub_envato.js ├── index.php └── ucm │ ├── class.shub_ucm.php │ ├── class.shub_ucm_account.php │ ├── class.shub_ucm_item.php │ ├── class.shub_ucm_message.php │ ├── class.shub_ucm_user.php │ ├── class.ucm-api.php │ ├── init.ucm.php │ ├── logo.png │ ├── shub_ucm.js │ ├── ucm_message.php │ └── ucm_settings.php ├── index.php ├── lang └── info.txt ├── pages ├── compose.php ├── dashboard.php ├── extra-data-view.php ├── inbox.php ├── interactions.php ├── message.php ├── metabox.php ├── outbox.php ├── sent.php ├── settings-extra.php ├── settings-logs.php ├── settings-products.php ├── settings.php └── setup.php ├── readme.txt ├── support-hub.php ├── templates ├── shub_external_footer.php ├── shub_external_header.php └── shub_extra_request_form.php └── vendor ├── autoload.php ├── composer ├── ClassLoader.php ├── LICENSE ├── autoload_classmap.php ├── autoload_namespaces.php ├── autoload_psr4.php ├── autoload_real.php └── installed.json └── hieu-le └── wordpress-xmlrpc-client ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── apigen.conf ├── composer.json ├── phpunit.xml └── src ├── Exception ├── NetworkException.php └── XmlrpcException.php └── WordpressClient.php /README.md: -------------------------------------------------------------------------------- 1 | # Support Hub 2 | Support Hub is a free WordPress plugin that helps you provide support for your products and businesses. 3 | 4 | Details on the website here: http://supporthub.co/ 5 | 6 | And in the forum here: http://codecanyon.net/forums/thread/supporthub/189239 -------------------------------------------------------------------------------- /assets/css/jquery.timepicker.css: -------------------------------------------------------------------------------- 1 | .time_field{ 2 | width:67px; 3 | } 4 | 5 | .ui-timepicker-wrapper { 6 | overflow-y: auto; 7 | height: 150px; 8 | width: 6.5em; 9 | background: #fff; 10 | border: 1px solid #ddd; 11 | -webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2); 12 | -moz-box-shadow:0 5px 10px rgba(0,0,0,0.2); 13 | box-shadow:0 5px 10px rgba(0,0,0,0.2); 14 | outline: none; 15 | z-index: 10001; 16 | margin: 0; 17 | } 18 | 19 | .ui-timepicker-wrapper.ui-timepicker-with-duration { 20 | width: 11em; 21 | } 22 | 23 | .ui-timepicker-list { 24 | margin: 0; 25 | padding: 0; 26 | list-style: none; 27 | } 28 | 29 | .ui-timepicker-duration { 30 | margin-left: 5px; color: #888; 31 | } 32 | 33 | .ui-timepicker-list:hover .ui-timepicker-duration { 34 | color: #888; 35 | } 36 | 37 | .ui-timepicker-list li { 38 | padding: 3px 0 3px 5px; 39 | cursor: pointer; 40 | white-space: nowrap; 41 | color: #000; 42 | list-style: none; 43 | margin: 0; 44 | } 45 | 46 | .ui-timepicker-list:hover .ui-timepicker-selected { 47 | background: #fff; color: #000; 48 | } 49 | 50 | li.ui-timepicker-selected, 51 | .ui-timepicker-list li:hover, 52 | .ui-timepicker-list .ui-timepicker-selected:hover { 53 | background: #1980EC; color: #fff; 54 | } 55 | 56 | li.ui-timepicker-selected .ui-timepicker-duration, 57 | .ui-timepicker-list li:hover .ui-timepicker-duration { 58 | color: #ccc; 59 | } 60 | 61 | .ui-timepicker-list li.ui-timepicker-disabled, 62 | .ui-timepicker-list li.ui-timepicker-disabled:hover, 63 | .ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled { 64 | color: #888; 65 | cursor: default; 66 | } 67 | 68 | .ui-timepicker-list li.ui-timepicker-disabled:hover, 69 | .ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled { 70 | background: #f2f2f2; 71 | } 72 | -------------------------------------------------------------------------------- /assets/js/jquery.timepicker.min.js: -------------------------------------------------------------------------------- 1 | !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){function b(a){if(a.minTime&&(a.minTime=s(a.minTime)),a.maxTime&&(a.maxTime=s(a.maxTime)),a.durationTime&&"function"!=typeof a.durationTime&&(a.durationTime=s(a.durationTime)),a.disableTimeRanges.length>0){for(var b in a.disableTimeRanges)a.disableTimeRanges[b]=[s(a.disableTimeRanges[b][0]),s(a.disableTimeRanges[b][1])];a.disableTimeRanges=a.disableTimeRanges.sort(function(a,b){return a[0]-b[0]});for(var b=a.disableTimeRanges.length-1;b>0;b--)a.disableTimeRanges[b][0]<=a.disableTimeRanges[b-1][1]&&(a.disableTimeRanges[b-1]=[Math.min(a.disableTimeRanges[b][0],a.disableTimeRanges[b-1][0]),Math.max(a.disableTimeRanges[b][1],a.disableTimeRanges[b-1][1])],a.disableTimeRanges.splice(b,1))}return a}function c(b){var c=b.data("timepicker-settings"),f=b.data("timepicker-list");if(f&&f.length&&(f.remove(),b.data("timepicker-list",!1)),c.useSelect){f=a(" 27 | get( 'shub_account_id' ) ); ?> 28 | array( 31 | 'type' => 'h3', 32 | 'title' => 'Compose message', 33 | ), 34 | 'class' => 'tableclass tableclass_form tableclass_full', 35 | 'elements' => array( 36 | 'item' => array( 37 | 'title' => __('bbpress Group', 'support_hub'), 38 | 'fields' => array(), 39 | ), 40 | 'message' => array( 41 | 'title' => __('message', 'support_hub'), 42 | 'field' => array( 43 | 'type' => 'textarea', 44 | 'name' => 'message', 45 | 'id' => 'bbpress_compose_message', 46 | 'value' => '', 47 | ), 48 | ), 49 | 'type' => array( 50 | 'title' => __('Type', 'support_hub'), 51 | 'fields' => array( 52 | ' ', 53 | '', 56 | ' ', 57 | '', 60 | ' ', 61 | '', 64 | ), 65 | ), 66 | 'link' => array( 67 | 'title' => __('Link', 'support_hub'), 68 | 'fields' => array( 69 | array( 70 | 'type' => 'text', 71 | 'name' => 'link', 72 | 'id' => 'message_link_url', 73 | 'value' => '', 74 | ), 75 | '', 76 | '', // flag for our JS hide/show hack 77 | ), 78 | ), 79 | 'link_picture' => array( 80 | 'title' => __('Link Picture', 'support_hub'), 81 | 'fields' => array( 82 | array( 83 | 'type' => 'text', 84 | 'name' => 'link_picture', 85 | 'value' => '', 86 | ), 87 | ('Full URL (eg: http://) to the picture to use for this link preview'), 88 | '', // flag for our JS hide/show hack 89 | ), 90 | ), 91 | 'link_name' => array( 92 | 'title' => __('Link Title', 'support_hub'), 93 | 'fields' => array( 94 | array( 95 | 'type' => 'text', 96 | 'name' => 'link_name', 97 | 'value' => '', 98 | ), 99 | ('Title to use instead of the automatically generated one from the Link page'), 100 | '', // flag for our JS hide/show hack 101 | ), 102 | ), 103 | 'link_caption' => array( 104 | 'title' => __('Link Caption', 'support_hub'), 105 | 'fields' => array( 106 | array( 107 | 'type' => 'text', 108 | 'name' => 'link_caption', 109 | 'value' => '', 110 | ), 111 | ('Caption to use instead of the automatically generated one from the Link page'), 112 | '', // flag for our JS hide/show hack 113 | ), 114 | ), 115 | 'link_description' => array( 116 | 'title' => __('Link Description', 'support_hub'), 117 | 'fields' => array( 118 | array( 119 | 'type' => 'text', 120 | 'name' => 'link_description', 121 | 'value' => '', 122 | ), 123 | ('Description to use instead of the automatically generated one from the Link page'), 124 | '', // flag for our JS hide/show hack 125 | ), 126 | ), 127 | /*'track' => array( 128 | 'title' => __('Track clicks', 'support_hub'), 129 | 'field' => array( 130 | 'type' => 'check', 131 | 'name' => 'track_links', 132 | 'value' => '1', 133 | 'help' => 'If this is selected, the links will be automatically shortened so we can track how many clicks are received.', 134 | 'checked' => false, 135 | ), 136 | ),*/ 137 | 'picture' => array( 138 | 'title' => __('Picture', 'support_hub'), 139 | 'fields' => array( 140 | '', 141 | '', // flag for our JS hide/show hack 142 | ), 143 | ), 144 | 'schedule' => array( 145 | 'title' => __('Schedule', 'support_hub'), 146 | 'fields' => array( 147 | array( 148 | 'type' => 'date', 149 | 'name' => 'schedule_date', 150 | 'value' => '', 151 | ), 152 | array( 153 | 'type' => 'time', 154 | 'name' => 'schedule_time', 155 | 'value' => '', 156 | ), 157 | ' ', 158 | sprintf(__('Currently: %s','support_hub'),date('c')), 159 | ' (Leave blank to send now, or pick a date in the future.)', 160 | ), 161 | ), 162 | 'debug' => array( 163 | 'title' => __('Debug', 'support_hub'), 164 | 'field' => array( 165 | 'type' => 'check', 166 | 'name' => 'debug', 167 | 'value' => '1', 168 | 'checked' => false, 169 | 'help' => 'Show debug output while posting the message', 170 | ), 171 | ), 172 | ) 173 | ); 174 | foreach($groups as $item_id => $group){ 175 | $fieldset_data['elements']['item']['fields'][] = 176 | '
' . 177 | ' ' . 178 | ' ' . 179 | htmlspecialchars($group->get('item_name')) . 180 | '
' 181 | ; 182 | } 183 | echo shub_module_form::generate_fieldset($fieldset_data); 184 | 185 | 186 | ?> 187 | 188 | 189 | 224 | 225 | 229 | -------------------------------------------------------------------------------- /extensions/bbpress/class.shub_bbpress_forum.php: -------------------------------------------------------------------------------- 1 | get_messages(array( 8 | 'shub_status' => _shub_MESSAGE_STATUS_PENDINGSEND, 9 | )); 10 | $now = time(); 11 | foreach($messages as $message){ 12 | if(isset($message['message_time']) && $message['message_time'] < $now){ 13 | $shub_bbpress_message = new shub_bbpress_message(false, $this, $message['shub_message_id']); 14 | $shub_bbpress_message->send_queued($debug); 15 | } 16 | }*/ 17 | 18 | SupportHub::getInstance()->log_data(_SUPPORT_HUB_LOG_INFO,'bbpress','Starting bbPress Cron for Forum: '.$this->get('item_name')); 19 | $this->load_latest_item_data($debug); 20 | } 21 | 22 | public function load_latest_item_data($debug = false){ 23 | // serialise this result into account_data. 24 | if(!$this->account){ 25 | echo 'No bbpress account linked, please try again'; 26 | return; 27 | } 28 | 29 | $api = $this->account->get_api(); 30 | 31 | $network_key = $this->get('network_key'); 32 | if(!$network_key){ 33 | echo 'No bbpress forum id found'; 34 | return; 35 | } 36 | 37 | // first we seed the cache with the latest bbpress replies and topics 38 | // we do this because it's not possible to filter based on "post_parent" through the WordPress API (SILLY!) 39 | // so this saves us calling getPost() a lot of times. 40 | $filter_replies = array( 41 | 'post_type' => 'reply', 42 | 'number' => 100, 43 | 'post_status' => 'publish', 44 | //'post_parent' => 45 | ); 46 | $api_result_latest_replies = $this->account->get_api_cache($filter_replies); 47 | $api_result_latest_replies = $api_result_latest_replies ? $api_result_latest_replies : $api->getPosts($filter_replies); 48 | 49 | $filter_topics = array( 50 | 'post_type' => 'topic', 51 | 'number' => 100, 52 | 'post_status' => 'publish', 53 | //'post_parent' => 54 | ); 55 | $api_result_latest_topics = $this->account->get_api_cache($filter_topics); 56 | $api_result_latest_topics = $api_result_latest_topics ? $api_result_latest_topics : $api->getPosts($filter_topics); 57 | 58 | 59 | // loop through our latest replies and see if any of them are from a thread that sits under this forum 60 | // COMPLETELY THE REVERSE WAY THAT WE SHOULD BE DOING IT! rar! 61 | 62 | $forum_topics = array(); 63 | 64 | foreach($api_result_latest_topics as $forum_topic){ 65 | if($forum_topic['post_parent'] == $network_key){ 66 | $forum_topic['timestamp'] = $forum_topic['post_date']->timestamp; 67 | // yay! this reply is part of a topic that is part of this forum. keep it. 68 | if(!isset($forum_topics[$forum_topic['post_id']])){ 69 | $forum_topics[$forum_topic['post_id']] = $forum_topic; 70 | } 71 | if(!isset($forum_topics[$forum_topic['post_id']]['replies'])){ 72 | $forum_topics[$forum_topic['post_id']]['replies'] = array(); 73 | } 74 | // we need to add our main forum_topic onto the replies array so that all messages go into the 'comments' database table. 75 | $forum_topics[$forum_topic['post_id']]['replies'][] = $forum_topic; 76 | } 77 | } 78 | foreach($api_result_latest_replies as $forum_reply){ 79 | 80 | // find its parent and see if it is from this forum. 81 | $found_parent = false; 82 | foreach($api_result_latest_topics as $forum_topic){ 83 | if($forum_topic['post_id'] == $forum_reply['post_parent']){ 84 | $found_parent = $forum_topic; 85 | break; 86 | } 87 | } 88 | if(!$found_parent){ 89 | $api_result_parent = $api->getPost($forum_reply['post_parent']); 90 | if($api_result_parent){ 91 | $found_parent = $api_result_parent; 92 | $api_result_latest_topics[] = $api_result_parent; // add to cache so we hopefully dont have to hit it again if it's a popular topic 93 | } 94 | } 95 | if($found_parent){ 96 | // found a parent post, check if it's part of this forum. 97 | if($found_parent['post_parent'] == $network_key){ 98 | $found_parent['timestamp'] = $found_parent['post_date']->timestamp; 99 | $forum_reply['timestamp'] = $forum_reply['post_date']->timestamp; 100 | // yay! this reply is part of a topic that is part of this forum. keep it. 101 | if(!isset($forum_topics[$found_parent['post_id']])){ 102 | $forum_topics[$found_parent['post_id']] = $found_parent; 103 | } 104 | if(!isset($forum_topics[$found_parent['post_id']]['replies'])){ 105 | $forum_topics[$found_parent['post_id']]['replies'] = array(); 106 | } 107 | $forum_topics[$found_parent['post_id']]['replies'][] = $found_parent; 108 | $forum_topics[$found_parent['post_id']]['replies'][] = $forum_reply; 109 | if(!isset($forum_topics[$found_parent['post_id']]['timestamp'])){ 110 | $forum_topics[$found_parent['post_id']]['timestamp'] = $found_parent['timestamp']; 111 | } 112 | $forum_topics[$found_parent['post_id']]['timestamp'] = max($forum_reply['post_date']->timestamp,$forum_topics[$found_parent['post_id']]['timestamp']); 113 | } 114 | 115 | /*echo date('Y-m-d',$forum_reply['post_date']->timestamp); 116 | echo " '".$forum_reply['link'].' '; 117 | echo $forum_reply['post_content']; 118 | echo "Parent is: "; 119 | echo date('Y-m-d',$found_parent['post_date']->timestamp); 120 | echo " '".$found_parent['link'].' '; 121 | echo '
';*/ 122 | }else{ 123 | 124 | } 125 | } 126 | uasort($forum_topics,function($a,$b){ 127 | return $a['timestamp'] < $b['timestamp']; 128 | }); 129 | // cache them for any other bbpress forum calls that are run during the same cron job process. 130 | $this->account->set_api_cache($filter_replies,$api_result_latest_replies); 131 | $this->account->set_api_cache($filter_topics,$api_result_latest_topics); 132 | 133 | 134 | // we keep a record of the last message received so we know where to stop checking the feed 135 | $last_message_received = (int)$this->get('last_message'); 136 | if($debug)echo "Getting the latest replies for forum: ".$network_key." (last message in database is from ".shub_print_date($last_message_received,true).")
\n"; 137 | 138 | $newest_message_received = 0; 139 | 140 | SupportHub::getInstance()->log_data(_SUPPORT_HUB_LOG_INFO,'bbpress','Found total of '.count($forum_topics)." forum topics from API calls"); 141 | $count = 0; 142 | foreach($forum_topics as $forum_topic){ 143 | $message_time = $forum_topic['timestamp']; 144 | $newest_message_received = max($newest_message_received,$message_time); 145 | if($message_time <= $last_message_received)break; // all done here. 146 | 147 | $bbpress_message = new shub_bbpress_message($this->account, $this, false); 148 | $bbpress_message -> load_by_bbpress_id($forum_topic['post_id'], $forum_topic, 'forum_topic', $debug); 149 | $count++; 150 | SupportHub::getInstance()->log_data(_SUPPORT_HUB_LOG_INFO,'bbpress','Imported forum topic ID '.$bbpress_message->get( 'network_key' )." with ".count($forum_topic['replies']).' replies'); 151 | if($debug) { 152 | ?> 153 |
154 |
 Imported forum topic ID: get( 'network_key' ); ?> with  replies. 
155 |
156 | log_data(_SUPPORT_HUB_LOG_INFO, 'bbpress', 'Completed Cron Import: '.$count.' new forum topics'); 162 | if($debug)echo " imported $count new forum comments
"; 163 | 164 | $this->update('last_message',$newest_message_received); 165 | $this->update('last_checked',time()); 166 | } 167 | 168 | public function link_refresh(){ 169 | return 'admin.php?page=support_hub_settings&tab=bbpress&manualrefresh&shub_account_id='.$this->get('shub_account_id').'&network_key='.$this->get('network_key'); 170 | } 171 | 172 | 173 | } 174 | -------------------------------------------------------------------------------- /extensions/bbpress/class.shub_bbpress_user.php: -------------------------------------------------------------------------------- 1 | get('user_email')){ 8 | $hash = md5(trim($this->get('user_email'))); 9 | return '//www.gravatar.com/avatar/'.$hash.'?d=identicon'; 10 | } 11 | $default = parent::get_image(); 12 | if(!$default){ 13 | return plugins_url('extensions/bbpress/default-user.jpg',_DTBAKER_SUPPORT_HUB_CORE_FILE_); 14 | } 15 | return $default; 16 | } 17 | 18 | 19 | } -------------------------------------------------------------------------------- /extensions/bbpress/default-user.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtbaker/support-hub/21466135d584b1c3c991dc8c09c3ca3d888ec125/extensions/bbpress/default-user.jpg -------------------------------------------------------------------------------- /extensions/bbpress/init.bbpress.php: -------------------------------------------------------------------------------- 1 | id = 'bbpress'; 17 | $shub['bbpress']->friendly_name = 'bbPress'; 18 | $shub['bbpress']->desc = 'Import and Reply to WordPress bbPress forum posts.'; 19 | return $shub; 20 | } 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /extensions/bbpress/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtbaker/support-hub/21466135d584b1c3c991dc8c09c3ca3d888ec125/extensions/bbpress/logo.png -------------------------------------------------------------------------------- /extensions/bbpress/shub_bbpress.css: -------------------------------------------------------------------------------- 1 | #bbpress_edit_form a{ 2 | text-decoration: none; 3 | } 4 | .bbpress_message_full{ 5 | display: none; 6 | background: #edeff4; 7 | border-radius: 5px; 8 | padding: 0 5px; 9 | } 10 | .bbpress_message_picture{ 11 | float: left; 12 | width: 35px; 13 | margin: 0 5px 0 0; 14 | } 15 | .bbpress_message_picture img{ 16 | max-width: 100%; 17 | height: auto; 18 | } 19 | .bbpress_message_reply{ 20 | margin-left: 40px; 21 | } 22 | .bbpress_message_reply button{ 23 | float: left; 24 | height:2em; 25 | border:1px solid #bdc7d8; 26 | margin:0 0 0 5px; 27 | } 28 | .bbpress_message_compose textarea{ 29 | background: #FFF; 30 | border:1px solid #bdc7d8; 31 | width:88%; 32 | min-height:2em; 33 | resize: none; 34 | } 35 | .bbpress_message_reply textarea{ 36 | float: left; 37 | background: #FFF; 38 | border:1px solid #bdc7d8; 39 | width:88%; 40 | min-height:2em; 41 | resize: none; 42 | } 43 | .bbpress_message_body{ 44 | margin-left: 40px; 45 | } 46 | .bbpress_message_actions{ 47 | clear: both; 48 | font-size: 0.9em; 49 | margin-left: 40px; 50 | padding: 0 0 5px 0; 51 | } 52 | .bbpress_message_header{ 53 | /*display: inline; 54 | float: left;*/ 55 | padding: 0 5px 0 0; 56 | font-weight: bold; 57 | } 58 | .bbpress_message_header span{ 59 | font-weight: normal; 60 | color:#CCC; 61 | } 62 | .bbpress_message{ 63 | border-bottom: 1px solid #d0d4e4; 64 | padding: 5px 0 0 5px; 65 | } 66 | #bbpress_edit_form > .bbpress_message_replies{ 67 | margin-left: 0; 68 | border-left: none; 69 | } 70 | .bbpress_message_reply_box{ 71 | display: none; 72 | } 73 | .bbpress_message_reply_box_level1{ 74 | display: block; 75 | } 76 | .bbpress_message_replies{ 77 | margin-left: 40px; 78 | border-left: 1px solid #d0d4e4; 79 | } 80 | .bbpress_picture{ 81 | background: #FFF; 82 | padding: 4px; 83 | display: inline-block; 84 | } 85 | .bbpress_picture img{ 86 | max-width: 100%; 87 | height:auto; 88 | } 89 | .bbpress_icon{ 90 | height:27px; 91 | width: auto; 92 | margin: 5px 5px 0 0; 93 | float: left; 94 | } 95 | .bbpress_icon.small{ 96 | height:15px; 97 | float: none; 98 | vertical-align: middle; 99 | margin:0 5px 0 0; 100 | } 101 | 102 | #bbpress_message_header{ 103 | border:1px solid #d0d4e4; 104 | background: #FFF; 105 | margin:5px; 106 | padding: 8px 5px 14px 10px; 107 | } 108 | #bbpress_message_holder{ 109 | } 110 | 111 | .bbpress_message_summary.unread, 112 | .message_row_unread .bbpress_message_summary{ 113 | font-weight: bold; 114 | } 115 | .bbpress_compose_account_select img{ 116 | width:20px; 117 | height:auto; 118 | vertical-align: middle; 119 | margin:0 5px; 120 | } -------------------------------------------------------------------------------- /extensions/bbpress/shub_bbpress.js: -------------------------------------------------------------------------------- 1 | ucm.social.bbpress = { 2 | init: function(){ 3 | 4 | jQuery('body').delegate('.bbpress_check_all','change',function(){ 5 | jQuery('.check_item').prop('checked', !!jQuery(this).prop('checked')); 6 | 7 | }); 8 | } 9 | }; -------------------------------------------------------------------------------- /extensions/envato/class.shub_envato_item.php: -------------------------------------------------------------------------------- 1 | get_messages(array( 10 | 'shub_status' => _shub_MESSAGE_STATUS_PENDINGSEND, 11 | )); 12 | $now = time(); 13 | foreach($messages as $message){ 14 | if(isset($message['message_time']) && $message['message_time'] < $now){ 15 | $shub_message = new shub_envato_message(false, $this, $message['shub_message_id']); 16 | $shub_message->send_queued($debug); 17 | } 18 | }*/ 19 | 20 | $this->load_latest_item_data($debug); 21 | } 22 | 23 | public function load_latest_item_data($debug = false){ 24 | // serialise this result into envato_data. 25 | if(!$this->account){ 26 | echo 'No envato account linked, please try again'; 27 | return; 28 | } 29 | 30 | $api = $this->account->get_api(); 31 | 32 | $network_key = $this->get('network_key'); 33 | if(!$network_key){ 34 | echo 'No envato item id found'; 35 | return; 36 | } 37 | 38 | // we keep a record of the last message received so we know where to stop checking the feed 39 | $last_message_received = (int)$this->get('last_message'); 40 | if($debug)echo "Getting the latest 60 comments for item: ".$network_key." (last message in database is from ".shub_print_date($last_message_received,true).")
\n"; 41 | 42 | $newest_message_received = 0; 43 | 44 | $endpoint = 'v1/discovery/search/search/comment?term=&item_id='.$network_key.'&sort_by=newest&page_size=60'; 45 | $api_result = $api->api($endpoint); 46 | if($debug){ 47 | echo "API Result took :".$api_result['took'].' seconds and produced '.count($api_result['matches']).' results'; 48 | } 49 | 50 | $count = 0; 51 | if(isset($api_result['matches']) && is_array($api_result['matches'])){ 52 | //foreach($api_result['matches'] as $item_message){ 53 | while($api_result['matches']){ 54 | $item_message = array_pop($api_result['matches']); 55 | if(!$item_message['id'])continue; 56 | $message_time = strtotime($item_message['last_comment_at']); 57 | $newest_message_received = max($newest_message_received,$message_time); 58 | if($message_time <= $last_message_received)continue; // all done here. 59 | 60 | // check if we have this message in our database already. 61 | $envato_message = new shub_envato_message($this->account, $this, false); 62 | $envato_message -> load_by_network_key($item_message['id'], $item_message, 'item_comment', $debug); 63 | $count++; 64 | if($debug) { 65 | ?> 66 |
67 |
 Imported message ID: get( 'network_key' ); ?> 
68 |
69 | log_data(_SUPPORT_HUB_LOG_INFO, 'envato', 'Imported '.$count.' new messages into database'); 74 | if($debug)echo " imported $count new item comments
"; 75 | 76 | $this->update('last_message',$newest_message_received); 77 | $this->update('last_checked',time()); 78 | } 79 | 80 | public function link_refresh(){ 81 | return 'admin.php?page=support_hub_settings&tab=envato&manualrefresh&shub_account_id='.$this->get('shub_account_id').'&network_key='.$this->get('network_key'); 82 | } 83 | 84 | 85 | } 86 | -------------------------------------------------------------------------------- /extensions/envato/default-user.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtbaker/support-hub/21466135d584b1c3c991dc8c09c3ca3d888ec125/extensions/envato/default-user.jpg -------------------------------------------------------------------------------- /extensions/envato/envato_message.php: -------------------------------------------------------------------------------- 1 | get('shub_account_id') == $shub_account_id){ 9 | $envato_message = new shub_envato_message( $envato, false, $shub_message_id ); 10 | $envato_message->output_message_page('popup'); 11 | 12 | } 13 | } 14 | 15 | if($shub_account_id && !(int)$shub_message_id){ 16 | $envato = new shub_envato_account($shub_account_id); 17 | if($shub_account_id && $envato->get('shub_account_id') == $shub_account_id){ 18 | 19 | /* @var $groups shub_item[] */ 20 | $groups = $envato->get('groups'); 21 | //print_r($groups); 22 | ?> 23 |
24 | 25 | get( 'shub_account_id' ) ); ?> 26 | array( 29 | 'type' => 'h3', 30 | 'title' => 'Compose message', 31 | ), 32 | 'class' => 'tableclass tableclass_form tableclass_full', 33 | 'elements' => array( 34 | 'item' => array( 35 | 'title' => __('envato Group', 'support_hub'), 36 | 'fields' => array(), 37 | ), 38 | 'message' => array( 39 | 'title' => __('message', 'support_hub'), 40 | 'field' => array( 41 | 'type' => 'textarea', 42 | 'name' => 'message', 43 | 'id' => 'envato_compose_message', 44 | 'value' => '', 45 | ), 46 | ), 47 | 'type' => array( 48 | 'title' => __('Type', 'support_hub'), 49 | 'fields' => array( 50 | ' ', 51 | '', 54 | ' ', 55 | '', 58 | ' ', 59 | '', 62 | ), 63 | ), 64 | 'link' => array( 65 | 'title' => __('Link', 'support_hub'), 66 | 'fields' => array( 67 | array( 68 | 'type' => 'text', 69 | 'name' => 'link', 70 | 'id' => 'message_link_url', 71 | 'value' => '', 72 | ), 73 | '', 74 | '', // flag for our JS hide/show hack 75 | ), 76 | ), 77 | 'link_picture' => array( 78 | 'title' => __('Link Picture', 'support_hub'), 79 | 'fields' => array( 80 | array( 81 | 'type' => 'text', 82 | 'name' => 'link_picture', 83 | 'value' => '', 84 | ), 85 | ('Full URL (eg: http://) to the picture to use for this link preview'), 86 | '', // flag for our JS hide/show hack 87 | ), 88 | ), 89 | 'link_name' => array( 90 | 'title' => __('Link Title', 'support_hub'), 91 | 'fields' => array( 92 | array( 93 | 'type' => 'text', 94 | 'name' => 'link_name', 95 | 'value' => '', 96 | ), 97 | ('Title to use instead of the automatically generated one from the Link page'), 98 | '', // flag for our JS hide/show hack 99 | ), 100 | ), 101 | 'link_caption' => array( 102 | 'title' => __('Link Caption', 'support_hub'), 103 | 'fields' => array( 104 | array( 105 | 'type' => 'text', 106 | 'name' => 'link_caption', 107 | 'value' => '', 108 | ), 109 | ('Caption to use instead of the automatically generated one from the Link page'), 110 | '', // flag for our JS hide/show hack 111 | ), 112 | ), 113 | 'link_description' => array( 114 | 'title' => __('Link Description', 'support_hub'), 115 | 'fields' => array( 116 | array( 117 | 'type' => 'text', 118 | 'name' => 'link_description', 119 | 'value' => '', 120 | ), 121 | ('Description to use instead of the automatically generated one from the Link page'), 122 | '', // flag for our JS hide/show hack 123 | ), 124 | ), 125 | /*'track' => array( 126 | 'title' => __('Track clicks', 'support_hub'), 127 | 'field' => array( 128 | 'type' => 'check', 129 | 'name' => 'track_links', 130 | 'value' => '1', 131 | 'help' => 'If this is selected, the links will be automatically shortened so we can track how many clicks are received.', 132 | 'checked' => false, 133 | ), 134 | ),*/ 135 | 'picture' => array( 136 | 'title' => __('Picture', 'support_hub'), 137 | 'fields' => array( 138 | '', 139 | '', // flag for our JS hide/show hack 140 | ), 141 | ), 142 | 'schedule' => array( 143 | 'title' => __('Schedule', 'support_hub'), 144 | 'fields' => array( 145 | array( 146 | 'type' => 'date', 147 | 'name' => 'schedule_date', 148 | 'value' => '', 149 | ), 150 | array( 151 | 'type' => 'time', 152 | 'name' => 'schedule_time', 153 | 'value' => '', 154 | ), 155 | ' ', 156 | sprintf(__('Currently: %s','support_hub'),date('c')), 157 | ' (Leave blank to send now, or pick a date in the future.)', 158 | ), 159 | ), 160 | 'debug' => array( 161 | 'title' => __('Debug', 'support_hub'), 162 | 'field' => array( 163 | 'type' => 'check', 164 | 'name' => 'debug', 165 | 'value' => '1', 166 | 'checked' => false, 167 | 'help' => 'Show debug output while posting the message', 168 | ), 169 | ), 170 | ) 171 | ); 172 | foreach($groups as $item_id => $group){ 173 | $fieldset_data['elements']['item']['fields'][] = 174 | '
' . 175 | ' ' . 176 | ' ' . 177 | htmlspecialchars($group->get('item_name')) . 178 | '
' 179 | ; 180 | } 181 | echo shub_module_form::generate_fieldset($fieldset_data); 182 | 183 | 184 | ?> 185 |
186 | 187 | 222 | 223 | 227 | -------------------------------------------------------------------------------- /extensions/envato/init.envato.php: -------------------------------------------------------------------------------- 1 | id = 'envato'; 19 | $shub['envato']->friendly_name = 'Envato'; 20 | $shub['envato']->desc = 'Import and Reply to Envato item messages.'; 21 | return $shub; 22 | } 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /extensions/envato/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtbaker/support-hub/21466135d584b1c3c991dc8c09c3ca3d888ec125/extensions/envato/logo.png -------------------------------------------------------------------------------- /extensions/envato/shub_envato.css: -------------------------------------------------------------------------------- 1 | 2 | .envato_message_full{ 3 | display: none; 4 | background: #edeff4; 5 | border-radius: 5px; 6 | padding: 0 5px; 7 | } 8 | .envato_message_compose textarea{ 9 | background: #FFF; 10 | border:1px solid #bdc7d8; 11 | width:88%; 12 | min-height:2em; 13 | resize: none; 14 | } 15 | 16 | .envato_message{ 17 | border-bottom: 1px solid #d0d4e4; 18 | padding: 5px 0 0 5px; 19 | } 20 | .envato_message_replies{ 21 | margin-left: 40px; 22 | border-left: 1px solid #d0d4e4; 23 | } 24 | .envato_picture{ 25 | background: #FFF; 26 | padding: 4px; 27 | display: inline-block; 28 | } 29 | .envato_picture img{ 30 | max-width: 100%; 31 | height:auto; 32 | } 33 | .envato_icon{ 34 | height:27px; 35 | width: auto; 36 | margin: 5px 5px 0 0; 37 | float: left; 38 | } 39 | .envato_icon.small{ 40 | height:15px; 41 | float: none; 42 | vertical-align: middle; 43 | margin:0 5px 0 0; 44 | } 45 | 46 | #envato_message_header{ 47 | border:1px solid #d0d4e4; 48 | background: #FFF; 49 | margin:5px; 50 | padding: 8px 5px 14px 10px; 51 | } 52 | #envato_message_holder{ 53 | } 54 | 55 | .envato_message_summary.unread, 56 | .message_row_unread .envato_message_summary{ 57 | font-weight: bold; 58 | } 59 | .envato_compose_account_select img{ 60 | width:20px; 61 | height:auto; 62 | vertical-align: middle; 63 | margin:0 5px; 64 | } -------------------------------------------------------------------------------- /extensions/envato/shub_envato.js: -------------------------------------------------------------------------------- 1 | ucm.social.envato = { 2 | init: function(){ 3 | 4 | jQuery('body').delegate('.envato_check_all','change',function(){ 5 | jQuery('.check_item').prop('checked', !!jQuery(this).prop('checked')); 6 | 7 | }); 8 | 9 | } 10 | }; -------------------------------------------------------------------------------- /extensions/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /extensions/ucm/class.shub_ucm_account.php: -------------------------------------------------------------------------------- 1 | shub_extension = 'ucm'; 8 | } 9 | 10 | public function confirm_api(){ 11 | // confirm API and do a call to get the ucm user id and save it in the account shub_user_id field so we can display when composing a message. 12 | 13 | $api = $this->get_api(); 14 | 15 | $api_result = $api->api('user','get'); 16 | if($api_result && !empty($api_result['email'])){ 17 | $shub_user_id = $this->get_api_user_to_id($api_result); 18 | if($shub_user_id){ 19 | $this->update('shub_user_id',$shub_user_id); 20 | return true; 21 | } 22 | } 23 | echo 'Failed to get User ID from api. Please confirm API details.'; 24 | exit; 25 | } 26 | 27 | public function load_available_items(){ 28 | // serialise this result into ucm_data. 29 | 30 | $api = $this->get_api(); 31 | 32 | $api_result = $api->api('faq','list_products'); 33 | /*Array 34 | ( 35 | [version] => 1 36 | [user_id] => 1 37 | [faq] => 1 38 | [faq_products] => Array 39 | ( 40 | [4] => Array 41 | ( 42 | [faq_product_id] => 4 43 | [item_ids] => 48670|144064 44 | [default_type_id] => 3 45 | [name] => asdfasdf333 46 | [date_created] => 2012-12-11 14:22:12 47 | [date_updated] => 2015-03-14 20:19:19 48 | [id] => 4 49 | [default_type] => Array 50 | ( 51 | [ticket_type_id] => 3 52 | [name] => CodeCanyon PHP Support 53 | [public] => 1 54 | [create_user_id] => 1 55 | [update_user_id] => 1 56 | [date_updated] => 2012-04-20 57 | [date_created] => 2012 58 | [default_user_id] => 0 59 | ) 60 | 61 | [items] => Array 62 | ( 63 | [0] => Array 64 | ( 65 | [item_id] => 230 66 | [envato_account_id] => 1 67 | [item_id] => 48670 68 | [marketplace] => themeforest 69 | [name] => Blue Business - 3 Pages - HTML & PSD 70 | [url] => http://themeforest.net/item/blue-business-3-pages-html-psd/48670 71 | [launch_date] => 2009-07-07 72 | [cost] => 12.00 73 | [cache] => a:16:{s:2:"id";s:5:"48670";s:4:"item";s:36:"Blue Business - 3 Pages - HTML & PSD";s:3:"url";s:64:"http://themeforest.net/item/blue-business-3-pages-html-psd/48670";s:4:"user";s:7:"dtbaker";s:9:"thumbnail";s:39:"http://3.s3.envato.com/files/140746.jpg";s:5:"sales";s:3:"246";s:6:"rating";s:1:"4";s:4:"cost";s:5:"12.00";s:11:"uploaded_on";s:30:"Tue Jul 07 04:26:11 +1000 2009";s:11:"last_update";s:30:"Tue Jul 07 04:26:11 +1000 2009";s:4:"tags";s:129:"blue, business, clean, clean, clear, corporate, crisp, education, google maps, html, icons, medical, php contact form, psd, white";s:8:"category";s:24:"site-templates/corporate";s:16:"live_preview_url";s:57:"http://3.s3.envato.com/files/142413/1.__large_preview.jpg";s:11:"marketplace";s:11:"themeforest";s:4:"name";s:36:"Blue Business - 3 Pages - HTML & PSD";s:4:"data";a:0:{}} 74 | [date_created] => 2012-10-20 12:53:46 75 | [date_updated] => 2012-11-29 20:06:00 76 | [id] => 230 77 | )*/ 78 | 79 | if(is_array($api_result) && isset($api_result['faq_products']) && count($api_result['faq_products'])){ 80 | $this->save_account_data(array( 81 | 'items' => $api_result['faq_products'], 82 | )); 83 | }else{ 84 | echo 'Failed to find any FAQ products, please create some in UCM first. Please check logs for any errors.'; 85 | } 86 | 87 | } 88 | 89 | public function run_cron( $debug = false ){ 90 | 91 | 92 | } 93 | 94 | private $api = false; 95 | public function get_api($use_db_code = true){ 96 | if(!$this->api){ 97 | 98 | require_once trailingslashit(dirname(_DTBAKER_SUPPORT_HUB_CORE_FILE_)) . 'extensions/ucm/class.ucm-api.php'; 99 | 100 | $this->api = ucm_api_basic::getInstance(); 101 | $this->api->set_api_url($this->get( 'ucm_api_url' )); 102 | $this->api->set_api_key($this->get( 'ucm_api_key' )); 103 | 104 | } 105 | return $this->api; 106 | } 107 | public function get_api_user_to_id($ucm_user_data){ 108 | //print_r($ucm_user_data);exit; 109 | $comment_user = new SupportHubUser_ucm(); 110 | if(!empty($ucm_user_data['email'])){ 111 | $comment_user->load_by( 'user_email', trim(strtolower($ucm_user_data['email']))); 112 | } 113 | if(!$comment_user->get('shub_user_id')){ 114 | // didn't find one yet. 115 | // find by envato username? 116 | if(isset($ucm_user_data['envato']['user'])){ 117 | $first = current($ucm_user_data['envato']['user']); 118 | if($first && !empty($first['envato_username'])){ 119 | if ($comment_user->load_by_meta('envato_username', strtolower($first['envato_username']))) { 120 | // found! yay! 121 | SupportHub::getInstance()->log_data(_SUPPORT_HUB_LOG_INFO,'ucm','Found a user based on envato username.',array( 122 | 'username' => $first['envato_username'], 123 | 'found_user_id' => $comment_user->get('shub_user_id'), 124 | )); 125 | } 126 | } 127 | } 128 | } 129 | 130 | 131 | if(isset($ucm_user_data['envato']['purchases']) && is_array($ucm_user_data['envato']['purchases'])){ 132 | // find a matching user account with these purchases. 133 | foreach($ucm_user_data['envato']['purchases'] as $purchase){ 134 | if(!empty($purchase['license_code'])) { 135 | // pull in the license code using the envato module if it's enabled. 136 | if(isset(SupportHub::getInstance()->message_managers['envato'])) { 137 | $result = SupportHub::getInstance()->message_managers['envato']->pull_purchase_code(false, $purchase['license_code'], array(), $comment_user->get('shub_user_id')); 138 | if ($result && !empty($result['shub_user_id'])) { 139 | $comment_user->load($result['shub_user_id']); 140 | SupportHub::getInstance()->log_data(_SUPPORT_HUB_LOG_INFO,'ucm','Found a user based on license code.',array( 141 | 'license_code' => $purchase['license_code'], 142 | 'found_user_id' => $comment_user->get('shub_user_id'), 143 | )); 144 | break; 145 | } 146 | } 147 | } 148 | } 149 | } 150 | 151 | if(!$comment_user->get('shub_user_id')){ 152 | // find a match based on email. 153 | if(!empty($ucm_user_data['email'])){ 154 | $comment_user->load_by( 'user_email', trim(strtolower($ucm_user_data['email']))); 155 | } 156 | } 157 | if(!$comment_user->get('shub_user_id')){ 158 | // no existing matches yet, create a new user with the above meta values so that we can find them again in the future. 159 | $comment_user->create_new(); 160 | } 161 | // now we add/update various meta/values of the user if anything is missing. 162 | if(!empty($ucm_user_data['email']) && !$comment_user->get('user_email')) { 163 | $comment_user->update('user_email', trim(strtolower($ucm_user_data['email']))); 164 | } 165 | if(isset($ucm_user_data['envato']['user'])){ 166 | $first = current($ucm_user_data['envato']['user']); 167 | if($first && !empty($first['envato_username']) && !$comment_user->get_meta('envato_username',strtolower($first['envato_username']))){ 168 | $comment_user->add_meta('envato_username', strtolower($first['envato_username'])); 169 | if(!$comment_user->get('user_username')){ 170 | $comment_user->update('user_username',strtolower($first['envato_username'])); 171 | } 172 | } 173 | } 174 | if(isset($ucm_user_data['envato']['purchases'])) { 175 | foreach ($ucm_user_data['envato']['purchases'] as $purchase) { 176 | if (!empty($purchase['license_code']) && !$comment_user->get_meta('envato_license_code', strtolower($purchase['license_code']))) { 177 | $comment_user->add_meta('envato_license_code', strtolower($purchase['license_code'])); 178 | } 179 | } 180 | } 181 | if(!empty($ucm_user_data['name'])){ 182 | if(empty($ucm_user_data['last_name'])){ 183 | $bits = explode(" ",$ucm_user_data['name']); 184 | $ucm_user_data['name'] = array_shift($bits); 185 | $ucm_user_data['last_name'] = implode(" ",$bits); 186 | } 187 | } 188 | if(!$comment_user->get('user_fname') && !empty($ucm_user_data['name'])){ 189 | $comment_user->update('user_fname',$ucm_user_data['name']); 190 | } 191 | if(!$comment_user->get('user_lname') && !empty($ucm_user_data['last_name'])){ 192 | $comment_user->update('user_lname',$ucm_user_data['last_name']); 193 | } 194 | $comment_user->update_user_data($ucm_user_data); 195 | return $comment_user->get('shub_user_id'); 196 | } 197 | 198 | public function get_picture(){ 199 | $data = $this->get('ucm_data'); 200 | return $data && isset($data['pictureUrl']) && !empty($data['pictureUrl']) ? $data['pictureUrl'] : false; 201 | } 202 | 203 | 204 | public function get_item($shub_item_id){ 205 | return new shub_ucm_item($this, $shub_item_id); 206 | } 207 | 208 | } 209 | -------------------------------------------------------------------------------- /extensions/ucm/class.shub_ucm_item.php: -------------------------------------------------------------------------------- 1 | get_messages(array( 9 | 'shub_status' => _shub_MESSAGE_STATUS_PENDINGSEND, 10 | )); 11 | $now = time(); 12 | foreach($messages as $message){ 13 | if(isset($message['message_time']) && $message['message_time'] < $now){ 14 | $shub_ucm_message = new shub_ucm_message(false, $this, $message['shub_ucm_message_id']); 15 | $shub_ucm_message->send_queued($debug); 16 | } 17 | }*/ 18 | 19 | $this->load_latest_item_data($debug); 20 | } 21 | 22 | public function load_latest_item_data($debug = false){ 23 | // serialise this result into ucm_data. 24 | if(!$this->account){ 25 | echo 'No ucm account linked, please try again'; 26 | return; 27 | } 28 | 29 | $api = $this->account->get_api(); 30 | 31 | $ucm_product_id = $this->get('network_key'); 32 | if(!$ucm_product_id){ 33 | echo 'No ucm product id found'; 34 | return; 35 | } 36 | 37 | // we keep a record of the last message received so we know where to stop checking the feed 38 | $last_message_received = (int)$this->get('last_message'); 39 | 40 | // dont want to import ALL tickets, so we pick a 20 day limit if we haven't done this yet 41 | if(!$last_message_received){ 42 | $last_message_received = strtotime('-20 days'); 43 | } 44 | // $last_message_received = false; 45 | 46 | SupportHub::getInstance()->log_data(_SUPPORT_HUB_LOG_INFO,'ucm','Loading latest tickets for product ('.$ucm_product_id.') "'.$this->get('product_name').'" modified since '.shub_print_date($last_message_received,true)); 47 | // find any messages from this particular UCM product that have been updated since our last scrape time. 48 | $tickets = $api->api('ticket','list',array('search'=>array('faq_product_id'=>$ucm_product_id,'time_from'=>$last_message_received,'status_id'=>0))); 49 | if($debug)echo "Getting the latest tickets for product: ".$ucm_product_id." (last message in database is from ".shub_print_date($last_message_received,true).")
\n"; 50 | 51 | $newest_message_received = 0; 52 | 53 | $count = 0; 54 | if(isset($tickets['reply_options'])) { 55 | $this->account->save_account_data(array( 56 | 'reply_options' => $tickets['reply_options'] 57 | )); 58 | } 59 | if(isset($tickets['tickets'])) { 60 | foreach ($tickets['tickets'] as $ticket) { 61 | $message_time = $ticket['last_message_timestamp']; 62 | $newest_message_received = max($newest_message_received, $message_time); 63 | //if($message_time <= $last_message_received)break; // all done here. 64 | 65 | $ucm_message = new shub_ucm_message($this->account, $this, false); 66 | $ucm_message->load_by_network_key($ticket['ticket_id'], $ticket, 'ticket', $debug); 67 | $count++; 68 | if ($debug) { 69 | ?> 70 |
71 |
 Imported Ticket ID: get('network_key'); ?>
72 |                             with  message. 
73 |
74 | log_data(_SUPPORT_HUB_LOG_ERROR,'ucm','Failed to get a reply from the API for product '.$ucm_product_id.' "',$tickets); 80 | } 81 | // get user, return envato_codes in meta 82 | SupportHub::getInstance()->log_data(_SUPPORT_HUB_LOG_INFO, 'ucm', 'Imported '.$count.' product tickets into database (from a total of '.count($tickets['tickets']).' returned by the api)'); 83 | if($debug)echo " imported $count new product tickets
"; 84 | 85 | $this->update('last_message',$newest_message_received); 86 | $this->update('last_checked',time()); 87 | } 88 | 89 | public function link_refresh(){ 90 | return 'admin.php?page=support_hub_settings&tab=ucm&manualrefresh&shub_account_id='.$this->get('shub_account_id').'&network_key='.$this->get('network_key'); 91 | } 92 | 93 | 94 | } 95 | -------------------------------------------------------------------------------- /extensions/ucm/class.shub_ucm_user.php: -------------------------------------------------------------------------------- 1 | _api_url = $api_url; 18 | } 19 | public function set_api_key($token){ 20 | $this->_api_key = $token; 21 | } 22 | 23 | public function api($endpoint, $method=false, $params=array()){ 24 | $headers = array( 25 | 'user-agent' => 'SupportHub WP Plugin', 26 | 'timeout' => 20, 27 | ); 28 | //$headers['headers'] = array('Authorization' => $this->_api_key,); 29 | $params['auth'] = $this->_api_key; 30 | if($params){ 31 | $headers['body'] = $params; 32 | $response = wp_remote_post($this->_api_url . (strpos($this->_api_url,'?') ? '&' : '?') . "endpoint=$endpoint&method=$method", $headers); 33 | }else{ 34 | $response = wp_remote_get($this->_api_url . (strpos($this->_api_url,'?') ? '&' : '?') . "endpoint=$endpoint&method=$method", $headers); 35 | } 36 | if( is_array($response) && isset($response['body']) && isset($response['response']['code']) && $response['response']['code'] == 200 ) { 37 | SupportHub::getInstance()->log_data(_SUPPORT_HUB_LOG_INFO, 'ucm', 'API Call: '.$endpoint .'/' .$method,$response['body']); 38 | $header = $response['headers']; 39 | $body = @json_decode($response['body'],true); 40 | if(!$body){ 41 | SupportHub::getInstance()->log_data(_SUPPORT_HUB_LOG_ERROR, 'ucm', 'API Error, unable to JSON decode: '.$endpoint. ' '.(isset($response['response']['code']) ? $response['response']['code'] .' / ': '').(isset($response['body']) ? $response['body'] : '')); 42 | } 43 | return $body; 44 | }else if(is_array($response) && isset($response['response']['code']) && $response['response']['code']){ 45 | SupportHub::getInstance()->log_data(_SUPPORT_HUB_LOG_ERROR, 'ucm', 'API Error: '.$endpoint. ' '.(isset($response['response']['code']) ? $response['response']['code'] .' / ': '').(isset($response['body']) ? $response['body'] : ''), $response); 46 | }else if(is_wp_error($response)){ 47 | SupportHub::getInstance()->log_data(_SUPPORT_HUB_LOG_ERROR, 'ucm', 'API Error: '.$endpoint. ' '.$response->get_error_message(),$response); 48 | } 49 | return false; 50 | } 51 | 52 | 53 | 54 | } -------------------------------------------------------------------------------- /extensions/ucm/init.ucm.php: -------------------------------------------------------------------------------- 1 | id = 'ucm'; 18 | $shub['ucm']->friendly_name = 'UCM'; 19 | $shub['ucm']->desc = 'View and Reply to Ultimate Client Manager Email Support Tickets.'; 20 | return $shub; 21 | } 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /extensions/ucm/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtbaker/support-hub/21466135d584b1c3c991dc8c09c3ca3d888ec125/extensions/ucm/logo.png -------------------------------------------------------------------------------- /extensions/ucm/shub_ucm.js: -------------------------------------------------------------------------------- 1 | ucm.social.ucm = { 2 | init: function(){ 3 | 4 | jQuery('body').delegate('.ucm_reply_button','click',function(){ 5 | var f = jQuery(this).parents('.ucm_message').first().next('.ucm_message_replies').find('.ucm_message_reply_box'); 6 | f.show(); 7 | f.find('textarea')[0].focus(); 8 | }).delegate('.ucm_check_all','change',function(){ 9 | jQuery('.check_item').prop('checked', !!jQuery(this).prop('checked')); 10 | 11 | }); 12 | } 13 | }; -------------------------------------------------------------------------------- /extensions/ucm/ucm_message.php: -------------------------------------------------------------------------------- 1 | get('shub_account_id') == $shub_account_id){ 9 | $ucm_message = new shub_ucm_message( $ucm, false, $shub_message_id ); 10 | $ucm_message->output_message_page('popup'); 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /extensions/ucm/ucm_settings.php: -------------------------------------------------------------------------------- 1 | message_managers['ucm']; 5 | if($current_account !== false){ 6 | $shub_ucm_account = new shub_ucm_account($current_account); 7 | if($shub_ucm_account->get('shub_extension') != 'ucm')die('Wrong extension:' .$shub_ucm_account->get('shub_extension')); 8 | if(isset($_GET['manualrefresh'])){ 9 | 10 | $network_key = isset( $_REQUEST['network_key'] ) ? (int) $_REQUEST['network_key'] : 0; 11 | if(!$network_key){ 12 | // update?? products? 13 | $shub_ucm_account->confirm_api(); 14 | $shub_ucm_account->load_available_items(); 15 | }else { 16 | /* @var $items shub_item[] */ 17 | $items = $shub_ucm_account->get('items'); 18 | if (!$network_key || !$items || !isset($items[$network_key])) { 19 | die('No items found to refresh'); 20 | } 21 | ?> 22 | Manually refreshing item data... please wait... 23 | run_cron(true); 25 | } 26 | 27 | }else if(isset($_GET['do_connect'])){ 28 | // connect to ucm. and if that isnt' found 29 | ?> 30 |
31 |

32 | 33 |

34 | get('shub_account_id') && $shub_ucm_account->get('shub_account_id') == $current_account && $shub_ucm_account->get( 'ucm_api_url' ) && 36 | $shub_ucm_account->get( 'ucm_api_key' )) { 37 | 38 | // now we load in a list of ucm products to manage and redirect the user back to the 'edit' screen where they can continue managing the account. 39 | $shub_ucm_account->confirm_api(); 40 | $shub_ucm_account->load_available_items(); 41 | $url = $shub_ucm_account->link_edit(); 42 | ?> 43 |

You have successfully connected UCM with the Support Hub plugin. Please click the button below:

44 |

Click here to continue.

45 |

 

46 |

 

47 |

 

48 |

 

49 | 52 | Please go back and make sure all fields are entered. 53 |
58 |
59 |

60 | 61 |

62 | 63 |
64 | 65 | 66 | 67 | get( 'shub_account_id' ) ); ?> 68 | 69 |

Setup Instructions:

70 | 77 | 78 | 79 | 80 | 83 | 87 | 88 | 89 | 92 | 96 | 97 | 98 | 101 | 104 | 105 | get( 'shub_account_id' ) ) { ?> 106 | 107 | 110 | 113 | 114 | 115 | 118 | 187 | 188 | 189 | 190 |
81 | 82 | 84 | 85 | (e.g. My UCM Install) 86 |
90 | 91 | 93 | 94 | (e.g. http://mysite.com/ucm/ext.php?m=api&h=v1&) 95 |
99 | 100 | 102 | 103 |
108 | 109 | 111 | get( 'last_checked' ) ? shub_print_date( $shub_ucm_account->get( 'last_checked' ), true ) : __( 'N/A', 'support_hub' ); ?> 112 |
116 | 117 | 119 | 120 |
121 | get( 'account_data' ); 123 | if ( $data && isset( $data['items'] ) && is_array( $data['items'] ) && count( $data['items'] ) > 0 ) { 124 | $ucm_products = $shub_ucm_account->get('items'); 125 | ?> 126 |
127 | - check all - 128 |
129 |

130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | get_products(); 144 | foreach ( $data['items'] as $product_id => $product_data ) { 145 | ?> 146 | 147 | 152 | 155 | 166 | 169 | 175 | 176 | 179 | 180 |
EnabledUCM ProductSupport Hub ProductLast CheckedAction
148 | is_item_active( $product_id ) ? ' checked' : ''; ?>> 150 | 151 | 153 | 154 | 156 | 'item_product['.$product_id.']', 158 | 'type' => 'select', 159 | 'blank' => __('- None -','support_hub'), 160 | 'value' => $shub_ucm_account->is_item_active( $product_id ) ? $ucm_products[ $product_id ]->get( 'shub_product_id' ) : (isset($product_data['shub_product_id']) ? $product_data['shub_product_id'] : 0), 161 | 'options' => $products, 162 | 'options_array_id' => 'product_name', 163 | 'class' => 'shub_product_dropdown', 164 | )); ?> 165 | 167 | is_item_active( $product_id ) && $ucm_products[ $product_id ]->get( 'last_checked' ) ? shub_print_date( $ucm_products[ $product_id ]->get( 'last_checked' ), true ): 'N/A';?> 168 | 170 | is_item_active( $product_id ) ) { 172 | echo 're-load product tickets'; 173 | } ?> 174 |
181 | 186 |
191 | 192 |

193 | get( 'shub_account_id' ) ) { ?> 194 | 196 | 198 | 201 | 202 | 204 | 205 |

206 | 207 | 208 |
209 |
210 | get_accounts(); 216 | foreach($accounts as $account_id => $account){ 217 | $a = new shub_ucm_account($account['shub_account_id']); 218 | $accounts[$account_id]['edit_link'] = $a->link_edit(); 219 | $accounts[$account_id]['title'] = $a->get('account_name'); 220 | $accounts[$account_id]['last_checked'] = $a->get('last_checked') ? shub_print_date( $a->get('last_checked') ) : 'N/A'; 221 | } 222 | $myListTable->set_data($accounts); 223 | $myListTable->prepare_items(); 224 | ?> 225 |
226 |

227 | 228 | 229 |

230 | search_box( 'search', 'search_id' ); 232 | $myListTable->display(); 233 | ?> 234 |
235 | 239 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 0){ 6 | $post = get_post($_GET['post_id']); 7 | if($post && $post->ID == $_GET['post_id']){ 8 | // woo! 9 | $defaults['post_id'] = $post->ID; 10 | $defaults['facebook_type'] = 'link'; 11 | $defaults['facebook_link'] = get_permalink($post->ID); 12 | if ( has_post_thumbnail($post->ID)) { 13 | $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' ); 14 | if($large_image_url[0]){ 15 | $defaults['facebook_link_picture'] = $large_image_url[0]; 16 | } 17 | } 18 | $defaults['facebook_title'] = get_the_title($post->ID); 19 | $defaults['facebook_description'] = substr( strip_tags(strip_shortcodes($post->post_excerpt ? $post->post_excerpt : $post->post_content)) , 0 , 50 ); 20 | $defaults['facebook_message'] = trim(strip_tags(strip_shortcodes($post->post_excerpt ? $post->post_excerpt : $post->post_content))); 21 | $defaults['google_message'] = trim(strip_tags(strip_shortcodes($post->post_excerpt ? $post->post_excerpt : $post->post_content))) . ' ' . get_permalink($post->ID); 22 | $defaults['twitter_message'] = trim(substr( strip_tags(strip_shortcodes($post->post_excerpt ? $post->post_excerpt : $post->post_content)) , 0 , 118 )) . ' ' . get_permalink($post->ID); 23 | $defaults['facebook_caption'] = get_bloginfo('description'); 24 | } 25 | } 26 | ?>
27 |

28 | 29 |

30 | 31 |
32 |
33 |
34 | 35 | 38 | 39 | 40 |
41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | message_managers as $message_manager){ 54 | if(!$message_manager->get_accounts())continue; 55 | ?> 56 | 57 | 58 | 59 | 60 | 64 | 67 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 89 | 102 | 103 | 104 | 107 | 115 | 116 | 117 | 120 | 123 | 124 | 125 |
NetworkMessageOptions
61 | friendly_name;?> 62 | compose_to();?> 63 | 65 | compose_message($defaults);?> 66 | 68 | compose_type($defaults);?> 69 |
Settings
87 | Schedule 88 | 90 | 91 | 92 | 93 | 94 | 95 | 101 |
105 | Track Clicks 106 | 108 | Yes, track link clicks. 109 |
If enabled, all links in above messages will be automatically changed (eg: ) for tracking. 114 |
118 | Debug 119 | 121 | 122 |
126 | 127 |

128 | 130 |

131 | 132 | 133 | 138 |
139 | 140 | 194 | 195 | 196 |
197 |
198 |
199 | 200 |
-------------------------------------------------------------------------------- /pages/dashboard.php: -------------------------------------------------------------------------------- 1 |
2 |

3 | 4 |

5 | 6 |
7 | 8 |

9 | Interesting graphs and stats are coming here soon. If you have suggestions please let me know. Some ideas: 10 | 11 |

12 |
    13 |
  1. Current ticket turn around time
  2. 14 |
  3. Pre-sale tickets vs sale tickets
  4. 15 |
  5. Time it takes to convert a pre-sale ticket to a purchase
  6. 16 |
  7. Percentage of total buyers who submit a support ticket
  8. 17 |
18 |
19 | 20 | 21 | 22 | 23 |
-------------------------------------------------------------------------------- /pages/extra-data-view.php: -------------------------------------------------------------------------------- 1 | get('shub_extra_id')); 6 | 7 | if(!$extra->get('shub_extra_id'))die('Failed to load extra'); 8 | 9 | ?> 10 | 11 |
12 | 13 | get( 'extra_name' ) );?> 14 | get('field_type')){ 16 | case 'encrypted': 17 | 18 | $encrypted_value = $extra_data->get('extra_value'); 19 | $data = $extra_data->get('extra_data'); 20 | $private_key = !empty($data['private_key']) ? $data['private_key'] : get_option('shub_encrypt_private_key',''); 21 | if(!$private_key){ 22 | echo 'Warning: unable to find private key. Unable to decrypt any deatils. Please set a new encryption key from Support Hub Settings area'; 23 | } 24 | ?> 25 | 26 | 83 | 84 |
85 | Enter Password to Decrypt: 86 |
87 | 90 | get('extra_value')); 94 | } 95 | ?> 96 | 97 | 98 | 99 |
-------------------------------------------------------------------------------- /pages/inbox.php: -------------------------------------------------------------------------------- 1 |
2 |

3 | 4 | 5 |

6 | get_current_layout_type(); 20 | 21 | // grab a mysql resource from all available social plugins (hardcoded for now - todo: hook) 22 | $search = isset($_REQUEST['search']) && is_array($_REQUEST['search']) ? $_REQUEST['search'] : array(); 23 | if(!isset($search['shub_status'])){ 24 | $search['shub_status'] = _shub_MESSAGE_STATUS_UNANSWERED; 25 | } 26 | $order = array(); 27 | if(!empty($_REQUEST['orderquery'])) { 28 | $bits = explode(':',$_REQUEST['orderquery']); 29 | $order = array( 30 | 'orderby' => $bits[0], 31 | 'order' => $bits[1], 32 | ); 33 | }else{ 34 | $order = array( 35 | 'orderby' => 'shub_column_time', 36 | 'order' => 'desc', 37 | ); 38 | } 39 | 40 | // retuin a combined copy of all available messages, based on search, as a MySQL resource 41 | // so we can loop through them on the global messages combined page. 42 | 43 | 44 | 45 | $myListTable = new SupportHubMessageList(array( 46 | 'screen' => 'shub_inbox' 47 | )); 48 | $myListTable->set_columns( array( 49 | 'cb' => 'Select All', 50 | 'shub_column_account' => __( 'Account', 'support_hub' ), 51 | 'shub_column_product' => __( 'Product', 'support_hub' ), 52 | 'shub_column_time' => __( 'Time', 'support_hub' ), 53 | 'shub_column_from' => __( 'From', 'support_hub' ), 54 | 'shub_column_summary' => __( 'Summary', 'support_hub' ), 55 | 'shub_column_action' => __( 'Action', 'support_hub' ), 56 | ) ); 57 | /*$myListTable->set_sortable_columns( array( 58 | 'shub_column_time' => array( 59 | 'shub_column_time', 60 | 1 61 | ), 62 | ) );*/ 63 | $myListTable->process_bulk_action(); // before we do the search on messages. 64 | 65 | $this_search = $search; 66 | if (isset($this_search['shub_status']) && $this_search['shub_status'] == -1) { 67 | unset($this_search['shub_status']); 68 | } 69 | SupportHub::getInstance()->load_all_messages($this_search, $order, $layout_type == 'continuous' ? 5 : false); 70 | // we store this data in the session so that continuous mode can access it and perform hte same search when loading more data. 71 | 72 | $all_messages = SupportHub::getInstance()->all_messages; 73 | $has_more = false; 74 | if($layout_type == 'continuous'){ 75 | 76 | $message_ids = array(); 77 | foreach($all_messages as $all_message){ 78 | $message_ids[]=$all_message['shub_message_id']; 79 | } 80 | // this is used in class-support-hub.php to load the next batch of messages. 81 | // todo: pull this out of sessions into ajax variables so we can have two tabs open with different searches going at the same time. 82 | $_SESSION['_shub_search_rules'] = array($this_search, $order, $message_ids); 83 | // todo: ajax notification when currently listed messages are updated or new ones appear at the top of the list. 84 | 85 | }else{ 86 | $screen = get_current_screen(); 87 | // retrieve the "per_page" option 88 | $screen_option = $screen->get_option('per_page', 'option'); 89 | // retrieve the value of the option stored for the current user 90 | $per_page = get_user_meta(get_current_user_id(), $screen_option, true); 91 | if ( empty ( $per_page) || $per_page < 1 || is_array($per_page) ) { 92 | // get the default value if none is set 93 | $per_page = $screen->get_option( 'per_page', 'default' ); 94 | } 95 | if(!$per_page)$per_page=20; 96 | $myListTable->items_per_page = $per_page; 97 | $limit_pages = 2; // get about 10 pages of data to display in WordPress. 98 | if(count($all_messages) >= ($myListTable->get_pagenum() * $myListTable->items_per_page) + ($limit_pages * $myListTable->items_per_page)){ 99 | $has_more = true; // a flag so we can show "more" in the pagination listing. 100 | } 101 | } 102 | 103 | 104 | // todo - hack in here some sort of cache so pagination works nicer ? 105 | //module_debug::log(array( 'title' => 'Finished social messages', 'data' => '', )); 106 | 107 | $myListTable->set_layout_type($layout_type); 108 | $myListTable->set_data($all_messages); 109 | $myListTable->prepare_items(); 110 | $myListTable->pagination_has_more = $has_more; 111 | 112 | // for ajax it would be $myListTable->single_row($message_array); 113 | ?> 114 |
115 |
116 | 117 | 118 | 119 | search_box(__('Search','support_hub'), 'search_id'); ?> 120 | 175 | display_tablenav( 'top' ); ?> 176 |
177 | display(); 179 | ?> 180 |
181 | 182 | 183 | 191 | 192 | 193 |
-------------------------------------------------------------------------------- /pages/interactions.php: -------------------------------------------------------------------------------- 1 |
2 |

3 | 4 | 5 |

6 | set_columns( array( 22 | 'cb' => '', 23 | 'shub_column_account' => __( 'Social Account', 'support_hub' ), 24 | 'shub_column_time' => __( 'Date/Time', 'support_hub' ), 25 | 'shub_column_from' => __( 'From', 'support_hub' ), 26 | 'shub_column_summary' => __( 'Summary', 'support_hub' ), 27 | 'shub_column_action' => __( 'Action', 'support_hub' ), 28 | ) ); 29 | $myListTable->process_bulk_action(); // before we do the search on messages. 30 | 31 | 32 | /* @var $message_manager shub_facebook */ 33 | foreach($this->message_managers as $message_id => $message_manager){ 34 | $message_manager->load_all_messages($search, $order); 35 | } 36 | 37 | // filter through each mysql resource so we get the date views. output each row using their individual classes. 38 | $all_messages = array(); 39 | $loop_messages = array(); 40 | $last_timestamp = false; 41 | while(true){ 42 | // fill them up 43 | $has_messages = false; 44 | foreach($this->message_managers as $type => $message_manager){ 45 | if(!isset($loop_messages[$type])){ 46 | $loop_messages[$type] = $message_manager->get_next_message(); 47 | if($loop_messages[$type]){ 48 | //echo "Got $type with date of ".print_date($loop_messages[$type]['message_time'],true)."
\n"; 49 | $loop_messages[$type]['message_manager'] = $message_manager; 50 | $has_messages = true; 51 | }else{ 52 | unset($loop_messages[$type]); 53 | } 54 | } 55 | } 56 | if(!$has_messages && empty($loop_messages)){ 57 | break; 58 | }// todo - limit count here. 59 | // pick the lowest one and replenish its spot 60 | $next_type = false; 61 | foreach($loop_messages as $type => $message){ 62 | if(!$next_type || $message['message_time'] > $last_timestamp){ 63 | $next_type = $type; 64 | $last_timestamp = $message['message_time']; 65 | } 66 | } 67 | //echo "Message $next_type :
\n"; 68 | $all_messages[] = $loop_messages[$next_type]; 69 | unset($loop_messages[$next_type]); 70 | // repeat. 71 | 72 | } 73 | 74 | // todo - hack in here some sort of cache so pagination works nicer ? 75 | //module_debug::log(array( 'title' => 'Finished social messages', 'data' => '', )); 76 | //print_r($all_messages); 77 | 78 | $myListTable->set_data($all_messages); 79 | $myListTable->prepare_items(); 80 | ?> 81 |
82 | 83 | search_box(__('Search','support_hub'), 'search_id'); ?> 84 | 95 | display(); 97 | ?> 98 |
99 | 100 | 108 | 109 | 110 |
-------------------------------------------------------------------------------- /pages/message.php: -------------------------------------------------------------------------------- 1 |
2 |

3 | 4 |

5 | 6 |
7 |
8 | message_managers[$network]) && $shub_message_id > 0){ 13 | $shub_extension_message = $this->message_managers[$network]->get_message( false, false, $shub_message_id); 14 | if($shub_extension_message->get('shub_message_id') == $shub_message_id){ 15 | $shub_account_id = $shub_extension_message->get('account')->get('shub_account_id'); 16 | include( trailingslashit( SupportHub::getInstance()->dir ) . 'extensions/'.$network.'/'.$network.'_message.php'); 17 | } 18 | } 19 | ?> 20 |
21 |
22 | 23 | 24 | 32 | 33 | 34 |
-------------------------------------------------------------------------------- /pages/metabox.php: -------------------------------------------------------------------------------- 1 | Share via Support Hub -------------------------------------------------------------------------------- /pages/outbox.php: -------------------------------------------------------------------------------- 1 |
2 |

3 | 4 | 5 |

6 | $bits[0], 21 | 'order' => $bits[1], 22 | ); 23 | } 24 | 25 | // retuin a combined copy of all available messages, based on search, as a MySQL resource 26 | // so we can loop through them on the global messages combined page. 27 | 28 | 29 | 30 | $myListTable = new SupportHubMessageList(); 31 | $screen = get_current_screen(); 32 | // retrieve the "per_page" option 33 | $screen_option = $screen->get_option('per_page', 'option'); 34 | // retrieve the value of the option stored for the current user 35 | $per_page = get_user_meta(get_current_user_id(), $screen_option, true); 36 | if ( empty ( $per_page) || $per_page < 1 || is_array($per_page) ) { 37 | // get the default value if none is set 38 | $per_page = $screen->get_option( 'per_page', 'default' ); 39 | } 40 | if(!$per_page)$per_page=20; 41 | $myListTable->items_per_page = $per_page; 42 | $myListTable->set_columns( array( 43 | 'cb' => 'Select All', 44 | 'shub_column_account' => __( 'Account', 'support_hub' ), 45 | 'shub_column_product' => __( 'Product', 'support_hub' ), 46 | 'shub_column_time' => __( 'Time', 'support_hub' ), 47 | 'shub_column_from' => __( 'From', 'support_hub' ), 48 | 'shub_column_summary' => __( 'Summary', 'support_hub' ), 49 | 'shub_column_action' => __( 'Action', 'support_hub' ), 50 | ) ); 51 | /*$myListTable->set_sortable_columns( array( 52 | 'shub_column_time' => array( 53 | 'shub_column_time', 54 | 1 55 | ), 56 | ) );*/ 57 | $myListTable->process_bulk_action(); // before we do the search on messages. 58 | 59 | 60 | $this_search = $search; 61 | if (isset($this_search['shub_status']) && $this_search['shub_status'] == -1) { 62 | unset($this_search['shub_status']); 63 | } 64 | // SupportHub::getInstance()->load_all_messages($this_search, $order); 65 | // $all_messages = SupportHub::getInstance()->all_messages; 66 | $all_messages = array_merge(SupportHubOutbox::get_failed(),SupportHubOutbox::get_pending()); 67 | $limit_pages = 2; // get about 10 pages of data to display in WordPress. 68 | $has_more = false; 69 | if(count($all_messages) >= ($myListTable->get_pagenum() * $myListTable->items_per_page) + ($limit_pages * $myListTable->items_per_page)){ 70 | $has_more = true; // a flag so we can show "more" in the pagination listing. 71 | } 72 | 73 | 74 | // todo - hack in here some sort of cache so pagination works nicer ? 75 | //module_debug::log(array( 'title' => 'Finished social messages', 'data' => '', )); 76 | 77 | $myListTable->set_layout_type($layout_type); 78 | $myListTable->set_data($all_messages); 79 | $myListTable->prepare_items(); 80 | $myListTable->pagination_has_more = $has_more; 81 | ?> 82 |
83 |
84 | 85 | 86 | 87 | search_box(__('Search','support_hub'), 'search_id'); ?> 88 | 142 | display_tablenav( 'top' ); ?> 143 |
144 | display(); 146 | ?> 147 |
148 | 149 | 150 | 158 | 159 | 160 |
-------------------------------------------------------------------------------- /pages/sent.php: -------------------------------------------------------------------------------- 1 |
2 |

3 | 4 | 5 |

6 | set_columns( array( 10 | 'shub_column_time' => __( 'Date/Time', 'support_hub' ), 11 | 'shub_column_account' => __( 'Social Accounts', 'support_hub' ), 12 | 'shub_column_summary' => __( 'Summary', 'support_hub' ), 13 | 'shub_column_links' => __( 'Link Clicks', 'support_hub' ), 14 | //'shub_column_stats' => __( 'Stats', 'support_hub' ), 15 | //'shub_column_action' => __( 'Action', 'support_hub' ), 16 | 'shub_column_post' => __( 'WP Post', 'support_hub' ), 17 | ) ); 18 | 19 | /* @var $message_manager shub_facebook */ 20 | /*foreach($this->message_managers as $message_id => $message_manager){ 21 | $message_manager->load_all_messages($search, $order); 22 | }*/ 23 | 24 | global $wpdb; 25 | $sql = "SELECT * FROM `"._support_hub_DB_PREFIX."shub_message` ORDER BY `shub_message_id` DESC "; 26 | $messages = $wpdb->get_results($sql, ARRAY_A); 27 | 28 | 29 | $myListTable->set_message_managers($this->message_managers); 30 | $myListTable->set_data($messages); 31 | $myListTable->prepare_items(); 32 | ?> 33 |
34 | 35 | display(); 37 | ?> 38 |
39 | 40 | 48 | 49 | 50 |
-------------------------------------------------------------------------------- /pages/settings-logs.php: -------------------------------------------------------------------------------- 1 | set_columns( array( 6 | 'log_time' => __( 'Time', 'support_hub' ), 7 | 'log_extension' => __( 'Extension', 'support_hub' ), 8 | 'log_error_level' => __( 'Error Level', 'support_hub' ), 9 | 'log_subject' => __( 'Subject', 'support_hub' ), 10 | 'log_data' => __( 'Data', 'support_hub' ), 11 | ) ); 12 | $latest_logs = shub_get_multiple('shub_log',isset($_REQUEST['search']) && is_array($_REQUEST['search']) ? $_REQUEST['search'] : array(), 'shub_log_id','shub_log_id DESC LIMIT 1000'); 13 | $myListTable->set_data($latest_logs); 14 | $myListTable->prepare_items(); 15 | ?> 16 | 17 |
18 |

19 | 20 |

21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 40 | 41 | 42 | 45 | 49 | 50 | 51 |
31 | 32 | 34 | time()){ ?> 35 | Logging has been enabled for the next hours
36 | 37 | 38 | (enable logging for the next 24 hours) 39 |
43 | 44 | 46 | 47 | (remove all existing logs) 48 |
52 | 53 |

54 | 56 |

57 | 58 | 59 |
60 |
61 |
62 |

63 | 64 |

65 | display(); 67 | ?> 68 |
69 | load($current_product); 7 | ?> 8 |
9 |

10 | 11 |

12 | 13 |
14 | 15 | 17 | get( 'shub_product_id' ) ); ?> 18 | 19 | 20 | 21 | 22 | 25 | 28 | 29 | 30 |
23 | 24 | 26 | 27 |
31 | 32 |

33 | get( 'shub_product_id' ) ) { ?> 34 | 36 | 39 | 40 | 42 | 43 |

44 | 45 | 46 |
47 |
48 | set_columns( array( 53 | 'product_name' => __( 'Product Name', 'support_hub' ), 54 | 'edit_link' => __( 'Action', 'support_hub' ), 55 | ) ); 56 | $product_details = SupportHub::getInstance()->get_products(); 57 | foreach($product_details as $product_detail_id => $product_detail){ 58 | $product_details[$product_detail_id]['edit_link'] = ''.__('Edit','support_hub').''; 59 | } 60 | $myListTable->set_data($product_details); 61 | $myListTable->prepare_items(); 62 | ?> 63 |
64 |

65 | 66 | 67 |

68 | search_box( 'search', 'search_id' ); 70 | $myListTable->display(); 71 | ?> 72 |
73 | 74 | 2 |

3 | 4 |

5 | 11 | 29 |
30 | 31 | message_managers[$tab])){ 33 | $SupportHub->message_managers[$tab]->settings_page(); 34 | }else{ 35 | if(is_file(dirname(_DTBAKER_SUPPORT_HUB_CORE_FILE_).'/pages/settings-'.basename($tab).'.php')){ 36 | include dirname(_DTBAKER_SUPPORT_HUB_CORE_FILE_).'/pages/settings-'.basename($tab).'.php'; 37 | } 38 | } 39 | }else{ 40 | ?> 41 |
42 | 43 | 44 |

Welcome to Support Hub!
This is BETA software. It will have bugs. It is a very complicated plugin and it simply might not work on some hosting accounts. This plugin uses a lot of advanced cURL queries and will operate best on a dedicated VPS hosting account.

45 |

46 | Please send all bug reports over to Github here: https://github.com/dtbaker/support-hub/issues 47 |

48 | 49 | 50 | 51 | 54 | 64 | 65 | 66 |
52 | 53 | 55 | More extensions will be made available shortly: 56 | message_managers as $id => $message_manager){ ?> 57 |
58 | 59 | is_enabled() ? ' checked' : '';?>> 60 | friendly_name;?> - desc;?> 61 |
62 | 63 |
67 |

68 | 70 |

71 |
72 | 75 | 76 | -------------------------------------------------------------------------------- /pages/setup.php: -------------------------------------------------------------------------------- 1 |
2 |

3 | 4 |

5 | 6 |

Please setup your accounts to get started.

7 |

Check the "Getting Started" guide on supporthub.co for help.

8 |
-------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === Support Hub === 2 | Contributors: dtbaker 3 | Donate link: http://supporthub.co 4 | Tags: support, facebook, twitter, email 5 | Requires at least: 4.2.2 6 | Tested up to: 4.2.2 7 | Stable tag: trunk 8 | License: GPLv2 or later 9 | License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 | 11 | This will import your messages from Facebook, Twitter, bbPress, Envato and more into an easy to use "support inbox". 12 | 13 | == Description == 14 | 15 | This plugin will import all your Support Questions from Facebook, Twitter, LinkedIn, Google+, POP3/IMAP Email, bbPress Forum Posts, WordPress Comments and Envato Item Comments into an easy to use "support inbox". 16 | 17 | Here you can quickly see and reply to all your messages no matter what medium they come through. 18 | 19 | This is the Support System you need when you already have a Support System. A great way to give Support Staff access to various social networks without giving them access. 20 | 21 | More platforms will be added (e.g. ticksy, helpscout and zendesk are planned) along with some sample code so you can add your own 3rd party support system. 22 | 23 | Details available at http://supporthub.co 24 | 25 | 26 | == Installation == 27 | 28 | This section describes how to install the plugin and get it working. 29 | 30 | 1. Upload the `supporthub` folder to the `/wp-content/plugins/` directory 31 | 1. Activate the plugin through the 'Plugins' menu in WordPress 32 | 1. Navigate to Support Hub > Settings to start configuration 33 | 34 | == Frequently Asked Questions == 35 | 36 | = What requirements does this plugin need? = 37 | 38 | This is a rather advanced plugin and it will not work on some cheap shared hosting accounts. The best way to check if it will work is to simply install the plugin and go to Support Hub > Settings, any warnings will be displayed there. 39 | 40 | == Screenshots == 41 | 42 | 1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from 43 | the /assets directory or the directory that contains the stable readme.txt (tags or trunk). Screenshots in the /assets 44 | directory take precedence. For example, `/assets/screenshot-1.png` would win over `/tags/4.3/screenshot-1.png` 45 | (or jpg, jpeg, gif). 46 | 2. This is the second screen shot 47 | 48 | 49 | == Upgrade Notice == 50 | 51 | = 1.1 = 52 | Major re-write and speed improvements 53 | 54 | = 1.0 = 55 | Initial Release 56 | 57 | 58 | 59 | == Changelog == 60 | 61 | = 1.1 = 62 | * Major core re-write 63 | * Speed improvements 64 | * Currently re-writing all extensions to be compatible with new framework 65 | * Envato extension working 66 | 67 | = 1.0 = 68 | * Initial release 69 | -------------------------------------------------------------------------------- /support-hub.php: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /templates/shub_external_header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Support Hub 6 | 7 | 8 | 9 | 10 | 77 | 78 | 79 |
80 |
81 |

Support Hub

82 |
-------------------------------------------------------------------------------- /templates/shub_extra_request_form.php: -------------------------------------------------------------------------------- 1 | 66 | 67 |
68 | 69 |
70 | Thank You 71 |
72 | Your extra information was received successfully. 73 |
74 |
75 | 76 | 77 |
78 | Past Messages: 79 |
80 | 81 |
82 |
83 | 84 | 85 | 86 |
87 | Please Provide Additional Details: 88 | get('extra_description')){ 91 | ?> 92 |
93 | get('extra_description'));?> 94 |
95 |
96 | get('shub_extra_id')])){ 98 | ?> 99 |
100 | get('shub_extra_id')]);?> 101 |
102 |
103 | 106 |
107 | 108 | $extra->get('field_type') ? $extra->get('field_type') : 'text', 110 | 'name' => 'extra['.$extra->get('shub_extra_id').']', 111 | 'value' => isset($extra_previous_data[$extra->get('shub_extra_id')]) ? $extra_previous_data[$extra->get('shub_extra_id')] : '', 112 | )); ?> 113 |
114 | 116 |
117 | 118 |
119 | Any more information? (optional) 120 |
121 | 122 | 'textarea', 124 | 'name' => 'extra_notes', 125 | 'value' => isset($extra_previous_notes) ? $extra_previous_notes : '', 126 | )); ?> 127 |
128 |
129 |
130 | 131 |
-------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/hieu-le/wordpress-xmlrpc-client/src'), 10 | ); 11 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | $path) { 28 | $loader->set($namespace, $path); 29 | } 30 | 31 | $map = require __DIR__ . '/autoload_psr4.php'; 32 | foreach ($map as $namespace => $path) { 33 | $loader->setPsr4($namespace, $path); 34 | } 35 | 36 | $classMap = require __DIR__ . '/autoload_classmap.php'; 37 | if ($classMap) { 38 | $loader->addClassMap($classMap); 39 | } 40 | 41 | $loader->register(true); 42 | 43 | return $loader; 44 | } 45 | } 46 | 47 | function composerRequire940fd0eee4927d082f8942ed5e0afd58($file) 48 | { 49 | require $file; 50 | } 51 | -------------------------------------------------------------------------------- /vendor/composer/installed.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "hieu-le/wordpress-xmlrpc-client", 4 | "version": "2.4.2", 5 | "version_normalized": "2.4.2.0", 6 | "source": { 7 | "type": "git", 8 | "url": "https://github.com/letrunghieu/wordpress-xmlrpc-client.git", 9 | "reference": "07a1ad3f2fed562c01f00161c37f6ab2e276d272" 10 | }, 11 | "dist": { 12 | "type": "zip", 13 | "url": "https://api.github.com/repos/letrunghieu/wordpress-xmlrpc-client/zipball/07a1ad3f2fed562c01f00161c37f6ab2e276d272", 14 | "reference": "07a1ad3f2fed562c01f00161c37f6ab2e276d272", 15 | "shasum": "" 16 | }, 17 | "require": { 18 | "ext-xmlrpc": "*", 19 | "php": ">=5.3.0" 20 | }, 21 | "require-dev": { 22 | "illuminate/support": "~4.0", 23 | "php-vcr/php-vcr": "dev-master", 24 | "php-vcr/phpunit-testlistener-vcr": "*", 25 | "phpunit/phpunit": "*", 26 | "symfony/yaml": "2.*" 27 | }, 28 | "time": "2015-05-29 03:17:43", 29 | "type": "library", 30 | "installation-source": "dist", 31 | "autoload": { 32 | "psr-4": { 33 | "HieuLe\\WordpressXmlrpcClient\\": "src/" 34 | } 35 | }, 36 | "notification-url": "https://packagist.org/downloads/", 37 | "license": [ 38 | "MIT" 39 | ], 40 | "authors": [ 41 | { 42 | "name": "Hieu Le", 43 | "email": "letrunghieu.cse09@gmail.com", 44 | "homepage": "http://www.hieule.info" 45 | } 46 | ], 47 | "description": "A PHP client for Wordpress websites that closely implement the XML-RPC WordPress API with full test suite built in", 48 | "keywords": [ 49 | "api", 50 | "client", 51 | "remote", 52 | "wordpress", 53 | "xmlrpc" 54 | ] 55 | } 56 | ] 57 | -------------------------------------------------------------------------------- /vendor/hieu-le/wordpress-xmlrpc-client/.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | composer.phar 3 | composer.lock 4 | .DS_Store 5 | /nbproject/private/ 6 | nbproject/ 7 | docs/ 8 | -------------------------------------------------------------------------------- /vendor/hieu-le/wordpress-xmlrpc-client/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.3 5 | - 5.4 6 | - 5.5 7 | - 5.6 8 | - hhvm 9 | 10 | before_script: 11 | - composer self-update 12 | - composer install --prefer-source --no-interaction --dev 13 | 14 | script: phpunit 15 | 16 | matrix: 17 | allow_failures: 18 | - php: 5.6 19 | - php: hhvm 20 | -------------------------------------------------------------------------------- /vendor/hieu-le/wordpress-xmlrpc-client/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Hieu Le Trung 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/hieu-le/wordpress-xmlrpc-client/README.md: -------------------------------------------------------------------------------- 1 | Wordpress XML-RPC PHP Client 2 | ======================= 3 | 4 | [![Build Status](https://travis-ci.org/letrunghieu/wordpress-xmlrpc-client.svg?branch=master)](https://travis-ci.org/letrunghieu/wordpress-xmlrpc-client) [![Latest Stable Version](https://poser.pugx.org/hieu-le/wordpress-xmlrpc-client/v/stable.svg)](https://packagist.org/packages/hieu-le/wordpress-xmlrpc-client) [![Total Downloads](https://poser.pugx.org/hieu-le/wordpress-xmlrpc-client/downloads.svg)](https://packagist.org/packages/hieu-le/wordpress-xmlrpc-client) [![Latest Unstable Version](https://poser.pugx.org/hieu-le/wordpress-xmlrpc-client/v/unstable.svg)](https://packagist.org/packages/hieu-le/wordpress-xmlrpc-client) [![License](https://poser.pugx.org/hieu-le/wordpress-xmlrpc-client/license.svg)](https://packagist.org/packages/hieu-le/wordpress-xmlrpc-client) 5 | 6 | A PHP client for Wordpress websites that closely implement the [XML-RPC WordPress API](http://codex.Wordpress.org/XML-RPC_WordPress_API) 7 | 8 | Created by [Hieu Le](http://www.hieule.info) 9 | 10 | MIT licensed. 11 | 12 | Current version: 2.4.0 13 | 14 | 15 | ## Features 16 | 17 | * Full test suit built in supporting testing using your own Wordpress site. 18 | * ~~Support error logging to files with Monolog library.~~ Now, erros can be logged in a more felxible way via **error callbacks** (v 2.4.0) 19 | * Support UTF-8 content. 20 | * Closely implement the whole [XML-RPC WordPress API](http://codex.Wordpress.org/XML-RPC_WordPress_API). 21 | * Detail exception will be thrown when errors occurs. 22 | * (v2.2) Support proxy and http authentication. 23 | * (v2.2.1) Allow value of `DateTime` class to be convert correctly to `datetime.iso8601` XML-RPC type, 24 | * (v2.4.0) Support using custom User Agent string beside the default User Agent string. 25 | * (v2.4.0) Support callbacks on **sending** and **error** events 26 | 27 | ## Installation 28 | 29 | ~~You will need [Composer](https://getcomposer.org/) installed on your machine to use this library~~ [Composer](https://getcomposer.org/) now is not required but recommended. Verify that composer is installed by typing this command 30 | 31 | ```bash 32 | composer --version 33 | ``` 34 | 35 | Choose one of the following methods to install **Wordpress XML-RPC PHP Client** 36 | 37 | ### Your project has used composer: 38 | 39 | Add this dependency into your `composer.json` file 40 | 41 | ```json 42 | "hieu-le/wordpress-xmlrpc-client":"~2.0" 43 | ``` 44 | 45 | After that, run `composer update` to install this package. 46 | 47 | ### Your project does not use composer: 48 | 49 | Clone or download the archive of this package from [github](https://github.com/letrunghieu/Wordpress-xmlrpc-client/releases). Include all files in the `src` directory into your project and start using **Wordpress XML-RPC Client**. You have to update the code of this library manually if using it without Composer. 50 | 51 | Required PHP extension is `xmlrpc` extension. The `curl` extension is optional but recommended. 52 | 53 | 54 | ## Usage 55 | 56 | All API call will be executed via an instance of the `WordpressClient` class. Since version 2.4.0, there is no mandatory parameters in the contructor. `endPoint`, `username`, and `password` can be updated anytime by calling `setCredentials` method. The last parameter in previous version contructor (which is an instance of `\Illuminate\Log\Writer` class) is deprecated and will be removed in the next major release. Below is an example of using this library: 57 | 58 | ```php 59 | # Your Wordpress website is at: http://wp-website.com 60 | $endpoint = "http://wp-website.com/xmlrpc.php"; 61 | 62 | # The Monolog logger instance 63 | $wpLog = new Monolog\Logger('wp-xmlrpc'); 64 | 65 | # Create client instance 66 | $wpClient = new \HieuLe\WordpressXmlrpcClient\WordpressClient(); 67 | # Log error 68 | $wpClient->onError(function($error, $event) use ($wpLog){ 69 | $wpLog->addError($error, $event); 70 | }); 71 | 72 | # Set the credentials for the next requests 73 | $wpClient->setCredentials($endpoint, 'username', 'password'); 74 | 75 | ``` 76 | 77 | If you have used logging feture of previous version of this library, you should update your code to use the new way of loggin as above, the Monolog instance can be replaced by any kinds of logging tool that you have. 78 | 79 | To use date time value, you must use an instance of `DateTime` class instead of a string. 80 | 81 | There will be 2 types of exception may be thrown from this library: 82 | 83 | * `XmlrpcException`: this kind of exception will be thrown if there is an error when the server executing your request 84 | * `NetworkException`: this kind of exception will be thrown if there is an error when transfer your request to server or when getting the response. 85 | 86 | For API reference, visit [Wordpress documentation](http://codex.Wordpress.org/XML-RPC_WordPress_API) or [Library API documentation](http://letrunghieu.github.io/wordpress-xmlrpc-client/api/index.html) 87 | 88 | ## User Agent (since 2.4.0) 89 | 90 | The library use the default User Agent when contacting with Wordpress blogs. If you want to use onother one, pass your custom User Agent string into the `setUserAgent` method. If you passed a _falsy_ value (`null`, `false`, ...) the default one will be used (thank @WarrenMoore) 91 | 92 | ## Callbacks and events (since 2.4.0) 93 | 94 | The library allow developers to listen on two events `Sending` and `Error`. You can add new closure as a callback for each events by calling `on` method with the closure as parameter (see the `onError` example above). 95 | 96 | ### `onSending($event)` 97 | 98 | This event is fired before each request is send to Wordpress blogs. `$event` is an array: 99 | 100 | - `event`: the name of the event, here is `sending` 101 | - `endpoint`: URL of the current endpoint 102 | - `username`: current username 103 | - `password`: current password 104 | - `method`: current XML-RPC method 105 | - `params`: parameters passed to the current method 106 | - `request`: the body of the current request which will be sent 107 | - `proxy`: current proxy config 108 | - `auth`: current http auth config 109 | 110 | ### `onError($errorMessage, $event)` 111 | 112 | This event is fired when the library run into errors, before any exception thrown. `$errorMessage` is a string. `$event` is an array: 113 | 114 | - `event`: the name of the event, here is `sending` 115 | - `endpoint`: URL of the current endpoint 116 | - `request`: the body of the current request 117 | - `proxy`: current proxy config 118 | - `auth`: current http auth config 119 | 120 | 121 | ## Unit testing 122 | 123 | By default, the project use recorded data as the default data for test suite. However, if you want to test with your own Wordpress installation, there are available options inside the `./tests/xmlrpc.yml` file: 124 | 125 | * `endpoint`: the url of your Wordpress XML-RPC endpoint 126 | * `admin_login`: the email or username of a user with the *Administrator* role 127 | * `admin_password`: the password of the admin user 128 | * `guest_login`: the email or username of a user with the *Subscriber* role 129 | * `guest_password`: the password of the guest user 130 | 131 | After update the `./tests/xmlrpc.yml` file, run your test again. 132 | -------------------------------------------------------------------------------- /vendor/hieu-le/wordpress-xmlrpc-client/apigen.conf: -------------------------------------------------------------------------------- 1 | source: "./src" 2 | destination: "./docs" 3 | title: "Wordpress XML-RPC PHP Client" 4 | baseUrl: "http://letrunghieu.github.io/wordpress-xmlrpc-client/api" 5 | php: "no" 6 | sourceCode: "no" 7 | googleAnalytics: "UA-49054610-2" -------------------------------------------------------------------------------- /vendor/hieu-le/wordpress-xmlrpc-client/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hieu-le/wordpress-xmlrpc-client", 3 | "description": "A PHP client for Wordpress websites that closely implement the XML-RPC WordPress API with full test suite built in", 4 | "keywords": ["wordpress", "xmlrpc", "client", "remote", "api"], 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Hieu Le", 9 | "email": "letrunghieu.cse09@gmail.com", 10 | "homepage": "http://www.hieule.info" 11 | } 12 | ], 13 | "repositories": [ 14 | { 15 | "type": "vcs", 16 | "url": "https://github.com/letrunghieu/php-vcr.git" 17 | } 18 | ], 19 | "require": { 20 | "php": ">=5.3.0", 21 | "ext-xmlrpc": "*" 22 | }, 23 | "require-dev": { 24 | "phpunit/phpunit": "*", 25 | "symfony/yaml": "2.*", 26 | "php-vcr/php-vcr": "dev-master", 27 | "php-vcr/phpunit-testlistener-vcr": "*", 28 | "illuminate/support": "~4.0" 29 | }, 30 | "autoload": { 31 | "psr-4": { 32 | "HieuLe\\WordpressXmlrpcClient\\": "src/" 33 | } 34 | }, 35 | "minimum-stability": "stable" 36 | } 37 | -------------------------------------------------------------------------------- /vendor/hieu-le/wordpress-xmlrpc-client/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 18 | ./tests/ 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /vendor/hieu-le/wordpress-xmlrpc-client/src/Exception/NetworkException.php: -------------------------------------------------------------------------------- 1 | message} (Code: {$this->code})"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/hieu-le/wordpress-xmlrpc-client/src/Exception/XmlrpcException.php: -------------------------------------------------------------------------------- 1 | message} (Code: {$this->code})"; 20 | } 21 | } 22 | --------------------------------------------------------------------------------