Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions integrations/real-time-collaboration.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class RealTimeCollaborationIntegration extends Integration {
* Empty string means load from the unversioned 'gutenberg' folder.
* A version number (e.g., '1.0') loads from 'gutenberg-1.0' folder.
*/
const VIP_RTC_GUTENBERG_VERSION = '22.4.1-f48ad9c';
const VIP_RTC_GUTENBERG_VERSION = '0.2';

/**
* Enable Pendo tracking for this integration.
Expand Down Expand Up @@ -70,12 +70,10 @@ private function can_load(): bool {
*/
private function get_gutenberg_path(): string|false {
// Empty string means use the unversioned folder
if ( defined( 'VIP_RTC_GUTENBERG_VERSION' ) && '' === constant( 'VIP_RTC_GUTENBERG_VERSION' ) ) {
if ( self::VIP_RTC_GUTENBERG_VERSION === '' ) {
$gutenberg_folder = 'gutenberg';
} elseif ( defined( 'VIP_RTC_GUTENBERG_VERSION' ) && '' !== constant( 'VIP_RTC_GUTENBERG_VERSION' ) ) {
$gutenberg_folder = 'gutenberg-' . constant( 'VIP_RTC_GUTENBERG_VERSION' );
} else {
return false;
$gutenberg_folder = 'gutenberg-' . self::VIP_RTC_GUTENBERG_VERSION;
}

$gutenberg_path = WPVIP_MU_PLUGIN_DIR . '/vip-integrations/' . $gutenberg_folder . '/gutenberg.php';
Expand All @@ -92,11 +90,7 @@ private function get_gutenberg_path(): string|false {
* @return string|false The path to the RTC plugin, or false if not found.
*/
private function get_plugin_path(): string|false {
if ( defined( 'VIP_RTC_PLUGIN_VERSION' ) ) {
$plugin_directory = 'vip-real-time-collaboration-' . constant( 'VIP_RTC_PLUGIN_VERSION' );
} else {
return false;
}
$plugin_directory = 'vip-real-time-collaboration-' . self::VIP_RTC_PLUGIN_VERSION;

$load_path = WPVIP_MU_PLUGIN_DIR . '/vip-integrations/' . $plugin_directory . '/vip-real-time-collaboration.php';
if ( ! file_exists( $load_path ) ) {
Expand Down
Loading