PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 2.2.7
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v2.2.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/Utils/Http.php +16 -23 3.1.102.2.7 View file →
@@ -138,12 +138,11 @@
138 138 $query = $this->query;
139 139 }
140 140
141 141 $headers = [
142 - 'Content-Type' => 'application/json',
143 - 'x-templately-ip' => Helper::get_ip(),
144 - 'x-templately-url' => home_url( '/' ),
145 - 'x-templately-version' => TEMPLATELY_VERSION,
142 + 'Content-Type' => 'application/json',
143 + 'x-templately-ip' => Helper::get_ip(),
144 + 'x-templately-url' => home_url( '/' )
146 145 ];
147 146
148 147 if ( ! empty( $args['headers'] ) ) {
149 148 $headers = wp_parse_args( $args['headers'], $headers );
@@ -155,9 +154,9 @@
155 154 Helper::log( 'QUERY: ' . $query );
156 155 }
157 156
158 157 $_default_args = [
159 - 'timeout' => $this->dev_mode ? 40 : 30,
158 + 'timeout' => $this->dev_mode ? 40 : 15,
160 159 'headers' => $headers,
161 160 'body' => wp_json_encode( [
162 161 'query' => $query
163 162 ] )
@@ -162,18 +161,12 @@
162 161 'query' => $query
163 162 ] )
164 163 ];
165 164
166 - $retryCount = 0;
167 - $maxRetries = defined('TEMPLATELY_HTTP_RETRY') ? TEMPLATELY_HTTP_RETRY : 3;
168 - $args = wp_parse_args( $args, $_default_args );
169 - do {
170 - $response = wp_remote_post( $this->url(), $args );
171 - $retryCount++;
172 - } while ( is_wp_error( $response ) && $retryCount < $maxRetries );
165 + $args = wp_parse_args( $args, $_default_args );
166 + $response = wp_remote_post( $this->url(), $args );
173 167
174 168 if ( defined( 'TEMPLATELY_DEBUG_LOG' ) && TEMPLATELY_DEBUG_LOG ) {
175 - Helper::log( 'Retry Count: ' . $retryCount );
176 169 Helper::log( 'RAW RESPONSE: ' );
177 170 Helper::log( $response );
178 171 Helper::log( 'END RAW RESPONSE' );
179 172 }
@@ -230,19 +223,19 @@
230 223 }
231 224 }
232 225 } );
233 226
234 - if( $wp_error->get_error_code() === 'templately_graphql_error' ) {
235 - if( $wp_error->get_error_message() == 'Unauthorized' ) {
236 - $global_user = Login::get_instance()->delete();
227 + if( $wp_error->get_error_code() === 'templately_graphql_error' ) {
228 + if( $wp_error->get_error_message() == 'Unauthorized' ) {
229 + $global_user = Login::get_instance()->delete();
237 230
238 - return [
239 - 'redirect' => true,
240 - 'url' => 'sign-in',
241 - 'user' => $global_user,
242 - ];
243 - }
244 - }
231 + return [
232 + 'redirect' => true,
233 + 'url' => 'sign-in',
234 + 'user' => $global_user,
235 + ];
236 + }
237 + }
245 238
246 239 return $wp_error;
247 240 }
248 241 }