Changeset 3235310
- Timestamp:
- 02/05/2025 10:37:26 AM (14 months ago)
- Location:
- sitelint/trunk
- Files:
-
- 4 edited
-
README.txt (modified) (2 diffs)
-
includes/sitelint-audits.php (modified) (2 diffs)
-
public/sitelint-public.php (modified) (3 diffs)
-
sitelint.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sitelint/trunk/README.txt
r3229645 r3235310 4 4 Requires at least: 4.7 5 5 Tested up to: 6.6.2 6 Stable tag: 1.5.1 46 Stable tag: 1.5.15 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 29 29 30 30 == 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 31 35 32 36 = 1.5.14 = -
sitelint/trunk/includes/sitelint-audits.php
r3229645 r3235310 129 129 SiteLint_Loader::add_action('admin_init', $plugin_admin, 'performAction'); 130 130 SiteLint_Loader::add_action('in_admin_header', $plugin_admin, 'handleInAdminHeader'); 131 131 132 132 $plugin_admin->enqueue_styles(); 133 133 $plugin_admin->enqueue_scripts(); … … 146 146 147 147 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');149 148 150 149 $plugin_public->enqueue_styles(); -
sitelint/trunk/public/sitelint-public.php
r3229645 r3235310 68 68 public function enqueue_scripts() 69 69 { 70 // Empty $sitelint['active'] means the user is not authenticated using the SiteLint account; not logged in 70 71 $sitelint = get_option('sitelint'); 71 72 … … 76 77 $isApiTokenAvailable = !empty($sitelint['apiToken']) && (is_string($sitelint['apiToken']) && $sitelint['apiToken'] !== 'null'); 77 78 $auditorUrlParam = $isApiTokenAvailable ? "?tokenId=" . esc_html($sitelint['apiToken']) : ""; 78 79 if ($sitelint['active'] == false) {80 return;81 }82 79 83 80 if (is_admin()) { … … 131 128 })(window, document, 'script');"; 132 129 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); 142 134 } 143 135 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 }); 160 139 } 161 140 -
sitelint/trunk/sitelint.php
r3229645 r3235310 10 10 * Plugin Name: SiteLint 11 11 * Description: SiteLint - official plugin. Accessibility, SEO, Performance, Security, Privacy, Technical issues in one place. Client-side & real-time checker. 12 * Version: 1.5.1 412 * Version: 1.5.15 13 13 * Author: SiteLint 14 14 * Author URI: https://www.sitelint.com … … 27 27 * Currently plugin version. Use SemVer - https://semver.org 28 28 */ 29 define('SITELINT_VERSION', '1.5.1 4');29 define('SITELINT_VERSION', '1.5.15'); 30 30 31 31 /**
Note: See TracChangeset
for help on using the changeset viewer.