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

Yoast / wordpress-seo / dd6e866a9e6d253114633104d9e3858d807178ba

19 Jun 2024 10:03AM UTC coverage: 48.628% (-4.3%) from 52.936%
dd6e866a9e6d253114633104d9e3858d807178ba

push

github

web-flow
Merge pull request #21431 from Yoast/21429-update-copy-in-the-introduction-and-consent-modals

Updates the copy for the introduction and consent modals

7441 of 13454 branches covered (55.31%)

Branch coverage included in aggregate %.

0 of 3 new or added lines in 2 files covered. (0.0%)

3718 existing lines in 107 files now uncovered.

25100 of 53464 relevant lines covered (46.95%)

62392.47 hits per line

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

0.0
/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
                if ( $url === null ) {
×
34
                        $url = self::DEFAULT_URL;
×
35
                }
36

37
                $this->url = $url;
×
38
        }
39

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

UNCOV
53
                $path = sprintf( 'js/dist/%s%s.js', $asset->get_src(), $asset->get_suffix() );
×
54

UNCOV
55
                return trailingslashit( $this->url ) . $path;
×
56
        }
57

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

69
                return $default_location->get_url( $asset, $type );
×
70
        }
71
}
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

© 2025 Coveralls, Inc