wpmansour
Forum Replies Created
-
Apologies for the inconvenience. Since you’ve purchased our plugin, we’d like to offer you specialized assistance through our premium support channel. Please fill out our premium support form at https://getwpo.com/premium-support for a quick resolution to your issue. Thank you for choosing our services, and we look forward to resolving this promptly for you.
You’re welcome, I’m glad to hear that it worked!
Hello Brenda,
Thank you for reaching out. To fix the issue with the mobile menus on your websites after installing WP Optimize, you can try these steps:
- Enable Separate Files for Mobile: Go to WP-Optimize ? Cache ? Cache settings and enable “Generate separate files for mobile devices”.
- Disable Minification: If the issue persists, try turning off minification in WP-Optimize ? Minify to see if that helps.
Please try these adjustments and let me know if it resolves the issue!
Best regards,
Mansour MAs a first step, you can just let me know: What version of PHP are you using in your XAMPP environment? Different versions might handle type conversions and errors differently!
Thank you for your patience and for providing such detailed information about the issue you’ve encountered with the WP-Optimize plugin.
We have successfully replicated the error on our end, and I’ve forwarded all the relevant details to our development team for further investigation.
They’re now working on identifying the root cause and will aim to deliver a fix as soon as possible.
We appreciate your effort in helping us improve our plugin and apologize for any inconvenience this may have caused. We’ll keep you updated on the progress and notify you once a resolution is implemented.
We truly appreciate your patience and cooperation.
Thank you for sharing the site health information; it has been helpful in further investigating the issue. I noticed that
WP_HOME
andWP_SITEURL
are undefined, which is common in local setups. Typically, browsers require a proper domain to accept or authorize cookies by default. Since this is a local environment, I suggest updating yourwp-config.php
file to address cookie handling. Please ensure that you remove the linedefine('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']);
that I suggested earlier, and replace it with the following code:define('ADMIN_COOKIE_PATH', '/'); define('COOKIE_DOMAIN', ''); define('COOKIEPATH', ''); define('SITECOOKIEPATH', ''); define('COOKIE_DOMAIN', false);
After adding this, please clear your browser’s cache completely, close the browser, and then try logging in again with a fresh window. Let us know how it goes!
To address the “Array to string conversion” warning you’re encountering, I recommend checking a few details to help diagnose the issue effectively:
- Inspect Variables: Could you check the contents of
$header[$i]['handles']
and$header[$i]['versions']
just before the warning triggers? Adding aprint_r
orvar_dump
right before the problematic line would help reveal what data is being processed. - PHP Version: What version of PHP are you using in your XAMPP environment? Different versions might handle type conversions and errors differently.
- Recent Modifications: Have there been any recent modifications in your code or updates that could affect these variables?
- PHP Configuration: Are there any specific settings in your
php.ini
that might be customized, particularly those related to error reporting?
These steps should help us get closer to understanding and resolving the issue.
Thank you for your patience and for providing such detailed information about the issue you’ve encountered with the WP-Optimize plugin.
We have successfully replicated the error on our end, and I’ve forwarded all the relevant details to our development team for further investigation. They’re now working on identifying the root cause and will aim to deliver a fix as soon as possible.
We appreciate your effort in helping us improve our plugin and apologize for any inconvenience this may have caused. We’ll keep you updated on the progress and notify you once a resolution is implemented.
We truly appreciate your patience and cooperation.
No, currently we do not have the capability to exclude CSS minification specifically for a single page while maintaining other optimizations. On the other hand, we do offer the option to entirely exclude a page from caching via the “Do not cache this page” feature.
We truly value user feedback and have taken note of your request to provide more granular control over CSS minification. While I can’t guarantee an exact release date for this feature, I have added it to our feature request board and we are considering it for future updates.
Thank you for your suggestion!
Thank you for your patience, we are actively investigating it and would like to gather any additional details. It would be very helpful if you could send us your WordPress Site Health Info. This information can provide crucial details that could help us understand what might be causing the problem.
Here’s how you can copy the Site Health Info:
- Go to your WordPress admin dashboard.
- Navigate to Tools > Site Health.
- Click on the Info tab.
- Press Copy site info to clipboard.
Here’s a screenshot to guide you: Site Health Info (https://prnt.sc/g708fnsnFzBf)
Once you have that copied, please paste it into a tool such as pastebin.com and share the link here. This will greatly assist us in diagnosing the problem more accurately.?
Thank you for your cooperation,
Hi there!
Thank you for bringing this issue to our attention. I’ve tried replicating the problem on our end, but everything seems to be functioning normally here.
Could you please try deactivating the WP-Optimize plugin and then reactivating it?
After doing this, please check if the warning message still appears. Let me know how it goes, and we can explore further steps if needed!
ThanksHello,
I’m sorry to hear about the trouble you’re experiencing while trying to log into WordPress. Let’s try a few steps that should help resolve the “Cookies are blocked or not supported by your browser” error:
- Enable Cookies in Your Browser: It’s essential that cookies are enabled in your browser. You can find how to do this by visiting this link: Enable Cookies.
- Clear Browser Cookies: If you recently changed servers, clear your browser cookies and try logging in again.
- Update Your wp-config.php File: Add the following line to your
wp-config.php
file, just before the/* That's all, stop editing! Happy publishing. */
line:define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']);
- Adjust functions.php: If the issue persists, add the following code to your theme’s
functions.php
file:
if (SITECOOKIEPATH != COOKIEPATH) { setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN); }
By following these steps, you should be able to resolve the login issue. Please let me know if you continue to experience problems after completing all the steps outlined above.
Thanks!
- This reply was modified 7 months ago by wpmansour.
Hello,
I’m glad to hear that the solution works well for new products! To extend the functionality so that the cache is also purged when an existing product is updated or changed in status (like being unpublished), you can modify the function to react to updates as well.
Here’s how you can adjust the code to handle changes in existing products:
function custom_purge_pages_on_products($post_id, $post, $update) { // Check if it's a product if ($post->post_type == 'product') { // Array of page IDs where the cache needs to be purged $page_ids = [123, 124, 125]; // Add or remove page IDs as needed // Check if the product is being updated or unpublished if ($update || $post->post_status == 'draft' || $post->post_status == 'pending') { // Loop through each page ID and purge its cache foreach ($page_ids as $page_id) { WPO_Page_Cache::delete_single_post_cache($page_id); } } } } add_action('save_post', 'custom_purge_pages_on_products', 10, 3);
This updated function checks not only for new products but also for updates to existing products, including changes to statuses like draft or pending, which typically include actions like unpublishing a product. Whenever any of these changes occur, it will purge the cache for the specified pages.
Please add or modify the page IDs in the
$page_ids
array to match those where your products are displayed. This should ensure that your product listings are always current, reflecting the latest updates and status changes.Best Regards,
Mansour MAbsolutely, I’m happy to help with that!
To extend the cache purge to several specific pages, we can easily modify the code to include multiple IDs. Here’s an example that covers the page IDs you mentioned—123, 124, and 125:
function custom_purge_multiple_pages_on_new_product($post_id, $post, $update) { // Check if it's a new product if ($post->post_type == 'product' && !$update) { // Array of page IDs where the cache needs to be purged $page_ids = [123, 124, 125]; // Feel free to modify this list // Loop through the list and purge cache for each page foreach ($page_ids as $page_id) { WPO_Page_Cache::delete_single_post_cache($page_id); } } } add_action('wp_insert_post', 'custom_purge_multiple_pages_on_new_product', 10, 3);
Hope this helps! If you have any more questions or need further assistance, please don’t hesitate to reach out.
Best regards,
Mansour MThanks for the additional clarification! If you have a single page where you display WooCommerce products via a shortcode and you want to purge the cache of that specific page whenever a new product is created, the function can be simplified. Here’s an updated version of the code to meet this specific need:
function custom_purge_on_new_product($post_id, $post, $update) { // Check if it's a new product if ($post->post_type == 'product' && !$update) { // Specify the ID of the page where the shortcode is displayed $page_id = 123; // Replace with your actual page ID // Purge the cache for the specified page WPO_Page_Cache::delete_single_post_cache($page_id); } } add_action('wp_insert_post', 'custom_purge_on_new_product', 10, 3);
Replace
123
with the ID of the page that displays the WooCommerce products via your shortcode. This setup ensures that each time a new product is added, visitors to that page will see the most recent content without any caching issues.If in the future, you decide to display products on multiple pages and wish to purge several pages’ caches upon product creation, you can easily modify this snippet by turning
$page_id
into an array of page IDs and looping through it to purge each one.I hope this solution meets your needs effectively! If you have any more questions, need further modifications, or require assistance with anything else, please don’t hesitate to reach out. I’m here to help ensure everything works smoothly for you ??
Best regards,
Mansour M