Skip to content

Commit b2bc8da

Browse files
committed
Release 1.3.7
feat(ultimo): Added ultimo-api-fix.php
1 parent 308f6ea commit b2bc8da

File tree

5 files changed

+47
-1
lines changed

5 files changed

+47
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Changelog
2+
## Release 1.3.7
3+
* feat(ultimo): Added ultimo-api-fix.php
4+
5+
26
## Release 1.3.6
37
* improvement: Added better detection to disable-wp-rocket-lscache.php
48
* fix: Errors with disable-lscache-notice.php

README-snippets.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@
101101
| ----- | ---- | ------ | ----------- |
102102
| [post-title-permalink.php](./theme/post-title-permalink.php) | Snippet | :white_check_mark: | This code will add a link to the title of the post, so that the title is clickable. |
103103

104+
## [ultimo](ultimo)
105+
106+
| Title | Type | Status | Description |
107+
| ----- | ---- | ------ | ----------- |
108+
| [WP Ultimo API Fix](./ultimo/ultimo-api-fix.php) | * Type: snippet | :white_check_mark: | Fixes the WP Ultimo API calls that fail and timeout after 10 seconds. |
109+
104110
## [woocommerce](woocommerce)
105111

106112
| Title | Type | Status | Description |

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ The status field is used to indicate the current status of the snippet. This is
115115
| ----- | ---- | ------ | ----------- |
116116
| [post-title-permalink.php](./theme/post-title-permalink.php) | Snippet | :white_check_mark: | This code will add a link to the title of the post, so that the title is clickable. |
117117

118+
## [ultimo](ultimo)
119+
120+
| Title | Type | Status | Description |
121+
| ----- | ---- | ------ | ----------- |
122+
| [WP Ultimo API Fix](./ultimo/ultimo-api-fix.php) | * Type: snippet | :white_check_mark: | Fixes the WP Ultimo API calls that fail and timeout after 10 seconds. |
123+
118124
## [woocommerce](woocommerce)
119125

120126
| Title | Type | Status | Description |
@@ -130,6 +136,10 @@ The status field is used to indicate the current status of the snippet. This is
130136
| [Failover Status Monitor](./wp-failover/wp-failover.php) | Plugin | :white_check_mark: | Monitors failover status and provides notifications. |
131137

132138
# Changelog
139+
## Release 1.3.7
140+
* feat(ultimo): Added ultimo-api-fix.php
141+
142+
133143
## Release 1.3.6
134144
* improvement: Added better detection to disable-wp-rocket-lscache.php
135145
* fix: Errors with disable-lscache-notice.php

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.6
1+
1.3.7

ultimo/ultimo-api-fix.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
/**
3+
* Plugin Name: WP Ultimo API Fix
4+
* Description: Fixes the WP Ultimo API calls that fail and timeout after 10 seconds.
5+
* Version: 0.1.0
6+
* Author: Jordan
7+
* Author URI: https://managingwp.io/live-blog/wp-ultimo-version-1-increase-page-loads-and-curl-timeouts-for-versions-nextpress-co/
8+
* Type: snippet
9+
* Status: Complete
10+
**/
11+
add_filter('pre_http_request', function($pre, $r, $url) {
12+
if (strpos($url, 'https://versions.nextpress.co/updates/') !== 0) {
13+
//error_log("Good API: $url");
14+
return $pre;
15+
} else {
16+
// Target only WP Ultimo update/license server calls
17+
error_log("Bad API: $url");
18+
return [
19+
'headers' => [],
20+
'body' => '',
21+
'response' => ['code' => 201, 'message' => 'OK'],
22+
'cookies' => [],
23+
'filename' => null,
24+
];
25+
}
26+
}, 10, 3);

0 commit comments

Comments
 (0)