PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.4.7
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.4.7
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/API.php +10 -19 3.7.33.4.7 View file →
@@ -162,9 +162,9 @@
162 162 * @return WP_Error
163 163 */
164 164 protected function permission_error( $message, $endpoint = '') {
165 165 if( empty( $message ) ) {
166 - $message = __( 'Your session has expired. Please log in again.', 'templately' );
166 + $message = __( 'Sorry, you need to login/re-login again.', 'templately' );
167 167 }
168 168
169 169 $_additional_data = [
170 170 'status' => rest_authorization_required_code(),
@@ -173,27 +173,18 @@
173 173 if( ! empty( $endpoint ) ) {
174 174 $_additional_data['endpoint'] = $endpoint;
175 175 }
176 176
177 - // Delete user logged meta data — pinned to the acting user, otherwise
178 - // Options::user_id() resolves a linked user to the global-login
179 - // administrator and clears the administrator's session instead.
180 - $options = $this->utils('options');
181 - $options->use_current_user( true );
177 + // Delete user logged meta data
178 + $this->utils('options')
179 + ->remove('user')
180 + ->remove('favourites')
181 + ->remove('reviews')
182 + ->remove('cloud_activity')
183 + ->remove('api_key');
182 184
183 - try {
184 - $options
185 - ->remove('user')
186 - ->remove('favourites')
187 - ->remove('reviews')
188 - ->remove('cloud_activity')
189 - ->remove('api_key');
190 -
191 - if( $options->who_am_i() === 'global' ) {
192 - $options->remove_global_login();
193 - }
194 - } finally {
195 - $options->use_current_user( false );
185 + if( $this->utils('options')->who_am_i() === 'global' ) {
186 + $this->utils('options')->remove_global_login();
196 187 }
197 188
198 189 return new WP_Error( 'invalid_api_key', $message, $_additional_data );
199 190 }