Skip to content

Commit 9515ee4

Browse files
authored
Merge pull request #897 from cloudinary/uat
Version 3.1.4
2 parents 0b126d7 + 53fe2e9 commit 9515ee4

29 files changed

+191
-134
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.3
1+
3.1.4

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
},
99
"require-dev": {
1010
"wp-coding-standards/wpcs": "^2.3",
11-
"automattic/vipwpcs": "^2.2",
11+
"automattic/vipwpcs": "dev-develop",
1212
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
13-
"phpcompatibility/phpcompatibility-wp": "^2.1",
13+
"phpcompatibility/phpcompatibility-wp": "dev-master",
1414
"phpcompatibility/php-compatibility": "dev-develop as 9.99.99"
1515
},
1616
"config": {

composer.lock

Lines changed: 69 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

languages/cloudinary.pot

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ msgid ""
44
msgstr ""
55
"Project-Id-Version: Cloudinary STABLETAG\n"
66
"Report-Msgid-Bugs-To: https://github.com/cloudinary/cloudinary_wordpress\n"
7-
"POT-Creation-Date: 2023-06-15 08:49:55+00:00\n"
7+
"POT-Creation-Date: 2023-08-22 09:32:35+00:00\n"
88
"MIME-Version: 1.0\n"
99
"Content-Type: text/plain; charset=utf-8\n"
1010
"Content-Transfer-Encoding: 8bit\n"
@@ -63,11 +63,11 @@ msgstr[1] ""
6363
msgid "No items found."
6464
msgstr ""
6565

66-
#: php/cache/class-cache-point.php:958 php/class-assets.php:1142
66+
#: php/cache/class-cache-point.php:962 php/class-assets.php:1142
6767
msgid "Cloudinary Asset"
6868
msgstr ""
6969

70-
#: php/cache/class-cache-point.php:959 php/class-assets.php:1143
70+
#: php/cache/class-cache-point.php:963 php/class-assets.php:1143
7171
msgid "Post type to represent a non-media library asset."
7272
msgstr ""
7373

@@ -502,66 +502,66 @@ msgstr ""
502502
msgid "Unsynced"
503503
msgstr ""
504504

505-
#: php/class-media.php:453
505+
#: php/class-media.php:455
506506
#. translators: variable is file size.
507507
msgid ""
508508
"File size exceeds the maximum of %s. This media asset will be served from "
509509
"WordPress."
510510
msgstr ""
511511

512-
#: php/class-media.php:2033
512+
#: php/class-media.php:2035
513513
msgid "Import"
514514
msgstr ""
515515

516516
#. Plugin Name of the plugin/theme
517517
msgid "Cloudinary"
518518
msgstr ""
519519

520-
#: php/class-media.php:2389
520+
#: php/class-media.php:2391
521521
msgid "The delivery for this asset is disabled."
522522
msgstr ""
523523

524-
#: php/class-media.php:2393
524+
#: php/class-media.php:2395
525525
msgid "Not syncable. This is an external media."
526526
msgstr ""
527527

528-
#: php/class-media.php:2397
528+
#: php/class-media.php:2399
529529
msgid "This media is Fetch type."
530530
msgstr ""
531531

532-
#: php/class-media.php:2401
532+
#: php/class-media.php:2403
533533
msgid "This media is Sprite type."
534534
msgstr ""
535535

536-
#: php/class-media.php:2411
536+
#: php/class-media.php:2413
537537
msgid "Not Synced"
538538
msgstr ""
539539

540-
#: php/class-media.php:2416
540+
#: php/class-media.php:2418
541541
msgid "Synced"
542542
msgstr ""
543543

544-
#: php/class-media.php:3057
544+
#: php/class-media.php:3061
545545
msgid "No Cloudinary filters"
546546
msgstr ""
547547

548-
#: php/class-media.php:3157
548+
#: php/class-media.php:3161
549549
msgid "Media Settings"
550550
msgstr ""
551551

552-
#: php/class-media.php:3160
552+
#: php/class-media.php:3164
553553
msgid "Media Display"
554554
msgstr ""
555555

556-
#: php/class-media.php:3164 php/media/class-global-transformations.php:620
556+
#: php/class-media.php:3168 php/media/class-global-transformations.php:620
557557
#: php/ui/component/class-asset-preview.php:73
558558
#: php/ui/component/class-plan-details.php:119
559559
#: php/ui/component/class-plan-status.php:128
560560
#: ui-definitions/settings-sidebar.php:36
561561
msgid "Transformations"
562562
msgstr ""
563563

564-
#: php/class-media.php:3165
564+
#: php/class-media.php:3169
565565
msgid ""
566566
"Cloudinary allows you to easily transform your images on-the-fly to any "
567567
"required format, style and dimension, and also optimizes images for minimal "
@@ -570,12 +570,12 @@ msgid ""
570570
"transformation and delivery URLs."
571571
msgstr ""
572572

573-
#: php/class-media.php:3170 ui-definitions/settings-image.php:164
573+
#: php/class-media.php:3174 ui-definitions/settings-image.php:164
574574
#: ui-definitions/settings-video.php:216
575575
msgid "See examples"
576576
msgstr ""
577577

578-
#: php/class-plugin.php:755
578+
#: php/class-plugin.php:762
579579
msgid "Visit plugin site"
580580
msgstr ""
581581

@@ -1100,26 +1100,26 @@ msgstr ""
11001100
msgid "No posts"
11011101
msgstr ""
11021102

1103-
#: php/sync/class-sync-queue.php:560
1103+
#: php/sync/class-sync-queue.php:561
11041104
#. translators: variable is queue type.
11051105
msgid "Stopping queue: %s."
11061106
msgstr ""
11071107

1108-
#: php/sync/class-sync-queue.php:599
1108+
#: php/sync/class-sync-queue.php:600
11091109
#. translators: variable is queue type.
11101110
msgid "Queue: %s - not running."
11111111
msgstr ""
11121112

1113-
#: php/sync/class-sync-queue.php:651
1113+
#: php/sync/class-sync-queue.php:652
11141114
#. translators: variable is thread name.
11151115
msgid "Starting thread %s."
11161116
msgstr ""
11171117

1118-
#: php/sync/class-sync-queue.php:905
1118+
#: php/sync/class-sync-queue.php:906
11191119
msgid "Resuming Maybe"
11201120
msgstr ""
11211121

1122-
#: php/sync/class-sync-queue.php:914
1122+
#: php/sync/class-sync-queue.php:915
11231123
#. translators: variable is thread name.
11241124
msgid "Thread %s Stopped."
11251125
msgstr ""

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

php/cache/class-cache-point.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -869,9 +869,13 @@ public function query_cached_items( $urls ) {
869869
foreach ( $indexes as $key ) {
870870
$url = $urls[ $key ];
871871

872-
if ( ! isset( $meta[ self::META_KEYS['cached_urls'] ][ $url ] )
873-
|| $url === $meta[ self::META_KEYS['cached_urls'] ][ $url ]
874-
&& $meta[ self::META_KEYS['last_updated'] ] < time() - MINUTE_IN_SECONDS * 10 ) {
872+
if (
873+
! isset( $meta[ self::META_KEYS['cached_urls'] ][ $url ] )
874+
|| (
875+
$url === $meta[ self::META_KEYS['cached_urls'] ][ $url ]
876+
&& $meta[ self::META_KEYS['last_updated'] ] < time() - MINUTE_IN_SECONDS * 10
877+
)
878+
) {
875879
// Send to upload prep.
876880
$this->prepare_for_sync( $post->ID );
877881
$meta[ self::META_KEYS['cached_urls'] ][ $url ] = $url;
@@ -972,6 +976,6 @@ protected function register_post_type() {
972976
'rewrite' => false,
973977
'capability_type' => 'page',
974978
);
975-
$this->post_type = register_post_type( self::POST_TYPE_SLUG, $args );
979+
$this->post_type = register_post_type( self::POST_TYPE_SLUG, $args ); // phpcs:ignore WordPress.NamingConventions.ValidPostTypeSlug.NotStringLiteral
976980
}
977981
}

php/class-assets.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ protected function register_post_type() {
11561156
'rewrite' => false,
11571157
'capability_type' => 'page',
11581158
);
1159-
$this->post_type = register_post_type( self::POST_TYPE_SLUG, $args );
1159+
$this->post_type = register_post_type( self::POST_TYPE_SLUG, $args ); // phpcs:ignore WordPress.NamingConventions.ValidPostTypeSlug.NotStringLiteral
11601160
}
11611161

11621162
/**

php/class-media.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ public function maybe_file_exist_in_url( $url ) {
356356
if ( ! filter_var( $url, FILTER_VALIDATE_URL ) ) {
357357
return false;
358358
}
359+
// phpcs:disable WordPress.WP.AlternativeFunctions
359360
$ch = curl_init( $url );
360361
curl_setopt( $ch, CURLOPT_NOBODY, true );
361362
curl_exec( $ch );
@@ -368,6 +369,7 @@ public function maybe_file_exist_in_url( $url ) {
368369
}
369370

370371
curl_close( $ch );
372+
// phpcs:enable
371373

372374
return $status;
373375
}
@@ -990,8 +992,8 @@ public function get_transformations( $attachment_id, $transformations = array(),
990992
*/
991993
public function get_crop_transformations( $attachment_id, $size ) {
992994
static $transformations = array();
993-
$size_dim = $size['width'] . 'x' . $size['height'];
994-
$key = $attachment_id . $size_dim;
995+
$size_dim = $size['width'] . 'x' . $size['height'];
996+
$key = $attachment_id . $size_dim;
995997
if ( empty( $transformations[ $key ] ) ) {
996998

997999
if ( empty( $size['transformation'] ) ) {
@@ -3033,13 +3035,15 @@ public function apply_media_library_filters( $query ) {
30333035
if ( SYNC::META_KEYS['unsynced'] === $request ) {
30343036
global $wpdb;
30353037
$wpdb->cld_table = Utils::get_relationship_table();
3036-
$result = $wpdb->get_col( "SELECT post_id FROM $wpdb->cld_table WHERE public_id IS NULL" );
3038+
$result = $wpdb->get_col( "SELECT post_id FROM $wpdb->cld_table WHERE public_id IS NULL" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
30373039

3040+
// phpcs:disable WordPressVIPMinimum.Hooks.PreGetPosts.PreGetPosts
30383041
if ( ! empty( $result ) ) {
30393042
$query->set( 'post__in', $result );
30403043
} else {
30413044
$query->set( 'post__in', array( 0 ) );
30423045
}
3046+
// phpcs:enable
30433047
}
30443048
}
30453049
}

php/class-plugin.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ final class Plugin {
8282
*/
8383
public $dir_url;
8484

85+
/**
86+
* The plugin file.
87+
*
88+
* @var string
89+
*/
90+
public $plugin_file;
91+
8592
/**
8693
* Directory in plugin containing autoloaded classes.
8794
*
@@ -190,7 +197,7 @@ private function get_settings_page_structure() {
190197

191198
foreach ( $parts as $slug => $part ) {
192199
if ( file_exists( $this->dir_path . "ui-definitions/settings-{$slug}.php" ) ) {
193-
$parts[ $slug ] = include $this->dir_path . "ui-definitions/settings-{$slug}.php";
200+
$parts[ $slug ] = include $this->dir_path . "ui-definitions/settings-{$slug}.php"; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingVariable
194201
}
195202
}
196203

php/class-report.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ static function( &$row ) {
223223
"SELECT * FROM {$wpdb->cld_table} WHERE post_id = %d;",
224224
$post->ID
225225
);
226-
$relationship = $wpdb->get_row( $prepare ); // phpcs:ignore WordPress.DB.PreparedSQL
226+
$relationship = $wpdb->get_row( $prepare ); // phpcs:ignore WordPress.DB.PreparedSQL,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching
227227

228228
ksort( $attachment );
229229
ksort( $meta );

0 commit comments

Comments
 (0)