Plugin Directory

Changeset 3430214


Ignore:
Timestamp:
12/31/2025 05:18:50 PM (3 months ago)
Author:
surflabtech
Message:

v2.3.2

Location:
surflink/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • surflink/trunk/assets/js/redirects.js

    r3430186 r3430214  
    279279        function (confirmed) {
    280280          if (confirmed) {
    281        
    282281            $.post(SURFL_AJAX_REDIRECTS.ajaxurl, {
    283282              action: "surfl_empty_redirects",
     
    532531          "#surfl-edit-redirect-modal-message"
    533532        );
    534             changeBtnState(btn, btnText);
     533        changeBtnState(btn, btnText);
    535534        ob_redirect_list(response);
    536535      },
     
    684683      processData: false,
    685684    }).done(function (res) {
    686 
    687         changeBtnState(btn, btnText);
     685      changeBtnState(btn, btnText);
    688686      if (res.success) {
    689 
    690        
    691687        ob_redirect_list(res);
    692688        showNotification(
     
    698694        showNotification("error", res.data.message, "#surfl-imp-ex-notice");
    699695      }
    700 
    701    
    702696    });
    703697  });
     
    869863 */
    870864jQuery(document).ready(function ($) {
    871 
    872 
    873 
    874     function ob_gone_list(res) {
     865  function ob_gone_list(res) {
    875866    const gone_html = res.data.gone_html || false;
    876867
     
    880871  }
    881872  //handle single 410
    882 
    883 
    884 
    885873
    886874  $(document).on("submit", "#surfl-410-form", function (e) {
     
    903891      },
    904892      success: function (response) {
    905        
    906           changeBtnState(btn, btnText);
     893        changeBtnState(btn, btnText);
    907894        if (response.success) {
    908 
    909895          showNotification(
    910896            "success",
     
    912898            "#surfl-410-response-msg"
    913899          );
    914          ob_gone_list(response);
     900          ob_gone_list(response);
    915901        } else {
    916902          showNotification(
     
    920906          );
    921907        }
    922        
    923908      },
    924909      error: function (xhr, status, error) {
     
    986971      }
    987972
    988       let btn ;
    989       let btnText ;
    990 
    991    if (action != "surfl_empty_410")
    992    {
    993       btn = $(this);
    994       btnText = btn.text();
    995         changeBtnState(btn); 
    996    }
    997 
    998      
    999    
     973      let btn;
     974      let btnText;
     975
     976      if (action != "surfl_empty_410") {
     977        btn = $(this);
     978        btnText = btn.text();
     979        changeBtnState(btn);
     980      }
     981
    1000982      showCustomConfirm(
    1001983        "Are you sure you want to delete the selected 410s? This action cannot be undone.",
     
    10251007                );
    10261008
    1027                 setTimeout(() =>  ob_gone_list(response), 1500);
     1009                setTimeout(() => ob_gone_list(response), 1500);
    10281010              } else {
    10291011                showNotification(
     
    10471029              _wpnonce: nonce,
    10481030            }).done(function (response) {
    1049      
    10501031              if (response.success) {
    1051                ob_gone_list(response);
     1032                ob_gone_list(response);
    10521033              } else {
    10531034                showNotification(
     
    11181099      processData: false,
    11191100    }).done(function (res) {
    1120        changeBtnState(btn, btnText);
     1101      changeBtnState(btn, btnText);
    11211102      if (res.success) {
    11221103        showNotification(
     
    11321113        showNotification("error", res.data.message, "#surfl-410-import-notice");
    11331114      }
    1134 
    1135    
    11361115    });
    11371116  });
     
    12061185        );
    12071186        changeBtnState(btn, btnText);
    1208        ob_gone_list(response);
     1187        ob_gone_list(response);
    12091188      },
    12101189      error: function () {
     
    12341213              "#surfl-410-edit-msg"
    12351214            );
    1236              ob_gone_list(response);
     1215            ob_gone_list(response);
    12371216          });
    12381217        }
     
    12681247              });
    12691248
    1270               setTimeout(() =>  ob_gone_list(response), 1500);
     1249              setTimeout(() => ob_gone_list(response), 1500);
    12711250            }
    12721251          });
     
    13021281  }
    13031282
     1283    function ob_shortlinkgroup_list(res) {
     1284    const shortlink_html = res.data.shortlink_html || false;
     1285
     1286    if (shortlink_html) {
     1287      $("#surfl-shortlink-content").html(shortlink_html);
     1288    }
     1289  }
     1290
     1291
    13041292  $(document).on("click", "#surfl-shortlink-toggle-h3", function () {
    13051293    const btn = $(this);
  • surflink/trunk/includes/class-surfl-404.php

    r3430186 r3430214  
    216216        $max_404_logs = isset($settings['max_404_logs']) ? absint($settings['max_404_logs']) : 100;
    217217
    218         $per_page = 20;
     218        $per_page = 30;
    219219        $current_page = isset($_GET['paged']) ? max(1, intval($_GET['paged'])) : 1;
    220220        $offset = ($current_page - 1) * $per_page;
  • surflink/trunk/includes/class-surfl-410.php

    r3430186 r3430214  
    349349        }
    350350        // --- Pagination Setup ---
    351         $per_page = 20;
     351        $per_page = 30;
    352352        $current_page = ( isset( $_GET['paged'] ) ? max( 1, intval( $_GET['paged'] ) ) : 1 );
    353353        $offset = ($current_page - 1) * $per_page;
  • surflink/trunk/includes/class-surfl-loader.php

    r3430186 r3430214  
    490490        } elseif ( $active_tab === 'surfl-sl-ls-li-tab' ) {
    491491            set_transient( $tab_transient, $active_tab, 5 * MINUTE_IN_SECONDS );
    492             require_once SURFL_PATH . 'templates/surfl-shortlink-list-html.php';
     492            echo '<div id="surfl-shortlink-content">';
     493            require SURFL_PATH . 'templates/surfl-shortlink-list-html.php';
     494            echo '</div>';
    493495        } elseif ( $active_tab === 'surfl-sl-ls-option-tab' ) {
    494496            set_transient( $tab_transient, $active_tab, 5 * MINUTE_IN_SECONDS );
  • surflink/trunk/includes/class-surfl-loginhider.php

    r3426914 r3430214  
    866866
    867867        // --- Pagination Setup ---
    868         $per_page = 20;
     868        $per_page = 30;
    869869        $current_page = isset($_GET['paged']) ? max(1, intval($_GET['paged'])) : 1;
    870870        $offset = ($current_page - 1) * $per_page;
  • surflink/trunk/includes/class-surfl-redirect.php

    r3430186 r3430214  
    113113    public function render_red_page() {
    114114        global $wpdb;
    115         $per_page = 20;
     115        $per_page = 30;
    116116        $current_page = ( isset( $_GET['paged'] ) ? max( 1, intval( $_GET['paged'] ) ) : 1 );
    117117        $offset = ($current_page - 1) * $per_page;
     
    127127        // 'all' means 'All Redirect Types'
    128128        $filter_redirect_type = ( isset( $_GET['surfl_redirect_type_filter'] ) ? sanitize_text_field( $_GET['surfl_redirect_type_filter'] ) : 'all' );
    129         $per_page = 20;
     129        $per_page = 30;
    130130        $current_page = ( isset( $_GET['paged'] ) ? max( 1, intval( $_GET['paged'] ) ) : 1 );
    131131        $offset = ($current_page - 1) * $per_page;
  • surflink/trunk/readme.txt

    r3430186 r3430214  
    66**Requires PHP:** 7.4   
    77**Tested up to:** 6.9 
    8 **Stable tag:** 2.3.1
     8**Stable tag:** 2.3.2
    99**License:** GPLv3 or later 
    1010**License URI:** https://opensource.org/licenses/GPL-3.0 
     
    141141== Changelog ==
    142142
     143= 2.3.2 =
     144* Improved: SmartLink Module's UX is improved.
     145* Fixed: Critical bug fixed in Redirect, 410, 404 and Shortlinks.
     146
    143147= 2.3.1 =
    144 * Improved: UX is improved in Redirects module. And some minor fixes.
     148* Improved: Redirects Module's UX is improved.
     149* Fixed: Critical bug fixed.
    145150
    146151= 2.3.0 =
  • surflink/trunk/surf-link.php

    r3430186 r3430214  
    77 * Author: SurfLab
    88 * Author URI: https://surflabtech.com
    9  * Version: 2.3.1
     9 * Version: 2.3.2
    1010 * Text Domain: surflink
    1111 * License: GPL-3.0-or-later
     
    6767    }
    6868    if ( !defined( 'SURFL_VERSION' ) ) {
    69         define( 'SURFL_VERSION', '2.3.1' );
     69        define( 'SURFL_VERSION', '2.3.2' );
    7070    }
    7171    if ( !defined( 'SURFL_PLUGIN' ) ) {
     
    9999        }
    100100        if ( !defined( 'SURFL_VERSION' ) ) {
    101             define( 'SURFL_VERSION', '2.3.1' );
     101            define( 'SURFL_VERSION', '2.3.2' );
    102102        }
    103103        if ( !defined( 'SURFL_SITE_URL' ) ) {
  • surflink/trunk/templates/surfl-shortlink-options.php

    r3428732 r3430214  
    11<?php
    22
    3 
    43$option_name = 'surfl_shortlink_options';
    5 
    6 
    7         $defaults = [
    8             'pass_params' => 0,
    9             'duration' => 0,
    10             'delete_data' => 0
    11         ];
    12 
    13 
    14         $settings = get_option($option_name, $defaults);
    15 
    16         if (!$settings) {
    17             update_option($option_name, $defaults);
    18         }
    19 
    20 
    21         if ($_SERVER['REQUEST_METHOD'] === 'POST' && check_admin_referer('surfl_ls_option_nonce')) {
    22 
    23             error_log('post ' . print_r($_POST, true));
    24             $shortlinks = absint($_POST['shortlinks_duration']);
    25             $pass_params = isset($_POST['pass_params']) ? 1 : 0;
    26             $delete_data = isset($_POST['delete_data']) ? 1 : 0;
    27             $settings['duration'] = $shortlinks;
    28             $settings['delete_data'] = $delete_data;
    29             $settings['pass_params'] = $pass_params;
    30             update_option($option_name, $settings);
    31             echo '<div class="updated"><p style="color:black;">Settings saved.</p></div>';
    32         }
    33 
    34 
     4$defaults = [
     5    'pass_params' => 0,
     6    'duration'    => 0,
     7    'delete_data' => 0,
     8];
     9$settings = get_option( $option_name, $defaults );
    3510?>
    3611
    3712
    3813 <div class="surfl-page-content-wrapper" >
    39                  <?php require SURFL_PATH . "templates/surfl-pro-ad.php"; ?>
     14                 <?php
     15require SURFL_PATH . "templates/surfl-pro-ad.php";
     16?>
    4017
    4118            <div class="surfl-section-title">
    4219
    4320                <h2><span class="surfl-price-title">
    44                         <?php esc_html_e('Shortlink Options', 'surflink'); ?>
     21                        <?php
     22esc_html_e( 'Shortlink Options', 'surflink' );
     23?>
    4524                    </span></h2>
    4625            </div>
    4726            <form method="post" id="surfl-ls-option-form">
    48                 <?php wp_nonce_field('surfl_ls_option_nonce'); ?>
     27                <?php
     28wp_nonce_field( 'surfl_ls_option_nonce' );
     29?>
    4930                <table class="surfl-sr-table" style="max-width: 1200px;">
    5031                    <tr>
     
    6445
    6546                                    <input name="shortlinks_duration" type="number" id="shortlinks_duration"
    66                                         value="<?php echo esc_attr($settings['duration']); ?>" class="small-text">
     47                                        value="<?php
     48echo esc_attr( $settings['duration'] );
     49?>" class="small-text">
    6750                                    <label class="surfl-label">days</label>
    6851                                </div>
     
    8265                                    name="pass_params"
    8366                                    value="1"
    84                                     <?php checked($settings['pass_params'], 1); ?>>
     67                                    <?php
     68checked( $settings['pass_params'], 1 );
     69?>>
    8570
    8671                        </td>
     
    9479                                    name="delete_data"
    9580                                    value="1"
    96                                     <?php checked($settings['delete_data'], 1); ?>>
     81                                    <?php
     82checked( $settings['delete_data'], 1 );
     83?>>
    9784
    9885                        </td>
     
    10289                        <td>
    10390                            <div class="surfl-flex-center">
    104                                 <button <?php echo ! surflink_fs()->is_premium() ? 'disabled' : ''; ?> type="submit" class="surfl-module-card surfl-white-button">SAVE</button>
     91                                <button <?php
     92echo ( !surflink_fs()->is_premium() ? 'disabled' : '' );
     93?> type="submit" class="surfl-module-card surfl-white-button">SAVE</button>
    10594                            </div>
    10695                        </td>
Note: See TracChangeset for help on using the changeset viewer.