Plugin Directory

Changeset 3095871

Timestamp:
05/31/2024 08:16:07 PM (2 months ago)
Author:
aslamdoctor
Message:

Version 4.3.0

  • Added settings to enable/disable override main loop or all loops
  • tested with wordpress version 6.5.3
  • tested with woocommerce version 8.9.1
Location:
rearrange-woocommerce-products/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • rearrange-woocommerce-products/trunk/readme.txt

    r2992103 r3095871  
    44Tags: woocommerce, ecommerce, product, reorder, rearrange, sort, sortbycategory, Woo
    55Requires at least: 4.6
    6 Tested up to: 6.4
    7 Stable tag: 4.2.0
     6Tested up to: 6.
     7Stable tag: 4..0
    88Requires PHP: 7.4.0
    99License: GPLv3 or later License
     
    60602. Products rearranging WILL BE undone after deactivating or deleting the plugin if you are doing sorting on products by categories.
    6161
     62
     63
     64
     65
    6266== Troubleshooting ==
    6367
     
    69734. Make sure it is set to “Default sorting (custom ordering + name)”
    7074
    71 **If you have huge list of product and the plugin is not saving the sort order changes** 
     75**If you have huge list of product and the plugin is not saving the sort order changes**
    7276
    7377Then it may be issue with PHP configuration done on your server for `memory_limit` and `max_execution_time`.
     
    9195== ChangeLog ==
    9296
     97
     98
     99
     100
     101
    93102= Version 4.2.0 =
    94103* Make plugin compatible with HPOS ( High-Performance Order Storage )
     
    102111
    103112= Version 4.1.6 =
    104 * Fix enqueue_assets hook not checking hook name properly when site is using different language. 
     113* Fix enqueue_assets hook not checking hook name properly when site is using different language.
    105114Ref: https://wordpress.org/support/topic/products-are-no-longer-displayed-in-categories/#post-16934448
    106115
     
    133142- Spanish (Colombia)
    134143- Spanish (Venezuela)
    135 - Russian 
    136 - Hindi 
     144- Russian
     145- Hindi
    137146- Spanish (Ecuador)
    138147- Chinese (China)
     
    189198
    190199= Version 3.0.4 =
    191 * Fixed: While sorting by categories, some products that are added recently were not visible. 
    192 * Code re-factoring and cleanup. 
     200* Fixed: While sorting by categories, some products that are added recently were not visible.
     201* Code re-factoring and cleanup.
    193202
    194203= Version 3.0.3 =
    195 * Fixed: Keep default sort order on frontend if it was not updated for Categories. 
     204* Fixed: Keep default sort order on frontend if it was not updated for Categories.
    196205
    197206= Version 3.0.2 =
    198 * Fixed: Category orders not showing any products due to meta_query not found. 
     207* Fixed: Category orders not showing any products due to meta_query not found.
    199208
    200209= Version 3.0.1 =
     
    270279= Version 1.1.0 =
    271280
    272 * Added capability to handle huge amount of products.     
     281* Added capability to handle huge amount of products.
    273282* Combined multiple sql update queries into one query.
    274283
  • rearrange-woocommerce-products/trunk/rearrange-woocommerce-products.php

    r2992103 r3095871  
    44 * Plugin URI: https://wordpress.org/plugins/rearrange-woocommerce-products/
    55 * Description: a WordPress plugin to Rearrange Woocommerce Products listed on the Shop page
    6  * Version: 4.2.0
     6 * Version: 4..0
    77 * Author: Aslam Doctor
    88 * Author URI: https://aslamdoctor.com/
     
    1414 *
    1515 * WC requires at least: 4.3
    16  * WC tested up to: 8.2.1
     16 * WC tested up to: 8..1
    1717 *
    1818 * License: GNU General Public License v3.0
     
    5454
    5555            add_action( 'admin_init', array( $this, 'check_required_plugin' ) );
     56
    5657
    5758            add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
     
    6768            add_action( 'save_post_product', array( $this, 'new_product_added' ), 10, 3 );
    6869            add_action( 'pre_get_posts', array( $this, 'sort_products_by_category' ), 999 );
     70
     71
     72
    6973
    7074            add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'add_settings_link_under_plugins_page' ) );
     
    132136            $pagenow = sanitize_text_field( $_REQUEST['page'] );
    133137
    134             if ( 'rwpp-page' !== $pagenow && 'rwpp-sortby-categories-page' !== $pagenow && 'rwpp-troubleshooting-page' !== $pagenow ) {
     138            if ( 'rwpp-page' !== $pagenow && 'rwpp-sortby-categories-page' !== $pagenow && 'rwpp-troubleshooting-page' !== $pagenow ) {
    135139                return;
    136140            }
     
    151155            );
    152156            wp_enqueue_script( 'rwpp_js' );
     157
     158
     159
     160
     161
     162
     163
    153164        }
    154165
     
    221232            add_submenu_page(
    222233                'rwpp-page',
     234
     235
     236
     237
     238
     239
     240
     241
     242
    223243                __( 'Troubleshooting', 'rearrange-woocommerce-products' ),
    224244                __( 'Troubleshooting', 'rearrange-woocommerce-products' ),
     
    349369
    350370        /**
     371
     372
     373
     374
     375
     376
     377
     378
     379
     380
     381
     382
     383
     384
     385
     386
     387
     388
     389
     390
     391
     392
     393
     394
     395
     396
     397
     398
     399
     400
     401
     402
     403
     404
     405
     406
     407
     408
     409
     410
    351411         * Modify Products loop query to sort by categories
    352412         *
     
    358418            }
    359419
    360             if ( is_tax( 'product_cat' ) && $query->is_main_query() && ! is_admin() ) {
     420            if ( get_option( 'rwpp_effected_loops' ) ) {
     421                $checker = is_tax( 'product_cat' ) && ! is_admin();
     422            } else {
     423                $checker = is_tax( 'product_cat' ) && $query->is_main_query() && ! is_admin();
     424            }
     425
     426            if ( $checker ) {
    361427                $term    = get_queried_object();
    362428                $term_id = $term->term_id;
  • rearrange-woocommerce-products/trunk/views/-rearrange-all-products.php

    r2917880 r3095871  
    1212<?php require 'template-parts/-header.php'; ?>
    1313
    14 <?php if ( ! ( isset( $_GET['page'] ) && ! empty( $_GET['page'] ) && 'rwpp-troubleshooting-page' === $_GET['page'] ) ) : // phpcs:ignore WordPress.Security.NonceVerification; ?>
     14<?php if ( ! ( isset( $_GET['page'] ) && ! empty( $_GET['page'] ) && ) ) : // phpcs:ignore WordPress.Security.NonceVerification; ?>
    1515<div class="notice notice-warning inline top-notice">
    1616    <ul>
    1717        <li><strong><?php esc_html_e( 'Important Notes', 'rearrange-woocommerce-products' ); ?></strong></li>
    1818        <li>- <?php esc_html_e( 'Use "single click" to select multiple products and drag them.', 'rearrange-woocommerce-products' ); // phpcs:ignore ?></li>
    19         <?php if ( isset( $_GET['page'] ) && ! empty( $_GET['page'] ) && 'rwpp-sortby-categories-page' === $_GET['page'] ) {  // phpcs:ignore WordPress.Security.NonceVerification ?>
     19        <?php
     20        if ( isset( $_GET['page'] ) && ! empty( $_GET['page'] ) && 'rwpp-sortby-categories-page' === $_GET['page'] ) {  // phpcs:ignore WordPress.Security.NonceVerification
     21            ?>
    2022            <li>- <?php esc_html_e( 'Products arranged below', 'rearrange-woocommerce-products' );?> <strong><?php esc_html_e('will be reset', 'rearrange-woocommerce-products' );?></strong> <?php esc_html_e('after deactivating or deleting the plugin.', 'rearrange-woocommerce-products' ); // phpcs:ignore ?></li>
    2123            <?php
    2224        } else {
    23             ;
    2425            ?>
    2526            <li>- <?php esc_html_e( 'Products arranged below', 'rearrange-woocommerce-products' );?> <strong><?php esc_html_e('can not be undone');?></strong> <?php esc_html_e('after deactivating or deleting the plugin.', 'rearrange-woocommerce-products' ); // phpcs:ignore ?></li>
    26         <?php } ?>
     27            <?php
     28        }
     29        ?>
    2730    </ul>
    2831</div>
     
    3134<input type="hidden" name="rwpp_current_page_url" id="rwpp_current_page_url" value="<?php echo isset( $_SERVER['REQUEST_URI'] ) ? esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized ?>">
    3235
    33     <?php
    34     if ( isset( $_GET['page'] ) && ! empty( $_GET['page'] ) && 'rwpp-sortby-categories-page' === $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification
    35         include 'template-parts/-tab-category-products.php';
    36         if ( isset( $_GET['term_id'] ) && ! empty( $_GET['term_id'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
    37             include 'template-parts/-tab-all-products.php';
    38         }
    39     } elseif ( isset( $_GET['page'] ) && ! empty( $_GET['page'] ) && 'rwpp-troubleshooting-page' === $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification
    40         include 'template-parts/-tab-troubleshooting.php';
    41     } else {
     36<?php
     37if ( isset( $_GET['page'] ) && ! empty( $_GET['page'] ) && 'rwpp-sortby-categories-page' === $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification
     38    include 'template-parts/-tab-category-products.php';
     39    if ( isset( $_GET['term_id'] ) && ! empty( $_GET['term_id'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
    4240        include 'template-parts/-tab-all-products.php';
    4341    }
    44     ?>
     42} elseif ( isset( $_GET['page'] ) && ! empty( $_GET['page'] ) && 'rwpp-troubleshooting-page' === $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification
     43    include 'template-parts/-tab-troubleshooting.php';
     44} elseif ( isset( $_GET['page'] ) && ! empty( $_GET['page'] ) && 'rwpp-settings-page' === $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification
     45    include 'template-parts/-tab-settings.php';
     46} else {
     47    include 'template-parts/-tab-all-products.php';
     48}
     49?>
    4550
    46     <?php require 'template-parts/-footer.php'; ?>
     51<?php require 'template-parts/-footer.php'; ?>
  • rearrange-woocommerce-products/trunk/views/template-parts/-header.php

    r2943375 r3095871  
    1818
    1919        <a href="<?php echo esc_attr( admin_url( 'admin.php?page=rwpp-sortby-categories-page' ) ); ?>" class="nav-tab <?php echo ( isset( $_GET['page'] ) && ! empty( $_GET['page'] ) && 'rwpp-sortby-categories-page' === $_GET['page'] ) ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Sort by Categories', 'rearrange-woocommerce-products' ); ?></a>
    20        
     20
     21        <a href="<?php echo esc_attr( admin_url( 'admin.php?page=rwpp-settings-page' ) ); ?>" class="nav-tab <?php echo ( isset( $_GET['page'] ) && ! empty( $_GET['page'] ) && 'rwpp-settings-page' === $_GET['page'] ) ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Settings', 'rearrange-woocommerce-products' ); ?></a>
     22
    2123        <a href="<?php echo esc_attr( admin_url( 'admin.php?page=rwpp-troubleshooting-page' ) ); ?>" class="nav-tab <?php echo ( isset( $_GET['page'] ) && ! empty( $_GET['page'] ) && 'rwpp-troubleshooting-page' === $_GET['page'] ) ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Troubleshooting', 'rearrange-woocommerce-products' ); ?></a>
    22        
     24
    2325        <a href="https://github.com/sponsors/aslamdoctor" target="_blank" class="nav-tab"><img src="<?php echo plugin_dir_url( __DIR__ ) . '../img/icon-tea.png'; ?>." alt=""><?php esc_html_e( 'Sponsor me', 'rearrange-woocommerce-products' ); ?></a>
    2426    </h2>
Note: See TracChangeset for help on using the changeset viewer.