Skip to content

Commit

Permalink
Fix empty string display of VIP_JETPACK_LOADED_VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccahum committed Dec 10, 2024
1 parent 6c4eaff commit 7b266e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,8 @@ function vip_jetpack_load() {

require_once $path;
if ( class_exists( 'Jetpack' ) ) {
var_dump( $version );
die( 'test' );
define( 'VIP_JETPACK_LOADED_VERSION', $version );
} else {
trigger_error( 'Jetpack could not be loaded and initialized due to a bootstrapping issue.', E_USER_WARNING );
Expand Down
7 changes: 6 additions & 1 deletion vip-jetpack/vip-jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,13 @@ function vip_filter_plugin_version_jetpack( $plugin_meta, $plugin_file ) {
}

if ( 'jetpack.php' === $plugin_file ) {
if ( defined( 'VIP_JETPACK_LOADED_VERSION' ) && ! empty( constant( 'VIP_JETPACK_LOADED_VERSION' ) ) ) {
$version = constant( 'VIP_JETPACK_LOADED_VERSION' );
} else {
$version = constant( 'JETPACK__VERSION' );
}
$type = defined( 'WPCOM_VIP_JETPACK_LOCAL' ) && constant( 'WPCOM_VIP_JETPACK_LOCAL' ) ? 'Local' : 'MU-Plugins';
$plugin_meta[0] = sprintf( '%s (%s)', $plugin_meta[0], $type );
$plugin_meta[0] = sprintf( '%s (%s)', $version, $type );
remove_filter( 'plugin_row_meta', 'vip_filter_plugin_version_jetpack', PHP_INT_MAX, 2 );
}

Expand Down

0 comments on commit 7b266e1

Please sign in to comment.