Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
62e74e9
Add Activity Library feature for learn.wordpress.org
Piyopiyo-Kitsune May 22, 2026
3b2f17b
Apply prettier formatting to existing plugin JS files
Piyopiyo-Kitsune May 22, 2026
7974c72
Refine Activity Library: UX polish, stats dashboard, feedback strip, …
Piyopiyo-Kitsune May 26, 2026
9d0422e
Fix JS lint failures: root ESLint scope, import order, identifier names
Piyopiyo-Kitsune May 26, 2026
84f131d
Add "Last updated" date to single activity kit header
Piyopiyo-Kitsune May 26, 2026
170e2be
Update "Read the handbook" link to activity kits handbook page
Piyopiyo-Kitsune May 26, 2026
0c4a6c0
Address Copilot code review: fix bugs, remove dead code, harden CI lint
Piyopiyo-Kitsune May 26, 2026
25d9232
Fix PluginDocumentSettingPanel import: use @wordpress/edit-post
Piyopiyo-Kitsune May 26, 2026
1463689
Fix import command: seed kits as drafts, not published
Piyopiyo-Kitsune May 28, 2026
c63a0cc
Fix PHPCS docblock: align @param spacing in activity_kit_query_vars
Piyopiyo-Kitsune May 28, 2026
088d209
Fix activity library review issues
dd32 Jun 8, 2026
c627518
Remove redundant activity library guards
dd32 Jun 8, 2026
7d4a2be
Use unknown author for imported activity kits
dd32 Jun 8, 2026
1e2ee14
Remove plugin-local lint config
dd32 Jun 8, 2026
fb49fa8
Migrate activity kit tracking to Jetpack Stats
Piyopiyo-Kitsune Jun 29, 2026
6bc2a98
Address Copilot review: build pipeline, tracking attrs, lint fixes
Piyopiyo-Kitsune Jun 29, 2026
f0169c7
Address second Copilot review: sanitization, colors, duration display
Piyopiyo-Kitsune Jun 29, 2026
03a481a
Fix locale-notice.js object-shorthand lint error
Piyopiyo-Kitsune Jun 29, 2026
36722f1
Fix activity kit stats data extraction and cap Jetpack stats cache
Piyopiyo-Kitsune Jul 7, 2026
54f320b
Activity kit admin: "Add Activity Kit" label, author column, stats su…
Piyopiyo-Kitsune Jul 7, 2026
7873eea
Address PR review: scope Jetpack stats cache filter, drop stray view …
Piyopiyo-Kitsune Jul 7, 2026
2a470ce
Fix phpcs function-spacing errors in blocks.php
Piyopiyo-Kitsune Jul 7, 2026
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
5 changes: 5 additions & 0 deletions wp-content/plugins/wporg-learn/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"useTabs": true,
"tabWidth": 4,
"printWidth": 120
}
138 changes: 138 additions & 0 deletions wp-content/plugins/wporg-learn/inc/activity-kit-import.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<?php

namespace WPOrg_Learn\Activity_Kit_Import;

defined( 'WPINC' ) || die();

if ( ! defined( 'WP_CLI' ) || ! WP_CLI ) {
return;
}

/**
* WP-CLI commands for Activity Kit management.
*/
class Activity_Kit_CLI {

/**
* Import the initial 11 Activity Kit posts.
*
* ## OPTIONS
*
* [--force]
* : Re-import even if posts already exist.
*
* ## EXAMPLES
*
* wp activity-kit import
*
* @when after_wp_load
*/
public function import( $args, $assoc_args ) {
$force = \WP_CLI\Utils\get_flag_value( $assoc_args, 'force', false );

$kits = array(
array(
'title' => 'Debugging for Developers',
'topics' => array( 'development' ),
'levels' => array( 'Intermediate' ),
),
array(
'title' => 'Debugging for Site Owners',
'topics' => array( 'site-management' ),
'levels' => array( 'Beginner' ),
),
array(
'title' => 'eCommerce with WooCommerce',
'topics' => array( 'woocommerce', 'ecommerce' ),
'levels' => array( 'Beginner' ),
),
array(
'title' => 'SEO Foundations',
'topics' => array( 'seo' ),
'levels' => array( 'Beginner' ),
),
array(
'title' => 'WordPress Playground',
'topics' => array( 'playground' ),
'levels' => array( 'Beginner' ),
),
array(
'title' => 'Content Creation',
'topics' => array( 'content-creation' ),
'levels' => array( 'Beginner' ),
),
array(
'title' => 'Using AI in your WordPress Dashboard',
'topics' => array( 'ai', 'site-management' ),
'levels' => array( 'Beginner' ),
),
array(
'title' => 'Managing your WordPress site with AI',
'topics' => array( 'ai', 'site-management' ),
'levels' => array( 'Intermediate' ),
),
array(
'title' => 'Contributor Onboarding',
'topics' => array( 'contributing' ),
'levels' => array( 'Beginner' ),
),
array(
'title' => 'WordPress Security Essentials',
'topics' => array( 'security' ),
'levels' => array( 'Beginner' ),
),
array(
'title' => 'Accessibility Testing in WordPress',
'topics' => array( 'accessibility' ),
'levels' => array( 'Beginner' ),
),
);

foreach ( $kits as $kit_data ) {
$existing_query = new \WP_Query(
array(
'post_type' => 'activity_kit',
'post_status' => 'any',
'title' => $kit_data['title'],
'posts_per_page' => 1,
'fields' => 'ids',
)
);
$existing = $existing_query->have_posts() ? get_post( $existing_query->posts[0] ) : null;

if ( $existing && ! $force ) {
\WP_CLI::log( sprintf( 'Skipping "%s" — already exists (ID %d). Use --force to re-import.', $kit_data['title'], $existing->ID ) );
continue;
}

$post_id = wp_insert_post(
array(
'post_title' => $kit_data['title'],
'post_type' => 'activity_kit',
'post_status' => 'draft',
'post_author' => 0,
),
Comment thread
Piyopiyo-Kitsune marked this conversation as resolved.
true
);

if ( is_wp_error( $post_id ) ) {
\WP_CLI::warning( sprintf( 'Failed to create "%s": %s', $kit_data['title'], $post_id->get_error_message() ) );
continue;
}

if ( ! empty( $kit_data['topics'] ) ) {
wp_set_object_terms( $post_id, $kit_data['topics'], 'topic' );
}

if ( ! empty( $kit_data['levels'] ) ) {
wp_set_object_terms( $post_id, $kit_data['levels'], 'level' );
}

\WP_CLI::success( sprintf( 'Created "%s" (ID %d)', $kit_data['title'], $post_id ) );
}

\WP_CLI::log( 'Import complete.' );
}
}

\WP_CLI::add_command( 'activity-kit', __NAMESPACE__ . '\Activity_Kit_CLI' );
Loading
Loading