Plugin Directory

Changeset 2276451


Ignore:
Timestamp:
04/05/2020 04:12:45 PM (6 years ago)
Author:
broadbrander
Message:

Fixed: Compatibility issue with latest WordPress.

Location:
loader/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • loader/trunk/inc/controls.php

    r2262313 r2276451  
    9393    $wp_customize->add_setting( 'enable_preloader',
    9494       array(
    95           'default' => '1',
     95          'default' => true,
    9696          'transport' => 'refresh',
    9797          'sanitize_callback' => 'loader_sanitize_checkbox'
     
    115115    $wp_customize->add_setting( 'enable_quotes',
    116116       array(
    117           'default' => '1',
     117          'default' => true,
    118118          'transport' => 'refresh',
    119119          'sanitize_callback' => 'loader_sanitize_checkbox'
     
    137137    $wp_customize->add_setting( 'enable_preload',
    138138       array(
    139           'default' => '1',
     139          'default' => true,
    140140          'transport' => 'refresh',
    141141          'sanitize_callback' => 'loader_sanitize_checkbox'
     
    327327    $wp_customize->add_setting( 'loader_style_image',
    328328       array(
    329           'default' => '1',
     329          'default' => 'none',
    330330          'transport' => 'refresh',
    331331          'sanitize_callback' => 'loader_sanitize_select'
     
    368368    $wp_customize->add_setting( 'only_home',
    369369       array(
    370           'default' => '0',
     370          'default' => false,
    371371          'transport' => 'refresh',
    372372          'sanitize_callback' => 'loader_sanitize_checkbox'
  • loader/trunk/inc/preloader/functions.php

    r2265313 r2276451  
    2424    wp_enqueue_script( 'hover_loader_script', plugin_dir_url( __FILE__ ) . 'assets/js/hover-loader.min.js');
    2525}
    26 if ( get_theme_mod('enable_preload' , 1) == 1 ) {
     26if ( get_theme_mod('enable_preload' , true) == true ) {
    2727   add_action('wp_enqueue_scripts', 'loader_preload_script');
    2828}
    2929
    30 function loader_load_jquery($value=''){
     30function loader_load_jquery(){
    3131wp_enqueue_script("jquery");
    3232}
    3333add_action('wp_enqueue_scripts', 'loader_load_jquery');
    3434
    35 if ( get_theme_mod('enable_preloader', 1 ) == 1 ) {
     35
    3636   
    3737
     
    189189
    190190// Add script to footer
    191 if ( get_theme_mod('only_home' , 0) == 1 ) {
     191if ( get_theme_mod('only_home' , 0) == true && get_theme_mod('enable_preloader', true ) == true ) {
    192192    add_action('wp_head', 'loader_home_script');
    193193} else{
     
    198198
    199199// Call the quote on preloader if enabled.
    200 if ( get_theme_mod('enable_quotes' , 1) == 1 ) {
     200if ( get_theme_mod('enable_quotes' , true) == true  && get_theme_mod('enable_preloader', true ) == true ) {
    201201    add_action( 'loader_quote', 'loader_print_one_quote' );
    202202}
     
    212212 */
    213213
    214 if ( get_theme_mod('loader_style_select' , 1) == 1) {
    215 
    216     // Check if the wp_body_open is available
    217     if(has_action('wp_body_open')) {
    218 
    219     // If avaibale add html after body tag
    220     add_action('wp_body_open', 'loader_html');
    221 
    222     } else {
    223 
    224     // Else add html to head
     214if ( get_theme_mod('loader_style_select' , '1') == '1' && get_theme_mod('enable_preloader', true ) == true ) {
     215
    225216    add_action('wp_head', 'loader_html');
    226 }
    227 }
    228 
    229 
    230 if ( get_theme_mod('loader_style_select') == 2) {
    231 
    232     // Check if the wp_body_open is available
    233     if(has_action('wp_body_open')) {
    234 
    235     // If avaibale add html after body tag
    236     add_action('wp_body_open', 'loader_html');
    237 
    238     } else {
    239 
    240     // Else add html to head
     217
     218}
     219
     220
     221if ( get_theme_mod('loader_style_select') == 2 && get_theme_mod('enable_preloader', true ) == true ) {
     222
    241223    add_action('wp_head', 'loader_html');
    242 }
    243 }
    244 
    245 
    246 if ( get_theme_mod('loader_style_select') == 3) {
    247 
    248     // Check if the wp_body_open is available
    249     if(has_action('wp_body_open')) {
    250 
    251     // If avaibale add html after body tag
    252     add_action('wp_body_open', 'loader_3_html');
    253 
    254     } else {
    255 
    256     // Else add html to head
     224
     225}
     226
     227
     228if ( get_theme_mod('loader_style_select') == 3 && get_theme_mod('enable_preloader', true ) == true ) {
     229
    257230    add_action('wp_head', 'loader_3_html');
    258 }
    259 }
    260 
    261 
    262 if ( get_theme_mod('loader_style_select') == 4) {
    263 
    264     // Check if the wp_body_open is available
    265     if(has_action('wp_body_open')) {
    266 
    267     // If avaibale add html after body tag
    268     add_action('wp_body_open', 'loader_4_html');
    269 
    270     } else {
    271 
    272     // Else add html to head
     231
     232}
     233
     234
     235if ( get_theme_mod('loader_style_select') == 4 && get_theme_mod('enable_preloader', true ) == true ) {
     236
    273237    add_action('wp_head', 'loader_4_html');
    274 }
    275 }
    276 
    277 
    278 if ( get_theme_mod('loader_style_select') == 5) {
    279 
    280     // Check if the wp_body_open is available
    281     if(has_action('wp_body_open')) {
    282 
    283     // If avaibale add html after body tag
    284     add_action('wp_body_open', 'loader_html');
    285 
    286     } else {
    287 
    288     // Else add html to head
     238
     239}
     240
     241
     242if ( get_theme_mod('loader_style_select') == 5 && get_theme_mod('enable_preloader', true ) == true ) {
     243
    289244    add_action('wp_head', 'loader_html');
    290 }
    291 }
    292 
    293 if ( get_theme_mod('loader_style_select') == 6) {
    294 
    295     // Check if the wp_body_open is available
    296     if(has_action('wp_body_open')) {
    297 
    298     // If avaibale add html after body tag
    299     add_action('wp_body_open', 'loader_6_html');
    300 
    301     } else {
    302 
    303     // Else add html to head
     245
     246}
     247
     248if ( get_theme_mod('loader_style_select') == 6 && get_theme_mod('enable_preloader', true ) == true ) {
     249
    304250    add_action('wp_head', 'loader_6_html');
    305 }
    306 }
    307 
    308 
    309 if ( get_theme_mod('loader_style_select') == 'image') {
    310 
    311     // Check if the wp_body_open is available
    312     if(has_action('wp_body_open')) {
    313 
    314     // If avaibale add html after body tag
    315     add_action('wp_body_open', 'loader_image_html');
    316 
    317     } else {
    318 
    319     // Else add html to head
     251
     252}
     253
     254
     255if ( get_theme_mod('loader_style_select') == 'image' && get_theme_mod('enable_preloader', true ) == true ) {
     256
    320257    add_action('wp_head', 'loader_image_html');
    321 }
    322 }
    323 
    324 if ( get_theme_mod('loader_style_select') == 'custom') {
    325 
    326     // Check if the wp_body_open is available
    327     if(has_action('wp_body_open')) {
    328 
    329     // If avaibale add html after body tag
    330     add_action('wp_body_open', 'loader_custom_html');
    331 
    332     } else {
    333 
    334     // Else add html to head
     258
     259}
     260
     261if ( get_theme_mod('loader_style_select') == 'custom' && get_theme_mod('enable_preloader', true ) == true ) {
     262
    335263    add_action('wp_head', 'loader_custom_html');
    336 }
    337 }
    338 }
     264
     265}
  • loader/trunk/inc/preloader/styles.php

    r2262313 r2276451  
    7171
    7272}?>
    73 
    74 
    7573
    7674
  • loader/trunk/loader.php

    r2265313 r2276451  
    44 * Plugin URI: https://wordpress.org/plugins/loader
    55 * Description: Loader is a lightweight plugin to show preloader and prefetch on mouse hover to load pages faster.
    6  * Version: 1.2.4
     6 * Version: 1.3.0
    77 * Author: BroadBrander
    88 * Author URI: https://broadbrander.com
  • loader/trunk/readme.txt

    r2265313 r2276451  
    11=== Loader: Preloader and User Experience Booster ===
    22Contributors: broadbrander
    3 Version: 1.2.4
     3Version: 1.3.0
    44Plugin Name: Loader: Preloader and User Experience Booster
    55Tags: wordpress, preloader, preload, prefetch, speed optimize
    66Requires at least: 4.9
    77Tested up to: 5.4.0
    8 Stable tag: 1.2.4
     8Stable tag: 1.3.0
    99Requires PHP: 5.2.4
    1010License: GPLv2 or later
     
    8686* Fixed: Minor bug.
    8787
    88 = 1.2.3 =
     88= 1.2.4 =
    8989
    9090* Fixed: Preloader not showing on some websites.
    9191* Added: SVG support.
    9292* Updated: Deprecated jQuery code.
     93
     94= 1.3.0 =
     95
     96* Fixed: Compatibility issue with WordPress 5.4.0
Note: See TracChangeset for help on using the changeset viewer.