Plugin Directory

Changeset 3145910


Ignore:
Timestamp:
09/03/2024 11:47:24 AM (17 months ago)
Author:
Tussendoor
Message:

##### 5.1.0

  • Fixed: An instance where jQuery was not triggered because it was loaded before DOM ready.
  • Fixed: An jQuery issue where some CF7 requests where not working.
  • Fixed: An issue where some CF7 forms had no ID in the HTML.
  • Added: The option to manually get a new API token from Tussendoor if no data is returned.
Location:
open-rdw-kenteken-voertuiginformatie/trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • open-rdw-kenteken-voertuiginformatie/trunk/admin/js/open-rdw-kenteken-voertuiginformatie-admin.js

    r3145292 r3145910  
    22    'use strict';
    33
    4     $(window).on('load', function(){
     4    document.addEventListener('DOMContentLoaded', function () {
    55
    66        /**
  • open-rdw-kenteken-voertuiginformatie/trunk/admin/logs/log.txt

    r3145292 r3145910  
    992024-08-27 12:20:34 - Open RDW PRO activation..
    10102024-08-27 12:20:34 - Open RDW PRO activated.
     112024-09-02 14:23:35 - Deactivating Open RDW PRO. Byebye!
     122024-09-02 14:25:19 - Open RDW PRO activation..
     132024-09-02 14:25:19 - Open RDW PRO activated.
  • open-rdw-kenteken-voertuiginformatie/trunk/admin/partials/TinyMceDisplay.php

    r3139133 r3145910  
    1818    public function render()
    1919    {
    20         ?>
    21             <div id="rdw-thickbox" class="rdw-popup" style="display: none;">
    22                 <div class="rdw-thickbox-content">
    23                     <div id="rdw-thickbox-header">
    24                         <h3><?php echo __('Select which fields you would like to display:', 'tussendoor-rdw') ?></h3>
    25                     </div>
    26                     <div id="rdw-thickbox-content">
    27                         <div class="rdw-sort-fields rdw-expand-fields">
    28                             <ul>
    29                                 <?php $this->render_fields(); ?>
    30                             </ul>
    31                         </div>
    32                     </div>
    33                     <div id="rdw-thickbox-footer">
    34                         <p>
    35                             <input type="button" value="<?php echo __('Cancel', 'tussendoor-rdw') ?>" class="button" onclick="tb_remove();">
    36                             <input type="button" value="<?php echo __('Add shortcode', 'tussendoor-rdw') ?>" class="button button-primary" id="rdw-thickbox-submit">
    37                         </p>
     20?>
     21        <div id="rdw-thickbox" class="rdw-popup" style="display: none;">
     22            <div class="rdw-thickbox-content">
     23                <div id="rdw-thickbox-header">
     24                    <h3><?php echo __('Select which fields you would like to display:', 'tussendoor-rdw') ?></h3>
     25                </div>
     26                <div id="rdw-thickbox-content">
     27                    <div class="rdw-sort-fields rdw-expand-fields">
     28                        <ul>
     29                            <?php $this->render_fields(); ?>
     30                        </ul>
    3831                    </div>
    3932                </div>
     33                <div id="rdw-thickbox-footer">
     34                    <p>
     35                        <input type="button" value="<?php echo __('Cancel', 'tussendoor-rdw') ?>" class="button" onclick="tb_remove();">
     36                        <input type="button" value="<?php echo __('Add shortcode', 'tussendoor-rdw') ?>" class="button button-primary" id="rdw-thickbox-submit">
     37                    </p>
     38                </div>
    4039            </div>
    41             <script type="text/javascript">
     40        </div>
     41        <script type="text/javascript">
     42            if (typeof jQuery != 'undefined') {
    4243                jQuery(document).ready(function() {
    4344                    jQuery('.rdw-sort-fields ul').sortable();
    4445                });
    45             </script>
    46         <?php
     46            }
     47        </script>
     48<?php
    4749    }
    4850
  • open-rdw-kenteken-voertuiginformatie/trunk/app/Concerns/HasActions.php

    r3138718 r3145910  
    7676
    7777    /**
     78     * The action associated with registering the plugin
     79     *
     80     * @var string
     81     */
     82    public static $refreshTokenAction = 'tsd_rdw_refresh_api_token_action';
     83
     84    /**
    7885     * The action associated with downloading a shipping label
    7986     *
  • open-rdw-kenteken-voertuiginformatie/trunk/app/Http/Controllers/SettingsController.php

    r3145292 r3145910  
    2727        add_action('wp_ajax_' . self::$settingsSave, [$this, 'saveSettings']);
    2828        add_action('wp_ajax_' . self::$registerPlugin, [$this, 'registerPlugin']);
     29        add_action('wp_ajax_' . self::$refreshTokenAction, [$this, 'refreshTokenAction']);
    2930    }
    3031
     
    4445            'Settings',
    4546            array(
    46                 'plugin_tag'        => MainConfig::get('plugin.tag'),
    47                 'ajaxurl'           => admin_url('admin-ajax.php'),
    48                 'save_action'       => self::$settingsSave,
    49                 'save_orders'       => self::$orderSettingsSave,
    50                 'save_returns'      => self::$returnSettingsSave,
    51                 'register_action'   => self::$registerPlugin,
    52                 'saveFailText'      => esc_html__('Opslaan van de instellingen mislukt! Neem contact op met Tussendoor B.V. wanneer de fout zich voor blijft doen.', 'tussendoor-rdw'),
    53                 'saveText'          => esc_html__('Instellingen opgeslagen!', 'tussendoor-rdw'),
     47                'plugin_tag'                    => MainConfig::get('plugin.tag'),
     48                'ajaxurl'                       => admin_url('admin-ajax.php'),
     49                'save_action'                   => self::$settingsSave,
     50                'save_orders'                   => self::$orderSettingsSave,
     51                'save_returns'                  => self::$returnSettingsSave,
     52                'register_action'               => self::$registerPlugin,
     53                'refresh_api_token_action'      => self::$refreshTokenAction,
     54                'saveFailText'                  => esc_html__('Opslaan van de instellingen mislukt! Neem contact op met Tussendoor B.V. wanneer de fout zich voor blijft doen.', 'tussendoor-rdw'),
     55                'saveText'                      => esc_html__('Instellingen opgeslagen!', 'tussendoor-rdw'),
    5456            )
    5557        );
     
    150152
    151153    /**
     154     * Register the plugin when the license is valid
     155     */
     156    public function refreshTokenAction()
     157    {
     158        $request = Request::fromGlobal();
     159
     160        add_filter('https_ssl_verify', '__return_false');
     161
     162        $api = new Api;
     163        $api->getTussendoorToken(true);
     164        return wp_send_json_success('De Tussendoor API Token is opnieuw aangevraagd.');
     165
     166    }
     167
     168    /**
    152169     * Remove old settings that are no longer used
    153170     *
  • open-rdw-kenteken-voertuiginformatie/trunk/app/Services/ContactForm7.php

    r3138718 r3145910  
    7171        }
    7272
    73         $atts['class']  = $tag->get_class_option(!empty($class) ? $class : null).' open-data-rdw';
    74 
     73        $atts['class']  = $tag->get_class_option(!empty($class) ? $class : null) . ' open-data-rdw-hook';
     74        $atts['id']     = 'open-data-rdw';
    7575
    7676        $value = (string) reset($tag->values);
    77         $value = $tag->get_default_option($value);
    7877
    7978        if ($tag->has_option('placeholder') || $tag->has_option('watermark')) {
     
    8281        }
    8382
    84         $atts['id']         = $tag->name;
    8583        $atts['value']      = $value;
    8684        $atts['type']       = 'text';
  • open-rdw-kenteken-voertuiginformatie/trunk/assets/admin/js/settings.js

    r3138718 r3145910  
    279279            url: Settings.ajaxurl,
    280280            data: {
    281                 action: Settings.register_action,
    282                 license: $button.parents('#register').find('#license_code').val(),
     281                action: Settings.refresh_api_token_action,
    283282            },
    284283            type: 'POST',
     
    289288            },
    290289        })
    291             .then(function (response) {
    292 
    293                 $button.removeClass('btn-primary').addClass('btn-success');
    294                 new Alert(response.data, 'success');
    295 
    296                 setTimeout(function () {
    297                     $('#register').modal('toggle');
    298                 }, 1000);
    299 
    300             })
    301             .fail(function (jqXHR, textStatus) {
    302 
    303                 $button.removeClass('btn-primary').addClass('btn-warning');
    304                 new Alert(jqXHR.responseJSON.data, 'danger', 'manual');
    305 
    306             })
    307             .always(function () {
    308                 $button.find('i').removeClass('fa-spinner fa-spin').addClass('fa-save');
    309 
    310                 setTimeout(function () {
    311                     $button.prop('disabled', false);
    312                     $button.removeClass('btn-success btn-warning').addClass('btn-primary');
    313                 }, 2000);
    314             });
     290        .then(function (response) {
     291
     292            $button.removeClass('btn-primary').addClass('btn-success');
     293            new Alert(response.data, 'success');
     294        })
     295        .fail(function (jqXHR) {
     296
     297            $button.removeClass('btn-primary').addClass('btn-warning');
     298            new Alert(jqXHR.responseJSON.data, 'danger', 'manual');
     299
     300        })
     301        .always(function () {
     302            $button.find('i').removeClass('fa-spinner fa-spin').addClass('fa-save');
     303
     304            setTimeout(function () {
     305                $button.prop('disabled', false);
     306                $button.removeClass('btn-success btn-warning').addClass('btn-primary');
     307            }, 2000);
     308        });
    315309    }
    316310
  • open-rdw-kenteken-voertuiginformatie/trunk/config/plugin.php

    r3145385 r3145910  
    2727        'log_source'            => 'tussendoor-rdw',
    2828        'log_context'           => 'tsdRdwContext',
    29         'version'               => '5.0.5.1',
     29        'version'               => '5.1.0',
    3030        'php_minimum'           => '8.0',
    3131        'php_minimum_id'        => 80000,
     
    5454        'textversion'           => '2.0.0',
    5555        'version'               => 'v2',
    56         'url'                   => 'https://tussendoor.test',
     56        'url'                   => 'https://tussendoor.nl',
    5757        'timezone'              => 'Europe/Amsterdam',
    5858        'endpoints' => [
  • open-rdw-kenteken-voertuiginformatie/trunk/plugin-gratis-open-rdw-kenteken-voertuiginformatie.php

    r3145385 r3145910  
    1212 * Author URI: https://www.tussendoor.nl
    1313 * Text Domain: tussendoor-rdw
    14  * Version: 5.0.5.1
     14 * Version: 5.1.0
    1515 * Tested up to: 6.6.1
    1616 * Requires at least: 6.2
     
    2828define('ORK_PLUGIN_PATH', plugins_url('tussendoor-rdw'));
    2929define('ORK_PLUGIN', __DIR__);
    30 define('ORK_VERSION', '5.0.5.1');
     30define('ORK_VERSION', '5.1.0');
    3131
    3232/**
  • open-rdw-kenteken-voertuiginformatie/trunk/public/PublicDashboard.php

    r3138718 r3145910  
    4444    public function ajax_check()
    4545    {
    46 
    4746        $data = array('errors' => true);
    4847
  • open-rdw-kenteken-voertuiginformatie/trunk/public/js/open-rdw-kenteken-voertuiginformatie-public.js

    r3138718 r3145910  
    22    'use strict';
    33
    4     $(document).on('ready', function () {
     4    document.addEventListener('DOMContentLoaded', function () {
    55
    66        /**
     
    5353         * This code is responsible for contact form 7 support and makes an ajax call to our plugin.
    5454         */
    55         $(document).on('change', '.open-data-rdw', function() {
     55        $(document).on('change', '#open-data-rdw', function () {
    5656            var formID = $(this).closest('form').attr('id');
    5757            if (formID == undefined) {
     
    6262            }
    6363
    64             $('#'+formID+' #open_rdw-loading').show();
    65             $('#'+formID+' #open_rdw-error').hide();
    66             $('#'+formID+' #open_rdw-accepted').hide();
     64            $('#' + formID + ' #open_rdw-loading').show();
     65            $('#' + formID + ' #open_rdw-error').hide();
     66            $('#' + formID + ' #open_rdw-accepted').hide();
    6767
    6868            var kenteken = normalizeLicense($(this).val());
    69             var data = {action: 'get_open_rdw_data', kenteken: kenteken};
     69            var data = { action: 'get_open_rdw_data', kenteken: kenteken };
    7070
    7171            $(document).trigger('openrdw:before_data_load', kenteken);
    7272
    73             $.post(ajax.ajax_url, data, function(res) {
     73            $.post(ajax.ajax_url, data, function (res) {
    7474
    7575                $('#open_rdw-loading').hide();
    7676                if (res.errors) {
    77                     $('#'+formID+' #open_rdw-error').show();
     77                    $('#' + formID + ' #open_rdw-error').show();
    7878                } else {
    79                     $('#'+formID+' #open_rdw-accepted').show();
     79                    $('#' + formID + ' #open_rdw-accepted').show();
    8080                }
    8181
    82                 $.each(res.result, function(name, value) {
     82                $.each(res.result, function (name, value) {
    8383                    if (name !== 'kenteken') {
    84                         $('#'+formID+' input[name="' + name + '"]').val(value).trigger('change');
     84                        $('#' + formID + ' input[name="' + name + '"]').val(value);
    8585                    }
    8686                });
  • open-rdw-kenteken-voertuiginformatie/trunk/readme.txt

    r3145385 r3145910  
    22Contributors: Tussendoor
    33Tags: tussendoor, rdw, kenteken, voertuig, kentekeninformatie
    4 Stable tag: 5.0.5.1
     4Stable tag: 5.1.0
    55Tested up to: 6.6.1
    66Requires at least: 6.2
     
    4545### Changelog
    4646
     47##### 5.1.0
     48* Fixed:  An instance where jQuery was not triggered because it was loaded before DOM ready.
     49* Fixed:  An jQuery issue where some CF7 requests where not working.
     50* Fixed:  An issue where some CF7 forms had no ID in the HTML.
     51* Added:  The option to manually get a new API token from Tussendoor if no data is returned.
     52
    4753##### 5.0.5.1
    4854* Hotfix:  Better JS checking to prevent errors.
     
    5157* Fixed: Check whether dateTime is compatible with Carbon Parse.
    5258* Removed: Older styles where enqueued.
    53 * Update: Stats now use v2 enpoints.
    54 * Update: Stability improvements on activating plugin with license.
    55 * Update: Stability improvements in JavaScript.
    56 * Update: Readme.md.
     59* Updated: Stats now use v2 enpoints.
     60* Updated: Stability improvements on activating plugin with license.
     61* Updated: Stability improvements in JavaScript.
     62* Updated: Readme.md.
    5763
    5864##### 5.0.4.8
  • open-rdw-kenteken-voertuiginformatie/trunk/views/dashboard/dashboard.info.php

    r3138718 r3145910  
    2727        </div>
    2828
    29         <?php
    30         /**
    31          * Action hook to add content before the version input
    32          */
    33         do_action('tussendoor_bol_before_main_version_input'); ?>
    34 
    3529        <div class="input-group mb-3 align-items-center flex-nowrap">
    3630            <div class="input-group-prepend">
     
    4135            <p id="version" class="mb-0 ms-2">
    4236                <?php
    43                     echo esc_html(MainConfig::get('plugin.version'));
    44                     if (MainConfig::get('plugin.is_beta')) {
    45                     ?>
    46                         <div class="badge text-bg-warning rounded-pill fw-light ms-2">Beta</div>
    47                     <?php
    48                     }
     37                echo esc_html(MainConfig::get('plugin.version'));
     38                if (MainConfig::get('plugin.is_beta')) {
    4939                ?>
    50             </p>
     40            <div class="badge text-bg-warning rounded-pill fw-light ms-2">Beta</div>
     41        <?php
     42                }
     43        ?>
     44        </p>
    5145        </div>
    5246        <div class="input-group mb-3 align-items-center flex-nowrap">
     
    108102        do_action('tussendoor_bol_after_main_license_input'); ?>
    109103    </div>
     104
     105    <div id="auth" class="mt-5">
     106        <div class="tab-title mb-3">
     107            <h3><?php esc_html_e('Authenticatie', 'tussendoor-rdw'); ?></h3>
     108        </div>
     109
     110        <div class="input-group mb-3 align-items-center flex-nowrap">
     111            <div class="input-group-prepend">
     112                <label class="input-group-text w-100 fw-light border-0 custom-bg-light" for="license">
     113                    <?php esc_html_e('Tussendoor API Token', 'tussendoor-rdw'); ?>
     114                    <small>
     115                        <i class="fa fa-info-circle ms-2 text-info" data-bs-toggle="tooltip" data-bs-custom-class="tussendoor-tooltip tussendoor-info" title="<?php esc_attr_e('Indien het ophalen van kentekens niet werkt kun je dit proberen. Anders neem contact op met Tussendoor B.V.', 'tussendoor-rdw'); ?>"></i>
     116                    </small>
     117                </label>
     118            </div>
     119            <p id="license" class="mb-0 ms-2">
     120                <span type="button" class="btn btn-sm btn-primary js--refresh-api-token"><i class="me-1 fa-solid fa-rotate"></i> <?php esc_html_e('Vernieuwen', 'tussendoor-rdw'); ?></span>
     121            </p>
     122        </div>
     123    </div>
    110124</div>
    111125
Note: See TracChangeset for help on using the changeset viewer.