The “Insert Script” Simple WordPress Plug-in uses an “insert_script” shortcode to insert external scripts into WordPress content.
I developed a simple WordPress plug-in that allows WordPress owners to call and execute external scripts from within their web root folder. It can be HTML, Javascript, CSS, or even PHP that executes first. You can even pass different attributes to your scripts so when the script is inserted the properties and/or variables are defined beforehand, allowing the script, if it’s dynamic to process the data based on the attributes defined.
Creating a WordPress plug-in as a PHP class is always the best way to keep your code encapsulated while avoiding collisions with any other WordPress globals and other plug-ins. It’s a little more work than the old way of declaring a function, but it’s worth it. First of all, you aren’t joining the continuous accommodation of procedure monstrosities that the WordPress architecture seems to welcome despite the consequences that come with not using OOP encapsulation. They should simply BAN procedural plug-ins and make all WordPress sites more stable overnight.
To see a screenshot, view the help page and download the “Insert Script” WordPress plug-in, click here.
I found the need to bring in external content that could talk to legacy systems, pull information from another database, make API calls from another website, even pull in reports from a COBOL-based legacy monstrosity for a luxury jewelry retailer and show the results within a WordPress page as part of the dynamic content. Need to show the price of gold at any given moment? This plug-in bridges the gap between your WordPress, non-technical guru and your web developers.
Save a lot of time and trouble by separating concerns and allowing those laymen who are too lazy to learn real web programming to insert your heavy lifting with this simple but very powerful “Insert Script” WordPress plug-in. If found this simple conduit between WordPress and other external scripts and code was efficient and safe for extending WordPress content to meet any organization’s or business’s needs. I hope you do too!
– Aaron Belchamber