dvadf
File manager - Edit - /home/theblueo/tv/wp-includes/pomo/lib/Integrations.tar
Back
Gutenberg/FormSelector.php 0000666 00000014342 15214176130 0011613 0 ustar 00 <?php namespace WPForms\Integrations\Gutenberg; use WPForms\Integrations\IntegrationInterface; /** * Form Selector Gutenberg block with live preview. * * @since 1.4.8 */ class FormSelector implements IntegrationInterface { /** * Indicate if current integration is allowed to load. * * @since 1.4.8 * * @return bool */ public function allow_load() { return \function_exists( 'register_block_type' ); } /** * Load an integration. * * @since 1.4.8 */ public function load() { $this->hooks(); } /** * Integration hooks. * * @since 1.4.8 */ protected function hooks() { \add_action( 'init', array( $this, 'register_block' ) ); \add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_editor_assets' ) ); } /** * Register WPForms Gutenberg block on the backend. * * @since 1.4.8 */ public function register_block() { \wp_register_style( 'wpforms-gutenberg-form-selector', WPFORMS_PLUGIN_URL . 'assets/css/wpforms-full.css', array( 'wp-edit-blocks' ), WPFORMS_VERSION ); $attributes = array( 'formId' => array( 'type' => 'string', ), 'displayTitle' => array( 'type' => 'boolean', ), 'displayDesc' => array( 'type' => 'boolean', ), 'className' => array( 'type' => 'string', ), ); \register_block_type( 'wpforms/form-selector', array( 'attributes' => \apply_filters( 'wpforms_gutenberg_form_selector_attributes', $attributes ), 'editor_style' => 'wpforms-gutenberg-form-selector', 'render_callback' => array( $this, 'get_form_html' ), ) ); } /** * Load WPForms Gutenberg block scripts. * * @since 1.4.8 */ public function enqueue_block_editor_assets() { $i18n = array( 'title' => \esc_html__( 'WPForms', 'wpforms-lite' ), 'description' => \esc_html__( 'Select and display one of your forms.', 'wpforms-lite' ), 'form_keywords' => array( \esc_html__( 'form', 'wpforms-lite' ), \esc_html__( 'contact', 'wpforms-lite' ), \esc_html__( 'survey', 'wpforms-lite' ), ), 'form_select' => \esc_html__( 'Select a Form', 'wpforms-lite' ), 'form_settings' => \esc_html__( 'Form Settings', 'wpforms-lite' ), 'form_selected' => \esc_html__( 'Form', 'wpforms-lite' ), 'show_title' => \esc_html__( 'Show Title', 'wpforms-lite' ), 'show_description' => \esc_html__( 'Show Description', 'wpforms-lite' ), 'panel_notice_head' => \esc_html__( 'Heads up!', 'wpforms-lite' ), 'panel_notice_text' => \esc_html__( 'Do not forget to test your form.', 'wpforms-lite' ), 'panel_notice_link' => \esc_html__( 'Check out our complete guide!', 'wpforms-lite' ), ); \wp_enqueue_script( 'wpforms-gutenberg-form-selector', WPFORMS_PLUGIN_URL . 'assets/js/components/admin/gutenberg/formselector.min.js', array( 'wp-blocks', 'wp-i18n', 'wp-element' ), WPFORMS_VERSION, true ); $forms = \wpforms()->form->get( '', array( 'order' => 'DESC' ) ); $forms = ! empty( $forms ) ? $forms : array(); $forms = array_map( function( $form ) { $form->post_title = htmlspecialchars_decode( $form->post_title, ENT_QUOTES ); return $form; }, $forms ); \wp_localize_script( 'wpforms-gutenberg-form-selector', 'wpforms_gutenberg_form_selector', array( 'logo_url' => WPFORMS_PLUGIN_URL . 'assets/images/sullie-alt.png', 'wpnonce' => \wp_create_nonce( 'wpforms-gutenberg-form-selector' ), 'forms' => $forms, 'i18n' => $i18n, ) ); } /** * Get form HTML to display in a WPForms Gutenberg block. * * @param array $attr Attributes passed by WPForms Gutenberg block. * * @since 1.4.8 * * @return string */ public function get_form_html( $attr ) { $id = ! empty( $attr['formId'] ) ? \absint( $attr['formId'] ) : 0; if ( empty( $id ) ) { return ''; } $title = ! empty( $attr['displayTitle'] ) ? true : false; $desc = ! empty( $attr['displayDesc'] ) ? true : false; // Disable form fields if called from the Gutenberg editor. if ( $this->is_gb_editor() ) { \add_filter( 'wpforms_frontend_container_class', function ( $classes ) { $classes[] = 'wpforms-gutenberg-form-selector'; $classes[] = 'wpforms-container-full'; return $classes; } ); \add_action( 'wpforms_frontend_output', function () { echo '<fieldset disabled>'; }, 3 ); \add_action( 'wpforms_frontend_output', function () { echo '</fieldset>'; }, 30 ); } if ( ! empty( $attr['className'] ) ) { \add_filter( 'wpforms_frontend_container_class', function ( $classes ) use ( $attr ) { $cls = array_map( 'esc_attr', explode( ' ', $attr['className'] ) ); return array_unique( array_merge( $classes, $cls ) ); } ); } \ob_start(); \do_action( 'wpforms_gutenberg_block_before' ); if ( $this->is_gb_editor() ) { wpforms_display( $id, apply_filters( 'wpforms_gutenberg_block_form_title', $title, $id ), apply_filters( 'wpforms_gutenberg_block_form_desc', $desc, $id ) ); } else { printf( '[wpforms id="%s" title="%d" description="%d"]', absint( $id ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped apply_filters( 'wpforms_gutenberg_block_form_title', $title, $id ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped apply_filters( 'wpforms_gutenberg_block_form_desc', $desc, $id ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ); } \do_action( 'wpforms_gutenberg_block_after' ); $content = \ob_get_clean(); if ( empty( $content ) ) { $content = '<div class="components-placeholder"><div class="components-placeholder__label"></div><div class="components-placeholder__fieldset">' . \esc_html__( 'The form cannot be displayed.', 'wpforms-lite' ) . '</div></div>'; } return \apply_filters( 'wpforms_gutenberg_block_form_content', $content, $id ); } /** * Checking if is Gutenberg REST API call. * * @since 1.5.7 * * @return bool True if is Gutenberg REST API call. */ public function is_gb_editor() { // TODO: Find a better way to check if is GB editor API call. return \defined( 'REST_REQUEST' ) && REST_REQUEST && ! empty( $_REQUEST['context'] ) && 'edit' === $_REQUEST['context']; // phpcs:ignore } } Elementor/Elementor.php 0000666 00000003604 15214176130 0011150 0 ustar 00 <?php namespace WPForms\Integrations\Elementor; use WPForms\Integrations\IntegrationInterface; /** * Improve Elementor Compatibility. * * @since 1.6.0 */ class Elementor implements IntegrationInterface { /** * Indicates if current integration is allowed to load. * * @since 1.6.0 * * @return bool */ public function allow_load() { return did_action( 'elementor/loaded' ); } /** * Load an integration. * * @since 1.6.0 */ public function load() { $this->hooks(); } /** * Integration hooks. * * @since 1.6.0 */ protected function hooks() { add_action( 'elementor/preview/init', [ $this, 'init' ] ); add_action( 'elementor/frontend/after_enqueue_scripts', [ $this, 'enqueue_assets' ] ); } /** * Init an integration logic. * * @since 1.6.0 */ public function init() { /** * Allow developers to determine if use or not this compatibility. * We make it on this place because we want that this filter will be available for theme developers too. * * @since 1.6.0 * * @param bool $use_compat */ $use_compat = apply_filters( 'wpforms_apply_elementor_preview_compat', true ); if ( true !== $use_compat ) { return; } // Load WPForms assets globally in Elementor Preview mode only. add_filter( 'wpforms_global_assets', '__return_true' ); } /** * Load an integration javascript. * * @since 1.6.0 */ public function enqueue_assets() { // Return, if no forms on Elementor page/popup. if ( empty( wpforms()->frontend->forms ) ) { return; } $min = wpforms_get_min_suffix(); wp_enqueue_script( 'wpforms-elementor', WPFORMS_PLUGIN_URL . "assets/js/integrations/wpforms-elementor{$min}.js", [ 'wpforms' ], WPFORMS_VERSION, true ); wp_localize_script( 'wpforms-elementor', 'wpformsElementorVars', [ 'recaptcha_type' => wpforms_setting( 'recaptcha-type', 'v2' ), ] ); } } SiteHealth/SiteHealth.php 0000666 00000006325 15214176130 0011353 0 ustar 00 <?php namespace WPForms\Integrations\SiteHealth; use WPForms\Integrations\IntegrationInterface; /** * Site Health WPForms Info. * * @since 1.5.5 */ class SiteHealth implements IntegrationInterface { /** * Indicate if current integration is allowed to load. * * @since 1.5.5 * * @return bool */ public function allow_load() { global $wp_version; return version_compare( $wp_version, '5.2', '>=' ); } /** * Load an integration. * * @since 1.5.5 */ public function load() { $this->hooks(); } /** * Integration hooks. * * @since 1.5.5 */ protected function hooks() { add_filter( 'debug_information', array( $this, 'add_info_section' ) ); } /** * Add WPForms section to Info tab. * * @since 1.5.5 * * @param array $debug_info Array of all information. * * @return array Array with added WPForms info section. */ public function add_info_section( $debug_info ) { $wpforms = array( 'label' => 'WPForms', 'fields' => array( 'version' => array( 'label' => esc_html__( 'Version', 'wpforms-lite' ), 'value' => WPFORMS_VERSION, ), ), ); // License key type. $wpforms['fields']['license'] = array( 'label' => esc_html__( 'License key type', 'wpforms-lite' ), 'value' => wpforms_get_license_type(), ); // Install date. $activated = get_option( 'wpforms_activated', array() ); if ( ! empty( $activated['lite'] ) ) { $date = $activated['lite'] + ( get_option( 'gmt_offset' ) * 3600 ); $wpforms['fields']['lite'] = array( 'label' => esc_html__( 'Lite install date', 'wpforms-lite' ), 'value' => date_i18n( esc_html__( 'M j, Y @ g:ia' ), $date ), ); } if ( ! empty( $activated['pro'] ) ) { $date = $activated['pro'] + ( get_option( 'gmt_offset' ) * 3600 ); $wpforms['fields']['pro'] = array( 'label' => esc_html__( 'Pro install date', 'wpforms-lite' ), 'value' => date_i18n( esc_html__( 'M j, Y @ g:ia' ), $date ), ); } // DB tables. if ( wpforms()->pro ) { $db_tables = wpforms()->get( 'pro' )->get_existing_custom_tables(); $db_tables_str = empty( $db_tables ) ? esc_html__( 'Not found', 'wpforms-lite' ) : implode( ', ', $db_tables ); $wpforms['fields']['db_tables'] = array( 'label' => esc_html__( 'DB tables', 'wpforms-lite' ), 'value' => $db_tables_str, ); } // Total forms. $wpforms['fields']['total_forms'] = array( 'label' => esc_html__( 'Total forms', 'wpforms-lite' ), 'value' => wp_count_posts( 'wpforms' )->publish, ); // Total entries. if ( wpforms()->pro ) { $wpforms['fields']['total_entries'] = array( 'label' => esc_html__( 'Total entries', 'wpforms-lite' ), 'value' => wpforms()->entry->get_entries( array(), true ), ); } else { $forms = \wpforms()->form->get( '', array( 'fields' => 'ids' ) ); if ( empty( $forms ) || ! \is_array( $forms ) ) { $forms = array(); } $count = 0; foreach ( $forms as $form_id ) { $count += (int) \get_post_meta( $form_id, 'wpforms_entries_count', true ); } $wpforms['fields']['total_entries'] = array( 'label' => esc_html__( 'Total submissions (since v1.5.0)', 'wpforms-lite' ), 'value' => $count, ); } $debug_info['wpforms'] = $wpforms; return $debug_info; } } WPMailSMTP/Notifications.php 0000666 00000005145 15214176130 0011734 0 ustar 00 <?php namespace WPForms\Integrations\WPMailSMTP; use WPForms\Integrations\IntegrationInterface; /** * WP Mail SMTP hints inside form builder notifications. * * @since 1.4.8 */ class Notifications implements IntegrationInterface { /** * WP Mail SMTP options. * * @since 1.4.8 * * @var \WPMailSMTP\Options */ public $options; /** * Indicate if current integration is allowed to load. * * @since 1.4.8 * * @return bool */ public function allow_load() { return \wpforms_is_admin_page( 'builder' ) && \function_exists( 'wp_mail_smtp' ); } /** * Load an integration. * * @since 1.4.8 */ public function load() { $this->options = new \WPMailSMTP\Options(); $this->filters(); } /** * Integration filters. * * @since 1.4.8 */ protected function filters() { \add_filter( 'wpforms_builder_notifications_from_name_after', array( $this, 'from_name_after' ) ); \add_filter( 'wpforms_builder_notifications_from_email_after', array( $this, 'from_email_after' ) ); } /** * Display hint if WP Mail SMTP is forcing from name. * * @since 1.4.8 * * @param string $after Text displayed after setting. * * @return string */ public function from_name_after( $after ) { if ( ! $this->options->get( 'mail', 'from_name_force' ) ) { return $after; } return sprintf( \wp_kses( /* translators: %s - URL WP Mail SMTP settings. */ \__( 'This setting is disabled because you have the "Force From Name" setting enabled in <a href="%s" rel="noopener noreferrer" target="_blank">WP Mail SMTP</a>.', 'wpforms-lite' ), array( 'a' => array( 'href' => array(), 'rel' => array(), 'target' => array(), ), ) ), \esc_url( \admin_url( 'options-general.php?page=wp-mail-smtp#wp-mail-smtp-setting-row-from_name' ) ) ); } /** * Display hint if WP Mail SMTP is forcing from email. * * @since 1.4.8 * * @param string $after Text displayed after setting. * * @return string */ public function from_email_after( $after ) { if ( ! $this->options->get( 'mail', 'from_email_force' ) ) { return $after; } return sprintf( \wp_kses( /* translators: %s - URL WP Mail SMTP settings. */ \__( 'This setting is disabled because you have the "Force From Email" setting enabled in <a href="%s" rel="noopener noreferrer" target="_blank">WP Mail SMTP</a>.', 'wpforms-lite' ), array( 'a' => array( 'href' => array(), 'rel' => array(), 'target' => array(), ), ) ), \esc_url( \admin_url( 'options-general.php?page=wp-mail-smtp#wp-mail-smtp-setting-row-from_email' ) ) ); } } Loader.php 0000666 00000004131 15214176130 0006466 0 ustar 00 <?php namespace WPForms\Integrations; /** * Class Loader gives ability to track/load all integrations. * * @since 1.4.8 */ class Loader { /** * Get the instance of a class and store it in itself. * * @since 1.4.8 */ public static function get_instance() { static $instance; if ( ! $instance ) { $instance = new Loader(); } return $instance; } /** * Loader constructor. * * @since 1.4.8 */ public function __construct() { $core_class_names = array( 'Elementor\Elementor', 'Gutenberg\FormSelector', 'SiteHealth\SiteHealth', 'WPMailSMTP\Notifications', 'WPorg\Translations', ); $class_names = \apply_filters( 'wpforms_integrations_available', $core_class_names ); foreach ( $class_names as $class_name ) { $integration = $this->register_class( $class_name ); if ( ! empty( $integration ) ) { $this->load_integration( $integration ); } } } /** * Load an integration. * * @param IntegrationInterface $integration Instance of an integration class. * * @since 1.4.8 */ protected function load_integration( IntegrationInterface $integration ) { if ( $integration->allow_load() ) { $integration->load(); } } /** * Register a new class. * * @since 1.5.6 * * @param string $class_name Class name to register. * * @return IntegrationInterface Instance of class. */ public function register_class( $class_name ) { $class_name = \sanitize_text_field( $class_name ); // Load Lite class if exists. if ( ! \wpforms()->pro && \class_exists( 'WPForms\Lite\Integrations\\' . $class_name ) ) { $class_name = 'WPForms\Lite\Integrations\\' . $class_name; return new $class_name(); } // Load Pro class if exists. if ( \wpforms()->pro && \class_exists( 'WPForms\Pro\Integrations\\' . $class_name ) ) { $class_name = 'WPForms\Pro\Integrations\\' . $class_name; return new $class_name(); } // Load general class if neither Pro nor Lite class exists. if ( \class_exists( __NAMESPACE__ . '\\' . $class_name ) ) { $class_name = __NAMESPACE__ . '\\' . $class_name; return new $class_name(); } } } IntegrationInterface.php 0000666 00000000642 15214176130 0011367 0 ustar 00 <?php namespace WPForms\Integrations; /** * Interface IntegrationInterface defines required methods for integrations to work properly. * * @since 1.4.8 */ interface IntegrationInterface { /** * Indicate if current integration is allowed to load. * * @since 1.4.8 * * @return bool */ public function allow_load(); /** * Load an integration. * * @since 1.4.8 */ public function load(); }
dvadf
dvadf
| ver. 1.4 |
Github
|
.
| PHP 7.0.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings