Implementing Generator Scripts for in WordPress

scripts

#1

Hey there,

I’m working on one project of mine for which I need to include a generator script. It is a bit different so I can’t use any plugin.

I don’t have much coding knowledge but I can paste the JavaScript & HTML at necessary places if you guys can help.


#2

Hi jaygummers welcome to the forum

Sorry, but I don’t know what you mean by “generator”. Generate what?


#3

Generator as in Codes Generator or Card Generators.


#4

Are those for credit cards, or are they a different type of generator?


#5

Can I put the url of the website? I have seen a website on WordPress which has some Gift Card Generators embedded into the site… I wish to do the same but for different purposes altogether.


#6

If this is for WordPress I think a plugin would be the way to go. For something like gift card codes (I’m assuming they’re what I might call a “hash” eg. a5gh8365dfep9… ) you could put something together with only HTML and JavaScript, but it would need to tie in with a server-side script one way or another to keep track of which ones were valid and which were used etc.

Other than because it’s “different”, why can’t you use a plugin?


#7

Yes, I have mentioned that in the title. It is definitely a WP website. I got that from the links but I am not sure about the Generator thingy… Shall I include the link of that generator post? It would be easy to understand rather than discussing it vaguely?

I haven’t added it yet because I thought my post might be considered as spam since it is a new account.


#8

Seeing a site that uses it probably wouldn’t be as helpful as being able to take a look at the code. Is it free and the source code available in either wordpress/plugins, github, or similar?


#9

Just go through this link. There’s a generator appearing in the middle of the post.

I wish to get the similar Generator on my website.

P.S. I don’t think it is any free plugin or such, that’s why I have attached it.


#10
function makeId(length) {
  var text = "";
  var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  for (var i = 0; i < length; i++)
    text += possible.charAt(Math.floor(Math.random() * possible.length));
  return text
}
function generateUserEmailPassword() {
  const email = makeId(4) + "-" + makeId(4) + "-" + makeId(4) + "-" + makeId(4);
  const passwordField = makeId(4) + "-" + makeId(4) + "-" + makeId(4) + "-" + makeId(4);
  console.log('email', email, 'passwordField', passwordField)
}

generateUserEmailPassword();

#11

Is this like the code that I paste into my website or what?


#12

@Rogerfedrer I didn’t see that the OP is asking for an email password. How does your code help?


#13

It is not my code. I just checked the website that he mentioned. This is is the exact JavaScript code on the website. Didn’t he ask for it?


#14

I am still asking for this…

Is this like the code that I paste into my website or what?


#15

Just put it in the back-end of your theme. Also, you’ll need some additional HTML + CSS to make the front-end. This won’t be possible using any plugin or WP custom widget. You need to code this on your own.


#16

I did a quick internet search for fake credit card number generator Wordpress plugins. Nothing really stands out. You will need to write your own plugin for Wordpress or add code manually to the theme to do so.


#17

My understanding is that @jaygummers is looking for a gift certificate generator, not something for passwords or credit card data.


#18

My mistake.

Then how about something like this as a Woo add-on.

This is the google search phrase I used to find that.

woocommerce + gift certificates


#19

:joy::joy::joy::joy:

I am going to hire a PHP Developer from Fiverr and will get him to embed the Generator on my website. I don’t think this job is easy.

Anyway, thanks for helping out guys.


closed #20

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.