Skip to content
Merged

Uat #385

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
892a81e
restructure image data to use correct methods
DavidCramer Feb 3, 2021
8136eb2
WIP
DavidCramer Feb 10, 2021
398aca2
remove self hosted video player and use embeded for better handling.
DavidCramer Feb 11, 2021
b4de516
Merge pull request #358 from cloudinary/fix/pgw-unsynced
pereirinha Feb 11, 2021
7dba3b7
Do not try to sync non local media
Feb 12, 2021
7c900cf
Update PHPCS rules
Feb 12, 2021
f9f8acf
Bypass external media on CLI command
Feb 12, 2021
4247693
Bypass external media on push to Cloudinary and autosync
Feb 12, 2021
9a21add
Force cleanup on sync external images
Feb 12, 2021
d680913
merge develop
DavidCramer Feb 16, 2021
464c6d4
ensure the video is synced before replacing shortcode.
DavidCramer Feb 16, 2021
c80936e
restructure the iframe params
DavidCramer Feb 16, 2021
fe31611
address CR issues.
DavidCramer Feb 16, 2021
f8eb334
Fix typo
Feb 17, 2021
03a6bf3
Extend Cloudinary support to Text files
Feb 17, 2021
a692e72
Enforce strict comparations
Feb 17, 2021
b8bfeb2
Remove limitations of the supported attachments
Feb 17, 2021
d126a23
Introduce the get_resource_type() and centralize decisions
Feb 17, 2021
322a61e
Fix PDF crops for thumbnails
Feb 17, 2021
8812d01
Fix the PDFs resouce type
Feb 17, 2021
98c712c
Depend on internal post meta updates to set signatures. This will pre…
Feb 17, 2021
39bc0bc
Factor in attachments that are not images
Feb 17, 2021
a7244ce
Improve the queue status
Feb 17, 2021
04ee40e
add export and cleanup
DavidCramer Feb 17, 2021
ba4ed01
address issues
DavidCramer Feb 17, 2021
9f45658
alignment
DavidCramer Feb 17, 2021
0547a87
Merge pull request #360 from cloudinary/fix/video-scripts-present
pereirinha Feb 17, 2021
e66b678
capture the type
DavidCramer Feb 17, 2021
57cb9da
add verifier to dissalow breakpoints
DavidCramer Feb 17, 2021
efa9b4e
add filter to dissalow creating sizes for sprites etc.
DavidCramer Feb 17, 2021
3f05eef
handle sizes and url creation
DavidCramer Feb 17, 2021
4cae6f6
Simplify logic
Feb 17, 2021
72a0a45
Merge pull request #362 from cloudinary/add/bypass-external-media
pereirinha Feb 17, 2021
7124cf4
Add bottom option to Carousel location
Feb 18, 2021
4881409
Update storage of Gallery settings
Feb 18, 2021
ccbbe68
Update compiled assets
Feb 18, 2021
4f3bb68
Bypass shortcodes with empty args
Feb 19, 2021
4341e6d
remove meta when adding to the internal.
DavidCramer Feb 19, 2021
bef2aa9
Merge pull request #363 from cloudinary/add/documents-support
pereirinha Feb 19, 2021
5227b98
Merge pull request #367 from cloudinary/fix/shortcode-empty-args
pereirinha Feb 19, 2021
23bfd04
Merge pull request #366 from cloudinary/add/bottom-option
pereirinha Feb 19, 2021
1316320
Merge branch 'develop', remote-tracking branch 'origin' into add/deli…
Feb 19, 2021
b20e1d9
Merge pull request #365 from cloudinary/add/delivery-types
pereirinha Feb 19, 2021
71bf384
Simplify the check for external media
Feb 22, 2021
5129033
Introduce support for pre "render_block_data" filter
Feb 22, 2021
5d95eb7
Fix autoplay and controls on videos
Feb 22, 2021
8ea8979
Revert typecast
Feb 22, 2021
814dded
Fix video preview
Feb 23, 2021
26b386c
Fix scripts enqueue
Feb 23, 2021
0a8e760
Introduce the cloudinary_prepare_size filter
Feb 23, 2021
3ff74ac
Use flag instead of removing and adding filter
Feb 23, 2021
b5d9db9
Merge pull request #371 from cloudinary/add/prepare-size-filter
pereirinha Feb 23, 2021
cef4817
Merge pull request #369 from cloudinary/add/bypass-external-media
pereirinha Feb 23, 2021
10a987d
Merge pull request #370 from cloudinary/fix/video
pereirinha Feb 23, 2021
a77b4ba
Prevent global coalitions
Feb 24, 2021
9ac9652
Abstract getting the media delivery type
Feb 24, 2021
3d13d05
Introduce bypassing sync upload to especific delivery types
Feb 24, 2021
1c89610
Skip sync for bypassed upload delivery types
Feb 24, 2021
d9a633d
Fix typo
Feb 24, 2021
a400ec2
public_id meta key is needed for counting synced assets
Feb 24, 2021
17a3e1f
Ensure at late stage that we keep cloudinary keys
Feb 24, 2021
227f90a
public_id meta key is needed for counting synced assets
Feb 24, 2021
2c9835d
Include all attachments for count
Feb 24, 2021
47d0244
Leverage $count static
Feb 24, 2021
7217098
Whitelist syncable delivery types
Feb 24, 2021
a6e3ed5
Ensure that the visibility of controls is defined on settings
Feb 24, 2021
3174953
Merge pull request #374 from cloudinary/fix/video-controls
pereirinha Feb 25, 2021
6ce070c
Merge pull request #373 from cloudinary/fix/sprite
pereirinha Feb 25, 2021
efbbcbf
Merge pull request #372 from cloudinary/fix/scripts
pereirinha Feb 25, 2021
be10747
remove self hosted video player and use embeded for better handling.
DavidCramer Feb 11, 2021
3822e85
restructure image data to use correct methods
DavidCramer Feb 3, 2021
3ab3f82
ensure the video is synced before replacing shortcode.
DavidCramer Feb 16, 2021
0803878
restructure the iframe params
DavidCramer Feb 16, 2021
98a6da2
address CR issues.
DavidCramer Feb 16, 2021
91dbfd5
address issues
DavidCramer Feb 17, 2021
c750903
alignment
DavidCramer Feb 17, 2021
07bf01e
capture the type
DavidCramer Feb 17, 2021
e7b4418
add verifier to dissalow breakpoints
DavidCramer Feb 17, 2021
0b33432
add filter to dissalow creating sizes for sprites etc.
DavidCramer Feb 17, 2021
305a472
handle sizes and url creation
DavidCramer Feb 17, 2021
7dadefe
remove meta when adding to the internal.
DavidCramer Feb 19, 2021
7b9ffe4
Update README.md
asisayag2 Jan 27, 2021
f7cd0fa
Bump plugin version
Jan 29, 2021
75b24f1
Version 2.6.0
asisayag2 Feb 1, 2021
e11c32f
Do not try to sync non local media
Feb 12, 2021
fb486f2
Update PHPCS rules
Feb 12, 2021
be65e9e
Bypass external media on CLI command
Feb 12, 2021
72053de
Bypass external media on push to Cloudinary and autosync
Feb 12, 2021
9b24dab
Force cleanup on sync external images
Feb 12, 2021
c53fafa
Simplify logic
Feb 17, 2021
510edcf
Fix typo
Feb 17, 2021
f7a8c1f
Extend Cloudinary support to Text files
Feb 17, 2021
dec77b2
Enforce strict comparations
Feb 17, 2021
151baa9
Remove limitations of the supported attachments
Feb 17, 2021
3011bb2
Introduce the get_resource_type() and centralize decisions
Feb 17, 2021
59910d7
Fix PDF crops for thumbnails
Feb 17, 2021
47d931a
Fix the PDFs resouce type
Feb 17, 2021
3f0a5bf
Depend on internal post meta updates to set signatures. This will pre…
Feb 17, 2021
6d0e44a
Factor in attachments that are not images
Feb 17, 2021
c0686a2
Improve the queue status
Feb 17, 2021
5bad9c7
Bypass shortcodes with empty args
Feb 19, 2021
49c76df
Add bottom option to Carousel location
Feb 18, 2021
5af74f4
Update storage of Gallery settings
Feb 18, 2021
fcdffde
Update compiled assets
Feb 18, 2021
4a29cbf
Introduce the cloudinary_prepare_size filter
Feb 23, 2021
7d81c7e
Simplify the check for external media
Feb 22, 2021
620aa84
Introduce support for pre "render_block_data" filter
Feb 22, 2021
5e4d359
Fix autoplay and controls on videos
Feb 22, 2021
c6b45ac
Revert typecast
Feb 22, 2021
f83e348
Fix video preview
Feb 23, 2021
5dc7f98
Fix scripts enqueue
Feb 23, 2021
b6678a3
Use flag instead of removing and adding filter
Feb 23, 2021
ec9981b
Rename Support class to Report
Feb 25, 2021
499c832
Extend add to cloudinary report action to all post types
Feb 26, 2021
a51ae1d
Abstract get_report_items
Feb 26, 2021
752d7f6
Typecast IDs
Feb 26, 2021
c815644
Inform that item was already added to the report
Feb 26, 2021
7266d44
Fix unescaped slashes
Feb 26, 2021
1200705
Restructure the Report page
Feb 26, 2021
c262a24
Cleanup
Feb 26, 2021
f5634ee
Fix alignement
Feb 26, 2021
e653029
Cleanup
Feb 26, 2021
d406f84
Enhance the system report
Feb 26, 2021
e273c01
Merge branch 'develop' into add/logging
Feb 26, 2021
d4d95da
Merge branch 'develop' into add/logging-enhanced
Feb 26, 2021
2634be3
merge develop
DavidCramer Feb 26, 2021
80638e1
Merge branch 'add/logging' into add/logging-enhanced
pereirinha Feb 26, 2021
75903c3
Remove support class
Feb 26, 2021
7f2fca3
Add context function
Feb 26, 2021
d072660
Merge pull request #375 from cloudinary/add/logging-enhanced
pereirinha Feb 27, 2021
ce30add
Merge branch 'develop' into uat
Feb 27, 2021
85c6c7a
Bump plugin version
Feb 27, 2021
fe4eb80
Update wording
Mar 1, 2021
efdf6da
Update wording
Mar 1, 2021
218a251
Ensure that we have gallery settings before trying to use them
Mar 1, 2021
b34c8e2
Merge pull request #376 from cloudinary/update/wording
pereirinha Mar 1, 2021
0aaff8a
Merge pull request #377 from cloudinary/update/reporting
pereirinha Mar 1, 2021
609a11a
Bump plugin version
Mar 1, 2021
7def38f
Fix public_id on downsync
Mar 2, 2021
4306bf1
Sometimes, the public_id is already set on downsync
Mar 4, 2021
324e173
Fix missing variables
Mar 4, 2021
b6a99b4
Improve delete attachment files. Sometimes those are not images and a…
Mar 4, 2021
a01c88c
Refactor cleanup of metadata and public_id storage.
DavidCramer Mar 4, 2021
7f11103
Merge pull request #380 from cloudinary/fix/downsync-enhance
pereirinha Mar 4, 2021
530a9eb
Merge pull request #379 from cloudinary/fix/downsync
pereirinha Mar 4, 2021
4e7131e
Remove useless comment
Mar 4, 2021
11d6d38
Bump plugin version
Mar 4, 2021
c7637d2
Cleanup hardcoded transformation
Mar 9, 2021
061cae4
Add controls for look & feel — pad or crop
Mar 9, 2021
ef535df
Update compiled assets
Mar 9, 2021
1b3b303
Update wording
Mar 9, 2021
9c8c19a
Update compiled assets
Mar 9, 2021
39ea482
Merge pull request #382 from cloudinary/feature/pgw-look-feel
pereirinha Mar 9, 2021
2bfc7b3
Update compiled assets
Mar 9, 2021
a1a21db
Bump plugin version
Mar 9, 2021
08ac366
Fix saving block settings
Mar 10, 2021
3f3298d
Add Tippy tooltip to react component
Mar 10, 2021
9556f69
Wording updates
Mar 10, 2021
5af77c4
Update compiled assets
Mar 10, 2021
93c6e6c
Cleanup parsed configuration
Mar 10, 2021
11e80a5
Update compiled assets
Mar 10, 2021
64bb62b
Merge branch 'uat' into feature/pgw-look-feel
pereirinha Mar 10, 2021
2512260
Merge pull request #383 from cloudinary/feature/pgw-look-feel
pereirinha Mar 10, 2021
9de7b2e
Bump plugin version
Mar 10, 2021
a92c711
Prevent custom settings to be override by the defaults
Mar 11, 2021
ff510d5
Update compiled assets
Mar 11, 2021
f1c4e61
Fix typo
Mar 11, 2021
e159070
Update compiled assets
Mar 11, 2021
32cf731
Merge pull request #384 from cloudinary/fix/pgw-crop
pereirinha Mar 11, 2021
db1dc08
Bump plugin version
Mar 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cloudinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Cloudinary
* Plugin URI: https://cloudinary.com/documentation/wordpress_integration
* Description: With the Cloudinary plugin, you can upload and manage your media assets in the cloud, then deliver them to your users through a fast content delivery network, improving your website’s loading speed and overall user experience. Apply multiple transformations and take advantage of a full digital asset management solution without leaving WordPress.
* Version: 2.6.0
* Version: 2.7.0-RC-6
* Author: Cloudinary Ltd., XWP
* Author URI: https://cloudinary.com/
* License: GPLv2+
Expand Down
2 changes: 1 addition & 1 deletion js/cloudinary.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/gallery-block.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-components/build-style/style.css', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '2695e94cb7e3a139b92189c7f3552ac8');
<?php return array('dependencies' => array('react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-components/build-style/style.css', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '95635dcdce3468c638dab46e572af7a3');
2 changes: 1 addition & 1 deletion js/gallery-block.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/gallery.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-components', 'wp-components/build-style/style.css', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '8208197bd5ef998a03d54b699afa3696');
<?php return array('dependencies' => array('react', 'react-dom', 'wp-block-editor', 'wp-components', 'wp-components/build-style/style.css', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '29099104bb87442e73de687aa973be61');
2 changes: 1 addition & 1 deletion js/gallery.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions js/src/gallery-block/attributes.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,12 @@
"selectedImages": {
"type": "array",
"default": []
},
"transformation_crop": {
"type": "string",
"default": "pad"
},
"transformation_background": {
"type": "string"
}
}
64 changes: 64 additions & 0 deletions js/src/gallery-block/controls.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Dot from 'dot-object';
import { __ } from '@wordpress/i18n';
import cloneDeep from 'lodash/cloneDeep';
import Tippy from '@tippyjs/react';

import '@wordpress/components/build-style/style.css';

Expand Down Expand Up @@ -31,6 +32,8 @@ import {
ZOOM_TRIGGER,
ZOOM_TYPE,
ZOOM_VIEWER_POSITION,
RESIZE_CROP,
PAD_STYLES,
} from './options';

import Radio from './radio';
Expand All @@ -57,6 +60,15 @@ const Controls = ( { attributes, setAttributes, colors } ) => {
? JSON.stringify( nestedAttrs.customSettings )
: nestedAttrs.customSettings;

if ( ! attributes.transformation_crop ) {
attributes.transformation_crop = 'pad';
attributes.transformation_background = 'rgb:FFFFFF';
}

if ( 'fill' === attributes.transformation_crop ) {
delete attributes.transformation_background;
}

return (
<>
<PanelBody title={ __( 'Layout', 'cloudinary' ) }>
Expand Down Expand Up @@ -144,6 +156,58 @@ const Controls = ( { attributes, setAttributes, colors } ) => {
setAttributes( { aspectRatio: value } )
}
/>
<p>
<Tippy
content={
<span>
{ __(
'How to resize or crop images to fit the gallery. Pad adds padding around the image using the specified padding style. Fill crops the image from the center so it fills as much of the available space as possible.',
'cloudinary'
) }
</span>
}
theme={ 'cloudinary' }
arrow={ false }
placement={ 'bottom-start' }
>
<div className="cld-ui-title">
{ __( 'Resize/Crop Mode', 'cloudinary' ) }
<span className="dashicons dashicons-info cld-tooltip"></span>
</div>
</Tippy>
<ButtonGroup>
{ RESIZE_CROP.map( ( type ) => (
<Button
key={ type.value + '-look-and-feel' }
isDefault
isPressed={
type.value ===
attributes.transformation_crop
}
onClick={ () =>
setAttributes( {
transformation_crop: type.value,
transformation_background: null,
} )
}
>
{ type.label }
</Button>
) ) }
</ButtonGroup>
</p>
{ 'pad' === attributes.transformation_crop && (
<SelectControl
label={ __( 'Pad style', 'cloudinary' ) }
value={ attributes.transformation_background }
options={ PAD_STYLES }
onChange={ ( value ) => {
setAttributes( {
transformation_background: value,
} );
} }
/>
) }
<p>{ __( 'Navigation', 'cloudinary' ) }</p>
<p>
<ButtonGroup>
Expand Down
5 changes: 5 additions & 0 deletions js/src/gallery-block/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ const Edit = ( { setAttributes, attributes, className, isSelected } ) => {
const [ loading, setLoading ] = useState( false );

const preparedAttributes = useMemo( () => {
// Do not override block settings with defaults on existing ones.
if ( 0 !== attributes.selectedImages.length ) {
return attributes;
}

const defaultAttrs = {};

// eslint-disable-next-line no-unused-vars
Expand Down
31 changes: 31 additions & 0 deletions js/src/gallery-block/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export const CAROUSEL_LOCATION = [
{ label: __( 'Left', 'cloudinary' ), value: 'left' },
{ label: __( 'Right', 'cloudinary' ), value: 'right' },
{ label: __( 'Top', 'cloudinary' ), value: 'top' },
{ label: __( 'Bottom', 'cloudinary' ), value: 'bottom' },
];

export const CAROUSEL_STYLE = [
Expand Down Expand Up @@ -189,3 +190,33 @@ export const MEDIA_ICON_SHAPE = [
label: __( 'Square', 'cloudinary' ),
},
];

export const RESIZE_CROP = [
{
label: __( 'Pad', 'cloudinary' ),
value: 'pad',
},
{
label: __( 'Fill', 'cloudinary' ),
value: 'fill',
},
];

export const PAD_STYLES = [
{
label: __( 'White padding', 'cloudinary' ),
value: 'rgb:FFFFFF',
},
{
label: __( 'Border color padding', 'cloudinary' ),
value: 'auto',
},
{
label: __( 'Predominant color padding', 'cloudinary' ),
value: 'auto:predominant',
},
{
label: __( 'Gradient fade padding', 'cloudinary' ),
value: 'auto:predominant_gradient',
},
];
8 changes: 8 additions & 0 deletions js/src/gallery-block/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ export const setupAttributesForRendering = ( attributes ) => {
delete config.displayProps.columns;
}

if ( 'pad' !== config?.transformation_crop ) {
delete config.transformation_background;
}

if ( 'pad' !== config?.transformation?.crop ) {
delete config.transformation.background;
}

if ( config.customSettings ) {
try {
const customSettings = JSON.parse( config.customSettings );
Expand Down
Loading