Plugin Directory

Changeset 2881052


Ignore:
Timestamp:
03/16/2023 08:59:02 AM (3 years ago)
Author:
ITRO
Message:

FIXED: wrong function name called in plugin init.
IMPROVED: function names refactoring

Location:
itro-popup/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • itro-popup/trunk/admin/popup-admin.php

    r2877356 r2881052  
    127127       
    128128        /* Save the posted value in the database */
    129         ipp_itro_update_option($opt_name[$i], $opt_val[$i]);
     129        ipp_update_option($opt_name[$i], $opt_val[$i]);
    130130       
    131131        if (isset($_POST['select_' . $opt_name[$i]])) {
    132             ipp_itro_update_option('select_' . $opt_name[$i], $_POST['select_' . $opt_name[$i]]);
     132            ipp_update_option('select_' . $opt_name[$i], $_POST['select_' . $opt_name[$i]]);
    133133           
    134134            $px_opt_val[$i] = ipp_validate_data('px_' . $opt_name[$i], $_POST['px_' . $opt_name[$i]]);
    135             ipp_itro_update_option('px_' . $opt_name[$i], $_POST['px_' . $opt_name[$i]]);
     135            ipp_update_option('px_' . $opt_name[$i], $_POST['px_' . $opt_name[$i]]);
    136136            $perc_opt_val[$i] = ipp_validate_data('perc_' . $opt_name[$i], $_POST['perc_' . $opt_name[$i]]);
    137             ipp_itro_update_option('perc_' . $opt_name[$i], $_POST['perc_' . $opt_name[$i]]);
     137            ipp_update_option('perc_' . $opt_name[$i], $_POST['perc_' . $opt_name[$i]]);
    138138        } else {
    139             ipp_itro_update_option('select_' . $opt_name[$i], NULL);
     139            ipp_update_option('select_' . $opt_name[$i], NULL);
    140140        }
    141141    } else {
     
    165165    if (isset($_POST['selected_page_id'])) {
    166166        $selected_page_id = json_encode($_POST['selected_page_id']);
    167         ipp_itro_update_option('selected_page_id', $selected_page_id);
     167        ipp_update_option('selected_page_id', $selected_page_id);
    168168    } else {
    169         ipp_itro_update_option('selected_page_id', NULL);
     169        ipp_update_option('selected_page_id', NULL);
    170170    }
    171171   
    172172    if (!empty($_POST['background_source'])) {
    173         ipp_itro_update_option('background_source', $_POST['background_source']);
     173        ipp_update_option('background_source', $_POST['background_source']);
    174174    }
    175175   
    176176    if (isset($_POST['roles'])) {
    177177        $roles_users = json_encode($_POST['roles']);
    178         ipp_itro_update_option('roles', $roles_users);
     178        ipp_update_option('roles', $roles_users);
    179179    } else {
    180         ipp_itro_update_option('roles', NULL);
     180        ipp_update_option('roles', NULL);
    181181    }
    182182} else {
     
    190190    check_admin_referer('ipp_save_data', 'ipp_cleardb_nonce_fld');
    191191    if (isset($_POST['delete_data'])) {
    192         ipp_itro_update_option('delete_data', $_POST['delete_data']);
     192        ipp_update_option('delete_data', $_POST['delete_data']);
    193193    } else {
    194         ipp_itro_update_option('delete_data', NULL);
     194        ipp_update_option('delete_data', NULL);
    195195    }
    196196}
  • itro-popup/trunk/css/itro-style-functions.php

    r2877733 r2881052  
    1414                'perc_popup_height'
    1515            ) == 0)) {
    16         ipp_itro_update_option('select_popup_height', 'auto');
     16        ipp_update_option('select_popup_height', 'auto');
    1717    }
    1818    if (ipp_itro_get_option('select_popup_width') == 'px' && ipp_itro_get_option('px_popup_width') == 0) {
    19         ipp_itro_update_option('px_popup_width', '600');
     19        ipp_update_option('px_popup_width', '600');
    2020    }
    2121    if (ipp_itro_get_option('select_popup_width') == 'perc' && ipp_itro_get_option('perc_popup_width') == 0) {
    22         ipp_itro_update_option('perc_popup_width', '60');
     22        ipp_update_option('perc_popup_width', '60');
    2323    }
    2424    ?>
  • itro-popup/trunk/functions/core-function.php

    r2877356 r2881052  
    5252    ipp_itro_db_init();
    5353
    54     itro_update_option('popup_time', 20);
    55     itro_update_option('popup_delay', 0);
    56     itro_update_option('cookie_time_exp', 0);
    57     itro_update_option('popup_background', '#FFFFFF');
    58     itro_update_option('popup_border_color', '#F7FF00');
    59     itro_update_option('px_popup_width', 600);
    60     itro_update_option('px_popup_height', 0);
    61     itro_update_option('show_countdown', 'yes');
    62     itro_update_option('auto_margin_check', 'yes');
    63     itro_update_option('select_popup_width', 'px');
    64     itro_update_option('select_popup_height', 'auto');
    65     itro_update_option('popup_bg_opacity', 0.40);
    66     itro_update_option('opaco_bg_color', '#8A8A8A');
    67     itro_update_option('popup_position', 'fixed');
    68     itro_update_option('popup_border_width', 3);
    69     itro_update_option('popup_border_radius', 8);
    70     itro_update_option('popup_padding', 2);
    71     itro_update_option('page_selection', 'none');
     54    ipp_update_option('popup_time', 20);
     55    ipp_update_option('popup_delay', 0);
     56    ipp_update_option('cookie_time_exp', 0);
     57    ipp_update_option('popup_background', '#FFFFFF');
     58    ipp_update_option('popup_border_color', '#F7FF00');
     59    ipp_update_option('px_popup_width', 600);
     60    ipp_update_option('px_popup_height', 0);
     61    ipp_update_option('show_countdown', 'yes');
     62    ipp_update_option('auto_margin_check', 'yes');
     63    ipp_update_option('select_popup_width', 'px');
     64    ipp_update_option('select_popup_height', 'auto');
     65    ipp_update_option('popup_bg_opacity', 0.40);
     66    ipp_update_option('opaco_bg_color', '#8A8A8A');
     67    ipp_update_option('popup_position', 'fixed');
     68    ipp_update_option('popup_border_width', 3);
     69    ipp_update_option('popup_border_radius', 8);
     70    ipp_update_option('popup_padding', 2);
     71    ipp_update_option('page_selection', 'none');
    7272
    7373    switch (get_locale()) {
     
    8383    ipp_itro_update_field('custom_html', $welcome_text);
    8484
    85     itro_update_option('sample_popup', 'done');
     85    ipp_update_option('sample_popup', 'done');
    8686    }
    8787}
     
    8989/* --------------------------CHECK THE PLUGIN VERSION */
    9090
    91 function ipp_itro_check_ver() {
     91function ipp_check_ver() {
    9292    ob_start();
    9393    if ($GLOBALS['ITRO_VER'] != get_option('itro_curr_ver')) {
    9494    /* check and update the db */
    95     ipp_itro_update_db();
     95    ipp_update_db();
    9696
    9797    $ver = get_option('itro_curr_ver');
     
    104104/* --------------------------DISPLAY THE POPUP */
    105105
    106 function ipp_itro_display_popup() {
     106function ipp_display_popup() {
    107107    global $popup_fired; //it check if there is a popup visualization via shortcode or via automatic visualization
    108108    //if a shortcode was fired it stop everything
  • itro-popup/trunk/functions/database-function.php

    r2812089 r2881052  
    4242/* update old fixed 'wp_' prefix to the current one' */
    4343
    44 function ipp_itro_update_db() {
     44function ipp_update_db() {
    4545    global $wpdb;
    4646    $prev_ver = get_option('itro_prev_ver');
    4747
    4848    if ($prev_ver <= 3.68) {
    49     ipp_itro_update_option('popup_border_width', 3);
    50     ipp_itro_update_option('popup_border_radius', 8);
     49    ipp_update_option('popup_border_width', 3);
     50    ipp_update_option('popup_border_radius', 8);
    5151    }
    5252
     
    6464    // added the text for countdown
    6565    if (version_compare($prev_ver, 4.91) == -1) {
    66     ipp_itro_update_option('countdown_text', 'This popup will close in:');
     66    ipp_update_option('countdown_text', 'This popup will close in:');
    6767    }
    6868    // reset the popup height after error for data sanitization
    6969    if (version_compare($prev_ver, 4.95) == -1) {
    7070    if (ipp_itro_get_option('select_popup_height') == 'px' && ipp_itro_get_option('px_popup_height') == 0) {
    71         ipp_itro_update_option('select_popup_height', 'auto');
     71        ipp_update_option('select_popup_height', 'auto');
    7272    }
    7373    }
     
    7676/* ------------------ PLUGIN OPTION DB MANAGEMENT --------------  */
    7777
    78 function ipp_itro_update_option($opt_name, $opt_val) {
     78function ipp_update_option($opt_name, $opt_val) {
    7979
    8080    global $wpdb;
  • itro-popup/trunk/mc-main.php

    r2877747 r2881052  
    6060function itro_get_woo_shop_id(): void
    6161{
    62     ipp_itro_update_option('woo_shop_id', get_the_id());
     62    ipp_update_option('woo_shop_id', get_the_id());
    6363}
    6464
     
    6666
    6767/* check current version for db update: forced with init function due register_activation_hook not working with automatic updates */
    68 add_action( 'init', 'ipp_itro_check_ver');
     68add_action( 'init', 'ipp_check_ver');
    6969
    7070add_action( 'woocommerce_before_shop_loop' , 'itro_get_woo_shop_id' );
    7171
    72 add_action( 'wp_footer', 'ipp_itro_display_popup');
     72add_action( 'wp_footer', 'ipp_display_popup');
    7373add_action( 'wp_enqueue_scripts' , 'itro_load_script' );
    7474
Note: See TracChangeset for help on using the changeset viewer.