Plugin Directory

Changeset 2673056


Ignore:
Timestamp:
02/04/2022 05:47:56 PM (4 years ago)
Author:
rexak
Message:

esc Woo settings page html

Location:
cardconnect-payment-module
Files:
1 deleted
3 edited
13 copied

Legend:

Unmodified
Added
Removed
  • cardconnect-payment-module/tags/3.4.11/cardconnect-payment-gateway.php

    r2672583 r2673056  
    3434    add_action('wp_ajax_admin_banned_cards', 'admin_banned_cards', 10);
    3535    add_action('admin_enqueue_scripts', 'cc_admin_page_scripts');
    36 
     36    add_filter( 'plugin_action_links_cardconnect-payment-module/cardconnect-payment-gateway.php', 'cc_settings_link' );
     37
     38    function cc_settings_link( $links ) {
     39        // Build and escape the URL.
     40        $url = esc_url( add_query_arg(
     41            'page',
     42            'wc-settings&tab=checkout&section=card_connect',
     43            get_admin_url() . 'admin.php'
     44        ) );
     45        // /wp-admin/admin.php?page=wc-settings&tab=checkout&section=card_connect
     46        // Create the link.
     47        $settings_link = "<a href='$url'>" . __( 'Settings' ) . '</a>';
     48        // Adds the link to the end of the array.
     49        array_push(
     50            $links,
     51            $settings_link
     52        );
     53        return $links;
     54    }
    3755    function cc_admin_page_scripts() {
    3856        wp_enqueue_script('woo-settings', plugins_url('javascript/setting.js', __FILE__), array('jquery'), '3.4.11', true);
  • cardconnect-payment-module/tags/3.4.11/classes/class-wc-gateway-cardconnect.php

    r2672583 r2673056  
    176176                WC()->session->set('cardPointe-hammer', $sessionHammer);
    177177                if ($sessionHammer['attempts'] >= 4) {
    178                     $validation_errors->add('validation', 'Too many failed attempts for this session.');
     178                    $validation_errors->add('validation', 'Too many attempts for this session.');
    179179                }
    180180                $session30minute = WC()->session->get('cardPointe-30minute');
     
    901901
    902902            if ($echo) {
    903                 echo $html;
     903                $allowed = $this->allowed_admin_panel_html();
     904                echo wp_kses($html, $allowed);
    904905            } else {
    905906                return $html;
     
    21282129        }
    21292130
     2131        private function allowed_admin_panel_html() {
     2132            return [
     2133                'p'        => [
     2134                    'class' => [],
     2135                ],
     2136                'strong'   => [
     2137                    'class' => [],
     2138                ],
     2139                'tr'       => [
     2140                    'valign' => []
     2141                ],
     2142                'span'     => [
     2143                    'class'    => [],
     2144                    'data-tip' => [],
     2145                ],
     2146                'th'       => [
     2147                    'scope' => [],
     2148                    'class' => [],
     2149                ],
     2150                'td'       => [
     2151                    'class' => [],
     2152                ],
     2153                'label'    => [
     2154                    'for'      => [],
     2155                    'class'    => [],
     2156                    'data-tip' => [],
     2157                ],
     2158                'fieldset' => [],
     2159                'legend'   => [
     2160                    'class' => [],
     2161                ],
     2162                'br'       => [],
     2163                'input'    => [
     2164                    'for'         => [],
     2165                    'class'       => [],
     2166                    'type'        => [],
     2167                    'name'        => [],
     2168                    'id'          => [],
     2169                    'style'       => [],
     2170                    'value'       => [],
     2171                    'checked'     => [],
     2172                    'placeholder' => [],
     2173                ],
     2174                'select'   => [
     2175                    'class'       => [],
     2176                    'type'        => [],
     2177                    'name'        => [],
     2178                    'multiple'    => [],
     2179                    'id'          => [],
     2180                    'style'       => [],
     2181                    'value'       => [],
     2182                    'checked'     => [],
     2183                    'placeholder' => [],
     2184                ],
     2185                'option'   => [
     2186                    'for'         => [],
     2187                    'selected'    => [],
     2188                    'class'       => [],
     2189                    'type'        => [],
     2190                    'name'        => [],
     2191                    'id'          => [],
     2192                    'style'       => [],
     2193                    'value'       => [],
     2194                    'checked'     => [],
     2195                    'placeholder' => [],
     2196                ],
     2197                'textarea' => [
     2198                    'rows'        => [],
     2199                    'cols'        => [],
     2200                    'class'       => [],
     2201                    'type'        => [],
     2202                    'name'        => [],
     2203                    'id'          => [],
     2204                    'style'       => [],
     2205                    'placeholder' => [],
     2206                ],
     2207                'h3'       => [
     2208                    'class' => [],
     2209                    'id'    => [],
     2210                    'style' => [],
     2211                ],
     2212            ];
     2213        }
    21302214    }
  • cardconnect-payment-module/tags/3.4.11/readme.txt

    r2672583 r2673056  
    134134= 3.4.11 =
    135135* deleted: cruft example files
     136* added: settings link on plugins list page
    136137* change: moved inline JQ to separate file
    137138
  • cardconnect-payment-module/trunk/cardconnect-payment-gateway.php

    r2672583 r2673056  
    3434    add_action('wp_ajax_admin_banned_cards', 'admin_banned_cards', 10);
    3535    add_action('admin_enqueue_scripts', 'cc_admin_page_scripts');
    36 
     36    add_filter( 'plugin_action_links_cardconnect-payment-module/cardconnect-payment-gateway.php', 'cc_settings_link' );
     37
     38    function cc_settings_link( $links ) {
     39        // Build and escape the URL.
     40        $url = esc_url( add_query_arg(
     41            'page',
     42            'wc-settings&tab=checkout&section=card_connect',
     43            get_admin_url() . 'admin.php'
     44        ) );
     45        // /wp-admin/admin.php?page=wc-settings&tab=checkout&section=card_connect
     46        // Create the link.
     47        $settings_link = "<a href='$url'>" . __( 'Settings' ) . '</a>';
     48        // Adds the link to the end of the array.
     49        array_push(
     50            $links,
     51            $settings_link
     52        );
     53        return $links;
     54    }
    3755    function cc_admin_page_scripts() {
    3856        wp_enqueue_script('woo-settings', plugins_url('javascript/setting.js', __FILE__), array('jquery'), '3.4.11', true);
  • cardconnect-payment-module/trunk/classes/class-wc-gateway-cardconnect.php

    r2672583 r2673056  
    176176                WC()->session->set('cardPointe-hammer', $sessionHammer);
    177177                if ($sessionHammer['attempts'] >= 4) {
    178                     $validation_errors->add('validation', 'Too many failed attempts for this session.');
     178                    $validation_errors->add('validation', 'Too many attempts for this session.');
    179179                }
    180180                $session30minute = WC()->session->get('cardPointe-30minute');
     
    901901
    902902            if ($echo) {
    903                 echo $html;
     903                $allowed = $this->allowed_admin_panel_html();
     904                echo wp_kses($html, $allowed);
    904905            } else {
    905906                return $html;
     
    21282129        }
    21292130
     2131        private function allowed_admin_panel_html() {
     2132            return [
     2133                'p'        => [
     2134                    'class' => [],
     2135                ],
     2136                'strong'   => [
     2137                    'class' => [],
     2138                ],
     2139                'tr'       => [
     2140                    'valign' => []
     2141                ],
     2142                'span'     => [
     2143                    'class'    => [],
     2144                    'data-tip' => [],
     2145                ],
     2146                'th'       => [
     2147                    'scope' => [],
     2148                    'class' => [],
     2149                ],
     2150                'td'       => [
     2151                    'class' => [],
     2152                ],
     2153                'label'    => [
     2154                    'for'      => [],
     2155                    'class'    => [],
     2156                    'data-tip' => [],
     2157                ],
     2158                'fieldset' => [],
     2159                'legend'   => [
     2160                    'class' => [],
     2161                ],
     2162                'br'       => [],
     2163                'input'    => [
     2164                    'for'         => [],
     2165                    'class'       => [],
     2166                    'type'        => [],
     2167                    'name'        => [],
     2168                    'id'          => [],
     2169                    'style'       => [],
     2170                    'value'       => [],
     2171                    'checked'     => [],
     2172                    'placeholder' => [],
     2173                ],
     2174                'select'   => [
     2175                    'class'       => [],
     2176                    'type'        => [],
     2177                    'name'        => [],
     2178                    'multiple'    => [],
     2179                    'id'          => [],
     2180                    'style'       => [],
     2181                    'value'       => [],
     2182                    'checked'     => [],
     2183                    'placeholder' => [],
     2184                ],
     2185                'option'   => [
     2186                    'for'         => [],
     2187                    'selected'    => [],
     2188                    'class'       => [],
     2189                    'type'        => [],
     2190                    'name'        => [],
     2191                    'id'          => [],
     2192                    'style'       => [],
     2193                    'value'       => [],
     2194                    'checked'     => [],
     2195                    'placeholder' => [],
     2196                ],
     2197                'textarea' => [
     2198                    'rows'        => [],
     2199                    'cols'        => [],
     2200                    'class'       => [],
     2201                    'type'        => [],
     2202                    'name'        => [],
     2203                    'id'          => [],
     2204                    'style'       => [],
     2205                    'placeholder' => [],
     2206                ],
     2207                'h3'       => [
     2208                    'class' => [],
     2209                    'id'    => [],
     2210                    'style' => [],
     2211                ],
     2212            ];
     2213        }
    21302214    }
  • cardconnect-payment-module/trunk/readme.txt

    r2672583 r2673056  
    134134= 3.4.11 =
    135135* deleted: cruft example files
     136* added: settings link on plugins list page
    136137* change: moved inline JQ to separate file
    137138
Note: See TracChangeset for help on using the changeset viewer.