Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 59 total)
  • Author
    Posts
  • pluginovenpluginoven
    Participant

    Meta Box Math CAPTCHA
    A standalone WordPress plugin that adds a privacy-compliant Math CAPTCHA field type to the Meta Box ecosystem. This plugin provides a secure, AJAX-validated Math CAPTCHA that works seamlessly with both backend and frontend forms, including those created with the Meta Box Frontend Submission addon.

    1. Install the plugin: https://github.com/baden03/mb-math-captcha
    2. Add a math_captcha:

    $meta_boxes[] = [
        'title'  => 'Contact Form',
        'id'     => 'contact_form',
        'fields' => [
            // ... your other form fields ...
            [
                'id'         => 'math_challenge',
                'name'       => 'Are you human?',
                'type'       => 'math_captcha',
                'save_field' => false, // Important: prevents saving the value
                'required'   => true,
            ],
        ],
        // Add the validation rule for the captcha
        'validation' => [
            'rules' => [
                'math_challenge' => [
                    'math_captcha' => true,
                ],
            ],
        ],
    ];
    pluginovenpluginoven
    Participant

    https://github.com/baden03/mb-math-captcha

    in reply to: ℹ️Missing Translations #48340
    pluginovenpluginoven
    Participant

    wow..

    The Text Domain needs to be added to the plugin header.

    Maybe this helps?

    pluginovenpluginoven
    Participant

    Hello Peter, thank you for your response. Just some thoughts:

    If you don't use the frontend form in the frontend, there isn't any option to enqueue any field scripts (JS, CSS) in the frontend. I think there is no reason to do so.

    OK. Imagine if you will that we use metabox to define a complex form and this form allows users to fill this out and submit it from the front end using a plugin like MB Frontend Submission.

    Now imagine that some of these fields are used later, on another page that allows users to search and filter using our pre-built form fields. One of them, for the sake of imagination is a language field using advanced_select. Well! we now have a reason to render this form field on the front end, but not as a submission form, oh no, but form that is used as a filter! Can you imagine that? That might be just one reason to do so. Let me know if you need more reasons. I have three more.

    You can simply download the Select2 library to your project and enqueue it in the frontend to use a similar feature of select advanced field for your select field.

    I refer you to the first post in the thread, right around the part that reads:

    We tried to load in the official select2 css and script, but it dose not match the version that RWMB renders.

    I invite you to compare the select2 field that meta-box renders next to the standard select2 field and maybe then you can see the difference. For example using a 'textbox' element for the search field rather than an li/span element as in the case of a metabox select2 rendered field.

    pluginovenpluginoven
    Participant

    yeah. no.

    pluginovenpluginoven
    Participant

    I take that as a no, not interested.

    pluginovenpluginoven
    Participant

    Hello Peter.
    the real case is an advanced plugin that handles handles the uploading, storing and managing access for sensitive data. If you share your github handle, I would be happy to give you access to the repo that explains everything in detail, including a demo-plugin we created as a proof of concept.

    We ended up creating a custom field type called secure_file_advanced that allows the passing of custom parameters to the $_REQUEST before the file is uploaded. To do this we needed to get very intimate with how metabox.io has implemented the WordPress AJAX Media Uploader on the back and frontend (three uploaders deep). Our case may be an edge case, but it dose extend the flexibility of existing file_advanced field.

    Regarding field type file: no for all the reasons that we went with file_advanced in the first place.
    Also, adding the upload_dir attribute to the field meta, visible on the frontend, is not desired.
    Also, with thousands of members we needed more than just a single upload-directory.

    pluginovenpluginoven
    Participant

    After a bit more trial and console.log fun, we have found a solution that works, but it's not pretty.

    In the media.js file under MediaButton > events

    // Refresh content when frame opens
    this._frame.on( 'open', function() {
       // adding the custom parameter to the uploader
       var some_custom_param = this.controller.get('some_custom_param');
       if(some_custom_param){
          this._frame.uploader.uploader.uploader.settings.multipart_params.some_custom_param = some_custom_param;
       }
       var frameContent = this._frame.content.get();
       if ( frameContent && frameContent.collection ) {
          frameContent.collection.mirroring._hasMore = true;
          frameContent.collection.more();
       }
    }, this );

    this is just a test. next steps would be:
    - get feedback on if there is a more elegant way to add the multipart_params
    - create our own field type 'file_more_advanced' so we don't modify metabox's core files
    - OR collaborate on extending the official file_advance field logic to support appending the multipart_params

    Thoughts?

    pluginovenpluginoven
    Participant

    No plugin, as there are not multiple languages. Just set WordPress to use a language other than EN, for example, DE_Formal. And yes the .po and .mo files are in wp-content/languages/plugins folder.

    pluginovenpluginoven
    Participant

    Have not heard back, but I am fighting a similar translation issue with the [mb_frontend_dashboard] shortcode. In this case, it's very clear that the language files are not being found for the mb-frontend-submission text domain in src/Form.php

    'confirm_delete' => __( 'Are you sure to delete this post?', 'mb-frontend-submission' ),
    is not being translated. As there is not longer time to continue to debug your plugins, we are reverting to hard-coding the language until these issues are resolved. Please let me know when there is something to test.

    in reply to: Prevent forms from rendering submit button #43729
    pluginovenpluginoven
    Participant

    src/Forms/info.php:

    protected function submit_button() {
    		$submit_button = '<div class="rwmb-field rwmb-button-wrapper rwmb-form-submit">
    			<div class="rwmb-input">
    				<button type="submit" class="rwmb-button" id="'.esc_attr( $this->config['id_submit'] ).'" name="rwmb_profile_submit_info" value="1">'.esc_html( $this->config['label_submit'] ).'</button>
    			</div>
    		</div>';
    		$submit_button = apply_filters( 'rwmb_profile_submit_button', $submit_button, $this->config );
    		echo $submit_button;
    	}

    usage:

    add_filter( 'rwmb_profile_submit_button', 'fix_frontend_submit_button', 20 , 2 );
    function fix_frontend_submit_button( $submit_button, $config ) {
    		$is_complete = get_user_meta( $config['user_id'], 'is_complete', true );
    		if($is_complete){
    			$submit_button = '';
    		}
    		return $submit_button;
    	}

    src/Forms/Base.php: function render()

    ...
    do_action( 'rwmb_profile_before_form', $this->config );
    
    		$form = '<form class="rwmb-form mbup-form" method="post" enctype="multipart/form-data" id="' . esc_html( $this->config['form_id'] ) . '">';
    		$form = apply_filters( 'rwmb_profile_form', $form, $this->config );
    		echo $form;
    ...

    usage:

    add_filter( 'rwmb_profile_form', 'fix_frontend_profile_form', 20 , 2 );
    function fix_frontend_profile_form( $form, $config ) {
    		$is_complete = get_user_meta( $config['user_id'], 'is_complete', true );
    		if($is_complete){
    			$form = str_replace('method="post"', 'disabled', $form);
    		}
    		return $form;
    	}
    in reply to: Prevent forms from rendering submit button #43728
    pluginovenpluginoven
    Participant

    Again we are faced with this issue
    While there is a rwmb_frontend_submit_button filter for forms created with mb_frontend_form, there is no such filter for mb_user_profile_info (which can also be used on the front end.

    This is a missing feature. Where can a pull request be submitted?

    in reply to: object type from rwmb_frontend_after_save_post #43324
    pluginovenpluginoven
    Participant

    update, nevermind, found rwmb_profile_after_process

    in reply to: MetaBox's jQuery UI Dialogue CSS is throwing 404 errors #43223
    pluginovenpluginoven
    Participant

    Thank you Peter.

    in reply to: Path to validation language files is incorrect. #43204
    pluginovenpluginoven
    Participant

    This has been happening across all sites that is running the latest 5.7.5 version of MetaBox.
    If it helps, we can provide step-by-step instructions to recreate the issue, but figured it was self explanatory

Viewing 15 posts - 1 through 15 (of 59 total)