What are some best practices to follow when integrating a third-party script into a PHP project?

When integrating a third-party script into a PHP project, it is important to ensure that the script is secure, up-to-date, and well-documented. It is also crucial to test the script thoroughly in a development environment before deploying it to production. Additionally, it is recommended to create a separate file or class for the third-party script to keep the codebase organized and maintainable.

// Include the third-party script
require_once 'third_party_script.php';

// Call a function from the third-party script
$result = ThirdPartyScript::someFunction($param1, $param2);

// Handle the result accordingly
if ($result) {
    // Do something
} else {
    // Do something else
}