MyBB Community Forums

Full Version: Google SEO 1.8.4
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
I have a problem that my tasks are not running any more. I already checked several things and I'm pointing it down to the SEO pluging.

Whenever a page is loaded, I get an error in the php log saying, twice.


[29-Jun-2022 21:22:44 Europe/Berlin] PHP Warning:  Trying to access array offset on value of type null in /homepages/u74637/kaikki.de/inc/functions_task.php on line 115

I then added some debug logging into that file and found out that the function
function add_task_log($task, $message)

is called with $task being null and $message containing the following string:

'Warning - [2] \'Undefined array key "extra"\' - Line: 100 - File: inc/plugins/google_seo/url.php

and for the second time it contains the following string:

'Warning - [2] \'Undefined variable $location\' - Line: 1250 - File: inc/plugins/google_seo/url.php'

Does anybody have an idea, what's wrong?
Well, those are simply warnings that should not stop anything from being executed.

But you can try download it from https://github.com/frostschutz/MyBB-Google-SEO and see if it changes anything.
Some additional information about my last post.
The url.php file seems to have two bugs. I'm no PHP expert, but if I'm not mistaken, GOOGLE_SEO_THREAD is defined as

GOOGLE_SEO_THREAD => array(
        'table' => TABLE_PREFIX.'threads',
        'id' => 'tid',
        'name' => 'subject',
        'scheme' => str_replace('&', '&', $settings['google_seo_url_threads']),
        )

and then later it is accessed in line 100 as follows:

$db->google_seo_url[GOOGLE_SEO_THREAD]['extra'] .= ',prefix';

This fails, because 'extra' is not defined. As a workaround I simply added the initialisation of 'extra' in the above statement, i.e., I changed it to
GOOGLE_SEO_THREAD => array(
        'table' => TABLE_PREFIX.'threads',
        'id' => 'tid',
        'name' => 'subject',
        'scheme' => str_replace('&', '&', $settings['google_seo_url_threads']),
        'extra' => '',
        )
No idea, whether that is a good idea, but at least it worked. ;-)



The second issue is in line 1250, where it states

if($location)

but this fails if $location is not set. I think it could be fixed by using

if(isSet($location))
I get these warnings with PHP 8.1 (and possibly 8.0, can't remember) with 1.8.4 of this plugin, but not 7.x.

@frostschutz - would it be possible to tag the current version of Github as 1.8.5? (assuming the current code fixes these warnings that is).
(2022-11-26, 05:56 PM)Rufus McDufus Wrote: [ -> ]I get these warnings with PHP 8.1 (and possibly 8.0, can't remember)  with 1.8.4 of this plugin, but not 7.x.

@frostschutz - would it be possible to tag the current version of Github as 1.8.5?  (assuming the current code fixes these warnings that is).

Same issue with those errors.

@frostschutz kindly, fix those errors!
I made some fixes to this plugin since I was using it, but after upgrading to php 8.1 and migrate my website to the new server, it started to fail. Is sort like a hack that works. I removed one "hack" intercepting mybb queries to reduce the number of final sql queries. Therefore it should be slower.
can you update this plugin for php 8.1 version, because have bug with php 8.1.
(2022-12-30, 04:41 AM)Mediuz Wrote: [ -> ]can you update this plugin for php 8.1 version, because have bug with php 8.1.

You could add the changes of sama34 from here or you could download an adapted version from here

You'll also need a modificated version of pluginlibary for PHP8 e.g. from here
(2022-12-30, 10:18 AM)SvePu Wrote: [ -> ]
(2022-12-30, 04:41 AM)Mediuz Wrote: [ -> ]can you update this plugin for php 8.1 version, because have bug with php 8.1.

You could add the changes of sama34 from here or you could download an adapted version from here

You'll also need a modificated version of pluginlibary for PHP8 e.g. from here

i tried it and got a little error redirect.php line 291 because it is using get_magic_quotes_gpc() function which was removed in php version 8.

You can use other ways to achieve the same effect. For example, you can use ini_get() to check if a particular directive is enabled:

if (ini_get('magic_quotes_gpc'))
            {
                // Dear PHP, I don't need magic, thank you very much.
                $mybb->strip_slashes_array($query_target);
                $mybb->strip_slashes_array($query_current);
            }

thanks for help me..
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26