Mr. W
Forum Replies Created
-
Forum: Plugins
In reply to: [Code Snippets] Fatal error: Allowed memory size of xxx bytes exhaustedHi,
After fixing the problem as I described I haven’t noticed anything. The plugin has been updated and works fine, sorry I couldn’t test it while the error still occurred. At least there are none of these in the database:
(23, 'Order snippets by date', 'Order snippets by last modification date by default in the snippets table.', '\nadd_filter( \'code_snippets/list_table/default_orderby\', function () {\n return \'modified\';\n} );\n\nadd_filter( \'code_snippets/list_table/default_order\', function () {\n return \'desc\';\n} );\n', 'code-snippets-plugin', 'admin', 0, 10, '2020-02-24 09:02:33'),
Forum: Plugins
In reply to: [Code Snippets] Fatal error: Allowed memory size of xxx bytes exhaustedOh, not that it probably matters but I did increase memory from 512 to 768 MB before I did the above. Thanks for looking into it.
Forum: Plugins
In reply to: [Code Snippets] Fatal error: Allowed memory size of xxx bytes exhaustedThanks. I don’t know the cause of the error, but exported the snippets from phpMyAdmin, removed the plugin, dropped the table, reinstalled and manually entered the snippets. Now it’s working again.
When I tried to open the Snippets overview page, the CPU would race, memory usage for the entire VPS would double to 1,5 GB and I had to restart PHP to reset it.
I haven’t had time to investigate details, but there were some odd looking entries in the table, like this:
(23, 'Order snippets by date', 'Order snippets by last modification date by default in the snippets table.', '\nadd_filter( \'code_snippets/list_table/default_orderby\', function () {\n return \'modified\';\n} );\n\nadd_filter( \'code_snippets/list_table/default_order\', function () {\n return \'desc\';\n} );\n', 'code-snippets-plugin', 'admin', 0, 10, '2020-02-24 09:02:33'), (24, 'Order snippets by date', 'Order snippets by last modification date by default in the snippets table.', '\nadd_filter( \'code_snippets/list_table/default_orderby\', function () {\n return \'modified\';\n} );\n\nadd_filter( \'code_snippets/list_table/default_order\', function () {\n return \'desc\';\n} );\n', 'code-snippets-plugin', 'admin', 0, 10, '2020-02-24 09:02:33'), (25, 'Order snippets by date', 'Order snippets by last modification date by default in the snippets table.', '\nadd_filter( \'code_snippets/list_table/default_orderby\', function () {\n return \'modified\';\n} );\n\nadd_filter( \'code_snippets/list_table/default_order\', function () {\n return \'desc\';\n} );\n', 'code-snippets-plugin', 'admin', 0, 10, '2020-02-24 09:02:35'), (26, 'Order snippets by date', 'Order snippets by last modification date by default in the snippets table.', '\nadd_filter( \'code_snippets/list_table/default_orderby\', function () {\n return \'modified\';\n} );\n\nadd_filter( \'code_snippets/list_table/default_order\', function () {\n return \'desc\';\n} );\n', 'code-snippets-plugin', 'admin', 0, 10, '2020-02-24 09:02:37'), (27, 'Order snippets by date', 'Order snippets by last modification date by default in the snippets table.', '\nadd_filter( \'code_snippets/list_table/default_orderby\', function () {\n return \'modified\';\n} );\n\nadd_filter( \'code_snippets/list_table/default_order\', function () {\n return \'desc\';\n} );\n', 'code-snippets-plugin', 'admin', 0, 10, '2020-02-24 09:02:38'), (28, 'Order snippets by date', 'Order snippets by last modification date by default in the snippets table.', '\nadd_filter( \'code_snippets/list_table/default_orderby\', function () {\n return \'modified\';\n} );\n\nadd_filter( \'code_snippets/list_table/default_order\', function () {\n return \'desc\';\n} );\n', 'code-snippets-plugin', 'admin', 0, 10, '2020-02-24 09:02:49'), (29, 'Order snippets by date', 'Order snippets by last modification date by default in the snippets table.', '\nadd_filter( \'code_snippets/list_table/default_orderby\', function () {\n return \'modified\';\n} );\n\nadd_filter( \'code_snippets/list_table/default_order\', function () {\n return \'desc\';\n} );\n', 'code-snippets-plugin', 'admin', 0, 10, '2020-02-24 09:02:51'), (30, 'Order snippets by date', 'Order snippets by last modification date by default in the snippets table.', '\nadd_filter( \'code_snippets/list_table/default_orderby\', function () {\n return \'modified\';\n} );\n\nadd_filter( \'code_snippets/list_table/default_order\', function () {\n return \'desc\';\n} );\n', 'code-snippets-plugin', 'admin', 0, 10, '2020-02-24 09:02:52'), (31, 'Order snippets by date', 'Order snippets by last modification date by default in the snippets table.', '\nadd_filter( \'code_snippets/list_table/default_orderby\', function () {\n return \'modified\';\n} );\n\nadd_filter( \'code_snippets/list_table/default_order\', function () {\n return \'desc\';\n} );\n', 'code-snippets-plugin', 'admin', 0, 10, '2020-02-24 09:02:53'), (32, 'Order snippets by date', 'Order snippets by last modification date by default in the snippets table.', '\nadd_filter( \'code_snippets/list_table/default_orderby\', function () {\n return \'modified\';\n} );\n\nadd_filter( \'code_snippets/list_table/default_order\', function () {\n return \'desc\';\n} );\n', 'code-snippets-plugin', 'admin', 0, 10, '2020-02-24 09:02:54'), (33, 'Order snippets by date', 'Order snippets by last modification date by default in the snippets table.', '\nadd_filter( \'code_snippets/list_table/default_orderby\', function () {\n return \'modified\';\n} );\n\nadd_filter( \'code_snippets/list_table/default_order\', function () {\n return \'desc\';\n} );\n', 'code-snippets-plugin', 'admin', 0, 10, '2020-02-24 09:02:59');
Thanks but I get the same result, it removes the “blog” slug but returns a 404. A bit further down, on the page I linked to, there’s a solution for taxonomies that I modified.
Somewhere I read somewhere that has_archive must be set to true for it to work, could that be it?
Ok, I wasn’t aware that anything put into the post permalink structure would be prepended to custom taxonomies, unless
'with_front' => false
.I found this solution to be put into functions.php, it does set the correct URL but no page is generated (404):
Perhaps you @masedinet are able to tweak it?
Forgot to add:
Array ( [home_url] => https://www.example.com [site_url] => https://www.example.com [version] => 3.5.3 [wp_version] => 5.0.2 [wp_multisite] => [wp_memory_limit] => 256M [wp_debug_mode] => [wp_cron] => 1 [language] => en_US [server_info] => nginx/1.10.3 [php_version] => 7.0.32-0ubuntu0.16.04.1 [php_post_max_size] => 96M [php_max_execution_time] => 300 [php_max_input_vars] => 6000 [max_upload_size] => 67108864 [default_timezone] => UTC [theme] => Array ( [name] => X – Child Theme [version] => 1.0.0 [parent_theme] => X ) [active_plugins] => Array ( [0] => cornerstone/cornerstone.php [1] => perfect-woocommerce-brands/main.php [2] => tco-under-construction/tco-under-construction.php [3] => woocommerce-google-analytics-pro/woocommerce-google-analytics-pro.php [4] => woocommerce-products-filter/index.php [5] => woocommerce-variation-master/woocommerce-variation-master.php [6] => woocommerce/woocommerce.php ) [pwb_options] => Array ( [version] => 1.7.0 [wc_pwb_admin_tab_brand_single_position] => after_meta [old_wc_pwb_admin_tab_slug] => marke-test [wc_pwb_notice_plugin_review] => 0 [wc_pwb_admin_tab_slug] => marke-test [wc_pwb_admin_tab_brand_desc] => yes [wc_pwb_admin_tab_brand_single_product_tab] => yes [wc_pwb_admin_tab_brands_in_loop] => no [wc_pwb_admin_tab_brands_in_single] => brand_image [wc_pwb_admin_tab_brand_logo_size] => woocommerce_thumbnail ) )
- This reply was modified 6 years, 3 months ago by Mr. W.
Forum: Plugins
In reply to: [Perfect Brands for WooCommerce] Filter products by brand alternativeI having conflicts with WOOF, are you using the same filter plugin?
WOOF will display filter terms as slugs instead of product category names when PWB is active. Also, there are weird things happening to the filter search fields, sometimes they disappear after only having applied one filter option.
Array ( [home_url] => https://www.example.com [site_url] => https://www.example.com [version] => 3.5.3 [wp_version] => 5.0.2 [wp_multisite] => [wp_memory_limit] => 256M [wp_debug_mode] => [wp_cron] => 1 [language] => en_US [server_info] => nginx/1.10.3 [php_version] => 7.0.32-0ubuntu0.16.04.1 [php_post_max_size] => 96M [php_max_execution_time] => 300 [php_max_input_vars] => 6000 [max_upload_size] => 67108864 [default_timezone] => UTC [theme] => Array ( [name] => X – Child Theme [version] => 1.0.0 [parent_theme] => X ) [active_plugins] => Array ( [0] => cornerstone/cornerstone.php [1] => perfect-woocommerce-brands/main.php [2] => tco-under-construction/tco-under-construction.php [3] => woocommerce-google-analytics-pro/woocommerce-google-analytics-pro.php [4] => woocommerce-products-filter/index.php [5] => woocommerce-variation-master/woocommerce-variation-master.php [6] => woocommerce/woocommerce.php ) [pwb_options] => Array ( [version] => 1.7.0 [wc_pwb_admin_tab_brand_single_position] => after_meta [old_wc_pwb_admin_tab_slug] => marke-test [wc_pwb_notice_plugin_review] => 0 [wc_pwb_admin_tab_slug] => marke-test [wc_pwb_admin_tab_brand_desc] => yes [wc_pwb_admin_tab_brand_single_product_tab] => yes [wc_pwb_admin_tab_brands_in_loop] => no [wc_pwb_admin_tab_brands_in_single] => brand_image [wc_pwb_admin_tab_brand_logo_size] => woocommerce_thumbnail ) )
I have the same issue. For the site in question I’ve added “/blog/” to the blog entry permalink structure, to separate blog articles from products. It seems PWB uses this permalink structure rather than the shop structure, where for example product categories show like “example.com/productcategory/category-name” and not “example.com/blog/productcategory/category-name”.
Why doesn’t PWB use the normal shop permalink structure?
Thanks for the solution, but it’s an annoyance having to manually edit the plugin at each update.
I don’t even know if it’s relevant, but did you try the new option “Brands page id for linking breadcrumbs” that I mention here?
https://www.ads-software.com/support/topic/brands-page-id-for-linking-breadcrumbs-how-does-it-work/Array ( [home_url] => https://www.example.com [site_url] => https://www.example.com [version] => 3.5.3 [wp_version] => 5.0.2 [wp_multisite] => [wp_memory_limit] => 256M [wp_debug_mode] => [wp_cron] => 1 [language] => en_US [server_info] => nginx/1.10.3 [php_version] => 7.0.32-0ubuntu0.16.04.1 [php_post_max_size] => 96M [php_max_execution_time] => 300 [php_max_input_vars] => 6000 [max_upload_size] => 67108864 [default_timezone] => UTC [theme] => Array ( [name] => X – Child Theme [version] => 1.0.0 [parent_theme] => X ) [active_plugins] => Array ( [0] => cornerstone/cornerstone.php [1] => perfect-woocommerce-brands/main.php [2] => tco-under-construction/tco-under-construction.php [3] => woocommerce-google-analytics-pro/woocommerce-google-analytics-pro.php [4] => woocommerce-products-filter/index.php [5] => woocommerce-variation-master/woocommerce-variation-master.php [6] => woocommerce/woocommerce.php ) [pwb_options] => Array ( [version] => 1.7.0 [wc_pwb_admin_tab_brand_single_position] => after_meta [old_wc_pwb_admin_tab_slug] => marke-test [wc_pwb_notice_plugin_review] => 0 [wc_pwb_admin_tab_slug] => marke-test [wc_pwb_admin_tab_brand_desc] => yes [wc_pwb_admin_tab_brand_single_product_tab] => yes [wc_pwb_admin_tab_brands_in_loop] => no [wc_pwb_admin_tab_brands_in_single] => brand_image [wc_pwb_admin_tab_brand_logo_size] => woocommerce_thumbnail ) )
Forum: Plugins
In reply to: [Perfect Brands for WooCommerce] shortcode for custom-tabPlease have a look at my previous post, I just did that.
It was just a matter of adding this to main.php:
require 'classes/shortcodes/class-pwb-brand-info.php';
I added this to brands in loop:
$image_size = 'thumbnail'; $image_size_selected = get_option('wc_pwb_admin_tab_brand_logo_size'); if($image_size_selected!=false){ $image_size = $image_size_selected; } $attachment_html = wp_get_attachment_image($attachment_id,$image_size);
Perhaps something like this could be used to create a shortcode [pwd-brand-info] that in turn could be placed for example in a tab.
This one per se didn’t work for me, I’m too much of a script kiddie, but similar code worked when creating a custom tab in functions.php. I tried to edit class-perfect-woocommerce-brands.php but perhaps I missed something.
<?php namespace Perfect_Woocommerce_Brands\Shortcodes; defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); class PWB_Brand_Info_Shortcode{ public static function brand_info_shortcode( $atts ) { global $post; $atts = shortcode_atts( array( 'product_id' => null, 'image_size' => 'thumbnail' ), $atts, 'pwb-brand' ); ob_start(); $brands = wp_get_post_terms( $post->ID, 'pwb-brand', array("fields" => "all") ); echo '<div class="pwb-brand-info-shortcode">'; foreach($brands as $brand){ $brand_link = get_term_link ( $brand->term_id, 'pwb-brand' ); $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 ); $attachment_html = wp_get_attachment_image($attachment_id,$atts['image_size']); if(!empty($attachment_html)){ echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$attachment_html.'</a>'; }else{ echo '<a href="'.$brand_link.'" title="'.__( 'View brand', 'perfect-woocommerce-brands' ).'">'.$brand->name.'</a>'; } $queried_object = get_queried_object(); echo term_description( $brand->term_id, 'pwb-brand' ); } echo '</div>'; return ob_get_clean(); } }
Forum: Plugins
In reply to: [YITH WooCommerce Brands Add-On] Rename URLI got it to work using the snippet above plus the snippet from here:
https://www.ads-software.com/support/topic/brand-slugs/#post-8427732Change ‘custom-brands-slug’ to whatever and add to functions.php:
// Remove Brands base
add_filter( ‘yith_wcbr_taxonomy_with_front’, ‘__return_false’ );// Rename Brands slug
if( defined( ‘YITH_WCBR’ ) && ! function_exists( ‘yith_wcbr_change_rewrite_rule’ ) ){
function yith_wcbr_change_rewrite_rule( $rewrite ){
return ‘custom-brands-slug’;
}
add_filter( ‘yith_wcbr_taxonomy_rewrite’, ‘yith_wcbr_change_rewrite_rule’ );
}Forum: Plugins
In reply to: [YITH WooCommerce Brands Add-On] Rename URLThis works, thanks!
But can it be added it via functions.php?Forum: Plugins
In reply to: [YITH WooCommerce Brands Add-On] Brand slugsWhen editing a brand and opening screen options I see an error:
Notice: Undefined index: cb in /var/www/dev.konsttorget.se/wp-content/plugins/yith-woocommerce-brands-add-on/includes/class.yith-wcbr-admin.php on line 182