Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes conflicts with WPForms plugin #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

isimaka
Copy link

@isimaka isimaka commented Apr 5, 2022

If WPForms is installed.
Fatal error would be thrown and site crashes:

PHP Warning:  require_once(wordpress/wp-content/plugins/wpforms/includes/providers/class-107517-6m2f19OS.php): failed to open stream: No such file or directory in wordpress/wp-content/plugins/wpforms/includes/class-providers.php on line 51
Warning: require_once(wordpress/wp-content/plugins/wpforms/includes/providers/class-107517-6m2f19OS.php): failed to open stream: No such file or directory in wordpress/wp-content/plugins/wpforms/includes/class-providers.php on line 51
PHP Fatal error:  require_once(): Failed opening required 'wordpress/wp-content/plugins/wpforms/includes/providers/class-107517-6m2f19OS.php' (include_path='.:/usr/share/php') in wordpress/wp-content/plugins/wpforms/includes/class-providers.php on line 51
Fatal error: require_once(): Failed opening required 'wordpress/wp-content/plugins/wpforms/includes/providers/class-107517-6m2f19OS.php' (include_path='.:/usr/share/php') in wordpress/wp-content/plugins/wpforms/includes/class-providers.php on line 51

The snippet that matters in wordpress/wp-content/plugins/wpforms/includes/class-providers.php:

/**
         * Load default marketing providers.
         *
         * @since 1.3.6
         */
        public function load() {

                $providers = array(
                        'constant-contact',
                );

                $providers = apply_filters( 'wpforms_load_providers', $providers );

                foreach ( $providers as $provider ) {

                        $provider = sanitize_file_name( $provider );

                        require_once WPFORMS_PLUGIN_DIR . 'includes/providers/class-' . $provider . '.php';
                }
        }
}

This line: $provider = sanitize_file_name( $provider );
would turn
class-constant-contact.php
to class-constant-contact-107517-6m2f19OS.php.

This commit would try to rename only media files, not other files like .php.

If [WPForms](https://wordpress.org/plugins/wpforms-lite/) is installed.
Fatal error would be thrown and site crashes:
```bash
PHP Warning:  require_once(wordpress/wp-content/plugins/wpforms/includes/providers/class-107517-6m2f19OS.php): failed to open stream: No such file or directory in wordpress/wp-content/plugins/wpforms/includes/class-providers.php on line 51
Warning: require_once(wordpress/wp-content/plugins/wpforms/includes/providers/class-107517-6m2f19OS.php): failed to open stream: No such file or directory in wordpress/wp-content/plugins/wpforms/includes/class-providers.php on line 51
PHP Fatal error:  require_once(): Failed opening required 'wordpress/wp-content/plugins/wpforms/includes/providers/class-107517-6m2f19OS.php' (include_path='.:/usr/share/php') in wordpress/wp-content/plugins/wpforms/includes/class-providers.php on line 51
Fatal error: require_once(): Failed opening required 'wordpress/wp-content/plugins/wpforms/includes/providers/class-107517-6m2f19OS.php' (include_path='.:/usr/share/php') in wordpress/wp-content/plugins/wpforms/includes/class-providers.php on line 51

```

The snippet that matters in `wordpress/wp-content/plugins/wpforms/includes/class-providers.php`:
```php
/**
         * Load default marketing providers.
         *
         * @SInCE 1.3.6
         */
        public function load() {

                $providers = array(
                        'constant-contact',
                );

                $providers = apply_filters( 'wpforms_load_providers', $providers );

                foreach ( $providers as $provider ) {

                        $provider = sanitize_file_name( $provider );

                        require_once WPFORMS_PLUGIN_DIR . 'includes/providers/class-' . $provider . '.php';
                }
        }
}
```
This line: ` $provider = sanitize_file_name( $provider );`
would turn 
`class-constant-contact.php` 
to `class-constant-contact-107517-6m2f19OS.php`. 

This commit would try to rename only media files, not other files like `.php`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant