| @@ -14,12 +14,9 @@ | ||
| 14 | 14 | $this->get( 'profile/purchased-items', [ $this, 'get_my_purchased_items' ] ); |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | public function sync() { |
| 18 | - // Keep the `subscription` field set in step with `Login::login()` — the | |
| 19 | - // Subscription screen renders from whichever of the two answered last, so a | |
| 20 | - // field missing here silently degrades the card after a profile sync. | |
| 21 | - $query = 'status, message, user{ id, name, first_name, last_name, display_name, email, profile_photo, joined, is_verified, is_restricted_company_user, api_key, plan, plan_expire_at, my_cloud{ limit, usages, last_pushed }, favourites{ id, type }, show_notice, reviews{ type, type_id, rating }, subscription { id, name, sites, subscription_plan_id, ends_at, plan_type, cancel_at_period_end } }'; | |
| 18 | + $query = 'status, message, user{ id, name, first_name, last_name, display_name, email, profile_photo, joined, is_verified, api_key, plan, plan_expire_at, my_cloud{ limit, usages, last_pushed }, favourites{ id, type }, show_notice, reviews{ type, type_id, rating } }'; | |
| 22 | 19 | |
| 23 | 20 | $funcArgs = [ |
| 24 | 21 | 'api_key' => $this->api_key, |
| 25 | 22 | 'site_url' => home_url( '/' ), |
| @@ -67,20 +64,8 @@ | ||
| 67 | 64 | unset( $response['user']['reviews'] ); |
| 68 | 65 | $meta['reviews'] = $_reviews; |
| 69 | 66 | } |
| 70 | 67 | |
| 71 | - if ( ! empty( $response['user'] ) && is_array( $response['user'] ) ) { | |
| 72 | - /** | |
| 73 | - * The cloud API key must never be persisted here or sent to the client. | |
| 74 | - * Under a global login this key belongs to the admin, while any user with | |
| 75 | - * `delete_posts` can reach this endpoint. Login and SignUp already drop it. | |
| 76 | - */ | |
| 77 | - unset( $response['user']['api_key'] ); | |
| 78 | - | |
| 79 | - $response['user']['site_url'] = base64_encode( home_url( '/' ) ); | |
| 80 | - $response['user']['ip'] = Helper::get_ip(); | |
| 81 | - } | |
| 82 | - | |
| 83 | 68 | $this->utils( 'options' )->set( 'user', $response['user'] ); |
| 84 | 69 | $response['user']['meta'] = Login::get_instance()->user_meta( $meta ); |
| 85 | 70 | |
| 86 | 71 | return $this->success( $response ); |
| @@ -154,13 +139,11 @@ | ||
| 154 | 139 | public function get_my_purchased_items() { |
| 155 | 140 | $page = $this->get_param( 'page', 1, 'intval' ); |
| 156 | 141 | $per_page = $this->get_param( 'per_page', 10, 'intval' ); |
| 157 | 142 | $_all = $this->get_param( 'all', false ); |
| 158 | - $platform = $this->get_param( 'platform', 'elementor' ); | |
| 159 | 143 | |
| 160 | 144 | $funcArgs = [ |
| 161 | 145 | 'api_key' => $this->api_key, |
| 162 | - 'platform' => $platform, | |
| 163 | 146 | 'page' => $page, |
| 164 | 147 | 'per_page' => $per_page |
| 165 | 148 | ]; |
| 166 | 149 | |