You are reviewing a custom observer for the event sales_order_save_after which is fired when an order is placed on the storefront. The observer is sending a remote request to an analytics system with the order data.
What issue may this observer cause?
You are working on a module MyCompany_MyModule which adds a select attribute with a few options using the \Magento\Eav\Setup\EavSetup: :addAttribute() method in data in data install script.
There is no uninstall script. While debugging, you have uninstalled the module with the command:
bin magento module:uninstall MyCompany_MyModule
Then you reinstalled the module. What will be the effect on the attribute?
When your class will be instantiated all the dependencies injected in your class constructor will also get instantiated, and it will trigger a chain reaction of object creation, this can really slow down the process. What could be the solution of above problem?
In homepage, you need to add inline css in the body tag. What should be the correct way of doing this using layout XML file cms_index_index.xml:
In a phtml, you added script tag and defined couple of js variables as below:Now to protect it from XSS attacks, which two methods allow you to keep the php variable output XSS-safe?Choose 2