@@ -51,15 +51,6 @@ class Media extends Settings_Component implements Setup {
5151 */
5252 private $ cloudinary_folder ;
5353
54- /**
55- * Holds the found Cloudinary ID's
56- *
57- * @since 0.1
58- *
59- * @var array
60- */
61- private $ cloudinary_ids = array ();
62-
6354 /**
6455 * Cloudinary credentials.
6556 *
@@ -98,7 +89,7 @@ class Media extends Settings_Component implements Setup {
9889 /**
9990 * Gallery instance.
10091 *
101- * @var \Cloudinary\Media\Gallery
92+ * @var \Cloudinary\Media\Gallery|null
10293 */
10394 public $ gallery ;
10495
@@ -112,7 +103,7 @@ class Media extends Settings_Component implements Setup {
112103 /**
113104 * Sync instance.
114105 *
115- * @var \Cloudinary\Sync
106+ * @var \Cloudinary\Sync|null
116107 */
117108 public $ sync ;
118109
@@ -1572,7 +1563,7 @@ public function prepare_size( $attachment_id, $size ) {
15721563 'full ' => true ,
15731564 );
15741565 }
1575- } elseif ( is_string ( $ size ) || ( is_array ( $ size ) && 3 === count ( $ size ) ) ) {
1566+ } elseif ( is_string ( $ size ) || 3 === count ( $ size ) ) {
15761567 $ intermediate = image_get_intermediate_size ( $ attachment_id , $ size );
15771568 // PDF's do not have intermediate URL.
15781569 if ( is_array ( $ intermediate ) && ! empty ( $ intermediate ['url ' ] ) ) {
@@ -1646,7 +1637,7 @@ public function get_cloudinary_folder( $add_trailing_slash = true ) {
16461637 * @param int $attachment_id The Attachment ID.
16471638 * @param bool $suffixed Flag to get suffixed version of ID.
16481639 *
1649- * @return string
1640+ * @return string|null
16501641 */
16511642 public function get_public_id ( $ attachment_id , $ suffixed = false ) {
16521643 // Check for a public_id.
@@ -1880,13 +1871,13 @@ public function convert_url( $url, $attachment_id, $transformations = array(), $
18801871 /**
18811872 * Get the responsive breakpoints for the image.
18821873 *
1883- * @param array $sources The original sources array.
1884- * @param array $size_array The size array.
1885- * @param string $image_src The original image source.
1886- * @param array $image_meta The image meta array.
1887- * @param int $attachment_id The attachment id.
1874+ * @param array|false $sources The original sources array.
1875+ * @param array $size_array The size array.
1876+ * @param string $image_src The original image source.
1877+ * @param array $image_meta The image meta array.
1878+ * @param int $attachment_id The attachment id.
18881879 *
1889- * @return array Altered or same sources array.
1880+ * @return array|false Altered or same sources array.
18901881 */
18911882 public function image_srcset ( $ sources , $ size_array , $ image_src , $ image_meta , $ attachment_id ) {
18921883
@@ -2107,7 +2098,7 @@ public function editor_assets() {
21072098 * @param array $asset The asset array data.
21082099 * @param string $public_id The cloudinary public id.
21092100 *
2110- * @return int|WP_Error
2101+ * @return int
21112102 */
21122103 private function create_attachment ( $ asset , $ public_id ) {
21132104
@@ -3262,7 +3253,7 @@ public function is_enabled( $enabled ) {
32623253 */
32633254 public function upgrade_settings ( $ previous_version , $ new_version ) {
32643255
3265- if ( 2.4 === $ previous_version ) {
3256+ if ( version_compare ( $ previous_version , ' 2.5 ' , ' < ' ) ) {
32663257 // Setup new data from old.
32673258 $ images = get_option ( 'cloudinary_global_transformations ' , array () );
32683259 $ video = get_option ( self ::GLOBAL_VIDEO_TRANSFORMATIONS , array () );
0 commit comments