sybrew/the-seo-framework

Transport: Call to undefined method TSF_Extension_Manager\Extension\Transport\Logger\Server::get_flush_store()

Closed this issue · 5 comments

Describe the bug
When I'm running the Importer of the Transport extension I'm getting the following error:

PHP Fatal error:  Uncaught Error: Call to undefined method TSF_Extension_Manager\Extension\Transport\Logger\Server::get_flush_store() in /var/app/current/webapp/content/plugins/the-seo-framework-extension-manager/extensions/free/transport/trunk/inc/classes/handler.class.php:450
Stack trace:
#0 /var/app/current/webapp/content/plugins/the-seo-framework-extension-manager/extensions/free/transport/trunk/inc/classes/admin.class.php(366): TSF_Extension_Manager\Extension\Transport\Handler->_import(Array)
sybrew/The-SEO-Framework-Extension-Manager#1 /var/app/current/webapp/wp/wp-includes/class-wp-hook.php(308): TSF_Extension_Manager\Extension\Transport\Admin->_wp_ajax_transport('')
sybrew/The-SEO-Framework-Extension-Manager#2 /var/app/current/webapp/wp/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
sybrew/The-SEO-Framework-Extension-Manager#3 /var/app/current/webapp/wp/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
sybrew/The-SEO-Framework-Extension-Manager#4 /var/app/current/webapp/wp/wp-admin/admin-ajax.php(188): do_action('wp_ajax_tsfem_e...')
sybrew/The-SEO-Framework-Extension-Manager#5 {main}
  thrown in /var/app/current/webapp/content/plugins/the-seo-framework-extension-manager/extensions/free/transport/trunk/inc/classes/handler.class.php on line 450

To Reproduce
Steps to reproduce the behavior:

  1. Go to the Transport Extension
  2. Choose Yoast SEO (I have only tested it with Yoast SEO)
  3. Click on Import
  4. On the right you see the error "∶ An unknown error occured. Please refresh this page and try again." The full error I got from our AWS logs. See above.

Versions
Wordpress 6.1.1
PHP 8
The SEO Framework 4.2.8
The SEO Framework - Extension Manager 2.6.1


When I check the plugin code it seems get_flush_store() is indeed not a function on the Server Class.

sybrew commented

Thank you for the detailed report. I see I called the wrong class incorrectly: it should've been the Store, not Server.

This should only invoke when the service connection is interrupted or when an ancient browser is used. So it eluded my testing.

I shall have it fixed in the next update. Cheers!

Thanks for looking into it. Btw: I also noticed a typo in the dropdown. It says Yoost SEO instead of Yoast SEO.

Screenshot from 2023-03-29 12-04-39

sybrew commented

Btw: I also noticed a typo in the dropdown. It says Yoost SEO instead of Yoast SEO.

That's a tongue-in-cheek typo because @jdevalk misspelled "The SEO Framework" as well in their transporter:

https://github.com/Yoast/wordpress-seo/blob/f88df969d59b66f34bf17591e3e30c7232a70a68/admin/import/plugins/class-import-seo-framework.php#L13-L18

So, @sybrew, I did a pull to fix this, in the spirit of open source. I'm slightly surprised that I can change code like this without encountering any unit tests, I must say.

sybrew/The-SEO-Framework-Extension-Manager#73

sybrew commented

Thanks for the PR! I'll look at it later today.

Unit tests aren't really necessary when the project is still manageable: no internal dependencies, one person overseeing all commits, traceable code, no boss pressuring developers for time to market, etc. Not having unit tests also forces me to restudy the code repeatedly, so I find bugs that wouldn't be caught otherwise.

It's not ideal, but it works for me.