• Resolved Gal Baras

    (@galbaras)


    When debugging, I’m seeing the following messages:

    Warning: Attempt to read property “labels” on bool in ROOT/wp-content/plugins/seo-by-rank-math/includes/settings/titles/taxonomies.php on line 15

    Warning: Attempt to read property “singular_name” on null in ROOT/wp-content/plugins/seo-by-rank-math/includes/settings/titles/taxonomies.php on line 15

    Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in ROOT/wp-content/plugins/seo-by-rank-math/includes/settings/titles/taxonomies.php on line 72

    This is on PHP 8.2

    • This topic was modified 1 month, 3 weeks ago by Gal Baras.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @galbaras,
    ?
    Thank you for contacting Rank Math support.
    ?
    Please confirm if you have created a custom taxonomy on your site. If so, please make sure that it has a singular name to get rid of the warnings.
    ?
    Looking forward to helping you.

    Thread Starter Gal Baras

    (@galbaras)

    According to the register_taxonomy reference page, this is optional, and Rank Math should be able to handle taxonomies that don’t have a labels argument at all, and have a label argument instead.

    Hi,

    Have same warnings with php 8.2 but have no custom taxonomies. Have ACF installed just for some field types

    Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @galbaras,

    By default, WordPress’s register_taxonomy() function adds a label automatically if the label is not defined. We tested this from our end and we didn’t receive any errors or warnings. We tested both codes:

    register_taxonomy('genre','book',[ 'label' => __( 'Genre', 'textdomain' ) ]);
    register_taxonomy( 'genre', 'book' );

    Can you please share with us the specific code you used to create the custom taxonomy?

    Looking forward to helping you.

    Thread Starter Gal Baras

    (@galbaras)

    My taxonomies have a label, but don’t have a labels. Not the same thing.

    Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @galbaras,
    ?
    Please share the code you have used to register the taxonomy so we can check it on our end.
    ?
    Looking forward to helping you.

    Thread Starter Gal Baras

    (@galbaras)

    register_taxonomy( 
    'easy-testimonial-category',
    'testimonial',
    array(
    'hierarchical' => true,
    'label' => __('Testimonial Category', 'easy-testimonials'),
    'rewrite' => array(
    'slug' => 'testimonial-category',
    'with_front' => true
    ),
    'show_in_rest' => true
    )
    );
    Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @galbaras,
    ?
    We used the code to create the taxonomy on our end and didn’t get any warnings, even on PHP 8.2 and higher. Please confirm if you have registered another taxonomy using a different code or used a plugin to create the custom taxonomy.?
    ?
    Looking forward to helping you.

    Thread Starter Gal Baras

    (@galbaras)

    OK, following a full plugin isolation, there’s a “media_tag” taxonomy created by the Taxopress plugin, which doesn’t seem to be registered properly, although the plugin lists all the right settings for it.

    I can direct this to the respective plugin authors, but Rank Math should still be able to handle this situation gracefully. You can’t assume that everything is OK, because sometimes, it isn’t. Gotta check.

    Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @galbaras,

    After further investigation, it seems that the issue is not how that plugin registers the taxonomies but rather related to some piece of code that is changing the global $wp_taxonomies which is made evident by the fact that the function get_taxonomy() returns null in the plugin source code.

    We try to avoid adding such workarounds in our plugin to provide compatibility to other plugins so please reach out to the developers of TaxoPress with this information so they can debug why this is happening.

    Thank you.

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.