• Resolved Mikey

    (@mikey-d)


    Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home/domain/public_html/wp-includes/functions.php on line 7053

    Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /home/domain/public_html/wp-includes/functions.php on line 2165

    Warning: Attempt to read property “post_type” on null in /home/domain/public_html/wp-includes/post.php on line 7557

    Warning: Attempt to read property “post_type” on null in /home/domain/public_html/wp-includes/post.php on line 7558

    Warning: Attempt to read property “ID” on null in /home/domain/public_html/wp-includes/post.php on line 7562

    Warning: Attempt to read property “post_type” on null in /home/domain/public_html/wp-includes/post.php on line 7843

    Warning: Attempt to read property “post_type” on null in /home/domain/public_html/wp-includes/theme.php on line 3538

    I get the same error with all plugins deactivated, theme switched to 2022, and making sure caching is all off.
    I can edit an existing post, but new posts or pages won’t go through.
    Tried PHP 8, 8.1, 8.2 all same results.

    Stack trace:
    
    0 /home/domain/public_html/wp-config.php(80): require_once()
    
    1 /home/domain/public_html/wp-load.php(50): require_once('/home/theweekly…')
    
    2 /home/domain/public_html/wp-blog-header.php(13): require_once('/home/theweekly…')
    
    3 /home/domain/public_html/index.php(17): require('/home/theweekly…')
    
    4 {main}
    
    thrown in /home/domain/public_html/wp-settings.php on line 33
    [11-Apr-2023 19:57:28 UTC] PHP Warning: require(/home/domain/public_html/wp-includes/version.php): Failed to open stream: No such file or directory in /home/domain/public_html/wp-settings.php on line 33
    [11-Apr-2023 19:57:28 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/domain/public_html/wp-includes/version.php' (include_path='.:/opt/cpanel/ea-php81/root/usr/share/pear') in /home/domain/public_html/wp-settings.php:33
    Stack trace: 0 /home/domain/public_html/wp-config.php(80): require_once() 1 /home/domain/public_html/wp-load.php(50): require_once('/home/theweekly…') 2 /home/domain/public_html/wp-blog-header.php(13): require_once('/home/theweekly…') 3 /home/domain/public_html/index.php(17): require('/home/theweekly…') 4 {main} thrown in /home/domain/public_html/wp-settings.php on line 33
    [11-Apr-2023 19:57:39 UTC] PHP Warning: Attempt to read property "post_type" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3387
    [11-Apr-2023 19:57:39 UTC] PHP Warning: Attempt to read property "ID" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3422
    [11-Apr-2023 19:57:52 UTC] PHP Warning: Attempt to read property "post_type" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3387
    [11-Apr-2023 19:57:52 UTC] PHP Warning: Attempt to read property "ID" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3422
    [11-Apr-2023 19:58:07 UTC] PHP Warning: Attempt to read property "post_type" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3387
    [11-Apr-2023 19:58:07 UTC] PHP Warning: Attempt to read property "ID" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3422
    [11-Apr-2023 19:58:16 UTC] PHP Warning: Attempt to read property "post_type" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3387
    [11-Apr-2023 19:58:16 UTC] PHP Warning: Attempt to read property "ID" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3422
    [11-Apr-2023 19:58:20 UTC] PHP Warning: Attempt to read property "post_type" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3387
    [11-Apr-2023 19:58:20 UTC] PHP Warning: Attempt to read property "ID" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3422
    [11-Apr-2023 19:58:34 UTC] PHP Warning: Attempt to read property "post_type" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3387
    [11-Apr-2023 19:58:34 UTC] PHP Warning: Attempt to read property "ID" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3422
    [11-Apr-2023 19:58:47 UTC] PHP Warning: Attempt to read property "post_type" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3387
    [11-Apr-2023 19:58:47 UTC] PHP Warning: Attempt to read property "ID" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3422
    [11-Apr-2023 19:59:01 UTC] PHP Warning: Attempt to read property "post_type" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3387
    [11-Apr-2023 19:59:01 UTC] PHP Warning: Attempt to read property "ID" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3422
    [11-Apr-2023 19:59:15 UTC] PHP Warning: Attempt to read property "post_type" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3387
    [11-Apr-2023 19:59:15 UTC] PHP Warning: Attempt to read property "ID" on null in /home/domain/public_html/wp-includes/class-wp-query.php on line 3422

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator James Huff

    (@macmanx)

    Try downloading WordPress again, access your server via SFTP or FTP, or a file manager in your hosting account’s control panel (consult your hosting provider’s documentation for specifics on these), and delete then replace your copies of everything on the server except the wp-config.php file and the /wp-content/ directory with fresh copies from the download. This will effectively replace all of your core files without damaging your content and settings.

    If you’d like to manually make a backup of your site first, please follow the steps at https://developer.www.ads-software.com/advanced-administration/security/backup/

    Some uploaders tend to be unreliable when overwriting files, so don’t forget to delete the original files before replacing them.

    • This reply was modified 1 year, 10 months ago by James Huff. Reason: fixed backup link
    Thread Starter Mikey

    (@mikey-d)

    I tried using both the in-dashboard reinstall of core files, manual ftp uploading, and also validating checksums with WordPress Toolkit on cpanel. Neither of those fixed the issue.

    Moderator James Huff

    (@macmanx)

    Does the issue continue under PHP 7.4?

    Thread Starter Mikey

    (@mikey-d)

    Server no longer has PHP 7.4 since it is EOL.

    Moderator James Huff

    (@macmanx)

    Ok, check your file permissions: https://developer.www.ads-software.com/advanced-administration/server/file-permissions/

    Make sure that all files are 644 and all directories are 755.

    If they already are, try 666 for files and 777 for directories.

    Moderator James Huff

    (@macmanx)

    One other possibility could be that your database is larger than allowed and thus new records cannot be saved.

    Sorry, this seems to be quite rare. ??

    Did something change to the hosting of the website? Like a transfer to a new host or migration to a new server? I’ve seen things like this happen after an export/import of a database, where both environments weren’t completely compatible causing the import to fail. The last part is missed in that case where the indexes and autoincrement properties are set. Without an AUTOINCREMENT attribute on the wp_posts (or related) table(s) is missing every new record will be added with id=0 (or NULL) causing an error because it already exists.

    So the database should be checked for this via phpMyAdmin (or similar). You will have to examine the table structure and see if there are indexes defined and an AI (AUTO_INCREMENT) attribute is set on the id field.

    Make sure you have a decent backup of the database, before you change anything and it might be a good idea to hire someone who knows how to fix this and knows their way with the database, because you can also do a lot of harm here.

    Hello Jos,

    Hope you’re well. I have the exact same problem as OP down to the line numbers in the error message. I have tried everything possible including switching off/on plugins and themes, updating core files, rollback, etc.

    And yes, I recently moved my site from Bluehost to Hostinger and this issue seems to have developed since then. Hostinger support is clueless. As per your suggestion I enabled AUTO_INCREMENT for the PRIMARY key in the following tables using PHPmyAdmin.

    xx_options, xx_posts, xx_postmeta

    The issue still persists however. Could you suggest which other tables need A_I for their PRIMARY key? Or something else that needs to be done?

    What exactly could be the that is breaking the post function here?

    Thanks a ton!

    It’s hard to say in detail, because in fact most tables have A_I settings, at least tables with id fields. You might want to compare it with a table of a clean (or at least correctly working website). Also check the database backup from before the transfer. Open it in a text editor and scroll to the bottom. There are the queries that should set the needed indexes and A_I settings. If you compare that database export with a export of the current database, you might see where it went wrong and what part should still be run.

    Again: be careful what you do, because this is advanced stuff.

    Thanks Jos. I followed your advice and found that the issue wasn’t with the A_I but with the PRIMARY key. In the xx_postmeta table the PRIMARY key was somehow assigned to post_id. I changed it to meta_id and voila! Everything works as it should! I got my page to add new posts.

    Thank you so much for your help! Have a good day.

    Hope this bit will be helpful for people facing the same issue.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Unable to create a new post’ is closed to new replies.