type-amp.php
1 year ago
type-content.php
10 months ago
type-dummy.php
1 year ago
type-gam.php
1 year ago
type-group.php
1 year ago
type-image.php
1 year ago
type-plain.php
1 year ago
type-unknown.php
1 year ago
type-amp.php
94 lines
| 1 | <?php |
| 2 | /** |
| 3 | * This class represents the "AMP" ad type. |
| 4 | * |
| 5 | * @package AdvancedAds |
| 6 | * @author Advanced Ads <info@wpadvancedads.com> |
| 7 | * @since 1.48.2 |
| 8 | */ |
| 9 | |
| 10 | namespace AdvancedAds\Ads\Types; |
| 11 | |
| 12 | use AdvancedAds\Ads\Ad_Dummy; |
| 13 | use AdvancedAds\Interfaces\Ad_Type; |
| 14 | |
| 15 | defined( 'ABSPATH' ) || exit; |
| 16 | |
| 17 | /** |
| 18 | * Type AMP. |
| 19 | */ |
| 20 | class AMP implements Ad_Type { |
| 21 | |
| 22 | /** |
| 23 | * Get the unique identifier (ID) of the ad type. |
| 24 | * |
| 25 | * @return string The unique ID of the ad type. |
| 26 | */ |
| 27 | public function get_id(): string { |
| 28 | return 'amp'; |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * Get the class name of the object as a string. |
| 33 | * |
| 34 | * @return string |
| 35 | */ |
| 36 | public function get_classname(): string { |
| 37 | return Ad_Dummy::class; |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Get the title or name of the ad type. |
| 42 | * |
| 43 | * @return string The title of the ad type. |
| 44 | */ |
| 45 | public function get_title(): string { |
| 46 | return __( 'AMP', 'advanced-ads' ); |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Get a description of the ad type. |
| 51 | * |
| 52 | * @return string The description of the ad type. |
| 53 | */ |
| 54 | public function get_description(): string { |
| 55 | return __( 'Ads that are visible on Accelerated Mobile Pages.', 'advanced-ads' ); |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Check if this ad type requires premium. |
| 60 | * |
| 61 | * @return bool True if premium is required; otherwise, false. |
| 62 | */ |
| 63 | public function is_premium(): bool { |
| 64 | return true; |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Get the URL for upgrading to this ad type. |
| 69 | * |
| 70 | * @return string The upgrade URL for the ad type. |
| 71 | */ |
| 72 | public function get_upgrade_url(): string { |
| 73 | return 'https://wpadvancedads.com/add-ons/responsive-ads/'; |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Get the URL for upgrading to this ad type. |
| 78 | * |
| 79 | * @return string The upgrade URL for the ad type. |
| 80 | */ |
| 81 | public function get_image(): string { |
| 82 | return ADVADS_BASE_URL . 'assets/img/ad-types/amp.svg'; |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Check if this ad type has size parameters. |
| 87 | * |
| 88 | * @return bool True if has size parameters; otherwise, false. |
| 89 | */ |
| 90 | public function has_size(): bool { |
| 91 | return true; |
| 92 | } |
| 93 | } |
| 94 |