Skip to content

Commit 6803bc9

Browse files
authored
Merge pull request #1815 from WordPress/add/code-coverage-ignore-abspath-short-circuit
Wrap ABSPATH existence short-circuit with code coverage ignore comments
2 parents c270c43 + 95884d6 commit 6803bc9

File tree

74 files changed

+177
-58
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+177
-58
lines changed

plugins/auto-sizes/auto-sizes.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
* @package auto-sizes
1616
*/
1717

18-
// Exit if accessed directly.
18+
// @codeCoverageIgnoreStart
1919
if ( ! defined( 'ABSPATH' ) ) {
20-
exit;
20+
exit; // Exit if accessed directly.
2121
}
22+
// @codeCoverageIgnoreEnd
2223

2324
// Define the constant.
2425
if ( defined( 'IMAGE_AUTO_SIZES_VERSION' ) ) {

plugins/auto-sizes/hooks.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
* @since 1.0.0
77
*/
88

9+
// @codeCoverageIgnoreStart
910
if ( ! defined( 'ABSPATH' ) ) {
1011
exit; // Exit if accessed directly.
1112
}
13+
// @codeCoverageIgnoreEnd
1214

1315
/**
1416
* Displays the HTML generator tag for the plugin.

plugins/dominant-color-images/hooks.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
* @since 1.0.0
88
*/
99

10+
// @codeCoverageIgnoreStart
1011
if ( ! defined( 'ABSPATH' ) ) {
1112
exit; // Exit if accessed directly.
1213
}
14+
// @codeCoverageIgnoreEnd
1315

1416
/**
1517
* Add the dominant color metadata to the attachment.

plugins/dominant-color-images/load.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
* @package dominant-color-images
1616
*/
1717

18-
// Exit if accessed directly.
18+
// @codeCoverageIgnoreStart
1919
if ( ! defined( 'ABSPATH' ) ) {
20-
exit;
20+
exit; // Exit if accessed directly.
2121
}
22+
// @codeCoverageIgnoreEnd
2223

2324
// Define required constants.
2425
if ( defined( 'DOMINANT_COLOR_IMAGES_VERSION' ) ) {

plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
* @since 0.2.0
77
*/
88

9-
// Exit if accessed directly.
9+
// @codeCoverageIgnoreStart
1010
if ( ! defined( 'ABSPATH' ) ) {
11-
exit;
11+
exit; // Exit if accessed directly.
1212
}
13+
// @codeCoverageIgnoreEnd
1314

1415
/**
1516
* Tag visitor that optimizes embeds.

plugins/embed-optimizer/hooks.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
* @package embed-optimizer
77
*/
88

9+
// @codeCoverageIgnoreStart
910
if ( ! defined( 'ABSPATH' ) ) {
1011
exit; // Exit if accessed directly.
1112
}
13+
// @codeCoverageIgnoreEnd
1214

1315
/**
1416
* Add hooks.

plugins/embed-optimizer/load.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
* @package embed-optimizer
1616
*/
1717

18-
// Exit if accessed directly.
18+
// @codeCoverageIgnoreStart
1919
if ( ! defined( 'ABSPATH' ) ) {
20-
exit;
20+
exit; // Exit if accessed directly.
2121
}
22+
// @codeCoverageIgnoreEnd
2223

2324
(
2425
/**

plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
* @since 0.1.0
77
*/
88

9-
// Exit if accessed directly.
9+
// @codeCoverageIgnoreStart
1010
if ( ! defined( 'ABSPATH' ) ) {
11-
exit;
11+
exit; // Exit if accessed directly.
1212
}
13+
// @codeCoverageIgnoreEnd
1314

1415
/**
1516
* Tag visitor that optimizes elements with background-image styles.

plugins/image-prioritizer/class-image-prioritizer-img-tag-visitor.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
* @since 0.1.0
77
*/
88

9-
// Exit if accessed directly.
9+
// @codeCoverageIgnoreStart
1010
if ( ! defined( 'ABSPATH' ) ) {
11-
exit;
11+
exit; // Exit if accessed directly.
1212
}
13+
// @codeCoverageIgnoreEnd
1314

1415
/**
1516
* Tag visitor that optimizes IMG tags.

plugins/image-prioritizer/class-image-prioritizer-tag-visitor.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
* @since 0.1.0
77
*/
88

9-
// Exit if accessed directly.
9+
// @codeCoverageIgnoreStart
1010
if ( ! defined( 'ABSPATH' ) ) {
11-
exit;
11+
exit; // Exit if accessed directly.
1212
}
13+
// @codeCoverageIgnoreEnd
1314

1415
/**
1516
* Tag visitor that optimizes image tags.

0 commit comments

Comments
 (0)