Changeset 2833215
- Timestamp:
- 12/13/2022 06:45:33 PM (3 years ago)
- Location:
- appexperts/trunk
- Files:
-
- 17 added
- 57 edited
-
app-expert.php (modified) (2 diffs)
-
includes/features/authentication/apis/endpoints/app-expert-user-endpoint.php (modified) (4 diffs)
-
includes/features/authentication/apis/routes/app-expert-user-profile-routes.php (modified) (1 diff)
-
includes/features/authentication/helpers/app-expert-user-response-helper.php (modified) (1 diff)
-
includes/features/log (added)
-
includes/features/log/app-expert-log-init.php (added)
-
includes/features/log/backend (added)
-
includes/features/log/backend/app-expert-log-cronjob.php (added)
-
includes/features/log/backend/app-expert-log-settings.php (added)
-
includes/features/log/templates (added)
-
includes/features/log/templates/settings-tabs (added)
-
includes/features/log/templates/settings-tabs/logs.php (added)
-
includes/features/notification/backend/app-expert-notification-settings.php (modified) (2 diffs)
-
includes/features/notification/helpers/app-expert-notification-helper.php (modified) (2 diffs)
-
includes/init/abstracts/app-expert-integration.php (modified) (4 diffs)
-
includes/init/common/app-expert-logger.php (added)
-
includes/init/common/app-expert-route.php (modified) (1 diff)
-
includes/integrations/contact-form-7/app-expert-contact-form-7-init.php (modified) (1 diff)
-
includes/integrations/freemius/app-expert-freemius-init.php (modified) (1 diff)
-
includes/integrations/peepso-core/apis/endpoints/app-expert-peepso-core-members-endpoint.php (modified) (1 diff)
-
includes/integrations/peepso-core/apis/endpoints/app-expert-peepso-core-post-endpoint.php (modified) (3 diffs)
-
includes/integrations/peepso-core/apis/endpoints/app-expert-peepso-core-users-endpoint.php (modified) (1 diff)
-
includes/integrations/peepso-core/apis/modifications/app-expert-peepso-core-notification.php (modified) (1 diff)
-
includes/integrations/peepso-core/apis/modifications/app-expert-peepso-core-settings.php (modified) (3 diffs)
-
includes/integrations/peepso-core/apis/modifications/app-expert-peepso-core-user.php (added)
-
includes/integrations/peepso-core/apis/requests/app-expert-add-post-request.php (modified) (2 diffs)
-
includes/integrations/peepso-core/apis/routes/app-expert-peepso-core-comment-routes.php (modified) (1 diff)
-
includes/integrations/peepso-core/apis/routes/app-expert-peepso-core-routes.php (modified) (5 diffs)
-
includes/integrations/peepso-core/apis/routes/app-expert-peepso-core-users-routes.php (modified) (2 diffs)
-
includes/integrations/peepso-core/apis/serializers/app-expert-comment-serializer.php (modified) (1 diff)
-
includes/integrations/peepso-core/apis/serializers/app-expert-post-serializer.php (modified) (3 diffs)
-
includes/integrations/peepso-core/apis/serializers/app-expert-user-serializer.php (modified) (1 diff)
-
includes/integrations/peepso-core/app-expert-peepso-core-init.php (modified) (1 diff)
-
includes/integrations/peepso-core/backend/app-expert-peepso-core-send-notification.php (modified) (2 diffs)
-
includes/integrations/peepso-core/helpers/app-expert-peepso-core-notification-helper.php (modified) (1 diff)
-
includes/integrations/peepso-friends/apis/endpoints/app-expert-peepso-friends-list-endpoint.php (modified) (2 diffs)
-
includes/integrations/peepso-friends/apis/modifications/app-expert-peepso-friends-notification.php (modified) (1 diff)
-
includes/integrations/peepso-friends/apis/modifications/app-expert-peepso-friends-user.php (modified) (2 diffs)
-
includes/integrations/peepso-friends/apis/routes/app-expert-peepso-friends-routes.php (modified) (2 diffs)
-
includes/integrations/peepso-friends/app-expert-peepso-friends-init.php (modified) (1 diff)
-
includes/integrations/peepso-friends/backend/app-expert-peepso-friends-notification-settings.php (modified) (2 diffs)
-
includes/integrations/peepso-friends/backend/app-expert-peepso-friends-send-notification.php (modified) (2 diffs)
-
includes/integrations/peepso-friends/helpers (added)
-
includes/integrations/peepso-friends/helpers/app-expert-peepso-friends-notification-helper.php (added)
-
includes/integrations/peepso-groups/apis/endpoints/app-expert-peepso-groups-endpoint.php (modified) (3 diffs)
-
includes/integrations/peepso-groups/apis/modifications/app-expert-album-apis.php (modified) (3 diffs)
-
includes/integrations/peepso-groups/apis/modifications/app-expert-peepso-groups-notification.php (modified) (1 diff)
-
includes/integrations/peepso-groups/apis/modifications/app-expert-peepso-groups-settings.php (modified) (1 diff)
-
includes/integrations/peepso-groups/apis/modifications/app-expert-peepso-groups-user.php (modified) (1 diff)
-
includes/integrations/peepso-groups/apis/modifications/app-expert-post-apis.php (modified) (3 diffs)
-
includes/integrations/peepso-groups/apis/modifications/app-expert-video-apis.php (modified) (1 diff)
-
includes/integrations/peepso-groups/apis/routes/app-expert-peepso-groups-routes.php (modified) (1 diff)
-
includes/integrations/peepso-groups/app-expert-peepso-groups-init.php (modified) (1 diff)
-
includes/integrations/peepso-groups/backend/app-expert-peepso-groups-send-notification.php (modified) (2 diffs)
-
includes/integrations/peepso-groups/helpers/app-expert-peepso-groups-notification-helper.php (added)
-
includes/integrations/peepso-photos/apis/endpoints/app-expert-peepso-photos-endpoint.php (modified) (9 diffs)
-
includes/integrations/peepso-photos/app-expert-peepso-photos-init.php (modified) (1 diff)
-
includes/integrations/peepso-videos/apis/endpoints/app-expert-peepso-videos-endpoint.php (modified) (1 diff)
-
includes/integrations/peepso-videos/apis/modifications/app-expert-peepso-videos-settings.php (modified) (1 diff)
-
includes/integrations/peepso-videos/apis/modifications/app-expert-post-apis.php (modified) (3 diffs)
-
includes/integrations/peepso-videos/apis/routes/app-expert-peepso-videos-routes.php (modified) (1 diff)
-
includes/integrations/peepso-videos/app-expert-peepso-videos-init.php (modified) (1 diff)
-
includes/integrations/sitepress-multilingual-cms/app-expert-sitepress-multilingual-cms-init.php (modified) (1 diff)
-
includes/integrations/woocommerce-bookings/app-expert-woocommerce-bookings-init.php (modified) (1 diff)
-
includes/integrations/woocommerce/app-expert-woocommerce-init.php (modified) (1 diff)
-
includes/integrations/wordpress/apis/response-meta-data/app-expert-gutenberg-blocks-meta-data.php (added)
-
includes/integrations/wordpress/apis/response-meta-data/blocks-meta (added)
-
includes/integrations/wordpress/apis/response-meta-data/blocks-meta/app-expert-gutenberg-block-core-cover-meta-data.php (added)
-
includes/integrations/wordpress/apis/wrapped-apis/app-expert-cpt-controller.php (modified) (1 diff)
-
includes/integrations/wordpress/app-expert-wordpress-init.php (modified) (2 diffs)
-
includes/integrations/wordpress/backend/app-expert-taxonomy-image-settings.php (modified) (2 diffs)
-
includes/integrations/wordpress/helpers/app-expert-gutenberg-block-helper.php (added)
-
includes/integrations/yith-woocommerce-wishlist/app-expert-yith-woocommerce-wishlist-init.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
appexperts/trunk/app-expert.php
r2808834 r2833215 3 3 Plugin Name: AppExperts 4 4 Description: Integrate App Experts builder functionality with your wordpress website 5 Version: 1.3. 35 Version: 1.3.4 6 6 Author: AppExperts 7 7 Author URI: https://appexperts.io/ … … 84 84 //todo:find a better way 85 85 86 const APP_EXPERT_PLUGIN_VERSION = '1.3. 3'; // used in assets86 const APP_EXPERT_PLUGIN_VERSION = '1.3.4'; // used in assets 87 87 const APP_EXPERT_API_NAMESPACE = 'app-expert/v1'; 88 88 -
appexperts/trunk/includes/features/authentication/apis/endpoints/app-expert-user-endpoint.php
r2808832 r2833215 27 27 $request = App_Expert_Profile_Helper::remove_user_meta_data_update($request); 28 28 29 $res = $this->update_user_meta($request, $user_id); 30 if (is_wp_error($res)) 31 return $res; 29 32 30 33 $response = parent::update_item($request); 31 34 if (is_wp_error($response)) 32 35 return $response; 33 34 do_action('ae_user_update_profile',$request, $user_id);35 36 36 37 return App_Expert_Response::wp_rest_success( … … 47 48 { 48 49 49 $mobile_number = $request->get_param(' mobile_number');50 $mobile_number = $request->get_param('phone'); 50 51 $firebase_access_token = $request->get_param('firebase_access_token'); 51 $birthdate = $request->get_param('birthdate');52 $gender = $request->get_param('gender');53 52 54 53 if(isset($firebase_access_token)){ … … 101 100 102 101 } 103 if(isset($gender)){104 $user_query = new WP_User_Query(105 array(106 'user_id' => $user_id,107 'meta_key' => 'gender',108 )109 );110 // Get the results from the query111 $users = $user_query->get_results();112 if($users){113 update_user_meta( $user_id, 'gender', $gender);114 }else{115 add_user_meta( $user_id, 'gender', $gender);116 }117 }118 if(isset($birthdate)){119 $user_query = new WP_User_Query(120 array(121 'user_id' => $user_id,122 'meta_key' => 'birthdate',123 )124 );125 // Get the results from the query126 $users = $user_query->get_results();127 if($users){128 update_user_meta( $user_id, 'birthdate', $birthdate);129 }else{130 add_user_meta( $user_id, 'birthdate', $birthdate);131 }132 }133 102 return $user_id; 134 103 } … … 138 107 $user_id=get_current_user_id(); 139 108 require_once(ABSPATH.'wp-admin/includes/user.php' ); 140 $success = wp_delete_user($user_id ,0);109 $success = wp_delete_user($user_id); 141 110 return App_Expert_Response::success("app_expert_delete_user_success", 142 111 'User deleted sueccssfully',["result"=>$success] -
appexperts/trunk/includes/features/authentication/apis/routes/app-expert-user-profile-routes.php
r2808832 r2833215 61 61 'type' => 'string', 62 62 'context' => array( 'edit' ), 63 ), 64 'phone' => array( 65 'description' => __( 'User phone' , 'app-expert' ), 66 'type' => 'string', 67 'context' => array( 'edit' ), 63 68 ) 64 69 ]; -
appexperts/trunk/includes/features/authentication/helpers/app-expert-user-response-helper.php
r2789917 r2833215 91 91 $data['login_type'] = $user_logged_in_by_mobile?"phone_otp":"user_password"; 92 92 93 $data=apply_filters('ae_login_user_data_object',$data,new WP_REST_Request(),$user); 94 93 95 return $data; 94 96 } -
appexperts/trunk/includes/features/notification/backend/app-expert-notification-settings.php
r2789917 r2833215 8 8 add_filter('ae_settings_tabs',array($this, 'add_notification_tab'), 10, 1); 9 9 add_action('admin_init', [$this, 'register_settings']); 10 10 add_filter('ae_daily_log_custom_settings',array($this,"add_logs")); 11 11 } 12 12 … … 48 48 return $tabs; 49 49 } 50 public function add_logs($settings_array){ 51 $server_key = get_option('server_key'); 52 $settings_array['notification']= [ 53 "is_allowed"=>!empty($server_key)?"yes":"no", 54 "automatic_send_allowed"=>get_option('notification_options') 55 ]; 56 57 return $settings_array; 58 } 50 59 51 60 } -
appexperts/trunk/includes/features/notification/helpers/app-expert-notification-helper.php
r2808832 r2833215 125 125 $_notification['content'] = $_notification['content'][$_lang]; 126 126 127 $_notification = apply_filters("ae_send_push_notification_object",$_notification,$_lang); 128 127 129 if(!is_array($_user_token))$_user_token=[$_user_token]; 128 130 foreach ($_user_token as $token){ … … 138 140 $_notification['title'] =json_decode($_notification['title'],true); 139 141 $_notification['content'] =json_decode($_notification['content'],true); 140 141 142 $_langs = App_Expert_Language::get_active_languages(); 142 143 foreach($_langs as $lang=>$obj){ 143 144 $id="'$lang' in topics".(!empty($segments)?" && ($segments)":""); 145 $_notification = apply_filters("ae_send_push_notification_object",$_notification,$lang); 144 146 App_Expert_FCM_Helper::send_message($_notification['title'][$lang],$_notification['content'][$lang],$id,$_notification,'topic',$_notification['attachment']); 145 147 } -
appexperts/trunk/includes/init/abstracts/app-expert-integration.php
r2808832 r2833215 5 5 $this->_include_files(); 6 6 $this->_include_hooks(); 7 add_filter('ae_daily_log_custom_integration',array($this,"add_logs")); 7 8 } 8 9 … … 11 12 abstract public function get_current_path(); 12 13 abstract public function get_dependencies(); 14 abstract public function add_logs($arr); 13 15 14 16 private function _include_files(){ … … 51 53 glob($this->get_dir()."frontend/*.php"), 52 54 glob($this->get_dir()."apis/middlewares/*.php"), 55 glob($this->get_dir()."apis/serializers/*.php"), 53 56 glob($this->get_dir()."apis/modifications/*.php") 54 57 ); … … 58 61 glob( $this->get_dir()."apis/requests/*.php"), 59 62 glob( $this->get_dir()."apis/helpers/*.php"), 60 glob( $this->get_dir()."apis/serializers/*.php"),61 63 glob( $this->get_dir()."apis/endpoints/*.php"), 62 64 glob( $this->get_dir()."apis/routes/*.php") -
appexperts/trunk/includes/init/common/app-expert-route.php
r2789917 r2833215 36 36 37 37 $validation_class=new $validator($request); 38 $logs_data=[ 39 "request"=>$request->get_params(), 40 "request_files"=>$request->get_file_params(), 41 "request_headers"=>$request->get_headers(), 42 "request_"=>$request->get_content_type(), 43 ]; 38 44 if($validation_class->validate()){ 39 return (new $call_back_class())->$call_back_method($request); 45 $response= (new $call_back_class())->$call_back_method($request); 46 $logs_data["response"]=$response; 47 App_Expert_Logger::info("Api Call {$request->get_route()} : success",$logs_data); 48 return $response; 40 49 } 41 50 $error = $validation_class->getErrors(); 51 $logs_data["errors"]=$error; 52 App_Expert_Logger::error("Api Call {$request->get_route()} : Validation Errors",$logs_data); 42 53 return count($error)?$error[0]:new WP_Error("something_went_wrong","error from App_Expert_Routes:add",[]); 43 54 }catch (Exception $e){ 55 $logs_data["exception"]=$e->getMessage(); 56 App_Expert_Logger::fatal("Api Call {$request->get_route()} : Exception",$logs_data); 44 57 return App_Expert_Response::fail("something_went_wrong",$e->getMessage(),[]); 45 58 } -
appexperts/trunk/includes/integrations/contact-form-7/app-expert-contact-form-7-init.php
r2800813 r2833215 19 19 } 20 20 21 public function add_logs($arr){ 22 $arr[] ='contact-form-7'; 23 return $arr; 24 } 21 25 } 22 26 new App_Expert_Contact_Form_7_Init(); -
appexperts/trunk/includes/integrations/freemius/app-expert-freemius-init.php
r2789917 r2833215 13 13 public function get_dependencies(){ 14 14 return []; 15 } 16 public function add_logs($arr){ 17 $arr[] ='freemius'; 18 return $arr; 15 19 } 16 20 -
appexperts/trunk/includes/integrations/peepso-core/apis/endpoints/app-expert-peepso-core-members-endpoint.php
r2808832 r2833215 8 8 $ajax->set_follow_status($resp); 9 9 $val=$request->get_param('follow'); 10 $msg= "un-follow done successfully";11 if($val) $msg= "follow done successfully";10 $msg=__("un-follow done successfully",'app-expert'); 11 if($val) $msg=__("follow done successfully",'app-expert'); 12 12 if($resp->success){ 13 return App_Expert_Peepso_Core_Response_Helper::success_response(App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_SUCCESS,['message'=> translate($msg,'app-expert')]);13 return App_Expert_Peepso_Core_Response_Helper::success_response(App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_SUCCESS,['message'=>$msg]); 14 14 } 15 15 return App_Expert_Peepso_Core_Response_Helper::fail_response( App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_BAD_REQUEST,$resp->errors); -
appexperts/trunk/includes/integrations/peepso-core/apis/endpoints/app-expert-peepso-core-post-endpoint.php
r2808832 r2833215 6 6 $_POST['id'] = get_current_user_id(); 7 7 $_POST['uid']= $request->get_param('profile_id')??0; 8 if($request->get_param('group_id')){ 9 $_POST['group_id'] = (int)$_POST['group_id']; 10 } 8 11 $result = apply_filters('ae_peepso_handle_add_post_request', $_POST, $request); 9 12 if(is_wp_error($result)){ … … 29 32 $_POST['page'] = isset($_POST['page'])?(int)$_POST['page']:1; 30 33 $_POST['pinned'] = ($_POST['page']<2)?1:0; 34 if($request->get_param('group_id')){ 35 $_POST['group_id'] = (int)$_POST['group_id']; 36 } 31 37 $_POST = apply_filters('ae_peepso_handle_get_post_request', $_POST,$request); 32 38 … … 129 135 return App_Expert_Peepso_Core_Response_Helper::success_response( App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_SUCCESS, ['message'=>"this post has been unpinned successfully"]); 130 136 } 137 138 public function report(WP_REST_Request $request){ 139 $_POST = array_merge($_POST,$request->get_params()); 140 $_POST['uid'] = get_current_user_id(); 141 $PeepSoActivity = new PeepSoActivity(); 142 $resp = new PeepSoAjaxResponse(); 143 $PeepSoActivity->report($resp); 144 if($resp->success){ 145 $resp->set('msg',count($resp->notices)?$resp->notices[0]:__('This item has been reported', 'peepso-core')); 146 return App_Expert_Peepso_Core_Response_Helper::success_response( App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_SUCCESS, $resp->data); 147 } 148 return App_Expert_Peepso_Core_Response_Helper::fail_response(App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_BAD_REQUEST,$resp->errors); 149 150 } 151 152 public function submit_vote(WP_REST_Request $request){ 153 $_POST = array_merge($_POST,$request->get_params()); 154 155 $PeepSoPollsAjax = PeepSoPollsAjax::get_instance(); 156 $resp = new PeepSoAjaxResponse(); 157 $PeepSoPollsAjax->submit_vote($resp); 158 if($resp->success){ 159 $resp->set('msg',__('Vote added.', 'peepso-core')); 160 unset($resp->data['html']); 161 return App_Expert_Peepso_Core_Response_Helper::success_response( App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_SUCCESS, $resp->data); 162 } 163 return App_Expert_Peepso_Core_Response_Helper::fail_response(App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_BAD_REQUEST,$resp->errors); 164 } 165 166 public function change_vote(WP_REST_Request $request){ 167 $_POST = array_merge($_POST,$request->get_params()); 168 169 $PeepSoPollsAjax = PeepSoPollsAjax::get_instance(); 170 $resp = new PeepSoAjaxResponse(); 171 $PeepSoPollsAjax->change_vote($resp); 172 if($resp->success){ 173 $resp->set('msg',__('Vote retrived', 'peepso-core')); 174 unset($resp->data['html']); 175 $post_id = $_POST['poll_id']; 176 $user_id = $_POST['user_id']; 177 $polls_model = new PeepSoPollsModel(); 178 $user_polls = $polls_model->get_user_polls($user_id, $post_id); 179 180 $max_answers = (int) get_post_meta($post_id, 'max_answers', TRUE); 181 $options = unserialize(get_post_meta($post_id, 'select_options', TRUE)); 182 $total_user_poll = get_post_meta($post_id, 'total_user_poll', TRUE); 183 184 $resp->data = array( 185 'id' => $post_id, 186 'options' => (is_array($options) && count($options) > 1) ? $options : array(), 187 'type' => $max_answers === 0 ? 'checkbox' : 'radio', 188 'enabled' => TRUE, 189 'is_voted' => FALSE, 190 'total_user_poll' => $total_user_poll, 191 'user_polls' => $user_polls 192 ); 193 return App_Expert_Peepso_Core_Response_Helper::success_response( App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_SUCCESS, $resp->data); 194 } 195 return App_Expert_Peepso_Core_Response_Helper::fail_response(App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_BAD_REQUEST,$resp->errors); 196 } 197 198 public function unvote(WP_REST_Request $request){ 199 $_POST = array_merge($_POST,$request->get_params()); 200 201 $PeepSoPollsAjax = PeepSoPollsAjax::get_instance(); 202 $resp = new PeepSoAjaxResponse(); 203 $PeepSoPollsAjax->unvote($resp); 204 if($resp->success){ 205 $resp->set('msg',__('Vote deleted.', 'peepso-core')); 206 unset($resp->data['html']); 207 return App_Expert_Peepso_Core_Response_Helper::success_response( App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_SUCCESS, $resp->data); 208 } 209 return App_Expert_Peepso_Core_Response_Helper::fail_response(App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_BAD_REQUEST,$resp->errors); 210 } 131 211 } -
appexperts/trunk/includes/integrations/peepso-core/apis/endpoints/app-expert-peepso-core-users-endpoint.php
r2808832 r2833215 35 35 } 36 36 37 public function report(WP_REST_Request $request){ 38 // profile.report 39 $peepso_profile = PeepSoProfile::get_instance(); 40 $_POST = array_merge($_POST,$request->get_params()); 41 $resp = new PeepSoAjaxResponse(); 42 $peepso_profile->report($resp); 43 if($resp->success){ 44 $resp->set('msg',count($resp->notices)?$resp->notices[0]:__('This item has been reported', 'peepso-core')); 45 return App_Expert_Peepso_Core_Response_Helper::success_response( App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_SUCCESS, $resp->data); 46 } 47 return App_Expert_Peepso_Core_Response_Helper::fail_response(App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_BAD_REQUEST,$resp->errors); 48 49 } 50 51 public function get_followers(WP_REST_Request $request) { 52 $user_id = $request->get_param('user_id')?:get_current_user_id(); 53 $page = $request->get_param('page')?:1; 54 55 // default limit is 1 (NewScroll) 56 $limit = $request->get_param('limit')?:1; 57 58 $offset = ($page - 1) * $limit; 59 60 if ($page < 1) { 61 $page = 1; 62 $offset = 0; 63 } 64 65 $users = PeepSoUserFollower::get_followers([ 66 'offset' => $offset, 67 'limit' => $limit, 68 'user_id' => $user_id 69 ]); 70 foreach ($users as $i=>$u){ 71 $users[$i] = (new App_Expert_User_Serializer(PeepSoUser::get_instance($u->uf_active_user_id)))->get(); 72 } 73 return App_Expert_Peepso_Core_Response_Helper::success_response(App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_SUCCESS,$users); 74 75 } 76 77 78 public function get_following(WP_REST_Request $request) { 79 $user_id = $request->get_param('user_id')?:get_current_user_id(); 80 $page = $request->get_param('page')?:1; 81 82 // default limit is 1 (NewScroll) 83 $limit = $request->get_param('limit')?:1; 84 85 $offset = ($page - 1) * $limit; 86 87 if ($page < 1) { 88 $page = 1; 89 $offset = 0; 90 } 91 92 $users = PeepSoUserFollower::get_following([ 93 'offset' => $offset, 94 'limit' => $limit, 95 'user_id' => $user_id 96 ]); 97 foreach ($users as $i=>$u){ 98 $users[$i] = (new App_Expert_User_Serializer(PeepSoUser::get_instance($u->uf_passive_user_id)))->get(); 99 } 100 return App_Expert_Peepso_Core_Response_Helper::success_response(App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_SUCCESS,$users); 101 102 } 37 103 38 104 -
appexperts/trunk/includes/integrations/peepso-core/apis/modifications/app-expert-peepso-core-notification.php
r2808832 r2833215 20 20 public function add_additional_params($_notification){ 21 21 if(in_array($_notification->type,$this->notification_types)){ 22 $_notification->title = __($_notification->title,'peepso-core'); 23 $record = App_Expert_Peepso_Core_Notification_helper::get_notification($_notification->object_id); 24 $PeepSoUser = PeepSoUser::get_instance($record->not_from_user_id); 25 $_notification->user_sending_notification_data = (new App_Expert_User_Serializer($PeepSoUser))->get(); 26 $activities = PeepSoActivity::get_instance(); 27 $preview = get_post_meta($record->not_external_id,'peepso_human_friendly', TRUE); 28 if(!is_array($preview) && strlen($preview)) { 29 $preview = trim( 30 truncateHtml($preview, 31 PeepSo::get_option('notification_preview_length',50), 32 PeepSo::get_option('notification_preview_ellipsis','...'), 33 false, FALSE) 34 ); 35 } 36 $preview = (string)$preview?:""; 37 $_notification->content = $preview; 38 if($record){ 39 switch($_notification->type){ 40 case 'wall_post': 41 case 'tag': 42 $_notification->object_id = $record->act_id; 43 break; 44 case 'user_comment': 45 case 'tag_comment': 46 case 'stream_reply_comment': 47 $not_activity = $activities->get_activity_data($record->not_external_id, $record->not_module_id); 48 $_notification->comment_activity_id = $not_activity->act_id; 49 $parent_activity = $activities->get_activity_data($not_activity->act_comment_object_id, $not_activity->act_comment_module_id); 50 $_notification->object_id = $parent_activity->act_id; 51 break; 52 case 'like_post': 53 $not_activity = $activities->get_activity_post($record->not_act_id); 54 $_notification->object_id =$not_activity->act_id; 55 if($not_activity->post_type ==="peepso-comment"){ 56 $not_activity = $activities->get_activity_data($not_activity->act_comment_object_id, $not_activity->act_comment_module_id); 57 $_notification->object_id =$not_activity->act_id; 58 } 59 } 60 } 22 $_notification = App_Expert_Peepso_Core_Notification_helper::get_extra_data($_notification); 61 23 } 62 24 return $_notification; -
appexperts/trunk/includes/integrations/peepso-core/apis/modifications/app-expert-peepso-core-settings.php
r2808832 r2833215 20 20 } 21 21 22 $data['reactions'] = $reactions; 22 $data['reactions'] = $reactions; 23 23 24 24 $data['privacy'] = $this->getPrivacyData(); 25 $data['hashtags'] = $this->get_hashtag_settings(); 26 $data['post_backgrounds'] = $this->get_post_background_settings(); 27 $data['giphy'] = $this->get_post_giphy_settings(); 28 $data['polls'] = $this->get_post_polls_settings(); 25 29 26 30 $moods = PeepSoMoods::get_instance(); … … 48 52 } 49 53 $data['plugins'] = $plugins; 50 // $reasons = str_replace("\r", '', PeepSo::get_option('site_reporting_types', __('Spam', 'peepso-core'))); 51 // $reasons = explode("\n", $reasons); 52 // $reasons = apply_filters('peepso_activity_report_reasons', $reasons); 53 // $reasons[] = "Other"; 54 // $data['reporting_reasons'] = $reasons; 54 $reasons = str_replace("\r", '', PeepSo::get_option('site_reporting_types', __('Spam', 'peepso-core'))); 55 $reasons = explode("\n", $reasons); 56 $reasons = apply_filters('peepso_activity_report_reasons', $reasons); 57 $reasons[] = "Other"; 58 $reasons_translated = []; 59 foreach ($reasons as $reason){ 60 $reason = esc_attr($reason); 61 $reason = stripslashes($reason); 62 $reasons_translated[] =[ 63 "value"=>$reason, 64 "label"=>__($reason, 'peepso-core') 65 ]; 66 } 67 $data['site_reporting'] = (string)PeepSo::get_option('site_reporting_enable'); 68 69 $data['reporting_reasons'] = $reasons_translated; 70 $data['location'] = [ 71 'location_enable'=>PeepSo::get_option('location_enable', 0), 72 'location_gmap_api_key'=>PeepSo::get_option('location_gmap_api_key',''), 73 ]; 74 $data['mentions']=[ 75 'tags_enable'=>PeepSo::get_option('tags_enable', 0), 76 'mentions_auto_on_comment_reply'=>PeepSo::get_option('mentions_auto_on_comment_reply',0), 77 ]; 55 78 return $data; 56 79 } … … 79 102 80 103 } 104 105 private function get_hashtag_settings (){ 106 $settings = array(); 107 $settings['hashtags_enable'] = (string)PeepSo::get_option('hashtags_enable', 1); 108 $settings['hashtags_post_count_interval'] = (string)PeepSo::get_option('hashtags_post_count_interval', 60); 109 $settings['hashtags_post_count_batch_size'] = (string)PeepSo::get_option('hashtags_post_count_batch_size', 5); 110 $settings['hashtags_delete_empty'] = (string)PeepSo::get_option('hashtags_delete_empty', 1); 111 $settings['hashtags_everything'] = (string)PeepSo::get_option('hashtags_everything', 0); 112 $settings['hashtags_min_length'] = (string)PeepSo::get_option('hashtags_min_length', 3); 113 $settings['hashtags_max_length'] = (string)PeepSo::get_option('hashtags_max_length', 16); 114 $settings['hashtags_must_start_with_letter'] = (string)PeepSo::get_option('hashtags_must_start_with_letter', 0); 115 $settings['hashtags_rebuild'] = (string)PeepSo::get_option('hashtags_rebuild', 0); 116 return $settings; 117 } 118 119 private function get_post_background_settings (){ 120 $settings = array(); 121 $settings['post_backgrounds_enable'] = (string)PeepSo::get_option('post_backgrounds_enable', 0); 122 $settings['post_backgrounds_max_length'] = (string)PeepSo::get_option('post_backgrounds_max_length',150); 123 $settings['post_backgrounds_max_linebreaks'] = (string)PeepSo::get_option('post_backgrounds_max_linebreaks', 0); 124 $PeepSoPostBackgroundsModel = new PeepSoPostBackgroundsModel(FALSE); 125 $backgrounds = $PeepSoPostBackgroundsModel->post_backgrounds; 126 foreach ($backgrounds as $background){ 127 128 $text_color = $background->content->text_color; 129 if(strpos($text_color, 'rgba') === 0){ 130 $background->content->text_color = $this->change_color_rgba_to_hex($text_color); 131 } 132 133 $background_color = $background->content->background_color; 134 if(strpos($background_color, 'rgba') === 0){ 135 $background->content->background_color = $this->change_color_rgba_to_hex($background_color); 136 } 137 138 $text_shadow_color = $background->content->text_shadow_color; 139 if(strpos($text_shadow_color, 'rgba') === 0){ 140 $background->content->text_shadow_color = $this->change_color_rgba_to_hex($text_shadow_color); 141 } 142 } 143 144 $settings['backgrounds'] = $PeepSoPostBackgroundsModel->post_backgrounds; 145 return $settings; 146 } 147 148 private function get_post_giphy_settings (){ 149 150 $settings = array(); 151 $settings['giphy_api_key'] = (string)PeepSo::get_option('giphy_api_key'); 152 $settings['giphy_display_limit'] = (string)PeepSo::get_option('giphy_display_limit',25); 153 $settings['giphy_rating'] = (string)PeepSo::get_option('giphy_rating', ''); 154 $settings['giphy_posts_enable'] = (string)PeepSo::get_option('giphy_posts_enable', 1); 155 $settings['giphy_rendition_posts'] = (string)PeepSo::get_option('giphy_rendition_posts', 'original'); 156 $settings['giphy_comments_enable'] = (string)PeepSo::get_option('giphy_comments_enable', 1); 157 $settings['giphy_rendition_comments'] = (string)PeepSo::get_option('giphy_rendition_comments', 'fixed_width'); 158 return $settings; 159 } 160 161 private function change_color_rgba_to_hex ($color){ 162 $color = str_replace( ' ', '', $color ); 163 sscanf( $color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha ); 164 165 $output = "#"; 166 $output.= dechex((1 - $alpha) * $red + $alpha * $red); 167 $output.= dechex((1 - $alpha) * $green + $alpha * $green); 168 $output.= dechex((1 - $alpha) * $blue + $alpha * $blue); 169 return $output; 170 } 171 172 private function get_post_polls_settings (){ 173 174 $settings = array(); 175 $settings['polls_enable'] = (string)PeepSo::get_option('polls_enable', 1); 176 $settings['polls_multiselect'] = (string)PeepSo::get_option('polls_multiselect',1); 177 $settings['polls_changevote'] = (string)PeepSo::get_option('polls_changevote', 0); 178 $settings['polls_show_result_before_vote'] = (string)PeepSo::get_option('polls_show_result_before_vote', 0); 179 $settings['polls_sort_result_by_votes'] = (string)PeepSo::get_option('polls_sort_result_by_votes', 0); 180 return $settings; 181 } 81 182 } 82 183 new App_Expert_Peepso_Core_Settings(); -
appexperts/trunk/includes/integrations/peepso-core/apis/requests/app-expert-add-post-request.php
r2808832 r2833215 23 23 $val = $this->request->get_param("type"); 24 24 //todo:add_apply filter 25 $types = array('activity', 'audio', 'video', 'photo', 'files' );25 $types = array('activity', 'audio', 'video', 'photo', 'files', 'post_backgrounds', 'giphy', 'poll'); 26 26 if (!in_array($val, $types)) { 27 return $this->get_validation_error("invalid_type", "type", __("Invalid parameter(s): type", "app-expert"), __("type should be activity, video, audio, photo or files", "app-expert"));27 return $this->get_validation_error("invalid_type", "type", __("Invalid parameter(s): type", "app-expert"), __("type should be activity, video, audio, photo , post_backgrounds or files", "app-expert")); 28 28 } 29 29 return true; … … 60 60 $val = $this->request->get_param("url"); 61 61 $type = $this->request->get_param("type"); 62 if (($type === 'video' || $type === 'audio') && empty($val)) { 62 $video = $this->request->get_param("video"); 63 $audio = $this->request->get_param("audio"); 64 65 if (($type === 'video' || $type === 'audio') && empty($val) && empty($video) && empty($audio)) { 63 66 return $this->get_validation_error("empty_url", "url", __("Invalid parameter(s): url", "app-expert"), __("url should not be empty once type of post is video or audio", "app-expert")); 64 67 } -
appexperts/trunk/includes/integrations/peepso-core/apis/routes/app-expert-peepso-core-comment-routes.php
r2808832 r2833215 29 29 'required' => true 30 30 ), 31 'giphy' => array( 32 'description' => __( 'giphy url' , 'app-expert' ), 33 'type' => 'string', 34 'required' => false 35 ) 31 36 ]); 32 37 } -
appexperts/trunk/includes/integrations/peepso-core/apis/routes/app-expert-peepso-core-routes.php
r2808832 r2833215 17 17 App_Expert_Route::delete(PEEPSO_CORE_API_NAMESPACE, '/posts/delete', "App_Expert_Peepso_Core_Post_Endpoint@delete" , $this->delete_post_parameters(), "App_Expert_Auth_Request"); 18 18 App_Expert_Route::post(PEEPSO_CORE_API_NAMESPACE, '/posts/pin', "App_Expert_Peepso_Core_Post_Endpoint@pin" , $this->pin_post_parameters(), "App_Expert_Auth_Request"); 19 App_Expert_Route::post(PEEPSO_CORE_API_NAMESPACE, '/posts/report', "App_Expert_Peepso_Core_Post_Endpoint@report" , $this->report_post_parameters(), "App_Expert_Auth_Request"); 20 App_Expert_Route::post(PEEPSO_CORE_API_NAMESPACE, '/posts/poll/vote', "App_Expert_Peepso_Core_Post_Endpoint@submit_vote" , $this->vote_post_parameters(), "App_Expert_Auth_Request"); 21 App_Expert_Route::post(PEEPSO_CORE_API_NAMESPACE, '/posts/poll/vote/change', "App_Expert_Peepso_Core_Post_Endpoint@change_vote" , $this->change_vote_post_parameters(), "App_Expert_Auth_Request"); 22 App_Expert_Route::post(PEEPSO_CORE_API_NAMESPACE, '/posts/poll/vote/delete', "App_Expert_Peepso_Core_Post_Endpoint@unvote" , $this->delete_vote_post_parameters(), "App_Expert_Auth_Request"); 23 19 24 } 20 25 … … 90 95 ), 91 96 'type' => array( 92 'description' => __( 'type of the post Allowed values are(activity, files,photo,audio Or video).' , 'app-expert' ),97 'description' => __( 'type of the post Allowed values are(activity, files, photo, audio, video, giphy, poll or post_backgrounds).' , 'app-expert' ), 93 98 'type' => 'string', 94 99 'required' => false … … 97 102 'description' => __( 'to schedule posting.' , 'app-expert' ), 98 103 'type' => 'date', 104 'required' => false 105 ), 106 'options' => array( 107 'description' => __( 'required if type is poll.' , 'app-expert' ), 108 'type' => 'array', 109 'required' => false 110 ), 111 'location' => array( 112 'description' => __( 'add location to the post if allowed. location should have "name","latitude" and "longitude".' , 'app-expert' ), 113 'type' => 'Object', 114 'required' => false 115 ), 116 'preset_id' => array( 117 'description' => __( 'post id of post background get it from app-expert settings api post_background section -> backgrounds array of objects, it is required if type = post_backgrounds' , 'app-expert' ), 118 'type' => 'integer', 119 'required' => false 120 ), 121 'text_color' => array( 122 'description' => __( 'text color of post background get it from app-expert settings api post_background section -> backgrounds array of objects, it is required if type = post_backgrounds' , 'app-expert' ), 123 'type' => 'string', 124 'required' => false 125 ), 126 'background' => array( 127 'description' => __( 'image url of post background get it from app-expert settings api post_background section -> backgrounds array of objects, it is required if type = post_backgrounds' , 'app-expert' ), 128 'type' => 'string', 129 'required' => false 130 ), 131 'giphy' => array( 132 'description' => __( 'giphy url , it is required if type = giphy' , 'app-expert' ), 133 'type' => 'string', 134 'required' => false 135 ), 136 'options' => array( 137 'description' => __( 'poll options , it is required if type = poll' , 'app-expert' ), 138 'type' => 'array', 139 'required' => false 140 ), 141 'allow_multiple' => array( 142 'description' => __( 'can select on option or more , it is required if type = poll and value = 0 or 1' , 'app-expert' ), 143 'type' => 'integer', 99 144 'required' => false 100 145 ) … … 131 176 'type' => 'string', 132 177 'required' => false 133 ) 134 178 ), 179 'location' => array( 180 'description' => __( 'add location to the post if allowed. location should have "name","latitude" and "longitude".' , 'app-expert' ), 181 'type' => 'Object', 182 'required' => false 183 ), 135 184 ); 136 185 … … 162 211 ); 163 212 } 213 public function report_post_parameters(){ 214 return array( 215 'act_id' => array( 216 'description' => __( 'activity id to report.' , 'app-expert' ), 217 'type' => 'integer', 218 'required' => true 219 ), 220 'reason' => array( 221 'description' => __( 'one of reasons in settings.' , 'app-expert' ), 222 'type' => 'string', 223 'required' => true 224 ), 225 'reason_desc' => array( 226 'description' => __( 'Report description.' , 'app-expert' ), 227 'type' => 'string', 228 'required' => false 229 ), 230 ); 231 } 232 233 public function vote_post_parameters(){ 234 return array( 235 'user_id' => array( 236 'description' => __( 'user_id' , 'app-expert' ), 237 'type' => 'integer', 238 'required' => true 239 ), 240 'poll_id' => array( 241 'description' => __( 'post id' , 'app-expert' ), 242 'type' => 'integer', 243 'required' => true 244 ), 245 'polls' => array( 246 'description' => __( 'array of pre-defined options ' , 'app-expert' ), 247 'type' => 'array', 248 'required' => true 249 ), 250 ); 251 } 252 253 public function change_vote_post_parameters(){ 254 return array( 255 'user_id' => array( 256 'description' => __( 'user_id' , 'app-expert' ), 257 'type' => 'integer', 258 'required' => true 259 ), 260 'poll_id' => array( 261 'description' => __( 'post id' , 'app-expert' ), 262 'type' => 'integer', 263 'required' => true 264 ) 265 ); 266 } 267 268 public function delete_vote_post_parameters(){ 269 return array( 270 'user_id' => array( 271 'description' => __( 'user_id' , 'app-expert' ), 272 'type' => 'integer', 273 'required' => true 274 ), 275 'poll_id' => array( 276 'description' => __( 'post id' , 'app-expert' ), 277 'type' => 'integer', 278 'required' => true 279 ) 280 ); 281 } 164 282 165 283 } -
appexperts/trunk/includes/integrations/peepso-core/apis/routes/app-expert-peepso-core-users-routes.php
r2808832 r2833215 10 10 public function register_routes(){ 11 11 App_Expert_Route::get(PEEPSO_CORE_API_NAMESPACE, '/users/profile(?:/(?P<id>\d+))?', "App_Expert_Peepso_Core_Users_Endpoint@get_user" , $this->get_user_parameters(), "App_Expert_Auth_Request"); 12 App_Expert_Route::get(PEEPSO_CORE_API_NAMESPACE, '/users/followers', "App_Expert_Peepso_Core_Users_Endpoint@get_followers" , $this->get_follow_parameters(), "App_Expert_Auth_Request"); 13 App_Expert_Route::get(PEEPSO_CORE_API_NAMESPACE, '/users/followings', "App_Expert_Peepso_Core_Users_Endpoint@get_following" , $this->get_follow_parameters(), "App_Expert_Auth_Request"); 12 14 App_Expert_Route::post(PEEPSO_CORE_API_NAMESPACE, '/users/profile-image', "App_Expert_Peepso_Core_Users_Endpoint@edit_profile_image" , $this->get_profile_image_parameters(), "App_Expert_Auth_Request"); 13 15 App_Expert_Route::post(PEEPSO_CORE_API_NAMESPACE, '/users/cover-imag', "App_Expert_Peepso_Core_Users_Endpoint@edit_coverImage" , $this->get_cover_image_parameters(), "App_Expert_Auth_Request"); 16 App_Expert_Route::post(PEEPSO_CORE_API_NAMESPACE, '/users/report', "App_Expert_Peepso_Core_Users_Endpoint@report" , $this->get_report_parameters(), "App_Expert_Auth_Request"); 14 17 } 15 18 … … 49 52 } 50 53 54 public function get_report_parameters() 55 { 56 return array( 57 'user_id' => array( 58 'description' => __( 'user id to report.' , 'app-expert' ), 59 'type' => 'integer', 60 'required' => true 61 ), 62 'reason' => array( 63 'description' => __( 'one of reasons in settings.' , 'app-expert' ), 64 'type' => 'string', 65 'required' => true 66 ), 67 'reason_desc' => array( 68 'description' => __( 'Report description.' , 'app-expert' ), 69 'type' => 'string', 70 'required' => false 71 ), 72 ); 73 } 74 75 private function get_follow_parameters() 76 { 77 return array( 78 'user_id' => array( 79 'description' => __( 'user id to report.' , 'app-expert' ), 80 'type' => 'integer', 81 'required' => false 82 ), 83 'page' => array( 84 'description' => __( 'one of reasons in settings.' , 'app-expert' ), 85 'type' => 'integer', 86 'required' => false 87 ), 88 'limit' => array( 89 'description' => __( 'Report description.' , 'app-expert' ), 90 'type' => 'integer', 91 'required' => false 92 ), 93 ); 94 } 51 95 52 96 -
appexperts/trunk/includes/integrations/peepso-core/apis/serializers/app-expert-comment-serializer.php
r2808832 r2833215 24 24 foreach($this->commentAttributes as $key){ 25 25 $Arr[$key]= $this->activity[$key]; 26 } 27 $comment_giphy = get_post_meta($this->activity["ID"], 'peepso_giphy', TRUE); 28 if($comment_giphy){ 29 $Arr['giphy'] = $comment_giphy; 26 30 } 27 31 $PeepSoUser = PeepSoUser::get_instance($this->activity["post_author"]); -
appexperts/trunk/includes/integrations/peepso-core/apis/serializers/app-expert-post-serializer.php
r2808832 r2833215 28 28 $arr[$key]= $this->post[$key]; 29 29 } 30 $post_background = get_post_meta($this->post['ID'], 'peepso_post_background', TRUE); 31 if($post_background){ 32 $arr['background'] = json_decode($post_background); 33 $arr['type'] = 'post_backgrounds'; 34 } 35 $post_giphy = get_post_meta($this->post['ID'], 'peepso_giphy', TRUE); 36 if($post_giphy){ 37 $arr['giphy'] = $post_giphy; 38 $arr['type'] = 'giphy'; 39 } 40 $post_poll_options = get_post_meta($this->post['ID'], 'select_options', true); 41 if($post_poll_options){ 42 $arr['poll_options'] = unserialize($post_poll_options); 43 } 44 $total_user_poll = get_post_meta($this->post['ID'], 'total_user_poll', true); 45 if($total_user_poll >= 0){ 46 $arr['total_user_poll'] = (string)$total_user_poll; 47 } 48 $max_answers = get_post_meta($this->post['ID'], 'max_answers', true); 49 if($max_answers >= 0){ 50 $arr['max_answers'] = (string)$max_answers; 51 } 30 52 //======== temporary fix date =========== 31 53 //$arr['post_date'] = wp_date('Y-m-d h:i:s',strtotime($arr['post_date'])); … … 51 73 ]; 52 74 } 53 $arr['comment_count'] = App_Expert_Peepso_Core_Activity_Helper::getCommentCount($this->post['ID']);75 $arr['comment_count'] = App_Expert_Peepso_Core_Activity_Helper::getCommentCount($this->post['ID']); 54 76 55 77 $arr['reactions']=App_Expert_Peepso_Core_Activity_Helper::getReactionCount($this->post['act_id']); … … 74 96 $arr['get_current_user_id'] = get_current_user_id(); 75 97 $arr['can_pin'] = App_Expert_Peepso_Core_Allowed_Plugins_Helper::can_pin(intval($this->post['ID'])); 76 98 //======== location data =========== 99 $arr['location'] = get_post_meta($this->post['ID'],"peepso_location",true); 100 if(empty($arr['location'])) $arr['location']=null; 101 //======== location data =========== 77 102 return apply_filters("ae_peepso_post_object",$arr, $this->post); 78 103 } -
appexperts/trunk/includes/integrations/peepso-core/apis/serializers/app-expert-user-serializer.php
r2808832 r2833215 47 47 $PeepSoUserFollower = new PeepSoUserFollower( $this->user->get_id(),get_current_user_id()); 48 48 $arr['is_follow'] = $PeepSoUserFollower->follow; 49 49 $arr['followers_count'] =(string) PeepSoUserFollower::count_followers( $this->user->get_id(), true); 50 50 51 return apply_filters("ae_peepso_user_object",$arr, $this->user); 51 52 } -
appexperts/trunk/includes/integrations/peepso-core/app-expert-peepso-core-init.php
r2808832 r2833215 31 31 return plugin_dir_path(__FILE__); 32 32 } 33 34 public function add_logs($arr){ 35 $arr[] ='peepso-core'; 36 return $arr; 37 } 33 38 } 34 39 -
appexperts/trunk/includes/integrations/peepso-core/backend/app-expert-peepso-core-send-notification.php
r2808832 r2833215 18 18 $this->_current_integration = $_current_integration; 19 19 add_action('peepso_action_create_notification_after',array($this,'add_push_notification'),99,1); 20 add_filter( "ae_send_push_notification_object" , array($this,'add_push_notification_additional_params'), 10, 2); 20 21 } 21 22 public function add_push_notification($id){ … … 46 47 } 47 48 49 public function add_push_notification_additional_params($_notification,$lang){ 50 if(in_array($_notification["type"],array_keys($this->settings_map))) { 51 $_notification = App_Expert_Peepso_Core_Notification_helper::get_extra_data((object)$_notification); 52 $_notification->title = $_notification->sender["user_fullname"]." ".$_notification->title; 53 $_notification = (array)$_notification; 54 } 55 return $_notification; 56 } 48 57 } -
appexperts/trunk/includes/integrations/peepso-core/helpers/app-expert-peepso-core-notification-helper.php
r2808832 r2833215 7 7 return $wpdb->get_row($wpdb->prepare($sql, $id), OBJECT); 8 8 } 9 public static function get_extra_data($_notification){ 10 $_notification->title = __($_notification->title,'peepso-core'); 11 $record = self::get_notification($_notification->object_id); 12 if(!$record) return $_notification; 13 $PeepSoUser = PeepSoUser::get_instance($record->not_from_user_id); 14 $_notification->sender = (new App_Expert_User_Serializer($PeepSoUser))->get(); 15 $activities = PeepSoActivity::get_instance(); 16 if($record){ 17 switch($_notification->type){ 18 case 'wall_post': 19 case 'tag': 20 $not_activity = $activities->get_activity_post($record->not_act_id); 21 $_notification->object_id = $record->not_act_id; 22 break; 23 case 'user_comment': 24 case 'tag_comment': 25 case 'stream_reply_comment': 26 $not_activity = $activities->get_activity_data($record->not_external_id, $record->not_module_id); 27 $_notification->comment_activity_id = $not_activity->act_id; 28 $parent_activity = $activities->get_activity_data($not_activity->act_comment_object_id, $not_activity->act_comment_module_id); 29 $_notification->object_id = $parent_activity->act_id; 30 break; 31 case 'like_post': 32 $not_activity = $activities->get_activity_post($record->not_act_id); 33 $_notification->object_id =$not_activity->act_id; 34 if($not_activity->post_type ==="peepso-comment"){ 35 $not_activity = $activities->get_activity_data($not_activity->act_comment_object_id, $not_activity->act_comment_module_id); 36 $_notification->object_id =$not_activity->act_id; 37 } 38 } 39 } 40 $preview = get_post_meta($record->not_external_id,'peepso_human_friendly', TRUE); 41 if(empty($preview)){ 42 $preview = $not_activity->post_content; 43 } 44 if(!is_array($preview) && strlen($preview)) { 45 $preview = trim( 46 truncateHtml($preview, 47 PeepSo::get_option('notification_preview_length',50), 48 PeepSo::get_option('notification_preview_ellipsis','...'), 49 false, FALSE) 50 ); 51 } 52 $preview = (string)$preview?:""; 53 54 $_notification->content = $preview; 55 56 return $_notification; 57 } 9 58 } -
appexperts/trunk/includes/integrations/peepso-friends/apis/endpoints/app-expert-peepso-friends-list-endpoint.php
r2808832 r2833215 30 30 } 31 31 32 public function get_requests( ){32 public function get_requests(WP_REST_Request $request){ 33 33 // .../peepso-friends/templates/friends/pending.php 34 34 $PeepSoFriendsRequests = PeepSoFriendsRequests::get_instance(); 35 $data=['received'=>[]]; 36 37 if ($PeepSoFriendsRequests->has_received_requests(get_current_user_id())) { 38 while ($request = $PeepSoFriendsRequests->get_next_request()) { 39 $friend = PeepSoUser::get_instance($request['freq_user_id']); 40 $request['Friend_data'] = (new App_Expert_User_Serializer($friend))->get(); 41 $data['received'][]=$request; 42 } 35 $data=[]; 36 $type = $request->has_param('type')?$request->get_param('type'):"received"; 37 switch ($type){ 38 //redundant code should stay as is 39 //the if checks & set the data to a private class parameter :) 40 case 'received': 41 if ($PeepSoFriendsRequests->has_received_requests(get_current_user_id())) { 42 while ($fr_request = $PeepSoFriendsRequests->get_next_request()) { 43 $friend = PeepSoUser::get_instance($fr_request['freq_user_id']); 44 $fr_request['Friend_data'] = (new App_Expert_User_Serializer($friend))->get(); 45 $data[]=$fr_request; 46 } 47 } 48 break; 49 case 'sent' : 50 if ($PeepSoFriendsRequests->has_sent_requests(get_current_user_id())) { 51 while ($request = $PeepSoFriendsRequests->get_next_request()) { 52 $friend = PeepSoUser::get_instance($request['freq_friend_id']); 53 $request['Friend_data'] = (new App_Expert_User_Serializer($friend))->get(); 54 $data[]=$request; 55 } 56 } 57 break; 43 58 } 44 45 // if ($PeepSoFriendsRequests->has_sent_requests(get_current_user_id())) { 46 // while ($request = $PeepSoFriendsRequests->get_next_request()) { 47 // $friend = PeepSoUser::get_instance($request['freq_friend_id']); 48 // $request['Friend_data'] = (new UserSerializer($friend))->get(); 49 // $data['sent'][]=$request; 50 // } 51 // } 52 return App_Expert_Peepso_Core_Response_Helper::success_response(App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_SUCCESS,$data['received']); 59 return App_Expert_Peepso_Core_Response_Helper::success_response(App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_SUCCESS,$data); 53 60 } 54 61 … … 72 79 switch ($sent_action){ 73 80 case 'add_friend': 74 $msg= "friend request added successfully";81 $msg=__("friend request added successfully",'app-expert'); 75 82 break; 76 83 case 'cancel_request': 77 $msg= "friend request canceled successfully";84 $msg=__("friend request canceled successfully",'app-expert'); 78 85 break; 79 86 case 'accept_request': 80 $msg= "friend request accepted successfully";87 $msg=__("friend request accepted successfully",'app-expert'); 81 88 break; 82 89 case 'remove_friend': 83 $msg= "friend removed successfully";90 $msg=__("friend removed successfully",'app-expert'); 84 91 break; 85 92 } 86 return App_Expert_Peepso_Core_Response_Helper::success_response(App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_SUCCESS,['message'=> translate($msg,'app-expert')]);93 return App_Expert_Peepso_Core_Response_Helper::success_response(App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_SUCCESS,['message'=>$msg]); 87 94 } 88 95 else -
appexperts/trunk/includes/integrations/peepso-friends/apis/modifications/app-expert-peepso-friends-notification.php
r2808832 r2833215 14 14 public function add_additional_params($_notification){ 15 15 if(in_array($_notification->type,$this->notification_types)){ 16 $_notification->title = __($_notification->title,'peepso-core'); 17 $record = App_Expert_Peepso_Core_Notification_helper::get_notification($_notification->object_id); 18 $PeepSoUser = PeepSoUser::get_instance($record->not_from_user_id); 19 $_notification->user_sending_notification_data = (new App_Expert_User_Serializer($PeepSoUser))->get(); 20 $activities = PeepSoActivity::get_instance(); 21 $preview = get_post_meta($record->not_external_id,'peepso_human_friendly', TRUE); 22 if(!is_array($preview) && strlen($preview)) { 23 $preview = trim( 24 truncateHtml($preview, 25 PeepSo::get_option('notification_preview_length',50), 26 PeepSo::get_option('notification_preview_ellipsis','...'), 27 false, FALSE) 28 ); 29 } 30 $preview = (string)$preview?:""; 31 $_notification->content = $preview; 32 if($record){ 33 switch($_notification->type){ 34 case 'wall_post': 35 case 'tag': 36 $_notification->object_id = $record->act_id; 37 break; 38 case 'user_comment': 39 case 'like_comment': 40 case 'tag_comment': 41 case 'stream_reply_comment': 42 $not_activity = $activities->get_activity_data($record->not_external_id, $record->not_module_id); 43 $_notification->comment_activity_id = $not_activity->act_id; 44 $parent_activity = $activities->get_activity_data($not_activity->act_comment_object_id, $not_activity->act_comment_module_id); 45 $_notification->object_id = $parent_activity->act_id; 46 break; 47 } 48 } 16 $_notification = App_Expert_Peepso_Friends_Notification_helper::get_extra_data($_notification); 49 17 } 50 18 return $_notification; -
appexperts/trunk/includes/integrations/peepso-friends/apis/modifications/app-expert-peepso-friends-user.php
r2808832 r2833215 4 4 public function __construct() 5 5 { 6 add_filter('ae_login_user_data_object', array($this, 'add_auth_changes'), 10, 3); 6 7 add_filter('ae_peepso_profile_tab_sub_items',array($this,'get_tab_sub_items'),10,4); 7 8 } … … 28 29 return $subItems; 29 30 } 31 public function add_auth_changes($user_data,WP_REST_Request $request,WP_User $user){ 32 $friends_requests = PeepSoFriendsRequests::get_instance(); 33 $user_data['friends_count'] = count($friends_requests->get_received_requests($user->ID)); 34 return $user_data; 35 } 30 36 31 37 } -
appexperts/trunk/includes/integrations/peepso-friends/apis/routes/app-expert-peepso-friends-routes.php
r2808832 r2833215 11 11 { 12 12 App_Expert_Route::get(PEEPSO_CORE_API_NAMESPACE, '/friends', "App_Expert_Peepso_Friends_List_Endpoint@get" , $this->get_friends_parameters(),"App_Expert_Auth_Request"); 13 App_Expert_Route::get(PEEPSO_CORE_API_NAMESPACE, '/friends/requests', "App_Expert_Peepso_Friends_List_Endpoint@get_requests" , [],"App_Expert_Auth_Request");13 App_Expert_Route::get(PEEPSO_CORE_API_NAMESPACE, '/friends/requests', "App_Expert_Peepso_Friends_List_Endpoint@get_requests" , $this->get_requests_parameters(),"App_Expert_Auth_Request"); 14 14 App_Expert_Route::post(PEEPSO_CORE_API_NAMESPACE, '/friends/action/(?P<friend_action>\D+)', "App_Expert_Peepso_Friends_List_Endpoint@actions" , $this->get_friends_actions_parameters(),"App_Expert_Auth_Request"); 15 15 … … 30 30 'description' => __( 'number of friends per page.' , 'app-expert' ), 31 31 'type' => 'integer', 32 'required' => false 33 ), 34 ]; 35 } 36 public function get_requests_parameters(){ 37 return [ 38 'type' => array( 39 'description' => __( 'get friends requests lists sent/received.' , 'app-expert' ), 40 'type' => 'string', 32 41 'required' => false 33 42 ), -
appexperts/trunk/includes/integrations/peepso-friends/app-expert-peepso-friends-init.php
r2808832 r2833215 38 38 return true; 39 39 } 40 41 public function add_logs($arr) 42 { 43 $arr[] ='peepso-friends'; 44 return $arr; 45 } 40 46 } 41 47 -
appexperts/trunk/includes/integrations/peepso-friends/backend/app-expert-peepso-friends-notification-settings.php
r2808832 r2833215 11 11 public function register_settings() 12 12 { 13 add_settings_field('peepso_friends_notification_settings', __('Peepso Friends', 'app-expert'), [$this, 'add_notification_settings'], 'notification-options', 'App Experts');13 add_settings_field('peepso_friends_notification_settings', __('Peepso Friends', 'app-expert'), [$this, 'add_notification_settings'], 'notification-options', 'App Experts'); 14 14 } 15 15 … … 19 19 $options = get_option('notification_options'); 20 20 $peepso_friends_options = [ 21 [ 22 'title' => __('Receive request', 'app-expert'), 23 'value' => 'receive_request' 24 ], 21 25 [ 22 26 'title' => __('Accept request', 'app-expert'), -
appexperts/trunk/includes/integrations/peepso-friends/backend/app-expert-peepso-friends-send-notification.php
r2808832 r2833215 4 4 private $_current_integration; 5 5 private $settings_map = [ 6 'friends_requests' => ['accept_request'] 6 'friends_requests' => ['accept_request'], 7 7 ]; 8 8 public function __construct(App_Expert_Integration $_current_integration) 9 9 { 10 10 $this->_current_integration = $_current_integration; 11 add_action('peepso_friends_requests_after_add', array($this, 'add_notification'), 10, 2); 11 12 add_action('peepso_action_create_notification_after',array($this,'add_push_notification'),99,1); 13 add_filter( "ae_send_push_notification_object" , array($this,'add_push_notification_additional_params'), 10, 2); 12 14 } 15 13 16 public function add_push_notification($id){ 14 17 $record = App_Expert_Peepso_Core_Notification_helper::get_notification($id); … … 37 40 } 38 41 42 public function add_push_notification_additional_params($_notification,$lang){ 43 if(in_array($_notification["type"],array_keys($this->settings_map))) { 44 $_notification = App_Expert_Peepso_Friends_Notification_helper::get_extra_data((object)$_notification); 45 $_notification->title = $_notification->sender["user_fullname"]." ".$_notification->title; 46 $_notification = (array)$_notification; 47 } 48 return $_notification; 49 } 50 51 public function add_notification($from_id,$to_id){ 52 53 $notification_options = get_option('notification_options',[]); 54 if(empty($notification_options)||empty($notification_options['peepso_friends_settings']))return; 55 $is_option_exist = false; 56 $is_option_exist = array_key_exists('receive_request',$notification_options['peepso_friends_settings']); 57 if(!$is_option_exist) return; 58 59 $SenderUser = PeepSoUser::get_instance($from_id); 60 $sender = (new App_Expert_User_Serializer($SenderUser))->get(); 61 $domain = 'app-expert'; 62 $_langs = App_Expert_Language::get_active_languages(); 63 $title=[]; 64 $content=[]; 65 //prepare segments to send to 66 foreach ($_langs as $lang=>$obj){ 67 App_Expert_Language::switch_lang($lang); 68 $title[$lang] = translate('Friend Rquest' , $domain); 69 $content[$lang] = sprintf(...array_merge([translate('New Friend Request from %s', $domain)], array($sender["user_fullname"]))); 70 } 71 72 $data=[ 73 "title" => json_encode($title), 74 "content" => json_encode($content), 75 "target" => null, 76 "segment" => "", 77 "attachment_id" => null, 78 "type" => 'new_friends_requests', 79 "object_id" => null, 80 "created_at" => gmdate( 'Y-m-d H:i:s' ) 81 ]; 82 83 App_Expert_Notification_Helper::send_push_to_user($data, $to_id); 84 } 39 85 } -
appexperts/trunk/includes/integrations/peepso-groups/apis/endpoints/app-expert-peepso-groups-endpoint.php
r2808832 r2833215 62 62 $segments = array(); 63 63 $segments[0][] = array( 64 'href' => ' ',64 'href' => 'stream', 65 65 'title'=> __('Stream', 'groupso'), 66 66 'icon' => 'gcis gci-stream', … … 75 75 } 76 76 77 $title = __('Members', 'groupso');78 79 80 77 $segments[0][] = array( 81 78 'href' => 'members', 82 'title'=> $title,79 'title'=> __('Members', 'groupso'), 83 80 'count'=>$pending = $group->pending_admin_members_count, 84 81 'icon' => 'gcis gci-user-friends', … … 90 87 foreach ($segments as $tabs){ 91 88 foreach ($tabs as $tab){ 92 $tabname=strtolower($tab['href']);93 if(empty($tabname)) $tabname=strtolower($tab['title']);94 $groupData['profile_tabs'][]=[95 'id'=>$tabname,96 'label'=>$tab['title'],97 'count'=>(int)($tab['count']??0),98 'url'=>$group->get_url().$tab['href'],99 'sub_items'=> App_Expert_Peepso_Groups_Tabs_Helper::getTabSubItems($tabname,$group,$group->get_url())100 ];89 $tabname=strtolower($tab['href']); 90 if(empty($tabname)) $tabname=strtolower($tab['title']); 91 $groupData['profile_tabs'][]=[ 92 'id'=>$tabname, 93 'label'=>$tab['title'], 94 'count'=>(int)($tab['count']??0), 95 'url'=>$group->get_url().$tab['href'], 96 'sub_items'=> App_Expert_Peepso_Groups_Tabs_Helper::getTabSubItems($tabname,$group,$group->get_url()) 97 ]; 101 98 } 102 99 } -
appexperts/trunk/includes/integrations/peepso-groups/apis/modifications/app-expert-album-apis.php
r2808832 r2833215 18 18 $parameters['group_id' ] = array( 19 19 'description' => __( 'if the album is in a group.' , 'app-expert' ), 20 'type' => 'integer',21 20 'required' => false 22 21 ); … … 35 34 { 36 35 if($request->has_param('group_id')){ 37 $post['module_id'] = PeepSoGroupsPlugin::MODULE_ID; 36 $post['module_id'] = PeepSoGroupsPlugin::MODULE_ID; 38 37 $post['privacy'] = PeepSo::ACCESS_PUBLIC; 39 38 } … … 63 62 if($request->has_param('group_id')) 64 63 { 65 $ _POST['user_id'] = $request->get_param('group_id');66 $ _POST['module_id'] = PeepSoGroupsPlugin::MODULE_ID;67 $ _POST['privacy'] = PeepSo::ACCESS_PUBLIC;64 $post['user_id'] = $request->get_param('group_id'); 65 $post['module_id'] = PeepSoGroupsPlugin::MODULE_ID; 66 $post['privacy'] = PeepSo::ACCESS_PUBLIC; 68 67 } 69 68 return $post; -
appexperts/trunk/includes/integrations/peepso-groups/apis/modifications/app-expert-peepso-groups-notification.php
r2808832 r2833215 24 24 public function add_additional_params($_notification){ 25 25 if(in_array($_notification->type,$this->notification_types)){ 26 $_notification->title = __($_notification->title,'peepso-core'); 27 $record = App_Expert_Peepso_Core_Notification_helper::get_notification($_notification->object_id); 28 $PeepSoUser = PeepSoUser::get_instance($record->not_from_user_id); 29 $_notification->sender = (new App_Expert_User_Serializer($PeepSoUser))->get(); 30 31 $preview = get_post_meta($record->not_external_id,'peepso_human_friendly', TRUE); 32 if(!is_array($preview) && strlen($preview)) { 33 $preview = trim( 34 truncateHtml($preview, 35 PeepSo::get_option('notification_preview_length',50), 36 PeepSo::get_option('notification_preview_ellipsis','...'), 37 false, FALSE) 38 ); 39 } 40 $preview = $preview?:""; 41 $_notification->content = $preview; 42 if($record){ 43 switch($_notification->type){ 44 case 'groups_new_post': 45 $args = json_decode($record->not_message_args); 46 if(count($args)) { 47 unset($args[0]); 48 $_notification->title = call_user_func_array("sprintf",array_merge([$_notification->title],$args)); 49 } 50 $activities = PeepSoActivity::get_instance(); 51 $activity = $activities->get_post_object($record->not_external_id); 52 $_notification->object_id = $activity->act_id; 53 break; 54 case 'groups_user_join_request_send': 55 case 'groups_user_join': 56 case 'groups_user_invitation_send': 57 case 'groups_user_join_request_accept': 58 case 'groups_rename': 59 case 'groups_privacy_change': 60 $args = json_decode($record->not_message_args); 61 if(count($args)) { 62 unset($args[0]); 63 $_notification->title = call_user_func_array("sprintf",array_merge([$_notification->title],$args)); 64 } 65 case 'groups_publish': 66 case 'groups_unpublish': 67 $_notification->object_id = $record->not_external_id; 68 break; 69 } 70 } 26 $_notification = App_Expert_Peepso_Groups_Notification_helper::get_extra_data($_notification); 71 27 } 72 28 return $_notification; -
appexperts/trunk/includes/integrations/peepso-groups/apis/modifications/app-expert-peepso-groups-settings.php
r2808832 r2833215 21 21 $data["peepso"]["group_privacy_default"]=-1; 22 22 } 23 24 $data['peepso']['polls']['polls_group'] = (string)PeepSo::get_option('polls_group', 0); 25 23 26 return $data; 24 27 } -
appexperts/trunk/includes/integrations/peepso-groups/apis/modifications/app-expert-peepso-groups-user.php
r2808832 r2833215 46 46 } 47 47 } 48 48 49 return $subItems; 49 50 } -
appexperts/trunk/includes/integrations/peepso-groups/apis/modifications/app-expert-post-apis.php
r2808832 r2833215 11 11 $parameters['group_id' ] = array( 12 12 'description' => __( 'if the post is in a group.' , 'app-expert' ), 13 'type' => 'integer',14 13 'required' => false 15 14 ); … … 19 18 public function handle_group_id_add_post_request( $post,$request) 20 19 { 20 21 21 if(isset($post['group_id'])){ 22 $post['module_id'] = PeepSoGroupsPlugin::MODULE_ID; 22 23 $_POST['module_id'] = PeepSoGroupsPlugin::MODULE_ID; 23 24 } 24 25 return $post; … … 28 29 { 29 30 if(isset($post['group_id'])){ 30 $ post['module_id'] = PeepSoGroupsPlugin::MODULE_ID;31 $_POST['module_id'] = PeepSoGroupsPlugin::MODULE_ID; 31 32 } 32 33 return $post; -
appexperts/trunk/includes/integrations/peepso-groups/apis/modifications/app-expert-video-apis.php
r2808832 r2833215 10 10 $parameters['group_id' ] = array( 11 11 'description' => __( 'if the video is in a group.' , 'app-expert' ), 12 'type' => 'integer',13 12 'required' => false 14 13 ); -
appexperts/trunk/includes/integrations/peepso-groups/apis/routes/app-expert-peepso-groups-routes.php
r2808832 r2833215 11 11 { 12 12 App_Expert_Route::get(PEEPSO_CORE_API_NAMESPACE, '/groups/is-plugin-active', "App_Expert_Peepso_Groups_Endpoint@is_active" , array()); 13 App_Expert_Route::get(PEEPSO_CORE_API_NAMESPACE, '/groups', "App_Expert_Peepso_Groups_Endpoint@get" , $this->get_groups_parameters() ,"App_Expert_Auth_Request");13 App_Expert_Route::get(PEEPSO_CORE_API_NAMESPACE, '/groups', "App_Expert_Peepso_Groups_Endpoint@get" , $this->get_groups_parameters()); 14 14 App_Expert_Route::get(PEEPSO_CORE_API_NAMESPACE, '/groups/(?P<id>[\d]+)', "App_Expert_Peepso_Groups_Endpoint@get_one", $this->get_single_group_parameters()); 15 App_Expert_Route::get(PEEPSO_CORE_API_NAMESPACE, '/groups/categories', "App_Expert_Peepso_Groups_Endpoint@get_categories", array() );15 App_Expert_Route::get(PEEPSO_CORE_API_NAMESPACE, '/groups/categories', "App_Expert_Peepso_Groups_Endpoint@get_categories", array(),"App_Expert_Auth_Request"); 16 16 App_Expert_Route::post(PEEPSO_CORE_API_NAMESPACE, '/groups', "App_Expert_Peepso_Groups_Endpoint@add" , $this->add_groups_parameters(),"App_Expert_Auth_Request"); 17 17 App_Expert_Route::post(PEEPSO_CORE_API_NAMESPACE, '/groups/change_avatar', "App_Expert_Peepso_Groups_Endpoint@change_avatar" , $this->change_avatar_groups_parameters(),"App_Expert_Auth_Request"); -
appexperts/trunk/includes/integrations/peepso-groups/app-expert-peepso-groups-init.php
r2808832 r2833215 40 40 return true; 41 41 } 42 43 public function add_logs($arr) 44 { 45 $arr[] ='peepso-groups'; 46 return $arr; 47 } 42 48 } 43 49 -
appexperts/trunk/includes/integrations/peepso-groups/backend/app-expert-peepso-groups-send-notification.php
r2808832 r2833215 21 21 $this->_current_integration = $_current_integration; 22 22 add_action('peepso_action_create_notification_after',array($this,'add_push_notification'),99,1); 23 add_filter( "ae_send_push_notification_object" , array($this,'add_push_notification_additional_params'), 10, 2); 23 24 } 24 25 public function add_push_notification($id){ … … 47 48 } 48 49 } 50 public function add_push_notification_additional_params($_notification,$lang){ 51 if(in_array($_notification["type"],array_keys($this->settings_map))) { 52 $_notification = App_Expert_Peepso_Groups_Notification_helper::get_extra_data((object)$_notification); 53 $_notification->title = $_notification->sender["user_fullname"]." ".$_notification->title; 54 $_notification = (array)$_notification; 55 } 56 return $_notification; 57 } 49 58 50 59 } -
appexperts/trunk/includes/integrations/peepso-photos/apis/endpoints/app-expert-peepso-photos-endpoint.php
r2808832 r2833215 5 5 public function upload_photo(WP_REST_Request $request){ 6 6 $_POST = array_merge($_POST,$request->get_params()); 7 if($request->get_param('group_id')){ 8 $_POST['group_id'] = (int)$_POST['group_id']; 9 } 7 10 $_POST = apply_filters('ae_peepso_handle_upload_photo_request',$_POST , $request); 8 11 … … 24 27 $_POST['user_id'] = get_current_user_id(); 25 28 $_POST['type'] = 'album'; 26 29 if($request->get_param('group_id')){ 30 $_POST['group_id'] = (int)$_POST['group_id']; 31 } 27 32 $_POST = apply_filters('ae_peepso_handle_add_album_request', $_POST, $request); 28 33 … … 48 53 'module_id'=>$module_id 49 54 ]; 55 if($request->get_param('group_id')){ 56 $_GET['group_id'] = (int)$_GET['group_id']; 57 } 50 58 $data = apply_filters('ae_peepso_handle_get_album_request',$data, $request); 51 59 … … 62 70 $user_albums = $PeepSoPhotosAlbumModel->get_user_photos_album($user_id, $offset, $limit, $sort, $module_id); 63 71 64 if(!$user_albums){65 return App_Expert_Peepso_Core_Response_Helper::fail_response(App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_BAD_REQUEST,["no albums found. "]);66 }72 // if(!$user_albums){ 73 // return App_Expert_Peepso_Core_Response_Helper::fail_response(App_Expert_Peepso_Core_Response_Helper::STATUS_CODE_BAD_REQUEST,["no albums found. "]); 74 // } 67 75 68 76 $albumsData = []; … … 95 103 $_POST['_wpnonce'] = wp_create_nonce('photo-delete-album') ; 96 104 $_POST['uid'] = get_current_user_id(); 97 105 if($request->get_param('group_id')){ 106 $_POST['group_id'] = (int)$_POST['group_id']; 107 } 98 108 $_POST = apply_filters('ae_peepso_handle_delete_album_request', $_POST, $request); 99 109 … … 126 136 $allowUpdatePrivacy = apply_filters('ae_peepso_handle_edit_album_allow_update_privacy',true,$request); 127 137 $_POST['user_id'] = get_current_user_id(); 138 if($request->get_param('group_id')){ 139 $_POST['group_id'] = (int)$_POST['group_id']; 140 } 128 141 $_POST = apply_filters('ae_peepso_handle_edit_album_request',$_POST ,$request); 129 142 $_POST['owner_id'] = $_POST['user_id']; … … 175 188 $_POST['album_id'] = $request->get_param('album_id') ; 176 189 $_POST['type'] = 'photo'; 177 190 if($request->get_param('group_id')){ 191 $_POST['group_id'] = (int)$_POST['group_id']; 192 } 178 193 $_POST = apply_filters('ae_peepso_handle_add_photos_album_request', $_POST, $request); 179 194 $_POST['photo'] = $request->get_param('photo') ; … … 209 224 'module_id' => 0 210 225 ); 226 if($request->get_param('group_id')){ 227 $_GET['group_id'] = (int)$_GET['group_id']; 228 } 211 229 $data = apply_filters('ae_peepso_handle_get_photos_album_request',$data, $request); 212 230 … … 252 270 'module_id' => 0 253 271 ); 272 if($request->get_param('group_id')){ 273 $_GET['group_id'] = (int)$_GET['group_id']; 274 } 254 275 $data = apply_filters('ae_peepso_handle_get_photos_by_album_album_request',$data ,$request); 255 276 -
appexperts/trunk/includes/integrations/peepso-photos/app-expert-peepso-photos-init.php
r2808832 r2833215 31 31 return true; 32 32 } 33 34 public function add_logs($arr) 35 { 36 $arr[] ='peepso-photos'; 37 return $arr; 38 } 33 39 } 34 40 -
appexperts/trunk/includes/integrations/peepso-videos/apis/endpoints/app-expert-peepso-videos-endpoint.php
r2808832 r2833215 38 38 'module_id' => 0 39 39 ); 40 if($request->get_param('group_id')){ 41 $_GET['group_id'] = (int)$_GET['group_id']; 42 } 40 43 $data = apply_filters('ae_peepso_handle_get_video_request', $data, $request); 41 44 -
appexperts/trunk/includes/integrations/peepso-videos/apis/modifications/app-expert-peepso-videos-settings.php
r2808832 r2833215 7 7 public function add_additional_params_to_settings($data){ 8 8 9 $settings = array( 10 'videos_max_upload_size' => '20', 11 'max_video_length' => 0, 12 ); 9 $video_settings = array(); 10 $video_settings['videos_enabled'] = (string)PeepSo::get_option('videos_video_master_switch', 1); 11 $video_settings['videos_play_inline'] = (string)PeepSo::get_option('videos_play_inline', 0); 12 $video_settings['videos_upload_enable'] = (string)PeepSo::get_option('videos_upload_enable', 0); 13 $video_settings['videos_max_upload_size'] = (string)PeepSo::get_option('videos_max_upload_size', 20); 14 $video_settings['videos_allowed_user_space'] = (string)PeepSo::get_option('videos_allowed_user_space', 0); 15 $video_settings['videos_conversion_mode'] = (string)PeepSo::get_option('videos_conversion_mode', 'no'); 16 $video_settings['videos_allowed_extensions'] = PeepSoVideosUpload::no_conversion_mode_filetypes(); 13 17 14 foreach($settings as $key=>$default){ 15 $data["peepso"][$key] = (string)PeepSo::get_option( $key , $default ); 16 } 18 $audio_settings = array(); 19 $audio_settings['videos_audio_enabled'] = (string)PeepSo::get_option('videos_audio_master_switch', 1); 20 $audio_settings['videos_audio_upload_enable'] = (string)PeepSo::get_option('videos_audio_enable', 0); 21 $audio_settings['videos_audio_max_upload_size'] = (string)PeepSo::get_option('videos_audio_max_upload_size', 20); 22 $audio_settings['videos_audio_allowed_user_space'] = (string)PeepSo::get_option('videos_audio_allowed_user_space', 0); 23 $audio_settings['videos_audio_lastfm'] = (string)PeepSo::get_option('videos_audio_lastfm', 0); 24 $audio_settings['videos_audio_lastfm_api_key'] = (string)PeepSo::get_option('videos_audio_lastfm_api_key'); 25 26 $data['peepso']['video'] = $video_settings; 27 $data['peepso']['audio'] = $audio_settings; 17 28 18 29 return $data; -
appexperts/trunk/includes/integrations/peepso-videos/apis/modifications/app-expert-post-apis.php
r2808832 r2833215 14 14 ); 15 15 16 $parameters['audio' ] = array( 17 'description' => __( 'required if type is audio and audio is uploaded not a url ' , 'app-expert' ), 18 'type' => 'string', 19 'required' => false 20 ); 21 22 $parameters['audio_title' ] = array( 23 'description' => __( 'audio title for uploaded audio file if type is audio and audio is uploaded not a url ' , 'app-expert' ), 24 'type' => 'string', 25 'required' => false 26 ); 27 28 $parameters['audio_artist' ] = array( 29 'description' => __( 'audio artist for uploaded audio file if type is audio and audio is uploaded not a url ' , 'app-expert' ), 30 'type' => 'string', 31 'required' => false 32 ); 33 34 $parameters['audio_album' ] = array( 35 'description' => __( 'audio album for uploaded audio file if type is audio and audio is uploaded not a url ' , 'app-expert' ), 36 'type' => 'string', 37 'required' => false 38 ); 39 40 $parameters['video' ] = array( 41 'description' => __( 'required if type is video and video is uploaded not a url ' , 'app-expert' ), 42 'type' => 'string', 43 'required' => false 44 ); 45 46 $parameters['video_title' ] = array( 47 'description' => __( 'video title for uploaded video file if type is video and video is uploaded not a url ' , 'app-expert' ), 48 'type' => 'string', 49 'required' => false 50 ); 51 16 52 return $parameters; 17 53 } … … 24 60 25 61 if(in_array($request_type, $types) && !empty($request->get_param('url'))){ 26 $post['accepted_type']=$request->get_param('type'); 27 $post['url']=$request->get_param('url'); 62 if($request_type === 'audio'){ 63 $_POST['accepted_type'] = 'audio'; 64 } 28 65 $PeepSoVideosAjax = PeepSoVideosAjax::get_instance(); 29 66 $validation_resp = new PeepSoAjaxResponse(); … … 43 80 } 44 81 } 45 return $ post;82 return $_POST; 46 83 } 47 84 } -
appexperts/trunk/includes/integrations/peepso-videos/apis/routes/app-expert-peepso-videos-routes.php
r2808832 r2833215 19 19 'description' => __( 'video file' , 'app-expert' ), 20 20 'type' => 'file', 21 'required' => false 22 ), 23 'is_audio' => array( 24 'description' => __( 'equal 1 if uploaded file is audio file and it is require in this case' , 'app-expert' ), 25 'type' => 'integer', 21 26 'required' => false 22 27 ) -
appexperts/trunk/includes/integrations/peepso-videos/app-expert-peepso-videos-init.php
r2808832 r2833215 32 32 return true; 33 33 } 34 35 public function add_logs($arr) 36 { 37 $arr[] ='peepso-videos'; 38 return $arr; 39 } 34 40 } 35 41 -
appexperts/trunk/includes/integrations/sitepress-multilingual-cms/app-expert-sitepress-multilingual-cms-init.php
r2789917 r2833215 23 23 new App_Expert_WPML_Language($this); 24 24 } 25 26 public function add_logs($arr) 27 { 28 $arr[] ='sitepress-multilingual-cms'; 29 return $arr; 30 } 25 31 } 26 32 //todo:find a better way to create new object -
appexperts/trunk/includes/integrations/woocommerce-bookings/app-expert-woocommerce-bookings-init.php
r2800813 r2833215 27 27 return plugin_dir_path(__FILE__); 28 28 } 29 30 public function add_logs($arr) 31 { 32 $arr[] ='woocommerce-bookings'; 33 return $arr; 34 } 29 35 } 30 36 -
appexperts/trunk/includes/integrations/woocommerce/app-expert-woocommerce-init.php
r2789917 r2833215 58 58 return plugin_dir_path(__FILE__); 59 59 } 60 61 public function add_logs($arr) 62 { 63 $arr[] ='woocommerce'; 64 return $arr; 65 } 60 66 } 61 67 -
appexperts/trunk/includes/integrations/wordpress/apis/wrapped-apis/app-expert-cpt-controller.php
r2808832 r2833215 80 80 public function get_item($request){ 81 81 $response = parent::get_item($request); 82 82 83 if (is_wp_error($response)) 83 84 return $response; 84 85 85 86 return App_Expert_Response::wp_rest_success( 86 $response,87 apply_filters("ae_single_{$this->post_type}_response",$response,$request), 87 88 'app_expert_post_retrieved', 88 89 'retrieved requested post' -
appexperts/trunk/includes/integrations/wordpress/app-expert-wordpress-init.php
r2789917 r2833215 32 32 return array_merge( 33 33 parent::get_endponints_files(), 34 // glob($this->get_dir()."apis/response-meta-data/blocks-meta/*.php"), 34 35 glob($this->get_dir()."apis/response-meta-data/*.php"), 35 36 glob($this->get_dir()."apis/wrapped-apis/*.php") … … 56 57 return []; 57 58 } 59 60 public function add_logs($arr) 61 { 62 $arr[] ='wordpress'; 63 return $arr; 64 } 58 65 } 59 66 //todo:find a better way to create new object -
appexperts/trunk/includes/integrations/wordpress/backend/app-expert-taxonomy-image-settings.php
r2789917 r2833215 10 10 add_filter('ae_default_settings_tab',array($this, 'set_default_settings_tab'), 10, 1); 11 11 add_action('admin_init', [$this, 'register_settings']); 12 add_filter('ae_daily_log_custom_settings',array($this,"add_logs")); 12 13 13 14 } … … 44 45 return "settings"; 45 46 } 47 public function add_logs($settings_array){ 48 $settings_array['taxonomy_images']= get_option('aeci_options'); 49 return $settings_array; 50 } 46 51 } -
appexperts/trunk/includes/integrations/yith-woocommerce-wishlist/app-expert-yith-woocommerce-wishlist-init.php
r2789917 r2833215 22 22 return plugin_dir_path(__FILE__); 23 23 } 24 25 public function add_logs($arr) 26 { 27 $arr[] ='yith-woocommerce-wishlist'; 28 return $arr; 29 } 24 30 } 25 31 -
appexperts/trunk/readme.txt
r2828704 r2833215 6 6 Requires at least: 4.5.0 7 7 Tested up to: 6.0 8 Stable tag: 1.3. 38 Stable tag: 1.3.4 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 105 105 == Changelog == 106 106 107 = 1.3.4 2022-12-13 = 108 * Added - Shimmer Loading 109 * Added - Custom App Loader 110 * Added - App Caching 111 * Added - Terms & Conditions 112 * Added - Option to delete account 113 * Added - Integration with PeepSo (Pro Feature) 114 * Added - Admob Integration (Pro Feature) 115 * Added - Google Analytics (Pro Feature) 116 107 117 = 1.3.3 2022-11-1 = 108 118 * Added - Integration with Peepso
Note: See TracChangeset
for help on using the changeset viewer.