Changeset 3145275
- Timestamp:
- 09/02/2024 11:06:56 AM (19 months ago)
- Location:
- advanced-ads
- Files:
-
- 14 added
- 4 deleted
- 70 edited
- 1 copied
-
tags/1.54.0 (copied) (copied from advanced-ads/trunk)
-
tags/1.54.0/admin/assets/css/admin.css (modified) (1 diff)
-
tags/1.54.0/admin/class-advanced-ads-admin.php (modified) (3 diffs)
-
tags/1.54.0/admin/includes/class-meta-box.php (modified) (2 diffs)
-
tags/1.54.0/advanced-ads.php (modified) (3 diffs)
-
tags/1.54.0/assets/css/app.css (modified) (1 diff)
-
tags/1.54.0/assets/js/app.js (modified) (1 diff)
-
tags/1.54.0/assets/scss/ui/_switch.scss (modified) (2 diffs)
-
tags/1.54.0/assets/src/modules/oneclick/connect-button.js (modified) (2 diffs)
-
tags/1.54.0/assets/src/modules/oneclick/connect-settings.js (added)
-
tags/1.54.0/assets/src/modules/oneclick/index.js (modified) (1 diff)
-
tags/1.54.0/assets/src/modules/oneclick/settings.js (deleted)
-
tags/1.54.0/classes/ad-debug.php (modified) (1 diff)
-
tags/1.54.0/classes/ad_group.php (modified) (1 diff)
-
tags/1.54.0/classes/frontend_checks.php (modified) (2 diffs)
-
tags/1.54.0/classes/in-content-injector.php (modified) (16 diffs)
-
tags/1.54.0/classes/plugin.php (modified) (2 diffs)
-
tags/1.54.0/includes/admin/class-assets.php (modified) (5 diffs)
-
tags/1.54.0/includes/class-assets-registry.php (modified) (6 diffs)
-
tags/1.54.0/includes/class-autoloader.php (modified) (5 diffs)
-
tags/1.54.0/includes/class-constants.php (added)
-
tags/1.54.0/includes/class-plugin.php (modified) (7 diffs)
-
tags/1.54.0/includes/importers (added)
-
tags/1.54.0/includes/importers/abstract-importer.php (added)
-
tags/1.54.0/includes/importers/class-api-ads.php (added)
-
tags/1.54.0/includes/importers/class-manager.php (added)
-
tags/1.54.0/includes/interfaces/interface-importer.php (added)
-
tags/1.54.0/languages/advanced-ads.pot (modified) (31 diffs)
-
tags/1.54.0/lib/composer/autoload_classmap.php (modified) (3 diffs)
-
tags/1.54.0/lib/composer/autoload_static.php (modified) (3 diffs)
-
tags/1.54.0/modules/one-click/admin/class-admin.php (modified) (5 diffs)
-
tags/1.54.0/modules/one-click/admin/class-ajax.php (modified) (4 diffs)
-
tags/1.54.0/modules/one-click/class-helpers.php (modified) (6 diffs)
-
tags/1.54.0/modules/one-click/class-options.php (modified) (1 diff)
-
tags/1.54.0/modules/one-click/modules/adstxt/class-adstxt.php (modified) (3 diffs)
-
tags/1.54.0/modules/one-click/modules/adstxt/class-detector.php (modified) (7 diffs)
-
tags/1.54.0/modules/one-click/modules/class-auto-ads.php (deleted)
-
tags/1.54.0/modules/one-click/modules/class-header-bidding.php (modified) (4 diffs)
-
tags/1.54.0/modules/one-click/modules/class-traffic-cop.php (modified) (2 diffs)
-
tags/1.54.0/modules/one-click/modules/class-workflow.php (modified) (5 diffs)
-
tags/1.54.0/packages/composer/LICENSE (modified) (2 diffs)
-
tags/1.54.0/packages/composer/autoload_classmap.php (modified) (3 diffs)
-
tags/1.54.0/packages/composer/autoload_static.php (modified) (3 diffs)
-
tags/1.54.0/readme.txt (modified) (18 diffs)
-
tags/1.54.0/views/admin/metabox-pubguru-connect.php (modified) (8 diffs)
-
trunk/admin/assets/css/admin.css (modified) (1 diff)
-
trunk/admin/class-advanced-ads-admin.php (modified) (3 diffs)
-
trunk/admin/includes/class-meta-box.php (modified) (2 diffs)
-
trunk/advanced-ads.php (modified) (3 diffs)
-
trunk/assets/css/app.css (modified) (1 diff)
-
trunk/assets/js/app.js (modified) (1 diff)
-
trunk/assets/scss/ui/_switch.scss (modified) (2 diffs)
-
trunk/assets/src/modules/oneclick/connect-button.js (modified) (2 diffs)
-
trunk/assets/src/modules/oneclick/connect-settings.js (added)
-
trunk/assets/src/modules/oneclick/index.js (modified) (1 diff)
-
trunk/assets/src/modules/oneclick/settings.js (deleted)
-
trunk/classes/ad-debug.php (modified) (1 diff)
-
trunk/classes/ad_group.php (modified) (1 diff)
-
trunk/classes/frontend_checks.php (modified) (2 diffs)
-
trunk/classes/in-content-injector.php (modified) (16 diffs)
-
trunk/classes/plugin.php (modified) (2 diffs)
-
trunk/includes/admin/class-assets.php (modified) (5 diffs)
-
trunk/includes/class-assets-registry.php (modified) (6 diffs)
-
trunk/includes/class-autoloader.php (modified) (5 diffs)
-
trunk/includes/class-constants.php (added)
-
trunk/includes/class-plugin.php (modified) (7 diffs)
-
trunk/includes/importers (added)
-
trunk/includes/importers/abstract-importer.php (added)
-
trunk/includes/importers/class-api-ads.php (added)
-
trunk/includes/importers/class-manager.php (added)
-
trunk/includes/interfaces/interface-importer.php (added)
-
trunk/languages/advanced-ads.pot (modified) (31 diffs)
-
trunk/lib/composer/autoload_classmap.php (modified) (3 diffs)
-
trunk/lib/composer/autoload_static.php (modified) (3 diffs)
-
trunk/modules/one-click/admin/class-admin.php (modified) (5 diffs)
-
trunk/modules/one-click/admin/class-ajax.php (modified) (4 diffs)
-
trunk/modules/one-click/class-helpers.php (modified) (6 diffs)
-
trunk/modules/one-click/class-options.php (modified) (1 diff)
-
trunk/modules/one-click/modules/adstxt/class-adstxt.php (modified) (3 diffs)
-
trunk/modules/one-click/modules/adstxt/class-detector.php (modified) (7 diffs)
-
trunk/modules/one-click/modules/class-auto-ads.php (deleted)
-
trunk/modules/one-click/modules/class-header-bidding.php (modified) (4 diffs)
-
trunk/modules/one-click/modules/class-traffic-cop.php (modified) (2 diffs)
-
trunk/modules/one-click/modules/class-workflow.php (modified) (5 diffs)
-
trunk/packages/composer/LICENSE (modified) (2 diffs)
-
trunk/packages/composer/autoload_classmap.php (modified) (3 diffs)
-
trunk/packages/composer/autoload_static.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (18 diffs)
-
trunk/views/admin/metabox-pubguru-connect.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-ads/tags/1.54.0/admin/assets/css/admin.css
r3063392 r3145275 1435 1435 text-decoration: underline; 1436 1436 } 1437 1438 .rollback-block header { 1439 background-color: #f9f9f9; 1440 border: solid #c3c4c7; 1441 padding: 10px; 1442 margin: 30px -12px 15px; 1443 border-width: 1px 0; 1444 } -
advanced-ads/tags/1.54.0/admin/class-advanced-ads-admin.php
r3134243 r3145275 2 2 // phpcs:ignoreFile 3 3 4 use AdvancedAds\Importers\Api_Ads; 5 use AdvancedAds\Utilities\WordPress; 4 6 use AdvancedAds\Utilities\Conditional; 5 use AdvancedAds\ Utilities\WordPress;7 use AdvancedAds\Framework\Utilities\Params; 6 8 7 9 /** … … 106 108 // update placements. 107 109 add_action( 'admin_init', [ 'Advanced_Ads_Placements', 'update_placements' ] ); 110 add_action( 'admin_init', [ $this, 'api_import_rollback' ] ); 108 111 109 112 // add Advanced Ads admin notices … … 483 486 echo '</span>'; 484 487 } 488 489 public function api_import_rollback() { 490 if ( 'advads_import_delete' !== Params::get( 'action' ) ) { 491 return; 492 } 493 494 check_admin_referer( 'advads_import_delete' ); 495 496 $session_key = Params::get( 'session_key' ); 497 $db_session = get_option( 'advanced-ads-importer-history' ); 498 499 if ( $session_key !== $db_session ) { 500 add_action( 'all_admin_notices', [ $this, 'import_error' ] ); 501 return; 502 } 503 504 ( new Api_Ads() )->rollback( $session_key); 505 delete_option( 'advanced-ads-importer-history' ); 506 add_action( 'all_admin_notices', [ $this, 'import_success' ] ); 507 } 508 509 public function import_error() { 510 ?> 511 <div class="notice notice-error"> 512 <p><strong>Error:</strong> Session key not matched.</p> 513 </div> 514 <?php 515 } 516 517 public function import_success() { 518 ?> 519 <div class="notice notice-success"> 520 <p><strong>Success:</strong> the rollback is completed.</p> 521 </div> 522 <?php 523 } 485 524 } -
advanced-ads/tags/1.54.0/admin/includes/class-meta-box.php
r3134243 r3145275 2 2 // phpcs:ignoreFile 3 3 4 use AdvancedAds\Assets_Registry;5 4 use AdvancedAds\Entities; 6 5 use AdvancedAds\Utilities\WordPress; … … 70 69 71 70 if ( 'index.php' === $pagenow ) { 72 Assets_Registry::enqueue_script( 'wp-widget-adsense' );71 wp_advads()->registry->enqueue_script( 'wp-widget-adsense' ); 73 72 } 74 73 } -
advanced-ads/tags/1.54.0/advanced-ads.php
r3134930 r3145275 4 4 * 5 5 * @package Advanced_Ads 6 * @author Advanced Ads GmbH<[email protected]>6 * @author Advanced Ads <[email protected]> 7 7 * @license GPL-2.0+ 8 8 * @link https://wpadvancedads.com … … 13 13 * Plugin URI: https://wpadvancedads.com 14 14 * Description: Manage and optimize your ads in WordPress 15 * Version: 1.5 3.216 * Author: Advanced Ads GmbH15 * Version: 1.54.0 16 * Author: Advanced Ads 17 17 * Author URI: https://wpadvancedads.com 18 18 * Text Domain: advanced-ads … … 34 34 35 35 define( 'ADVADS_FILE', __FILE__ ); 36 define( 'ADVADS_VERSION', '1.5 3.2' );36 define( 'ADVADS_VERSION', '1.54.0' ); 37 37 38 38 // Load the autoloader. -
advanced-ads/tags/1.54.0/assets/css/app.css
r3050336 r3145275 1 .sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.\!mr-2{margin-right:.5rem!important}.\!mt-1{margin-top:.25rem!important}.mb-6{margin-bottom:1.5rem}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.w-full{width:100%}.items-center{align-items:center}.gap-x-4{column-gap:1rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.self-start{align-self:flex-start}.text-base{font-size:1rem;line-height:1.5rem}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.lds-ripple{display:none;height:40px;position:relative;width:40px}.lds-ripple.show{display:inline-block}.lds-ripple div{animation:lds-ripple 1s cubic-bezier(0,.2,.8,1) infinite;border:4px solid #ccc;border-radius:50%;opacity:1;position:absolute}.lds-ripple div:nth-child(2){animation-delay:-.5s}@keyframes lds-ripple{0%{height:0;left:20px;opacity:0;top:20px;width:0}4.9%{height:0;left:20px;opacity:0;top:20px;width:0}5%{height:0;left:20px;opacity:1;top:20px;width:0}to{height:40px;left:0;opacity:0;top:0;width:40px}}.advads-ui-switch{align-items:center;cursor:pointer;display:inline-flex;position:relative}.advads-ui-switch-list>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.25rem*var(--tw-space-y-reverse));margin-top:calc(1.25rem*(1 - var(--tw-space-y-reverse)))}.advads-ui-switch input{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.advads-ui-switch input:checked~div{--tw-bg-opacity:1;background-color:rgb(4 116 162/var(--tw-bg-opacity))}.advads-ui-switch input:checked~div:after{--tw- translate-x:100%;--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity));content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.advads-ui-switch input:disabled~div:after{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));content:var(--tw-content)}.advads-ui-switch div{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));border-radius:9999px;height:1.5rem;width:2.75rem}.advads-ui-switch div:after{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-content:"";background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(209 213 219/var(--tw-border-opacity));border-radius:9999px;border-width:1px;content:var(--tw-content);height:1.25rem;left:2px;position:absolute;top:.125rem;transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:1.25rem}.advads-ui-switch span{font-size:.875rem;font-weight:500;line-height:1.25rem;margin-left:.75rem}#advads-m2-connect{display:none}#advads-m2-connect a{--tw-text-opacity:1;color:rgb(4 116 162/var(--tw-text-opacity))}1 .sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.\!mr-2{margin-right:.5rem!important}.\!mt-1{margin-top:.25rem!important}.mb-6{margin-bottom:1.5rem}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.w-full{width:100%}.items-center{align-items:center}.gap-x-4{column-gap:1rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.self-start{align-self:flex-start}.text-base{font-size:1rem;line-height:1.5rem}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.lds-ripple{display:none;height:40px;position:relative;width:40px}.lds-ripple.show{display:inline-block}.lds-ripple div{animation:lds-ripple 1s cubic-bezier(0,.2,.8,1) infinite;border:4px solid #ccc;border-radius:50%;opacity:1;position:absolute}.lds-ripple div:nth-child(2){animation-delay:-.5s}@keyframes lds-ripple{0%{height:0;left:20px;opacity:0;top:20px;width:0}4.9%{height:0;left:20px;opacity:0;top:20px;width:0}5%{height:0;left:20px;opacity:1;top:20px;width:0}to{height:40px;left:0;opacity:0;top:0;width:40px}}.advads-ui-switch{align-items:center;cursor:pointer;display:inline-flex;position:relative}.advads-ui-switch-list>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.25rem*var(--tw-space-y-reverse));margin-top:calc(1.25rem*(1 - var(--tw-space-y-reverse)))}.advads-ui-switch input{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.advads-ui-switch input:checked~div{--tw-bg-opacity:1;background-color:rgb(4 116 162/var(--tw-bg-opacity))}.advads-ui-switch input:checked~div:after{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity));content:var(--tw-content);left:auto;right:2px}.advads-ui-switch input:disabled~div:after{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));content:var(--tw-content)}.advads-ui-switch div{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));border-radius:9999px;border-width:1px;height:1.5rem;position:relative;width:2.75rem}.advads-ui-switch div:after{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-content:"";background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(209 213 219/var(--tw-border-opacity));border-radius:9999px;border-width:1px;content:var(--tw-content);height:1.25rem;left:2px;position:absolute;top:.125rem;transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:1.25rem}.advads-ui-switch span{font-size:.875rem;font-weight:500;line-height:1.25rem;margin-left:.75rem}#advads-m2-connect{display:none}#advads-m2-connect a{--tw-text-opacity:1;color:rgb(4 116 162/var(--tw-text-opacity))} -
advanced-ads/tags/1.54.0/assets/js/app.js
r3134243 r3145275 1 (()=>{"use strict";var t,e={570:(t,e,n)=>{const a=jQuery;var o=n.n(a);function s(){var t,e,n,a,s;t=o()(".js-pubguru-connect"),e=t.next(".aa-spinner"),n=o()("#advads-m2-connect"),o()(".js-m2-show-consent").on("click",".button",(function(t){t.preventDefault();var e=o()(this).closest("tr");n.show(),e.addClass("hidden"),e.next().removeClass("hidden")})),o()(".js-pubguru-disconnect").on("click",".button",(function(t){t.preventDefault();var e=o()(this).closest("tr");n.hide(),e.addClass("hidden"),e.prev().removeClass("hidden"),o().ajax({type:"POST",url:ajaxurl,data:{action:"pubguru_disconnect",nonce:advadsglobal.ajax_nonce},dataType:"json"}).done((function(t){if(t.success){var n=o()('<div class="notice notice-success" />');n.html("<p>"+t.data.message+"</p>"),e.closest(".postbox").after(n),setTimeout((function(){n.fadeOut(500,(function(){n.remove()}))}),3e3)}}))})),o()("#m2-connect-consent").on("change",(function(){var e=o()(this);t.prop("disabled",!e.is(":checked"))})),o()("#advads-overview").on("click",".notice-dismiss",(function(t){t.preventDefault();var e=o()(this).parent();e.fadeOut(500,(function(){e.remove()}))})),t.on("click",(function(n){n.preventDefault(),e.addClass("show"),o().ajax({type:"POST",url:ajaxurl,data:{action:"pubguru_connect",nonce:advadsglobal.ajax_nonce},dataType:"json"}).done((function(t){t.success&&(o()(".pubguru-not-connected").hide(),o()(".pubguru-connected").removeClass("hidden"),o()(".pg-tc-trail").toggle(!t.data.hasTrafficCop),o()(".pg-tc-install").toggle(t.data.hasTrafficCop))})).fail((function(e){var n=e.responseJSON,a=o()('<div class="notice notice-error is-dismissible" />');a.html("<p>"+n.data+'</p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button>'),t.closest(".postbox").after(a)})).complete((function(){return e.removeClass("show")}))})),a=o()("#pubguru-modules"),s=o()("#pubguru-notices"),a.on("input","input:checkbox",(function(){var t=o()(this),e=t.attr("name"),n=t.is(":checked");o().ajax({url:a.attr("action"),method:"POST",data:{action:"pubguru_module_change",security:a.data("security"),module:e,status:n}}).done((function(t){var e=t.data.notice,n=void 0===e?"":e;s.html(""),""!==n&&s.html(n)}))})),s.on("click",".js-btn-backup-adstxt",(function(){var t=o()(this);t.prop("disabled",!0),t.html(t.data("loading")),o().ajax({url:a.attr("action"),method:"POST",data:{action:"pubguru_backup_ads_txt",security:t.data("security")}}).done((function(e){e.success?(t.html(t.data("done")),setTimeout((function(){s.fadeOut("slow",(function(){s.html("")}))}),4e3)):t.html(t.data("text"))})).fail((function(){t.html(t.data("text"))}))}))}o()((function(){s()}))},576:()=>{}},n={};function a(t){var o=n[t];if(void 0!==o)return o.exports;var s=n[t]={exports:{}};return e[t](s,s.exports,a),s.exports}a.m=e,t=[],a.O=(e,n,o,s)=>{if(!n){var c=1/0;for(d=0;d<t.length;d++){for(var[n,o,s]=t[d],i=!0,r=0;r<n.length;r++)(!1&s||c>=s)&&Object.keys(a.O).every((t=>a.O[t](n[r])))?n.splice(r--,1):(i=!1,s<c&&(c=s));if(i){t.splice(d--,1);var u=o();void 0!==u&&(e=u)}}return e}s=s||0;for(var d=t.length;d>0&&t[d-1][2]>s;d--)t[d]=t[d-1];t[d]=[n,o,s]},a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={845:0,196:0};a.O.j=e=>0===t[e];var e=(e,n)=>{var o,s,[c,i,r]=n,u=0;if(c.some((e=>0!==t[e]))){for(o in i)a.o(i,o)&&(a.m[o]=i[o]);if(r)var d=r(a)}for(e&&e(n);u<c.length;u++)s=c[u],a.o(t,s)&&t[s]&&t[s][0](),t[s]=0;return a.O(d)},n=globalThis.webpackChunkadvanced_ads=globalThis.webpackChunkadvanced_ads||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),a.O(void 0,[196],(()=>a(570)));var o=a.O(void 0,[196],(()=>a(576)));o=a.O(o)})();1 (()=>{"use strict";var e,t={612:(e,t,a)=>{const n=jQuery;var o=a.n(n);function s(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=o()('<div class="notice notice-'.concat(t,' is-dismissible" />'));n.html("<p>"+e+'</p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button>'),o()("#pubguru-notices").append(n),a&&setTimeout((function(){n.fadeOut(500,(function(){n.remove()}))}),3e3)}function c(){var e,t,a,n,c,i,u,d,r,l;e=o()(".js-pubguru-connect"),t=o()(".js-pubguru-disconnect"),a=o()("#advads-m2-connect"),n=o()(".js-pubguru-connecting"),c=n.next(".aa-spinner"),i=o()(".pubguru-connected"),u=o()(".pubguru-not-connected"),e.on("click",".button",(function(e){e.preventDefault(),a.show()})),o()("#m2-connect-consent").on("change",(function(){var e=o()(this);n.prop("disabled",!e.is(":checked"))})),n.on("click",(function(a){a.preventDefault(),c.addClass("show"),o().ajax({type:"POST",url:ajaxurl,data:{action:"pubguru_connect",nonce:advadsglobal.ajax_nonce},dataType:"json"}).done((function(a){a.success&&(u.addClass("hidden"),e.addClass("hidden"),i.removeClass("hidden"),t.removeClass("hidden"),o()(".pg-tc-trail").toggle(!a.data.hasTrafficCop),o()(".pg-tc-install").toggle(a.data.hasTrafficCop),s(a.data.message,"success",!0))})).fail((function(e){s(e.responseJSON.data,"error")})).complete((function(){return c.removeClass("show")}))})),t.on("click",".button",(function(n){n.preventDefault(),a.hide(),u.removeClass("hidden"),e.removeClass("hidden"),i.addClass("hidden"),t.addClass("hidden"),o().ajax({type:"POST",url:ajaxurl,data:{action:"pubguru_disconnect",nonce:advadsglobal.ajax_nonce},dataType:"json"}).done((function(e){e.success&&s(e.data.message,"success",!0)}))})),d=o()("#pubguru-modules"),r=o()("#pubguru-notices"),l=o()("#pubguru-header-bidding-at-body").closest("div"),d.on("input","input:checkbox",(function(){var e=o()(this),t=e.attr("name"),a=e.is(":checked");"header_bidding"===t&&l.toggle(a),o().ajax({url:d.attr("action"),method:"POST",data:{action:"pubguru_module_change",security:d.data("security"),module:t,status:a}}).done((function(e){var t=e.data.notice,a=void 0===t?"":t;r.html(""),""!==a&&r.html(a)}))})),o()(document).on("click",".js-btn-backup-adstxt",(function(){var e=o()(this),t=e.closest(".notice");e.prop("disabled",!0),e.html(e.data("loading")),o().ajax({url:d.attr("action"),method:"POST",data:{action:"pubguru_backup_ads_txt",security:e.data("security")}}).always((function(){e.prop("disabled",!1),e.html(e.data("text"))})).done((function(e){if(e.success){var a=o()(e.data);r.html(a),t.after(a),t.remove(),setTimeout((function(){a.fadeOut("slow",(function(){a.html("")}))}),4e3)}else r.html(e.data),t.after(e.data)}))})),o()("#advads-overview").on("click",".notice-dismiss",(function(e){e.preventDefault();var t=o()(this).parent();t.fadeOut(500,(function(){t.remove()}))}))}o()((function(){c()}))},576:()=>{}},a={};function n(e){var o=a[e];if(void 0!==o)return o.exports;var s=a[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.m=t,e=[],n.O=(t,a,o,s)=>{if(!a){var c=1/0;for(r=0;r<e.length;r++){for(var[a,o,s]=e[r],i=!0,u=0;u<a.length;u++)(!1&s||c>=s)&&Object.keys(n.O).every((e=>n.O[e](a[u])))?a.splice(u--,1):(i=!1,s<c&&(c=s));if(i){e.splice(r--,1);var d=o();void 0!==d&&(t=d)}}return t}s=s||0;for(var r=e.length;r>0&&e[r-1][2]>s;r--)e[r]=e[r-1];e[r]=[a,o,s]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={845:0,196:0};n.O.j=t=>0===e[t];var t=(t,a)=>{var o,s,[c,i,u]=a,d=0;if(c.some((t=>0!==e[t]))){for(o in i)n.o(i,o)&&(n.m[o]=i[o]);if(u)var r=u(n)}for(t&&t(a);d<c.length;d++)s=c[d],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(r)},a=globalThis.webpackChunkadvanced_ads=globalThis.webpackChunkadvanced_ads||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})(),n.O(void 0,[196],(()=>n(612)));var o=n.O(void 0,[196],(()=>n(576)));o=n.O(o)})(); -
advanced-ads/tags/1.54.0/assets/scss/ui/_switch.scss
r3041809 r3145275 10 10 11 11 &:checked ~ div { 12 @apply after:translate-x-full after:border-white bg-primary;12 @apply bg-primary after:left-auto after:right-[2px] after:border-white; 13 13 } 14 14 … … 19 19 20 20 div { 21 @apply w-11 h-6 bg-gray-200 rounded-full;21 @apply relative w-11 h-6 bg-gray-200 rounded-full border; 22 22 23 23 &::after { -
advanced-ads/tags/1.54.0/assets/src/modules/oneclick/connect-button.js
r3041809 r3145275 1 1 import jQuery from 'jquery'; 2 2 3 function createNotice(message, type, fadeAway = false) { 4 const notice = jQuery( 5 `<div class="notice notice-${type} is-dismissible" />` 6 ); 7 notice.html( 8 '<p>' + 9 message + 10 '</p>' + 11 '<button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button>' 12 ); 13 14 jQuery('#pubguru-notices').append(notice); 15 16 if (fadeAway) { 17 setTimeout(() => { 18 notice.fadeOut(500, () => { 19 notice.remove(); 20 }); 21 }, 3000); 22 } 23 } 24 3 25 export default function () { 4 const pubguruConnectButton= jQuery('.js-pubguru-connect');5 const spinner = pubguruConnectButton.next('.aa-spinner');26 const connectWrap = jQuery('.js-pubguru-connect'); 27 const disconnectWrap = jQuery('.js-pubguru-disconnect'); 6 28 const metabox = jQuery('#advads-m2-connect'); 29 const connectButton = jQuery('.js-pubguru-connecting'); 30 const spinner = connectButton.next('.aa-spinner'); 31 const contentConnected = jQuery('.pubguru-connected'); 32 const contentNotConnected = jQuery('.pubguru-not-connected'); 7 33 8 jQuery('.js-m2-show-consent').on('click', '.button', function (event) { 34 // Show consent box. 35 connectWrap.on('click', '.button', function (event) { 9 36 event.preventDefault(); 10 11 const tr = jQuery(this).closest('tr');12 13 37 metabox.show(); 14 tr.addClass('hidden');15 tr.next().removeClass('hidden');16 });17 18 jQuery('.js-pubguru-disconnect').on('click', '.button', function (event) {19 event.preventDefault();20 21 const tr = jQuery(this).closest('tr');22 23 metabox.hide();24 tr.addClass('hidden');25 tr.prev().removeClass('hidden');26 27 jQuery28 .ajax({29 type: 'POST',30 url: ajaxurl,31 data: {32 action: 'pubguru_disconnect',33 nonce: advadsglobal.ajax_nonce,34 },35 dataType: 'json',36 })37 .done(function (response) {38 if (!response.success) {39 return;40 }41 42 const notice = jQuery('<div class="notice notice-success" />');43 notice.html('<p>' + response.data.message + '</p>');44 45 tr.closest('.postbox').after(notice);46 setTimeout(function () {47 notice.fadeOut(500, function () {48 notice.remove();49 });50 }, 3000);51 });52 38 }); 53 39 54 40 jQuery('#m2-connect-consent').on('change', function () { 55 41 const checkbox = jQuery(this); 56 pubguruConnectButton.prop('disabled', !checkbox.is(':checked'));42 connectButton.prop('disabled', !checkbox.is(':checked')); 57 43 }); 58 44 59 jQuery('#advads-overview').on('click', '.notice-dismiss', function (event) { 60 event.preventDefault(); 61 const button = jQuery(this); 62 const notice = button.parent(); 63 notice.fadeOut(500, function () { 64 notice.remove(); 65 }); 66 }); 67 68 pubguruConnectButton.on('click', function (event) { 45 connectButton.on('click', function (event) { 69 46 event.preventDefault(); 70 47 … … 85 62 } 86 63 87 jQuery('.pubguru-not-connected').hide(); 88 jQuery('.pubguru-connected').removeClass('hidden'); 64 contentNotConnected.addClass('hidden'); 65 connectWrap.addClass('hidden'); 66 contentConnected.removeClass('hidden'); 67 disconnectWrap.removeClass('hidden'); 89 68 90 69 jQuery('.pg-tc-trail').toggle(!response.data.hasTrafficCop); 91 70 jQuery('.pg-tc-install').toggle(response.data.hasTrafficCop); 71 createNotice(response.data.message, 'success'); 92 72 }) 93 73 .fail(function (jqXHR) { 94 74 const response = jqXHR.responseJSON; 95 const notice = jQuery( 96 '<div class="notice notice-error is-dismissible" />' 97 ); 98 notice.html( 99 '<p>' + 100 response.data + 101 '</p>' + 102 '<button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button>' 103 ); 104 105 pubguruConnectButton.closest('.postbox').after(notice); 75 createNotice(response.data, 'error'); 106 76 }) 107 77 .complete(() => spinner.removeClass('show')); 108 78 }); 79 80 disconnectWrap.on('click', '.button', function (event) { 81 event.preventDefault(); 82 83 metabox.hide(); 84 contentNotConnected.removeClass('hidden'); 85 connectWrap.removeClass('hidden'); 86 contentConnected.addClass('hidden'); 87 disconnectWrap.addClass('hidden'); 88 89 jQuery 90 .ajax({ 91 type: 'POST', 92 url: ajaxurl, 93 data: { 94 action: 'pubguru_disconnect', 95 nonce: advadsglobal.ajax_nonce, 96 }, 97 dataType: 'json', 98 }) 99 .done(function (response) { 100 if (!response.success) { 101 return; 102 } 103 104 createNotice(response.data.message, 'success', true); 105 }); 106 }); 109 107 } -
advanced-ads/tags/1.54.0/assets/src/modules/oneclick/index.js
r3041809 r3145275 1 import jQuery from 'jquery'; 2 1 3 import connectButton from './connect-button'; 2 import settingsUi from './settings';4 import connectSettings from './connect-settings'; 3 5 4 6 export default function () { 5 7 connectButton(); 6 settingsUi(); 8 connectSettings(); 9 10 jQuery('#advads-overview').on('click', '.notice-dismiss', function (event) { 11 event.preventDefault(); 12 const button = jQuery(this); 13 const notice = button.parent(); 14 notice.fadeOut(500, function () { 15 notice.remove(); 16 }); 17 }); 7 18 } -
advanced-ads/tags/1.54.0/classes/ad-debug.php
r2983598 r3145275 247 247 $content = ''; 248 248 foreach ( $_condition as $_k => $_v ) { 249 $content .= esc_html( $_k ) . ': ' . esc_html( $_v ) . '<br>'; 249 $content .= esc_html( $_k ) . ': '; 250 if ( is_array( $_v ) ) { 251 $content .= esc_html( implode( ', ', $_v ) ); 252 } else { 253 $content .= esc_html( $_v ); 254 } 255 $content .= '<br />'; 250 256 } 251 257 -
advanced-ads/tags/1.54.0/classes/ad_group.php
r3134930 r3145275 376 376 'orderby' => 'id', // Might want to avoid sorting as not needed for most calls and fast in PHP; slight I/O blocking concern. 377 377 ]; 378 379 if ( ! empty( $this->ad_args['post_status'] ) ) { 380 $args['post_status'] = array_unique( array_merge( (array) $args['post_status'], (array) $this->ad_args['post_status'] ) ); 381 } 378 382 379 383 $ads = new WP_Query( $args ); -
advanced-ads/tags/1.54.0/classes/frontend_checks.php
r3108573 r3145275 2 2 // phpcs:ignoreFile 3 3 4 use AdvancedAds\Assets_Registry;5 4 use AdvancedAds\Utilities\WordPress; 6 5 … … 53 52 54 53 if( $this->has_adblocker_placements() ) { 55 if ( ! Assets_Registry::script_is('find-adblocker', 'enqueued') ) {56 Assets_Registry::enqueue_script('find-adblocker');54 if ( ! wp_advads()->registry->is_script('find-adblocker', 'enqueued') ) { 55 wp_advads()->registry->enqueue_script('find-adblocker'); 57 56 } 58 57 } -
advanced-ads/tags/1.54.0/classes/in-content-injector.php
r2983598 r3145275 1 <?php 1 <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName 2 2 3 3 use AdvancedAds\Utilities\WordPress; … … 80 80 } 81 81 82 // handle tags that are empty by definition or could be empty ("custom" option)82 // Handle tags that are empty by definition or could be empty ("custom" option). 83 83 if ( in_array( $tag_option, [ 'img', 'iframe', 'custom' ], true ) ) { 84 84 $defaults['allowEmpty'] = true; … … 116 116 switch ( $tag_option ) { 117 117 case 'p': 118 // exclude paragraphs within blockquote tags118 // Exclude paragraphs within blockquote tags. 119 119 $tag = 'p[not(parent::blockquote)]'; 120 120 break; 121 121 case 'pwithoutimg': 122 // convert option name into correct path, exclude paragraphs within blockquote tags122 // Convert option name into correct path, exclude paragraphs within blockquote tags. 123 123 $tag = 'p[not(descendant::img) and not(parent::blockquote)]'; 124 124 break; … … 133 133 contains(concat(' ', normalize-space(@class), ' '), ' gallery-size') or 134 134 contains(concat(' ', normalize-space(@class), ' '), ' wp-caption ') )"; 135 $tag = "*[self::img or self::figure or self::div[$shortcodes]]135 $tag = "*[self::img or self::figure or self::div[$shortcodes]] 136 136 [not(ancestor::table or ancestor::figure or ancestor::div[$shortcodes])]"; 137 137 break; 138 // any headline. By default h2, h3, and h4138 // Any headline. By default h2, h3, and h4. 139 139 case 'headlines': 140 140 $headlines = apply_filters( 'advanced-ads-headlines-for-ad-injection', [ 'h2', 'h3', 'h4' ] ); … … 145 145 $tag = '*[' . implode( ' or ', $headlines ) . ']'; // /html/body/*[self::h2 or self::h3 or self::h4] 146 146 break; 147 // any HTML element that makes sense in the content147 // Any HTML element that makes sense in the content. 148 148 case 'anyelement': 149 149 $exclude = [ … … 186 186 break; 187 187 case 'custom': 188 // get the path for the "custom" tag choice, use p as a fallback to prevent it from showing any ads if users left it empty188 // Get the path for the "custom" tag choice, use p as a fallback to prevent it from showing any ads if users left it empty. 189 189 $tag = ! empty( $placement_opts['xpath'] ) ? stripslashes( $placement_opts['xpath'] ) : 'p'; 190 190 break; … … 194 194 $xpath = new DOMXPath( $dom ); 195 195 196 197 if ( $options['itemLimit'] !== -1 ) { 196 if ( -1 !== $options['itemLimit'] ) { 198 197 $items = $xpath->query( '/html/body/' . $tag ); 199 198 … … 254 253 } 255 254 256 // make sure that the ad is injected outside the link255 // Make sure that the ad is injected outside the link. 257 256 if ( 'img' === $tag_option && 'a' === $node->parentNode->tagName ) { 258 257 if ( $options['before'] ) { 259 258 $node->parentNode; 260 259 } else { 261 // go one level deeper if inserted after to not insert the ad into the link; probably after the paragraph260 // Go one level deeper if inserted after to not insert the ad into the link; probably after the paragraph. 262 261 $node->parentNode->parentNode; 263 262 } … … 274 273 $ad_content = self::filter_ad_content( $ad_content, $node->tagName, $options ); 275 274 276 // convert HTML to XML!277 $ad_dom = new DOMDocument( '1.0', $wp_charset );275 // Convert HTML to XML!. 276 $ad_dom = new DOMDocument( '1.0', $wp_charset ); 278 277 $libxml_use_internal_errors = libxml_use_internal_errors( true ); 279 278 $ad_dom->loadHtml( '<!DOCTYPE html><html><meta http-equiv="Content-Type" content="text/html; charset=' . $wp_charset . '" /><body>' . $ad_content ); … … 314 313 } 315 314 } else { 316 // append to body; -TODO using here that we only select direct children of the body tag.315 // Append to body; -TODO using here that we only select direct children of the body tag. 317 316 foreach ( $ad_dom->getElementsByTagName( 'body' )->item( 0 )->childNodes as $importedNode ) { 318 317 $importedNode = $dom->importNode( $importedNode, true ); … … 341 340 * * but there are enough elements on the site, but just in sub-containers 342 341 */ 343 } elseif ( WordPress::user_can( 'advanced_ads_manage_options' ) 344 && $options['itemLimit'] !== -1 345 && empty( $plugin_options['content-injection-level-disabled'] ) ) { 342 } elseif ( 343 WordPress::user_can( 'advanced_ads_manage_options' ) && 344 -1 !== $options['itemLimit'] && 345 empty( $plugin_options['content-injection-level-disabled'] ) 346 ) { 346 347 347 348 // Check if there are more elements without limitation. … … 363 364 364 365 // phpcs:enable 365 366 366 return $content; 367 367 } … … 473 473 // Add tags before/after which ad placehoders were injected. 474 474 foreach ( $ads_for_placeholders as $ad_content ) { 475 $tag = $ad_content['tag']; 475 $alts = []; 476 $tag = $ad_content['tag']; 476 477 477 478 switch ( $ad_content['position'] ) { … … 492 493 } 493 494 } 495 494 496 $alts = array_unique( $alts ); 495 497 $tag_regexp = implode( '|', $alts ); … … 527 529 } 528 530 } else { 529 $count ++;531 ++$count; 530 532 } 531 533 } … … 749 751 return '//*[' . implode( ' or ', $query ) . ']'; 750 752 } 751 752 753 } -
advanced-ads/tags/1.54.0/classes/plugin.php
r3134733 r3145275 90 90 */ 91 91 public function wp_plugins_loaded() { 92 // Load plugin text domain.93 $this->load_plugin_textdomain();94 95 92 // Load public-facing style sheet and JavaScript. 96 93 add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] ); … … 267 264 268 265 /** 269 * Load the plugin text domain for translation.270 */271 public function load_plugin_textdomain() {272 load_plugin_textdomain( 'advanced-ads', false, ADVADS_BASE_DIR . '/languages' );273 }274 275 /**276 266 * Shortcode to include ad in frontend 277 267 * -
advanced-ads/tags/1.54.0/includes/admin/class-assets.php
r3134243 r3145275 10 10 namespace AdvancedAds\Admin; 11 11 12 use AdvancedAds\Entities; 12 13 use Advanced_Ads_AdSense_Admin; 13 14 use Advanced_Ads_Display_Conditions; 14 use AdvancedAds\Assets_Registry;15 use AdvancedAds\Entities;16 use AdvancedAds\Utilities\Data;17 15 use AdvancedAds\Utilities\Conditional; 18 16 use AdvancedAds\Framework\Interfaces\Integration_Interface; … … 43 41 $screen = get_current_screen(); 44 42 45 Assets_Registry::enqueue_style( 'ui' );46 Assets_Registry::enqueue_style( 'admin' );43 wp_advads()->registry->enqueue_style( 'ui' ); 44 wp_advads()->registry->enqueue_style( 'admin' ); 47 45 48 46 if ( 'post' === $screen->base && Entities::POST_TYPE_AD === $screen->post_type ) { 49 Assets_Registry::enqueue_style( 'ad-positioning' );47 wp_advads()->registry->enqueue_style( 'ad-positioning' ); 50 48 } 51 49 } … … 63 61 64 62 // TODO: add conditional loading. 65 Assets_Registry::enqueue_script( 'admin-global' );66 Assets_Registry::enqueue_script( 'find-adblocker' );63 wp_advads()->registry->enqueue_script( 'admin-global' ); 64 wp_advads()->registry->enqueue_script( 'find-adblocker' ); 67 65 68 66 $params = [ … … 77 75 78 76 if ( Conditional::is_screen_advanced_ads() ) { 79 Assets_Registry::enqueue_script( 'admin' );80 Assets_Registry::enqueue_script( 'conditions' );81 Assets_Registry::enqueue_script( 'wizard' );77 wp_advads()->registry->enqueue_script( 'admin' ); 78 wp_advads()->registry->enqueue_script( 'conditions' ); 79 wp_advads()->registry->enqueue_script( 'wizard' ); 82 80 83 81 $translation_array = [ … … 118 116 // Ad edit screen. 119 117 if ( 'post' === $screen->base && Entities::POST_TYPE_AD === $screen->post_type ) { 120 Assets_Registry::enqueue_script( 'ad-positioning' );118 wp_advads()->registry->enqueue_script( 'ad-positioning' ); 121 119 } 122 120 123 121 if ( in_array( $screen->id, [ 'edit-post', 'edit-page' ], true ) && current_user_can( 'edit_posts' ) ) { 124 Assets_Registry::enqueue_script( 'page-quick-edit' );122 wp_advads()->registry->enqueue_script( 'page-quick-edit' ); 125 123 wp_advads()->json->add( 'page_quick_edit', [ 'nonce' => wp_create_nonce( 'advads-post-quick-edit' ) ] ); 126 124 } -
advanced-ads/tags/1.54.0/includes/class-assets-registry.php
r3134243 r3145275 10 10 namespace AdvancedAds; 11 11 12 use AdvancedAds\Framework\Interfaces\Integration_Interface;13 14 12 defined( 'ABSPATH' ) || exit; 15 13 … … 17 15 * Assets Registry. 18 16 */ 19 class Assets_Registry implements Integration_Interface{17 class Assets_Registry extends \AdvancedAds\Framework\Assets_Registry { 20 18 21 19 /** 22 * Enqueue stylesheet20 * Version for plugin local assets. 23 21 * 24 * @param string $handle Name of the stylesheet. 25 * 26 * @return void 22 * @return string 27 23 */ 28 public static function enqueue_style( $handle ): void{29 wp_enqueue_style( self::prefix_it( $handle ) );24 public function get_version(): string { 25 return ADVADS_VERSION; 30 26 } 31 27 32 28 /** 33 * Enqueue script29 * Prefix to use in handle to make it unique. 34 30 * 35 * @param string $handle Name of the script. 36 * 37 * @return void 31 * @return string 38 32 */ 39 public static function enqueue_script( $handle ): void{40 wp_enqueue_script( self::prefix_it( $handle ) );33 public function get_prefix(): string { 34 return ADVADS_SLUG; 41 35 } 42 36 43 37 /** 44 * Prefix the handle 45 * 46 * @param string $handle Name of the asset. 38 * Base URL for plugin local assets. 47 39 * 48 40 * @return string 49 41 */ 50 public static function prefix_it( $handle ): string { 51 return ADVADS_SLUG . '-' . $handle; 52 } 53 54 /** 55 * Determines whether a script has been added to the queue. 56 * 57 * @param string $handle Name of the script. 58 * @param string $status Optional. Status of the script to check. Default 'enqueued'. 59 * Accepts 'enqueued', 'registered', 'queue', 'to_do', and 'done'. 60 * 61 * @return bool 62 */ 63 public static function script_is( $handle, $status = 'enqueued' ): bool { 64 return wp_script_is( self::prefix_it( $handle ), $status ); 65 } 66 67 /** 68 * Hook into WordPress. 69 * 70 * @return void 71 */ 72 public function hooks(): void { 73 add_action( 'admin_enqueue_scripts', [ $this, 'register_assets' ], 0 ); 74 add_action( 'wp_enqueue_scripts', [ $this, 'register_assets' ], 0 ); 75 } 76 77 /** 78 * Register assets 79 * 80 * @return void 81 */ 82 public function register_assets(): void { 83 $this->register_styles(); 84 $this->register_scripts(); 42 public function get_base_url(): string { 43 return ADVADS_BASE_URL; 85 44 } 86 45 … … 94 53 return; 95 54 } 55 96 56 $this->register_style( 'ui', 'admin/assets/css/ui.css' ); 97 57 $this->register_style( 'admin', 'admin/assets/css/admin.css' ); … … 99 59 $this->register_style( 'app', 'assets/css/app.css' ); 100 60 } 101 $this->register_style( 'ad-positioning', 'modules/ad-positioning/assets/css/ad-positioning.css', [ self::prefix_it( 'admin' ) ] );61 $this->register_style( 'ad-positioning', 'modules/ad-positioning/assets/css/ad-positioning.css', [ $this->prefix_it( 'admin' ) ] ); 102 62 } 103 63 … … 111 71 $this->register_script( 'wp-widget-adsense', 'modules/gadsense/admin/assets/js/wp-widget.js', [ 'jquery' ], false, true ); 112 72 $this->register_script( 'app', 'assets/js/app.js', [ 'jquery' ], false, true ); 73 $this->register_script( 'find-adblocker', 'admin/assets/js/advertisement.js' ); 113 74 114 75 if ( ! is_admin() ) { … … 117 78 118 79 // Backend JS files go here. 119 $this->register_script( 'find-adblocker', 'admin/assets/js/advertisement.js' ); 120 $this->register_script( 'conditions', 'admin/assets/js/conditions.js', [ 'jquery', self::prefix_it( 'ui' ) ] ); 80 $this->register_script( 'conditions', 'admin/assets/js/conditions.js', [ 'jquery', $this->prefix_it( 'ui' ) ] ); 121 81 $this->register_script( 'wizard', 'admin/assets/js/wizard.js', [ 'jquery' ] ); 122 82 $this->register_script( 'inline-edit-group-ads', 'admin/assets/js/inline-edit-group-ads.js', [ 'jquery' ] ); 123 $this->register_script( 'admin', 'admin/assets/js/admin.min.js', [ 'jquery', self::prefix_it( 'ui' ), 'jquery-ui-autocomplete', 'wp-util' ] );83 $this->register_script( 'admin', 'admin/assets/js/admin.min.js', [ 'jquery', $this->prefix_it( 'ui' ), 'jquery-ui-autocomplete', 'wp-util' ] ); 124 84 $this->register_script( 'ui', 'admin/assets/js/ui.js', [ 'jquery' ] ); 125 85 $this->register_script( 'admin-global', 'admin/assets/js/admin-global.js', [ 'jquery' ], false, true ); 126 86 $this->register_script( 'page-quick-edit', 'assets/js/admin/page-quick-edit.js', [], false, true ); 127 87 } 128 129 /**130 * Register stylesheet131 *132 * @param string $handle Name of the stylesheet. Should be unique.133 * @param string|bool $src URL of the stylesheet.134 * @param string[] $deps Optional. An array of registered stylesheet handles this stylesheet depends on.135 * @param string|bool|null $ver Optional. String specifying stylesheet version number.136 * @param string $media Optional. The media for which this stylesheet has been defined.137 *138 * @return void139 */140 private function register_style( $handle, $src, $deps = [], $ver = false, $media = 'all' ) {141 if ( false === $ver ) {142 $ver = ADVADS_VERSION;143 }144 145 wp_register_style( self::prefix_it( $handle ), ADVADS_BASE_URL . $src, $deps, $ver, $media );146 }147 148 /**149 * Register script150 *151 * @param string $handle Name of the stylesheet. Should be unique.152 * @param string|bool $src URL of the stylesheet.153 * @param string[] $deps Optional. An array of registered stylesheet handles this stylesheet depends on.154 * @param string|bool|null $ver Optional. String specifying stylesheet version number.155 * @param bool $in_footer Optional. The media for which this stylesheet has been defined.156 *157 * @return void158 */159 private function register_script( $handle, $src, $deps = [], $ver = false, $in_footer = false ) {160 if ( false === $ver ) {161 $ver = ADVADS_VERSION;162 }163 164 $new_src = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? $src : str_replace( '.js', '.min.js', $src );165 wp_register_script( self::prefix_it( $handle ), ADVADS_BASE_URL . $src, $deps, $ver, $in_footer );166 }167 88 } -
advanced-ads/tags/1.54.0/includes/class-autoloader.php
r2991956 r3145275 51 51 52 52 /** 53 * Get plugin directory. 54 * 55 * @return string 56 */ 57 public function get_directory(): string { 58 return dirname( ADVADS_FILE ); 59 } 60 61 /** 53 62 * Runs this initializer. 54 63 * … … 63 72 } 64 73 65 $this->autoloader = require _once$locate;74 $this->autoloader = require $locate; 66 75 $this->register_wordpress(); 67 76 } … … 75 84 */ 76 85 private function locate() { 77 $directory = dirname( ADVADS_FILE ); 78 $packages = $directory . '/packages/autoload.php'; 79 $vendors = $directory . '/vendor/autoload.php'; 80 $is_debug = 'local' === ( function_exists( 'wp_get_environment_type' ) ? wp_get_environment_type() : $this->get_environment_type() ); 81 $is_packages = is_readable( $packages ); 82 $is_vendors = is_readable( $vendors ); 83 84 if ( $is_packages && ( ! $is_debug || ! $is_vendors ) ) { 86 $directory = $this->get_directory(); 87 $packages = $directory . '/packages/autoload.php'; 88 $vendors = $directory . '/vendor/autoload.php'; 89 $is_debug = $this->is_debug() || 'local' === $this->get_environment_type(); 90 91 if ( is_readable( $packages ) && ( ! $is_debug || ! is_readable( $vendors ) ) ) { 85 92 return $packages; 86 93 } 87 94 88 if ( $is_vendors) {95 if ( is_readable( $vendors ) ) { 89 96 return $vendors; 90 97 } … … 135 142 */ 136 143 public function get_environment_type(): string { 144 return function_exists( 'wp_get_environment_type' ) 145 ? wp_get_environment_type() 146 : $this->get_environment_type_fallback(); 147 } 148 149 /** 150 * Retrieves the current environment type. 151 * 152 * @return string 153 */ 154 private function get_environment_type_fallback(): string { 137 155 static $current_env = ''; 138 156 … … 184 202 return $current_env; 185 203 } 204 205 /** 206 * Is WordPress debug mode enabled 207 * 208 * @return bool 209 */ 210 private function is_debug(): bool { 211 return defined( 'WP_DEBUG' ) && WP_DEBUG; 212 } 186 213 } -
advanced-ads/tags/1.54.0/includes/class-plugin.php
r3134243 r3145275 11 11 12 12 use AdvancedAds\Admin; 13 use AdvancedAds\Groups;14 13 use AdvancedAds\Framework; 15 14 use AdvancedAds\Framework\Loader; … … 20 19 /** 21 20 * Plugin. 21 * 22 * Containers: 23 * 24 * @property Shortcodes $shortcodes Shortcodes handler. 25 * @property Assets_Registry $registry Assets registry. 26 * @property Framework\JSON $json JSON handler. 27 * @property Admin\Admin_Menu $screens Admin screens. 28 * @property Frontend\Ad_Renderer $renderer Ads renderer. 29 * @property Frontend\Manager $frontend Frontend manager. 22 30 */ 23 31 class Plugin extends Loader { … … 57 65 private function setup(): void { 58 66 $this->define_constants(); 67 $this->includes_functions(); 59 68 $this->includes(); 69 $this->includes_admin(); 60 70 61 71 /** … … 64 74 * TODO: need to remove it in future. 65 75 */ 66 67 // Load public functions (might be used by modules, other plugins or theme).68 require_once ADVADS_ABSPATH . 'includes/functions.php';69 require_once ADVADS_ABSPATH . 'includes/cap_map.php';70 71 76 // Public-Facing and Core Functionality. 72 77 \Advanced_Ads::get_instance(); … … 78 83 } 79 84 85 add_action( 'init', [ $this, 'load_textdomain' ] ); 80 86 add_action( 'plugins_loaded', [ $this, 'on_plugins_loaded' ], -1 ); 87 88 // Load it all. 81 89 $this->load(); 82 90 } … … 96 104 */ 97 105 do_action( 'advanced-ads-loaded' ); 106 } 107 108 /** 109 * Load the plugin text domain for translation. 110 * 111 * @return void 112 */ 113 public function load_textdomain(): void { 114 $locale = get_user_locale(); 115 $locale = apply_filters( 'plugin_locale', $locale, 'advanced-ads' ); 116 117 unload_textdomain( 'advanced-ads' ); 118 if ( false === load_textdomain( 'advanced-ads', WP_LANG_DIR . '/plugins/advanced-ads-' . $locale . '.mo' ) ) { 119 load_textdomain( 'advanced-ads', WP_LANG_DIR . '/advanced-ads/advanced-ads-' . $locale . '.mo' ); 120 } 121 122 load_plugin_textdomain( 'advanced-ads', false, dirname( ADVADS_PLUGIN_BASENAME ) . '/languages' ); 98 123 } 99 124 … … 145 170 */ 146 171 private function includes(): void { 172 // Common. 147 173 $this->register_initializer( Install::class ); 148 174 $this->register_integration( Entities::class ); 149 $this->register_integration( Assets_Registry::class );175 $this->register_integration( Assets_Registry::class, 'registry' ); 150 176 $this->register_integration( Framework\JSON::class, 'json', [ 'advancedAds' ] ); 151 177 $this->register_integration( Groups\Manager::class, 'group_manager' ); 152 153 // Only in admin area. 154 if ( is_admin() ) { 155 $this->register_integration( Admin\Action_Links::class ); 156 $this->register_integration( Admin\Assets::class ); 157 $this->register_integration( Admin\Header::class ); 158 $this->register_integration( Admin\TinyMCE::class ); 159 $this->register_integration( Admin\Admin_Menu::class ); 160 $this->register_integration( Admin\Page_Quick_Edit::class ); 161 } 178 } 179 180 /** 181 * Includes files used in admin. 182 * 183 * @return void 184 */ 185 private function includes_admin(): void { 186 // Early bail!! 187 if ( ! is_admin() ) { 188 return; 189 } 190 191 $this->register_integration( Admin\Action_Links::class ); 192 $this->register_integration( Admin\Assets::class ); 193 $this->register_integration( Admin\Header::class ); 194 $this->register_integration( Admin\TinyMCE::class ); 195 $this->register_integration( Admin\Admin_Menu::class ); 196 $this->register_integration( Admin\Page_Quick_Edit::class ); 197 } 198 199 /** 200 * Includes the necessary functions files. 201 * 202 * @return void 203 */ 204 private function includes_functions(): void { 205 require_once ADVADS_ABSPATH . 'includes/functions.php'; 206 require_once ADVADS_ABSPATH . 'includes/cap_map.php'; 162 207 } 163 208 } -
advanced-ads/tags/1.54.0/languages/advanced-ads.pot
r3134930 r3145275 1 # Copyright (C) 2024 Advanced Ads GmbH1 # Copyright (C) 2024 Advanced Ads 2 2 # This file is distributed under the GPL-2.0+. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Advanced Ads 1.53. 1\n"5 "Project-Id-Version: Advanced Ads 1.53.2\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads/\n" 7 7 "Last-Translator: Thomas Maier <[email protected]>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2024-0 8-13T12:34:04+00:00\n"12 "POT-Creation-Date: 2024-09-02T11:05:48+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.6.0\n" … … 16 16 17 17 #. Plugin Name of the plugin 18 #: admin/includes/class-meta-box.php:565 18 #. Author of the plugin 19 #: admin/includes/class-meta-box.php:564 19 20 #: modules/gutenberg/includes/class-gutenberg.php:136 20 21 msgid "Advanced Ads" … … 28 29 #. Description of the plugin 29 30 msgid "Manage and optimize your ads in WordPress" 30 msgstr ""31 32 #. Author of the plugin33 msgid "Advanced Ads GmbH"34 31 msgstr "" 35 32 … … 86 83 #. translators: %s is empty here, but the string will be followed by a name of an ad unit. 87 84 #: admin/includes/ad-health-notices.php:112 88 #: classes/frontend_checks.php:2 8085 #: classes/frontend_checks.php:279 89 86 msgid "Visible ads should not use the Header placement: %s" 90 87 msgstr "" 91 88 92 89 #: admin/includes/ad-health-notices.php:123 93 #: classes/ad-debug.php:27 294 #: classes/frontend_checks.php:26 790 #: classes/ad-debug.php:278 91 #: classes/frontend_checks.php:266 95 92 msgid "Your website is using HTTPS, but the ad code contains HTTP and might not work." 96 93 msgstr "" … … 295 292 296 293 #: admin/includes/class-ad-type.php:953 297 #: classes/frontend_checks.php:54 7294 #: classes/frontend_checks.php:546 298 295 msgid "Get help" 299 296 msgstr "" … … 439 436 msgstr "" 440 437 441 #: admin/includes/class-meta-box.php: 50438 #: admin/includes/class-meta-box.php:49 442 439 #: admin/includes/class-overview-widgets.php:68 443 440 msgid "AdSense Earnings" 444 441 msgstr "" 445 442 446 #: admin/includes/class-meta-box.php:10 1443 #: admin/includes/class-meta-box.php:100 447 444 msgid "Ad Type" 448 445 msgstr "" 449 446 450 447 #. translators: 1: Name of ad unit 451 #: admin/includes/class-meta-box.php:11 9448 #: admin/includes/class-meta-box.php:118 452 449 msgid "Earnings of %1$s" 453 450 msgstr "" 454 451 455 #: admin/includes/class-meta-box.php:13 7452 #: admin/includes/class-meta-box.php:136 456 453 #: includes/admin/class-groups-list-table.php:451 457 454 #: views/admin/screens/placements.php:351 … … 459 456 msgstr "" 460 457 461 #: admin/includes/class-meta-box.php:14 6458 #: admin/includes/class-meta-box.php:145 462 459 msgid "Ad Parameters" 463 460 msgstr "" 464 461 465 #: admin/includes/class-meta-box.php:15 4462 #: admin/includes/class-meta-box.php:153 466 463 #: admin/includes/class-settings.php:73 467 464 msgid "Layout / Output" 468 465 msgstr "" 469 466 470 #: admin/includes/class-meta-box.php:16 2467 #: admin/includes/class-meta-box.php:161 471 468 msgid "Targeting" 472 469 msgstr "" 473 470 474 #: admin/includes/class-meta-box.php:17 1471 #: admin/includes/class-meta-box.php:170 475 472 msgid "Increase your ad revenue" 476 473 msgstr "" 477 474 478 #: admin/includes/class-meta-box.php:18 1475 #: admin/includes/class-meta-box.php:180 479 476 msgid "Statistics" 480 477 msgstr "" 481 478 482 #: admin/includes/class-meta-box.php:25 2483 #: admin/includes/class-meta-box.php:26 6479 #: admin/includes/class-meta-box.php:251 480 #: admin/includes/class-meta-box.php:265 484 481 #: admin/includes/class-overview-widgets.php:181 485 482 #: admin/views/ad-main-metabox.php:29 … … 502 499 msgstr "" 503 500 501 #: admin/includes/class-meta-box.php:269 502 msgid "Video" 503 msgstr "" 504 504 505 #: admin/includes/class-meta-box.php:270 505 msgid "Video"506 msgstr ""507 508 #: admin/includes/class-meta-box.php:271509 506 #: admin/views/conditions/ad-targeting-metabox.php:18 510 507 #: classes/ad-debug.php:152 … … 514 511 msgstr "" 515 512 516 #: admin/includes/class-meta-box.php:27 2513 #: admin/includes/class-meta-box.php:271 517 514 #: admin/views/conditions/ad-targeting-metabox.php:37 518 515 #: classes/ad-debug.php:239 … … 522 519 msgstr "" 523 520 524 #: admin/includes/class-meta-box.php:30 4521 #: admin/includes/class-meta-box.php:303 525 522 #: admin/includes/class-overview-widgets.php:64 526 523 #: views/admin/page-bulk-edit.php:20 … … 529 526 msgstr "" 530 527 531 #: admin/includes/class-meta-box.php:46 6528 #: admin/includes/class-meta-box.php:465 532 529 msgid "Ad Settings" 533 530 msgstr "" 534 531 535 532 #. translators: %1$d is the number of ads, %2$s and %3$s are URLs. 536 #: admin/includes/class-meta-box.php:58 1533 #: admin/includes/class-meta-box.php:580 537 534 msgid "%1$d ads – <a href=\"%2$s\">manage</a> - <a href=\"%3$s\">new</a>" 538 535 msgstr "" 539 536 540 #: admin/includes/class-meta-box.php:59 4537 #: admin/includes/class-meta-box.php:593 541 538 msgid "Get the tutorial via email" 542 539 msgstr "" 543 540 544 #: admin/includes/class-meta-box.php:60 3541 #: admin/includes/class-meta-box.php:602 545 542 msgid "Get AdSense tips via email" 546 543 msgstr "" 547 544 548 #: admin/includes/class-meta-box.php:61 2545 #: admin/includes/class-meta-box.php:611 549 546 msgid "Visit our blog for more articles about ad optimization" 550 547 msgstr "" 551 548 552 549 #. translators: %s is our URL. 553 #: admin/includes/class-meta-box.php:66 7550 #: admin/includes/class-meta-box.php:666 554 551 msgid "Latest posts on wpadvancedads.com" 555 552 msgstr "" … … 585 582 #: admin/views/notices/welcome-panel.php:15 586 583 #: admin/views/placements-item.php:68 587 #: includes/admin/class-assets.php: 71584 #: includes/admin/class-assets.php:69 588 585 #: views/admin/tables/groups/list-row-loop-none.php:17 589 586 #: views/admin/tables/groups/list-row-option-ads.php:61 … … 744 741 #: admin/includes/class-overview-widgets.php:627 745 742 #: admin/includes/class-overview-widgets.php:645 746 #: classes/ad_group.php:65 0743 #: classes/ad_group.php:654 747 744 msgid "Activate now" 748 745 msgstr "" … … 778 775 779 776 #: admin/includes/class-overview-widgets.php:733 780 #: classes/ad_group.php:65 3777 #: classes/ad_group.php:657 781 778 msgid "Get this add-on" 782 779 msgstr "" … … 823 820 824 821 #: admin/includes/class-settings.php:178 825 #: classes/in-content-injector.php:6 09822 #: classes/in-content-injector.php:611 826 823 msgid "Disable level limitation" 827 824 msgstr "" … … 1703 1700 1704 1701 #: admin/views/settings/general/block-bots.php:11 1705 #: classes/frontend_checks.php:13 81702 #: classes/frontend_checks.php:137 1706 1703 msgid "You look like a bot" 1707 1704 msgstr "" … … 2078 2075 2079 2076 #. translators: %1$s is an URL, %2$s is a URL text 2080 #: classes/ad_group.php:6 592077 #: classes/ad_group.php:663 2081 2078 msgid "It seems that a caching plugin is activated. Your ads might not rotate properly. The cache busting in Advanced Ads Pro will solve that. <a href=\"%1$s\" target=\"_blank\">%2$s.</a>" 2082 2079 msgstr "" … … 2384 2381 #: classes/display-conditions.php:318 2385 2382 #: classes/visitor-conditions.php:317 2386 #: includes/admin/class-assets.php:8 42383 #: includes/admin/class-assets.php:82 2387 2384 #: modules/gadsense/admin/views/external-ads-links.php:17 2388 2385 #: modules/gadsense/admin/views/external-ads-links.php:22 … … 2393 2390 #: classes/display-conditions.php:318 2394 2391 #: classes/visitor-conditions.php:317 2395 #: includes/admin/class-assets.php:8 52392 #: includes/admin/class-assets.php:83 2396 2393 msgid "and" 2397 2394 msgstr "" … … 2564 2561 msgstr "" 2565 2562 2566 #: classes/frontend_checks.php:12 32563 #: classes/frontend_checks.php:122 2567 2564 msgid "Random AdSense ads" 2568 2565 msgstr "" 2569 2566 2570 #: classes/frontend_checks.php:15 22567 #: classes/frontend_checks.php:151 2571 2568 msgid "Ad blocker enabled" 2572 2569 msgstr "" 2573 2570 2574 #: classes/frontend_checks.php:16 42571 #: classes/frontend_checks.php:163 2575 2572 msgid "<em>%s</em> filter does not exist" 2576 2573 msgstr "" 2577 2574 2578 #: classes/frontend_checks.php:1 802575 #: classes/frontend_checks.php:179 2579 2576 msgid "Ads are disabled in the content of this page" 2580 2577 msgstr "" 2581 2578 2582 #: classes/frontend_checks.php:19 22579 #: classes/frontend_checks.php:191 2583 2580 msgid "the current post ID is 0 " 2584 2581 msgstr "" 2585 2582 2586 #: classes/frontend_checks.php:21 12583 #: classes/frontend_checks.php:210 2587 2584 msgid "Ads are disabled on this page" 2588 2585 msgstr "" 2589 2586 2590 #: classes/frontend_checks.php:22 52587 #: classes/frontend_checks.php:224 2591 2588 msgid "Ads are disabled on all pages" 2592 2589 msgstr "" 2593 2590 2594 #: classes/frontend_checks.php:2 402591 #: classes/frontend_checks.php:239 2595 2592 msgid "Ads are disabled on 404 pages" 2596 2593 msgstr "" 2597 2594 2598 #: classes/frontend_checks.php:25 42595 #: classes/frontend_checks.php:253 2599 2596 msgid "Ads are disabled on non singular pages" 2600 2597 msgstr "" 2601 2598 2602 #: classes/frontend_checks.php:26 82599 #: classes/frontend_checks.php:267 2603 2600 msgid "Ad IDs: %s" 2604 2601 msgstr "" 2605 2602 2603 #: classes/frontend_checks.php:295 2604 msgid "AdSense violation" 2605 msgstr "" 2606 2606 2607 #: classes/frontend_checks.php:296 2607 msgid "Ad Sense violation"2608 msgid "Ad is hidden" 2608 2609 msgstr "" 2609 2610 2610 2611 #: classes/frontend_checks.php:297 2611 msgid "Ad is hidden"2612 msgstr ""2613 2614 #: classes/frontend_checks.php:2982615 2612 msgid "IDs: %s" 2616 2613 msgstr "" 2617 2614 2618 #: classes/frontend_checks.php:31 42615 #: classes/frontend_checks.php:313 2619 2616 msgid "The following responsive AdSense ads are not showing up: %s" 2620 2617 msgstr "" 2621 2618 2622 #: classes/frontend_checks.php:33 12619 #: classes/frontend_checks.php:330 2623 2620 msgid "Consent not given" 2624 2621 msgstr "" 2625 2622 2626 #: classes/frontend_checks.php:34 82623 #: classes/frontend_checks.php:347 2627 2624 msgid "Enable TCF integration" 2628 2625 msgstr "" 2629 2626 2630 #: classes/frontend_checks.php:36 32627 #: classes/frontend_checks.php:362 2631 2628 msgid "Debug Google Ad Manager" 2632 2629 msgstr "" 2633 2630 2634 #: classes/frontend_checks.php:3 802631 #: classes/frontend_checks.php:379 2635 2632 msgid "highlight ads" 2636 2633 msgstr "" 2637 2634 2638 #: classes/frontend_checks.php: 5002635 #: classes/frontend_checks.php:499 2639 2636 msgid "Ad Health" 2640 2637 msgstr "" 2641 2638 2642 #: classes/frontend_checks.php:51 52639 #: classes/frontend_checks.php:514 2643 2640 msgid "Show %d more notifications" 2644 2641 msgstr "" 2645 2642 2646 #: classes/frontend_checks.php:53 42643 #: classes/frontend_checks.php:533 2647 2644 msgid "Everything is fine" 2648 2645 msgstr "" 2649 2646 2650 #: classes/frontend_checks.php:60 52647 #: classes/frontend_checks.php:604 2651 2648 msgid "the following code is used for automatic error detection and only visible to admins" 2652 2649 msgstr "" 2653 2650 2654 2651 #. translators: %s stands for the name of the "Disable level limitation" option and automatically translated as well 2655 #: classes/in-content-injector.php:6 082652 #: classes/in-content-injector.php:610 2656 2653 msgid "Set <em>%s</em> to show more ads" 2657 2654 msgstr "" … … 2761 2758 msgstr "" 2762 2759 2760 #: includes/admin/class-assets.php:84 2761 msgid "After which paragraph?" 2762 msgstr "" 2763 2763 2764 #: includes/admin/class-assets.php:86 2764 msgid "After which paragraph?"2765 msgstr ""2766 2767 #: includes/admin/class-assets.php:882768 2765 #: modules/gadsense/includes/class-adsense-report.php:159 2769 2766 msgid "Today" 2770 2767 msgstr "" 2771 2768 2772 #: includes/admin/class-assets.php:8 92769 #: includes/admin/class-assets.php:87 2773 2770 #: modules/gadsense/includes/class-adsense-report.php:160 2774 2771 msgid "Yesterday" 2775 2772 msgstr "" 2776 2773 2777 #: includes/admin/class-assets.php: 902774 #: includes/admin/class-assets.php:88 2778 2775 #: modules/gadsense/includes/class-adsense-report.php:163 2779 2776 msgid "This Month" … … 2781 2778 2782 2779 #. translators: 1: The number of days. 2783 #: includes/admin/class-assets.php:9 22780 #: includes/admin/class-assets.php:90 2784 2781 #: modules/gadsense/includes/class-adsense-report.php:162 2785 2782 #: modules/gadsense/includes/class-adsense-report.php:165 … … 2788 2785 2789 2786 #. translators: 1: An error message. 2790 #: includes/admin/class-assets.php:9 42787 #: includes/admin/class-assets.php:92 2791 2788 msgid "An error occurred: %1$s" 2792 2789 msgstr "" 2793 2790 2794 #: includes/admin/class-assets.php:9 52791 #: includes/admin/class-assets.php:93 2795 2792 #: modules/gadsense/admin/views/adsense-report.php:24 2796 2793 msgid "All" 2797 2794 msgstr "" 2798 2795 2796 #: includes/admin/class-assets.php:94 2797 msgid "There were no results returned for this ad. Please make sure it is active, generating impressions and double check your ad parameters." 2798 msgstr "" 2799 2800 #: includes/admin/class-assets.php:95 2801 msgid "Show inactive ads" 2802 msgstr "" 2803 2799 2804 #: includes/admin/class-assets.php:96 2800 msgid "There were no results returned for this ad. Please make sure it is active, generating impressions and double check your ad parameters." 2801 msgstr "" 2802 2803 #: includes/admin/class-assets.php:97 2804 msgid "Show inactive ads" 2805 msgid "Hide inactive ads" 2805 2806 msgstr "" 2806 2807 2807 2808 #: includes/admin/class-assets.php:98 2808 msgid "Hide inactive ads" 2809 msgid "Permanently delete this placement?" 2810 msgstr "" 2811 2812 #: includes/admin/class-assets.php:99 2813 msgid "Close" 2809 2814 msgstr "" 2810 2815 2811 2816 #: includes/admin/class-assets.php:100 2812 msgid "Permanently delete this placement?"2813 msgstr ""2814 2815 #: includes/admin/class-assets.php:1012816 msgid "Close"2817 msgstr ""2818 2819 #: includes/admin/class-assets.php:1022820 2817 msgid "Data you have entered has not been saved. Are you sure you want to discard your changes?" 2821 2818 msgstr "" … … 3011 3008 3012 3009 #. translators: 1: is a link to a support document. 2: closing link 3013 #: includes/class-autoloader.php:12 13010 #: includes/class-autoloader.php:128 3014 3011 msgid "Your installation of Advanced Ads is incomplete. If you installed Advanced Ads from GitHub, %1$s please refer to this document%2$s to set up your development environment." 3015 3012 msgstr "" 3016 3013 3017 3014 #. translators: %s: WP_ENVIRONMENT_TYPES 3018 #: includes/class-autoloader.php:1 543015 #: includes/class-autoloader.php:172 3019 3016 msgid "The %s constant is no longer supported." 3020 3017 msgstr "" … … 3128 3125 #: includes/groups/types/type-unknown.php:60 3129 3126 msgid "No description" 3127 msgstr "" 3128 3129 #: includes/importers/class-api-ads.php:56 3130 msgid "Ads from API" 3131 msgstr "" 3132 3133 #: includes/importers/class-api-ads.php:65 3134 msgid "For MonetizeMore clients using PubGuru, you will be able to create all of your new ads from api." 3135 msgstr "" 3136 3137 #. translators: 1: counts 2: Importer title 3138 #: includes/importers/class-api-ads.php:192 3139 msgid "%1$d ads migrated from %2$s" 3140 msgstr "" 3141 3142 #: includes/importers/class-manager.php:104 3143 msgid "History deleted successfully." 3130 3144 msgstr "" 3131 3145 … … 4138 4152 msgstr "" 4139 4153 4154 #: modules/one-click/admin/class-admin.php:60 4155 msgid "MonetizeMore & PubGuru Integration" 4156 msgstr "" 4157 4140 4158 #: modules/one-click/admin/class-admin.php:61 4141 msgid "MonetizeMore & PubGuru Integration"4142 msgstr ""4143 4144 #: modules/one-click/admin/class-admin.php:624145 4159 msgid "Enables MonetizeMore users to link their settings with the PubGuru insights & analytics dashboard." 4146 4160 msgstr "" … … 4150 4164 msgstr "" 4151 4165 4152 #: modules/one-click/admin/class-admin.php:7 44166 #: modules/one-click/admin/class-admin.php:76 4153 4167 msgid "Disconnect now" 4154 4168 msgstr "" 4155 4169 4156 #: modules/one-click/admin/class-admin.php:10 04170 #: modules/one-click/admin/class-admin.php:101 4157 4171 msgid "PubGuru OneClick Consent & Privacy Policy" 4158 4172 msgstr "" 4159 4173 4160 #: modules/one-click/admin/class-admin.php:10 24174 #: modules/one-click/admin/class-admin.php:103 4161 4175 msgid "Connecting Your With Your PubGuru Account Settings" 4162 4176 msgstr "" … … 4167 4181 4168 4182 #: modules/one-click/admin/class-ajax.php:78 4169 msgid " Pubguru successfully connected."4183 msgid "We have successfully migrated your MonetizeMore Pubguru Ad Units to your WordPress site. The existing placements and ads have been paused." 4170 4184 msgstr "" 4171 4185 … … 4174 4188 msgstr "" 4175 4189 4190 #: modules/one-click/admin/class-ajax.php:132 4176 4191 #: modules/one-click/admin/class-ajax.php:167 4177 4192 msgid "An error has occurred please try again." 4178 4193 msgstr "" 4179 4194 4180 #: modules/one-click/modules/adstxt/class-detector.php:88 4195 #: modules/one-click/admin/class-ajax.php:139 4196 msgid "File successfully backed up." 4197 msgstr "" 4198 4199 #: modules/one-click/modules/adstxt/class-detector.php:93 4181 4200 msgid "File alert!" 4182 4201 msgstr "" 4183 4202 4184 #: modules/one-click/modules/adstxt/class-detector.php: 884185 msgid "Physical ads.txt found. In order to use PubGuru service you need to delete it ."4186 msgstr "" 4187 4188 #: modules/one-click/modules/adstxt/class-detector.php:9 04189 #: modules/one-click/modules/adstxt/class-detector.php:9 14203 #: modules/one-click/modules/adstxt/class-detector.php:93 4204 msgid "Physical ads.txt found. In order to use PubGuru service you need to delete it or back it up." 4205 msgstr "" 4206 4207 #: modules/one-click/modules/adstxt/class-detector.php:96 4208 #: modules/one-click/modules/adstxt/class-detector.php:97 4190 4209 msgid "Backup the File" 4191 4210 msgstr "" 4192 4211 4193 #: modules/one-click/modules/adstxt/class-detector.php:9 04212 #: modules/one-click/modules/adstxt/class-detector.php:96 4194 4213 msgid "Backing Up" 4195 4214 msgstr "" 4196 4215 4197 #: modules/one-click/modules/adstxt/class-detector.php:9 04216 #: modules/one-click/modules/adstxt/class-detector.php:96 4198 4217 msgid "Backed Up" 4199 4218 msgstr "" … … 4369 4388 4370 4389 #. translators: %s link to privacy policy 4371 #: views/admin/metabox-pubguru-connect.php:2 14390 #: views/admin/metabox-pubguru-connect.php:23 4372 4391 msgid "This form is designed exclusively for MonetizeMore customers who wish to integrate Advanced Ads with the PubGuru Dashboard. By selecting \"Connect PGHB,\" you agree to share your domain name to facilitate the connection with your PubGuru account, in alignment with our <a href=\"%s\">Privacy Policy</a>. Rest assured, no additional information is exchanged, and Advanced Ads does not engage in any tracking activities." 4373 4392 msgstr "" 4374 4393 4375 #: views/admin/metabox-pubguru-connect.php:3 04394 #: views/admin/metabox-pubguru-connect.php:32 4376 4395 msgid "Connect PGHB" 4377 4396 msgstr "" 4378 4397 4379 #: views/admin/metabox-pubguru-connect.php:4 24398 #: views/admin/metabox-pubguru-connect.php:43 4380 4399 msgid "To activate any of the settings with your PubGuru account, please select from the options below. Should you have any inquiries, feel free to <a href=\"https://www.monetizemore.com/contact/\">click here<a/> to reach out to us or send an email to <a href=\"mailto:[email protected]\">[email protected]</a>" 4381 4400 msgstr "" 4382 4401 4383 #: views/admin/metabox-pubguru-connect.php:5 24402 #: views/admin/metabox-pubguru-connect.php:53 4384 4403 msgid "Install PubGuru Header Bidding" 4385 4404 msgstr "" 4386 4405 4387 #: views/admin/metabox-pubguru-connect.php:62 4406 #: views/admin/metabox-pubguru-connect.php:63 4407 msgid "Move the PubGuru Header Bidding script to the footer. Keep this option disabled to maximize revenue. Only enable it if PageSpeed is your priority." 4408 msgstr "" 4409 4410 #: views/admin/metabox-pubguru-connect.php:75 4411 msgid "Enable ads.txt settings from the <a href=\"https://app.pubguru.com/ads-txt\" target=\"_blank\">PubGuru platform</a>" 4412 msgstr "" 4413 4414 #: views/admin/metabox-pubguru-connect.php:94 4415 msgid "Install Traffic Cop. 7 days free trial" 4416 msgstr "" 4417 4418 #: views/admin/metabox-pubguru-connect.php:97 4419 msgid "Install Traffic Cop." 4420 msgstr "" 4421 4422 #: views/admin/metabox-pubguru-connect.php:107 4388 4423 msgid "Activate Tag Conversion" 4389 4424 msgstr "" 4390 4425 4391 #: views/admin/metabox-pubguru-connect.php:74 4392 msgid "Enable ads.txt settings from the <a href=\"https://app.pubguru.com/ads-txt\" target=\"_blank\">PubGuru platform</a>" 4393 msgstr "" 4394 4395 #: views/admin/metabox-pubguru-connect.php:93 4396 msgid "Install Traffic Cop. 7 days free trial" 4397 msgstr "" 4398 4399 #: views/admin/metabox-pubguru-connect.php:96 4400 msgid "Install Traffic Cop." 4426 #: views/admin/metabox-pubguru-connect.php:132 4427 msgid "Rollback" 4428 msgstr "" 4429 4430 #: views/admin/metabox-pubguru-connect.php:133 4431 msgid "Rollback the api changes back to previous state." 4401 4432 msgstr "" 4402 4433 -
advanced-ads/tags/1.54.0/lib/composer/autoload_classmap.php
r3134243 r3145275 55 55 'AdvancedAds\\BuildTools\\Values\\SemanticVersion' => $vendorDir . '/advanced-ads/build-tools/src/Values/SemanticVersion.php', 56 56 'AdvancedAds\\BuildTools\\Values\\Translation' => $vendorDir . '/advanced-ads/build-tools/src/Values/Translation.php', 57 'AdvancedAds\\Constants' => $baseDir . '/includes/class-constants.php', 57 58 'AdvancedAds\\Entities' => $baseDir . '/includes/class-entities.php', 58 59 'AdvancedAds\\Groups\\Manager' => $baseDir . '/includes/groups/class-manager.php', … … 62 63 'AdvancedAds\\Groups\\Types\\Standard' => $baseDir . '/includes/groups/types/type-standard.php', 63 64 'AdvancedAds\\Groups\\Types\\Unknown' => $baseDir . '/includes/groups/types/type-unknown.php', 65 'AdvancedAds\\Importers\\Api_Ads' => $baseDir . '/includes/importers/class-api-ads.php', 66 'AdvancedAds\\Importers\\Importer' => $baseDir . '/includes/importers/abstract-importer.php', 67 'AdvancedAds\\Importers\\Manager' => $baseDir . '/includes/importers/class-manager.php', 64 68 'AdvancedAds\\Installation\\Capabilities' => $baseDir . '/includes/installation/class-capabilities.php', 65 69 'AdvancedAds\\Installation\\Install' => $baseDir . '/includes/installation/class-install.php', 66 70 'AdvancedAds\\Installation\\Uninstall' => $baseDir . '/includes/installation/class-uninstall.php', 67 71 'AdvancedAds\\Interfaces\\Group_Type' => $baseDir . '/includes/interfaces/interface-group-type.php', 72 'AdvancedAds\\Interfaces\\Importer' => $baseDir . '/includes/interfaces/interface-importer.php', 68 73 'AdvancedAds\\Interfaces\\Screen_Interface' => $baseDir . '/includes/interfaces/interface-screen.php', 69 74 'AdvancedAds\\Modules\\OneClick\\Admin\\Admin' => $baseDir . '/modules/one-click/admin/class-admin.php', … … 71 76 'AdvancedAds\\Modules\\OneClick\\AdsTxt\\AdsTxt' => $baseDir . '/modules/one-click/modules/adstxt/class-adstxt.php', 72 77 'AdvancedAds\\Modules\\OneClick\\AdsTxt\\Detector' => $baseDir . '/modules/one-click/modules/adstxt/class-detector.php', 73 'AdvancedAds\\Modules\\OneClick\\Auto_Ads' => $baseDir . '/modules/one-click/modules/class-auto-ads.php',74 78 'AdvancedAds\\Modules\\OneClick\\Header_Bidding' => $baseDir . '/modules/one-click/modules/class-header-bidding.php', 75 79 'AdvancedAds\\Modules\\OneClick\\Helpers' => $baseDir . '/modules/one-click/class-helpers.php', -
advanced-ads/tags/1.54.0/lib/composer/autoload_static.php
r3134243 r3145275 85 85 'AdvancedAds\\BuildTools\\Values\\SemanticVersion' => __DIR__ . '/..' . '/advanced-ads/build-tools/src/Values/SemanticVersion.php', 86 86 'AdvancedAds\\BuildTools\\Values\\Translation' => __DIR__ . '/..' . '/advanced-ads/build-tools/src/Values/Translation.php', 87 'AdvancedAds\\Constants' => __DIR__ . '/../..' . '/includes/class-constants.php', 87 88 'AdvancedAds\\Entities' => __DIR__ . '/../..' . '/includes/class-entities.php', 88 89 'AdvancedAds\\Groups\\Manager' => __DIR__ . '/../..' . '/includes/groups/class-manager.php', … … 92 93 'AdvancedAds\\Groups\\Types\\Standard' => __DIR__ . '/../..' . '/includes/groups/types/type-standard.php', 93 94 'AdvancedAds\\Groups\\Types\\Unknown' => __DIR__ . '/../..' . '/includes/groups/types/type-unknown.php', 95 'AdvancedAds\\Importers\\Api_Ads' => __DIR__ . '/../..' . '/includes/importers/class-api-ads.php', 96 'AdvancedAds\\Importers\\Importer' => __DIR__ . '/../..' . '/includes/importers/abstract-importer.php', 97 'AdvancedAds\\Importers\\Manager' => __DIR__ . '/../..' . '/includes/importers/class-manager.php', 94 98 'AdvancedAds\\Installation\\Capabilities' => __DIR__ . '/../..' . '/includes/installation/class-capabilities.php', 95 99 'AdvancedAds\\Installation\\Install' => __DIR__ . '/../..' . '/includes/installation/class-install.php', 96 100 'AdvancedAds\\Installation\\Uninstall' => __DIR__ . '/../..' . '/includes/installation/class-uninstall.php', 97 101 'AdvancedAds\\Interfaces\\Group_Type' => __DIR__ . '/../..' . '/includes/interfaces/interface-group-type.php', 102 'AdvancedAds\\Interfaces\\Importer' => __DIR__ . '/../..' . '/includes/interfaces/interface-importer.php', 98 103 'AdvancedAds\\Interfaces\\Screen_Interface' => __DIR__ . '/../..' . '/includes/interfaces/interface-screen.php', 99 104 'AdvancedAds\\Modules\\OneClick\\Admin\\Admin' => __DIR__ . '/../..' . '/modules/one-click/admin/class-admin.php', … … 101 106 'AdvancedAds\\Modules\\OneClick\\AdsTxt\\AdsTxt' => __DIR__ . '/../..' . '/modules/one-click/modules/adstxt/class-adstxt.php', 102 107 'AdvancedAds\\Modules\\OneClick\\AdsTxt\\Detector' => __DIR__ . '/../..' . '/modules/one-click/modules/adstxt/class-detector.php', 103 'AdvancedAds\\Modules\\OneClick\\Auto_Ads' => __DIR__ . '/../..' . '/modules/one-click/modules/class-auto-ads.php',104 108 'AdvancedAds\\Modules\\OneClick\\Header_Bidding' => __DIR__ . '/../..' . '/modules/one-click/modules/class-header-bidding.php', 105 109 'AdvancedAds\\Modules\\OneClick\\Helpers' => __DIR__ . '/../..' . '/modules/one-click/class-helpers.php', -
advanced-ads/tags/1.54.0/modules/one-click/admin/class-admin.php
r3041809 r3145275 10 10 namespace AdvancedAds\Modules\OneClick\Admin; 11 11 12 use AdvancedAds\Assets_Registry;13 12 use AdvancedAds\Utilities\Conditional; 14 13 use AdvancedAds\Modules\OneClick\Helpers; … … 44 43 } 45 44 46 Assets_Registry::enqueue_style( 'app' );47 Assets_Registry::enqueue_script( 'app' );45 wp_advads()->registry->enqueue_style( 'app' ); 46 wp_advads()->registry->enqueue_script( 'app' ); 48 47 } 49 48 … … 63 62 'order' => 1000, 64 63 'link' => '#', 64 'icon' => ADVADS_BASE_URL . 'assets/img/add-ons/aa-addons-icons-m2pg.svg', 65 65 ]; 66 66 67 67 $addons['monetizemore-connect'] = $defaults + [ 68 'class' => 'js-m2-show-consent', 69 'link_title' => __( 'Connect now', 'advanced-ads' ), 68 'class' => 'js-pubguru-connect', 69 'link_title' => __( 'Connect now', 'advanced-ads' ), 70 'link_icon' => 'dashicons-plus', 71 'link_primary' => true, 70 72 ]; 71 73 … … 73 75 'class' => 'js-pubguru-disconnect', 74 76 'link_title' => __( 'Disconnect now', 'advanced-ads' ), 77 'link_icon' => 'dashicons-dismiss', 75 78 ]; 76 79 77 if ( $is_connected ) { 78 $addons['monetizemore-connect']['class'] .= ' hidden'; 79 } else { 80 $addons['monetizemore-disconnect']['class'] .= ' hidden'; 81 } 80 $key = $is_connected ? 'monetizemore-connect' : 'monetizemore-disconnect'; 81 82 $addons[ $key ]['class'] .= ' hidden'; 82 83 83 84 return $addons; … … 111 112 </div> 112 113 </div> 114 <div id="pubguru-notices"></div> 113 115 114 116 <?php -
advanced-ads/tags/1.54.0/modules/one-click/admin/class-ajax.php
r3041809 r3145275 14 14 use AdvancedAds\Modules\OneClick\Helpers; 15 15 use AdvancedAds\Modules\OneClick\Options; 16 use AdvancedAds\Framework\Utilities\Params; 16 17 use AdvancedAds\Modules\OneClick\AdsTxt\Detector; 17 use AdvancedAds\Framework\Utilities\Params;18 18 use AdvancedAds\Framework\Interfaces\Integration_Interface; 19 19 … … 76 76 wp_send_json_success( 77 77 [ 78 'message' => esc_html__( ' Pubguru successfully connected.', 'advanced-ads' ),78 'message' => esc_html__( 'We have successfully migrated your MonetizeMore Pubguru Ad Units to your WordPress site. The existing placements and ads have been paused.', 'advanced-ads' ), 79 79 'hasTrafficCop' => Helpers::has_traffic_cop( $config ), 80 80 ] … … 107 107 check_ajax_referer( 'pubguru_module_changed', 'security' ); 108 108 109 $module = Params::post( 'module', [] ); 110 $status = Params::post( 'status', false, FILTER_VALIDATE_BOOLEAN ); 111 $option_key = 'pubguru_module_' . $module; 109 $module = Params::post( 'module', [] ); 110 $status = Params::post( 'status', false, FILTER_VALIDATE_BOOLEAN ); 112 111 113 update_option( $option_key, $status );112 Options::module( $module, $status ); 114 113 115 do_action( 'pubguru_module_status_changed', $module, $status );114 $data = apply_filters( 'pubguru_module_status_changed', [], $module, $status ); 116 115 117 $notice = ''; 118 119 if ( 'ads_txt' === $module && $status ) { 120 $detector = new Detector(); 121 if ( $detector->detect_files() ) { 122 ob_start(); 123 $detector->show_notice(); 124 $notice = ob_get_clean(); 125 } 126 } 127 128 wp_send_json_success( [ 'notice' => $notice ] ); 116 wp_send_json_success( $data ); 129 117 } 130 118 … … 137 125 check_ajax_referer( 'pubguru_backup_adstxt', 'security' ); 138 126 139 ( new Detector() )->backup_file(); 127 $notice = ''; 128 $result = ( new Detector() )->backup_file(); 129 if ( false === $result ) { 130 $notice = sprintf( 131 '<div class="notice notice-error flex items-center p-4">%s</div>', 132 esc_html__( 'An error has occurred please try again.', 'advanced-ads' ) 133 ); 134 wp_send_json_error( $notice ); 135 } 140 136 141 wp_send_json_success(); 137 $notice = sprintf( 138 '<div class="notice notice-success flex items-center p-4">%s</div>', 139 esc_html__( 'File successfully backed up.', 'advanced-ads' ) 140 ); 141 wp_send_json_success( $notice ); 142 142 } 143 143 -
advanced-ads/tags/1.54.0/modules/one-click/class-helpers.php
r3041809 r3145275 10 10 namespace AdvancedAds\Modules\OneClick; 11 11 12 use AdvancedAds\ Utilities\Str;12 use AdvancedAds\Constants; 13 13 use AdvancedAds\Utilities\WordPress; 14 use AdvancedAds\Framework\Utilities\Str; 14 15 15 16 defined( 'ABSPATH' ) || exit; … … 19 20 */ 20 21 class Helpers { 21 22 /**23 * Is module enabled.24 *25 * @param string $name name of module.26 *27 * @return bool28 */29 public static function is_module_enabled( $name ): bool {30 return boolval( get_option( "pubguru_module_{$name}" ) );31 }32 22 33 23 /** … … 96 86 97 87 foreach ( $configs['configs'] as $config ) { 98 if ( Str:: str_contains( $needle, $config['name'] ) ) {88 if ( Str::contains( $needle, $config['name'] ) ) { 99 89 return $config['name']; 100 90 } … … 112 102 $ads = self::get_ads_from_config(); 113 103 114 if ( $ads && ! wp_next_scheduled( 'advanced-ads-pghb-auto-ad-creation') ) {115 wp_schedule_single_event( current_datetime()->getTimestamp() + MINUTE_IN_SECONDS, 'advanced-ads-pghb-auto-ad-creation');104 if ( $ads && ! wp_next_scheduled( Constants::CRON_API_ADS_CREATION ) ) { 105 wp_schedule_single_event( current_datetime()->getTimestamp() + 5, Constants::CRON_API_ADS_CREATION ); 116 106 } 117 107 } … … 140 130 } 141 131 } 132 } else { 133 $domain = WordPress::get_site_domain(); 134 $pubguru_config_ads = [ 135 $domain . '_leaderboard' => [ 136 'ad_unit' => $domain . '_leaderboard', 137 'slot' => $domain . '_leaderboard', 138 'device' => 'All', 139 'placement' => 'Before Content', 140 'placement_conditions' => 'All', 141 'in_content_position' => 'Before', 142 'in_content_count' => 1, 143 'in_content_element' => 'p', 144 'in_content_repeat' => false, 145 ], 146 $domain . '_in_content_1' => [ 147 'ad_unit' => $domain . '_in_content_1', 148 'slot' => $domain . '_in_content_1', 149 'device' => 'All', 150 'placement' => 'Before Content', 151 'placement_conditions' => 'All', 152 'in_content_position' => 'Before', 153 'in_content_count' => 1, 154 'in_content_element' => 'p', 155 'in_content_repeat' => false, 156 ], 157 $domain . '_in_content_2' => [ 158 'ad_unit' => $domain . '_in_content_2', 159 'slot' => $domain . '_in_content_2', 160 'device' => 'All', 161 'placement' => 'After Content', 162 'placement_conditions' => 'All', 163 'in_content_position' => 'Aefore', 164 'in_content_count' => 3, 165 'in_content_element' => 'p', 166 'in_content_repeat' => true, 167 ], 168 ]; 142 169 } 143 170 … … 155 182 global $post; 156 183 184 if ( ! $post ) { 185 return false; 186 } 187 157 188 if ( ! $post_id ) { 158 189 $post_id = $post->ID; -
advanced-ads/tags/1.54.0/modules/one-click/class-options.php
r3041809 r3145275 37 37 return update_option( self::CONFIG_KEY, $data ); 38 38 } 39 40 /** 41 * Read and Write pubguru module status 42 * 43 * @param string $module Module name. 44 * @param bool $status Module status. 45 * 46 * @return bool 47 */ 48 public static function module( $module, $status = null ): bool { 49 $option_key = 'pubguru_module_' . $module; 50 51 if ( null === $status ) { 52 return boolval( get_option( $option_key, false ) ); 53 } 54 55 update_option( $option_key, $status ); 56 57 return $status; 58 } 39 59 } -
advanced-ads/tags/1.54.0/modules/one-click/modules/adstxt/class-adstxt.php
r3041809 r3145275 12 12 use AdvancedAds\Utilities\WordPress; 13 13 use AdvancedAds\Framework\Interfaces\Integration_Interface; 14 use AdvancedAds\Framework\Utilities\Params; 15 use AdvancedAds\Framework\Utilities\Str; 14 16 15 17 defined( 'ABSPATH' ) || exit; … … 28 30 remove_action( 'advanced-ads-plugin-loaded', 'advanced_ads_ads_txt_init' ); 29 31 30 add_action( 'init', [ $this, 'add_rewrite_rules' ] );31 add_filter( 'query_vars', [ $this, 'add_query_vars' ] );32 32 add_action( 'template_redirect', [ $this, 'handle_redirect' ] ); 33 33 add_filter( 'allowed_redirect_hosts', [ $this, 'allowed_redirect_hosts' ] ); 34 35 if ( is_admin() ) {36 ( new Detector() )->hooks();37 }38 }39 40 /**41 * Add rewrite rules42 *43 * @return void44 */45 public function add_rewrite_rules(): void {46 global $wp_rewrite;47 48 if ( ! $wp_rewrite->using_permalinks() ) {49 return;50 }51 52 add_rewrite_rule( 'ads\.txt$', $wp_rewrite->index . '?adstxt=1', 'top' );53 }54 55 /**56 * Add query var57 *58 * @param array $vars Array to hold query variables.59 *60 * @return array61 */62 public function add_query_vars( $vars ): array {63 $vars[] = 'adstxt';64 return $vars;65 34 } 66 35 … … 71 40 */ 72 41 public function handle_redirect(): void { 73 if ( empty( get_query_var( 'adstxt' ) ) ) { 42 if ( 43 'ads-txt' !== get_query_var( 'name' ) || 44 Str::contains( Params::server( 'REQUEST_URI' ), 'ads.txt' ) 45 ) { 74 46 return; 75 47 } 76 48 77 $redirect = sprintf( 'https://adstxt.pubguru.net/ %s/ads.txt', WordPress::get_site_domain() );49 $redirect = sprintf( 'https://adstxt.pubguru.net/pg/%s/ads.txt', WordPress::get_site_domain() ); 78 50 wp_safe_redirect( $redirect, 301 ); 79 51 exit; -
advanced-ads/tags/1.54.0/modules/one-click/modules/adstxt/class-detector.php
r3041809 r3145275 40 40 41 41 if ( $this->detect_files() ) { 42 add_action( ' pubguru_notices', [ $this, 'show_notice' ] );42 add_action( 'all_admin_notices', [ $this, 'show_notice' ] ); 43 43 } 44 44 } … … 47 47 * Detect file exists 48 48 * 49 * @param string $file file name. 50 * 49 51 * @return bool 50 52 */ 51 public function detect_files( ): bool {53 public function detect_files( $file = 'ads.txt' ): bool { 52 54 $wp_filesystem = $this->get_filesystem(); 53 55 if ( null === $wp_filesystem ) { … … 55 57 } 56 58 57 return $wp_filesystem->exists( ABSPATH . '/ ads.txt');59 return $wp_filesystem->exists( ABSPATH . '/' . $file ); 58 60 } 59 61 … … 64 66 */ 65 67 public function backup_file(): bool { 66 $ wp_filesystem = $this->get_filesystem();67 if ( null === $wp_filesystem ) {68 return false;69 }68 $source = ABSPATH . '/ads.txt'; 69 $destination = $source . '.bak'; 70 return $this->move_file( $source, $destination ); 71 } 70 72 71 return $wp_filesystem->move( ABSPATH . '/ads.txt', ABSPATH . '/ads.txt.bak' ); 73 /** 74 * Revert file 75 * 76 * @return bool 77 */ 78 public function revert_file(): bool { 79 $source = ABSPATH . '/ads.txt.bak'; 80 $destination = ABSPATH . 'ads.txt'; 81 return $this->move_file( $source, $destination ); 72 82 } 73 83 … … 79 89 public function show_notice(): void { 80 90 ?> 81 <div class=" flex shadow-lg rounded">82 <div class="bg-red-600 p-3 rounded-l flex items-center">83 <s vg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" class="fill-current text-white w-5" viewBox="0 0 32 32" aria-hidden="true"><path d="M2,16H2A14,14,0,1,0,16,2,14,14,0,0,0,2,16Zm23.15,7.75L8.25,6.85a12,12,0,0,1,16.9,16.9ZM8.24,25.16A12,12,0,0,1,6.84,8.27L23.73,25.16a12,12,0,0,1-15.49,0Z"></path><title>Error</title></svg>91 <div class="notice notice-error flex items-center p-4"> 92 <div> 93 <strong><?php esc_html_e( 'File alert!', 'advanced-ads' ); ?></strong> <?php esc_html_e( 'Physical ads.txt found. In order to use PubGuru service you need to delete it or back it up.', 'advanced-ads' ); ?> 84 94 </div> 85 95 86 <div class="p-3 bg-white rounded-r w-full flex justify-between items-center"> 87 <div> 88 <span class="font-medium"><?php esc_html_e( 'File alert!', 'advanced-ads' ); ?></span> <?php esc_html_e( 'Physical ads.txt found. In order to use PubGuru service you need to delete it.', 'advanced-ads' ); ?> 89 </div> 90 <button class="js-btn-backup-adstxt px-3 py-2 rounded text-xs bg-blue-600 text-white hover:bg-blue-700" data-text="<?php esc_attr_e( 'Backup the File', 'advanced-ads' ); ?>" data-loading="<?php esc_attr_e( 'Backing Up', 'advanced-ads' ); ?>" data-done="<?php esc_attr_e( 'Backed Up', 'advanced-ads' ); ?>" data-security="<?php echo wp_create_nonce( 'pubguru_backup_adstxt' ); // phpcs:ignore ?>"> 91 <?php esc_html_e( 'Backup the File', 'advanced-ads' ); ?> 92 </button> 93 </div> 96 <button class="!ml-auto button button-primary js-btn-backup-adstxt" data-text="<?php esc_attr_e( 'Backup the File', 'advanced-ads' ); ?>" data-loading="<?php esc_attr_e( 'Backing Up', 'advanced-ads' ); ?>" data-done="<?php esc_attr_e( 'Backed Up', 'advanced-ads' ); ?>" data-security="<?php echo wp_create_nonce( 'pubguru_backup_adstxt' ); // phpcs:ignore ?>"> 97 <?php esc_html_e( 'Backup the File', 'advanced-ads' ); ?> 98 </button> 94 99 </div> 95 100 <?php … … 101 106 * @return object 102 107 */ 103 p ublicfunction get_filesystem() {108 private function get_filesystem() { 104 109 global $wp_filesystem; 105 110 … … 111 116 return $wp_filesystem; 112 117 } 118 119 /** 120 * Handle file operations (backup or revert) 121 * 122 * @param string $source Source file path. 123 * @param string $destination Destination file path. 124 * 125 * @return bool 126 */ 127 private function move_file( string $source, string $destination ): bool { 128 $wp_filesystem = $this->get_filesystem(); 129 130 if ( null === $wp_filesystem || ! $wp_filesystem->is_writable( $source ) ) { 131 return false; 132 } 133 134 return $wp_filesystem->move( $source, $destination ); 135 } 113 136 } -
advanced-ads/tags/1.54.0/modules/one-click/modules/class-header-bidding.php
r3041809 r3145275 10 10 namespace AdvancedAds\Modules\OneClick; 11 11 12 use AdvancedAds\ Utilities\Str;12 use AdvancedAds\Framework\Utilities\Str; 13 13 use AdvancedAds\Framework\Interfaces\Integration_Interface; 14 14 … … 19 19 */ 20 20 class Header_Bidding implements Integration_Interface { 21 22 /**23 * Check if has gpt24 *25 * @var bool26 */27 private $has_gpt = false;28 29 /**30 * Check if has pubguru tag31 *32 * @var bool33 */34 private $has_pubguru = false;35 36 /**37 * Check if has traffic cop atq38 *39 * @var bool40 */41 private $has_traffic_cop = false;42 21 43 22 /** … … 72 51 public function remove_tags( $script ): string { 73 52 74 if ( Str::str_contains( '/gpt.js', $script ) ) { 75 $script = ''; 76 $this->has_gpt = true; 53 if ( Str::contains( '/gpt.js', $script ) ) { 54 $script = ''; 77 55 } 78 56 79 if ( Str::str_contains( '//m2d.m2.ai/', $script ) || Str::str_contains( '//c.pubguru.net/', $script ) ) { 80 $script = ''; 81 $this->has_gpt = true; 82 $this->has_pubguru = true; 57 if ( Str::contains( '//m2d.m2.ai/', $script ) || Str::contains( '//c.pubguru.net/', $script ) ) { 58 $script = ''; 83 59 } 84 60 85 if ( Str::str_contains( 'window.pg.atq = window.pg.atq || [];', $script ) ) { 86 $script = ''; 87 $this->has_traffic_cop = true; 61 if ( Str::contains( 'window.pg.atq = window.pg.atq || [];', $script ) ) { 62 $script = ''; 88 63 } 89 64 … … 99 74 */ 100 75 private function add_script_tag( $page ): string { 101 $name = Helpers::get_config_file(); 76 $name = Helpers::get_config_file(); 77 $at_body = Options::module( 'header_bidding_at_body' ); 102 78 103 79 if ( $name ) { 104 $script = [ '<head>' ]; 105 106 if ( $this->has_gpt ) { 107 $script[] = '<script src="https://securepubads.g.doubleclick.net/tag/js/gpt.js" async></script>'; // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript 108 $script[] = '<script type="text/javascript">window.googletag=window.googletag||{};window.googletag.cmd=window.googletag.cmd||[];'; 109 $script[] = 'window.googletag.cmd.push(function(){window.__onpageGptEmbed=(new Date()).getTime()})</script>'; 80 $script = []; 81 if ( ! $at_body ) { 82 $script[] = '<head>'; 110 83 } 111 84 112 if ( $this->has_pubguru ) { 113 $script[] = sprintf( '<script src="//c.pubguru.net/%s" async> </script>', $name ); // phpcs:ignore 114 } 85 $script[] = '<script src="https://securepubads.g.doubleclick.net/tag/js/gpt.js" async></script>'; // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript 86 $script[] = '<script type="text/javascript">window.googletag=window.googletag||{};window.googletag.cmd=window.googletag.cmd||[];'; 87 $script[] = 'window.googletag.cmd.push(function(){window.__onpageGptEmbed=(new Date()).getTime()})</script>'; 88 $script[] = sprintf( '<script src="//c.pubguru.net/%s" async> </script>', $name ); // phpcs:ignore 115 89 116 if ( Helpers::is_module_enabled( 'traffic_cop' ) && Helpers::has_traffic_cop() && $this->has_traffic_cop) {90 if ( Options::module( 'traffic_cop' ) && Helpers::has_traffic_cop() ) { 117 91 $script[] = '<script>window.pg = window.pg || {};window.pg.atq = window.pg.atq || [];</script>'; 118 92 } 119 93 120 $page = str_replace( '<head>', join( "\n", $script ), $page ); 94 if ( $at_body ) { 95 $page = $page . join( "\n", $script ); 96 } else { 97 $page = str_replace( 98 '<head>', 99 join( "\n", $script ), 100 $page 101 ); 102 } 121 103 } 122 104 -
advanced-ads/tags/1.54.0/modules/one-click/modules/class-traffic-cop.php
r3041809 r3145275 10 10 namespace AdvancedAds\Modules\OneClick; 11 11 12 use AdvancedAds\ Utilities\Str;12 use AdvancedAds\Framework\Utilities\Str; 13 13 use AdvancedAds\Framework\Interfaces\Integration_Interface; 14 14 … … 38 38 public function modify_script_tag( $content ) { 39 39 // Early bail!! 40 if ( ! Str:: str_contains( 'googletag.display', $content ) ) {40 if ( ! Str::contains( 'googletag.display', $content ) ) { 41 41 return false; 42 42 } -
advanced-ads/tags/1.54.0/modules/one-click/modules/class-workflow.php
r3041809 r3145275 10 10 namespace AdvancedAds\Modules\OneClick; 11 11 12 use AdvancedAds\Constants; 13 use AdvancedAds\Importers\Api_Ads; 12 14 use AdvancedAds\Modules\OneClick\Helpers; 13 15 use AdvancedAds\Modules\OneClick\Options; 16 use AdvancedAds\Framework\Utilities\Params; 17 use AdvancedAds\Modules\OneClick\Traffic_Cop; 18 use AdvancedAds\Modules\OneClick\AdsTxt\AdsTxt; 19 use AdvancedAds\Modules\OneClick\AdsTxt\Detector; 14 20 use AdvancedAds\Framework\Interfaces\Integration_Interface; 15 use AdvancedAds\Framework\Utilities\Params;16 use AdvancedAds\Modules\OneClick\AdsTxt\AdsTxt;17 use AdvancedAds\Modules\OneClick\Traffic_Cop;18 21 19 22 defined( 'ABSPATH' ) || exit; … … 38 41 public function hooks(): void { 39 42 add_action( 'init', [ $this, 'flush_rewrite_rules' ], 999 ); 40 add_ action( 'pubguru_module_status_changed', [ $this, 'module_status_changed' ], 10, 1);41 add_action( 'advanced-ads-pghb-auto-ad-creation', [ $this, 'auto_ad_creation' ], 10, 0 );43 add_filter( 'pubguru_module_status_changed', [ $this, 'module_status_changed' ], 10, 3 ); 44 add_action( Constants::CRON_API_ADS_CREATION, [ $this, 'auto_ad_creation' ], 10, 0 ); 42 45 43 46 if ( false !== Options::pubguru_config() && ! is_admin() ) { 44 47 add_action( 'wp', [ $this, 'init' ] ); 45 48 46 if ( Helpers::is_module_enabled( 'ads_txt' ) ) {49 if ( Options::module( 'ads_txt' ) ) { 47 50 ( new AdsTxt() )->hooks(); 48 51 } 52 } 53 54 if ( Options::module( 'ads_txt' ) ) { 55 if ( is_admin() ) { 56 ( new Detector() )->hooks(); 57 } 58 remove_action( 'advanced-ads-plugin-loaded', 'advanced_ads_ads_txt_init' ); 49 59 } 50 60 } … … 64 74 Page_Parser::get_instance(); 65 75 66 if ( $is_debugging || Helpers::is_module_enabled( 'header_bidding' ) ) {76 if ( $is_debugging || Options::module( 'header_bidding' ) ) { 67 77 ( new Header_Bidding() )->hooks(); 68 78 } 69 79 70 if ( $is_debugging || Helpers::is_module_enabled( 'tag_conversion' ) ) {80 if ( $is_debugging || Options::module( 'tag_conversion' ) ) { 71 81 ( new Tags_Conversion() )->hooks(); 72 82 } 73 83 74 if ( Helpers::is_module_enabled( 'traffic_cop' ) && Helpers::has_traffic_cop() ) {75 if ( ! Helpers::is_module_enabled( 'header_bidding' ) ) {84 if ( Options::module( 'traffic_cop' ) && Helpers::has_traffic_cop() ) { 85 if ( ! Options::module( 'header_bidding' ) ) { 76 86 ( new Header_Bidding() )->hooks(); 77 87 } … … 84 94 * Handle module status change 85 95 * 96 * @param array $data Data to send back to ajax request. 86 97 * @param string $module Module name. 98 * @param bool $status Module status. 87 99 * 88 * @return void100 * @return array 89 101 */ 90 public function module_status_changed( $ module ): void{102 public function module_status_changed( $data, $module, $status ): array { 91 103 if ( 'ads_txt' === $module ) { 104 $detector = new Detector(); 105 if ( $status && $detector->detect_files() ) { 106 ob_start(); 107 $detector->show_notice(); 108 $notice = ob_get_clean(); 109 if ( $notice ) { 110 $data['notice'] = $notice; 111 } 112 } 113 114 if ( ! $status && $detector->detect_files( 'ads.txt.bak' ) ) { 115 $detector->revert_file(); 116 } 117 92 118 update_option( self::FLUSH_KEY, 1 ); 93 119 } 120 121 return $data; 94 122 } 95 123 … … 112 140 */ 113 141 public function auto_ad_creation(): void { 114 $ads = Helpers::get_ads_from_config(); 115 // ( new Auto_Ads() )->run( $ads ); 142 ( new Api_Ads() )->import(); 116 143 } 117 144 } -
advanced-ads/tags/1.54.0/packages/composer/LICENSE
r3134733 r3145275 1 1 2 Copyright (c) Nils Adermann, Jordi Boggiano 2 3 … … 18 19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 20 THE SOFTWARE. 21 -
advanced-ads/tags/1.54.0/packages/composer/autoload_classmap.php
r3134733 r3145275 24 24 'AdvancedAds\\Assets_Registry' => $baseDir . '/includes/class-assets-registry.php', 25 25 'AdvancedAds\\Autoloader' => $baseDir . '/includes/class-autoloader.php', 26 'AdvancedAds\\Constants' => $baseDir . '/includes/class-constants.php', 26 27 'AdvancedAds\\Entities' => $baseDir . '/includes/class-entities.php', 27 28 'AdvancedAds\\Framework\\Assets_Registry' => $vendorDir . '/advanced-ads/framework/src/class-assets-registry.php', … … 58 59 'AdvancedAds\\Groups\\Types\\Standard' => $baseDir . '/includes/groups/types/type-standard.php', 59 60 'AdvancedAds\\Groups\\Types\\Unknown' => $baseDir . '/includes/groups/types/type-unknown.php', 61 'AdvancedAds\\Importers\\Api_Ads' => $baseDir . '/includes/importers/class-api-ads.php', 62 'AdvancedAds\\Importers\\Importer' => $baseDir . '/includes/importers/abstract-importer.php', 63 'AdvancedAds\\Importers\\Manager' => $baseDir . '/includes/importers/class-manager.php', 60 64 'AdvancedAds\\Installation\\Capabilities' => $baseDir . '/includes/installation/class-capabilities.php', 61 65 'AdvancedAds\\Installation\\Install' => $baseDir . '/includes/installation/class-install.php', 62 66 'AdvancedAds\\Installation\\Uninstall' => $baseDir . '/includes/installation/class-uninstall.php', 63 67 'AdvancedAds\\Interfaces\\Group_Type' => $baseDir . '/includes/interfaces/interface-group-type.php', 68 'AdvancedAds\\Interfaces\\Importer' => $baseDir . '/includes/interfaces/interface-importer.php', 64 69 'AdvancedAds\\Interfaces\\Screen_Interface' => $baseDir . '/includes/interfaces/interface-screen.php', 65 70 'AdvancedAds\\Modules\\OneClick\\Admin\\Admin' => $baseDir . '/modules/one-click/admin/class-admin.php', … … 67 72 'AdvancedAds\\Modules\\OneClick\\AdsTxt\\AdsTxt' => $baseDir . '/modules/one-click/modules/adstxt/class-adstxt.php', 68 73 'AdvancedAds\\Modules\\OneClick\\AdsTxt\\Detector' => $baseDir . '/modules/one-click/modules/adstxt/class-detector.php', 69 'AdvancedAds\\Modules\\OneClick\\Auto_Ads' => $baseDir . '/modules/one-click/modules/class-auto-ads.php',70 74 'AdvancedAds\\Modules\\OneClick\\Header_Bidding' => $baseDir . '/modules/one-click/modules/class-header-bidding.php', 71 75 'AdvancedAds\\Modules\\OneClick\\Helpers' => $baseDir . '/modules/one-click/class-helpers.php', -
advanced-ads/tags/1.54.0/packages/composer/autoload_static.php
r3134733 r3145275 53 53 'AdvancedAds\\Assets_Registry' => __DIR__ . '/../..' . '/includes/class-assets-registry.php', 54 54 'AdvancedAds\\Autoloader' => __DIR__ . '/../..' . '/includes/class-autoloader.php', 55 'AdvancedAds\\Constants' => __DIR__ . '/../..' . '/includes/class-constants.php', 55 56 'AdvancedAds\\Entities' => __DIR__ . '/../..' . '/includes/class-entities.php', 56 57 'AdvancedAds\\Framework\\Assets_Registry' => __DIR__ . '/..' . '/advanced-ads/framework/src/class-assets-registry.php', … … 87 88 'AdvancedAds\\Groups\\Types\\Standard' => __DIR__ . '/../..' . '/includes/groups/types/type-standard.php', 88 89 'AdvancedAds\\Groups\\Types\\Unknown' => __DIR__ . '/../..' . '/includes/groups/types/type-unknown.php', 90 'AdvancedAds\\Importers\\Api_Ads' => __DIR__ . '/../..' . '/includes/importers/class-api-ads.php', 91 'AdvancedAds\\Importers\\Importer' => __DIR__ . '/../..' . '/includes/importers/abstract-importer.php', 92 'AdvancedAds\\Importers\\Manager' => __DIR__ . '/../..' . '/includes/importers/class-manager.php', 89 93 'AdvancedAds\\Installation\\Capabilities' => __DIR__ . '/../..' . '/includes/installation/class-capabilities.php', 90 94 'AdvancedAds\\Installation\\Install' => __DIR__ . '/../..' . '/includes/installation/class-install.php', 91 95 'AdvancedAds\\Installation\\Uninstall' => __DIR__ . '/../..' . '/includes/installation/class-uninstall.php', 92 96 'AdvancedAds\\Interfaces\\Group_Type' => __DIR__ . '/../..' . '/includes/interfaces/interface-group-type.php', 97 'AdvancedAds\\Interfaces\\Importer' => __DIR__ . '/../..' . '/includes/interfaces/interface-importer.php', 93 98 'AdvancedAds\\Interfaces\\Screen_Interface' => __DIR__ . '/../..' . '/includes/interfaces/interface-screen.php', 94 99 'AdvancedAds\\Modules\\OneClick\\Admin\\Admin' => __DIR__ . '/../..' . '/modules/one-click/admin/class-admin.php', … … 96 101 'AdvancedAds\\Modules\\OneClick\\AdsTxt\\AdsTxt' => __DIR__ . '/../..' . '/modules/one-click/modules/adstxt/class-adstxt.php', 97 102 'AdvancedAds\\Modules\\OneClick\\AdsTxt\\Detector' => __DIR__ . '/../..' . '/modules/one-click/modules/adstxt/class-detector.php', 98 'AdvancedAds\\Modules\\OneClick\\Auto_Ads' => __DIR__ . '/../..' . '/modules/one-click/modules/class-auto-ads.php',99 103 'AdvancedAds\\Modules\\OneClick\\Header_Bidding' => __DIR__ . '/../..' . '/modules/one-click/modules/class-header-bidding.php', 100 104 'AdvancedAds\\Modules\\OneClick\\Helpers' => __DIR__ . '/../..' . '/modules/one-click/class-helpers.php', -
advanced-ads/tags/1.54.0/readme.txt
r3134930 r3145275 1 1 === Advanced Ads – Ad Manager & AdSense === 2 2 Contributors: webzunft, advancedads 3 Tags: ads, adsense, am p, ads.txt, ad rotations, ad blocker, amazon, banner, click fraud protection, google ad manager, header code, lazy loading,3 Tags: ads, adsense, amazon, affiliate, ad manager 4 4 Requires at least: 5.0 5 5 Tested up to: 6.5 6 6 Requires PHP: 7.2 7 Stable tag: 1.5 3.27 Stable tag: 1.54.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Manage and optimize all ad types. Support for Google AdSense Auto ads, Amazon, image banners, HTML, page builder, ad widget, ad rotations, ads.txt 11 The only complete toolkit for all ad types. Grow your revenue with AdSense, Amazon—or any affiliate network. Get pinpoint targeting and best support! 12 12 13 13 == Description == … … 31 31 This is what our users are saying about Advanced Ads: 32 32 33 > We use this plugin to deliver rotating ads on a community news site, and it’s great. We’ve delivered over a million ad impressions since we launched less than a year ago, using a combination of sidebar, top, sticky and in-content placements — both HTML5 a nd images. Advanced Ads makes it easy for our small team to deliver a good experience to our users and our advertisers.33 > We use this plugin to deliver rotating ads on a community news site, and it’s great. We’ve delivered over a million ad impressions since we launched less than a year ago, using a combination of sidebar, top, sticky and in-content placements — both HTML5 ads and images. Advanced Ads makes it easy for our small team to deliver a good experience to our users and our advertisers. 34 34 > <i>mytown304 on wp.org</i> 35 35 … … 37 37 38 38 = Premium Features = 39 This plugin is the lite version of the Advanced Ads plugin that comes with all the features you will ever need to optimize your ads and increase your revenues, including performance tracking, advanced ad targeting, split tests, click fraud protection, lazy loading, background ads, popups and sticky ads, full AMP support, adblocker detection, the most comfortable Google Ad Manager integration, and tons more. [Click here to purchase the best premium WordPress ad management plugin now!](https://wpadvancedads.com/add-ons/all-access/?utm_source=wporg&utm_medium=link&utm_campaign=wp-all-access)39 This plugin is the lite version of the Advanced Ads plugin that comes with all the features you will ever need to optimize your ads and increase your revenues, including performance tracking, advanced ad targeting, split tests, click fraud protection, lazy loading, background ads, floating ads, popups and sticky ads, full AMP support, adblocker detection, the most comfortable Google Ad Manager integration, and tons more. [Click here to purchase the best premium WordPress ad management plugin now!](https://wpadvancedads.com/add-ons/all-access/?utm_source=wporg&utm_medium=link&utm_campaign=wp-all-access) 40 40 41 41 [Full Feature List](https://wpadvancedads.com/features/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features) 42 42 43 = ad management =43 = Ad Management = 44 44 45 45 * create and display **unlimited** ad units … … 49 49 * inject ads into posts and pages automatically without coding 50 50 51 = ad types =51 = Ad Types = 52 52 53 53 Choose between different ad types that enable you to: 54 54 55 * insert ads and banners from all ad and affiliate networks (e.g., [Google AdSense](https://wpadvancedads.com/adsense-ads/), [Amazon Affiliate Program ](https://wpadvancedads.com/amazon-affiliate-program-wordpress/), BuySellAds, Google Ad Manager (formerly Google DoubleClick for Publishers, DFP), Ezoic, media.net, [Booking.com](https://wpadvancedads.com/booking-com-ads-wordpress/), Tradedoubler, Awin, Getyourguide, The Moneytizer, Infolinks...)55 * insert ads and banners from all ad and affiliate networks (e.g., [Google AdSense](https://wpadvancedads.com/adsense-ads/), [Amazon Affiliate Program Amazon Associates](https://wpadvancedads.com/amazon-affiliate-program-wordpress/), BuySellAds, Google Ad Manager (formerly Google DoubleClick for Publishers, DFP), Ezoic, media.net, [Booking.com](https://wpadvancedads.com/booking-com-ads-wordpress/), Tradedoubler, Awin, GetYourGuide, The Moneytizer, Infolinks...) 56 56 * dedicated support for all types of Google AdSense ads, including text and display ads, native ads (In-article, In-feed, Multiplex ads), Auto ads, and Auto ads for AMP 57 57 * display images and image banners 58 58 * create content-rich ads with the WordPress TinyMCE editor 59 59 * insert contextual Amazon Native Shopping Ads 60 * inject HTML, CSS, Javascript or PHP code61 * use shortcodes within ads (to also deliver advertisements from another ad plugin like Ad Inserter, AdRotate, Quick AdSense, Ad s for WP, or the Google AdSense Plugin WP QUADS)62 63 = display ads for WordPress =60 * inject HTML, CSS, Javascript, or PHP code 61 * use shortcodes within ads (to also deliver advertisements from another ad plugin like Ad Inserter, AdRotate, Quick AdSense, AdSanity, Ads for WP, or the Google AdSense plugin WP QUADS) 62 63 = Display Ads for WordPress = 64 64 65 65 * auto-inject ads via placements 66 66 * use functions to display ads in template files 67 * use shortcodes to place ads manually in post content67 * use shortcodes to place ads manually 68 68 * show ads in the sidebar and in widgets 69 69 * disable all ads on specific pages 70 * display multiple ads (ad grids)71 70 * display a customizable ad label, e.g., “Advertisements” above each banner ad 72 73 = display conditions = 71 * display multiple ads in ad grids ([Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-5)) 72 73 = Display Conditions = 74 74 75 75 Show ads based on content. [List of all display conditions](https://wpadvancedads.com/manual/display-conditions/) … … 79 79 * archive pages by category, tags, taxonomies 80 80 * special page types like 404, attachment and front page 81 * posts and pages by contained keywords [(keyword targeting)](https://wpadvancedads.com/manual/ads-based-on-keywords/?utm_source=wporg&utm_medium=link&utm_campaign=features) or URL parameters, included in [Advanced Ads Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-1)82 81 * hide ads on secondary queries (e.g., posts in sidebars) 83 82 * display or hide banners within the post feed 84 83 * hide all ads from specific page types, e.g., 404 pages, feed 85 84 * hide ads from bots and web crawlers 86 87 = visitor conditions = 85 * posts and pages by contained keywords [(keyword targeting)](https://wpadvancedads.com/manual/ads-based-on-keywords/?utm_source=wporg&utm_medium=link&utm_campaign=features) or URL parameters, included in [Advanced Ads Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-1) 86 87 = Visitor Conditions = 88 88 89 89 Serve ads by conditions based on the visitor. [List of all visitor conditions](https://wpadvancedads.com/manual/visitor-conditions/) … … 92 92 * display or hide a banner by role and for logged-in visitors 93 93 * advanced visitor conditions: geolocation, previously visited URL (referrer), user capability, browser language, browser, and browser width included in [Advanced Ads Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-2) 94 * frequency capping ([Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-6)) 94 95 95 96 > **Fantastic plugin and outstanding support** … … 97 98 > djsawyer on wp.org 98 99 99 = ad injection | placements =100 = Ad Injection | Placements = 100 101 101 102 Placements to insert ads in pre-defined positions in your theme and content. [List of all placements](https://wpadvancedads.com/manual/placements/) … … 107 108 * [Page peel banners](https://wpadvancedads.com/page-peel-ads/) 108 109 * create [split tests and A/B testing](https://wpadvancedads.com/ab-testing-wordpress/) 109 * many more ad positions with [add-ons](https://wpadvancedads.com/add-ons/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features)110 110 * automatic insertion of any kind of footer and header code, not only advertising 111 111 * use the [ad server](https://wpadvancedads.com/ad-server-wordpress/) placement to display ads on other sites 112 113 = mobile devices = 112 * many more ad positions with [add-ons](https://wpadvancedads.com/add-ons/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features) 113 114 = Mobile Devices = 114 115 115 116 * target ads to mobile devices, or tablets, or desktops 116 117 * display responsive image ads 117 * ads only for specific browser sizes using [Advanced AdsPro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-3)118 * insert ads on AMP pages with [AMP Ads](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-amp-ads-1)118 * ads only for specific browser sizes [Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-3) 119 * insert ads on AMP pages [AMP Ads add-on](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-amp-ads-1) 119 120 120 121 = Google AdSense = … … 133 134 * easy Ad Health integration and Google AdSense violation checks 134 135 * option to remove the Google AdSense background color 135 * place Google AdSense In-feed ads using the also free [In-feed add-on](https://wordpress.org/plugins/advanced-ads-adsense-in-feed/)136 * assistant for exact sizes of responsive Google AdSense ads with the [AMP Ads add-on](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-amp-ads-2)137 * convert Google AdSense ads into AMP ads automatically with the [AMP Ads add-on](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-amp-ads-3)138 136 * ads.txt generated with the correct AdSense information automatically 139 137 * works along with Google Site Kit or can replace it if you want to [control your ad placements](https://wpadvancedads.com/place-adsense-ad-unit-manually/) 138 * place Google AdSense In-feed ads [free In-feed add-on](https://wordpress.org/plugins/advanced-ads-adsense-in-feed/) 139 * assistant for exact sizes of responsive Google AdSense ads [AMP Ads add-on](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-amp-ads-2) 140 * convert Google AdSense ads into AMP ads automatically [AMP Ads add-on](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-amp-ads-3) 140 141 141 142 https://vimeo.com/577120971 … … 145 146 > Your app is awesome, congratulations! Google Adsense suggests using your app on its official website, it’s incredible! 146 147 147 = ads.txt = 148 = Affiliate Marketing = 149 150 Easily integrate affiliate marketing with a comprehensive toolkit. 151 152 * unlimited affiliate ads and banners 153 * text link support 154 * affiliate disclosure 155 * automatic affiliate ad insertion 156 * advanced targeting 157 * dedicated AAWP ad type (Amazon Affiliate WordPress Plugin) 158 * integrates with other affiliate plugins like Pretty Links, Thirsty Affiliates, Lasso, and many more 159 * support for all Amazon ad formats 160 * compatible with all affiliate networks 161 * link masking and link cloaking ([Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-7)) 162 * affiliate ad tracking ([Tracking add-on](https://wpadvancedads.com/add-ons/tracking/?utm_source=wporg&utm_medium=link&utm_campaign=affiliate-tracking)) 163 164 165 = Ads.txt = 148 166 149 167 * generates an ads.txt with custom content … … 156 174 * all add-ons include priority email support 157 175 * [All Access](https://wpadvancedads.com/add-ons/all-access/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – includes all available add-ons 158 * [Advanced Ads Pro](https://wpadvancedads.com/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – powerful tools for ad optimizations: cache-busting, more placements, [lazy loading](https://wpadvancedads.com/lazy-load-ads/?utm_source=wporg&utm_medium=link&utm_campaign=features), ad blocker module, [click fraud protection](https://wpadvancedads.com/manual/click-fraud-protection/?utm_source=wporg&utm_medium=link&utm_campaign=features), [geo targeting](https://wpadvancedads.com/add-ons/geo-targeting/?utm_source=wporg&utm_medium=link&utm_campaign=features), [parallax ads](https://wpadvancedads.com/parallax-ads/?utm_source=wporg&utm_medium=link&utm_campaign=features) and many more176 * [Advanced Ads Pro](https://wpadvancedads.com/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – powerful tools for ad optimizations: cache-busting, more placements, [lazy loading](https://wpadvancedads.com/lazy-load-ads/?utm_source=wporg&utm_medium=link&utm_campaign=features), ad blocker module, ad refresh, [click fraud protection](https://wpadvancedads.com/manual/click-fraud-protection/?utm_source=wporg&utm_medium=link&utm_campaign=features), [geo targeting](https://wpadvancedads.com/add-ons/geo-targeting/?utm_source=wporg&utm_medium=link&utm_campaign=features), [parallax ads](https://wpadvancedads.com/parallax-ads/?utm_source=wporg&utm_medium=link&utm_campaign=features) and many more 159 177 * [Tracking](https://wpadvancedads.com/add-ons/tracking/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – track ad impressions and ad clicks with local methods or Google Analytics 160 178 * [AMP Ads](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – make your ads compatible with AMP and convert Google AdSense ads automatically … … 167 185 * [Full Feature List](https://wpadvancedads.com/features/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) 168 186 169 = ad blocker =187 = Ad Blocker = 170 188 171 189 * basic features to prevent ads from being removed by AdBlock and other ad blockers 172 190 * prevent ad blockers from breaking sites where plugin scripts are running 173 * ad block ing detection: show alternative content to ad block users with [Advanced Ads Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-3) and improve the monetization of your website191 * ad blocker detection: show alternative content to ad block users and improve the monetization of your website [Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-4) 174 192 175 193 Learn more on the [plugin homepage](https://wpadvancedads.com). … … 188 206 - BuddyPress – [How to add ads on BuddyPress pages](https://wpadvancedads.com/ads-on-buddypress-pages/) 189 207 - bbPress – [How to show ads on bbPress pages?](https://wpadvancedads.com/ads-in-bbpress/) 190 - Cookie Consent, Borlabs Cookies, Complianz, GDPR Cookie Consent, and other content manager – [How to show ads based on visitors’ consent](https://wpadvancedads.com/manual/ad-cookie-consent/)208 - Cookie Consent, Borlabs Cookies, Complianz, GDPR Cookie Consent, and other privacy and consent manager – [How to show ads based on visitors’ consent](https://wpadvancedads.com/manual/ad-cookie-consent/) 191 209 - Elementor - [How to create and implement ads in Elementor](https://wpadvancedads.com/elementor-ads/) 192 210 - GamiPress – [How to target ads on GamiPress websites](https://wpadvancedads.com/manual/gamipress-ads/) 193 211 - Genesis – [Genesis Ads add-on](https://wpadvancedads.com/add-ons/genesis-ads/) 194 - [IAB TCF 2.0 consent](https://wpadvancedads.com/manual/tcf-consent-wordpress/) – hide ads until users give their consent. Integrating with any CMP, Quantcast Choices, iubenda, Google Funding Choices, cookiebot, etc.212 - [IAB TCF 2.0 consent](https://wpadvancedads.com/manual/tcf-consent-wordpress/) – hide ads until users give their consent. Integrating with any CMP, InMobi, iubenda, Google Funding Choices, cookiebot, etc. 195 213 - LearnDash - [How to integrate ads into LearnDash](https://wpadvancedads.com/learndash-ads/) 196 214 - MailPoet - [How to integrate Advanced Ads in MailPoet Newsletters](https://wpadvancedads.com/mailpoet-newsletters/) … … 201 219 - WPBakery Page Builder – [Displaying Ads with WPBakery Page Builder](https://wpadvancedads.com/visual-composer-ads/) 202 220 - WPML – [Showing different ads per language with WPML](https://wpadvancedads.com/translating-ads-wpml/) 221 - Youzify – [How to integrate ads in Youzify](https://wpadvancedads.com/how-to-integrate-ads-in-youzify/) 203 222 204 223 == Installation == … … 241 260 * Ads not showing up? Take a look [here](https://wpadvancedads.com/manual/ads-not-showing-up). 242 261 243 = What about my users’ privacy and GDPR ? =262 = What about my users’ privacy and GDPR compliance? = 244 263 245 264 The plugin comes with Privacy settings that help you gather consent from users before showing ads to them. The feature works for any ads managed with the plugin, including AdSense Auto ads. … … 257 276 = Which ad networks are supported? = 258 277 259 Advanced Ads is compatible with all ad networks and banners from affiliate programs like AWin, Google AdSense, Chitika, Clickbank, Amazon, and also Google Ad Manager (formerly Google DoubleClick for Publishers, DFP), media.net. 260 261 You can also use it to insert additional ad network tags into header or footer of your site without coding. 262 263 AdSense has even a dedicated ad type leveling the specific options this ad network provides. 278 Advanced Ads is compatible with all ad networks and banners from affiliate programs like Awin, Google AdSense, Chitika, Clickbank, CJ Affiliate, Amazon, ShareASale, Impact, Rakuten, Booking.com, GetYourGuide, media.net, and also Google Ad Manager (formerly Google DoubleClick for Publishers, DFP). 279 280 You can also use it to insert additional ad network tags into your site's header or footer without coding to integrate header bidding. 281 Advanced Ads even provides a dedicated AdSense ad type to leverage this ad network's specific options. 264 282 265 283 = PHP functions and shortcodes = … … 284 302 `<?php the_ad_placement('header-left'); ?>` 285 303 286 = Is there a revenue share? =287 288 There is no revenue shar e. Advanced Ads doesn’t alter your ad codes in a way that you earn less than you would directly including the ad code in your template.304 = Is there an ad revenue share? = 305 306 There is no revenue sharing. Advanced Ads doesn’t alter your ad codes in a way that you earn less than you would directly including the ad code in your template. To implement revenue sharing between multiple authors, follow the instructions of [this tutorial](https://wpadvancedads.com/publisher-revenue-share/). 289 307 290 308 = Can I place ads directly in my theme files? = … … 339 357 == Changelog == 340 358 341 = 1.53.2 (August 13, 2024) = 342 343 - Fix: ensure content from a group shows in all content placements 344 345 = 1.53.1 (August 13, 2024) = 346 347 - Fix: resolve issue with deleting data on uninstall 348 - Fix: resolve JavaScript error when uninstall 349 350 = 1.53.0 (August 6, 2024) = 351 352 - Improvement: add quick & bulk edit for "disable" ads on post/pages 353 - Fix: correct handling of conditions array when no conditions are set for an ad 354 - Fix: add drafted ads to group statistics on the statistic page 359 = 1.54.0 (September 2, 2024) = 360 361 - Improvement: enhance PubGuru one click integration 362 - Fix: prevent PHP warning when using ad debug 363 - Fix: readd drafted ads to group statistics on the statistic page 364 - Fix: resolve issue with ad blocker detection -
advanced-ads/tags/1.54.0/views/admin/metabox-pubguru-connect.php
r3041809 r3145275 7 7 */ 8 8 9 if ( false === $pubguru_config ) : ?> 9 use AdvancedAds\Modules\OneClick\Options; 10 10 11 <div class="pubguru-not-connected space-y-4"> 11 $header_bidding = Options::module( 'header_bidding' ); 12 ?> 13 <div class="pubguru-not-connected space-y-4<?php echo false === $pubguru_config ? '' : ' hidden'; ?>"> 12 14 <label for="m2-connect-consent" class="flex items-center w-full"> 13 15 <span class="self-start"> … … 28 30 29 31 <div class="flex items-center gap-x-4"> 30 <button class="button button-primary js-pubguru-connect " disabled type="button"><?php esc_html_e( 'Connect PGHB', 'advanced-ads' ); ?></button>32 <button class="button button-primary js-pubguru-connecting" disabled type="button"><?php esc_html_e( 'Connect PGHB', 'advanced-ads' ); ?></button> 31 33 <div class="lds-ripple aa-spinner"><div></div><div></div></div> 32 34 </div> 33 35 </div> 34 <?php endif; ?>35 36 36 37 <div class="pubguru-connected<?php echo false === $pubguru_config ? ' hidden' : ''; ?>"> … … 47 48 <div> 48 49 <label for="pubguru-header-bidding" class="advads-ui-switch"> 49 <input type="checkbox" name="header_bidding" id="pubguru-header-bidding" class="sr-only peer" <?php checked( boolval( get_option( 'pubguru_module_header_bidding', false ) )); ?>>50 <input type="checkbox" name="header_bidding" id="pubguru-header-bidding" class="sr-only peer" <?php checked( $header_bidding ); ?>> 50 51 <div></div> 51 52 <span> … … 55 56 </div> 56 57 57 <div >58 <label for="pubguru- tag-conversion" class="advads-ui-switch">59 <input type="checkbox" name=" tag_conversion" id="pubguru-tag-conversion" <?php checked( boolval( get_option( 'pubguru_module_tag_conversion', false ) ) ); ?> />58 <div<?php echo $header_bidding ? ' style="margin-left: 20px;"' : ' style="display: none;"'; ?>> 59 <label for="pubguru-header-bidding-at-body" class="advads-ui-switch"> 60 <input type="checkbox" name="header_bidding_at_body" id="pubguru-header-bidding-at-body" class="sr-only peer" <?php checked( Options::module( 'header_bidding_at_body' ) ); ?>> 60 61 <div></div> 61 62 <span> 62 <?php esc_html_e( ' Activate Tag Conversion', 'advanced-ads' ); ?>63 <?php esc_html_e( 'Move the PubGuru Header Bidding script to the footer. Keep this option disabled to maximize revenue. Only enable it if PageSpeed is your priority.', 'advanced-ads' ); ?> 63 64 </span> 64 65 </label> … … 67 68 <div> 68 69 <label for="pubguru-adstxt" class="advads-ui-switch"> 69 <input type="checkbox" name="ads_txt" id="pubguru-adstxt" <?php checked( boolval( get_option( 'pubguru_module_ads_txt', false )) ); ?> />70 <input type="checkbox" name="ads_txt" id="pubguru-adstxt" <?php checked( Options::module( 'ads_txt' ) ); ?> /> 70 71 <div></div> 71 72 <span> … … 86 87 </div> 87 88 88 <div >89 <div class="hidden"> 89 90 <label for="pubguru-traffic-cop" class="advads-ui-switch"> 90 <input type="checkbox" name="traffic_cop" id="pubguru-traffic-cop" <?php checked( boolval( get_option( 'pubguru_module_traffic_cop', false )) ); ?> />91 <input type="checkbox" name="traffic_cop" id="pubguru-traffic-cop" <?php checked( Options::module( 'traffic_cop' ) ); ?> /> 91 92 <div></div> 92 93 <span class="pg-tc-trail <?php echo $has_traffic_cop ? 'hidden' : ''; ?>"> … … 99 100 </div> 100 101 102 <div class="hidden"> 103 <label for="pubguru-tag-conversion" class="advads-ui-switch"> 104 <input type="checkbox" name="tag_conversion" id="pubguru-tag-conversion" <?php checked( Options::module( 'tag_conversion' ) ); ?> /> 105 <div></div> 106 <span> 107 <?php esc_html_e( 'Activate Tag Conversion', 'advanced-ads' ); ?> 108 </span> 109 </label> 110 </div> 111 101 112 </div> 102 113 … … 104 115 105 116 </div> 117 118 <?php 119 $session_key = get_option( 'advanced-ads-importer-history' ); 120 if ( $session_key ) : 121 $delete_link = wp_nonce_url( 122 add_query_arg( 123 [ 124 'action' => 'advads_import_delete', 125 'session_key' => $session_key, 126 ] 127 ), 128 'advads_import_delete' 129 ); 130 ?> 131 <div class="rollback-block"> 132 <header><?php esc_html_e( 'Rollback', 'advanced-ads' ); ?></header> 133 <a href="<?php echo esc_url( $delete_link ); ?>" class="button-link !text-red-500"><?php esc_html_e( 'Rollback the api changes back to previous state.', 'advanced-ads' ); ?></a> 134 </div> 135 <?php endif; ?> -
advanced-ads/trunk/admin/assets/css/admin.css
r3063392 r3145275 1435 1435 text-decoration: underline; 1436 1436 } 1437 1438 .rollback-block header { 1439 background-color: #f9f9f9; 1440 border: solid #c3c4c7; 1441 padding: 10px; 1442 margin: 30px -12px 15px; 1443 border-width: 1px 0; 1444 } -
advanced-ads/trunk/admin/class-advanced-ads-admin.php
r3134243 r3145275 2 2 // phpcs:ignoreFile 3 3 4 use AdvancedAds\Importers\Api_Ads; 5 use AdvancedAds\Utilities\WordPress; 4 6 use AdvancedAds\Utilities\Conditional; 5 use AdvancedAds\ Utilities\WordPress;7 use AdvancedAds\Framework\Utilities\Params; 6 8 7 9 /** … … 106 108 // update placements. 107 109 add_action( 'admin_init', [ 'Advanced_Ads_Placements', 'update_placements' ] ); 110 add_action( 'admin_init', [ $this, 'api_import_rollback' ] ); 108 111 109 112 // add Advanced Ads admin notices … … 483 486 echo '</span>'; 484 487 } 488 489 public function api_import_rollback() { 490 if ( 'advads_import_delete' !== Params::get( 'action' ) ) { 491 return; 492 } 493 494 check_admin_referer( 'advads_import_delete' ); 495 496 $session_key = Params::get( 'session_key' ); 497 $db_session = get_option( 'advanced-ads-importer-history' ); 498 499 if ( $session_key !== $db_session ) { 500 add_action( 'all_admin_notices', [ $this, 'import_error' ] ); 501 return; 502 } 503 504 ( new Api_Ads() )->rollback( $session_key); 505 delete_option( 'advanced-ads-importer-history' ); 506 add_action( 'all_admin_notices', [ $this, 'import_success' ] ); 507 } 508 509 public function import_error() { 510 ?> 511 <div class="notice notice-error"> 512 <p><strong>Error:</strong> Session key not matched.</p> 513 </div> 514 <?php 515 } 516 517 public function import_success() { 518 ?> 519 <div class="notice notice-success"> 520 <p><strong>Success:</strong> the rollback is completed.</p> 521 </div> 522 <?php 523 } 485 524 } -
advanced-ads/trunk/admin/includes/class-meta-box.php
r3134243 r3145275 2 2 // phpcs:ignoreFile 3 3 4 use AdvancedAds\Assets_Registry;5 4 use AdvancedAds\Entities; 6 5 use AdvancedAds\Utilities\WordPress; … … 70 69 71 70 if ( 'index.php' === $pagenow ) { 72 Assets_Registry::enqueue_script( 'wp-widget-adsense' );71 wp_advads()->registry->enqueue_script( 'wp-widget-adsense' ); 73 72 } 74 73 } -
advanced-ads/trunk/advanced-ads.php
r3134930 r3145275 4 4 * 5 5 * @package Advanced_Ads 6 * @author Advanced Ads GmbH<[email protected]>6 * @author Advanced Ads <[email protected]> 7 7 * @license GPL-2.0+ 8 8 * @link https://wpadvancedads.com … … 13 13 * Plugin URI: https://wpadvancedads.com 14 14 * Description: Manage and optimize your ads in WordPress 15 * Version: 1.5 3.216 * Author: Advanced Ads GmbH15 * Version: 1.54.0 16 * Author: Advanced Ads 17 17 * Author URI: https://wpadvancedads.com 18 18 * Text Domain: advanced-ads … … 34 34 35 35 define( 'ADVADS_FILE', __FILE__ ); 36 define( 'ADVADS_VERSION', '1.5 3.2' );36 define( 'ADVADS_VERSION', '1.54.0' ); 37 37 38 38 // Load the autoloader. -
advanced-ads/trunk/assets/css/app.css
r3050336 r3145275 1 .sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.\!mr-2{margin-right:.5rem!important}.\!mt-1{margin-top:.25rem!important}.mb-6{margin-bottom:1.5rem}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.w-full{width:100%}.items-center{align-items:center}.gap-x-4{column-gap:1rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.self-start{align-self:flex-start}.text-base{font-size:1rem;line-height:1.5rem}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.lds-ripple{display:none;height:40px;position:relative;width:40px}.lds-ripple.show{display:inline-block}.lds-ripple div{animation:lds-ripple 1s cubic-bezier(0,.2,.8,1) infinite;border:4px solid #ccc;border-radius:50%;opacity:1;position:absolute}.lds-ripple div:nth-child(2){animation-delay:-.5s}@keyframes lds-ripple{0%{height:0;left:20px;opacity:0;top:20px;width:0}4.9%{height:0;left:20px;opacity:0;top:20px;width:0}5%{height:0;left:20px;opacity:1;top:20px;width:0}to{height:40px;left:0;opacity:0;top:0;width:40px}}.advads-ui-switch{align-items:center;cursor:pointer;display:inline-flex;position:relative}.advads-ui-switch-list>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.25rem*var(--tw-space-y-reverse));margin-top:calc(1.25rem*(1 - var(--tw-space-y-reverse)))}.advads-ui-switch input{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.advads-ui-switch input:checked~div{--tw-bg-opacity:1;background-color:rgb(4 116 162/var(--tw-bg-opacity))}.advads-ui-switch input:checked~div:after{--tw- translate-x:100%;--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity));content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.advads-ui-switch input:disabled~div:after{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));content:var(--tw-content)}.advads-ui-switch div{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));border-radius:9999px;height:1.5rem;width:2.75rem}.advads-ui-switch div:after{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-content:"";background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(209 213 219/var(--tw-border-opacity));border-radius:9999px;border-width:1px;content:var(--tw-content);height:1.25rem;left:2px;position:absolute;top:.125rem;transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:1.25rem}.advads-ui-switch span{font-size:.875rem;font-weight:500;line-height:1.25rem;margin-left:.75rem}#advads-m2-connect{display:none}#advads-m2-connect a{--tw-text-opacity:1;color:rgb(4 116 162/var(--tw-text-opacity))}1 .sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.\!mr-2{margin-right:.5rem!important}.\!mt-1{margin-top:.25rem!important}.mb-6{margin-bottom:1.5rem}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.w-full{width:100%}.items-center{align-items:center}.gap-x-4{column-gap:1rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.self-start{align-self:flex-start}.text-base{font-size:1rem;line-height:1.5rem}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.lds-ripple{display:none;height:40px;position:relative;width:40px}.lds-ripple.show{display:inline-block}.lds-ripple div{animation:lds-ripple 1s cubic-bezier(0,.2,.8,1) infinite;border:4px solid #ccc;border-radius:50%;opacity:1;position:absolute}.lds-ripple div:nth-child(2){animation-delay:-.5s}@keyframes lds-ripple{0%{height:0;left:20px;opacity:0;top:20px;width:0}4.9%{height:0;left:20px;opacity:0;top:20px;width:0}5%{height:0;left:20px;opacity:1;top:20px;width:0}to{height:40px;left:0;opacity:0;top:0;width:40px}}.advads-ui-switch{align-items:center;cursor:pointer;display:inline-flex;position:relative}.advads-ui-switch-list>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.25rem*var(--tw-space-y-reverse));margin-top:calc(1.25rem*(1 - var(--tw-space-y-reverse)))}.advads-ui-switch input{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.advads-ui-switch input:checked~div{--tw-bg-opacity:1;background-color:rgb(4 116 162/var(--tw-bg-opacity))}.advads-ui-switch input:checked~div:after{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity));content:var(--tw-content);left:auto;right:2px}.advads-ui-switch input:disabled~div:after{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));content:var(--tw-content)}.advads-ui-switch div{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity));border-radius:9999px;border-width:1px;height:1.5rem;position:relative;width:2.75rem}.advads-ui-switch div:after{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-content:"";background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(209 213 219/var(--tw-border-opacity));border-radius:9999px;border-width:1px;content:var(--tw-content);height:1.25rem;left:2px;position:absolute;top:.125rem;transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:1.25rem}.advads-ui-switch span{font-size:.875rem;font-weight:500;line-height:1.25rem;margin-left:.75rem}#advads-m2-connect{display:none}#advads-m2-connect a{--tw-text-opacity:1;color:rgb(4 116 162/var(--tw-text-opacity))} -
advanced-ads/trunk/assets/js/app.js
r3134243 r3145275 1 (()=>{"use strict";var t,e={570:(t,e,n)=>{const a=jQuery;var o=n.n(a);function s(){var t,e,n,a,s;t=o()(".js-pubguru-connect"),e=t.next(".aa-spinner"),n=o()("#advads-m2-connect"),o()(".js-m2-show-consent").on("click",".button",(function(t){t.preventDefault();var e=o()(this).closest("tr");n.show(),e.addClass("hidden"),e.next().removeClass("hidden")})),o()(".js-pubguru-disconnect").on("click",".button",(function(t){t.preventDefault();var e=o()(this).closest("tr");n.hide(),e.addClass("hidden"),e.prev().removeClass("hidden"),o().ajax({type:"POST",url:ajaxurl,data:{action:"pubguru_disconnect",nonce:advadsglobal.ajax_nonce},dataType:"json"}).done((function(t){if(t.success){var n=o()('<div class="notice notice-success" />');n.html("<p>"+t.data.message+"</p>"),e.closest(".postbox").after(n),setTimeout((function(){n.fadeOut(500,(function(){n.remove()}))}),3e3)}}))})),o()("#m2-connect-consent").on("change",(function(){var e=o()(this);t.prop("disabled",!e.is(":checked"))})),o()("#advads-overview").on("click",".notice-dismiss",(function(t){t.preventDefault();var e=o()(this).parent();e.fadeOut(500,(function(){e.remove()}))})),t.on("click",(function(n){n.preventDefault(),e.addClass("show"),o().ajax({type:"POST",url:ajaxurl,data:{action:"pubguru_connect",nonce:advadsglobal.ajax_nonce},dataType:"json"}).done((function(t){t.success&&(o()(".pubguru-not-connected").hide(),o()(".pubguru-connected").removeClass("hidden"),o()(".pg-tc-trail").toggle(!t.data.hasTrafficCop),o()(".pg-tc-install").toggle(t.data.hasTrafficCop))})).fail((function(e){var n=e.responseJSON,a=o()('<div class="notice notice-error is-dismissible" />');a.html("<p>"+n.data+'</p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button>'),t.closest(".postbox").after(a)})).complete((function(){return e.removeClass("show")}))})),a=o()("#pubguru-modules"),s=o()("#pubguru-notices"),a.on("input","input:checkbox",(function(){var t=o()(this),e=t.attr("name"),n=t.is(":checked");o().ajax({url:a.attr("action"),method:"POST",data:{action:"pubguru_module_change",security:a.data("security"),module:e,status:n}}).done((function(t){var e=t.data.notice,n=void 0===e?"":e;s.html(""),""!==n&&s.html(n)}))})),s.on("click",".js-btn-backup-adstxt",(function(){var t=o()(this);t.prop("disabled",!0),t.html(t.data("loading")),o().ajax({url:a.attr("action"),method:"POST",data:{action:"pubguru_backup_ads_txt",security:t.data("security")}}).done((function(e){e.success?(t.html(t.data("done")),setTimeout((function(){s.fadeOut("slow",(function(){s.html("")}))}),4e3)):t.html(t.data("text"))})).fail((function(){t.html(t.data("text"))}))}))}o()((function(){s()}))},576:()=>{}},n={};function a(t){var o=n[t];if(void 0!==o)return o.exports;var s=n[t]={exports:{}};return e[t](s,s.exports,a),s.exports}a.m=e,t=[],a.O=(e,n,o,s)=>{if(!n){var c=1/0;for(d=0;d<t.length;d++){for(var[n,o,s]=t[d],i=!0,r=0;r<n.length;r++)(!1&s||c>=s)&&Object.keys(a.O).every((t=>a.O[t](n[r])))?n.splice(r--,1):(i=!1,s<c&&(c=s));if(i){t.splice(d--,1);var u=o();void 0!==u&&(e=u)}}return e}s=s||0;for(var d=t.length;d>0&&t[d-1][2]>s;d--)t[d]=t[d-1];t[d]=[n,o,s]},a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={845:0,196:0};a.O.j=e=>0===t[e];var e=(e,n)=>{var o,s,[c,i,r]=n,u=0;if(c.some((e=>0!==t[e]))){for(o in i)a.o(i,o)&&(a.m[o]=i[o]);if(r)var d=r(a)}for(e&&e(n);u<c.length;u++)s=c[u],a.o(t,s)&&t[s]&&t[s][0](),t[s]=0;return a.O(d)},n=globalThis.webpackChunkadvanced_ads=globalThis.webpackChunkadvanced_ads||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),a.O(void 0,[196],(()=>a(570)));var o=a.O(void 0,[196],(()=>a(576)));o=a.O(o)})();1 (()=>{"use strict";var e,t={612:(e,t,a)=>{const n=jQuery;var o=a.n(n);function s(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=o()('<div class="notice notice-'.concat(t,' is-dismissible" />'));n.html("<p>"+e+'</p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button>'),o()("#pubguru-notices").append(n),a&&setTimeout((function(){n.fadeOut(500,(function(){n.remove()}))}),3e3)}function c(){var e,t,a,n,c,i,u,d,r,l;e=o()(".js-pubguru-connect"),t=o()(".js-pubguru-disconnect"),a=o()("#advads-m2-connect"),n=o()(".js-pubguru-connecting"),c=n.next(".aa-spinner"),i=o()(".pubguru-connected"),u=o()(".pubguru-not-connected"),e.on("click",".button",(function(e){e.preventDefault(),a.show()})),o()("#m2-connect-consent").on("change",(function(){var e=o()(this);n.prop("disabled",!e.is(":checked"))})),n.on("click",(function(a){a.preventDefault(),c.addClass("show"),o().ajax({type:"POST",url:ajaxurl,data:{action:"pubguru_connect",nonce:advadsglobal.ajax_nonce},dataType:"json"}).done((function(a){a.success&&(u.addClass("hidden"),e.addClass("hidden"),i.removeClass("hidden"),t.removeClass("hidden"),o()(".pg-tc-trail").toggle(!a.data.hasTrafficCop),o()(".pg-tc-install").toggle(a.data.hasTrafficCop),s(a.data.message,"success",!0))})).fail((function(e){s(e.responseJSON.data,"error")})).complete((function(){return c.removeClass("show")}))})),t.on("click",".button",(function(n){n.preventDefault(),a.hide(),u.removeClass("hidden"),e.removeClass("hidden"),i.addClass("hidden"),t.addClass("hidden"),o().ajax({type:"POST",url:ajaxurl,data:{action:"pubguru_disconnect",nonce:advadsglobal.ajax_nonce},dataType:"json"}).done((function(e){e.success&&s(e.data.message,"success",!0)}))})),d=o()("#pubguru-modules"),r=o()("#pubguru-notices"),l=o()("#pubguru-header-bidding-at-body").closest("div"),d.on("input","input:checkbox",(function(){var e=o()(this),t=e.attr("name"),a=e.is(":checked");"header_bidding"===t&&l.toggle(a),o().ajax({url:d.attr("action"),method:"POST",data:{action:"pubguru_module_change",security:d.data("security"),module:t,status:a}}).done((function(e){var t=e.data.notice,a=void 0===t?"":t;r.html(""),""!==a&&r.html(a)}))})),o()(document).on("click",".js-btn-backup-adstxt",(function(){var e=o()(this),t=e.closest(".notice");e.prop("disabled",!0),e.html(e.data("loading")),o().ajax({url:d.attr("action"),method:"POST",data:{action:"pubguru_backup_ads_txt",security:e.data("security")}}).always((function(){e.prop("disabled",!1),e.html(e.data("text"))})).done((function(e){if(e.success){var a=o()(e.data);r.html(a),t.after(a),t.remove(),setTimeout((function(){a.fadeOut("slow",(function(){a.html("")}))}),4e3)}else r.html(e.data),t.after(e.data)}))})),o()("#advads-overview").on("click",".notice-dismiss",(function(e){e.preventDefault();var t=o()(this).parent();t.fadeOut(500,(function(){t.remove()}))}))}o()((function(){c()}))},576:()=>{}},a={};function n(e){var o=a[e];if(void 0!==o)return o.exports;var s=a[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.m=t,e=[],n.O=(t,a,o,s)=>{if(!a){var c=1/0;for(r=0;r<e.length;r++){for(var[a,o,s]=e[r],i=!0,u=0;u<a.length;u++)(!1&s||c>=s)&&Object.keys(n.O).every((e=>n.O[e](a[u])))?a.splice(u--,1):(i=!1,s<c&&(c=s));if(i){e.splice(r--,1);var d=o();void 0!==d&&(t=d)}}return t}s=s||0;for(var r=e.length;r>0&&e[r-1][2]>s;r--)e[r]=e[r-1];e[r]=[a,o,s]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={845:0,196:0};n.O.j=t=>0===e[t];var t=(t,a)=>{var o,s,[c,i,u]=a,d=0;if(c.some((t=>0!==e[t]))){for(o in i)n.o(i,o)&&(n.m[o]=i[o]);if(u)var r=u(n)}for(t&&t(a);d<c.length;d++)s=c[d],n.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return n.O(r)},a=globalThis.webpackChunkadvanced_ads=globalThis.webpackChunkadvanced_ads||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})(),n.O(void 0,[196],(()=>n(612)));var o=n.O(void 0,[196],(()=>n(576)));o=n.O(o)})(); -
advanced-ads/trunk/assets/scss/ui/_switch.scss
r3041809 r3145275 10 10 11 11 &:checked ~ div { 12 @apply after:translate-x-full after:border-white bg-primary;12 @apply bg-primary after:left-auto after:right-[2px] after:border-white; 13 13 } 14 14 … … 19 19 20 20 div { 21 @apply w-11 h-6 bg-gray-200 rounded-full;21 @apply relative w-11 h-6 bg-gray-200 rounded-full border; 22 22 23 23 &::after { -
advanced-ads/trunk/assets/src/modules/oneclick/connect-button.js
r3041809 r3145275 1 1 import jQuery from 'jquery'; 2 2 3 function createNotice(message, type, fadeAway = false) { 4 const notice = jQuery( 5 `<div class="notice notice-${type} is-dismissible" />` 6 ); 7 notice.html( 8 '<p>' + 9 message + 10 '</p>' + 11 '<button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button>' 12 ); 13 14 jQuery('#pubguru-notices').append(notice); 15 16 if (fadeAway) { 17 setTimeout(() => { 18 notice.fadeOut(500, () => { 19 notice.remove(); 20 }); 21 }, 3000); 22 } 23 } 24 3 25 export default function () { 4 const pubguruConnectButton= jQuery('.js-pubguru-connect');5 const spinner = pubguruConnectButton.next('.aa-spinner');26 const connectWrap = jQuery('.js-pubguru-connect'); 27 const disconnectWrap = jQuery('.js-pubguru-disconnect'); 6 28 const metabox = jQuery('#advads-m2-connect'); 29 const connectButton = jQuery('.js-pubguru-connecting'); 30 const spinner = connectButton.next('.aa-spinner'); 31 const contentConnected = jQuery('.pubguru-connected'); 32 const contentNotConnected = jQuery('.pubguru-not-connected'); 7 33 8 jQuery('.js-m2-show-consent').on('click', '.button', function (event) { 34 // Show consent box. 35 connectWrap.on('click', '.button', function (event) { 9 36 event.preventDefault(); 10 11 const tr = jQuery(this).closest('tr');12 13 37 metabox.show(); 14 tr.addClass('hidden');15 tr.next().removeClass('hidden');16 });17 18 jQuery('.js-pubguru-disconnect').on('click', '.button', function (event) {19 event.preventDefault();20 21 const tr = jQuery(this).closest('tr');22 23 metabox.hide();24 tr.addClass('hidden');25 tr.prev().removeClass('hidden');26 27 jQuery28 .ajax({29 type: 'POST',30 url: ajaxurl,31 data: {32 action: 'pubguru_disconnect',33 nonce: advadsglobal.ajax_nonce,34 },35 dataType: 'json',36 })37 .done(function (response) {38 if (!response.success) {39 return;40 }41 42 const notice = jQuery('<div class="notice notice-success" />');43 notice.html('<p>' + response.data.message + '</p>');44 45 tr.closest('.postbox').after(notice);46 setTimeout(function () {47 notice.fadeOut(500, function () {48 notice.remove();49 });50 }, 3000);51 });52 38 }); 53 39 54 40 jQuery('#m2-connect-consent').on('change', function () { 55 41 const checkbox = jQuery(this); 56 pubguruConnectButton.prop('disabled', !checkbox.is(':checked'));42 connectButton.prop('disabled', !checkbox.is(':checked')); 57 43 }); 58 44 59 jQuery('#advads-overview').on('click', '.notice-dismiss', function (event) { 60 event.preventDefault(); 61 const button = jQuery(this); 62 const notice = button.parent(); 63 notice.fadeOut(500, function () { 64 notice.remove(); 65 }); 66 }); 67 68 pubguruConnectButton.on('click', function (event) { 45 connectButton.on('click', function (event) { 69 46 event.preventDefault(); 70 47 … … 85 62 } 86 63 87 jQuery('.pubguru-not-connected').hide(); 88 jQuery('.pubguru-connected').removeClass('hidden'); 64 contentNotConnected.addClass('hidden'); 65 connectWrap.addClass('hidden'); 66 contentConnected.removeClass('hidden'); 67 disconnectWrap.removeClass('hidden'); 89 68 90 69 jQuery('.pg-tc-trail').toggle(!response.data.hasTrafficCop); 91 70 jQuery('.pg-tc-install').toggle(response.data.hasTrafficCop); 71 createNotice(response.data.message, 'success'); 92 72 }) 93 73 .fail(function (jqXHR) { 94 74 const response = jqXHR.responseJSON; 95 const notice = jQuery( 96 '<div class="notice notice-error is-dismissible" />' 97 ); 98 notice.html( 99 '<p>' + 100 response.data + 101 '</p>' + 102 '<button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button>' 103 ); 104 105 pubguruConnectButton.closest('.postbox').after(notice); 75 createNotice(response.data, 'error'); 106 76 }) 107 77 .complete(() => spinner.removeClass('show')); 108 78 }); 79 80 disconnectWrap.on('click', '.button', function (event) { 81 event.preventDefault(); 82 83 metabox.hide(); 84 contentNotConnected.removeClass('hidden'); 85 connectWrap.removeClass('hidden'); 86 contentConnected.addClass('hidden'); 87 disconnectWrap.addClass('hidden'); 88 89 jQuery 90 .ajax({ 91 type: 'POST', 92 url: ajaxurl, 93 data: { 94 action: 'pubguru_disconnect', 95 nonce: advadsglobal.ajax_nonce, 96 }, 97 dataType: 'json', 98 }) 99 .done(function (response) { 100 if (!response.success) { 101 return; 102 } 103 104 createNotice(response.data.message, 'success', true); 105 }); 106 }); 109 107 } -
advanced-ads/trunk/assets/src/modules/oneclick/index.js
r3041809 r3145275 1 import jQuery from 'jquery'; 2 1 3 import connectButton from './connect-button'; 2 import settingsUi from './settings';4 import connectSettings from './connect-settings'; 3 5 4 6 export default function () { 5 7 connectButton(); 6 settingsUi(); 8 connectSettings(); 9 10 jQuery('#advads-overview').on('click', '.notice-dismiss', function (event) { 11 event.preventDefault(); 12 const button = jQuery(this); 13 const notice = button.parent(); 14 notice.fadeOut(500, function () { 15 notice.remove(); 16 }); 17 }); 7 18 } -
advanced-ads/trunk/classes/ad-debug.php
r2983598 r3145275 247 247 $content = ''; 248 248 foreach ( $_condition as $_k => $_v ) { 249 $content .= esc_html( $_k ) . ': ' . esc_html( $_v ) . '<br>'; 249 $content .= esc_html( $_k ) . ': '; 250 if ( is_array( $_v ) ) { 251 $content .= esc_html( implode( ', ', $_v ) ); 252 } else { 253 $content .= esc_html( $_v ); 254 } 255 $content .= '<br />'; 250 256 } 251 257 -
advanced-ads/trunk/classes/ad_group.php
r3134930 r3145275 376 376 'orderby' => 'id', // Might want to avoid sorting as not needed for most calls and fast in PHP; slight I/O blocking concern. 377 377 ]; 378 379 if ( ! empty( $this->ad_args['post_status'] ) ) { 380 $args['post_status'] = array_unique( array_merge( (array) $args['post_status'], (array) $this->ad_args['post_status'] ) ); 381 } 378 382 379 383 $ads = new WP_Query( $args ); -
advanced-ads/trunk/classes/frontend_checks.php
r3108573 r3145275 2 2 // phpcs:ignoreFile 3 3 4 use AdvancedAds\Assets_Registry;5 4 use AdvancedAds\Utilities\WordPress; 6 5 … … 53 52 54 53 if( $this->has_adblocker_placements() ) { 55 if ( ! Assets_Registry::script_is('find-adblocker', 'enqueued') ) {56 Assets_Registry::enqueue_script('find-adblocker');54 if ( ! wp_advads()->registry->is_script('find-adblocker', 'enqueued') ) { 55 wp_advads()->registry->enqueue_script('find-adblocker'); 57 56 } 58 57 } -
advanced-ads/trunk/classes/in-content-injector.php
r2983598 r3145275 1 <?php 1 <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName 2 2 3 3 use AdvancedAds\Utilities\WordPress; … … 80 80 } 81 81 82 // handle tags that are empty by definition or could be empty ("custom" option)82 // Handle tags that are empty by definition or could be empty ("custom" option). 83 83 if ( in_array( $tag_option, [ 'img', 'iframe', 'custom' ], true ) ) { 84 84 $defaults['allowEmpty'] = true; … … 116 116 switch ( $tag_option ) { 117 117 case 'p': 118 // exclude paragraphs within blockquote tags118 // Exclude paragraphs within blockquote tags. 119 119 $tag = 'p[not(parent::blockquote)]'; 120 120 break; 121 121 case 'pwithoutimg': 122 // convert option name into correct path, exclude paragraphs within blockquote tags122 // Convert option name into correct path, exclude paragraphs within blockquote tags. 123 123 $tag = 'p[not(descendant::img) and not(parent::blockquote)]'; 124 124 break; … … 133 133 contains(concat(' ', normalize-space(@class), ' '), ' gallery-size') or 134 134 contains(concat(' ', normalize-space(@class), ' '), ' wp-caption ') )"; 135 $tag = "*[self::img or self::figure or self::div[$shortcodes]]135 $tag = "*[self::img or self::figure or self::div[$shortcodes]] 136 136 [not(ancestor::table or ancestor::figure or ancestor::div[$shortcodes])]"; 137 137 break; 138 // any headline. By default h2, h3, and h4138 // Any headline. By default h2, h3, and h4. 139 139 case 'headlines': 140 140 $headlines = apply_filters( 'advanced-ads-headlines-for-ad-injection', [ 'h2', 'h3', 'h4' ] ); … … 145 145 $tag = '*[' . implode( ' or ', $headlines ) . ']'; // /html/body/*[self::h2 or self::h3 or self::h4] 146 146 break; 147 // any HTML element that makes sense in the content147 // Any HTML element that makes sense in the content. 148 148 case 'anyelement': 149 149 $exclude = [ … … 186 186 break; 187 187 case 'custom': 188 // get the path for the "custom" tag choice, use p as a fallback to prevent it from showing any ads if users left it empty188 // Get the path for the "custom" tag choice, use p as a fallback to prevent it from showing any ads if users left it empty. 189 189 $tag = ! empty( $placement_opts['xpath'] ) ? stripslashes( $placement_opts['xpath'] ) : 'p'; 190 190 break; … … 194 194 $xpath = new DOMXPath( $dom ); 195 195 196 197 if ( $options['itemLimit'] !== -1 ) { 196 if ( -1 !== $options['itemLimit'] ) { 198 197 $items = $xpath->query( '/html/body/' . $tag ); 199 198 … … 254 253 } 255 254 256 // make sure that the ad is injected outside the link255 // Make sure that the ad is injected outside the link. 257 256 if ( 'img' === $tag_option && 'a' === $node->parentNode->tagName ) { 258 257 if ( $options['before'] ) { 259 258 $node->parentNode; 260 259 } else { 261 // go one level deeper if inserted after to not insert the ad into the link; probably after the paragraph260 // Go one level deeper if inserted after to not insert the ad into the link; probably after the paragraph. 262 261 $node->parentNode->parentNode; 263 262 } … … 274 273 $ad_content = self::filter_ad_content( $ad_content, $node->tagName, $options ); 275 274 276 // convert HTML to XML!277 $ad_dom = new DOMDocument( '1.0', $wp_charset );275 // Convert HTML to XML!. 276 $ad_dom = new DOMDocument( '1.0', $wp_charset ); 278 277 $libxml_use_internal_errors = libxml_use_internal_errors( true ); 279 278 $ad_dom->loadHtml( '<!DOCTYPE html><html><meta http-equiv="Content-Type" content="text/html; charset=' . $wp_charset . '" /><body>' . $ad_content ); … … 314 313 } 315 314 } else { 316 // append to body; -TODO using here that we only select direct children of the body tag.315 // Append to body; -TODO using here that we only select direct children of the body tag. 317 316 foreach ( $ad_dom->getElementsByTagName( 'body' )->item( 0 )->childNodes as $importedNode ) { 318 317 $importedNode = $dom->importNode( $importedNode, true ); … … 341 340 * * but there are enough elements on the site, but just in sub-containers 342 341 */ 343 } elseif ( WordPress::user_can( 'advanced_ads_manage_options' ) 344 && $options['itemLimit'] !== -1 345 && empty( $plugin_options['content-injection-level-disabled'] ) ) { 342 } elseif ( 343 WordPress::user_can( 'advanced_ads_manage_options' ) && 344 -1 !== $options['itemLimit'] && 345 empty( $plugin_options['content-injection-level-disabled'] ) 346 ) { 346 347 347 348 // Check if there are more elements without limitation. … … 363 364 364 365 // phpcs:enable 365 366 366 return $content; 367 367 } … … 473 473 // Add tags before/after which ad placehoders were injected. 474 474 foreach ( $ads_for_placeholders as $ad_content ) { 475 $tag = $ad_content['tag']; 475 $alts = []; 476 $tag = $ad_content['tag']; 476 477 477 478 switch ( $ad_content['position'] ) { … … 492 493 } 493 494 } 495 494 496 $alts = array_unique( $alts ); 495 497 $tag_regexp = implode( '|', $alts ); … … 527 529 } 528 530 } else { 529 $count ++;531 ++$count; 530 532 } 531 533 } … … 749 751 return '//*[' . implode( ' or ', $query ) . ']'; 750 752 } 751 752 753 } -
advanced-ads/trunk/classes/plugin.php
r3134733 r3145275 90 90 */ 91 91 public function wp_plugins_loaded() { 92 // Load plugin text domain.93 $this->load_plugin_textdomain();94 95 92 // Load public-facing style sheet and JavaScript. 96 93 add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] ); … … 267 264 268 265 /** 269 * Load the plugin text domain for translation.270 */271 public function load_plugin_textdomain() {272 load_plugin_textdomain( 'advanced-ads', false, ADVADS_BASE_DIR . '/languages' );273 }274 275 /**276 266 * Shortcode to include ad in frontend 277 267 * -
advanced-ads/trunk/includes/admin/class-assets.php
r3134243 r3145275 10 10 namespace AdvancedAds\Admin; 11 11 12 use AdvancedAds\Entities; 12 13 use Advanced_Ads_AdSense_Admin; 13 14 use Advanced_Ads_Display_Conditions; 14 use AdvancedAds\Assets_Registry;15 use AdvancedAds\Entities;16 use AdvancedAds\Utilities\Data;17 15 use AdvancedAds\Utilities\Conditional; 18 16 use AdvancedAds\Framework\Interfaces\Integration_Interface; … … 43 41 $screen = get_current_screen(); 44 42 45 Assets_Registry::enqueue_style( 'ui' );46 Assets_Registry::enqueue_style( 'admin' );43 wp_advads()->registry->enqueue_style( 'ui' ); 44 wp_advads()->registry->enqueue_style( 'admin' ); 47 45 48 46 if ( 'post' === $screen->base && Entities::POST_TYPE_AD === $screen->post_type ) { 49 Assets_Registry::enqueue_style( 'ad-positioning' );47 wp_advads()->registry->enqueue_style( 'ad-positioning' ); 50 48 } 51 49 } … … 63 61 64 62 // TODO: add conditional loading. 65 Assets_Registry::enqueue_script( 'admin-global' );66 Assets_Registry::enqueue_script( 'find-adblocker' );63 wp_advads()->registry->enqueue_script( 'admin-global' ); 64 wp_advads()->registry->enqueue_script( 'find-adblocker' ); 67 65 68 66 $params = [ … … 77 75 78 76 if ( Conditional::is_screen_advanced_ads() ) { 79 Assets_Registry::enqueue_script( 'admin' );80 Assets_Registry::enqueue_script( 'conditions' );81 Assets_Registry::enqueue_script( 'wizard' );77 wp_advads()->registry->enqueue_script( 'admin' ); 78 wp_advads()->registry->enqueue_script( 'conditions' ); 79 wp_advads()->registry->enqueue_script( 'wizard' ); 82 80 83 81 $translation_array = [ … … 118 116 // Ad edit screen. 119 117 if ( 'post' === $screen->base && Entities::POST_TYPE_AD === $screen->post_type ) { 120 Assets_Registry::enqueue_script( 'ad-positioning' );118 wp_advads()->registry->enqueue_script( 'ad-positioning' ); 121 119 } 122 120 123 121 if ( in_array( $screen->id, [ 'edit-post', 'edit-page' ], true ) && current_user_can( 'edit_posts' ) ) { 124 Assets_Registry::enqueue_script( 'page-quick-edit' );122 wp_advads()->registry->enqueue_script( 'page-quick-edit' ); 125 123 wp_advads()->json->add( 'page_quick_edit', [ 'nonce' => wp_create_nonce( 'advads-post-quick-edit' ) ] ); 126 124 } -
advanced-ads/trunk/includes/class-assets-registry.php
r3134243 r3145275 10 10 namespace AdvancedAds; 11 11 12 use AdvancedAds\Framework\Interfaces\Integration_Interface;13 14 12 defined( 'ABSPATH' ) || exit; 15 13 … … 17 15 * Assets Registry. 18 16 */ 19 class Assets_Registry implements Integration_Interface{17 class Assets_Registry extends \AdvancedAds\Framework\Assets_Registry { 20 18 21 19 /** 22 * Enqueue stylesheet20 * Version for plugin local assets. 23 21 * 24 * @param string $handle Name of the stylesheet. 25 * 26 * @return void 22 * @return string 27 23 */ 28 public static function enqueue_style( $handle ): void{29 wp_enqueue_style( self::prefix_it( $handle ) );24 public function get_version(): string { 25 return ADVADS_VERSION; 30 26 } 31 27 32 28 /** 33 * Enqueue script29 * Prefix to use in handle to make it unique. 34 30 * 35 * @param string $handle Name of the script. 36 * 37 * @return void 31 * @return string 38 32 */ 39 public static function enqueue_script( $handle ): void{40 wp_enqueue_script( self::prefix_it( $handle ) );33 public function get_prefix(): string { 34 return ADVADS_SLUG; 41 35 } 42 36 43 37 /** 44 * Prefix the handle 45 * 46 * @param string $handle Name of the asset. 38 * Base URL for plugin local assets. 47 39 * 48 40 * @return string 49 41 */ 50 public static function prefix_it( $handle ): string { 51 return ADVADS_SLUG . '-' . $handle; 52 } 53 54 /** 55 * Determines whether a script has been added to the queue. 56 * 57 * @param string $handle Name of the script. 58 * @param string $status Optional. Status of the script to check. Default 'enqueued'. 59 * Accepts 'enqueued', 'registered', 'queue', 'to_do', and 'done'. 60 * 61 * @return bool 62 */ 63 public static function script_is( $handle, $status = 'enqueued' ): bool { 64 return wp_script_is( self::prefix_it( $handle ), $status ); 65 } 66 67 /** 68 * Hook into WordPress. 69 * 70 * @return void 71 */ 72 public function hooks(): void { 73 add_action( 'admin_enqueue_scripts', [ $this, 'register_assets' ], 0 ); 74 add_action( 'wp_enqueue_scripts', [ $this, 'register_assets' ], 0 ); 75 } 76 77 /** 78 * Register assets 79 * 80 * @return void 81 */ 82 public function register_assets(): void { 83 $this->register_styles(); 84 $this->register_scripts(); 42 public function get_base_url(): string { 43 return ADVADS_BASE_URL; 85 44 } 86 45 … … 94 53 return; 95 54 } 55 96 56 $this->register_style( 'ui', 'admin/assets/css/ui.css' ); 97 57 $this->register_style( 'admin', 'admin/assets/css/admin.css' ); … … 99 59 $this->register_style( 'app', 'assets/css/app.css' ); 100 60 } 101 $this->register_style( 'ad-positioning', 'modules/ad-positioning/assets/css/ad-positioning.css', [ self::prefix_it( 'admin' ) ] );61 $this->register_style( 'ad-positioning', 'modules/ad-positioning/assets/css/ad-positioning.css', [ $this->prefix_it( 'admin' ) ] ); 102 62 } 103 63 … … 111 71 $this->register_script( 'wp-widget-adsense', 'modules/gadsense/admin/assets/js/wp-widget.js', [ 'jquery' ], false, true ); 112 72 $this->register_script( 'app', 'assets/js/app.js', [ 'jquery' ], false, true ); 73 $this->register_script( 'find-adblocker', 'admin/assets/js/advertisement.js' ); 113 74 114 75 if ( ! is_admin() ) { … … 117 78 118 79 // Backend JS files go here. 119 $this->register_script( 'find-adblocker', 'admin/assets/js/advertisement.js' ); 120 $this->register_script( 'conditions', 'admin/assets/js/conditions.js', [ 'jquery', self::prefix_it( 'ui' ) ] ); 80 $this->register_script( 'conditions', 'admin/assets/js/conditions.js', [ 'jquery', $this->prefix_it( 'ui' ) ] ); 121 81 $this->register_script( 'wizard', 'admin/assets/js/wizard.js', [ 'jquery' ] ); 122 82 $this->register_script( 'inline-edit-group-ads', 'admin/assets/js/inline-edit-group-ads.js', [ 'jquery' ] ); 123 $this->register_script( 'admin', 'admin/assets/js/admin.min.js', [ 'jquery', self::prefix_it( 'ui' ), 'jquery-ui-autocomplete', 'wp-util' ] );83 $this->register_script( 'admin', 'admin/assets/js/admin.min.js', [ 'jquery', $this->prefix_it( 'ui' ), 'jquery-ui-autocomplete', 'wp-util' ] ); 124 84 $this->register_script( 'ui', 'admin/assets/js/ui.js', [ 'jquery' ] ); 125 85 $this->register_script( 'admin-global', 'admin/assets/js/admin-global.js', [ 'jquery' ], false, true ); 126 86 $this->register_script( 'page-quick-edit', 'assets/js/admin/page-quick-edit.js', [], false, true ); 127 87 } 128 129 /**130 * Register stylesheet131 *132 * @param string $handle Name of the stylesheet. Should be unique.133 * @param string|bool $src URL of the stylesheet.134 * @param string[] $deps Optional. An array of registered stylesheet handles this stylesheet depends on.135 * @param string|bool|null $ver Optional. String specifying stylesheet version number.136 * @param string $media Optional. The media for which this stylesheet has been defined.137 *138 * @return void139 */140 private function register_style( $handle, $src, $deps = [], $ver = false, $media = 'all' ) {141 if ( false === $ver ) {142 $ver = ADVADS_VERSION;143 }144 145 wp_register_style( self::prefix_it( $handle ), ADVADS_BASE_URL . $src, $deps, $ver, $media );146 }147 148 /**149 * Register script150 *151 * @param string $handle Name of the stylesheet. Should be unique.152 * @param string|bool $src URL of the stylesheet.153 * @param string[] $deps Optional. An array of registered stylesheet handles this stylesheet depends on.154 * @param string|bool|null $ver Optional. String specifying stylesheet version number.155 * @param bool $in_footer Optional. The media for which this stylesheet has been defined.156 *157 * @return void158 */159 private function register_script( $handle, $src, $deps = [], $ver = false, $in_footer = false ) {160 if ( false === $ver ) {161 $ver = ADVADS_VERSION;162 }163 164 $new_src = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? $src : str_replace( '.js', '.min.js', $src );165 wp_register_script( self::prefix_it( $handle ), ADVADS_BASE_URL . $src, $deps, $ver, $in_footer );166 }167 88 } -
advanced-ads/trunk/includes/class-autoloader.php
r2991956 r3145275 51 51 52 52 /** 53 * Get plugin directory. 54 * 55 * @return string 56 */ 57 public function get_directory(): string { 58 return dirname( ADVADS_FILE ); 59 } 60 61 /** 53 62 * Runs this initializer. 54 63 * … … 63 72 } 64 73 65 $this->autoloader = require _once$locate;74 $this->autoloader = require $locate; 66 75 $this->register_wordpress(); 67 76 } … … 75 84 */ 76 85 private function locate() { 77 $directory = dirname( ADVADS_FILE ); 78 $packages = $directory . '/packages/autoload.php'; 79 $vendors = $directory . '/vendor/autoload.php'; 80 $is_debug = 'local' === ( function_exists( 'wp_get_environment_type' ) ? wp_get_environment_type() : $this->get_environment_type() ); 81 $is_packages = is_readable( $packages ); 82 $is_vendors = is_readable( $vendors ); 83 84 if ( $is_packages && ( ! $is_debug || ! $is_vendors ) ) { 86 $directory = $this->get_directory(); 87 $packages = $directory . '/packages/autoload.php'; 88 $vendors = $directory . '/vendor/autoload.php'; 89 $is_debug = $this->is_debug() || 'local' === $this->get_environment_type(); 90 91 if ( is_readable( $packages ) && ( ! $is_debug || ! is_readable( $vendors ) ) ) { 85 92 return $packages; 86 93 } 87 94 88 if ( $is_vendors) {95 if ( is_readable( $vendors ) ) { 89 96 return $vendors; 90 97 } … … 135 142 */ 136 143 public function get_environment_type(): string { 144 return function_exists( 'wp_get_environment_type' ) 145 ? wp_get_environment_type() 146 : $this->get_environment_type_fallback(); 147 } 148 149 /** 150 * Retrieves the current environment type. 151 * 152 * @return string 153 */ 154 private function get_environment_type_fallback(): string { 137 155 static $current_env = ''; 138 156 … … 184 202 return $current_env; 185 203 } 204 205 /** 206 * Is WordPress debug mode enabled 207 * 208 * @return bool 209 */ 210 private function is_debug(): bool { 211 return defined( 'WP_DEBUG' ) && WP_DEBUG; 212 } 186 213 } -
advanced-ads/trunk/includes/class-plugin.php
r3134243 r3145275 11 11 12 12 use AdvancedAds\Admin; 13 use AdvancedAds\Groups;14 13 use AdvancedAds\Framework; 15 14 use AdvancedAds\Framework\Loader; … … 20 19 /** 21 20 * Plugin. 21 * 22 * Containers: 23 * 24 * @property Shortcodes $shortcodes Shortcodes handler. 25 * @property Assets_Registry $registry Assets registry. 26 * @property Framework\JSON $json JSON handler. 27 * @property Admin\Admin_Menu $screens Admin screens. 28 * @property Frontend\Ad_Renderer $renderer Ads renderer. 29 * @property Frontend\Manager $frontend Frontend manager. 22 30 */ 23 31 class Plugin extends Loader { … … 57 65 private function setup(): void { 58 66 $this->define_constants(); 67 $this->includes_functions(); 59 68 $this->includes(); 69 $this->includes_admin(); 60 70 61 71 /** … … 64 74 * TODO: need to remove it in future. 65 75 */ 66 67 // Load public functions (might be used by modules, other plugins or theme).68 require_once ADVADS_ABSPATH . 'includes/functions.php';69 require_once ADVADS_ABSPATH . 'includes/cap_map.php';70 71 76 // Public-Facing and Core Functionality. 72 77 \Advanced_Ads::get_instance(); … … 78 83 } 79 84 85 add_action( 'init', [ $this, 'load_textdomain' ] ); 80 86 add_action( 'plugins_loaded', [ $this, 'on_plugins_loaded' ], -1 ); 87 88 // Load it all. 81 89 $this->load(); 82 90 } … … 96 104 */ 97 105 do_action( 'advanced-ads-loaded' ); 106 } 107 108 /** 109 * Load the plugin text domain for translation. 110 * 111 * @return void 112 */ 113 public function load_textdomain(): void { 114 $locale = get_user_locale(); 115 $locale = apply_filters( 'plugin_locale', $locale, 'advanced-ads' ); 116 117 unload_textdomain( 'advanced-ads' ); 118 if ( false === load_textdomain( 'advanced-ads', WP_LANG_DIR . '/plugins/advanced-ads-' . $locale . '.mo' ) ) { 119 load_textdomain( 'advanced-ads', WP_LANG_DIR . '/advanced-ads/advanced-ads-' . $locale . '.mo' ); 120 } 121 122 load_plugin_textdomain( 'advanced-ads', false, dirname( ADVADS_PLUGIN_BASENAME ) . '/languages' ); 98 123 } 99 124 … … 145 170 */ 146 171 private function includes(): void { 172 // Common. 147 173 $this->register_initializer( Install::class ); 148 174 $this->register_integration( Entities::class ); 149 $this->register_integration( Assets_Registry::class );175 $this->register_integration( Assets_Registry::class, 'registry' ); 150 176 $this->register_integration( Framework\JSON::class, 'json', [ 'advancedAds' ] ); 151 177 $this->register_integration( Groups\Manager::class, 'group_manager' ); 152 153 // Only in admin area. 154 if ( is_admin() ) { 155 $this->register_integration( Admin\Action_Links::class ); 156 $this->register_integration( Admin\Assets::class ); 157 $this->register_integration( Admin\Header::class ); 158 $this->register_integration( Admin\TinyMCE::class ); 159 $this->register_integration( Admin\Admin_Menu::class ); 160 $this->register_integration( Admin\Page_Quick_Edit::class ); 161 } 178 } 179 180 /** 181 * Includes files used in admin. 182 * 183 * @return void 184 */ 185 private function includes_admin(): void { 186 // Early bail!! 187 if ( ! is_admin() ) { 188 return; 189 } 190 191 $this->register_integration( Admin\Action_Links::class ); 192 $this->register_integration( Admin\Assets::class ); 193 $this->register_integration( Admin\Header::class ); 194 $this->register_integration( Admin\TinyMCE::class ); 195 $this->register_integration( Admin\Admin_Menu::class ); 196 $this->register_integration( Admin\Page_Quick_Edit::class ); 197 } 198 199 /** 200 * Includes the necessary functions files. 201 * 202 * @return void 203 */ 204 private function includes_functions(): void { 205 require_once ADVADS_ABSPATH . 'includes/functions.php'; 206 require_once ADVADS_ABSPATH . 'includes/cap_map.php'; 162 207 } 163 208 } -
advanced-ads/trunk/languages/advanced-ads.pot
r3134930 r3145275 1 # Copyright (C) 2024 Advanced Ads GmbH1 # Copyright (C) 2024 Advanced Ads 2 2 # This file is distributed under the GPL-2.0+. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Advanced Ads 1.53. 1\n"5 "Project-Id-Version: Advanced Ads 1.53.2\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads/\n" 7 7 "Last-Translator: Thomas Maier <[email protected]>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2024-0 8-13T12:34:04+00:00\n"12 "POT-Creation-Date: 2024-09-02T11:05:48+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.6.0\n" … … 16 16 17 17 #. Plugin Name of the plugin 18 #: admin/includes/class-meta-box.php:565 18 #. Author of the plugin 19 #: admin/includes/class-meta-box.php:564 19 20 #: modules/gutenberg/includes/class-gutenberg.php:136 20 21 msgid "Advanced Ads" … … 28 29 #. Description of the plugin 29 30 msgid "Manage and optimize your ads in WordPress" 30 msgstr ""31 32 #. Author of the plugin33 msgid "Advanced Ads GmbH"34 31 msgstr "" 35 32 … … 86 83 #. translators: %s is empty here, but the string will be followed by a name of an ad unit. 87 84 #: admin/includes/ad-health-notices.php:112 88 #: classes/frontend_checks.php:2 8085 #: classes/frontend_checks.php:279 89 86 msgid "Visible ads should not use the Header placement: %s" 90 87 msgstr "" 91 88 92 89 #: admin/includes/ad-health-notices.php:123 93 #: classes/ad-debug.php:27 294 #: classes/frontend_checks.php:26 790 #: classes/ad-debug.php:278 91 #: classes/frontend_checks.php:266 95 92 msgid "Your website is using HTTPS, but the ad code contains HTTP and might not work." 96 93 msgstr "" … … 295 292 296 293 #: admin/includes/class-ad-type.php:953 297 #: classes/frontend_checks.php:54 7294 #: classes/frontend_checks.php:546 298 295 msgid "Get help" 299 296 msgstr "" … … 439 436 msgstr "" 440 437 441 #: admin/includes/class-meta-box.php: 50438 #: admin/includes/class-meta-box.php:49 442 439 #: admin/includes/class-overview-widgets.php:68 443 440 msgid "AdSense Earnings" 444 441 msgstr "" 445 442 446 #: admin/includes/class-meta-box.php:10 1443 #: admin/includes/class-meta-box.php:100 447 444 msgid "Ad Type" 448 445 msgstr "" 449 446 450 447 #. translators: 1: Name of ad unit 451 #: admin/includes/class-meta-box.php:11 9448 #: admin/includes/class-meta-box.php:118 452 449 msgid "Earnings of %1$s" 453 450 msgstr "" 454 451 455 #: admin/includes/class-meta-box.php:13 7452 #: admin/includes/class-meta-box.php:136 456 453 #: includes/admin/class-groups-list-table.php:451 457 454 #: views/admin/screens/placements.php:351 … … 459 456 msgstr "" 460 457 461 #: admin/includes/class-meta-box.php:14 6458 #: admin/includes/class-meta-box.php:145 462 459 msgid "Ad Parameters" 463 460 msgstr "" 464 461 465 #: admin/includes/class-meta-box.php:15 4462 #: admin/includes/class-meta-box.php:153 466 463 #: admin/includes/class-settings.php:73 467 464 msgid "Layout / Output" 468 465 msgstr "" 469 466 470 #: admin/includes/class-meta-box.php:16 2467 #: admin/includes/class-meta-box.php:161 471 468 msgid "Targeting" 472 469 msgstr "" 473 470 474 #: admin/includes/class-meta-box.php:17 1471 #: admin/includes/class-meta-box.php:170 475 472 msgid "Increase your ad revenue" 476 473 msgstr "" 477 474 478 #: admin/includes/class-meta-box.php:18 1475 #: admin/includes/class-meta-box.php:180 479 476 msgid "Statistics" 480 477 msgstr "" 481 478 482 #: admin/includes/class-meta-box.php:25 2483 #: admin/includes/class-meta-box.php:26 6479 #: admin/includes/class-meta-box.php:251 480 #: admin/includes/class-meta-box.php:265 484 481 #: admin/includes/class-overview-widgets.php:181 485 482 #: admin/views/ad-main-metabox.php:29 … … 502 499 msgstr "" 503 500 501 #: admin/includes/class-meta-box.php:269 502 msgid "Video" 503 msgstr "" 504 504 505 #: admin/includes/class-meta-box.php:270 505 msgid "Video"506 msgstr ""507 508 #: admin/includes/class-meta-box.php:271509 506 #: admin/views/conditions/ad-targeting-metabox.php:18 510 507 #: classes/ad-debug.php:152 … … 514 511 msgstr "" 515 512 516 #: admin/includes/class-meta-box.php:27 2513 #: admin/includes/class-meta-box.php:271 517 514 #: admin/views/conditions/ad-targeting-metabox.php:37 518 515 #: classes/ad-debug.php:239 … … 522 519 msgstr "" 523 520 524 #: admin/includes/class-meta-box.php:30 4521 #: admin/includes/class-meta-box.php:303 525 522 #: admin/includes/class-overview-widgets.php:64 526 523 #: views/admin/page-bulk-edit.php:20 … … 529 526 msgstr "" 530 527 531 #: admin/includes/class-meta-box.php:46 6528 #: admin/includes/class-meta-box.php:465 532 529 msgid "Ad Settings" 533 530 msgstr "" 534 531 535 532 #. translators: %1$d is the number of ads, %2$s and %3$s are URLs. 536 #: admin/includes/class-meta-box.php:58 1533 #: admin/includes/class-meta-box.php:580 537 534 msgid "%1$d ads – <a href=\"%2$s\">manage</a> - <a href=\"%3$s\">new</a>" 538 535 msgstr "" 539 536 540 #: admin/includes/class-meta-box.php:59 4537 #: admin/includes/class-meta-box.php:593 541 538 msgid "Get the tutorial via email" 542 539 msgstr "" 543 540 544 #: admin/includes/class-meta-box.php:60 3541 #: admin/includes/class-meta-box.php:602 545 542 msgid "Get AdSense tips via email" 546 543 msgstr "" 547 544 548 #: admin/includes/class-meta-box.php:61 2545 #: admin/includes/class-meta-box.php:611 549 546 msgid "Visit our blog for more articles about ad optimization" 550 547 msgstr "" 551 548 552 549 #. translators: %s is our URL. 553 #: admin/includes/class-meta-box.php:66 7550 #: admin/includes/class-meta-box.php:666 554 551 msgid "Latest posts on wpadvancedads.com" 555 552 msgstr "" … … 585 582 #: admin/views/notices/welcome-panel.php:15 586 583 #: admin/views/placements-item.php:68 587 #: includes/admin/class-assets.php: 71584 #: includes/admin/class-assets.php:69 588 585 #: views/admin/tables/groups/list-row-loop-none.php:17 589 586 #: views/admin/tables/groups/list-row-option-ads.php:61 … … 744 741 #: admin/includes/class-overview-widgets.php:627 745 742 #: admin/includes/class-overview-widgets.php:645 746 #: classes/ad_group.php:65 0743 #: classes/ad_group.php:654 747 744 msgid "Activate now" 748 745 msgstr "" … … 778 775 779 776 #: admin/includes/class-overview-widgets.php:733 780 #: classes/ad_group.php:65 3777 #: classes/ad_group.php:657 781 778 msgid "Get this add-on" 782 779 msgstr "" … … 823 820 824 821 #: admin/includes/class-settings.php:178 825 #: classes/in-content-injector.php:6 09822 #: classes/in-content-injector.php:611 826 823 msgid "Disable level limitation" 827 824 msgstr "" … … 1703 1700 1704 1701 #: admin/views/settings/general/block-bots.php:11 1705 #: classes/frontend_checks.php:13 81702 #: classes/frontend_checks.php:137 1706 1703 msgid "You look like a bot" 1707 1704 msgstr "" … … 2078 2075 2079 2076 #. translators: %1$s is an URL, %2$s is a URL text 2080 #: classes/ad_group.php:6 592077 #: classes/ad_group.php:663 2081 2078 msgid "It seems that a caching plugin is activated. Your ads might not rotate properly. The cache busting in Advanced Ads Pro will solve that. <a href=\"%1$s\" target=\"_blank\">%2$s.</a>" 2082 2079 msgstr "" … … 2384 2381 #: classes/display-conditions.php:318 2385 2382 #: classes/visitor-conditions.php:317 2386 #: includes/admin/class-assets.php:8 42383 #: includes/admin/class-assets.php:82 2387 2384 #: modules/gadsense/admin/views/external-ads-links.php:17 2388 2385 #: modules/gadsense/admin/views/external-ads-links.php:22 … … 2393 2390 #: classes/display-conditions.php:318 2394 2391 #: classes/visitor-conditions.php:317 2395 #: includes/admin/class-assets.php:8 52392 #: includes/admin/class-assets.php:83 2396 2393 msgid "and" 2397 2394 msgstr "" … … 2564 2561 msgstr "" 2565 2562 2566 #: classes/frontend_checks.php:12 32563 #: classes/frontend_checks.php:122 2567 2564 msgid "Random AdSense ads" 2568 2565 msgstr "" 2569 2566 2570 #: classes/frontend_checks.php:15 22567 #: classes/frontend_checks.php:151 2571 2568 msgid "Ad blocker enabled" 2572 2569 msgstr "" 2573 2570 2574 #: classes/frontend_checks.php:16 42571 #: classes/frontend_checks.php:163 2575 2572 msgid "<em>%s</em> filter does not exist" 2576 2573 msgstr "" 2577 2574 2578 #: classes/frontend_checks.php:1 802575 #: classes/frontend_checks.php:179 2579 2576 msgid "Ads are disabled in the content of this page" 2580 2577 msgstr "" 2581 2578 2582 #: classes/frontend_checks.php:19 22579 #: classes/frontend_checks.php:191 2583 2580 msgid "the current post ID is 0 " 2584 2581 msgstr "" 2585 2582 2586 #: classes/frontend_checks.php:21 12583 #: classes/frontend_checks.php:210 2587 2584 msgid "Ads are disabled on this page" 2588 2585 msgstr "" 2589 2586 2590 #: classes/frontend_checks.php:22 52587 #: classes/frontend_checks.php:224 2591 2588 msgid "Ads are disabled on all pages" 2592 2589 msgstr "" 2593 2590 2594 #: classes/frontend_checks.php:2 402591 #: classes/frontend_checks.php:239 2595 2592 msgid "Ads are disabled on 404 pages" 2596 2593 msgstr "" 2597 2594 2598 #: classes/frontend_checks.php:25 42595 #: classes/frontend_checks.php:253 2599 2596 msgid "Ads are disabled on non singular pages" 2600 2597 msgstr "" 2601 2598 2602 #: classes/frontend_checks.php:26 82599 #: classes/frontend_checks.php:267 2603 2600 msgid "Ad IDs: %s" 2604 2601 msgstr "" 2605 2602 2603 #: classes/frontend_checks.php:295 2604 msgid "AdSense violation" 2605 msgstr "" 2606 2606 2607 #: classes/frontend_checks.php:296 2607 msgid "Ad Sense violation"2608 msgid "Ad is hidden" 2608 2609 msgstr "" 2609 2610 2610 2611 #: classes/frontend_checks.php:297 2611 msgid "Ad is hidden"2612 msgstr ""2613 2614 #: classes/frontend_checks.php:2982615 2612 msgid "IDs: %s" 2616 2613 msgstr "" 2617 2614 2618 #: classes/frontend_checks.php:31 42615 #: classes/frontend_checks.php:313 2619 2616 msgid "The following responsive AdSense ads are not showing up: %s" 2620 2617 msgstr "" 2621 2618 2622 #: classes/frontend_checks.php:33 12619 #: classes/frontend_checks.php:330 2623 2620 msgid "Consent not given" 2624 2621 msgstr "" 2625 2622 2626 #: classes/frontend_checks.php:34 82623 #: classes/frontend_checks.php:347 2627 2624 msgid "Enable TCF integration" 2628 2625 msgstr "" 2629 2626 2630 #: classes/frontend_checks.php:36 32627 #: classes/frontend_checks.php:362 2631 2628 msgid "Debug Google Ad Manager" 2632 2629 msgstr "" 2633 2630 2634 #: classes/frontend_checks.php:3 802631 #: classes/frontend_checks.php:379 2635 2632 msgid "highlight ads" 2636 2633 msgstr "" 2637 2634 2638 #: classes/frontend_checks.php: 5002635 #: classes/frontend_checks.php:499 2639 2636 msgid "Ad Health" 2640 2637 msgstr "" 2641 2638 2642 #: classes/frontend_checks.php:51 52639 #: classes/frontend_checks.php:514 2643 2640 msgid "Show %d more notifications" 2644 2641 msgstr "" 2645 2642 2646 #: classes/frontend_checks.php:53 42643 #: classes/frontend_checks.php:533 2647 2644 msgid "Everything is fine" 2648 2645 msgstr "" 2649 2646 2650 #: classes/frontend_checks.php:60 52647 #: classes/frontend_checks.php:604 2651 2648 msgid "the following code is used for automatic error detection and only visible to admins" 2652 2649 msgstr "" 2653 2650 2654 2651 #. translators: %s stands for the name of the "Disable level limitation" option and automatically translated as well 2655 #: classes/in-content-injector.php:6 082652 #: classes/in-content-injector.php:610 2656 2653 msgid "Set <em>%s</em> to show more ads" 2657 2654 msgstr "" … … 2761 2758 msgstr "" 2762 2759 2760 #: includes/admin/class-assets.php:84 2761 msgid "After which paragraph?" 2762 msgstr "" 2763 2763 2764 #: includes/admin/class-assets.php:86 2764 msgid "After which paragraph?"2765 msgstr ""2766 2767 #: includes/admin/class-assets.php:882768 2765 #: modules/gadsense/includes/class-adsense-report.php:159 2769 2766 msgid "Today" 2770 2767 msgstr "" 2771 2768 2772 #: includes/admin/class-assets.php:8 92769 #: includes/admin/class-assets.php:87 2773 2770 #: modules/gadsense/includes/class-adsense-report.php:160 2774 2771 msgid "Yesterday" 2775 2772 msgstr "" 2776 2773 2777 #: includes/admin/class-assets.php: 902774 #: includes/admin/class-assets.php:88 2778 2775 #: modules/gadsense/includes/class-adsense-report.php:163 2779 2776 msgid "This Month" … … 2781 2778 2782 2779 #. translators: 1: The number of days. 2783 #: includes/admin/class-assets.php:9 22780 #: includes/admin/class-assets.php:90 2784 2781 #: modules/gadsense/includes/class-adsense-report.php:162 2785 2782 #: modules/gadsense/includes/class-adsense-report.php:165 … … 2788 2785 2789 2786 #. translators: 1: An error message. 2790 #: includes/admin/class-assets.php:9 42787 #: includes/admin/class-assets.php:92 2791 2788 msgid "An error occurred: %1$s" 2792 2789 msgstr "" 2793 2790 2794 #: includes/admin/class-assets.php:9 52791 #: includes/admin/class-assets.php:93 2795 2792 #: modules/gadsense/admin/views/adsense-report.php:24 2796 2793 msgid "All" 2797 2794 msgstr "" 2798 2795 2796 #: includes/admin/class-assets.php:94 2797 msgid "There were no results returned for this ad. Please make sure it is active, generating impressions and double check your ad parameters." 2798 msgstr "" 2799 2800 #: includes/admin/class-assets.php:95 2801 msgid "Show inactive ads" 2802 msgstr "" 2803 2799 2804 #: includes/admin/class-assets.php:96 2800 msgid "There were no results returned for this ad. Please make sure it is active, generating impressions and double check your ad parameters." 2801 msgstr "" 2802 2803 #: includes/admin/class-assets.php:97 2804 msgid "Show inactive ads" 2805 msgid "Hide inactive ads" 2805 2806 msgstr "" 2806 2807 2807 2808 #: includes/admin/class-assets.php:98 2808 msgid "Hide inactive ads" 2809 msgid "Permanently delete this placement?" 2810 msgstr "" 2811 2812 #: includes/admin/class-assets.php:99 2813 msgid "Close" 2809 2814 msgstr "" 2810 2815 2811 2816 #: includes/admin/class-assets.php:100 2812 msgid "Permanently delete this placement?"2813 msgstr ""2814 2815 #: includes/admin/class-assets.php:1012816 msgid "Close"2817 msgstr ""2818 2819 #: includes/admin/class-assets.php:1022820 2817 msgid "Data you have entered has not been saved. Are you sure you want to discard your changes?" 2821 2818 msgstr "" … … 3011 3008 3012 3009 #. translators: 1: is a link to a support document. 2: closing link 3013 #: includes/class-autoloader.php:12 13010 #: includes/class-autoloader.php:128 3014 3011 msgid "Your installation of Advanced Ads is incomplete. If you installed Advanced Ads from GitHub, %1$s please refer to this document%2$s to set up your development environment." 3015 3012 msgstr "" 3016 3013 3017 3014 #. translators: %s: WP_ENVIRONMENT_TYPES 3018 #: includes/class-autoloader.php:1 543015 #: includes/class-autoloader.php:172 3019 3016 msgid "The %s constant is no longer supported." 3020 3017 msgstr "" … … 3128 3125 #: includes/groups/types/type-unknown.php:60 3129 3126 msgid "No description" 3127 msgstr "" 3128 3129 #: includes/importers/class-api-ads.php:56 3130 msgid "Ads from API" 3131 msgstr "" 3132 3133 #: includes/importers/class-api-ads.php:65 3134 msgid "For MonetizeMore clients using PubGuru, you will be able to create all of your new ads from api." 3135 msgstr "" 3136 3137 #. translators: 1: counts 2: Importer title 3138 #: includes/importers/class-api-ads.php:192 3139 msgid "%1$d ads migrated from %2$s" 3140 msgstr "" 3141 3142 #: includes/importers/class-manager.php:104 3143 msgid "History deleted successfully." 3130 3144 msgstr "" 3131 3145 … … 4138 4152 msgstr "" 4139 4153 4154 #: modules/one-click/admin/class-admin.php:60 4155 msgid "MonetizeMore & PubGuru Integration" 4156 msgstr "" 4157 4140 4158 #: modules/one-click/admin/class-admin.php:61 4141 msgid "MonetizeMore & PubGuru Integration"4142 msgstr ""4143 4144 #: modules/one-click/admin/class-admin.php:624145 4159 msgid "Enables MonetizeMore users to link their settings with the PubGuru insights & analytics dashboard." 4146 4160 msgstr "" … … 4150 4164 msgstr "" 4151 4165 4152 #: modules/one-click/admin/class-admin.php:7 44166 #: modules/one-click/admin/class-admin.php:76 4153 4167 msgid "Disconnect now" 4154 4168 msgstr "" 4155 4169 4156 #: modules/one-click/admin/class-admin.php:10 04170 #: modules/one-click/admin/class-admin.php:101 4157 4171 msgid "PubGuru OneClick Consent & Privacy Policy" 4158 4172 msgstr "" 4159 4173 4160 #: modules/one-click/admin/class-admin.php:10 24174 #: modules/one-click/admin/class-admin.php:103 4161 4175 msgid "Connecting Your With Your PubGuru Account Settings" 4162 4176 msgstr "" … … 4167 4181 4168 4182 #: modules/one-click/admin/class-ajax.php:78 4169 msgid " Pubguru successfully connected."4183 msgid "We have successfully migrated your MonetizeMore Pubguru Ad Units to your WordPress site. The existing placements and ads have been paused." 4170 4184 msgstr "" 4171 4185 … … 4174 4188 msgstr "" 4175 4189 4190 #: modules/one-click/admin/class-ajax.php:132 4176 4191 #: modules/one-click/admin/class-ajax.php:167 4177 4192 msgid "An error has occurred please try again." 4178 4193 msgstr "" 4179 4194 4180 #: modules/one-click/modules/adstxt/class-detector.php:88 4195 #: modules/one-click/admin/class-ajax.php:139 4196 msgid "File successfully backed up." 4197 msgstr "" 4198 4199 #: modules/one-click/modules/adstxt/class-detector.php:93 4181 4200 msgid "File alert!" 4182 4201 msgstr "" 4183 4202 4184 #: modules/one-click/modules/adstxt/class-detector.php: 884185 msgid "Physical ads.txt found. In order to use PubGuru service you need to delete it ."4186 msgstr "" 4187 4188 #: modules/one-click/modules/adstxt/class-detector.php:9 04189 #: modules/one-click/modules/adstxt/class-detector.php:9 14203 #: modules/one-click/modules/adstxt/class-detector.php:93 4204 msgid "Physical ads.txt found. In order to use PubGuru service you need to delete it or back it up." 4205 msgstr "" 4206 4207 #: modules/one-click/modules/adstxt/class-detector.php:96 4208 #: modules/one-click/modules/adstxt/class-detector.php:97 4190 4209 msgid "Backup the File" 4191 4210 msgstr "" 4192 4211 4193 #: modules/one-click/modules/adstxt/class-detector.php:9 04212 #: modules/one-click/modules/adstxt/class-detector.php:96 4194 4213 msgid "Backing Up" 4195 4214 msgstr "" 4196 4215 4197 #: modules/one-click/modules/adstxt/class-detector.php:9 04216 #: modules/one-click/modules/adstxt/class-detector.php:96 4198 4217 msgid "Backed Up" 4199 4218 msgstr "" … … 4369 4388 4370 4389 #. translators: %s link to privacy policy 4371 #: views/admin/metabox-pubguru-connect.php:2 14390 #: views/admin/metabox-pubguru-connect.php:23 4372 4391 msgid "This form is designed exclusively for MonetizeMore customers who wish to integrate Advanced Ads with the PubGuru Dashboard. By selecting \"Connect PGHB,\" you agree to share your domain name to facilitate the connection with your PubGuru account, in alignment with our <a href=\"%s\">Privacy Policy</a>. Rest assured, no additional information is exchanged, and Advanced Ads does not engage in any tracking activities." 4373 4392 msgstr "" 4374 4393 4375 #: views/admin/metabox-pubguru-connect.php:3 04394 #: views/admin/metabox-pubguru-connect.php:32 4376 4395 msgid "Connect PGHB" 4377 4396 msgstr "" 4378 4397 4379 #: views/admin/metabox-pubguru-connect.php:4 24398 #: views/admin/metabox-pubguru-connect.php:43 4380 4399 msgid "To activate any of the settings with your PubGuru account, please select from the options below. Should you have any inquiries, feel free to <a href=\"https://www.monetizemore.com/contact/\">click here<a/> to reach out to us or send an email to <a href=\"mailto:[email protected]\">[email protected]</a>" 4381 4400 msgstr "" 4382 4401 4383 #: views/admin/metabox-pubguru-connect.php:5 24402 #: views/admin/metabox-pubguru-connect.php:53 4384 4403 msgid "Install PubGuru Header Bidding" 4385 4404 msgstr "" 4386 4405 4387 #: views/admin/metabox-pubguru-connect.php:62 4406 #: views/admin/metabox-pubguru-connect.php:63 4407 msgid "Move the PubGuru Header Bidding script to the footer. Keep this option disabled to maximize revenue. Only enable it if PageSpeed is your priority." 4408 msgstr "" 4409 4410 #: views/admin/metabox-pubguru-connect.php:75 4411 msgid "Enable ads.txt settings from the <a href=\"https://app.pubguru.com/ads-txt\" target=\"_blank\">PubGuru platform</a>" 4412 msgstr "" 4413 4414 #: views/admin/metabox-pubguru-connect.php:94 4415 msgid "Install Traffic Cop. 7 days free trial" 4416 msgstr "" 4417 4418 #: views/admin/metabox-pubguru-connect.php:97 4419 msgid "Install Traffic Cop." 4420 msgstr "" 4421 4422 #: views/admin/metabox-pubguru-connect.php:107 4388 4423 msgid "Activate Tag Conversion" 4389 4424 msgstr "" 4390 4425 4391 #: views/admin/metabox-pubguru-connect.php:74 4392 msgid "Enable ads.txt settings from the <a href=\"https://app.pubguru.com/ads-txt\" target=\"_blank\">PubGuru platform</a>" 4393 msgstr "" 4394 4395 #: views/admin/metabox-pubguru-connect.php:93 4396 msgid "Install Traffic Cop. 7 days free trial" 4397 msgstr "" 4398 4399 #: views/admin/metabox-pubguru-connect.php:96 4400 msgid "Install Traffic Cop." 4426 #: views/admin/metabox-pubguru-connect.php:132 4427 msgid "Rollback" 4428 msgstr "" 4429 4430 #: views/admin/metabox-pubguru-connect.php:133 4431 msgid "Rollback the api changes back to previous state." 4401 4432 msgstr "" 4402 4433 -
advanced-ads/trunk/lib/composer/autoload_classmap.php
r3134243 r3145275 55 55 'AdvancedAds\\BuildTools\\Values\\SemanticVersion' => $vendorDir . '/advanced-ads/build-tools/src/Values/SemanticVersion.php', 56 56 'AdvancedAds\\BuildTools\\Values\\Translation' => $vendorDir . '/advanced-ads/build-tools/src/Values/Translation.php', 57 'AdvancedAds\\Constants' => $baseDir . '/includes/class-constants.php', 57 58 'AdvancedAds\\Entities' => $baseDir . '/includes/class-entities.php', 58 59 'AdvancedAds\\Groups\\Manager' => $baseDir . '/includes/groups/class-manager.php', … … 62 63 'AdvancedAds\\Groups\\Types\\Standard' => $baseDir . '/includes/groups/types/type-standard.php', 63 64 'AdvancedAds\\Groups\\Types\\Unknown' => $baseDir . '/includes/groups/types/type-unknown.php', 65 'AdvancedAds\\Importers\\Api_Ads' => $baseDir . '/includes/importers/class-api-ads.php', 66 'AdvancedAds\\Importers\\Importer' => $baseDir . '/includes/importers/abstract-importer.php', 67 'AdvancedAds\\Importers\\Manager' => $baseDir . '/includes/importers/class-manager.php', 64 68 'AdvancedAds\\Installation\\Capabilities' => $baseDir . '/includes/installation/class-capabilities.php', 65 69 'AdvancedAds\\Installation\\Install' => $baseDir . '/includes/installation/class-install.php', 66 70 'AdvancedAds\\Installation\\Uninstall' => $baseDir . '/includes/installation/class-uninstall.php', 67 71 'AdvancedAds\\Interfaces\\Group_Type' => $baseDir . '/includes/interfaces/interface-group-type.php', 72 'AdvancedAds\\Interfaces\\Importer' => $baseDir . '/includes/interfaces/interface-importer.php', 68 73 'AdvancedAds\\Interfaces\\Screen_Interface' => $baseDir . '/includes/interfaces/interface-screen.php', 69 74 'AdvancedAds\\Modules\\OneClick\\Admin\\Admin' => $baseDir . '/modules/one-click/admin/class-admin.php', … … 71 76 'AdvancedAds\\Modules\\OneClick\\AdsTxt\\AdsTxt' => $baseDir . '/modules/one-click/modules/adstxt/class-adstxt.php', 72 77 'AdvancedAds\\Modules\\OneClick\\AdsTxt\\Detector' => $baseDir . '/modules/one-click/modules/adstxt/class-detector.php', 73 'AdvancedAds\\Modules\\OneClick\\Auto_Ads' => $baseDir . '/modules/one-click/modules/class-auto-ads.php',74 78 'AdvancedAds\\Modules\\OneClick\\Header_Bidding' => $baseDir . '/modules/one-click/modules/class-header-bidding.php', 75 79 'AdvancedAds\\Modules\\OneClick\\Helpers' => $baseDir . '/modules/one-click/class-helpers.php', -
advanced-ads/trunk/lib/composer/autoload_static.php
r3134243 r3145275 85 85 'AdvancedAds\\BuildTools\\Values\\SemanticVersion' => __DIR__ . '/..' . '/advanced-ads/build-tools/src/Values/SemanticVersion.php', 86 86 'AdvancedAds\\BuildTools\\Values\\Translation' => __DIR__ . '/..' . '/advanced-ads/build-tools/src/Values/Translation.php', 87 'AdvancedAds\\Constants' => __DIR__ . '/../..' . '/includes/class-constants.php', 87 88 'AdvancedAds\\Entities' => __DIR__ . '/../..' . '/includes/class-entities.php', 88 89 'AdvancedAds\\Groups\\Manager' => __DIR__ . '/../..' . '/includes/groups/class-manager.php', … … 92 93 'AdvancedAds\\Groups\\Types\\Standard' => __DIR__ . '/../..' . '/includes/groups/types/type-standard.php', 93 94 'AdvancedAds\\Groups\\Types\\Unknown' => __DIR__ . '/../..' . '/includes/groups/types/type-unknown.php', 95 'AdvancedAds\\Importers\\Api_Ads' => __DIR__ . '/../..' . '/includes/importers/class-api-ads.php', 96 'AdvancedAds\\Importers\\Importer' => __DIR__ . '/../..' . '/includes/importers/abstract-importer.php', 97 'AdvancedAds\\Importers\\Manager' => __DIR__ . '/../..' . '/includes/importers/class-manager.php', 94 98 'AdvancedAds\\Installation\\Capabilities' => __DIR__ . '/../..' . '/includes/installation/class-capabilities.php', 95 99 'AdvancedAds\\Installation\\Install' => __DIR__ . '/../..' . '/includes/installation/class-install.php', 96 100 'AdvancedAds\\Installation\\Uninstall' => __DIR__ . '/../..' . '/includes/installation/class-uninstall.php', 97 101 'AdvancedAds\\Interfaces\\Group_Type' => __DIR__ . '/../..' . '/includes/interfaces/interface-group-type.php', 102 'AdvancedAds\\Interfaces\\Importer' => __DIR__ . '/../..' . '/includes/interfaces/interface-importer.php', 98 103 'AdvancedAds\\Interfaces\\Screen_Interface' => __DIR__ . '/../..' . '/includes/interfaces/interface-screen.php', 99 104 'AdvancedAds\\Modules\\OneClick\\Admin\\Admin' => __DIR__ . '/../..' . '/modules/one-click/admin/class-admin.php', … … 101 106 'AdvancedAds\\Modules\\OneClick\\AdsTxt\\AdsTxt' => __DIR__ . '/../..' . '/modules/one-click/modules/adstxt/class-adstxt.php', 102 107 'AdvancedAds\\Modules\\OneClick\\AdsTxt\\Detector' => __DIR__ . '/../..' . '/modules/one-click/modules/adstxt/class-detector.php', 103 'AdvancedAds\\Modules\\OneClick\\Auto_Ads' => __DIR__ . '/../..' . '/modules/one-click/modules/class-auto-ads.php',104 108 'AdvancedAds\\Modules\\OneClick\\Header_Bidding' => __DIR__ . '/../..' . '/modules/one-click/modules/class-header-bidding.php', 105 109 'AdvancedAds\\Modules\\OneClick\\Helpers' => __DIR__ . '/../..' . '/modules/one-click/class-helpers.php', -
advanced-ads/trunk/modules/one-click/admin/class-admin.php
r3041809 r3145275 10 10 namespace AdvancedAds\Modules\OneClick\Admin; 11 11 12 use AdvancedAds\Assets_Registry;13 12 use AdvancedAds\Utilities\Conditional; 14 13 use AdvancedAds\Modules\OneClick\Helpers; … … 44 43 } 45 44 46 Assets_Registry::enqueue_style( 'app' );47 Assets_Registry::enqueue_script( 'app' );45 wp_advads()->registry->enqueue_style( 'app' ); 46 wp_advads()->registry->enqueue_script( 'app' ); 48 47 } 49 48 … … 63 62 'order' => 1000, 64 63 'link' => '#', 64 'icon' => ADVADS_BASE_URL . 'assets/img/add-ons/aa-addons-icons-m2pg.svg', 65 65 ]; 66 66 67 67 $addons['monetizemore-connect'] = $defaults + [ 68 'class' => 'js-m2-show-consent', 69 'link_title' => __( 'Connect now', 'advanced-ads' ), 68 'class' => 'js-pubguru-connect', 69 'link_title' => __( 'Connect now', 'advanced-ads' ), 70 'link_icon' => 'dashicons-plus', 71 'link_primary' => true, 70 72 ]; 71 73 … … 73 75 'class' => 'js-pubguru-disconnect', 74 76 'link_title' => __( 'Disconnect now', 'advanced-ads' ), 77 'link_icon' => 'dashicons-dismiss', 75 78 ]; 76 79 77 if ( $is_connected ) { 78 $addons['monetizemore-connect']['class'] .= ' hidden'; 79 } else { 80 $addons['monetizemore-disconnect']['class'] .= ' hidden'; 81 } 80 $key = $is_connected ? 'monetizemore-connect' : 'monetizemore-disconnect'; 81 82 $addons[ $key ]['class'] .= ' hidden'; 82 83 83 84 return $addons; … … 111 112 </div> 112 113 </div> 114 <div id="pubguru-notices"></div> 113 115 114 116 <?php -
advanced-ads/trunk/modules/one-click/admin/class-ajax.php
r3041809 r3145275 14 14 use AdvancedAds\Modules\OneClick\Helpers; 15 15 use AdvancedAds\Modules\OneClick\Options; 16 use AdvancedAds\Framework\Utilities\Params; 16 17 use AdvancedAds\Modules\OneClick\AdsTxt\Detector; 17 use AdvancedAds\Framework\Utilities\Params;18 18 use AdvancedAds\Framework\Interfaces\Integration_Interface; 19 19 … … 76 76 wp_send_json_success( 77 77 [ 78 'message' => esc_html__( ' Pubguru successfully connected.', 'advanced-ads' ),78 'message' => esc_html__( 'We have successfully migrated your MonetizeMore Pubguru Ad Units to your WordPress site. The existing placements and ads have been paused.', 'advanced-ads' ), 79 79 'hasTrafficCop' => Helpers::has_traffic_cop( $config ), 80 80 ] … … 107 107 check_ajax_referer( 'pubguru_module_changed', 'security' ); 108 108 109 $module = Params::post( 'module', [] ); 110 $status = Params::post( 'status', false, FILTER_VALIDATE_BOOLEAN ); 111 $option_key = 'pubguru_module_' . $module; 109 $module = Params::post( 'module', [] ); 110 $status = Params::post( 'status', false, FILTER_VALIDATE_BOOLEAN ); 112 111 113 update_option( $option_key, $status );112 Options::module( $module, $status ); 114 113 115 do_action( 'pubguru_module_status_changed', $module, $status );114 $data = apply_filters( 'pubguru_module_status_changed', [], $module, $status ); 116 115 117 $notice = ''; 118 119 if ( 'ads_txt' === $module && $status ) { 120 $detector = new Detector(); 121 if ( $detector->detect_files() ) { 122 ob_start(); 123 $detector->show_notice(); 124 $notice = ob_get_clean(); 125 } 126 } 127 128 wp_send_json_success( [ 'notice' => $notice ] ); 116 wp_send_json_success( $data ); 129 117 } 130 118 … … 137 125 check_ajax_referer( 'pubguru_backup_adstxt', 'security' ); 138 126 139 ( new Detector() )->backup_file(); 127 $notice = ''; 128 $result = ( new Detector() )->backup_file(); 129 if ( false === $result ) { 130 $notice = sprintf( 131 '<div class="notice notice-error flex items-center p-4">%s</div>', 132 esc_html__( 'An error has occurred please try again.', 'advanced-ads' ) 133 ); 134 wp_send_json_error( $notice ); 135 } 140 136 141 wp_send_json_success(); 137 $notice = sprintf( 138 '<div class="notice notice-success flex items-center p-4">%s</div>', 139 esc_html__( 'File successfully backed up.', 'advanced-ads' ) 140 ); 141 wp_send_json_success( $notice ); 142 142 } 143 143 -
advanced-ads/trunk/modules/one-click/class-helpers.php
r3041809 r3145275 10 10 namespace AdvancedAds\Modules\OneClick; 11 11 12 use AdvancedAds\ Utilities\Str;12 use AdvancedAds\Constants; 13 13 use AdvancedAds\Utilities\WordPress; 14 use AdvancedAds\Framework\Utilities\Str; 14 15 15 16 defined( 'ABSPATH' ) || exit; … … 19 20 */ 20 21 class Helpers { 21 22 /**23 * Is module enabled.24 *25 * @param string $name name of module.26 *27 * @return bool28 */29 public static function is_module_enabled( $name ): bool {30 return boolval( get_option( "pubguru_module_{$name}" ) );31 }32 22 33 23 /** … … 96 86 97 87 foreach ( $configs['configs'] as $config ) { 98 if ( Str:: str_contains( $needle, $config['name'] ) ) {88 if ( Str::contains( $needle, $config['name'] ) ) { 99 89 return $config['name']; 100 90 } … … 112 102 $ads = self::get_ads_from_config(); 113 103 114 if ( $ads && ! wp_next_scheduled( 'advanced-ads-pghb-auto-ad-creation') ) {115 wp_schedule_single_event( current_datetime()->getTimestamp() + MINUTE_IN_SECONDS, 'advanced-ads-pghb-auto-ad-creation');104 if ( $ads && ! wp_next_scheduled( Constants::CRON_API_ADS_CREATION ) ) { 105 wp_schedule_single_event( current_datetime()->getTimestamp() + 5, Constants::CRON_API_ADS_CREATION ); 116 106 } 117 107 } … … 140 130 } 141 131 } 132 } else { 133 $domain = WordPress::get_site_domain(); 134 $pubguru_config_ads = [ 135 $domain . '_leaderboard' => [ 136 'ad_unit' => $domain . '_leaderboard', 137 'slot' => $domain . '_leaderboard', 138 'device' => 'All', 139 'placement' => 'Before Content', 140 'placement_conditions' => 'All', 141 'in_content_position' => 'Before', 142 'in_content_count' => 1, 143 'in_content_element' => 'p', 144 'in_content_repeat' => false, 145 ], 146 $domain . '_in_content_1' => [ 147 'ad_unit' => $domain . '_in_content_1', 148 'slot' => $domain . '_in_content_1', 149 'device' => 'All', 150 'placement' => 'Before Content', 151 'placement_conditions' => 'All', 152 'in_content_position' => 'Before', 153 'in_content_count' => 1, 154 'in_content_element' => 'p', 155 'in_content_repeat' => false, 156 ], 157 $domain . '_in_content_2' => [ 158 'ad_unit' => $domain . '_in_content_2', 159 'slot' => $domain . '_in_content_2', 160 'device' => 'All', 161 'placement' => 'After Content', 162 'placement_conditions' => 'All', 163 'in_content_position' => 'Aefore', 164 'in_content_count' => 3, 165 'in_content_element' => 'p', 166 'in_content_repeat' => true, 167 ], 168 ]; 142 169 } 143 170 … … 155 182 global $post; 156 183 184 if ( ! $post ) { 185 return false; 186 } 187 157 188 if ( ! $post_id ) { 158 189 $post_id = $post->ID; -
advanced-ads/trunk/modules/one-click/class-options.php
r3041809 r3145275 37 37 return update_option( self::CONFIG_KEY, $data ); 38 38 } 39 40 /** 41 * Read and Write pubguru module status 42 * 43 * @param string $module Module name. 44 * @param bool $status Module status. 45 * 46 * @return bool 47 */ 48 public static function module( $module, $status = null ): bool { 49 $option_key = 'pubguru_module_' . $module; 50 51 if ( null === $status ) { 52 return boolval( get_option( $option_key, false ) ); 53 } 54 55 update_option( $option_key, $status ); 56 57 return $status; 58 } 39 59 } -
advanced-ads/trunk/modules/one-click/modules/adstxt/class-adstxt.php
r3041809 r3145275 12 12 use AdvancedAds\Utilities\WordPress; 13 13 use AdvancedAds\Framework\Interfaces\Integration_Interface; 14 use AdvancedAds\Framework\Utilities\Params; 15 use AdvancedAds\Framework\Utilities\Str; 14 16 15 17 defined( 'ABSPATH' ) || exit; … … 28 30 remove_action( 'advanced-ads-plugin-loaded', 'advanced_ads_ads_txt_init' ); 29 31 30 add_action( 'init', [ $this, 'add_rewrite_rules' ] );31 add_filter( 'query_vars', [ $this, 'add_query_vars' ] );32 32 add_action( 'template_redirect', [ $this, 'handle_redirect' ] ); 33 33 add_filter( 'allowed_redirect_hosts', [ $this, 'allowed_redirect_hosts' ] ); 34 35 if ( is_admin() ) {36 ( new Detector() )->hooks();37 }38 }39 40 /**41 * Add rewrite rules42 *43 * @return void44 */45 public function add_rewrite_rules(): void {46 global $wp_rewrite;47 48 if ( ! $wp_rewrite->using_permalinks() ) {49 return;50 }51 52 add_rewrite_rule( 'ads\.txt$', $wp_rewrite->index . '?adstxt=1', 'top' );53 }54 55 /**56 * Add query var57 *58 * @param array $vars Array to hold query variables.59 *60 * @return array61 */62 public function add_query_vars( $vars ): array {63 $vars[] = 'adstxt';64 return $vars;65 34 } 66 35 … … 71 40 */ 72 41 public function handle_redirect(): void { 73 if ( empty( get_query_var( 'adstxt' ) ) ) { 42 if ( 43 'ads-txt' !== get_query_var( 'name' ) || 44 Str::contains( Params::server( 'REQUEST_URI' ), 'ads.txt' ) 45 ) { 74 46 return; 75 47 } 76 48 77 $redirect = sprintf( 'https://adstxt.pubguru.net/ %s/ads.txt', WordPress::get_site_domain() );49 $redirect = sprintf( 'https://adstxt.pubguru.net/pg/%s/ads.txt', WordPress::get_site_domain() ); 78 50 wp_safe_redirect( $redirect, 301 ); 79 51 exit; -
advanced-ads/trunk/modules/one-click/modules/adstxt/class-detector.php
r3041809 r3145275 40 40 41 41 if ( $this->detect_files() ) { 42 add_action( ' pubguru_notices', [ $this, 'show_notice' ] );42 add_action( 'all_admin_notices', [ $this, 'show_notice' ] ); 43 43 } 44 44 } … … 47 47 * Detect file exists 48 48 * 49 * @param string $file file name. 50 * 49 51 * @return bool 50 52 */ 51 public function detect_files( ): bool {53 public function detect_files( $file = 'ads.txt' ): bool { 52 54 $wp_filesystem = $this->get_filesystem(); 53 55 if ( null === $wp_filesystem ) { … … 55 57 } 56 58 57 return $wp_filesystem->exists( ABSPATH . '/ ads.txt');59 return $wp_filesystem->exists( ABSPATH . '/' . $file ); 58 60 } 59 61 … … 64 66 */ 65 67 public function backup_file(): bool { 66 $ wp_filesystem = $this->get_filesystem();67 if ( null === $wp_filesystem ) {68 return false;69 }68 $source = ABSPATH . '/ads.txt'; 69 $destination = $source . '.bak'; 70 return $this->move_file( $source, $destination ); 71 } 70 72 71 return $wp_filesystem->move( ABSPATH . '/ads.txt', ABSPATH . '/ads.txt.bak' ); 73 /** 74 * Revert file 75 * 76 * @return bool 77 */ 78 public function revert_file(): bool { 79 $source = ABSPATH . '/ads.txt.bak'; 80 $destination = ABSPATH . 'ads.txt'; 81 return $this->move_file( $source, $destination ); 72 82 } 73 83 … … 79 89 public function show_notice(): void { 80 90 ?> 81 <div class=" flex shadow-lg rounded">82 <div class="bg-red-600 p-3 rounded-l flex items-center">83 <s vg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" class="fill-current text-white w-5" viewBox="0 0 32 32" aria-hidden="true"><path d="M2,16H2A14,14,0,1,0,16,2,14,14,0,0,0,2,16Zm23.15,7.75L8.25,6.85a12,12,0,0,1,16.9,16.9ZM8.24,25.16A12,12,0,0,1,6.84,8.27L23.73,25.16a12,12,0,0,1-15.49,0Z"></path><title>Error</title></svg>91 <div class="notice notice-error flex items-center p-4"> 92 <div> 93 <strong><?php esc_html_e( 'File alert!', 'advanced-ads' ); ?></strong> <?php esc_html_e( 'Physical ads.txt found. In order to use PubGuru service you need to delete it or back it up.', 'advanced-ads' ); ?> 84 94 </div> 85 95 86 <div class="p-3 bg-white rounded-r w-full flex justify-between items-center"> 87 <div> 88 <span class="font-medium"><?php esc_html_e( 'File alert!', 'advanced-ads' ); ?></span> <?php esc_html_e( 'Physical ads.txt found. In order to use PubGuru service you need to delete it.', 'advanced-ads' ); ?> 89 </div> 90 <button class="js-btn-backup-adstxt px-3 py-2 rounded text-xs bg-blue-600 text-white hover:bg-blue-700" data-text="<?php esc_attr_e( 'Backup the File', 'advanced-ads' ); ?>" data-loading="<?php esc_attr_e( 'Backing Up', 'advanced-ads' ); ?>" data-done="<?php esc_attr_e( 'Backed Up', 'advanced-ads' ); ?>" data-security="<?php echo wp_create_nonce( 'pubguru_backup_adstxt' ); // phpcs:ignore ?>"> 91 <?php esc_html_e( 'Backup the File', 'advanced-ads' ); ?> 92 </button> 93 </div> 96 <button class="!ml-auto button button-primary js-btn-backup-adstxt" data-text="<?php esc_attr_e( 'Backup the File', 'advanced-ads' ); ?>" data-loading="<?php esc_attr_e( 'Backing Up', 'advanced-ads' ); ?>" data-done="<?php esc_attr_e( 'Backed Up', 'advanced-ads' ); ?>" data-security="<?php echo wp_create_nonce( 'pubguru_backup_adstxt' ); // phpcs:ignore ?>"> 97 <?php esc_html_e( 'Backup the File', 'advanced-ads' ); ?> 98 </button> 94 99 </div> 95 100 <?php … … 101 106 * @return object 102 107 */ 103 p ublicfunction get_filesystem() {108 private function get_filesystem() { 104 109 global $wp_filesystem; 105 110 … … 111 116 return $wp_filesystem; 112 117 } 118 119 /** 120 * Handle file operations (backup or revert) 121 * 122 * @param string $source Source file path. 123 * @param string $destination Destination file path. 124 * 125 * @return bool 126 */ 127 private function move_file( string $source, string $destination ): bool { 128 $wp_filesystem = $this->get_filesystem(); 129 130 if ( null === $wp_filesystem || ! $wp_filesystem->is_writable( $source ) ) { 131 return false; 132 } 133 134 return $wp_filesystem->move( $source, $destination ); 135 } 113 136 } -
advanced-ads/trunk/modules/one-click/modules/class-header-bidding.php
r3041809 r3145275 10 10 namespace AdvancedAds\Modules\OneClick; 11 11 12 use AdvancedAds\ Utilities\Str;12 use AdvancedAds\Framework\Utilities\Str; 13 13 use AdvancedAds\Framework\Interfaces\Integration_Interface; 14 14 … … 19 19 */ 20 20 class Header_Bidding implements Integration_Interface { 21 22 /**23 * Check if has gpt24 *25 * @var bool26 */27 private $has_gpt = false;28 29 /**30 * Check if has pubguru tag31 *32 * @var bool33 */34 private $has_pubguru = false;35 36 /**37 * Check if has traffic cop atq38 *39 * @var bool40 */41 private $has_traffic_cop = false;42 21 43 22 /** … … 72 51 public function remove_tags( $script ): string { 73 52 74 if ( Str::str_contains( '/gpt.js', $script ) ) { 75 $script = ''; 76 $this->has_gpt = true; 53 if ( Str::contains( '/gpt.js', $script ) ) { 54 $script = ''; 77 55 } 78 56 79 if ( Str::str_contains( '//m2d.m2.ai/', $script ) || Str::str_contains( '//c.pubguru.net/', $script ) ) { 80 $script = ''; 81 $this->has_gpt = true; 82 $this->has_pubguru = true; 57 if ( Str::contains( '//m2d.m2.ai/', $script ) || Str::contains( '//c.pubguru.net/', $script ) ) { 58 $script = ''; 83 59 } 84 60 85 if ( Str::str_contains( 'window.pg.atq = window.pg.atq || [];', $script ) ) { 86 $script = ''; 87 $this->has_traffic_cop = true; 61 if ( Str::contains( 'window.pg.atq = window.pg.atq || [];', $script ) ) { 62 $script = ''; 88 63 } 89 64 … … 99 74 */ 100 75 private function add_script_tag( $page ): string { 101 $name = Helpers::get_config_file(); 76 $name = Helpers::get_config_file(); 77 $at_body = Options::module( 'header_bidding_at_body' ); 102 78 103 79 if ( $name ) { 104 $script = [ '<head>' ]; 105 106 if ( $this->has_gpt ) { 107 $script[] = '<script src="https://securepubads.g.doubleclick.net/tag/js/gpt.js" async></script>'; // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript 108 $script[] = '<script type="text/javascript">window.googletag=window.googletag||{};window.googletag.cmd=window.googletag.cmd||[];'; 109 $script[] = 'window.googletag.cmd.push(function(){window.__onpageGptEmbed=(new Date()).getTime()})</script>'; 80 $script = []; 81 if ( ! $at_body ) { 82 $script[] = '<head>'; 110 83 } 111 84 112 if ( $this->has_pubguru ) { 113 $script[] = sprintf( '<script src="//c.pubguru.net/%s" async> </script>', $name ); // phpcs:ignore 114 } 85 $script[] = '<script src="https://securepubads.g.doubleclick.net/tag/js/gpt.js" async></script>'; // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript 86 $script[] = '<script type="text/javascript">window.googletag=window.googletag||{};window.googletag.cmd=window.googletag.cmd||[];'; 87 $script[] = 'window.googletag.cmd.push(function(){window.__onpageGptEmbed=(new Date()).getTime()})</script>'; 88 $script[] = sprintf( '<script src="//c.pubguru.net/%s" async> </script>', $name ); // phpcs:ignore 115 89 116 if ( Helpers::is_module_enabled( 'traffic_cop' ) && Helpers::has_traffic_cop() && $this->has_traffic_cop) {90 if ( Options::module( 'traffic_cop' ) && Helpers::has_traffic_cop() ) { 117 91 $script[] = '<script>window.pg = window.pg || {};window.pg.atq = window.pg.atq || [];</script>'; 118 92 } 119 93 120 $page = str_replace( '<head>', join( "\n", $script ), $page ); 94 if ( $at_body ) { 95 $page = $page . join( "\n", $script ); 96 } else { 97 $page = str_replace( 98 '<head>', 99 join( "\n", $script ), 100 $page 101 ); 102 } 121 103 } 122 104 -
advanced-ads/trunk/modules/one-click/modules/class-traffic-cop.php
r3041809 r3145275 10 10 namespace AdvancedAds\Modules\OneClick; 11 11 12 use AdvancedAds\ Utilities\Str;12 use AdvancedAds\Framework\Utilities\Str; 13 13 use AdvancedAds\Framework\Interfaces\Integration_Interface; 14 14 … … 38 38 public function modify_script_tag( $content ) { 39 39 // Early bail!! 40 if ( ! Str:: str_contains( 'googletag.display', $content ) ) {40 if ( ! Str::contains( 'googletag.display', $content ) ) { 41 41 return false; 42 42 } -
advanced-ads/trunk/modules/one-click/modules/class-workflow.php
r3041809 r3145275 10 10 namespace AdvancedAds\Modules\OneClick; 11 11 12 use AdvancedAds\Constants; 13 use AdvancedAds\Importers\Api_Ads; 12 14 use AdvancedAds\Modules\OneClick\Helpers; 13 15 use AdvancedAds\Modules\OneClick\Options; 16 use AdvancedAds\Framework\Utilities\Params; 17 use AdvancedAds\Modules\OneClick\Traffic_Cop; 18 use AdvancedAds\Modules\OneClick\AdsTxt\AdsTxt; 19 use AdvancedAds\Modules\OneClick\AdsTxt\Detector; 14 20 use AdvancedAds\Framework\Interfaces\Integration_Interface; 15 use AdvancedAds\Framework\Utilities\Params;16 use AdvancedAds\Modules\OneClick\AdsTxt\AdsTxt;17 use AdvancedAds\Modules\OneClick\Traffic_Cop;18 21 19 22 defined( 'ABSPATH' ) || exit; … … 38 41 public function hooks(): void { 39 42 add_action( 'init', [ $this, 'flush_rewrite_rules' ], 999 ); 40 add_ action( 'pubguru_module_status_changed', [ $this, 'module_status_changed' ], 10, 1);41 add_action( 'advanced-ads-pghb-auto-ad-creation', [ $this, 'auto_ad_creation' ], 10, 0 );43 add_filter( 'pubguru_module_status_changed', [ $this, 'module_status_changed' ], 10, 3 ); 44 add_action( Constants::CRON_API_ADS_CREATION, [ $this, 'auto_ad_creation' ], 10, 0 ); 42 45 43 46 if ( false !== Options::pubguru_config() && ! is_admin() ) { 44 47 add_action( 'wp', [ $this, 'init' ] ); 45 48 46 if ( Helpers::is_module_enabled( 'ads_txt' ) ) {49 if ( Options::module( 'ads_txt' ) ) { 47 50 ( new AdsTxt() )->hooks(); 48 51 } 52 } 53 54 if ( Options::module( 'ads_txt' ) ) { 55 if ( is_admin() ) { 56 ( new Detector() )->hooks(); 57 } 58 remove_action( 'advanced-ads-plugin-loaded', 'advanced_ads_ads_txt_init' ); 49 59 } 50 60 } … … 64 74 Page_Parser::get_instance(); 65 75 66 if ( $is_debugging || Helpers::is_module_enabled( 'header_bidding' ) ) {76 if ( $is_debugging || Options::module( 'header_bidding' ) ) { 67 77 ( new Header_Bidding() )->hooks(); 68 78 } 69 79 70 if ( $is_debugging || Helpers::is_module_enabled( 'tag_conversion' ) ) {80 if ( $is_debugging || Options::module( 'tag_conversion' ) ) { 71 81 ( new Tags_Conversion() )->hooks(); 72 82 } 73 83 74 if ( Helpers::is_module_enabled( 'traffic_cop' ) && Helpers::has_traffic_cop() ) {75 if ( ! Helpers::is_module_enabled( 'header_bidding' ) ) {84 if ( Options::module( 'traffic_cop' ) && Helpers::has_traffic_cop() ) { 85 if ( ! Options::module( 'header_bidding' ) ) { 76 86 ( new Header_Bidding() )->hooks(); 77 87 } … … 84 94 * Handle module status change 85 95 * 96 * @param array $data Data to send back to ajax request. 86 97 * @param string $module Module name. 98 * @param bool $status Module status. 87 99 * 88 * @return void100 * @return array 89 101 */ 90 public function module_status_changed( $ module ): void{102 public function module_status_changed( $data, $module, $status ): array { 91 103 if ( 'ads_txt' === $module ) { 104 $detector = new Detector(); 105 if ( $status && $detector->detect_files() ) { 106 ob_start(); 107 $detector->show_notice(); 108 $notice = ob_get_clean(); 109 if ( $notice ) { 110 $data['notice'] = $notice; 111 } 112 } 113 114 if ( ! $status && $detector->detect_files( 'ads.txt.bak' ) ) { 115 $detector->revert_file(); 116 } 117 92 118 update_option( self::FLUSH_KEY, 1 ); 93 119 } 120 121 return $data; 94 122 } 95 123 … … 112 140 */ 113 141 public function auto_ad_creation(): void { 114 $ads = Helpers::get_ads_from_config(); 115 // ( new Auto_Ads() )->run( $ads ); 142 ( new Api_Ads() )->import(); 116 143 } 117 144 } -
advanced-ads/trunk/packages/composer/LICENSE
r3134733 r3145275 1 1 2 Copyright (c) Nils Adermann, Jordi Boggiano 2 3 … … 18 19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 20 THE SOFTWARE. 21 -
advanced-ads/trunk/packages/composer/autoload_classmap.php
r3134733 r3145275 24 24 'AdvancedAds\\Assets_Registry' => $baseDir . '/includes/class-assets-registry.php', 25 25 'AdvancedAds\\Autoloader' => $baseDir . '/includes/class-autoloader.php', 26 'AdvancedAds\\Constants' => $baseDir . '/includes/class-constants.php', 26 27 'AdvancedAds\\Entities' => $baseDir . '/includes/class-entities.php', 27 28 'AdvancedAds\\Framework\\Assets_Registry' => $vendorDir . '/advanced-ads/framework/src/class-assets-registry.php', … … 58 59 'AdvancedAds\\Groups\\Types\\Standard' => $baseDir . '/includes/groups/types/type-standard.php', 59 60 'AdvancedAds\\Groups\\Types\\Unknown' => $baseDir . '/includes/groups/types/type-unknown.php', 61 'AdvancedAds\\Importers\\Api_Ads' => $baseDir . '/includes/importers/class-api-ads.php', 62 'AdvancedAds\\Importers\\Importer' => $baseDir . '/includes/importers/abstract-importer.php', 63 'AdvancedAds\\Importers\\Manager' => $baseDir . '/includes/importers/class-manager.php', 60 64 'AdvancedAds\\Installation\\Capabilities' => $baseDir . '/includes/installation/class-capabilities.php', 61 65 'AdvancedAds\\Installation\\Install' => $baseDir . '/includes/installation/class-install.php', 62 66 'AdvancedAds\\Installation\\Uninstall' => $baseDir . '/includes/installation/class-uninstall.php', 63 67 'AdvancedAds\\Interfaces\\Group_Type' => $baseDir . '/includes/interfaces/interface-group-type.php', 68 'AdvancedAds\\Interfaces\\Importer' => $baseDir . '/includes/interfaces/interface-importer.php', 64 69 'AdvancedAds\\Interfaces\\Screen_Interface' => $baseDir . '/includes/interfaces/interface-screen.php', 65 70 'AdvancedAds\\Modules\\OneClick\\Admin\\Admin' => $baseDir . '/modules/one-click/admin/class-admin.php', … … 67 72 'AdvancedAds\\Modules\\OneClick\\AdsTxt\\AdsTxt' => $baseDir . '/modules/one-click/modules/adstxt/class-adstxt.php', 68 73 'AdvancedAds\\Modules\\OneClick\\AdsTxt\\Detector' => $baseDir . '/modules/one-click/modules/adstxt/class-detector.php', 69 'AdvancedAds\\Modules\\OneClick\\Auto_Ads' => $baseDir . '/modules/one-click/modules/class-auto-ads.php',70 74 'AdvancedAds\\Modules\\OneClick\\Header_Bidding' => $baseDir . '/modules/one-click/modules/class-header-bidding.php', 71 75 'AdvancedAds\\Modules\\OneClick\\Helpers' => $baseDir . '/modules/one-click/class-helpers.php', -
advanced-ads/trunk/packages/composer/autoload_static.php
r3134733 r3145275 53 53 'AdvancedAds\\Assets_Registry' => __DIR__ . '/../..' . '/includes/class-assets-registry.php', 54 54 'AdvancedAds\\Autoloader' => __DIR__ . '/../..' . '/includes/class-autoloader.php', 55 'AdvancedAds\\Constants' => __DIR__ . '/../..' . '/includes/class-constants.php', 55 56 'AdvancedAds\\Entities' => __DIR__ . '/../..' . '/includes/class-entities.php', 56 57 'AdvancedAds\\Framework\\Assets_Registry' => __DIR__ . '/..' . '/advanced-ads/framework/src/class-assets-registry.php', … … 87 88 'AdvancedAds\\Groups\\Types\\Standard' => __DIR__ . '/../..' . '/includes/groups/types/type-standard.php', 88 89 'AdvancedAds\\Groups\\Types\\Unknown' => __DIR__ . '/../..' . '/includes/groups/types/type-unknown.php', 90 'AdvancedAds\\Importers\\Api_Ads' => __DIR__ . '/../..' . '/includes/importers/class-api-ads.php', 91 'AdvancedAds\\Importers\\Importer' => __DIR__ . '/../..' . '/includes/importers/abstract-importer.php', 92 'AdvancedAds\\Importers\\Manager' => __DIR__ . '/../..' . '/includes/importers/class-manager.php', 89 93 'AdvancedAds\\Installation\\Capabilities' => __DIR__ . '/../..' . '/includes/installation/class-capabilities.php', 90 94 'AdvancedAds\\Installation\\Install' => __DIR__ . '/../..' . '/includes/installation/class-install.php', 91 95 'AdvancedAds\\Installation\\Uninstall' => __DIR__ . '/../..' . '/includes/installation/class-uninstall.php', 92 96 'AdvancedAds\\Interfaces\\Group_Type' => __DIR__ . '/../..' . '/includes/interfaces/interface-group-type.php', 97 'AdvancedAds\\Interfaces\\Importer' => __DIR__ . '/../..' . '/includes/interfaces/interface-importer.php', 93 98 'AdvancedAds\\Interfaces\\Screen_Interface' => __DIR__ . '/../..' . '/includes/interfaces/interface-screen.php', 94 99 'AdvancedAds\\Modules\\OneClick\\Admin\\Admin' => __DIR__ . '/../..' . '/modules/one-click/admin/class-admin.php', … … 96 101 'AdvancedAds\\Modules\\OneClick\\AdsTxt\\AdsTxt' => __DIR__ . '/../..' . '/modules/one-click/modules/adstxt/class-adstxt.php', 97 102 'AdvancedAds\\Modules\\OneClick\\AdsTxt\\Detector' => __DIR__ . '/../..' . '/modules/one-click/modules/adstxt/class-detector.php', 98 'AdvancedAds\\Modules\\OneClick\\Auto_Ads' => __DIR__ . '/../..' . '/modules/one-click/modules/class-auto-ads.php',99 103 'AdvancedAds\\Modules\\OneClick\\Header_Bidding' => __DIR__ . '/../..' . '/modules/one-click/modules/class-header-bidding.php', 100 104 'AdvancedAds\\Modules\\OneClick\\Helpers' => __DIR__ . '/../..' . '/modules/one-click/class-helpers.php', -
advanced-ads/trunk/readme.txt
r3134930 r3145275 1 1 === Advanced Ads – Ad Manager & AdSense === 2 2 Contributors: webzunft, advancedads 3 Tags: ads, adsense, am p, ads.txt, ad rotations, ad blocker, amazon, banner, click fraud protection, google ad manager, header code, lazy loading,3 Tags: ads, adsense, amazon, affiliate, ad manager 4 4 Requires at least: 5.0 5 5 Tested up to: 6.5 6 6 Requires PHP: 7.2 7 Stable tag: 1.5 3.27 Stable tag: 1.54.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Manage and optimize all ad types. Support for Google AdSense Auto ads, Amazon, image banners, HTML, page builder, ad widget, ad rotations, ads.txt 11 The only complete toolkit for all ad types. Grow your revenue with AdSense, Amazon—or any affiliate network. Get pinpoint targeting and best support! 12 12 13 13 == Description == … … 31 31 This is what our users are saying about Advanced Ads: 32 32 33 > We use this plugin to deliver rotating ads on a community news site, and it’s great. We’ve delivered over a million ad impressions since we launched less than a year ago, using a combination of sidebar, top, sticky and in-content placements — both HTML5 a nd images. Advanced Ads makes it easy for our small team to deliver a good experience to our users and our advertisers.33 > We use this plugin to deliver rotating ads on a community news site, and it’s great. We’ve delivered over a million ad impressions since we launched less than a year ago, using a combination of sidebar, top, sticky and in-content placements — both HTML5 ads and images. Advanced Ads makes it easy for our small team to deliver a good experience to our users and our advertisers. 34 34 > <i>mytown304 on wp.org</i> 35 35 … … 37 37 38 38 = Premium Features = 39 This plugin is the lite version of the Advanced Ads plugin that comes with all the features you will ever need to optimize your ads and increase your revenues, including performance tracking, advanced ad targeting, split tests, click fraud protection, lazy loading, background ads, popups and sticky ads, full AMP support, adblocker detection, the most comfortable Google Ad Manager integration, and tons more. [Click here to purchase the best premium WordPress ad management plugin now!](https://wpadvancedads.com/add-ons/all-access/?utm_source=wporg&utm_medium=link&utm_campaign=wp-all-access)39 This plugin is the lite version of the Advanced Ads plugin that comes with all the features you will ever need to optimize your ads and increase your revenues, including performance tracking, advanced ad targeting, split tests, click fraud protection, lazy loading, background ads, floating ads, popups and sticky ads, full AMP support, adblocker detection, the most comfortable Google Ad Manager integration, and tons more. [Click here to purchase the best premium WordPress ad management plugin now!](https://wpadvancedads.com/add-ons/all-access/?utm_source=wporg&utm_medium=link&utm_campaign=wp-all-access) 40 40 41 41 [Full Feature List](https://wpadvancedads.com/features/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features) 42 42 43 = ad management =43 = Ad Management = 44 44 45 45 * create and display **unlimited** ad units … … 49 49 * inject ads into posts and pages automatically without coding 50 50 51 = ad types =51 = Ad Types = 52 52 53 53 Choose between different ad types that enable you to: 54 54 55 * insert ads and banners from all ad and affiliate networks (e.g., [Google AdSense](https://wpadvancedads.com/adsense-ads/), [Amazon Affiliate Program ](https://wpadvancedads.com/amazon-affiliate-program-wordpress/), BuySellAds, Google Ad Manager (formerly Google DoubleClick for Publishers, DFP), Ezoic, media.net, [Booking.com](https://wpadvancedads.com/booking-com-ads-wordpress/), Tradedoubler, Awin, Getyourguide, The Moneytizer, Infolinks...)55 * insert ads and banners from all ad and affiliate networks (e.g., [Google AdSense](https://wpadvancedads.com/adsense-ads/), [Amazon Affiliate Program Amazon Associates](https://wpadvancedads.com/amazon-affiliate-program-wordpress/), BuySellAds, Google Ad Manager (formerly Google DoubleClick for Publishers, DFP), Ezoic, media.net, [Booking.com](https://wpadvancedads.com/booking-com-ads-wordpress/), Tradedoubler, Awin, GetYourGuide, The Moneytizer, Infolinks...) 56 56 * dedicated support for all types of Google AdSense ads, including text and display ads, native ads (In-article, In-feed, Multiplex ads), Auto ads, and Auto ads for AMP 57 57 * display images and image banners 58 58 * create content-rich ads with the WordPress TinyMCE editor 59 59 * insert contextual Amazon Native Shopping Ads 60 * inject HTML, CSS, Javascript or PHP code61 * use shortcodes within ads (to also deliver advertisements from another ad plugin like Ad Inserter, AdRotate, Quick AdSense, Ad s for WP, or the Google AdSense Plugin WP QUADS)62 63 = display ads for WordPress =60 * inject HTML, CSS, Javascript, or PHP code 61 * use shortcodes within ads (to also deliver advertisements from another ad plugin like Ad Inserter, AdRotate, Quick AdSense, AdSanity, Ads for WP, or the Google AdSense plugin WP QUADS) 62 63 = Display Ads for WordPress = 64 64 65 65 * auto-inject ads via placements 66 66 * use functions to display ads in template files 67 * use shortcodes to place ads manually in post content67 * use shortcodes to place ads manually 68 68 * show ads in the sidebar and in widgets 69 69 * disable all ads on specific pages 70 * display multiple ads (ad grids)71 70 * display a customizable ad label, e.g., “Advertisements” above each banner ad 72 73 = display conditions = 71 * display multiple ads in ad grids ([Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-5)) 72 73 = Display Conditions = 74 74 75 75 Show ads based on content. [List of all display conditions](https://wpadvancedads.com/manual/display-conditions/) … … 79 79 * archive pages by category, tags, taxonomies 80 80 * special page types like 404, attachment and front page 81 * posts and pages by contained keywords [(keyword targeting)](https://wpadvancedads.com/manual/ads-based-on-keywords/?utm_source=wporg&utm_medium=link&utm_campaign=features) or URL parameters, included in [Advanced Ads Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-1)82 81 * hide ads on secondary queries (e.g., posts in sidebars) 83 82 * display or hide banners within the post feed 84 83 * hide all ads from specific page types, e.g., 404 pages, feed 85 84 * hide ads from bots and web crawlers 86 87 = visitor conditions = 85 * posts and pages by contained keywords [(keyword targeting)](https://wpadvancedads.com/manual/ads-based-on-keywords/?utm_source=wporg&utm_medium=link&utm_campaign=features) or URL parameters, included in [Advanced Ads Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-1) 86 87 = Visitor Conditions = 88 88 89 89 Serve ads by conditions based on the visitor. [List of all visitor conditions](https://wpadvancedads.com/manual/visitor-conditions/) … … 92 92 * display or hide a banner by role and for logged-in visitors 93 93 * advanced visitor conditions: geolocation, previously visited URL (referrer), user capability, browser language, browser, and browser width included in [Advanced Ads Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-2) 94 * frequency capping ([Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-6)) 94 95 95 96 > **Fantastic plugin and outstanding support** … … 97 98 > djsawyer on wp.org 98 99 99 = ad injection | placements =100 = Ad Injection | Placements = 100 101 101 102 Placements to insert ads in pre-defined positions in your theme and content. [List of all placements](https://wpadvancedads.com/manual/placements/) … … 107 108 * [Page peel banners](https://wpadvancedads.com/page-peel-ads/) 108 109 * create [split tests and A/B testing](https://wpadvancedads.com/ab-testing-wordpress/) 109 * many more ad positions with [add-ons](https://wpadvancedads.com/add-ons/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features)110 110 * automatic insertion of any kind of footer and header code, not only advertising 111 111 * use the [ad server](https://wpadvancedads.com/ad-server-wordpress/) placement to display ads on other sites 112 113 = mobile devices = 112 * many more ad positions with [add-ons](https://wpadvancedads.com/add-ons/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features) 113 114 = Mobile Devices = 114 115 115 116 * target ads to mobile devices, or tablets, or desktops 116 117 * display responsive image ads 117 * ads only for specific browser sizes using [Advanced AdsPro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-3)118 * insert ads on AMP pages with [AMP Ads](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-amp-ads-1)118 * ads only for specific browser sizes [Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-3) 119 * insert ads on AMP pages [AMP Ads add-on](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-amp-ads-1) 119 120 120 121 = Google AdSense = … … 133 134 * easy Ad Health integration and Google AdSense violation checks 134 135 * option to remove the Google AdSense background color 135 * place Google AdSense In-feed ads using the also free [In-feed add-on](https://wordpress.org/plugins/advanced-ads-adsense-in-feed/)136 * assistant for exact sizes of responsive Google AdSense ads with the [AMP Ads add-on](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-amp-ads-2)137 * convert Google AdSense ads into AMP ads automatically with the [AMP Ads add-on](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-amp-ads-3)138 136 * ads.txt generated with the correct AdSense information automatically 139 137 * works along with Google Site Kit or can replace it if you want to [control your ad placements](https://wpadvancedads.com/place-adsense-ad-unit-manually/) 138 * place Google AdSense In-feed ads [free In-feed add-on](https://wordpress.org/plugins/advanced-ads-adsense-in-feed/) 139 * assistant for exact sizes of responsive Google AdSense ads [AMP Ads add-on](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-amp-ads-2) 140 * convert Google AdSense ads into AMP ads automatically [AMP Ads add-on](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-amp-ads-3) 140 141 141 142 https://vimeo.com/577120971 … … 145 146 > Your app is awesome, congratulations! Google Adsense suggests using your app on its official website, it’s incredible! 146 147 147 = ads.txt = 148 = Affiliate Marketing = 149 150 Easily integrate affiliate marketing with a comprehensive toolkit. 151 152 * unlimited affiliate ads and banners 153 * text link support 154 * affiliate disclosure 155 * automatic affiliate ad insertion 156 * advanced targeting 157 * dedicated AAWP ad type (Amazon Affiliate WordPress Plugin) 158 * integrates with other affiliate plugins like Pretty Links, Thirsty Affiliates, Lasso, and many more 159 * support for all Amazon ad formats 160 * compatible with all affiliate networks 161 * link masking and link cloaking ([Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-7)) 162 * affiliate ad tracking ([Tracking add-on](https://wpadvancedads.com/add-ons/tracking/?utm_source=wporg&utm_medium=link&utm_campaign=affiliate-tracking)) 163 164 165 = Ads.txt = 148 166 149 167 * generates an ads.txt with custom content … … 156 174 * all add-ons include priority email support 157 175 * [All Access](https://wpadvancedads.com/add-ons/all-access/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – includes all available add-ons 158 * [Advanced Ads Pro](https://wpadvancedads.com/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – powerful tools for ad optimizations: cache-busting, more placements, [lazy loading](https://wpadvancedads.com/lazy-load-ads/?utm_source=wporg&utm_medium=link&utm_campaign=features), ad blocker module, [click fraud protection](https://wpadvancedads.com/manual/click-fraud-protection/?utm_source=wporg&utm_medium=link&utm_campaign=features), [geo targeting](https://wpadvancedads.com/add-ons/geo-targeting/?utm_source=wporg&utm_medium=link&utm_campaign=features), [parallax ads](https://wpadvancedads.com/parallax-ads/?utm_source=wporg&utm_medium=link&utm_campaign=features) and many more176 * [Advanced Ads Pro](https://wpadvancedads.com/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – powerful tools for ad optimizations: cache-busting, more placements, [lazy loading](https://wpadvancedads.com/lazy-load-ads/?utm_source=wporg&utm_medium=link&utm_campaign=features), ad blocker module, ad refresh, [click fraud protection](https://wpadvancedads.com/manual/click-fraud-protection/?utm_source=wporg&utm_medium=link&utm_campaign=features), [geo targeting](https://wpadvancedads.com/add-ons/geo-targeting/?utm_source=wporg&utm_medium=link&utm_campaign=features), [parallax ads](https://wpadvancedads.com/parallax-ads/?utm_source=wporg&utm_medium=link&utm_campaign=features) and many more 159 177 * [Tracking](https://wpadvancedads.com/add-ons/tracking/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – track ad impressions and ad clicks with local methods or Google Analytics 160 178 * [AMP Ads](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – make your ads compatible with AMP and convert Google AdSense ads automatically … … 167 185 * [Full Feature List](https://wpadvancedads.com/features/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) 168 186 169 = ad blocker =187 = Ad Blocker = 170 188 171 189 * basic features to prevent ads from being removed by AdBlock and other ad blockers 172 190 * prevent ad blockers from breaking sites where plugin scripts are running 173 * ad block ing detection: show alternative content to ad block users with [Advanced Ads Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-3) and improve the monetization of your website191 * ad blocker detection: show alternative content to ad block users and improve the monetization of your website [Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features-pro-4) 174 192 175 193 Learn more on the [plugin homepage](https://wpadvancedads.com). … … 188 206 - BuddyPress – [How to add ads on BuddyPress pages](https://wpadvancedads.com/ads-on-buddypress-pages/) 189 207 - bbPress – [How to show ads on bbPress pages?](https://wpadvancedads.com/ads-in-bbpress/) 190 - Cookie Consent, Borlabs Cookies, Complianz, GDPR Cookie Consent, and other content manager – [How to show ads based on visitors’ consent](https://wpadvancedads.com/manual/ad-cookie-consent/)208 - Cookie Consent, Borlabs Cookies, Complianz, GDPR Cookie Consent, and other privacy and consent manager – [How to show ads based on visitors’ consent](https://wpadvancedads.com/manual/ad-cookie-consent/) 191 209 - Elementor - [How to create and implement ads in Elementor](https://wpadvancedads.com/elementor-ads/) 192 210 - GamiPress – [How to target ads on GamiPress websites](https://wpadvancedads.com/manual/gamipress-ads/) 193 211 - Genesis – [Genesis Ads add-on](https://wpadvancedads.com/add-ons/genesis-ads/) 194 - [IAB TCF 2.0 consent](https://wpadvancedads.com/manual/tcf-consent-wordpress/) – hide ads until users give their consent. Integrating with any CMP, Quantcast Choices, iubenda, Google Funding Choices, cookiebot, etc.212 - [IAB TCF 2.0 consent](https://wpadvancedads.com/manual/tcf-consent-wordpress/) – hide ads until users give their consent. Integrating with any CMP, InMobi, iubenda, Google Funding Choices, cookiebot, etc. 195 213 - LearnDash - [How to integrate ads into LearnDash](https://wpadvancedads.com/learndash-ads/) 196 214 - MailPoet - [How to integrate Advanced Ads in MailPoet Newsletters](https://wpadvancedads.com/mailpoet-newsletters/) … … 201 219 - WPBakery Page Builder – [Displaying Ads with WPBakery Page Builder](https://wpadvancedads.com/visual-composer-ads/) 202 220 - WPML – [Showing different ads per language with WPML](https://wpadvancedads.com/translating-ads-wpml/) 221 - Youzify – [How to integrate ads in Youzify](https://wpadvancedads.com/how-to-integrate-ads-in-youzify/) 203 222 204 223 == Installation == … … 241 260 * Ads not showing up? Take a look [here](https://wpadvancedads.com/manual/ads-not-showing-up). 242 261 243 = What about my users’ privacy and GDPR ? =262 = What about my users’ privacy and GDPR compliance? = 244 263 245 264 The plugin comes with Privacy settings that help you gather consent from users before showing ads to them. The feature works for any ads managed with the plugin, including AdSense Auto ads. … … 257 276 = Which ad networks are supported? = 258 277 259 Advanced Ads is compatible with all ad networks and banners from affiliate programs like AWin, Google AdSense, Chitika, Clickbank, Amazon, and also Google Ad Manager (formerly Google DoubleClick for Publishers, DFP), media.net. 260 261 You can also use it to insert additional ad network tags into header or footer of your site without coding. 262 263 AdSense has even a dedicated ad type leveling the specific options this ad network provides. 278 Advanced Ads is compatible with all ad networks and banners from affiliate programs like Awin, Google AdSense, Chitika, Clickbank, CJ Affiliate, Amazon, ShareASale, Impact, Rakuten, Booking.com, GetYourGuide, media.net, and also Google Ad Manager (formerly Google DoubleClick for Publishers, DFP). 279 280 You can also use it to insert additional ad network tags into your site's header or footer without coding to integrate header bidding. 281 Advanced Ads even provides a dedicated AdSense ad type to leverage this ad network's specific options. 264 282 265 283 = PHP functions and shortcodes = … … 284 302 `<?php the_ad_placement('header-left'); ?>` 285 303 286 = Is there a revenue share? =287 288 There is no revenue shar e. Advanced Ads doesn’t alter your ad codes in a way that you earn less than you would directly including the ad code in your template.304 = Is there an ad revenue share? = 305 306 There is no revenue sharing. Advanced Ads doesn’t alter your ad codes in a way that you earn less than you would directly including the ad code in your template. To implement revenue sharing between multiple authors, follow the instructions of [this tutorial](https://wpadvancedads.com/publisher-revenue-share/). 289 307 290 308 = Can I place ads directly in my theme files? = … … 339 357 == Changelog == 340 358 341 = 1.53.2 (August 13, 2024) = 342 343 - Fix: ensure content from a group shows in all content placements 344 345 = 1.53.1 (August 13, 2024) = 346 347 - Fix: resolve issue with deleting data on uninstall 348 - Fix: resolve JavaScript error when uninstall 349 350 = 1.53.0 (August 6, 2024) = 351 352 - Improvement: add quick & bulk edit for "disable" ads on post/pages 353 - Fix: correct handling of conditions array when no conditions are set for an ad 354 - Fix: add drafted ads to group statistics on the statistic page 359 = 1.54.0 (September 2, 2024) = 360 361 - Improvement: enhance PubGuru one click integration 362 - Fix: prevent PHP warning when using ad debug 363 - Fix: readd drafted ads to group statistics on the statistic page 364 - Fix: resolve issue with ad blocker detection -
advanced-ads/trunk/views/admin/metabox-pubguru-connect.php
r3041809 r3145275 7 7 */ 8 8 9 if ( false === $pubguru_config ) : ?> 9 use AdvancedAds\Modules\OneClick\Options; 10 10 11 <div class="pubguru-not-connected space-y-4"> 11 $header_bidding = Options::module( 'header_bidding' ); 12 ?> 13 <div class="pubguru-not-connected space-y-4<?php echo false === $pubguru_config ? '' : ' hidden'; ?>"> 12 14 <label for="m2-connect-consent" class="flex items-center w-full"> 13 15 <span class="self-start"> … … 28 30 29 31 <div class="flex items-center gap-x-4"> 30 <button class="button button-primary js-pubguru-connect " disabled type="button"><?php esc_html_e( 'Connect PGHB', 'advanced-ads' ); ?></button>32 <button class="button button-primary js-pubguru-connecting" disabled type="button"><?php esc_html_e( 'Connect PGHB', 'advanced-ads' ); ?></button> 31 33 <div class="lds-ripple aa-spinner"><div></div><div></div></div> 32 34 </div> 33 35 </div> 34 <?php endif; ?>35 36 36 37 <div class="pubguru-connected<?php echo false === $pubguru_config ? ' hidden' : ''; ?>"> … … 47 48 <div> 48 49 <label for="pubguru-header-bidding" class="advads-ui-switch"> 49 <input type="checkbox" name="header_bidding" id="pubguru-header-bidding" class="sr-only peer" <?php checked( boolval( get_option( 'pubguru_module_header_bidding', false ) )); ?>>50 <input type="checkbox" name="header_bidding" id="pubguru-header-bidding" class="sr-only peer" <?php checked( $header_bidding ); ?>> 50 51 <div></div> 51 52 <span> … … 55 56 </div> 56 57 57 <div >58 <label for="pubguru- tag-conversion" class="advads-ui-switch">59 <input type="checkbox" name=" tag_conversion" id="pubguru-tag-conversion" <?php checked( boolval( get_option( 'pubguru_module_tag_conversion', false ) ) ); ?> />58 <div<?php echo $header_bidding ? ' style="margin-left: 20px;"' : ' style="display: none;"'; ?>> 59 <label for="pubguru-header-bidding-at-body" class="advads-ui-switch"> 60 <input type="checkbox" name="header_bidding_at_body" id="pubguru-header-bidding-at-body" class="sr-only peer" <?php checked( Options::module( 'header_bidding_at_body' ) ); ?>> 60 61 <div></div> 61 62 <span> 62 <?php esc_html_e( ' Activate Tag Conversion', 'advanced-ads' ); ?>63 <?php esc_html_e( 'Move the PubGuru Header Bidding script to the footer. Keep this option disabled to maximize revenue. Only enable it if PageSpeed is your priority.', 'advanced-ads' ); ?> 63 64 </span> 64 65 </label> … … 67 68 <div> 68 69 <label for="pubguru-adstxt" class="advads-ui-switch"> 69 <input type="checkbox" name="ads_txt" id="pubguru-adstxt" <?php checked( boolval( get_option( 'pubguru_module_ads_txt', false )) ); ?> />70 <input type="checkbox" name="ads_txt" id="pubguru-adstxt" <?php checked( Options::module( 'ads_txt' ) ); ?> /> 70 71 <div></div> 71 72 <span> … … 86 87 </div> 87 88 88 <div >89 <div class="hidden"> 89 90 <label for="pubguru-traffic-cop" class="advads-ui-switch"> 90 <input type="checkbox" name="traffic_cop" id="pubguru-traffic-cop" <?php checked( boolval( get_option( 'pubguru_module_traffic_cop', false )) ); ?> />91 <input type="checkbox" name="traffic_cop" id="pubguru-traffic-cop" <?php checked( Options::module( 'traffic_cop' ) ); ?> /> 91 92 <div></div> 92 93 <span class="pg-tc-trail <?php echo $has_traffic_cop ? 'hidden' : ''; ?>"> … … 99 100 </div> 100 101 102 <div class="hidden"> 103 <label for="pubguru-tag-conversion" class="advads-ui-switch"> 104 <input type="checkbox" name="tag_conversion" id="pubguru-tag-conversion" <?php checked( Options::module( 'tag_conversion' ) ); ?> /> 105 <div></div> 106 <span> 107 <?php esc_html_e( 'Activate Tag Conversion', 'advanced-ads' ); ?> 108 </span> 109 </label> 110 </div> 111 101 112 </div> 102 113 … … 104 115 105 116 </div> 117 118 <?php 119 $session_key = get_option( 'advanced-ads-importer-history' ); 120 if ( $session_key ) : 121 $delete_link = wp_nonce_url( 122 add_query_arg( 123 [ 124 'action' => 'advads_import_delete', 125 'session_key' => $session_key, 126 ] 127 ), 128 'advads_import_delete' 129 ); 130 ?> 131 <div class="rollback-block"> 132 <header><?php esc_html_e( 'Rollback', 'advanced-ads' ); ?></header> 133 <a href="<?php echo esc_url( $delete_link ); ?>" class="button-link !text-red-500"><?php esc_html_e( 'Rollback the api changes back to previous state.', 'advanced-ads' ); ?></a> 134 </div> 135 <?php endif; ?>
Note: See TracChangeset
for help on using the changeset viewer.