Plugin Directory

Changeset 2598067


Ignore:
Timestamp:
09/13/2021 01:06:07 PM (4 years ago)
Author:
ctrify
Message:

Updating version 1.1.2

Location:
ctrify
Files:
28 added
2 edited

Legend:

Unmodified
Added
Removed
  • ctrify/tags/1.1.1/js/ctrify-script.js

    r2597901 r2598067  
    33 * (c) ExcursionPass inc 2019 - 2021
    44 */
    5 
    6 !function(e){function t(t){return tmp=swal({text:t,type:!1,imageUrl:ctrify.loading_icon_url,onOpen:()=>{e(swal.getImage()).addClass("rotating")},heightAuto:!1,imageWidth:100,imageHeight:100,imageAlt:t,allowOutsideClick:!1,allowEscapeKey:!1,allowEnterKey:!1,showConfirmButton:!1,width:600}),tmp}function i(t,i,n,a){return n=void 0===n||n,e.ajax({type:"POST",url:"https://www.ctrify.com/api/v3/"+t,data:"params="+i,cache:!1,beforeSend:function(e){e.setRequestHeader("x-site",ctrify.xsite),e.setRequestHeader("x-user",ctrify.xkey),e.setRequestHeader("x-path",ctrify.xpath),e.setRequestHeader("x-license",ctrify.license_key),e.setRequestHeader("x-version",ctrify.version)},async:n,success:function(i){if(void 0!==a&&"Restricted."!=i)switch(a){case"ctrify_saveWPCTRForm":l(i,t,!0);break;case"ctrify_processPayment":!function(e,t,i){1==i&&"ok"==(e=JSON.parse(e)).status&&null!=e.url?(localStorage.setItem("pid",e.id),window.location.href=e.url):swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error})}(i,0,!0);break;case"ctify_confirmCapture":!function(e,t,i){if(1==i){var n=JSON.parse(e),i=null!=n.status?n.status:n;if("ok"==i)window.location.reload();else switch(i){case"credits":swal({heightAuto:!1,type:"error",title:"You don´t have enough credits to perform this action. Please buy more."});break;case"save_success":swal({heightAuto:!1,type:"success",title:ctrify.save_success});break;case"notfound":swal({heightAuto:!1,type:"error",title:ctrify.notfound});break;case"rebuild_limit":swal({heightAuto:!1,type:"error",title:ctrify.rebuild_limit});break;case"tryagain":swal({heightAuto:!1,type:"error",title:n.message});break;default:swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error})}}}(i,0,!0);break;case"ctify_printQuestions":!function(t,i,n){if(swal.close(),1==n){var a=JSON.parse(t);if("ok"==a.status){e(".closed-"+a.key).remove();var o=null!=a.buttondisabled?"disabled":"",s=null!=a.buttondisabled?'<span class="title inline-edit-categories-label">Keywords</span>':'<span class="title inline-edit-categories-label">Questions( <strong><x id="questmarked">0</x> new questions marked for processing</strong> )</span>',r='<fieldset class="inline-edit-categories"><div class="inline-edit-col">'+s+'<ul class="cat-checklist questionschecklist">',l=JSON.parse(a.questions),c=!1;Object.keys(l).forEach(function(e){var t=1==l[e].processed?"checked":"",i=1==l[e].processed?"readonly":"",n=1==l[e].processed?"disabled":"",a=1==l[e].processed?"":"ctrify_procquest";null==l[e].pid&&(t="",n="",a="ctrify_procquest",i=""),c=l[e].cid,r+=`<li id="category-${e}"><label class="selectit"><input ${t} ${i} ${n} value="${e}" type="checkbox" name="questioncategory[]" id="in-category-${e}" class="${a}"> ${l[e].question}</label></li>`}),r+="</ul></div></fieldset>";var u=`<tr class="closed-${a.key} inline-edit-row inline-edit-row-post quick-edit-row quick-edit-row-post inline-edit-post inline-editor">\n                            <td colspan="10" class="colspanchange">\n                              <div>${r}</div>\n                              <div class="submit inline-edit-save">\n                                <button toclose="${a.key}" type="button" class="ctrify_closeadded button alignleft">Cancel</button>\n                                <button type="button" ${o} class="button button-primary ctrify_saveprocessselected alignright" capid="${c}">Process Selected As Different Posts</button>\n                                <button type="button" ${o} class="button button-primary ctrify_combineprocessselected alignright" capid="${c}" style="background: #ed9f0f;border: #b57b0f;">Combine Selected As Long Post</button>\n                                <span class="spinner"></span>\n                                <br class="clear">\n                              </div>\n                          </td>\n                      </tr>`;e("#post-"+a.key).closest("tr").after(u)}else"credits"==a.status?swal({heightAuto:!1,type:"error",title:"You don´t have enough credits to perform this action. Please buy more."}):swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error})}}(i,0,!0);break;case"ctrify_processnewCampaign":!function(e,t,i){if(1==i)switch((e=JSON.parse(e)).status){case"ok":swal({heightAuto:!1,type:"success",title:"Your new campaign is now in the process.  It may take a few minutes, to an hour to start posting depending on our backlog jobs load."}),setTimeout(function(){window.location.reload()},3e3);break;case"credits":swal({heightAuto:!1,type:"error",title:"You don´t have enough credits to start a new campaign. Please buy more."});break;case"prompt":swal({heightAuto:!1,type:"error",title:e.prompt});break;default:swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error})}else swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error})}(i,0,!0)}"Restricted."==i&&window.location.reload()},error:function(e){if(void 0!==a)switch(a){case"ctrify_saveWPCTRForm":l(i,t,!1)}}}),"false"}function n(e,t){if(null!=e)for(var i=e.options,n=0,a=i.length;n<a;n++)if(i[n].value==t)return e.selectedIndex=n,!0;return!1}function a(){Swal.fire({title:"Buy Credits",input:"select",inputOptions:ctrify.credits_options,confirmButtonText:"Pay with Paypal",inputValidator:e=>{if(!e)return"You need to choose something!";setTimeout(function(){t(ctrify.redirecting)},100);var n={credits:e,is:ctrify.is,paypal_email:ctrify.paypal_email};i("ctrify_buyCredits",btoa(unescape(encodeURIComponent(JSON.stringify(n)))),!0,"ctrify_processPayment")}})}function o(e){return`https://res.cloudinary.com/demo/image/upload/q_auto,f_auto/${e}/18882410261_e4f9d25780_b_lked9y.jpg`}function s(){var e='<label for="ctrify_cloudinary_image_options" style="font-weight: bold;">Select Image Effect: </label>';return e+='<select name="ctrify_cloudinary_image_options" id="ctrify_cloudinary_image_options" style="width: 227px;">',e+="<option "+("e_improve"==ctrify.cloudinaryeffect?"selected":"")+' value="e_improve">Improve</option>',e+="<option "+("e_grayscale"==ctrify.cloudinaryeffect?"selected":"")+' value="e_grayscale">Gray Scale</option>',e+="<option "+("e_grayscale/e_tint:50:red"==ctrify.cloudinaryeffect?"selected":"")+' value="e_grayscale/e_tint:50:red">Duotone Red</option>',e+="<option "+("e_grayscale/e_tint:50:blue"==ctrify.cloudinaryeffect?"selected":"")+' value="e_grayscale/e_tint:50:blue">Duotone Blue</option>',e+="<option "+("e_grayscale/e_tint:50:green"==ctrify.cloudinaryeffect?"selected":"")+' value="e_grayscale/e_tint:50:green">Duotone Green</option>',e+="<option "+("e_sepia:80"==ctrify.cloudinaryeffect?"selected":"")+' value="e_sepia:80">Duotone Sepia</option>',e+="<option "+("e_hue"==ctrify.cloudinaryeffect?"selected":"")+' value="e_hue">Random Hue</option>',e+="<option "+("a_hflip,e_improve"==ctrify.cloudinaryeffect?"selected":"")+' value="a_hflip,e_improve">Flip Horizontally</option>',e+="</select>",e+=`<img id="cloudimage" src="${o("e_improve")}" style="float: left;width: 400px;margin-right: 36px;">`}function r(){if("https:"!==location.protocol)return swal({heightAuto:!1,type:"error",title:"You need an SSL certificate to allow secure communications with the API between our servers."}),!1;parseInt(ctrify.campaigns)>=parseInt(ctrify.limit)?(e("#ctrify_newcampaign").addClass("ctrify_limited"),e("#ctrify_newgeneralcampaign").addClass("ctrify_limited")):(e("#ctrify_newcampaign").removeClass("ctrify_limited"),e("#ctrify_newgeneralcampaign").removeClass("ctrify_limited"))}function l(t,i,n){if(e(".ctrify_error").removeClass("ctrify_error"),1==n)if("ok"==(t=JSON.parse(t)).status){var a=ctrify.nonce_save_settings,o=e("#ctrify_form").serialize()+"&_ajax_nonce="+a+"&action=save_settting_nonce_action";e.post({url:ctrify.ajaxurl,data:o}).always(function(e){swal.close()}).done(function(t){void 0!==t.success&&t.success?e.get(window.location.href).always(function(t,i,n){status=n.status,"2"!=status.substr(0,1)?swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error}):(e("#ctrify_review-notification").show(),swal({type:"success",heightAuto:!1,title:ctrify.save_success,showConfirmButton:!1,timer:1400}),setTimeout(function(){window.location.reload()},1400))}):void 0===t.success||t.success?swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error}):swal({heightAuto:!1,type:"error",title:t.data})}).fail(function(e){e.data?swal({type:"error",heightAuto:!1,title:ctrify.documented_error+" "+e.data}):swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error})})}else switch(t.status){case"fail_deepl":e("#ctrify_deepl_key").addClass("ctrify_error"),swal({heightAuto:!1,type:"error",title:"Your DeepL API key is not correct, or you have reached your account limit."}),e("html, body").animate({scrollTop:e("#ctrify_deepl_key").offset().top-170},2e3);break;case"fail_cloudinary":e(".ctrify_cloud_key").addClass("ctrify_error"),swal({heightAuto:!1,type:"error",title:"One or more of your Cloudinary API params is not correct, or you have reached your account limit."}),e("html, body").animate({scrollTop:e("#ctrify_cloudinary_key").offset().top-170},2e3);break;case"fail_license":swal({heightAuto:!1,type:"error",title:"Your license key is not correct, or you have reached your account limit."}),null!=document.getElementById("ctrify_license_key")&&(e("#ctrify_license_key").addClass("ctrify_error"),e("html, body").animate({scrollTop:e("#ctrify_license_key").offset().top-170},2e3));break;case"prompt":swal({heightAuto:!1,type:"error",title:t.prompt});break;default:swal({heightAuto:!1,type:"error",title:t.status})}else swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error});return!1}if(e(".ctrify_noclick").on("click",function(e){e.preventDefault()}),e(".ctrify_viewquestions").on("click",function(n){n.preventDefault(),setTimeout(function(){t(ctrify.retrieving)},100);var a={action:"viewquestions",id:e(this).attr("qid"),is:ctrify.is};i("updateSEOCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(a)))),!0,"ctify_printQuestions")}),e(".ctrify_viewkeywords").on("click",function(n){n.preventDefault(),setTimeout(function(){t(ctrify.retrieving)},100);var a={action:"viewkeywords",id:e(this).attr("qid"),is:ctrify.is};i("updateSEOCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(a)))),!0,"ctify_printQuestions")}),e(document.body).on("click",".ctrify_closeadded",function(t){t.preventDefault(),e(this).closest("tr").remove()}),e(document.body).on("click",".ctrify_procquest",function(t){var i=e(".ctrify_procquest:checkbox:checked");e("#questmarked").html(i.length);for(var n=0,a=i.length;n<a;n++);}),e(document.body).on("click",".ctrify_saveprocessselected",function(n){n.preventDefault();for(var a=e(".ctrify_procquest:checkbox:checked"),o=[],s=0,r=a.length;s<r;s++)o.includes(a[s].value)||o.push(a[s].value);if(o.length>0){setTimeout(function(){t(ctrify.saving)},100);var l={action:"addquestions",selected:o,is:ctrify.is,id:e(this).attr("capid")};i("updateSEOCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(l)))),!0,"ctify_confirmCapture")}}),e(document.body).on("click",".ctrify_combineprocessselected",function(n){n.preventDefault();for(var a=e(".ctrify_procquest:checkbox:checked"),o=[],s=0,r=a.length;s<r;s++)o.includes(a[s].value)||o.push(a[s].value);if(o.length>10)swal({heightAuto:!1,type:"error",title:"You can´t combine more that 10 questions"});else{setTimeout(function(){t(ctrify.saving)},100);var l={action:"combinequestions",selected:o,is:ctrify.is,id:e(this).attr("capid")};i("updateSEOCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(l)))),!0,"ctify_confirmCapture")}}),e(".ctrify_pausecampaign").on("click",function(n){n.preventDefault(),setTimeout(function(){t(ctrify.saving)},100);var a={action:"pause",id:e(this).attr("capid"),is:ctrify.is};i("updateSEOCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(a)))),!0,"ctify_confirmCapture")}),e(".ctrify_editcampaign").on("click",function(n){n.preventDefault(),setTimeout(function(){t(ctrify.saving)},100);var a={action:"active",id:e(this).attr("capid"),is:ctrify.is};i("updateSEOCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(a)))),!0,"ctify_confirmCapture")}),e(".ctrify_increaselimit").on("click",function(n){n.preventDefault();var a=e(this).attr("limit");swal.fire({title:"Increase your limit",input:"number",text:"You need to increase the limit to activate this campaign.",inputValue:a,confirmButtonText:"Increase Limit",confirmButtonColor:"#6eb78a",showCancelButton:!0,cancelButtonColor:"rgb(230, 141, 83)",reverseButtons:!0,inputValidator:n=>new Promise(o=>{if(parseInt(n)>parseInt(ctrify.credits))o("You need more credits to reach that new limit. With your current credits you can increase the limit up to a maximun of "+ctrify.credits);else if(parseInt(n)<parseInt(a))o("You need to increase the limit to more than your current limit of "+a);else if(parseInt(n)!=parseInt(a)){if(""!=n){setTimeout(function(){t(ctrify.saving)},100);var s={action:"uplimit",newlimit:n,id:e(this).attr("capid"),is:ctrify.is};i("updateSEOCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(s)))),!0,"ctify_confirmCapture"),o()}}else o("The new limit is the same as the old limit")})})}),e(".upgrade").on("click",function(t){t.preventDefault();var n=e(this).attr("href");"#"==n?i("rebuildUpdate",!1,!0,"ctify_confirmCapture"):n.includes("update.php")?window.location.href=n:window.open(n,"_blank")}),e("#ctrify_doactioncampaign").on("click",function(t){t.preventDefault();var n=[];if("trash"==e("#bulk-action-selector-bottom").val()&&(e("input:checkbox.campaignsins").each(function(){sThisVal=this.checked?e(this).val():"",""!=sThisVal&&(e("#post-"+sThisVal).hide(),n.push(sThisVal))}),n.length>0)){var a={campaigns:n,is:ctrify.is,action:"delete"};i("deleteCampaigns",btoa(unescape(encodeURIComponent(JSON.stringify(a)))),!0),Swal.fire("Deleted!","Your file has been deleted.","success")}}),e("#ctrify_doactiontransfer").on("click",function(t){t.preventDefault();var n=[];if("credits"==e("#bulk-action-selector-credits").val()&&(e("input:checkbox.domainsins").each(function(){sThisVal=this.checked?e(this).val():"",""!=sThisVal&&n.push(sThisVal)}),n.length>0)){var a={sources:n,is:ctrify.is,action:"transfer"};console.log(a),i("transferCredits",btoa(unescape(encodeURIComponent(JSON.stringify(a)))),!0),Swal.fire("Transfered!","Your credits had been transfered!","success"),setTimeout(function(){window.location.reload()},1400)}}),e(".ctrify_buycredits").on("click",function(t){if(t.preventDefault(),"https:"!==location.protocol)return swal({heightAuto:!1,type:"error",title:"You need an SSL certificate to allow secure communications with the API between our servers."}),!1;null==ctrify.paypal_email||""==ctrify.paypal_email?(e("#ctrify_paypal_email").addClass("error"),swal({heightAuto:!1,type:"error",title:"Add your Paypal email on the settings"}),e("html, body").animate({scrollTop:e("#ctrify_paypal_email").offset().top-170},2e3)):(e("#ctrify_paypal_email").removeClass("error"),a())}),1==e("#ctrify_publish_newposts").prop("checked")?e("#ctrify_schedule_newposts").prop("disabled",!1):(e("#ctrify_schedule_newposts").prop("disabled",!0),n(document.getElementById("ctrify_schedule_newposts"),"no")),e(document.body).on("change","#ctrify_publish_newposts",function(t){1==e("#ctrify_publish_newposts").prop("checked")?e("#ctrify_schedule_newposts").prop("disabled",!1):(e("#ctrify_schedule_newposts").prop("disabled",!0),n(document.getElementById("ctrify_schedule_newposts"),"no"))}),e(document.body).on("change","#ctrify_cloudinary_image_options",function(t){e("#cloudimage").attr("src",o(e(this).val()))}),1==e("#ctrify_featured_images").prop("checked")?(e("#ctrify_cloudinary_options").html(s()),e("#cloudimage").attr("src",o(ctrify.cloudinaryeffect))):e("#ctrify_cloudinary_options").html(""),e(document.body).on("change","#ctrify_featured_images",function(t){"no"==ctrify.cloudinaryON?(e(".ctrify_cloud_key").addClass("error"),swal({heightAuto:!1,type:"error",title:"You need to add your Cloudinary API params first."}),e("html, body").animate({scrollTop:e("#ctrify_cloudinary_key").offset().top-170},2e3),e("#ctrify_featured_images").prop("checked",!1)):1==e("#ctrify_featured_images").prop("checked")?e("#ctrify_cloudinary_options").html(s()):e("#ctrify_cloudinary_options").html("")}),e(document.body).on("click","#ctrify_newclustercampaign",function(t){if(t.preventDefault(),r(),e(this).hasClass("ctrify_buycredits"))return a(),!1;if(e(this).hasClass("ctrify_limited"))return swal({heightAuto:!1,type:"warning",title:ctrify.limited}),!1;var n=!1,o=!1,s=!1,l=!1,c=["1"],u=!1,d=[{title:"Content Regionalization and language",html:"<br>You will be able to translate this content to any language at the moment of creating the post if you have the <strong>DeepL API option active</strong>. Different countries and languages may output different localized texts.",input:"select",inputPlaceholder:"Select a Language and Country",inputOptions:{en_AS:"English » American Samoa | as",en_AI:"English » Anguilla | ai",en_AG:"English » Antigua And Barbuda | ag",en_AU:"English » Australia | au",en_BS:"English » Bahamas | bs",en_CA:"English » Canada | ca",en_CK:"English » Cook Islands | ck",en_CY:"English » Cyprus | cy",en_DM:"English » Dominica | dm",en_FJ:"English » Fiji | fj",en_GM:"English » Gambia | gm",en_GH:"English » Ghana | gh",en_GI:"English » Gibraltar | gi",en_GG:"English » Guersney | gg",en_GY:"English » Guyana | gy",en_IN:"English » India | in",en_IE:"English » Ireland | ie",en_IM:"English » Isle Of Man | im",en_JM:"English » Jamaica | jm",en_KI:"English » Kiribati | ki",en_MV:"English » Maldives | mv",en_MU:"English » Mauritius | mu",en_FM:"English » Micronesia | fm",en_MS:"English » Montserrat | ms",en_NA:"English » Namibia | na",en_NR:"English » Nauru | nr",en_NZ:"English » New Zealand | nz",en_NG:"English » Nigeria | ng",en_NU:"English » Niue | nu",en_NF:"English » Norfolk Island | nf",en_PK:"English » Pakistan | pk",en_PN:"English » Pitcairn | pn",en_RW:"English » Rwanda | rw",en_SH:"English » Saint Helena | sh",en_VC:"English » Saint Vincent And Grenadines | vc",en_WS:"English » Samoa | ws",en_SL:"English » Sierra Leone | sl",en_SG:"English » Singapore | sg",en_SB:"English » Solomon Islands | sb",en_LK:"English » Sri Lanka | lk",en_TK:"English » Tokelau | tk",en_TO:"English » Tonga | to",en_TT:"English » Trinidad and Tobago | tt",en_GB:"English » United Kingdom | uk",en_US:"English » United States | com",en_VU:"English » Vanuatu | vu",en_VG:"English » Virgin Islands, British | vg",en_VI:"English » Virgin Islands, U.S. | vi",en_ZM:"English » Zambia | zm",en_ZW:"English » Zimbabwe | zw",es_AR:"Spanish » Argentina | ar",es_BZ:"Spanish » Belize | bz",es_BO:"Spanish » Bolivia | bo",es_CL:"Spanish » Chile | cl",es_CO:"Spanish » Colombia | co",es_CR:"Spanish » Costa Rica | cr",es_CU:"Spanish » Cuba | cu",es_DO:"Spanish » Dominican Republic | do",es_EC:"Spanish » Ecuador | ec",es_SV:"Spanish » El Salvador | sv",es_GT:"Spanish » Guatemala | gt",es_HN:"Spanish » Honduras | hn",es_MX:"Spanish » Mexico | mx",es_NI:"Spanish » Nicaragua | ni",es_PA:"Spanish » Panama | pa",es_PY:"Spanish » Paraguay | py",es_PE:"Spanish » Peru | pe",es_PR:"Spanish » Puerto Rico | pr",es_ES:"Spanish » Spain | es",es_UY:"Spanish » Uruguay | uy",es_VE:"Spanish » Venezuela | ve"},inputValidator:(e,t)=>new Promise(t=>{if(""!=e){var i=e.split("_");u="es"==i[0]?"Spanish":"English",t()}else t("You need to select one language")})}];d.push({title:"Main Title Keyword",html:'<div style="text-align:justify;"><br>Write the main title, question or long tail keyword. Our AI will learn all about it and will generate related content.<br><br> On the next step you will provide a set of subtitles or cluster keywords. It will generate a full post including all of them </div><br><br><label><strong>Main Title Keyword</strong></label>',inputValidator:e=>!e&&"You need to provide one main keyword in "+u}),c.push(c.length+1),d.push({title:"Cluster keywords",input:"textarea",html:'<div style="text-align:justify;">Please add one by line and up to 6 maxium. Write subtitles, related questions, or clustered long-tail keywords. The AI will generate content for them and will be included in the final post following the same order.</div>',inputValidator:e=>new Promise(t=>{var i=e.split(/\r?\n/);i.length>0&&i.length<7&&""!=i[0]?t():""==i[0]?t("You need to provide at least one subtitle, question or cluster long-tail keyword"):t("You can write a maxium of 6 lines with subtitles, questions or cluster long-tail keywords")})}),c.push(c.length+1),d.push({title:"Negative keywords",input:"textarea",html:'<div style="text-align:justify;">Some keywords may have more than one meaning and you may want to discard posts creation for not desired meanings. Ej "Will Smith" can be the actor or well the baseball pitcher. So if you like that posts to be related to the baseball player you would like to add as negative keywords "movies, Netflix" etc<br><br> Add them here if you like, <b>one keyword by line</b>, and post that include those keywords won´t be included in your campaign. <br><br>You can leave it blank now and add them later if you found some not desired keywords on your campaign. But adding them now may save you some credits.</div>',inputValidator:e=>{}}),c.push(c.length+1),"yes"==ctrify.isPost&&(d.push({title:"Select the Category",html:"<br>Select a the category where new posts will be asigned.",input:"select",inputPlaceholder:"Select a Category",inputOptions:ctrify.categories,inputValidator:(e,t)=>new Promise(i=>{""!=e?(s=e,l=t,i()):i("You need to select one category, or uncategorized")})}),c.push(c.length+1)),"yes"==ctrify.deeplON&&(d.push({title:"Translate with DeepL?",html:"<br>Select a language to translate the final post to, or click next without select a language to create the post on the localized language selected on the previous step.",input:"select",inputPlaceholder:"Translate To...",inputOptions:ctrify.langs,inputValidator:(e,t)=>new Promise(t=>{""!=e?(o=e,t()):t()})}),c.push(c.length+1)),swal.mixin({input:"text",confirmButtonText:"Next &rarr;",showCancelButton:!0,reverseButtons:!0,progressSteps:c}).queue(d).then(e=>{e.value&&(n=e.value,swal.fire({title:"All ready!",html:`<br><div style="text-align:justify;">\n                     You are about to create a post for:<br><br> <strong> ${e.value[1]} </strong>  ${""!=e.value[1]?"<br><br><b>And aditional texts for the following keywords:</b><br><ul>":""} ${""!=e.value[2]?e.value[2].split("\n").map(function(e){return"<li>"+e+"</li>"}).join(""):""}</ul><br> \n              `,confirmButtonText:"Create Campaign!",confirmButtonColor:"#6eb78a",showCancelButton:!0,cancelButtonColor:"rgb(230, 141, 83)",reverseButtons:!0}).then(e=>{if(e.value){var t={type:"cluster",country:n[0],keyword:n[1],clusters:""!=n[2]?n[2].split(/\r?\n/):"",negatives:""!=n[3]?n[3].split(/\r?\n/):"",limit:n[4],is:ctrify.is,translateTo:o,catID:s,catName:l};i("createCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(t)))),!0,"ctrify_processnewCampaign")}}))})}),e(document.body).on("click","#ctrify_newgeneralcampaign",function(n){if(n.preventDefault(),r(),e(this).hasClass("ctrify_buycredits"))return a(),!1;if(e(this).hasClass("ctrify_limited"))return swal({heightAuto:!1,type:"warning",title:ctrify.limited}),!1;var o=!1,s=!1,l=!1,c=!1,u=!1,d=["1"],h=[{title:"Content Regionalization and language",html:"<br>You will be able to translate this content to any language at the moment of creating the post if you have the <strong>DeepL API option active</strong>. Different countries and languages may output different localized texts.",input:"select",inputPlaceholder:"Select a Language and Country",inputOptions:{en_AS:"English » American Samoa | as",en_AI:"English » Anguilla | ai",en_AG:"English » Antigua And Barbuda | ag",en_AU:"English » Australia | au",en_BS:"English » Bahamas | bs",en_CA:"English » Canada | ca",en_CK:"English » Cook Islands | ck",en_CY:"English » Cyprus | cy",en_DM:"English » Dominica | dm",en_FJ:"English » Fiji | fj",en_GM:"English » Gambia | gm",en_GH:"English » Ghana | gh",en_GI:"English » Gibraltar | gi",en_GG:"English » Guersney | gg",en_GY:"English » Guyana | gy",en_IN:"English » India | in",en_IE:"English » Ireland | ie",en_IM:"English » Isle Of Man | im",en_JM:"English » Jamaica | jm",en_KI:"English » Kiribati | ki",en_MV:"English » Maldives | mv",en_MU:"English » Mauritius | mu",en_FM:"English » Micronesia | fm",en_MS:"English » Montserrat | ms",en_NA:"English » Namibia | na",en_NR:"English » Nauru | nr",en_NZ:"English » New Zealand | nz",en_NG:"English » Nigeria | ng",en_NU:"English » Niue | nu",en_NF:"English » Norfolk Island | nf",en_PK:"English » Pakistan | pk",en_PN:"English » Pitcairn | pn",en_RW:"English » Rwanda | rw",en_SH:"English » Saint Helena | sh",en_VC:"English » Saint Vincent And Grenadines | vc",en_WS:"English » Samoa | ws",en_SL:"English » Sierra Leone | sl",en_SG:"English » Singapore | sg",en_SB:"English » Solomon Islands | sb",en_LK:"English » Sri Lanka | lk",en_TK:"English » Tokelau | tk",en_TO:"English » Tonga | to",en_TT:"English » Trinidad and Tobago | tt",en_GB:"English » United Kingdom | uk",en_US:"English » United States | com",en_VU:"English » Vanuatu | vu",en_VG:"English » Virgin Islands, British | vg",en_VI:"English » Virgin Islands, U.S. | vi",en_ZM:"English » Zambia | zm",en_ZW:"English » Zimbabwe | zw",es_AR:"Spanish » Argentina | ar",es_BZ:"Spanish » Belize | bz",es_BO:"Spanish » Bolivia | bo",es_CL:"Spanish » Chile | cl",es_CO:"Spanish » Colombia | co",es_CR:"Spanish » Costa Rica | cr",es_CU:"Spanish » Cuba | cu",es_DO:"Spanish » Dominican Republic | do",es_EC:"Spanish » Ecuador | ec",es_SV:"Spanish » El Salvador | sv",es_GT:"Spanish » Guatemala | gt",es_HN:"Spanish » Honduras | hn",es_MX:"Spanish » Mexico | mx",es_NI:"Spanish » Nicaragua | ni",es_PA:"Spanish » Panama | pa",es_PY:"Spanish » Paraguay | py",es_PE:"Spanish » Peru | pe",es_PR:"Spanish » Puerto Rico | pr",es_ES:"Spanish » Spain | es",es_UY:"Spanish » Uruguay | uy",es_VE:"Spanish » Venezuela | ve"},inputValidator:(e,t)=>new Promise(t=>{if(""!=e){var i=e.split("_");"es"==i[0]?"Spanish":"English",t()}else t("You need to select one language")})}];h.push({title:"Posts keywords",input:"textarea",html:'<div style="text-align:justify;">Write one keyword or question per line. Our AI will generate a new post based on each given keyword, or will answer each question.</div>',inputValidator:e=>new Promise(t=>{var i=e.split(/\r?\n/);i.length>0&&""!=i[0]?t():t("You need to provide at least one keyword or question")})}),d.push(d.length+1),h.push({title:"Negative keywords",input:"textarea",html:'<div style="text-align:justify;">Some keywords may have more than one meaning and you may want to discard posts creation for not desired meanings. Ej "Will Smith" can be the actor or well the baseball pitcher. So if you like that posts to be related to the baseball player you would like to add as negative keywords "movies, Netflix" etc<br><br> Add them here if you like, <b>one keyword by line</b>, and post that include those keywords won´t be included in your campaign. <br><br>You can leave it blank now and add them later if you found some not desired keywords on your campaign. But adding them now may save you some credits.</div>',inputValidator:e=>{}}),d.push(d.length+1),h.push({title:"Words limit",input:"number",inputValue:500,html:"Posts lengths may vary from keyword to keyword based on the subject and information available. We can´t control the mínimum, but you can control the approximate maximum number of words per post.",inputValidator:e=>{if(e<500)return"The minimun limit is 500 words per posts.";u=e}}),d.push(d.length+1),"yes"==ctrify.isPost&&(h.push({title:"Select the Category",html:"<br>Select a the category where new posts will be asigned.",input:"select",inputPlaceholder:"Select a Category",inputOptions:ctrify.categories,inputValidator:(e,t)=>new Promise(i=>{""!=e?(l=e,c=t,i()):i("You need to select one category, or uncategorized")})}),d.push(d.length+1)),"yes"==ctrify.deeplON&&(h.push({title:"Translate with DeepL?",html:"<br>Select a language to translate the final post to, or click next without select a language to create the post on the localized language selected on the previous step.",input:"select",inputPlaceholder:"Translate To...",inputOptions:ctrify.langs,inputValidator:(e,t)=>new Promise(t=>{""!=e?(s=e,t()):t()})}),d.push(d.length+1)),swal.mixin({input:"text",confirmButtonText:"Next &rarr;",showCancelButton:!0,reverseButtons:!0,progressSteps:d}).queue(h).then(e=>{e.value&&(o=e.value,swal.fire({title:"All ready!",html:`<br><div style="text-align:justify;">\n                     You are about to create one post for each of following keywords: </b><br><ul> ${""!=e.value[1]?e.value[1].split("\n").map(function(e){return"<li>"+e+"</li>"}).join(""):""}</ul><br> You understand that ${ctrify.credits_per_word} credits per word will be expended for each generated post<br>.\n              `,confirmButtonText:"Create Campaign!",confirmButtonColor:"#6eb78a",showCancelButton:!0,cancelButtonColor:"rgb(230, 141, 83)",reverseButtons:!0}).then(e=>{if(e.value){t(ctrify.saving);var n={type:"keyword",country:o[0],keywords:""!=o[1]?o[1].split(/\r?\n/):"",negatives:""!=o[2]?o[2].split(/\r?\n/):"",translateTo:s,wordslimit:u,is:ctrify.is,catID:l,catName:c};i("createCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(n)))),!0,"ctrify_processnewCampaign")}}))})}),e(document.body).on("click","#ctrify_newcampaign",function(t){if(t.preventDefault(),r(),e(this).hasClass("ctrify_buycredits"))return a(),!1;if(e(this).hasClass("ctrify_limited"))return swal({heightAuto:!1,type:"warning",title:ctrify.limited}),!1;var n=!1,o=!1,s=!1,l=!1,c=!1,u=["1"],d=!1,h=[{title:"Content Regionalization and language",html:"<br>You will be able to translate this content to any language at the moment of creating the post if you have the <strong>DeepL API option active</strong>. Different countries and languages may output different localized texts.",input:"select",inputPlaceholder:"Select a Language and Country",inputOptions:{en_AS:"English » American Samoa | as",en_AI:"English » Anguilla | ai",en_AG:"English » Antigua And Barbuda | ag",en_AU:"English » Australia | au",en_BS:"English » Bahamas | bs",en_CA:"English » Canada | ca",en_CK:"English » Cook Islands | ck",en_CY:"English » Cyprus | cy",en_DM:"English » Dominica | dm",en_FJ:"English » Fiji | fj",en_GM:"English » Gambia | gm",en_GH:"English » Ghana | gh",en_GI:"English » Gibraltar | gi",en_GG:"English » Guersney | gg",en_GY:"English » Guyana | gy",en_IN:"English » India | in",en_IE:"English » Ireland | ie",en_IM:"English » Isle Of Man | im",en_JM:"English » Jamaica | jm",en_KI:"English » Kiribati | ki",en_MV:"English » Maldives | mv",en_MU:"English » Mauritius | mu",en_FM:"English » Micronesia | fm",en_MS:"English » Montserrat | ms",en_NA:"English » Namibia | na",en_NR:"English » Nauru | nr",en_NZ:"English » New Zealand | nz",en_NG:"English » Nigeria | ng",en_NU:"English » Niue | nu",en_NF:"English » Norfolk Island | nf",en_PK:"English » Pakistan | pk",en_PN:"English » Pitcairn | pn",en_RW:"English » Rwanda | rw",en_SH:"English » Saint Helena | sh",en_VC:"English » Saint Vincent And Grenadines | vc",en_WS:"English » Samoa | ws",en_SL:"English » Sierra Leone | sl",en_SG:"English » Singapore | sg",en_SB:"English » Solomon Islands | sb",en_LK:"English » Sri Lanka | lk",en_TK:"English » Tokelau | tk",en_TO:"English » Tonga | to",en_TT:"English » Trinidad and Tobago | tt",en_GB:"English » United Kingdom | uk",en_US:"English » United States | com",en_VU:"English » Vanuatu | vu",en_VG:"English » Virgin Islands, British | vg",en_VI:"English » Virgin Islands, U.S. | vi",en_ZM:"English » Zambia | zm",en_ZW:"English » Zimbabwe | zw",es_AR:"Spanish » Argentina | ar",es_BZ:"Spanish » Belize | bz",es_BO:"Spanish » Bolivia | bo",es_CL:"Spanish » Chile | cl",es_CO:"Spanish » Colombia | co",es_CR:"Spanish » Costa Rica | cr",es_CU:"Spanish » Cuba | cu",es_DO:"Spanish » Dominican Republic | do",es_EC:"Spanish » Ecuador | ec",es_SV:"Spanish » El Salvador | sv",es_GT:"Spanish » Guatemala | gt",es_HN:"Spanish » Honduras | hn",es_MX:"Spanish » Mexico | mx",es_NI:"Spanish » Nicaragua | ni",es_PA:"Spanish » Panama | pa",es_PY:"Spanish » Paraguay | py",es_PE:"Spanish » Peru | pe",es_PR:"Spanish » Puerto Rico | pr",es_ES:"Spanish » Spain | es",es_UY:"Spanish » Uruguay | uy",es_VE:"Spanish » Venezuela | ve"},inputValidator:(e,t)=>new Promise(t=>{if(""!=e){var i=e.split("_");d="es"==i[0]?"Spanish":"English",t()}else t("You need to select one language")})}];h.push({title:"Write the main keyword",html:'<div style="text-align:justify;"><br>Our AI will learn all about the given keyword and will generate all possible questions people ask around it, and their respective answers.<br><br> You can generate a post with the question and answer automatically if "Auto Answer Questions" is ON, or well select later on the campaigns menu what questions you like to be answered and converted into a post.</div><br><br><label><strong>Main Keyword</strong></label>',inputValidator:e=>!e&&"You need to provide one keyword in "+d}),u.push(u.length+1),h.push({title:"Negative keywords",input:"textarea",html:'<div style="text-align:justify;">Some questions may include not desired keywords. Add them here if you like, <b>one keyword by line</b>, and questions that include those keywords won´t be included in your campaign. <br><br>You can leave it blank now and add them later if you found some not desired keywords on your campaign questions. But adding them now may save you some credits.</div>',inputValidator:e=>{}}),u.push(u.length+1),h.push({title:"Questions process limit",input:"number",inputValue:ctrify.min_questions,html:"How many questions do you like to gather to start? You will be able to increase that limit later.",inputValidator:e=>{if(e<ctrify.min_questions)return`The minimun quantity are ${ctrify.min_questions} questions.`}}),u.push(u.length+1),"yes"==ctrify.isPost&&(h.push({title:"Select the Category",html:"<br>Select a the category where new posts will be asigned.",input:"select",inputPlaceholder:"Select a Category",inputOptions:ctrify.categories,inputValidator:(e,t)=>new Promise(i=>{""!=e?(s=e,l=t,i()):i("You need to select one category, or uncategorized")})}),u.push(u.length+1)),"yes"==ctrify.deeplON&&(h.push({title:"Translate with DeepL?",html:"<br>Select a language to translate the final post to, or click next without select a language to create the post on the localized language selected on the previous step.",input:"select",inputPlaceholder:"Translate To...",inputOptions:ctrify.langs,inputValidator:(e,t)=>new Promise(t=>{""!=e?(o=e,t()):t()})}),u.push(u.length+1)),h.push({title:"<br>Auto Answer the questions?",input:"checkbox",inputPlaceholder:'<div style="margin-left:10px"><strong>Check this box if you like to activate Auto Answer and create posts with the questions and its answer automatically</strong>. You will be charged instead, '+ctrify.credits_per_word+" credit"+(ctrify.credits_per_word>1?"s":"")+" per word length of the generated posts up to your limit.<br></div>",html:'<div style="text-align:justify"><br> If Auto Answer is off, you will be able to select which questions to convert to a post later.  Only '+ctrify.credits_per_word+" credit"+(ctrify.credits_per_word>1?"s":"")+" per question word will be expended for each generated question up to your limit. Usually, the AI will generate more relevant questions than your limit, but you won´t be charged for the extra ones.</div>",inputValidator:e=>{e&&(c=1)}}),u.push(u.length+1),swal.mixin({input:"text",confirmButtonText:"Next &rarr;",showCancelButton:!0,reverseButtons:!0,progressSteps:u}).queue(h).then(e=>{e.value&&(n=e.value,swal.fire({title:"All ready!",html:`<br><div style="text-align:justify;">\n                     You are about to create a capaign for the keyword:<br><br> <strong> ${e.value[1]} </strong> with a limit of <strong> ${e.value[3]} </strong> processed questions ${""!=e.value[1]?"<br><br><b>Negative Keywords:</b><br><br>":""} ${""!=e.value[2]?e.value[2].split("\n").map(function(e){return"<li>"+e+"</li>"}).join(""):""}<br><br> \n              `,confirmButtonText:"Create Campaign!",confirmButtonColor:"#6eb78a",showCancelButton:!0,cancelButtonColor:"rgb(230, 141, 83)",reverseButtons:!0}).then(e=>{if(e.value){var t={type:"question",country:n[0],keyword:n[1],negatives:""!=n[2]?n[2].split(/\r?\n/):"",limit:n[3],autoAnswear:c,is:ctrify.is,translateTo:o,catID:s,catName:l};i("createCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(t)))),!0,"ctrify_processnewCampaign")}}))})}),e(document.body).on("click",".ctrify_learn_more",function(t){t.preventDefault();var i=null!=ctrify.learn_more[e(this).attr("tp")]&&ctrify.learn_more[e(this).attr("tp")];i&&window.open(i,"_blank")}),e(".ctrify_learn_more").hide(),null!=ctrify.learn_more&&Object.keys(ctrify.learn_more).forEach(t=>{e(".more_"+t).show()}),e(".ctrify_save_settings").on("click",function(n){if(n.preventDefault(),"https:"!==location.protocol)return swal({heightAuto:!1,type:"error",title:"You need an SSL certificate to allow secure communications with the API between our servers."}),!1;t(ctrify.saving);var a,o,s=(a=e("#ctrify_form").serializeArray(),o={},e.map(a,function(e,t){o[e.name.replace("ctrify_","")]=e.value}),o);i("testApiKeys",btoa(unescape(encodeURIComponent(JSON.stringify(s)))),!0,"ctrify_saveWPCTRForm")}),e.ctify_QueryString=function(){for(var e={},t=window.location.search.substring(1).split("&"),i=0;i<t.length;i++){var n=t[i].split("=");if(void 0===e[n[0]])e[n[0]]=decodeURIComponent(n[1]);else if("string"==typeof e[n[0]]){var a=[e[n[0]],decodeURIComponent(n[1])];e[n[0]]=a}else e[n[0]].push(decodeURIComponent(n[1]))}return e}(),null!=e.ctify_QueryString.paypal&&"cancel"!=e.ctify_QueryString.paypal){var c={payerID:e.ctify_QueryString.PayerID,authtoken:e.ctify_QueryString.token,what:e.ctify_QueryString.paypal,sid:localStorage.pid,token:ctrify.is,paypal_email:ctrify.paypal_email};setTimeout(function(){t(ctrify.retrieving)},100),i("doCapture",btoa(unescape(encodeURIComponent(JSON.stringify(c)))),!0,"ctify_confirmCapture")}var u;u=window.location.href.includes("edit.php")?window.location.href:window.location.href.split("?")[0].split("#")[0]+"?page=ctrify-settings",window.history.replaceState({html:u,pageTitle:document.title},"",u),window.addEventListener("popstate",function(e){history.pushState(null,document.title,location.href)}),e(document.body).on("click",".requestctriftreview",function(t){t.preventDefault();for(var n=e(this).parent("span").parent("div").children("span").children("a").attr("href"),a={},o=n.split("?")[1].split("&"),s=0;s<o.length;s++){var r=o[s].split("=");if(void 0===a[r[0]])a[r[0]]=decodeURIComponent(r[1]);else if("string"==typeof a[r[0]]){var l=[a[r[0]],decodeURIComponent(r[1])];a[r[0]]=l}else a[r[0]].push(decodeURIComponent(r[1]))}var c=!1,u=["1"],d=[];d.push({title:"Negative keywords",input:"textarea",html:'<div style="text-align:justify;"><br><br>If the post has included a not relevant topic you can add negative keywords to avoid touching the same things during the rebuild. <br><br> Some keywords may have more than one meaning and you may want to discard posts creation for not desired meanings. Ej "Will Smith" can be the actor or well the baseball pitcher. So if you like that posts to be related to the baseball player you would like to add as negative keywords "movies, Netflix" etc<br><br> Add them here if you like, <b>one keyword by line</b>, and those keywords won´t be included on the new rebuilded post.  <br><br>You can leave it blank now it is not the case.</div>',inputValidator:e=>{}}),u.push(u.length+1),swal.mixin({input:"text",confirmButtonText:"Next &rarr;",showCancelButton:!0,reverseButtons:!0,progressSteps:u}).queue(d).then(e=>{e.value&&(c=e.value,swal.fire({title:"All ready!",html:`<br><div style="text-align:justify;">\n               You are about to rebuild this post. ${""!=e.value[0]?"<br><br><b>Negative Keywords:</b><br><br>":""} ${""!=e.value[0]?e.value[0].split("\n").map(function(e){return"<li>"+e+"</li>"}).join(""):""}<br><br> \n        `,confirmButtonText:"Rebuild Post!",confirmButtonColor:"#6eb78a",showCancelButton:!0,cancelButtonColor:"rgb(230, 141, 83)",reverseButtons:!0}).then(e=>{if(e.value){var t={type:"rebuild",is:ctrify.is,negatives:""!=c[0]?c[0].split(/\r?\n/):"",post:a.post};i("updateSEOCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(t)))),!0,"ctify_confirmCapture")}}))})})}(jQuery);
     5var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(b){return b.raw=b};$jscomp.createTemplateTagFirstArgWithRaw=function(b,q){b.raw=q;return b};
     6(function(b){function q(a){return tmp=swal({text:a,type:!1,imageUrl:ctrify.loading_icon_url,onOpen:function(){b(swal.getImage()).addClass("rotating")},heightAuto:!1,imageWidth:100,imageHeight:100,imageAlt:a,allowOutsideClick:!1,allowEscapeKey:!1,allowEnterKey:!1,showConfirmButton:!1,width:600})}function p(a,c,g,d){b.ajax({type:"POST",url:"https://www.ctrify.com/api/v3/"+a,data:"params="+c,cache:!1,beforeSend:function(h){h.setRequestHeader("x-site",ctrify.xsite);h.setRequestHeader("x-user",ctrify.xkey);
     7h.setRequestHeader("x-path",ctrify.xpath);h.setRequestHeader("x-license",ctrify.license_key);h.setRequestHeader("x-version",ctrify.version)},async:"undefined"!==typeof g?g:!0,success:function(h){if("undefined"!==typeof d&&"Restricted."!=h)switch(d){case "ctrify_saveWPCTRForm":w(h,a,!0);break;case "ctrify_processPayment":var m=JSON.parse(h);"ok"==m.status?void 0!=m.url?(localStorage.setItem("pid",m.id),window.location.href=m.url):swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error}):swal({heightAuto:!1,
     8type:"error",title:ctrify.undocumented_error});break;case "ctify_confirmCapture":var l=JSON.parse(h);m=void 0!=l.status?l.status:l;if("ok"==m)window.location.reload();else switch(m){case "credits":swal({heightAuto:!1,type:"error",title:"You don\u00b4t have enough credits to perform this action. Please buy more."});break;case "save_success":swal({heightAuto:!1,type:"success",title:ctrify.save_success});break;case "notfound":swal({heightAuto:!1,type:"error",title:ctrify.notfound});break;case "rebuild_limit":swal({heightAuto:!1,
     9type:"error",title:ctrify.rebuild_limit});break;case "tryagain":swal({heightAuto:!1,type:"error",title:l.message});break;default:swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error})}break;case "ctify_printQuestions":A(h,a,!0);break;case "ctrify_processnewCampaign":B(h,a,!0)}"Restricted."==h&&window.location.reload()},error:function(h){if("undefined"!==typeof d)switch(d){case "ctrify_saveWPCTRForm":w(c,a,!1)}}});return"false"}function x(a,c){if(void 0!=a)for(var g=a.options,d=0,h=g.length;d<
     10h;d++)if(g[d].value==c)return a.selectedIndex=d,!0;return!1}function B(a,c,g){if(1==g)switch(a=JSON.parse(a),a.status){case "ok":swal({heightAuto:!1,type:"success",title:"Your new campaign is now in the process.  It may take a few minutes, to an hour to start posting depending on our backlog jobs load."});setTimeout(function(){window.location.reload()},3E3);break;case "credits":swal({heightAuto:!1,type:"error",title:"You don\u00b4t have enough credits to start a new campaign. Please buy more."});
     11break;case "prompt":swal({heightAuto:!1,type:"error",title:a.prompt});break;default:swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error})}else swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error})}function t(){Swal.fire({title:"Buy Credits",input:"select",inputOptions:ctrify.credits_options,confirmButtonText:"Pay with Paypal",inputValidator:function(a){if(a)setTimeout(function(){q(ctrify.redirecting)},100),p("ctrify_buyCredits",btoa(unescape(encodeURIComponent(JSON.stringify({credits:a,
     12is:ctrify.is,paypal_email:ctrify.paypal_email})))),!0,"ctrify_processPayment");else return"You need to choose something!"}})}function u(a){return"https://res.cloudinary.com/demo/image/upload/q_auto,f_auto/"+a+"/18882410261_e4f9d25780_b_lked9y.jpg"}function y(){var a='<label for="ctrify_cloudinary_image_options" style="font-weight: bold;">Select Image Effect: </label><select name="ctrify_cloudinary_image_options" id="ctrify_cloudinary_image_options" style="width: 227px;"><option '+(("e_improve"==ctrify.cloudinaryeffect?
     13"selected":"")+' value="e_improve">Improve</option>');a+="<option "+("e_grayscale"==ctrify.cloudinaryeffect?"selected":"")+' value="e_grayscale">Gray Scale</option>';a+="<option "+("e_grayscale/e_tint:50:red"==ctrify.cloudinaryeffect?"selected":"")+' value="e_grayscale/e_tint:50:red">Duotone Red</option>';a+="<option "+("e_grayscale/e_tint:50:blue"==ctrify.cloudinaryeffect?"selected":"")+' value="e_grayscale/e_tint:50:blue">Duotone Blue</option>';a+="<option "+("e_grayscale/e_tint:50:green"==ctrify.cloudinaryeffect?
     14"selected":"")+' value="e_grayscale/e_tint:50:green">Duotone Green</option>';a+="<option "+("e_sepia:80"==ctrify.cloudinaryeffect?"selected":"")+' value="e_sepia:80">Duotone Sepia</option>';a+="<option "+("e_hue"==ctrify.cloudinaryeffect?"selected":"")+' value="e_hue">Random Hue</option>';a+="<option "+("a_hflip,e_improve"==ctrify.cloudinaryeffect?"selected":"")+' value="a_hflip,e_improve">Flip Horizontally</option>';return a=a+'</select><img id="cloudimage" src="'+(u("e_improve")+'" style="float: left;width: 400px;margin-right: 36px;">')}
     15function v(){if("https:"!==location.protocol)return swal({heightAuto:!1,type:"error",title:"You need an SSL certificate to allow secure communications with the API between our servers."}),!1;parseInt(ctrify.campaigns)>=parseInt(ctrify.limit)?(b("#ctrify_newcampaign").addClass("ctrify_limited"),b("#ctrify_newgeneralcampaign").addClass("ctrify_limited")):(b("#ctrify_newcampaign").removeClass("ctrify_limited"),b("#ctrify_newgeneralcampaign").removeClass("ctrify_limited"))}function C(){var a=b("#ctrify_form").serializeArray(),
     16c={};b.map(a,function(g,d){c[g.name.replace("ctrify_","")]=g.value});return c}function w(a,c,g){b(".ctrify_error").removeClass("ctrify_error");if(1==g)if(a=JSON.parse(a),"ok"==a.status)a=ctrify.nonce_save_settings,a=b("#ctrify_form").serialize()+"&_ajax_nonce="+a+"&action=save_settting_nonce_action",b.post({url:ctrify.ajaxurl,data:a}).always(function(d){swal.close()}).done(function(d){"undefined"!=typeof d.success&&d.success?b.get(window.location.href).always(function(h,m,l){status=l.status;"2"!=
     17status.substr(0,1)?swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error}):(b("#ctrify_review-notification").show(),swal({type:"success",heightAuto:!1,title:ctrify.save_success,showConfirmButton:!1,timer:1400}),setTimeout(function(){window.location.reload()},1400))}):"undefined"==typeof d.success||d.success?swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error}):swal({heightAuto:!1,type:"error",title:d.data})}).fail(function(d){d.data?swal({type:"error",heightAuto:!1,title:ctrify.documented_error+
     18" "+d.data}):swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error})});else switch(a.status){case "fail_deepl":b("#ctrify_deepl_key").addClass("ctrify_error");swal({heightAuto:!1,type:"error",title:"Your DeepL API key is not correct, or you have reached your account limit."});b("html, body").animate({scrollTop:b("#ctrify_deepl_key").offset().top-170},2E3);break;case "fail_cloudinary":b(".ctrify_cloud_key").addClass("ctrify_error");swal({heightAuto:!1,type:"error",title:"One or more of your Cloudinary API params is not correct, or you have reached your account limit."});
     19b("html, body").animate({scrollTop:b("#ctrify_cloudinary_key").offset().top-170},2E3);break;case "fail_license":swal({heightAuto:!1,type:"error",title:"Your license key is not correct, or you have reached your account limit."});void 0!=document.getElementById("ctrify_license_key")&&(b("#ctrify_license_key").addClass("ctrify_error"),b("html, body").animate({scrollTop:b("#ctrify_license_key").offset().top-170},2E3));break;case "prompt":swal({heightAuto:!1,type:"error",title:a.prompt});break;default:swal({heightAuto:!1,
     20type:"error",title:a.status})}else swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error});return!1}function A(a,c,g){swal.close();if(1==g)if(a=JSON.parse(a),"ok"==a.status){b(".closed-"+a.key).remove();c=void 0!=a.buttondisabled?"disabled":"";var d='<fieldset class="inline-edit-categories"><div class="inline-edit-col">'+(void 0!=a.buttondisabled?'<span class="title inline-edit-categories-label">Keywords</span>':'<span class="title inline-edit-categories-label">Questions( <strong><x id="questmarked">0</x> new questions marked for processing</strong> )</span>')+
     21'<ul class="cat-checklist questionschecklist">',h=JSON.parse(a.questions),m=!1;Object.keys(h).forEach(function(l){var n=1==h[l].processed?"checked":"",f=1==h[l].processed?"readonly":"",e=1==h[l].processed?"disabled":"",k=1==h[l].processed?"":"ctrify_procquest";null==h[l].pid&&(e=n="",k="ctrify_procquest",f="");m=h[l].cid;d+='<li id="category-'+l+'"><label class="selectit"><input '+n+" "+f+" "+e+' value="'+l+'" type="checkbox" name="questioncategory[]" id="in-category-'+l+'" class="'+k+'"> '+h[l].question+
     22"</label></li>"});d+="</ul></div></fieldset>";c='<tr class="closed-'+a.key+' inline-edit-row inline-edit-row-post quick-edit-row quick-edit-row-post inline-edit-post inline-editor">\n                            <td colspan="10" class="colspanchange">\n                              <div>'+d+'</div>\n                              <div class="submit inline-edit-save">\n                                <button toclose="'+a.key+'" type="button" class="ctrify_closeadded button alignleft">Cancel</button>\n                                <button type="button" '+
     23c+' class="button button-primary ctrify_saveprocessselected alignright" capid="'+m+'">Process Selected As Different Posts</button>\n                                <button type="button" '+c+' class="button button-primary ctrify_combineprocessselected alignright" capid="'+m+'" style="background: #ed9f0f;border: #b57b0f;">Combine Selected As Long Post</button>\n                                <span class="spinner"></span>\n                                <br class="clear">\n                              </div>\n                          </td>\n                      </tr>';
     24b("#post-"+a.key).closest("tr").after(c)}else"credits"==a.status?swal({heightAuto:!1,type:"error",title:"You don\u00b4t have enough credits to perform this action. Please buy more."}):swal({heightAuto:!1,type:"error",title:ctrify.undocumented_error})}b(".ctrify_noclick").on("click",function(a){a.preventDefault()});b(".ctrify_viewquestions").on("click",function(a){a.preventDefault();setTimeout(function(){q(ctrify.retrieving)},100);a={action:"viewquestions",id:b(this).attr("qid"),is:ctrify.is};p("updateSEOCampaign",
     25btoa(unescape(encodeURIComponent(JSON.stringify(a)))),!0,"ctify_printQuestions")});b(".ctrify_viewkeywords").on("click",function(a){a.preventDefault();setTimeout(function(){q(ctrify.retrieving)},100);a={action:"viewkeywords",id:b(this).attr("qid"),is:ctrify.is};p("updateSEOCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(a)))),!0,"ctify_printQuestions")});b(document.body).on("click",".ctrify_closeadded",function(a){a.preventDefault();b(this).closest("tr").remove()});b(document.body).on("click",
     26".ctrify_procquest",function(a){var c=b(".ctrify_procquest:checkbox:checked");b("#questmarked").html(c.length);a=0;for(c=c.length;a<c;a++);});b(document.body).on("click",".ctrify_saveprocessselected",function(a){a.preventDefault();a=b(".ctrify_procquest:checkbox:checked");for(var c=[],g=0,d=a.length;g<d;g++)c.includes(a[g].value)||c.push(a[g].value);0<c.length&&(setTimeout(function(){q(ctrify.saving)},100),a={action:"addquestions",selected:c,is:ctrify.is,id:b(this).attr("capid")},p("updateSEOCampaign",
     27btoa(unescape(encodeURIComponent(JSON.stringify(a)))),!0,"ctify_confirmCapture"))});b(document.body).on("click",".ctrify_combineprocessselected",function(a){a.preventDefault();a=b(".ctrify_procquest:checkbox:checked");for(var c=[],g=0,d=a.length;g<d;g++)c.includes(a[g].value)||c.push(a[g].value);10<c.length?swal({heightAuto:!1,type:"error",title:"You can\u00b4t combine more that 10 questions"}):(setTimeout(function(){q(ctrify.saving)},100),a={action:"combinequestions",selected:c,is:ctrify.is,id:b(this).attr("capid")},
     28p("updateSEOCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(a)))),!0,"ctify_confirmCapture"))});b(".ctrify_pausecampaign").on("click",function(a){a.preventDefault();setTimeout(function(){q(ctrify.saving)},100);a={action:"pause",id:b(this).attr("capid"),is:ctrify.is};p("updateSEOCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(a)))),!0,"ctify_confirmCapture")});b(".ctrify_editcampaign").on("click",function(a){a.preventDefault();setTimeout(function(){q(ctrify.saving)},100);a={action:"active",
     29id:b(this).attr("capid"),is:ctrify.is};p("updateSEOCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(a)))),!0,"ctify_confirmCapture")});b(".ctrify_increaselimit").on("click",function(a){var c=this;a.preventDefault();var g=b(this).attr("limit");swal.fire({title:"Increase your limit",input:"number",text:"You need to increase the limit to activate this campaign.",inputValue:g,confirmButtonText:"Increase Limit",confirmButtonColor:"#6eb78a",showCancelButton:!0,cancelButtonColor:"rgb(230, 141, 83)",
     30reverseButtons:!0,inputValidator:function(d){return new Promise(function(h){if(parseInt(d)>parseInt(ctrify.credits))h("You need more credits to reach that new limit. With your current credits you can increase the limit up to a maximun of "+ctrify.credits);else if(parseInt(d)<parseInt(g))h("You need to increase the limit to more than your current limit of "+g);else if(parseInt(d)==parseInt(g))h("The new limit is the same as the old limit");else if(""!=d){setTimeout(function(){q(ctrify.saving)},100);
     31var m={action:"uplimit",newlimit:d,id:b(c).attr("capid"),is:ctrify.is};p("updateSEOCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(m)))),!0,"ctify_confirmCapture");h()}})}})});b(".upgrade").on("click",function(a){a.preventDefault();a=b(this).attr("href");"#"==a?p("rebuildUpdate",!1,!0,"ctify_confirmCapture"):a.includes("update.php")?window.location.href=a:window.open(a,"_blank")});b("#ctrify_doactioncampaign").on("click",function(a){a.preventDefault();var c=[];"trash"==b("#bulk-action-selector-bottom").val()&&
     32(b("input:checkbox.campaignsins").each(function(){sThisVal=this.checked?b(this).val():"";""!=sThisVal&&(b("#post-"+sThisVal).hide(),c.push(sThisVal))}),0<c.length&&(p("deleteCampaigns",btoa(unescape(encodeURIComponent(JSON.stringify({campaigns:c,is:ctrify.is,action:"delete"})))),!0),Swal.fire("Deleted!","Your file has been deleted.","success")))});b("#ctrify_doactiontransfer").on("click",function(a){a.preventDefault();var c=[];"credits"==b("#bulk-action-selector-credits").val()&&(b("input:checkbox.domainsins").each(function(){sThisVal=
     33this.checked?b(this).val():"";""!=sThisVal&&c.push(sThisVal)}),0<c.length&&(a={sources:c,is:ctrify.is,action:"transfer"},console.log(a),p("transferCredits",btoa(unescape(encodeURIComponent(JSON.stringify(a)))),!0),Swal.fire("Transfered!","Your credits had been transfered!","success"),setTimeout(function(){window.location.reload()},1400)))});b(".ctrify_buycredits").on("click",function(a){a.preventDefault();if("https:"!==location.protocol)return swal({heightAuto:!1,type:"error",title:"You need an SSL certificate to allow secure communications with the API between our servers."}),
     34!1;void 0==ctrify.paypal_email||""==ctrify.paypal_email?(b("#ctrify_paypal_email").addClass("error"),swal({heightAuto:!1,type:"error",title:"Add your Paypal email on the settings"}),b("html, body").animate({scrollTop:b("#ctrify_paypal_email").offset().top-170},2E3)):(b("#ctrify_paypal_email").removeClass("error"),t())});1==b("#ctrify_publish_newposts").prop("checked")?b("#ctrify_schedule_newposts").prop("disabled",!1):(b("#ctrify_schedule_newposts").prop("disabled",!0),x(document.getElementById("ctrify_schedule_newposts"),
     35"no"));b(document.body).on("change","#ctrify_publish_newposts",function(a){1==b("#ctrify_publish_newposts").prop("checked")?b("#ctrify_schedule_newposts").prop("disabled",!1):(b("#ctrify_schedule_newposts").prop("disabled",!0),x(document.getElementById("ctrify_schedule_newposts"),"no"))});b(document.body).on("change","#ctrify_cloudinary_image_options",function(a){b("#cloudimage").attr("src",u(b(this).val()))});1==b("#ctrify_featured_images").prop("checked")?(b("#ctrify_cloudinary_options").html(y()),
     36b("#cloudimage").attr("src",u(ctrify.cloudinaryeffect))):b("#ctrify_cloudinary_options").html("");b(document.body).on("change","#ctrify_featured_images",function(a){"no"==ctrify.cloudinaryON?(b(".ctrify_cloud_key").addClass("error"),swal({heightAuto:!1,type:"error",title:"You need to add your Cloudinary API params first."}),b("html, body").animate({scrollTop:b("#ctrify_cloudinary_key").offset().top-170},2E3),b("#ctrify_featured_images").prop("checked",!1)):1==b("#ctrify_featured_images").prop("checked")?
     37b("#ctrify_cloudinary_options").html(y()):b("#ctrify_cloudinary_options").html("")});b(document.body).on("click","#ctrify_newclustercampaign",function(a){a.preventDefault();v();if(b(this).hasClass("ctrify_buycredits"))return t(),!1;if(b(this).hasClass("ctrify_limited"))return swal({heightAuto:!1,type:"warning",title:ctrify.limited}),!1;var c=!1,g=!1,d=!1,h=!1,m=!1;a=["1"];var l=!1,n=[{title:"Content Regionalization and language",html:"<br>You will be able to translate this content to any language at the moment of creating the post if you have the <strong>DeepL API option active</strong>. Different countries and languages may output different localized texts.",
     38input:"select",inputPlaceholder:"Select a Language and Country",inputOptions:{en_AS:"English \u00bb American Samoa | as",en_AI:"English \u00bb Anguilla | ai",en_AG:"English \u00bb Antigua And Barbuda | ag",en_AU:"English \u00bb Australia | au",en_BS:"English \u00bb Bahamas | bs",en_CA:"English \u00bb Canada | ca",en_CK:"English \u00bb Cook Islands | ck",en_CY:"English \u00bb Cyprus | cy",en_DM:"English \u00bb Dominica | dm",en_FJ:"English \u00bb Fiji | fj",en_GM:"English \u00bb Gambia | gm",en_GH:"English \u00bb Ghana | gh",
     39en_GI:"English \u00bb Gibraltar | gi",en_GG:"English \u00bb Guersney | gg",en_GY:"English \u00bb Guyana | gy",en_IN:"English \u00bb India | in",en_IE:"English \u00bb Ireland | ie",en_IM:"English \u00bb Isle Of Man | im",en_JM:"English \u00bb Jamaica | jm",en_KI:"English \u00bb Kiribati | ki",en_MV:"English \u00bb Maldives | mv",en_MU:"English \u00bb Mauritius | mu",en_FM:"English \u00bb Micronesia | fm",en_MS:"English \u00bb Montserrat | ms",en_NA:"English \u00bb Namibia | na",en_NR:"English \u00bb Nauru | nr",
     40en_NZ:"English \u00bb New Zealand | nz",en_NG:"English \u00bb Nigeria | ng",en_NU:"English \u00bb Niue | nu",en_NF:"English \u00bb Norfolk Island | nf",en_PK:"English \u00bb Pakistan | pk",en_PN:"English \u00bb Pitcairn | pn",en_RW:"English \u00bb Rwanda | rw",en_SH:"English \u00bb Saint Helena | sh",en_VC:"English \u00bb Saint Vincent And Grenadines | vc",en_WS:"English \u00bb Samoa | ws",en_SL:"English \u00bb Sierra Leone | sl",en_SG:"English \u00bb Singapore | sg",en_SB:"English \u00bb Solomon Islands | sb",
     41en_LK:"English \u00bb Sri Lanka | lk",en_TK:"English \u00bb Tokelau | tk",en_TO:"English \u00bb Tonga | to",en_TT:"English \u00bb Trinidad and Tobago | tt",en_GB:"English \u00bb United Kingdom | uk",en_US:"English \u00bb United States | com",en_VU:"English \u00bb Vanuatu | vu",en_VG:"English \u00bb Virgin Islands, British | vg",en_VI:"English \u00bb Virgin Islands, U.S. | vi",en_ZM:"English \u00bb Zambia | zm",en_ZW:"English \u00bb Zimbabwe | zw",es_AR:"Spanish \u00bb Argentina | ar",es_BZ:"Spanish \u00bb Belize | bz",
     42es_BO:"Spanish \u00bb Bolivia | bo",es_CL:"Spanish \u00bb Chile | cl",es_CO:"Spanish \u00bb Colombia | co",es_CR:"Spanish \u00bb Costa Rica | cr",es_CU:"Spanish \u00bb Cuba | cu",es_DO:"Spanish \u00bb Dominican Republic | do",es_EC:"Spanish \u00bb Ecuador | ec",es_SV:"Spanish \u00bb El Salvador | sv",es_GT:"Spanish \u00bb Guatemala | gt",es_HN:"Spanish \u00bb Honduras | hn",es_MX:"Spanish \u00bb Mexico | mx",es_NI:"Spanish \u00bb Nicaragua | ni",es_PA:"Spanish \u00bb Panama | pa",es_PY:"Spanish \u00bb Paraguay | py",
     43es_PE:"Spanish \u00bb Peru | pe",es_PR:"Spanish \u00bb Puerto Rico | pr",es_ES:"Spanish \u00bb Spain | es",es_UY:"Spanish \u00bb Uruguay | uy",es_VE:"Spanish \u00bb Venezuela | ve"},inputValidator:function(f,e){return new Promise(function(k){if(""!=f){var r=f.split("_");d=r[0];l="es"==r[0]?"Spanish":"English";k()}else k("You need to select one language")})}}];n.push({title:"Main Title Keyword",html:'<div style="text-align:justify;"><br>Write the main title, question or long tail keyword. Our AI will learn all about it and will generate related content.<br><br> On the next step you will provide a set of subtitles or cluster keywords. It will generate a full post including all of them </div><br><br><label><strong>Main Title Keyword</strong></label>',
     44inputValidator:function(f){return!f&&"You need to provide one main keyword in "+l}});a.push(a.length+1);n.push({title:"Cluster keywords",input:"textarea",html:'<div style="text-align:justify;">Please add one by line and up to 6 maxium. Write subtitles, related questions, or clustered long-tail keywords. The AI will generate content for them and will be included in the final post following the same order.</div>',inputValidator:function(f){return new Promise(function(e){var k=f.split(/\r?\n/);0<k.length&&
     457>k.length&&""!=k[0]?e():""==k[0]?e("You need to provide at least one subtitle, question or cluster long-tail keyword"):e("You can write a maxium of 6 lines with subtitles, questions or cluster long-tail keywords")})}});a.push(a.length+1);n.push({title:"Negative keywords",input:"textarea",html:'<div style="text-align:justify;">Some keywords may have more than one meaning and you may want to discard posts creation for not desired meanings. Ej "Will Smith" can be the actor or well the baseball pitcher. So if you like that posts to be related to the baseball player you would like to add as negative keywords "movies, Netflix" etc<br><br> Add them here if you like, <b>one keyword by line</b>, and post that include those keywords won\u00b4t be included in your campaign. <br><br>You can leave it blank now and add them later if you found some not desired keywords on your campaign. But adding them now may save you some credits.</div>',
     46inputValidator:function(f){}});a.push(a.length+1);"yes"==ctrify.isPost&&(n.push({title:"Select the Category",html:"<br>Select a the category where new posts will be asigned.",input:"select",inputPlaceholder:"Select a Category",inputOptions:ctrify.categories,inputValidator:function(f,e){return new Promise(function(k){""!=f?(h=f,m=e,k()):k("You need to select one category, or uncategorized")})}}),a.push(a.length+1));"yes"==ctrify.deeplON&&(n.push({title:"Translate with DeepL?",html:"<br>Select a language to translate the final post to, or click next without select a language to create the post on the localized language selected on the previous step.",
     47input:"select",inputPlaceholder:"Translate To...",inputOptions:ctrify.langs,inputValidator:function(f,e){return new Promise(function(k){""!=f?f==d?k("You can\u00b4t translate the post to the same language it is produced. Pick another one or select none"):(g=f,k()):k()})}}),a.push(a.length+1));swal.mixin({input:"text",confirmButtonText:"Next &rarr;",showCancelButton:!0,reverseButtons:!0,progressSteps:a}).queue(n).then(function(f){f.value&&(c=f.value,swal.fire({title:"All ready!",html:'<br><div style="text-align:justify;">\n                     You are about to create a post for:<br><br> <strong> '+
     48f.value[1]+" </strong>  "+(""!=f.value[1]?"<br><br><b>And aditional texts for the following keywords:</b><br><ul>":"")+" "+(""!=f.value[2]?f.value[2].split("\n").map(function(e){return"<li>"+e+"</li>"}).join(""):"")+"</ul><br>\n              ",confirmButtonText:"Create Campaign!",confirmButtonColor:"#6eb78a",showCancelButton:!0,cancelButtonColor:"rgb(230, 141, 83)",reverseButtons:!0}).then(function(e){e.value&&(e={type:"cluster",country:c[0],keyword:c[1],clusters:""!=c[2]?c[2].split(/\r?\n/):"",negatives:""!=
     49c[3]?c[3].split(/\r?\n/):"",limit:c[4],is:ctrify.is,translateTo:g,catID:h,catName:m},p("createCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(e)))),!0,"ctrify_processnewCampaign"))}))})});b(document.body).on("click","#ctrify_newgeneralcampaign",function(a){a.preventDefault();v();if(b(this).hasClass("ctrify_buycredits"))return t(),!1;if(b(this).hasClass("ctrify_limited"))return swal({heightAuto:!1,type:"warning",title:ctrify.limited}),!1;var c=!1,g=!1,d=!1,h=!1,m=!1,l=!1;a=["1"];var n=[{title:"Content Regionalization and language",
     50html:"<br>You will be able to translate this content to any language at the moment of creating the post if you have the <strong>DeepL API option active</strong>. Different countries and languages may output different localized texts.",input:"select",inputPlaceholder:"Select a Language and Country",inputOptions:{en_AS:"English \u00bb American Samoa | as",en_AI:"English \u00bb Anguilla | ai",en_AG:"English \u00bb Antigua And Barbuda | ag",en_AU:"English \u00bb Australia | au",en_BS:"English \u00bb Bahamas | bs",
     51en_CA:"English \u00bb Canada | ca",en_CK:"English \u00bb Cook Islands | ck",en_CY:"English \u00bb Cyprus | cy",en_DM:"English \u00bb Dominica | dm",en_FJ:"English \u00bb Fiji | fj",en_GM:"English \u00bb Gambia | gm",en_GH:"English \u00bb Ghana | gh",en_GI:"English \u00bb Gibraltar | gi",en_GG:"English \u00bb Guersney | gg",en_GY:"English \u00bb Guyana | gy",en_IN:"English \u00bb India | in",en_IE:"English \u00bb Ireland | ie",en_IM:"English \u00bb Isle Of Man | im",en_JM:"English \u00bb Jamaica | jm",
     52en_KI:"English \u00bb Kiribati | ki",en_MV:"English \u00bb Maldives | mv",en_MU:"English \u00bb Mauritius | mu",en_FM:"English \u00bb Micronesia | fm",en_MS:"English \u00bb Montserrat | ms",en_NA:"English \u00bb Namibia | na",en_NR:"English \u00bb Nauru | nr",en_NZ:"English \u00bb New Zealand | nz",en_NG:"English \u00bb Nigeria | ng",en_NU:"English \u00bb Niue | nu",en_NF:"English \u00bb Norfolk Island | nf",en_PK:"English \u00bb Pakistan | pk",en_PN:"English \u00bb Pitcairn | pn",en_RW:"English \u00bb Rwanda | rw",
     53en_SH:"English \u00bb Saint Helena | sh",en_VC:"English \u00bb Saint Vincent And Grenadines | vc",en_WS:"English \u00bb Samoa | ws",en_SL:"English \u00bb Sierra Leone | sl",en_SG:"English \u00bb Singapore | sg",en_SB:"English \u00bb Solomon Islands | sb",en_LK:"English \u00bb Sri Lanka | lk",en_TK:"English \u00bb Tokelau | tk",en_TO:"English \u00bb Tonga | to",en_TT:"English \u00bb Trinidad and Tobago | tt",en_GB:"English \u00bb United Kingdom | uk",en_US:"English \u00bb United States | com",en_VU:"English \u00bb Vanuatu | vu",
     54en_VG:"English \u00bb Virgin Islands, British | vg",en_VI:"English \u00bb Virgin Islands, U.S. | vi",en_ZM:"English \u00bb Zambia | zm",en_ZW:"English \u00bb Zimbabwe | zw",es_AR:"Spanish \u00bb Argentina | ar",es_BZ:"Spanish \u00bb Belize | bz",es_BO:"Spanish \u00bb Bolivia | bo",es_CL:"Spanish \u00bb Chile | cl",es_CO:"Spanish \u00bb Colombia | co",es_CR:"Spanish \u00bb Costa Rica | cr",es_CU:"Spanish \u00bb Cuba | cu",es_DO:"Spanish \u00bb Dominican Republic | do",es_EC:"Spanish \u00bb Ecuador | ec",
     55es_SV:"Spanish \u00bb El Salvador | sv",es_GT:"Spanish \u00bb Guatemala | gt",es_HN:"Spanish \u00bb Honduras | hn",es_MX:"Spanish \u00bb Mexico | mx",es_NI:"Spanish \u00bb Nicaragua | ni",es_PA:"Spanish \u00bb Panama | pa",es_PY:"Spanish \u00bb Paraguay | py",es_PE:"Spanish \u00bb Peru | pe",es_PR:"Spanish \u00bb Puerto Rico | pr",es_ES:"Spanish \u00bb Spain | es",es_UY:"Spanish \u00bb Uruguay | uy",es_VE:"Spanish \u00bb Venezuela | ve"},inputValidator:function(f,e){return new Promise(function(k){""!=
     56f?(l=f.split("_")[0],k()):k("You need to select one language")})}}];n.push({title:"Posts keywords",input:"textarea",html:'<div style="text-align:justify;">Write one keyword or question per line. Our AI will generate a new post based on each given keyword, or will answer each question.</div>',inputValidator:function(f){return new Promise(function(e){var k=f.split(/\r?\n/);0<k.length&&""!=k[0]?e():e("You need to provide at least one keyword or question")})}});a.push(a.length+1);n.push({title:"Negative keywords",
     57input:"textarea",html:'<div style="text-align:justify;">Some keywords may have more than one meaning and you may want to discard posts creation for not desired meanings. Ej "Will Smith" can be the actor or well the baseball pitcher. So if you like that posts to be related to the baseball player you would like to add as negative keywords "movies, Netflix" etc<br><br> Add them here if you like, <b>one keyword by line</b>, and post that include those keywords won\u00b4t be included in your campaign. <br><br>You can leave it blank now and add them later if you found some not desired keywords on your campaign. But adding them now may save you some credits.</div>',
     58inputValidator:function(f){}});a.push(a.length+1);n.push({title:"Words limit",input:"number",inputValue:500,html:"Posts lengths may vary from keyword to keyword based on the subject and information available. We can\u00b4t control the m\u00ednimum, but you can control the approximate maximum number of words per post.",inputValidator:function(f){if(500>f)return"The minimun limit is 500 words per posts.";m=f}});a.push(a.length+1);"yes"==ctrify.isPost&&(n.push({title:"Select the Category",html:"<br>Select a the category where new posts will be asigned.",
     59input:"select",inputPlaceholder:"Select a Category",inputOptions:ctrify.categories,inputValidator:function(f,e){return new Promise(function(k){""!=f?(d=f,h=e,k()):k("You need to select one category, or uncategorized")})}}),a.push(a.length+1));"yes"==ctrify.deeplON&&(n.push({title:"Translate with DeepL?",html:"<br>Select a language to translate the final post to, or click next without select a language to create the post on the localized language selected on the previous step.",input:"select",inputPlaceholder:"Translate To...",
     60inputOptions:ctrify.langs,inputValidator:function(f,e){return new Promise(function(k){""!=f?f==l?k("You can\u00b4t translate the post to the same language it is produced. Pick another one or select none"):(g=f,k()):k()})}}),a.push(a.length+1));swal.mixin({input:"text",confirmButtonText:"Next &rarr;",showCancelButton:!0,reverseButtons:!0,progressSteps:a}).queue(n).then(function(f){f.value&&(c=f.value,swal.fire({title:"All ready!",html:'<br><div style="text-align:justify;">\n                     You are about to create one post for each of following keywords: </b><br><ul> '+
     61(""!=f.value[1]?f.value[1].split("\n").map(function(e){return"<li>"+e+"</li>"}).join(""):"")+"</ul><br> You understand that "+ctrify.credits_per_word+" credits per word will be expended for each generated post<br>.\n              ",confirmButtonText:"Create Campaign!",confirmButtonColor:"#6eb78a",showCancelButton:!0,cancelButtonColor:"rgb(230, 141, 83)",reverseButtons:!0}).then(function(e){e.value&&(q(ctrify.saving),e={type:"keyword",country:c[0],keywords:""!=c[1]?c[1].split(/\r?\n/):"",negatives:""!=
     62c[2]?c[2].split(/\r?\n/):"",translateTo:g,wordslimit:m,is:ctrify.is,catID:d,catName:h},p("createCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(e)))),!0,"ctrify_processnewCampaign"))}))})});b(document.body).on("click","#ctrify_newcampaign",function(a){a.preventDefault();v();if(b(this).hasClass("ctrify_buycredits"))return t(),!1;if(b(this).hasClass("ctrify_limited"))return swal({heightAuto:!1,type:"warning",title:ctrify.limited}),!1;var c=!1,g=!1,d=!1,h=!1,m=!1;a=["1"];var l=!1,n=!1,f=[{title:"Content Regionalization and language",
     63html:"<br>You will be able to translate this content to any language at the moment of creating the post if you have the <strong>DeepL API option active</strong>. Different countries and languages may output different localized texts.",input:"select",inputPlaceholder:"Select a Language and Country",inputOptions:{en_AS:"English \u00bb American Samoa | as",en_AI:"English \u00bb Anguilla | ai",en_AG:"English \u00bb Antigua And Barbuda | ag",en_AU:"English \u00bb Australia | au",en_BS:"English \u00bb Bahamas | bs",
     64en_CA:"English \u00bb Canada | ca",en_CK:"English \u00bb Cook Islands | ck",en_CY:"English \u00bb Cyprus | cy",en_DM:"English \u00bb Dominica | dm",en_FJ:"English \u00bb Fiji | fj",en_GM:"English \u00bb Gambia | gm",en_GH:"English \u00bb Ghana | gh",en_GI:"English \u00bb Gibraltar | gi",en_GG:"English \u00bb Guersney | gg",en_GY:"English \u00bb Guyana | gy",en_IN:"English \u00bb India | in",en_IE:"English \u00bb Ireland | ie",en_IM:"English \u00bb Isle Of Man | im",en_JM:"English \u00bb Jamaica | jm",
     65en_KI:"English \u00bb Kiribati | ki",en_MV:"English \u00bb Maldives | mv",en_MU:"English \u00bb Mauritius | mu",en_FM:"English \u00bb Micronesia | fm",en_MS:"English \u00bb Montserrat | ms",en_NA:"English \u00bb Namibia | na",en_NR:"English \u00bb Nauru | nr",en_NZ:"English \u00bb New Zealand | nz",en_NG:"English \u00bb Nigeria | ng",en_NU:"English \u00bb Niue | nu",en_NF:"English \u00bb Norfolk Island | nf",en_PK:"English \u00bb Pakistan | pk",en_PN:"English \u00bb Pitcairn | pn",en_RW:"English \u00bb Rwanda | rw",
     66en_SH:"English \u00bb Saint Helena | sh",en_VC:"English \u00bb Saint Vincent And Grenadines | vc",en_WS:"English \u00bb Samoa | ws",en_SL:"English \u00bb Sierra Leone | sl",en_SG:"English \u00bb Singapore | sg",en_SB:"English \u00bb Solomon Islands | sb",en_LK:"English \u00bb Sri Lanka | lk",en_TK:"English \u00bb Tokelau | tk",en_TO:"English \u00bb Tonga | to",en_TT:"English \u00bb Trinidad and Tobago | tt",en_GB:"English \u00bb United Kingdom | uk",en_US:"English \u00bb United States | com",en_VU:"English \u00bb Vanuatu | vu",
     67en_VG:"English \u00bb Virgin Islands, British | vg",en_VI:"English \u00bb Virgin Islands, U.S. | vi",en_ZM:"English \u00bb Zambia | zm",en_ZW:"English \u00bb Zimbabwe | zw",es_AR:"Spanish \u00bb Argentina | ar",es_BZ:"Spanish \u00bb Belize | bz",es_BO:"Spanish \u00bb Bolivia | bo",es_CL:"Spanish \u00bb Chile | cl",es_CO:"Spanish \u00bb Colombia | co",es_CR:"Spanish \u00bb Costa Rica | cr",es_CU:"Spanish \u00bb Cuba | cu",es_DO:"Spanish \u00bb Dominican Republic | do",es_EC:"Spanish \u00bb Ecuador | ec",
     68es_SV:"Spanish \u00bb El Salvador | sv",es_GT:"Spanish \u00bb Guatemala | gt",es_HN:"Spanish \u00bb Honduras | hn",es_MX:"Spanish \u00bb Mexico | mx",es_NI:"Spanish \u00bb Nicaragua | ni",es_PA:"Spanish \u00bb Panama | pa",es_PY:"Spanish \u00bb Paraguay | py",es_PE:"Spanish \u00bb Peru | pe",es_PR:"Spanish \u00bb Puerto Rico | pr",es_ES:"Spanish \u00bb Spain | es",es_UY:"Spanish \u00bb Uruguay | uy",es_VE:"Spanish \u00bb Venezuela | ve"},inputValidator:function(e,k){return new Promise(function(r){if(""!=
     69e){var z=e.split("_");n=z[0];l="es"==z[0]?"Spanish":"English";r()}else r("You need to select one language")})}}];f.push({title:"Write the main keyword",html:'<div style="text-align:justify;"><br>Our AI will learn all about the given keyword and will generate all possible questions people ask around it, and their respective answers.<br><br> You can generate a post with the question and answer automatically if "Auto Answer Questions" is ON, or well select later on the campaigns menu what questions you like to be answered and converted into a post.</div><br><br><label><strong>Main Keyword</strong></label>',
     70inputValidator:function(e){return!e&&"You need to provide one keyword in "+l}});a.push(a.length+1);f.push({title:"Negative keywords",input:"textarea",html:'<div style="text-align:justify;">Some questions may include not desired keywords. Add them here if you like, <b>one keyword by line</b>, and questions that include those keywords won\u00b4t be included in your campaign. <br><br>You can leave it blank now and add them later if you found some not desired keywords on your campaign questions. But adding them now may save you some credits.</div>',
     71inputValidator:function(e){}});a.push(a.length+1);f.push({title:"Questions process limit",input:"number",inputValue:ctrify.min_questions,html:"How many questions do you like to gather to start? You will be able to increase that limit later.",inputValidator:function(e){if(e<ctrify.min_questions)return"The minimun quantity are "+ctrify.min_questions+" questions."}});a.push(a.length+1);"yes"==ctrify.isPost&&(f.push({title:"Select the Category",html:"<br>Select a the category where new posts will be asigned.",
     72input:"select",inputPlaceholder:"Select a Category",inputOptions:ctrify.categories,inputValidator:function(e,k){return new Promise(function(r){""!=e?(d=e,h=k,r()):r("You need to select one category, or uncategorized")})}}),a.push(a.length+1));"yes"==ctrify.deeplON&&(f.push({title:"Translate with DeepL?",html:"<br>Select a language to translate the final post to, or click next without select a language to create the post on the localized language selected on the previous step.",input:"select",inputPlaceholder:"Translate To...",
     73inputOptions:ctrify.langs,inputValidator:function(e,k){return new Promise(function(r){""!=e?e==n?r("You can\u00b4t translate the post to the same language it is produced. Pick another one or select none"):(g=e,r()):r()})}}),a.push(a.length+1));f.push({title:"<br>Auto Answer the questions?",input:"checkbox",inputPlaceholder:'<div style="margin-left:10px"><strong>Check this box if you like to activate Auto Answer and create posts with the questions and its answer automatically</strong>. You will be charged instead, '+
     74ctrify.credits_per_word+" credit"+(1<ctrify.credits_per_word?"s":"")+" per word length of the generated posts up to your limit.<br></div>",html:'<div style="text-align:justify"><br> If Auto Answer is off, you will be able to select which questions to convert to a post later.  Only '+ctrify.credits_per_word+" credit"+(1<ctrify.credits_per_word?"s":"")+" per question word will be expended for each generated question up to your limit. Usually, the AI will generate more relevant questions than your limit, but you won\u00b4t be charged for the extra ones.</div>",
     75inputValidator:function(e){e&&(m=1)}});a.push(a.length+1);swal.mixin({input:"text",confirmButtonText:"Next &rarr;",showCancelButton:!0,reverseButtons:!0,progressSteps:a}).queue(f).then(function(e){e.value&&(c=e.value,swal.fire({title:"All ready!",html:'<br><div style="text-align:justify;">\n                     You are about to create a capaign for the keyword:<br><br> <strong> '+e.value[1]+" </strong> with a limit of <strong> "+e.value[3]+" </strong> processed questions "+(""!=e.value[1]?"<br><br><b>Negative Keywords:</b><br><br>":
     76"")+" "+(""!=e.value[2]?e.value[2].split("\n").map(function(k){return"<li>"+k+"</li>"}).join(""):"")+"<br><br>\n              ",confirmButtonText:"Create Campaign!",confirmButtonColor:"#6eb78a",showCancelButton:!0,cancelButtonColor:"rgb(230, 141, 83)",reverseButtons:!0}).then(function(k){k.value&&(k={type:"question",country:c[0],keyword:c[1],negatives:""!=c[2]?c[2].split(/\r?\n/):"",limit:c[3],autoAnswear:m,is:ctrify.is,translateTo:g,catID:d,catName:h},p("createCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(k)))),
     77!0,"ctrify_processnewCampaign"))}))})});b(document.body).on("click",".ctrify_learn_more",function(a){a.preventDefault();(a=void 0!=ctrify.learn_more[b(this).attr("tp")]?ctrify.learn_more[b(this).attr("tp")]:!1)&&window.open(a,"_blank")});(function(){b(".ctrify_learn_more").hide();void 0!=ctrify.learn_more&&Object.keys(ctrify.learn_more).forEach(function(a){b(".more_"+a).show()})})();b(".ctrify_save_settings").on("click",function(a){a.preventDefault();if("https:"!==location.protocol)return swal({heightAuto:!1,
     78type:"error",title:"You need an SSL certificate to allow secure communications with the API between our servers."}),!1;q(ctrify.saving);a=C();p("testApiKeys",btoa(unescape(encodeURIComponent(JSON.stringify(a)))),!0,"ctrify_saveWPCTRForm")});b.ctify_QueryString=function(){for(var a={},c=window.location.search.substring(1).split("&"),g=0;g<c.length;g++){var d=c[g].split("=");if("undefined"===typeof a[d[0]])a[d[0]]=decodeURIComponent(d[1]);else if("string"===typeof a[d[0]]){var h=[a[d[0]],decodeURIComponent(d[1])];
     79a[d[0]]=h}else a[d[0]].push(decodeURIComponent(d[1]))}return a}();if(void 0!=b.ctify_QueryString.paypal&&"cancel"!=b.ctify_QueryString.paypal){var D={payerID:b.ctify_QueryString.PayerID,authtoken:b.ctify_QueryString.token,what:b.ctify_QueryString.paypal,sid:localStorage.pid,token:ctrify.is,paypal_email:ctrify.paypal_email};setTimeout(function(){q(ctrify.retrieving)},100);p("doCapture",btoa(unescape(encodeURIComponent(JSON.stringify(D)))),!0,"ctify_confirmCapture")}(function(){var a=window.location.href.includes("edit.php")?
     80window.location.href:window.location.href.split("?")[0].split("#")[0]+"?page=ctrify-settings";window.history.replaceState({html:a,pageTitle:document.title},"",a);window.addEventListener("popstate",function(c){history.pushState(null,document.title,location.href)})})();b(document.body).on("click",".requestctriftreview",function(a){a.preventDefault();var c={};a=b(this).parent("span").parent("div").children("span").children("a").attr("href").split("?")[1].split("&");for(var g=0;g<a.length;g++){var d=
     81a[g].split("=");if("undefined"===typeof c[d[0]])c[d[0]]=decodeURIComponent(d[1]);else if("string"===typeof c[d[0]]){var h=[c[d[0]],decodeURIComponent(d[1])];c[d[0]]=h}else c[d[0]].push(decodeURIComponent(d[1]))}var m=!1;a=["1"];g=[];g.push({title:"Negative keywords",input:"textarea",html:'<div style="text-align:justify;"><br><br>If the post has included a not relevant topic you can add negative keywords to avoid touching the same things during the rebuild. <br><br> Some keywords may have more than one meaning and you may want to discard posts creation for not desired meanings. Ej "Will Smith" can be the actor or well the baseball pitcher. So if you like that posts to be related to the baseball player you would like to add as negative keywords "movies, Netflix" etc<br><br> Add them here if you like, <b>one keyword by line</b>, and those keywords won\u00b4t be included on the new rebuilded post.  <br><br>You can leave it blank now it is not the case.</div>',
     82inputValidator:function(l){}});a.push(a.length+1);swal.mixin({input:"text",confirmButtonText:"Next &rarr;",showCancelButton:!0,reverseButtons:!0,progressSteps:a}).queue(g).then(function(l){l.value&&(m=l.value,swal.fire({title:"All ready!",html:'<br><div style="text-align:justify;">\n               You are about to rebuild this post. '+(""!=l.value[0]?"<br><br><b>Negative Keywords:</b><br><br>":"")+" "+(""!=l.value[0]?l.value[0].split("\n").map(function(n){return"<li>"+n+"</li>"}).join(""):"")+"<br><br>\n        ",
     83confirmButtonText:"Rebuild Post!",confirmButtonColor:"#6eb78a",showCancelButton:!0,cancelButtonColor:"rgb(230, 141, 83)",reverseButtons:!0}).then(function(n){n.value&&(n={type:"rebuild",is:ctrify.is,negatives:""!=m[0]?m[0].split(/\r?\n/):"",post:c.post},p("updateSEOCampaign",btoa(unescape(encodeURIComponent(JSON.stringify(n)))),!0,"ctify_confirmCapture"))}))})})})(jQuery);
  • ctrify/trunk/readme.txt

    r2597901 r2598067  
    66Tested up to: 5.7
    77Requires PHP: 5.2
    8 Stable Tag: 1.1.1
     8Stable Tag: 1.1.2
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    114114- 2021/09/13
    115115- Minor compatibility fix.
     116
     117= v1.1.2 =
     118- 2021/09/13
     119- Minor JS Update.
Note: See TracChangeset for help on using the changeset viewer.