Skip to content

Instantly share code, notes, and snippets.

View nylen's full-sized avatar
🏗️
Constructing

James Nylen nylen

🏗️
Constructing
View GitHub Profile
This file has been truncated, but you can view the full file.
diff -ru build-before-upgrades-unminified/wp-admin/css/about.min.css build-unminified/wp-admin/css/about.min.css
--- build-before-upgrades-unminified/wp-admin/css/about.min.css 2018-10-05 18:06:59.450589337 -0500
+++ build-unminified/wp-admin/css/about.min.css 2018-10-05 18:07:16.186704658 -0500
@@ -39,7 +39,8 @@
}
.wp-badge {
- background: url(../images/w-logo-white.png?ver=20160308) center 25px no-repeat #0073aa;
+ background: #0073aa url(../images/w-logo-white.png?ver=20160308) no-repeat;
+ background-position: center 25px;
@nylen
nylen / version_compare_php_version.sh
Created September 17, 2018 02:38
ClassicPress PHP version
$ ack -i 'version_compare.*php_version'
tests/phpunit/tests/functions.php:763: if ( version_compare( PHP_VERSION, '5.5', '<' ) ) {
tests/phpunit/tests/db/charset.php:365: if ( version_compare( PHP_VERSION, '5.3', '<') && stristr( php_uname( 's' ), 'win' ) ) {
tests/phpunit/tests/rest-api/rest-schema-setup.php:371: if ( version_compare( PHP_VERSION, '5.4', '>=' ) ) {
tests/phpunit/tests/rest-api/rest-schema-setup.php:380: if ( ! is_multisite() && version_compare( PHP_VERSION, '5.4', '>=' ) ) {
tests/phpunit/tests/rest-api/rest-request.php:458: if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
tests/phpunit/tests/rest-api/rest-request.php:474: if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
tests/phpunit/tests/customize/nav-menus.php:957: if ( version_compare( PHP_VERSION, '5.3', '>=' ) ) {
tests/phpunit/tests/theme/customHeader.php:128: if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
tests/phpunit/tests/theme/customHeader.php:212: if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
a:84:{s:4:"mode";s:3:"now";s:5:"title";s:0:"";s:15:"skip_empty_file";b:1;s:11:"log_results";b:0;s:11:"from_status";a:0:{}s:9:"to_status";a:0:{}s:22:"change_order_status_to";s:0:"";s:8:"statuses";a:0:{}s:9:"from_date";s:0:"";s:7:"to_date";s:0:"";s:18:"shipping_locations";a:0:{}s:16:"shipping_methods";a:0:{}s:10:"item_names";a:0:{}s:13:"item_metadata";a:0:{}s:10:"user_roles";a:0:{}s:10:"user_names";a:0:{}s:18:"user_custom_fields";a:0:{}s:17:"billing_locations";a:0:{}s:15:"payment_methods";a:0:{}s:15:"any_coupon_used";s:1:"0";s:7:"coupons";a:0:{}s:19:"order_custom_fields";a:0:{}s:18:"product_categories";a:0:{}s:15:"product_vendors";a:0:{}s:8:"products";a:0:{}s:18:"product_taxonomies";a:0:{}s:21:"product_custom_fields";a:0:{}s:18:"product_attributes";a:0:{}s:16:"product_itemmeta";a:0:{}s:6:"format";s:3:"CSV";s:25:"format_xls_use_xls_format";s:1:"0";s:21:"format_xls_sheet_name";s:6:"Orders";s:31:"format_xls_display_column_names";s:1:"1";s:21:"format_xls_auto_width";s:1:"1";s:46:"format_xls_populate_other_columns_p
diff --git a/Gruntfile.js b/Gruntfile.js
index 8a984ccdd4..5668c0c744 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -747,9 +747,14 @@ module.exports = function(grunt) {
],
tasks: ['qunit']
}
- }
+ },
@nylen
nylen / wp-doing-it-wrong.sh
Created September 5, 2018 01:15
WP _doing_it_wrong calls
ClassicPress $ ack "doing_it_wrong.*['\"]\d"
tests/phpunit/tests/includes/helpers.php:204: _doing_it_wrong( __METHOD__, __( 'Incorrect usage test' ), '2.5' );
src/wp-includes/rest-api.php:37: _doing_it_wrong( 'register_rest_route', __( 'Routes must be namespaced with plugin or theme name and version.' ), '4.4.0' );
src/wp-includes/rest-api.php:40: _doing_it_wrong( 'register_rest_route', __( 'Route must be specified.' ), '4.4.0' );
src/wp-includes/functions.php:5742: _doing_it_wrong( __FUNCTION__, __( 'Only UUID V4 is supported at this time.' ), '4.9.0' );
src/wp-includes/class-wp-admin-bar.php:128: _doing_it_wrong( __METHOD__, __( 'The menu ID should not be empty.' ), '3.3.0' );
src/wp-includes/pluggable.php:1083: _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2.0' );
src/wp-includes/pluggable.php:1126: _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '4.7'
@nylen
nylen / wp-deprecated-code.sh
Created September 5, 2018 01:14
WP deprecated code
ClassicPress $ ack "_deprecated_.*['\"]\d"
tests/phpunit/tests/includes/helpers.php:199: _deprecated_function( __METHOD__, '2.5' );
src/wp-includes/ms-load.php:506: _deprecated_function( __FUNCTION__, '3.9.0', 'get_current_site()' );
src/wp-includes/ms-load.php:526: _deprecated_function( __FUNCTION__, '3.9.0' );
src/wp-includes/ms-load.php:543: _deprecated_function( __FUNCTION__, '4.7.0', 'get_network()' );
src/wp-includes/ms-default-constants.php:141: _deprecated_argument( 'define()', '3.0.0', $vhost_deprecated );
src/wp-includes/author-template.php:27: _deprecated_argument( __FUNCTION__, '2.1.0' );
src/wp-includes/author-template.php:60: _deprecated_argument( __FUNCTION__, '2.1.0' );
src/wp-includes/author-template.php:64: _deprecated_argument( __FUNCTION__, '1.5.0',
src/wp-includes/author-template.php:318: _deprecated_argument( __FUNCTION__, '2.1.0' );
$ ack -i autosizer -A5 | grep -i list -B5 | pbcopy
client/blocks/term-tree-selector/terms.jsx:11:import AutoSizer from 'react-virtualized/AutoSizer';
client/blocks/term-tree-selector/terms.jsx:12-import List from 'react-virtualized/List';
--
client/blocks/term-tree-selector/terms.jsx:14- debounce,
client/blocks/term-tree-selector/terms.jsx:15- difference,
client/blocks/term-tree-selector/terms.jsx:16- includes,
client/blocks/term-tree-selector/terms.jsx:425: <AutoSizer disableHeight>
client/blocks/term-tree-selector/terms.jsx:426- { ( { width } ) => (
client/blocks/term-tree-selector/terms.jsx:427- <List
diff --git a/client/components/popover/menu-item.jsx b/client/components/popover/menu-item.jsx
index 77dc01a..82228cd 100644
--- a/client/components/popover/menu-item.jsx
+++ b/client/components/popover/menu-item.jsx
@@ -29,7 +29,8 @@ export default class PopoverMenuItem extends Component {
}
render() {
- const { children, className, focusOnHover, href, icon, isSelected } = this.props;
+ const href = null;
#!/usr/bin/env php
<?php
/*
Usage:
$ ag --php --skip-vcs-ignores register_rest_route | tee scans/register_rest_route.txt
$ scans/register_rest_route-strings.php
*/
$f = fopen( dirname( __FILE__ ) . '/register_rest_route.txt', 'r' );
@nylen
nylen / list-gutenberg-dependencies.pl
Last active August 3, 2017 22:52
List JS dependencies of the WP Gutenberg plugin and suggest a load order
#!/usr/bin/env perl
use warnings;
use strict;
use File::Basename;
chdir dirname $0;
if ( ! -f 'editor/index.js' ) {
chdir '..';