/* Plugin Name: SASBoss WooCommerce Integration Description: A plugin to integrate WooCommerce with SASBoss API. Version: 0.7.1 Author: 13VoIP Pty Ltd License: Commercial License */ if (!defined("ABSPATH")) { exit(); } // Define plugin constants define("SASBOSS_PLUGIN_VERSION", "0.7.1"); define("SASBOSS_PLUGIN_DIR", plugin_dir_path(__FILE__)); define("SASBOSS_PLUGIN_URL", plugin_dir_url(__FILE__)); define("SASBOSS_REPO_URL", "https://dev.azure.com/13VoIP/43846730-84a7-443b-94f3-8867387f3829/_apis/git/repositories/5b1f7dc9-a01f-4ae7-b22c-974daeb973f0/items?path=/&resolveLfs=true&%24format=zip&api-version=5.0&download=true"); // URL to download updates function sasboss_plugin_init() { require_once SASBOSS_PLUGIN_DIR . "admin/class-sasboss-admin.php"; require_once SASBOSS_PLUGIN_DIR . "admin/class-sasboss-api.php"; } add_action("plugins_loaded", "sasboss_plugin_init"); // Add custom action links for settings and check for updates add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'sasboss_add_action_links'); function sasboss_add_action_links($links) { $settings_link = '' . __('Settings', 'sasboss') . ''; $update_link = '' . __('Check for Updates', 'sasboss') . ''; return array_merge($links, array($settings_link, $update_link)); } function sasboss_activate() { // Minimum version requirements $min_php = "7.2"; // Minimum version of PHP required for the plugin $min_wp = "5.0"; // Minimum version of WordPress required for the plugin // Check PHP Version if (version_compare(PHP_VERSION, $min_php, "<")) { deactivate_plugins(plugin_basename(__FILE__)); wp_die(__("This plugin requires PHP version $min_php or higher.", "sasboss"), "Plugin dependency check", [ "back_link" => true, ]); } // Check WordPress Version if (version_compare(get_bloginfo("version"), $min_wp, "<")) { deactivate_plugins(plugin_basename(__FILE__)); wp_die(__("This plugin requires WordPress version $min_wp or higher.", "sasboss"), "Plugin dependency check", [ "back_link" => true, ]); } // Include the plugin.php file for is_plugin_active() function availability include_once ABSPATH . "wp-admin/includes/plugin.php"; // Check if WooCommerce is active if (!is_plugin_active("woocommerce/woocommerce.php")) { deactivate_plugins(plugin_basename(__FILE__)); // Deactivate your plugin wp_die(__("This plugin requires WooCommerce to be active.", "sasboss"), "Plugin dependency check", [ "back_link" => true, ]); } // Create database tables sasboss_create_database_tables(); // Schedule a daily event to check for updates if (!wp_next_scheduled("sasboss_daily_update_check")) { wp_schedule_event(time(), "daily", "sasboss_daily_update_check"); } } register_activation_hook(__FILE__, "sasboss_activate"); // Hook for plugin deactivation register_deactivation_hook(__FILE__, "sasboss_deactivate"); function sasboss_deactivate() { // Clean up any options or transient data if needed sasboss_cleanup(); // Clear scheduled update checks wp_clear_scheduled_hook("sasboss_daily_update_check"); } // Create database tables function sasboss_create_database_tables() { global $wpdb; $settings_table = $wpdb->prefix . "sasboss_settings"; $enterprises_table = $wpdb->prefix . "sasboss_enterprises"; $dashboard_table = $wpdb->prefix . "sasboss_dashboard"; $billing_table = $wpdb->prefix . "sasboss_billing"; $services_table = $wpdb->prefix . "sasboss_services"; $dids_table = $wpdb->prefix . "sasboss_dids"; $sales_table = $wpdb->prefix . "sasboss_sales"; $charset_collate = $wpdb->get_charset_collate(); $sql_settings = "CREATE TABLE IF NOT EXISTS $settings_table ( id MEDIUMINT(9) NOT NULL AUTO_INCREMENT, api_url VARCHAR(255) DEFAULT '' NOT NULL, api_user VARCHAR(255) DEFAULT '' NOT NULL, api_password VARCHAR(255) DEFAULT '' NOT NULL, api_role VARCHAR(255) DEFAULT '' NOT NULL, reseller_id VARCHAR(255) DEFAULT '' NOT NULL, PRIMARY KEY (id) ) $charset_collate;"; $sql_enterprises = "CREATE TABLE IF NOT EXISTS $enterprises_table ( id MEDIUMINT(9) NOT NULL AUTO_INCREMENT, reseller_id VARCHAR(255) NOT NULL, enterprise_name VARCHAR(255) NOT NULL, enterprise_short_name VARCHAR(255) NOT NULL, default_domain VARCHAR(255) NOT NULL, imp_domain VARCHAR(255) NOT NULL, industry VARCHAR(255) NOT NULL, disable_retail_billing VARCHAR(5) NOT NULL, portal_password VARCHAR(255) NOT NULL, address TEXT NOT NULL, contact TEXT NOT NULL, PRIMARY KEY (id) ) $charset_collate;"; $sql_dashboard = "CREATE TABLE IF NOT EXISTS $dashboard_table ( id MEDIUMINT(9) NOT NULL AUTO_INCREMENT, data_key VARCHAR(255) NOT NULL, data_value LONGTEXT NOT NULL, PRIMARY KEY (id) ) $charset_collate;"; $sql_billing = "CREATE TABLE IF NOT EXISTS $billing_table ( id MEDIUMINT(9) NOT NULL AUTO_INCREMENT, enterprise_id MEDIUMINT(9) NOT NULL, invoice_id VARCHAR(255) NOT NULL, invoice_data LONGTEXT NOT NULL, PRIMARY KEY (id), FOREIGN KEY (enterprise_id) REFERENCES $enterprises_table(id) ON DELETE CASCADE ) $charset_collate;"; $sql_services = "CREATE TABLE IF NOT EXISTS $services_table ( id MEDIUMINT(9) NOT NULL AUTO_INCREMENT, service_name VARCHAR(255) NOT NULL, service_description TEXT NOT NULL, service_price DECIMAL(10, 2) NOT NULL, PRIMARY KEY (id) ) $charset_collate;"; $sql_dids = "CREATE TABLE IF NOT EXISTS $dids_table ( id MEDIUMINT(9) NOT NULL AUTO_INCREMENT, did_number VARCHAR(255) NOT NULL, did_description TEXT NOT NULL, PRIMARY KEY (id) ) $charset_collate;"; $sql_sales = "CREATE TABLE IF NOT EXISTS $sales_table ( id MEDIUMINT(9) NOT NULL AUTO_INCREMENT, sale_amount DECIMAL(10, 2) NOT NULL, sale_date DATETIME NOT NULL, enterprise_id MEDIUMINT(9) NOT NULL, PRIMARY KEY (id), FOREIGN KEY (enterprise_id) REFERENCES $enterprises_table(id) ON DELETE CASCADE ) $charset_collate;"; require_once ABSPATH . "wp-admin/includes/upgrade.php"; dbDelta($sql_settings); dbDelta($sql_enterprises); dbDelta($sql_dashboard); dbDelta($sql_billing); dbDelta($sql_services); dbDelta($sql_dids); dbDelta($sql_sales); // Insert default settings row if not exists $exists = $wpdb->get_var("SELECT COUNT(*) FROM $settings_table"); if ($exists == 0) { $wpdb->insert($settings_table, [ "api_url" => "", "api_user" => "", "api_password" => "", "api_role" => "", "reseller_id" => "", ]); } } // Clean up on deactivation function sasboss_cleanup() { global $wpdb; $table_name = $wpdb->prefix . "sasboss_settings"; if (get_option("sasboss_delete_data_on_deactivation") === "yes") { $wpdb->query("DROP TABLE IF EXISTS $table_name"); delete_option("sasboss_plugin_version"); delete_option("sasboss_delete_data_on_deactivation"); } } // Enqueue scripts and styles function sasboss_enqueue_admin_scripts($hook) { if (strpos($hook, "sasboss") === false) { return; } wp_enqueue_style("sasboss-admin-style", SASBOSS_PLUGIN_URL . "admin/css/admin-style.css"); wp_enqueue_script( "sasboss-admin-script", SASBOSS_PLUGIN_URL . "admin/js/admin-script.js", ["jquery"], SASBOSS_PLUGIN_VERSION, true ); } add_action("admin_enqueue_scripts", "sasboss_enqueue_admin_scripts"); // Check for updates function sasboss_check_for_updates() { $latest_version_info = sasboss_get_latest_version_info(); if (!$latest_version_info || is_wp_error($latest_version_info)) { return; } if (!isset($latest_version_info['version'])) { return; } $latest_version = $latest_version_info['version']; $zip_url = $latest_version_info['zip_url']; if (version_compare($latest_version, SASBOSS_PLUGIN_VERSION, ">")) { // Notify about the update $transient->response[plugin_basename(__FILE__)] = (object) [ 'new_version' => $latest_version, 'package' => $zip_url, 'slug' => plugin_basename(__FILE__), 'plugin' => plugin_basename(__FILE__), 'url' => SASBOSS_REPO_URL, ]; } } function sasboss_get_plugin_version() { $plugin_data = get_file_data(__FILE__, array('Version' => 'Version'), false); return $plugin_data['Version']; } function sasboss_get_latest_version_info() { // Azure DevOps API URL to get the VERSION file content $url = "https://dev.azure.com/13VoIP/43846730-84a7-443b-94f3-8867387f3829/_apis/git/repositories/5b1f7dc9-a01f-4ae7-b22c-974daeb973f0/items?path=/VERSION&api-version=5.0"; $response = wp_remote_get($url); if (is_wp_error($response)) { return [ 'success' => false, 'message' => $response->get_error_message(), 'zip_url' => '' ]; } $body = wp_remote_retrieve_body($response); $version = trim($body); if (empty($version)) { return [ 'success' => false, 'message' => __('Version file not found or empty.', 'sasboss'), 'zip_url' => '' ]; } $zip_url = SASBOSS_REPO_URL; return [ 'success' => true, 'message' => __('Latest version info retrieved successfully.', 'sasboss'), 'version' => $version, 'zip_url' => $zip_url ]; } // Download and install update function sasboss_download_and_install_update($version, $zip_url) { $zip_file = download_url($zip_url); if (is_wp_error($zip_file)) { return; } // Rename the zip file $new_zip_file = dirname($zip_file) . '/sasboss plugin.zip'; rename($zip_file, $new_zip_file); // Define a temporary directory to unzip the file $temp_dir = wp_tempnam() . '-sasboss-update'; if (!mkdir($temp_dir) && !is_dir($temp_dir)) { return; } // Unzip the file to the temporary directory $result = unzip_file($new_zip_file, $temp_dir); // Delete the zip file after extracting unlink($new_zip_file); if (is_wp_error($result)) { return; } // Identify the correct source directory $unzipped_files = scandir($temp_dir); $source = $temp_dir; // Check if there's only one subdirectory and use it as the source $sub_dirs = array_values(array_diff($unzipped_files, ['.', '..'])); if (count($sub_dirs) === 1 && is_dir($temp_dir . '/' . $sub_dirs[0])) { $source = $temp_dir . '/' . $sub_dirs[0]; } // Ensure the correct plugin directory name $destination = WP_PLUGIN_DIR . "/sasboss plugin"; rename($source, $destination); // Clean up the temporary directory sasboss_remove_dir($temp_dir); // Update the plugin version update_option("sasboss_plugin_version", $version); } // Helper function to remove directory recursively function sasboss_remove_dir($dir) { if (is_dir($dir)) { $objects = scandir($dir); foreach ($objects as $object) { if ($object != "." && $object != "..") { if (is_dir($dir . "/" . $object)) { sasboss_remove_dir($dir . "/" . $object); } else { unlink($dir . "/" . $object); } } } rmdir($dir); } } // Add manual update check to settings page add_action("admin_init", "sasboss_manual_check_for_updates"); function sasboss_manual_check_for_updates() { if (isset($_GET["check_for_updates"])) { $latest_version_info = sasboss_get_latest_version_info(); if (!$latest_version_info['success']) { $_SESSION['update_message'] = $latest_version_info['message']; $_SESSION['update_success'] = false; $_SESSION['zip_url'] = $latest_version_info['zip_url']; } else { $_SESSION['update_message'] = __('Update check completed successfully.', 'sasboss'); $_SESSION['update_success'] = true; $_SESSION['zip_url'] = $latest_version_info['zip_url']; } // Redirect to the appropriate page if (isset($_GET["page"]) && $_GET["page"] === "sasboss-settings") { wp_redirect(admin_url("admin.php?page=sasboss-settings&update_checked=1")); } else { wp_redirect(admin_url("plugins.php?plugin_status=all&update_checked=1")); } exit(); } } function sasboss_admin_hooks() { if (!current_user_can("manage_options")) { wp_die(__("You do not have sufficient permissions to access this page.", "sasboss")); } add_action("admin_menu", "sasboss_add_admin_menu"); } add_action("admin_init", "sasboss_admin_hooks"); function sasboss_add_admin_menu() { $admin = new SASBoss_Admin(); } function sasboss_display_warning_message() { echo '
'; echo '

' . __("Note: Data may be up to 10 minutes old. We are working towards realtime data feeds in later versions.", "sasboss") . '

'; echo '
'; } add_action('woocommerce_account_dashboard', 'sasboss_display_warning_message'); // Check for plugin updates and show message on plugins page add_filter('pre_set_site_transient_update_plugins', 'sasboss_check_for_plugin_updates'); function sasboss_check_for_plugin_updates($transient) { if (empty($transient->checked)) { return $transient; } // Get the plugin data $plugin_version = SASBOSS_PLUGIN_VERSION; // Check for updates $latest_version_info = sasboss_get_latest_version_info(); if (!$latest_version_info || is_wp_error($latest_version_info)) { return $transient; } $latest_version = $latest_version_info['version']; $zip_url = $latest_version_info['zip_url']; if (version_compare($plugin_version, $latest_version, '<')) { $plugin_slug = plugin_basename(__FILE__); $transient->response[$plugin_slug] = (object) [ 'slug' => $plugin_slug, 'new_version' => $latest_version, 'url' => SASBOSS_REPO_URL, 'package' => $zip_url, ]; } return $transient; } ?>
Warning: Cannot modify header information - headers already sent by (output started at /home/site/wwwroot/wp-content/plugins/sasboss plugin/sasboss.php:1) in /home/site/wwwroot/wp-content/plugins/wp-seopress/inc/functions/options-advanced.php on line 102

Warning: Cannot modify header information - headers already sent by (output started at /home/site/wwwroot/wp-content/plugins/sasboss plugin/sasboss.php:1) in /home/site/wwwroot/wp-content/plugins/wp-seopress/inc/functions/options-advanced.php on line 110

Deprecated: Creation of dynamic property RevsliderDiviModule::$icon_path is deprecated in /home/site/wwwroot/wp-content/themes/Divi/includes/builder/class-et-builder-element.php on line 1425
Revolutionize Your Business Communication with VoIP: Top Advantages You Shouldn't Miss | Cloud Business Phone System | 13VoIP

In the fast-paced world of business communication, a reliable, cost-effective, and versatile phone system is crucial. Voice over Internet Protocol (VoIP) has revolutionized how companies communicate, offering myriad benefits that traditional phone systems simply can’t match. In this blog post, we’ll discuss the top advantages of switching to a VoIP phone system for your business and why embracing the future of communication is time.

  1. Cost Savings

One of the most significant benefits of adopting a VoIP phone system is cost savings. Traditional phone systems often have high installation and maintenance fees, while VoIP services are typically more affordable. VoIP systems allow calls to be made over the internet, drastically reducing long-distance and international call charges. Additionally, many VoIP providers offer all-inclusive packages, making it easier for businesses to budget and manage their communication expenses.

  1. Flexibility and Scalability

VoIP systems are incredibly flexible, allowing businesses to adapt to their changing needs easily. Adding or removing lines and extensions is a simple process, making it easy to scale your phone system as your company grows. Furthermore, VoIP technology can be integrated with various devices such as smartphones, tablets, and laptops, allowing employees to stay connected anywhere.

  1. Enhanced Features

VoIP systems offer many advanced features that can improve your business’s communication and productivity. These features include call forwarding, call recording, voicemail-to-email, auto-attendant, and video conferencing. These features can enhance collaboration among team members and improve customer service, making your business more efficient and competitive.

  1. Improved Call Quality

Call quality is one of the main concerns businesses have when considering a switch to VoIP. However, VoIP technology has come a long way, and with a reliable internet connection, call quality is often better than traditional phone lines. High-definition voice and noise cancellation technologies make your calls crystal clear, reducing misunderstandings and miscommunications.

  1. Remote Work Capability

As the trend of remote work continues to grow, businesses must adapt their communication systems to accommodate a distributed workforce. VoIP systems provide the perfect solution, allowing employees to work from anywhere with an internet connection. With features like call forwarding and mobile app integration, remote workers can stay connected to the office and clients, ensuring seamless communication and collaboration.

  1. Enhanced Security

VoIP systems often have built-in security measures, such as encryption and authentication, to protect your business’s sensitive information. Additionally, since VoIP providers manage and maintain the system’s infrastructure, they ensure that security protocols are up-to-date, providing an extra layer of protection for your company’s data.

Conclusion:

Switching to a VoIP phone system can provide your business numerous benefits, from cost savings and flexibility to advanced features and improved call quality. By embracing VoIP technology, you’ll be equipping your business with a communication system that can adapt to your needs and support your growth, both now and in the future. Don’t let outdated phone systems hold your business back – switch to VoIP today and experience the difference for yourself.