Changeset 3095871
- Timestamp:
- 05/31/2024 08:16:07 PM (2 months ago)
- Location:
- rearrange-woocommerce-products/trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
rearrange-woocommerce-products/trunk/readme.txt
r2992103 r3095871 4 4 Tags: woocommerce, ecommerce, product, reorder, rearrange, sort, sortbycategory, Woo 5 5 Requires at least: 4.6 6 Tested up to: 6. 47 Stable tag: 4. 2.06 Tested up to: 6. 7 Stable tag: 4..0 8 8 Requires PHP: 7.4.0 9 9 License: GPLv3 or later License … … 60 60 2. Products rearranging WILL BE undone after deactivating or deleting the plugin if you are doing sorting on products by categories. 61 61 62 63 64 65 62 66 == Troubleshooting == 63 67 … … 69 73 4. Make sure it is set to “Default sorting (custom ordering + name)” 70 74 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** 72 76 73 77 Then it may be issue with PHP configuration done on your server for `memory_limit` and `max_execution_time`. … … 91 95 == ChangeLog == 92 96 97 98 99 100 101 93 102 = Version 4.2.0 = 94 103 * Make plugin compatible with HPOS ( High-Performance Order Storage ) … … 102 111 103 112 = 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. 105 114 Ref: https://wordpress.org/support/topic/products-are-no-longer-displayed-in-categories/#post-16934448 106 115 … … 133 142 - Spanish (Colombia) 134 143 - Spanish (Venezuela) 135 - Russian 136 - Hindi 144 - Russian 145 - Hindi 137 146 - Spanish (Ecuador) 138 147 - Chinese (China) … … 189 198 190 199 = 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. 193 202 194 203 = 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. 196 205 197 206 = 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. 199 208 200 209 = Version 3.0.1 = … … 270 279 = Version 1.1.0 = 271 280 272 * Added capability to handle huge amount of products. 281 * Added capability to handle huge amount of products. 273 282 * Combined multiple sql update queries into one query. 274 283 -
rearrange-woocommerce-products/trunk/rearrange-woocommerce-products.php
r2992103 r3095871 4 4 * Plugin URI: https://wordpress.org/plugins/rearrange-woocommerce-products/ 5 5 * Description: a WordPress plugin to Rearrange Woocommerce Products listed on the Shop page 6 * Version: 4. 2.06 * Version: 4..0 7 7 * Author: Aslam Doctor 8 8 * Author URI: https://aslamdoctor.com/ … … 14 14 * 15 15 * WC requires at least: 4.3 16 * WC tested up to: 8. 2.116 * WC tested up to: 8..1 17 17 * 18 18 * License: GNU General Public License v3.0 … … 54 54 55 55 add_action( 'admin_init', array( $this, 'check_required_plugin' ) ); 56 56 57 57 58 add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) ); … … 67 68 add_action( 'save_post_product', array( $this, 'new_product_added' ), 10, 3 ); 68 69 add_action( 'pre_get_posts', array( $this, 'sort_products_by_category' ), 999 ); 70 71 72 69 73 70 74 add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'add_settings_link_under_plugins_page' ) ); … … 132 136 $pagenow = sanitize_text_field( $_REQUEST['page'] ); 133 137 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 ) { 135 139 return; 136 140 } … … 151 155 ); 152 156 wp_enqueue_script( 'rwpp_js' ); 157 158 159 160 161 162 163 153 164 } 154 165 … … 221 232 add_submenu_page( 222 233 'rwpp-page', 234 235 236 237 238 239 240 241 242 223 243 __( 'Troubleshooting', 'rearrange-woocommerce-products' ), 224 244 __( 'Troubleshooting', 'rearrange-woocommerce-products' ), … … 349 369 350 370 /** 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 351 411 * Modify Products loop query to sort by categories 352 412 * … … 358 418 } 359 419 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 ) { 361 427 $term = get_queried_object(); 362 428 $term_id = $term->term_id; -
rearrange-woocommerce-products/trunk/views/-rearrange-all-products.php
r2917880 r3095871 12 12 <?php require 'template-parts/-header.php'; ?> 13 13 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; ?> 15 15 <div class="notice notice-warning inline top-notice"> 16 16 <ul> 17 17 <li><strong><?php esc_html_e( 'Important Notes', 'rearrange-woocommerce-products' ); ?></strong></li> 18 18 <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 ?> 20 22 <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> 21 23 <?php 22 24 } else { 23 ;24 25 ?> 25 26 <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 ?> 27 30 </ul> 28 31 </div> … … 31 34 <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 ?>"> 32 35 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 37 if ( 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 42 40 include 'template-parts/-tab-all-products.php'; 43 41 } 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 ?> 45 50 46 51 <?php require 'template-parts/-footer.php'; ?> -
rearrange-woocommerce-products/trunk/views/template-parts/-header.php
r2943375 r3095871 18 18 19 19 <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 21 23 <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 23 25 <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> 24 26 </h2>
Note: See TracChangeset
for help on using the changeset viewer.