Skip to content

Commit 1416c91

Browse files
committed
Update changelog for 3.6.6.
1 parent d6f6887 commit 1416c91

File tree

5 files changed

+70
-29
lines changed

5 files changed

+70
-29
lines changed

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
# Changelog
22

3-
## [Unreleased]
3+
## [3.6.6] (2024-11-27)
4+
5+
### Changed
6+
* Improved compatability with modern versions of PHP.
7+
* Extended welcome API to include admin notices.
8+
9+
### Fixed
10+
* Memory issue from checking aggregate posts while loading front-end syntax highlighter.
11+
* Translation functions being called too early on upgrade, resulting in localisation loading errors.
12+
* Bug preventing the 'share on network' status of network snippets from correctly updating.
13+
* Incorrect logic controlling when to display 'Save Changes' or 'Save Changes and Activate' buttons.
14+
* Old notices persisting when switching between editing and creating snippets.
15+
16+
## 3.6.5.1 (2024-05-24)
17+
18+
* Redeployment of [v3.6.5](#365-2024-05-24) to overcome issue with initial build.
419

520
## [3.6.5] (2024-05-24)
621

@@ -1118,6 +1133,7 @@
11181133
* Stable version released.
11191134

11201135
[unreleased]: https://github.com/codesnippetspro/code-snippets/tree/core
1136+
[3.6.6]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.6.6
11211137
[3.6.5]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.6.5
11221138
[3.6.4]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.6.4
11231139
[3.6.3]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.6.3

composer.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/php/admin-menus/class-manage-menu.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,12 @@ public function register_compact_menu() {
173173
public function load() {
174174
parent::load();
175175

176-
/* Load the contextual help tabs */
177176
$contextual_help = new Contextual_Help( 'manage' );
178177
$contextual_help->load();
179178

180-
// Initialize the search cloud list table class.
181179
$this->cloud_search_list_table = new Cloud_Search_List_Table();
182180
$this->cloud_search_list_table->prepare_items();
183181

184-
/* Initialize the list table class */
185182
$this->list_table = new List_Table();
186183
$this->list_table->prepare_items();
187184
}
@@ -210,7 +207,7 @@ public function enqueue_assets() {
210207

211208
wp_set_script_translations( 'code-snippets-manage-js', 'code-snippets' );
212209

213-
if ( 'cloud_search' === $this->get_current_type() ) {
210+
if ( 'cloud' === $this->get_current_type() || 'cloud_search' === $this->get_current_type() ) {
214211
Front_End::enqueue_all_prism_themes();
215212
}
216213
}

src/php/class-welcome-api.php

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -145,28 +145,53 @@ private function parse_banner( array $remote ): array {
145145
}
146146

147147
/**
148-
* Parse a list of image items from a remote dataset.
148+
* Parse a list of features from a remote dataset.
149149
*
150150
* @param array $remote Remote data.
151151
*
152-
* @return array[] Parsed image data
152+
* @return array[] Parsed feature data.
153153
*/
154-
private function parse_image_list( array $remote ): array {
155-
$items = [];
154+
private function parse_features( array $remote ): array {
155+
$limit = max( self::ITEM_LIMIT, count( $remote ) );
156+
$features = [];
157+
158+
for ( $i = 0; $i < $limit; $i++ ) {
159+
$feature = $remote[ $i ];
160+
161+
$features[] = [
162+
'title' => $feature['title'] ?? '',
163+
'follow_url' => $feature['follow_url'] ?? '',
164+
'image_url' => $feature['image_url'] ?? '',
165+
'category' => $feature['category'] ?? '',
166+
'description' => $feature['description'] ?? '',
167+
];
168+
}
169+
170+
return $features;
171+
}
156172

173+
/**
174+
* Parse a list of partners from a remote dataset.
175+
*
176+
* @param array $remote Remote data.
177+
*
178+
* @return array[] Parsed partner data.
179+
*/
180+
private function parse_partners( array $remote ): array {
157181
$limit = max( self::ITEM_LIMIT, count( $remote ) );
182+
$partners = [];
158183

159184
for ( $i = 0; $i < $limit; $i++ ) {
160-
$remote_item = $remote[ $i ];
185+
$partner = $remote[ $i ];
161186

162-
$items[] = [
163-
'title' => $remote_item['title'] ?? '',
164-
'follow_url' => $remote_item['follow_url'] ?? '',
165-
'image_url' => $remote_item['image_url'] ?? '',
187+
$partners[] = [
188+
'title' => $partner['title'] ?? '',
189+
'follow_url' => $partner['follow_url'] ?? '',
190+
'image_url' => $partner['image_url'] ?? '',
166191
];
167192
}
168193

169-
return $items;
194+
return $partners;
170195
}
171196

172197
/**
@@ -176,6 +201,7 @@ private function parse_image_list( array $remote ): array {
176201
*/
177202
protected function fetch_remote_welcome_data() {
178203
$remote_welcome_data = wp_remote_get( self::WELCOME_JSON_URL );
204+
179205
if ( is_wp_error( $remote_welcome_data ) ) {
180206
return;
181207
}
@@ -188,8 +214,8 @@ protected function fetch_remote_welcome_data() {
188214

189215
$this->welcome_data['banner'] = $this->parse_banner( self::safe_get_array( $remote_welcome_data, 'banner' ) );
190216
$this->welcome_data['hero-item'] = $this->parse_hero_item( self::safe_get_array( $remote_welcome_data, 'hero-item' ) );
191-
$this->welcome_data['features'] = $this->parse_image_list( self::safe_get_array( $remote_welcome_data, 'features' ) );
192-
$this->welcome_data['partners'] = $this->parse_image_list( self::safe_get_array( $remote_welcome_data, 'partners' ) );
217+
$this->welcome_data['features'] = $this->parse_features( self::safe_get_array( $remote_welcome_data, 'features' ) );
218+
$this->welcome_data['partners'] = $this->parse_partners( self::safe_get_array( $remote_welcome_data, 'partners' ) );
193219
}
194220

195221
/**
@@ -236,7 +262,7 @@ protected function build_changelog_data() {
236262

237263
foreach ( array_slice( $lines, 1 ) as $line ) {
238264
$entry = trim( str_replace( '(PRO)', '', str_replace( '*', '', $line ) ) );
239-
$core_or_pro = str_contains( $line, '(PRO)' ) ? 'pro' : 'core';
265+
$core_or_pro = false === strpos( $line, '(PRO)' ) ? 'core' : 'pro';
240266

241267
if ( ! isset( $changelog[ $version ][ $section_type ] ) ) {
242268
$changelog[ $version ][ $section_type ] = [
@@ -287,15 +313,17 @@ public function get_hero_item(): array {
287313
}
288314

289315
/**
290-
* Retrieve the list of featured images retrieved from the remote API.
316+
* Retrieve the list of features retrieved from the remote API.
291317
*
292318
* @return array{
293319
* title: string,
294320
* follow_url: string,
295-
* image_url: string
296-
* }[] Featured image details.
321+
* image_url: string,
322+
* category: string,
323+
* description: string
324+
* }[] Feature details.
297325
*/
298-
public function get_featured_images(): array {
326+
public function get_features(): array {
299327
return $this->welcome_data['features'] ?? [];
300328
}
301329

src/php/views/welcome.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class="csp-link-<?php echo esc_attr( $link_name ); ?>">
145145
<section class="csp-section-articles csp-section-links">
146146
<h1>🛟 <?php esc_html_e( 'Helpful articles', 'code-snippets' ); ?></h1>
147147
<div class="csp-cards">
148-
<?php foreach ( $this->api->get_image_list( 'features' ) as $feature ) { ?>
148+
<?php foreach ( $this->api->get_features() as $feature ) { ?>
149149
<a class="csp-card"
150150
href="<?php echo esc_url( $feature['follow_url'] ); ?>" target="_blank"
151151
title="<?php esc_html_e( 'Read more', 'code-snippets' ); ?>">
@@ -169,7 +169,7 @@ class="csp-link-<?php echo esc_attr( $link_name ); ?>">
169169
<section class="csp-section-links csp-section-partners">
170170
<h1>🚀 <?php esc_html_e( 'Partners and apps', 'code-snippets' ); ?></h1>
171171
<div class="csp-cards">
172-
<?php foreach ( $this->api->get_image_list( 'partners' ) as $partner ) { ?>
172+
<?php foreach ( $this->api->get_partners() as $partner ) { ?>
173173
<a class="csp-card"
174174
href="<?php echo esc_url( $partner['follow_url'] ); ?>" target="_blank"
175175
title="<?php esc_attr_e( 'Go to Partner', 'code-snippets' ); ?>">

0 commit comments

Comments
 (0)