Closed benjaminisawolfe closed 3 years ago
Oh, I should also add that I used passphrases for my encryption and action signature keys -- not sure if spaces and special characters would create an issue.
Here's the PHP error I'm getting on both sites:
Wprus_Api_Abstract->decrypt_data on line 192: Could not decrypt data: invalid bundle., referer: https://prfnul.wpengine.com/wprus/login/
I changed the following lines in the class-wprus-api-abstract.php on both sites to get more info:
public function decrypt_data( $bundle ) {
$data = false;
$payload = false;
try {
$payload = Wprus_Crypto::decrypt(
$bundle,
self::$encryption_settings['aes_key'],
self::$encryption_settings['hmac_key']
);
} catch ( Exception $e ) {
Wprus_Logger::log( 'Could not decrypt data: ' . $e->getMessage() . ' : ' . $bundle, 'alert', 'db_log' );
}
if ( $payload ) {
$data = json_decode( $payload, true );
} else {
Wprus_Logger::log( __( 'Could not decrypt data: invalid bundle: ' . $bundle, 'wprus' ) );
}
return $data;
}
When I ran the login test from the prfnul to prfndev, it returned the following error:
Wprus_Api_Abstract->decrypt_data on line 192: Could not decrypt data: invalid bundle: 2XnOYHBkM8xn5g20nFxexwQ7WfzyjFMxnPHDAvqj+AgkZwntcZw7v0oz4MlgEh8g5GyQdpetZIyeI7RGjBKVqPbFo4YQLXZjLVytyFP9gtPcxYeq7pbzqSdVtIkJt_1CkcRpDk6VUcWW6ujL_g4RMTJJ2UhLT+nQT68SJEQuv_mt6vAqImAdKrT0BMo0uFiunl2Cjv_1GPeRtVrg5ZE53g==, referer: https://prfnul.wpengine.com/wprus/login/
I don't know if that helps at all, but figure the more information I can provide, the better.
So, interestingly, I made a test to call your functions and ran them on the "invalid bundle" from my last comment with my keys, and here's what it returned:
'{"ping":1,"direction":"incoming","username":"adminusername","base_url":"https:\/\/prfntdev.wpengine.com"}`
Where adminusername is the account name for the account with _userid 1.
I also ran a json_decode on it, and it returned this:
array (
'ping' => 1,
'direction' => 'incoming',
'username' => 'adminusername',
'base_url' => 'https://prfntdev.wpengine.com',
)
I did some further testing by adding some more output fields to the error log, like so:
public function decrypt_data( $bundle ) {
$data = false;
$payload = false;
try {
$payload = Wprus_Crypto::decrypt(
$bundle,
self::$encryption_settings['aes_key'],
self::$encryption_settings['hmac_key']
);
} catch ( Exception $e ) {
Wprus_Logger::log( 'Could not decrypt data: ' . $e->getMessage() . ' : ' . $bundle, 'alert', 'db_log' );
}
if ( $payload ) {
$data = json_decode( $payload, true );
} else {
Wprus_Logger::log( __( 'Could not decrypt data: invalid bundle: payload=' . $payload . ' -- bundle=' . $bundle . ' -- encryption key=' . self::$encryption_settings['aes_key'] . ' -- hmac key=' . self::$encryption_settings['hmac_key'], 'wprus' ) );
}
return $data;
}
Everything came out fine except for $payload. It came out empty, which makes no sense. If the bundle and keys are present, then payload should be?
Anyhow, that's as far as I've gotten in debugging. Hopefully, it helps!
Ack, how embarrassing. The encryption keys mismatched due to a copy/paste error.
It might be useful to add a more informative error message, because it was not clear at all that this was the problem.
That said, it's a great plugin and thank you for your hard work!
Hello!
I'm trying to get WP RUS working between two pre-existing sites with plugins and users, etc.
I've checked that the URLs are correct and match the WordPress and Site address in the General settings.
I am getting the following error:
Error contacting the remote site: Payload error - Syntax error
Here's the log from https://prfnul.wpengine.com/ :
It's running the CityGov theme, and the following plugins:
3D FlipBook - Lite Edition bbPress Better Search Replace Booked BuddyPress BuddyPress Simple Terms And Conditions Buttons Shortcode And Widgets CB Change Mail Sender Chatra Live Chat, Chatbots and Cart Saver Classic Editor Colorlib Login Customizer Contact Form 7 Essential Grid Flow-Flow Lite Google Analytics for WordPress by MonsterInsights HTML5 jQuery Audio Player Jetpack LH Buddypress Export Xprofile Data Loco Translate MC4WP Peter's Login Redirect Portfolio Filter Gallery Post Expirator Remove Dashboard Access Restrict User Access Shortcodes Ultimate Slider Revolution SM Replace Howdy Social Icons Widget & Block by WPZOOM Stream String Locator The Events Calendar ThemeREX Donations ThemeREX Updater ThemeREX Utilities Unbounce Landing Pages Woo Custom Emails Per Product WooCommerce WooCommerce Shipping & Tax WooCommerce Stripe Gateway WordPress Importer WordPress Users & WooCommerce Customers Import Export(BASIC) WP Cloudy WP GDPR Compliance WP Remote Users Sync WP Voting Contest WPBakery Page Builder WPZOOM Instagram Widget Yoast Duplicate Post
And here is the log from https://prfnul.wpengine.com/:
It's running the CityGov theme, and the following plugins:
Buttons Shortcode And Widgets CB Change Mail Sender Classic Editor Colorlib Login Customizer Contact Form 7 Essential Grid Jetpack Loco Translate MC4WP Post Expirator Remove Dashboard Access Shortcodes Ultimate Slider Revolution Social Icons Widget & Block by WPZOOM Stream ThemeREX Updater ThemeREX Utilities Unbounce Landing Pages User Role Editor WordPress Importer WP GDPR Compliance WPBakery Page Builder Yoast Duplicate Post
Please let me know if you need any more details.
Thank you!