298 comments found.
- mycustom.js
- functions.php
- mycustom.css
mycustom.js
jQuery(document).on("keyup", ".opd-container input[name='email']", function (event) {
var error_msg = '<div class="err_msg" style="color: red;border: 1px solid red;padding: 5px;">O endereço de email que indicou não é permitido!</div>';
jQuery('.opd-container .opd-message').html('');
jQuery('.opd-container .opd-submit').removeClass('allow_btn');
jQuery('.custom_spin').remove();
var current_ele = jQuery(this);
var email = current_ele.val();
if(email){
if(validateEmail(email)){
jQuery('.opd-container .opd-submit').parent().append('<i class="fas fa-spinner fa-spin custom_spin" />');
jQuery.ajax({
url: ajax_url,
aysnc: false,
type: 'post',
data: {
'action': 'check_valid_emails',
'email': email,
},
success: function (data) {
console.log(data);
var data = JSON.parse(data);
if(data.status == "valid"){
jQuery('.opd-container .opd-submit').addClass('allow_btn');
jQuery('.opd-container .opd-message').html('');
} else {
jQuery('.opd-container .opd-submit').removeClass('allow_btn');
jQuery('.opd-container .opd-message').html(error_msg);
}
jQuery('.custom_spin').hide();
},
error: function (errorThrown) {
console.log(errorThrown);
}
});
} else {
jQuery('.opd-container .opd-submit').removeClass('allow_btn');
jQuery('.opd-container .opd-message').html('');
}
} else {
jQuery('.opd-container .opd-submit').removeClass('allow_btn');
jQuery('.opd-container .opd-message').html('');
}
});
function validateEmail(email) {
const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(String(email).toLowerCase());
}
functions.php
<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'mycustom', get_stylesheet_directory_uri() . '/css/mycustom.css' );
wp_enqueue_script( 'mycustom', get_stylesheet_directory_uri().'/js/mycustom.js', array('jquery'), false, true );
}
add_action('wp_ajax_check_valid_emails', 'check_valid_emails');
add_action('wp_ajax_nopriv_check_valid_emails', 'check_valid_emails');
function check_valid_emails()
{
$result_arr = [];
$email = isset($_POST['email']) ? $_POST['email'] : '';
if($email){
$valid_email_domains = array("gmail.com", "hotmail.com", "outlook.pt", "outlook.com", "yahoo.com", "sapo.pt", "live.com.pt", "msn.com", "netcabo.pt", "portugalmail.com", "portugalmail.pt", "live.com", "netmadeira.com", "protonmail.com", "yandex.com");
$valid = false;
foreach( $valid_email_domains as $d ){
$d_length = strlen( $d );
$current_email_domain = strtolower( substr( $email, -($d_length), $d_length));
if( $current_email_domain == strtolower($d) ){
$valid = true;
break;
}
}
// Return error message for invalid domains
if( $valid === false ){
$result_arr['status'] = 'invalid';
} else {
$result_arr['status'] = 'valid';
}
}
print_r(json_encode($result_arr));
exit;
}
?>
mycustom.css
/*--------------------------------------------------------------
## Download Plugin
--------------------------------------------------------------*/
.opd-container .opd-submit{pointer-events: none; opacity: 0.7;}
.opd-container .opd-submit.allow_btn{pointer-events: auto; opacity: 1;}
.loading {
height: 0;
width: 0;
padding: 15px;
border: 6px solid #ccc;
border-right-color: #888;
border-radius: 60px;
-webkit-animation: rotate 1s infinite linear;
/* left, top and position just for the demo! */
position: absolute;
left: 50%;
top: 50%;
}
@-webkit-keyframes rotate {
/* 100% keyframe for clockwise.
use 0% instead for anticlockwise */
100% {
-webkit-transform: rotate(360deg);
}
}
Hi, I have a pre-sales question. I have a 50MB file but I can only upload 32MB max at a time. It is possible for the subscriber to download two files?
Hi. Unfortunately, no.
Hello,
I purchased this plugin as it is compatible with mailster. To download the file, a mailster subscription is sent to the e-mail address, but the download link is not provided. I look forward to your support to fix this problem.
Thanks & Best Regards,
Please provide access to WP dashboard and URL of the page where I can see the form. I’ll check what’s wrong.
I’ve sent you a message
OK. Here I go again. What is the process for embedding the forms into an external website? All I am seeing is a shortcode and a download url. Does that download url automatically generate a download or something?
You use it with Halfdata Admin Panel. Right? In your admin panel please go to “How To Use” page. It explains how to use the script.
Is it possible to use a different form style for this? These are not very attractive at all. And again the documentation for embedding them on a website is very vague and incomplete. An example is rounded corners in fields and in Boxes. These are very sharp and I am not seeing any way to rouns corners or create attractive forms.
Also the GetResponse will not validate API key or locate campaigns so I get a warning.
1. Unfortunately, there is no feature to fully customize the form. You can change some parameters, but not all possible ones.
2. What exactly is not clear in documentation. Embedding the script is really simple process. Please let me know what step is not clear.
3. Please provide access to script’s admin panel. I’ll check what’s wrong with GetResponse.
I will send you the admin login in the contact form. As for what is not clear? It would be helpful to see some screen shots or a video of the process. For some reason I am not able to get them to show up. Yes it might be easy, but it may take a visual for me to understand it and GET it.
It’s impossible to create videos or screenshots. Script can be embedded into ANY webpage. People use different sites with different structures and internal architectures, they use different ways to modify source code. I can’t create vide to cover all possible situations. That’s why I described common steps. Exact procedure depends on your site.
Thanks for details. Please also send me your GetResponse key.
It will be in your email in 2 minutes
Thanks. Seems GetResponse updated their API. I’ve already included the fix into script/plugin. You can download new version from CodeCanyon.
Hi, Im looking for a plugin where I can generate multiple links to download in a website section, I have a place with links download in my website but I need to have also name, mail and phone. Can I do this with your plugin? And is possible to show the links in my website? (dont send in a mail) Thanks
Unfortunately, there is no such feature.
Thanks for letting me know. I’ll check and inclide into todo list.
Hello!
Is it compatible with Polylang?
Unfortunately, I’m not familiar with this plugin.
It is a multilanguage plugin. https://wordpress.org/plugins/polylang/
Hello ! Since yesterday, i’ve got an AJAX error when i try to click the submit button form (I looked at the Dev console ):
d7c68.js:102 Uncaught TypeError: Cannot read property ‘ajax-url’ of undefined
And the more detailed part of the code where problem occurs :
jQuery.ajax({
url: opd_vars["ajax-url"],
data: form_data,
method: (opd_vars["mode"] "remote" ? "get" : "post"),
dataType: (opd_vars["mode"] "remote" ? "jsonp" : "json"),
async: true,
success: function(return_data)
Maybe something change in AJAX libraries ?
Thanks
Nothing changed. Looks like you combined js files and included inline js into file. And fid incorrectly.
I have several downloadable files on my website, I have a doubt before buying it if this plugin will work for me. I have several PDFs on my website. Does the plugin work with only one link? or can I configure multiple forms? The only thing I need is that depending on which page they access and decide to download a PDF they will receive a different link.Thanks
Hi. You can use as many files as you want.
Hi there,
Under features it says that, among others, Mailster is supported. But even though I see the other options under the Integration Settings, no Mailster options are present. So my question is, how is Mailster supported and is it possible to link opt-ins via this plugin to a Mailster list?
Hi. Make sure you have latest version of the plugin and Mailster installed and activated.
Thank you, the Opt-In Downloads plugin wasn’t updated, so that’s why it wasn’t working. It would be nice if it was possible to use the Mailster editor as the OID e-mail editor if both plugins are active. I know I can just copy the HTML from Mailster, but the Mailster editor is very versatile.
Also, it would be nice if it were possible to select a separate Mailster list per download, instead of just one general one.
Lastly, it would be nice to have a newsletter opt-in checkbox, and use that as a conditional check before the user is added to the Mailster list.
Thanks for ideas. I’ll think how to implement them.
Hello, please does this plugin enables users to be redirected to a specific page after users submitted the form to get their giveaway? Like redirecting the users to a sales page or upsell page or so
No. There is no such feature.
Plugin is producing the following error with a popup on my site: “Make sure that you properly included opd.js. Currently you did not.” – fix?
Seems you use WP Rocket. Make sure that you disabled “delay javascript execution”.
Hello, I’m moving my downloads from one site to another (I will use the plugin only on one site). Is it possible to export all download links (shortcuts, settings, etc) from the current installation to the new one? I would really like to avoid exporting database files. Thanks!
Hi. Unfortunately, there is no such feature.
Hi, so first of Great plugin! It worked fine for like 3500 subscribers, and now all of a sudden it doesnt send any download links anymore, not to the customers and not the admin, any idea what could have caused that? Thank you!
Hi. Please notice, WordPress plugins never send emails by themselves. They delegate this function to WordPress core by using wp_mail() function. So, the WordPress core is responsible for email sending. If you don’t receive emails, it means that WordPress can’t send them. Why it may happen and what to do?
1. By default WordPress uses php mail() function. Probably your hosting provider blocks this function. Please contact their support and ask if they do that.
2. Some hosting providers don’t allow to send emails when sender email address doesn’t belong to the same domain (where website installed) or doesn’t exists. So, please go to plugin’s Settings page and make sure that Sender Email address exists and belongs to domain, where website installed.
3. Also you can configure wp_mail() function to use any 3rd party SMTP server by using free plugins, that adjust wp_mail(): https://wordpress.org/plugins/search.php?q=wp_mail
can the links be set to never expire?
Unfortunately, there is no such feature.
Hi, is it possible to add a “Mobile phone” field in the form? Thank you so much
Hi. Unfortunately, there is no such feature.