Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion includes/AMP/Output_Buffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,6 @@ private function render_error_page( Throwable $throwable ): string {
"\n" .
"\n" .
// translators: 1: error message. 2: location.
sprintf( esc_html__( 'Error message: %1$s (%2$s)', 'web-stories' ), $throwable->getMessage(), $throwable->getFile() . ':' . $throwable->getLine() );
\sprintf( esc_html__( 'Error message: %1$s (%2$s)', 'web-stories' ), $throwable->getMessage(), $throwable->getFile() . ':' . $throwable->getLine() );
}
}
2 changes: 1 addition & 1 deletion includes/AMP/Sanitization.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ protected function get_extension_sources(): array {
$specs = [];
// Register all AMP components as defined in the spec.
foreach ( AMP_Allowed_Tags_Generated::get_extension_specs() as $extension_name => $extension_spec ) {
$src = sprintf(
$src = \sprintf(
'https://cdn.ampproject.org/v0/%s-%s.js',
$extension_name,
$extension_spec['latest']
Expand Down
2 changes: 1 addition & 1 deletion includes/AMP/Traits/Sanitization_Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ private function deduplicate_inline_styles( $document ): void {
foreach ( $elements_by_inline_style as $inline_style => $styled_elements ) {
$inline_style_class_name = '_' . substr( md5( (string) $inline_style ), 0, 7 );

$style_rule = $document->createTextNode( sprintf( '.%s{%s}', $inline_style_class_name, $inline_style ) );
$style_rule = $document->createTextNode( \sprintf( '.%s{%s}', $inline_style_class_name, $inline_style ) );
$style_element->appendChild( $style_rule );

/**
Expand Down
4 changes: 2 additions & 2 deletions includes/Admin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function prefill_post_content( $content, ?WP_Post $post ) {
if ( ! use_block_editor_for_post( $post ) ) {
$content = '[web_stories_embed url="%1$s" title="%2$s" poster="%3$s" width="%4$s" height="%5$s" align="%6$s"]';

return sprintf(
return \sprintf(
$content,
esc_url( $story->get_url() ),
esc_attr( $story->get_title() ),
Expand All @@ -197,7 +197,7 @@ public function prefill_post_content( $content, ?WP_Post $post ) {

$content = '<!-- wp:web-stories/embed {"blockType":"url","url":"%1$s","title":"%2$s","poster":"%3$s","width":"%4$s","height":"%5$s","align":"%6$s","stories": [%7$s]} -->%8$s<!-- /wp:web-stories/embed -->';
// note $story->get_url should not be escaped here (esc_url()) see https://github.com/GoogleForCreators/web-stories-wp/issues/11371.
return sprintf(
return \sprintf(
$content,
$story->get_url(),
esc_js( $story->get_title() ),
Expand Down
2 changes: 1 addition & 1 deletion includes/Admin/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ public function load_stories_dashboard(): void {

wp_add_inline_script(
'wp-api-fetch',
sprintf( 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );', wp_json_encode( $preload_data ) ),
\sprintf( 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );', wp_json_encode( $preload_data ) ),
'after'
);
}
Expand Down
4 changes: 2 additions & 2 deletions includes/Admin/Editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ public function get_editor_settings(): array {
$revision = absint( $revision );

$revision_message = ! empty( $revision ) ?
sprintf(
\sprintf(
/* translators: %s: Date and time of the revision. */
__( 'Story restored to revision from %s.', 'web-stories' ),
wp_post_revision_title( $revision, false )
Expand Down Expand Up @@ -458,7 +458,7 @@ public function get_editor_settings(): array {
'taxonomies' => '/web-stories/v1/taxonomies/',
'fonts' => trailingslashit( $this->font_post_type->get_rest_url() ),
'metaBoxes' => $this->meta_boxes->get_meta_box_url( (int) $story_id ),
'storyLocking' => rest_url( sprintf( '%s/%s/lock/', $this->story_post_type->get_rest_url(), $story_id ) ),
'storyLocking' => rest_url( \sprintf( '%s/%s/lock/', $this->story_post_type->get_rest_url(), $story_id ) ),
],
'metadata' => [
'publisher' => $publisher_name,
Expand Down
4 changes: 2 additions & 2 deletions includes/Admin/PluginActionLinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ public function action_links( $links ) {
if ( ! \is_array( $links ) ) {
return $links;
}
$slug = sprintf( 'edit.php?post_type=%s&page=stories-dashboard#/editor-settings', Story_Post_Type::POST_TYPE_SLUG );
$slug = \sprintf( 'edit.php?post_type=%s&page=stories-dashboard#/editor-settings', Story_Post_Type::POST_TYPE_SLUG );
$url = get_admin_url( null, $slug );
$links[] = sprintf(
$links[] = \sprintf(
'<a href="%s">%s</a>',
esc_url( $url ),
esc_html__( 'Settings', 'web-stories' )
Expand Down
2 changes: 1 addition & 1 deletion includes/Admin/TinyMCE.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function web_stories_mce_plugin( $plugins ) {
if ( ! \is_array( $plugins ) ) {
return $plugins;
}
$plugins['web_stories'] = $this->assets->get_base_url( sprintf( 'assets/js/%s.js', self::SCRIPT_HANDLE ) );
$plugins['web_stories'] = $this->assets->get_base_url( \sprintf( 'assets/js/%s.js', self::SCRIPT_HANDLE ) );

return $plugins;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/Discovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public function print_feed_link(): void {
/* translators: 1: Blog name, 2: Separator (raquo), 3: Post type name. */
$post_type_title = esc_html__( '%1$s %2$s %3$s Feed', 'web-stories' );

$title = sprintf( $post_type_title, get_bloginfo( 'name' ), $separator, $name );
$title = \sprintf( $post_type_title, get_bloginfo( 'name' ), $separator, $name );

printf(
'<link rel="alternate" type="%s" title="%s" href="%s">',
Expand Down
2 changes: 1 addition & 1 deletion includes/Embed_Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static function get_registration_action_priority(): int {
* @since 1.13.0
*/
public function add_amp_post_template_css(): void {
$path = $this->assets->get_base_path( sprintf( 'assets/css/%s%s.css', self::SCRIPT_HANDLE, is_rtl() ? '-rtl' : '' ) );
$path = $this->assets->get_base_path( \sprintf( 'assets/css/%s%s.css', self::SCRIPT_HANDLE, is_rtl() ? '-rtl' : '' ) );

if ( is_readable( $path ) ) {
$css = file_get_contents( $path ); // phpcs:ignore WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown
Expand Down
6 changes: 3 additions & 3 deletions includes/Exception/InvalidEventProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static function from_invalid_type( $properties ): self {
? \get_class( $properties )
: \gettype( $properties );

$message = sprintf(
$message = \sprintf(
'The properties argument for adding properties to an event needs to be an array, but is of type %s',
$type
);
Expand All @@ -73,7 +73,7 @@ public static function from_invalid_element_key_type( $property ): self {
? \get_class( $property )
: \gettype( $property );

$message = sprintf(
$message = \sprintf(
'Each property element key for adding properties to an event needs to of type string, but found an element key of type %s',
$type
);
Expand All @@ -92,7 +92,7 @@ public static function from_invalid_element_value_type( $property ): self {
? \get_class( $property )
: \gettype( $property );

$message = sprintf(
$message = \sprintf(
'Each property element value for adding properties to an event needs to be a scalar value, but found an element value of type %s',
$type
);
Expand Down
2 changes: 1 addition & 1 deletion includes/Experiments.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function display_experiment_field( array $args ): void {
<label for="<?php echo esc_attr( $args['id'] ); ?>">
<input
type="checkbox"
name="<?php echo esc_attr( sprintf( '%1$s[%2$s]', $this->settings::SETTING_NAME_EXPERIMENTS, $args['id'] ) ); ?>"
name="<?php echo esc_attr( \sprintf( '%1$s[%2$s]', $this->settings::SETTING_NAME_EXPERIMENTS, $args['id'] ) ); ?>"
id="<?php echo esc_attr( $args['id'] ); ?>"
value="1"
<?php echo esc_attr( $disabled ); ?>
Expand Down
2 changes: 1 addition & 1 deletion includes/Integrations/Core_Themes_Support.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function extend_theme_support(): void {
*/
public function embed_web_stories(): void {
$stylesheet = get_stylesheet();
if ( is_readable( sprintf( '%sassets/css/web-stories-theme-style-%s.css', WEBSTORIES_PLUGIN_DIR_PATH, $stylesheet ) ) ) {
if ( is_readable( \sprintf( '%sassets/css/web-stories-theme-style-%s.css', WEBSTORIES_PLUGIN_DIR_PATH, $stylesheet ) ) ) {
$this->assets->enqueue_style_asset( 'web-stories-theme-style-' . $stylesheet, [] );
}
?>
Expand Down
2 changes: 1 addition & 1 deletion includes/Integrations/Ezoic.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,6 @@ private function render_error_page( Throwable $throwable ): string {
"\n" .
"\n" .
// translators: 1: error message. 2: location.
sprintf( esc_html__( 'Error message: %1$s (%2$s)', 'web-stories' ), $throwable->getMessage(), $throwable->getFile() . ':' . $throwable->getLine() );
\sprintf( esc_html__( 'Error message: %1$s (%2$s)', 'web-stories' ), $throwable->getMessage(), $throwable->getFile() . ':' . $throwable->getLine() );
}
}
2 changes: 1 addition & 1 deletion includes/Integrations/Jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,6 @@ protected function format_milliseconds( int $milliseconds ): string {
$minutes = 0;
}

return sprintf( '%d:%02u', $minutes, $seconds );
return \sprintf( '%d:%02u', $minutes, $seconds );
}
}
2 changes: 1 addition & 1 deletion includes/Media/Video/Muting.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function update_callback_is_muted( $value, WP_Post $post ) {
return new \WP_Error(
'rest_cannot_update',
/* translators: %s: Custom field key.**/
sprintf( __( 'Sorry, you are not allowed to edit the %s custom field.', 'web-stories' ), $name ),
\sprintf( __( 'Sorry, you are not allowed to edit the %s custom field.', 'web-stories' ), $name ),
[
'key' => $name,
'status' => rest_authorization_required_code(),
Expand Down
2 changes: 1 addition & 1 deletion includes/REST_API/Link_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function parse_link( $request ) {
$query_string = wp_parse_url( $url, PHP_URL_QUERY );
$check_url = \is_string( $query_string ) ? str_replace( "?$query_string", '', $url ) : $url;
if ( preg_match( '~^https?://(www\.)?instagram\.com/([^/]+)/?$~', $check_url, $matches ) ) {
$data['title'] = sprintf(
$data['title'] = \sprintf(
/* translators: %s: Instagram username. */
__( 'Instagram - @%s', 'web-stories' ),
$matches[2]
Expand Down
2 changes: 1 addition & 1 deletion includes/REST_API/Publisher_Logos_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ protected function filter_publisher_logos( $publisher_logos ): array {
* @phpstan-return Links
*/
protected function prepare_links( $post ): array {
$base = sprintf( '%s/%s', $this->namespace, $this->rest_base );
$base = \sprintf( '%s/%s', $this->namespace, $this->rest_base );

// Entity meta.
return [
Expand Down
8 changes: 4 additions & 4 deletions includes/REST_API/Stories_Base_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ protected function prepare_item_for_database( $request ) {
) {
return new \WP_Error(
'rest_empty_content',
sprintf(
\sprintf(
/* translators: 1: content, 2: story_data */
__( '%1$s and %2$s should always be updated together.', 'web-stories' ),
'content',
Expand Down Expand Up @@ -302,15 +302,15 @@ protected function prepare_links( $post ): array {

if ( ! empty( $post->post_author ) && post_type_supports( $post->post_type, 'author' ) ) {
$links['author'] = [
'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, 'users', $post->post_author ) ),
'href' => rest_url( \sprintf( '%s/%s/%s', $this->namespace, 'users', $post->post_author ) ),
'embeddable' => true,
];
}

// If we have a featured media, add that.
$featured_media = get_post_thumbnail_id( $post->ID );
if ( $featured_media ) {
$image_url = rest_url( sprintf( '%s/%s/%s', $this->namespace, 'media', $featured_media ) );
$image_url = rest_url( \sprintf( '%s/%s/%s', $this->namespace, 'media', $featured_media ) );

$links['https://api.w.org/featuredmedia'] = [
'href' => $image_url,
Expand All @@ -319,7 +319,7 @@ protected function prepare_links( $post ): array {
}

if ( ! \in_array( $post->post_type, [ 'attachment', 'nav_menu_item', 'revision' ], true ) ) {
$attachments_url = rest_url( sprintf( '%s/%s', $this->namespace, 'media' ) );
$attachments_url = rest_url( \sprintf( '%s/%s', $this->namespace, 'media' ) );
$attachments_url = add_query_arg( 'parent', $post->ID, $attachments_url );

$links['https://api.w.org/attachment'] = [
Expand Down
8 changes: 4 additions & 4 deletions includes/REST_API/Stories_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function create_item( $request ) {
$request['content'] = $original_post->post_content;
$request['excerpt'] = $original_post->post_excerpt;

$title = sprintf(
$title = \sprintf(
/* translators: %s: story title. */
__( '%s (Copy)', 'web-stories' ),
$original_post->post_title
Expand Down Expand Up @@ -599,7 +599,7 @@ protected function prepare_links( $post ): array {
* @phpstan-return Links
*/
private function add_post_locking_link( array $links, WP_Post $post ): array {
$base = sprintf( '%s/%s', $this->namespace, $this->rest_base );
$base = \sprintf( '%s/%s', $this->namespace, $this->rest_base );
$lock_url = rest_url( trailingslashit( $base ) . $post->ID . '/lock' );

$links['https://api.w.org/lock'] = [
Expand All @@ -622,7 +622,7 @@ private function add_post_locking_link( array $links, WP_Post $post ): array {

if ( $time && $time > time() - $time_window ) {
$links['https://api.w.org/lockuser'] = [
'href' => rest_url( sprintf( '%s/%s', $this->namespace, 'users/' ) . $user ),
'href' => rest_url( \sprintf( '%s/%s', $this->namespace, 'users/' ) . $user ),
'embeddable' => true,
];
}
Expand Down Expand Up @@ -667,7 +667,7 @@ private function add_publisher_logo_link( array $links, WP_Post $post ): array {

if ( $publisher_logo_id ) {
$links['https://api.w.org/publisherlogo'] = [
'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, 'media', $publisher_logo_id ) ),
'href' => rest_url( \sprintf( '%s/%s/%s', $this->namespace, 'media', $publisher_logo_id ) ),
'embeddable' => true,
];
}
Expand Down
Loading
Loading