Skip to content

Commit 7244755

Browse files
RELEASE: 5.0.42
1 parent e79d920 commit 7244755

File tree

430 files changed

+2065
-40818
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

430 files changed

+2065
-40818
lines changed

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,45 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### [5.0.41]
1010

11+
#### Added
12+
- NEW
13+
1114
#### Fixed
1215
- [Fix Additional Registrant Incomplete Reg Forms (#1856)](https://github.com/eventespresso/cafe/pull/1856)
16+
- [Fix License Keys Admin Menu Loading on Multisite (#1860)](https://github.com/eventespresso/cafe/pull/1860)
17+
- [Fix PluginLicense Error During Cron (#1866)](https://github.com/eventespresso/cafe/pull/1866)
18+
- [Fix Version Parsing (#1883)](https://github.com/eventespresso/cafe/pull/1883)
19+
- [Prevent _load_textdomain_just_in_time notice from GraphQL (#1882)](https://github.com/eventespresso/cafe/pull/1882)
20+
- [Fix Admin Page RSS Feed (#1893)](https://github.com/eventespresso/cafe/pull/1893)
21+
- [PPC. Fix updating onboarding status (#1888)](https://github.com/eventespresso/cafe/pull/1888)
22+
- [Modify System Hook Points (#1891)](https://github.com/eventespresso/cafe/pull/1891)
23+
- [Fix Payment Method Nag Notices (#1895)](https://github.com/eventespresso/cafe/pull/1895)
24+
- [Decode HTML Entities in Reg Form Options (#1892)](https://github.com/eventespresso/cafe/pull/1892)
25+
- [Fix SPCO Transaction Lock (#1906)](https://github.com/eventespresso/cafe/pull/1906)
26+
- [SAAS. After deploy fixes Jul 16 (#1911)](https://github.com/eventespresso/cafe/pull/1911)
27+
- [Remove types in EEM_Base that were changed or might be null (#1912)](https://github.com/eventespresso/cafe/pull/1912)
28+
- FIX
1329

1430
#### Changed
1531
- [Dont migrate options we dont use (#1845)](https://github.com/eventespresso/cafe/pull/1845)
32+
- [Rename Version Files and Fallback to Main File for Version (#1880)](https://github.com/eventespresso/cafe/pull/1880)
33+
- [Load Textdomain on Init (#1637)](https://github.com/eventespresso/cafe/pull/1637)
34+
- [Define Model Field Data Types (#1714)](https://github.com/eventespresso/cafe/pull/1714)
35+
- [Refactor Events Calendar Plus Data Loading and Add Data Migration Management (#1881)](https://github.com/eventespresso/cafe/pull/1881)
36+
- [Removed Default Filters From Datetimes And Tickets In Editor (Barista#1422) (#1910)](https://github.com/eventespresso/cafe/pull/1910)
37+
- [Fix Plugin Action Settings Links and Improve Plugin Menu Items (#1377)](https://github.com/eventespresso/cafe/pull/1377)
38+
- [Move Existing and Add New SPCO Line Item Filters (#1907)](https://github.com/eventespresso/cafe/pull/1907)
39+
- [Check For Main Query Before Running Logic in THE LOOP (#1767)](https://github.com/eventespresso/cafe/pull/1767)
40+
- MOD
41+
42+
#### Deprecated
43+
- DEP
44+
45+
#### Removed
46+
- RMV
47+
48+
#### Security
49+
- SEC
1650

1751

1852

PaymentMethods/PayPalCommerce/PayPalCheckout/forms/BillingForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ public function enqueue_js(): void
461461
$merchant_id = false;
462462
$funding_options = ['venmo', 'paylater'];
463463

464-
// Override the above if thrid party integration
464+
// Override the above if third party integration
465465
if (EED_PayPalCommerce::isThirdParty($this->_pm_instance)) {
466466
$client_id_key = Domain::META_KEY_PARTNER_CLIENT_ID;
467467
$merchant_id = PayPalExtraMetaManager::getPmOption(

PaymentMethods/PayPalCommerce/assets/js/eea-paypal-onboarding.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ jQuery(document).ready(function ($) {
128128
const sandbox_mode = this_pm.sandbox_select.val();
129129
// Update the onboarding URL if the debug mode was changed.
130130
this_pm.toggleBtnText(this_pm, sandbox_mode);
131+
// Save this change.
132+
this_pm.sendRequest('eeaPpSaveDebugMode');
131133
});
132134
};
133135

@@ -333,6 +335,8 @@ jQuery(document).ready(function ($) {
333335
* @function
334336
*/
335337
this.sendRequest = function (request_action, request_data, callback, update_ui) {
338+
$(this.onboard_btn).attr('disabled', true);
339+
$(this.offboard_btn).attr('disabled', true);
336340
if (typeof request_data === 'undefined') {
337341
request_data = {};
338342
}
@@ -356,6 +360,8 @@ jQuery(document).ready(function ($) {
356360
callback(this_pm, response);
357361
} else {
358362
this_pm.processing_icon.fadeOut('fast');
363+
$(this_pm.onboard_btn).attr('disabled', false);
364+
$(this_pm.offboard_btn).attr('disabled', false);
359365
}
360366
if (update_ui) {
361367
this_pm.updateOnboardingUI(this_pm, false);
@@ -441,7 +447,7 @@ jQuery(document).ready(function ($) {
441447
*/
442448
this.checkForErrors = function (this_pm, response, close_window) {
443449
if (response === null || response.error) {
444-
if (close_window) {
450+
if (typeof close_window !== 'undefined' && close_window && this_pm.onboard_window) {
445451
this_pm.onboard_window.close();
446452
}
447453
let error = eeaPPOnboardParameters.request_error;

PaymentMethods/PayPalCommerce/modules/EED_PayPalOnboard.module.php

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ public static function set_hooks_admin(): void
6161
// Get onboarding URL.
6262
add_action('wp_ajax_eeaPpGetOnboardingUrl', [__CLASS__, 'getOnboardingUrl']);
6363
// Catch the return/redirect from PayPal onboarding page.
64-
add_action('init', [__CLASS__, 'updateOnboardingStatus']);
64+
add_action('admin_init', [__CLASS__, 'updateOnboardingStatus']);
6565
// Return the connection/onboard status.
6666
add_action('wp_ajax_eeaPpGetOnboardStatus', [__CLASS__, 'getOnboardStatus']);
6767
// Revoke access.
6868
add_action('wp_ajax_eeaPpOffboard', [__CLASS__, 'offboard']);
6969
// Clear all metadata.
7070
add_action('wp_ajax_eeaPpClearMetaData', [__CLASS__, 'clearMetaData']);
71+
add_action('wp_ajax_eeaPpSaveDebugMode', [__CLASS__, 'eeaPpSaveDebugMode']);
7172
// Admin notice.
7273
add_action('admin_init', [__CLASS__, 'adminNotice']);
7374
}
@@ -298,6 +299,15 @@ public static function updateOnboardingStatus(): void
298299
$get_params = EED_Module::getRequest()->getParams();
299300
// Get the payment method.
300301
$paypal_pm = EED_PayPalCommerce::getPaymentMethod();
302+
if (! $paypal_pm instanceof EE_Payment_Method) {
303+
PayPalLogger::errorLog(
304+
esc_html__('Not able to validate the payment method.', 'event_espresso'),
305+
$get_params,
306+
$paypal_pm
307+
);
308+
EED_PayPalOnboard::redirectToPmSettingsHome();
309+
return;
310+
}
301311
// Check the response (GET) parameters.
302312
if (! EED_PayPalOnboard::onboardingStatusResponseValid($get_params, $paypal_pm)) {
303313
// Missing parameters. Can't proceed.
@@ -316,7 +326,7 @@ public static function updateOnboardingStatus(): void
316326
);
317327
if (! isset($onboarding_status['valid']) || ! $onboarding_status['valid']) {
318328
PayPalLogger::errorLog(
319-
$onboarding_status['message'],
329+
$onboarding_status['message'] ?? esc_html__('Failed to track seller onboarding.', 'event_espresso'),
320330
array_merge($get_params, $onboarding_status),
321331
$paypal_pm
322332
);
@@ -365,7 +375,7 @@ public static function onboardingStatusResponseValid(array $data, $paypal_pm): b
365375
*/
366376
public static function getPartnerAccessToken(EE_Payment_Method $paypal_pm): string
367377
{
368-
// Do we have it saved ?
378+
// See if it's already saved.
369379
$access_token = PayPalExtraMetaManager::getPmOption($paypal_pm, Domain::META_KEY_ACCESS_TOKEN);
370380
// If we don't have it, request/update it.
371381
if (! $access_token) {
@@ -395,8 +405,8 @@ public static function partnerAccessTokenExpired(EE_Payment_Method $paypal_pm):
395405
}
396406
// Validate the token expiration date.
397407
$minutes_left = round(($expires_at - time()) / 60);
398-
// Count as expired if less than 60 minutes till expiration left.
399-
if ($minutes_left <= 60) {
408+
// Refresh if less than 2 hours till expiration left. Access tokens have a life of 15 minutes or 8 hours.
409+
if ($minutes_left <= 60 * 2) {
400410
return true;
401411
}
402412
return false;
@@ -563,6 +573,26 @@ public static function clearMetaData(): void
563573
}
564574

565575

576+
/**
577+
* Save the sandbox mode option.
578+
* (AJAX)
579+
*
580+
* @return void
581+
* @throws EE_Error
582+
* @throws ReflectionException
583+
*/
584+
public static function eeaPpSaveDebugMode(): void
585+
{
586+
$paypal_pm = EED_PayPalCommerce::getPaymentMethod();
587+
EED_PayPalOnboard::validatePmAjax($paypal_pm);
588+
// Reset the partner access token.
589+
PayPalExtraMetaManager::updateDebugMode($paypal_pm, EED_Module::getRequest()->postParams());
590+
// And do the data reset.
591+
PayPalExtraMetaManager::deleteAllData($paypal_pm);
592+
wp_send_json(['success' => true]);
593+
}
594+
595+
566596
/**
567597
* Validate the PM instance, returning an ajax response on invalid.
568598
*

PaymentMethods/PayPalCommerce/tools/extra_meta/PayPalExtraMetaManager.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use EE_Payment_Method;
77
use EventEspresso\core\services\encryption\Base64Encoder;
88
use EventEspresso\core\services\loaders\LoaderFactory;
9+
use EventEspresso\core\services\request\RequestInterface;
910
use EventEspresso\PaymentMethods\PayPalCommerce\domain\Domain;
1011
use EventEspresso\PaymentMethods\PayPalCommerce\tools\encryption\OpenSSLEncryption;
1112
use EventEspresso\PaymentMethods\PayPalCommerce\tools\encryption\PPCommerceEncryptionKeyManager;
@@ -37,9 +38,14 @@ class PayPalExtraMetaManager
3738
*/
3839
public static function extraMeta(EE_Payment_Method $paypal_pm): PayPalExtraMeta
3940
{
41+
$post_params = LoaderFactory::getLoader()->getShared(RequestInterface::class)->postParams();
4042
if (
4143
! PayPalExtraMetaManager::$pay_pal_extra_meta instanceof PayPalExtraMeta
4244
|| PayPalExtraMetaManager::$pay_pal_extra_meta->pm->slug() !== $paypal_pm->slug()
45+
|| (! empty($post_params['sandbox_mode'])
46+
&& in_array($post_params['sandbox_mode'], ['0', '1'], true)
47+
&& $paypal_pm->debug_mode() !== (bool) $post_params['sandbox_mode']
48+
)
4349
) {
4450
PayPalExtraMetaManager::$pay_pal_extra_meta = new PayPalExtraMeta($paypal_pm);
4551
}

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5.0.42

admin_pages/about/About_Admin_Page_Init.core.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3+
use EventEspresso\core\domain\entities\admin\menu\AdminMenuGroup;
34
use EventEspresso\core\domain\entities\admin\menu\AdminMenuItem;
5+
use EventEspresso\core\domain\entities\admin\menu\AdminMenuTopLevel;
46

57
/**
68
* EE_About_Admin_Page_Init
@@ -39,14 +41,14 @@ public function getMenuProperties(): array
3941
{
4042
return [
4143
'menu_type' => AdminMenuItem::TYPE_MENU_SUB_ITEM,
42-
'menu_group' => 'extras',
44+
'menu_group' => AdminMenuGroup::MENU_SLUG_EXTRAS,
4345
'menu_order' => 40,
4446
'show_on_menu' => AdminMenuItem::DISPLAY_BLOG_AND_NETWORK,
45-
'parent_slug' => 'espresso_events',
46-
'menu_slug' => 'espresso_about',
47+
'parent_slug' => AdminMenuTopLevel::MENU_PARENT_ACTIVE,
48+
'menu_slug' => EE_ABOUT_PG_SLUG,
4749
'menu_label' => EE_ABOUT_LABEL,
4850
'capability' => 'manage_options',
49-
'maintenance_mode_parent' => 'espresso_maintenance_settings',
51+
'maintenance_mode_parent' => AdminMenuTopLevel::MENU_PARENT_MAINTENANCE,
5052
];
5153
}
5254
}

admin_pages/events/Events_Admin_Page.core.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2627,7 +2627,7 @@ protected function _update_default_event_settings()
26272627
$registration_config->default_STS_ID = $valid_data['default_reg_status'];
26282628
}
26292629
if (isset($valid_data['default_max_tickets'])) {
2630-
$registration_config->default_maximum_number_of_tickets = $valid_data['default_max_tickets'];
2630+
$registration_config->default_maximum_number_of_tickets = (int) $valid_data['default_max_tickets'];
26312631
}
26322632
do_action(
26332633
'AHEE__Events_Admin_Page___update_default_event_settings',

admin_pages/events/Events_Admin_Page_Init.core.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3+
use EventEspresso\core\domain\entities\admin\menu\AdminMenuGroup;
34
use EventEspresso\core\domain\entities\admin\menu\AdminMenuItem;
5+
use EventEspresso\core\domain\entities\admin\menu\AdminMenuTopLevel;
46

57
/**
68
* Events_Admin_Page_Init
@@ -41,14 +43,14 @@ protected function _set_init_properties()
4143
public function getMenuProperties(): array
4244
{
4345
return [
44-
'menu_type' => AdminMenuItem::TYPE_MENU_SUB_ITEM,
45-
'menu_group' => 'main',
46-
'menu_order' => 10,
47-
'show_on_menu' => AdminMenuItem::DISPLAY_BLOG_ONLY,
48-
'parent_slug' => 'espresso_events',
49-
'menu_slug' => 'espresso_events',
50-
'menu_label' => esc_html__('Events', 'event_espresso'),
51-
'capability' => 'ee_read_events',
46+
'menu_type' => AdminMenuItem::TYPE_MENU_SUB_ITEM,
47+
'menu_group' => AdminMenuGroup::MENU_SLUG_MAIN,
48+
'menu_order' => 10,
49+
'show_on_menu' => AdminMenuItem::DISPLAY_BLOG_ONLY,
50+
'parent_slug' => AdminMenuTopLevel::MENU_PARENT_ACTIVE,
51+
'menu_slug' => AdminMenuTopLevel::MENU_PARENT_ACTIVE,
52+
'menu_label' => esc_html__('Events', 'event_espresso'),
53+
'capability' => 'ee_read_events',
5254
];
5355
}
5456
}

admin_pages/general_settings/General_Settings_Admin_Page_Init.core.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3+
use EventEspresso\core\domain\entities\admin\menu\AdminMenuGroup;
34
use EventEspresso\core\domain\entities\admin\menu\AdminMenuItem;
5+
use EventEspresso\core\domain\entities\admin\menu\AdminMenuTopLevel;
46

57
/**
68
* General_Settings_Admin_Page_Init
@@ -41,14 +43,14 @@ protected function _set_init_properties()
4143
public function getMenuProperties(): array
4244
{
4345
return [
44-
'menu_type' => AdminMenuItem::TYPE_MENU_SUB_ITEM,
45-
'menu_group' => 'settings',
46-
'menu_order' => 20,
47-
'show_on_menu' => AdminMenuItem::DISPLAY_BLOG_ONLY,
48-
'parent_slug' => 'espresso_events',
49-
'menu_slug' => GEN_SET_PG_SLUG,
50-
'menu_label' => GEN_SET_LABEL,
51-
'capability' => 'manage_options',
46+
'menu_type' => AdminMenuItem::TYPE_MENU_SUB_ITEM,
47+
'menu_group' => AdminMenuGroup::MENU_SLUG_SETTINGS,
48+
'menu_order' => 20,
49+
'show_on_menu' => AdminMenuItem::DISPLAY_BLOG_ONLY,
50+
'parent_slug' => AdminMenuTopLevel::MENU_PARENT_ACTIVE,
51+
'menu_slug' => GEN_SET_PG_SLUG,
52+
'menu_label' => GEN_SET_LABEL,
53+
'capability' => 'manage_options',
5254
];
5355
}
5456
}

0 commit comments

Comments
 (0)