*/ class Chart_Builder_Integrations { /** * The ID of this plugin. * * @since 1.0.0 * @access private * @var string $plugin_name The ID of this plugin. */ private $plugin_name; /** * The version of this plugin. * * @since 1.0.0 * @access private * @var string $version The current version of this plugin. */ private $version; private $settings_obj; private $capability; private $blockquote_content; /** * Initialize the class and set its properties. * * @since 1.0.0 * @param string $plugin_name The name of this plugin. * @param string $version The version of this plugin. */ public function __construct($plugin_name, $version){ $this->plugin_name = $plugin_name; $this->version = $version; $this->settings_obj = new Chart_Builder_Settings_DB_Actions($this->plugin_name); $settings_url = sprintf( __( "For enabling this option, please go to %s page and fill all options.", $this->plugin_name ), "". __( "this", $this->plugin_name ) ."" ); $blockquote_content = '
'; $this->blockquote_content = $blockquote_content; } // ===== INTEGRATIONS HOOKS ===== public function ays_chart_page_integrations_content( $args ){ if( ! $this->settings_obj->get_permission_for_editing_plugin() ){ $settings_url = __( "This functionality is disabled.", $this->plugin_name ); $blockquote_content = ''; $this->blockquote_content = $blockquote_content; } $integrations_contents = apply_filters( 'ays_cb_chart_page_integrations_contents', array(), $args ); $integrations = array(); foreach ($integrations_contents as $key => $integrations_content) { $content = ''; $integrations[] = $content; } echo implode('1. '. __("Turn on Your Google Sheet API", $this->plugin_name) .' https://console.developers.google.com
2. '. __("Create ", $this->plugin_name) .''. __("new Google Oauth client ID credentials (if you do not still have)", $this->plugin_name).'
3. '. __("Choose the application type as Web application", $this->plugin_name) .'
4. '. __("Add the following link in the Authorized redirect URIs field", $this->plugin_name) .'
Redirect url
5. '. __("Click on the Create button", $this->plugin_name) .'
6. '. __("Copy the Your Client ID and Your Client Secret from the opened popup and paste them in the corresponding fields.", $this->plugin_name) .'
7. '. __("Click on the Connect button to complete authorization", $this->plugin_name) .'
' . __("IP Access:", $this->plugin_name) . '
'. __("In some cases, your database may block connections from unknown IP addresses. You might need to whitelist your IP in the database settings to allow access.", $this->plugin_name) .'
' . __("Database Host:", $this->plugin_name) . ' ' . __("Enter the address of your database (e.g., 'localhost', or a host like 'db.example.com').", $this->plugin_name) . '
' . __("Database Name:", $this->plugin_name) . ' ' . __("Enter the name of the database you want to connect to.", $this->plugin_name) . '
' . __("Database User:", $this->plugin_name) . ' ' . __("Enter the username for accessing the database.", $this->plugin_name) . '
' . __("Database Password:", $this->plugin_name) . ' ' . __("Enter the password for your database user. Make sure this is correct.", $this->plugin_name) . '
' . __("Database Port (Optional):", $this->plugin_name) . ' ' . __("The default MySQL port is '3306'. You can leave this field empty. If your host doesn't specify a port, we'll use the default value.", $this->plugin_name) . '
' . __("Test Connection:", $this->plugin_name) . ' ' . __("Click on the 'Test Connection' button to verify that the connection is successful.", $this->plugin_name) . '
' . __("If the test fails:", $this->plugin_name) . ' ' . __("Please recheck your details or verify if your IP address is whitelisted.", $this->plugin_name) . '