• Resolved leedxw

    (@leedxw)


    I’m seeing PHP fatal errors triggered by unexpected requests when the plugin is activated.

    curl -v "http://localhost/?s=n&audience=x"
    PHP Fatal error:  Uncaught TypeError: trim(): Argument #1 ($string) must be of type string, WP_Error given in /var/www/html/wp-content/plugins/wonderm00ns-simple-facebook-open-graph-tags/public/class-webdados-fb-open-graph-public.php:739
    Stack trace:
    #0 /var/www/html/wp-content/plugins/wonderm00ns-simple-facebook-open-graph-tags/public/class-webdados-fb-open-graph-public.php(739): trim()
    #1 /var/www/html/wp-includes/class-wp-hook.php(341): Webdados_FB_Public->insert_meta_tags()
    #2 /var/www/html/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters()
    #3 /var/www/html/wp-includes/plugin.php(522): WP_Hook->do_action()
    #4 /var/www/html/wp-includes/general-template.php(3197): do_action()
    #5 /var/www/html/wp-content/themes/theme-child/templates/layouts/main.php(10): wp_head()
    #6 /var/www/html/wp-includes/template-loader.php(132): include('...')
    #7 /var/www/html/wp-blog-header.php(19): require_once('...')
    #8 /var/www/html/index.php(17): require('...')

    The following line change – checking if $term->taxonomy is available before using it, seems to prevent the fatal error in this specific case.

    --- a/public/class-webdados-fb-open-graph-public.php
    +++ b/public/class-webdados-fb-open-graph-public.php
    @@ -396,7 +396,7 @@ if ( ! class_exists( 'Webdados_FB_Public' ) ) :
    } elseif ( is_tax() ) {
    $fb_title = wp_strip_all_tags( stripslashes( single_term_title( '', false ) ), true );
    $term = $wp_query->get_queried_object();
    - $fb_url = get_term_link( $term, $term->taxonomy );
    + $fb_url = ( isset( $term->taxonomy ) ) ? get_term_link( $term, $term->taxonomy ) : $fb_url;
    $debug[] = 'is_tax: ' . $term->taxonomy;
    $tax_desc = trim( wp_strip_all_tags( stripslashes( term_description() ), true ) );
    if ( '' != trim( $tax_desc ) ) {
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Muhammad Usama Azad

    (@usamaazad99)

    Hi @leedxw ,

    I hope you are doing well.

    Thank you for contacting the WP Experts Support Team. I’m happy to assist you today.

    I’ve forwarded your query to our Technical Team for further review, and I will get back to you as soon as I receive an update from them.

    Plugin Support Muhammad Usama Azad

    (@usamaazad99)

    Hi @leedxw

    I hope you are doing well.

    Thanks for your patience! We’ve made some changes to the code. Please download the beta version from the link below and check if the issue is fixed:

    Download Updated Plugin

    Once you’ve had a chance to test it, We’d really appreciate your feedback. It helps us make sure everything is working as expected.

    Looking forward to your response.

    Plugin Support Muhammad Usama Azad

    (@usamaazad99)

    Hi @leedxw ,

    I hope you’re doing well!

    I wanted to follow up on the updated plugin we provided. Have you had a chance to install beta version? Your feedback would be greatly appreciated.

    Looking forward to your feedback.

    Plugin Support Muhammad Usama Azad

    (@usamaazad99)

    Hi @leedxw ,

    I hope you are doing well,

    We are marking this thread as resolved due to inactivity. If you encounter any further issues, please feel free to open a new thread.

    Have a great day!

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.