See screen shot as how it shows in Staging , on the Categories page,
a bunch of script under locations but only the first one Named Distribution shows the script
[19-Nov-2024 15:11:30 UTC]
PHP Deprecated: Creation of dynamic property SLP_Power_Category_Manager::$wp_categories_by_id is deprecated
in /var/www/html/wp-content/
plugins/slp-power/include/module/category/SLP_Power_Category_Manager.php
on line 274
You will see this message in Generate Embed when reviewing the interface for any user.
As of February 21st, 2024, google.maps.Marker is deprecated. Please use google.maps.marker.AdvancedMarkerElement instead. At this time, google.maps.Marker is not scheduled to be discontinued, but google.maps.marker.AdvancedMarkerElement is recommended over google.maps.Marker. While google.maps.Marker will continue to receive bug fixes for any major regressions, existing bugs in google.maps.Marker will not be addressed. At least 12 months notice will be given before support is discontinued. Please see https://developers.google.com/maps/deprecations for additional details and https://developers.google.com/maps/documentation/javascript/advanced-markers/migration for the migration guide.
On the initial call the store-locator-plus.php MUP is called first an is loading with the initMySLP _jsonp call from the embed script.
the SLPlus::initialize_after_plugins_loaded() is being called.
DOING_AJAX is not set, so createobject_AJAX() is not called.
MySLP_REST_API->get_options() is called, which expects SLP->AJAX to be set, but it is not.
The front-end/locations.js is using jQuery.ajax() but it is calling a REST API url, not an AJAX listener endpoint… from the locations.js call…
Update the MySLP_REST_API->get_options() method to use SLP_Ajax::get_instance() to ensure that object is instantiated before use when not doing an AJAX call.
Use the main MySLP::getUserBlogId() to fetch blog IDs. Use SLP_Ajax::get_instance() versus the uninitialized slplus->AjaxHandler to get the SLP AJAX instance.
slplus->AJAX (slplus->AJAX_Handler) was not initialized because the call is a REST call not an AJAX call.
Users are seeing the wrong locations when logged in, seeing the main super admin locations.
Reproduction
Login as a super admin (CiCi?)
Bring up the customer list and switch to any customer (bhinson)
The default location list is not correct. For bhinson it shows 2 locations that belong to super admin. bhinson has 0 locations.
Testing Update : 2024.11.14
Correct locations show up on MySLP menu, but NOT the SLP menu.
Dev Notes
SaaS is using a custom REST endpoint to find locations: …/myslp/v2/locations
This is running a custom interface in the MySLP Dashboard defined wp-content/plugins/myslp-dashboard/include/class.myslp.rest.api.php which fetches locations from include/location/MySLP_Location.php get_locations();
This leverages wp-content/plugins/store-locator-plus/include/module/location/SLP_Location_Utilities.php to provide the location data interface.
In MySLP_Locations the slptbl is set in __construct() which may be too early. it is coming back as wp_store_locator which is incorrect It appears switch_to_blog() has not yet been called. The call stack at this point..
switch_to_blog is called in MySLP class via perform_init_actions() which is attached to the WP hook ‘init’ with no order of precedence set
SLP not returning proper locations
The SLP Location Manager is rendered via SLP_Admin_Locations::display_manage_locations_table() ./wp-content/plugins/store-locator-plus/include/module/admin/SLP_Admin_Locations.php
It is pulling locations vis the $slplus->database property which is an instantiation of SLP_Data:: ./wp-content/plugins/store-locator-plus/include/module/data/SLP_Data.php
SLP_Data::initialize is setting the SLP_Data::from_slp_table property via SLP_Data::set_database_meta() This pulls from SLP_Data::db which is an instantiation of the WordPress wpdb class. The table is set by adding wpdb->prefix to the ‘store_locator’ fixed string.
wpdb->prefix is not pulling the proper user prefix , likely due to switch_to_blog() not being called yet.
Call Sequence
store-locator-plus.php is loaded…
slp_setup_environment() is called…
SLPLUS::initialize() is executed
$this->database = new SLP_Data()
SLP_Actions::initialize()
add_action( ‘init’, array( $this, ‘init’ ), 11 );
SLP_Actions::init() via WP init hook
MySLP::perform_init_actions()
Resolution
MySLP
The main MySLP dashboard loader (wp-content/plugins/myslp-dashboard/myslp-dashboard.php) was initializing the MySLP_Location class which immediate set the properties for SLP table and Extendo table names.
This needed to be deferred until after the MySLP::perform_init_actions() was called.
Added a new method in MySLP_Location::perform_init_actions() that sets the slp and extendo class properties. It is called from within the MySLP::perform_init_actions() to ensure proper timing on the reading of those table names.
SLP
Initialize the $slplus->data (SLP_Data) object AFTER the user login, performing the setup in the init action hook within SLP_Actions.
Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/wp-content/plugins/myslp-customer-maintenance/include/MySLP_SysAdmin_View_Profile.php on line 275
Reproduction
Login as SA
List Customers
Choose a customer , highlight the row and click “view profile” under the menu.
When the page renders the debug.log entry will show the message above.
Resolution
Stop Gap
A stop-gap measure is in place to default to text “stripe”, but we need to find out why the myslp->User object does not have a payment method set.
[08-Nov-2024 20:28:43 UTC] PHP Warning: Undefined variable $user_blog in /var/www/html/wp-content/plugins/myslp-customer-maintenance/include/MySLP_SysAdmin_View_Profile.php on line 387
[08-Nov-2024 20:28:43 UTC] PHP Warning: Attempt to read property “blog_id” on null in /var/www/html/wp-content/plugins/myslp-customer-maintenance/include/MySLP_SysAdmin_View_Profile.php on line 387
[08-Nov-2024 20:28:43 UTC] PHP Warning: Undefined variable $user_blog in /var/www/html/wp-content/plugins/myslp-customer-maintenance/include/MySLP_SysAdmin_View_Profile.php on line 391
[08-Nov-2024 20:28:43 UTC] PHP Warning: Attempt to read property “path” on null in /var/www/html/wp-content/plugins/myslp-customer-maintenance/include/MySLP_SysAdmin_View_Profile.php on line 391
[08-Nov-2024 20:28:43 UTC] PHP Warning: Undefined variable $user_blog in /var/www/html/wp-content/plugins/myslp-customer-maintenance/include/MySLP_SysAdmin_View_Profile.php on line 393
[08-Nov-2024 20:28:43 UTC] PHP Warning: Attempt to read property “path” on null in /var/www/html/wp-content/plugins/myslp-customer-maintenance/include/MySLP_SysAdmin_View_Profile.php on line 393
[08-Nov-2024 20:41:38 UTC] PHP Warning: Attempt to read property “path” on int in /var/www/html/wp-content/plugins/myslp-customer-maintenance/include/MySLP_SysAdmin_View_Profile.php on line 409
Invalid submenu call
[08-Nov-2024 20:28:43 UTC] PHP Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/wp-admin/admin-header.php on line 36
Reproduction
Login as SA
Customers | All Users
Search CiCi
Hover and click profile
errors are in the debug.log
Resolution
Related To Blog ID Not Set
These errors are all related to an issue in the MySLP Customer Maintenance plugin where the $user_blog var was not set to a proper WP_Site object when the user was an SA.
Added a line to fetch WP_Site based on the $myslp->User->blog_id in those cases.
Invalid Submenu Call
This strip_tags() error is coming from WP core admin functions. Turns out the admin-header rendering expected a call to add_submenu_page to actually name a menu in the first param, not pass ” as a string. Apparently you need to attach all submenus to a parent menu of some kind.
Attached the View Profile admin page to the ‘users.php’ (Customers) menu as a submenu.
Side effect: it now shows “View Profile” under the Customers menu — not sure I like it there.
[06-Nov-2024 23:37:44 UTC] PHP Deprecated: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in /var/www/html/wp-content/mu-plugins/myslp-site-architect/extensions/myslp-dashboard/controllers/myslp-dashboard-controller.php on line 801
Resolution
Stop Gap
Pass ” in a ?? fallback on strtotime() calls in our code.
Go to the staging site (https://staging.storelocatorplus.com)
Login as CiCi
Error
Fatal error: Uncaught TypeError: MySLP::getUserBlogId():
Return value must be of type int, string returned in
/var/www/html/wp-content/mu-plugins/myslp-dashboard/include/MySLP.php
on line 196
TypeError: MySLP::getUserBlogId(): Return value must be of type int, string returned in /var/www/html/wp-content/mu-plugins/myslp-dashboard/include/MySLP.php on line 196
Cause
The blog id (site id) for cici does not have a meta ‘primary_blog’ value set.
The bug is specific to SLP employees with elevated privs only.
Resolution
Update MySLP Dashboard getUserBlogId() to default to current_user- site ID if primary blog meta is empty.
Deprecated:
Return type of Stripe\Util\CaseInsensitiveArray::offsetExists($offset)
Return type of Stripe\Util\CaseInsensitiveArray::offsetGet($offset)
Return type of Stripe\Util\CaseInsensitiveArray::offsetSet($offset, $value)
Return type of Stripe\Util\CaseInsensitiveArray::offsetUnset($offset)
Return type of Stripe\Util\CaseInsensitiveArray::count()
Return type of Stripe\Util\CaseInsensitiveArray::getIterator()
Return type of Stripe\Util\Set::getIterator()
Return type of Stripe\StripeObject::offsetExists($k)
Return type of Stripe\StripeObject::offsetGet($k)
Return type of Stripe\StripeObject::offsetSet($k, $v)
Return type of Stripe\StripeObject::offsetUnset($k)
Return type of Stripe\StripeObject::count()
Return type of Stripe\StripeObject::jsonSerialize()
Return type of Stripe\Collection::getIterator()
Detailed Example
Deprecated:
Return type of Stripe\Util\CaseInsensitiveArray::offsetExists($offset)
should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool,
or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in
/var/www/html/wp-content/mu-plugins/myslp-payments/include/module/stripe/lib/Util/CaseInsensitiveArray.php on line 44
Call Stack: 0.0001 464728
1. {main}() /var/www/html/wp-admin/admin.php:0 0.4073 9234784
2. do_action($hook_name = 'toplevel_page_myslp_profile') /var/www/html/wp-admin/admin.php:259 0.4073 9235000
3. WP_Hook->do_action($args = [0 => '']) /var/www/html/wp-includes/plugin.php:517 0.4073 9235000
4. WP_Hook->apply_filters($value = '', $args = [0 => '']) /var/www/html/wp-includes/class-wp-hook.php:348 0.4073 9235432
5. MySLP_Customer_Profile->page_profile('') /var/www/html/wp-includes/class-wp-hook.php:324 0.4079 9250552
6. require_once('/var/www/html/wp-content/plugins/myslp-customer-profile/views/view.profile.php') /var/www/html/wp-content/plugins/myslp-customer-profile/include/MySLP_Customer_Profile.php:259 0.4079 9250552
7. MySLP_Recurring_Payments->get_subscription_details($user_id = 592, $force = TRUE) /var/www/html/wp-content/plugins/myslp-customer-profile/views/view.profile.php:19 0.4113 9252720
8. MySLP_Stripe_Payments->get_subscription_details($subscription_id = 'sub_Gycmzo5SSaE1Wd') /var/www/html/wp-content/mu-plugins/myslp-payments/include/module/MySLP_Recurring_Payments.php:154 0.4113 9252720
9. MySLP_Stripe_Payments->load_lib() /var/www/html/wp-content/mu-plugins/myslp-payments/include/module/stripe/MySLP_Stripe_Payments.php:418 0.4115 9253216
10. require_once('/var/www/html/wp-content/mu-plugins/myslp-payments/include/module/stripe/init.php') /var/www/html/wp-content/mu-plugins/myslp-payments/include/module/stripe/MySLP_Stripe_Payments.php:435 0.4119 9253760
11. require('/var/www/html/wp-content/mu-plugins/myslp-payments/include/module/stripe/lib/Util/CaseInsensitiveArray.php') /var/www/html/wp-content/mu-plugins/myslp-payments/include/module/stripe/init.php:7
Deprecated: Return type of Stripe\Util\CaseInsensitiveArray::offsetGet($offset)
The Stripe API library included in the myslp-payments plugin was outdated.
This was already updated and in the develop branch, however the staging branch in myslp-payments was not updated to point to this latest updated.
Merged the develop branch into staging on the myslp-payments repo (ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/myslp-payments) and pushed up to AWS CodeCommit.
Check out staging branch on the myslp_aws_ecs_kit on local dev box.
Ran ./tools/update_code.sh on the local dev box.
This pushed code and committed it to the staging branch on the myslp_aws_ecs kit. This triggered CodePipline to build the new ECR image , fetching the staging branch on the myslp_aws_ecs_kit and all submodules before performing the build.