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-gam.php
93 lines
| 1 | <?php |
| 2 | /** |
| 3 | * This class represents the "GAM" ad type. |
| 4 | * |
| 5 | * @package AdvancedAds\GAM |
| 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 GAM. |
| 19 | */ |
| 20 | class GAM implements Ad_Type { |
| 21 | /** |
| 22 | * Get the unique identifier (ID) of the ad type. |
| 23 | * |
| 24 | * @return string The unique ID of the ad type. |
| 25 | */ |
| 26 | public function get_id(): string { |
| 27 | return 'gam'; |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Get the class name of the object as a string. |
| 32 | * |
| 33 | * @return string |
| 34 | */ |
| 35 | public function get_classname(): string { |
| 36 | return Ad_Dummy::class; |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Get the title or name of the ad type. |
| 41 | * |
| 42 | * @return string The title of the ad type. |
| 43 | */ |
| 44 | public function get_title(): string { |
| 45 | return __( 'Google Ad Manager', 'advanced-ads' ); |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Get a description of the ad type. |
| 50 | * |
| 51 | * @return string The description of the ad type. |
| 52 | */ |
| 53 | public function get_description(): string { |
| 54 | return __( 'Load ad units directly from your Google Ad Manager account.', 'advanced-ads' ); |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Check if this ad type requires premium. |
| 59 | * |
| 60 | * @return bool True if premium is required; otherwise, false. |
| 61 | */ |
| 62 | public function is_premium(): bool { |
| 63 | return true; |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * Get the URL for upgrading to this ad type. |
| 68 | * |
| 69 | * @return string The upgrade URL for the ad type. |
| 70 | */ |
| 71 | public function get_upgrade_url(): string { |
| 72 | return 'https://wpadvancedads.com/add-ons/google-ad-manager/'; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Get the URL for upgrading to this ad type. |
| 77 | * |
| 78 | * @return string The upgrade URL for the ad type. |
| 79 | */ |
| 80 | public function get_image(): string { |
| 81 | return ADVADS_BASE_URL . 'assets/img/ad-types/gam.svg'; |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Check if this ad type has size parameters. |
| 86 | * |
| 87 | * @return bool True if has size parameters; otherwise, false. |
| 88 | */ |
| 89 | public function has_size(): bool { |
| 90 | return true; |
| 91 | } |
| 92 | } |
| 93 |