AdSense Plugin WP QUADS - Version 1.5.4

Version Description

  • Fix: Hide widget on homepage option not working
  • Tweak: Change default value of ad limitation to unlimited ads
  • Tweak: Clean up code
Download this release

Release Info

Developer ReneHermi
Plugin Icon 128x128 AdSense Plugin WP QUADS
Version 1.5.4
Comparing to
See all releases

Code changes from version 1.5.2 to 1.5.4

assets/css/quads-admin.css CHANGED
@@ -362,6 +362,7 @@ li.quads-tabs {
362
  -o-user-select: none;
363
  user-select: none;
364
  cursor: pointer !important;
 
365
  }
366
 
367
  .quads-ad-toggle-container{
@@ -412,9 +413,9 @@ li.quads-tabs {
412
  width:150px;
413
  }
414
 
415
- .quads-select{
416
  max-width:100px;
417
- }
418
 
419
  .quads-size-input {
420
  position: relative;
@@ -801,13 +802,74 @@ li.quads-tabs {
801
 
802
 
803
  #quads-validate{
804
- margin-top: -20px;
805
  display: block;
806
  margin-left: 2px;
807
  margin-bottom: 20px;
808
  font-weight: bold;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
809
  }
810
 
811
  #quads-submit-button{
812
  z-index: 999999;
813
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
362
  -o-user-select: none;
363
  user-select: none;
364
  cursor: pointer !important;
365
+ min-height: 20px;
366
  }
367
 
368
  .quads-ad-toggle-container{
413
  width:150px;
414
  }
415
 
416
+ /*.quads-select{
417
  max-width:100px;
418
+ }*/
419
 
420
  .quads-size-input {
421
  position: relative;
802
 
803
 
804
  #quads-validate{
 
805
  display: block;
806
  margin-left: 2px;
807
  margin-bottom: 20px;
808
  font-weight: bold;
809
+ clear: both;
810
+ }
811
+
812
+ @font-face {
813
+ font-family: 'quads';
814
+ src: url('data:application/octet-stream;base64,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') format('woff'),
815
+ url('data:application/octet-stream;base64,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LbA/LLA2K4ogIDywBCNCijgjIC5GsAIlRlJYIDxZLrErARQrsARDLrArKy2wQCywABawBCWwBCYgLkcjRyNhsAlDKyMgPCAuIzixKwEUKy2wQSyxCAQlQrAAFrAEJbAEJSAuRyNHI2EgsAQjQrAJQysgsGBQWCCwQFFYswIgAyAbswImAxpZQkIjIEewBEOwAmIgsABQWLBAYFlmsAFjYCCwASsgiophILACQ2BkI7ADQ2FkUFiwAkNhG7ADQ2BZsAMlsAJiILAAUFiwQGBZZrABY2GwAiVGYTgjIDwjOBshICBGI0ewASsjYTghWbErARQrLbBCLLA1Ky6xKwEUKy2wQyywNishIyAgPLAEI0IjOLErARQrsARDLrArKy2wRCywABUgR7AAI0KyAAEBFRQTLrAxKi2wRSywABUgR7AAI0KyAAEBFRQTLrAxKi2wRiyxAAEUE7AyKi2wRyywNCotsEgssAAWRSMgLiBGiiNhOLErARQrLbBJLLAII0KwSCstsEossgAAQSstsEsssgABQSstsEwssgEAQSstsE0ssgEBQSstsE4ssgAAQistsE8ssgABQistsFAssgEAQistsFEssgEBQistsFIssgAAPistsFMssgABPistsFQssgEAPistsFUssgEBPistsFYssgAAQCstsFcssgABQCstsFgssgEAQCstsFkssgEBQCstsFossgAAQystsFsssgABQystsFwssgEAQystsF0ssgEBQystsF4ssgAAPystsF8ssgABPystsGAssgEAPystsGEssgEBPystsGIssDcrLrErARQrLbBjLLA3K7A7Ky2wZCywNyuwPCstsGUssAAWsDcrsD0rLbBmLLA4Ky6xKwEUKy2wZyywOCuwOystsGgssDgrsDwrLbBpLLA4K7A9Ky2waiywOSsusSsBFCstsGsssDkrsDsrLbBsLLA5K7A8Ky2wbSywOSuwPSstsG4ssDorLrErARQrLbBvLLA6K7A7Ky2wcCywOiuwPCstsHEssDorsD0rLbByLLMJBAIDRVghGyMhWUIrsAhlsAMkUHiwARUwLQBLuADIUlixAQGOWbABuQgACABjcLEABUKyAAEAKrEABUKzCgIBCCqxAAVCsw4AAQgqsQAGQroCwAABAAkqsQAHQroAQAABAAkqsQMARLEkAYhRWLBAiFixA2REsSYBiFFYugiAAAEEQIhjVFixAwBEWVlZWbMMAgEMKrgB/4WwBI2xAgBEAAA=') format('truetype');
816
+ }
817
+ #quads-add-new-ad:before {
818
+ font-family: 'quads';
819
+ content: '\e801';
820
+ text-decoration: none;
821
+ margin-right:5px;
822
+ color: #383838;
823
+ }
824
+
825
+ #quads-add-new-ad{
826
+ margin-left: 3px;
827
+ margin-top: 5px;
828
+ display: block;
829
+ margin-bottom: 20px;
830
+ text-decoration: none;
831
+ font-size: 14px;
832
+ font-weight: 600;
833
+ color: #383838;
834
  }
835
 
836
  #quads-submit-button{
837
  z-index: 999999;
838
+ }
839
+
840
+ p.submit{
841
+ float:left;
842
+ padding-top:0px;
843
+ padding-bottom:0px;
844
+ }
845
+
846
+ .quads-delete-ad{
847
+ clear:both;
848
+ display:block;
849
+ //background: url('../images/remove-icon.png');
850
+ //background-size: 20px 20px;
851
+ //background-repeat: no-repeat;
852
+ //height: 20px;
853
+ //padding-left:30px;
854
+ margin-right:5px;
855
+ font-size: 14px;
856
+ font-weight: 600;
857
+ text-decoration: none;
858
+ color: #383838;
859
+ }
860
+ .quads-delete-ad:before{
861
+ font-family: 'quads';
862
+ content: '\e800';
863
+ margin-right:5px;
864
+ color: #383838;
865
+ }
866
+
867
+ #backup-settings-textarea{
868
+ width: 580px;
869
+ height: 400px;
870
+ font-family: Menlo, Monaco, monospace;
871
+ background: none;
872
+ white-space: normal;
873
+ overflow: auto;
874
+ display: block;
875
+ }
assets/css/quads-admin.min.css CHANGED
@@ -1 +1 @@
1
- .quads-share-button-container{margin:5px 0}.quads-share-button-container p{margin:0 0 10px}.quads-share-button{display:inline-block}.quads-share-button a{text-decoration:none}.quads-share-button .quads-share{font-family:sans-serif;font-weight:700;text-decoration:none;text-align:center;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;color:#FFF;display:inline;font-size:16px;width:40px;padding:4px 8px}.quads-share-button-twitter .quads-share{background-color:#00ABF0}.quads-share-button-facebook .quads-share{background-color:#3b5998}.quads-share-button-googleplus .quads-share{background-color:#F53424}.quads-share-button-facebook .share:active,.quads-share-button-googleplus .share:active,.quads-share-button-twitter .share:active{background-color:#353535}@media (max-width:925px){.quads-share-button .quads-share{font-size:15px;padding:8px 16px}}.quads-richeditor{font-size:11px}#quads-add-ons h2{margin:0 0 15px}#quads-add-ons .quadsshare-addons{float:left;margin:0 15px 15px 0;background:#f0f0f0;border:1px solid #ccc;width:320px;padding:8px;height:315px;position:relative}#quads-add-ons .quadsshare-addons h3{margin:0 0 8px;font-size:13px}#quads-add-ons .quadsshare-addons .button-secondary{position:absolute;bottom:8px;left:8px}#quads-add-ons .quadsshare-addons .third-party{display:none}#system-info-textarea{width:580px;height:400px;font-family:Menlo,Monaco,monospace;background:0 0;white-space:pre;overflow:auto;display:block}.quads-select-chosen{width:300px}input.large-text,textarea.large-text{max-width:600px}input.medium-text,textarea.medium-text{min-width:190px}#quads_tab_container ul{list-style:none;margin:0;padding:0;background:#fff;float:left}#quads_tab_container ul li:first-child.selected-tab{border-top:none}#quads_tab_container ul li a.selected-tab{font-weight:700;text-decoration:none}#quads_tab_container .quads-row{padding-top:12px;padding-bottom:12px}#quads_tab_container .quads-row label strong,#tab_container .quads-row strong{font-weight:700}.quads-tabs a{padding:5px;color:#a1a1a1;text-transform:uppercase}.quads-tabs a strong{font-weight:700}li.quads-tabs{float:left;margin-left:0;background-color:#e5e5e5}#quads_tab_container>ul>li.quads-tabs.active{background-color:#fff}#quads_tab_container>ul>li.quads-tabs.active a{color:#83c11f}#quads_tab_container .quads-panel-container{background:#FFF;padding:20px;overflow:auto;text-align:left;margin-bottom:10px;max-width:640px;float:left;clear:both}.form-table{margin-top:-20px}#quads_tab_container .form-table th{vertical-align:top;text-align:left;padding:20px 10px 20px 0;line-height:1.3;font-weight:700;font-size:14px;color:#484848;width:30%}#quads_tab_container .form-table tr{border-bottom:1px solid #E7E7E7}#quads_tab_container span.description{display:block;font-weight:400;font-style:normal;font-size:13px;margin-top:7px;color:#484848}#quads_tab_container .col-title{font-size:18px;color:#484848}@media only screen and (max-width:680px){#quads_tab_container ul{float:none;background:#fff}#quads_tab_container .form-table tr>th{width:100%}#quads_tab_container span.description{font-size:14px}#quads_tab_container .form-table tr>th,#tab_container .form-table tr>td{padding:10px}#quads_tab_container .quads-tabs a{text-align:left}#quads_tab_container li.quads-tabs{float:none;margin-left:0}}#quads_tab_container ul li.quads-tabs{margin-bottom:0}#quads_tab_container ul li.quads-tabs a{display:block;padding:10px;text-decoration:none;font-weight:700}#quads_tab_container ul li.quads-tabs a:hover{color:#383838}#quads_tab_container ul li.quads-tabs a.active{text-decoration:underline}#quads_tab_container table tbody tr:nth-child(1)>th>div{font-size:20px}#quadstabcontainer>.quadstabs{background-color:#fff}#quadstabcontainer ul .active{background-color:#00adef;color:#fff;border-bottom-color:#0098D2}#quadstabcontainer ul .active:hover{background-color:#00A4E2;color:#fff;border-bottom-color:#0098D2}#quadstabcontainer ul li a{padding:10px 14px;background-color:#f3f3f3}#quadstabcontainer .quadstab-container{border:0 solid #ececec}.quads-quote-docs{font-family:Courier New,Courier,Fixed;color:#050}.quads-desc{display:block;font-style:italic;padding-top:10px}.quads-postbox{padding:10px;position:relative;min-width:255px;border:1px solid #e5e5e5;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fff;margin-bottom:20px}.nav-tab-active{background-color:#fff;border-bottom:0}#quads-add-ons{padding:20px}.quads-toggle{position:absolute;right:0;top:0}.quads-box-close .quads-close-open-icon{background-position:0 -38px}.quads-close-open-icon{width:38px;height:38px;background:url(../images/arrow-close.png) repeat-y #f4f4f4}.quads-ad-toggle-header{position:relative;background-color:#f4f4f4;margin-bottom:2px;padding:10px 10px 10px 15px;-moz-user-select:-moz-none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none;cursor:pointer!important}.quads-ad-toggle-container{padding:20px;background-color:#f4f4f4}.quads-toogle-title{font-size:16px;font-weight:700}.adsense-size-title,.quads-advanced-description label{font-weight:600;font-size:12px;text-transform:uppercase;float:left}.quads-advanced-description label{width:215px}.quads-advanced-ad-box{clear:both;margin-top:20px;margin-bottom:20px}.adsense-size-title{margin-right:0;line-height:32px;margin-left:14px;min-width:100px}.quads-select-style-overwrite{border:1px solid #e6e6e6;width:150px;overflow:hidden;background:url(../images/box_arrow.png) 120px 0 repeat-y #fff;margin:0 0 5px}.quads-select-style-overwrite select{width:150px}.quads-select{max-width:100px}.quads-size-input{position:relative;top:-1px;width:110%;border:none;box-shadow:none;background:0 0;-webkit-appearance:none;font-family:'Open Sans',arial,sans-serif;color:#555;font-size:12px}.quads-pro-overlay{height:200px}.quads-license-error-notice,.quads-license-expires-soon-notice{background-color:#fff;padding:10px;overflow:auto;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1);border:1px solid #ECECEC;border-radius:3px}.quads-license-error-notice a{color:#0097df;text-decoration:underline}.quads-license-error-notice{border-left:4px solid #dd3d36}.quads-license-expiration-date-notice,.quads-license-lifetime-notice,.quads-license-null{padding:0}.quads-license-expiration-date-notice .quads-license-data p,.quads-license-lifetime-notice .quads-license-data p{color:#666;font-size:14px;font-style:italic;margin:4px 0 0}#quads_settingslicenses_header-nav{display:none}#quads_settingslicenses_header{max-width:640px}#quads_settingslicenses_header .quads-row.th{min-width:250px}.quads-notice{background:#fff;border-left:4px solid #46b450;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin:5px 15px 2px;padding:1px 12px}.quads_admin h2.nav-tab-wrapper{border:0}.quads_admin .nav-tab{border:0;text-transform:uppercase;color:#a1a1a1;font-weight:700}.quads-h1{margin-bottom:1.35rem;font-size:2.5em;line-height:3.68rem;letter-spacing:normal}.quads-h2{margin-top:0;margin-bottom:1.2rem;font-size:30px;line-height:2.5rem}.quads-heading-pro{color:#83c11f;font-weight:700}.quads-button.green{display:inline-block;background-color:#83c11f;padding:10px;min-width:170px;color:#fff;font-size:16px;text-decoration:none;text-align:center;margin-top:20px}#quads-add-ons .quads-footer{clear:both;margin-top:20px;font-style:italic}#quads-add-ons li{font-size:18px;line-height:29px;position:relative;padding-left:23px;list-style:none!important}#quads-add-ons li:before{width:1em;height:100%;background:url(data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%2377B227%22%20d%3D%22M1671%20566q0%2040%2D28%2068l%2D724%20724%2D136%20136q%2D28%2028%2D68%2028t%2D68%2D28l%2D136%2D136%2D362%2D362q%2D28%2D28%2D28%2D68t28%2D68l136%2D136q28%2D28%2068%2D28t68%2028l294%20295%20656%2D657q28%2D28%2068%2D28t68%2028l136%20136q28%2028%2028%2068z%22%2F%3E%3C%2Fsvg%3E) left .4em no-repeat;background-size:contain;content:"";position:absolute;top:0;left:0;color:#77b227}.adsense_admin_header{font-size:14px;font-weight:500}#quads-adsense-bg-div{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.65);z-index:250000}#quads-adsense-container{text-align:center;width:480px;margin:85px auto 0;background-color:#fff;padding:2%;border-radius:2px}#quads-adsense-container h3{margin-top:0}#quads-adsense-container textarea,.quads-ad-toggle-container textarea{width:100%}.quads-ad-toggle-container input{margin-top:7px;margin-bottom:10px}.quads-adsense-code label,input{margin-right:2px}#quads_settings\5b ad2\5d \5b g_data_ad_client\5d{width:200px}.quads-ad-toggle-container label{display:inline-block;margin-right:2px;margin-top:-3px}.quads_adsense_code .quads-add-adsense{margin:20px 5px 20px 0}.quads-label-left{min-width:71px}#quads-label-Type{min-width:67px}.quads-medium-size{width:110px}#quads-msg{display:none;margin:5px;background-color:#c55c5c;color:#fff}.quads-loader,.quads-success-modal{display:block;position:fixed;top:45%;left:25%;width:200px;height:auto;padding:5px 20px;z-index:1002;overflow:auto}.quads-form-table{width:100%}.quads-left-box{width:45%;min-height:100px;float:left;line-height:35px;min-width:300px}@media screen and (max-width:700px){.adsense-size-title{margin-left:0}.quads-left-box{width:45%;min-height:100px;float:none;line-height:35px;min-width:300px}.quads-style img{max-width:50px}}.quads-general-helper,.quads-helper{background-color:#83c11f;width:15px;display:inline-block;top:4px;cursor:pointer}.adsense_admin_header ul li{margin-top:2px;margin-left:20px;list-style-type:square}.quads-helper{border-radius:50%;border:2px solid #fff;height:15px;position:relative;margin-top:-4px;margin-left:2px}.quads-general-helper:after,.quads-helper:after{height:20px;font-family:sans-serif;content:"?";font-size:11px;font-weight:700;left:4px;position:absolute;color:#fff}.quads-helper:after{margin-top:-10px}.quads-general-helper:after{margin-top:-2px}.quads-general-helper{border-radius:50%;border:2px solid #fff;height:15px;position:relative;margin-top:-4px;margin-left:2px}.quads-message{padding:10px;border:1px solid #FBFBFB;border-radius:2px;background-color:#F8F8F8;position:absolute;max-width:500px;z-index:9999;display:none;box-shadow:0 0 5px rgba(0,0,0,.2);font-weight:400;line-height:20px;text-transform:none;font-size:14px}#quads-pro-hover{background-color:#83c11f;padding:20px;min-width:150px;color:#fff;display:block;position:relative;margin-top:-100px;margin-left:50%}#quads-pro-hover-background{width:100%;height:100%;background:rgba(0,0,0,.6)}#quads-open-toggle{clear:both;float:left;margin-top:10px}#quads_settingsadsense_header input[type=number].small-text{width:55px}.quads_adsense_code input.quads-bggrey{background-color:#f5f5f5;color:#939393}.quads-amp-code{color:#939393;height:130px}.quads-chosen-select .chosen-choices li.search-field input{min-height:25px}#quads-validate{margin-top:-20px;display:block;margin-left:2px;margin-bottom:20px;font-weight:700}#quads-submit-button{z-index:999999}
1
+ .quads-share-button-container{margin:5px 0}.quads-share-button-container p{margin:0 0 10px}.quads-share-button{display:inline-block}.quads-share-button a{text-decoration:none}.quads-share-button .quads-share{font-family:sans-serif;font-weight:700;text-decoration:none;text-align:center;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;color:#FFF;display:inline;font-size:16px;width:40px;padding:4px 8px}.quads-share-button-twitter .quads-share{background-color:#00ABF0}.quads-share-button-facebook .quads-share{background-color:#3b5998}.quads-share-button-googleplus .quads-share{background-color:#F53424}.quads-share-button-facebook .share:active,.quads-share-button-googleplus .share:active,.quads-share-button-twitter .share:active{background-color:#353535}@media (max-width:925px){.quads-share-button .quads-share{font-size:15px;padding:8px 16px}}.quads-richeditor{font-size:11px}#quads-add-ons h2{margin:0 0 15px}#quads-add-ons .quadsshare-addons{float:left;margin:0 15px 15px 0;background:#f0f0f0;border:1px solid #ccc;width:320px;padding:8px;height:315px;position:relative}#quads-add-ons .quadsshare-addons h3{margin:0 0 8px;font-size:13px}#quads-add-ons .quadsshare-addons .button-secondary{position:absolute;bottom:8px;left:8px}#quads-add-ons .quadsshare-addons .third-party{display:none}#system-info-textarea{width:580px;height:400px;font-family:Menlo,Monaco,monospace;background:0 0;white-space:pre;overflow:auto;display:block}.quads-select-chosen{width:300px}input.large-text,textarea.large-text{max-width:600px}input.medium-text,textarea.medium-text{min-width:190px}#quads_tab_container ul{list-style:none;margin:0;padding:0;background:#fff;float:left}#quads_tab_container ul li:first-child.selected-tab{border-top:none}#quads_tab_container ul li a.selected-tab{font-weight:700;text-decoration:none}#quads_tab_container .quads-row{padding-top:12px;padding-bottom:12px}#quads_tab_container .quads-row label strong,#tab_container .quads-row strong{font-weight:700}.quads-tabs a{padding:5px;color:#a1a1a1;text-transform:uppercase}.quads-tabs a strong{font-weight:700}li.quads-tabs{float:left;margin-left:0;background-color:#e5e5e5}#quads_tab_container>ul>li.quads-tabs.active{background-color:#fff}#quads_tab_container>ul>li.quads-tabs.active a{color:#83c11f}#quads_tab_container .quads-panel-container{background:#FFF;padding:20px;overflow:auto;text-align:left;margin-bottom:10px;max-width:640px;float:left;clear:both}.form-table{margin-top:-20px}#quads_tab_container .form-table th{vertical-align:top;text-align:left;padding:20px 10px 20px 0;line-height:1.3;font-weight:700;font-size:14px;color:#484848;width:30%}#quads_tab_container .form-table tr{border-bottom:1px solid #E7E7E7}#quads_tab_container span.description{display:block;font-weight:400;font-style:normal;font-size:13px;margin-top:7px;color:#484848}#quads_tab_container .col-title{font-size:18px;color:#484848}@media only screen and (max-width:680px){#quads_tab_container ul{float:none;background:#fff}#quads_tab_container .form-table tr>th{width:100%}#quads_tab_container span.description{font-size:14px}#quads_tab_container .form-table tr>th,#tab_container .form-table tr>td{padding:10px}#quads_tab_container .quads-tabs a{text-align:left}#quads_tab_container li.quads-tabs{float:none;margin-left:0}}#quads_tab_container ul li.quads-tabs{margin-bottom:0}#quads_tab_container ul li.quads-tabs a{display:block;padding:10px;text-decoration:none;font-weight:700}#quads_tab_container ul li.quads-tabs a:hover{color:#383838}#quads_tab_container ul li.quads-tabs a.active{text-decoration:underline}#quads_tab_container table tbody tr:nth-child(1)>th>div{font-size:20px}#quadstabcontainer>.quadstabs{background-color:#fff}#quadstabcontainer ul .active{background-color:#00adef;color:#fff;border-bottom-color:#0098D2}#quadstabcontainer ul .active:hover{background-color:#00A4E2;color:#fff;border-bottom-color:#0098D2}#quadstabcontainer ul li a{padding:10px 14px;background-color:#f3f3f3}#quadstabcontainer .quadstab-container{border:0 solid #ececec}.quads-quote-docs{font-family:Courier New,Courier,Fixed;color:#050}.quads-desc{display:block;font-style:italic;padding-top:10px}.quads-postbox{padding:10px;position:relative;min-width:255px;border:1px solid #e5e5e5;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);background:#fff;margin-bottom:20px}.nav-tab-active{background-color:#fff;border-bottom:0}#quads-add-ons{padding:20px}.quads-toggle{position:absolute;right:0;top:0}.quads-box-close .quads-close-open-icon{background-position:0 -38px}.quads-close-open-icon{width:38px;height:38px;background:url(../images/arrow-close.png) repeat-y #f4f4f4}.quads-ad-toggle-header{position:relative;background-color:#f4f4f4;margin-bottom:2px;padding:10px 10px 10px 15px;-moz-user-select:-moz-none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none;cursor:pointer!important;min-height:20px}.quads-ad-toggle-container{padding:20px;background-color:#f4f4f4}.quads-toogle-title{font-size:16px;font-weight:700}.adsense-size-title,.quads-advanced-description label{font-weight:600;font-size:12px;text-transform:uppercase;float:left}.quads-advanced-description label{width:215px}.quads-advanced-ad-box{clear:both;margin-top:20px;margin-bottom:20px}.adsense-size-title{margin-right:0;line-height:32px;margin-left:14px;min-width:100px}.quads-select-style-overwrite{border:1px solid #e6e6e6;width:150px;overflow:hidden;background:url(../images/box_arrow.png) 120px 0 repeat-y #fff;margin:0 0 5px}.quads-select-style-overwrite select{width:150px}.quads-size-input{position:relative;top:-1px;width:110%;border:none;box-shadow:none;background:0 0;-webkit-appearance:none;font-family:'Open Sans',arial,sans-serif;color:#555;font-size:12px}.quads-pro-overlay{height:200px}.quads-license-error-notice,.quads-license-expires-soon-notice{background-color:#fff;padding:10px;overflow:auto;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1);border:1px solid #ECECEC;border-radius:3px}.quads-license-error-notice a{color:#0097df;text-decoration:underline}.quads-license-error-notice{border-left:4px solid #dd3d36}.quads-license-expiration-date-notice,.quads-license-lifetime-notice,.quads-license-null{padding:0}.quads-license-expiration-date-notice .quads-license-data p,.quads-license-lifetime-notice .quads-license-data p{color:#666;font-size:14px;font-style:italic;margin:4px 0 0}#quads_settingslicenses_header-nav{display:none}#quads_settingslicenses_header{max-width:640px}#quads_settingslicenses_header .quads-row.th{min-width:250px}.quads-notice{background:#fff;border-left:4px solid #46b450;-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,.1);box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin:5px 15px 2px;padding:1px 12px}.quads_admin h2.nav-tab-wrapper{border:0}.quads_admin .nav-tab{border:0;text-transform:uppercase;color:#a1a1a1;font-weight:700}.quads-h1{margin-bottom:1.35rem;font-size:2.5em;line-height:3.68rem;letter-spacing:normal}.quads-h2{margin-top:0;margin-bottom:1.2rem;font-size:30px;line-height:2.5rem}.quads-heading-pro{color:#83c11f;font-weight:700}.quads-button.green{display:inline-block;background-color:#83c11f;padding:10px;min-width:170px;color:#fff;font-size:16px;text-decoration:none;text-align:center;margin-top:20px}#quads-add-ons .quads-footer{clear:both;margin-top:20px;font-style:italic}#quads-add-ons li{font-size:18px;line-height:29px;position:relative;padding-left:23px;list-style:none!important}#quads-add-ons li:before{width:1em;height:100%;background:url(data:image/svg+xml;charset=utf8,%3Csvg%20width%3D%221792%22%20height%3D%221792%22%20viewBox%3D%220%200%201792%201792%22%20xmlns%3D%22http%3A%2F%2Fwww%2Ew3%2Eorg%2F2000%2Fsvg%22%3E%3Cpath%20fill%3D%22%2377B227%22%20d%3D%22M1671%20566q0%2040%2D28%2068l%2D724%20724%2D136%20136q%2D28%2028%2D68%2028t%2D68%2D28l%2D136%2D136%2D362%2D362q%2D28%2D28%2D28%2D68t28%2D68l136%2D136q28%2D28%2068%2D28t68%2028l294%20295%20656%2D657q28%2D28%2068%2D28t68%2028l136%20136q28%2028%2028%2068z%22%2F%3E%3C%2Fsvg%3E) left .4em no-repeat;background-size:contain;content:"";position:absolute;top:0;left:0;color:#77b227}.adsense_admin_header{font-size:14px;font-weight:500}#quads-adsense-bg-div{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.65);z-index:250000}#quads-adsense-container{text-align:center;width:480px;margin:85px auto 0;background-color:#fff;padding:2%;border-radius:2px}#quads-adsense-container h3{margin-top:0}#quads-adsense-container textarea,.quads-ad-toggle-container textarea{width:100%}.quads-ad-toggle-container input{margin-top:7px;margin-bottom:10px}.quads-adsense-code label,input{margin-right:2px}#quads_settings\5b ad2\5d \5b g_data_ad_client\5d{width:200px}.quads-ad-toggle-container label{display:inline-block;margin-right:2px;margin-top:-3px}.quads_adsense_code .quads-add-adsense{margin:20px 5px 20px 0}.quads-label-left{min-width:71px}#quads-label-Type{min-width:67px}.quads-medium-size{width:110px}#quads-msg{display:none;margin:5px;background-color:#c55c5c;color:#fff}.quads-loader,.quads-success-modal{display:block;position:fixed;top:45%;left:25%;width:200px;height:auto;padding:5px 20px;z-index:1002;overflow:auto}.quads-form-table{width:100%}.quads-left-box{width:45%;min-height:100px;float:left;line-height:35px;min-width:300px}@media screen and (max-width:700px){.adsense-size-title{margin-left:0}.quads-left-box{width:45%;min-height:100px;float:none;line-height:35px;min-width:300px}.quads-style img{max-width:50px}}.quads-general-helper,.quads-helper{width:15px;display:inline-block;top:4px;cursor:pointer}.adsense_admin_header ul li{margin-top:2px;margin-left:20px;list-style-type:square}.quads-helper{border-radius:50%;border:2px solid #fff;background-color:#83c11f;height:15px;position:relative;margin-top:-4px;margin-left:2px}.quads-general-helper:after,.quads-helper:after{height:20px;font-family:sans-serif;content:"?";font-size:11px;font-weight:700;left:4px;position:absolute;color:#fff}.quads-helper:after{margin-top:-10px}.quads-general-helper:after{margin-top:-2px}#quads-add-new-ad:before,.quads-delete-ad:before{font-family:quads;margin-right:5px}.quads-general-helper{border-radius:50%;border:2px solid #fff;background-color:#83c11f;height:15px;position:relative;margin-top:-4px;margin-left:2px}.quads-message{padding:10px;border:1px solid #FBFBFB;border-radius:2px;background-color:#F8F8F8;position:absolute;max-width:500px;z-index:9999;display:none;box-shadow:0 0 5px rgba(0,0,0,.2);font-weight:400;line-height:20px;text-transform:none;font-size:14px}#quads-pro-hover{background-color:#83c11f;padding:20px;min-width:150px;color:#fff;display:block;position:relative;margin-top:-100px;margin-left:50%}#quads-pro-hover-background{width:100%;height:100%;background:rgba(0,0,0,.6)}#quads-open-toggle{clear:both;float:left;margin-top:10px}#quads_settingsadsense_header input[type=number].small-text{width:55px}.quads_adsense_code input.quads-bggrey{background-color:#f5f5f5;color:#939393}.quads-amp-code{color:#939393;height:130px}.quads-chosen-select .chosen-choices li.search-field input{min-height:25px}#quads-validate{display:block;margin-left:2px;margin-bottom:20px;font-weight:700;clear:both}#quads-add-new-ad,.quads-delete-ad{font-size:14px;font-weight:600;text-decoration:none;color:#383838;display:block}@font-face{font-family:quads;src:url(data:application/octet-stream;base64,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) format('woff'),url(data:application/octet-stream;base64,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LbA/LLA2K4ogIDywBCNCijgjIC5GsAIlRlJYIDxZLrErARQrsARDLrArKy2wQCywABawBCWwBCYgLkcjRyNhsAlDKyMgPCAuIzixKwEUKy2wQSyxCAQlQrAAFrAEJbAEJSAuRyNHI2EgsAQjQrAJQysgsGBQWCCwQFFYswIgAyAbswImAxpZQkIjIEewBEOwAmIgsABQWLBAYFlmsAFjYCCwASsgiophILACQ2BkI7ADQ2FkUFiwAkNhG7ADQ2BZsAMlsAJiILAAUFiwQGBZZrABY2GwAiVGYTgjIDwjOBshICBGI0ewASsjYTghWbErARQrLbBCLLA1Ky6xKwEUKy2wQyywNishIyAgPLAEI0IjOLErARQrsARDLrArKy2wRCywABUgR7AAI0KyAAEBFRQTLrAxKi2wRSywABUgR7AAI0KyAAEBFRQTLrAxKi2wRiyxAAEUE7AyKi2wRyywNCotsEgssAAWRSMgLiBGiiNhOLErARQrLbBJLLAII0KwSCstsEossgAAQSstsEsssgABQSstsEwssgEAQSstsE0ssgEBQSstsE4ssgAAQistsE8ssgABQistsFAssgEAQistsFEssgEBQistsFIssgAAPistsFMssgABPistsFQssgEAPistsFUssgEBPistsFYssgAAQCstsFcssgABQCstsFgssgEAQCstsFkssgEBQCstsFossgAAQystsFsssgABQystsFwssgEAQystsF0ssgEBQystsF4ssgAAPystsF8ssgABPystsGAssgEAPystsGEssgEBPystsGIssDcrLrErARQrLbBjLLA3K7A7Ky2wZCywNyuwPCstsGUssAAWsDcrsD0rLbBmLLA4Ky6xKwEUKy2wZyywOCuwOystsGgssDgrsDwrLbBpLLA4K7A9Ky2waiywOSsusSsBFCstsGsssDkrsDsrLbBsLLA5K7A8Ky2wbSywOSuwPSstsG4ssDorLrErARQrLbBvLLA6K7A7Ky2wcCywOiuwPCstsHEssDorsD0rLbByLLMJBAIDRVghGyMhWUIrsAhlsAMkUHiwARUwLQBLuADIUlixAQGOWbABuQgACABjcLEABUKyAAEAKrEABUKzCgIBCCqxAAVCsw4AAQgqsQAGQroCwAABAAkqsQAHQroAQAABAAkqsQMARLEkAYhRWLBAiFixA2REsSYBiFFYugiAAAEEQIhjVFixAwBEWVlZWbMMAgEMKrgB/4WwBI2xAgBEAAA=) format('truetype')}#quads-add-new-ad:before{content:'\e801';text-decoration:none;color:#383838}#quads-add-new-ad{margin-left:3px;margin-top:5px;margin-bottom:20px}#quads-submit-button{z-index:999999}p.submit{float:left;padding-top:0;padding-bottom:0}.quads-delete-ad{clear:both;//background:url(../images/remove-icon.png);//background-size:20px 20px;//background-repeat:no-repeat;//height:20px;//padding-left:30px;margin-right:5px}.quads-delete-ad:before{content:'\e800';color:#383838}#backup-settings-textarea{width:580px;height:400px;font-family:Menlo,Monaco,monospace;background:0 0;white-space:normal;overflow:auto;display:block}
assets/images/remove-icon.png ADDED
Binary file
assets/js/quads-admin.js CHANGED
@@ -3,7 +3,9 @@ var strict;
3
 
4
  jQuery(document).ready(function ($) {
5
 
6
-
 
 
7
  // Inactive select fields are greyed out
8
  $('.quads-assign').each(function(e){
9
  if (!$(this).prop('checked')){
@@ -21,6 +23,9 @@ jQuery(document).ready(function ($) {
21
  }
22
  });
23
 
 
 
 
24
  // Check if submit button is visible than stick it to the bottom of the page
25
  $(window).scroll(function() {
26
  var elem = '#quads_tab_container .submit';
@@ -62,10 +67,7 @@ jQuery(document).ready(function ($) {
62
  }
63
  });
64
 
65
- // // remove content of amp code form if its clicked in
66
- // $('.quads-amp-code').click(function(){
67
- // $(this).val('');
68
- // });
69
 
70
  /**
71
  * Toggle Button | Open All Ads
@@ -138,7 +140,10 @@ jQuery(document).ready(function ($) {
138
  e.stopPropagation();
139
  });
140
 
141
- // Save settings via ajax
 
 
 
142
  jQuery('#quads_settings').submit(function() {
143
 
144
  // Check if ad name has been changed and prepare new data for saving
@@ -182,7 +187,9 @@ jQuery(document).ready(function ($) {
182
  }
183
 
184
 
185
- // Paste AdSense Code form
 
 
186
  $(document).on('click', '#quads-paste-button', function () {
187
 
188
  var content = $('#quads-adsense-form').val();
@@ -210,18 +217,19 @@ jQuery(document).ready(function ($) {
210
 
211
  var id = containerID.replace("quads-toggle", "");
212
 
213
- $('#quads_settings\\[' + id + '\\]\\[g_data_ad_slot\\]').val(GoogleAd.slotId);
214
- $('#quads_settings\\[' + id + '\\]\\[g_data_ad_client\\]').val(GoogleAd.pubId);
215
  if ('normal' == GoogleAd.type) {
216
- $('#quads_settings\\[' + id + '\\]\\[adsense_type\\]').val('normal');
217
- $('#quads_settings\\[' + id + '\\]\\[g_data_ad_width\\]').val(GoogleAd.width);
218
- $('#quads_settings\\[' + id + '\\]\\[g_data_ad_height\\]').val(GoogleAd.height);
 
219
  }
220
  if ('responsive' == GoogleAd.type) {
221
- $('#quads_settings\\[' + id + '\\]\\[adsense_type\\]').val('responsive');
222
  //$('#ad-resize-type').val('auto');
223
- $('#quads_settings\\[' + id + '\\]\\[g_data_ad_width\\]').val('');
224
- $('#quads_settings\\[' + id + '\\]\\[g_data_ad_height\\]').val('');
225
  }
226
  // Trigger the ad type select
227
  $('.quads-select-Type').trigger('change');
@@ -506,11 +514,12 @@ jQuery(document).ready(function ($) {
506
  /**
507
  * Toggle the adsense container
508
  */
509
- $('.quads-ad-toggle-header').click(function (e) {
 
510
  e.preventDefault();
511
 
512
  var container = $('#' + $(this).data('box-id'));
513
-
514
  container.toggle(0, function () {
515
  if (container.parents('.quads-ad-toggle-header').hasClass('quads-box-close')) {
516
  // open the box
@@ -572,7 +581,9 @@ jQuery(document).ready(function ($) {
572
  }
573
 
574
 
575
- // Start easytabs()
 
 
576
  if ($(".quads-tabs").length) {
577
  $('#quads_tab_container').easytabs({
578
  animate: true,
@@ -580,6 +591,9 @@ jQuery(document).ready(function ($) {
580
  animationSpeed: 'fast'
581
  });
582
  }
 
 
 
583
 
584
  }); // document ready
585
 
3
 
4
  jQuery(document).ready(function ($) {
5
 
6
+ /**
7
+ * General Tab
8
+ */
9
  // Inactive select fields are greyed out
10
  $('.quads-assign').each(function(e){
11
  if (!$(this).prop('checked')){
23
  }
24
  });
25
 
26
+ /**
27
+ * AdSense Code Tab
28
+ */
29
  // Check if submit button is visible than stick it to the bottom of the page
30
  $(window).scroll(function() {
31
  var elem = '#quads_tab_container .submit';
67
  }
68
  });
69
 
70
+
 
 
 
71
 
72
  /**
73
  * Toggle Button | Open All Ads
140
  e.stopPropagation();
141
  });
142
 
143
+ /**
144
+ * Save settings via ajax
145
+ */
146
+
147
  jQuery('#quads_settings').submit(function() {
148
 
149
  // Check if ad name has been changed and prepare new data for saving
187
  }
188
 
189
 
190
+ /**
191
+ * Paste AdSense Code form
192
+ */
193
  $(document).on('click', '#quads-paste-button', function () {
194
 
195
  var content = $('#quads-adsense-form').val();
217
 
218
  var id = containerID.replace("quads-toggle", "");
219
 
220
+ $('#quads_settings\\[ads\\]\\[' + id + '\\]\\[g_data_ad_slot\\]').val(GoogleAd.slotId);
221
+ $('#quads_settings\\[ads\\]\\[' + id + '\\]\\[g_data_ad_client\\]').val(GoogleAd.pubId);
222
  if ('normal' == GoogleAd.type) {
223
+ console.log($('#quads_settings\\[ads\\]\\[' + id + '\\]\\[adsense_type\\]'));
224
+ $('#quads_settings\\[ads\\]\\[' + id + '\\]\\[adsense_type\\]').val('normal');
225
+ $('#quads_settings\\[ads\\]\\[' + id + '\\]\\[g_data_ad_width\\]').val(GoogleAd.width);
226
+ $('#quads_settings\\[ads\\]\\[' + id + '\\]\\[g_data_ad_height\\]').val(GoogleAd.height);
227
  }
228
  if ('responsive' == GoogleAd.type) {
229
+ $('#quads_settings\\[ads\\]\\[' + id + '\\]\\[adsense_type\\]').val('responsive');
230
  //$('#ad-resize-type').val('auto');
231
+ $('#quads_settings\\[ads\\]\\[' + id + '\\]\\[g_data_ad_width\\]').val('');
232
+ $('#quads_settings\\[ads\\]\\[' + id + '\\]\\[g_data_ad_height\\]').val('');
233
  }
234
  // Trigger the ad type select
235
  $('.quads-select-Type').trigger('change');
514
  /**
515
  * Toggle the adsense container
516
  */
517
+ //$('.quads-ad-toggle-header').click(function (e) {
518
+ $('.quads-form-table').on('click', '.quads-ad-toggle-header', function(e) {
519
  e.preventDefault();
520
 
521
  var container = $('#' + $(this).data('box-id'));
522
+ //console.log(container);
523
  container.toggle(0, function () {
524
  if (container.parents('.quads-ad-toggle-header').hasClass('quads-box-close')) {
525
  // open the box
581
  }
582
 
583
 
584
+ /**
585
+ * Start easytabs()
586
+ */
587
  if ($(".quads-tabs").length) {
588
  $('#quads_tab_container').easytabs({
589
  animate: true,
591
  animationSpeed: 'fast'
592
  });
593
  }
594
+
595
+
596
+
597
 
598
  }); // document ready
599
 
assets/js/quads-admin.min.js CHANGED
@@ -3,7 +3,9 @@ var strict;
3
 
4
  jQuery(document).ready(function ($) {
5
 
6
-
 
 
7
  // Inactive select fields are greyed out
8
  $('.quads-assign').each(function(e){
9
  if (!$(this).prop('checked')){
@@ -21,6 +23,9 @@ jQuery(document).ready(function ($) {
21
  }
22
  });
23
 
 
 
 
24
  // Check if submit button is visible than stick it to the bottom of the page
25
  $(window).scroll(function() {
26
  var elem = '#quads_tab_container .submit';
@@ -62,10 +67,7 @@ jQuery(document).ready(function ($) {
62
  }
63
  });
64
 
65
- // // remove content of amp code form if its clicked in
66
- // $('.quads-amp-code').click(function(){
67
- // $(this).val('');
68
- // });
69
 
70
  /**
71
  * Toggle Button | Open All Ads
@@ -138,7 +140,10 @@ jQuery(document).ready(function ($) {
138
  e.stopPropagation();
139
  });
140
 
141
- // Save settings via ajax
 
 
 
142
  jQuery('#quads_settings').submit(function() {
143
 
144
  // Check if ad name has been changed and prepare new data for saving
@@ -182,7 +187,9 @@ jQuery(document).ready(function ($) {
182
  }
183
 
184
 
185
- // Paste AdSense Code form
 
 
186
  $(document).on('click', '#quads-paste-button', function () {
187
 
188
  var content = $('#quads-adsense-form').val();
@@ -210,18 +217,19 @@ jQuery(document).ready(function ($) {
210
 
211
  var id = containerID.replace("quads-toggle", "");
212
 
213
- $('#quads_settings\\[' + id + '\\]\\[g_data_ad_slot\\]').val(GoogleAd.slotId);
214
- $('#quads_settings\\[' + id + '\\]\\[g_data_ad_client\\]').val(GoogleAd.pubId);
215
  if ('normal' == GoogleAd.type) {
216
- $('#quads_settings\\[' + id + '\\]\\[adsense_type\\]').val('normal');
217
- $('#quads_settings\\[' + id + '\\]\\[g_data_ad_width\\]').val(GoogleAd.width);
218
- $('#quads_settings\\[' + id + '\\]\\[g_data_ad_height\\]').val(GoogleAd.height);
 
219
  }
220
  if ('responsive' == GoogleAd.type) {
221
- $('#quads_settings\\[' + id + '\\]\\[adsense_type\\]').val('responsive');
222
  //$('#ad-resize-type').val('auto');
223
- $('#quads_settings\\[' + id + '\\]\\[g_data_ad_width\\]').val('');
224
- $('#quads_settings\\[' + id + '\\]\\[g_data_ad_height\\]').val('');
225
  }
226
  // Trigger the ad type select
227
  $('.quads-select-Type').trigger('change');
@@ -506,11 +514,12 @@ jQuery(document).ready(function ($) {
506
  /**
507
  * Toggle the adsense container
508
  */
509
- $('.quads-ad-toggle-header').click(function (e) {
 
510
  e.preventDefault();
511
 
512
  var container = $('#' + $(this).data('box-id'));
513
-
514
  container.toggle(0, function () {
515
  if (container.parents('.quads-ad-toggle-header').hasClass('quads-box-close')) {
516
  // open the box
@@ -572,7 +581,9 @@ jQuery(document).ready(function ($) {
572
  }
573
 
574
 
575
- // Start easytabs()
 
 
576
  if ($(".quads-tabs").length) {
577
  $('#quads_tab_container').easytabs({
578
  animate: true,
@@ -580,6 +591,9 @@ jQuery(document).ready(function ($) {
580
  animationSpeed: 'fast'
581
  });
582
  }
 
 
 
583
 
584
  }); // document ready
585
 
3
 
4
  jQuery(document).ready(function ($) {
5
 
6
+ /**
7
+ * General Tab
8
+ */
9
  // Inactive select fields are greyed out
10
  $('.quads-assign').each(function(e){
11
  if (!$(this).prop('checked')){
23
  }
24
  });
25
 
26
+ /**
27
+ * AdSense Code Tab
28
+ */
29
  // Check if submit button is visible than stick it to the bottom of the page
30
  $(window).scroll(function() {
31
  var elem = '#quads_tab_container .submit';
67
  }
68
  });
69
 
70
+
 
 
 
71
 
72
  /**
73
  * Toggle Button | Open All Ads
140
  e.stopPropagation();
141
  });
142
 
143
+ /**
144
+ * Save settings via ajax
145
+ */
146
+
147
  jQuery('#quads_settings').submit(function() {
148
 
149
  // Check if ad name has been changed and prepare new data for saving
187
  }
188
 
189
 
190
+ /**
191
+ * Paste AdSense Code form
192
+ */
193
  $(document).on('click', '#quads-paste-button', function () {
194
 
195
  var content = $('#quads-adsense-form').val();
217
 
218
  var id = containerID.replace("quads-toggle", "");
219
 
220
+ $('#quads_settings\\[ads\\]\\[' + id + '\\]\\[g_data_ad_slot\\]').val(GoogleAd.slotId);
221
+ $('#quads_settings\\[ads\\]\\[' + id + '\\]\\[g_data_ad_client\\]').val(GoogleAd.pubId);
222
  if ('normal' == GoogleAd.type) {
223
+ console.log($('#quads_settings\\[ads\\]\\[' + id + '\\]\\[adsense_type\\]'));
224
+ $('#quads_settings\\[ads\\]\\[' + id + '\\]\\[adsense_type\\]').val('normal');
225
+ $('#quads_settings\\[ads\\]\\[' + id + '\\]\\[g_data_ad_width\\]').val(GoogleAd.width);
226
+ $('#quads_settings\\[ads\\]\\[' + id + '\\]\\[g_data_ad_height\\]').val(GoogleAd.height);
227
  }
228
  if ('responsive' == GoogleAd.type) {
229
+ $('#quads_settings\\[ads\\]\\[' + id + '\\]\\[adsense_type\\]').val('responsive');
230
  //$('#ad-resize-type').val('auto');
231
+ $('#quads_settings\\[ads\\]\\[' + id + '\\]\\[g_data_ad_width\\]').val('');
232
+ $('#quads_settings\\[ads\\]\\[' + id + '\\]\\[g_data_ad_height\\]').val('');
233
  }
234
  // Trigger the ad type select
235
  $('.quads-select-Type').trigger('change');
514
  /**
515
  * Toggle the adsense container
516
  */
517
+ //$('.quads-ad-toggle-header').click(function (e) {
518
+ $('.quads-form-table').on('click', '.quads-ad-toggle-header', function(e) {
519
  e.preventDefault();
520
 
521
  var container = $('#' + $(this).data('box-id'));
522
+ //console.log(container);
523
  container.toggle(0, function () {
524
  if (container.parents('.quads-ad-toggle-header').hasClass('quads-box-close')) {
525
  // open the box
581
  }
582
 
583
 
584
+ /**
585
+ * Start easytabs()
586
+ */
587
  if ($(".quads-tabs").length) {
588
  $('#quads_tab_container').easytabs({
589
  animate: true,
591
  animationSpeed: 'fast'
592
  });
593
  }
594
+
595
+
596
+
597
 
598
  }); // document ready
599
 
includes/admin/admin-actions.php CHANGED
@@ -39,3 +39,5 @@ function quads_close_upgrade_notice(){
39
  }
40
  add_action('quads_close_upgrade_notice', 'quads_close_upgrade_notice');
41
 
 
 
39
  }
40
  add_action('quads_close_upgrade_notice', 'quads_close_upgrade_notice');
41
 
42
+
43
+
includes/admin/admin-notices.php CHANGED
@@ -29,6 +29,10 @@ function quads_admin_messages() {
29
  quads_theme_notice();
30
 
31
  quads_update_notice();
 
 
 
 
32
 
33
  if( quads_is_admin_page() ) {
34
  echo '<div class="notice notice-error" id="wpquads-adblock-notice" style="display:none;">' . sprintf( __( '<strong><p>Your ad blocker browser extension is removing WP QUADS ressources and is breaking this settings screen! Deactivate adblock for this website and you are good! WP QUADS is used on 40.000 websites and is into focus of the big adblocking companies. That\'s the downside of our success but nothing you need to worry about. </strong></p>', 'quick-adsense-reloaded' ), admin_url() . 'admin.php?page=quads-settings#quads_settingsgeneral_header' ) . '</div>';
@@ -43,14 +47,13 @@ function quads_admin_messages() {
43
  }
44
 
45
  if( !quads_is_post_type_activated() && quads_is_admin_page() ) {
46
- echo '<div class="notice notice-warning">' . sprintf( __( '<strong>No ads are shown - No post types selected</strong> You need to select at least 1 post type like <i>blog</i> or <i>page</i>. Fix this in <a href="%s">General Settings</a> or no ads are shown at all.', 'quick-adsense-reloaded' ), admin_url() . 'admin.php?page=quads-settings#quads_settingsgeneral_header' ) . '</div>';
47
  }
48
 
49
  if( isset( $_GET['quads-action'] ) && $_GET['quads-action'] === 'validate' && quads_is_admin_page() && quads_is_any_ad_activated() && quads_is_post_type_activated() && quads_get_active_ads() > 0 ) {
50
  echo '<div class="notice notice-success">' . sprintf( __( '<strong>No errors detected in WP QUADS settings.</strong> If ads are still not shown read the <a href="%s" target="_blank">troubleshooting guide</a>' ), 'http://wpquads.com/docs/adsense-ads-are-not-showing/?utm_source=plugin&utm_campaign=wpquads-settings&utm_medium=website&utm_term=toplink' ) . '</div>';
51
  }
52
 
53
- //quads_plugin_deactivated_notice();
54
 
55
  $install_date = get_option( 'quads_install_date' );
56
  $display_date = date( 'Y-m-d h:i:s' );
@@ -235,7 +238,7 @@ function quads_update_notice() {
235
  return false;
236
  }
237
 
238
- if( (version_compare( QUADS_VERSION, '1.3.9', '>=' ) ) && quads_is_advanced() && (version_compare( QUADS_PRO_VERSION, '1.3.0', '<' ) ) ) {
239
  $message = sprintf( __( '<strong>WP QUADS ' . QUADS_VERSION . ': </strong> Update WP QUADS PRO to get custom post type support from <a href="%s">General Settings</a>.', 'quick-adsense-reloaded' ), admin_url() . 'admin.php?page=quads-settings' );
240
  $message .= '<br><br><a href="' . admin_url() . 'admin.php?page=quads-settings&quads-action=hide_update_notice" class="button-primary thankyou" target="_self" title="Close Notice" style="font-weight:bold;">Close Notice</a>';
241
  ?>
@@ -244,7 +247,7 @@ function quads_update_notice() {
244
  </div> <?php
245
  //update_option ('quads_show_update_notice', 'no');
246
  } else
247
- if( !quads_is_advanced() ) {
248
  $message = sprintf( __( '<strong>WP QUADS ' . QUADS_VERSION . ': </strong> Install <a href="%1s" target="_blank">WP QUADS PRO</a> to get custom post type support in <a href="%2s">General Settings</a>.', 'quick-adsense-reloaded' ), 'http://wpquads.com?utm_campaign=admin_notice&utm_source=admin_notice&utm_medium=admin&utm_content=custom_post_type', admin_url() . 'admin.php?page=quads-settings' );
249
  $message .= '<br><br><a href="' . admin_url() . 'admin.php?page=quads-settings&quads-action=hide_update_notice" class="button-primary thankyou" target="_self" title="Close Notice" style="font-weight:bold;">Close Notice</a>';
250
  ?>
@@ -255,6 +258,51 @@ function quads_update_notice() {
255
  }
256
  }
257
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
  /**
259
  * Hide Notice and update db option quads_hide_notice
260
  */
@@ -264,6 +312,15 @@ function quads_hide_notice() {
264
 
265
  add_action( 'quads_hide_update_notice', 'quads_hide_notice', 10 );
266
 
 
 
 
 
 
 
 
 
 
267
  /**
268
  * Check if any ad is activated and assigned in general settings
269
  *
@@ -334,7 +391,7 @@ function quads_ads_empty() {
334
  $check = array();
335
 
336
  for ( $i = 1; $i <= 10; $i++ ) {
337
- if( !empty( $quads_options['ad' . $i]['code'] ) ) {
338
  $check[] = 'true';
339
  }
340
  }
29
  quads_theme_notice();
30
 
31
  quads_update_notice();
32
+
33
+ quads_update_notice_v2();
34
+
35
+ quads_update_notice_1_5_3();
36
 
37
  if( quads_is_admin_page() ) {
38
  echo '<div class="notice notice-error" id="wpquads-adblock-notice" style="display:none;">' . sprintf( __( '<strong><p>Your ad blocker browser extension is removing WP QUADS ressources and is breaking this settings screen! Deactivate adblock for this website and you are good! WP QUADS is used on 40.000 websites and is into focus of the big adblocking companies. That\'s the downside of our success but nothing you need to worry about. </strong></p>', 'quick-adsense-reloaded' ), admin_url() . 'admin.php?page=quads-settings#quads_settingsgeneral_header' ) . '</div>';
47
  }
48
 
49
  if( !quads_is_post_type_activated() && quads_is_admin_page() ) {
50
+ echo '<div class="notice notice-warning">' . sprintf( __( '<strong>No ads are shown - No post type chosen!</strong> You need to select at least 1 post type like <i>blog</i> or <i>page</i>. Fix this in <a href="%s">General Settings</a> or no ads are shown at all.', 'quick-adsense-reloaded' ), admin_url() . 'admin.php?page=quads-settings#quads_settingsgeneral_header' ) . '</div>';
51
  }
52
 
53
  if( isset( $_GET['quads-action'] ) && $_GET['quads-action'] === 'validate' && quads_is_admin_page() && quads_is_any_ad_activated() && quads_is_post_type_activated() && quads_get_active_ads() > 0 ) {
54
  echo '<div class="notice notice-success">' . sprintf( __( '<strong>No errors detected in WP QUADS settings.</strong> If ads are still not shown read the <a href="%s" target="_blank">troubleshooting guide</a>' ), 'http://wpquads.com/docs/adsense-ads-are-not-showing/?utm_source=plugin&utm_campaign=wpquads-settings&utm_medium=website&utm_term=toplink' ) . '</div>';
55
  }
56
 
 
57
 
58
  $install_date = get_option( 'quads_install_date' );
59
  $display_date = date( 'Y-m-d h:i:s' );
238
  return false;
239
  }
240
 
241
+ if( (version_compare( QUADS_VERSION, '1.3.9', '>=' ) ) && quads_is_pro_active() && (version_compare( QUADS_PRO_VERSION, '1.3.0', '<' ) ) ) {
242
  $message = sprintf( __( '<strong>WP QUADS ' . QUADS_VERSION . ': </strong> Update WP QUADS PRO to get custom post type support from <a href="%s">General Settings</a>.', 'quick-adsense-reloaded' ), admin_url() . 'admin.php?page=quads-settings' );
243
  $message .= '<br><br><a href="' . admin_url() . 'admin.php?page=quads-settings&quads-action=hide_update_notice" class="button-primary thankyou" target="_self" title="Close Notice" style="font-weight:bold;">Close Notice</a>';
244
  ?>
247
  </div> <?php
248
  //update_option ('quads_show_update_notice', 'no');
249
  } else
250
+ if( !quads_is_extra() ) {
251
  $message = sprintf( __( '<strong>WP QUADS ' . QUADS_VERSION . ': </strong> Install <a href="%1s" target="_blank">WP QUADS PRO</a> to get custom post type support in <a href="%2s">General Settings</a>.', 'quick-adsense-reloaded' ), 'http://wpquads.com?utm_campaign=admin_notice&utm_source=admin_notice&utm_medium=admin&utm_content=custom_post_type', admin_url() . 'admin.php?page=quads-settings' );
252
  $message .= '<br><br><a href="' . admin_url() . 'admin.php?page=quads-settings&quads-action=hide_update_notice" class="button-primary thankyou" target="_self" title="Close Notice" style="font-weight:bold;">Close Notice</a>';
253
  ?>
258
  }
259
  }
260
 
261
+ /**
262
+ * Show upgrade notice if wp quads pro is lower than 1.3.6
263
+ * @return boolean
264
+ */
265
+ function quads_update_notice_v2(){
266
+
267
+ if( quads_is_pro_active() && (version_compare( QUADS_PRO_VERSION, '1.3.6', '<' ) ) ) {
268
+ $message = sprintf( __( 'You need to update <strong>WP QUADS PRO to version 1.3.6</strong> or higher. Your version of <strong>WP QUADS Pro</strong> is '.QUADS_PRO_VERSION. '.<br>WP QUADS Pro '.QUADS_PRO_VERSION.' supports unlimited amount of ads. <br>Updating requires a valid <a href="%s" target="_new">license key</a>.', 'quick-adsense-reloaded' ), 'https://wpquads.com/#buy-wpquads?utm_source=plugin_notice&utm_medium=admin&utm_campaign=activate_license' );
269
+ ?>
270
+ <div class="notice notice-error">
271
+ <p><?php echo $message; ?></p>
272
+ </div> <?php
273
+ }
274
+ }
275
+
276
+ /**
277
+ * Show upgrade notice after updating from 1.5.2 to 1.5.3 and higher
278
+ * @return boolean
279
+ */
280
+ function quads_update_notice_1_5_3(){
281
+
282
+ // do not show anything
283
+ if( false !== get_option( 'quads_hide_update_notice_1_5_3' )) {
284
+ return false;
285
+ }
286
+
287
+ $previous_version = get_option('quads_version_upgraded_from');
288
+
289
+ //wp_die(QUADS_VERSION);
290
+
291
+ // Show update message if previous version was lower than 1.7 - This makes sure that the message is shown for future updates without complicated version number conditions
292
+ if( !empty($previous_version) && version_compare( QUADS_VERSION, '1.7.0', '<=' ) ) {
293
+
294
+ $message = sprintf( __( 'This is a huge update! The data structure of WP QUADS has been modified and improved for better performance and great new features. <br> For the case you\'d experience issues, we made a <a href="%1s" target="_self">backup of previous WP QUADS data</a>. So you can <a href="%2s" target="_new">switch back to the previous version</a> anytime. <br><br>Please <a href="%3s" target="_new">open first a support ticket</a> if you experience any issue.', 'quick-adsense-reloaded' ), admin_url() . '?page=quads-settings&tab=help', 'https://wpquads.com/docs/install-older-plugin-version/?utm_source=plugin_notice&utm_medium=admin&utm_campaign=install_older_version', 'https://wordpress.org/support/plugin/quick-adsense-reloaded' );
295
+ ?>
296
+ <div class="notice notice-error">
297
+ <p><?php echo $message; ?></p>
298
+ <?php
299
+ echo '<p><a href="' . admin_url() . 'admin.php?page=quads-settings&quads-action=hide_update_notice_1_5_3" class="button-primary" target="_self" title="Close Notice" style="font-weight:bold;">' . __('Close Notice','quick-adsense-reloaded') . '</a>';
300
+ ?>
301
+ </div> <?php
302
+ }
303
+ }
304
+
305
+
306
  /**
307
  * Hide Notice and update db option quads_hide_notice
308
  */
312
 
313
  add_action( 'quads_hide_update_notice', 'quads_hide_notice', 10 );
314
 
315
+ /**
316
+ * Set option to hide admin notice 1.5.3
317
+ * @return boolean
318
+ */
319
+ function quads_hide_notice_1_5_3(){
320
+ update_option('quads_hide_update_notice_1_5_3', '1');
321
+ }
322
+ add_action('quads_hide_update_notice_1_5_3', 'quads_hide_notice_1_5_3');
323
+
324
  /**
325
  * Check if any ad is activated and assigned in general settings
326
  *
391
  $check = array();
392
 
393
  for ( $i = 1; $i <= 10; $i++ ) {
394
+ if( !empty( $quads_options['ads']['ad' . $i]['code'] ) ) {
395
  $check[] = 'true';
396
  }
397
  }
includes/admin/admin-pages.php CHANGED
@@ -24,7 +24,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
24
  function quads_add_options_link() {
25
  global $quads_options, $quads_parent_page, $quads_add_ons_page, $quads_add_ons_page2, $quads_settings_page;
26
 
27
- $label = quads_is_advanced() ? 'WP QUADS PRO' : 'WP QUADS';
28
 
29
  $create_settings = isset($quads_options['create_settings']) ? true : false;
30
  if ($create_settings){
@@ -35,7 +35,7 @@ $wpquads_logo ="PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxzdmcgdmVy
35
  $quads_parent_page = add_menu_page( 'Quick AdSense Reloaded Settings', $label, 'manage_options', 'quads-settings', 'quads_options_page', 'data:image/svg+xml;base64,' . $wpquads_logo );
36
  $quads_settings_page = add_submenu_page( 'quads-settings', __( 'Ad Settings', 'quick-adsense-reloaded' ), 'Ad Settings', 'manage_options', 'quads-settings', 'quads_options_page' );
37
 
38
- if (!quads_is_advanced()){
39
  $quads_add_ons_page = add_submenu_page( 'quads-settings', __( 'Get Add-On', 'quick-adsense-reloaded' ), 'Get WP QUADS PRO', 'manage_options', 'quads-addons', 'quads_add_ons_page' );
40
  }
41
  }
24
  function quads_add_options_link() {
25
  global $quads_options, $quads_parent_page, $quads_add_ons_page, $quads_add_ons_page2, $quads_settings_page;
26
 
27
+ $label = quads_is_extra() ? 'WP QUADS PRO' : 'WP QUADS';
28
 
29
  $create_settings = isset($quads_options['create_settings']) ? true : false;
30
  if ($create_settings){
35
  $quads_parent_page = add_menu_page( 'Quick AdSense Reloaded Settings', $label, 'manage_options', 'quads-settings', 'quads_options_page', 'data:image/svg+xml;base64,' . $wpquads_logo );
36
  $quads_settings_page = add_submenu_page( 'quads-settings', __( 'Ad Settings', 'quick-adsense-reloaded' ), 'Ad Settings', 'manage_options', 'quads-settings', 'quads_options_page' );
37
 
38
+ if (!quads_is_extra()){
39
  $quads_add_ons_page = add_submenu_page( 'quads-settings', __( 'Get Add-On', 'quick-adsense-reloaded' ), 'Get WP QUADS PRO', 'manage_options', 'quads-addons', 'quads_add_ons_page' );
40
  }
41
  }
includes/admin/settings/display-settings.php CHANGED
@@ -132,10 +132,7 @@ function quads_do_settings_fields($page, $section) {
132
 
133
  echo '<tr><td>';
134
  call_user_func($field['callback'], $field['args']);
135
- echo '<tr><td>';
136
-
137
-
138
-
139
  }
140
  echo '</tbody></table>';
141
  if ($header === true){
@@ -237,7 +234,7 @@ function quads_options_page() {
237
  $other_attributes = array( 'id' => 'quads-submit-button' );
238
  submit_button(null, 'primary', 'quads-save-settings' , true, $other_attributes );
239
  ?>
240
- <a href="<?php echo admin_url() . '/admin.php?page=quads-settings&quads-action=validate'; ?> " id="quads-validate"><?php _e('Validate Settings','quick-adsense-reloaded')?></a>
241
  <?php
242
  }
243
  ?>
@@ -245,8 +242,8 @@ function quads_options_page() {
245
  <?php
246
  if ($active_tab !== 'addons' && $active_tab !== 'licenses'){
247
  echo sprintf( __( '<strong>If you like this plugin please do us a BIG favor and give us a 5 star rating <a href="%s" target="_blank">here</a> . If you`re not happy, please open a <a href="%2s" target="_blank">support ticket</a>, so that we can sort it out. Thank you!</strong>', 'quick-adsense-reloaded' ),
248
- 'https://wordpress.org/support/plugin/quick-adsense-reloaded/reviews/#new-post',
249
- 'http://wpquads.com/support/'
250
  );
251
  echo '<p>' . sprintf( __( '<strong>Ads are not showing? Read the <a href="%s" target="_blank">troubleshooting guide</a> to find out how to resolve this issue.', 'quick-adsense-reloaded' ),
252
  'http://wpquads.com/docs/adsense-ads-are-not-showing/?utm_source=plugin&utm_campaign=wpquads-settings&utm_medium=website&utm_term=bottomlink'
@@ -280,7 +277,7 @@ function quads_get_debug_messages(){
280
  */
281
  function quads_get_advertising() {
282
 
283
- if ( quads_is_advanced() ){
284
  return '';
285
  }
286
  ob_start();
132
 
133
  echo '<tr><td>';
134
  call_user_func($field['callback'], $field['args']);
135
+ echo '</td></tr>';
 
 
 
136
  }
137
  echo '</tbody></table>';
138
  if ($header === true){
234
  $other_attributes = array( 'id' => 'quads-submit-button' );
235
  submit_button(null, 'primary', 'quads-save-settings' , true, $other_attributes );
236
  ?>
237
+ <a href="<?php echo admin_url() . '/admin.php?page=quads-settings&quads-action=validate'; ?> " id="quads-validate"><?php _e('Validate Ad Settings','quick-adsense-reloaded')?></a>
238
  <?php
239
  }
240
  ?>
242
  <?php
243
  if ($active_tab !== 'addons' && $active_tab !== 'licenses'){
244
  echo sprintf( __( '<strong>If you like this plugin please do us a BIG favor and give us a 5 star rating <a href="%s" target="_blank">here</a> . If you`re not happy, please open a <a href="%2s" target="_blank">support ticket</a>, so that we can sort it out. Thank you!</strong>', 'quick-adsense-reloaded' ),
245
+ 'https://wordpress.org/support/plugin/quick-adsense-reloaded/reviews/#new-post',
246
+ 'http://wpquads.com/support/'
247
  );
248
  echo '<p>' . sprintf( __( '<strong>Ads are not showing? Read the <a href="%s" target="_blank">troubleshooting guide</a> to find out how to resolve this issue.', 'quick-adsense-reloaded' ),
249
  'http://wpquads.com/docs/adsense-ads-are-not-showing/?utm_source=plugin&utm_campaign=wpquads-settings&utm_medium=website&utm_term=bottomlink'
277
  */
278
  function quads_get_advertising() {
279
 
280
+ if ( quads_is_extra() ){
281
  return '';
282
  }
283
  ob_start();
includes/admin/settings/register-settings.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Register Settings
5
  *
@@ -11,7 +10,7 @@
11
  */
12
  // Exit if accessed directly
13
  if( !defined( 'ABSPATH' ) )
14
- exit;
15
 
16
  /**
17
  * Get an option
@@ -22,10 +21,10 @@ if( !defined( 'ABSPATH' ) )
22
  * @return mixed
23
  */
24
  function quads_get_option( $key = '', $default = false ) {
25
- global $quads_options;
26
- $value = !empty( $quads_options[$key] ) ? $quads_options[$key] : $default;
27
- $value = apply_filters( 'quads_get_option', $value, $key, $default );
28
- return apply_filters( 'quads_get_option_' . $key, $value, $key, $default );
29
  }
30
 
31
  /**
@@ -37,23 +36,23 @@ function quads_get_option( $key = '', $default = false ) {
37
  * @return array QUADS settings
38
  */
39
  function quads_get_settings() {
40
- $settings = get_option( 'quads_settings' );
41
 
42
 
43
- if( empty( $settings ) ) {
44
- // Update old settings with new single option
45
- $general_settings = is_array( get_option( 'quads_settings_general' ) ) ? get_option( 'quads_settings_general' ) : array();
46
- $ext_settings = is_array( get_option( 'quads_settings_extensions' ) ) ? get_option( 'quads_settings_extensions' ) : array();
47
- $license_settings = is_array( get_option( 'quads_settings_licenses' ) ) ? get_option( 'quads_settings_licenses' ) : array();
48
- $addons_settings = is_array( get_option( 'quads_settings_addons' ) ) ? get_option( 'quads_settings_addons' ) : array();
49
- $imexport_settings = is_array( get_option( 'quads_settings_imexport' ) ) ? get_option( 'quads_settings_imexport' ) : array();
50
- $help_settings = is_array( get_option( 'quads_settings_help' ) ) ? get_option( 'quads_settings_help' ) : array();
51
 
52
- $settings = array_merge( $general_settings, $ext_settings, $imexport_settings, $help_settings );
53
 
54
- update_option( 'quads_settings', $settings );
55
- }
56
- return apply_filters( 'quads_get_settings', $settings );
57
  }
58
 
59
  /**
@@ -64,45 +63,44 @@ function quads_get_settings() {
64
  */
65
  function quads_register_settings() {
66
 
67
- if( false == get_option( 'quads_settings' ) ) {
68
- add_option( 'quads_settings' );
69
- }
70
-
71
- foreach ( quads_get_registered_settings() as $tab => $settings ) {
72
-
73
- add_settings_section(
74
- 'quads_settings_' . $tab, __return_null(), '__return_false', 'quads_settings_' . $tab
75
- );
76
-
77
- foreach ( $settings as $option ) {
78
-
79
- $name = isset( $option['name'] ) ? $option['name'] : '';
80
-
81
- add_settings_field(
82
- 'quads_settings[' . $option['id'] . ']', $name, function_exists( 'quads_' . $option['type'] . '_callback' ) ? 'quads_' . $option['type'] . '_callback' : 'quads_missing_callback', 'quads_settings_' . $tab, 'quads_settings_' . $tab, array(
83
- 'id' => isset( $option['id'] ) ? $option['id'] : null,
84
- 'desc' => !empty( $option['desc'] ) ? $option['desc'] : '',
85
- 'desc2' => !empty( $option['desc2'] ) ? $option['desc2'] : '',
86
- 'helper-desc' => !empty( $option['helper-desc'] ) ? $option['helper-desc'] : '',
87
- 'name' => isset( $option['name'] ) ? $option['name'] : null,
88
- 'section' => $tab,
89
- 'size' => isset( $option['size'] ) ? $option['size'] : null,
90
- 'options' => isset( $option['options'] ) ? $option['options'] : '',
91
- 'std' => isset( $option['std'] ) ? $option['std'] : '',
92
- 'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : '',
93
- 'textarea_rows' => isset( $option['textarea_rows'] ) ? $option['textarea_rows'] : ''
94
- )
95
- );
96
- }
97
- }
98
-
99
- // Store adsense values
100
- quads_store_adsense_args();
101
- // Store AdSense value
102
- //quads_fix_ad_not_shown();
103
-
104
- // Creates our settings in the options table
105
- register_setting( 'quads_settings', 'quads_settings', 'quads_settings_sanitize' );
106
  }
107
 
108
  add_action( 'admin_init', 'quads_register_settings' );
@@ -115,326 +113,336 @@ add_action( 'admin_init', 'quads_register_settings' );
115
  */
116
  function quads_get_registered_settings() {
117
 
118
- /**
119
- * 'Whitelisted' QUADS settings, filters are provided for each settings
120
- * section to allow extensions and other plugins to add their own settings
121
- */
122
- $quads_settings = array(
123
- /** General Settings */
124
- 'general' => apply_filters( 'quads_settings_general', array(
125
- array(
126
- 'id' => 'general_header',
127
- 'name' => '<strong>' . __( 'General & Position', 'quick-adsense-reloaded' ) . '</strong>',
128
- 'desc' => __( '', 'quick-adsense-reloaded' ),
129
- 'type' => 'header'
130
- ),
131
- 'maxads' => array(
132
- 'id' => 'maxads',
133
- 'name' => __( 'Limit Amount of ads:', 'quick-adsense-reloaded' ),
134
- 'desc' => __( ' ads on a page.', 'quick-adsense-reloaded' ),
135
- 'desc2' => sprintf(__( '<a href="%s" target="_blank">Read here</a> to learn how many AdSense ads are allowed. If you are unsure select 3 ads.', 'quick-adsense-reloaded' ), 'http://wpquads.com/google-adsense-allowed-number-ads/'),
136
- 'type' => 'select',
137
- 'std' => 3,
138
- 'options' => array(
139
- 1 => '1',
140
- 2 => '2',
141
- 3 => '3',
142
- 4 => '4',
143
- 5 => '5',
144
- 6 => '6',
145
- 7 => '7',
146
- 8 => '8',
147
- 9 => '9',
148
- 10 => '10',
149
- 11 => '11',
150
- 12 => '12',
151
- 13 => '13',
152
- 14 => '14',
153
- 15 => '15',
154
- 16 => '16',
155
- 17 => '17',
156
- 18 => '18',
157
- 19 => '19',
158
- 20 => '20',
159
- 100 => 'Unlimited',
160
- ),
161
- ),
162
- array(
163
- 'id' => 'ad_position',
164
- 'name' => __( 'Position - Default Ads', 'quick-adsense-reloaded' ),
165
- 'desc' => __( 'Assign and activate ads on specific ad places', 'quick-adsense-reloaded' ),
166
- 'type' => 'ad_position'
167
- ),
168
- array(
169
- 'id' => 'visibility',
170
- 'name' => __( 'Visibility', 'quick-adsense-reloaded' ),
171
- 'desc' => __( '', 'quick-adsense-reloaded' ),
172
- 'type' => 'visibility'
173
- ),
174
- array(
175
- "id" => "post_types",
176
- "name" => __( "Post Types", "quick-adsense-reloaded" ),
177
- "desc" => __( "Select post types where ads are visible.", "quick-adsense-reloaded" ),
178
- "helper-desc" => __( "Select post types where ads are visible.", "quick-adsense-reloaded" ),
179
- "type" => "multiselect",
180
- "options" => quads_get_post_types(),
181
- "placeholder" => __( "Select Post Type", "quick-adsense-reloaded" )
182
- ),
183
- array(
184
- 'id' => 'quicktags',
185
- 'name' => __( 'Quicktags', 'quick-adsense-reloaded' ),
186
- 'desc' => __( '', 'quick-adsense-reloaded' ),
187
- 'type' => 'quicktags'
188
- ),
189
- /* 'load_scripts_footer' => array(
190
- 'id' => 'load_scripts_footer',
191
- 'name' => __( 'JS Load Order', 'quick-adsense-reloaded' ),
192
- 'desc' => __( 'Enable this to load all *.js files into footer. Make sure your theme uses the wp_footer() template tag in the appropriate place. Default: Disabled', 'quick-adsense-reloaded' ),
193
- 'type' => 'checkbox'
194
- ), */
195
- 'adsense_header' => array(
196
- 'id' => 'adsense_header',
197
- 'name' => '<strong>' . __( 'AdSense Code', 'quick-adsense-reloaded' ) . '</strong>',
198
- 'desc' => '<div class="adsense_admin_header">' . sprintf( __( 'Enter your ad codes below:</div>'
199
- . '<ul style="margin-top:10px;">'
200
- . '<li style="font-weight:600;">Select <i>AdSense</i> if you are using AdSense!</li>'
201
- . '<li style="font-weight:600;">Use <i>Plain Text / HTML / JS</i> for all other ads! Putting AdSense into Plain text field can result in non visible ads.</li></ul>', 'quick-adsense-reloaded' ), 'http://wpquads.com/effective-adsense-banner-size-formats/?utm_campaign=plugin&utm_source=general_tab&utm_medium=admin&utm_content=best_banner_sizes' )
202
- . '</ul>'
203
- . '<div style="clear:both;">' . sprintf( __( '<strong>Ads are not showing? Read the <a href="%s" target="_blank">troubleshooting guide</a> to find out how to resolve this issue.', 'quick-adsense-reloaded' ),'http://wpquads.com/docs/adsense-ads-are-not-showing/?utm_source=plugin&utm_campaign=wpquads-settings&utm_medium=website&utm_term=toplink') . ''
204
- . '<br><a href="%s" target="_blank">Read here</a> to find out the most effective AdSense banner sizes. </div>'
205
- . '<div id="quads-open-toggle" class="button">'.__('Open All Ads','quick-adsense-reloaded').'</div>',
206
- 'type' => 'header'
207
- ),
208
- array(
209
- 'id' => 'ad1',
210
- 'name' => __( 'Ad 1', 'quick-adsense-reloaded' ),
211
- 'desc' => __( 'Shortcode: <strong>[quads id="1"] </strong></br>PHP: <strong>echo do_shortcode(\'[quads id="1"]\');</strong>', 'quick-adsense-reloaded' ),
212
- 'type' => 'adsense_code',
213
- 'options' => quads_get_alignment(),
214
- ),
215
- array(
216
- 'id' => 'ad2',
217
- 'name' => __( 'Ad 2', 'quick-adsense-reloaded' ),
218
- 'desc' => __( 'Shortcode: <strong>[quads id="2"] </strong></br>PHP: <strong>echo do_shortcode(\'[quads id="2"]\');</strong>', 'quick-adsense-reloaded' ),
219
- 'type' => 'adsense_code',
220
- 'options' => quads_get_alignment(),
221
- ),
222
- array(
223
- 'id' => 'ad3',
224
- 'name' => __( 'Ad 3', 'quick-adsense-reloaded' ),
225
- 'desc' => __( 'Shortcode: <strong>[quads id="3"] </strong></br>PHP: <strong>echo do_shortcode(\'[quads id="3"]\');</strong>', 'quick-adsense-reloaded' ),
226
- 'type' => 'adsense_code',
227
- 'options' => quads_get_alignment(),
228
- ),
229
- array(
230
- 'id' => 'ad4',
231
- 'name' => __( 'Ad 4', 'quick-adsense-reloaded' ),
232
- 'desc' => __( 'Shortcode: <strong>[quads id="4"] </strong></br>PHP: <strong>echo do_shortcode(\'[quads id="4"]\');</strong>', 'quick-adsense-reloaded' ),
233
- 'type' => 'adsense_code',
234
- 'options' => quads_get_alignment(),
235
- ),
236
- array(
237
- 'id' => 'ad5',
238
- 'name' => __( 'Ad 5', 'quick-adsense-reloaded' ),
239
- 'desc' => __( 'Shortcode: <strong>[quads id="5"] </strong></br>PHP: <strong>echo do_shortcode(\'[quads id="5"]\');</strong>', 'quick-adsense-reloaded' ),
240
- 'type' => 'adsense_code',
241
- 'options' => quads_get_alignment(),
242
- ),
243
- array(
244
- 'id' => 'ad6',
245
- 'name' => __( 'Ad 6', 'quick-adsense-reloaded' ),
246
- 'desc' => __( 'Shortcode: <strong>[quads id="6"] </strong></br>PHP: <strong>echo do_shortcode(\'[quads id="6"]\');</strong>', 'quick-adsense-reloaded' ),
247
- 'type' => 'adsense_code',
248
- 'options' => quads_get_alignment(),
249
- ),
250
- array(
251
- 'id' => 'ad7',
252
- 'name' => __( 'Ad 7', 'quick-adsense-reloaded' ),
253
- 'desc' => __( 'Shortcode: <strong>[quads id="7"] </strong></br>PHP: <strong>echo do_shortcode(\'[quads id="7"]\');</strong>', 'quick-adsense-reloaded' ),
254
- 'type' => 'adsense_code',
255
- 'options' => quads_get_alignment(),
256
- ),
257
- array(
258
- 'id' => 'ad8',
259
- 'name' => __( 'Ad 8', 'quick-adsense-reloaded' ),
260
- 'desc' => __( 'Shortcode: <strong>[quads id="8"] </strong></br>PHP: <strong>echo do_shortcode(\'[quads id="8"]\');</strong>', 'quick-adsense-reloaded' ),
261
- 'type' => 'adsense_code',
262
- 'options' => quads_get_alignment(),
263
- ),
264
- array(
265
- 'id' => 'ad9',
266
- 'name' => __( 'Ad 9', 'quick-adsense-reloaded' ),
267
- 'desc' => __( 'Shortcode: <strong>[quads id="9"] </strong></br>Function: <strong>echo do_shortcode(\'[quads id="9"]\');</strong>', 'quick-adsense-reloaded' ),
268
- 'type' => 'adsense_code',
269
- 'options' => quads_get_alignment(),
270
- ),
271
- array(
272
- 'id' => 'ad10',
273
- 'name' => __( 'Ad 10', 'quick-adsense-reloaded' ),
274
- 'desc' => __( 'Shortcode: <strong>[quads id="10"] </strong></br>PHP <strong>echo do_shortcode(\'[quads id="10"]\');</strong>', 'quick-adsense-reloaded' ),
275
- 'type' => 'adsense_code',
276
- 'options' => quads_get_alignment(),
277
- ),
278
- 'widget_header' => array(
279
- 'id' => 'widget_header',
280
- 'name' => '<strong>' . __( 'Widgets Ad Code', 'quick-adsense-reloaded' ) . '</strong>',
281
- 'desc' => sprintf( __( 'After creating your ads here go to <a href="%s" target="_self">Appearance->Widgets</a> and drag the WP QUADS widget into place.', 'quick-adsense-reloaded' ), admin_url() . 'widgets.php' ),
282
- 'type' => 'header'
283
- ),
284
- 'ad1_widget' => array(
285
- 'id' => 'ad1_widget',
286
- 'name' => __( 'Ad widget 1', 'quick-adsense-reloaded' ),
287
- 'desc' => __( '', 'quick-adsense-reloaded' ),
288
- 'type' => 'adsense_widget',
289
- 'size' => 4
290
- ),
291
- 'ad2_widget' => array(
292
- 'id' => 'ad2_widget',
293
- 'name' => __( 'Ad widget 2', 'quick-adsense-reloaded' ),
294
- 'desc' => __( '', 'quick-adsense-reloaded' ),
295
- 'type' => 'adsense_widget',
296
- 'size' => 4
297
- ),
298
- 'ad3_widget' => array(
299
- 'id' => 'ad3_widget',
300
- 'name' => __( 'Ad widget 3', 'quick-adsense-reloaded' ),
301
- 'desc' => __( '', 'quick-adsense-reloaded' ),
302
- 'type' => 'adsense_widget',
303
- 'size' => 4
304
- ),
305
- 'ad4_widget' => array(
306
- 'id' => 'ad4_widget',
307
- 'name' => __( 'Ad widget 4', 'quick-adsense-reloaded' ),
308
- 'desc' => __( '', 'quick-adsense-reloaded' ),
309
- 'type' => 'adsense_widget',
310
- 'size' => 4
311
- ),
312
- 'ad5_widget' => array(
313
- 'id' => 'ad5_widget',
314
- 'name' => __( 'Ad widget 5', 'quick-adsense-reloaded' ),
315
- 'desc' => __( '', 'quick-adsense-reloaded' ),
316
- 'type' => 'adsense_widget',
317
- 'size' => 4
318
- ),
319
- 'ad6_widget' => array(
320
- 'id' => 'ad6_widget',
321
- 'name' => __( 'Ad widget 6', 'quick-adsense-reloaded' ),
322
- 'desc' => __( '', 'quick-adsense-reloaded' ),
323
- 'type' => 'adsense_widget',
324
- 'size' => 4
325
- ),
326
- 'ad7_widget' => array(
327
- 'id' => 'ad7_widget',
328
- 'name' => __( 'Ad widget 7', 'quick-adsense-reloaded' ),
329
- 'desc' => __( '', 'quick-adsense-reloaded' ),
330
- 'type' => 'adsense_widget',
331
- 'size' => 4
332
- ),
333
- 'ad8_widget' => array(
334
- 'id' => 'ad8_widget',
335
- 'name' => __( 'Ad widget 8', 'quick-adsense-reloaded' ),
336
- 'desc' => __( '', 'quick-adsense-reloaded' ),
337
- 'type' => 'adsense_widget',
338
- 'size' => 4
339
- ),
340
- 'ad9_widget' => array(
341
- 'id' => 'ad9_widget',
342
- 'name' => __( 'Ad widget 9', 'quick-adsense-reloaded' ),
343
- 'desc' => __( '', 'quick-adsense-reloaded' ),
344
- 'type' => 'adsense_widget',
345
- 'size' => 4
346
- ),
347
- 'ad10_widget' => array(
348
- 'id' => 'ad10_widget',
349
- 'name' => __( 'Ad widget 10', 'quick-adsense-reloaded' ),
350
- 'desc' => __( '', 'quick-adsense-reloaded' ),
351
- 'type' => 'adsense_widget',
352
- 'size' => 4
353
- ),
354
- array(
355
- 'id' => 'plugin_header',
356
- 'name' => '<strong>' . __( 'Plugin Settings', 'quick-adsense-reloaded' ) . '</strong>',
357
- 'desc' => __( '', 'quick-adsense-reloaded' ),
358
- 'type' => 'header'
359
- ),
360
- 'priority' => array(
361
- 'id' => 'priority',
362
- 'name' => __( 'Load Priority', 'quick-adsense-reloaded' ),
363
- //'desc' => __( 'Do not change this until you know what you are doing. Usually the default value 20 is working fine. Changing this value can lead to unexpected results like ads not showing or loaded on wrong order. <strong>Default:</strong> 20', 'quick-adsense-reloaded' ),
364
- 'helper-desc' => __( 'Do not change this until you know what you are doing. Usually the default value 20 is working fine. Changing this value can lead to unexpected results like ads not showing or loaded on wrong order. <strong>Default:</strong> 20', 'quick-adsense-reloaded' ),
365
- 'type' => 'number',
366
- 'size' => 'small',
367
- 'std' => 20
368
- ),
369
- 'create_settings' => array(
370
- 'id' => 'create_settings',
371
- 'name' => __( 'Remove menu button', 'quick-adsense-reloaded' ),
372
- //'desc' => __( 'Make the WPQUADS settings available from <strong>Settings->WPQUADS</strong>. This will remove the primary menu button from the admin sidebar', 'quick-adsense-reloaded' ),
373
- 'desc' => __('Remove'),
374
- 'helper-desc' => __( 'Make the WPQUADS settings available from <strong>Settings->WPQUADS</strong>. This will remove the primary menu button from the admin sidebar', 'quick-adsense-reloaded' ),
375
- 'type' => 'checkbox',
376
- ),
377
- 'uninstall_on_delete' => array(
378
- 'id' => 'uninstall_on_delete',
379
- 'name' => __( 'Delete Data on Uninstall?', 'quick-adsense-reloaded' ),
380
- //'desc' => __( 'Check this box if you would like <strong>Settings->WPQUADS</strong> to completely remove all of its data when the plugin is deleted.', 'quick-adsense-reloaded' ),
381
- 'helper-desc' => __( 'Check this box if you would like <strong>Settings->WPQUADS</strong> to completely remove all of its data when the plugin is deleted.', 'quick-adsense-reloaded' ),
382
- 'desc' => 'Delete',
383
- 'type' => 'checkbox'
384
- ),
385
- )
386
- ),
387
- 'licenses' => apply_filters( 'quads_settings_licenses', array('licenses_header' => array(
388
- 'id' => 'licenses_header',
389
- 'name' => __( 'Activate Your License', 'quick-adsense-reloaded' ),
390
- 'desc' => '',
391
- 'type' => 'header'
392
- ),)
393
- ),
394
- 'extensions' => apply_filters( 'quads_settings_extension', array()
395
- ),
396
- 'addons' => apply_filters( 'quads_settings_addons', array(
397
- 'addons' => array(
398
- 'id' => 'addons',
399
- 'name' => __( '', 'quick-adsense-reloaded' ),
400
- 'desc' => __( '', 'quick-adsense-reloaded' ),
401
- 'type' => 'addons'
402
- ),
403
- )
404
- ),
405
- 'imexport' => apply_filters( 'quads_settings_imexport', array(
406
- 'imexport' => array(
407
- 'id' => 'imexport',
408
- 'name' => __( '', 'quick-adsense-reloaded' ),
409
- 'desc' => __( '', 'quick-adsense-reloaded' ),
410
- 'type' => 'imexport'
411
- )
412
- )
413
- ),
414
- 'help' => apply_filters( 'quads_settings_help', array(
415
- 'help_header' => array(
416
- 'id' => 'help_header',
417
- 'name' => '<strong>' . __( 'Help', 'quick-adsense-reloaded' ) . '</strong>',
418
- 'desc' => quads_is_advanced() ? sprintf( __( 'Something not working as expected? Open a <a href="%1s" target="_blank">support ticket</a>', 'quick-adsense-reloaded' ), 'http://wpquads.com/support/' ) : sprintf( __( 'Something not working as expected? Visit the WP<strong>QUADS</strong> <a href="%1s" target="_blank">Support Forum</a>', 'quick-adsense-reloaded' ), 'https://wordpress.org/support/plugin/quick-adsense-reloaded' ),
419
- 'type' => 'header'
420
- ),
421
- 'systeminfo' => array(
422
- 'id' => 'systeminfo',
423
- 'name' => __( 'Systeminfo', 'quick-adsense-reloaded' ),
424
- 'desc' => __( '', 'quick-adsense-reloaded' ),
425
- 'type' => 'systeminfo'
426
- ),
427
- 'debug_mode' => array(
428
- 'id' => 'debug_mode',
429
- 'name' => __( 'Debug mode', 'quick-adsense-reloaded' ),
430
- 'desc' => __( 'This does not minify javascript and css files. This makes debugging much easier and is recommended setting for inspecting issues on your site', 'quick-adsense-reloaded' ),
431
- 'type' => 'checkbox'
432
- )
433
- )
434
- )
435
- );
436
-
437
- return $quads_settings;
 
 
 
 
 
 
 
 
 
 
438
  }
439
 
440
  /**
@@ -442,7 +450,7 @@ function quads_get_registered_settings() {
442
  * @return string empty one
443
  */
444
  function quads_empty_callback() {
445
- return '';
446
  }
447
 
448
  /**
@@ -458,60 +466,76 @@ function quads_empty_callback() {
458
  * @return string $input Sanitized value
459
  */
460
  function quads_settings_sanitize( $input = array() ) {
 
 
461
 
462
- global $quads_options;
463
 
 
 
 
464
 
465
- if( empty( $_POST['_wp_http_referer'] ) ) {
466
- return $input;
467
- }
468
 
469
- parse_str( $_POST['_wp_http_referer'], $referrer );
 
470
 
471
- $settings = quads_get_registered_settings();
472
- $tab = isset( $referrer['tab'] ) ? $referrer['tab'] : 'general';
 
 
 
473
 
474
- $input = $input ? $input : array();
475
- $input = apply_filters( 'quads_settings_' . $tab . '_sanitize', $input );
 
 
 
 
476
 
477
- // Loop through each setting being saved and pass it through a sanitization filter
478
- foreach ( $input as $key => $value ) {
 
 
 
479
 
480
- // Get the setting type (checkbox, select, etc)
481
- $type = isset( $settings[$tab][$key]['type'] ) ? $settings[$tab][$key]['type'] : false;
 
 
 
 
 
482
 
483
- if( $type ) {
484
- // Field type specific filter
485
- $input[$key] = apply_filters( 'quads_settings_sanitize_' . $type, $value, $key );
486
- }
 
487
 
488
- // General filter
489
- $input[$key] = apply_filters( 'quads_settings_sanitize', $value, $key );
490
- }
491
 
492
- // Loop through the whitelist and unset any that are empty for the tab being saved
493
- if( !empty( $settings[$tab] ) ) {
494
- foreach ( $settings[$tab] as $key => $value ) {
495
- // settings used to have numeric keys, now they have keys that match the option ID. This ensures both methods work
496
- if( is_numeric( $key ) ) {
497
- $key = $value['id'];
498
- }
499
-
500
- if( empty( $input[$key] ) ) {
501
- unset( $quads_options[$key] );
502
- }
503
- }
504
- }
505
 
506
 
507
- // Merge our new settings with the existing
508
- $output = array_merge( $quads_options, $input );
509
 
 
 
510
 
511
- add_settings_error( 'quads-notices', '', __( 'Settings updated.', 'quick-adsense-reloaded' ), 'updated' );
512
-
513
- return $output;
 
 
 
 
 
 
 
 
 
514
  }
 
515
 
516
  /**
517
  * Sanitize text fields
@@ -521,9 +545,8 @@ function quads_settings_sanitize( $input = array() ) {
521
  * @return string $input Sanitizied value
522
  */
523
  function quads_sanitize_text_field( $input ) {
524
- return trim( $input );
525
  }
526
-
527
  add_filter( 'quads_settings_sanitize_text', 'quads_sanitize_text_field' );
528
 
529
  /**
@@ -535,37 +558,37 @@ add_filter( 'quads_settings_sanitize_text', 'quads_sanitize_text_field' );
535
  */
536
  function quads_get_settings_tabs() {
537
 
538
- $settings = quads_get_registered_settings();
539
 
540
- $tabs = array();
541
- $tabs['general'] = __( 'General', 'quick-adsense-reloaded' );
542
 
543
- if( !empty( $settings['visual'] ) ) {
544
- $tabs['visual'] = __( 'Visual', 'quick-adsense-reloaded' );
545
- }
546
 
547
- if( !empty( $settings['networks'] ) ) {
548
- //$tabs['networks'] = __( 'Social Networks', 'quick-adsense-reloaded' );
549
- }
550
 
551
- if( !empty( $settings['extensions'] ) ) {
552
- $tabs['extensions'] = __( 'Add-On Setting', 'quick-adsense-reloaded' );
553
- }
554
 
555
 
556
- if( !empty( $settings['licenses'] ) && quads_is_advanced() ) {
557
- $tabs['licenses'] = __( 'Licenses', 'quick-adsense-reloaded' );
558
- }
559
 
560
- //$tabs['addons'] = __( 'Add-Ons', 'quick-adsense-reloaded' );
561
 
562
- $tabs['imexport'] = __( 'Import/Export', 'quick-adsense-reloaded' );
563
 
564
- $tabs['help'] = __( 'Help', 'quick-adsense-reloaded' );
565
 
566
- //$tabs['misc'] = __( 'Misc', 'quick-adsense-reloaded' );
567
 
568
- return apply_filters( 'quads_settings_tabs', $tabs );
569
  }
570
 
571
  /**
@@ -578,11 +601,11 @@ function quads_get_settings_tabs() {
578
  * @return void
579
  */
580
  function quads_header_callback( $args ) {
581
- if( !empty( $args['desc'] ) ) {
582
- echo $args['desc'];
583
- } else {
584
- echo '&nbsp';
585
- }
586
  }
587
 
588
  /**
@@ -596,14 +619,15 @@ function quads_header_callback( $args ) {
596
  * @return void
597
  */
598
  function quads_checkbox_callback( $args ) {
599
- global $quads_options;
600
 
601
- $checked = isset( $quads_options[$args['id']] ) ? checked( 1, $quads_options[$args['id']], false ) : '';
602
- $html = '<input type="checkbox" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']" value="1" ' . $checked . '/>';
603
- $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
604
 
605
- echo $html;
606
  }
 
607
  /**
608
  * Checkbox Callback
609
  *
@@ -615,13 +639,13 @@ function quads_checkbox_callback( $args ) {
615
  * @return void
616
  */
617
  function quads_checkbox_adsense_callback( $args ) {
618
- global $quads_options;
619
 
620
- $checked = isset( $quads_options[$args['id']] ) ? checked( 1, $quads_options[$args['id']], false ) : '';
621
- $html = '<input type="checkbox" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']" value="1" ' . $checked . '/>';
622
- $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
623
 
624
- return $html;
625
  }
626
 
627
  /**
@@ -635,20 +659,20 @@ function quads_checkbox_adsense_callback( $args ) {
635
  * @return void
636
  */
637
  function quads_multicheck_callback( $args ) {
638
- global $quads_options;
639
-
640
- if( !empty( $args['options'] ) ) {
641
- foreach ( $args['options'] as $key => $option ):
642
- if( isset( $quads_options[$args['id']][$key] ) ) {
643
- $enabled = $option;
644
- } else {
645
- $enabled = NULL;
646
- }
647
- echo '<input name="quads_settings[' . $args['id'] . '][' . $key . ']" id="quads_settings[' . $args['id'] . '][' . $key . ']" type="checkbox" value="' . $option . '" ' . checked( $option, $enabled, false ) . '/>&nbsp;';
648
- echo '<label for="quads_settings[' . $args['id'] . '][' . $key . ']">' . $option . '</label><br/>';
649
- endforeach;
650
- echo '<p class="description quads_hidden">' . $args['desc'] . '</p>';
651
- }
652
  }
653
 
654
  /**
@@ -662,21 +686,21 @@ function quads_multicheck_callback( $args ) {
662
  * @return void
663
  */
664
  function quads_radio_callback( $args ) {
665
- global $quads_options;
666
 
667
- foreach ( $args['options'] as $key => $option ) :
668
- $checked = false;
669
 
670
- if( isset( $quads_options[$args['id']] ) && $quads_options[$args['id']] == $key )
671
- $checked = true;
672
- elseif( isset( $args['std'] ) && $args['std'] == $key && !isset( $quads_options[$args['id']] ) )
673
- $checked = true;
674
 
675
- echo '<input name="quads_settings[' . $args['id'] . ']"" id="quads_settings[' . $args['id'] . '][' . $key . ']" type="radio" value="' . $key . '" ' . checked( true, $checked, false ) . '/>&nbsp;';
676
- echo '<label for="quads_settings[' . $args['id'] . '][' . $key . ']">' . $option . '</label><br/>';
677
- endforeach;
678
 
679
- echo '<p class="description quads_hidden">' . $args['desc'] . '</p>';
680
  }
681
 
682
  /**
@@ -692,21 +716,21 @@ function quads_radio_callback( $args ) {
692
  * @return void
693
  */
694
  function quads_adtype_callback( $id, $args ) {
695
- global $quads_options;
696
 
697
- foreach ( $args['options'] as $key => $option ) :
698
- $checked = false;
699
 
700
- if( isset( $quads_options[$id]['ad_type'] ) && $quads_options[$id]['ad_type'] == $key )
701
- $checked = true;
702
- elseif( isset( $args['std'] ) && $args['std'] == $key && !isset( $quads_options[$id]['ad_type'] ) )
703
- $checked = true;
704
 
705
- echo '<input name="quads_settings[' . $id . '][ad_type]" class="quads_adsense_type" id="quads_settings[' . $id . '][ad_type_'.$key.']" type="radio" value="' . $key . '" ' . checked( true, $checked, false ) . '/>&nbsp;';
706
- echo '<label for="quads_settings[' . $id . '][ad_type_'.$key.']">' . $option . '</label>&nbsp;';
707
- endforeach;
708
 
709
- echo '<p class="description quads_hidden">' . $args['desc'] . '</p>';
710
  }
711
 
712
  /**
@@ -722,25 +746,25 @@ function quads_adtype_callback( $id, $args ) {
722
  * @return void
723
  */
724
  function quads_adposition_callback( $id, $args ) {
725
- global $quads_options;
726
-
727
- foreach ( $args['options'] as $key => $option ) :
728
- $checked = false;
729
-
730
- if( isset( $quads_options[$id]['align'] ) && $quads_options[$id]['align'] == $key )
731
- $checked = true;
732
- elseif( isset( $args['std'] ) && $args['std'] == $key && !isset( $quads_options[$id]['align'] ) )
733
- $checked = true;
734
-
735
- if ($key == '3'){
736
- echo '<input name="quads_settings[' . $id . '][align]" class="quads_adsense_align" id="quads_settings[' . $id . '][align_'.$key.']" type="radio" value="' . $key . '" ' . checked( true, $checked, false ) . '/>&nbsp;';
737
- echo '<label for="quads_settings[' . $id . '][align_'.$key.']">Default</label>&nbsp;';
738
- } else {
739
- echo '<input name="quads_settings[' . $id . '][align]" class="quads_adsense_positon" id="quads_settings[' . $id . '][align_'.$key.']" type="radio" value="' . $key . '" ' . checked( true, $checked, false ) . '/>&nbsp;';
740
- echo '<label for="quads_settings[' . $id . '][align_'.$key.']"><img src="'.QUADS_PLUGIN_URL.'assets/images/align_'.$key.'.png" width="75" height="56"></label>&nbsp;';
741
- }
742
-
743
- endforeach;
744
  }
745
 
746
  /**
@@ -753,19 +777,19 @@ function quads_adposition_callback( $id, $args ) {
753
  * @global $quads_options Array of all the QUADS Options
754
  * @return void
755
  */
756
- function quads_gateways_callback( $args ) {
757
- global $quads_options;
758
-
759
- foreach ( $args['options'] as $key => $option ) :
760
- if( isset( $quads_options['gateways'][$key] ) )
761
- $enabled = '1';
762
- else
763
- $enabled = null;
764
-
765
- echo '<input name="quads_settings[' . $args['id'] . '][' . $key . ']"" id="quads_settings[' . $args['id'] . '][' . $key . ']" type="checkbox" value="1" ' . checked( '1', $enabled, false ) . '/>&nbsp;';
766
- echo '<label for="quads_settings[' . $args['id'] . '][' . $key . ']">' . $option['admin_label'] . '</label><br/>';
767
- endforeach;
768
- }
769
 
770
  /**
771
  * Text Callback
@@ -778,18 +802,18 @@ function quads_gateways_callback( $args ) {
778
  * @return void
779
  */
780
  function quads_text_callback( $args ) {
781
- global $quads_options;
782
 
783
- if( isset( $quads_options[$args['id']] ) )
784
- $value = $quads_options[$args['id']];
785
- else
786
- $value = isset( $args['std'] ) ? $args['std'] : '';
787
 
788
- $size = ( isset( $args['size'] ) && !is_null( $args['size'] ) ) ? $args['size'] : 'regular';
789
- $html = '<input type="text" class="' . $size . '-text" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']" value="' . esc_attr( stripslashes( $value ) ) . '"/>';
790
- $html .= '<label class="quads_hidden" class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
791
 
792
- echo $html;
793
  }
794
 
795
  /**
@@ -803,22 +827,22 @@ function quads_text_callback( $args ) {
803
  * @return void
804
  */
805
  function quads_number_callback( $args ) {
806
- global $quads_options;
807
 
808
- if( isset( $quads_options[$args['id']] ) )
809
- $value = $quads_options[$args['id']];
810
- else
811
- $value = isset( $args['std'] ) ? $args['std'] : '';
812
 
813
- $max = isset( $args['max'] ) ? $args['max'] : 999999;
814
- $min = isset( $args['min'] ) ? $args['min'] : 0;
815
- $step = isset( $args['step'] ) ? $args['step'] : 1;
816
 
817
- $size = ( isset( $args['size'] ) && !is_null( $args['size'] ) ) ? $args['size'] : 'regular';
818
- $html = '<input type="number" step="' . esc_attr( $step ) . '" max="' . esc_attr( $max ) . '" min="' . esc_attr( $min ) . '" class="' . $size . '-text" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']" value="' . esc_attr( stripslashes( $value ) ) . '"/>';
819
- $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
820
 
821
- echo $html;
822
  }
823
 
824
  /**
@@ -832,21 +856,20 @@ function quads_number_callback( $args ) {
832
  * @return void
833
  */
834
  function quads_textarea_callback( $args ) {
835
- global $quads_options;
836
 
837
- if( isset( $quads_options[$args['id']] ) )
838
- $value = $quads_options[$args['id']];
839
- else
840
- $value = isset( $args['std'] ) ? $args['std'] : '';
841
 
842
- $size = ( isset( $args['size'] ) && !is_null( $args['size'] ) ) ? $args['size'] : '40';
843
- $html = '<textarea class="large-text quads-textarea" cols="50" rows="' . $size . '" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']">' . esc_textarea( stripslashes( $value ) ) . '</textarea>';
844
- $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
845
 
846
- echo $html;
847
  }
848
 
849
-
850
  /**
851
  * Password Callback
852
  *
@@ -858,18 +881,18 @@ function quads_textarea_callback( $args ) {
858
  * @return void
859
  */
860
  function quads_password_callback( $args ) {
861
- global $quads_options;
862
 
863
- if( isset( $quads_options[$args['id']] ) )
864
- $value = $quads_options[$args['id']];
865
- else
866
- $value = isset( $args['std'] ) ? $args['std'] : '';
867
 
868
- $size = ( isset( $args['size'] ) && !is_null( $args['size'] ) ) ? $args['size'] : 'regular';
869
- $html = '<input type="password" class="' . $size . '-text" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']" value="' . esc_attr( $value ) . '"/>';
870
- $html .= '<label for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
871
 
872
- echo $html;
873
  }
874
 
875
  /**
@@ -882,7 +905,7 @@ function quads_password_callback( $args ) {
882
  * @return void
883
  */
884
  function quads_missing_callback( $args ) {
885
- printf( __( 'The callback function used for the <strong>%s</strong> setting is missing.', 'quick-adsense-reloaded' ), $args['id'] );
886
  }
887
 
888
  /**
@@ -896,26 +919,27 @@ function quads_missing_callback( $args ) {
896
  * @return void
897
  */
898
  function quads_select_callback( $args ) {
899
- global $quads_options;
900
 
901
- if( isset( $quads_options[$args['id']] ) )
902
- $value = $quads_options[$args['id']];
903
- else
904
- $value = isset( $args['std'] ) ? $args['std'] : '';
905
 
906
- $html = '<select id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']"/>';
907
 
908
- foreach ( $args['options'] as $option => $name ) :
909
- $selected = selected( $option, $value, false );
910
- $html .= '<option value="' . $option . '" ' . $selected . '>' . $name . '</option>';
911
- endforeach;
912
 
913
- $html .= '</select>';
914
- $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
915
- $html .= '<br>' . $args['desc2'];
916
 
917
- echo $html;
918
  }
 
919
  /**
920
  * AdSense Type Select Callback
921
  *
@@ -928,25 +952,26 @@ function quads_select_callback( $args ) {
928
  * @return void
929
  */
930
  function quads_adense_select_callback( $id, $args ) {
931
- global $quads_options;
932
-
933
- if( isset( $quads_options[$id][$args['id']] ) )
934
- $value = $quads_options[$id][$args['id']];
935
- else
936
- $value = isset( $args['std'] ) ? $args['std'] : '';
937
-
938
- $size = !empty($args['size']) ? $args['size'] : 'quads-medium-size';
939
-
940
- $html = '<label class="quads_hidden" id="quads-label-'.$args['desc'].'" for="quads_settings[' . $id . '][' . $args['id'] . ']"> ' . $args['desc'] . ' </label>';
941
- $html .= ' <select class="quads-select-'.$args['desc'].' '.$size. '" id="quads_settings[' . $id . '][' . $args['id'] . ']" name="quads_settings[' . $id . '][' . $args['id'] . ']"/>';
942
-
943
- foreach ( $args['options'] as $option => $name ) :
944
- $selected = selected( $option, $value, false );
945
- $html .= '<option value="' . $option . '" ' . $selected . '>' . $name . '</option>';
946
- endforeach;
947
-
948
- $html .= '</select>';
949
- echo $html;
 
950
  }
951
 
952
  /**
@@ -960,19 +985,19 @@ function quads_adense_select_callback( $id, $args ) {
960
  * @return void
961
  */
962
  function quads_color_select_callback( $args ) {
963
- global $quads_options;
964
 
965
- if( isset( $quads_options[$args['id']] ) )
966
- $value = $quads_options[$args['id']];
967
- else
968
- $value = isset( $args['std'] ) ? $args['std'] : '';
969
 
970
- $html = '<strong>#:</strong><input type="text" style="max-width:80px;border:1px solid #' . esc_attr( stripslashes( $value ) ) . ';border-right:20px solid #' . esc_attr( stripslashes( $value ) ) . ';" id="quads_settings[' . $args['id'] . ']" class="medium-text ' . $args['id'] . '" name="quads_settings[' . $args['id'] . ']" value="' . esc_attr( stripslashes( $value ) ) . '"/>';
971
 
972
- $html .= '</select>';
973
- $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
974
 
975
- echo $html;
976
  }
977
 
978
  /**
@@ -986,23 +1011,23 @@ function quads_color_select_callback( $args ) {
986
  * @global $wp_version WordPress Version
987
  */
988
  function quads_rich_editor_callback( $args ) {
989
- global $quads_options, $wp_version;
990
- if( isset( $quads_options[$args['id']] ) )
991
- $value = $quads_options[$args['id']];
992
- else
993
- $value = isset( $args['std'] ) ? $args['std'] : '';
994
-
995
- if( $wp_version >= 3.3 && function_exists( 'wp_editor' ) ) {
996
- ob_start();
997
- wp_editor( stripslashes( $value ), 'quads_settings_' . $args['id'], array('textarea_name' => 'quads_settings[' . $args['id'] . ']', 'textarea_rows' => $args['textarea_rows']) );
998
- $html = ob_get_clean();
999
- } else {
1000
- $html = '<textarea class="large-text quads-richeditor" rows="10" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']">' . esc_textarea( stripslashes( $value ) ) . '</textarea>';
1001
- }
1002
-
1003
- $html .= '<br/><label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1004
-
1005
- echo $html;
1006
  }
1007
 
1008
  /**
@@ -1016,19 +1041,32 @@ function quads_rich_editor_callback( $args ) {
1016
  * @return void
1017
  */
1018
  function quads_upload_callback( $args ) {
1019
- global $quads_options;
 
 
 
 
 
1020
 
1021
- if( isset( $quads_options[$args['id']] ) )
1022
- $value = $quads_options[$args['id']];
1023
- else
1024
- $value = isset( $args['std'] ) ? $args['std'] : '';
 
 
 
1025
 
1026
- $size = ( isset( $args['size'] ) && !is_null( $args['size'] ) ) ? $args['size'] : 'regular';
1027
- $html = '<input type="text" class="' . $size . '-text quads_upload_field" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']" value="' . esc_attr( stripslashes( $value ) ) . '"/>';
1028
- $html .= '<span>&nbsp;<input type="button" class="quads_settings_upload_button button-secondary" value="' . __( 'Upload File', 'quick-adsense-reloaded' ) . '"/></span>';
1029
- $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1030
 
1031
- echo $html;
 
 
 
 
 
 
 
 
 
1032
  }
1033
 
1034
  /**
@@ -1042,20 +1080,20 @@ function quads_upload_callback( $args ) {
1042
  * @return void
1043
  */
1044
  function quads_color_callback( $args ) {
1045
- global $quads_options;
1046
 
1047
- if( isset( $quads_options[$args['id']] ) )
1048
- $value = $quads_options[$args['id']];
1049
- else
1050
- $value = isset( $args['std'] ) ? $args['std'] : '';
1051
 
1052
- $default = isset( $args['std'] ) ? $args['std'] : '';
1053
 
1054
- $size = ( isset( $args['size'] ) && !is_null( $args['size'] ) ) ? $args['size'] : 'regular';
1055
- $html = '<input type="text" class="quads-color-picker" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']" value="' . esc_attr( $value ) . '" data-default-color="' . esc_attr( $default ) . '" />';
1056
- $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1057
 
1058
- echo $html;
1059
  }
1060
 
1061
  /**
@@ -1068,146 +1106,146 @@ function quads_color_callback( $args ) {
1068
  */
1069
  if( !function_exists( 'quads_license_key_callback' ) ) {
1070
 
1071
- function quads_license_key_callback( $args ) {
1072
- global $quads_options;
1073
 
1074
- $class = '';
1075
 
1076
- $messages = array();
1077
- $license = get_option( $args['options']['is_valid_license_option'] );
1078
 
1079
 
1080
- if( isset( $quads_options[$args['id']] ) ) {
1081
- $value = $quads_options[$args['id']];
1082
- } else {
1083
- $value = isset( $args['std'] ) ? $args['std'] : '';
1084
- }
1085
 
1086
- if( !empty( $license ) && is_object( $license ) ) {
1087
 
1088
- // activate_license 'invalid' on anything other than valid, so if there was an error capture it
1089
- if( false === $license->success ) {
1090
 
1091
- switch ( $license->error ) {
1092
 
1093
- case 'expired' :
1094
 
1095
- $class = 'error';
1096
- $messages[] = sprintf(
1097
- __( 'Your license key expired on %s. Please <a href="%s" target="_blank" title="Renew your license key">renew your license key</a>.', 'quick-adsense-reloaded' ), date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ), 'http://wpquads.com/checkout/?edd_license_key=' . $value . '&utm_campaign=notice&utm_source=license_tab&utm_medium=admin&utm_content=license-expired'
1098
- );
1099
 
1100
- $license_status = 'quads-license-' . $class . '-notice';
1101
 
1102
- break;
1103
 
1104
- case 'missing' :
1105
 
1106
- $class = 'error';
1107
- $messages[] = sprintf(
1108
- __( 'Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'quick-adsense-reloaded' ), 'http://wpquads.com/your-account?utm_source=licenses-tab&utm_medium=admin&utm_content=invalid-license&utm_campaign=notice'
1109
- );
1110
 
1111
- $license_status = 'quads-license-' . $class . '-notice';
1112
 
1113
- break;
1114
 
1115
- case 'invalid' :
1116
- case 'site_inactive' :
1117
 
1118
- $class = 'error';
1119
- $messages[] = sprintf(
1120
- __( 'Your %s is not active for this URL. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'quick-adsense-reloaded' ), $args['name'], 'http://wpquads.com/your-account?utm_campaign=notice&utm_source=licenses-tab&utm_medium=admin&utm_content=invalid-license'
1121
- );
1122
 
1123
- $license_status = 'quads-license-' . $class . '-notice';
1124
 
1125
- break;
1126
 
1127
- case 'item_name_mismatch' :
1128
 
1129
- $class = 'error';
1130
- $messages[] = sprintf( __( 'This is not a %s.', 'quick-adsense-reloaded' ), $args['name'] );
1131
 
1132
- $license_status = 'quads-license-' . $class . '-notice';
1133
 
1134
- break;
1135
 
1136
- case 'no_activations_left':
1137
 
1138
- $class = 'error';
1139
- $messages[] = sprintf( __( 'Your license key has reached its activation limit. <a href="%s" target="_blank">View possible upgrades</a> now.', 'quick-adsense-reloaded' ), 'http://wpquads.com/your-account?utm_campaign=notice&utm_source=licenses-tab&utm_medium=admin&utm_content=invalid-license' );
1140
 
1141
- $license_status = 'quads-license-' . $class . '-notice';
1142
 
1143
- break;
1144
- }
1145
- } else {
1146
 
1147
- switch ( $license->license ) {
1148
 
1149
- case 'valid' :
1150
- default:
1151
 
1152
- $class = 'valid';
1153
 
1154
- $now = current_time( 'timestamp' );
1155
- $expiration = strtotime( $license->expires, current_time( 'timestamp' ) );
1156
 
1157
- if( 'lifetime' === $license->expires ) {
1158
 
1159
- $messages[] = __( 'License key never expires.', 'quick-adsense-reloaded' );
1160
 
1161
- $license_status = 'quads-license-lifetime-notice';
1162
- } elseif( $expiration > $now && $expiration - $now < ( DAY_IN_SECONDS * 30 ) ) {
1163
 
1164
- $messages[] = sprintf(
1165
- __( 'Your license key expires soon! It expires on %s. <a href="%s" target="_blank" title="Renew license">Renew your license key</a>.', 'quick-adsense-reloaded' ), date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ), 'http://wpquads.com/checkout/?edd_license_key=' . $value . '&utm_campaign=notice&utm_source=licenses-tab&utm_medium=admin'
1166
- );
1167
 
1168
- $license_status = 'quads-license-expires-soon-notice';
1169
- } else {
1170
 
1171
- $messages[] = sprintf(
1172
- __( 'Your license key expires on %s.', 'quick-adsense-reloaded' ), date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) )
1173
- );
1174
 
1175
- $license_status = 'quads-license-expiration-date-notice';
1176
- }
1177
 
1178
- break;
1179
- }
1180
  }
1181
- } else {
1182
- $license_status = null;
1183
- }
 
1184
 
1185
- $size = ( isset( $args['size'] ) && !is_null( $args['size'] ) ) ? $args['size'] : 'regular';
1186
- $html = '<input type="text" class="' . sanitize_html_class( $size ) . '-text" id="quads_settings[' . quads_sanitize_key( $args['id'] ) . ']" name="quads_settings[' . quads_sanitize_key( $args['id'] ) . ']" value="' . esc_attr( $value ) . '"/>';
1187
 
1188
- if( ( is_object( $license ) && 'valid' == $license->license ) || 'valid' == $license ) {
1189
- $html .= '<input type="submit" class="button-secondary" name="' . $args['id'] . '_deactivate" value="' . __( 'Deactivate License', 'quick-adsense-reloaded' ) . '"/>';
1190
- }
1191
 
1192
- $html .= '<label for="quads_settings[' . quads_sanitize_key( $args['id'] ) . ']"> ' . wp_kses_post( $args['desc'] ) . '</label>';
1193
 
1194
- if( !empty( $messages ) ) {
1195
- foreach ( $messages as $message ) {
1196
 
1197
- $html .= '<div class="quads-license-data quads-license-' . $class . '">';
1198
- $html .= '<p>' . $message . '</p>';
1199
- $html .= '</div>';
1200
- }
1201
- }
1202
 
1203
- wp_nonce_field( quads_sanitize_key( $args['id'] ) . '-nonce', quads_sanitize_key( $args['id'] ) . '-nonce' );
1204
 
1205
- if( isset( $license_status ) ) {
1206
- echo '<div class="' . $license_status . '">' . $html . '</div>';
1207
- } else {
1208
- echo '<div class="quads-license-null">' . $html . '</div>';
1209
- }
1210
- }
1211
 
1212
  }
1213
 
@@ -1219,8 +1257,8 @@ if( !function_exists( 'quads_license_key_callback' ) ) {
1219
  * @return html
1220
  */
1221
  function quads_addons_callback( $args ) {
1222
- $html = quads_add_ons_page();
1223
- echo $html;
1224
  }
1225
 
1226
  /**
@@ -1231,9 +1269,9 @@ function quads_addons_callback( $args ) {
1231
  * @return html
1232
  */
1233
  function quads_imexport_callback( $args ) {
1234
- $html = quads_tools_import_export_display();
1235
- $html .= quads_import_quick_adsense_settings();
1236
- echo $html;
1237
  }
1238
 
1239
  /**
@@ -1244,8 +1282,8 @@ function quads_imexport_callback( $args ) {
1244
  * @return html
1245
  */
1246
  function quads_systeminfo_callback( $args ) {
1247
- $html = quads_tools_sysinfo_display();
1248
- echo $html;
1249
  }
1250
 
1251
  /**
@@ -1257,53 +1295,23 @@ function quads_systeminfo_callback( $args ) {
1257
  * @return void
1258
  */
1259
  function quads_upload_image_callback( $args ) {
1260
- global $quads_options;
1261
 
1262
- if( isset( $quads_options[$args['id']] ) )
1263
- $value = $quads_options[$args['id']];
1264
- else
1265
- $value = isset( $args['std'] ) ? $args['std'] : '';
1266
 
1267
- $size = ( isset( $args['size'] ) && !is_null( $args['size'] ) ) ? $args['size'] : 'regular';
1268
- $html = '<input type="text" class="' . $size . '-text ' . $args['id'] . '" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']" value="' . esc_attr( $value ) . '"/>';
1269
 
1270
- $html .= '<input type="submit" class="button-secondary quads_upload_image" name="' . $args['id'] . '_upload" value="' . __( 'Select Image', 'quick-adsense-reloaded' ) . '"/>';
1271
 
1272
- $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1273
 
1274
- echo $html;
1275
  }
1276
 
1277
- /*
1278
- * Post Types Callback
1279
- *
1280
- * Adds a multiple choice drop box
1281
- * for selecting where WPQUADS should be enabled
1282
- *
1283
- * @since 2.0.9
1284
- * @param array $args Arguments passed by the setting
1285
- * @return void
1286
- *
1287
- */
1288
-
1289
- //function quads_posttypes_callback( $args ) {
1290
- // global $quads_options;
1291
- // $posttypes = get_post_types();
1292
- //
1293
- // if( !empty( $posttypes ) ) {
1294
- // foreach ( $posttypes as $key => $option ):
1295
- // if( isset( $quads_options[$args['id']][$key] ) ) {
1296
- // $enabled = $option;
1297
- // } else {
1298
- // $enabled = NULL;
1299
- // }
1300
- // echo '<input name="quads_settings[' . $args['id'] . '][' . $key . ']" id="quads_settings[' . $args['id'] . '][' . $key . ']" type="checkbox" value="' . $option . '" ' . checked( $option, $enabled, false ) . '/>&nbsp;';
1301
- // echo '<label for="quads_settings[' . $args['id'] . '][' . $key . ']">' . $option . '</label><br/>';
1302
- // endforeach;
1303
- // echo '<p class="description quads_hidden">' . $args['desc'] . '</p>';
1304
- // }
1305
- //}
1306
-
1307
  /*
1308
  * Note Callback
1309
  *
@@ -1316,10 +1324,9 @@ function quads_upload_image_callback( $args ) {
1316
  */
1317
 
1318
  function quads_note_callback( $args ) {
1319
- global $quads_options;
1320
- //$html = !empty($args['desc']) ? $args['desc'] : '';
1321
- $html = '';
1322
- echo $html;
1323
  }
1324
 
1325
  /**
@@ -1331,22 +1338,22 @@ function quads_note_callback( $args ) {
1331
  * @scince 2.3.2
1332
  */
1333
  function quads_add_content_callback( $args ) {
1334
- global $quads_options;
1335
-
1336
- $html = '<div id="quadstabcontainer" class="tabcontent_container"><ul class="quadstabs" style="width:99%;max-width:500px;">';
1337
- foreach ( $args['options'] as $option => $name ) :
1338
- $html .= '<li class="quadstab" style="float:left;margin-right:4px;"><a href="#' . $name['id'] . '">' . $name['name'] . '</a></li>';
1339
- endforeach;
1340
- $html .= '</ul>';
1341
- $html .= '<div class="quadstab-container">';
1342
- foreach ( $args['options'] as $option => $name ) :
1343
- $value = isset( $quads_options[$name['id']] ) ? $quads_options[$name['id']] : '';
1344
- $textarea = '<textarea class="large-text quads-textarea" cols="50" rows="15" id="quads_settings[' . $name['id'] . ']" name="quads_settings[' . $name['id'] . ']">' . esc_textarea( stripslashes( $value ) ) . '</textarea>';
1345
- $html .= '<div id="' . $name['id'] . '" style="max-width:500px;"><span style="padding-top:60px;display:block;">' . $name['desc'] . ':</span><br>' . $textarea . '</div>';
1346
- endforeach;
1347
- $html .= '</div>';
1348
- $html .= '</div>';
1349
- echo $html;
1350
  }
1351
 
1352
  /**
@@ -1359,7 +1366,7 @@ function quads_add_content_callback( $args ) {
1359
  * @return void
1360
  */
1361
  function quads_hook_callback( $args ) {
1362
- do_action( 'quads_' . $args['id'] );
1363
  }
1364
 
1365
  /**
@@ -1369,7 +1376,7 @@ function quads_hook_callback( $args ) {
1369
  * @return string capability required
1370
  */
1371
  function quads_set_settings_cap() {
1372
- return 'manage_options';
1373
  }
1374
 
1375
  add_filter( 'option_page_capability_quads_settings', 'quads_set_settings_cap' );
@@ -1384,10 +1391,10 @@ add_filter( 'option_page_capability_quads_settings', 'quads_set_settings_cap' );
1384
  */
1385
 
1386
  function quads_cache_status() {
1387
- global $quads_options;
1388
- if( isset( $quads_options['disable_cache'] ) ) {
1389
- return ' <strong style="color:red;">' . __( 'Transient Cache disabled! Enable it for performance increase.', 'quick-adsense-reloaded' ) . '</strong> ';
1390
- }
1391
  }
1392
 
1393
  /* Permission check if logfile is writable
@@ -1397,10 +1404,10 @@ function quads_cache_status() {
1397
  */
1398
 
1399
  function quads_log_permissions() {
1400
- global $quads_options;
1401
- if( !$quads->logger->checkDir() ) {
1402
- return '<br><strong style="color:red;">' . __( 'Log file directory not writable! Set FTP permission to 755 or 777 for /wp-content/plugins/quadssharer/logs/', 'quick-adsense-reloaded' ) . '</strong> <br> Read here more about <a href="http://codex.wordpress.org/Changing_File_Permissions" target="_blank">file permissions</a> ';
1403
- }
1404
  }
1405
 
1406
  /**
@@ -1410,23 +1417,47 @@ function quads_log_permissions() {
1410
  * @return array
1411
  */
1412
  function quads_get_ads() {
1413
- global $quads_options;
1414
-
1415
-
1416
- $ads = array(
1417
- 0 => __( 'Random Ads', 'quick-adsense-reloaded' ),
1418
- 1 => isset( $quads_options['ad1']['label'] ) ? $quads_options['ad1']['label'] : 'ad1',
1419
- 2 => isset( $quads_options['ad2']['label'] ) ? $quads_options['ad2']['label'] : 'ad2',
1420
- 3 => isset( $quads_options['ad3']['label'] ) ? $quads_options['ad3']['label'] : 'ad3',
1421
- 4 => isset( $quads_options['ad4']['label'] ) ? $quads_options['ad4']['label'] : 'ad4',
1422
- 5 => isset( $quads_options['ad5']['label'] ) ? $quads_options['ad5']['label'] : 'ad5',
1423
- 6 => isset( $quads_options['ad6']['label'] ) ? $quads_options['ad6']['label'] : 'ad6',
1424
- 7 => isset( $quads_options['ad7']['label'] ) ? $quads_options['ad7']['label'] : 'ad7',
1425
- 8 => isset( $quads_options['ad8']['label'] ) ? $quads_options['ad8']['label'] : 'ad8',
1426
- 9 => isset( $quads_options['ad9']['label'] ) ? $quads_options['ad9']['label'] : 'ad9',
1427
- 10 => isset( $quads_options['ad10']['label'] ) ? $quads_options['ad10']['label'] : 'ad10',
1428
- );
1429
- return $ads;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1430
  }
1431
 
1432
  /**
@@ -1437,12 +1468,12 @@ function quads_get_ads() {
1437
  */
1438
  function quads_get_values() {
1439
 
1440
- $array = array(1);
1441
- for ( $i = 1; $i <= 50; $i++ ) {
1442
- $array[] = $i;
1443
- }
1444
- unset( $array[0] ); // remove the 0 and start the array with 1
1445
- return $array;
1446
  }
1447
 
1448
  /**
@@ -1456,21 +1487,16 @@ function quads_get_values() {
1456
  * @return void
1457
  */
1458
  function quads_visibility_callback( $args ) {
1459
- global $quads_options, $quads;
1460
-
1461
- // Posts & Pages
1462
- //$html = $quads->html->checkbox( array('name' => 'quads_settings[visibility][AppPost]', 'current' => !empty( $quads_options['visibility']['AppPost'] ) ? $quads_options['visibility']['AppPost'] : null, 'class' => 'quads-checkbox') );
1463
- //$html .= __( 'Posts ', 'quick-adsense-reloaded' );
1464
- //$html .= $quads->html->checkbox( array('name' => 'quads_settings[visibility][AppPage]', 'current' => !empty( $quads_options['visibility']['AppPage'] ) ? $quads_options['visibility']['AppPage'] : null, 'class' => 'quads-checkbox') );
1465
- //$html .= ' ' . __( 'Pages', 'quick-adsense-reloaded' ) . '<br>';
1466
- $html = $quads->html->checkbox( array('name' => 'quads_settings[visibility][AppHome]', 'current' => !empty( $quads_options['visibility']['AppHome'] ) ? $quads_options['visibility']['AppHome'] : null, 'class' => 'quads-checkbox') ) . __( 'Homepage ', 'quick-adsense-reloaded' );
1467
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[visibility][AppCate]', 'current' => !empty( $quads_options['visibility']['AppCate'] ) ? $quads_options['visibility']['AppCate'] : null, 'class' => 'quads-checkbox') ) . __( 'Categories ', 'quick-adsense-reloaded' );
1468
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[visibility][AppArch]', 'current' => !empty( $quads_options['visibility']['AppArch'] ) ? $quads_options['visibility']['AppArch'] : null, 'class' => 'quads-checkbox') ) . __( 'Archives ', 'quick-adsense-reloaded' );
1469
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[visibility][AppTags]', 'current' => !empty( $quads_options['visibility']['AppTags'] ) ? $quads_options['visibility']['AppTags'] : null, 'class' => 'quads-checkbox') ) . __( 'Tags', 'quick-adsense-reloaded' ) . '<br>';
1470
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[visibility][AppSide]', 'current' => !empty( $quads_options['visibility']['AppSide'] ) ? $quads_options['visibility']['AppSide'] : null, 'class' => 'quads-checkbox') ) . __( 'Hide AdsWidget on Homepage', 'quick-adsense-reloaded' ) . '<br>';
1471
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[visibility][AppLogg]', 'current' => !empty( $quads_options['visibility']['AppLogg'] ) ? $quads_options['visibility']['AppLogg'] : null, 'class' => 'quads-checkbox') ) . __( 'Hide Ads when user is logged in.', 'quick-adsense-reloaded' ) . '<br>';
1472
-
1473
- echo $html;
1474
  }
1475
 
1476
  /**
@@ -1484,82 +1510,82 @@ function quads_visibility_callback( $args ) {
1484
  * @return void
1485
  */
1486
  function quads_ad_position_callback( $args ) {
1487
- global $quads_options, $quads;
1488
-
1489
-
1490
- // Pos 1
1491
- $html = $quads->html->checkbox( array('name' => 'quads_settings[pos1][BegnAds]','current' => !empty( $quads_options['pos1']['BegnAds'] ) ? $quads_options['pos1']['BegnAds'] : null, 'class' => 'quads-checkbox quads-assign') );
1492
- $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1493
- $html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos1][BegnRnd]', 'name' => 'quads_settings[pos1][BegnRnd]', 'selected' => !empty( $quads_options['pos1']['BegnRnd'] ) ? $quads_options['pos1']['BegnRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1494
- $html .= ' ' . __( 'to <strong>Beginning of Post</strong>', 'quick-adsense-reloaded' ) . '</br>';
1495
-
1496
- // Pos 2
1497
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos2][MiddAds]', 'current' => !empty( $quads_options['pos2']['MiddAds'] ) ? $quads_options['pos2']['MiddAds'] : null, 'class' => 'quads-checkbox quads-assign') );
1498
- $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1499
- $html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos2][MiddRnd]', 'name' => 'quads_settings[pos2][MiddRnd]', 'selected' => !empty( $quads_options['pos2']['MiddRnd'] ) ? $quads_options['pos2']['MiddRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1500
- $html .= ' ' . __( 'to <strong>Middle of Post</strong>', 'quick-adsense-reloaded' ) . '</br>';
1501
-
1502
- // Pos 3
1503
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos3][EndiAds]', 'current' => !empty( $quads_options['pos3']['EndiAds'] ) ? $quads_options['pos3']['EndiAds'] : null, 'class' => 'quads-checkbox quads-assign') );
1504
- $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1505
- $html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos3][EndiRnd]', 'name' => 'quads_settings[pos3][EndiRnd]', 'selected' => !empty( $quads_options['pos3']['EndiRnd'] ) ? $quads_options['pos3']['EndiRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1506
- $html .= ' ' . __( 'to <strong>End of Post</strong>', 'quick-adsense-reloaded' ) . '</br>';
1507
-
1508
- // Pos 4
1509
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos4][MoreAds]', 'current' => !empty( $quads_options['pos4']['MoreAds'] ) ? $quads_options['pos4']['MoreAds'] : null, 'class' => 'quads-checkbox quads-assign') );
1510
- $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1511
- $html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos4][MoreRnd]', 'name' => 'quads_settings[pos4][MoreRnd]', 'selected' => !empty( $quads_options['pos4']['MoreRnd'] ) ? $quads_options['pos4']['MoreRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1512
- $html .= ' ' . __( 'right after <strong>the <span style="font-family:Courier New,Courier,Fixed;">&lt;!--more--&gt;</span> tag</strong>', 'quick-adsense-reloaded' ) . '</br>';
1513
-
1514
- // Pos 5
1515
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos5][LapaAds]', 'current' => !empty( $quads_options['pos5']['LapaAds'] ) ? $quads_options['pos5']['LapaAds'] : null, 'class' => 'quads-checkbox quads-assign') );
1516
- $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1517
- $html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos5][LapaRnd]', 'name' => 'quads_settings[pos5][LapaRnd]', 'selected' => !empty( $quads_options['pos5']['LapaRnd'] ) ? $quads_options['pos5']['LapaRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1518
- $html .= ' ' . __( 'right before <strong>the last Paragraph</strong>', 'quick-adsense-reloaded' ) . ' </br>';
1519
-
1520
- // Pos 6
1521
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos6][Par1Ads]', 'current' => !empty( $quads_options['pos6']['Par1Ads'] ) ? $quads_options['pos6']['Par1Ads'] : null, 'class' => 'quads-checkbox quads-assign') );
1522
- $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1523
- $html .= $quads->html->select( array('options' => quads_get_ads(),'id' => 'quads_settings[pos6][Par1Rnd]', 'name' => 'quads_settings[pos6][Par1Rnd]', 'selected' => !empty( $quads_options['pos6']['Par1Rnd'] ) ? $quads_options['pos6']['Par1Rnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1524
- $html .= ' ' . __( '<strong>After Paragraph</strong>', 'quick-adsense-reloaded' ) . ' ';
1525
- $html .= $quads->html->select( array('options' => quads_get_values(), 'class' => 'quads-paragraph', 'id' => 'quads_settings[pos6][Par1Nup]', 'name' => 'quads_settings[pos6][Par1Nup]', 'selected' => !empty( $quads_options['pos6']['Par1Nup'] ) ? $quads_options['pos6']['Par1Nup'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1526
- $html .= ' ' . __( '→', 'quick-adsense-reloaded' ) . ' ';
1527
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos6][Par1Con]', 'current' => !empty( $quads_options['pos6']['Par1Con'] ) ? $quads_options['pos6']['Par1Con'] : null, 'class' => 'quads-checkbox quads-assign') );
1528
- $html .= ' ' . __( 'to <strong>End of Post</strong> if fewer paragraphs are found.', 'quick-adsense-reloaded' ) . ' </br>';
1529
-
1530
- // Pos 7
1531
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos7][Par2Ads]', 'current' => !empty( $quads_options['pos7']['Par2Ads'] ) ? $quads_options['pos7']['Par2Ads'] : null, 'class' => 'quads-checkbox quads-assign') );
1532
- $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1533
- $html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos7][Par2Rnd]', 'name' => 'quads_settings[pos7][Par2Rnd]', 'selected' => !empty( $quads_options['pos7']['Par2Rnd'] ) ? $quads_options['pos7']['Par2Rnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1534
- $html .= ' ' . __( '<strong>After Paragraph</strong>', 'quick-adsense-reloaded' ) . ' ';
1535
- $html .= $quads->html->select( array('options' => quads_get_values(), 'id' => 'quads_settings[pos7][Par2Nup]', 'name' => 'quads_settings[pos7][Par2Nup]', 'selected' => !empty( $quads_options['pos7']['Par2Nup'] ) ? $quads_options['pos7']['Par2Nup'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1536
- $html .= ' ' . __( '→', 'quick-adsense-reloaded' ) . ' ';
1537
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos7][Par2Con]', 'current' => !empty( $quads_options['pos7']['Par2Con'] ) ? $quads_options['pos7']['Par2Con'] : null, 'class' => 'quads-checkbox quads-assign') );
1538
- $html .= ' ' . __( 'to <strong>End of Post</strong> if fewer paragraphs are found.', 'quick-adsense-reloaded' ) . ' </br>';
1539
-
1540
- // Pos 8
1541
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos8][Par3Ads]', 'current' => !empty( $quads_options['pos8']['Par3Ads'] ) ? $quads_options['pos8']['Par3Ads'] : null, 'class' => 'quads-checkbox quads-assign') );
1542
- $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1543
- $html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos8][Par3Rnd]', 'name' => 'quads_settings[pos8][Par3Rnd]', 'selected' => !empty( $quads_options['pos8']['Par3Rnd'] ) ? $quads_options['pos8']['Par3Rnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1544
- $html .= ' ' . __( '<strong>After Paragraph</strong>', 'quick-adsense-reloaded' ) . ' ';
1545
- $html .= $quads->html->select( array('options' => quads_get_values(), 'id' => 'quads_settings[pos8][Par3Nup]', 'name' => 'quads_settings[pos8][Par3Nup]', 'selected' => !empty( $quads_options['pos8']['Par3Nup'] ) ? $quads_options['pos8']['Par3Nup'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1546
- $html .= ' ' . __( '→', 'quick-adsense-reloaded' ) . ' ';
1547
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos8][Par3Con]', 'current' => !empty( $quads_options['pos8']['Par3Con'] ) ? $quads_options['pos8']['Par3Con'] : null, 'class' => 'quads-checkbox quads-assign') );
1548
- $html .= ' ' . __( 'to <strong>End of Post</strong> if fewer paragraphs are found.', 'quick-adsense-reloaded' ) . ' </br>';
1549
-
1550
- $html .= apply_filters('quads_extra_paragraph', '');
1551
-
1552
- // Pos 9
1553
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos9][Img1Ads]', 'current' => !empty( $quads_options['pos9']['Img1Ads'] ) ? $quads_options['pos9']['Img1Ads'] : null, 'class' => 'quads-checkbox quads-assign') );
1554
- $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1555
- $html .= $quads->html->select( array('options' => quads_get_ads(), 'name' => 'quads_settings[pos9][Img1Rnd]', 'selected' => !empty( $quads_options['pos9']['Img1Rnd'] ) ? $quads_options['pos9']['Img1Rnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1556
- $html .= ' ' . __( '<strong>After Image</strong>', 'quick-adsense-reloaded' ) . ' ';
1557
- $html .= $quads->html->select( array('options' => quads_get_values(), 'id' => 'quads_settings[pos9][Img1Nup]', 'name' => 'quads_settings[pos9][Img1Nup]', 'selected' => !empty( $quads_options['pos9']['Img1Nup'] ) ? $quads_options['pos9']['Img1Nup'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1558
- $html .= ' ' . __( '→', 'quick-adsense-reloaded' ) . ' ';
1559
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos9][Img1Con]', 'current' => !empty( $quads_options['pos9']['Img1Con'] ) ? $quads_options['pos9']['Img1Con'] : null, 'class' => 'quads-checkbox quads-assign') );
1560
- $html .= ' ' . __( 'after <b>Image\'s outer</b><b><span style="font-family:Courier New,Courier,Fixed;"> &lt;div&gt; wp-caption</span></b> if any.', 'quick-adsense-reloaded' ) . ' </br>';
1561
-
1562
- echo apply_filters( 'quads_ad_position_callback', $html );
1563
  }
1564
 
1565
  /**
@@ -1573,138 +1599,140 @@ function quads_ad_position_callback( $args ) {
1573
  * @return void
1574
  */
1575
  function quads_quicktags_callback( $args ) {
1576
- global $quads_options, $quads;
1577
 
1578
- // Quicktags info
1579
- $html = '<div style="margin-bottom:5px;"><strong>Optional: </strong><a href="#" id="quads_insert_ads_action">' . __( ' Insert Ads into a post, on-the-fly', 'quick-adsense-reloaded' ) . '</a></br>' .
1580
- '<ol style="margin-top:5px;display:none;" id="quads_insert_ads_box">
1581
  <li>' . __( 'Insert <span class="quads-quote-docs">&lt;!--Ads1--&gt;</span>, <span class="quads-quote-docs">&lt;!--Ads2--&gt;</span>, etc. into a post to show the <b>Particular Ads</b> at specific location.', 'quick-adsense-reloaded' ) . '</li>
1582
  <li>' . __( 'Insert <span class="quads-quote-docs">&lt;!--RndAds--&gt;</span> into a post to show the <b>Random Ads</b> at specific location', 'quick-adsense-reloaded' ) . '</li>
1583
  </ol></div>';
1584
 
1585
- $html .= $quads->html->checkbox( array('name' => 'quads_settings[quicktags][QckTags]', 'current' => !empty( $quads_options['quicktags']['QckTags'] ) ? $quads_options['quicktags']['QckTags'] : null, 'class' => 'quads-checkbox') );
1586
- $html .= __( 'Show Quicktag Buttons on the HTML Post Editor', 'quick-adsense-reloaded' ) . '</br>';
1587
- $html .= '<span class="quads-desc">' . __( 'Tags can be inserted into a post via the additional Quicktag Buttons at the HTML Edit Post SubPanel.', 'quick-adsense-reloaded' ) . '</span>';
1588
- echo $html;
1589
  }
1590
 
1591
  /**
1592
- * AdSense Code Callback
1593
- *
1594
- * Renders adsense code fields
1595
- *
1596
- * @since 0.9.0
1597
- * @param array $args Arguments passed by the setting
1598
- * @global $quads_options Array of all the QUADS Options
1599
- * @return void
1600
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1601
 
1602
- function quads_adsense_code_callback( $args ) {
1603
- global $quads_options;
1604
-
1605
- $new_label = isset( $quads_options[$args['id']]['label'] ) ? $quads_options[$args['id']]['label'] : '';
1606
-
1607
- $label = !empty($new_label) ? $new_label : $args['name'];
1608
-
1609
- $code = isset( $quads_options[$args['id']]['code'] ) ? $quads_options[$args['id']]['code'] : '';
1610
-
1611
- $margin = isset( $quads_options[$args['id']]['margin'] ) ? esc_attr( stripslashes( $quads_options[$args['id']]['margin'] ) ) : 0;
1612
-
1613
- $g_data_ad_client = isset( $quads_options[$args['id']]['g_data_ad_client'] ) ? $quads_options[$args['id']]['g_data_ad_client'] : '';
1614
-
1615
- $g_data_ad_slot = isset( $quads_options[$args['id']]['g_data_ad_slot'] ) ? $quads_options[$args['id']]['g_data_ad_slot'] : '';
1616
-
1617
- $g_data_ad_width = isset( $quads_options[$args['id']]['g_data_ad_width'] ) ? $quads_options[$args['id']]['g_data_ad_width'] : '';
1618
-
1619
- $g_data_ad_height = isset( $quads_options[$args['id']]['g_data_ad_height'] ) ? $quads_options[$args['id']]['g_data_ad_height'] : '';
1620
-
1621
- //$label = !empty($new_label) ? $new_label :
1622
-
1623
- // Create a shorter var to make HTML cleaner
1624
- $id = $args['id'];
1625
- ?>
1626
- <div class="quads-ad-toggle-header quads-box-close" data-box-id="quads-toggle<?php echo $id; ?>">
1627
- <div class="quads-toogle-title"><span contenteditable="true" id="quads-ad-label-<?php echo $id; ?>"><?php echo $label; ?></span><input type="hidden" class="quads-input-label" id="" name="quads_settings[<?php echo $id; ?>][label]" value="<?php echo $new_label;?>"></div>
1628
- <a class="quads-toggle" data-box-id="quads-toggle<?php echo $id; ?>" href="#"><div class="quads-close-open-icon"></div></a>
1629
- </div>
1630
- <div class="quads-ad-toggle-container" id="quads-toggle<?php echo $id; ?>" style="display:none;">
1631
- <div>
1632
- <?php
1633
- $args_ad_type = array(
1634
- 'id' => 'ad_type',
1635
- 'name' => 'Type',
1636
- 'desc' => '',
1637
- 'std' => 'plain_text',
1638
- 'options' => array(
1639
- 'adsense' => 'AdSense',
1640
- 'plain_text' => 'Plain Text / HTML / JS'
1641
- )
1642
- );
1643
- echo quads_adtype_callback($id, $args_ad_type);
1644
- ?>
1645
- </div>
1646
- <textarea style="vertical-align:top;margin-right:20px;" class="large-text quads-textarea" cols="50" rows="10" id="quads_settings[<?php echo $id; ?>][code]" name="quads_settings[<?php echo $id; ?>][code]"><?php echo esc_textarea( stripslashes( $code ) ); ?></textarea><label for="quads_settings[ <?php echo $id; ?> ][code]"> <?php echo $args['desc']; ?></label>
1647
- <br>
1648
- <div class="quads_adsense_code">
1649
- <input type="button" style="vertical-align:inherit;" class="button button-primary quads-add-adsense" value="Copy / Paste AdSense Code"> <span>or add Ad Slot ID & Publisher ID manually below:</span>
1650
- <br />
1651
- <?php //echo __('Generate Ad Slot & Publisher ID automatically from your adsense code', 'quick-adsense-reloaded')?>
1652
- <label class="quads-label-left" for="quads_settings[<?php echo $id; ?>][g_data_ad_slot]">Ad Slot ID </label><input type="text" class="quads-medium-size quads-bggrey" id="quads_settings[<?php echo $id; ?>][g_data_ad_slot]" name="quads_settings[<?php echo $id; ?>][g_data_ad_slot]" value="<?php echo $g_data_ad_slot; ?>">
1653
- <label for="quads_settings[<?php echo $id; ?>][g_data_ad_client]">Publisher ID</label><input type="text" id="quads_settings[<?php echo $id; ?>][g_data_ad_client]" class="medium-text quads-bggrey" name="quads_settings[<?php echo $id; ?>][g_data_ad_client]" value="<?php echo $g_data_ad_client; ?>">
1654
- <br />
1655
- <?php
1656
- $args_adsense_type = array(
1657
- 'id' => 'adsense_type',
1658
- 'name' => 'Type',
1659
- 'desc' => 'Type',
1660
- 'options' => array(
1661
- 'normal' => 'Fixed Size',
1662
- 'responsive' => 'Responsive'
1663
- )
1664
- );
1665
- echo quads_adense_select_callback($id, $args_adsense_type);
1666
- ?>
1667
- <?php if ( !quads_is_advanced()) {?>
1668
- <span class="quads-pro-notice" style="display:block;margin-top:20px;"><?php echo sprintf(__('Install <a href="%s" target="_blank">WP QUADS PRO</a> to fully support AdSense Responsive ads.', 'quick-adsense-reloaded'),'http://wpquads.com/?utm_campaign=overlay&utm_source=free-plugin&utm_medium=admin')?></span>
1669
- <?php } ?>
1670
- <br />
1671
- <label class="quads-label-left quads-type-normal" for="quads_settings[<?php echo $id; ?>][g_data_ad_width]">Width </label><input type="number" step="1" id="quads_settings[<?php echo $id; ?>][g_data_ad_width]" name="quads_settings[<?php echo $id; ?>][g_data_ad_width]" class="small-text quads-type-normal" value="<?php echo $g_data_ad_width; ?>">
1672
- <label class="quads-type-normal" for="quads_settings[<?php echo $id; ?>][g_data_ad_height]">Height </label><input type="number" step="1" id="quads_settings[<?php echo $id; ?>][g_data_ad_height]" name="quads_settings[<?php echo $id; ?>][g_data_ad_height]" class="small-text quads-type-normal" value="<?php echo $g_data_ad_height; ?>">
1673
- </div>
1674
- <div class="quads-style">
1675
- <h3>Layout</h3>
1676
- <?php
1677
- $args_ad_position = array(
1678
- 'id' => 'align',
1679
- 'name' => 'align',
1680
- 'desc' => 'align',
1681
- 'std' => '3',
1682
- 'options' => array(
1683
- '3' => 'Default',
1684
- '0' => 'Left',
1685
- '1' => 'Center',
1686
- '2' => 'Right'
1687
- )
1688
- );
1689
- echo quads_adposition_callback($id, $args_ad_position);
1690
- // if WP QUADS PRO is installed and version number is higher or equal 1.2.7 show the new margin settings
1691
- if ( !quads_is_advanced_1_2_7() ){
1692
- ?>
1693
 
1694
- <br />
1695
- <label class="quads-label-left" for="quads_settings[<?php echo $id; ?>][margin]"><?php _e( 'Margin', 'quick-adsense-reloaded' );?></label>
1696
- <input type="number" step="1" max="" min="" class="small-text" id="quads_settings[<?php echo $id; ?>][margin]" name="quads_settings[<?php echo $id; ?>][margin]" value="<?php echo esc_attr( stripslashes( $margin ) ); ?>"/>px
1697
- <?php } echo apply_filters('quads_render_margin', '', $id); ?>
1698
- </div>
1699
- <?php
1700
- echo apply_filters( 'quads_advanced_settings', '', $id );
1701
- echo quads_pro_overlay();
1702
- ?>
1703
- </div>
1704
- <?php
 
 
 
 
 
1705
  }
 
1706
  /**
1707
- * AdSense Code Widget Callback
1708
  *
1709
  * Renders adsense code fields
1710
  *
@@ -1713,292 +1741,414 @@ function quads_adsense_code_callback( $args ) {
1713
  * @global $quads_options Array of all the QUADS Options
1714
  * @return void
1715
  */
1716
-
1717
- function quads_adsense_widget_callback( $args ) {
1718
- global $quads_options;
1719
-
1720
- $label = !empty($args['name']) ? $args['name'] : '';
1721
-
1722
- $code = isset( $quads_options[$args['id']]['code'] ) ? $quads_options[$args['id']]['code'] : '';
1723
-
1724
- $margin = isset( $quads_options[$args['id']]['margin'] ) ? esc_attr( stripslashes( $quads_options[$args['id']]['margin'] ) ) : 0;
1725
-
1726
- $g_data_ad_client = isset( $quads_options[$args['id']]['g_data_ad_client'] ) ? $quads_options[$args['id']]['g_data_ad_client'] : '';
1727
-
1728
- $g_data_ad_slot = isset( $quads_options[$args['id']]['g_data_ad_slot'] ) ? $quads_options[$args['id']]['g_data_ad_slot'] : '';
1729
-
1730
- $g_data_ad_width = isset( $quads_options[$args['id']]['g_data_ad_width'] ) ? $quads_options[$args['id']]['g_data_ad_width'] : '';
1731
-
1732
- $g_data_ad_height = isset( $quads_options[$args['id']]['g_data_ad_height'] ) ? $quads_options[$args['id']]['g_data_ad_height'] : '';
1733
-
1734
- // Create a shorter var to make HTML cleaner
1735
- $id = $args['id'];
1736
- ?>
1737
- <div class="quads-ad-toggle-header quads-box-close" data-box-id="quads-toggle<?php echo $id; ?>">
1738
- <div class="quads-toogle-title"><?php echo $label; ?></div>
1739
- <a class="quads-toggle" data-box-id="quads-toggle<?php echo $id; ?>" href="#"><div class="quads-close-open-icon"></div></a>
1740
- </div>
1741
- <div class="quads-ad-toggle-container" id="quads-toggle<?php echo $id; ?>" style="display:none;">
1742
- <div>
1743
- <?php
1744
- $args_ad_type = array(
1745
- 'id' => 'ad_type',
1746
- 'name' => 'Type',
1747
- 'desc' => '',
1748
- 'std' => 'plain_text',
1749
- 'options' => array(
1750
- 'adsense' => 'AdSense',
1751
- 'plain_text' => 'Plain Text / HTML / JS'
1752
- )
1753
- );
1754
- echo quads_adtype_callback($id, $args_ad_type);
1755
- ?>
1756
- </div>
1757
- <textarea style="vertical-align:top;margin-right:20px;" class="large-text quads-textarea" cols="50" rows="10" id="quads_settings[<?php echo $id; ?>][code]" name="quads_settings[<?php echo $id; ?>][code]"><?php echo esc_textarea( stripslashes( $code ) ); ?></textarea><label for="quads_settings[ <?php echo $id; ?> ][code]"> <?php echo $args['desc']; ?></label>
1758
- <br>
1759
- <div class="quads_adsense_code">
1760
- <input type="button" style="vertical-align:inherit;" class="button button-primary quads-add-adsense" value="Copy / Paste AdSense Code"> <span>or add Ad Slot ID & Publisher ID manually below:</span>
1761
- <br />
1762
- <?php //echo __('Generate Ad Slot & Publisher ID automatically from your adsense code', 'quick-adsense-reloaded')?>
1763
- <label class="quads-label-left" for="quads_settings[<?php echo $id; ?>][g_data_ad_slot]">Ad Slot ID </label><input type="text" class="quads-medium-size quads-bggrey" id="quads_settings[<?php echo $id; ?>][g_data_ad_slot]" name="quads_settings[<?php echo $id; ?>][g_data_ad_slot]" value="<?php echo $g_data_ad_slot; ?>">
1764
- <label for="quads_settings[<?php echo $id; ?>][g_data_ad_client]">Publisher ID</label><input type="text" id="quads_settings[<?php echo $id; ?>][g_data_ad_client]" class="medium-text quads-bggrey" name="quads_settings[<?php echo $id; ?>][g_data_ad_client]" value="<?php echo $g_data_ad_client; ?>">
1765
- <br />
1766
- <?php
1767
- $args_adsense_type = array(
1768
- 'id' => 'adsense_type',
1769
- 'name' => 'Type',
1770
- 'desc' => 'Type',
1771
- 'options' => array(
1772
- 'normal' => 'Fixed Size',
1773
- 'responsive' => 'Responsive'
1774
- )
1775
- );
1776
- echo quads_adense_select_callback($id, $args_adsense_type);
1777
- ?>
1778
- <?php if ( !quads_is_advanced()) {?>
1779
- <span class="quads-pro-notice" style="display:block;margin-top:20px;"><?php echo sprintf(__('Install <a href="%s" target="_blank">WP QUADS PRO</a> to fully support AdSense Responsive ads.', 'quick-adsense-reloaded'),'http://wpquads.com/?utm_campaign=overlay&utm_source=free-plugin&utm_medium=admin')?></span>
1780
- <?php } ?>
1781
- <br />
1782
- <label class="quads-label-left quads-type-normal" for="quads_settings[<?php echo $id; ?>][g_data_ad_width]">Width </label><input type="number" step="1" id="quads_settings[<?php echo $id; ?>][g_data_ad_width]" name="quads_settings[<?php echo $id; ?>][g_data_ad_width]" class="small-text quads-type-normal" value="<?php echo $g_data_ad_width; ?>">
1783
- <label class="quads-type-normal" for="quads_settings[<?php echo $id; ?>][g_data_ad_height]">Height </label><input type="number" step="1" id="quads_settings[<?php echo $id; ?>][g_data_ad_height]" name="quads_settings[<?php echo $id; ?>][g_data_ad_height]" class="small-text quads-type-normal" value="<?php echo $g_data_ad_height; ?>">
1784
- </div>
1785
- <div class="quads-style">
1786
- <h3>Layout</h3>
1787
- <?php
1788
- $args_ad_position = array(
1789
- 'id' => 'align',
1790
- 'name' => 'align',
1791
- 'desc' => 'align',
1792
- 'std' => '3',
1793
- 'options' => array(
1794
- '3' => 'Default',
1795
- '0' => 'Left',
1796
- '1' => 'Center',
1797
- '2' => 'Right'
1798
- )
1799
- );
1800
- echo quads_adposition_callback($id, $args_ad_position);
1801
- // if WP QUADS PRO is installed and version number is higher or equal 1.2.7 show the new margin settings
1802
- if ( !quads_is_advanced_1_2_7() ){
1803
- ?>
1804
-
1805
- <br />
1806
- <label class="quads-label-left" for="quads_settings[<?php echo $id; ?>][margin]"><?php _e( 'Margin', 'quick-adsense-reloaded' );?></label>
1807
- <input type="number" step="1" max="" min="" class="small-text" id="quads_settings[<?php echo $id; ?>][margin]" name="quads_settings[<?php echo $id; ?>][margin]" value="<?php echo esc_attr( stripslashes( $margin ) ); ?>"/>px
1808
- <?php } echo apply_filters('quads_render_margin', '', $id); ?>
1809
- </div>
1810
- <?php
1811
- echo apply_filters( 'quads_advanced_settings', '', $id );
1812
- echo quads_pro_overlay();
1813
- ?>
1814
- </div>
1815
- <?php
1816
- }
1817
-
1818
-
1819
-
1820
- /**
1821
- * If advanced settings are not available load overlay image
1822
- * @return string
1823
- */
1824
- function quads_pro_overlay() {
1825
- if( quads_is_advanced() ) {
1826
- return '';
1827
  }
1828
 
1829
- $html = '<div class="quads-advanced-ad-box quads-pro-overlay"><a href="http://wpquads.com/?utm_campaign=overlay&utm_source=free-plugin&utm_medium=admin" target="_blank"><img src="' . QUADS_PLUGIN_URL . '/assets/images/get_pro_overlay.png"></a></div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1830
 
1831
- return $html;
1832
- }
 
 
 
 
 
 
1833
 
1834
- /**
1835
- *
1836
- * Return array of alignment options
1837
- *
1838
- * @return array
1839
- */
1840
- function quads_get_alignment() {
1841
- // Do not change the key => value order for compatibility reasons
1842
- return array(
1843
- 3 => 'none',
1844
- 0 => 'left',
1845
- 1 => 'center',
1846
- 2 => 'right',
1847
- );
1848
- }
1849
 
1850
- /**
1851
- * Check if plugin Clickfraud Monitoring is installed
1852
- *
1853
- * @return boolean true when it is installed and active
1854
- */
1855
- function quads_is_installed_clickfraud() {
1856
- $plugin_file = 'cfmonitor/cfmonitor.php';
1857
- $plugin_file2 = 'clickfraud-monitoring/cfmonitor.php';
1858
 
1859
- if( is_plugin_active( $plugin_file ) || is_plugin_active( $plugin_file2 ) ) {
1860
- return true;
 
 
 
 
 
 
 
 
 
 
 
 
1861
  }
1862
 
1863
- return false;
1864
- }
 
 
 
 
 
 
1865
 
1866
- /**
1867
- *
1868
- * @param array $args array(
1869
- * 'id' => 'string),
1870
- * 'type' => desktop, tablet_landscape, tablet_portrait, phone
1871
- * @return string
1872
- */
1873
- function quads_render_size_option( $args ) {
1874
- global $quads_options;
1875
 
1876
- if( !isset( $args['id'] ) ) {
1877
- return '';
1878
  }
1879
 
1880
- $checked = isset( $quads_options[$args['id']][$args['type']] ) ? $quads_options[$args['id']][$args['type']] : '';
1881
- $html = '<div class="quads-select-style-overwrite">';
1882
- $html .= '<select class="quads-size-input" id="quads_settings[' . $args['id'] . '][' . $args['type'] . ']" name="quads_settings[' . $args['id'] . '][' . $args['type'] . ']"/>';
1883
- foreach ( quads_get_adsense_sizes() as $key => $value ) :
1884
- $selected = selected( $key, $checked, false );
1885
- $html .= '<option value="' . $key . '" ' . $selected . '>' . $value . '</option>';
1886
- endforeach;
1887
- $html .= '</select>';
1888
- $html .= '</div>';
1889
-
1890
- return $html;
1891
- }
1892
-
1893
- /**
1894
- * Get all AdSense Sizes
1895
- * @return array
1896
- */
1897
- function quads_get_adsense_sizes() {
1898
- $sizes = array(
1899
- 'Auto' => 'Auto',
1900
- '120 x 90' => '120 x 90',
1901
- '120 x 240' => '120 x 240',
1902
- '120 x 600' => '120 x 600',
1903
- '125 x 125' => '125 x 125',
1904
- '160 x 90' => '160 x 90',
1905
- '160 x 600' => '160 x 600',
1906
- '180 x 90' => '180 x 90',
1907
- '180 x 150' => '180 x 150',
1908
- '200 x 90' => '200 x 90',
1909
- '200 x 200' => '200 x 200',
1910
- '234 x 60' => '234 x 60',
1911
- '250 x 250' => '250 x 250',
1912
- '320 x 100' => '320 x 100',
1913
- '300 x 250' => '300 x 250',
1914
- '300 x 600' => '300 x 600',
1915
- '300 x 1050' => '300 x 1050',
1916
- '320 x 50' => '320 x 50',
1917
- '336 x 280' => '336 x 280',
1918
- '360 x 300' => '360 x 300',
1919
- '435 x 300' => '435 x 300',
1920
- '468 x 15' => '468 x 15',
1921
- '468 x 60' => '468 x 60',
1922
- '640 x 165' => '640 x 165',
1923
- '640 x 190' => '640 x 190',
1924
- '640 x 300' => '640 x 300',
1925
- '728 x 15' => '728 x 15',
1926
- '728 x 90' => '728 x 90',
1927
- '970 x 90' => '970 x 90',
1928
- '970 x 250' => '970 x 250',
1929
- '240 x 400' => '240 x 400 - Regional ad sizes',
1930
- '250 x 360' => '250 x 360 - Regional ad sizes',
1931
- '580 x 400' => '580 x 400 - Regional ad sizes',
1932
- '750 x 100' => '750 x 100 - Regional ad sizes',
1933
- '750 x 200' => '750 x 200 - Regional ad sizes',
1934
- '750 x 300' => '750 x 300 - Regional ad sizes',
1935
- '980 x 120' => '980 x 120 - Regional ad sizes',
1936
- '930 x 180' => '930 x 180 - Regional ad sizes',
1937
- );
1938
-
1939
- return apply_filters( 'quads_adsense_size_formats', $sizes );
1940
- }
1941
 
1942
- /**
1943
- * Store AdSense parameters
1944
- *
1945
- * @return boolean
1946
- */
1947
- function quads_store_adsense_args() {
1948
- global $quads_options;
 
 
 
 
 
 
 
 
 
 
 
 
 
1949
 
1950
- foreach ( $quads_options as $id => $values ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1951
 
1952
- if( is_array( $values ) && array_key_exists( 'code', $values ) && !empty($values['code']) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1953
 
1954
  //check to see if it is google ad
1955
- if( preg_match( '/googlesyndication.com/', $values['code'] ) ) {
1956
-
1957
- // Test if its google asyncron ad
1958
- if( preg_match( '/data-ad-client=/', $values['code'] ) ) {
1959
- //*** GOOGLE ASYNCRON *************
1960
- $quads_options[$id]['current_ad_type'] = 'google_async';
1961
- //get g_data_ad_client
1962
- $explode_ad_code = explode( 'data-ad-client', $values['code'] );
1963
- preg_match( '#"([a-zA-Z0-9-\s]+)"#', $explode_ad_code[1], $matches_add_client );
1964
- $quads_options[$id]['g_data_ad_client'] = str_replace( array('"', ' '), array(''), $matches_add_client[1] );
1965
-
1966
- //get g_data_ad_slot
1967
- $explode_ad_code = explode( 'data-ad-slot', $values['code'] );
1968
- preg_match( '#"([a-zA-Z0-9/\s]+)"#', $explode_ad_code[1], $matches_add_slot );
1969
- $quads_options[$id]['g_data_ad_slot'] = str_replace( array('"', ' '), array(''), $matches_add_slot[1] );
1970
- } else {
1971
- //*** GOOGLE SYNCRON *************
1972
- $quads_options[$id]['current_ad_type'] = 'google_sync';
1973
- //get g_data_ad_client
1974
- $explode_ad_code = explode( 'google_ad_client', $values['code'] );
1975
- preg_match( '#"([a-zA-Z0-9-\s]+)"#', $explode_ad_code[1], $matches_add_client );
1976
- $quads_options[$id]['g_data_ad_client'] = str_replace( array('"', ' '), array(''), $matches_add_client[1] );
1977
-
1978
- //get g_data_ad_slot
1979
- $explode_ad_code = explode( 'google_ad_slot', $values['code'] );
1980
- preg_match( '#"([a-zA-Z0-9/\s]+)"#', $explode_ad_code[1], $matches_add_slot );
1981
- $quads_options[$id]['g_data_ad_slot'] = str_replace( array('"', ' '), array(''), $matches_add_slot[1] );
1982
- }
1983
- } else {
1984
- //$quads_options[$id]['current_ad_type'] = 'other';
1985
- //$quads_options[$id]['g_data_ad_client'] = '';
1986
- //$quads_options[$id]['g_data_ad_slot'] = '';
1987
  }
1988
- }
1989
- }
1990
- //var_dump($quads_options);
1991
- update_option( 'quads_settings', $quads_options );
 
1992
  }
1993
 
1994
-
1995
  /**
1996
- * Populate AdSense Code field otherwise ads are not shown on frontpage (Bug).
1997
- * @todo
1998
- *
1999
- * @global $quads_options $quads_options
2000
- * @deprecated since 1.3.8
2001
- */
2002
  //function quads_fix_ad_not_shown(){
2003
  // global $quads_options;
2004
  //
@@ -2009,51 +2159,52 @@ function quads_store_adsense_args() {
2009
  // }
2010
  //}
2011
 
2012
- /**
2013
- * Sanitizes a string key for QUADS Settings
2014
- *
2015
- * Keys are used as internal identifiers. Alphanumeric characters, dashes, underscores, stops, colons and slashes are allowed
2016
- *
2017
- * @since 2.0.0
2018
- * @param string $key String key
2019
- * @return string Sanitized key
2020
- */
2021
- function quads_sanitize_key( $key ) {
2022
- $raw_key = $key;
2023
- $key = preg_replace( '/[^a-zA-Z0-9_\-\.\:\/]/', '', $key );
2024
  /**
2025
- * Filter a sanitized key string.
2026
  *
2027
- * @since 2.5.8
2028
- * @param string $key Sanitized key.
2029
- * @param string $raw_key The key prior to sanitization.
 
 
2030
  */
2031
- return apply_filters( 'quads_sanitize_key', $key, $raw_key );
2032
- }
 
 
 
 
 
 
 
 
 
 
2033
 
2034
- /**
2035
- * Multi Select Callback
2036
- *
2037
- * @since 1.3.8
2038
- * @param array $args Arguments passed by the settings
2039
- * @global $quads_options Array of all the QUADS Options
2040
- * @return string $output dropdown
2041
- */
2042
- function quads_multiselect_callback( $args = array() ) {
2043
- global $quads_options;
2044
-
2045
- $placeholder = !empty($args['placeholder']) ? $args['placeholder'] : '';
2046
- $selected = isset($quads_options[$args['id']]) ? $quads_options[$args['id']] : '';
2047
- $checked = '';
2048
-
2049
- $html = '<select name="quads_settings[' . $args['id'] . '][]" data-placeholder="'.$placeholder.'" style="width:550px;" multiple tabindex="4" class="quads-select quads-chosen-select">';
2050
- $i = 0;
2051
- foreach ( $args['options'] as $key => $value ) :
2052
- if( is_array($selected)){
2053
- $checked = selected( true, in_array( $key, $selected ), false );
2054
- }
2055
- $html .= '<option value="' . $key . '" ' . $checked . '>' . $value . '</option>';
2056
- endforeach;
2057
- $html .= '</select>';
2058
- echo $html;
2059
- }
 
1
  <?php
 
2
  /**
3
  * Register Settings
4
  *
10
  */
11
  // Exit if accessed directly
12
  if( !defined( 'ABSPATH' ) )
13
+ exit;
14
 
15
  /**
16
  * Get an option
21
  * @return mixed
22
  */
23
  function quads_get_option( $key = '', $default = false ) {
24
+ global $quads_options;
25
+ $value = !empty( $quads_options[$key] ) ? $quads_options[$key] : $default;
26
+ $value = apply_filters( 'quads_get_option', $value, $key, $default );
27
+ return apply_filters( 'quads_get_option_' . $key, $value, $key, $default );
28
  }
29
 
30
  /**
36
  * @return array QUADS settings
37
  */
38
  function quads_get_settings() {
39
+ $settings = get_option( 'quads_settings' );
40
 
41
 
42
+ if( empty( $settings ) ) {
43
+ // Update old settings with new single option
44
+ $general_settings = is_array( get_option( 'quads_settings_general' ) ) ? get_option( 'quads_settings_general' ) : array();
45
+ $ext_settings = is_array( get_option( 'quads_settings_extensions' ) ) ? get_option( 'quads_settings_extensions' ) : array();
46
+ $license_settings = is_array( get_option( 'quads_settings_licenses' ) ) ? get_option( 'quads_settings_licenses' ) : array();
47
+ $addons_settings = is_array( get_option( 'quads_settings_addons' ) ) ? get_option( 'quads_settings_addons' ) : array();
48
+ $imexport_settings = is_array( get_option( 'quads_settings_imexport' ) ) ? get_option( 'quads_settings_imexport' ) : array();
49
+ $help_settings = is_array( get_option( 'quads_settings_help' ) ) ? get_option( 'quads_settings_help' ) : array();
50
 
51
+ $settings = array_merge( $general_settings, $ext_settings, $imexport_settings, $help_settings );
52
 
53
+ update_option( 'quads_settings', $settings );
54
+ }
55
+ return apply_filters( 'quads_get_settings', $settings );
56
  }
57
 
58
  /**
63
  */
64
  function quads_register_settings() {
65
 
66
+ if( false == get_option( 'quads_settings' ) ) {
67
+ add_option( 'quads_settings' );
68
+ }
69
+
70
+ foreach ( quads_get_registered_settings() as $tab => $settings ) {
71
+
72
+ add_settings_section(
73
+ 'quads_settings_' . $tab, __return_null(), '__return_false', 'quads_settings_' . $tab
74
+ );
75
+
76
+ foreach ( $settings as $option ) {
77
+
78
+ $name = isset( $option['name'] ) ? $option['name'] : '';
79
+
80
+ add_settings_field(
81
+ 'quads_settings[' . $option['id'] . ']', $name, function_exists( 'quads_' . $option['type'] . '_callback' ) ? 'quads_' . $option['type'] . '_callback' : 'quads_missing_callback', 'quads_settings_' . $tab, 'quads_settings_' . $tab, array(
82
+ 'id' => isset( $option['id'] ) ? $option['id'] : null,
83
+ 'desc' => !empty( $option['desc'] ) ? $option['desc'] : '',
84
+ 'desc2' => !empty( $option['desc2'] ) ? $option['desc2'] : '',
85
+ 'helper-desc' => !empty( $option['helper-desc'] ) ? $option['helper-desc'] : '',
86
+ 'name' => isset( $option['name'] ) ? $option['name'] : null,
87
+ 'section' => $tab,
88
+ 'size' => isset( $option['size'] ) ? $option['size'] : null,
89
+ 'options' => isset( $option['options'] ) ? $option['options'] : '',
90
+ 'std' => isset( $option['std'] ) ? $option['std'] : '',
91
+ 'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : '',
92
+ 'textarea_rows' => isset( $option['textarea_rows'] ) ? $option['textarea_rows'] : ''
93
+ )
94
+ );
95
+ }
96
+ }
97
+
98
+ // Store adsense values
99
+ quads_store_adsense_args();
100
+ // Store AdSense value
101
+ //quads_fix_ad_not_shown();
102
+ // Creates our settings in the options table
103
+ register_setting( 'quads_settings', 'quads_settings', 'quads_settings_sanitize' );
 
104
  }
105
 
106
  add_action( 'admin_init', 'quads_register_settings' );
113
  */
114
  function quads_get_registered_settings() {
115
 
116
+ /**
117
+ * 'Whitelisted' QUADS settings, filters are provided for each settings
118
+ * section to allow extensions and other plugins to add their own settings
119
+ */
120
+ $quads_settings = array(
121
+ /** General Settings */
122
+ 'general' => apply_filters( 'quads_settings_general', array(
123
+ array(
124
+ 'id' => 'general_header',
125
+ 'name' => '<strong>' . __( 'General & Position', 'quick-adsense-reloaded' ) . '</strong>',
126
+ 'desc' => __( '', 'quick-adsense-reloaded' ),
127
+ 'type' => 'header'
128
+ ),
129
+ 'maxads' => array(
130
+ 'id' => 'maxads',
131
+ 'name' => __( 'Limit Amount of ads:', 'quick-adsense-reloaded' ),
132
+ 'desc' => __( ' ads on a page.', 'quick-adsense-reloaded' ),
133
+ 'desc2' => sprintf( __( '<a href="%s" target="_blank">Read here</a> to learn how many AdSense ads are allowed. If you are unsure set the value to unlimited.', 'quick-adsense-reloaded' ), 'http://wpquads.com/google-adsense-allowed-number-ads/' ),
134
+ 'type' => 'select',
135
+ 'std' => 100,
136
+ 'options' => array(
137
+ 1 => '1',
138
+ 2 => '2',
139
+ 3 => '3',
140
+ 4 => '4',
141
+ 5 => '5',
142
+ 6 => '6',
143
+ 7 => '7',
144
+ 8 => '8',
145
+ 9 => '9',
146
+ 10 => '10',
147
+ 11 => '11',
148
+ 12 => '12',
149
+ 13 => '13',
150
+ 14 => '14',
151
+ 15 => '15',
152
+ 16 => '16',
153
+ 17 => '17',
154
+ 18 => '18',
155
+ 19 => '19',
156
+ 20 => '20',
157
+ 100 => 'Unlimited',
158
+ ),
159
+ ),
160
+ array(
161
+ 'id' => 'ad_position',
162
+ 'name' => __( 'Position - Default Ads', 'quick-adsense-reloaded' ),
163
+ 'desc' => __( 'Assign and activate ads on specific ad places', 'quick-adsense-reloaded' ),
164
+ 'type' => 'ad_position'
165
+ ),
166
+ array(
167
+ 'id' => 'visibility',
168
+ 'name' => __( 'Visibility', 'quick-adsense-reloaded' ),
169
+ 'desc' => __( '', 'quick-adsense-reloaded' ),
170
+ 'type' => 'visibility'
171
+ ),
172
+ array(
173
+ "id" => "post_types",
174
+ "name" => __( "Post Types", "quick-adsense-reloaded" ),
175
+ "desc" => __( "Select post types where ads are visible.", "quick-adsense-reloaded" ),
176
+ "helper-desc" => __( "Select post types where ads are visible.", "quick-adsense-reloaded" ),
177
+ "type" => "multiselect",
178
+ "options" => quads_get_post_types(),
179
+ "placeholder" => __( "Select Post Type", "quick-adsense-reloaded" )
180
+ ),
181
+ array(
182
+ 'id' => 'quicktags',
183
+ 'name' => __( 'Quicktags', 'quick-adsense-reloaded' ),
184
+ 'desc' => __( '', 'quick-adsense-reloaded' ),
185
+ 'type' => 'quicktags'
186
+ ),
187
+ /* 'load_scripts_footer' => array(
188
+ 'id' => 'load_scripts_footer',
189
+ 'name' => __( 'JS Load Order', 'quick-adsense-reloaded' ),
190
+ 'desc' => __( 'Enable this to load all *.js files into footer. Make sure your theme uses the wp_footer() template tag in the appropriate place. Default: Disabled', 'quick-adsense-reloaded' ),
191
+ 'type' => 'checkbox'
192
+ ), */
193
+ 'adsense_header' => array(
194
+ 'id' => 'adsense_header',
195
+ 'name' => '<strong>' . __( 'AdSense Code', 'quick-adsense-reloaded' ) . '</strong>',
196
+ 'desc' => '<div class="adsense_admin_header">' . sprintf( __( 'Enter your ad codes below:</div>'
197
+ . '<ul style="margin-top:10px;">'
198
+ . '<li style="font-weight:600;">Select <i>AdSense</i> if you are using AdSense!</li>'
199
+ . '<li style="font-weight:600;">Use <i>Plain Text / HTML / JS</i> for all other ads! <br><strong>Caution:</strong> Adding AdSense code into <i>Plain Text</i> option can result in non-displayed ads!</li></ul>', 'quick-adsense-reloaded' ), 'http://wpquads.com/effective-adsense-banner-size-formats/?utm_campaign=plugin&utm_source=general_tab&utm_medium=admin&utm_content=best_banner_sizes' )
200
+ . '</ul>'
201
+ . '<div style="clear:both;">' . sprintf( __( '<strong>Ads are not showing? Read the <a href="%s" target="_blank">troubleshooting guide</a> to find out how to resolve this issue.', 'quick-adsense-reloaded' ), 'http://wpquads.com/docs/adsense-ads-are-not-showing/?utm_source=plugin&utm_campaign=wpquads-settings&utm_medium=website&utm_term=toplink' ) . ''
202
+ . '<br><a href="%s" target="_blank">Read here</a> to find out the most effective AdSense banner sizes. </div>'
203
+ . '<div id="quads-open-toggle" class="button">' . __( 'Open All Ads', 'quick-adsense-reloaded' ) . '</div>',
204
+ 'type' => 'header'
205
+ ),
206
+ // array(
207
+ // 'id' => 'ad1',
208
+ // 'name' => __( 'Ad 1', 'quick-adsense-reloaded' ),
209
+ // 'desc' => __( 'Shortcode: <strong>[quads id="1"] </strong></br>PHP: <strong>echo do_shortcode(\'[quads id="1"]\');</strong>', 'quick-adsense-reloaded' ),
210
+ // 'type' => 'adsense_code',
211
+ // 'options' => quads_get_alignment(),
212
+ // ),
213
+ // array(
214
+ // 'id' => 'ad2',
215
+ // 'name' => __( 'Ad 2', 'quick-adsense-reloaded' ),
216
+ // 'desc' => __( 'Shortcode: <strong>[quads id="2"] </strong></br>PHP: <strong>echo do_shortcode(\'[quads id="2"]\');</strong>', 'quick-adsense-reloaded' ),
217
+ // 'type' => 'adsense_code',
218
+ // 'options' => quads_get_alignment(),
219
+ // ),
220
+ // array(
221
+ // 'id' => 'ad3',
222
+ // 'name' => __( 'Ad 3', 'quick-adsense-reloaded' ),
223
+ // 'desc' => __( 'Shortcode: <strong>[quads id="3"] </strong></br>PHP: <strong>echo do_shortcode(\'[quads id="3"]\');</strong>', 'quick-adsense-reloaded' ),
224
+ // 'type' => 'adsense_code',
225
+ // 'options' => quads_get_alignment(),
226
+ // ),
227
+ // array(
228
+ // 'id' => 'ad4',
229
+ // 'name' => __( 'Ad 4', 'quick-adsense-reloaded' ),
230
+ // 'desc' => __( 'Shortcode: <strong>[quads id="4"] </strong></br>PHP: <strong>echo do_shortcode(\'[quads id="4"]\');</strong>', 'quick-adsense-reloaded' ),
231
+ // 'type' => 'adsense_code',
232
+ // 'options' => quads_get_alignment(),
233
+ // ),
234
+ // array(
235
+ // 'id' => 'ad5',
236
+ // 'name' => __( 'Ad 5', 'quick-adsense-reloaded' ),
237
+ // 'desc' => __( 'Shortcode: <strong>[quads id="5"] </strong></br>PHP: <strong>echo do_shortcode(\'[quads id="5"]\');</strong>', 'quick-adsense-reloaded' ),
238
+ // 'type' => 'adsense_code',
239
+ // 'options' => quads_get_alignment(),
240
+ // ),
241
+ // array(
242
+ // 'id' => 'ad6',
243
+ // 'name' => __( 'Ad 6', 'quick-adsense-reloaded' ),
244
+ // 'desc' => __( 'Shortcode: <strong>[quads id="6"] </strong></br>PHP: <strong>echo do_shortcode(\'[quads id="6"]\');</strong>', 'quick-adsense-reloaded' ),
245
+ // 'type' => 'adsense_code',
246
+ // 'options' => quads_get_alignment(),
247
+ // ),
248
+ // array(
249
+ // 'id' => 'ad7',
250
+ // 'name' => __( 'Ad 7', 'quick-adsense-reloaded' ),
251
+ // 'desc' => __( 'Shortcode: <strong>[quads id="7"] </strong></br>PHP: <strong>echo do_shortcode(\'[quads id="7"]\');</strong>', 'quick-adsense-reloaded' ),
252
+ // 'type' => 'adsense_code',
253
+ // 'options' => quads_get_alignment(),
254
+ // ),
255
+ // array(
256
+ // 'id' => 'ad8',
257
+ // 'name' => __( 'Ad 8', 'quick-adsense-reloaded' ),
258
+ // 'desc' => __( 'Shortcode: <strong>[quads id="8"] </strong></br>PHP: <strong>echo do_shortcode(\'[quads id="8"]\');</strong>', 'quick-adsense-reloaded' ),
259
+ // 'type' => 'adsense_code',
260
+ // 'options' => quads_get_alignment(),
261
+ // ),
262
+ // array(
263
+ // 'id' => 'ad9',
264
+ // 'name' => __( 'Ad 9', 'quick-adsense-reloaded' ),
265
+ // 'desc' => __( 'Shortcode: <strong>[quads id="9"] </strong></br>Function: <strong>echo do_shortcode(\'[quads id="9"]\');</strong>', 'quick-adsense-reloaded' ),
266
+ // 'type' => 'adsense_code',
267
+ // 'options' => quads_get_alignment(),
268
+ // ),
269
+ // array(
270
+ // 'id' => 'ad10',
271
+ // 'name' => __( 'Ad 10', 'quick-adsense-reloaded' ),
272
+ // 'desc' => __( 'Shortcode: <strong>[quads id="10"] </strong></br>PHP <strong>echo do_shortcode(\'[quads id="10"]\');</strong>', 'quick-adsense-reloaded' ),
273
+ // 'type' => 'adsense_code',
274
+ // 'options' => quads_get_alignment(),
275
+ // ),
276
+ array(
277
+ 'id' => 'quads_ads',
278
+ 'name' => __( '', 'quick-adsense-reloaded' ),
279
+ 'type' => 'ad_code'
280
+ ),
281
+ array(
282
+ 'id' => 'new_ad',
283
+ 'name' => __( '', 'quick-adsense-reloaded' ),
284
+ 'type' => 'new_ad',
285
+ ),
286
+ 'widget_header' => array(
287
+ 'id' => 'widget_header',
288
+ 'name' => '<strong>' . __( 'Widgets Ad Code', 'quick-adsense-reloaded' ) . '</strong>',
289
+ 'desc' => sprintf( __( 'After creating your ads here go to <a href="%s" target="_self">Appearance->Widgets</a> and drag the WP QUADS widget into place.', 'quick-adsense-reloaded' ), admin_url() . 'widgets.php' ),
290
+ 'type' => 'header'
291
+ ),
292
+ 'ad1_widget' => array(
293
+ 'id' => 'ad1_widget',
294
+ 'name' => __( 'Ad widget 1', 'quick-adsense-reloaded' ),
295
+ 'desc' => __( '', 'quick-adsense-reloaded' ),
296
+ 'type' => 'adsense_widget',
297
+ 'size' => 4
298
+ ),
299
+ 'ad2_widget' => array(
300
+ 'id' => 'ad2_widget',
301
+ 'name' => __( 'Ad widget 2', 'quick-adsense-reloaded' ),
302
+ 'desc' => __( '', 'quick-adsense-reloaded' ),
303
+ 'type' => 'adsense_widget',
304
+ 'size' => 4
305
+ ),
306
+ 'ad3_widget' => array(
307
+ 'id' => 'ad3_widget',
308
+ 'name' => __( 'Ad widget 3', 'quick-adsense-reloaded' ),
309
+ 'desc' => __( '', 'quick-adsense-reloaded' ),
310
+ 'type' => 'adsense_widget',
311
+ 'size' => 4
312
+ ),
313
+ 'ad4_widget' => array(
314
+ 'id' => 'ad4_widget',
315
+ 'name' => __( 'Ad widget 4', 'quick-adsense-reloaded' ),
316
+ 'desc' => __( '', 'quick-adsense-reloaded' ),
317
+ 'type' => 'adsense_widget',
318
+ 'size' => 4
319
+ ),
320
+ 'ad5_widget' => array(
321
+ 'id' => 'ad5_widget',
322
+ 'name' => __( 'Ad widget 5', 'quick-adsense-reloaded' ),
323
+ 'desc' => __( '', 'quick-adsense-reloaded' ),
324
+ 'type' => 'adsense_widget',
325
+ 'size' => 4
326
+ ),
327
+ 'ad6_widget' => array(
328
+ 'id' => 'ad6_widget',
329
+ 'name' => __( 'Ad widget 6', 'quick-adsense-reloaded' ),
330
+ 'desc' => __( '', 'quick-adsense-reloaded' ),
331
+ 'type' => 'adsense_widget',
332
+ 'size' => 4
333
+ ),
334
+ 'ad7_widget' => array(
335
+ 'id' => 'ad7_widget',
336
+ 'name' => __( 'Ad widget 7', 'quick-adsense-reloaded' ),
337
+ 'desc' => __( '', 'quick-adsense-reloaded' ),
338
+ 'type' => 'adsense_widget',
339
+ 'size' => 4
340
+ ),
341
+ 'ad8_widget' => array(
342
+ 'id' => 'ad8_widget',
343
+ 'name' => __( 'Ad widget 8', 'quick-adsense-reloaded' ),
344
+ 'desc' => __( '', 'quick-adsense-reloaded' ),
345
+ 'type' => 'adsense_widget',
346
+ 'size' => 4
347
+ ),
348
+ 'ad9_widget' => array(
349
+ 'id' => 'ad9_widget',
350
+ 'name' => __( 'Ad widget 9', 'quick-adsense-reloaded' ),
351
+ 'desc' => __( '', 'quick-adsense-reloaded' ),
352
+ 'type' => 'adsense_widget',
353
+ 'size' => 4
354
+ ),
355
+ 'ad10_widget' => array(
356
+ 'id' => 'ad10_widget',
357
+ 'name' => __( 'Ad widget 10', 'quick-adsense-reloaded' ),
358
+ 'desc' => __( '', 'quick-adsense-reloaded' ),
359
+ 'type' => 'adsense_widget',
360
+ 'size' => 4
361
+ ),
362
+ array(
363
+ 'id' => 'plugin_header',
364
+ 'name' => '<strong>' . __( 'Plugin Settings', 'quick-adsense-reloaded' ) . '</strong>',
365
+ 'desc' => __( '', 'quick-adsense-reloaded' ),
366
+ 'type' => 'header'
367
+ ),
368
+ 'priority' => array(
369
+ 'id' => 'priority',
370
+ 'name' => __( 'Load Priority', 'quick-adsense-reloaded' ),
371
+ //'desc' => __( 'Do not change this until you know what you are doing. Usually the default value 20 is working fine. Changing this value can lead to unexpected results like ads not showing or loaded on wrong order. <strong>Default:</strong> 20', 'quick-adsense-reloaded' ),
372
+ 'helper-desc' => __( 'Do not change this until you know what you are doing. Usually the default value 20 is working fine. Changing this value can lead to unexpected results like ads not showing or loaded on wrong order. <strong>Default:</strong> 20', 'quick-adsense-reloaded' ),
373
+ 'type' => 'number',
374
+ 'size' => 'small',
375
+ 'std' => 20
376
+ ),
377
+ 'create_settings' => array(
378
+ 'id' => 'create_settings',
379
+ 'name' => __( 'Remove menu button', 'quick-adsense-reloaded' ),
380
+ //'desc' => __( 'Make the WPQUADS settings available from <strong>Settings->WPQUADS</strong>. This will remove the primary menu button from the admin sidebar', 'quick-adsense-reloaded' ),
381
+ 'desc' => __( 'Remove it' ),
382
+ 'helper-desc' => __( 'Make the WPQUADS settings available from <strong>Settings->WPQUADS</strong>. This will remove the primary menu button from the admin sidebar', 'quick-adsense-reloaded' ),
383
+ 'type' => 'checkbox',
384
+ ),
385
+ 'uninstall_on_delete' => array(
386
+ 'id' => 'uninstall_on_delete',
387
+ 'name' => __( 'Delete Data on Uninstall?', 'quick-adsense-reloaded' ),
388
+ //'desc' => __( 'Check this box if you would like <strong>Settings->WPQUADS</strong> to completely remove all of its data when the plugin is deleted.', 'quick-adsense-reloaded' ),
389
+ 'helper-desc' => __( 'Check this box if you would like <strong>Settings->WPQUADS</strong> to completely remove all of its data when the plugin is deleted.', 'quick-adsense-reloaded' ),
390
+ 'desc' => 'Delete data',
391
+ 'type' => 'checkbox'
392
+ ),
393
+ 'debug_mode' => array(
394
+ 'id' => 'debug_mode',
395
+ 'name' => __( 'Debug mode', 'quick-adsense-reloaded' ),
396
+ 'desc' => __( 'Check this to not minify JavaScript and CSS files. This makes debugging much easier and is recommended setting for inspecting issues on your site', 'quick-adsense-reloaded' ),
397
+ 'type' => 'checkbox'
398
+ )
399
+ )
400
+ ),
401
+ 'licenses' => apply_filters( 'quads_settings_licenses', array('licenses_header' => array(
402
+ 'id' => 'licenses_header',
403
+ 'name' => __( 'Activate Your License', 'quick-adsense-reloaded' ),
404
+ 'desc' => '',
405
+ 'type' => 'header'
406
+ ),)
407
+ ),
408
+ 'extensions' => apply_filters( 'quads_settings_extension', array()
409
+ ),
410
+ 'addons' => apply_filters( 'quads_settings_addons', array(
411
+ 'addons' => array(
412
+ 'id' => 'addons',
413
+ 'name' => __( '', 'quick-adsense-reloaded' ),
414
+ 'desc' => __( '', 'quick-adsense-reloaded' ),
415
+ 'type' => 'addons'
416
+ ),
417
+ )
418
+ ),
419
+ 'imexport' => apply_filters( 'quads_settings_imexport', array(
420
+ 'imexport' => array(
421
+ 'id' => 'imexport',
422
+ 'name' => __( '', 'quick-adsense-reloaded' ),
423
+ 'desc' => __( '', 'quick-adsense-reloaded' ),
424
+ 'type' => 'imexport'
425
+ )
426
+ )
427
+ ),
428
+ 'help' => apply_filters( 'quads_settings_help', array(
429
+ 'help_header' => array(
430
+ 'id' => 'help_header',
431
+ 'name' => '<strong>' . __( 'Help', 'quick-adsense-reloaded' ) . '</strong>',
432
+ 'desc' => quads_is_extra() ? sprintf( __( 'Something not working as expected? Open a <a href="%1s" target="_blank">support ticket</a>', 'quick-adsense-reloaded' ), 'http://wpquads.com/support/' ) : sprintf( __( 'Something not working as expected? Visit the WP<strong>QUADS</strong> <a href="%1s" target="_blank">Support Forum</a>', 'quick-adsense-reloaded' ), 'https://wordpress.org/support/plugin/quick-adsense-reloaded' ),
433
+ 'type' => 'header'
434
+ ),
435
+ 'systeminfo' => array(
436
+ 'id' => 'systeminfo',
437
+ 'name' => __( 'Systeminfo', 'quick-adsense-reloaded' ),
438
+ 'desc' => __( '', 'quick-adsense-reloaded' ),
439
+ 'type' => 'systeminfo'
440
+ )
441
+ )
442
+ )
443
+ );
444
+
445
+ return $quads_settings;
446
  }
447
 
448
  /**
450
  * @return string empty one
451
  */
452
  function quads_empty_callback() {
453
+ return '';
454
  }
455
 
456
  /**
466
  * @return string $input Sanitized value
467
  */
468
  function quads_settings_sanitize( $input = array() ) {
469
+
470
+ global $quads_options;
471
 
 
472
 
473
+ if( empty( $_POST['_wp_http_referer'] ) ) {
474
+ return $input;
475
+ }
476
 
477
+ parse_str( $_POST['_wp_http_referer'], $referrer );
 
 
478
 
479
+ $settings = quads_get_registered_settings();
480
+ $tab = isset( $referrer['tab'] ) ? $referrer['tab'] : 'general';
481
 
482
+
483
+ $input = $input ? $input : array();
484
+ $input = apply_filters( 'quads_settings_' . $tab . '_sanitize', $input );
485
+ // Loop through each setting being saved and pass it through a sanitization filter
486
+ foreach ( $input as $key => $value ) {
487
 
488
+ // Get the setting type (checkbox, select, etc)
489
+ $type = isset( $settings[$tab][$key]['type'] ) ? $settings[$tab][$key]['type'] : false;
490
+ if( $type ) {
491
+ // Field type specific filter
492
+ $input[$key] = apply_filters( 'quads_settings_sanitize_' . $type, $value, $key );
493
+ }
494
 
495
+ // General filter
496
+ $input[$key] = apply_filters( 'quads_settings_sanitize', $value, $key );
497
+ }
498
+ //wp_die(var_dump($input));
499
+
500
 
501
+ // Loop through the whitelist and unset any that are empty for the tab being saved
502
+ if( !empty( $settings[$tab] ) ) {
503
+ foreach ( $settings[$tab] as $key => $value ) {
504
+ // settings used to have numeric keys, now they have keys that match the option ID. This ensures both methods work
505
+ if( is_numeric( $key ) ) {
506
+ $key = $value['id'];
507
+ }
508
 
509
+ if( empty( $input[$key] ) ) {
510
+ unset( $quads_options[$key] );
511
+ }
512
+ }
513
+ }
514
 
 
 
 
515
 
516
+ // Merge our new settings with the existing
517
+ $output = array_merge( $quads_options, $input );
 
 
 
 
 
 
 
 
 
 
 
518
 
519
 
520
+ add_settings_error( 'quads-notices', '', __( 'Settings updated.', 'quick-adsense-reloaded' ), 'updated' );
 
521
 
522
+ return $output;
523
+ }
524
 
525
+ /**
526
+ * Sanitize all fields and remove whitespaces
527
+ *
528
+ * @since 1.5.3
529
+ * @param array $input The field value
530
+ * @return string $input Sanitizied value
531
+ */
532
+ function quads_sanitize_general_field( $input ){
533
+ if (!is_array( $input )){
534
+ return trim($input);
535
+ }
536
+ return array_map('quads_sanitize_general_field', $input);
537
  }
538
+ add_filter( 'quads_settings_sanitize', 'quads_sanitize_general_field' );
539
 
540
  /**
541
  * Sanitize text fields
545
  * @return string $input Sanitizied value
546
  */
547
  function quads_sanitize_text_field( $input ) {
548
+ return trim( $input );
549
  }
 
550
  add_filter( 'quads_settings_sanitize_text', 'quads_sanitize_text_field' );
551
 
552
  /**
558
  */
559
  function quads_get_settings_tabs() {
560
 
561
+ $settings = quads_get_registered_settings();
562
 
563
+ $tabs = array();
564
+ $tabs['general'] = __( 'General', 'quick-adsense-reloaded' );
565
 
566
+ if( !empty( $settings['visual'] ) ) {
567
+ $tabs['visual'] = __( 'Visual', 'quick-adsense-reloaded' );
568
+ }
569
 
570
+ if( !empty( $settings['networks'] ) ) {
571
+ //$tabs['networks'] = __( 'Social Networks', 'quick-adsense-reloaded' );
572
+ }
573
 
574
+ if( !empty( $settings['extensions'] ) ) {
575
+ $tabs['extensions'] = __( 'Add-On Setting', 'quick-adsense-reloaded' );
576
+ }
577
 
578
 
579
+ if( !empty( $settings['licenses'] ) && quads_is_extra() ) {
580
+ $tabs['licenses'] = __( 'Licenses', 'quick-adsense-reloaded' );
581
+ }
582
 
583
+ //$tabs['addons'] = __( 'Add-Ons', 'quick-adsense-reloaded' );
584
 
585
+ $tabs['imexport'] = __( 'Import/Export', 'quick-adsense-reloaded' );
586
 
587
+ $tabs['help'] = __( 'Help', 'quick-adsense-reloaded' );
588
 
589
+ //$tabs['misc'] = __( 'Misc', 'quick-adsense-reloaded' );
590
 
591
+ return apply_filters( 'quads_settings_tabs', $tabs );
592
  }
593
 
594
  /**
601
  * @return void
602
  */
603
  function quads_header_callback( $args ) {
604
+ if( !empty( $args['desc'] ) ) {
605
+ echo $args['desc'];
606
+ } else {
607
+ echo '&nbsp';
608
+ }
609
  }
610
 
611
  /**
619
  * @return void
620
  */
621
  function quads_checkbox_callback( $args ) {
622
+ global $quads_options;
623
 
624
+ $checked = isset( $quads_options[$args['id']] ) ? checked( 1, $quads_options[$args['id']], false ) : '';
625
+ $html = '<input type="checkbox" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']" value="1" ' . $checked . '/>';
626
+ $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
627
 
628
+ echo $html;
629
  }
630
+
631
  /**
632
  * Checkbox Callback
633
  *
639
  * @return void
640
  */
641
  function quads_checkbox_adsense_callback( $args ) {
642
+ global $quads_options;
643
 
644
+ $checked = isset( $quads_options[$args['id']] ) ? checked( 1, $quads_options[$args['id']], false ) : '';
645
+ $html = '<input type="checkbox" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']" value="1" ' . $checked . '/>';
646
+ $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
647
 
648
+ return $html;
649
  }
650
 
651
  /**
659
  * @return void
660
  */
661
  function quads_multicheck_callback( $args ) {
662
+ global $quads_options;
663
+
664
+ if( !empty( $args['options'] ) ) {
665
+ foreach ( $args['options'] as $key => $option ):
666
+ if( isset( $quads_options[$args['id']][$key] ) ) {
667
+ $enabled = $option;
668
+ } else {
669
+ $enabled = NULL;
670
+ }
671
+ echo '<input name="quads_settings[' . $args['id'] . '][' . $key . ']" id="quads_settings[' . $args['id'] . '][' . $key . ']" type="checkbox" value="' . $option . '" ' . checked( $option, $enabled, false ) . '/>&nbsp;';
672
+ echo '<label for="quads_settings[' . $args['id'] . '][' . $key . ']">' . $option . '</label><br/>';
673
+ endforeach;
674
+ echo '<p class="description quads_hidden">' . $args['desc'] . '</p>';
675
+ }
676
  }
677
 
678
  /**
686
  * @return void
687
  */
688
  function quads_radio_callback( $args ) {
689
+ global $quads_options;
690
 
691
+ foreach ( $args['options'] as $key => $option ) :
692
+ $checked = false;
693
 
694
+ if( isset( $quads_options[$args['id']] ) && $quads_options[$args['id']] == $key )
695
+ $checked = true;
696
+ elseif( isset( $args['std'] ) && $args['std'] == $key && !isset( $quads_options[$args['id']] ) )
697
+ $checked = true;
698
 
699
+ echo '<input name="quads_settings[' . $args['id'] . ']"" id="quads_settings[' . $args['id'] . '][' . $key . ']" type="radio" value="' . $key . '" ' . checked( true, $checked, false ) . '/>&nbsp;';
700
+ echo '<label for="quads_settings[' . $args['id'] . '][' . $key . ']">' . $option . '</label><br/>';
701
+ endforeach;
702
 
703
+ echo '<p class="description quads_hidden">' . $args['desc'] . '</p>';
704
  }
705
 
706
  /**
716
  * @return void
717
  */
718
  function quads_adtype_callback( $id, $args ) {
719
+ global $quads_options;
720
 
721
+ foreach ( $args['options'] as $key => $option ) :
722
+ $checked = false;
723
 
724
+ if( isset( $quads_options['ads'][$id]['ad_type'] ) && $quads_options['ads'][$id]['ad_type'] == $key )
725
+ $checked = true;
726
+ elseif( isset( $args['std'] ) && $args['std'] == $key && !isset( $quads_options['ads'][$id]['ad_type'] ) )
727
+ $checked = true;
728
 
729
+ echo '<input name="quads_settings[ads][' . $id . '][ad_type]" class="quads_adsense_type" id="quads_settings[ads][' . $id . '][ad_type_' . $key . ']" type="radio" value="' . $key . '" ' . checked( true, $checked, false ) . '/>&nbsp;';
730
+ echo '<label for="quads_settings[ads][' . $id . '][ad_type_' . $key . ']">' . $option . '</label>&nbsp;';
731
+ endforeach;
732
 
733
+ echo '<p class="description quads_hidden">' . $args['desc'] . '</p>';
734
  }
735
 
736
  /**
746
  * @return void
747
  */
748
  function quads_adposition_callback( $id, $args ) {
749
+ global $quads_options;
750
+
751
+ foreach ( $args['options'] as $key => $option ) :
752
+ $checked = false;
753
+
754
+ if( isset( $quads_options['ads'][$id]['align'] ) && $quads_options['ads'][$id]['align'] == $key )
755
+ $checked = true;
756
+ elseif( isset( $args['std'] ) && $args['std'] == $key && !isset( $quads_options['ads'][$id]['align'] ) )
757
+ $checked = true;
758
+
759
+ if( $key == '3' ) {
760
+ echo '<input name="quads_settings[ads][' . $id . '][align]" class="quads_adsense_align" id="quads_settings[ads][' . $id . '][align_' . $key . ']" type="radio" value="' . $key . '" ' . checked( true, $checked, false ) . '/>&nbsp;';
761
+ echo '<label for="quads_settings[ads][' . $id . '][align_' . $key . ']">Default</label>&nbsp;';
762
+ } else {
763
+ echo '<input name="quads_settings[ads][' . $id . '][align]" class="quads_adsense_positon" id="quads_settings[ads][' . $id . '][align_' . $key . ']" type="radio" value="' . $key . '" ' . checked( true, $checked, false ) . '/>&nbsp;';
764
+ echo '<label for="quads_settings[ads][' . $id . '][align_' . $key . ']"><img src="' . QUADS_PLUGIN_URL . 'assets/images/align_' . $key . '.png" width="75" height="56"></label>&nbsp;';
765
+ }
766
+
767
+ endforeach;
768
  }
769
 
770
  /**
777
  * @global $quads_options Array of all the QUADS Options
778
  * @return void
779
  */
780
+ //function quads_gateways_callback( $args ) {
781
+ // global $quads_options;
782
+ //
783
+ // foreach ( $args['options'] as $key => $option ) :
784
+ // if( isset( $quads_options['gateways'][$key] ) )
785
+ // $enabled = '1';
786
+ // else
787
+ // $enabled = null;
788
+ //
789
+ // echo '<input name="quads_settings[' . $args['id'] . '][' . $key . ']"" id="quads_settings[' . $args['id'] . '][' . $key . ']" type="checkbox" value="1" ' . checked( '1', $enabled, false ) . '/>&nbsp;';
790
+ // echo '<label for="quads_settings[' . $args['id'] . '][' . $key . ']">' . $option['admin_label'] . '</label><br/>';
791
+ // endforeach;
792
+ //}
793
 
794
  /**
795
  * Text Callback
802
  * @return void
803
  */
804
  function quads_text_callback( $args ) {
805
+ global $quads_options;
806
 
807
+ if( isset( $quads_options[$args['id']] ) )
808
+ $value = $quads_options[$args['id']];
809
+ else
810
+ $value = isset( $args['std'] ) ? $args['std'] : '';
811
 
812
+ $size = ( isset( $args['size'] ) && !is_null( $args['size'] ) ) ? $args['size'] : 'regular';
813
+ $html = '<input type="text" class="' . $size . '-text" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']" value="' . esc_attr( stripslashes( $value ) ) . '"/>';
814
+ $html .= '<label class="quads_hidden" class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
815
 
816
+ echo $html;
817
  }
818
 
819
  /**
827
  * @return void
828
  */
829
  function quads_number_callback( $args ) {
830
+ global $quads_options;
831
 
832
+ if( isset( $quads_options[$args['id']] ) )
833
+ $value = $quads_options[$args['id']];
834
+ else
835
+ $value = isset( $args['std'] ) ? $args['std'] : '';
836
 
837
+ $max = isset( $args['max'] ) ? $args['max'] : 999999;
838
+ $min = isset( $args['min'] ) ? $args['min'] : 0;
839
+ $step = isset( $args['step'] ) ? $args['step'] : 1;
840
 
841
+ $size = ( isset( $args['size'] ) && !is_null( $args['size'] ) ) ? $args['size'] : 'regular';
842
+ $html = '<input type="number" step="' . esc_attr( $step ) . '" max="' . esc_attr( $max ) . '" min="' . esc_attr( $min ) . '" class="' . $size . '-text" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']" value="' . esc_attr( stripslashes( $value ) ) . '"/>';
843
+ $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
844
 
845
+ echo $html;
846
  }
847
 
848
  /**
856
  * @return void
857
  */
858
  function quads_textarea_callback( $args ) {
859
+ global $quads_options;
860
 
861
+ if( isset( $quads_options[$args['id']] ) )
862
+ $value = $quads_options[$args['id']];
863
+ else
864
+ $value = isset( $args['std'] ) ? $args['std'] : '';
865
 
866
+ $size = ( isset( $args['size'] ) && !is_null( $args['size'] ) ) ? $args['size'] : '40';
867
+ $html = '<textarea class="large-text quads-textarea" cols="50" rows="' . $size . '" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']">' . esc_textarea( stripslashes( $value ) ) . '</textarea>';
868
+ $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
869
 
870
+ echo $html;
871
  }
872
 
 
873
  /**
874
  * Password Callback
875
  *
881
  * @return void
882
  */
883
  function quads_password_callback( $args ) {
884
+ global $quads_options;
885
 
886
+ if( isset( $quads_options[$args['id']] ) )
887
+ $value = $quads_options[$args['id']];
888
+ else
889
+ $value = isset( $args['std'] ) ? $args['std'] : '';
890
 
891
+ $size = ( isset( $args['size'] ) && !is_null( $args['size'] ) ) ? $args['size'] : 'regular';
892
+ $html = '<input type="password" class="' . $size . '-text" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']" value="' . esc_attr( $value ) . '"/>';
893
+ $html .= '<label for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
894
 
895
+ echo $html;
896
  }
897
 
898
  /**
905
  * @return void
906
  */
907
  function quads_missing_callback( $args ) {
908
+ printf( __( 'The callback function used for the <strong>%s</strong> setting is missing.', 'quick-adsense-reloaded' ), $args['id'] );
909
  }
910
 
911
  /**
919
  * @return void
920
  */
921
  function quads_select_callback( $args ) {
922
+ global $quads_options;
923
 
924
+ if( isset( $quads_options[$args['id']] ) )
925
+ $value = $quads_options[$args['id']];
926
+ else
927
+ $value = isset( $args['std'] ) ? $args['std'] : '';
928
 
929
+ $html = '<select id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']">';
930
 
931
+ foreach ( $args['options'] as $option => $name ) :
932
+ $selected = selected( $option, $value, false );
933
+ $html .= '<option value="' . $option . '" ' . $selected . '>' . $name . '</option>';
934
+ endforeach;
935
 
936
+ $html .= '</select>';
937
+ $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
938
+ $html .= '<br>' . $args['desc2'];
939
 
940
+ echo $html;
941
  }
942
+
943
  /**
944
  * AdSense Type Select Callback
945
  *
952
  * @return void
953
  */
954
  function quads_adense_select_callback( $id, $args ) {
955
+ global $quads_options;
956
+
957
+ if( isset( $quads_options['ads'][$id][$args['id']] ) )
958
+ $value = $quads_options['ads'][$id][$args['id']];
959
+ else
960
+ $value = isset( $args['std'] ) ? $args['std'] : '';
961
+
962
+
963
+ $size = !empty( $args['size'] ) ? $args['size'] : 'quads-medium-size';
964
+
965
+ $htmlNew = '<label class="quads_hidden" id="quads-label-' . $args['desc'] . '" for="quads_settings[ads][' . $id . '][' . $args['id'] . ']"> ' . $args['desc'] . ' </label>';
966
+ $htmlNew .= '<select class="quads-select-' . $args['desc'] . ' ' . $size . '" id="quads_settings[ads][' . $id . '][' . $args['id'] . ']" name="quads_settings[ads][' . $id . '][' . $args['id'] . ']" >';
967
+
968
+ foreach ( $args['options'] as $option => $name ) {
969
+ $selected = selected( $option, $value, false );
970
+ $htmlNew .= '<option value="' . $option . '" ' . $selected . '>' . $name . '</option>';
971
+ }
972
+
973
+ $htmlNew .= '</select>';
974
+ echo $htmlNew;
975
  }
976
 
977
  /**
985
  * @return void
986
  */
987
  function quads_color_select_callback( $args ) {
988
+ global $quads_options;
989
 
990
+ if( isset( $quads_options[$args['id']] ) )
991
+ $value = $quads_options[$args['id']];
992
+ else
993
+ $value = isset( $args['std'] ) ? $args['std'] : '';
994
 
995
+ $html = '<strong>#:</strong><input type="text" style="max-width:80px;border:1px solid #' . esc_attr( stripslashes( $value ) ) . ';border-right:20px solid #' . esc_attr( stripslashes( $value ) ) . ';" id="quads_settings[' . $args['id'] . ']" class="medium-text ' . $args['id'] . '" name="quads_settings[' . $args['id'] . ']" value="' . esc_attr( stripslashes( $value ) ) . '"/>';
996
 
997
+ $html .= '</select>';
998
+ $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
999
 
1000
+ echo $html;
1001
  }
1002
 
1003
  /**
1011
  * @global $wp_version WordPress Version
1012
  */
1013
  function quads_rich_editor_callback( $args ) {
1014
+ global $quads_options, $wp_version;
1015
+ if( isset( $quads_options[$args['id']] ) )
1016
+ $value = $quads_options[$args['id']];
1017
+ else
1018
+ $value = isset( $args['std'] ) ? $args['std'] : '';
1019
+
1020
+ if( $wp_version >= 3.3 && function_exists( 'wp_editor' ) ) {
1021
+ ob_start();
1022
+ wp_editor( stripslashes( $value ), 'quads_settings_' . $args['id'], array('textarea_name' => 'quads_settings[' . $args['id'] . ']', 'textarea_rows' => $args['textarea_rows']) );
1023
+ $html = ob_get_clean();
1024
+ } else {
1025
+ $html = '<textarea class="large-text quads-richeditor" rows="10" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']">' . esc_textarea( stripslashes( $value ) ) . '</textarea>';
1026
+ }
1027
+
1028
+ $html .= '<br/><label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1029
+
1030
+ echo $html;
1031
  }
1032
 
1033
  /**
1041
  * @return void
1042
  */
1043
  function quads_upload_callback( $args ) {
1044
+ global $quads_options;
1045
+
1046
+ if( isset( $quads_options[$args['id']] ) )
1047
+ $value = $quads_options[$args['id']];
1048
+ else
1049
+ $value = isset( $args['std'] ) ? $args['std'] : '';
1050
 
1051
+ $size = ( isset( $args['size'] ) && !is_null( $args['size'] ) ) ? $args['size'] : 'regular';
1052
+ $html = '<input type="text" class="' . $size . '-text quads_upload_field" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']" value="' . esc_attr( stripslashes( $value ) ) . '"/>';
1053
+ $html .= '<span>&nbsp;<input type="button" class="quads_settings_upload_button button-secondary" value="' . __( 'Upload File', 'quick-adsense-reloaded' ) . '"/></span>';
1054
+ $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1055
+
1056
+ echo $html;
1057
+ }
1058
 
 
 
 
 
1059
 
1060
+ /**
1061
+ * Check if extra settings are available
1062
+ *
1063
+ * @return boolean
1064
+ */
1065
+ function quads_is_extra() {
1066
+ if( function_exists( 'quads_extra' ) ) {
1067
+ return quads_extra();
1068
+ }
1069
+ return false;
1070
  }
1071
 
1072
  /**
1080
  * @return void
1081
  */
1082
  function quads_color_callback( $args ) {
1083
+ global $quads_options;
1084
 
1085
+ if( isset( $quads_options[$args['id']] ) )
1086
+ $value = $quads_options[$args['id']];
1087
+ else
1088
+ $value = isset( $args['std'] ) ? $args['std'] : '';
1089
 
1090
+ $default = isset( $args['std'] ) ? $args['std'] : '';
1091
 
1092
+ $size = ( isset( $args['size'] ) && !is_null( $args['size'] ) ) ? $args['size'] : 'regular';
1093
+ $html = '<input type="text" class="quads-color-picker" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']" value="' . esc_attr( $value ) . '" data-default-color="' . esc_attr( $default ) . '" />';
1094
+ $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1095
 
1096
+ echo $html;
1097
  }
1098
 
1099
  /**
1106
  */
1107
  if( !function_exists( 'quads_license_key_callback' ) ) {
1108
 
1109
+ function quads_license_key_callback( $args ) {
1110
+ global $quads_options;
1111
 
1112
+ $class = '';
1113
 
1114
+ $messages = array();
1115
+ $license = get_option( $args['options']['is_valid_license_option'] );
1116
 
1117
 
1118
+ if( isset( $quads_options[$args['id']] ) ) {
1119
+ $value = $quads_options[$args['id']];
1120
+ } else {
1121
+ $value = isset( $args['std'] ) ? $args['std'] : '';
1122
+ }
1123
 
1124
+ if( !empty( $license ) && is_object( $license ) ) {
1125
 
1126
+ // activate_license 'invalid' on anything other than valid, so if there was an error capture it
1127
+ if( false === $license->success ) {
1128
 
1129
+ switch ( $license->error ) {
1130
 
1131
+ case 'expired' :
1132
 
1133
+ $class = 'error';
1134
+ $messages[] = sprintf(
1135
+ __( 'Your license key expired on %s. Please <a href="%s" target="_blank" title="Renew your license key">renew your license key</a>.', 'quick-adsense-reloaded' ), date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ), 'http://wpquads.com/checkout/?edd_license_key=' . $value . '&utm_campaign=notice&utm_source=license_tab&utm_medium=admin&utm_content=license-expired'
1136
+ );
1137
 
1138
+ $license_status = 'quads-license-' . $class . '-notice';
1139
 
1140
+ break;
1141
 
1142
+ case 'missing' :
1143
 
1144
+ $class = 'error';
1145
+ $messages[] = sprintf(
1146
+ __( 'Invalid license. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> and verify it.', 'quick-adsense-reloaded' ), 'http://wpquads.com/your-account?utm_source=licenses-tab&utm_medium=admin&utm_content=invalid-license&utm_campaign=notice'
1147
+ );
1148
 
1149
+ $license_status = 'quads-license-' . $class . '-notice';
1150
 
1151
+ break;
1152
 
1153
+ case 'invalid' :
1154
+ case 'site_inactive' :
1155
 
1156
+ $class = 'error';
1157
+ $messages[] = sprintf(
1158
+ __( 'Your %s is not active for this URL. Please <a href="%s" target="_blank" title="Visit account page">visit your account page</a> to manage your license key URLs.', 'quick-adsense-reloaded' ), $args['name'], 'http://wpquads.com/your-account?utm_campaign=notice&utm_source=licenses-tab&utm_medium=admin&utm_content=invalid-license'
1159
+ );
1160
 
1161
+ $license_status = 'quads-license-' . $class . '-notice';
1162
 
1163
+ break;
1164
 
1165
+ case 'item_name_mismatch' :
1166
 
1167
+ $class = 'error';
1168
+ $messages[] = sprintf( __( 'This is not a %s.', 'quick-adsense-reloaded' ), $args['name'] );
1169
 
1170
+ $license_status = 'quads-license-' . $class . '-notice';
1171
 
1172
+ break;
1173
 
1174
+ case 'no_activations_left':
1175
 
1176
+ $class = 'error';
1177
+ $messages[] = sprintf( __( 'Your license key has reached its activation limit. <a href="%s" target="_blank">View possible upgrades</a> now.', 'quick-adsense-reloaded' ), 'http://wpquads.com/your-account?utm_campaign=notice&utm_source=licenses-tab&utm_medium=admin&utm_content=invalid-license' );
1178
 
1179
+ $license_status = 'quads-license-' . $class . '-notice';
1180
 
1181
+ break;
1182
+ }
1183
+ } else {
1184
 
1185
+ switch ( $license->license ) {
1186
 
1187
+ case 'valid' :
1188
+ default:
1189
 
1190
+ $class = 'valid';
1191
 
1192
+ $now = current_time( 'timestamp' );
1193
+ $expiration = strtotime( $license->expires, current_time( 'timestamp' ) );
1194
 
1195
+ if( 'lifetime' === $license->expires ) {
1196
 
1197
+ $messages[] = __( 'License key never expires.', 'quick-adsense-reloaded' );
1198
 
1199
+ $license_status = 'quads-license-lifetime-notice';
1200
+ } elseif( $expiration > $now && $expiration - $now < ( DAY_IN_SECONDS * 30 ) ) {
1201
 
1202
+ $messages[] = sprintf(
1203
+ __( 'Your license key expires soon! It expires on %s. <a href="%s" target="_blank" title="Renew license">Renew your license key</a>.', 'quick-adsense-reloaded' ), date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ), 'http://wpquads.com/checkout/?edd_license_key=' . $value . '&utm_campaign=notice&utm_source=licenses-tab&utm_medium=admin'
1204
+ );
1205
 
1206
+ $license_status = 'quads-license-expires-soon-notice';
1207
+ } else {
1208
 
1209
+ $messages[] = sprintf(
1210
+ __( 'Your license key expires on %s.', 'quick-adsense-reloaded' ), date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) )
1211
+ );
1212
 
1213
+ $license_status = 'quads-license-expiration-date-notice';
1214
+ }
1215
 
1216
+ break;
 
1217
  }
1218
+ }
1219
+ } else {
1220
+ $license_status = null;
1221
+ }
1222
 
1223
+ $size = ( isset( $args['size'] ) && !is_null( $args['size'] ) ) ? $args['size'] : 'regular';
1224
+ $html = '<input type="text" class="' . sanitize_html_class( $size ) . '-text" id="quads_settings[' . quads_sanitize_key( $args['id'] ) . ']" name="quads_settings[' . quads_sanitize_key( $args['id'] ) . ']" value="' . esc_attr( $value ) . '"/>';
1225
 
1226
+ if( ( is_object( $license ) && 'valid' == $license->license ) || 'valid' == $license ) {
1227
+ $html .= '<input type="submit" class="button-secondary" name="' . $args['id'] . '_deactivate" value="' . __( 'Deactivate License', 'quick-adsense-reloaded' ) . '"/>';
1228
+ }
1229
 
1230
+ $html .= '<label for="quads_settings[' . quads_sanitize_key( $args['id'] ) . ']"> ' . wp_kses_post( $args['desc'] ) . '</label>';
1231
 
1232
+ if( !empty( $messages ) ) {
1233
+ foreach ( $messages as $message ) {
1234
 
1235
+ $html .= '<div class="quads-license-data quads-license-' . $class . '">';
1236
+ $html .= '<p>' . $message . '</p>';
1237
+ $html .= '</div>';
1238
+ }
1239
+ }
1240
 
1241
+ wp_nonce_field( quads_sanitize_key( $args['id'] ) . '-nonce', quads_sanitize_key( $args['id'] ) . '-nonce' );
1242
 
1243
+ if( isset( $license_status ) ) {
1244
+ echo '<div class="' . $license_status . '">' . $html . '</div>';
1245
+ } else {
1246
+ echo '<div class="quads-license-null">' . $html . '</div>';
1247
+ }
1248
+ }
1249
 
1250
  }
1251
 
1257
  * @return html
1258
  */
1259
  function quads_addons_callback( $args ) {
1260
+ $html = quads_add_ons_page();
1261
+ echo $html;
1262
  }
1263
 
1264
  /**
1269
  * @return html
1270
  */
1271
  function quads_imexport_callback( $args ) {
1272
+ $html = quads_tools_import_export_display();
1273
+ $html .= quads_import_quick_adsense_settings();
1274
+ echo $html;
1275
  }
1276
 
1277
  /**
1282
  * @return html
1283
  */
1284
  function quads_systeminfo_callback( $args ) {
1285
+ $html = quads_tools_sysinfo_display();
1286
+ echo $html;
1287
  }
1288
 
1289
  /**
1295
  * @return void
1296
  */
1297
  function quads_upload_image_callback( $args ) {
1298
+ global $quads_options;
1299
 
1300
+ if( isset( $quads_options[$args['id']] ) )
1301
+ $value = $quads_options[$args['id']];
1302
+ else
1303
+ $value = isset( $args['std'] ) ? $args['std'] : '';
1304
 
1305
+ $size = ( isset( $args['size'] ) && !is_null( $args['size'] ) ) ? $args['size'] : 'regular';
1306
+ $html = '<input type="text" class="' . $size . '-text ' . $args['id'] . '" id="quads_settings[' . $args['id'] . ']" name="quads_settings[' . $args['id'] . ']" value="' . esc_attr( $value ) . '"/>';
1307
 
1308
+ $html .= '<input type="submit" class="button-secondary quads_upload_image" name="' . $args['id'] . '_upload" value="' . __( 'Select Image', 'quick-adsense-reloaded' ) . '"/>';
1309
 
1310
+ $html .= '<label class="quads_hidden" for="quads_settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1311
 
1312
+ echo $html;
1313
  }
1314
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1315
  /*
1316
  * Note Callback
1317
  *
1324
  */
1325
 
1326
  function quads_note_callback( $args ) {
1327
+ global $quads_options;
1328
+ $html = '';
1329
+ echo $html;
 
1330
  }
1331
 
1332
  /**
1338
  * @scince 2.3.2
1339
  */
1340
  function quads_add_content_callback( $args ) {
1341
+ global $quads_options;
1342
+
1343
+ $html = '<div id="quadstabcontainer" class="tabcontent_container"><ul class="quadstabs" style="width:99%;max-width:500px;">';
1344
+ foreach ( $args['options'] as $option => $name ) :
1345
+ $html .= '<li class="quadstab" style="float:left;margin-right:4px;"><a href="#' . $name['id'] . '">' . $name['name'] . '</a></li>';
1346
+ endforeach;
1347
+ $html .= '</ul>';
1348
+ $html .= '<div class="quadstab-container">';
1349
+ foreach ( $args['options'] as $option => $name ) :
1350
+ $value = isset( $quads_options[$name['id']] ) ? $quads_options[$name['id']] : '';
1351
+ $textarea = '<textarea class="large-text quads-textarea" cols="50" rows="15" id="quads_settings[' . $name['id'] . ']" name="quads_settings[' . $name['id'] . ']">' . esc_textarea( stripslashes( $value ) ) . '</textarea>';
1352
+ $html .= '<div id="' . $name['id'] . '" style="max-width:500px;"><span style="padding-top:60px;display:block;">' . $name['desc'] . ':</span><br>' . $textarea . '</div>';
1353
+ endforeach;
1354
+ $html .= '</div>';
1355
+ $html .= '</div>';
1356
+ echo $html;
1357
  }
1358
 
1359
  /**
1366
  * @return void
1367
  */
1368
  function quads_hook_callback( $args ) {
1369
+ do_action( 'quads_' . $args['id'] );
1370
  }
1371
 
1372
  /**
1376
  * @return string capability required
1377
  */
1378
  function quads_set_settings_cap() {
1379
+ return 'manage_options';
1380
  }
1381
 
1382
  add_filter( 'option_page_capability_quads_settings', 'quads_set_settings_cap' );
1391
  */
1392
 
1393
  function quads_cache_status() {
1394
+ global $quads_options;
1395
+ if( isset( $quads_options['disable_cache'] ) ) {
1396
+ return ' <strong style="color:red;">' . __( 'Transient Cache disabled! Enable it for performance increase.', 'quick-adsense-reloaded' ) . '</strong> ';
1397
+ }
1398
  }
1399
 
1400
  /* Permission check if logfile is writable
1404
  */
1405
 
1406
  function quads_log_permissions() {
1407
+ global $quads_options;
1408
+ if( !$quads->logger->checkDir() ) {
1409
+ return '<br><strong style="color:red;">' . __( 'Log file directory not writable! Set FTP permission to 755 or 777 for /wp-content/plugins/quadssharer/logs/', 'quick-adsense-reloaded' ) . '</strong> <br> Read here more about <a href="http://codex.wordpress.org/Changing_File_Permissions" target="_blank">file permissions</a> ';
1410
+ }
1411
  }
1412
 
1413
  /**
1417
  * @return array
1418
  */
1419
  function quads_get_ads() {
1420
+ global $quads_options;
1421
+
1422
+ if (!isset($quads_options['ads']) && 0 === count( $quads_options['ads'] ) ) {
1423
+ return array();
1424
+ }
1425
+
1426
+ // Start array with
1427
+ $arrHeader = array ( 0 => __( 'Random Ads', 'quick-adsense-reloaded' ) );
1428
+
1429
+ $ads = array();
1430
+
1431
+ foreach ( $quads_options['ads'] as $key => $value ){
1432
+ // Skip all widget ads
1433
+ if ( false !== strpos($key, '_widget') ){
1434
+ continue;
1435
+ }
1436
+ // Create array
1437
+ if (!empty( $value['label'] ) ) {
1438
+ $ads[] = $value['label'];
1439
+ } else {
1440
+ $ads[] = $key;
1441
+ }
1442
+
1443
+ }
1444
+
1445
+ return array_merge($arrHeader, $ads);
1446
+
1447
+ // $ads = array(
1448
+ // 0 => __( 'Random Ads', 'quick-adsense-reloaded' ),
1449
+ // 1 => isset( $quads_options['ads']['ad1']['label'] ) ? $quads_options['ads']['ad1']['label'] : 'ad1',
1450
+ // 2 => isset( $quads_options['ads']['ad2']['label'] ) ? $quads_options['ads']['ad2']['label'] : 'ad2',
1451
+ // 3 => isset( $quads_options['ads']['ad3']['label'] ) ? $quads_options['ads']['ad3']['label'] : 'ad3',
1452
+ // 4 => isset( $quads_options['ads']['ad4']['label'] ) ? $quads_options['ads']['ad4']['label'] : 'ad4',
1453
+ // 5 => isset( $quads_options['ads']['ad5']['label'] ) ? $quads_options['ads']['ad5']['label'] : 'ad5',
1454
+ // 6 => isset( $quads_options['ads']['ad6']['label'] ) ? $quads_options['ads']['ad6']['label'] : 'ad6',
1455
+ // 7 => isset( $quads_options['ads']['ad7']['label'] ) ? $quads_options['ads']['ad7']['label'] : 'ad7',
1456
+ // 8 => isset( $quads_options['ads']['ad8']['label'] ) ? $quads_options['ads']['ad8']['label'] : 'ad8',
1457
+ // 9 => isset( $quads_options['ads']['ad9']['label'] ) ? $quads_options['ads']['ad9']['label'] : 'ad9',
1458
+ // 10 => isset( $quads_option['ads']['ad10']['label'] ) ? $quads_options['ads']['ad10']['label'] : 'ad10',
1459
+ // );
1460
+ //return $ads;
1461
  }
1462
 
1463
  /**
1468
  */
1469
  function quads_get_values() {
1470
 
1471
+ $array = array(1);
1472
+ for ( $i = 1; $i <= 50; $i++ ) {
1473
+ $array[] = $i;
1474
+ }
1475
+ unset( $array[0] ); // remove the 0 and start the array with 1
1476
+ return $array;
1477
  }
1478
 
1479
  /**
1487
  * @return void
1488
  */
1489
  function quads_visibility_callback( $args ) {
1490
+ global $quads_options, $quads;
1491
+
1492
+ $html = $quads->html->checkbox( array('name' => 'quads_settings[visibility][AppHome]', 'current' => !empty( $quads_options['visibility']['AppHome'] ) ? $quads_options['visibility']['AppHome'] : null, 'class' => 'quads-checkbox') ) . __( 'Homepage ', 'quick-adsense-reloaded' );
1493
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[visibility][AppCate]', 'current' => !empty( $quads_options['visibility']['AppCate'] ) ? $quads_options['visibility']['AppCate'] : null, 'class' => 'quads-checkbox') ) . __( 'Categories ', 'quick-adsense-reloaded' );
1494
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[visibility][AppArch]', 'current' => !empty( $quads_options['visibility']['AppArch'] ) ? $quads_options['visibility']['AppArch'] : null, 'class' => 'quads-checkbox') ) . __( 'Archives ', 'quick-adsense-reloaded' );
1495
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[visibility][AppTags]', 'current' => !empty( $quads_options['visibility']['AppTags'] ) ? $quads_options['visibility']['AppTags'] : null, 'class' => 'quads-checkbox') ) . __( 'Tags', 'quick-adsense-reloaded' ) . '<br>';
1496
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[visibility][AppSide]', 'current' => !empty( $quads_options['visibility']['AppSide'] ) ? $quads_options['visibility']['AppSide'] : null, 'class' => 'quads-checkbox') ) . __( 'Hide Ad Widgets on Homepage', 'quick-adsense-reloaded' ) . '<br>';
1497
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[visibility][AppLogg]', 'current' => !empty( $quads_options['visibility']['AppLogg'] ) ? $quads_options['visibility']['AppLogg'] : null, 'class' => 'quads-checkbox') ) . __( 'Hide Ads when user is logged in.', 'quick-adsense-reloaded' ) . '<br>';
1498
+
1499
+ echo $html;
 
 
 
 
 
1500
  }
1501
 
1502
  /**
1510
  * @return void
1511
  */
1512
  function quads_ad_position_callback( $args ) {
1513
+ global $quads_options, $quads;
1514
+
1515
+
1516
+ // Pos 1
1517
+ $html = $quads->html->checkbox( array('name' => 'quads_settings[pos1][BegnAds]', 'current' => !empty( $quads_options['pos1']['BegnAds'] ) ? $quads_options['pos1']['BegnAds'] : null, 'class' => 'quads-checkbox quads-assign') );
1518
+ $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1519
+ $html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos1][BegnRnd]', 'name' => 'quads_settings[pos1][BegnRnd]', 'selected' => !empty( $quads_options['pos1']['BegnRnd'] ) ? $quads_options['pos1']['BegnRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1520
+ $html .= ' ' . __( 'to <strong>Beginning of Post</strong>', 'quick-adsense-reloaded' ) . '</br>';
1521
+
1522
+ // Pos 2
1523
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos2][MiddAds]', 'current' => !empty( $quads_options['pos2']['MiddAds'] ) ? $quads_options['pos2']['MiddAds'] : null, 'class' => 'quads-checkbox quads-assign') );
1524
+ $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1525
+ $html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos2][MiddRnd]', 'name' => 'quads_settings[pos2][MiddRnd]', 'selected' => !empty( $quads_options['pos2']['MiddRnd'] ) ? $quads_options['pos2']['MiddRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1526
+ $html .= ' ' . __( 'to <strong>Middle of Post</strong>', 'quick-adsense-reloaded' ) . '</br>';
1527
+
1528
+ // Pos 3
1529
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos3][EndiAds]', 'current' => !empty( $quads_options['pos3']['EndiAds'] ) ? $quads_options['pos3']['EndiAds'] : null, 'class' => 'quads-checkbox quads-assign') );
1530
+ $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1531
+ $html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos3][EndiRnd]', 'name' => 'quads_settings[pos3][EndiRnd]', 'selected' => !empty( $quads_options['pos3']['EndiRnd'] ) ? $quads_options['pos3']['EndiRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1532
+ $html .= ' ' . __( 'to <strong>End of Post</strong>', 'quick-adsense-reloaded' ) . '</br>';
1533
+
1534
+ // Pos 4
1535
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos4][MoreAds]', 'current' => !empty( $quads_options['pos4']['MoreAds'] ) ? $quads_options['pos4']['MoreAds'] : null, 'class' => 'quads-checkbox quads-assign') );
1536
+ $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1537
+ $html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos4][MoreRnd]', 'name' => 'quads_settings[pos4][MoreRnd]', 'selected' => !empty( $quads_options['pos4']['MoreRnd'] ) ? $quads_options['pos4']['MoreRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1538
+ $html .= ' ' . __( 'right after <strong>the <span style="font-family:Courier New,Courier,Fixed;">&lt;!--more--&gt;</span> tag</strong>', 'quick-adsense-reloaded' ) . '</br>';
1539
+
1540
+ // Pos 5
1541
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos5][LapaAds]', 'current' => !empty( $quads_options['pos5']['LapaAds'] ) ? $quads_options['pos5']['LapaAds'] : null, 'class' => 'quads-checkbox quads-assign') );
1542
+ $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1543
+ $html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos5][LapaRnd]', 'name' => 'quads_settings[pos5][LapaRnd]', 'selected' => !empty( $quads_options['pos5']['LapaRnd'] ) ? $quads_options['pos5']['LapaRnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1544
+ $html .= ' ' . __( 'right before <strong>the last Paragraph</strong>', 'quick-adsense-reloaded' ) . ' </br>';
1545
+
1546
+ // Pos 6
1547
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos6][Par1Ads]', 'current' => !empty( $quads_options['pos6']['Par1Ads'] ) ? $quads_options['pos6']['Par1Ads'] : null, 'class' => 'quads-checkbox quads-assign') );
1548
+ $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1549
+ $html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos6][Par1Rnd]', 'name' => 'quads_settings[pos6][Par1Rnd]', 'selected' => !empty( $quads_options['pos6']['Par1Rnd'] ) ? $quads_options['pos6']['Par1Rnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1550
+ $html .= ' ' . __( '<strong>After Paragraph</strong>', 'quick-adsense-reloaded' ) . ' ';
1551
+ $html .= $quads->html->select( array('options' => quads_get_values(), 'class' => 'quads-paragraph', 'id' => 'quads_settings[pos6][Par1Nup]', 'name' => 'quads_settings[pos6][Par1Nup]', 'selected' => !empty( $quads_options['pos6']['Par1Nup'] ) ? $quads_options['pos6']['Par1Nup'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1552
+ $html .= ' ' . __( '→', 'quick-adsense-reloaded' ) . ' ';
1553
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos6][Par1Con]', 'current' => !empty( $quads_options['pos6']['Par1Con'] ) ? $quads_options['pos6']['Par1Con'] : null, 'class' => 'quads-checkbox quads-assign') );
1554
+ $html .= ' ' . __( 'to <strong>End of Post</strong> if fewer paragraphs are found.', 'quick-adsense-reloaded' ) . ' </br>';
1555
+
1556
+ // Pos 7
1557
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos7][Par2Ads]', 'current' => !empty( $quads_options['pos7']['Par2Ads'] ) ? $quads_options['pos7']['Par2Ads'] : null, 'class' => 'quads-checkbox quads-assign') );
1558
+ $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1559
+ $html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos7][Par2Rnd]', 'name' => 'quads_settings[pos7][Par2Rnd]', 'selected' => !empty( $quads_options['pos7']['Par2Rnd'] ) ? $quads_options['pos7']['Par2Rnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1560
+ $html .= ' ' . __( '<strong>After Paragraph</strong>', 'quick-adsense-reloaded' ) . ' ';
1561
+ $html .= $quads->html->select( array('options' => quads_get_values(), 'id' => 'quads_settings[pos7][Par2Nup]', 'name' => 'quads_settings[pos7][Par2Nup]', 'selected' => !empty( $quads_options['pos7']['Par2Nup'] ) ? $quads_options['pos7']['Par2Nup'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1562
+ $html .= ' ' . __( '→', 'quick-adsense-reloaded' ) . ' ';
1563
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos7][Par2Con]', 'current' => !empty( $quads_options['pos7']['Par2Con'] ) ? $quads_options['pos7']['Par2Con'] : null, 'class' => 'quads-checkbox quads-assign') );
1564
+ $html .= ' ' . __( 'to <strong>End of Post</strong> if fewer paragraphs are found.', 'quick-adsense-reloaded' ) . ' </br>';
1565
+
1566
+ // Pos 8
1567
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos8][Par3Ads]', 'current' => !empty( $quads_options['pos8']['Par3Ads'] ) ? $quads_options['pos8']['Par3Ads'] : null, 'class' => 'quads-checkbox quads-assign') );
1568
+ $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1569
+ $html .= $quads->html->select( array('options' => quads_get_ads(), 'id' => 'quads_settings[pos8][Par3Rnd]', 'name' => 'quads_settings[pos8][Par3Rnd]', 'selected' => !empty( $quads_options['pos8']['Par3Rnd'] ) ? $quads_options['pos8']['Par3Rnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1570
+ $html .= ' ' . __( '<strong>After Paragraph</strong>', 'quick-adsense-reloaded' ) . ' ';
1571
+ $html .= $quads->html->select( array('options' => quads_get_values(), 'id' => 'quads_settings[pos8][Par3Nup]', 'name' => 'quads_settings[pos8][Par3Nup]', 'selected' => !empty( $quads_options['pos8']['Par3Nup'] ) ? $quads_options['pos8']['Par3Nup'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1572
+ $html .= ' ' . __( '→', 'quick-adsense-reloaded' ) . ' ';
1573
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos8][Par3Con]', 'current' => !empty( $quads_options['pos8']['Par3Con'] ) ? $quads_options['pos8']['Par3Con'] : null, 'class' => 'quads-checkbox quads-assign') );
1574
+ $html .= ' ' . __( 'to <strong>End of Post</strong> if fewer paragraphs are found.', 'quick-adsense-reloaded' ) . ' </br>';
1575
+
1576
+ $html .= apply_filters( 'quads_extra_paragraph', '' );
1577
+
1578
+ // Pos 9
1579
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos9][Img1Ads]', 'current' => !empty( $quads_options['pos9']['Img1Ads'] ) ? $quads_options['pos9']['Img1Ads'] : null, 'class' => 'quads-checkbox quads-assign') );
1580
+ $html .= ' ' . __( 'Assign', 'quick-adsense-reloaded' ) . ' ';
1581
+ $html .= $quads->html->select( array('options' => quads_get_ads(), 'name' => 'quads_settings[pos9][Img1Rnd]', 'selected' => !empty( $quads_options['pos9']['Img1Rnd'] ) ? $quads_options['pos9']['Img1Rnd'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1582
+ $html .= ' ' . __( '<strong>After Image</strong>', 'quick-adsense-reloaded' ) . ' ';
1583
+ $html .= $quads->html->select( array('options' => quads_get_values(), 'id' => 'quads_settings[pos9][Img1Nup]', 'name' => 'quads_settings[pos9][Img1Nup]', 'selected' => !empty( $quads_options['pos9']['Img1Nup'] ) ? $quads_options['pos9']['Img1Nup'] : null, 'show_option_all' => false, 'show_option_none' => false) );
1584
+ $html .= ' ' . __( '→', 'quick-adsense-reloaded' ) . ' ';
1585
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[pos9][Img1Con]', 'current' => !empty( $quads_options['pos9']['Img1Con'] ) ? $quads_options['pos9']['Img1Con'] : null, 'class' => 'quads-checkbox quads-assign') );
1586
+ $html .= ' ' . __( 'after <b>Image\'s outer</b><b><span style="font-family:Courier New,Courier,Fixed;"> &lt;div&gt; wp-caption</span></b> if any.', 'quick-adsense-reloaded' ) . ' </br>';
1587
+
1588
+ echo apply_filters( 'quads_ad_position_callback', $html );
1589
  }
1590
 
1591
  /**
1599
  * @return void
1600
  */
1601
  function quads_quicktags_callback( $args ) {
1602
+ global $quads_options, $quads;
1603
 
1604
+ // Quicktags info
1605
+ $html = '<div style="margin-bottom:5px;"><strong>Optional: </strong><a href="#" id="quads_insert_ads_action">' . __( ' Insert Ads into a post, on-the-fly', 'quick-adsense-reloaded' ) . '</a></br>' .
1606
+ '<ol style="margin-top:5px;display:none;" id="quads_insert_ads_box">
1607
  <li>' . __( 'Insert <span class="quads-quote-docs">&lt;!--Ads1--&gt;</span>, <span class="quads-quote-docs">&lt;!--Ads2--&gt;</span>, etc. into a post to show the <b>Particular Ads</b> at specific location.', 'quick-adsense-reloaded' ) . '</li>
1608
  <li>' . __( 'Insert <span class="quads-quote-docs">&lt;!--RndAds--&gt;</span> into a post to show the <b>Random Ads</b> at specific location', 'quick-adsense-reloaded' ) . '</li>
1609
  </ol></div>';
1610
 
1611
+ $html .= $quads->html->checkbox( array('name' => 'quads_settings[quicktags][QckTags]', 'current' => !empty( $quads_options['quicktags']['QckTags'] ) ? $quads_options['quicktags']['QckTags'] : null, 'class' => 'quads-checkbox') );
1612
+ $html .= __( 'Show Quicktag Buttons on the HTML Post Editor', 'quick-adsense-reloaded' ) . '</br>';
1613
+ $html .= '<span class="quads-desc">' . __( 'Tags can be inserted into a post via the additional Quicktag Buttons at the HTML Edit Post SubPanel.', 'quick-adsense-reloaded' ) . '</span>';
1614
+ echo $html;
1615
  }
1616
 
1617
  /**
1618
+ * Add new ad
1619
+ * @global array $quads_options
 
 
 
 
 
 
1620
  */
1621
+ function quads_ajax_add_ads(){
1622
+ global $quads_options;
1623
+
1624
+ $postCount = !empty($_POST['count']) ? $_POST['count'] : 1;
1625
+ //wp_die($postCount);
1626
+
1627
+ $count = isset($quads_options['ads']) ? count ($quads_options['ads']) + $postCount : 10 + $postCount;
1628
+
1629
+ $args = array();
1630
+ // subtract 10 widget ads
1631
+ $args['id'] = $count-10;
1632
+ $args['name'] = 'Ad ' . $args['id'];
1633
+
1634
+ ob_start();
1635
+ // ... get the content ...
1636
+ quads_adsense_code_callback( $args );
1637
+ $content = ob_get_contents();
1638
+ ob_end_clean();
1639
+
1640
+ $html = '<tr><td>';
1641
+ $html.= $content;
1642
+ $html.= '</td></tr>';
1643
+ echo $html;
1644
+ die();
1645
+ }
1646
+ add_action( 'wp_ajax_quads_ajax_add_ads', 'quads_ajax_add_ads' );
1647
 
1648
+ /**
1649
+ * Count normal ads. Do not count widget ads
1650
+ *
1651
+ * @global array $quads_options
1652
+ * @return int
1653
+ */
1654
+ function quads_count_normal_ads() {
1655
+ global $quads_options;
1656
+
1657
+ if(!isset($quads_options['ads'])){
1658
+ return 0;
1659
+ }
1660
+
1661
+ // Count normal ads - not widget ads
1662
+ $adsCount = 0;
1663
+ $id = 1;
1664
+ foreach ( $quads_options['ads'] as $ads => $value ) {
1665
+ // Skip if its a widget ad
1666
+ if( strpos( $ads, 'ad' . $id ) === 0 && false === strpos( $ads, 'ad' . $id . '_widget' ) ) {
1667
+ $adsCount++;
1668
+ }
1669
+ $id++;
1670
+ }
1671
+ return $adsCount;
1672
+ }
1673
+
1674
+ function quads_new_ad_callback(){
1675
+ echo '<a href="#" id="quads-add-new-ad">' . __('Add New Ad','quick-adsense-reloaded') . '</a>';
1676
+ }
1677
+
1678
+ /**
1679
+ * Render all ad relevant settings (ADSENSE CODE tab)
1680
+ * No widget ads
1681
+ * @global $quads_options $quads_options
1682
+ */
1683
+ function quads_ad_code_callback(){
1684
+ global $quads_options;
1685
+
1686
+ $args = array();
1687
+
1688
+ $i = 1;
1689
+ // Render 10 default ads if there are less than 10 ads stored or none at all
1690
+ if( quads_count_normal_ads() < 10 || !quads_is_extra()) {
1691
+ //wp_die('t2');
1692
+ while ( $i <= 10 ) {
1693
+
1694
+ $id = $i++;
1695
+
1696
+ $args['id'] = $id;
1697
+
1698
+ $args['desc'] = '';
1699
+
1700
+ $args['name'] = !empty( $quads_options['ads']['ad' . $id]['label'] ) ? $quads_options['ads']['ad' . $id]['label'] : 'Ad ' . $id;
1701
+
1702
+ echo '<tr><td>';
1703
+ echo quads_adsense_code_callback( $args );
1704
+ echo '</td></tr>';
1705
+
1706
+ }
1707
+
1708
+ // Stop here early
1709
+ return true;
1710
+ }
1711
+
1712
+ // Else render 10 + n ads
1713
+ $i = 1;
1714
+ foreach ($quads_options['ads'] as $ads => $value ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1715
 
1716
+ $id = $i++;
1717
+
1718
+ $args['id'] = $id;
1719
+
1720
+ $args['desc'] = '';
1721
+
1722
+ $args['name'] = !empty($quads_options['ads']['ad' . $id]['label']) ? $quads_options['ads']['ad' . $id]['label'] : 'Ad ' . $id;
1723
+
1724
+ // Skip if its a widget ad
1725
+ if ( (strpos($ads, 'ad' . $id) === 0) && (false === strpos($ads, 'ad' . $id . '_widget') ) ){
1726
+ echo '<tr><td>';
1727
+ echo quads_adsense_code_callback( $args );
1728
+ echo '</td></tr>';
1729
+ }
1730
+
1731
+ }
1732
  }
1733
+
1734
  /**
1735
+ * AdSense Code Callback
1736
  *
1737
  * Renders adsense code fields
1738
  *
1741
  * @global $quads_options Array of all the QUADS Options
1742
  * @return void
1743
  */
1744
+ function quads_adsense_code_callback( $args ) {
1745
+ global $quads_options;
1746
+
1747
+ $new_label = isset( $quads_options['ads']['ad'.$args['id']]['label'] ) ? $quads_options['ads']['ad'.$args['id']]['label'] : '';
1748
+
1749
+ $label = !empty( $new_label ) ? $new_label : $args['name'];
1750
+
1751
+ $code = isset( $quads_options['ads']['ad'.$args['id']]['code'] ) ? $quads_options['ads']['ad'.$args['id']]['code'] : '';
1752
+
1753
+ $margin = isset( $quads_options['ads']['ad'.$args['id']]['margin'] ) ? esc_attr( stripslashes( $quads_options['ads']['ad'.$args['id']]['margin'] ) ) : 0;
1754
+
1755
+ $g_data_ad_client = isset( $quads_options['ads']['ad'. $args['id']]['g_data_ad_client'] ) ? $quads_options['ads']['ad'. $args['id']]['g_data_ad_client'] : '';
1756
+
1757
+ $g_data_ad_slot = isset( $quads_options['ads']['ad'. $args['id']]['g_data_ad_slot'] ) ? $quads_options['ads']['ad'. $args['id']]['g_data_ad_slot'] : '';
1758
+
1759
+ $g_data_ad_width = isset( $quads_options['ads']['ad'. $args['id']]['g_data_ad_width'] ) ? $quads_options['ads']['ad'. $args['id']]['g_data_ad_width'] : '';
1760
+
1761
+ $g_data_ad_height = isset( $quads_options['ads']['ad'. $args['id']]['g_data_ad_height'] ) ? $quads_options['ads']['ad'. $args['id']]['g_data_ad_height'] : '';
1762
+
1763
+ //$args['desc'] = __( '<strong>Shortcode:</strong> [quads id="'.$args['id'].'"] | <strong>PHP:</strong> echo do_shortcode(\'[quads id="'.$args['id'].'"]\');', 'quick-adsense-reloaded' );
1764
+
1765
+ //$label = !empty($new_label) ? $new_label :
1766
+ // Create a shorter var to make HTML cleaner
1767
+ $id = 'ad' . $args['id'];
1768
+ ?>
1769
+ <div class="quads-ad-toggle-header quads-box-close" data-box-id="quads-toggle<?php echo $id; ?>">
1770
+ <div class="quads-toogle-title"><span contenteditable="true" id="quads-ad-label-<?php echo $id; ?>"><?php echo $label; ?></span><input type="hidden" class="quads-input-label" id="" name="quads_settings[ads][<?php echo $id; ?>][label]" value="<?php echo $new_label; ?>"></div>
1771
+ <a class="quads-toggle" data-box-id="quads-toggle<?php echo $id; ?>" href="#"><div class="quads-close-open-icon"></div></a>
1772
+ </div>
1773
+ <div class="quads-ad-toggle-container" id="quads-toggle<?php echo $id; ?>" style="display:none;">
1774
+ <div>
1775
+ <?php
1776
+ $args_ad_type = array(
1777
+ 'id' => 'ad_type',
1778
+ 'name' => 'Type',
1779
+ 'desc' => '',
1780
+ 'std' => 'plain_text',
1781
+ 'options' => array(
1782
+ 'adsense' => 'AdSense',
1783
+ 'plain_text' => 'Plain Text / HTML / JS'
1784
+ )
1785
+ );
1786
+ echo quads_adtype_callback( $id, $args_ad_type );
1787
+ ?>
1788
+ </div>
1789
+ <textarea style="vertical-align:top;margin-right:20px;" class="large-text quads-textarea" cols="50" rows="10" id="quads_settings[ads][<?php echo $id; ?>][code]" name="quads_settings[ads][<?php echo $id; ?>][code]"><?php echo esc_textarea( stripslashes( $code ) ); ?></textarea>
1790
+ <!--<label for="quads_settings[ads][ <?php //echo $id; ?> ][code]"> <?php //echo $args['desc']; ?></label><br>//-->
1791
+ <label for="quads_shortcode_<?php echo $args['id'];?>">Post Shortcode:</label><input readonly id="quads_shortcode_<?php echo $args['id'];?>" type="text" onclick="this.focus(); this.select()" value='[quads id=<?php echo $args['id'];?>]' title="Copy and paste the shortcode into the post editor, click below then press Ctrl + C (PC) or Cmd + C (Mac).">
1792
+ <label for="quads_php_shortcode_<?php echo $args['id'];?>">PHP:</label><input readonly id="quads_php_shortcode_<?php echo $args['id'];?>" type="text" onclick="this.focus(); this.select()" style="width:290px;" value="&lt;?php echo do_shortcode('[quads id=<?php echo $args['id']; ?>]'); ?&gt;" title="Copy and paste the PHP code into your theme files, click below then press Ctrl + C (PC) or Cmd + C (Mac).">
1793
+ <br>
1794
+ <div class="quads_adsense_code">
1795
+ <input type="button" style="vertical-align:inherit;" class="button button-primary quads-add-adsense" value="Copy / Paste AdSense Code"> <span>or add Ad Slot ID & Publisher ID manually below:</span>
1796
+ <br />
1797
+ <?php //echo __('Generate Ad Slot & Publisher ID automatically from your adsense code', 'quick-adsense-reloaded') ?>
1798
+ <label class="quads-label-left" for="quads_settings[ads][<?php echo $id; ?>][g_data_ad_slot]">Ad Slot ID </label><input type="text" class="quads-medium-size quads-bggrey" id="quads_settings[ads][<?php echo $id; ?>][g_data_ad_slot]" name="quads_settings[ads][<?php echo $id; ?>][g_data_ad_slot]" value="<?php echo $g_data_ad_slot; ?>">
1799
+ <label for="quads_settings[ads][<?php echo $id; ?>][g_data_ad_client]">Publisher ID</label><input type="text" id="quads_settings[ads][<?php echo $id; ?>][g_data_ad_client]" class="medium-text quads-bggrey" name="quads_settings[ads][<?php echo $id; ?>][g_data_ad_client]" value="<?php echo $g_data_ad_client; ?>">
1800
+ <br />
1801
+ <?php
1802
+ $args = array(
1803
+ 'id' => 'adsense_type',
1804
+ 'name' => 'Type',
1805
+ 'desc' => 'Type',
1806
+ 'options' => array(
1807
+ 'normal' => 'Fixed Size',
1808
+ 'responsive' => 'Responsive'
1809
+ )
1810
+ );
1811
+ echo quads_adense_select_callback( $id, $args );
1812
+ ?>
1813
+ <?php if( !quads_is_extra() ) { ?>
1814
+ <span class="quads-pro-notice" style="display:block;margin-top:20px;"><?php echo sprintf( __( 'Install <a href="%s" target="_blank">WP QUADS PRO</a> to fully support AdSense Responsive ads.', 'quick-adsense-reloaded' ), 'http://wpquads.com/?utm_campaign=overlay&utm_source=free-plugin&utm_medium=admin' ) ?></span>
1815
+ <?php } ?>
1816
+ <br />
1817
+ <label class="quads-label-left quads-type-normal" for="quads_settings[ads][<?php echo $id; ?>][g_data_ad_width]">Width </label><input type="number" step="1" id="quads_settings[ads][<?php echo $id; ?>][g_data_ad_width]" name="quads_settings[ads][<?php echo $id; ?>][g_data_ad_width]" class="small-text quads-type-normal" value="<?php echo $g_data_ad_width; ?>">
1818
+ <label class="quads-type-normal" for="quads_settings[ads][<?php echo $id; ?>][g_data_ad_height]">Height </label><input type="number" step="1" id="quads_settings[ads][<?php echo $id; ?>][g_data_ad_height]" name="quads_settings[ads][<?php echo $id; ?>][g_data_ad_height]" class="small-text quads-type-normal" value="<?php echo $g_data_ad_height; ?>">
1819
+ </div>
1820
+ <div class="quads-style">
1821
+ <h3>Layout</h3>
1822
+ <?php
1823
+ $args_ad_position = array(
1824
+ 'id' => 'align',
1825
+ 'name' => 'align',
1826
+ 'desc' => 'align',
1827
+ 'std' => '3',
1828
+ 'options' => array(
1829
+ '3' => 'Default',
1830
+ '0' => 'Left',
1831
+ '1' => 'Center',
1832
+ '2' => 'Right'
1833
+ )
1834
+ );
1835
+ echo quads_adposition_callback( $id, $args_ad_position );
1836
+ // if WP QUADS PRO is installed and version number is higher or equal 1.2.7 show the new margin settings
1837
+ if( !quads_is_extra() ) {
1838
+ ?>
1839
+
1840
+ <br />
1841
+ <label class="quads-label-left" for="quads_settings[ads][<?php echo $id; ?>][margin]"><?php _e( 'Margin', 'quick-adsense-reloaded' ); ?></label>
1842
+ <input type="number" step="1" max="" min="" class="small-text" id="quads_settings[ads][<?php echo $id; ?>][margin]" name="quads_settings[ads][<?php echo $id; ?>][margin]" value="<?php echo esc_attr( stripslashes( $margin ) ); ?>"/>px
1843
+ <?php } echo apply_filters( 'quads_render_margin', '', $id ); ?>
1844
+ </div>
1845
+ <?php
1846
+ if (quads_is_extra()){
1847
+ echo apply_filters( 'quads_advanced_settings', '', $id );
1848
+ }
1849
+ echo quads_pro_overlay();
1850
+ ?>
1851
+ </div>
1852
+ <?php
 
 
1853
  }
1854
 
1855
+ /**
1856
+ * AdSense Code Widget Callback
1857
+ *
1858
+ * Renders adsense code fields
1859
+ *
1860
+ * @since 0.9.0
1861
+ * @param array $args Arguments passed by the setting
1862
+ * @global $quads_options Array of all the QUADS Options
1863
+ * @return void
1864
+ */
1865
+ function quads_adsense_widget_callback( $args ) {
1866
+ global $quads_options;
1867
+
1868
+ $label = !empty( $args['name'] ) ? $args['name'] : '';
1869
+
1870
+ $code = isset( $quads_options['ads'][$args['id']]['code'] ) ? $quads_options['ads'][$args['id']]['code'] : '';
1871
+
1872
+ $margin = isset( $quads_options['ads'][$args['id']]['margin'] ) ? esc_attr( stripslashes( $quads_options['ads'][$args['id']]['margin'] ) ) : 0;
1873
+
1874
+ $g_data_ad_client = isset( $quads_options['ads'][$args['id']]['g_data_ad_client'] ) ? $quads_options['ads'][$args['id']]['g_data_ad_client'] : '';
1875
+
1876
+ $g_data_ad_slot = isset( $quads_options['ads'][$args['id']]['g_data_ad_slot'] ) ? $quads_options['ads'][$args['id']]['g_data_ad_slot'] : '';
1877
+
1878
+ $g_data_ad_width = isset( $quads_options['ads'][$args['id']]['g_data_ad_width'] ) ? $quads_options['ads'][$args['id']]['g_data_ad_width'] : '';
1879
+
1880
+ $g_data_ad_height = isset( $quads_options['ads'][$args['id']]['g_data_ad_height'] ) ? $quads_options['ads'][$args['id']]['g_data_ad_height'] : '';
1881
+
1882
+ // Create a shorter var to make HTML cleaner
1883
+ $id = $args['id'];
1884
+ ?>
1885
+ <div class="quads-ad-toggle-header quads-box-close" data-box-id="quads-toggle<?php echo $id; ?>">
1886
+ <div class="quads-toogle-title"><?php echo $label; ?></div>
1887
+ <a class="quads-toggle" data-box-id="quads-toggle<?php echo $id; ?>" href="#"><div class="quads-close-open-icon"></div></a>
1888
+ </div>
1889
+ <div class="quads-ad-toggle-container" id="quads-toggle<?php echo $id; ?>" style="display:none;">
1890
+ <div>
1891
+ <?php
1892
+ $args_ad_type = array(
1893
+ 'id' => 'ad_type',
1894
+ 'name' => 'Type',
1895
+ 'desc' => '',
1896
+ 'std' => 'plain_text',
1897
+ 'options' => array(
1898
+ 'adsense' => 'AdSense',
1899
+ 'plain_text' => 'Plain Text / HTML / JS'
1900
+ )
1901
+ );
1902
+ echo quads_adtype_callback( $id, $args_ad_type );
1903
+ ?>
1904
+ </div>
1905
+ <textarea style="vertical-align:top;margin-right:20px;" class="large-text quads-textarea" cols="50" rows="10" id="quads_settings[ads][<?php echo $id; ?>][code]" name="quads_settings[ads][<?php echo $id; ?>][code]"><?php echo esc_textarea( stripslashes( $code ) ); ?></textarea><label for="quads_settings[ads][ <?php echo $id; ?> ][code]"> <?php echo $args['desc']; ?></label>
1906
+ <br>
1907
+ <div class="quads_adsense_code">
1908
+ <input type="button" style="vertical-align:inherit;" class="button button-primary quads-add-adsense" value="Copy / Paste AdSense Code"> <span>or add Ad Slot ID & Publisher ID manually below:</span>
1909
+ <br />
1910
+ <?php //echo __('Generate Ad Slot & Publisher ID automatically from your adsense code', 'quick-adsense-reloaded') ?>
1911
+ <label class="quads-label-left" for="quads_settings[ads][<?php echo $id; ?>][g_data_ad_slot]">Ad Slot ID </label><input type="text" class="quads-medium-size quads-bggrey" id="quads_settings[ads][<?php echo $id; ?>][g_data_ad_slot]" name="quads_settings[ads][<?php echo $id; ?>][g_data_ad_slot]" value="<?php echo $g_data_ad_slot; ?>">
1912
+ <label for="quads_settings[ads][<?php echo $id; ?>][g_data_ad_client]">Publisher ID</label><input type="text" id="quads_settings[ads][<?php echo $id; ?>][g_data_ad_client]" class="medium-text quads-bggrey" name="quads_settings[ads][<?php echo $id; ?>][g_data_ad_client]" value="<?php echo $g_data_ad_client; ?>">
1913
+ <br />
1914
+ <?php
1915
+ $args_adsense_type = array(
1916
+ 'id' => 'adsense_type',
1917
+ 'name' => 'Type',
1918
+ 'desc' => 'Type',
1919
+ 'options' => array(
1920
+ 'normal' => 'Fixed Size',
1921
+ 'responsive' => 'Responsive'
1922
+ )
1923
+ );
1924
+ echo quads_adense_select_callback( $id, $args_adsense_type );
1925
+ ?>
1926
+ <?php if( !quads_is_extra() ) { ?>
1927
+ <span class="quads-pro-notice" style="display:block;margin-top:20px;"><?php echo sprintf( __( 'Install <a href="%s" target="_blank">WP QUADS PRO</a> to fully support AdSense Responsive ads.', 'quick-adsense-reloaded' ), 'http://wpquads.com/?utm_campaign=overlay&utm_source=free-plugin&utm_medium=admin' ) ?></span>
1928
+ <?php } ?>
1929
+ <br />
1930
+ <label class="quads-label-left quads-type-normal" for="quads_settings[ads][<?php echo $id; ?>][g_data_ad_width]">Width </label><input type="number" step="1" id="quads_settings[ads][<?php echo $id; ?>][g_data_ad_width]" name="quads_settings[ads][<?php echo $id; ?>][g_data_ad_width]" class="small-text quads-type-normal" value="<?php echo $g_data_ad_width; ?>">
1931
+ <label class="quads-type-normal" for="quads_settings[ads][<?php echo $id; ?>][g_data_ad_height]">Height </label><input type="number" step="1" id="quads_settings[ads][<?php echo $id; ?>][g_data_ad_height]" name="quads_settings[ads][<?php echo $id; ?>][g_data_ad_height]" class="small-text quads-type-normal" value="<?php echo $g_data_ad_height; ?>">
1932
+ </div>
1933
+ <div class="quads-style">
1934
+ <h3>Layout</h3>
1935
+ <?php
1936
+ $args_ad_position = array(
1937
+ 'id' => 'align',
1938
+ 'name' => 'align',
1939
+ 'desc' => 'align',
1940
+ 'std' => '3',
1941
+ 'options' => array(
1942
+ '3' => 'Default',
1943
+ '0' => 'Left',
1944
+ '1' => 'Center',
1945
+ '2' => 'Right'
1946
+ )
1947
+ );
1948
+ echo quads_adposition_callback( $id, $args_ad_position );
1949
+ // if WP QUADS PRO is installed and version number is higher or equal 1.2.7 show the new margin settings
1950
+ if( !quads_is_extra() ) {
1951
+ ?>
1952
+ <br />
1953
+ <label class="quads-label-left" for="quads_settings[ads][<?php echo $id; ?>][margin]"><?php _e( 'Margin', 'quick-adsense-reloaded' ); ?></label>
1954
+ <input type="number" step="1" max="" min="" class="small-text" id="quads_settings[ads][<?php echo $id; ?>][margin]" name="quads_settings[ads][<?php echo $id; ?>][margin]" value="<?php echo esc_attr( stripslashes( $margin ) ); ?>"/>px
1955
+ <?php } echo apply_filters( 'quads_render_margin', '', $id ); ?>
1956
+ </div>
1957
+ <?php
1958
+ if (quads_is_extra()){
1959
+ echo apply_filters( 'quads_advanced_settings', '', $id );
1960
+ }
1961
+ echo quads_pro_overlay();
1962
+ ?>
1963
+ </div>
1964
+ <?php
1965
+ }
1966
 
1967
+ /**
1968
+ * If advanced settings are not available load overlay image
1969
+ * @return string
1970
+ */
1971
+ function quads_pro_overlay() {
1972
+ if( quads_is_extra() ) {
1973
+ return '';
1974
+ }
1975
 
1976
+ $html = '<div class="quads-advanced-ad-box quads-pro-overlay"><a href="http://wpquads.com/?utm_campaign=overlay&utm_source=free-plugin&utm_medium=admin" target="_blank"><img src="' . QUADS_PLUGIN_URL . '/assets/images/get_pro_overlay.png"></a></div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1977
 
1978
+ return $html;
1979
+ }
 
 
 
 
 
 
1980
 
1981
+ /**
1982
+ *
1983
+ * Return array of alignment options
1984
+ *
1985
+ * @return array
1986
+ */
1987
+ function quads_get_alignment() {
1988
+ // Do not change the key => value order for compatibility reasons
1989
+ return array(
1990
+ 3 => 'none',
1991
+ 0 => 'left',
1992
+ 1 => 'center',
1993
+ 2 => 'right',
1994
+ );
1995
  }
1996
 
1997
+ /**
1998
+ * Check if plugin Clickfraud Monitoring is installed
1999
+ *
2000
+ * @return boolean true when it is installed and active
2001
+ */
2002
+ function quads_is_installed_clickfraud() {
2003
+ $plugin_file = 'cfmonitor/cfmonitor.php';
2004
+ $plugin_file2 = 'clickfraud-monitoring/cfmonitor.php';
2005
 
2006
+ if( is_plugin_active( $plugin_file ) || is_plugin_active( $plugin_file2 ) ) {
2007
+ return true;
2008
+ }
 
 
 
 
 
 
2009
 
2010
+ return false;
 
2011
  }
2012
 
2013
+ /**
2014
+ *
2015
+ * @param array $args array(
2016
+ * 'id' => 'string),
2017
+ * 'type' => desktop, tablet_landscape, tablet_portrait, phone
2018
+ * @return string
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2019
 
2020
+ */
2021
+ function quads_render_size_option( $args ) {
2022
+ global $quads_options;
2023
+
2024
+ if( !isset( $args['id'] ) ) {
2025
+ return '';
2026
+ }
2027
+
2028
+ $checked = isset( $quads_options['ads'][$args['id']][$args['type']] ) ? $quads_options['ads'][$args['id']][$args['type']] : '';
2029
+ $html = '<div class="quads-select-style-overwrite">';
2030
+ $html .= '<select class="quads-size-input" id="quads_settings[ads][' . $args['id'] . '][' . $args['type'] . ']" name="quads_settings[ads][' . $args['id'] . '][' . $args['type'] . ']">';
2031
+ foreach ( quads_get_adsense_sizes() as $key => $value ) :
2032
+ $selected = selected( $key, $checked, false );
2033
+ $html .= '<option value="' . $key . '" ' . $selected . '>' . $value . '</option>';
2034
+ endforeach;
2035
+ $html .= '</select>';
2036
+ $html .= '</div>';
2037
+
2038
+ return $html;
2039
+ }
2040
 
2041
+ /**
2042
+ * Get all AdSense Sizes
2043
+ * @return array
2044
+ */
2045
+ function quads_get_adsense_sizes() {
2046
+ $sizes = array(
2047
+ 'Auto' => 'Auto',
2048
+ '120 x 90' => '120 x 90',
2049
+ '120 x 240' => '120 x 240',
2050
+ '120 x 600' => '120 x 600',
2051
+ '125 x 125' => '125 x 125',
2052
+ '160 x 90' => '160 x 90',
2053
+ '160 x 600' => '160 x 600',
2054
+ '180 x 90' => '180 x 90',
2055
+ '180 x 150' => '180 x 150',
2056
+ '200 x 90' => '200 x 90',
2057
+ '200 x 200' => '200 x 200',
2058
+ '234 x 60' => '234 x 60',
2059
+ '250 x 250' => '250 x 250',
2060
+ '320 x 100' => '320 x 100',
2061
+ '300 x 250' => '300 x 250',
2062
+ '300 x 600' => '300 x 600',
2063
+ '300 x 1050' => '300 x 1050',
2064
+ '320 x 50' => '320 x 50',
2065
+ '336 x 280' => '336 x 280',
2066
+ '360 x 300' => '360 x 300',
2067
+ '435 x 300' => '435 x 300',
2068
+ '468 x 15' => '468 x 15',
2069
+ '468 x 60' => '468 x 60',
2070
+ '640 x 165' => '640 x 165',
2071
+ '640 x 190' => '640 x 190',
2072
+ '640 x 300' => '640 x 300',
2073
+ '728 x 15' => '728 x 15',
2074
+ '728 x 90' => '728 x 90',
2075
+ '970 x 90' => '970 x 90',
2076
+ '970 x 250' => '970 x 250',
2077
+ '240 x 400' => '240 x 400 - Regional ad sizes',
2078
+ '250 x 360' => '250 x 360 - Regional ad sizes',
2079
+ '580 x 400' => '580 x 400 - Regional ad sizes',
2080
+ '750 x 100' => '750 x 100 - Regional ad sizes',
2081
+ '750 x 200' => '750 x 200 - Regional ad sizes',
2082
+ '750 x 300' => '750 x 300 - Regional ad sizes',
2083
+ '980 x 120' => '980 x 120 - Regional ad sizes',
2084
+ '930 x 180' => '930 x 180 - Regional ad sizes',
2085
+ );
2086
+
2087
+ return apply_filters( 'quads_adsense_size_formats', $sizes );
2088
+ }
2089
 
2090
+ /**
2091
+ * Store AdSense parameters
2092
+ *
2093
+ * @return boolean
2094
+ */
2095
+ function quads_store_adsense_args() {
2096
+ global $quads_options;
2097
+
2098
+ foreach ( $quads_options as $id => $ads ) {
2099
+ //$quads_options['ads'][$key]['code'];
2100
+ //echo 'id:' . $id . ' - ' . $ads['ads'];
2101
+ if (!is_array($ads)){
2102
+ continue;
2103
+ }
2104
+ foreach ($ads as $key => $value) {
2105
+ //echo $key . $value['code'] . '<br>';
2106
+ if( is_array( $value ) && array_key_exists( 'code', $value ) && !empty( $value['code'] ) ) {
2107
 
2108
  //check to see if it is google ad
2109
+ if( preg_match( '/googlesyndication.com/', $value['code'] ) ) {
2110
+
2111
+ // Test if its google asyncron ad
2112
+ if( preg_match( '/data-ad-client=/', $value['code'] ) ) {
2113
+ //*** GOOGLE ASYNCRON *************
2114
+ $quads_options['ads'][$key]['current_ad_type'] = 'google_async';
2115
+ //get g_data_ad_client
2116
+ $explode_ad_code = explode( 'data-ad-client', $value['code'] );
2117
+ preg_match( '#"([a-zA-Z0-9-\s]+)"#', $explode_ad_code[1], $matches_add_client );
2118
+ $quads_options['ads'][$key]['g_data_ad_client'] = str_replace( array('"', ' '), array(''), $matches_add_client[1] );
2119
+
2120
+ //get g_data_ad_slot
2121
+ $explode_ad_code = explode( 'data-ad-slot', $value['code'] );
2122
+ preg_match( '#"([a-zA-Z0-9/\s]+)"#', $explode_ad_code[1], $matches_add_slot );
2123
+ $quads_options['ads'][$key]['g_data_ad_slot'] = str_replace( array('"', ' '), array(''), $matches_add_slot[1] );
2124
+ } else {
2125
+ //*** GOOGLE SYNCRON *************
2126
+ $quads_options['ads'][$key]['current_ad_type'] = 'google_sync';
2127
+ //get g_data_ad_client
2128
+ $explode_ad_code = explode( 'google_ad_client', $value['code'] );
2129
+ preg_match( '#"([a-zA-Z0-9-\s]+)"#', $explode_ad_code[1], $matches_add_client );
2130
+ $quads_options['ads'][$key]['g_data_ad_client'] = str_replace( array('"', ' '), array(''), $matches_add_client[1] );
2131
+
2132
+ //get g_data_ad_slot
2133
+ $explode_ad_code = explode( 'google_ad_slot', $value['code'] );
2134
+ preg_match( '#"([a-zA-Z0-9/\s]+)"#', $explode_ad_code[1], $matches_add_slot );
2135
+ $quads_options['ads'][$key]['g_data_ad_slot'] = str_replace( array('"', ' '), array(''), $matches_add_slot[1] );
2136
+ }
 
 
 
 
2137
  }
2138
+ }
2139
+ }
2140
+ }
2141
+ //wp_die( var_dump( $quads_options ) );
2142
+ update_option( 'quads_settings', $quads_options );
2143
  }
2144
 
 
2145
  /**
2146
+ * Populate AdSense Code field otherwise ads are not shown on frontpage (Bug).
2147
+ * @todo
2148
+ *
2149
+ * @global $quads_options $quads_options
2150
+ * @deprecated since 1.3.8
2151
+ */
2152
  //function quads_fix_ad_not_shown(){
2153
  // global $quads_options;
2154
  //
2159
  // }
2160
  //}
2161
 
 
 
 
 
 
 
 
 
 
 
 
 
2162
  /**
2163
+ * Sanitizes a string key for QUADS Settings
2164
  *
2165
+ * Keys are used as internal identifiers. Alphanumeric characters, dashes, underscores, stops, colons and slashes are allowed
2166
+ *
2167
+ * @since 2.0.0
2168
+ * @param string $key String key
2169
+ * @return string Sanitized key
2170
  */
2171
+ function quads_sanitize_key( $key ) {
2172
+ $raw_key = $key;
2173
+ $key = preg_replace( '/[^a-zA-Z0-9_\-\.\:\/]/', '', $key );
2174
+ /**
2175
+ * Filter a sanitized key string.
2176
+ *
2177
+ * @since 2.5.8
2178
+ * @param string $key Sanitized key.
2179
+ * @param string $raw_key The key prior to sanitization.
2180
+ */
2181
+ return apply_filters( 'quads_sanitize_key', $key, $raw_key );
2182
+ }
2183
 
2184
+ /**
2185
+ * Multi Select Callback
2186
+ *
2187
+ * @since 1.3.8
2188
+ * @param array $args Arguments passed by the settings
2189
+ * @global $quads_options Array of all the QUADS Options
2190
+ * @return string $output dropdown
2191
+ */
2192
+ function quads_multiselect_callback( $args = array() ) {
2193
+ global $quads_options;
2194
+
2195
+ $placeholder = !empty( $args['placeholder'] ) ? $args['placeholder'] : '';
2196
+ $selected = isset( $quads_options[$args['id']] ) ? $quads_options[$args['id']] : '';
2197
+ $checked = '';
2198
+
2199
+ $html = '<select name="quads_settings[' . $args['id'] . '][]" data-placeholder="' . $placeholder . '" style="width:550px;" multiple tabindex="4" class="quads-select quads-chosen-select">';
2200
+ $i = 0;
2201
+ foreach ( $args['options'] as $key => $value ) :
2202
+ if( is_array( $selected ) ) {
2203
+ $checked = selected( true, in_array( $key, $selected ), false );
2204
+ }
2205
+ $html .= '<option value="' . $key . '" ' . $checked . '>' . $value . '</option>';
2206
+ endforeach;
2207
+ $html .= '</select>';
2208
+ echo $html;
2209
+ }
2210
+
includes/admin/tools.php CHANGED
@@ -66,7 +66,7 @@ function quads_get_tools_tabs() {
66
 
67
  $tabs = array();
68
  $tabs['import_export'] = __( 'Import/Export', 'quick-adsense-reloaded' );
69
- $tabs['system_info'] = __( 'System Info', 'quick-adsense-reloaded' );
70
 
71
  return apply_filters( 'quads_tools_tabs', $tabs );
72
  }
@@ -124,6 +124,8 @@ function quads_tools_import_export_display() {
124
  }
125
  add_action( 'quads_tools_tab_import_export', 'quads_tools_import_export_display' );
126
 
 
 
127
  /* check if function is disabled or not
128
  *
129
  * @returns bool
@@ -250,7 +252,7 @@ function quads_tools_sysinfo_display() {
250
  }
251
 
252
  ?>
253
- <!--<form action="<?php echo esc_url( admin_url( 'admin.php?page=quads-settings&tab=system_info' ) ); ?>" method="post" dir="ltr">//-->
254
  <textarea readonly="readonly" onclick="this.focus(); this.select()" id="system-info-textarea" name="quads-sysinfo" title="To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac)."><?php echo quads_tools_sysinfo_get(); ?></textarea>
255
  <!--
256
  <p class="submit">
@@ -259,9 +261,28 @@ function quads_tools_sysinfo_display() {
259
  <!--</p>//-->
260
  <!--</form>//-->
261
  <?php
 
 
262
  }
263
  add_action( 'quads_tools_tab_system_info', 'quads_tools_sysinfo_display' );
264
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
 
266
  /**
267
  * Get system info
66
 
67
  $tabs = array();
68
  $tabs['import_export'] = __( 'Import/Export', 'quick-adsense-reloaded' );
69
+ $tabs['system_info'] = __( 'System Info', 'quick-adsense-reloaded' );
70
 
71
  return apply_filters( 'quads_tools_tabs', $tabs );
72
  }
124
  }
125
  add_action( 'quads_tools_tab_import_export', 'quads_tools_import_export_display' );
126
 
127
+
128
+
129
  /* check if function is disabled or not
130
  *
131
  * @returns bool
252
  }
253
 
254
  ?>
255
+ <!--<form action="<?php //echo esc_url( admin_url( 'admin.php?page=quads-settings&tab=system_info' ) ); ?>" method="post" dir="ltr">//-->
256
  <textarea readonly="readonly" onclick="this.focus(); this.select()" id="system-info-textarea" name="quads-sysinfo" title="To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac)."><?php echo quads_tools_sysinfo_get(); ?></textarea>
257
  <!--
258
  <p class="submit">
261
  <!--</p>//-->
262
  <!--</form>//-->
263
  <?php
264
+ echo '<br>' . quads_render_backup_settings();
265
+
266
  }
267
  add_action( 'quads_tools_tab_system_info', 'quads_tools_sysinfo_display' );
268
 
269
+ /**
270
+ * Render textarea with backup settings from previous version 1.5.2
271
+ * @return string
272
+ */
273
+ function quads_render_backup_settings(){
274
+ if( ! current_user_can( 'update_plugins' ) ) {
275
+ return;
276
+ }
277
+
278
+ $settings = json_encode(get_option('quads_settings_1_5_2'));
279
+ echo '<h3>' . __('Backup data from WP QUADS 1.5.2', 'quick-adsense-reloaded') . '</h3>' . __('Copy and paste this data into an empty text file with extension *.json');
280
+ ?>
281
+
282
+ <textarea readonly="readonly" onclick="this.focus(); this.select()" id="backup-settings-textarea" name="quads-backupsettings" title="To copy the backup settings info, click below then press Ctrl + C (PC) or Cmd + C (Mac)."><?php echo $settings; ?></textarea>
283
+ <?php
284
+ }
285
+
286
 
287
  /**
288
  * Get system info
includes/admin/upgrades/upgrade-functions.php CHANGED
@@ -24,10 +24,14 @@ function quads_do_automatic_upgrades() {
24
  $did_upgrade = false;
25
  // Get current installed version
26
  $quads_version = preg_replace( '/[^0-9.].*/', '', get_option( 'quads_version' ) );
 
 
 
 
27
 
28
- if( version_compare( $quads_version, '1.2.5', '<' ) ) {
29
- quads_store_adsense_args();
30
- }
31
  if( version_compare( $quads_version, '1.2.7', '<' ) ) {
32
  quads_change_widget_values();
33
  }
@@ -35,6 +39,13 @@ function quads_do_automatic_upgrades() {
35
  quads_import_post_type_settings();
36
  quads_is_commercial_theme();
37
  }
 
 
 
 
 
 
 
38
 
39
  // Check if version number in DB is lower than version number of plugin
40
  if( version_compare( $quads_version, QUADS_VERSION, '<' ) ) {
@@ -42,13 +53,97 @@ function quads_do_automatic_upgrades() {
42
  $did_upgrade = true;
43
  }
44
 
45
- // Update Version number
46
- if( $did_upgrade ) {
47
- update_option( 'quads_version', preg_replace( '/[^0-9.].*/', '', QUADS_VERSION ) );
48
  }
49
  }
50
  add_action( 'admin_init', 'quads_do_automatic_upgrades' );
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  /**
53
  * Change array quads_settings['ad1_widget'] to quads_settings[ad1_widget][code]
54
  *
@@ -122,6 +217,7 @@ function quads_is_commercial_theme() {
122
 
123
  /**
124
  * Check if WP QUADS PRO is installed and version number is higher or equal 1.2.7
 
125
  * @return boolean
126
  */
127
  function quads_is_advanced_1_2_7() {
24
  $did_upgrade = false;
25
  // Get current installed version
26
  $quads_version = preg_replace( '/[^0-9.].*/', '', get_option( 'quads_version' ) );
27
+
28
+ // Previous version
29
+ $previous_version = get_option( 'quads_version_upgraded_from' );
30
+
31
 
32
+ // if( version_compare( $quads_version, '1.2.5', '<' ) ) {
33
+ // quads_store_adsense_args();
34
+ // }
35
  if( version_compare( $quads_version, '1.2.7', '<' ) ) {
36
  quads_change_widget_values();
37
  }
39
  quads_import_post_type_settings();
40
  quads_is_commercial_theme();
41
  }
42
+
43
+ // Update settings - Try to do this after any update
44
+ if( version_compare( $quads_version, QUADS_VERSION, '<=' )) {
45
+ quads_update_settings_1_5_3();
46
+ quads_is_commercial_theme();
47
+ }
48
+
49
 
50
  // Check if version number in DB is lower than version number of plugin
51
  if( version_compare( $quads_version, QUADS_VERSION, '<' ) ) {
53
  $did_upgrade = true;
54
  }
55
 
56
+ // Update Current Version number
57
+ if( $did_upgrade ) {
58
+ update_option( 'quads_version', preg_replace( '/[^0-9.].*/', '', QUADS_VERSION ) );
59
  }
60
  }
61
  add_action( 'admin_init', 'quads_do_automatic_upgrades' );
62
 
63
+ /**
64
+ * Update Settings for version 1.5.3 and higher
65
+ * Add new index $settings['ads']
66
+ */
67
+ function quads_update_settings_1_5_3(){
68
+ $settings = get_option( 'quads_settings' );
69
+
70
+ // Do not update - we already did it
71
+ if (isset($settings['ads'])){
72
+ //wp_die('test');
73
+ return false;
74
+ }
75
+
76
+ foreach ( $settings as $key => $value ) {
77
+
78
+ if( $key === 'ad1_widget'){
79
+ $new['ads']['ad1_widget'] = $value;
80
+ }else if( $key === 'ad2_widget' )
81
+ $new['ads']['ad2_widget'] = $value;
82
+ else if( $key === 'ad3_widget' )
83
+ $new['ads']['ad3_widget'] = $value;
84
+
85
+ else if( $key === 'ad4_widget' )
86
+ $new['ads']['ad4_widget'] = $value;
87
+
88
+ else if( $key === 'ad5_widget' )
89
+ $new['ads']['ad5_widget'] = $value;
90
+
91
+ else if( $key === 'ad6_widget' )
92
+ $new['ads']['ad6_widget'] = $value;
93
+
94
+ else if( $key === 'ad7_widget' )
95
+ $new['ads']['ad7_widget'] = $value;
96
+
97
+ else if( $key === 'ad8_widget' )
98
+ $new['ads']['ad8_widget'] = $value;
99
+
100
+ else if( $key === 'ad9_widget' )
101
+ $new['ads']['ad9_widget'] = $value;
102
+
103
+ else if( $key === 'ad10_widget' )
104
+ $new['ads']['ad10_widget'] = $value;
105
+
106
+ else if ( $key === 'ad1' )
107
+ $new['ads']['ad1'] = $value;
108
+
109
+ else if( $key === 'ad2' )
110
+ $new['ads']['ad2'] = $value;
111
+
112
+ else if( $key === 'ad3' )
113
+ $new['ads']['ad3'] = $value;
114
+
115
+ else if( $key === 'ad4' )
116
+ $new['ads']['ad4'] = $value;
117
+
118
+ else if( $key === 'ad5' )
119
+ $new['ads']['ad5'] = $value;
120
+
121
+ else if( $key === 'ad6' )
122
+ $new['ads']['ad6'] = $value;
123
+
124
+ else if( $key === 'ad7' )
125
+ $new['ads']['ad7'] = $value;
126
+
127
+ else if( $key === 'ad8' )
128
+ $new['ads']['ad8'] = $value;
129
+
130
+ else if( $key === 'ad9' )
131
+ $new['ads']['ad9'] = $value;
132
+
133
+ else if( $key === 'ad10' )
134
+ $new['ads']['ad10'] = $value;
135
+ else
136
+ $new[$key] = $value;
137
+ }
138
+ // Backup old settings just in case. Do this only one time!
139
+ if (false === get_option('quads_settings_1_5_2')){
140
+ update_option('quads_settings_1_5_2', $settings);
141
+ }
142
+ update_option('quads_settings', $new);
143
+ //wp_die(var_dump($new));
144
+ //wp_die(var_dump($settings));
145
+ }
146
+
147
  /**
148
  * Change array quads_settings['ad1_widget'] to quads_settings[ad1_widget][code]
149
  *
217
 
218
  /**
219
  * Check if WP QUADS PRO is installed and version number is higher or equal 1.2.7
220
+ * @deprecated since version 1.5.6
221
  * @return boolean
222
  */
223
  function quads_is_advanced_1_2_7() {
includes/admin/welcome.php CHANGED
@@ -70,7 +70,7 @@ class quads_Welcome {
70
  // wp_safe_redirect( admin_url( 'admin.php?page=quads-addons' ) ); exit;
71
  // }
72
  // Redirect to settings page if wp quads pro is not installed
73
- if( quads_is_advanced() ) { // First time install
74
  wp_safe_redirect( admin_url( 'admin.php?page=quads-settings' ) ); exit;
75
  } else { // Update
76
  wp_safe_redirect( admin_url( 'admin.php?page=quads-addons' ) ); exit;
70
  // wp_safe_redirect( admin_url( 'admin.php?page=quads-addons' ) ); exit;
71
  // }
72
  // Redirect to settings page if wp quads pro is not installed
73
+ if( quads_is_extra() ) { // First time install
74
  wp_safe_redirect( admin_url( 'admin.php?page=quads-settings' ) ); exit;
75
  } else { // Update
76
  wp_safe_redirect( admin_url( 'admin.php?page=quads-addons' ) ); exit;
includes/api.php CHANGED
@@ -148,7 +148,7 @@ function quads_ad( $args ) {
148
  $location_settings = quads_get_ad_location_settings( $args['location'] );
149
  $code .= "\n".'<!-- WP QUADS Custom Ad v. ' . QUADS_VERSION .' -->'."\n";
150
  $code .= '<div class="quads-location quads-ad' .$location_settings['ad']. '" id="quads-ad' .$location_settings['ad']. '" style="'. quads_get_inline_ad_style( $location_settings['ad'] ).'">'."\n";
151
- $code .= quads_render_ad( 'ad' . $location_settings['ad'], $quads_options[ 'ad' . $location_settings['ad'] ]['code'] );
152
  $code .= '</div>';
153
  }
154
 
148
  $location_settings = quads_get_ad_location_settings( $args['location'] );
149
  $code .= "\n".'<!-- WP QUADS Custom Ad v. ' . QUADS_VERSION .' -->'."\n";
150
  $code .= '<div class="quads-location quads-ad' .$location_settings['ad']. '" id="quads-ad' .$location_settings['ad']. '" style="'. quads_get_inline_ad_style( $location_settings['ad'] ).'">'."\n";
151
+ $code .= quads_render_ad( 'ad' . $location_settings['ad'], $quads_options['ads'][ 'ad' . $location_settings['ad'] ]['code'] );
152
  $code .= '</div>';
153
  }
154
 
includes/{conditionals.php → conditions.php} RENAMED
@@ -1,10 +1,10 @@
1
  <?php
2
 
3
  /**
4
- * Conditionals
5
  *
6
  * @package QUADS
7
- * @subpackage Functions/conditionals
8
  * @copyright Copyright (c) 2016, René Hermenau
9
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10
  * @since 1.2.8
@@ -24,6 +24,16 @@ function quads_ad_is_allowed( $content = null ) {
24
  global $quads_options;
25
 
26
  $hide_ads = apply_filters('quads_hide_ads', false);
 
 
 
 
 
 
 
 
 
 
27
 
28
  if(
29
  (is_feed()) ||
@@ -31,13 +41,10 @@ function quads_ad_is_allowed( $content = null ) {
31
  (is_404() ) ||
32
  (strpos( $content, '<!--NoAds-->' ) !== false) ||
33
  (strpos( $content, '<!--OffAds-->' ) !== false) ||
34
- (is_front_page() && !( isset( $quads_options['visibility']['AppHome'] ) ) ) ||
35
- //(is_single() && !( isset( $quads_options['visibility']['AppPost'] ) ) ) ||
36
- //(is_page() && !( isset( $quads_options['visibility']['AppPage'] ) ) ) ||
37
  (is_category() && !(isset( $quads_options['visibility']['AppCate'] ) ) ) ||
38
  (is_archive() && !( isset( $quads_options['visibility']['AppArch'] ) ) ) ||
39
  (is_tag() && !( isset( $quads_options['visibility']['AppTags'] ) ) ) ||
40
- (!quads_user_roles_permission()) ||
41
  (!quads_post_type_allowed()) ||
42
  (is_user_logged_in() && ( isset( $quads_options['visibility']['AppLogg'] ) ) ) ||
43
  true === $hide_ads
@@ -49,6 +56,25 @@ function quads_ad_is_allowed( $content = null ) {
49
  }
50
 
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
53
  /**
54
  * Get the total number of active ads
1
  <?php
2
 
3
  /**
4
+ * Conditions
5
  *
6
  * @package QUADS
7
+ * @subpackage Functions/conditions
8
  * @copyright Copyright (c) 2016, René Hermenau
9
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10
  * @since 1.2.8
24
  global $quads_options;
25
 
26
  $hide_ads = apply_filters('quads_hide_ads', false);
27
+
28
+ // User Roles check
29
+ if(!quads_user_roles_permission()){
30
+ return false;
31
+ }
32
+
33
+ // Frontpage check
34
+ if (is_front_page() && isset( $quads_options['visibility']['AppHome'] ) ){
35
+ return true;
36
+ }
37
 
38
  if(
39
  (is_feed()) ||
41
  (is_404() ) ||
42
  (strpos( $content, '<!--NoAds-->' ) !== false) ||
43
  (strpos( $content, '<!--OffAds-->' ) !== false) ||
44
+ (is_front_page() && !isset( $quads_options['visibility']['AppHome'] ) ) ||
 
 
45
  (is_category() && !(isset( $quads_options['visibility']['AppCate'] ) ) ) ||
46
  (is_archive() && !( isset( $quads_options['visibility']['AppArch'] ) ) ) ||
47
  (is_tag() && !( isset( $quads_options['visibility']['AppTags'] ) ) ) ||
 
48
  (!quads_post_type_allowed()) ||
49
  (is_user_logged_in() && ( isset( $quads_options['visibility']['AppLogg'] ) ) ) ||
50
  true === $hide_ads
56
  }
57
 
58
 
59
+ /**
60
+ * Check if Ad widgets are visible on homepage
61
+ *
62
+ * @since 0.9.7
63
+ * return true when ad widgets are not visible on frontpage else false
64
+ */
65
+ function quads_hide_ad_widget_on_homepage(){
66
+ global $quads_options;
67
+
68
+ $is_active = isset($quads_options["visibility"]["AppSide"]) ? true : false;
69
+
70
+ if( is_front_page() && $is_active ){
71
+ return true;
72
+ }
73
+
74
+ return false;
75
+
76
+ }
77
+
78
 
79
  /**
80
  * Get the total number of active ads
includes/render-ad-functions.php CHANGED
@@ -46,12 +46,10 @@ function quads_render_ad( $id, $string, $widget = false ) {
46
 
47
  // Return the adsense ad code
48
  if( true === quads_is_adsense( $id, $string ) ) {
49
- //wp_die('t2');
50
  return apply_filters( 'quads_render_ad', quads_render_google_async( $id ) );
51
  }
52
 
53
  // Return empty string
54
- //wp_die('t3');
55
  return '';
56
  }
57
 
@@ -80,32 +78,32 @@ function quads_render_google_async( $id ) {
80
 
81
  // Overwrite default values if there are ones
82
  // Desktop big ad
83
- if( !empty( $quads_options[$id]['desktop_size'] ) && $quads_options[$id]['desktop_size'] !== 'Auto' ) {
84
- $ad_size_parts = explode( ' x ', $quads_options[$id]['desktop_size'] );
85
  $default_ad_sizes[$id]['desktop_width'] = $ad_size_parts[0];
86
  $default_ad_sizes[$id]['desktop_height'] = $ad_size_parts[1];
87
  }
88
 
89
 
90
  //tablet landscape
91
- if( !empty( $quads_options[$id]['tbl_lands_size'] ) && $quads_options[$id]['tbl_lands_size'] !== 'Auto' ) {
92
- $ad_size_parts = explode( ' x ', $quads_options[$id]['tbl_lands_size'] );
93
  $default_ad_sizes[$id]['tbl_landscape_width'] = $ad_size_parts[0];
94
  $default_ad_sizes[$id]['tbl_landscape_height'] = $ad_size_parts[1];
95
  }
96
 
97
 
98
  //tablet portrait
99
- if( !empty( $quads_options[$id]['tbl_portr_size'] ) && $quads_options[$id]['tbl_portr_size'] !== 'Auto' ) {
100
- $ad_size_parts = explode( ' x ', $quads_options[$id]['tbl_portr_size'] );
101
  $default_ad_sizes[$id]['tbl_portrait_width'] = $ad_size_parts[0];
102
  $default_ad_sizes[$id]['tbl_portrait_height'] = $ad_size_parts[1];
103
  }
104
 
105
 
106
  //phone
107
- if( !empty( $quads_options[$id]['phone_size'] ) && $quads_options[$id]['phone_size'] !== 'Auto' ) {
108
- $ad_size_parts = explode( ' x ', $quads_options[$id]['phone_size'] );
109
  $default_ad_sizes[$id]['phone_width'] = $ad_size_parts[0];
110
  $default_ad_sizes[$id]['phone_height'] = $ad_size_parts[1];
111
  }
@@ -148,32 +146,32 @@ function quads_render_desktop_js( $id, $default_ad_sizes ) {
148
  $backgroundcolor = '';
149
 
150
  $responsive_style = 'display:block;' . $backgroundcolor;
151
-
152
- if( quads_is_advanced() && isset( $quads_options[$id]['adsense_type'] ) && $quads_options[$id]['adsense_type'] === 'responsive' ) {
153
  $width = $default_ad_sizes[$id][$adtype.'_width'];
154
 
155
  $height = $default_ad_sizes[$id][$adtype.'_height'];
156
 
157
  $normal_style = 'display:inline-block;width:' . $width . 'px;height:' . $height . 'px;' . $backgroundcolor;
158
 
159
- $style = isset( $quads_options[$id]['adsense_type'] ) && $quads_options[$id]['adsense_type'] === 'responsive' && (isset( $quads_options[$id][$adtype.'_size'] ) && $quads_options[$id][$adtype.'_size'] === 'Auto') ? $responsive_style : $normal_style;
160
  } else {
161
- $width = empty( $quads_options[$id]['g_data_ad_width'] ) ? $default_ad_sizes[$id][$adtype.'_width'] : $quads_options[$id]['g_data_ad_width'];
162
 
163
- $height = empty( $quads_options[$id]['g_data_ad_height'] ) ? $default_ad_sizes[$id][$adtype.'_height'] : $quads_options[$id]['g_data_ad_height'];
164
 
165
  $normal_style = 'display:inline-block;width:' . $width . 'px;height:' . $height . 'px;' . $backgroundcolor;
166
 
167
- $style = isset( $quads_options[$id]['adsense_type'] ) && $quads_options[$id]['adsense_type'] === 'responsive' ? $responsive_style : $normal_style;
168
  }
169
 
170
- $ad_format = (isset( $quads_options[$id]['adsense_type'] ) && $quads_options[$id]['adsense_type'] === 'responsive') && (isset( $quads_options[$id][$adtype.'_size'] ) && $quads_options[$id][$adtype.'_size'] === 'Auto') ? 'data-ad-format="auto"' : '';
171
 
172
  $html = '<ins class="adsbygoogle" style="' . $style . '"';
173
- $html .= ' data-ad-client="' . $quads_options[$id]['g_data_ad_client'] . '"';
174
- $html .= ' data-ad-slot="' . $quads_options[$id]['g_data_ad_slot'] . '" ' . $ad_format . '></ins>';
175
 
176
- if( !isset( $quads_options[$id][$adtype] ) and !empty( $default_ad_sizes[$id][$adtype.'_width'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
177
  $js = 'if ( quads_screen_width >= 1140 ) {
178
  /* desktop monitors */
179
  document.write(\'' . $html . '\');
@@ -202,32 +200,32 @@ function quads_render_tablet_landscape_js( $id, $default_ad_sizes ) {
202
 
203
  $responsive_style = 'display:block;' . $backgroundcolor;
204
 
205
- if( quads_is_advanced() && isset( $quads_options[$id]['adsense_type'] ) && $quads_options[$id]['adsense_type'] === 'responsive' ) {
206
  $width = $default_ad_sizes[$id][$adtype.'_width'];
207
 
208
  $height = $default_ad_sizes[$id][$adtype.'_height'];
209
 
210
  $normal_style = 'display:inline-block;width:' . $width . 'px;height:' . $height . 'px;' . $backgroundcolor;
211
 
212
- $style = isset( $quads_options[$id]['adsense_type'] ) && $quads_options[$id]['adsense_type'] === 'responsive' && (isset( $quads_options[$id][$adtype_short.'_size'] ) && $quads_options[$id][$adtype_short.'_size'] === 'Auto') ? $responsive_style : $normal_style;
213
  } else {
214
- $width = empty( $quads_options[$id]['g_data_ad_width'] ) ? $default_ad_sizes[$id][$adtype.'_width'] : $quads_options[$id]['g_data_ad_width'];
215
 
216
- $height = empty( $quads_options[$id]['g_data_ad_height'] ) ? $default_ad_sizes[$id][$adtype.'_height'] : $quads_options[$id]['g_data_ad_height'];
217
 
218
  $normal_style = 'display:inline-block;width:' . $width . 'px;height:' . $height . 'px;' . $backgroundcolor;
219
 
220
- $style = isset( $quads_options[$id]['adsense_type'] ) && $quads_options[$id]['adsense_type'] === 'responsive' ? $responsive_style : $normal_style;
221
  }
222
 
223
- $ad_format = (isset( $quads_options[$id]['adsense_type'] ) && $quads_options[$id]['adsense_type'] === 'responsive') && (isset( $quads_options[$id][$adtype_short.'_size'] ) && $quads_options[$id][$adtype_short.'_size'] === 'Auto') ? 'data-ad-format="auto"' : '';
224
 
225
 
226
  $html = '<ins class="adsbygoogle" style="' . $style . '"';
227
- $html .= ' data-ad-client="' . $quads_options[$id]['g_data_ad_client'] . '"';
228
- $html .= ' data-ad-slot="' . $quads_options[$id]['g_data_ad_slot'] . '" ' . $ad_format . '></ins>';
229
 
230
- if( !isset( $quads_options[$id]['tablet_landscape'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_width'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
231
  $js = 'if ( quads_screen_width >= 1024 && quads_screen_width < 1140 ) {
232
  /* tablet landscape */
233
  document.write(\'' . $html . '\');
@@ -256,31 +254,31 @@ function quads_render_tablet_portrait_js( $id, $default_ad_sizes ) {
256
 
257
  $responsive_style = 'display:block;' . $backgroundcolor;
258
 
259
- if( quads_is_advanced() && isset( $quads_options[$id]['adsense_type'] ) && $quads_options[$id]['adsense_type'] === 'responsive' ) {
260
  $width = $default_ad_sizes[$id][$adtype.'_width'];
261
 
262
  $height = $default_ad_sizes[$id][$adtype.'_height'];
263
 
264
  $normal_style = 'display:inline-block;width:' . $width . 'px;height:' . $height . 'px;' . $backgroundcolor;
265
 
266
- $style = isset( $quads_options[$id]['adsense_type'] ) && $quads_options[$id]['adsense_type'] === 'responsive' && (isset( $quads_options[$id][$adtype_short.'_size'] ) && $quads_options[$id][$adtype_short.'_size'] === 'Auto') ? $responsive_style : $normal_style;
267
  } else {
268
- $width = empty( $quads_options[$id]['g_data_ad_width'] ) ? $default_ad_sizes[$id][$adtype.'_width'] : $quads_options[$id]['g_data_ad_width'];
269
 
270
- $height = empty( $quads_options[$id]['g_data_ad_height'] ) ? $default_ad_sizes[$id][$adtype.'_height'] : $quads_options[$id]['g_data_ad_height'];
271
 
272
  $normal_style = 'display:inline-block;width:' . $width . 'px;height:' . $height . 'px;' . $backgroundcolor;
273
 
274
- $style = isset( $quads_options[$id]['adsense_type'] ) && $quads_options[$id]['adsense_type'] === 'responsive' ? $responsive_style : $normal_style;
275
  }
276
 
277
- $ad_format = (isset( $quads_options[$id]['adsense_type'] ) && $quads_options[$id]['adsense_type'] === 'responsive') && (isset( $quads_options[$id][$adtype_short.'_size'] ) && $quads_options[$id][$adtype_short.'_size'] === 'Auto') ? 'data-ad-format="auto"' : '';
278
 
279
  $html = '<ins class="adsbygoogle" style="' . $style . '"';
280
- $html .= ' data-ad-client="' . $quads_options[$id]['g_data_ad_client'] . '"';
281
- $html .= ' data-ad-slot="' . $quads_options[$id]['g_data_ad_slot'] . '" ' . $ad_format . '></ins>';
282
 
283
- if( !isset( $quads_options[$id]['tablet_portrait'] ) and !empty( $default_ad_sizes[$id]['tbl_portrait_width'] ) and !empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
284
  $js = 'if ( quads_screen_width >= 768 && quads_screen_width < 1024 ) {
285
  /* tablet portrait */
286
  document.write(\'' . $html . '\');
@@ -307,31 +305,31 @@ function quads_render_phone_js( $id, $default_ad_sizes ) {
307
 
308
  $responsive_style = 'display:block;' . $backgroundcolor;
309
 
310
- if( quads_is_advanced() && isset( $quads_options[$id]['adsense_type'] ) && $quads_options[$id]['adsense_type'] === 'responsive' ) {
311
  $width = $default_ad_sizes[$id][$adtype.'_width'];
312
 
313
  $height = $default_ad_sizes[$id][$adtype.'_height'];
314
 
315
  $normal_style = 'display:inline-block;width:' . $width . 'px;height:' . $height . 'px;' . $backgroundcolor;
316
 
317
- $style = isset( $quads_options[$id]['adsense_type'] ) && $quads_options[$id]['adsense_type'] === 'responsive' && (isset( $quads_options[$id][$adtype.'_size'] ) && $quads_options[$id][$adtype.'_size'] === 'Auto') ? $responsive_style : $normal_style;
318
  } else {
319
- $width = empty( $quads_options[$id]['g_data_ad_width'] ) ? $default_ad_sizes[$id][$adtype.'_width'] : $quads_options[$id]['g_data_ad_width'];
320
 
321
- $height = empty( $quads_options[$id]['g_data_ad_height'] ) ? $default_ad_sizes[$id][$adtype.'_height'] : $quads_options[$id]['g_data_ad_height'];
322
 
323
  $normal_style = 'display:inline-block;width:' . $width . 'px;height:' . $height . 'px;' . $backgroundcolor;
324
 
325
- $style = isset( $quads_options[$id]['adsense_type'] ) && $quads_options[$id]['adsense_type'] === 'responsive' ? $responsive_style : $normal_style;
326
  }
327
 
328
- $ad_format = (isset( $quads_options[$id]['adsense_type'] ) && $quads_options[$id]['adsense_type'] === 'responsive') && (isset( $quads_options[$id][$adtype.'_size'] ) && $quads_options[$id][$adtype.'_size'] === 'Auto') ? 'data-ad-format="auto"' : '';
329
 
330
  $html = '<ins class="adsbygoogle" style="' . $style . '"';
331
- $html .= ' data-ad-client="' . $quads_options[$id]['g_data_ad_client'] . '"';
332
- $html .= ' data-ad-slot="' . $quads_options[$id]['g_data_ad_slot'] . '" ' . $ad_format . '></ins>';
333
 
334
- if( !isset( $quads_options[$id][$adtype] ) and ! empty( $default_ad_sizes[$id][$adtype.'_width'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
335
  $js = 'if ( quads_screen_width < 768 ) {
336
  /* phone */
337
  document.write(\'' . $html . '\');
@@ -352,7 +350,7 @@ document.write(\'' . $html . '\');
352
  function quads_is_adsense( $id, $string ) {
353
  global $quads_options;
354
 
355
- if( isset($quads_options[$id]['ad_type']) && $quads_options[$id]['ad_type'] === 'adsense') {
356
  return true;
357
  }
358
  return false;
@@ -370,15 +368,15 @@ function quads_render_amp($id){
370
  global $quads_options;
371
 
372
  // if amp is not activated return empty
373
- if (!isset($quads_options[$id]['amp']) || quads_is_disabled_post_amp() ){
374
  return '';
375
  }
376
 
377
- if (!empty($quads_options[$id]['amp_code'])){
378
- $html = $quads_options[$id]['amp_code'];
379
  } else {
380
  // Return default adsense code
381
- $html = '<amp-ad layout="responsive" width=300 height=250 type="adsense" data-ad-client="'. $quads_options[$id]['g_data_ad_client'] . '" data-ad-slot="'.$quads_options[$id]['g_data_ad_slot'].'"></amp-ad>';
382
  }
383
 
384
  return $html;
46
 
47
  // Return the adsense ad code
48
  if( true === quads_is_adsense( $id, $string ) ) {
 
49
  return apply_filters( 'quads_render_ad', quads_render_google_async( $id ) );
50
  }
51
 
52
  // Return empty string
 
53
  return '';
54
  }
55
 
78
 
79
  // Overwrite default values if there are ones
80
  // Desktop big ad
81
+ if( !empty( $quads_options['ads'][$id]['desktop_size'] ) && $quads_options['ads'][$id]['desktop_size'] !== 'Auto' ) {
82
+ $ad_size_parts = explode( ' x ', $quads_options['ads'][$id]['desktop_size'] );
83
  $default_ad_sizes[$id]['desktop_width'] = $ad_size_parts[0];
84
  $default_ad_sizes[$id]['desktop_height'] = $ad_size_parts[1];
85
  }
86
 
87
 
88
  //tablet landscape
89
+ if( !empty( $quads_options['ads'][$id]['tbl_lands_size'] ) && $quads_options['ads'][$id]['tbl_lands_size'] !== 'Auto' ) {
90
+ $ad_size_parts = explode( ' x ', $quads_options['ads'][$id]['tbl_lands_size'] );
91
  $default_ad_sizes[$id]['tbl_landscape_width'] = $ad_size_parts[0];
92
  $default_ad_sizes[$id]['tbl_landscape_height'] = $ad_size_parts[1];
93
  }
94
 
95
 
96
  //tablet portrait
97
+ if( !empty( $quads_options['ads'][$id]['tbl_portr_size'] ) && $quads_options['ads'][$id]['tbl_portr_size'] !== 'Auto' ) {
98
+ $ad_size_parts = explode( ' x ', $quads_options['ads'][$id]['tbl_portr_size'] );
99
  $default_ad_sizes[$id]['tbl_portrait_width'] = $ad_size_parts[0];
100
  $default_ad_sizes[$id]['tbl_portrait_height'] = $ad_size_parts[1];
101
  }
102
 
103
 
104
  //phone
105
+ if( !empty( $quads_options['ads'][$id]['phone_size'] ) && $quads_options['ads'][$id]['phone_size'] !== 'Auto' ) {
106
+ $ad_size_parts = explode( ' x ', $quads_options['ads'][$id]['phone_size'] );
107
  $default_ad_sizes[$id]['phone_width'] = $ad_size_parts[0];
108
  $default_ad_sizes[$id]['phone_height'] = $ad_size_parts[1];
109
  }
146
  $backgroundcolor = '';
147
 
148
  $responsive_style = 'display:block;' . $backgroundcolor;
149
+
150
+ if( quads_is_extra() && isset( $quads_options['ads'][$id]['adsense_type'] ) && $quads_options['ads'][$id]['adsense_type'] === 'responsive' ) {
151
  $width = $default_ad_sizes[$id][$adtype.'_width'];
152
 
153
  $height = $default_ad_sizes[$id][$adtype.'_height'];
154
 
155
  $normal_style = 'display:inline-block;width:' . $width . 'px;height:' . $height . 'px;' . $backgroundcolor;
156
 
157
+ $style = isset( $quads_options['ads'][$id]['adsense_type'] ) && $quads_options['ads'][$id]['adsense_type'] === 'responsive' && (isset( $quads_options['ads'][$id][$adtype.'_size'] ) && $quads_options['ads'][$id][$adtype.'_size'] === 'Auto') ? $responsive_style : $normal_style;
158
  } else {
159
+ $width = empty( $quads_options['ads'][$id]['g_data_ad_width'] ) ? $default_ad_sizes[$id][$adtype.'_width'] : $quads_options['ads'][$id]['g_data_ad_width'];
160
 
161
+ $height = empty( $quads_options['ads'][$id]['g_data_ad_height'] ) ? $default_ad_sizes[$id][$adtype.'_height'] : $quads_options['ads'][$id]['g_data_ad_height'];
162
 
163
  $normal_style = 'display:inline-block;width:' . $width . 'px;height:' . $height . 'px;' . $backgroundcolor;
164
 
165
+ $style = isset( $quads_options['ads'][$id]['adsense_type'] ) && $quads_options['ads'][$id]['adsense_type'] === 'responsive' ? $responsive_style : $normal_style;
166
  }
167
 
168
+ $ad_format = (isset( $quads_options['ads'][$id]['adsense_type'] ) && $quads_options['ads'][$id]['adsense_type'] === 'responsive') && (isset( $quads_options['ads'][$id][$adtype.'_size'] ) && $quads_options['ads'][$id][$adtype.'_size'] === 'Auto') ? 'data-ad-format="auto"' : '';
169
 
170
  $html = '<ins class="adsbygoogle" style="' . $style . '"';
171
+ $html .= ' data-ad-client="' . $quads_options['ads'][$id]['g_data_ad_client'] . '"';
172
+ $html .= ' data-ad-slot="' . $quads_options['ads'][$id]['g_data_ad_slot'] . '" ' . $ad_format . '></ins>';
173
 
174
+ if( !isset( $quads_options['ads'][$id][$adtype] ) and !empty( $default_ad_sizes[$id][$adtype.'_width'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
175
  $js = 'if ( quads_screen_width >= 1140 ) {
176
  /* desktop monitors */
177
  document.write(\'' . $html . '\');
200
 
201
  $responsive_style = 'display:block;' . $backgroundcolor;
202
 
203
+ if( quads_is_extra() && isset( $quads_options['ads'][$id]['adsense_type'] ) && $quads_options['ads'][$id]['adsense_type'] === 'responsive' ) {
204
  $width = $default_ad_sizes[$id][$adtype.'_width'];
205
 
206
  $height = $default_ad_sizes[$id][$adtype.'_height'];
207
 
208
  $normal_style = 'display:inline-block;width:' . $width . 'px;height:' . $height . 'px;' . $backgroundcolor;
209
 
210
+ $style = isset( $quads_options['ads'][$id]['adsense_type'] ) && $quads_options['ads'][$id]['adsense_type'] === 'responsive' && (isset( $quads_options['ads'][$id][$adtype_short.'_size'] ) && $quads_options['ads'][$id][$adtype_short.'_size'] === 'Auto') ? $responsive_style : $normal_style;
211
  } else {
212
+ $width = empty( $quads_options['ads'][$id]['g_data_ad_width'] ) ? $default_ad_sizes[$id][$adtype.'_width'] : $quads_options['ads'][$id]['g_data_ad_width'];
213
 
214
+ $height = empty( $quads_options['ads'][$id]['g_data_ad_height'] ) ? $default_ad_sizes[$id][$adtype.'_height'] : $quads_options['ads'][$id]['g_data_ad_height'];
215
 
216
  $normal_style = 'display:inline-block;width:' . $width . 'px;height:' . $height . 'px;' . $backgroundcolor;
217
 
218
+ $style = isset( $quads_options['ads'][$id]['adsense_type'] ) && $quads_options['ads'][$id]['adsense_type'] === 'responsive' ? $responsive_style : $normal_style;
219
  }
220
 
221
+ $ad_format = (isset( $quads_options['ads'][$id]['adsense_type'] ) && $quads_options['ads'][$id]['adsense_type'] === 'responsive') && (isset( $quads_options['ads'][$id][$adtype_short.'_size'] ) && $quads_options['ads'][$id][$adtype_short.'_size'] === 'Auto') ? 'data-ad-format="auto"' : '';
222
 
223
 
224
  $html = '<ins class="adsbygoogle" style="' . $style . '"';
225
+ $html .= ' data-ad-client="' . $quads_options['ads'][$id]['g_data_ad_client'] . '"';
226
+ $html .= ' data-ad-slot="' . $quads_options['ads'][$id]['g_data_ad_slot'] . '" ' . $ad_format . '></ins>';
227
 
228
+ if( !isset( $quads_options['ads'][$id]['tablet_landscape'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_width'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
229
  $js = 'if ( quads_screen_width >= 1024 && quads_screen_width < 1140 ) {
230
  /* tablet landscape */
231
  document.write(\'' . $html . '\');
254
 
255
  $responsive_style = 'display:block;' . $backgroundcolor;
256
 
257
+ if( quads_is_extra() && isset( $quads_options['ads'][$id]['adsense_type'] ) && $quads_options['ads'][$id]['adsense_type'] === 'responsive' ) {
258
  $width = $default_ad_sizes[$id][$adtype.'_width'];
259
 
260
  $height = $default_ad_sizes[$id][$adtype.'_height'];
261
 
262
  $normal_style = 'display:inline-block;width:' . $width . 'px;height:' . $height . 'px;' . $backgroundcolor;
263
 
264
+ $style = isset( $quads_options['ads'][$id]['adsense_type'] ) && $quads_options['ads'][$id]['adsense_type'] === 'responsive' && (isset( $quads_options['ads'][$id][$adtype_short.'_size'] ) && $quads_options['ads'][$id][$adtype_short.'_size'] === 'Auto') ? $responsive_style : $normal_style;
265
  } else {
266
+ $width = empty( $quads_options['ads'][$id]['g_data_ad_width'] ) ? $default_ad_sizes[$id][$adtype.'_width'] : $quads_options['ads'][$id]['g_data_ad_width'];
267
 
268
+ $height = empty( $quads_options['ads'][$id]['g_data_ad_height'] ) ? $default_ad_sizes[$id][$adtype.'_height'] : $quads_options['ads'][$id]['g_data_ad_height'];
269
 
270
  $normal_style = 'display:inline-block;width:' . $width . 'px;height:' . $height . 'px;' . $backgroundcolor;
271
 
272
+ $style = isset( $quads_options['ads'][$id]['adsense_type'] ) && $quads_options['ads'][$id]['adsense_type'] === 'responsive' ? $responsive_style : $normal_style;
273
  }
274
 
275
+ $ad_format = (isset( $quads_options['ads'][$id]['adsense_type'] ) && $quads_options['ads'][$id]['adsense_type'] === 'responsive') && (isset( $quads_options['ads'][$id][$adtype_short.'_size'] ) && $quads_options['ads'][$id][$adtype_short.'_size'] === 'Auto') ? 'data-ad-format="auto"' : '';
276
 
277
  $html = '<ins class="adsbygoogle" style="' . $style . '"';
278
+ $html .= ' data-ad-client="' . $quads_options['ads'][$id]['g_data_ad_client'] . '"';
279
+ $html .= ' data-ad-slot="' . $quads_options['ads'][$id]['g_data_ad_slot'] . '" ' . $ad_format . '></ins>';
280
 
281
+ if( !isset( $quads_options['ads'][$id]['tablet_portrait'] ) and !empty( $default_ad_sizes[$id]['tbl_portrait_width'] ) and !empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
282
  $js = 'if ( quads_screen_width >= 768 && quads_screen_width < 1024 ) {
283
  /* tablet portrait */
284
  document.write(\'' . $html . '\');
305
 
306
  $responsive_style = 'display:block;' . $backgroundcolor;
307
 
308
+ if( quads_is_extra() && isset( $quads_options['ads'][$id]['adsense_type'] ) && $quads_options['ads'][$id]['adsense_type'] === 'responsive' ) {
309
  $width = $default_ad_sizes[$id][$adtype.'_width'];
310
 
311
  $height = $default_ad_sizes[$id][$adtype.'_height'];
312
 
313
  $normal_style = 'display:inline-block;width:' . $width . 'px;height:' . $height . 'px;' . $backgroundcolor;
314
 
315
+ $style = isset( $quads_options['ads'][$id]['adsense_type'] ) && $quads_options['ads'][$id]['adsense_type'] === 'responsive' && (isset( $quads_options['ads'][$id][$adtype.'_size'] ) && $quads_options['ads'][$id][$adtype.'_size'] === 'Auto') ? $responsive_style : $normal_style;
316
  } else {
317
+ $width = empty( $quads_options['ads'][$id]['g_data_ad_width'] ) ? $default_ad_sizes[$id][$adtype.'_width'] : $quads_options['ads'][$id]['g_data_ad_width'];
318
 
319
+ $height = empty( $quads_options['ads'][$id]['g_data_ad_height'] ) ? $default_ad_sizes[$id][$adtype.'_height'] : $quads_options['ads'][$id]['g_data_ad_height'];
320
 
321
  $normal_style = 'display:inline-block;width:' . $width . 'px;height:' . $height . 'px;' . $backgroundcolor;
322
 
323
+ $style = isset( $quads_options['ads'][$id]['adsense_type'] ) && $quads_options['ads'][$id]['adsense_type'] === 'responsive' ? $responsive_style : $normal_style;
324
  }
325
 
326
+ $ad_format = (isset( $quads_options['ads'][$id]['adsense_type'] ) && $quads_options['ads'][$id]['adsense_type'] === 'responsive') && (isset( $quads_options['ads'][$id][$adtype.'_size'] ) && $quads_options['ads'][$id][$adtype.'_size'] === 'Auto') ? 'data-ad-format="auto"' : '';
327
 
328
  $html = '<ins class="adsbygoogle" style="' . $style . '"';
329
+ $html .= ' data-ad-client="' . $quads_options['ads'][$id]['g_data_ad_client'] . '"';
330
+ $html .= ' data-ad-slot="' . $quads_options['ads'][$id]['g_data_ad_slot'] . '" ' . $ad_format . '></ins>';
331
 
332
+ if( !isset( $quads_options['ads'][$id][$adtype] ) and ! empty( $default_ad_sizes[$id][$adtype.'_width'] ) and ! empty( $default_ad_sizes[$id][$adtype.'_height'] ) ) {
333
  $js = 'if ( quads_screen_width < 768 ) {
334
  /* phone */
335
  document.write(\'' . $html . '\');
350
  function quads_is_adsense( $id, $string ) {
351
  global $quads_options;
352
 
353
+ if( isset($quads_options['ads'][$id]['ad_type']) && $quads_options['ads'][$id]['ad_type'] === 'adsense') {
354
  return true;
355
  }
356
  return false;
368
  global $quads_options;
369
 
370
  // if amp is not activated return empty
371
+ if (!isset($quads_options['ads'][$id]['amp']) || quads_is_disabled_post_amp() ){
372
  return '';
373
  }
374
 
375
+ if (!empty($quads_options['ads'][$id]['amp_code'])){
376
+ $html = $quads_options['ads'][$id]['amp_code'];
377
  } else {
378
  // Return default adsense code
379
+ $html = '<amp-ad layout="responsive" width=300 height=250 type="adsense" data-ad-client="'. $quads_options['ads'][$id]['g_data_ad_client'] . '" data-ad-slot="'.$quads_options['ads'][$id]['g_data_ad_slot'].'"></amp-ad>';
380
  }
381
 
382
  return $html;
includes/scripts.php CHANGED
@@ -62,9 +62,6 @@ function quads_load_admin_scripts( $hook ) {
62
  // Use minified libraries if SCRIPT_DEBUG is turned off
63
  $suffix = ( quadsIsDebugMode() ) ? '' : '.min';
64
 
65
- // if ( quads_is_plugins_page() ){
66
- // wp_enqueue_script( 'quads-global-admin-scripts', $js_dir . 'quads-global-admin' . $suffix . '.js', array('jquery'), QUADS_VERSION, false );
67
- // }
68
 
69
  // These have to be global
70
  wp_enqueue_script( 'quads-admin-ads', $js_dir . 'ads.js', array('jquery'), QUADS_VERSION, false );
@@ -127,7 +124,7 @@ function quads_register_styles( $hook ) {
127
 
128
  /**
129
  * Add dynamic CSS to write media queries for removing unwanted ads without the need to use any cache busting method
130
- * that could affect performance and lead to lot of support tickets
131
  *
132
  * @since 1.0
133
  * @global1 array options
@@ -140,11 +137,14 @@ function quads_inline_styles() {
140
 
141
  $css = '';
142
 
143
- foreach ($quads_options as $key => $value){
144
- $css .= quads_render_media_query($key, $value);
145
- }
146
-
147
- wp_add_inline_style( 'quads-styles', $css );
 
 
 
148
  }
149
 
150
  /**
@@ -159,16 +159,21 @@ function quads_render_media_query($key, $value){
159
  $html = '';
160
 
161
  if (isset($value['desktop']) ){
162
- $html .= '@media only screen and (min-width:1140px){.quads-'.$key.' {display:none;}}'. "\n";
 
 
163
  }
164
  if (isset($value['tablet_landscape']) ){
165
- $html .= '@media only screen and (min-width:1024px) and (max:width:1140px) {.quads-'.$key.' {display:none;}}' . "\n";
 
166
  }
167
  if (isset($value['tablet_portrait']) ){
168
- $html .= '@media only screen and (min-width:768px) and (max-width:1024px){.quads-'.$key.' {display:none;}}' . "\n";
 
169
  }
170
  if (isset($value['phone']) ){
171
- $html .= '@media only screen and (max-width:768px){.quads-'.$key.' {display:none;}}' . "\n";
 
172
  }
173
 
174
  return $html;
62
  // Use minified libraries if SCRIPT_DEBUG is turned off
63
  $suffix = ( quadsIsDebugMode() ) ? '' : '.min';
64
 
 
 
 
65
 
66
  // These have to be global
67
  wp_enqueue_script( 'quads-admin-ads', $js_dir . 'ads.js', array('jquery'), QUADS_VERSION, false );
124
 
125
  /**
126
  * Add dynamic CSS to write media queries for removing unwanted ads without the need to use any cache busting method
127
+ * (Cache busting could affect performance and lead to lot of support tickets so lets follow the css approach)
128
  *
129
  * @since 1.0
130
  * @global1 array options
137
 
138
  $css = '';
139
 
140
+ if( isset( $quads_options['ads'] ) ) {
141
+ foreach ( $quads_options['ads'] as $key => $value ) {
142
+ $css .= quads_render_media_query( $key, $value );
143
+ }
144
+ }
145
+
146
+
147
+ wp_add_inline_style( 'quads-styles', $css );
148
  }
149
 
150
  /**
159
  $html = '';
160
 
161
  if (isset($value['desktop']) ){
162
+ //$html .= '@media only screen and (min-width:1140px){.quads-'.$key.' {display:none;}}'. "\n";
163
+ //$html .= '/* Hide on desktop */';
164
+ $html .= '@media only screen and (min-width:1140px){#quads-'.$key.', .quads-' . $key . ' {display:none;}}'. "\n";
165
  }
166
  if (isset($value['tablet_landscape']) ){
167
+ //$html .= '/* Hide on tablet landscape */';
168
+ $html .= '@media only screen and (min-width:1024px) and (max-width:1140px) {#quads-'.$key.', .quads-'.$key.' {display:none;}}' . "\n";
169
  }
170
  if (isset($value['tablet_portrait']) ){
171
+ //$html .= '/* Hide on tablet portrait */';
172
+ $html .= '@media only screen and (min-width:768px) and (max-width:1023px){#quads-'.$key.', .quads-'.$key.' {display:none;}}' . "\n";
173
  }
174
  if (isset($value['phone']) ){
175
+ //$html .= '/* Hide on mobile device */';
176
+ $html .= '@media only screen and (max-width:767px){#quads-'.$key.', .quads-'.$key.' {display:none;}}' . "\n";
177
  }
178
 
179
  return $html;
includes/shortcodes.php CHANGED
@@ -38,6 +38,7 @@ function quads_shortcode_display_ad( $atts ) {
38
 
39
  // The ad id
40
  $id = isset( $atts['id'] ) ? ( int ) $atts['id'] : 0;
 
41
 
42
  $arr = array(
43
  'float:left;margin:%1$dpx %1$dpx %1$dpx 0;',
@@ -45,8 +46,8 @@ function quads_shortcode_display_ad( $atts ) {
45
  'float:right;margin:%1$dpx 0 %1$dpx %1$dpx;',
46
  'float:none;margin:0px;');
47
 
48
- $adsalign = $quads_options['ad' . $id]['align'];
49
- $adsmargin = isset( $quads_options['ad' . $id]['margin'] ) ? $quads_options['ad' . $id]['margin'] : '3'; // default
50
  $margin = sprintf( $arr[( int ) $adsalign], $adsmargin );
51
 
52
 
@@ -75,12 +76,12 @@ function quads_get_ad($id = 0) {
75
  return;
76
  }
77
 
78
- if ( isset($quads_options['ad' . $id]['code']) ){
79
  // Count how often the shortcode is used - Important
80
  quads_set_ad_count_shortcode();
81
  //$code = "\n".'<!-- WP QUADS Shortcode Ad v. ' . QUADS_VERSION .' -->'."\n";
82
  //return $code . $quads_options['ad' . $id]['code'];
83
- return quads_render_ad('ad' . $id, $quads_options['ad' . $id]['code']);
84
  }
85
  }
86
 
38
 
39
  // The ad id
40
  $id = isset( $atts['id'] ) ? ( int ) $atts['id'] : 0;
41
+ //wp_die($id);
42
 
43
  $arr = array(
44
  'float:left;margin:%1$dpx %1$dpx %1$dpx 0;',
46
  'float:right;margin:%1$dpx 0 %1$dpx %1$dpx;',
47
  'float:none;margin:0px;');
48
 
49
+ $adsalign = isset($quads_options['ads']['ad' . $id]['align']) ? $quads_options['ads']['ad' . $id]['align'] : 3; // default
50
+ $adsmargin = isset( $quads_options['ads']['ad' . $id]['margin'] ) ? $quads_options['ads']['ad' . $id]['margin'] : '3'; // default
51
  $margin = sprintf( $arr[( int ) $adsalign], $adsmargin );
52
 
53
 
76
  return;
77
  }
78
 
79
+ if ( isset($quads_options['ads']['ad' . $id]['code']) ){
80
  // Count how often the shortcode is used - Important
81
  quads_set_ad_count_shortcode();
82
  //$code = "\n".'<!-- WP QUADS Shortcode Ad v. ' . QUADS_VERSION .' -->'."\n";
83
  //return $code . $quads_options['ad' . $id]['code'];
84
+ return quads_render_ad('ad' . $id, $quads_options['ads']['ad' . $id]['code']);
85
  }
86
  }
87
 
includes/template-functions.php CHANGED
@@ -44,27 +44,26 @@ function quads_post_settings_to_quicktags ( $content ) {
44
  *
45
  * @return string
46
  */
47
- function quads_get_visibility_quicktags_str ( $post_id = null ) {
48
-
49
- if ( ! $post_id ) {
50
- $post_id = get_the_ID();
51
- }
52
 
53
- $str = '';
54
- if (false === $post_id){
55
- return $str;
56
- }
57
-
58
- $config = get_post_meta( $post_id, '_quads_config_visibility', true );
59
-
60
-
61
- if ( !empty($config))
62
- foreach ( $config as $qtag_id => $qtag_label ) {
63
- $str .= '<!--' . $qtag_id . '-->';
64
- //$str .= $qtag_id;
65
- }
66
-
67
- return $str;
 
 
 
68
  }
69
 
70
  /**
@@ -177,9 +176,9 @@ function quads_get_active_ads() {
177
 
178
  // Array of ad codes
179
  for ( $i = 1; $i <= $numberAds; $i++ ) {
180
- $tmp = isset( $quads_options['ad' . $i]['code'] ) ? trim( $quads_options['ad' . $i]['code'] ) : '';
181
  // id is valid if there is either the plain text field populated or the adsense ad slot and the ad client id
182
- if( !empty( $tmp ) || (!empty( $quads_options['ad' . $i]['g_data_ad_slot'] ) && !empty( $quads_options['ad' . $i]['g_data_ad_client'] ) ) ) {
183
  $adsArray[] = $i;
184
  }
185
  }
@@ -191,25 +190,25 @@ function quads_get_active_ads() {
191
  * Get complete array of valid ads
192
  * @global arr $quads_options
193
  */
194
- function quads_get_ad_content() {
195
- global $quads_options;
196
-
197
- // Max amount of different content ads we can have
198
- $numberAds = 10;
199
-
200
- $adsArray = array();
201
-
202
- // Array of ad codes
203
- for ( $i = 1; $i <= $numberAds; $i++ ) {
204
- $tmp = isset( $quads_options['ad' . $i]['code'] ) ? trim( $quads_options['ad' . $i]['code'] ) : '';
205
- // id is valid if there is either the plain text field populated or the adsense ad slot and the ad client id
206
- if( !empty( $tmp ) || (!empty( $quads_options['ad' . $i]['g_data_ad_slot'] ) && !empty( $quads_options['ad' . $i]['g_data_ad_client'] ) ) ) {
207
- $adsArray[] = $quads_options['ad' . $i];
208
- }
209
- }
210
-
211
- return count($adsArray) ? $adsArray : 0;
212
- }
213
 
214
 
215
  /**
@@ -236,6 +235,7 @@ function quads_get_max_allowed_post_ads( $content ) {
236
  }
237
  }
238
  //echo 'test' . $maxAds . quads_is_amp_endpoint();
 
239
  return $maxAds;
240
  }
241
 
@@ -452,25 +452,27 @@ function quads_filter_default_ads( $content ) {
452
  $content = str_replace( "<IMG", $imgtag, $content );
453
  $content = str_replace( "</A>", $atag, $content );
454
 
455
- // Start
456
- $paragraphsArray = explode( $imgtag, $content );
457
- if( ( int ) $imageNo < count( $paragraphsArray ) ) {
458
- $paragraphsArrayImages = explode( $delimiter, $paragraphsArray[$imageNo] );
459
- if( count( $paragraphsArrayImages ) > 1 ) {
460
- $tss = explode( $caption, $paragraphsArray[$imageNo] );
461
- $ccp = ( count( $tss ) > 1 ) ? strpos( strtolower( $tss[0] ), '[caption ' ) === false : false;
462
- $paragraphsArrayAtag = explode( $atag, $paragraphsArray[$imageNo] );
463
- $cdu = ( count( $paragraphsArrayAtag ) > 1 ) ? strpos( strtolower( $paragraphsArrayAtag[0] ), '<a href' ) === false : false;
 
 
 
464
  if( $imageCaption && $ccp ) {
465
- $paragraphsArray[$imageNo] = implode( $caption, array_slice( $tss, 0, 1 ) ) . $caption . "\r\n" . '<!--' . $imageAd . '-->' . "\r\n" . implode( $caption, array_slice( $tss, 1 ) );
466
  } else if( $cdu ) {
467
- $paragraphsArray[$imageNo] = implode( $atag, array_slice( $paragraphsArrayAtag, 0, 1 ) ) . $atag . "\r\n" . '<!--' . $imageAd . '-->' . "\r\n" . implode( $atag, array_slice( $paragraphsArrayAtag, 1 ) );
468
  } else {
469
-
470
- $paragraphsArray[$imageNo] = implode( $delimiter, array_slice( $paragraphsArrayImages, 0, 1 ) ) . $delimiter . "\r\n" . '<!--' . $imageAd . '-->' . "\r\n" . implode( $delimiter, array_slice( $paragraphsArrayImages, 1 ) );
471
  }
472
  }
473
- $content = implode( $imgtag, $paragraphsArray );
474
  }
475
  }
476
 
@@ -683,20 +685,8 @@ function quads_replace_ads($content, $quicktag, $id) {
683
 
684
 
685
  if ($id != -1) {
686
- // $styleArray = array(
687
- // 'float:left;margin:%1$dpx %1$dpx %1$dpx 0;',
688
- // 'float:none;margin:%1$dpx 0 %1$dpx 0;text-align:center;',
689
- // 'float:right;margin:%1$dpx 0 %1$dpx %1$dpx;',
690
- // 'float:none;margin:0px;');
691
- //
692
- // $adsalign = $quads_options['ad' . $id]['align'];
693
- // $adsmargin = isset($quads_options['ad' . $id]['margin']) ? $quads_options['ad' . $id]['margin'] : '3'; // default
694
- // $margin = sprintf($styleArray[(int)$adsalign], $adsmargin);
695
- //
696
- // // Do not create any inline style on AMP site
697
- // $style = !quads_is_amp_endpoint() ? apply_filters ('quads_filter_margins', $margin, 'ad'.$id ) : '';
698
 
699
- $code = !empty($quads_options['ad' . $id ]['code']) ? $quads_options['ad' . $id ]['code'] : '';
700
  $style = quads_get_inline_ad_style($id);
701
  $adscode =
702
  "\n".'<!-- WP QUADS Content Ad Plugin v. ' . QUADS_VERSION .' -->'."\n".
@@ -734,10 +724,10 @@ function quads_get_inline_ad_style( $id ) {
734
  'float:none;margin:0px;');
735
 
736
  // Alignment
737
- $adsalign = $quads_options['ad' . $id]['align'];
738
 
739
  // Margin
740
- $adsmargin = isset( $quads_options['ad' . $id]['margin'] ) ? $quads_options['ad' . $id]['margin'] : '3'; // default optin = 3
741
  $margin = sprintf( $styleArray[( int ) $adsalign], $adsmargin );
742
 
743
  // Do not create any inline style on AMP site
44
  *
45
  * @return string
46
  */
47
+ function quads_get_visibility_quicktags_str( $post_id = null ) {
 
 
 
 
48
 
49
+ if( !$post_id ) {
50
+ $post_id = get_the_ID();
51
+ }
52
+
53
+ $str = '';
54
+ if( false === $post_id ) {
55
+ return $str;
56
+ }
57
+
58
+ $config = get_post_meta( $post_id, '_quads_config_visibility', true );
59
+
60
+ if( !empty( $config ) && is_array($config) ) {
61
+ foreach ( $config as $qtag_id => $qtag_label ) {
62
+ $str .= '<!--' . $qtag_id . '-->';
63
+ }
64
+ }
65
+
66
+ return $str;
67
  }
68
 
69
  /**
176
 
177
  // Array of ad codes
178
  for ( $i = 1; $i <= $numberAds; $i++ ) {
179
+ $tmp = isset( $quads_options['ads']['ad' . $i]['code'] ) ? trim( $quads_options['ads']['ad' . $i]['code'] ) : '';
180
  // id is valid if there is either the plain text field populated or the adsense ad slot and the ad client id
181
+ if( !empty( $tmp ) || (!empty( $quads_options['ads']['ad' . $i]['g_data_ad_slot'] ) && !empty( $quads_options['ads']['ad' . $i]['g_data_ad_client'] ) ) ) {
182
  $adsArray[] = $i;
183
  }
184
  }
190
  * Get complete array of valid ads
191
  * @global arr $quads_options
192
  */
193
+ //function quads_get_ad_content() {
194
+ // global $quads_options;
195
+ //
196
+ // // Max amount of different content ads we can have
197
+ // $numberAds = 10;
198
+ //
199
+ // $adsArray = array();
200
+ //
201
+ // // Array of ad codes
202
+ // for ( $i = 1; $i <= $numberAds; $i++ ) {
203
+ // $tmp = isset( $quads_options['ads']['ad' . $i]['code'] ) ? trim( $quads_options['ads']['ad' . $i]['code'] ) : '';
204
+ // // id is valid if there is either the plain text field populated or the adsense ad slot and the ad client id
205
+ // if( !empty( $tmp ) || (!empty( $quads_options['ads']['ad' . $i]['g_data_ad_slot'] ) && !empty( $quads_options['ads']['ad' . $i]['g_data_ad_client'] ) ) ) {
206
+ // $adsArray[] = $quads_options['ads']['ad' . $i];
207
+ // }
208
+ // }
209
+ //
210
+ // return count($adsArray) ? $adsArray : 0;
211
+ //}
212
 
213
 
214
  /**
235
  }
236
  }
237
  //echo 'test' . $maxAds . quads_is_amp_endpoint();
238
+ //wp_die($maxAds);
239
  return $maxAds;
240
  }
241
 
452
  $content = str_replace( "<IMG", $imgtag, $content );
453
  $content = str_replace( "</A>", $atag, $content );
454
 
455
+ // Get all images in content
456
+ $imagesArray = explode( $imgtag, $content );
457
+ // Modify Image ad
458
+ if( ( int ) $imageNo < count( $imagesArray ) ) {
459
+ //Get all tags
460
+ $tagsArray = explode( $delimiter, $imagesArray[$imageNo] );
461
+ if( count( $tagsArray ) > 1 ) {
462
+ $captionArray = explode( $caption, $imagesArray[$imageNo] );
463
+ $ccp = ( count( $captionArray ) > 1 ) ? strpos( strtolower( $captionArray[0] ), '[caption ' ) === false : false;
464
+ $imagesArrayAtag = explode( $atag, $imagesArray[$imageNo] );
465
+ $cdu = ( count( $imagesArrayAtag ) > 1 ) ? strpos( strtolower( $imagesArrayAtag[0] ), '<a href' ) === false : false;
466
+ // Show ad after caption
467
  if( $imageCaption && $ccp ) {
468
+ $imagesArray[$imageNo] = implode( $caption, array_slice( $captionArray, 0, 1 ) ) . $caption . "\r\n" . '<!--' . $imageAd . '-->' . "\r\n" . implode( $caption, array_slice( $captionArray, 1 ) );
469
  } else if( $cdu ) {
470
+ $imagesArray[$imageNo] = implode( $atag, array_slice( $imagesArrayAtag, 0, 1 ) ) . $atag . "\r\n" . '<!--' . $imageAd . '-->' . "\r\n" . implode( $atag, array_slice( $imagesArrayAtag, 1 ) );
471
  } else {
472
+ $imagesArray[$imageNo] = implode( $delimiter, array_slice( $tagsArray, 0, 1 ) ) . $delimiter . "\r\n" . '<!--' . $imageAd . '-->' . "\r\n" . implode( $delimiter, array_slice( $tagsArray, 1 ) );
 
473
  }
474
  }
475
+ $content = implode( $imgtag, $imagesArray );
476
  }
477
  }
478
 
685
 
686
 
687
  if ($id != -1) {
 
 
 
 
 
 
 
 
 
 
 
 
688
 
689
+ $code = !empty($quads_options['ads']['ad' . $id ]['code']) ? $quads_options['ads']['ad' . $id ]['code'] : '';
690
  $style = quads_get_inline_ad_style($id);
691
  $adscode =
692
  "\n".'<!-- WP QUADS Content Ad Plugin v. ' . QUADS_VERSION .' -->'."\n".
724
  'float:none;margin:0px;');
725
 
726
  // Alignment
727
+ $adsalign = $quads_options['ads']['ad' . $id]['align'];
728
 
729
  // Margin
730
+ $adsmargin = isset( $quads_options['ads']['ad' . $id]['margin'] ) ? $quads_options['ads']['ad' . $id]['margin'] : '3'; // default optin = 3
731
  $margin = sprintf( $styleArray[( int ) $adsalign], $adsmargin );
732
 
733
  // Do not create any inline style on AMP site
includes/widgets.php CHANGED
@@ -24,13 +24,15 @@ function quads_register_widgets() {
24
 
25
  $amountWidgets = 10;
26
  for ( $i = 1; $i <= $amountWidgets; $i++ ) {
27
- if( !empty( $quads_options['ad' . $i . '_widget']['code'] ) ) {
28
  register_widget( 'quads_widgets_' . $i );
29
  }
30
  }
31
  }
32
 
33
 
 
 
34
  class quads_widgets_1 extends WP_Widget {
35
 
36
  /**
@@ -70,12 +72,11 @@ class quads_widgets_1 extends WP_Widget {
70
  extract( $args );
71
 
72
  $cont = quads_post_settings_to_quicktags( get_the_content() );
73
- //if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() && !quads_ad_reach_max_count() ) {
74
- if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() ) {
75
 
76
  //quads_set_ad_count_widget();
77
  //$codetxt = $quads_options['ad' . $this->adsID . '_widget'];
78
- $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ad' . $this->adsID . '_widget']['code'] );
79
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
80
  if( array_key_exists( 'before_widget', $args ) )
81
  echo $args['before_widget'];
@@ -122,10 +123,10 @@ class quads_widgets_2 extends WP_Widget {
122
 
123
  $cont = quads_post_settings_to_quicktags( get_the_content() );
124
  //if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() && !quads_ad_reach_max_count() ) {
125
- if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() ) {
126
 
127
  //quads_set_ad_count_widget();
128
- $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ad' . $this->adsID . '_widget']['code'] );
129
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
130
  //if (array_key_exists('before_widget', $args))
131
  echo $args['before_widget'];
@@ -170,10 +171,10 @@ class quads_widgets_3 extends WP_Widget {
170
  }
171
  extract( $args );
172
  $cont = quads_post_settings_to_quicktags( get_the_content() );
173
- if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() ) {
174
 
175
  //quads_set_ad_count_widget();
176
- $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ad' . $this->adsID . '_widget']['code'] );
177
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
178
  if( array_key_exists( 'before_widget', $args ) )
179
  echo $args['before_widget'];
@@ -219,10 +220,10 @@ class quads_widgets_4 extends WP_Widget {
219
 
220
  extract( $args );
221
  $cont = quads_post_settings_to_quicktags( get_the_content() );
222
- if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() ) {
223
 
224
  //quads_set_ad_count_widget();
225
- $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ad' . $this->adsID . '_widget']['code'] );
226
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
227
  if( array_key_exists( 'before_widget', $args ) )
228
  echo $args['before_widget'];
@@ -267,10 +268,10 @@ class quads_widgets_5 extends WP_Widget {
267
  }
268
  extract( $args );
269
  $cont = quads_post_settings_to_quicktags( get_the_content() );
270
- if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() ) {
271
 
272
  //quads_set_ad_count_widget();
273
- $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ad' . $this->adsID . '_widget']['code'] );
274
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
275
  if( array_key_exists( 'before_widget', $args ) )
276
  echo $args['before_widget'];
@@ -316,10 +317,10 @@ class quads_widgets_6 extends WP_Widget {
316
 
317
  extract( $args );
318
  $cont = quads_post_settings_to_quicktags( get_the_content() );
319
- if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() ) {
320
 
321
  //quads_set_ad_count_widget();
322
- $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ad' . $this->adsID . '_widget']['code'] );
323
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
324
  if( array_key_exists( 'before_widget', $args ) )
325
  echo $args['before_widget'];
@@ -365,10 +366,10 @@ class quads_widgets_7 extends WP_Widget {
365
 
366
  extract( $args );
367
  $cont = quads_post_settings_to_quicktags( get_the_content() );
368
- if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() ) {
369
 
370
  //quads_set_ad_count_widget();
371
- $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ad' . $this->adsID . '_widget']['code'] );
372
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
373
  if( array_key_exists( 'before_widget', $args ) )
374
  echo $args['before_widget'];
@@ -414,10 +415,10 @@ class quads_widgets_8 extends WP_Widget {
414
 
415
  extract( $args );
416
  $cont = quads_post_settings_to_quicktags( get_the_content() );
417
- if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() ) {
418
 
419
  //quads_set_ad_count_widget();
420
- $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ad' . $this->adsID . '_widget']['code'] );
421
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
422
  if( array_key_exists( 'before_widget', $args ) )
423
  echo $args['before_widget'];
@@ -463,10 +464,10 @@ class quads_widgets_9 extends WP_Widget {
463
 
464
  extract( $args );
465
  $cont = quads_post_settings_to_quicktags( get_the_content() );
466
- if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() ) {
467
 
468
  //quads_set_ad_count_widget();
469
- $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ad' . $this->adsID . '_widget']['code'] );
470
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
471
  if( array_key_exists( 'before_widget', $args ) )
472
  echo $args['before_widget'];
@@ -512,10 +513,10 @@ class quads_widgets_10 extends WP_Widget {
512
 
513
  extract( $args );
514
  $cont = quads_post_settings_to_quicktags( get_the_content() );
515
- if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() ) {
516
 
517
  //quads_set_ad_count_widget();
518
- $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ad' . $this->adsID . '_widget']['code'] );
519
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
520
  if( array_key_exists( 'before_widget', $args ) )
521
  echo $args['before_widget'];
24
 
25
  $amountWidgets = 10;
26
  for ( $i = 1; $i <= $amountWidgets; $i++ ) {
27
+ if( !empty( $quads_options['ads']['ad' . $i . '_widget']['code']) || !empty( $quads_options['ads']['ad' . $i . '_widget']['g_data_ad_slot']) ) {
28
  register_widget( 'quads_widgets_' . $i );
29
  }
30
  }
31
  }
32
 
33
 
34
+
35
+
36
  class quads_widgets_1 extends WP_Widget {
37
 
38
  /**
72
  extract( $args );
73
 
74
  $cont = quads_post_settings_to_quicktags( get_the_content() );
75
+ if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() && !quads_hide_ad_widget_on_homepage() ) {
 
76
 
77
  //quads_set_ad_count_widget();
78
  //$codetxt = $quads_options['ad' . $this->adsID . '_widget'];
79
+ $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ads']['ad' . $this->adsID . '_widget']['code'] );
80
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
81
  if( array_key_exists( 'before_widget', $args ) )
82
  echo $args['before_widget'];
123
 
124
  $cont = quads_post_settings_to_quicktags( get_the_content() );
125
  //if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() && !quads_ad_reach_max_count() ) {
126
+ if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() && !quads_hide_ad_widget_on_homepage() ) {
127
 
128
  //quads_set_ad_count_widget();
129
+ $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ads']['ad' . $this->adsID . '_widget']['code'] );
130
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
131
  //if (array_key_exists('before_widget', $args))
132
  echo $args['before_widget'];
171
  }
172
  extract( $args );
173
  $cont = quads_post_settings_to_quicktags( get_the_content() );
174
+ if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() && !quads_hide_ad_widget_on_homepage() ) {
175
 
176
  //quads_set_ad_count_widget();
177
+ $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ads']['ad' . $this->adsID . '_widget']['code'] );
178
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
179
  if( array_key_exists( 'before_widget', $args ) )
180
  echo $args['before_widget'];
220
 
221
  extract( $args );
222
  $cont = quads_post_settings_to_quicktags( get_the_content() );
223
+ if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() && !quads_hide_ad_widget_on_homepage() ) {
224
 
225
  //quads_set_ad_count_widget();
226
+ $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ads']['ad' . $this->adsID . '_widget']['code'] );
227
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
228
  if( array_key_exists( 'before_widget', $args ) )
229
  echo $args['before_widget'];
268
  }
269
  extract( $args );
270
  $cont = quads_post_settings_to_quicktags( get_the_content() );
271
+ if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() && !quads_hide_ad_widget_on_homepage() ) {
272
 
273
  //quads_set_ad_count_widget();
274
+ $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ads']['ad' . $this->adsID . '_widget']['code'] );
275
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
276
  if( array_key_exists( 'before_widget', $args ) )
277
  echo $args['before_widget'];
317
 
318
  extract( $args );
319
  $cont = quads_post_settings_to_quicktags( get_the_content() );
320
+ if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() && !quads_hide_ad_widget_on_homepage() ) {
321
 
322
  //quads_set_ad_count_widget();
323
+ $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ads']['ad' . $this->adsID . '_widget']['code'] );
324
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
325
  if( array_key_exists( 'before_widget', $args ) )
326
  echo $args['before_widget'];
366
 
367
  extract( $args );
368
  $cont = quads_post_settings_to_quicktags( get_the_content() );
369
+ if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() && !quads_hide_ad_widget_on_homepage() ) {
370
 
371
  //quads_set_ad_count_widget();
372
+ $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ads']['ad' . $this->adsID . '_widget']['code'] );
373
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
374
  if( array_key_exists( 'before_widget', $args ) )
375
  echo $args['before_widget'];
415
 
416
  extract( $args );
417
  $cont = quads_post_settings_to_quicktags( get_the_content() );
418
+ if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() && !quads_hide_ad_widget_on_homepage() ) {
419
 
420
  //quads_set_ad_count_widget();
421
+ $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ads']['ad' . $this->adsID . '_widget']['code'] );
422
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
423
  if( array_key_exists( 'before_widget', $args ) )
424
  echo $args['before_widget'];
464
 
465
  extract( $args );
466
  $cont = quads_post_settings_to_quicktags( get_the_content() );
467
+ if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() && !quads_hide_ad_widget_on_homepage() ) {
468
 
469
  //quads_set_ad_count_widget();
470
+ $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ads']['ad' . $this->adsID . '_widget']['code'] );
471
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
472
  if( array_key_exists( 'before_widget', $args ) )
473
  echo $args['before_widget'];
513
 
514
  extract( $args );
515
  $cont = quads_post_settings_to_quicktags( get_the_content() );
516
+ if( strpos( $cont, "<!--OffAds-->" ) === false && strpos( $cont, "<!--OffWidget-->" ) === false && quads_ad_is_allowed() && !quads_hide_ad_widget_on_homepage()) {
517
 
518
  //quads_set_ad_count_widget();
519
+ $code = quads_render_ad( 'ad' . $this->adsID . '_widget', $quads_options['ads']['ad' . $this->adsID . '_widget']['code'] );
520
  echo "\n" . "<!-- Quick Adsense Reloaded -->" . "\n";
521
  if( array_key_exists( 'before_widget', $args ) )
522
  echo $args['before_widget'];
quick-adsense-reloaded.php CHANGED
@@ -6,7 +6,7 @@
6
  * Description: Insert Google AdSense or any Ads code into your website. A fork of Quick AdSense
7
  * Author: Rene Hermenau, WP-Staging
8
  * Author URI: https://wordpress.org/plugins/quick-adsense-reloaded/
9
- * Version: 1.5.2
10
  * Text Domain: quick-adsense-reloaded
11
  * Domain Path: languages
12
  * Credits: WP QUADS - Quick AdSense Reloaded is a fork of Quick AdSense
@@ -31,26 +31,27 @@
31
  */
32
  // Exit if accessed directly
33
  if( !defined( 'ABSPATH' ) )
34
- exit;
35
 
36
  // Plugin version
37
  if( !defined( 'QUADS_VERSION' ) ) {
38
- define( 'QUADS_VERSION', '1.5.2' );
 
39
  }
40
 
41
  // Plugin name
42
  if( !defined( 'QUADS_NAME' ) ) {
43
- define( 'QUADS_NAME', 'WP QUADS - Quick AdSense Reloaded' );
44
  }
45
 
46
  // Debug
47
  if( !defined( 'QUADS_DEBUG' ) ) {
48
- define( 'QUADS_DEBUG', false );
49
  }
50
 
51
  // Files that needs to be loaded early
52
  if( !class_exists( 'QUADS_Utils' ) ) {
53
- require dirname( __FILE__ ) . '/includes/quads-utils.php';
54
  }
55
 
56
  // Define some globals
@@ -68,271 +69,268 @@ $maxWidgets = 10; // number of widgets
68
 
69
  if( !class_exists( 'QuickAdsenseReloaded' ) ) :
70
 
71
- /**
72
- * Main QuickAdsenseReloaded Class
73
- *
74
- * @since 1.0.0
75
- */
76
- final class QuickAdsenseReloaded {
77
- /** Singleton ************************************************************ */
78
-
79
- /**
80
- * @var QuickAdsenseReloaded The one and only QuickAdsenseReloaded
81
- * @since 1.0
82
- */
83
- private static $instance;
84
-
85
- /**
86
- * QUADS HTML Element Helper Object
87
- *
88
- * @var object
89
- * @since 2.0.0
90
- */
91
- public $html;
92
-
93
- /* QUADS LOGGER Class
94
- *
95
- */
96
- public $logger;
97
-
98
- /**
99
- * Main QuickAdsenseReloaded Instance
100
- *
101
- * Insures that only one instance of QuickAdsenseReloaded exists in memory at any one
102
- * time. Also prevents needing to define globals all over the place.
103
- *
104
- * @since 1.0
105
- * @static
106
- * @static var array $instance
107
- * @uses QuickAdsenseReloaded::setup_constants() Setup the constants needed
108
- * @uses QuickAdsenseReloaded::includes() Include the required files
109
- * @uses QuickAdsenseReloaded::load_textdomain() load the language files
110
- * @see QUADS()
111
- * @return The one true QuickAdsenseReloaded
112
- */
113
- public static function instance() {
114
- if( !isset( self::$instance ) && !( self::$instance instanceof QuickAdsenseReloaded ) ) {
115
- self::$instance = new QuickAdsenseReloaded;
116
- self::$instance->setup_constants();
117
- self::$instance->includes();
118
- self::$instance->load_textdomain();
119
- self::$instance->load_hooks();
120
- self::$instance->logger = new quadsLogger( "quick_adsense_log_" . date( "Y-m-d" ) . ".log", quadsLogger::INFO );
121
- self::$instance->html = new QUADS_HTML_Elements();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  }
123
- return self::$instance;
124
- }
125
-
126
- /**
127
- * Throw error on object clone
128
- *
129
- * The whole idea of the singleton design pattern is that there is a single
130
- * object therefore, we don't want the object to be cloned.
131
- *
132
- * @since 1.0
133
- * @access protected
134
- * @return void
135
- */
136
- public function __clone() {
137
- // Cloning instances of the class is forbidden
138
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'QUADS' ), '1.0' );
139
- }
140
-
141
- /**
142
- * Disable unserializing of the class
143
- *
144
- * @since 1.0
145
- * @access protected
146
- * @return void
147
- */
148
- public function __wakeup() {
149
- // Unserializing instances of the class is forbidden
150
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'QUADS' ), '1.0' );
151
- }
152
-
153
- /**
154
- * Setup plugin constants
155
- *
156
- * @access private
157
- * @since 1.0
158
- * @return void
159
- */
160
- private function setup_constants() {
161
- global $wpdb;
162
-
163
- // Plugin Folder Path
164
- if( !defined( 'QUADS_PLUGIN_DIR' ) ) {
165
- define( 'QUADS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
166
- }
167
-
168
- // Plugin Folder URL
169
- if( !defined( 'QUADS_PLUGIN_URL' ) ) {
170
- define( 'QUADS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
171
- }
172
-
173
- // Plugin Root File
174
- if( !defined( 'QUADS_PLUGIN_FILE' ) ) {
175
- define( 'QUADS_PLUGIN_FILE', __FILE__ );
176
- }
177
- }
178
-
179
-
180
- /**
181
- * Include required files
182
- *
183
- * @access private
184
- * @since 1.0
185
- * @return void
186
- */
187
- private function includes() {
188
- global $quads_options;
189
-
190
- require_once QUADS_PLUGIN_DIR . 'includes/admin/settings/register-settings.php';
191
- $quads_options = quads_get_settings();
192
- require_once QUADS_PLUGIN_DIR . 'includes/post_types.php';
193
- require_once QUADS_PLUGIN_DIR . 'includes/user_roles.php';
194
- require_once QUADS_PLUGIN_DIR . 'includes/widgets.php';
195
- require_once QUADS_PLUGIN_DIR . 'includes/template-functions.php';
196
- require_once QUADS_PLUGIN_DIR . 'includes/class-quads-license-handler.php';
197
- require_once QUADS_PLUGIN_DIR . 'includes/logger.php';
198
- require_once QUADS_PLUGIN_DIR . 'includes/class-quads-html-elements.php';
199
- require_once QUADS_PLUGIN_DIR . 'includes/shortcodes.php';
200
- require_once QUADS_PLUGIN_DIR . 'includes/api.php';
201
- require_once QUADS_PLUGIN_DIR . 'includes/render-ad-functions.php';
202
- require_once QUADS_PLUGIN_DIR . 'includes/scripts.php';
203
- require_once QUADS_PLUGIN_DIR . 'includes/automattic-amp-ad.php';
204
- require_once QUADS_PLUGIN_DIR . 'includes/helper-functions.php';
205
- require_once QUADS_PLUGIN_DIR . 'includes/conditionals.php';
206
- require_once QUADS_PLUGIN_DIR . 'includes/frontend-checks.php';
207
-
208
- if( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
209
- require_once QUADS_PLUGIN_DIR . 'includes/admin/add-ons.php';
210
- require_once QUADS_PLUGIN_DIR . 'includes/admin/admin-actions.php';
211
- require_once QUADS_PLUGIN_DIR . 'includes/admin/admin-footer.php';
212
- require_once QUADS_PLUGIN_DIR . 'includes/admin/admin-pages.php';
213
- require_once QUADS_PLUGIN_DIR . 'includes/admin/plugins.php';
214
- require_once QUADS_PLUGIN_DIR . 'includes/admin/welcome.php';
215
- require_once QUADS_PLUGIN_DIR . 'includes/admin/settings/display-settings.php';
216
- require_once QUADS_PLUGIN_DIR . 'includes/admin/settings/contextual-help.php';
217
- //require_once QUADS_PLUGIN_DIR . 'includes/install.php';
218
- require_once QUADS_PLUGIN_DIR . 'includes/admin/tools.php';
219
- require_once QUADS_PLUGIN_DIR . 'includes/meta-boxes.php';
220
- require_once QUADS_PLUGIN_DIR . 'includes/quicktags.php';
221
- require_once QUADS_PLUGIN_DIR . 'includes/admin/admin-notices.php';
222
- require_once QUADS_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php';
223
- }
224
- }
225
-
226
- public function load_hooks() {
227
- if( is_admin() && quads_is_plugins_page() ) {
228
- add_filter( 'admin_footer', 'quads_add_deactivation_feedback_modal' );
229
- }
230
- }
231
-
232
- /**
233
- * Loads the plugin language files
234
- *
235
- * @access public
236
- * @since 1.0
237
- * @return void
238
- */
239
- public function load_textdomain() {
240
- // Set filter for plugin's languages directory
241
- $quads_lang_dir = dirname( plugin_basename( QUADS_PLUGIN_FILE ) ) . '/languages/';
242
- $quads_lang_dir = apply_filters( 'quads_languages_directory', $quads_lang_dir );
243
-
244
- // Traditional WordPress plugin locale filter
245
- $locale = apply_filters( 'plugin_locale', get_locale(), 'quick-adsense-reloaded' );
246
- $mofile = sprintf( '%1$s-%2$s.mo', 'quick-adsense-reloaded', $locale );
247
-
248
- // Setup paths to current locale file
249
- $mofile_local = $quads_lang_dir . $mofile;
250
- $mofile_global = WP_LANG_DIR . '/quads/' . $mofile;
251
- //echo $mofile_local;
252
- if( file_exists( $mofile_global ) ) {
253
- // Look in global /wp-content/languages/quads folder
254
- load_textdomain( 'quick-adsense-reloaded', $mofile_global );
255
- } elseif( file_exists( $mofile_local ) ) {
256
- // Look in local /wp-content/plugins/quick-adsense-reloaded/languages/ folder
257
- load_textdomain( 'quick-adsense-reloaded', $mofile_local );
258
- } else {
259
- // Load the default language files
260
- load_plugin_textdomain( 'quick-adsense-reloaded', false, $quads_lang_dir );
261
- }
262
- }
263
-
264
- /*
265
- * Activation function fires when the plugin is activated.
266
- * Checks first if multisite is enabled
267
- * @since 1.0.0
268
- *
269
- */
270
-
271
- public static function activation( $networkwide ) {
272
- global $wpdb;
273
-
274
- if( function_exists( 'is_multisite' ) && is_multisite() ) {
275
- // check if it is a network activation - if so, run the activation function for each blog id
276
- if( $networkwide ) {
277
- $old_blog = $wpdb->blogid;
278
- // Get all blog ids
279
- $blogids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
280
- foreach ( $blogids as $blog_id ) {
281
- switch_to_blog( $blog_id );
282
- QuickAdsenseReloaded::during_activation();
283
- }
284
- switch_to_blog( $old_blog );
285
- return;
286
- }
287
- }
288
- QuickAdsenseReloaded::during_activation();
289
- }
290
-
291
-
292
- /**
293
- * This function is fired from the activation method.
294
- *
295
- * @since 2.1.1
296
- * @access public
297
- *
298
- * @return void
299
- */
300
- public static function during_activation() {
301
-
302
- // Add Upgraded From Option
303
- $current_version = get_option( 'quads_version' );
304
- if( $current_version ) {
305
- update_option( 'quads_version_upgraded_from', $current_version );
306
- }
307
- // First time installation
308
- // Get all settings and update them only if they are empty
309
- $quads_options = get_option('quads_settings');
310
- if(!$quads_options) {
311
- $quads_options['post_types'] = array('post', 'page');
312
- $quads_options['visibility']['AppHome'] = "1";
313
- $quads_options['visibility']['AppCate'] = "1";
314
- $quads_options['visibility']['AppArch'] = "1";
315
- $quads_options['visibility']['AppTags'] = "1";
316
- $quads_options['quicktags']['QckTags'] = "1";
317
-
318
- update_option('quads_settings', $quads_options);
319
- }
320
-
321
- // Update the current version
322
- //update_option( 'quads_version', QUADS_VERSION );
323
-
324
- // Add plugin installation date and variable for rating div
325
- add_option( 'quads_install_date', date( 'Y-m-d h:i:s' ) );
326
- add_option( 'quads_rating_div', 'no' );
327
- add_option( 'quads_show_theme_notice', 'yes' );
328
-
329
- // Add the transient to redirect (not for multisites)
330
- set_transient( 'quads_activation_redirect', true, 3600 );
331
- }
332
-
333
- }
334
-
335
- endif; // End if class_exists check
336
 
337
  /**
338
  * The main function responsible for returning the one true QuickAdsenseReloaded
@@ -354,15 +352,15 @@ if( !class_exists( 'QuickAdsenseReloaded' ) ) :
354
  */
355
  function quads_loaded() {
356
 
357
- global $quads;
358
 
359
- if( !is_null( $quads ) ) {
360
- return $quads;
361
- }
362
 
363
- $quads_instance = new QuickAdsenseReloaded;
364
- $quads = $quads_instance->instance();
365
- return $quads;
366
  }
367
 
368
  add_action( 'plugins_loaded', 'quads_loaded' );
@@ -374,36 +372,49 @@ add_action( 'plugins_loaded', 'quads_loaded' );
374
  */
375
  register_activation_hook( __FILE__, array('QuickAdsenseReloaded', 'activation') );
376
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
377
 
378
  /**
379
  * Check if advanced settings are available
380
  *
381
  * @return boolean
382
  */
383
-
384
-
385
- function quads_is_advanced(){
386
- if ( function_exists( 'quads_is_active_pro' )){
387
- return quads_is_active_pro();
388
- } else {
389
- return quads_is_active_deprecated();
390
- }
391
- return false;
392
  }
 
393
  /**
394
  * Check if wp quads pro is active and installed
395
  *
396
  * @deprecated since version 1.3.0
397
  * @return boolean
398
  */
399
- function quads_is_active_deprecated(){
400
-
401
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
402
- $plugin = 'wp-quads-pro/wp-quads-pro.php';
403
 
404
- if( is_plugin_active( $plugin ) ) {
405
- return true;
406
- }
407
 
408
- return false;
409
- }
6
  * Description: Insert Google AdSense or any Ads code into your website. A fork of Quick AdSense
7
  * Author: Rene Hermenau, WP-Staging
8
  * Author URI: https://wordpress.org/plugins/quick-adsense-reloaded/
9
+ * Version: 1.5.4
10
  * Text Domain: quick-adsense-reloaded
11
  * Domain Path: languages
12
  * Credits: WP QUADS - Quick AdSense Reloaded is a fork of Quick AdSense
31
  */
32
  // Exit if accessed directly
33
  if( !defined( 'ABSPATH' ) )
34
+ exit;
35
 
36
  // Plugin version
37
  if( !defined( 'QUADS_VERSION' ) ) {
38
+ define( 'QUADS_VERSION', '1.5.4' );
39
+ //define( 'QUADS_VERSION', '1.5.4' );
40
  }
41
 
42
  // Plugin name
43
  if( !defined( 'QUADS_NAME' ) ) {
44
+ define( 'QUADS_NAME', 'WP QUADS - Quick AdSense Reloaded' );
45
  }
46
 
47
  // Debug
48
  if( !defined( 'QUADS_DEBUG' ) ) {
49
+ define( 'QUADS_DEBUG', false );
50
  }
51
 
52
  // Files that needs to be loaded early
53
  if( !class_exists( 'QUADS_Utils' ) ) {
54
+ require dirname( __FILE__ ) . '/includes/quads-utils.php';
55
  }
56
 
57
  // Define some globals
69
 
70
  if( !class_exists( 'QuickAdsenseReloaded' ) ) :
71
 
72
+ /**
73
+ * Main QuickAdsenseReloaded Class
74
+ *
75
+ * @since 1.0.0
76
+ */
77
+ final class QuickAdsenseReloaded {
78
+ /** Singleton ************************************************************ */
79
+
80
+ /**
81
+ * @var QuickAdsenseReloaded The one and only QuickAdsenseReloaded
82
+ * @since 1.0
83
+ */
84
+ private static $instance;
85
+
86
+ /**
87
+ * QUADS HTML Element Helper Object
88
+ *
89
+ * @var object
90
+ * @since 2.0.0
91
+ */
92
+ public $html;
93
+
94
+ /* QUADS LOGGER Class
95
+ *
96
+ */
97
+ public $logger;
98
+
99
+ /**
100
+ * Main QuickAdsenseReloaded Instance
101
+ *
102
+ * Insures that only one instance of QuickAdsenseReloaded exists in memory at any one
103
+ * time. Also prevents needing to define globals all over the place.
104
+ *
105
+ * @since 1.0
106
+ * @static
107
+ * @static var array $instance
108
+ * @uses QuickAdsenseReloaded::setup_constants() Setup the constants needed
109
+ * @uses QuickAdsenseReloaded::includes() Include the required files
110
+ * @uses QuickAdsenseReloaded::load_textdomain() load the language files
111
+ * @see QUADS()
112
+ * @return The one true QuickAdsenseReloaded
113
+ */
114
+ public static function instance() {
115
+ if( !isset( self::$instance ) && !( self::$instance instanceof QuickAdsenseReloaded ) ) {
116
+ self::$instance = new QuickAdsenseReloaded;
117
+ self::$instance->setup_constants();
118
+ self::$instance->includes();
119
+ self::$instance->load_textdomain();
120
+ self::$instance->load_hooks();
121
+ self::$instance->logger = new quadsLogger( "quick_adsense_log_" . date( "Y-m-d" ) . ".log", quadsLogger::INFO );
122
+ self::$instance->html = new QUADS_HTML_Elements();
123
+ }
124
+ return self::$instance;
125
+ }
126
+
127
+ /**
128
+ * Throw error on object clone
129
+ *
130
+ * The whole idea of the singleton design pattern is that there is a single
131
+ * object therefore, we don't want the object to be cloned.
132
+ *
133
+ * @since 1.0
134
+ * @access protected
135
+ * @return void
136
+ */
137
+ public function __clone() {
138
+ // Cloning instances of the class is forbidden
139
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'QUADS' ), '1.0' );
140
+ }
141
+
142
+ /**
143
+ * Disable unserializing of the class
144
+ *
145
+ * @since 1.0
146
+ * @access protected
147
+ * @return void
148
+ */
149
+ public function __wakeup() {
150
+ // Unserializing instances of the class is forbidden
151
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'QUADS' ), '1.0' );
152
+ }
153
+
154
+ /**
155
+ * Setup plugin constants
156
+ *
157
+ * @access private
158
+ * @since 1.0
159
+ * @return void
160
+ */
161
+ private function setup_constants() {
162
+ global $wpdb;
163
+
164
+ // Plugin Folder Path
165
+ if( !defined( 'QUADS_PLUGIN_DIR' ) ) {
166
+ define( 'QUADS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
167
+ }
168
+
169
+ // Plugin Folder URL
170
+ if( !defined( 'QUADS_PLUGIN_URL' ) ) {
171
+ define( 'QUADS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
172
+ }
173
+
174
+ // Plugin Root File
175
+ if( !defined( 'QUADS_PLUGIN_FILE' ) ) {
176
+ define( 'QUADS_PLUGIN_FILE', __FILE__ );
177
+ }
178
+ }
179
+
180
+ /**
181
+ * Include required files
182
+ *
183
+ * @access private
184
+ * @since 1.0
185
+ * @return void
186
+ */
187
+ private function includes() {
188
+ global $quads_options;
189
+
190
+ require_once QUADS_PLUGIN_DIR . 'includes/admin/settings/register-settings.php';
191
+ $quads_options = quads_get_settings();
192
+ require_once QUADS_PLUGIN_DIR . 'includes/post_types.php';
193
+ require_once QUADS_PLUGIN_DIR . 'includes/user_roles.php';
194
+ require_once QUADS_PLUGIN_DIR . 'includes/widgets.php';
195
+ require_once QUADS_PLUGIN_DIR . 'includes/template-functions.php';
196
+ require_once QUADS_PLUGIN_DIR . 'includes/class-quads-license-handler.php';
197
+ require_once QUADS_PLUGIN_DIR . 'includes/logger.php';
198
+ require_once QUADS_PLUGIN_DIR . 'includes/class-quads-html-elements.php';
199
+ require_once QUADS_PLUGIN_DIR . 'includes/shortcodes.php';
200
+ require_once QUADS_PLUGIN_DIR . 'includes/api.php';
201
+ require_once QUADS_PLUGIN_DIR . 'includes/render-ad-functions.php';
202
+ require_once QUADS_PLUGIN_DIR . 'includes/scripts.php';
203
+ require_once QUADS_PLUGIN_DIR . 'includes/automattic-amp-ad.php';
204
+ require_once QUADS_PLUGIN_DIR . 'includes/helper-functions.php';
205
+ require_once QUADS_PLUGIN_DIR . 'includes/conditions.php';
206
+ require_once QUADS_PLUGIN_DIR . 'includes/frontend-checks.php';
207
+
208
+ if( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
209
+ require_once QUADS_PLUGIN_DIR . 'includes/admin/add-ons.php';
210
+ require_once QUADS_PLUGIN_DIR . 'includes/admin/admin-actions.php';
211
+ require_once QUADS_PLUGIN_DIR . 'includes/admin/admin-footer.php';
212
+ require_once QUADS_PLUGIN_DIR . 'includes/admin/admin-pages.php';
213
+ require_once QUADS_PLUGIN_DIR . 'includes/admin/plugins.php';
214
+ require_once QUADS_PLUGIN_DIR . 'includes/admin/welcome.php';
215
+ require_once QUADS_PLUGIN_DIR . 'includes/admin/settings/display-settings.php';
216
+ require_once QUADS_PLUGIN_DIR . 'includes/admin/settings/contextual-help.php';
217
+ //require_once QUADS_PLUGIN_DIR . 'includes/install.php';
218
+ require_once QUADS_PLUGIN_DIR . 'includes/admin/tools.php';
219
+ require_once QUADS_PLUGIN_DIR . 'includes/meta-boxes.php';
220
+ require_once QUADS_PLUGIN_DIR . 'includes/quicktags.php';
221
+ require_once QUADS_PLUGIN_DIR . 'includes/admin/admin-notices.php';
222
+ require_once QUADS_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php';
223
+ }
224
+ }
225
+
226
+ public function load_hooks() {
227
+ if( is_admin() && quads_is_plugins_page() ) {
228
+ add_filter( 'admin_footer', 'quads_add_deactivation_feedback_modal' );
229
+ }
230
+ }
231
+
232
+ /**
233
+ * Loads the plugin language files
234
+ *
235
+ * @access public
236
+ * @since 1.0
237
+ * @return void
238
+ */
239
+ public function load_textdomain() {
240
+ // Set filter for plugin's languages directory
241
+ $quads_lang_dir = dirname( plugin_basename( QUADS_PLUGIN_FILE ) ) . '/languages/';
242
+ $quads_lang_dir = apply_filters( 'quads_languages_directory', $quads_lang_dir );
243
+
244
+ // Traditional WordPress plugin locale filter
245
+ $locale = apply_filters( 'plugin_locale', get_locale(), 'quick-adsense-reloaded' );
246
+ $mofile = sprintf( '%1$s-%2$s.mo', 'quick-adsense-reloaded', $locale );
247
+
248
+ // Setup paths to current locale file
249
+ $mofile_local = $quads_lang_dir . $mofile;
250
+ $mofile_global = WP_LANG_DIR . '/quads/' . $mofile;
251
+ //echo $mofile_local;
252
+ if( file_exists( $mofile_global ) ) {
253
+ // Look in global /wp-content/languages/quads folder
254
+ load_textdomain( 'quick-adsense-reloaded', $mofile_global );
255
+ } elseif( file_exists( $mofile_local ) ) {
256
+ // Look in local /wp-content/plugins/quick-adsense-reloaded/languages/ folder
257
+ load_textdomain( 'quick-adsense-reloaded', $mofile_local );
258
+ } else {
259
+ // Load the default language files
260
+ load_plugin_textdomain( 'quick-adsense-reloaded', false, $quads_lang_dir );
261
+ }
262
+ }
263
+
264
+ /*
265
+ * Activation function fires when the plugin is activated.
266
+ * Checks first if multisite is enabled
267
+ * @since 1.0.0
268
+ *
269
+ */
270
+
271
+ public static function activation( $networkwide ) {
272
+ global $wpdb;
273
+
274
+ if( function_exists( 'is_multisite' ) && is_multisite() ) {
275
+ // check if it is a network activation - if so, run the activation function for each blog id
276
+ if( $networkwide ) {
277
+ $old_blog = $wpdb->blogid;
278
+ // Get all blog ids
279
+ $blogids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
280
+ foreach ( $blogids as $blog_id ) {
281
+ switch_to_blog( $blog_id );
282
+ QuickAdsenseReloaded::during_activation();
283
+ }
284
+ switch_to_blog( $old_blog );
285
+ return;
286
  }
287
+ }
288
+ QuickAdsenseReloaded::during_activation();
289
+ }
290
+
291
+ /**
292
+ * This function is fired from the activation method.
293
+ *
294
+ * @since 2.1.1
295
+ * @access public
296
+ *
297
+ * @return void
298
+ */
299
+ public static function during_activation() {
300
+
301
+ // Add Upgraded From Option
302
+ $current_version = get_option( 'quads_version' );
303
+ if( $current_version ) {
304
+ update_option( 'quads_version_upgraded_from', $current_version );
305
+ }
306
+ // First time installation
307
+ // Get all settings and update them only if they are empty
308
+ $quads_options = get_option( 'quads_settings' );
309
+ if( !$quads_options ) {
310
+ $quads_options['post_types'] = array('post', 'page');
311
+ $quads_options['visibility']['AppHome'] = "1";
312
+ $quads_options['visibility']['AppCate'] = "1";
313
+ $quads_options['visibility']['AppArch'] = "1";
314
+ $quads_options['visibility']['AppTags'] = "1";
315
+ $quads_options['quicktags']['QckTags'] = "1";
316
+
317
+ update_option( 'quads_settings', $quads_options );
318
+ }
319
+
320
+ // Update the current version
321
+ //update_option( 'quads_version', QUADS_VERSION );
322
+ // Add plugin installation date and variable for rating div
323
+ add_option( 'quads_install_date', date( 'Y-m-d h:i:s' ) );
324
+ add_option( 'quads_rating_div', 'no' );
325
+ add_option( 'quads_show_theme_notice', 'yes' );
326
+
327
+ // Add the transient to redirect (not for multisites)
328
+ set_transient( 'quads_activation_redirect', true, 3600 );
329
+ }
330
+
331
+ }
332
+
333
+ endif; // End if class_exists check
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
334
 
335
  /**
336
  * The main function responsible for returning the one true QuickAdsenseReloaded
352
  */
353
  function quads_loaded() {
354
 
355
+ global $quads;
356
 
357
+ if( !is_null( $quads ) ) {
358
+ return $quads;
359
+ }
360
 
361
+ $quads_instance = new QuickAdsenseReloaded;
362
+ $quads = $quads_instance->instance();
363
+ return $quads;
364
  }
365
 
366
  add_action( 'plugins_loaded', 'quads_loaded' );
372
  */
373
  register_activation_hook( __FILE__, array('QuickAdsenseReloaded', 'activation') );
374
 
375
+ /**
376
+ * Check if pro version is installed and active
377
+ */
378
+ function quads_is_pro_active() {
379
+ $needle = 'wp-quads-pro';
380
+ $plugins = get_option( 'active_plugins', array() );
381
+ foreach ( $plugins as $key => $value ) {
382
+ if( strpos( $value, $needle ) !== false ) {
383
+ return true;
384
+ }
385
+ }
386
+ return false;
387
+ }
388
+
389
 
390
  /**
391
  * Check if advanced settings are available
392
  *
393
  * @return boolean
394
  */
395
+ function quads_is_advanced() {
396
+ if( function_exists( 'quads_is_active_pro' ) ) {
397
+ return quads_is_active_pro();
398
+ } else {
399
+ return quads_is_active_deprecated();
400
+ }
401
+ return false;
 
 
402
  }
403
+
404
  /**
405
  * Check if wp quads pro is active and installed
406
  *
407
  * @deprecated since version 1.3.0
408
  * @return boolean
409
  */
410
+ function quads_is_active_deprecated() {
411
+
412
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
413
+ $plugin = 'wp-quads-pro/wp-quads-pro.php';
414
 
415
+ if( is_plugin_active( $plugin ) ) {
416
+ return true;
417
+ }
418
 
419
+ return false;
420
+ }
readme.txt CHANGED
@@ -9,7 +9,7 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Tags: adsense, ads, ad, google adsense, advertising, amp, ad injection, ad inserter, ad manager
10
  Requires at least: 3.6+
11
  Tested up to: 4.8
12
- Stable tag: 1.5.2
13
 
14
  Quick Adsense Reloaded! Quickest way to insert Google AdSense & other ads into your website. Google AdSense integration with Google AMP support
15
 
@@ -129,6 +129,19 @@ Alternative Installation:
129
 
130
  == Changelog ==
131
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  = 1.5.2 =
133
  * Tweak: Make sure that for AdSense ads only the AdSense ad option is used and not the plain text one
134
  * Fix: Spelling issue
@@ -156,5 +169,5 @@ Complete changelog: https://wpquads.com/changelog
156
 
157
  == Upgrade Notice ==
158
 
159
- = 1.4.3 =
160
  1.4.3 This new version brings a ton of improvements and small fixes - WP QUADS<a href="https://wordpress.org/plugins/quick-adsense-reloaded/changelog/" style="color:white;text-decoration: underline;">Complete changelog! </a>
9
  Tags: adsense, ads, ad, google adsense, advertising, amp, ad injection, ad inserter, ad manager
10
  Requires at least: 3.6+
11
  Tested up to: 4.8
12
+ Stable tag: 1.5.4
13
 
14
  Quick Adsense Reloaded! Quickest way to insert Google AdSense & other ads into your website. Google AdSense integration with Google AMP support
15
 
129
 
130
  == Changelog ==
131
 
132
+ = 1.5.4 =
133
+ * Fix: Hide widget on homepage option not working
134
+ * Tweak: Change default value of ad limitation to unlimited ads
135
+ * Tweak: Clean up code
136
+
137
+ = 1.5.3 =
138
+ * New: Unlimited amount of ads can be used with WP QUADS PRO
139
+ * Tweak: Move debug setting to tab plugin settings
140
+ * Fix: Security Update! If you are using WP QUADS Pro you need to update WP QUADS Pro to version 1.3.6.
141
+ * Fix: If page or post is used as frontpage the home page condition is ignored
142
+ * Fix: Better sanitization - remove all whitespaces in settings
143
+ * Fix: Ads are not shown on tablet device if mobile device visibility is disabled
144
+
145
  = 1.5.2 =
146
  * Tweak: Make sure that for AdSense ads only the AdSense ad option is used and not the plain text one
147
  * Fix: Spelling issue
169
 
170
  == Upgrade Notice ==
171
 
172
+ = 1.5.3 =
173
  1.4.3 This new version brings a ton of improvements and small fixes - WP QUADS<a href="https://wordpress.org/plugins/quick-adsense-reloaded/changelog/" style="color:white;text-decoration: underline;">Complete changelog! </a>
uninstall.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * Uninstall Quick adsense reloaded
4
  *
@@ -8,10 +9,9 @@
8
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
  * @since 1.0.0
10
  */
11
-
12
  // Exit if accessed directly
13
- if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) exit;
14
-
15
 
16
  /**
17
  * Get an option
@@ -22,29 +22,30 @@ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) exit;
22
  * @return mixed
23
  */
24
  function quads_get_option_uninstall( $key = '', $default = false ) {
25
- $quads_options = get_option('quads_settings');
26
- $value = ! empty( $quads_options[ $key ] ) ? $quads_options[ $key ] : $default;
27
- $value = apply_filters( 'quads_get_option', $value, $key, $default );
28
- return apply_filters( 'quads_get_option_' . $key, $value, $key, $default );
29
  }
30
 
31
  if( quads_get_option_uninstall( 'uninstall_on_delete' ) ) {
32
- /** Delete all the Plugin Options */
33
- delete_option( 'quads_settings' );
34
- delete_option( 'quads_install_date');
35
- delete_option( 'quads_rating_div');
36
- delete_option( 'quads_version');
37
- delete_option( 'quads_version_upgraded_from');
38
- delete_option( 'quads_show_theme_notice');
39
- delete_option( 'quads_show_update_notice');
40
-
41
- /* Delete all post meta options */
42
- delete_post_meta_by_key( 'quads_timestamp' );
43
- delete_post_meta_by_key( 'quads_shares' );
44
- delete_post_meta_by_key( 'quads_jsonshares' );
45
-
46
- // Delete transients
47
- delete_transient ('quads_check_theme');
48
- delete_transient ('quads_activation_redirect');
49
-
 
50
  }
1
  <?php
2
+
3
  /**
4
  * Uninstall Quick adsense reloaded
5
  *
9
  * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10
  * @since 1.0.0
11
  */
 
12
  // Exit if accessed directly
13
+ if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
14
+ exit;
15
 
16
  /**
17
  * Get an option
22
  * @return mixed
23
  */
24
  function quads_get_option_uninstall( $key = '', $default = false ) {
25
+ $quads_options = get_option( 'quads_settings' );
26
+ $value = !empty( $quads_options[$key] ) ? $quads_options[$key] : $default;
27
+ $value = apply_filters( 'quads_get_option', $value, $key, $default );
28
+ return apply_filters( 'quads_get_option_' . $key, $value, $key, $default );
29
  }
30
 
31
  if( quads_get_option_uninstall( 'uninstall_on_delete' ) ) {
32
+ /** Delete all the Plugin Options */
33
+ delete_option( 'quads_settings' );
34
+ delete_option( 'quads_install_date' );
35
+ delete_option( 'quads_rating_div' );
36
+ delete_option( 'quads_version' );
37
+ delete_option( 'quads_version_upgraded_from' );
38
+ delete_option( 'quads_show_theme_notice' );
39
+ delete_option( 'quads_show_update_notice' );
40
+ delete_option( 'quads_settings_1_5_2' );
41
+ delete_option( 'quads_show_update_notice_1_5_2' );
42
+
43
+ /* Delete all post meta options */
44
+ delete_post_meta_by_key( 'quads_timestamp' );
45
+ delete_post_meta_by_key( 'quads_shares' );
46
+ delete_post_meta_by_key( 'quads_jsonshares' );
47
+
48
+ // Delete transients
49
+ delete_transient( 'quads_check_theme' );
50
+ delete_transient( 'quads_activation_redirect' );
51
  }