Plugin Directory

Changeset 3302012


Ignore:
Timestamp:
05/28/2025 08:06:55 AM (10 months ago)
Author:
daext
Message:

Committing and tagging 1.20

Location:
league-table-lite
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • league-table-lite/tags/1.20/admin/inc/menu/child/class-daextletal-tables-menu-elements.php

    r3294646 r3302012  
    142142                        $pag = new Daextletal_Pagination( $this->shared );
    143143                        $pag->set_total_items( $total_items );// Set the total number of items.
    144                         $pag->set_record_per_page( 10 ); // Set records per page.
     144                        $pag->set_record_per_page( intval( get_option( $this->shared->get( 'slug' ) . '_items_per_page_tables_menu' ) ) ); // Set records per page.
    145145                        $pag->set_target_page( 'admin.php?page=' . $this->shared->get( 'slug' ) . '-tables' );// Set target page.
    146146                        $pag->set_current_page();// set the current page number from $_GET.
  • league-table-lite/tags/1.20/admin/inc/menu/class-daextletal-menu-elements.php

    r3294646 r3302012  
    913913                // Delete the items.
    914914                global $wpdb;
    915                 $table_name = $wpdb->prefix . $this->shared->get( 'slug' ) . '_' . $this->db_table;
    916915
    917916                if ( count( $delete_id_deletable ) > 0 ) {
    918917
    919                     // Sanitize the db table name.
    920                     $table_name = sanitize_key( $table_name );
    921 
    922                     // Sanitize the field name.
    923                     $primary_key_name = sanitize_key( $this->primary_key );
    924 
    925                     // phpcs:disable WordPress.DB.DirectDatabaseQuery
    926                     // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- $variables are sanitized above.
    927                     // phpcs:disable WordPress.DB.PreparedSQL.NotPrepared
    928                     $query_result = $wpdb->query(
    929                         "DELETE FROM $table_name WHERE $primary_key_name IN (" . implode( ',', $delete_id_deletable ) . ')'
    930                     );
    931                     // phpcs:enable
     918                    $deleted_items_count = 0;
     919
     920                    foreach ( $delete_id_deletable as $delete_id ) {
     921                        // Delete the item in the "_table" menu where the id field matches the current $delete_id.
     922                        $query_result_table = $wpdb->query(
     923                            $wpdb->prepare( "DELETE FROM {$wpdb->prefix}daextletal_table WHERE id = %d", $delete_id )
     924                        );
     925
     926                        if ( isset( $query_result_table ) && false !== $query_result_table ) {
     927
     928                            // Get the number of deleted items with $wpdb.
     929                            $deleted_items_count = $deleted_items_count + $wpdb->rows_affected;
     930
     931                        }
     932
     933                        // Delete the items in the "_data" db table where the table_id matches the current $delete_id.
     934                        $wpdb->query(
     935                            $wpdb->prepare( "DELETE FROM {$wpdb->prefix}daextletal_data WHERE table_id = %d", $delete_id )
     936                        );
     937
     938                        // Delete the items in the "_cell" db table where the table_id matches the current $delete_id.
     939                        $wpdb->query(
     940                            $wpdb->prepare( "DELETE FROM {$wpdb->prefix}daextletal_cell WHERE table_id = %d", $delete_id )
     941                        );
     942                    }
    932943
    933944                }
    934945
    935                 if ( isset( $query_result ) && false !== $query_result ) {
    936 
    937                     // Get the number of deleted items with $wpdb.
    938                     $deleted_items_count = $wpdb->rows_affected;
    939 
    940                     $this->shared->save_dismissible_notice(
    941                         $deleted_items_count . ' ' . __( 'items have been successfully deleted.', 'league-table-lite' ),
    942                         'updated'
    943                     );
    944 
    945                 }
    946 
    947                 if ( count( $delete_id_non_deletable ) > 0 ) {
    948 
    949                     $this->shared->save_dismissible_notice(
    950                         __( 'The', 'league-table-lite' ) . ' ' . strtolower( $this->label_plural ) . ' ' . __( "with the following IDs are used in one or more automatic internal links and can't be deleted:", 'league-table-lite' ) . ' ' . implode( ', ', $delete_id_non_deletable ) . '.',
    951                         'error'
    952                     );
    953 
    954                 }
     946                $this->shared->save_dismissible_notice(
     947                    $deleted_items_count . ' ' . __( 'items have been successfully deleted.', 'league-table-lite' ),
     948                    'updated'
     949                );
     950
    955951            }
    956952        }
  • league-table-lite/tags/1.20/inc/class-daextletal-rest.php

    r3294646 r3302012  
    150150        $options['daextletal_load_google_font_2']          = $request->get_param( 'daextletal_load_google_font_2' ) !== null ? esc_url_raw( $request->get_param( 'daextletal_load_google_font_2' ) ) : null;
    151151        $options['daextletal_max_execution_time']          = $request->get_param( 'daextletal_max_execution_time' ) !== null ? intval( $request->get_param( 'daextletal_max_execution_time' ), 10 ) : null;
     152        $options['daextletal_items_per_page_tables_menu']  = $request->get_param( 'daextletal_items_per_page_tables_menu' ) !== null ? intval( $request->get_param( 'daextletal_items_per_page_tables_menu' ), 10 ) : null;
    152153        $options['daextletal_limit_shortcode_parsing']     = $request->get_param( 'daextletal_limit_shortcode_parsing' ) !== null ? intval( $request->get_param( 'daextletal_limit_shortcode_parsing' ), 10 ) : null;
    153154        $options['daextletal_verify_single_shortcode']     = $request->get_param( 'daextletal_verify_single_shortcode' ) !== null ? intval( $request->get_param( 'daextletal_verify_single_shortcode' ), 10 ) : null;
  • league-table-lite/tags/1.20/init.php

    r3294646 r3302012  
    33 * Plugin Name: League Table
    44 * Description: Generates tables in your WordPress blog. (Lite version)
    5  * Version: 1.19
     5 * Version: 1.20
    66 * Author: DAEXT
    77 * Author URI: https://daext.com
  • league-table-lite/tags/1.20/readme.txt

    r3294646 r3302012  
    66Tested up to: 6.8.1
    77Requires PHP: 7.2
    8 Stable tag: 1.19
     8Stable tag: 1.20
    99License: GPLv3
    1010
     
    158158== Changelog ==
    159159
     160= 1.20 =
     161
     162*May 28, 2025*
     163
     164* Deleting multiple tables from the Tables menu now correctly removes the related records from subsidiary database tables.
     165* You can now define how many items are displayed per page in the Tables menu via a new setting.
     166
    160167= 1.19 =
    161168
  • league-table-lite/tags/1.20/shared/class-daextletal-shared.php

    r3294646 r3302012  
    7575
    7676        $this->data['slug'] = 'daextletal';
    77         $this->data['ver']  = '1.19';
     77        $this->data['ver']  = '1.20';
    7878        $this->data['dir']  = substr( plugin_dir_path( __FILE__ ), 0, -7 );
    7979        $this->data['url']  = substr( plugin_dir_url( __FILE__ ), 0, -7 );
     
    9898            $this->get( 'slug' ) . '_load_google_font_2' => '',
    9999            $this->get( 'slug' ) . '_max_execution_time' => '300',
     100            $this->get( 'slug' ) . '_items_per_page_tables_menu' => '10',
    100101            $this->get( 'slug' ) . '_limit_shortcode_parsing' => '1',
    101102            $this->get( 'slug' ) . '_verify_single_shortcode' => '1',
     
    18461847                            ),
    18471848                            array(
     1849                                'name'      => 'daextletal_items_per_page_tables_menu',
     1850                                'label'     => __( 'Items per Page (Tables Menu)', 'league-table-lite' ),
     1851                                'type'      => 'range',
     1852                                'tooltip'   => __(
     1853                                    'This options determines the number of elements per page displayed in the "Tables" menu.',
     1854                                    'league-table-lite'
     1855                                ),
     1856                                'help'      => __( 'Set the number of elements per page displayed in the "Tables" menu.', 'league-table-lite' ),
     1857                                'rangeMin'  => 10,
     1858                                'rangeMax'  => 100,
     1859                                'rangeStep' => 10,
     1860                            ),
     1861                            array(
    18481862                                'name'    => 'daextletal_limit_shortcode_parsing',
    18491863                                'label'   => __( 'Limit Shortcode Parsing', 'league-table-lite' ),
  • league-table-lite/trunk/admin/inc/menu/child/class-daextletal-tables-menu-elements.php

    r3294646 r3302012  
    142142                        $pag = new Daextletal_Pagination( $this->shared );
    143143                        $pag->set_total_items( $total_items );// Set the total number of items.
    144                         $pag->set_record_per_page( 10 ); // Set records per page.
     144                        $pag->set_record_per_page( intval( get_option( $this->shared->get( 'slug' ) . '_items_per_page_tables_menu' ) ) ); // Set records per page.
    145145                        $pag->set_target_page( 'admin.php?page=' . $this->shared->get( 'slug' ) . '-tables' );// Set target page.
    146146                        $pag->set_current_page();// set the current page number from $_GET.
  • league-table-lite/trunk/admin/inc/menu/class-daextletal-menu-elements.php

    r3294646 r3302012  
    913913                // Delete the items.
    914914                global $wpdb;
    915                 $table_name = $wpdb->prefix . $this->shared->get( 'slug' ) . '_' . $this->db_table;
    916915
    917916                if ( count( $delete_id_deletable ) > 0 ) {
    918917
    919                     // Sanitize the db table name.
    920                     $table_name = sanitize_key( $table_name );
    921 
    922                     // Sanitize the field name.
    923                     $primary_key_name = sanitize_key( $this->primary_key );
    924 
    925                     // phpcs:disable WordPress.DB.DirectDatabaseQuery
    926                     // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- $variables are sanitized above.
    927                     // phpcs:disable WordPress.DB.PreparedSQL.NotPrepared
    928                     $query_result = $wpdb->query(
    929                         "DELETE FROM $table_name WHERE $primary_key_name IN (" . implode( ',', $delete_id_deletable ) . ')'
    930                     );
    931                     // phpcs:enable
     918                    $deleted_items_count = 0;
     919
     920                    foreach ( $delete_id_deletable as $delete_id ) {
     921                        // Delete the item in the "_table" menu where the id field matches the current $delete_id.
     922                        $query_result_table = $wpdb->query(
     923                            $wpdb->prepare( "DELETE FROM {$wpdb->prefix}daextletal_table WHERE id = %d", $delete_id )
     924                        );
     925
     926                        if ( isset( $query_result_table ) && false !== $query_result_table ) {
     927
     928                            // Get the number of deleted items with $wpdb.
     929                            $deleted_items_count = $deleted_items_count + $wpdb->rows_affected;
     930
     931                        }
     932
     933                        // Delete the items in the "_data" db table where the table_id matches the current $delete_id.
     934                        $wpdb->query(
     935                            $wpdb->prepare( "DELETE FROM {$wpdb->prefix}daextletal_data WHERE table_id = %d", $delete_id )
     936                        );
     937
     938                        // Delete the items in the "_cell" db table where the table_id matches the current $delete_id.
     939                        $wpdb->query(
     940                            $wpdb->prepare( "DELETE FROM {$wpdb->prefix}daextletal_cell WHERE table_id = %d", $delete_id )
     941                        );
     942                    }
    932943
    933944                }
    934945
    935                 if ( isset( $query_result ) && false !== $query_result ) {
    936 
    937                     // Get the number of deleted items with $wpdb.
    938                     $deleted_items_count = $wpdb->rows_affected;
    939 
    940                     $this->shared->save_dismissible_notice(
    941                         $deleted_items_count . ' ' . __( 'items have been successfully deleted.', 'league-table-lite' ),
    942                         'updated'
    943                     );
    944 
    945                 }
    946 
    947                 if ( count( $delete_id_non_deletable ) > 0 ) {
    948 
    949                     $this->shared->save_dismissible_notice(
    950                         __( 'The', 'league-table-lite' ) . ' ' . strtolower( $this->label_plural ) . ' ' . __( "with the following IDs are used in one or more automatic internal links and can't be deleted:", 'league-table-lite' ) . ' ' . implode( ', ', $delete_id_non_deletable ) . '.',
    951                         'error'
    952                     );
    953 
    954                 }
     946                $this->shared->save_dismissible_notice(
     947                    $deleted_items_count . ' ' . __( 'items have been successfully deleted.', 'league-table-lite' ),
     948                    'updated'
     949                );
     950
    955951            }
    956952        }
  • league-table-lite/trunk/inc/class-daextletal-rest.php

    r3294646 r3302012  
    150150        $options['daextletal_load_google_font_2']          = $request->get_param( 'daextletal_load_google_font_2' ) !== null ? esc_url_raw( $request->get_param( 'daextletal_load_google_font_2' ) ) : null;
    151151        $options['daextletal_max_execution_time']          = $request->get_param( 'daextletal_max_execution_time' ) !== null ? intval( $request->get_param( 'daextletal_max_execution_time' ), 10 ) : null;
     152        $options['daextletal_items_per_page_tables_menu']  = $request->get_param( 'daextletal_items_per_page_tables_menu' ) !== null ? intval( $request->get_param( 'daextletal_items_per_page_tables_menu' ), 10 ) : null;
    152153        $options['daextletal_limit_shortcode_parsing']     = $request->get_param( 'daextletal_limit_shortcode_parsing' ) !== null ? intval( $request->get_param( 'daextletal_limit_shortcode_parsing' ), 10 ) : null;
    153154        $options['daextletal_verify_single_shortcode']     = $request->get_param( 'daextletal_verify_single_shortcode' ) !== null ? intval( $request->get_param( 'daextletal_verify_single_shortcode' ), 10 ) : null;
  • league-table-lite/trunk/init.php

    r3294646 r3302012  
    33 * Plugin Name: League Table
    44 * Description: Generates tables in your WordPress blog. (Lite version)
    5  * Version: 1.19
     5 * Version: 1.20
    66 * Author: DAEXT
    77 * Author URI: https://daext.com
  • league-table-lite/trunk/readme.txt

    r3294646 r3302012  
    66Tested up to: 6.8.1
    77Requires PHP: 7.2
    8 Stable tag: 1.19
     8Stable tag: 1.20
    99License: GPLv3
    1010
     
    158158== Changelog ==
    159159
     160= 1.20 =
     161
     162*May 28, 2025*
     163
     164* Deleting multiple tables from the Tables menu now correctly removes the related records from subsidiary database tables.
     165* You can now define how many items are displayed per page in the Tables menu via a new setting.
     166
    160167= 1.19 =
    161168
  • league-table-lite/trunk/shared/class-daextletal-shared.php

    r3294646 r3302012  
    7575
    7676        $this->data['slug'] = 'daextletal';
    77         $this->data['ver']  = '1.19';
     77        $this->data['ver']  = '1.20';
    7878        $this->data['dir']  = substr( plugin_dir_path( __FILE__ ), 0, -7 );
    7979        $this->data['url']  = substr( plugin_dir_url( __FILE__ ), 0, -7 );
     
    9898            $this->get( 'slug' ) . '_load_google_font_2' => '',
    9999            $this->get( 'slug' ) . '_max_execution_time' => '300',
     100            $this->get( 'slug' ) . '_items_per_page_tables_menu' => '10',
    100101            $this->get( 'slug' ) . '_limit_shortcode_parsing' => '1',
    101102            $this->get( 'slug' ) . '_verify_single_shortcode' => '1',
     
    18461847                            ),
    18471848                            array(
     1849                                'name'      => 'daextletal_items_per_page_tables_menu',
     1850                                'label'     => __( 'Items per Page (Tables Menu)', 'league-table-lite' ),
     1851                                'type'      => 'range',
     1852                                'tooltip'   => __(
     1853                                    'This options determines the number of elements per page displayed in the "Tables" menu.',
     1854                                    'league-table-lite'
     1855                                ),
     1856                                'help'      => __( 'Set the number of elements per page displayed in the "Tables" menu.', 'league-table-lite' ),
     1857                                'rangeMin'  => 10,
     1858                                'rangeMax'  => 100,
     1859                                'rangeStep' => 10,
     1860                            ),
     1861                            array(
    18481862                                'name'    => 'daextletal_limit_shortcode_parsing',
    18491863                                'label'   => __( 'Limit Shortcode Parsing', 'league-table-lite' ),
Note: See TracChangeset for help on using the changeset viewer.