Plugin Directory

Changeset 3235310


Ignore:
Timestamp:
02/05/2025 10:37:26 AM (14 months ago)
Author:
ctomczyk
Message:

Release 1.5.15

Location:
sitelint/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sitelint/trunk/README.txt

    r3229645 r3235310  
    44Requires at least: 4.7
    55Tested up to: 6.6.2
    6 Stable tag: 1.5.14
     6Stable tag: 1.5.15
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2929
    3030== Changelog ==
     31
     32= 1.5.15 =
     33
     34* Removing adding URL query parameter "sitelint" to the redirection while moving from admin to the public site
    3135
    3236= 1.5.14 =
  • sitelint/trunk/includes/sitelint-audits.php

    r3229645 r3235310  
    129129        SiteLint_Loader::add_action('admin_init', $plugin_admin, 'performAction');
    130130        SiteLint_Loader::add_action('in_admin_header', $plugin_admin, 'handleInAdminHeader');
    131        
     131
    132132        $plugin_admin->enqueue_styles();
    133133        $plugin_admin->enqueue_scripts();
     
    146146
    147147        SiteLint_Loader::add_action('wp_footer', $plugin_public, 'add_logo');
    148         SiteLint_Loader::add_action('template_redirect', $plugin_public, 'add_query_params_if_plugin_active');
    149148
    150149        $plugin_public->enqueue_styles();
  • sitelint/trunk/public/sitelint-public.php

    r3229645 r3235310  
    6868    public function enqueue_scripts()
    6969    {
     70      // Empty $sitelint['active'] means the user is not authenticated using the SiteLint account; not logged in
    7071      $sitelint = get_option('sitelint');
    7172
     
    7677      $isApiTokenAvailable = !empty($sitelint['apiToken']) && (is_string($sitelint['apiToken']) && $sitelint['apiToken'] !== 'null');
    7778      $auditorUrlParam = $isApiTokenAvailable ? "?tokenId=" . esc_html($sitelint['apiToken']) : "";
    78 
    79       if ($sitelint['active'] == false) {
    80         return;
    81       }
    8279
    8380      if (is_admin()) {
     
    131128      })(window, document, 'script');";
    132129
    133       wp_register_script($sitelintLoaderId, '');
    134       wp_enqueue_script($sitelintLoaderId);
    135       wp_add_inline_script($sitelintLoaderId, $sitelintLoader);
    136     }
    137 
    138     function add_query_params_if_plugin_active() {
    139 
    140       if(!is_user_logged_in()){
    141         return;
     130      function enqueue_sitelint_loader($sitelintLoaderId, $sitelintLoader) {
     131        wp_register_script($sitelintLoaderId, '');
     132        wp_enqueue_script($sitelintLoaderId);
     133        wp_add_inline_script($sitelintLoaderId, $sitelintLoader);
    142134      }
    143135
    144       $current_url = (is_ssl() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    145 
    146       $parsed_url = wp_parse_url($current_url);
    147       $query_params = [];
    148 
    149       if (isset($parsed_url['query'])) {
    150           parse_str($parsed_url['query'], $query_params);
    151       }
    152 
    153       if (!array_key_exists('sitelint', $query_params)) {
    154           $query_params['sitelint'] = '';
    155           $new_query_string = http_build_query($query_params);
    156           $new_url = $parsed_url['scheme'] . '://' . $parsed_url['host'] . (isset($parsed_url['port']) ? ':' . $parsed_url['port'] : '') . $parsed_url['path'] . '?' . $new_query_string;
    157 
    158           wp_redirect($new_url);
    159       }
     136      add_action('wp_enqueue_scripts', function() use ($sitelintLoaderId, $sitelintLoader) {
     137          enqueue_sitelint_loader($sitelintLoaderId, $sitelintLoader);
     138      });
    160139    }
    161140
  • sitelint/trunk/sitelint.php

    r3229645 r3235310  
    1010 * Plugin Name:       SiteLint
    1111 * Description:       SiteLint - official plugin. Accessibility, SEO, Performance, Security, Privacy, Technical issues in one place. Client-side & real-time checker.
    12  * Version:           1.5.14
     12 * Version:           1.5.15
    1313 * Author:            SiteLint
    1414 * Author URI:        https://www.sitelint.com
     
    2727 * Currently plugin version. Use SemVer - https://semver.org
    2828 */
    29 define('SITELINT_VERSION', '1.5.14');
     29define('SITELINT_VERSION', '1.5.15');
    3030
    3131/**
Note: See TracChangeset for help on using the changeset viewer.