The GDPR Framework By Data443 Shortcodes

Below, you’ll find a detailed guide on how to add the The GDPR Framework By Data443 Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the The GDPR Framework By Data443 Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the The GDPR Framework By Data443 Plugin and the shortcodes it provides:

Plugin Icon
The GDPR Framework By Data443

"The GDPR Framework By Data443 is a WordPress plugin designed to simplify GDPR compliance. It provides tools for data handling, privacy management, and user consent tracking."

★★★★☆ (65) Active Installs: 20000+ Tested with: 6.1.4 PHP Version: 5.6
Included Shortcodes:
  • [gdpr_privacy_safe]
  • [gdpr_privacy]
  • [gdpr_privacy_policy_url]
  • [gdpr_privacy_policy_link]
  • [gdpr_privacy_tools]
  • [gdpr_do_not_sell_form]

The GDPR Framework [gdpr_privacy_safe] Shortcode

The ‘gdpr_privacy_safe’ shortcode is designed to display the Data443 Privacy Safe seal on a webpage. It registers and enqueues a script that generates the seal based on specified parameters. If the ‘gdpr_privacy_safe_imagecode’ and ‘gdpr_privacy_safe_params’ options are set, it adds an image link to the seal. If the ‘gdpr_privacy_safe_backlink’ option is enabled, it also includes a backlink to Data443’s website.

Shortcode: [gdpr_privacy_safe]

Examples and Usage

Basic example – Displaying a privacy safe seal on your website

[gdpr_privacy_safe /]

This shortcode will display the privacy safe seal on your website. This is the most basic usage of the shortcode and it doesn’t require any parameters. The seal will be displayed according to the settings configured in the GDPR plugin settings.

Advanced examples

Displaying a privacy safe seal with custom image parameters and code

[gdpr_privacy_safe gdpr_imageparams="custom_params" gdpr_imagecode="custom_code" /]

In this example, the shortcode is used with two parameters: ‘gdpr_imageparams’ and ‘gdpr_imagecode’. These parameters allow you to customize the image parameters and code of the privacy safe seal. Replace ‘custom_params’ and ‘custom_code’ with your custom parameters and code.

Displaying a privacy safe seal with a backlink to Data443

[gdpr_privacy_safe gdpr_privacy_safe_backlink="1" /]

In this example, the shortcode is used with the ‘gdpr_privacy_safe_backlink’ parameter set to ‘1’. This will display the privacy safe seal along with a backlink to Data443. This is useful for promoting the privacy management service provided by Data443.

PHP Function Code

In case you have difficulties debugging what causing issues with [gdpr_privacy_safe] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'gdpr_privacy_safe', 'render_privacy_safe' ); // preserve backward compatibility

Shortcode PHP function:

function render_privacy_safe() {
    global $gdpr;
	wp_register_script( 'gdpr_whmcs_seal_generator', $gdpr->PluginUrl . 'assets/js/showseal.js', null, true, true );
	wp_localize_script(
		'gdpr_whmcs_seal_generator',
		'gdpr_seal_var',
		array(
			'gdpr_imageparams'   => esc_attr( get_option( 'gdpr_privacy_safe_params' ) ),
			'gdpr_imagecode'     => esc_attr( get_option( 'gdpr_privacy_safe_imagecode' ) ),
			'gdpr_showimagefunc' => 'showimage_' . esc_attr( get_option( 'gdpr_privacy_safe_imagecode' ) ),
		)
	);
	wp_enqueue_script( 'gdpr_whmcs_seal_generator', basename( dirname( __FILE__ ) ) . 'assets/js/showseal.js', null, true, true );

	$seal_code = '<div class="data443-privacy-safe" style="font-size:12px;text-align: left;">';

	if( get_option( 'gdpr_privacy_safe_imagecode' ) !== '' && get_option( 'gdpr_privacy_safe_params' ) !== '' ){
		$seal_code .= '<a href="javascript:;" onclick="openpopup_' . esc_attr( get_option( 'gdpr_privacy_safe_imagecode' ) ) . '();">
		<img id="data443-privacy-safe-image" src="https://orders.data443.com/seal/seal.php?params=' . esc_attr( get_option( 'gdpr_privacy_safe_params' ) ) . '" alt="Data443 Privacy Safe" />
		</a>';
	}
	if( get_option( 'gdpr_privacy_safe_backlink' ) === '1' ){
		$seal_code .= '<span style="display:block;">Privacy Management Service by <a href="https://data443.com/products/global-privacy-manager/" target="_blank">Data443</a></span>';
	}
	$seal_code .= '</div>';
	// scale the size of the link text based on the loaded scaled image
	$seal_code .= "<script>jQuery('#data443-privacy-safe-image').load(function(){var px='12px';var w=jQuery(this).width();if(w>0&&w<=150){px='6px'}else if(w<300){px='10px'};jQuery('.data443-privacy-safe').css({'font-size': px});})</script>";
	return $seal_code;
}

Code file location:

gdpr-framework/gdpr-framework/gdpr-framework.php

The GDPR Framework [gdpr_privacy] Shortcode

The GDPR Framework shortcode, ‘gdpr_privacy’, retrieves specific privacy-related information based on the ‘item’ attribute provided. It extracts data like company name, email, DPO details, and authority contact info.

Shortcode: [gdpr_privacy]

Parameters

Here is a list of all possible gdpr_privacy shortcode parameters and attributes:

  • company_name – Displays the company’s name set in GDPR options.
  • company_email – Shows the company’s email address from GDPR options.
  • company_email_link – Provides a clickable mailto link with the company’s email.
  • dpo_name – Returns the name of the Data Protection Officer.
  • dpo_email – Shows the email address of the Data Protection Officer.
  • dpo_email_link – Creates a mailto link for the Data Protection Officer’s email.
  • rep_name – Displays the representative’s contact name from GDPR settings.
  • rep_email – Shows the representative’s contact email from GDPR settings.
  • rep_email_link – Provides a clickable mailto link with the representative’s email.
  • authority_website – Displays the website of the data protection authority.
  • authority_email – Shows the email of the data protection authority.
  • authority_email_link – Creates a mailto link for the data protection authority’s email.
  • authority_phone – Returns the phone number of the data protection authority.

Examples and Usage

Basic example – Display the company name set in the GDPR settings.

[gdpr_privacy item="company_name" /]

Advanced examples

Display the company’s contact email with a clickable mailto link. This is helpful for users who want to contact your company directly from the website.

[gdpr_privacy item="company_email_link" /]

Display the Data Protection Officer’s name and email. This is useful for users who have specific GDPR-related questions or concerns.

[gdpr_privacy item="dpo_name" /] [gdpr_privacy item="dpo_email" /]

Display the representative’s name and their contact email with a clickable mailto link. This is useful for users who need to contact your company’s representative.

[gdpr_privacy item="rep_name" /] [gdpr_privacy item="rep_email_link" /]

Display the Data Protection Authority’s website, email, and phone number. This is useful for users who want to learn more about the GDPR or need to contact the authority.

[gdpr_privacy item="authority_website" /] [gdpr_privacy item="authority_email_link" /] [gdpr_privacy item="authority_phone" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [gdpr_privacy] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('gdpr_privacy', [$this, 'doShortcode']);

Shortcode PHP function:

function doShortcode($attributes)
    {
        global $gdpr;
        $attributes = shortcode_atts([
            'item' => null,
        ], $attributes);

        switch ($attributes['item']) {
            case 'company_name':
                return esc_html($gdpr->Options->get('company_name'));
            case 'company_email':
                return esc_html($gdpr->Options->get('contact_email'));
            case 'company_email_link':
                $email = antispambot($gdpr->Options->get('contact_email'));
                return "<a href='mailto:{$email}'>{$email}</a>";
            case 'dpo_name':
                return esc_html($gdpr->Options->get('dpo_name'));
            case 'dpo_email':
                return esc_html($gdpr->Options->get('dpo_email'));
            case 'dpo_email_link':
                $email = antispambot($gdpr->Options->get('dpo_email'));
                return "<a href='mailto:{$email}'>{$email}</a>";
            case 'rep_name':
                return esc_html($gdpr->Options->get('representative_contact_name'));
            case 'rep_email':
                return esc_html($gdpr->Options->get('representative_contact_email'));
            case 'rep_email_link':
                $email = antispambot($gdpr->Options->get('representative_contact_email'));
                return "<a href='mailto:{$email}'>{$email}</a>";
            case 'authority_website':
                return esc_html($gdpr->Options->get('dpa_website'));
            case 'authority_email':
                return esc_html($gdpr->Options->get('dpa_email'));
            case 'authority_email_link':
                $email = antispambot($gdpr->Options->get('dpa_email'));
                return "<a href='mailto:{$email}'>{$email}</a>";
            case 'authority_phone':
                return esc_html($gdpr->Options->get('dpa_phone'));
            case null:
                return '';
        }

        return '';
    }

Code file location:

gdpr-framework/gdpr-framework/src/Components/PrivacyPolicy/PrivacyPolicy.php

The GDPR Framework [gdpr_privacy_policy_url] Shortcode

The GDPR Framework plugin shortcode ‘gdpr_privacy_policy_url’ generates a URL that links to the privacy policy page on your website. This shortcode calls the ‘renderUrlShortcode’ function, which retrieves the privacy policy page URL from your site’s GDPR settings.

Shortcode: [gdpr_privacy_policy_url]

Examples and Usage

Basic example – A straightforward usage of the shortcode to display the URL of the privacy policy page.

[gdpr_privacy_policy_url /]

PHP Function Code

In case you have difficulties debugging what causing issues with [gdpr_privacy_policy_url] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('gdpr_privacy_policy_url', [$this, 'renderUrlShortcode']);

Shortcode PHP function:

function renderUrlShortcode()
    {
        global $gdpr;
        return gdpr('helpers')->getPrivacyPolicyPageUrl();
    }

Code file location:

gdpr-framework/gdpr-framework/src/Components/PrivacyPolicy/PrivacyPolicy.php

The GDPR Framework [gdpr_privacy_policy_link] Shortcode

The GDPR Framework shortcode is a nifty tool that generates a link to your privacy policy page. This shortcode uses the ‘renderLinkShortcode’ function to create a hyperlink. It first sets a default title for the link, ‘Privacy Policy’, which can be customized. It then fetches the URL of your privacy policy page using built-in helper functions. The output is a clickable link that directs the user to your privacy policy page.

Shortcode: [gdpr_privacy_policy_link]

Parameters

Here is a list of all possible gdpr_privacy_policy_link shortcode parameters and attributes:

  • title – Defines the text for the privacy policy link

Examples and Usage

Basic example – The shortcode displays a link to the Privacy Policy page with the default name as ‘Privacy Policy’.

[gdpr_privacy_policy_link /]

Advanced examples

Displaying a link to the Privacy Policy page with a custom title. The title attribute can be used to change the text of the link.

[gdpr_privacy_policy_link title='Our Privacy Commitment' /]

Using the shortcode with a custom title in a different language. This is useful for multilingual websites.

[gdpr_privacy_policy_link title='Politica de Privacidad' /]

Embedding the shortcode within a sentence to provide context. The link will be integrated seamlessly into your content.

Read our [gdpr_privacy_policy_link title='Privacy Policy'] to learn more about how we use your data.

Please note that the ‘title’ attribute in the shortcode is used to change the text of the link. As seen in the examples above, you can customize this text to suit the needs of your website.

PHP Function Code

In case you have difficulties debugging what causing issues with [gdpr_privacy_policy_link] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('gdpr_privacy_policy_link', [$this, 'renderLinkShortcode']);

Shortcode PHP function:

function renderLinkShortcode($attributes)
    {
        global $gdpr;
        $attributes = shortcode_atts([
            'title' => __('Privacy Policy', 'gdpr-framework'),
        ], $attributes);

        $url = gdpr('helpers')->getPrivacyPolicyPageUrl();

        return
            "<a href='{$url}'>" .
            esc_html($attributes['title']) .
            "</a>";
    }

Code file location:

gdpr-framework/gdpr-framework/src/Components/PrivacyPolicy/PrivacyPolicy.php

The GDPR Framework [gdpr_privacy_tools] Shortcode

The GDPR Framework shortcode, ‘gdpr_privacy_tools’, manages the visibility and functionality of the Privacy Tools page. It checks if the page is enabled in the settings. If not, a message displays indicating its disabled status. If the page isn’t properly configured, it prompts the admin to set it up. Once enabled and set up, it renders the Privacy Tools page.

Shortcode: [gdpr_privacy_tools]

Examples and Usage

Basic example – The shortcode below is a simple implementation of the GDPR Privacy Tools plugin. This displays the Privacy Tools page where users can manage their data.

[gdpr_privacy_tools]

PHP Function Code

In case you have difficulties debugging what causing issues with [gdpr_privacy_tools] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('gdpr_privacy_tools', [$this, 'renderPage']);

Shortcode PHP function:

function renderPage()
    {
        global $gdpr;
        if (!$gdpr->Options->get('enable')) {
            return __('This page is currently disabled.', 'gdpr-framework');
        }

        if ((!$gdpr->Options->get('tools_page') || is_null(get_post($gdpr->Options->get('tools_page')))) && !$gdpr->Options->get('custom_tools_page')) {
            return __('Please configure the Privacy Tools page in the admin interface.', 'gdpr-framework');
        }

        ob_start();
        $this->controller->render();
        return ob_get_clean();
    }

Code file location:

gdpr-framework/gdpr-framework/src/Components/PrivacyToolsPage/PrivacyToolsPageShortcode.php

The GDPR Framework By Data443 [gdpr_do_not_sell_form] Shortcode

The GDPR Framework shortcode, ‘gdpr_do_not_sell_form’, renders a ‘Do Not Sell’ form. It first checks if the GDPR is enabled and if a Privacy Tools page is set. If both conditions are met, it retrieves user details if logged in and displays the form.

Shortcode: [gdpr_do_not_sell_form]

Examples and Usage

Basic example – Utilizing the GDPR Do Not Sell Form shortcode without any specific parameters. This will display the default form provided by the plugin.

[gdpr_do_not_sell_form /]

PHP Function Code

In case you have difficulties debugging what causing issues with [gdpr_do_not_sell_form] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('gdpr_do_not_sell_form', [$this, 'renderDoNotSellForm']);

Shortcode PHP function:

function renderDoNotSellForm()
    {
        global $gdpr;
        if (!$gdpr->Options->get('enable')) {
            return __('This page is currently disabled.', 'gdpr-framework');
        }

        if (!$gdpr->Options->get('tools_page') || is_null(get_post($gdpr->Options->get('tools_page')))) {
            return __('Please configure the Privacy Tools page in the admin interface.', 'gdpr-framework');
        }
        $slug = 'do-not-sell-request';
        $defaultConsentTypes = $this->consentManager->getbySlugConsent($slug);
        $first_name = '';
        $last_name = '';
        $user_email = '';
        if (is_user_logged_in()) {
            // your code for logged in user 
            $current_user =  wp_get_current_user();
            $first_name   =  get_user_meta($current_user->ID, 'first_name', true);
            if ($first_name === '') {
                $first_name = $current_user->user_nicename;
            }
            $last_name    =  get_user_meta($current_user->ID, 'last_name', true);
            $user_email   =  $current_user->user_email;
        }
        ob_start();
        //$this->controller->render(); 
        //$this->controller->renderNoticesOnly();        
        echo gdpr('view')->render('privacy-tools/donotsell', compact('defaultConsentTypes', 'first_name', 'last_name', 'user_email'));
        return ob_get_clean();
    }

Code file location:

gdpr-framework/gdpr-framework/src/Components/PrivacyToolsPage/PrivacyToolsPageShortcode.php

Conclusion

Now that you’ve learned how to embed the The GDPR Framework By Data443 Plugin shortcodes, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *