Skip to content

Commit

Permalink
Merge branch 'develop' into release/5.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeelia authored Dec 12, 2024
2 parents 10311e8 + 12b2b32 commit 09d26b7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
1 change: 0 additions & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
".",
"https://downloads.wordpress.org/plugin/classic-widgets.zip",
"https://downloads.wordpress.org/plugin/debug-bar.zip",
"https://downloads.wordpress.org/plugin/debug-bar-elasticpress.zip",
"https://downloads.wordpress.org/plugin/wordpress-importer.zip",
"10up/elasticpress-proxy#develop"
],
Expand Down
5 changes: 5 additions & 0 deletions bin/setup-cypress-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ fi
# Set twentytwentyone as the active theme here, as 2025 won't work with WP 6.0
./bin/wp-env-cli tests-wordpress "wp --allow-root theme activate twentytwentyone"

# Fix the debug-bar-elasticpress dependency of ElasticPress
./bin/wp-env-cli tests-wordpress "wp --allow-root plugin install debug-bar-elasticpress"
./bin/wp-env-cli tests-wordpress "sed -i \"s/Requires Plugins: elasticpress/Requires Plugins: $PLUGIN_NAME/\" /var/www/html/wp-content/plugins/debug-bar-elasticpress/debug-bar-elasticpress.php"
./bin/wp-env-cli tests-wordpress "wp --allow-root plugin activate debug-bar-elasticpress"

if [ ! -z $WP_VERSION ]; then
./bin/wp-env-cli tests-wordpress "wp --allow-root core update --version=${WP_VERSION} --force"
fi
Expand Down
8 changes: 5 additions & 3 deletions includes/classes/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -1335,9 +1335,11 @@ public function index_output( $message, $args, $index_meta, $context ) {
$time_elapsed = Utility::timer_stop( 2 );
WP_CLI::log( WP_CLI::colorize( '%Y' . esc_html__( 'Time elapsed: ', 'elasticpress' ) . '%N' . Utility::timer_format( $time_elapsed ) . $time_elapsed_diff ) );

$current_memory = round( memory_get_usage() / 1024 / 1024, 2 ) . 'mb';
$peak_memory = ' (Peak: ' . round( memory_get_peak_usage() / 1024 / 1024, 2 ) . 'mb)';
WP_CLI::log( WP_CLI::colorize( '%Y' . esc_html__( 'Memory Usage: ', 'elasticpress' ) . '%N' . $current_memory . $peak_memory ) );
$current_memory = memory_get_usage() / 1024 / 1024;
$current_memory = ( $current_memory > 1000 ) ? round( $current_memory / 1024, 2 ) . 'gb' : round( $current_memory, 2 ) . 'mb';
$peak_memory = memory_get_peak_usage() / 1024 / 1024;
$peak_memory = ( $peak_memory > 1000 ) ? round( $peak_memory / 1024, 2 ) . 'gb' : round( $peak_memory, 2 ) . 'mb';
WP_CLI::log( WP_CLI::colorize( '%Y' . esc_html__( 'Memory Usage: ', 'elasticpress' ) . '%N' . $current_memory . ' (Peak: ' . $peak_memory . ')' ) );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion includes/partials/stats-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<div class="ep-flex-container">
<div class="ep-totals-column inside">
<p class="ep-totals-title"><?php esc_html_e( 'Total Documents', 'elasticpress' ); ?></p>
<p class="ep-totals-data"><?php echo esc_html( $totals['docs'] ); ?></p>
<p class="ep-totals-data"><?php echo esc_html( number_format_i18n( $totals['docs'] ) ); ?></p>
</div>
<div class="ep-totals-column inside">
<p class="ep-totals-title"><?php esc_html_e( 'Total Size', 'elasticpress' ); ?></p>
Expand Down
18 changes: 18 additions & 0 deletions tests/php/TestAdminNotices.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@ public function testHostErrorNoticeInAdmin() {

remove_all_filters( 'ep_elasticsearch_version' );

// As we know the call will fail, let's fail faster.
add_filter(
'ep_pre_request_args',
function ( $args ) {
$args['timeout'] = 1;
return $args;
}
);

ElasticPress\Elasticsearch::factory()->get_elasticsearch_version( true );

ElasticPress\Screen::factory()->set_current_screen( null );
Expand Down Expand Up @@ -252,6 +261,15 @@ public function testHostErrorNoticeInInstall() {
delete_site_option( 'ep_need_upgrade_sync', true );
delete_site_option( 'ep_feature_auto_activated_sync' );

// As we know the call will fail, let's fail faster.
add_filter(
'ep_pre_request_args',
function ( $args ) {
$args['timeout'] = 1;
return $args;
}
);

ElasticPress\Elasticsearch::factory()->get_elasticsearch_version( true );

ElasticPress\Screen::factory()->set_current_screen( 'install' );
Expand Down

0 comments on commit 09d26b7

Please sign in to comment.