PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 1.9.8
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v1.9.8
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / classes / CDN / PushCDNInterface.php

PushCDNInterface.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF 1.9.8, at classes/CDN/PushCDNInterface.php

97 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Imagify\CDN;
3
4 defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
5
6 /**
7 * Interface to use for Push CDNs.
8 *
9 * @since 1.9
10 * @author Grégory Viguier
11 */
12 interface PushCDNInterface {
13
14 /**
15 * Tell if the CDN is ready (not necessarily reachable).
16 *
17 * @since 1.9
18 * @access public
19 * @author Grégory Viguier
20 *
21 * @return bool
22 */
23 public function is_ready();
24
25 /**
26 * Tell if the media is on the CDN.
27 *
28 * @since 1.9
29 * @access public
30 * @author Grégory Viguier
31 *
32 * @return bool
33 */
34 public function media_is_on_cdn();
35
36 /**
37 * Get files from the CDN.
38 *
39 * @since 1.9
40 * @access public
41 * @author Grégory Viguier
42 *
43 * @param array $file_paths A list of file paths.
44 * @return bool|\WP_Error True on success. A \WP_error object on failure.
45 */
46 public function get_files_from_cdn( $file_paths );
47
48 /**
49 * Remove files from the CDN.
50 * Don't use this to empty a folder.
51 *
52 * @since 1.9
53 * @access public
54 * @author Grégory Viguier
55 *
56 * @param array $file_paths A list of file paths. Those paths are not necessary absolute, and can be also file names.
57 * @return bool|\WP_Error True on success. A \WP_error object on failure.
58 */
59 public function remove_files_from_cdn( $file_paths );
60
61 /**
62 * Send all files from a media to the CDN.
63 *
64 * @since 1.9
65 * @access public
66 * @author Grégory Viguier
67 *
68 * @param bool $is_new_upload Tell if the current media is a new upload. If not, it means it's a media being regenerated, restored, etc.
69 * @return bool|\WP_Error True/False if sent or not. A \WP_error object on failure.
70 */
71 public function send_to_cdn( $is_new_upload );
72
73 /**
74 * Get a file URL.
75 *
76 * @since 1.9
77 * @access public
78 * @author Grégory Viguier
79 *
80 * @param string $file_name Name of the file. Leave empty for the full size file.
81 * @return string URL to the file.
82 */
83 public function get_file_url( $file_name = false );
84
85 /**
86 * Get a file path.
87 *
88 * @since 1.9
89 * @access public
90 * @author Grégory Viguier
91 *
92 * @param string $file_name Name of the file. Leave empty for the full size file. Use 'original' to get the path to the original file.
93 * @return string Path to the file.
94 */
95 public function get_file_path( $file_name = false );
96 }
97