technocrackers
Forum Replies Created
-
Forum: Everything else WordPress
In reply to: V6.6.2 Block full widthIn WordPress block editor (Gutenberg), you can use the Full Width alignment option for certain blocks, like images or cover blocks, but for Paragraph blocks, this option may not appear by default, depending on the theme you’re using. Here are steps to enable full-width or wide-width for a paragraph block:Steps to Enable Full Width for Paragraph Block:
- Check Your Theme Support: Not all WordPress themes support full-width alignment for all blocks. If your theme doesn’t support this, you may need to modify it or choose a theme that does. To check if your theme supports full-width:
- Go to Appearance > Theme Editor.
- Look for
add_theme_support('align-wide');
in yourfunctions.php
file. If it’s missing, add it.
function mytheme_setup() {
add_theme_support('align-wide');
}
add_action('after_setup_theme', 'mytheme_setup');Use Group Block for Full Width: If your theme supports wide/full-width blocks, but the Paragraph block doesn’t show the option directly, you can:
- Wrap the Paragraph inside a Group block.
- Then set the Group block to full-width.
Here’s how:
- In the editor, insert a Group block.
- Inside the Group block, insert your Paragraph block.
- Click on the Group block (not the paragraph), and in the toolbar, you should see the Full Width option.
Custom CSS Option: If the above steps don’t work or your theme doesn’t support full-width, you can add custom CSS to force the paragraph to full width.
Here’s how to do it:
- In your WordPress Dashboard, go to Appearance > Customize.
- Click on Additional CSS.
- Add the following CSS to make paragraphs full width:
.wp-block-group {
width: 100%;
max-width: none;
}
.wp-block-group p {
max-width: 100%;
}- Full Width Page Template: Some themes include a Full Width page template. You can select it from the page’s Template settings:
- On the right-hand sidebar, click on Page settings.
- Under Template, look for a “Full Width” template option. If available, select it to apply a full-width layout to your page.
If you still don’t see the full-width option for paragraphs after trying these methods, you might need to adjust or change your theme to one that better supports Gutenberg’s full-width features.
Forum: Fixing WordPress
In reply to: No access to my wordpress admin or websiteIt seems that your WordPress installation is encountering compatibility issues with the PHP version your hosting provider is using. The key error here is:
PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported
This error occurs because curly braces for array and string offset access (
$array{$key}
) were deprecated in PHP 7.4 and removed in PHP 8. If your server is running PHP 8.x, but your WordPress codebase uses older syntax, this will break the site.Here are the steps to resolve this issue:Step 1: Update WordPress Core
Ensure your WordPress core is updated to the latest version. Newer versions of WordPress are compatible with PHP 8 and will have removed deprecated curly brace syntax. If you’re unable to access your WordPress admin dashboard to update, you can update it manually:
- Download the latest WordPress version from www.remarpro.com.
- Unzip the files on your local machine.
- Using FTP or your hosting control panel, replace the
wp-admin
andwp-includes
folders with the ones from the new download. Be sure not to overwrite thewp-content
directory to avoid losing theme and plugin data. - Update
index.php
andwp-config.php
if they were modified in the new version.
Step 2: Update Plugins and Themes
Some of your error logs mention plugin-related issues, like the one with
hello.php
. These plugins may also be incompatible with PHP 8.- Go to your WordPress plugins directory (
wp-content/plugins
). - Identify plugins that haven’t been updated for PHP 8 compatibility. Either update them or replace them with compatible versions.
- If a plugin breaks your site and you can’t update it, temporarily disable it by renaming its folder via FTP.
Step 3: Temporary Downgrade to PHP 7.x
If you’re unable to update WordPress or plugins immediately, downgrading your PHP version to 7.4 can provide a temporary fix. This can be done via your hosting provider’s control panel, often under “PHP Settings” or similar options.Step 4: Investigate Possible Security Breach
Some error logs (e.g.,
wso.php
,simple.php
,chosen.php
,bs1.php
) indicate missing or potentially malicious files. You should:- Scan your website for malware. Some of these files might be part of an attack.
- Delete any suspicious or unknown PHP files that might have been injected.
Forum: Fixing WordPress
In reply to: Every Plugin Upgrade fill Debug Log with Scraping home page…Ok Will check that for sure
The
aria-label
attribute is used to improve accessibility by providing a textual description for elements where visible text may not be sufficient or available. Here are the common use cases for placing thearia-label
attribute:Icons without text: If an icon (like a search, cart, or hamburger menu) doesn’t have visible text, use
aria-label
to provide a description.<button aria-label="Open menu">
<i class="icon-menu"></i>
</button>Links or buttons with only images: When an image or icon serves as a link or button, and there is no descriptive text.
<a href="home.html" aria-label="Go to home">
<img src="home-icon.png" alt="">
</a>Form inputs: When form input fields do not have a visible label, use
aria-label
to describe them.<input type="text" aria-label="Search" placeholder="Search">
Custom interactive elements: If you’re using a custom component (like a dropdown or slider) that doesn’t have standard HTML semantics,
aria-label
can describe the element’s purpose.<div role="slider" aria-label="Volume control"></div>
WooCommerce example: In WooCommerce, an
aria-label
can be added to various parts of the UI like add-to-cart buttons, quantity selectors, and product links to enhance accessibility.<button aria-label="Add product to cart">Add to cart</button>
Forum: Fixing WordPress
In reply to: “Just another WordPress site” tagline when sharing to social mediaThe issue you’re encountering, where the old tagline “Just another WordPress site” still appears when sharing links on social media, is typically caused by cached metadata in the Open Graph tags that social media platforms use to generate the preview box (including the title, description, and image). Even though you’ve changed the tagline in your WordPress settings, these platforms may still be pulling outdated information from cached metadata.
Here’s a step-by-step guide to resolve the issue:1. Ensure Open Graph Meta Tags Are Updated
First, make sure your website is correctly using Open Graph meta tags to define the title, description, and image that social media platforms will use when sharing links. If you are using an SEO plugin (such as Yoast SEO or Rank Math), you can control these fields directly from the plugin’s settings.
- Yoast SEO: Go to SEO > Social and ensure the Open Graph meta tags are set with the correct title, description, and image for your site.
- Rank Math: Go to Rank Math > Titles & Meta > Homepage to set your homepage’s meta title, description, and other Open Graph data.
2. Force Social Media Platforms to Scrape Updated Metadata
Once you’ve confirmed that your Open Graph tags are correctly updated, you’ll need to force social media platforms like Facebook and Instagram (which use Facebook’s scraper) to re-fetch the latest metadata.
- Facebook & Instagram: Use the Facebook Sharing Debugger tool.
- Go to Facebook Sharing Debugger.
- Enter the URL of your site (or specific page) and click Debug.
- Click Scrape Again to force Facebook (and Instagram) to re-scrape your page and update the Open Graph data.
- WhatsApp: WhatsApp also uses the same Open Graph data. If it’s updated on Facebook, it should update on WhatsApp as well.
3. Check for Caching Plugins
If you are using any caching plugins (such as W3 Total Cache or WP Super Cache), clear all caches from these plugins. This ensures the latest metadata is served.4. Check CDN Caches
If you’re using a CDN (Content Delivery Network) like Cloudflare, you may need to purge the cache there as well.
- Go to your Cloudflare dashboard and click Purge Cache to remove any old cached data.
5. Clear Object Cache (Optional)
In some cases, if your hosting provider uses an object caching system like Redis or Memcached, clearing these caches can help. You can usually do this from your hosting provider’s control panel or by asking their support team.Summary of Steps:
- Ensure Open Graph tags are correctly set (via SEO plugin).
- Use Facebook Sharing Debugger to force re-scrape.
- Clear WordPress caching plugins.
- Purge CDN caches (if applicable).
- Clear object cache (if applicable).
Following these steps should resolve the issue and ensure the correct tagline appears when sharing your site on social media.
Forum: Fixing WordPress
In reply to: Every Plugin Upgrade fill Debug Log with Scraping home page…You’re correct. Upon reviewing the WordPress core files, it seems there is no
automatic_updates_debug
filter in the WordPress codebase, but there is indeed anautomatic_updates_debug_email
filter, which controls debug messages sent via email after automatic updates.To specifically suppress the scraping of the homepage without affecting other debug features, there is no direct filter provided in the current WordPress core. However, we can address the issue by intercepting the output in a custom manner, using available hooks around the automatic update process.
Here’s an approach to filter out unwanted logs related to the homepage scraping:1. Intercept Debug Logs with a Custom Error Handler
We can create a custom error handler to capture the log entries and filter out the scraping message before it’s written to the log file.
You can add the following code to your theme’s
functions.php
file or a custom plugin:// Custom error handler to filter out scraping logs.
add_action('init', function () {
// Check if WP_DEBUG is enabled.
if (defined('WP_DEBUG') && WP_DEBUG && defined('WP_DEBUG_LOG') && WP_DEBUG_LOG) {
// Set a custom error handler.
set_error_handler('filter_scraping_debug_log', E_USER_NOTICE | E_USER_WARNING | E_USER_ERROR);
}
});
// Custom function to filter the scraping log entry.
function filter_scraping_debug_log($errno, $errstr, $errfile, $errline) {
// Filter out the "Scraping home page" log entry.
if (strpos($errstr, 'Scraping home page...') !== false || strpos($errstr, '<!doctype html>') !== false) {
// Prevent logging of this particular message.
return true; // Returning true prevents the default error handler from continuing.
}
// Let other messages pass through.
return false; // Returning false lets the normal error handler proceed.
}How This Works:
- Custom Error Handler: We are using
set_error_handler()
to define a custom error handler that intercepts messages before they are logged. - Filter Logic: The handler checks if the error message contains
Scraping home page...
or an HTML doctype (<!doctype html>
), and if so, prevents it from being logged. - Fallback for Other Logs: Other debug messages will pass through as usual and be handled by WordPress’s default logging mechanism.
2. Disable Update Rollback Feature (Optional)
If you do not require the rollback feature introduced in WordPress 6.6, you could disable it altogether by adding the following line to your
wp-config.php
file:// Disable the rollback feature.
define('WP_AUTO_UPDATE_ROLLBACK', false);This will stop WordPress from scraping the homepage after updates, which in turn prevents the related logs from being generated.
Forum: Fixing WordPress
In reply to: Every Plugin Upgrade fill Debug Log with Scraping home page…The issue you’re encountering seems to stem from WordPress 6.6’s auto-update and rollback feature that scrapes the homepage to ensure that everything works properly after an automatic update. While this is useful for debugging purposes, it is indeed unnecessary to log the entire HTML of your home page to the debug log after every update.
To resolve this issue, we can adjust the behavior by either preventing the homepage scraping from being logged or suppressing these specific debug entries. Here are two approaches to deal with this issue:
1. Disable Scraping Logging in Debug LogYou can add a filter to prevent logging the scraped HTML output after a plugin update. WordPress offers hooks and filters that you can use to customize its behavior.
Add the following code to your theme’s
functions.php
file or a custom plugin:// Disable logging of scraping output after automatic updates.
add_filter('automatic_updates_debug', function($log_entry, $context) {
if (strpos($log_entry, 'Scraping home page...') !== false) {
// Prevent logging of the HTML body.
return false;
}
return $log_entry;
}, 10, 2);This code checks if the log entry contains the “Scraping home page…” text and stops that entry from being logged by returning
false
.2. Reduce WordPress Debug Log Verbosity
If you don’t need detailed debug information for automatic updates, you can reduce the verbosity of the debug log in general.
In
wp-config.php
, you can turn off the debug log or only log certain types of errors:// Disable WP_DEBUG_LOG or set it to a more restrictive mode.
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
// Disable notices and only log errors and warnings
define('WP_DEBUG_LEVEL', E_ERROR | E_WARNING);This reduces the amount of information logged, including potentially the full HTML scrape output. However, this method may suppress other useful debug information, so it is recommended only if you don’t require extensive logging.
Forum: Developing with WordPress
In reply to: How do you insert patterns programmatically?In WordPress, block patterns are registered and accessed via
WP_Block_Patterns_Registry
. Instead ofget_block_pattern()
, you should useWP_Block_Patterns_Registry::get_instance()->get_registered()
to retrieve the block pattern.// Register the shortcode
function insert_pattern_via_shortcode() {
// Ensure the block patterns registry exists
if ( class_exists( 'WP_Block_Patterns_Registry' ) ) {
// Replace 'my-pattern-slug' with your pattern's slug
$pattern = WP_Block_Patterns_Registry::get_instance()->get_registered( 'my-pattern-slug' );
if ( $pattern && isset( $pattern['content'] ) ) {
return do_blocks( $pattern['content'] );
}
}
return '';
}
// Add the shortcode
add_shortcode( 'insert_pattern', 'insert_pattern_via_shortcode' );Explanation:
WP_Block_Patterns_Registry::get_instance()->get_registered( 'my-pattern-slug' )
: This retrieves the registered pattern by its slug.$pattern['content']
: Accesses the content of the block pattern if it exists.do_blocks( $pattern['content'] )
: Processes the pattern’s block content and outputs it.
How to Use:
- Replace
'my-pattern-slug'
with the slug of the block pattern you want to insert. You can find the slug in your block pattern registration code. - Add the
[insert_pattern]
shortcode in any post or page to display the pattern.
Usage Example in Pages/Posts:
[insert_pattern]
Forum: Developing with WordPress
In reply to: How do you insert patterns programmatically?Yes, it is possible to insert an existing pattern in a WordPress page via PHP and shortcodes. This approach can help prevent your editor from slowing down or crashing by deferring the loading of the pattern until it’s rendered on the front end, rather than during the editing process.
1. Register a Shortcode in WordPress with below code// Register the shortcode
function insert_pattern_via_shortcode() {
// Check if the functiondo_blocks()
exists
if ( function_exists( 'do_blocks' ) ) {
// Replace 'my-pattern-slug' with your pattern's slug
$pattern = get_block_pattern( 'my-pattern-slug' );
if ( $pattern ) {
return do_blocks( $pattern['content'] );
}
}
return '';
}
// Add the shortcode
add_shortcode( 'insert_pattern', 'insert_pattern_via_shortcode' );2. Using the Shortcode in Pages/Posts
Once the shortcode is registered, you can use it in your pages or posts to insert the desired pattern. Simply add the following shortcode where you want the pattern to appear:[insert_pattern]
How it Works:
- The shortcode defers the pattern loading until the page is rendered on the front end.
- The?
get_block_pattern()
?function retrieves the content of the block pattern by its slug (replace?'my-pattern-slug'
?with the actual slug of the pattern you want to insert). - The?
do_blocks()
?function processes the pattern’s block content, which ensures it is properly rendered.
Hi @guildesigns We recently launched this plugin. Please give it a try! Reach out to us if you need any support.
Forum: Reviews
In reply to: [Bulk Price Update for Woocommerce] Awesome plugin!Thanks ??
Forum: Plugins
In reply to: [Christmas Greetings] Plugin Not WorkingCan you please try to change your site wide date format from Settings -> general ?
https://drive.google.com/open?id=176Y7xun6gPD-DCOrVKTP1oYMpk51KMuP
I assume your site language is English and It should work when you select date format mentioned in the screen shot.
Forum: Plugins
In reply to: [Christmas Greetings] Plugin Not Working@salujagaurav
Please try to use date formats
Y-m-d Or m/d/Y OR d/m/YForum: Plugins
In reply to: [Christmas Greetings] Plugin Not WorkingHi @salujagaurav ,
Did you check the start and end dates under settings? Make sure you made it to visible from today.Forum: Reviews
In reply to: [Christmas Greetings] save changes are for adminsWe only allow admin role to change plugin settings. Can you please let us know more about your issue and we are happy to assist you.
- Check Your Theme Support: Not all WordPress themes support full-width alignment for all blocks. If your theme doesn’t support this, you may need to modify it or choose a theme that does. To check if your theme supports full-width: