• Resolved hannahangeladecena

    (@hannahangeladecena)


    Hello.

    Encountered an issue in my site, where I wasn’t able to access the wp-admin when I updated the Yoast SEO 20.10.0 plugin.

    This is the file.
    /wp-content/plugins/wordpress-seo/src/conditionals/woocommerce-conditional.php

    <?php
    
    namespace Yoast\WP\SEO\Conditionals;
    
    /**
     * Conditional that is only met when WooCommerce is active.
     */
    abstract class WooCommerce_Conditional implements Conditional {
    
            /**
             * Returns true when the WooCommerce plugin is installed and activated.
             *
             * @return bool true when the WooCommerce plugin is installed and activated.
             */
            public function is_met() {
                    return \class_exists( 'WooCommerce' );
            }
    }

    The only solution we did is to add the “abstract” above the file.

    abstract 
    
    
    <?php
    
    namespace Yoast\WP\SEO\Conditionals;
    
    /**
     * Conditional that is only met when WooCommerce is active.
     */
    class WooCommerce_Conditional implements Conditional {
    
            /**
             * Returns true when the WooCommerce plugin is installed and activated.
             *
             * @return bool true when the WooCommerce plugin is installed and activated.
             */
            public function is_met() {
                    return \class_exists( 'WooCommerce' );
            }
    }

    But now, I just noticed that the “abstract” I added was deleted and the issue was gone. I need to know why does this type of issue happened and what causing this to occur? Is this related to the plugin update?

    I hope someone can give me idea about this.
    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @hannahangeladecena

    Thanks for using the Yoast SEO plugin. It’d have been helpful if you could share the error you got in your log relating to the issee. However, we are glad it’s resolved now.

    If it happens again in the future, do not hesitate to reach out with the error message.

    Thread Starter hannahangeladecena

    (@hannahangeladecena)

    Hello @maybellyne

    Thank you for reaching out.

    It took some time to retrieve the error log.
    Here’s the issue on the log.

    [Fri Jul 07 18:17:48.339157 2023] [php7:error] [pid 23061:tid 139960250177280] [client 116.89.247.242:0] PHP Fatal error: Class contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Yoast\\WP\\SEO\\Conditionals\\Conditional::is_met) in /var/www/html/wptmj/wp-content/plugins/wordpress-
    seo/src/conditionals/woocommerce-conditional.php on line 8, referer: https://www.tmj.jp/wptmj/wp-admin/edit.php?post_type=page

    Thank you for taking time to check.
    And I hope the new update has fixed this, if ever.

    Thank you again.

    Hey @hannahangeladecena,

    Thank you for your reply.

    I had a look at our woocommerce-conditional.php file (see Github), but that class was never abstract – so we are not sure why that would be present in your installation. It shouldn’t be. The file hasn’t changed since version 16.4. Were you updating from a very old version?

    Thread Starter hannahangeladecena

    (@hannahangeladecena)

    @jeroenrotty

    Hello.
    Thank you for your time.

    I have no idea either. We also have the test site, where I pre-test the updates before reflecting it direct to the production site and there’s no issue.

    At first, I thought the load balancer was delayed, since production 1 needs to be reflected for the production 2 automatically. But then, few minutes passed, it still doesn’t fixed the issue in the admin.

    Hey @hannahangeladecena,

    Thank you for your reply.

    There might be anything in your pipeline of “going to production” that builds or does changes to files. We’re not sure but we’d suggest trying to install Yoast SEO 20.11 on your production environment with a direct ZIP file (https://downloads.www.ads-software.com/plugin/wordpress-seo.20.11.zip) and see if that works.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Updated Yoast SEO plugin 20.10 and woocommerce conditional namespace issue’ is closed to new replies.