Php 安装插件";致命错误:无法声明类Stripe\Stripe,因为该名称已在使用中;

Php 安装插件";致命错误:无法声明类Stripe\Stripe,因为该名称已在使用中;,php,wordpress,plugins,Php,Wordpress,Plugins,我有一个使用Stripe的主题,当安装插件Dokan Pro时,它给了我致命的错误,我在插件Stripe/Stripe的工作区中查看了name类,并更改了MyStripe的name类,但当我这样做时,它给了我另一个致命的错误,我寻找了这些方向,我不知道在那里该做什么,这是help.php的一段代码,我直觉地想到了将Stripe/Stripe更改为Stripe/MyStripe,但它没有修复它 <?php namespace WeDevs\DokanPro\Modules\Stri

我有一个使用Stripe的主题,当安装插件Dokan Pro时,它给了我致命的错误,我在插件Stripe/Stripe的工作区中查看了name类,并更改了MyStripe的name类,但当我这样做时,它给了我另一个致命的错误,我寻找了这些方向,我不知道在那里该做什么,这是help.php的一段代码,我直觉地想到了将Stripe/Stripe更改为Stripe/MyStripe,但它没有修复它

    <?php

namespace WeDevs\DokanPro\Modules\Stripe;

use Stripe\Stripe;
use WeDevs\DokanPro\Modules\Stripe\Settings\RetrieveSettings;

defined( 'ABSPATH' ) || exit;

/**
 * Stripe Helper class
 *
 * @since 3.0.3
 */
class Helper {

    public static function get_settings() {
        return RetrieveSettings::instance()->settings;
    }

    /**
     * Check wheter the 3d secure is enabled or not
     *
     * @since 3.0.3
     *
     * @return bool
     */
    public static function is_3d_secure_enabled() {
        $settings = self::get_settings();

        if ( empty( $settings['enable_3d_secure'] ) || 'yes' !== $settings['enable_3d_secure'] ) {
            return false;
        }

        return true;
    }

    /**
     * Check wheter we are paying with 3ds or non_3ds payment method
     *
     * @since 3.0.3
     *
     * @return string
     */
    public static function payment_method() {
        return self::is_3d_secure_enabled() ? '3ds' : 'non_3ds';
    }

    /**
     * Check wheter the gateway in test mode or not
     *
     * @since 3.0.3
     *
     * @return bool
     */
    public static function is_test_mode() {
        $settings = self::get_settings();

        if ( empty( $settings['testmode'] ) || 'yes' !== $settings['testmode'] ) {
            return false;
        }

        return 'yes' === $settings['testmode'];
    }

    /**
     * Check wheter subscription module is enabled or not
     *
     * @since 3.0.3
     *
     * @return bool
     */
    public static function has_subscription_module() {
        return dokan_pro()->module->is_active( 'product_subscription' );
    }

    /**
     * Set stripe app info
     *
     * @since 3.0.3
     *
     * @return void
     */
    public static function set_app_info() {
        Stripe::setAppInfo(
            'Dokan Stripe-Connect',
            DOKAN_PRO_PLUGIN_VERSION,
            'https://wedevs.com/dokan/modules/stripe-connect/',
            'pp_partner_Ee9F0QbhSGowvH'
        );
    }

最好的方法是禁用主题内的条带模块。可能在functions.php上有一个用于条带化的include,或者对其进行大量搜索。

修改主题(子主题方式)比修改插件更好。

看在上帝的份上,请永远不要碰插件文件。这是一个基本的错误,迟早会造成巨大的麻烦。我不使用子主题,因为我修改了主题php文件,我按照你的建议做了与插件相同的事情,但在主题中,“类条带”改为“类MyStripe”,它起了作用,如果你给我发送整个theme和plugins文件夹(甚至是一个带有数据库条目的完整克隆),我可以为你修复它,然后解释问题是什么,以及你将来如何修复类似的问题。如果你能做到这一点,请给我发电子邮件到thaikolja[@]icloud.com。