Skip to content

Instantly share code, notes, and snippets.

View adamsilverstein's full-sized avatar
💭
Working remotely, as usual

Adam Silverstein adamsilverstein

💭
Working remotely, as usual
View GitHub Profile
@adamsilverstein
adamsilverstein / client-side-media-indicator.php
Created May 31, 2026 07:39
Client-Side Media Indicator - WordPress helper plugin: tags each uploaded image as client-side or server-side processed and surfaces it in the Media Library, attachment details, REST API, and an optional front-end badge (no dev tools needed). Companion to the Client-Side Media Processing call for testing.
<?php
/**
* Plugin Name: Client-Side Media Indicator
* Plugin URI: https://make.wordpress.org/core/
* Description: Records whether each uploaded image was processed in the browser (client-side) or on the server, and surfaces that on the attachment - in the Media Library, the attachment details panel, the REST API, and an optional front-end badge - so testers can confirm the processing path without opening browser dev tools.
* Version: 1.0.0
* Requires at least: 6.8
* Requires PHP: 7.4
* Author: WordPress Core Media Component
* License: GPL-2.0-or-later
<?php
/**
* Extract alt meta data from uploaded images.
*
* @wordpress-plugin
* Plugin Name: Extract Alt on Upload
* Description: Extract alt meta data from uploaded images.
* Plugin URI:
* Version: 1.0.0
* Author: Adam Silverstein.
@adamsilverstein
adamsilverstein / wordpress-sizes-attribute-exploration.ipynb
Last active January 15, 2025 23:45
wordpress-sizes-attribute-exploration.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adamsilverstein
adamsilverstein / wordpress-sites-using-react.ipynb
Last active September 13, 2024 15:46
wordpress-sites-using-react.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adamsilverstein
adamsilverstein / cms ratio percent of total sites over time.sql
Created September 11, 2024 03:14
cms ratio % of total sites over time
WITH
sites AS (
SELECT
page AS url,
date,
category
FROM
`httparchive.all.pages`,
UNNEST(technologies) AS technologies,
UNNEST(technologies.categories) AS category
@adamsilverstein
adamsilverstein / performant-translations-colab.ipynb
Last active November 17, 2024 16:03
Performant Translations Colab
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Performance Metrics Impact as of 7/1 dataset

These metrics show the impact on sites after installing the feature (after subtracting out any changes in WordPress core over the same period). Changes are absolute percentage changes in pass rates.

Speculative Loading: {'pct_good_cwv_change': '3.09%', 'pct_good_lcp_change': '2.64%', 'pct_good_cls_change': '2.05%', 'pct_good_inp_change': '-0.24%', 'feature_active_sites': 7206, 'feature_inactive_sites': 10000, 'inactive_to_active_percent': 100.0}

Image Prioritizer: {'pct_good_cwv_change': '3.09%', 'pct_good_lcp_change': '1.68%', 'pct_good_cls_change': '2.35%', 'pct_good_inp_change': '2.14%', 'feature_active_sites': 1264, 'feature_inactive_sites': 10000, 'inactive_to_active_percent': 100.0}

Embed Optimizer: {'pct_good_cwv_change': '3.62%', 'pct_good_lcp_change': '-0.23%', 'pct_good_cls_change': '3.62%', 'pct_good_inp_change': '1.13%', 'feature_active_sites': 3705, 'feature_inactive_sites': 10000, 'inactive_to_active_percent': 100.0}

Modern Images: {'pct_good_c

@adamsilverstein
adamsilverstein / modern-image-formats-colab.ipynb
Last active December 11, 2024 17:56
Modern Image Formats (new)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adamsilverstein
adamsilverstein / wpp-metrics-tracking.ipynb
Last active December 11, 2024 19:38
WPP Metrics Tracking colab
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adamsilverstein
adamsilverstein / interactivity-api-colab.ipynb
Last active March 12, 2025 15:39
interactivity-api-colab.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.