Plugin Directory

Changeset 2867781


Ignore:
Timestamp:
02/19/2023 05:55:31 PM (3 years ago)
Author:
andrija
Message:

v1.3.3

Location:
jane-menu/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • jane-menu/trunk/includes/core.php

    r2865958 r2867781  
    99use IHeartJane\WebMenu\DB;
    1010use IHeartJane\WebMenu\StoreConfigs;
     11use IHeartJane\WebMenu\Sitemap;
    1112use IHeartJane\WebMenu\Helpers;
     13
     14/**
     15 * Triggers the database table update for old structure versions
     16 *
     17 * @uses     IHeartJane\WebMenu\Constants\PLUGIN_VER                        Constants\PLUGIN_VER
     18 * @uses     IHeartJane\WebMenu\DB\create_or_update_config_table()          DB\create_or_update_config_table()
     19 * @uses     IHeartJane\WebMenu\Sitemap\update_remote_sitemap()             Sitemap\update_remote_sitemap()
     20 *
     21 * @see      https://developer.wordpress.org/reference/hooks/admin_init/    Codex, action: admin_init
     22 *
     23 * @since    1.3.0
     24 *
     25 * @return   void
     26 */
     27function check_db_version(){
     28   
     29    $db_ver = get_option( 'jane_web_db_version', '0.0.1' );
     30   
     31    // Helpers\debug_log( $db_ver, "db-check_db_version-running" );
     32   
     33    if( version_compare( $db_ver, Constants\PLUGIN_VER, '<' ) ){
     34       
     35        // Helpers\debug_log( Constants\PLUGIN_VER, "db-check_db_version-updating" );
     36       
     37        DB\create_or_update_config_table();
     38        Sitemap\update_remote_sitemap();
     39    }
     40}
     41add_action( 'admin_init', __NAMESPACE__ . '\\' . 'check_db_version' );
    1242
    1343/**
  • jane-menu/trunk/includes/db.php

    r2865958 r2867781  
    99use IHeartJane\WebMenu\Constants;
    1010use IHeartJane\WebMenu\Helpers;
    11 
    12 /**
    13  * Triggers the database table update for old structure versions
    14  *
    15  * @uses     IHeartJane\WebMenu\Constants\PLUGIN_VER                        Constants\PLUGIN_VER
    16  * @uses     IHeartJane\WebMenu\DB\create_or_update_config_table()          DB\create_or_update_config_table()
    17  *
    18  * @see      https://developer.wordpress.org/reference/hooks/admin_init/    Codex, action: admin_init
    19  *
    20  * @since    1.3.0
    21  *
    22  * @return   void
    23  */
    24 function check_db_version(){
    25    
    26     $db_ver = get_option( 'jane_web_db_version', '0.0.1' );
    27    
    28     // Helpers\debug_log( $db_ver, "db-check_db_version-running" );
    29    
    30     if( version_compare( $db_ver, Constants\PLUGIN_VER, '<' ) ){
    31        
    32         // Helpers\debug_log( Constants\PLUGIN_VER, "db-check_db_version-updating" );
    33        
    34         create_or_update_config_table();
    35     }
    36 }
    37 add_action( 'admin_init', __NAMESPACE__ . '\\' . 'check_db_version' );
    3811
    3912/**
  • jane-menu/trunk/includes/sitemap.php

    r2865958 r2867781  
    4343 *
    4444 * The sitemap index file lists all the remote sitemap URLs from existing Store Configs
    45  *
    46  * @todo    Needs to get triggered when a Store Config is deleted too
    4745 *
    4846 * @uses     IHeartJane\WebMenu\Constants\OPTION_SITEMAP_ENABLED_NAME   Constants\OPTION_SITEMAP_ENABLED_NAME
  • jane-menu/trunk/jane-menu.php

    r2865959 r2867781  
    99 * Plugin URI:          https://www.iheartjane.com/plugins/jane-menu-plugin
    1010 * Description:         Dispensary manager to display partner product menu.
    11  * Version:             1.3.2
     11 * Version:             1.3.3
    1212 * Requires at least:   5.9
    1313 * Requires PHP:        7.4
     
    2727 * @var string
    2828 */
    29 define( 'IHeartJane\WebMenu\Constants\PLUGIN_VER', "1.3.2" );
     29define( 'IHeartJane\WebMenu\Constants\PLUGIN_VER', "1.3.3" );
    3030
    3131/**
  • jane-menu/trunk/js/store_config-list.js

    r2854692 r2867781  
    88    });
    99   
     10    $('#jane_sitemap_enabled').on('change', function(){
     11       
     12        let selected = $(this).prop('checked');
     13       
     14        $('.row-sitemap-index').toggle( selected );
     15    });
     16   
     17   
     18    $('#jane_sitemap_index_location').css( 'width', ( $('#jane_sitemap_index_location').val().length + 1 ) + "ch" );
     19   
     20    $('#jane_sitemap_index_location').on('click', function(){
     21       
     22        console.log( 'sitemap location clicked' );
     23       
     24        let el = $(this)[0];
     25       
     26        el.setSelectionRange( 0, el.value.length );
     27       
     28    });
    1029});
  • jane-menu/trunk/readme.txt

    r2865959 r2867781  
    22Contributors: danaatiheartjane, andrija
    33Tags: jane, catalog, pos
    4 Stable tag: 1.3.2
     4Stable tag: 1.3.3
    55Requires at least: 5.9
    66Tested up to: 6.1.1
     
    2222== Changelog ==
    2323
     24= 1.3.3 =
     25* Added: The Sitemap index location in Settings
     26* Fixed: The Sitemap index gets generated even if the plugin is updated
     27
    2428= 1.3.2 =
    2529* Added: Sitemap index with remote sitemap URLs generated in the uploads folder
  • jane-menu/trunk/templates/store-config-list.php

    r2865959 r2867781  
    99
    1010$url_new = admin_url( 'admin.php?page=' . Constants\ADMIN_PAGE_NAME . '&action=new' );
     11
     12$sitemap_url_displayed = $sitemap_enabled ? '' : ' style="display: none;"';
    1113
    1214?>
     
    3234                        </td>
    3335                    </tr>
    34                  
     36                   
    3537                    <tr class="row-jane-sitemap-enabled">
    3638                        <th scope="row">
    37                             <?php _e( 'Add sitemap(s) to robots.txt', 'iheartjane' ); ?>
     39                            <label for="jane_sitemap_enabled">
     40                                <?php _e( 'Add sitemap index to robots.txt', 'iheartjane' ); ?>
     41                            </label>
    3842                        </th>
    3943                        <td>
    40                             <label for="jane-sitemap-enabled"><input type="checkbox" name="jane_sitemap_enabled" id="jane_sitemap_enabled" value="1" <?php checked( $sitemap_enabled, 1 ); ?> /> </label>
     44                            <input type="checkbox" name="jane_sitemap_enabled" id="jane_sitemap_enabled" value="1" <?php checked( $sitemap_enabled, 1 ); ?> />
    4145                        </td>
    42                      
    4346                    </tr>
     47                   
     48                    <tr class="row-sitemap-index"<?php echo $sitemap_url_displayed; ?>>
     49                        <th scope="row">
     50                            <?php _e( 'Sitemap index location', 'iheartjane' ); ?>
     51                        </th>
     52                        <td>
     53                            <input type="text" readonly id="jane_sitemap_index_location" value="<?php echo esc_attr( Constants\SITEMAP_URL ); ?>"/>
     54                        </td>
     55                    </tr>
     56                   
    4457                </tbody>
    4558            </table>
Note: See TracChangeset for help on using the changeset viewer.