News:

Wondering if this will always be free?  See why free is better.

Main Menu

Optimus

Started by Bugo, February 15, 2011, 03:48:12 PM

Previous topic - Next topic

vitalog2010

Quote from: vitalog2010 on November 07, 2024, 09:59:36 AMDear @Bugo,

I recently installed Optimus 3.0 Beta and I'm trying to add a meta-tag description.

When I set "The forum description" for the Homepage, the meta-tag description remains the same across every page of the forum.

Configuration Details:
"Display the topic first message snippet as the meta-tag description": Enabled

In Optimus 2.13, this configuration worked perfectly, displaying the topic's first message snippet as the meta-tag description. However, it doesn't seem to function the same way in Optimus 3.0 Beta.

System Information:
  • SMF 2.1.4
  • PHP 8.2
  • Optimus 3.0 Beta
  • Installed mod: Stop Forum Spam

Could you please guide me on how to resolve this issue in Optimus 3.0 Beta?


After extensive testing, I finally identified the problem. [Refer to my initial request for more details, and check my previous messages in this topic].

@Bugo , I tested Optimus v3.0 RC1 and pinpointed the issue. Note that I conducted these tests on a clean SMF 2.1.4 with PHP 8.2 (no additional mods installed).

Here are the detailed test results:

When "Search Engine Friendly URLs" is checked in the "General Configuration" on SMF, and "Display the topic first message snippet as the meta-tag description" is enabled in the Optimus settings, the page meta description is the same for all pages.

How to verify the issue after making these settings:

  • Go to the main page of the forum by clicking the forum name. (Do not refresh the same page, follow the steps)
  • Click on any board.
  • Click on any topic.
  • Refresh the topic page using Ctrl+F5.
  • Open the page source to see the meta description.

You will see that the meta description is the same on all pages. However, when I disable "Search Engine Friendly URLs" in the global settings on SMF, the Optimus mod works correctly.

Hope you could you fix this issue in the next release or provide us resolution.

Screenshots of the settings:
1. SMF General Configuration
[nofollow]
2. Optimus Settings
[nofollow]
3. Topic Page source code (same meta description in the every forum pages):
[nofollow]

Thank you.
My System Information:
  • SMF Version: 2.1.4
  • PHP Version: 8.2
  • MySQL version: 8.0.40
  • Installed mods: Stop Forum Spam 1.5.6

Bugo

@vitalog2010 Thank you for the research conducted. I never enable that option, so I probably wouldn't have noticed. Try changing the code

if (empty(Utils::$context['current_action'])
    && empty(Input::server('query_string'))
    && empty(Input::server('argv'))
) {
    Utils::$context['meta_description'] = Input::xss(Config::$modSettings['optimus_description']);
}

in the Sources/Optimus/Handlers/FrontPageHandler.php file to this:

if (empty(Utils::$context['current_action'])
    && empty(Input::server('query_string'))
    && empty(Input::server('path_info'))
    && empty(Input::server('argv'))
) {
    Utils::$context['meta_description'] = Input::xss(Config::$modSettings['optimus_description']);
}

Xpresskonami

Quote from: Xpresskonami on November 29, 2024, 03:20:38 AMHello I use smf 2.0
I activate a Cloudflare DDos attack in which new visitors will pass through verification before accessing my forum. But My content image graph stops working whenever i share a post to whatsapp group or Facebook. But if i deactivate the cloudflare Ddos attack. The open image graph will start working back. Please how can I fix this with the DDOs activated?

How can I fix this ?? @Bugo

vitalog2010

Quote from: Bugo on December 08, 2024, 10:49:26 PM@vitalog2010 Thank you for the research conducted. I never enable that option, so I probably wouldn't have noticed. Try changing the code

if (empty(Utils::$context['current_action'])
    && empty(Input::server('query_string'))
    && empty(Input::server('argv'))
) {
    Utils::$context['meta_description'] = Input::xss(Config::$modSettings['optimus_description']);
}

in the Sources/Optimus/Handlers/FrontPageHandler.php file to this:

if (empty(Utils::$context['current_action'])
    && empty(Input::server('query_string'))
    && empty(Input::server('path_info'))
    && empty(Input::server('argv'))
) {
    Utils::$context['meta_description'] = Input::xss(Config::$modSettings['optimus_description']);
}


@Bugo,

Thank you so much. The problem is solved.

I have another question: Could you please add a "rel" attribute option in the next release to include, for example, rel="noopener noreferrer nofollow" for external URLs in forum messages?

Thanks again.
My System Information:
  • SMF Version: 2.1.4
  • PHP Version: 8.2
  • MySQL version: 8.0.40
  • Installed mods: Stop Forum Spam 1.5.6

Bugo

You can create the addon for Optimus right now without waiting - the file Sources/Optimus/Addons/SaveLinks.php with the code provided in the link:


https://laravel.su/pastebin/9daf765b-9b08-414b-b444-33d7b9435d94

vitalog2010

Hi @Bugo ,

I just found another problem/bug on the Optimus 3.0 RC1 [see my My System Information in the signature].

When I'm trying to "Move Topic", getting an error on the local server: (And 500 Error on the Hosting)

Fatal error: Uncaught TypeError: explode(): Argument #2 ($string) must be of type string, array given in https://localtestforum.com/Sources/Optimus/Handlers/TagHandler.php:192 Stack trace: #0 https://localtestforum.com/Sources/Optimus/Handlers/TagHandler.php(192): explode() #1 https://localtestforum.com/Sources/Subs.php(5797): Bugo/Optimus/Handlers/TagHandler->createTopic() #2 https://localtestforum.com/Sources/Subs-Post.php(1978): call_integration_hook() #3 https://localtestforum.com/Sources/MoveTopic.php(314): createPost() #4 https://localtestforum.com/index.php(184): MoveTopic2() #5 {main} thrown in https://localtestforum.com/Sources/Optimus/Handlers/TagHandler.php on line 192
[nofollow]

Could you please test at your end ?

Thank you so much for your help.

My System Information:
  • SMF Version: 2.1.4
  • PHP Version: 8.2
  • MySQL version: 8.0.40
  • Installed mods: Stop Forum Spam 1.5.6

Bugo

I see, replace "$keywords = Input::xss(Input::request('optimus_keywords', []));" with "$keywords = Input::xss(Input::request('optimus_keywords', ''));" in that string.

vitalog2010

Quote from: Bugo on December 19, 2024, 09:51:36 AMI see, replace "$keywords = Input::xss(Input::request('optimus_keywords', []));" with "$keywords = Input::xss(Input::request('optimus_keywords', ''));" in that string.

@Bugo , Solved, Thank you so much
My System Information:
  • SMF Version: 2.1.4
  • PHP Version: 8.2
  • MySQL version: 8.0.40
  • Installed mods: Stop Forum Spam 1.5.6

Advertisement: