| @@ -14,9 +14,9 @@ | ||
| 14 | 14 | * Holds the dev server's default URL. |
| 15 | 15 | * |
| 16 | 16 | * @var string |
| 17 | 17 | */ |
| 18 | - const DEFAULT_URL = 'http://localhost:8080'; | |
| 18 | + public const DEFAULT_URL = 'http://localhost:8080'; | |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * Holds the url where the server is located. |
| 22 | 22 | * |
| @@ -29,11 +29,9 @@ | ||
| 29 | 29 | * |
| 30 | 30 | * @param string|null $url Where the dev server is located. |
| 31 | 31 | */ |
| 32 | 32 | public function __construct( $url = null ) { |
| 33 | - if ( $url === null ) { | |
| 34 | - $url = self::DEFAULT_URL; | |
| 35 | - } | |
| 33 | + $url ??= self::DEFAULT_URL; | |
| 36 | 34 | |
| 37 | 35 | $this->url = $url; |
| 38 | 36 | } |
| 39 | 37 | |
| @@ -46,16 +44,8 @@ | ||
| 46 | 44 | * @return string The URL of the asset. |
| 47 | 45 | */ |
| 48 | 46 | public function get_url( WPSEO_Admin_Asset $asset, $type ) { |
| 49 | 47 | if ( $type === WPSEO_Admin_Asset::TYPE_CSS ) { |
| 50 | - return $this->get_default_url( $asset, $type ); | |
| 51 | - } | |
| 52 | - | |
| 53 | - $asset_manager = new WPSEO_Admin_Asset_Manager(); | |
| 54 | - $flat_version = $asset_manager->flatten_version( WPSEO_VERSION ); | |
| 55 | - $version_less_source = str_replace( '-' . $flat_version, '', $asset->get_src() ); | |
| 56 | - | |
| 57 | - if ( strpos( $version_less_source, 'select2' ) !== false ) { | |
| 58 | 48 | return $this->get_default_url( $asset, $type ); |
| 59 | 49 | } |
| 60 | 50 | |
| 61 | 51 | $path = sprintf( 'js/dist/%s%s.js', $asset->get_src(), $asset->get_suffix() ); |