• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / 6c9a496186af09ad5b9d1b8a59520a14b7920b96

15 Feb 2026 10:29PM UTC coverage: 52.986% (+0.01%) from 52.975%
6c9a496186af09ad5b9d1b8a59520a14b7920b96

push

github

web-flow
Merge pull request #22986 from Yoast/JRF/QA/use-more-specific-check

CS/QA: use slightly more specific checks in a few places

8482 of 15955 branches covered (53.16%)

Branch coverage included in aggregate %.

32462 of 61318 relevant lines covered (52.94%)

48791.32 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

36.36
/admin/class-admin-asset-dev-server-location.php
1
<?php
2
/**
3
 * WPSEO plugin file.
4
 *
5
 * @package WPSEO\Admin
6
 */
7

8
/**
9
 * Changes the asset paths to dev server paths.
10
 */
11
final class WPSEO_Admin_Asset_Dev_Server_Location implements WPSEO_Admin_Asset_Location {
12

13
        /**
14
         * Holds the dev server's default URL.
15
         *
16
         * @var string
17
         */
18
        public const DEFAULT_URL = 'http://localhost:8080';
19

20
        /**
21
         * Holds the url where the server is located.
22
         *
23
         * @var string
24
         */
25
        private $url;
26

27
        /**
28
         * Class constructor.
29
         *
30
         * @param string|null $url Where the dev server is located.
31
         */
32
        public function __construct( $url = null ) {
×
33
                $url ??= self::DEFAULT_URL;
×
34

35
                $this->url = $url;
×
36
        }
37

38
        /**
39
         * Determines the URL of the asset on the dev server.
40
         *
41
         * @param WPSEO_Admin_Asset $asset The asset to determine the URL for.
42
         * @param string            $type  The type of asset. Usually JS or CSS.
43
         *
44
         * @return string The URL of the asset.
45
         */
46
        public function get_url( WPSEO_Admin_Asset $asset, $type ) {
8✔
47
                if ( $type === WPSEO_Admin_Asset::TYPE_CSS ) {
8✔
48
                        return $this->get_default_url( $asset, $type );
×
49
                }
50

51
                $path = sprintf( 'js/dist/%s%s.js', $asset->get_src(), $asset->get_suffix() );
8✔
52

53
                return trailingslashit( $this->url ) . $path;
8✔
54
        }
55

56
        /**
57
         * Determines the URL of the asset not using the dev server.
58
         *
59
         * @param WPSEO_Admin_Asset $asset The asset to determine the URL for.
60
         * @param string            $type  The type of asset.
61
         *
62
         * @return string The URL of the asset file.
63
         */
64
        public function get_default_url( WPSEO_Admin_Asset $asset, $type ) {
×
65
                $default_location = new WPSEO_Admin_Asset_SEO_Location( WPSEO_FILE );
×
66

67
                return $default_location->get_url( $asset, $type );
×
68
        }
69
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc