Plugin Directory

Changeset 3244381


Ignore:
Timestamp:
02/21/2025 10:05:28 AM (13 months ago)
Author:
ctomczyk
Message:

Release 1.5.16

Location:
sitelint/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • sitelint/trunk/README.txt

    r3235310 r3244381  
    44Requires at least: 4.7
    55Tested up to: 6.6.2
    6 Stable tag: 1.5.15
     6Stable tag: 1.5.16
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2929
    3030== Changelog ==
     31
     32= 1.5.16 =
     33
     34* Enqueuing the SiteLint loader through the wp_loaded hook and creating the script file.
    3135
    3236= 1.5.15 =
  • sitelint/trunk/includes/sitelint-audits-deactivator.php

    r3223115 r3244381  
    1515    public static function deactivate() {
    1616    SiteLint_Loader::remove_all_filters_and_actions();
     17    SiteLint_Loader::remove_js_loader();
    1718    }
    1819
  • sitelint/trunk/includes/sitelint-audits-loader.php

    r3223115 r3244381  
    120120    }
    121121
     122  public static function remove_js_loader() {
     123    $plugin_path = plugin_dir_path(__FILE__);
     124    $js_loader_path = $plugin_path . '../public/scripts/loader.js';
     125
     126    if (file_exists($js_loader_path)) {
     127        try {
     128            unlink($js_loader_path);
     129        } catch (Exception $e) {
     130          error_log('An error occurred while trying to remove SiteLint loader.js: ' . $e->getMessage());
     131        }
     132    }
     133  }
    122134}
  • sitelint/trunk/includes/sitelint-audits.php

    r3235310 r3244381  
    146146
    147147        SiteLint_Loader::add_action('wp_footer', $plugin_public, 'add_logo');
    148 
    149148        $plugin_public->enqueue_styles();
    150         $plugin_public->enqueue_scripts();
     149        SiteLint_Loader::add_action('wp_loaded', $plugin_public, 'enqueue_scripts');
    151150    }
    152151
  • sitelint/trunk/public/sitelint-public.php

    r3235310 r3244381  
    128128      })(window, document, 'script');";
    129129
    130       function enqueue_sitelint_loader($sitelintLoaderId, $sitelintLoader) {
    131         wp_register_script($sitelintLoaderId, '');
    132         wp_enqueue_script($sitelintLoaderId);
    133         wp_add_inline_script($sitelintLoaderId, $sitelintLoader);
     130      $loaderFilePath = __DIR__ . '/scripts/loader.js';
     131      $loaderFileDir = dirname($loaderFilePath);
     132
     133      if (file_exists($loaderFileDir) === false) {
     134        wp_mkdir_p($loaderFileDir);
    134135      }
    135136
    136       add_action('wp_enqueue_scripts', function() use ($sitelintLoaderId, $sitelintLoader) {
    137           enqueue_sitelint_loader($sitelintLoaderId, $sitelintLoader);
    138       });
     137      file_put_contents($loaderFilePath, $sitelintLoader);
     138
     139      wp_register_script($sitelintLoaderId, plugins_url('scripts/loader.js', __FILE__), [], SITELINT_VERSION, [
     140        'strategy' => 'defer'
     141      ]);
     142      wp_enqueue_script($sitelintLoaderId);
    139143    }
    140144
  • sitelint/trunk/sitelint.php

    r3235310 r3244381  
    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.15
     12 * Version:           1.5.16
    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.15');
     29define('SITELINT_VERSION', '1.5.16');
    3030
    3131/**
Note: See TracChangeset for help on using the changeset viewer.