Skip to content

Instantly share code, notes, and snippets.

@kurtpayne
kurtpayne / p3-scanner.php
Created November 20, 2012 20:41
Customize P3's Auto Scan URLs
<?php
/*
Plugin Name: P3 Custom Scanner
Plugin URI: http://inside.godaddy.com/
Description: Customize the pages scanned by P3's auto scan mode
Author: GoDaddy.com
Version: 1.0
Author URI: http://www.godaddy.com/
*/
@kurtpayne
kurtpayne / 6821-unit-test-super-fun.patch
Created October 30, 2012 19:46
6821 unit test super fun
Index: includes/mock-image-editor.php
===================================================================
--- includes/mock-image-editor.php (revision 1108)
+++ includes/mock-image-editor.php (working copy)
@@ -5,13 +5,12 @@
class WP_Image_Editor_Mock extends WP_Image_Editor {
public static $load_return = true;
- public static $test_return = true;
@kurtpayne
kurtpayne / 6821-unit-tests-3.patch
Created September 21, 2012 22:47
6821 unit tests
Index: includes/mock-image-editor.php
===================================================================
--- includes/mock-image-editor.php (revision 0)
+++ includes/mock-image-editor.php (working copy)
@@ -0,0 +1,38 @@
+<?php
+
+class WP_Image_Editor_Mock extends WP_Image_Editor {
+
+ public static $load_return = true;
@kurtpayne
kurtpayne / 6821-resize-unit-test.patch
Created September 12, 2012 23:08
6821 image_resize unit test
Index: tests/image/resize.php
===================================================================
--- tests/image/resize.php (revision 1017)
+++ tests/image/resize.php (working copy)
@@ -123,4 +123,23 @@
unlink($image);
}
+ /**
+ * Try resizing a non-existent image
@kurtpayne
kurtpayne / class-wp-image-editor-base.php
Created September 6, 2012 18:24
Abstract that thing
<?php
abstract class WP_Image_Editor_Base {
protected $file = false;
protected $size = false;
protected $orig_type = false;
protected $quality = 90;
public function __construct( $filename ) {
xdebug_start_trace();
@kurtpayne
kurtpayne / phpl.sh
Last active April 8, 2019 01:17
WordPress Unit Tests Jenkins Config
#!/bin/bash
find $1 \( -type f -and \( -name "*.php" -or -name "*.inc" -or -name "*.phtml" \) \) -exec php -l {} \; | grep -v "No syntax errors"
@kurtpayne
kurtpayne / 21481.patch
Created August 5, 2012 23:13
21481.patch
Index: wp-admin/includes/image.php
===================================================================
--- wp-admin/includes/image.php (revision 21427)
+++ wp-admin/includes/image.php (working copy)
@@ -143,9 +143,11 @@
}
$sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes );
+
+ $image = wp_load_image( $file );
@kurtpayne
kurtpayne / faster_filters_maybe.patch
Created July 19, 2012 21:03
Faster filters, maybe
Index: wp-includes/plugin.php
===================================================================
--- wp-includes/plugin.php (revision 21276)
+++ wp-includes/plugin.php (working copy)
@@ -164,12 +164,26 @@
$args = func_get_args();
do {
- foreach( (array) current($wp_filter[$tag]) as $the_ )
- if ( !is_null($the_['function']) ){
@kurtpayne
kurtpayne / l10n.patch
Created July 19, 2012 20:59
Don't create a new NOOP_Translations object for every domain
Index: wp-includes/l10n.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-includes/l10n.php (revision 21279)
+++ wp-includes/l10n.php (revision )
@@ -493,10 +493,11 @@
* @param string $domain
* @return object A Translation instance
@kurtpayne
kurtpayne / janky_timer.php
Created July 18, 2012 19:51
Janky timer thingy
<?php
// Requests lib
// See https://github.com/rmccue/Requests
require_once 'Requests/library/Requests.php';
Requests::register_autoloader();
// Stopwatch
$timer = new Timer();