PluginProbe
Embed Privacy / 1.10.5
Embed Privacy v1.10.5
1.14.0 1.13.0 trunk 0.1 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.1.3 1.10.0 1.10.1 1.10.10 1.10.2 1.10.3 1.10.4 1.10.5 1.10.6 1.10.7 1.10.8 1.10.9 1.11.0 1.11.1 1.11.2 All 68 releases
embed-privacy / inc / thumbnail / provider / class-thumbnail-provider.php

class-thumbnail-provider.php in Embed Privacy 1.10.5, at inc/thumbnail/provider/class-thumbnail-provider.php

76 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace epiphyt\Embed_Privacy\thumbnail\provider;
3
4 use epiphyt\Embed_Privacy\thumbnail\Thumbnail;
5
6 /**
7 * An abstract implementation of a thumbnail provider.
8 *
9 * @author Epiphyt
10 * @license GPL2
11 * @package epiphyt\Embed_Privacy
12 */
13 abstract class Thumbnail_Provider implements Thumbnail_Provider_Interface {
14 /**
15 * @var string[] List of valid domains for the thumbnail provider
16 */
17 public static $domains = [];
18
19 /**
20 * @var string Thumbnail provider name
21 */
22 public static $name = '';
23
24 /**
25 * {@inheritDoc}
26 */
27 public static function get( $data, $url ) { } // phpcs:ignore SlevomatCodingStandard.Functions.DisallowEmptyFunction.EmptyFunction
28
29 /**
30 * {@inheritDoc}
31 */
32 public static function get_id( $url ) { } // phpcs:ignore SlevomatCodingStandard.Functions.DisallowEmptyFunction.EmptyFunction
33
34 /**
35 * {@inheritDoc}
36 */
37 public static function get_path( $filename ) {
38 return Thumbnail::get_directory()['base_dir'] . '/' . $filename;
39 }
40
41 /**
42 * {@inheritDoc}
43 */
44 public static function get_title() {
45 return '';
46 }
47
48 /**
49 * {@inheritDoc}
50 */
51 public static function get_url( $filename ) {
52 return Thumbnail::get_directory()['base_url'] . '/' . $filename;
53 }
54
55 /**
56 * {@inheritDoc}
57 */
58 public static function is_provider_embed( $url ) {
59 $is_provider_embed = false;
60
61 foreach ( static::$domains as $domain ) {
62 if ( \str_contains( $url, $domain ) ) {
63 $is_provider_embed = true;
64 break;
65 }
66 }
67
68 return $is_provider_embed;
69 }
70
71 /**
72 * {@inheritDoc}
73 */
74 public static function save( $id, $url, $thumbnail_url = '' ) { } // phpcs:ignore SlevomatCodingStandard.Functions.DisallowEmptyFunction.EmptyFunction
75 }
76