Skip to content

Commit 251aa6c

Browse files
authored
Merge pull request #637 from udx/latest
Updated requirments
2 parents 9aed262 + 8a58cc7 commit 251aa6c

File tree

9 files changed

+35
-30
lines changed

9 files changed

+35
-30
lines changed

changelog.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
== Changelog ==
2+
= 3.2.1 =
3+
* FIX - Updated requirments.
4+
* FIX - WP-Stateless 3.2.0 doesn’t upload docs, only images [#638](https://github.com/udx/wp-stateless/issues/638).
5+
16
== Changelog ==
27
= 3.2.0 =
38
* ENHANCEMENT - Upgraded `wpmetabox` library.

changes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#### 3.2.1
2+
3+
- FIX - Updated requirments.
4+
- FIX - WP-Stateless 3.2.0 doesn’t upload docs, only images [#638](https://github.com/udx/wp-stateless/issues/638).
5+
16
#### 3.2.0
27

38
- ENHANCEMENT - Upgraded `wpmetabox` library.

lib/classes/class-bootstrap.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,13 @@ private function _init_filters($type = '') {
315315

316316
/**
317317
* Delete original in the end of generating metadata
318+
* it does not work with PDF
318319
*/
319-
add_filter('wp_generate_attachment_metadata', function ($metadata, $attachment_id, $state) {
320-
if (!in_array(ud_get_stateless_media()->get('sm.mode'), array('ephemeral'))) return $metadata;
321-
@unlink(get_attached_file($attachment_id, true));
322-
return $metadata;
323-
}, 99, 3);
320+
// add_filter('wp_generate_attachment_metadata', function ($metadata, $attachment_id, $state) {
321+
// if (!in_array(ud_get_stateless_media()->get('sm.mode'), array('ephemeral'))) return $metadata;
322+
// @unlink(get_attached_file($attachment_id, true));
323+
// return $metadata;
324+
// }, 99, 3);
324325

325326
/**
326327
* Rewrite Image URLS

lib/classes/class-utility.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public static function add_media($metadata, $attachment_id, $force = false, $arg
210210

211211
$image_host = ud_get_stateless_media()->get_gs_host();
212212
$bucketLink = apply_filters('wp_stateless_bucket_link', $image_host);
213-
$fullsizepath = wp_normalize_path(wp_get_original_image_path($attachment_id));
213+
$fullsizepath = wp_normalize_path(get_attached_file($attachment_id));
214214
$_cacheControl = self::getCacheControl($attachment_id, $metadata, null);
215215
$_contentDisposition = self::getContentDisposition($attachment_id, $metadata, null);
216216

@@ -443,7 +443,7 @@ public static function get_path_and_url($metadata, $attachment_id) {
443443
}
444444

445445
$gs_name_path = array();
446-
$full_size_path = wp_get_original_image_path($attachment_id);
446+
$full_size_path = get_attached_file($attachment_id);
447447
$base_dir = dirname($full_size_path);
448448

449449
$gs_name = apply_filters('wp_stateless_file_name', $full_size_path, true, $attachment_id, '');
@@ -969,7 +969,7 @@ public static function process_image_by_id($id) {
969969
if (!$image || 'attachment' != $image->post_type || 'image/' != substr($image->post_mime_type, 0, 6))
970970
throw new UnprocessableException(sprintf(__('Failed to process item: %s is an invalid image ID.', ud_get_stateless_media()->domain), $id));
971971

972-
$fullsizepath = wp_get_original_image_path($image->ID);
972+
$fullsizepath = get_attached_file($image->ID);
973973

974974
// If no file found
975975
if (false === $fullsizepath || !file_exists($fullsizepath)) {
@@ -1026,7 +1026,7 @@ public static function process_file_by_id($id) {
10261026
throw new UnprocessableException(sprintf(__('Attachment not found: %s is an invalid file ID.', ud_get_stateless_media()->domain), $id));
10271027
}
10281028

1029-
$fullsizepath = wp_get_original_image_path($file->ID);
1029+
$fullsizepath = get_attached_file($file->ID);
10301030
$local_file_exists = file_exists($fullsizepath);
10311031

10321032
if (false === $fullsizepath || !$local_file_exists) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "wp-stateless",
33
"title": "WP-Stateless",
44
"description": "wpCloud Stateless Media for GCE",
5-
"version": "3.2.0",
5+
"version": "3.2.1",
66
"homepage": "https://udx.io",
77
"author": {
88
"name": "UDX",

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ For a more detailed installation and setup walkthrough, please see the [manual s
5353

5454
### What are the minimum server requirements for this plugin?
5555

56-
Beyond the [official WordPress minimum requirements](https://codex.wordpress.org/Template:Server_requirements), WP-Stateless requires a minimum PHP version of 5.6 or higher and OpenSSL to be enabled.
56+
Beyond the [official WordPress minimum requirements](https://codex.wordpress.org/Template:Server_requirements), WP-Stateless requires a minimum PHP version of 7.2 or higher and OpenSSL to be enabled.
5757

5858
### What wp-config constants are supported?
5959

readme.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ Contributors: usability_dynamics, andypotanin, ideric, maxim.peshkov, Anton Koro
33
Donate link: https://udx.io
44
Tags: google, google cloud, google cloud storage, cdn, uploads, media, stateless, backup
55
License: GPLv2 or later
6-
Requires PHP: 5.6
6+
Requires PHP: 7.2
77
Requires at least: 5.0
88
Tested up to: 5.9.3
9-
Stable tag: 3.2.0
9+
Stable tag: 3.2.1
1010

1111
Upload and serve your WordPress media files from Google Cloud Storage.
1212

@@ -72,7 +72,7 @@ For a more detailed installation and setup walkthrough, please see the [manual s
7272

7373
= What are the minimum server requirements for this plugin? =
7474

75-
Beyond the [official WordPress minimum requirements](https://codex.wordpress.org/Template:Server_requirements), WP-Stateless requires a minimum PHP version of 5.6 or higher and OpenSSL to be enabled.
75+
Beyond the [official WordPress minimum requirements](https://codex.wordpress.org/Template:Server_requirements), WP-Stateless requires a minimum PHP version of 7.2 or higher and OpenSSL to be enabled.
7676

7777
= What wp-config constants are supported? =
7878

@@ -103,11 +103,19 @@ To ensure new releases cause as little disruption as possible, we rely on a numb
103103

104104
== Upgrade Notice ==
105105

106+
= 3.2.0 =
107+
Before upgrading to WP-Stateless 3.2.0, please, make sure you use PHP 7.2 or above.
108+
106109
= 3.0 =
107110
Before upgrading to WP-Stateless 3.0, please, make sure you tested it on your development environment.
108111

109112
== Changelog ==
113+
= 3.2.1 =
114+
* FIX - Updated requirments.
115+
* FIX - WP-Stateless 3.2.0 doesn’t upload docs, only images [#638](https://github.com/udx/wp-stateless/issues/638).
116+
110117
= 3.2.0 =
118+
* **Before upgrading to WP-Stateless 3.2.0, please, make sure you tested it on your development environment. It may have breaking changes.**
111119
* ENHANCEMENT - Upgraded `wpmetabox` library.
112120
* ENHANCEMENT - Updated Client library for Google APIs.
113121
* ENHANCEMENT - Updated Guzzle library to version 7.

static/views/settings_interface.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<a href="#stless_sync_tab" class="stless_setting_tab nav-tab"><?php _e('Sync', ud_get_stateless_media()->domain); ?></a>
1111
<?php endif; ?>
1212
<a href="#stless_compatibility_tab" class="stless_setting_tab nav-tab"><?php _e('Compatibility', ud_get_stateless_media()->domain); ?></a>
13-
<a href="#stless_questions_tab" class="stless_setting_tab nav-tab"><?php _e('Support', ud_get_stateless_media()->domain); ?></a>
1413
</h2>
1514

1615
<div class="stless_settings">
@@ -243,7 +242,7 @@
243242
<div id="stless_compatibility_tab" class="stless_settings_content" ng-controller="wpStatelessCompatibility">
244243
<div class="container-fluid">
245244
<h2><?php _e("Enable or disable compatibility with other plugins."); ?></h2>
246-
<p><?php _e(sprintf("Having an issue with another plugin? <a class='stless_setting_tab' href='%s'>Submit feedback</a> and let us know your issue!", "#stless_questions_tab")); ?></p>
245+
<p><?php _e(sprintf("Having an issue with another plugin? <a class='' target='_blank' href='%s' >Submit feedback</a> and let us know your issue!", "https://wordpress.org/support/plugin/wp-stateless/")); ?></p>
247246
<form method="post" action="">
248247
<input type="hidden" name="action" value="stateless_modules">
249248
<?php wp_nonce_field('wp-stateless-modules', '_smnonce'); ?>
@@ -277,19 +276,6 @@
277276
</form>
278277
</div>
279278
</div>
280-
<div id="stless_questions_tab" class="stless_settings_content">
281-
<!--[if lte IE 8]>
282-
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
283-
<![endif]-->
284-
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
285-
<script>
286-
hbspt.forms.create({
287-
portalId: '3453418',
288-
formId: 'cad1f6e1-7825-4e6d-a3e7-278c91abce7e',
289-
submitButtonClass: 'button button-primary',
290-
});
291-
</script>
292-
</div>
293279
</div>
294280

295281
</div>

wp-stateless-media.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin URI: https://udx.io
55
* Description: Upload and serve your WordPress media files from Google Cloud Storage.
66
* Author: UDX
7-
* Version: 3.2.0
7+
* Version: 3.2.1
88
* Text Domain: stateless-media
99
* Author URI: https://www.udx.io
1010
*

0 commit comments

Comments
 (0)