Functon Name | Calls | Calls % | Incl. Wall Time | IWall% | Excl. Wall Time | EWall% |
---|---|---|---|---|---|---|
Run #1 | ||||||
profile_get_permalink_with_id |
1,000 | 0.4% | 323,009 | 48.3% | 5,428 | 0.8% |
profile_get_permalink_with_obj |
1,000 | 0.4% | 343,777 | 51.4% | 9,017 | 1.3% |
Run #2 | ||||||
profile_get_permalink_with_id |
1,000 | 0.4% | 416,239 | 50.0% | 1,666 | 0.2% |
profile_get_permalink_with_obj |
1,000 | 0.4% | 413,868 | 49.7% | 5,640 | 0.7% |
Run #3 | ||||||
profile_get_permalink_with_id |
1,000 | 0.4% | 464,560 | 52.7% | 1,349 | 0.2% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tag=${1:-trunk} | |
echo "Releasing CampTix Version: $tag" | |
d=`mktemp -d -t camptix` | |
git clone [email protected]:Automattic/camptix.git $d/git | |
svn co https://plugins.svn.wordpress.org/camptix/trunk $d/svn | |
cp -r $d/git/* $d/svn/ | |
cd $d/svn | |
svn add . | |
svn commit -m "Sync with GitHub master." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'pre_comment_content', function( $content ) { | |
if ( strlen( $content ) > 64000 ) | |
wp_die( 'Invalid comment.' ); | |
return $content; | |
} ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wp_natural_time( $timestamp, $limit = 2 ) { | |
$from = time(); | |
$diff = absint( $from - $timestamp ); | |
if ( $diff < 1 ) | |
return _x( 'now', 'time ago' ); | |
$result = array(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$XHPROF_ROOT = '/home/kovshenin/xhprof'; | |
include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_lib.php"; | |
include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_runs.php"; | |
add_action( 'init', function() { | |
// Make sure it's in cache before we profile. | |
$post = get_post( $post_id ); | |
$post_id = 1134; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I don't think it's about the conflict, consider two simple tables, say posts (p): | |
|| id || | |
|| 1 || | |
|| 2 || | |
|| 3 || | |
And term relationships (tr): | |
|| post_id || term_id || |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'init', function() { | |
$total = 0; | |
for ( $i = 1; $i <= 500; $i++ ) { | |
$query = new WP_Query( array( | |
'posts_per_page' => 1, | |
'offset' => $i, | |
) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Fix my /date/ | |
*/ | |
function fix_my_date() { | |
global $wp_rewrite; | |
$wp_rewrite->date_structure = '%year%/%monthnum%/%day%'; | |
} | |
add_action( 'init', 'fix_my_date' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Reproduce #26533 | |
*/ | |
add_action( 'admin_bar_menu', function() { | |
global $wp_admin_bar; | |
$wp_admin_bar->add_menu( array( | |
'id' => 'foo', | |
'title' => '<span id="foo-icon" class="ab-item" style="height: 32px !important; width: 32px !important; display: block; background: red;"></span>', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Static Templates | |
* | |
* If most of your site content is in .php template files, and you're tired of | |
* creating new pages, assigning them page templates, creating page templates | |
* then doing it all over again on production, this plugin is for you. | |
* | |
* Examples: | |
* |