| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Contact Form by WPForms – Drag & Drop Form Builder for WordPress |
| 4 |
* Plugin URI: https://wordpress.org/plugins/wpforms-lite/ |
| 5 |
* |
| 6 |
* Compatibility Description: Ensures compatibility with WPForms. |
| 7 |
* |
| 8 |
*/ |
| 9 |
|
| 10 |
namespace wpCloud\StatelessMedia { |
| 11 |
|
| 12 |
if(!class_exists('wpCloud\StatelessMedia\WPForms')) { |
| 13 |
|
| 14 |
class WPForms extends ICompatibility { |
| 15 |
protected $id = 'wpforms'; |
| 16 |
protected $title = 'WPForms'; |
| 17 |
protected $constant = 'WP_STATELESS_COMPATIBILITY_WPFORMS'; |
| 18 |
protected $description = 'Ensures compatibility with WPForms.'; |
| 19 |
protected $plugin_file = ['wpforms-lite/wpforms.php', 'wpforms/wpforms.php']; |
| 20 |
|
| 21 |
public function module_init($sm){ |
| 22 |
// exclude randomize_filename from wpforms page |
| 23 |
if(!empty($_GET['page']) && $_GET['page'] == 'wpforms-builder') { |
| 24 |
remove_filter( 'sanitize_file_name', array( "wpCloud\StatelessMedia\Utility", 'randomize_filename' ), 10 ); |
| 25 |
} |
| 26 |
|
| 27 |
} |
| 28 |
|
| 29 |
} |
| 30 |
|
| 31 |
} |
| 32 |
|
| 33 |
} |
| 34 |
|