<commit_before><?php
   /*
   Description: Setup the P4M shortcodes

                [p4m-login]
                [p4m-signup]
                [p4m-checkout-redirect]       : put this in the standard checkout page
                [p4m-checkout]                : make a new page with this on it, the standard page will redirect to it if p4m logged on 
                [p4m-payment-complete]
                
   Version: 0.0.1
   Author: ParcelForMe
   Author URI: http://parcelfor.me/
   License: MIT
   */


class Parcel4me_Shortcodes {
 
  public function __construct() {

    function base_uri() {
      return plugins_url() . '/parcel4me/lib/';
    }


    function add_all_scripts() {
      // scripts required for all components
      wp_enqueue_script( 'webcomponentsjs', base_uri() . 'webcomponentsjs/webcomponents.min.js' );
    }
    add_action( 'wp_enqueue_scripts', 'add_all_scripts' );



    // [p4m-login]
    function p4m_login_func( $atts ){
      echo '<link rel="import" href="' . base_uri() . 'p4m-widgets/p4m-login/p4m-login.html" />';
      echo '<p4m-login id-srv-url="' . P4M\Settings::getPublic('Server:P4M_OID_SERVER') . '" 
                       client-id="' . P4M\Settings::getPublic('OpenIdConnect:ClientId') . '" 
                       redirect-url="' . P4M\Settings::getPublic('OpenIdConnect:RedirectUrl') . '" 
                       logout-form="logoutForm"> 
            </p4m-login>';
    }
    add_shortcode( 'p4m-login', 'p4m_login_func' );


    // [p4m-signup]
    function p4m_signup_func( $atts ) {
      echo '<link rel="import" href="' . base_uri() . 'p4m-widgets/p4m-register/p4m-register.html" />';
      echo '<p4m-register></p4m-register>';
    }
    add_shortcode( 'p4m-signup', 'p4m_signup_func' );


    // [p4m-checkout-redirect]<commit_msg>implement the logout of p4m to do a local logout too<commit_after><?php
   /*
   Description: Setup the P4M shortcodes

                [p4m-login]
                [p4m-signup]
                [p4m-checkout-redirect]       : put this in the standard checkout page
                [p4m-checkout]                : make a new page with this on it, the standard page will redirect to it if p4m logged on 
                [p4m-payment-complete]
                
   Version: 0.0.1
   Author: ParcelForMe
   Author URI: http://parcelfor.me/
   License: MIT
   */


class Parcel4me_Shortcodes {
 
  public function __construct() {

    function base_uri() {
      return plugins_url() . '/parcel4me/lib/';
    }


    function add_all_scripts() {
      // scripts required for all components
      wp_enqueue_script( 'webcomponentsjs', base_uri() . 'webcomponentsjs/webcomponents.min.js' );
    }
    add_action( 'wp_enqueue_scripts', 'add_all_scripts' );



    // [p4m-login]
    function p4m_login_func( $atts ){
      echo '<form style="display:none" action="/my-account/customer-logout" id="p4m_special_hidden_logout_form_hack"></form>';
      echo '<link rel="import" href="' . base_uri() . 'p4m-widgets/p4m-login/p4m-login.html" />';
      echo '<p4m-login id-srv-url="' . P4M\Settings::getPublic('Server:P4M_OID_SERVER') . '" 
                       client-id="' . P4M\Settings::getPublic('OpenIdConnect:ClientId') . '" 
                       redirect-url="' . P4M\Settings::getPublic('OpenIdConnect:RedirectUrl') . '" 
                       logout-form="p4m_special_hidden_logout_form_hack"> 
            </p4m-login>';
    }
    add_shortcode( 'p4m-login', 'p4m_login_func' );


    // [p4m-signup]
    function p4m_signup_func( $atts ) {
      echo '<link rel="import" href="' . base_uri() . 'p4m-widgets/p4m-register/p4m-register.html" />';
      echo '<p4m-register></p4m-register>';
    }
    add_shortcode( 'p4m-signup', 'p4m_signup_func' );


    // [p4m-checkout-redirect]
{'fraction_non_alphanumeric': 0.13880794701986754, 'fraction_numerical': 0.01933774834437086, 'mean_word_length': 2.274934952298352, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6802437', 'n_tokens_mistral': 1334, 'n_tokens_neox': 1260, 'n_words': 232}