Forum Replies Created

Viewing 15 replies - 1 through 15 (of 29,165 total)
  • Forum: Fixing WordPress
    In reply to: Fixing WordPress
    Moderator bcworkz

    (@bcworkz)

    Looking at your site, I’m guessing you’re relying upon JetPack for visitation stats. JetPack related questions can be posted in their dedicated support forum. You’ll want to review the pinned comment over there: Official JetPack Support Resources. For technical reasons, visitation stats are not always 100% accurate, but the methodology wouldn’t change because you changed hosts.

    If you suspect traffic is being blocked, your host’s technical support would be the best place to inquire. Consider the possibility that the missing traffic was of low quality (i.e. bots) and not reflective of true visitor engagement.

    Moderator bcworkz

    (@bcworkz)

    Well, as the notice says, the cause is is_page() was called too early. The post_status on null warnings are likely knock on effects from trying to call get_post_states() before the query has been run, because the passed $post object doesn’t yet have valid information.

    The is_page() error on line 6131 of functions.php is not useful data for finding the root cause since it’s merely part of the function wp_trigger_error(). You need a debug backtrace to learn what the initial call was that started the entire problem.

    Try hooking the ‘wp_trigger_error_run’ action hook and dumping out the return from debug_backtrace() in the callback. The output will give us a better idea of the root cause. Output may not be readily visible on the requested page. You may need to use your browser’s source HTML view to see the output. Search for “array” if the output isn’t immediately apparent.

    The typical reason for such an error is a plugin or theme tried calling is_page() immediately on load instead of hooking an action that fires after the query has run.

    Moderator bcworkz

    (@bcworkz)

    I cannot replicate such behavior, so there’s no way for me (or anyone else) to tell you exactly what’s wrong. I can however suggest what you can do to investigate further. The problem is most likely due to interference from a plugin or your theme. As a test, switch to a default theme and deactivate all plugins but the one generating the embed. If the problem persists, then the problem is within the embed generation code itself. If so, you can either debug the code or replace it with your own code. Instead of relying upon WP functions, you could get the image information on a more direct level. You can get the featured image’s attachment ID from the current post’s meta data, keyed “_thumbnail_id”. With the attachment/thumbnail ID, get its post meta keyed “_wp_attachment_metadata”. The returned array includes all size information needed for the image, including a path relative to /uploads/.

    In theory you can get this information using only native PHP, no WP functions are needed at all, but you ought to be able to use lower level WP functions such as get_post_meta() without any problem. If you cannot even get an attachment ID this way, it’s likely that your DB is corrupted and the problem is not the related PHP code.

    Moderator bcworkz

    (@bcworkz)

    If you’re not seeing the default block editor view, then threadi’s reply above is most appropriate.

    Moderator bcworkz

    (@bcworkz)

    I assume you’re looking for this in the block editor? Be sure the side pane is on the “Post” tab. Click the “Slug” setting. The slug modal will show you the permalink.

    Moderator bcworkz

    (@bcworkz)

    Using plain http:// protocol (instead of https://) on port 443 is invalid. Normal browser requests are typically automatically upgraded to https://. Not so with cURL. Where ever cURL is getting your domain name URL needs to be updated to use https://. I assume this is the site and home URL option settings. On multisite these are not that easy to alter. Try requesting /wp-admin/options.php (type it in, there’s no link in network settings), then searching the long list for the right settings. Don’t forget to scroll to the bottom to click the update button after making changes.

    If even options.php doesn’t work, the settings can be updated via the phpMyAdmin app, usually accessed through your hosting account.

    Moderator bcworkz

    (@bcworkz)

    You can manually re-install v6.9 via FTP. You would extract the .zip file and upload the files yourself instead of letting WP do it. This is a more reliable way to resolve strange problems than using the re-install WP button on the updates admin screen.

    Moderator bcworkz

    (@bcworkz)

    Could this be related to the absence or misconfiguration of GD/Imagick?

    If neither one is present then that would be a problem. Assuming one or the other is at least installed, the error you’re seeing is because your server responded to an upload request in an unusual manner. As the message suggests, it could be due to lack of sufficient memory or the server being too busy. Or anything else that would cause the server to respond with anything aside from 200 OK. If this happens intermittently and inconsistently, the issue is likely due to lack of adequate server resource.

    If the problem occurs consistently with only certain reasonably sized images, and others upload just fine, then the problematic files could be formatted in a way that the image processor doesn’t recognize. Perhaps the image processor version (GD or Imagick) is in need of updating or its configuration is flawed. Seek assistance through your host’s tech support.

    Moderator bcworkz

    (@bcworkz)

    It could be a plugin issue, but this sort of problem is usually somewhere else in the email delivery chain.

    First, confirm that notifications have not landed in your mail client’s spam folder. Server generated emails often end up there. If notifications are being treated as spam, there are several measure you can take to avoid this.

    If you’re sure they are not getting to your email client at all, maybe it is the plugin. Be sure your plugins and WordPress are up to date. If so, the problem is more likely somewhere else in the SMTP mail server chain and an issue external to WordPress.

    Firewalls are beyond the scope of WordPress. Firewall for what? Your computer or your web server? In either case, firewalls are usually already in place. There are other measures you can take to secure your computer or your site.

    Moderator bcworkz

    (@bcworkz)

    There’s no predefined function since apparently a 0xFFFF character is entirely unexpected. However, the wp_insert_post() function does call sanitize_post() before saving data. There are numerous filters available through which you could add code to search and remove offending characters. For example the “pre_post_content” filter. There are similar filters for other default fields such as post_excerpt and post_title.

    The actual removal code could be something like:

    $invalid = array('￿',); // additional undesirable characters may be added to this array
    return str_replace( $invalid, '', $content );

    You only need to wrap this with appropriate filter callback code.

    This would resolve the problem for the default fields of any future posts, but does nothing for existing data, nor for data from get_field('descripcion').

    There is a “esc_xml” filter available through which you could search and remove the invalid character. Of course it would only resolve XML errors, the invalid character would still appear on web pages. While it wouldn’t throw any errors, having the invalid character represented with a ￿ on web pages is not ideal. There are other filters such as “the_content” through which the character could be removed for web pages. But if you could prevent the character from being saved to start with, you needn’t deal with it on output. As I mentioned earlier, you could do a one time global search and remove operation to rid your DB of any existing invalid characters.

    To prevent invalid characters from being saved in custom fields like ‘descripcion’, you might be able to use a filter such as “sanitize_post_meta_{$meta_key}”, but I’m not sure how your custom fields plugin saves data. If the plugin offers similar filters, you’re probably better off using one of those.

    Happy new year!

    Moderator bcworkz

    (@bcworkz)

    Your Memcache plugin may need to be updated. AFAIK, the plugin is required to signal to WP that it’s active, in addition to a slew of other integration. (signal via global $_wp_using_ext_object_cache) All the site health check routine does is check for this signal. It’s conceivable that Memcache is working fine, but it hasn’t properly signaled to WP that it’s there.

    Moderator bcworkz

    (@bcworkz)

    The current style enqueue scheme has no provision to defer style loading. To do so, you’d need to work outside of the enqueue scheme. You could hook the “wp_footer” action and output any desired style blocks or link references you desire. Of course you’d then need to manage any precedence yourself.

    As you may know, enqueued scripts currently have a provision to defer loading, but not styles.

    If you’d like to see a more formal way to do so within the core style enqueue scheme, you could post an enhancement request ticket in the WP Trac system. Please first search existing tickets to ensure there’s not already an existing similar ticket

    Moderator bcworkz

    (@bcworkz)

    You’ll need the phpMyAdmin app in order to hopefully resolve this. It’s generally accessed through your hosting account or cPanel. It allows you to directly view and manipulate the DB.

    If this is a new installation, drop all tables with the wp_kv9a6brmkv_ prefix. Any data you may have added will be lost. Then reinstall WordPress.

    If this is not a new installation, verify that the tables are actually missing. It’s possible they exist but the DB user that WP is using has no permission to access them. The tables’ assigned permissions will need to be corrected.

    If they are truly missing, yet other WP tables such as posts, terms, etc. still exist, your DB has become seriously corrupted and the rest of the DB may not be reliable. It’d be best to drop everything (but first backup what you have now, just on principle), then restore from a known good backup.

    If you don’t have a good backup, you could attempt to patch up the existing DB. Alter the table prefix in the wp-config.php file, then reinstall WP. Rename the new options and postmeta tables using the needed wp_kv9a6brmkv_ prefix. You may drop the remaining new tables. Restore the table prefix in wp-config.php back to what it was. You should regain basic functionality this way, but all of your media uploads (attachment posts) will be lacking crucial information. You’ll need to delete all existing media and re-upload it. This will likely break all the media URLs that exist in your posts. You’ll need to also correct all such URLs. Despite all this effort, it’s possible your site will still not work correctly. We cannot know what else might be wrong with the DB aside from missing tables.

    Moderator bcworkz

    (@bcworkz)

    Escaping is still the right thing to do even if it doesn’t resolve the issue 🙂

    Your invalid character encodes as 0xFFFF, assuming it copy/pasted correctly. I’m pretty sure that really is an invalid UTF-8 character code. So what is it doing in your content in the first place? Would you consider replacing it in your database? You could use the Better Search and Replace plugin to find all instances and replace it with a proper UTF-8 character.

    It looks like it was supposed to be some other letter (maybe with a diacritic) that somehow got improperly encoded. Does it occur in place of a specific letter? Or is it replacing a variety of different letters? If a variety, you may need to manually replace them with the right letters.

    And if it can be replaced, you might need to consider how it got there and take steps to ensure it doesn’t happen again.

    Moderator bcworkz

    (@bcworkz)

    You should be escaping any content prior to output. Run $descripcion1 through esc_xml().

    By truncating the field to the first 600 chars, there could be HTML tags that fail to properly close, which could cause XML issues. There’s no simple, elegant way to make sure everything closes correctly. The brute force way to ensure there are no improper HTML blocks is to simply strip out all HTML tags so only plain text remains. This is what the WP auto-excerpt function does.

Viewing 15 replies - 1 through 15 (of 29,165 total)