• Resolved w0uta

    (@w0uta)


    Hi,

    When i activate the plugin i get the follow error.

    [29-Mar-2016 22:46:14 UTC] PHP Catchable fatal error: Object of class stdClass could not be converted to string in /location/subdomain/test/wp-content/plugins/autodescription/inc/classes/init.class.php on line 227

    This error i get only on the home page other pages like to work normaly.

    Is the plugin comptible with PHP 7 ?

    https://wordpress.org/plugins/autodescription/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hi w0uta,

    This plugin is written and tested on PHP7, PHP 5.6, PHP 5.2 and WordPress MultiSite.

    The global WordPress core variable $page has been overwritten by the theme and/or another plugin to become an Object instead of an Integer.
    Which is plainly wrong and should be resolved within the theme or plugin as WordPress core uses it to find the current page within in the loop. More info is found here.

    I’m wondering if switching themes would resolve this, if only temporarily to see if that’s where the problem lies.
    If the theme is open source, I’d be happy to work with the theme author to resolve this issue.
    If it’s an external plugin causing the issue, the same goes for that :).

    I hope this clears things up!

    Thread Starter w0uta

    (@w0uta)

    Hi Sybre,

    The problem is in my theme. Its a costumized theme.
    On the moment i dont understand whats going wrong but maybe i can find out whats going wrong on the index page.
    The theme is build on the Runway framework so i geuss there is the problem.

    If you have any suggestion how to find the issue please let me know.
    Is there a debug option to find where the problem come from ?

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi w0uta,

    This is out of my hands, as it’s embedded within the Runaway Framework.
    I’ve opened an issue on the theme’s GitHub.

    I’ll add a scalar check in the next version, so if something like this happens in the future, it will fall back on page 0 (which is OK in almost all cases).

    If you wish to temporarily edit The SEO Framework plugin, you are free to change line 227 and 228 right at where the error notification leads you to in init.class.php from the following:

    $page = isset( $page ) ? (string) $page : '0';
    $paged = isset( $paged ) ? (string) $paged : '0';

    Into the following:

    $page = isset( $page ) && is_scalar( $page ) ? (string) $page : '0';
    $paged = isset( $paged ) && is_scalar( $paged ) ? (string) $paged : '0';

    I hope this helps and I hope you have a wonderful day! 🙂

    Thread Starter w0uta

    (@w0uta)

    Hi Sybre,

    You are right when i add is_scalar function the error like to be gone. The plugin will bework the same as before the code change ?

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi w0uta,

    The results will only differ when you use Object Caching and have a paginated blog as front page.
    Which will only affect sharing the 2nd or later page on Facebook or Twitter.

    So it has a quite minimal impact :).

    The next version (2.6.0) features a workaround for this issue – which is much more efficient as well; and it’s already in the Alpha version.

    I hope this helps!

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi w0uta,

    The very next update (2.5.2.4) will have this issue fixed as proposed, released momentarily :).

    Thank you for the bug report and have a great day!

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

The topic ‘Error when activate plugin | class stdClass could not be converted to string’ is closed to new replies.