From b6ca3c3d38e9ac4c6224ee347be2a62f2722f467 Mon Sep 17 00:00:00 2001 From: Anthony Correa Date: Wed, 29 Apr 2026 13:13:19 -0500 Subject: [PATCH] Remove square Open Graph image --- includes/open-graph-tags.php | 5 ----- package.json | 2 +- tests/test-open-graph-tags.php | 8 ++------ tonys-sportspress-enhancements.php | 4 ++-- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/includes/open-graph-tags.php b/includes/open-graph-tags.php index 4574c1b..9f455bd 100644 --- a/includes/open-graph-tags.php +++ b/includes/open-graph-tags.php @@ -49,11 +49,6 @@ function asc_sp_event_open_graph_images( WP_Post $post ) { 'width' => '1200', 'height' => '628', ), - array( - 'url' => asc_sp_event_matchup_image_url( $post, 'square' ), - 'width' => '1200', - 'height' => '1200', - ), ); } diff --git a/package.json b/package.json index 8dffeaf..7a1c1e4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tonys-sportspress-enhancements", - "version": "0.1.12", + "version": "0.1.13", "main": "Gruntfile.js", "author": "YOUR NAME HERE", "scripts" : { diff --git a/tests/test-open-graph-tags.php b/tests/test-open-graph-tags.php index 58dfbd7..29cf976 100644 --- a/tests/test-open-graph-tags.php +++ b/tests/test-open-graph-tags.php @@ -136,15 +136,12 @@ class Test_Open_Graph_Tags extends WP_UnitTestCase { $this->assertSame( 'article', $meta['type'] ); $this->assertStringContainsString( 'Hawks vs Electrons', $meta['title'] ); $this->assertStringContainsString( 'First pitch at one.', $meta['description'] ); - $this->assertCount( 2, $meta['images'] ); + $this->assertCount( 1, $meta['images'] ); $this->assertSame( '1200', $meta['images'][0]['width'] ); $this->assertSame( '628', $meta['images'][0]['height'] ); - $this->assertSame( '1200', $meta['images'][1]['width'] ); - $this->assertSame( '1200', $meta['images'][1]['height'] ); $this->assertSame( '1200', $meta['image_width'] ); $this->assertSame( '628', $meta['image_height'] ); $this->assertStringContainsString( '/head-to-head?post=' . $event, $meta['image'] ); - $this->assertStringContainsString( 'variant=square', $meta['images'][1]['url'] ); $this->assertNotEmpty( $meta['url'] ); } @@ -260,10 +257,9 @@ class Test_Open_Graph_Tags extends WP_UnitTestCase { $output = ob_get_clean(); $this->assertStringContainsString( 'og:image:width', $output ); - $this->assertSame( 2, substr_count( $output, 'property="og:image" content=' ) ); + $this->assertSame( 1, substr_count( $output, 'property="og:image" content=' ) ); $this->assertStringContainsString( 'content="628"', $output ); $this->assertStringContainsString( 'content="1200"', $output ); - $this->assertStringContainsString( 'variant=square', $output ); $this->assertStringContainsString( 'Hawks "A"', $output ); $this->assertStringNotContainsString( '', $output ); $this->assertStringNotContainsString( '