PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.7.2
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.7.2
3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 All 111 releases
← All changes | includes/API/Profile.php +17 -3 3.0.63.7.2 View file →
@@ -64,8 +64,20 @@
64 64 unset( $response['user']['reviews'] );
65 65 $meta['reviews'] = $_reviews;
66 66 }
67 67
68 + if ( ! empty( $response['user'] ) && is_array( $response['user'] ) ) {
69 + /**
70 + * The cloud API key must never be persisted here or sent to the client.
71 + * Under a global login this key belongs to the admin, while any user with
72 + * `delete_posts` can reach this endpoint. Login and SignUp already drop it.
73 + */
74 + unset( $response['user']['api_key'] );
75 +
76 + $response['user']['site_url'] = base64_encode( home_url( '/' ) );
77 + $response['user']['ip'] = Helper::get_ip();
78 + }
79 +
68 80 $this->utils( 'options' )->set( 'user', $response['user'] );
69 81 $response['user']['meta'] = Login::get_instance()->user_meta( $meta );
70 82
71 83 return $this->success( $response );
@@ -77,9 +89,9 @@
77 89 ];
78 90
79 91 $response = $this->http()->query( 'isVerifiedUser', '', $funcArgs )->post();
80 92
81 - if ( $response ) {
93 + if ( $response && !is_wp_error( $response ) ) {
82 94 $user = $this->utils( 'options' )->get( 'user' );
83 95
84 96 $user['is_verified'] = true;
85 97 $this->utils( 'options' )->set( 'user', $user );
@@ -98,9 +110,9 @@
98 110 "page" => $page
99 111 ] )->post();
100 112
101 113 if ( is_wp_error( $response ) ) {
102 - return $this->error( 'invalid_download_history_response', __( $response->get_error_message(), 'templately' ), 'profile/download-history', $response->get_error_code() );
114 + return $this->error( 'invalid_download_history_response', __( $response->get_error_message(), 'templately' ), 'profile/download-history' );
103 115 }
104 116
105 117 if ( isset( $response['total'] ) ) {
106 118 $this->utils( 'options' )->set( 'total_download_counts', $response['total'] );
@@ -129,9 +141,9 @@
129 141
130 142 $response = $this->http()->mutation( 'myFavouriteItem', 'total_page, current_page, data { id, name, rating, type, slug, favourite_count, thumbnail, thumbnail2, thumbnail3, price, author{ display_name, name, joined }, dependencies{ id, name, icon, plugin_file, plugin_original_slug, is_pro, link } }', $funcArgs )->post();
131 143
132 144 if ( is_wp_error( $response ) ) {
133 - return $this->error( 'invalid_my_favourites_response', __( $response->get_error_message(), 'templately' ), 'profile/my-favourites', $response->get_error_code() );
145 + return $this->error( 'invalid_my_favourites_response', __( $response->get_error_message(), 'templately' ), 'profile/my-favourites' );
134 146 }
135 147
136 148 return $response;
137 149 }
@@ -139,11 +151,13 @@
139 151 public function get_my_purchased_items() {
140 152 $page = $this->get_param( 'page', 1, 'intval' );
141 153 $per_page = $this->get_param( 'per_page', 10, 'intval' );
142 154 $_all = $this->get_param( 'all', false );
155 + $platform = $this->get_param( 'platform', 'elementor' );
143 156
144 157 $funcArgs = [
145 158 'api_key' => $this->api_key,
159 + 'platform' => $platform,
146 160 'page' => $page,
147 161 'per_page' => $per_page
148 162 ];
149 163