PATH:
home
/
letacommog
/
rdvenunclick.fr1
/
wp-content
/
plugins
/
weforms
/
includes
<?php /** * The installer class * * @since 1.1.0 */ class WeForms_Installer { /** * The installer class * * @return void */ public function install() { $this->create_tables(); $this->maybe_set_default_settings(); $this->create_default_form(); $installed = get_option( 'weforms_installed' ); if ( !$installed ) { update_option( 'weforms_installed', time() ); } set_transient( 'weforms_activation_redirect', true, 30 ); set_transient( 'weforms_prevent_tracker_notice', true, DAY_IN_SECONDS * 7 ); // don't wanna show tracking notice in first 7 days update_option( 'weforms_version', WEFORMS_VERSION ); } /** * Create the table schema * * @return void */ public function create_tables() { global $wpdb; $collate = ''; if ( $wpdb->has_cap( 'collation' ) ) { if ( !empty( $wpdb->charset ) ) { $collate .= "DEFAULT CHARACTER SET $wpdb->charset"; } if ( !empty( $wpdb->collate ) ) { $collate .= " COLLATE $wpdb->collate"; } } $table_schema = [ "CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}weforms_entries` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `form_id` bigint(20) unsigned DEFAULT NULL, `user_id` bigint(20) unsigned DEFAULT NULL, `user_ip` int(11) unsigned DEFAULT NULL, `user_device` varchar(50) DEFAULT NULL, `referer` varchar(255) DEFAULT NULL, `status` varchar(10) DEFAULT 'publish', `created_at` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `form_id` (`form_id`) ) $collate;", "CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}weforms_entrymeta` ( `meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `weforms_entry_id` bigint(20) unsigned DEFAULT NULL, `meta_key` varchar(255) DEFAULT NULL, `meta_value` longtext, PRIMARY KEY (`meta_id`), KEY `meta_key` (`meta_key`), KEY `entry_id` (`weforms_entry_id`) ) $collate;", ]; require_once ABSPATH . 'wp-admin/includes/upgrade.php'; foreach ( $table_schema as $table ) { dbDelta( $table ); } } /** * Set the required default settings key if not present * * This is required for setting up the component settings data * * @return void */ public function maybe_set_default_settings() { $requires_update = false; $settings = get_option( 'weforms_settings', [] ); $additional_keys = [ 'email_gateway' => 'wordpress', 'credit' => false, 'email_footer' => true, 'recaptcha' => [ 'key' => '', 'secret' => '', 'type' => 'v2' ], ]; foreach ( $additional_keys as $key => $value ) { if ( !isset( $settings[ $key ] ) ) { $settings[ $key ] = $value; $requires_update = true; } } if ( $requires_update ) { update_option( 'weforms_settings', $settings ); } } /** * Create a default form * * @return void */ public function create_default_form() { $version = get_option( 'weforms_version' ); // seems like it's already installed if ( $version ) { return; } weforms()->templates->create( 'contact' ); } }
[+]
..
[-] class-form-entry-manager.php
[edit]
[-] class-frontend-form.php
[edit]
[-] class-ajax-upload.php
[edit]
[+]
importer
[-] class-ajax.php
[edit]
[+]
api
[+]
fields
[-] class-notification.php
[edit]
[-] class-form-entry.php
[edit]
[-] class-importer-manager.php
[edit]
[+]
compat
[-] functions.php
[edit]
[-] class-field-manager.php
[edit]
[+]
library
[-] class-integration-manager.php
[edit]
[+]
email
[-] class-form-widget.php
[edit]
[+]
templates
[-] class-weforms-api.php
[edit]
[-] class-template-manager.php
[edit]
[+]
integrations
[-] class-installer.php
[edit]
[-] class-scripts-styles.php
[edit]
[-] country-list.php
[edit]
[-] class-form.php
[edit]
[-] class-form-manager.php
[edit]
[-] class-upgrades.php
[edit]
[-] class-emailer.php
[edit]
[-] class-form-preview.php
[edit]
[+]
admin
[-] class-dokan-integration.php
[edit]