When a user is logged in, the application stack is calling \MySLP_Contact_Us::initialize on every page load on the MySLP SaaS system. This should only be loaded when a user is interacting with the Contact Us page in the app.
This is being called via \MySLP_loader in the myslp-dashboard code. This happens when plugins_loaded action hooks are called from WordPress per this code block:
// Load the Customer Profile module AFTER history logger (pri; 15)
add_action( 'plugins_loaded', function () {
/**
* @return void
*/
function myslp_customer_interfaces_loader(): void {
require_once( MYSLP_PLUGIN_DIR . 'include/customer_profile/MySLP_Customer_Profile.php' );
require_once( MYSLP_PLUGIN_DIR . 'include/MySLP_Contact_Us.php' );
require_once( MYSLP_PLUGIN_DIR . 'include/MySLP_Customer_Maintenance.php' );
MySLP_Contact_Us::get_instance();
}
myslp_customer_interfaces_loader();
}, 15 );
This setting is stored in the options_nojs[‘style’] option setting.
It is managed by an instantiation of the SLP_Settings_style_vision_list object.
data_field: options_nojs[style]
label: ‘Locator Style’
type: ‘style_vision_list’
This is a “smart option” managed by SLP_SmartOptions. It is defined in \SLP_SmartOptions:view_appearance() It has a ‘vue’ object type for rendering assistance.
Stack Trace : SLP | Settings
Triggered selecting – Menu : Store Locator Plus® | Settings
Store Locator Plus® was updated with a “pub/sub” model a few years ago. This feature is a managed interface for jQuery Callbacks that allows disparate Javascript functions to interact with each other. It works much like hooks and filters in WordPress, but solely within the JavaScript runtime space.
The basic premise is any JavaScript function can call a “publish” method that fires off a stack of callbacks.
slp_Filter('slp_map_ready').publish(cslmap);
What is run by those callbacks is set by having a JavaScript module call a “subscribe” method.
Location bulk actions allow for users to work on multiple locations at once. Export a list of locations, delete select locations from the location table, geocode locations ,and more.
2209.12
Export locations is our first attempt at making bulk actions work more like a single page application.
Instead of doing a form post and submitting the location list, then reading in some PHP-driven variables to set the JavaScript behavior — in 2209.12 the export process bypasses the form submit.
Bypass is handled by using a pub/sub module with a dynamic filter name “exportBulkAction”. This tells the main SLP JavaScript process to execute the callback stack instead of pushing a form submit. This allows the AJAX call to happen immediately without a full page re-render.
2208.15
The apply button processing is handled in the main plugin’s admin.js file.
It uses jQuery to process form variables and prepare the #locationForm to be submitted.
When submitted it sends the request back to WordPress for standard “full page load” processing.
The process starts with a standard form submit from the Bulk Actions “Apply” button.
WordPress sets up a JavaScript variable location_import that has info about the action “export”.
This triggers a jQuery(document).ready() call that fires another request via AJAX back to WordPress with some new parameters in place.
That AJAX call eventually sends back a CSV file that is stored in a DOM div that was prepared with the jQuery() document loader when the refreshed page (post original submit) was rendered.