Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Working remotely, as usual

Adam Silverstein adamsilverstein

💭
Working remotely, as usual
View GitHub Profile
View post.json
{
id: 63,
date: "2020-11-05T22:17:57",
date_gmt: "2020-11-05T22:17:57",
guid: {
rendered: "http://wpdev.localhost/?p=63"
},
modified: "2020-11-05T22:17:57",
modified_gmt: "2020-11-05T22:17:57",
slug: "welcome-to-the-gutenberg-editor",
View google-site-kit-language-loader.php
<?php
/**
* Ensures Site Kit loads languages correctly.
*
* @author Adam Silverstein, Google
* @license Apache 2.0
* @copyright 2020 Google Inc.
*
* @wordpress-plugin
* Plugin Name: Site Kit Language Loader
View pass-author-name.diff
diff --git a/lib/rest-api.php b/lib/rest-api.php
index 8ad8653091..72944e6d79 100644
--- a/lib/rest-api.php
+++ b/lib/rest-api.php
@@ -52,6 +52,25 @@ function gutenberg_filter_oembed_result( $response, $handler, $request ) {
}
add_filter( 'rest_request_after_callbacks', 'gutenberg_filter_oembed_result', 10, 3 );
+add_action( 'rest_api_init', function() {
+ global $post;
View gist:712dae49f0df58f0204c32e171b68e5c
<?php
/**
* Ensures Site Kit WPML compatibility.
*
* @wordpress-plugin
* Plugin Name: Fix Site Kit WPML compatibility
* Description: Ensures Site Kit WPML compatibility.
* Plugin URI:
* Version: 1.0.0
* Author: Adam Silverstein, Google
View tests.diff
diff --git a/packages/editor/src/components/post-author/index.js b/packages/editor/src/components/post-author/index.js
index bdd9c30596..623a0ad82b 100644
--- a/packages/editor/src/components/post-author/index.js
+++ b/packages/editor/src/components/post-author/index.js
@@ -17,8 +17,7 @@ import { compose, withInstanceId } from '@wordpress/compose';
*/
import PostAuthorCheck from './check';
-function PostAuthor( { authors, postAuthor, onUpdateAuthor } ) {
-
View site-monitoring-app-script.js
// Created by Adam Silverstein, based on original work by Rick Viscomi (@rick_viscomi)
// Adapted from https://ithoughthecamewithyou.com/post/automate-google-pagespeed-insights-with-apps-script by Robert Ellison
// @copyright 2020 Google LLC
var scriptProperties = PropertiesService.getScriptProperties();
var pageSpeedApiKey = scriptProperties.getProperty('PSI_API_KEY');
function queueAllDomains() { {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var sheet = spreadsheet.getSheetByName('Alerts');
View wvfw-links.html
@adamsilverstein
adamsilverstein / web-vitals.php
Last active Aug 28, 2020
Measure Web Vitals in Analytics
View web-vitals.php
<?php
/**
* Measure Web Vitals in Analytics
*
* @copyright 2020 Google LLC
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
*
* @wordpress-plugin
* Plugin Name: Measure Vitals
* Description: Measure Web Vitals in Analytics
@adamsilverstein
adamsilverstein / analytics-step-mode.php
Last active Jul 29, 2020
Enabling Analytics Step Mode
View analytics-step-mode.php
<?php
/**
* Enable the 'analytics-step' setup mode.
*
* @copyright 2020 Google LLC
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link https://sitekit.withgoogle.com
*
* @wordpress-plugin
* Plugin Name: Analytics Step Setup
View channelGrouping.json
"modules::analytics:report::1cc2cfc3218eab9aa0d167f96fe944ea": [{
"nextPageToken": null,
"columnHeader": {
"dimensions": ["ga:channelGrouping"],
"metricHeader": {
"metricHeaderEntries": [{
"name": "Sessions",
"type": "INTEGER"
}, {
"name": "Users",
You can’t perform that action at this time.