Incompatibility with php 8.0.1
-
Hello,
I have this warnings in page admin:Warning : Attempt to read property “name” on int in /data/web/virtuals/236156/virtual/www/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-base.php on line 106
Warning : Attempt to read property “description” on int in /data/web/virtuals/236156/virtual/www/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-base.php on line 106
Can you fix this, please?
Thak you
-
Hello @davidki,
Thank you for contacting the support and sorry for any inconvenience that might have been caused due to that.
We couldn’t reproduce this issue on our setup. We checked this by adding
%category%&%categoies%variable in the post in PHP v8.Please ensure that the server’s read & write settings are correct. You can contact your hosting on that. Here’s an article on what they should be:
and
https://www.malcare.com/blog/wordpress-file-permissions/If that does not help, and assuming you are using the latest version of all the plugins, themes, and WordPress (please update if not yet), it would seem like a conflict with one of the plugins or the theme you are using.
To determine that, please follow this troubleshooting guide:
https://rankmath.com/kb/check-plugin-conflicts/Only the site admin would know and your users won’t be affected by this troubleshooting.
You can follow this video tutorial as well:
Looking forward to helping you.
Hello,
I did everything what you wrote to me.
The only one thing which cause the warning messages in my website admin is your Rank Math plugin.
I disabled all plugins except Rank Math and activated default wordpress theme Twenty Twenty-One.
The warning messages in my website admin are still there.
After disabled Rank Math plugin, the warning messages are gone (even with enabled all my plugins and my custom theme again).So this is the prove, that only Rank Math plugin cause these problems with php 8.0.1 (no problems with php 7.4)
I wanted to buy your PRO version, but Rank Math is the only one plugin that will not allow me to use php 8. So I’ll have to delete this plugin rather that buy PRO version, if you don’t fix it.
Here are all warning messages which I found in my website admin:
1. Page admin (wp-admin/post.php):
Warning : Attempt to read property “name” on int in /data/web/virtuals/236156/virtual/www/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-base.php on line 106Warning : Attempt to read property “description” on int in /data/web/virtuals/236156/virtual/www/wp-content/plugins/seo-by-rank-math/includes/replace-variables/class-base.php on line 106
2. List of posts – in column of my custom taxonomy “recenze” (/wp-admin/edit.php):
Warning: Attempt to read property “slug” on int in /data/web/virtuals/236156/virtual/www/wp-admin/includes/class-wp-posts-list-table.php on line 1271Warning: Attempt to read property “name” on int in /data/web/virtuals/236156/virtual/www/wp-admin/includes/class-wp-posts-list-table.php on line 1274
Warning: Attempt to read property “term_id” on int in /data/web/virtuals/236156/virtual/www/wp-admin/includes/class-wp-posts-list-table.php on line 1274
3. List of pages – in column of my custom taxonomy “kategorie” (/wp-admin/edit.php?post_type=page):
Warning: Attempt to read property “slug” on int in /data/web/virtuals/236156/virtual/www/wp-admin/includes/class-wp-posts-list-table.php on line 1271Warning: Attempt to read property “name” on int in /data/web/virtuals/236156/virtual/www/wp-admin/includes/class-wp-posts-list-table.php on line 1274
Warning: Attempt to read property “term_id” on int in /data/web/virtuals/236156/virtual/www/wp-admin/includes/class-wp-posts-list-table.php on line 1274
4. List of custom post type “sleva” – in column of my custom taxonomy “sleva-kategorie” (/wp-admin/edit.php?post_type=sleva):
Warning: Attempt to read property “slug” on int in /data/web/virtuals/236156/virtual/www/wp-admin/includes/class-wp-posts-list-table.php on line 1271Warning: Attempt to read property “name” on int in /data/web/virtuals/236156/virtual/www/wp-admin/includes/class-wp-posts-list-table.php on line 1274
Warning: Attempt to read property “term_id” on int in /data/web/virtuals/236156/virtual/www/wp-admin/includes/class-wp-posts-list-table.php on line 1274
Thank you for fixing it.
David
Any update, please?
Hello @davidki
Can you please record a video showing the troubleshooting mode using the Health Check plugin? You can use a free service like Loom for it.
The error which you are getting is on post type and the taxonomy filter is not normal. By default WordPress, doesn’t add Taxonomies on Pages. There must be some code that is adding this and changing the
get_termsobject.You can also check our knowledgebase articles on our website.
Looking forward to helping you. Thank you.
The plugin “Health Check & Troubleshooting” do everything what I already did. Turns off one plugin at a time until there are 2 plugins left that interact with each other.
I already know which 2 plugins. These are yours Rank Math plugin and my custom plugin which register my custom post type and custom taxonomy even for page post type.
But like I wrote to you before, when I disable Rank Math plugin, everything is OK, and also in PHP 7.4 was everything ok. Only in PHP 8 is problem with Rank Math.
Below I wrote code from my custom plugin, which register my custom taxonomy for page post type. Plese, try to find where is the problem with my code and Rank Math.
if(!function_exists('my_page_taxonomy')){ function my_page_taxonomy(){ $taxArray = array(array('tax_slug' => 'kategorie', 'single_name' => 'Kategorie'), array('tax_slug' => 'kategorie-typ', 'single_name' => 'Typ'), array('tax_slug' => 'kategorie-obchod', 'single_name' => 'Kategorie - obchod')); foreach($taxArray as $tax){ $labels = array('name' => $tax['single_name'], 'singular_name' => $tax['single_name'], 'menu_name' => $tax['single_name']); $args = array('labels' => $labels, 'public' => true, 'hierarchical' => true, 'show_tagcloud' => false, 'show_admin_column' => true, 'rewrite' => array('slug' => $tax['tax_slug']), 'query_var' => false, 'show_in_rest' => true); register_taxonomy($tax['tax_slug'], 'page', $args); } } add_action('init', 'my_page_taxonomy'); }Would it help if I sent you a php file that registers my custom post type and all custom taxonomies?
I will add that warning messages are only for that pages, or posts which have not been assigned to any taxonomy term.
Hello,
I finally resolved it and Found where was the problem.
The problem was in Rank Math “rank_math_primary_category” meta which have some value other than “0”. I don’t want to use rank_math_primary_category feature.
So I deleted all meta with keys “rank_math_primary_” from my database and the warnings messages disappeared.
But when I create new page, the meta with key “rank_math_primary_” is still creating.
How can I stop this?
Hello @davidki
Please add the following filter code in functions.php file to disable the Primary term feature:
https://rankmath.com/kb/filters-hooks-api-developer/#disable-primary-term-featureAlso, can you please tell us what value you have added in the Title & Description field? We still couldn’t reproduce this issue on our setup after adding the taxonomy code you provided. We checked in PHP v8, by adding the Custom term variable in the Title field.
Looking forward to helping you. Thank you.
The topic ‘Incompatibility with php 8.0.1’ is closed to new replies.