Advanced Ads - Version 1.37.0

Version Description

(October 11, 2022) =

  • Feature: bump minimum required PHP version to 7.2
  • Improvement: cleanup of the header items on list pages in the admin and unified layout elements
  • Improvement: show filters and search options on the ad, group, and placement list pages with the new Filters button in the page header
  • Improvement: show filters on the ad overview list permanently using the new Show Filters Permanently screen option
  • Improvement: unify the links and buttons in the header of admin pages related to Advanced Ads
  • Improvement: show the bulk options only when items in the ad list are selected
  • Improvement: hide the following columns on the ad list view by default: notes, size, author
  • Improvement: remove the background color for some ad status, like draft
  • Improvement: add a new "Type" column to the beginning of the ad list with a tooltip with more details
  • Improvement: add a new "Size" column for the ad size only
  • Improvement: add a "Notes" column for the ad description
  • Improvement: rename the "Title" Column into "Name"
  • Improvement: rename the Ad Details column into "Preview", showing only image ad previews
  • Improvement: search ad by post ID on the ad overview page
  • Fix: "All" view on the ad list not highlighted
  • Fix: show proper message for empty AdSense account
  • Fix: prevent undefined index notice on Ad Blocker setting in multisite
Download this release

Release Info

Developer advancedads
Plugin Icon 128x128 Advanced Ads
Version 1.37.0
Comparing to
See all releases

Code changes from version 1.36.3 to 1.37.0

Files changed (45) hide show
  1. admin/assets/css/admin.css +87 -28
  2. admin/assets/img/ad-types/adsense.svg +1 -0
  3. admin/assets/img/ad-types/amp.svg +1 -0
  4. admin/assets/img/ad-types/content.svg +1 -0
  5. admin/assets/img/ad-types/dummy.svg +1 -0
  6. admin/assets/img/ad-types/gam.svg +1 -0
  7. admin/assets/img/ad-types/group.svg +1 -0
  8. admin/assets/img/ad-types/image.svg +1 -0
  9. admin/assets/img/ad-types/plain.svg +1 -0
  10. admin/assets/js/admin.js +38 -1
  11. admin/class-advanced-ads-admin.php +46 -11
  12. admin/includes/class-ad-type.php +321 -256
  13. admin/includes/class-list-filters.php +147 -10
  14. admin/includes/class-menu.php +1 -0
  15. admin/views/ad-group.php +3 -2
  16. admin/views/ad-info-top.php +6 -2
  17. admin/views/ad-list-details-column.php +0 -25
  18. admin/views/ad-list/description.php +8 -0
  19. admin/views/ad-list/preview-image.php +22 -0
  20. admin/views/ad-list/screen-options.php +15 -0
  21. admin/views/{ad-list-shortcode-column.php → ad-list/shortcode.php} +0 -0
  22. admin/views/ad-list/size.php +9 -0
  23. admin/views/{ad-list-timing-column.php → ad-list/timing.php} +0 -0
  24. admin/views/ad-list/type.php +22 -0
  25. admin/views/ad-list/view-list.php +27 -0
  26. admin/views/header.php +34 -30
  27. admin/views/placements.php +1 -1
  28. advanced-ads.php +2 -2
  29. changelog.txt +19 -0
  30. classes/ad.php +7 -0
  31. classes/ad_type_abstract.php +25 -15
  32. classes/ad_type_dummy.php +1 -2
  33. classes/ad_type_image.php +28 -26
  34. languages/advanced-ads.pot +209 -177
  35. modules/ad-blocker/admin/admin.php +5 -0
  36. modules/gadsense/admin/admin.php +0 -20
  37. modules/gadsense/admin/assets/img/adsense-display.svg +1 -0
  38. modules/gadsense/admin/assets/img/adsense-in-article.svg +1 -0
  39. modules/gadsense/admin/assets/img/adsense-in-feed.svg +1 -0
  40. modules/gadsense/admin/assets/img/adsense-multiplex.svg +1 -0
  41. modules/gadsense/admin/assets/js/mapi-settings.js +0 -12
  42. modules/gadsense/admin/views/adsense-account.php +24 -15
  43. modules/gadsense/includes/class-ad-type-adsense.php +68 -2
  44. modules/gadsense/includes/class-mapi.php +126 -133
  45. readme.txt +21 -28
admin/assets/css/admin.css CHANGED
@@ -44,16 +44,34 @@
44
  .adsvads-ad-health-notices-show-hidden { text-align: right; cursor: pointer; margin-right: 10px; }
45
 
46
  /**
47
- * AD OVERVIEW PAGE
48
  */
49
- #posts-filter .ad_details > fieldset {float: none;}
50
- .ad_details img { float: left; margin-right: 10px; width: 150px; max-width: calc(50% - 10px); height: auto;}
51
- .ad_details img ~ p { float: left; width: 50%; }
52
  .advads-ad-size { white-space: nowrap; }
53
- .post-type-advanced_ads .subsubsub .draft a { background-color: #FCE7C0; }
54
- .post-type-advanced_ads .subsubsub .pending a { background-color: #FFDEDE; }
55
- .post-type-advanced_ads .wp-list-table .status-draft { background-color: #FCE7C0; }
56
- .post-type-advanced_ads .wp-list-table .status-pending { background-color: #FFDEDE; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
  /**
59
  * AD EDIT PAGE
@@ -355,10 +373,10 @@ fieldset.advads-group-add-ad { margin-top: 1em; }
355
  .advads-placement-description { display: none; }
356
  .advads-placements-new-form .advads-placement-type { position: relative; top: 0; left: 0; float: left; width: 80px; margin: 15px 0 0 15px; }
357
  .advads-placements-new-form .advads-placement-type .advads-button { background: none; border-radius: 0; height: auto; }
358
- .advads-placements-new-form .advads-placement-type .advads-button-text { padding: 0; width: 90px; height: 68px; border: solid 1px #0085ba; border-radius: 3px; box-shadow: 0px 0px 2px #0085ba; overflow: hidden; box-sizing: border-box; }
359
  .advads-placements-new-form .advads-placement-type .advads-button-text img { max-width: 100%; pointer-events: none; }
360
  .advads-placements-new-form .advads-placement-type label { display: inline-block; width: 80px; text-align: center; border: 0; padding: 0; }
361
- .advads-placements-new-form .advads-buttonset .advads-button.advads-ui-state-active { outline: 8px solid #2ea2cc; border: 0; }
362
  .advads-placements-new-form .advads-placement-type label .description { padding: 10px; }
363
  .advads-placements-new-form .advads-notice-inline.advads-error { display: none; }
364
  .advads-placements-table { min-width: 80%; border-collapse: collapse; background: #fff; }
@@ -456,7 +474,7 @@ tr:hover .on-hover { display: block; }
456
 
457
  #advads-header svg {
458
  display: inline;
459
- margin: 0;
460
  width: 32px;
461
  }
462
 
@@ -470,30 +488,16 @@ tr:hover .on-hover { display: block; }
470
 
471
  #advads-header .header-action {
472
  margin-right: 10px;
473
- border: 1px solid #1B183A;
474
  font-weight: 400;
475
- color: #1B183A;
476
- background: #fff;
477
- }
478
-
479
- #advads-header .header-action .dashicons {
480
- line-height: 30px;
481
- margin-left: -5px;
482
- padding-right: 5px;
483
  }
484
 
485
  #advads-header #advads-header-links {
486
  margin-right: 20px;
487
  }
488
 
489
- #advads-header #advads-header-links a {
490
- margin-left: 10px;
491
- }
492
-
493
- #advads-header #advads-header-links .advads-upgrade {
494
- font-weight: bold;
495
- text-decoration: none;
496
- color: #1d2327;
497
  }
498
 
499
  #advads-header #advads-links a {
@@ -1170,6 +1174,61 @@ tr.advads-clickable-row:hover{
1170
  }
1171
  }
1172
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1173
  /**
1174
  MODULE ACTIVATION
1175
  */
44
  .adsvads-ad-health-notices-show-hidden { text-align: right; cursor: pointer; margin-right: 10px; }
45
 
46
  /**
47
+ * AD LIST PAGE
48
  */
49
+ .ad_icon { max-width: 80px; width: 80px; }
50
+ .advads-ad-list-tooltip-content { display: none; }
 
51
  .advads-ad-size { white-space: nowrap; }
52
+ .post-type-advanced_ads .search-box { display: none; margin-bottom: 10px; }
53
+ .post-type-advanced_ads .tablenav.top { clear: none; margin-top: 0px; padding-top: 0; }
54
+ .post-type-advanced_ads .tablenav.top .displaying-num { display: none; }
55
+ .post-type-advanced_ads .tablenav.top .alignleft { float: none; margin: 10px 0; }
56
+ .post-type-advanced_ads .tablenav.top .alignleft.actions:not(.bulkactions) { display: none; }
57
+ .post-type-advanced_ads .tablenav.top .bulkactions { display: none; }
58
+ .post-type-advanced_ads .tablenav.top .tablenav-pages { margin: 10px 0 20px; }
59
+ .post-type-advanced_ads .tablenav.top #delete_all { margin: 10px 0 0 20px; }
60
+ .post-type-advanced_ads .tablenav.top .alignleft.actions #delete_all { margin: 0; padding: 0; width: 0; border: 0; visibility: hidden; }
61
+ .post-type-advanced_ads .tablenav.bottom { margin-top: 15px; }
62
+ .post-type-advanced_ads .tablenav.bottom .bulkactions.fixed { position: fixed; bottom: 0px; background: #fff; padding: 1em; border: solid 1px; z-index: 1000; }
63
+ .post-type-advanced_ads .wrap .subsubsub { display: none; }
64
+ .post-type-advanced_ads .advanced-ads-ad-list-views { margin: 10px 0 20px; float: left; clear: both; }
65
+ .post-type-advanced_ads .advanced-ads-ad-list-views li { display: inline-block; padding: 0; overflow: hidden; }
66
+ .post-type-advanced_ads .advanced-ads-ad-list-views a { display: inline-block; text-decoration: none; padding: 0 10px; }
67
+ .post-type-advanced_ads #screen-options-link-wrap { display: none; }
68
+ .post-type-advanced_ads #screen-meta { position: absolute; z-index: 1000; border-color: #000; }
69
+ .post-type-advanced_ads #adv-settings .submit button { margin-left: 10px; }
70
+ .post-type-advanced_ads #advads-show-filters span { line-height: 30px; }
71
+ .post-type-advanced_ads .button:not(.button-primary):not(.advads-button-primary):not(:hover) { border-color: #0474A2; color: #0474A2; }
72
+ .post-type-advanced_ads .wp-list-table thead tr .dashicons-edit { float: right; visibility: hidden; cursor: pointer; }
73
+ .post-type-advanced_ads .wp-list-table thead tr:hover .dashicons-edit { visibility: visible; }
74
+ .post-type-advanced_ads .column-ad_type { width: 50px; }
75
 
76
  /**
77
  * AD EDIT PAGE
373
  .advads-placement-description { display: none; }
374
  .advads-placements-new-form .advads-placement-type { position: relative; top: 0; left: 0; float: left; width: 80px; margin: 15px 0 0 15px; }
375
  .advads-placements-new-form .advads-placement-type .advads-button { background: none; border-radius: 0; height: auto; }
376
+ .advads-placements-new-form .advads-placement-type .advads-button-text { padding: 0; width: 80px; height: 60px; border: solid 1px #0085ba; border-radius: 3px; box-shadow: 0 0 2px #0085ba; overflow: hidden; box-sizing: border-box; }
377
  .advads-placements-new-form .advads-placement-type .advads-button-text img { max-width: 100%; pointer-events: none; }
378
  .advads-placements-new-form .advads-placement-type label { display: inline-block; width: 80px; text-align: center; border: 0; padding: 0; }
379
+ .advads-placements-new-form .advads-buttonset .advads-button.advads-ui-state-active { outline: 5px solid #2ea2cc; border: 0; }
380
  .advads-placements-new-form .advads-placement-type label .description { padding: 10px; }
381
  .advads-placements-new-form .advads-notice-inline.advads-error { display: none; }
382
  .advads-placements-table { min-width: 80%; border-collapse: collapse; background: #fff; }
474
 
475
  #advads-header svg {
476
  display: inline;
477
+ margin: 0 0 -4px 0;
478
  width: 32px;
479
  }
480
 
488
 
489
  #advads-header .header-action {
490
  margin-right: 10px;
 
491
  font-weight: 400;
 
 
 
 
 
 
 
 
492
  }
493
 
494
  #advads-header #advads-header-links {
495
  margin-right: 20px;
496
  }
497
 
498
+ #advads-header-links .disabled {
499
+ background-color: #c3c4c7;
500
+ cursor: default;
 
 
 
 
 
501
  }
502
 
503
  #advads-header #advads-links a {
1174
  }
1175
  }
1176
 
1177
+ /**
1178
+ * Buttons
1179
+ */
1180
+ .button.advads-button-primary {
1181
+ background-color: #0474A2;
1182
+ color: #fff;
1183
+ border: 1px solid #0474A2;
1184
+ }
1185
+ .button.advads-button-primary a {
1186
+ color: #fff;
1187
+ }
1188
+ .button.advads-button-secondary {
1189
+ border-color: #0474A2;
1190
+ color: #0474A2;
1191
+ background-color: #fff;
1192
+ }
1193
+ .button.advads-button-secondary a {
1194
+ color: #0474A2;
1195
+ color: #0474A2;
1196
+ }
1197
+ .button.advads-button-primary:hover {
1198
+ background-color: #1B183A;
1199
+ border-color: #1B183A;
1200
+ color: #fff;
1201
+ }
1202
+ .button.advads-button-secondary:hover {
1203
+ background-color: #fff;
1204
+ border-color: #1B183A;
1205
+ color: #1B183A;
1206
+ }
1207
+ .button.advads-button-primary:hover a {
1208
+ color: #fff;
1209
+ }
1210
+ .button.advads-button-secondary:hover a {
1211
+ color: #1B183A;
1212
+ }
1213
+ /* Actionable buttons have icons on the left */
1214
+ .advads-button-primary .dashicons,
1215
+ .advads-button-secondary .dashicons {
1216
+ line-height: 30px;
1217
+ margin-left: -5px;
1218
+ padding-right: 5px;
1219
+ }
1220
+ /* Decorative icons are on the right */
1221
+ .advads-button-icon-right .dashicons {
1222
+ line-height: 30px;
1223
+ margin-left: 0;
1224
+ padding-right: 0;
1225
+ margin-right: -5px;
1226
+ padding-left: 5px;
1227
+ }
1228
+ .button .dashicons.dashicons-star-filled {
1229
+ margin-top: -2px;
1230
+ }
1231
+
1232
  /**
1233
  MODULE ACTIVATION
1234
  */
admin/assets/img/ad-types/adsense.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" overflow="visible"><path fill="#fff" d="M19.878 99C9.469 99 1 90.532 1 80.123V2a1 1 0 0 1 1-1h78.122C90.531 1 99 9.468 99 19.877V98a1 1 0 0 1-1 1H19.878z"/><path fill="#0074a2" d="M80.122 2C89.98 2 98 10.02 98 19.877V98H19.878C10.02 98 2 89.981 2 80.123V2h78.122m0-2H2a2 2 0 0 0-2 2v78.123C0 91.083 8.917 100 19.878 100H98a2 2 0 0 0 2-2V19.877C100 8.917 91.083 0 80.122 0h0z"/><path fill="#66acc7" d="M60.049 34.663c3.472-5.941 1.41-13.532-4.602-16.963-6.017-3.428-13.707-1.396-17.179 4.545-.151.266-.294.537-.431.814L26.104 43.133a15.01 15.01 0 0 0-.721 1.232l-12.187 21.03L34.972 77.6 47.1 56.75a11.79 11.79 0 0 0 .719-1.233l11.735-20.079a12.17 12.17 0 0 0 .495-.775"/><path fill="#0074a2" d="M35.074 77.537c-3.451 6.038-11.237 8.259-17.215 4.777s-8.104-11.046-4.648-17.082 11.171-8.266 17.148-4.784c5.982 3.487 8.166 11.054 4.715 17.087"/><path fill="#3390b5" d="M82.067 38.638a12.45 12.45 0 0 0-16.983 4.54L52.649 64.656c-3.423 5.924-1.4 13.5 4.52 16.926.011.006.021.013.031.021 5.948 3.425 13.544 1.395 16.987-4.541L86.62 55.58a12.39 12.39 0 0 0-4.525-16.926c-.009-.004-.017-.008-.028-.016"/></svg>
admin/assets/img/ad-types/amp.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" overflow="visible"><path fill="#fff" d="M19.878 99C9.469 99 1 90.531 1 80.122V2a1 1 0 0 1 1-1h78.122C90.531 1 99 9.468 99 19.877V98a1 1 0 0 1-1 1H19.878z"/><path d="M80.122 2C89.98 2 98 10.02 98 19.877V98H19.878C10.02 98 2 89.98 2 80.122V2h78.122m0-2H2a2 2 0 0 0-2 2v78.122C0 91.083 8.917 100 19.878 100H98a2 2 0 0 0 2-2V19.877C100 8.917 91.083 0 80.122 0h0zM46.976 73.271h-2.915l2.885-17.45-8.927.013h-.128a1.46 1.46 0 0 1-1.454-1.456c0-.346.321-.931.321-.931L52.8 26.696l2.969.01-2.958 17.48 8.974-.01h.144c.801 0 1.455.649 1.455 1.453 0 .328-.129.614-.31.857L46.976 73.271zm2.943-61.637C28.728 11.634 11.55 28.811 11.55 50s17.178 38.367 38.369 38.367S88.284 71.19 88.284 50 71.11 11.634 49.919 11.634z" fill="#0074a2"/></svg>
admin/assets/img/ad-types/content.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" overflow="visible"><path fill="#fff" d="M19.878 99C9.469 99 1 90.531 1 80.122V2a1 1 0 0 1 1-1h78.122C90.531 1 99 9.468 99 19.877V98a1 1 0 0 1-1 1H19.878z"/><g fill="#0074a2"><path d="M80.122 2C89.98 2 98 10.02 98 19.877V98H19.878C10.02 98 2 89.98 2 80.122V2h78.122m0-2H2a2 2 0 0 0-2 2v78.122C0 91.083 8.917 100 19.878 100H98a2 2 0 0 0 2-2V19.877C100 8.917 91.083 0 80.122 0h0zM29.944 17.691h-15.31a2.961 2.961 0 0 1 0-5.922h15.31a2.961 2.961 0 1 1 0 5.922zm0 11.802h-15.31a2.961 2.961 0 1 1 0-5.922h15.31a2.961 2.961 0 1 1 0 5.922zm0 11.801h-15.31a2.961 2.961 0 1 1 0-5.922h15.31a2.961 2.961 0 1 1 0 5.922zm55.504 35.271H14.635a2.961 2.961 0 1 1 0-5.921h70.813a2.961 2.961 0 1 1 0 5.921zm0 11.802H14.635a2.961 2.961 0 1 1 0-5.922h70.813a2.961 2.961 0 1 1 0 5.922zm0-35.27h-58.97a2.961 2.961 0 1 1 0-5.921h58.97a2.96 2.96 0 0 1 2.961 2.96c0 1.634-1.326 2.961-2.961 2.961zm0 11.842h-58.97a2.961 2.961 0 1 1 0-5.921h58.97a2.961 2.961 0 1 1 0 5.921zM58.889 29.994c-.706 1.22-2.023 2.041-3.535 2.041a4.08 4.08 0 0 1-3.537-2.04l-1.188-2.062c-.706-1.22-2.026-2.042-3.538-2.042s-2.829.821-3.535 2.042l-4.18 7.239a4.08 4.08 0 0 0 3.537 6.124H84.32c1.408-.001 2.779-.732 3.534-2.041a4.08 4.08 0 0 0 .001-4.083L75.413 13.619a4.08 4.08 0 0 0-7.071.001l-9.453 16.374z"/><circle cx="47.091" cy="15.664" r="4.083"/><circle cx="14.635" cy="50.136" r="2.96"/><circle cx="14.635" cy="61.979" r="2.96"/></g></svg>
admin/assets/img/ad-types/dummy.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" overflow="visible"><path fill="#fff" d="M19.878 99C9.469 99 1 90.532 1 80.123V2a1 1 0 0 1 1-1h78.122C90.531 1 99 9.468 99 19.877V98a1 1 0 0 1-1 1H19.878z"/><path d="M80.122 2C89.98 2 98 10.021 98 19.877V98H19.878C10.02 98 2 89.981 2 80.123V2h78.122m0-2H2a2 2 0 0 0-2 2v78.123C0 91.083 8.917 100 19.878 100H98a2 2 0 0 0 2-2V19.877C100 8.917 91.083 0 80.122 0h0zM44.147 70.986h9.716L35.966 30.958h-9.147L8.976 70.986h9.493l3.565-8.576h18.561l3.552 8.576zM24.961 55.375l6.371-15.32 6.348 15.32H24.961zm54.581-26.818v14.888c-.711-.778-1.508-1.438-2.402-1.965-1.944-1.14-4.216-1.712-6.808-1.712-2.894 0-5.51.646-7.832 1.945-2.326 1.292-4.165 3.122-5.519 5.485s-2.029 5.166-2.029 8.409c0 3.201.675 5.984 2.029 8.347s3.192 4.204 5.519 5.516c2.322 1.317 4.938 1.974 7.832 1.974 2.708 0 5.021-.573 6.947-1.713 1.012-.602 1.897-1.374 2.661-2.307v3.562h8.521V28.557h-8.919zm-.89 31.591c-.707 1.281-1.647 2.262-2.83 2.946s-2.498 1.028-3.945 1.028c-1.484 0-2.821-.34-4.001-1.028s-2.128-1.665-2.83-2.946c-.708-1.274-1.061-2.792-1.061-4.541 0-1.791.353-3.318 1.061-4.579.702-1.256 1.646-2.229 2.83-2.913 1.18-.689 2.517-1.029 4.001-1.029 1.447 0 2.765.34 3.945 1.029s2.123 1.657 2.83 2.913c.708 1.261 1.056 2.788 1.056 4.579 0 1.749-.348 3.267-1.056 4.541z" fill="#0074a2"/></svg>
admin/assets/img/ad-types/gam.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" overflow="visible"><path fill="#fff" d="M19.878 99C9.469 99 1 90.531 1 80.122V2a1 1 0 0 1 1-1h78.122C90.531 1 99 9.468 99 19.877V98a1 1 0 0 1-1 1H19.878z"/><path d="M80.122 2C89.98 2 98 10.02 98 19.877V98H19.878C10.02 98 2 89.98 2 80.122V2h78.122m0-2H2a2 2 0 0 0-2 2v78.122C0 91.083 8.917 100 19.878 100H98a2 2 0 0 0 2-2V19.877C100 8.917 91.083 0 80.122 0h0zm6.102 54.934L54.935 86.223c-2.854 2.854-7.486 2.854-10.341 0s-2.854-7.484 0-10.339l31.294-31.292c2.854-2.854 7.485-2.854 10.34 0s2.854 7.484-.004 10.342h0z" fill="#0074a2"/><circle fill="#3390b5" cx="49.763" cy="81.054" r="7.313"/><path fill="#0074a2" d="M60.477 29.184L44.828 44.828l10.34 10.34 15.649-15.645c2.854-2.855 2.854-7.485 0-10.339a7.31 7.31 0 0 0-10.34 0h0z"/><path fill="#66acc7" d="M39.523 70.815L55.168 55.17l-10.34-10.339-15.643 15.646c-2.854 2.855-2.854 7.484 0 10.339a7.31 7.31 0 0 0 10.338-.001h0z"/><circle fill="#3390b5" cx="50.034" cy="49.964" r="7.313"/><path fill="#66acc7" d="M55.406 24.113L24.112 55.405c-2.854 2.854-7.485 2.854-10.338 0s-2.855-7.485 0-10.339l31.291-31.293c2.854-2.854 7.486-2.854 10.341 0a7.31 7.31 0 0 1 0 10.34h0z"/><circle fill="#3390b5" cx="50.235" cy="18.944" r="7.312"/></svg>
admin/assets/img/ad-types/group.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" overflow="visible"><path fill="#fff" d="M19.878 99C9.469 99 1 90.531 1 80.121V2a1 1 0 0 1 1-1h78.122C90.531 1 99 9.468 99 19.876V98a1 1 0 0 1-1 1H19.878z"/><path d="M80.122 2C89.98 2 98 10.019 98 19.876V98H19.878C10.02 98 2 89.979 2 80.121V2h78.122m0-2H2a2 2 0 0 0-2 2v78.121C0 91.082 8.917 100 19.878 100H98a2 2 0 0 0 2-2V19.876C100 8.917 91.083 0 80.122 0h0zm7.343 24.343a2.96 2.96 0 0 0-2.094-.868l-39.13.001v-8.883a2.96 2.96 0 0 0-2.961-2.961H14.56a2.96 2.96 0 0 0-2.961 2.961v70.812a2.96 2.96 0 0 0 2.961 2.961h70.812a2.96 2.96 0 0 0 2.961-2.961v-58.97a2.96 2.96 0 0 0-.868-2.092zM46.232 78.035a.74.74 0 0 1-.74.74h-17.64a.74.74 0 0 1-.739-.74v-17.64a.74.74 0 0 1 .739-.74h8.821a.74.74 0 0 1 .741.74v2.211h8.078a.74.74 0 0 1 .74.739v14.69zm0-26.587a.74.74 0 0 1-.74.74h-17.64a.74.74 0 0 1-.739-.74v-17.64a.74.74 0 0 1 .739-.74h8.821a.74.74 0 0 1 .741.74v2.212l8.078-.002a.74.74 0 0 1 .74.74v14.69zM72.82 78.035a.74.74 0 0 1-.739.74H54.44a.74.74 0 0 1-.74-.74v-17.64a.74.74 0 0 1 .74-.74h8.819a.74.74 0 0 1 .74.74v2.211h8.081a.74.74 0 0 1 .739.739v14.69zm0-26.587a.74.74 0 0 1-.739.74H54.44a.74.74 0 0 1-.74-.74v-17.64a.74.74 0 0 1 .74-.74h8.819a.74.74 0 0 1 .74.74v2.212l8.081-.002a.74.74 0 0 1 .739.74v14.69z" fill="#0074a2"/></svg>
admin/assets/img/ad-types/image.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" overflow="visible"><path fill="#fff" d="M19.878 99C9.469 99 1 90.531 1 80.122V2a1 1 0 0 1 1-1h78.122C90.531 1 99 9.468 99 19.877V98a1 1 0 0 1-1 1H19.878z"/><path d="M80.122 2C89.98 2 98 10.02 98 19.877V98H19.878C10.02 98 2 89.98 2 80.122V2h78.122m0-2H2a2 2 0 0 0-2 2v78.122C0 91.083 8.917 100 19.878 100H98a2 2 0 0 0 2-2V19.877C100 8.917 91.083 0 80.122 0h0zM42.639 55.506a6.31 6.31 0 0 1-5.473 3.157 6.32 6.32 0 0 1-5.473-3.155l-1.84-3.193c-1.094-1.889-3.138-3.16-5.477-3.16s-4.38 1.269-5.474 3.16l-6.47 11.204c-1.088 1.891-1.17 4.295.002 6.32a6.32 6.32 0 0 0 5.474 3.159h64.093c2.181-.003 4.303-1.136 5.473-3.159s1.089-4.43.002-6.32L68.215 30.161c-1.091-1.887-3.132-3.158-5.471-3.158a6.32 6.32 0 0 0-5.475 3.159l-14.63 25.344zM30.482 31.689c.904 3.372-1.099 6.835-4.468 7.736-3.37.906-6.835-1.094-7.739-4.465a6.32 6.32 0 0 1 4.467-7.737c3.374-.907 6.838 1.094 7.74 4.466z" fill="#0074a2"/></svg>
admin/assets/img/ad-types/plain.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" overflow="visible"><path fill="#fff" d="M19.875 99C9.467 99 1 90.532 1 80.125V2a1 1 0 0 1 1-1h78.125C90.532 1 99 9.467 99 19.875V98a1 1 0 0 1-1 1H19.875z"/><path d="M80.125 2C89.984 2 98 10.016 98 19.875V98H19.875C10.016 98 2 89.977 2 80.125V2h78.125m0-2H2a2 2 0 0 0-2 2v78.125C0 91.084 8.916 100 19.875 100H98a2 2 0 0 0 2-2V19.875C100 8.916 91.084 0 80.125 0h0zM32.227 62.234a3.02 3.02 0 0 1-1.523-.414l-15.906-9.172c-.945-.547-1.531-1.555-1.531-2.648a3.06 3.06 0 0 1 1.531-2.648l15.906-9.18a3.06 3.06 0 0 1 4.18 1.125c.844 1.461.344 3.328-1.117 4.172L22.445 50l11.32 6.523c1.461.852 1.961 2.719 1.117 4.18-.562.985-1.593 1.531-2.655 1.531zm35.539 0c-1.055 0-2.086-.547-2.648-1.531a3.05 3.05 0 0 1 1.117-4.18L77.547 50l-11.312-6.531a3.04 3.04 0 0 1-1.117-4.172c.844-1.469 2.711-1.969 4.18-1.125l15.906 9.18c.945.547 1.531 1.555 1.531 2.648a3.06 3.06 0 0 1-1.531 2.648L69.297 61.82c-.485.282-1.008.414-1.531.414zm-26.188 5.391c-.516 0-1.047-.133-1.531-.406-1.461-.844-1.961-2.719-1.117-4.18l16.836-29.133a3.06 3.06 0 0 1 4.18-1.125c1.461.844 1.969 2.719 1.125 4.18L44.234 66.094c-.57.984-1.593 1.531-2.656 1.531z" fill="#0074a2"/></svg>
admin/assets/js/admin.js CHANGED
@@ -101,6 +101,18 @@ jQuery( document ).ready( function ( $ ) {
101
  } )
102
  }
103
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  /**
105
  * Logic for ad groups
106
  */
@@ -473,6 +485,31 @@ jQuery( document ).ready( function ( $ ) {
473
  }
474
  }
475
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
476
  /**
477
  * PLACEMENTS
478
  */
@@ -1493,7 +1530,7 @@ if ( ! window.AdvancedAdsAdmin.AdImporter ) window.AdvancedAdsAdmin.AdImporter =
1493
  * updates the UI, (call if the selected unit is NOT supported)
1494
  */
1495
  emptyMapiSelector: function ( msg ) {
1496
- const nag = '<div class="notice notice-error" style="font-size:1.1em;padding:.6em 1em;font-weight:bold;">' + msg + '</div>'
1497
  jQuery( '#mapi-loading-overlay' ).css( 'display', 'none' )
1498
  jQuery( '#mapi-wrap' ).html( jQuery( nag ) )
1499
  },
101
  } )
102
  }
103
 
104
+ // AD OVERVIEW PAGE
105
+
106
+ $( '.advads-ad-list-tooltip' ).advads_tooltip( {
107
+ content: function () {
108
+ return jQuery( this ).find( '.advads-ad-list-tooltip-content' ).html()
109
+ }
110
+ } )
111
+ // show edit icon in the last head column
112
+ $( '.post-type-advanced_ads .wp-list-table thead th:last-of-type' ).append( '<span class="dashicons dashicons-edit"></span>' ).on( 'click', function() {
113
+ $( '#show-settings-link' ).trigger( 'click' );
114
+ } );
115
+
116
  /**
117
  * Logic for ad groups
118
  */
485
  }
486
  }
487
 
488
+ // OVERVIEW LIST (Ads, Groups, Placements)
489
+
490
+ // toggle page filters, excluded from the Ads list since the search markup is not editable by us.
491
+ $( 'body:not(.post-type-advanced_ads ) #advads-show-filters' ).on( 'click', function() {
492
+ const disabled = $( this ).find( '.dashicons' ).hasClass( 'dashicons-arrow-up' );
493
+ $( '.advads-toggle-with-filters-button' ).toggleClass( 'hidden', disabled );
494
+ $( '#advads-show-filters .dashicons' ).toggleClass( 'dashicons-filter', disabled );
495
+ $( '#advads-show-filters .dashicons' ).toggleClass( 'dashicons-arrow-up', ! disabled );
496
+ } );
497
+
498
+ // AD OVERVIEW LIST
499
+
500
+ // show the bulk actions sticky, when some lines are selected
501
+ $( '.post-type-advanced_ads .check-column input[type="checkbox"]' ).on( 'change', function() {
502
+ $( '.post-type-advanced_ads .tablenav.bottom .bulkactions' ).toggleClass( 'fixed', 0 < $( '.post-type-advanced_ads .check-column input[type="checkbox"]:checked' ).length );
503
+ } );
504
+ // show screen options when clicking on our custom link or the Close button
505
+ $( '#advads-show-screen-options' ).on( 'click', function(){
506
+ $( '#show-settings-link' ).trigger( 'click' );
507
+ } );
508
+ // Add a close button to the screen options
509
+ $( '<button type="button" class="button advads-button-secondary">' + advadstxt.close + '</button>' )
510
+ .appendTo( $( '.post-type-advanced_ads #adv-settings .submit' ) )
511
+ .on( 'click', function() { $( '#show-settings-link' ).trigger( 'click' ); } );
512
+
513
  /**
514
  * PLACEMENTS
515
  */
1530
  * updates the UI, (call if the selected unit is NOT supported)
1531
  */
1532
  emptyMapiSelector: function ( msg ) {
1533
+ const nag = '<div class="advads-notice-inline advads-error"><p>' + msg + '</p></div>'
1534
  jQuery( '#mapi-loading-overlay' ).css( 'display', 'none' )
1535
  jQuery( '#mapi-wrap' ).html( jQuery( nag ) )
1536
  },
admin/class-advanced-ads-admin.php CHANGED
@@ -238,6 +238,7 @@ class Advanced_Ads_Admin {
238
  'hide_inactive_ads' => __( 'Hide inactive ads', 'advanced-ads' ),
239
  'display_conditions_form_name' => Advanced_Ads_Display_Conditions::FORM_NAME, // not meant for translation.
240
  'delete_placement_confirmation' => __( 'Permanently delete this placement?', 'advanced-ads' ),
 
241
  );
242
 
243
  wp_localize_script( $this->plugin_slug . '-admin-script', 'advadstxt', $translation_array );
@@ -774,27 +775,61 @@ class Advanced_Ads_Admin {
774
 
775
  /**
776
  * Add an Advanced Ads branded header to plugin pages
 
 
777
  */
778
  private function branded_admin_header() {
779
- $screen_id = get_current_screen()->id;
780
- // manually set a few page titles
781
- switch ( $screen_id ) {
782
- case 'edit-advanced_ads': // ad overview
783
- $title = __( 'Your Ads', 'advanced-ads' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
784
  break;
785
  case 'advanced-ads_page_advanced-ads-groups': // ad groups
786
- $title = __( 'Your Groups', 'advanced-ads' );
 
 
 
 
 
 
787
  break;
788
  case 'advanced-ads_page_advanced-ads-placements':
789
- $title = __( 'Your Placements', 'advanced-ads' );
 
 
 
 
790
  break;
791
  case 'advanced-ads_page_advanced-ads-settings':
792
- $title = __( 'Advanced Ads Settings', 'advanced-ads' );
793
- break;
794
- default:
795
- $title = get_admin_page_title();
796
  break;
797
  }
 
 
 
798
  include ADVADS_BASE_PATH . 'admin/views/header.php';
799
  }
800
  }
238
  'hide_inactive_ads' => __( 'Hide inactive ads', 'advanced-ads' ),
239
  'display_conditions_form_name' => Advanced_Ads_Display_Conditions::FORM_NAME, // not meant for translation.
240
  'delete_placement_confirmation' => __( 'Permanently delete this placement?', 'advanced-ads' ),
241
+ 'close' => __( 'Close', 'advanced-ads' ),
242
  );
243
 
244
  wp_localize_script( $this->plugin_slug . '-admin-script', 'advadstxt', $translation_array );
775
 
776
  /**
777
  * Add an Advanced Ads branded header to plugin pages
778
+ *
779
+ * @see Advanced_Ads_Admin::screen_belongs_to_advanced_ads()
780
  */
781
  private function branded_admin_header() {
782
+ $screen = get_current_screen();
783
+ $manual_url = 'manual/';
784
+ $new_button_id = '';
785
+ $new_button_label = '';
786
+ $show_filter_button = false;
787
+ $reset_href = '';
788
+ $filter_disabled = '';
789
+ $show_screen_options = false;
790
+ $title = get_admin_page_title();
791
+
792
+ switch ( $screen->id ) {
793
+ // ad overview
794
+ case 'advanced_ads':
795
+ $new_button_label = __( 'New Ad', 'advanced-ads' );
796
+ $new_button_href = admin_url( 'post-new.php?post_type=advanced_ads' );
797
+ $manual_url = 'manual/first-ad/';
798
+ break;
799
+ case 'edit-advanced_ads':
800
+ $title = __( 'Your Ads', 'advanced-ads' );
801
+ $new_button_label = __( 'New Ad', 'advanced-ads' );
802
+ $new_button_href = admin_url( 'post-new.php?post_type=advanced_ads' );
803
+ $manual_url = 'manual/first-ad/';
804
+ $show_filter_button = ! Advanced_Ads_Ad_List_Filters::uses_filter_or_search();
805
+ $reset_href = ! $show_filter_button ? esc_url( admin_url( 'edit.php?post_type=' . Advanced_Ads::POST_TYPE_SLUG ) ) : '';
806
+ $filter_disabled = $screen->get_option( 'show-filters' ) ? 'disabled' : '';
807
+ $show_screen_options = true;
808
  break;
809
  case 'advanced-ads_page_advanced-ads-groups': // ad groups
810
+ $title = __( 'Your Groups', 'advanced-ads' );
811
+ $new_button_label = __( 'New Ad Group', 'advanced-ads' );
812
+ $new_button_href = '#';
813
+ $new_button_id = 'advads-new-ad-group-link';
814
+ $manual_url = 'manual/rotate-ad/';
815
+ $show_filter_button = empty( $_GET['s'] );
816
+ $reset_href = ! $show_filter_button ? esc_url( admin_url( 'admin.php?page=advanced-ads-groups' ) ) : '';
817
  break;
818
  case 'advanced-ads_page_advanced-ads-placements':
819
+ $title = __( 'Your Placements', 'advanced-ads' );
820
+ $new_button_label = __( 'New Placement', 'advanced-ads' );
821
+ $new_button_href = '#modal-placement-new';
822
+ $manual_url = 'manual/placements/';
823
+ $show_filter_button = true;
824
  break;
825
  case 'advanced-ads_page_advanced-ads-settings':
826
+ $title = __( 'Advanced Ads Settings', 'advanced-ads' );
827
+ $new_button_href = '';
 
 
828
  break;
829
  }
830
+
831
+ $manual_url = apply_filters( 'advanced-ads-admin-header-manual-url', $manual_url, $screen->id );
832
+
833
  include ADVADS_BASE_PATH . 'admin/views/header.php';
834
  }
835
  }
admin/includes/class-ad-type.php CHANGED
@@ -23,167 +23,42 @@ class Advanced_Ads_Admin_Ad_Type {
23
  * Register hooks function related to the ad type
24
  */
25
  private function __construct() {
26
- // registering custom columns needs to work with and without DOING_AJAX.
27
  add_filter(
28
  'manage_advanced_ads_posts_columns',
29
  array(
30
  $this,
31
  'ad_list_columns_head',
32
  )
33
- ); // extra column.
34
- add_filter(
35
- 'manage_advanced_ads_posts_custom_column',
36
- array(
37
- $this,
38
- 'ad_list_columns_content',
39
- ),
40
- 10,
41
- 2
42
- ); // extra column.
43
- add_filter(
44
- 'manage_advanced_ads_posts_custom_column',
45
- array(
46
- $this,
47
- 'ad_list_columns_timing',
48
- ),
49
- 10,
50
- 2
51
- ); // extra column.
52
- add_filter(
53
- 'manage_advanced_ads_posts_custom_column',
54
- array(
55
- $this,
56
- 'ad_list_columns_shortcode',
57
- ),
58
- 10,
59
- 2
60
- ); // extra column.
61
- add_action(
62
- 'restrict_manage_posts',
63
- array(
64
- $this,
65
- 'ad_list_add_filters',
66
- )
67
- );
68
- add_filter(
69
- 'default_hidden_columns',
70
- array(
71
- $this,
72
- 'hide_ad_list_columns',
73
- ),
74
- 10,
75
- 2
76
- ); // hide the ad shortcode column by default.
77
-
78
- // ad updated messages.
79
- add_filter(
80
- 'bulk_post_updated_messages',
81
- array(
82
- $this,
83
- 'ad_bulk_update_messages',
84
- ),
85
- 10,
86
- 2
87
  );
88
-
 
 
 
 
89
  // order ad lists.
90
  add_filter( 'request', array( $this, 'ad_list_request' ) );
91
-
92
- add_action(
93
- 'all_admin_notices',
94
- array(
95
- $this,
96
- 'no_ads_yet_notice',
97
- )
98
- );
99
  // Manipulate post data when post is created.
100
- add_filter(
101
- 'wp_insert_post_data',
102
- array(
103
- $this,
104
- 'prepare_insert_post_data',
105
- )
106
- );
107
  // Save ads post type.
108
  // @source https://developer.wordpress.org/reference/hooks/save_post_post-post_type/
109
- add_action(
110
- 'save_post_advanced_ads',
111
- array(
112
- $this,
113
- 'save_ad',
114
- )
115
- );
116
- // delete ads post type.
117
- add_action(
118
- 'delete_post',
119
- array(
120
- $this,
121
- 'delete_ad',
122
- )
123
- );
124
- // on post/ad edit screen.
125
- add_action(
126
- 'edit_form_top',
127
- array(
128
- $this,
129
- 'edit_form_above_title',
130
- )
131
- );
132
- add_action(
133
- 'dbx_post_sidebar',
134
- array(
135
- $this,
136
- 'edit_form_end',
137
- )
138
- );
139
- add_action(
140
- 'post_submitbox_misc_actions',
141
- array(
142
- $this,
143
- 'add_submit_box_meta',
144
- )
145
- );
146
- add_action(
147
- 'admin_enqueue_scripts',
148
- array(
149
- $this,
150
- 'use_code_editor',
151
- )
152
- );
153
- // ad updated messages.
154
- add_filter(
155
- 'post_updated_messages',
156
- array(
157
- $this,
158
- 'ad_update_messages',
159
- )
160
- );
161
- add_filter(
162
- 'gettext',
163
- array(
164
- $this,
165
- 'replace_cheating_message',
166
- ),
167
- 20,
168
- 2
169
- );
170
- // things that need to know the current screen.
171
- add_action(
172
- 'current_screen',
173
- array(
174
- $this,
175
- 'run_on_ad_edit_screen',
176
- )
177
- );
178
- add_filter(
179
- 'pre_wp_unique_post_slug',
180
- array(
181
- $this,
182
- 'pre_wp_unique_post_slug',
183
- ),
184
- 10,
185
- 6
186
- );
187
 
188
  $this->post_type = constant( 'Advanced_Ads::POST_TYPE_SLUG' );
189
  }
@@ -244,158 +119,237 @@ class Advanced_Ads_Admin_Ad_Type {
244
  * Add heading for extra column of ads list
245
  * remove the date column
246
  *
247
- * @param array $columns array with existing columns.
248
  *
249
- * @return array $new_columns
250
- * @since 1.3.3
251
  */
252
  public function ad_list_columns_head( $columns ) {
253
  $new_columns = array();
254
- if ( is_array( $columns ) ) {
255
- foreach ( $columns as $key => $value ) {
256
- $new_columns[ $key ] = $value;
257
- if ( 'title' === $key ) {
258
- $new_columns['ad_details'] = __( 'Ad Details', 'advanced-ads' );
259
- $new_columns['ad_timing'] = __( 'Ad Planning', 'advanced-ads' );
260
- $new_columns['ad_shortcode'] = __( 'Ad Shortcode', 'advanced-ads' );
261
- }
 
 
 
 
 
 
 
 
262
  }
263
- } else {
264
- $new_columns['ad_details'] = __( 'Ad Details', 'advanced-ads' );
265
- $new_columns['ad_timing'] = __( 'Ad Planning', 'advanced-ads' );
266
- $new_columns['ad_shortcode'] = __( 'Ad Shortcode', 'advanced-ads' );
267
  }
268
 
269
- // white-listed columns.
270
- $whitelist = apply_filters(
271
- 'advanced-ads-ad-list-allowed-columns',
272
- array(
273
- 'cb', // checkbox.
274
- 'title',
275
- 'author',
276
- 'ad_details',
277
- 'ad_timing',
278
- 'ad_shortcode',
279
- 'taxonomy-advanced_ads_groups',
280
- )
281
  );
282
 
283
- // remove non-white-listed columns.
284
- foreach ( $new_columns as $_key => $_value ) {
285
- if ( ! in_array( $_key, $whitelist, true ) ) {
286
- unset( $new_columns[ $_key ] );
287
- }
288
- }
289
 
290
- return $new_columns;
291
  }
292
 
293
  /**
294
- * Display ad details in ads list
295
  *
296
  * @param string $column_name name of the column.
297
  * @param int $ad_id id of the ad.
298
  *
299
- * @since 1.3.3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300
  */
301
  public function ad_list_columns_content( $column_name, $ad_id ) {
302
- if ( 'ad_details' === $column_name ) {
303
- $ad = new Advanced_Ads_Ad( $ad_id );
 
304
 
305
- // load ad type title.
306
- $types = Advanced_Ads::get_instance()->ad_types;
307
- $type = ( ! empty( $types[ $ad->type ]->title ) ) ? $types[ $ad->type ]->title : 0;
 
 
 
 
 
 
 
 
 
 
308
 
309
- // load ad size.
310
- $size = 0;
311
- if ( ! empty( $ad->width ) || ! empty( $ad->height ) ) {
312
- $size = sprintf( '%d x %d', $ad->width, $ad->height );
313
- }
314
 
315
- $size = apply_filters( 'advanced-ads-list-ad-size', $size, $ad );
 
316
 
317
- $privacy_overriden = ! empty( Advanced_Ads_Privacy::get_instance()->options()['enabled'] ) && ! empty( $ad->options()['privacy']['ignore-consent'] );
 
 
 
 
 
 
 
 
318
 
319
- include ADVADS_BASE_PATH . 'admin/views/ad-list-details-column.php';
320
- }
321
  }
322
 
323
  /**
324
- * Display ad details in ads list
325
  *
326
- * @param string $column_name name of the column.
327
- * @param int $ad_id id of the ad.
328
  *
329
- * @since 1.6.11
330
  */
331
- public function ad_list_columns_timing( $column_name, $ad_id ) {
332
- if ( 'ad_timing' === $column_name ) {
333
- $ad = new Advanced_Ads_Ad( $ad_id );
334
 
335
- $expiry = false;
336
- $post_future = false;
337
- $post_start = get_post_time( 'U', true, $ad->id );
338
- $html_classes = 'advads-filter-timing';
339
- $expiry_date_format = get_option( 'date_format' ) . ', ' . get_option( 'time_format' );
340
 
341
- if ( isset( $ad->expiry_date ) && $ad->expiry_date ) {
342
- $html_classes .= ' advads-filter-any-exp-date';
 
343
 
344
- $expiry = $ad->expiry_date;
345
- if ( $ad->expiry_date < time() ) {
346
- $html_classes .= ' advads-filter-expired';
347
- }
348
- }
349
- if ( $post_start > time() ) {
350
- $post_future = $post_start;
351
- $html_classes .= ' advads-filter-future';
352
- }
353
 
354
- ob_start();
355
- do_action_ref_array(
356
- 'advanced-ads-ad-list-timing-column-after',
357
- array(
358
- $ad,
359
- &$html_classes,
360
- )
361
- );
362
- $content_after = ob_get_clean();
363
 
364
- include ADVADS_BASE_PATH . 'admin/views/ad-list-timing-column.php';
 
365
  }
 
 
366
  }
367
 
368
  /**
369
- * Display ad shortcode in ads list
370
  *
371
- * @param string $column_name name of the column.
372
- * @param int $ad_id id of the ad.
373
  *
374
- * @since 1.8.2
375
  */
376
- public function ad_list_columns_shortcode( $column_name, $ad_id ) {
377
- if ( 'ad_shortcode' === $column_name ) {
378
- $ad = new Advanced_Ads_Ad( $ad_id );
379
-
380
- include ADVADS_BASE_PATH . 'admin/views/ad-list-shortcode-column.php';
 
 
 
 
 
 
 
 
 
381
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
382
  }
383
 
384
  /**
385
  * Display ad shortcode in ads list
386
  *
 
 
 
 
 
 
 
 
 
 
 
387
  * @param array $hidden an array of columns hidden by default.
388
  * @param WP_Screen $screen WP_Screen object of the current screen.
389
  *
390
- * @return array $hidden
391
- * @since 1.10.5
392
  */
393
  public function hide_ad_list_columns( $hidden, $screen ) {
394
-
395
  if ( isset( $screen->id ) && 'edit-' . Advanced_Ads::POST_TYPE_SLUG === $screen->id ) {
396
-
 
 
397
  $hidden[] = 'ad_shortcode';
398
-
399
  }
400
 
401
  return $hidden;
@@ -403,6 +357,8 @@ class Advanced_Ads_Admin_Ad_Type {
403
 
404
  /**
405
  * Adds filter dropdowns before the 'Filter' button on the ad list table
 
 
406
  */
407
  public function ad_list_add_filters() {
408
  $screen = get_current_screen();
@@ -418,9 +374,8 @@ class Advanced_Ads_Admin_Ad_Type {
418
  * @param array $messages existing bulk update messages.
419
  * @param array $counts numbers of updated ads.
420
  *
421
- * @return array $messages
422
  *
423
- * @since 1.4.7
424
  * @see wp-admin/edit.php
425
  */
426
  public function ad_bulk_update_messages( array $messages, array $counts ) {
@@ -523,13 +478,12 @@ class Advanced_Ads_Admin_Ad_Type {
523
  * @todo handling this more dynamic based on ad type
524
  */
525
  public function save_ad( $post_id ) {
526
-
527
  // phpcs:disable WordPress.Security.NonceVerification.Missing
528
  if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads' ) ) // only use for ads, no other post type.
529
- || ! isset( $_POST['post_type'] )
530
- || $this->post_type != $_POST['post_type']
531
- || ! isset( $_POST['advanced_ad']['type'] )
532
- || wp_is_post_revision( $post_id ) ) {
533
  return;
534
  }
535
 
@@ -659,10 +613,8 @@ class Advanced_Ads_Admin_Ad_Type {
659
  * @return array
660
  */
661
  public static function prepare_insert_post_data( $data ) {
662
-
663
  if ( Advanced_Ads::POST_TYPE_SLUG === $data['post_type']
664
  && '' === $data['post_title'] ) {
665
-
666
  if ( function_exists( 'wp_date' ) ) {
667
  // The function wp_date was added in WP 5.3.
668
  $created_time = wp_date( get_option( 'date_format' ) ) . ' ' . wp_date( get_option( 'time_format' ) );
@@ -955,7 +907,6 @@ class Advanced_Ads_Admin_Ad_Type {
955
  10,
956
  2
957
  );
958
-
959
  }
960
 
961
  /**
@@ -1016,4 +967,118 @@ class Advanced_Ads_Admin_Ad_Type {
1016
  return $override_slug;
1017
  }
1018
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1019
  }
23
  * Register hooks function related to the ad type
24
  */
25
  private function __construct() {
26
+ // Register column headers.
27
  add_filter(
28
  'manage_advanced_ads_posts_columns',
29
  array(
30
  $this,
31
  'ad_list_columns_head',
32
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  );
34
+ add_filter( 'manage_advanced_ads_posts_custom_column', array( $this, 'ad_list_columns' ), 10, 2 );
35
+ // Add custom filter views.
36
+ add_action( 'restrict_manage_posts', array( $this, 'ad_list_add_filters' ) );
37
+ add_filter( 'default_hidden_columns', array( $this, 'hide_ad_list_columns' ), 10, 2 );
38
+ add_filter( 'bulk_post_updated_messages', array( $this, 'ad_bulk_update_messages' ), 10, 2 );
39
  // order ad lists.
40
  add_filter( 'request', array( $this, 'ad_list_request' ) );
41
+ add_action( 'all_admin_notices', array( $this, 'no_ads_yet_notice' ) );
 
 
 
 
 
 
 
42
  // Manipulate post data when post is created.
43
+ add_filter( 'wp_insert_post_data', array( $this, 'prepare_insert_post_data' ) );
 
 
 
 
 
 
44
  // Save ads post type.
45
  // @source https://developer.wordpress.org/reference/hooks/save_post_post-post_type/
46
+ add_action( 'save_post_advanced_ads', array( $this, 'save_ad' ) );
47
+ add_action( 'delete_post', array( $this, 'delete_ad' ) );
48
+ add_action( 'edit_form_top', array( $this, 'edit_form_above_title' ) );
49
+ add_action( 'edit_form_after_title', array( $this, 'edit_form_below_title' ) );
50
+ add_action( 'dbx_post_sidebar', array( $this, 'edit_form_end' ) );
51
+ add_action( 'post_submitbox_misc_actions', array( $this, 'add_submit_box_meta' ) );
52
+ add_action( 'admin_enqueue_scripts', array( $this, 'use_code_editor' ) );
53
+ add_filter( 'post_updated_messages', array( $this, 'ad_update_messages' ) );
54
+ add_filter( 'gettext', array( $this, 'replace_cheating_message' ), 20, 2 );
55
+ add_action( 'current_screen', array( $this, 'run_on_ad_edit_screen' ) );
56
+ add_filter( 'pre_wp_unique_post_slug', array( $this, 'pre_wp_unique_post_slug' ), 10, 6 );
57
+ add_filter( 'view_mode_post_types', array( $this, 'remove_view_mode' ) );
58
+ add_filter( 'get_user_option_user-settings', array( $this, 'reset_view_mode_option' ) );
59
+ add_filter( 'screen_settings', array( $this, 'add_screen_options' ), 10, 2 );
60
+ add_action( 'wp_loaded', array( $this, 'save_screen_options' ) );
61
+ add_action( 'load-edit.php', array( $this, 'set_screen_options' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
  $this->post_type = constant( 'Advanced_Ads::POST_TYPE_SLUG' );
64
  }
119
  * Add heading for extra column of ads list
120
  * remove the date column
121
  *
122
+ * @param string[] $columns array with existing columns.
123
  *
124
+ * @return string[]
 
125
  */
126
  public function ad_list_columns_head( $columns ) {
127
  $new_columns = array();
128
+
129
+ foreach ( $columns as $key => $value ) {
130
+ $new_columns[ $key ] = $value;
131
+ // add ad icon column after the checkbox
132
+ if ( $key === 'cb' ) {
133
+ $new_columns['ad_type'] = __( 'Type', 'advanced-ads' );
134
+ continue;
135
+ }
136
+
137
+ if ( $key === 'title' ) {
138
+ $new_columns['title'] = __( 'Name', 'advanced-ads' );
139
+ $new_columns['ad_description'] = __( 'Notes', 'advanced-ads' );
140
+ $new_columns['ad_preview'] = __( 'Preview', 'advanced-ads' );
141
+ $new_columns['ad_size'] = __( 'Size', 'advanced-ads' );
142
+ $new_columns['ad_timing'] = __( 'Ad Planning', 'advanced-ads' );
143
+ $new_columns['ad_shortcode'] = __( 'Ad Shortcode', 'advanced-ads' );
144
  }
 
 
 
 
145
  }
146
 
147
+ $allowed_columns = array(
148
+ 'cb', // checkbox.
149
+ 'title',
150
+ 'author',
151
+ 'ad_type',
152
+ 'ad_description',
153
+ 'ad_preview',
154
+ 'ad_size',
155
+ 'ad_timing',
156
+ 'ad_shortcode',
157
+ 'taxonomy-advanced_ads_groups',
 
158
  );
159
 
160
+ /**
161
+ * Filter the allowed columns for Advanced Ads post type list.
162
+ *
163
+ * @param string[] $allowed_columns The allowed column names.
164
+ */
165
+ $allowed_columns = (array) apply_filters( 'advanced-ads-ad-list-allowed-columns', $allowed_columns );
166
 
167
+ return array_intersect_key( $new_columns, array_flip( $allowed_columns ) );
168
  }
169
 
170
  /**
171
+ * Add ad list column content
172
  *
173
  * @param string $column_name name of the column.
174
  * @param int $ad_id id of the ad.
175
  *
176
+ * @return void
177
+ */
178
+ public function ad_list_columns( $column_name, $ad_id ) {
179
+ $ad = new Advanced_Ads_Ad( $ad_id );
180
+
181
+ switch ( $column_name ) {
182
+ case 'ad_type':
183
+ $this->ad_list_columns_type( $ad );
184
+ break;
185
+ case 'ad_description':
186
+ $this->ad_list_columns_description( $ad );
187
+ break;
188
+ case 'ad_preview':
189
+ $this->ad_list_columns_preview( $ad );
190
+ break;
191
+ case 'ad_size':
192
+ $this->ad_list_columns_size( $ad );
193
+ break;
194
+ case 'ad_timing':
195
+ $this->ad_list_columns_timing( $ad );
196
+ break;
197
+ case 'ad_shortcode':
198
+ $this->ad_list_columns_shortcode( $ad );
199
+ }
200
+ }
201
+
202
+ /**
203
+ * Display ad details in ads list.
204
+ *
205
+ * @param string $column_name Column name.
206
+ * @param int $ad_id Ad id.
207
+ *
208
+ * @return void
209
+ * @deprecated
210
+ * @see Advanced_Ads_Admin_Ad_Type::ad_list_columns_preview()
211
  */
212
  public function ad_list_columns_content( $column_name, $ad_id ) {
213
+ $ad = new Advanced_Ads_Ad( $ad_id );
214
+ $this->ad_list_columns_preview( $ad );
215
+ }
216
 
217
+ /**
218
+ * Display the ad type icon in the ads list.
219
+ *
220
+ * @param Advanced_Ads_Ad $ad ad object.
221
+ *
222
+ * @return void
223
+ */
224
+ private function ad_list_columns_type( Advanced_Ads_Ad $ad ) {
225
+ $ad_types = Advanced_Ads::get_instance()->ad_types;
226
+ if ( ! array_key_exists( $ad->type, $ad_types ) ) {
227
+ echo esc_html( $ad->type );
228
+ return;
229
+ }
230
 
231
+ $size = $this->get_ad_size_string( $ad );
 
 
 
 
232
 
233
+ include ADVADS_BASE_PATH . 'admin/views/ad-list/type.php';
234
+ }
235
 
236
+ /**
237
+ * Display the ad description in the ads list
238
+ *
239
+ * @param Advanced_Ads_Ad $ad ad object.
240
+ *
241
+ * @return void
242
+ */
243
+ private function ad_list_columns_description( Advanced_Ads_Ad $ad ) {
244
+ $description = wp_trim_words( $ad->description, 50 );
245
 
246
+ include ADVADS_BASE_PATH . 'admin/views/ad-list/description.php';
 
247
  }
248
 
249
  /**
250
+ * Display an ad preview in ads list.
251
  *
252
+ * @param Advanced_Ads_Ad $ad ad object.
 
253
  *
254
+ * @return void
255
  */
256
+ private function ad_list_columns_preview( $ad ) {
257
+ $types = Advanced_Ads::get_instance()->ad_types;
258
+ $type = ( ! empty( $types[ $ad->type ]->title ) ) ? $types[ $ad->type ]->title : 0;
259
 
260
+ if ( ! $type ) {
261
+ return;
262
+ }
 
 
263
 
264
+ if ( ! empty( $type ) ) {
265
+ $types[ $ad->type ]->render_preview( $ad );
266
+ }
267
 
268
+ do_action( 'advanced-ads-ad-list-details-column-after', $ad );
269
+ }
 
 
 
 
 
 
 
270
 
271
+ /**
272
+ * Display the ad size in the ads list
273
+ *
274
+ * @param Advanced_Ads_Ad $ad ad object.
275
+ *
276
+ * @return void
277
+ */
278
+ private function ad_list_columns_size( $ad ) {
279
+ $size = $this->get_ad_size_string( $ad );
280
 
281
+ if ( empty( $size ) ) {
282
+ return;
283
  }
284
+
285
+ include ADVADS_BASE_PATH . 'admin/views/ad-list/size.php';
286
  }
287
 
288
  /**
289
+ * Display ad timing in ads list
290
  *
291
+ * @param Advanced_Ads_Ad $ad ad object.
 
292
  *
293
+ * @return void
294
  */
295
+ public function ad_list_columns_timing( $ad ) {
296
+ $expiry = false;
297
+ $post_future = false;
298
+ $post_start = get_post_time( 'U', true, $ad->id );
299
+ $html_classes = 'advads-filter-timing';
300
+ $expiry_date_format = get_option( 'date_format' ) . ', ' . get_option( 'time_format' );
301
+
302
+ if ( isset( $ad->expiry_date ) && $ad->expiry_date ) {
303
+ $html_classes .= ' advads-filter-any-exp-date';
304
+
305
+ $expiry = $ad->expiry_date;
306
+ if ( $ad->expiry_date < time() ) {
307
+ $html_classes .= ' advads-filter-expired';
308
+ }
309
  }
310
+ if ( $post_start > time() ) {
311
+ $post_future = $post_start;
312
+ $html_classes .= ' advads-filter-future';
313
+ }
314
+
315
+ ob_start();
316
+ do_action_ref_array(
317
+ 'advanced-ads-ad-list-timing-column-after',
318
+ array(
319
+ $ad,
320
+ &$html_classes,
321
+ )
322
+ );
323
+ $content_after = ob_get_clean();
324
+
325
+ include ADVADS_BASE_PATH . 'admin/views/ad-list/timing.php';
326
  }
327
 
328
  /**
329
  * Display ad shortcode in ads list
330
  *
331
+ * @param Advanced_Ads_Ad $ad ad object.
332
+ *
333
+ * @return void
334
+ */
335
+ public function ad_list_columns_shortcode( $ad ) {
336
+ include ADVADS_BASE_PATH . 'admin/views/ad-list/shortcode.php';
337
+ }
338
+
339
+ /**
340
+ * Hide certain columns on the ad list by default.
341
+ *
342
  * @param array $hidden an array of columns hidden by default.
343
  * @param WP_Screen $screen WP_Screen object of the current screen.
344
  *
345
+ * @return array
 
346
  */
347
  public function hide_ad_list_columns( $hidden, $screen ) {
 
348
  if ( isset( $screen->id ) && 'edit-' . Advanced_Ads::POST_TYPE_SLUG === $screen->id ) {
349
+ $hidden[] = 'ad_description';
350
+ $hidden[] = 'author';
351
+ $hidden[] = 'ad_size';
352
  $hidden[] = 'ad_shortcode';
 
353
  }
354
 
355
  return $hidden;
357
 
358
  /**
359
  * Adds filter dropdowns before the 'Filter' button on the ad list table
360
+ *
361
+ * @return void
362
  */
363
  public function ad_list_add_filters() {
364
  $screen = get_current_screen();
374
  * @param array $messages existing bulk update messages.
375
  * @param array $counts numbers of updated ads.
376
  *
377
+ * @return array
378
  *
 
379
  * @see wp-admin/edit.php
380
  */
381
  public function ad_bulk_update_messages( array $messages, array $counts ) {
478
  * @todo handling this more dynamic based on ad type
479
  */
480
  public function save_ad( $post_id ) {
 
481
  // phpcs:disable WordPress.Security.NonceVerification.Missing
482
  if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads' ) ) // only use for ads, no other post type.
483
+ || ! isset( $_POST['post_type'] )
484
+ || $this->post_type !== $_POST['post_type']
485
+ || ! isset( $_POST['advanced_ad']['type'] )
486
+ || wp_is_post_revision( $post_id ) ) {
487
  return;
488
  }
489
 
613
  * @return array
614
  */
615
  public static function prepare_insert_post_data( $data ) {
 
616
  if ( Advanced_Ads::POST_TYPE_SLUG === $data['post_type']
617
  && '' === $data['post_title'] ) {
 
618
  if ( function_exists( 'wp_date' ) ) {
619
  // The function wp_date was added in WP 5.3.
620
  $created_time = wp_date( get_option( 'date_format' ) ) . ' ' . wp_date( get_option( 'time_format' ) );
907
  10,
908
  2
909
  );
 
910
  }
911
 
912
  /**
967
  return $override_slug;
968
  }
969
 
970
+ /**
971
+ * Remove the View Mode setting in Screen Options
972
+ *
973
+ * @param array $view_mode_post_types post types that have the View Mode option.
974
+ *
975
+ * @return array
976
+ */
977
+ public function remove_view_mode( $view_mode_post_types ) {
978
+ unset( $view_mode_post_types['advanced_ads'] );
979
+
980
+ return $view_mode_post_types;
981
+ }
982
+
983
+ /**
984
+ * Set the removed post list mode to "List", if it was set to "Excerpt".
985
+ *
986
+ * @param string $user_options Query string containing user options.
987
+ *
988
+ * @return string
989
+ */
990
+ public function reset_view_mode_option( $user_options ) {
991
+ return str_replace( '&posts_list_mode=excerpt', '&posts_list_mode=list', $user_options );
992
+ }
993
+
994
+ /**
995
+ * Register custom screen options on the ad overview page.
996
+ *
997
+ * @param string $options Screen options HTML.
998
+ * @param WP_Screen $screen Screen object.
999
+ *
1000
+ * @return string
1001
+ */
1002
+ public function add_screen_options( $options, WP_Screen $screen ) {
1003
+ if ( $screen->base !== 'edit' || $screen->id !== 'edit-advanced_ads' ) {
1004
+ return $options;
1005
+ }
1006
+
1007
+ $show_filters = (bool) $screen->get_option( 'show-filters' );
1008
+
1009
+ // If the default WordPress screen options don't exist, we have to force the submit button to show.
1010
+ add_filter( 'screen_options_show_submit', '__return_true' );
1011
+ ob_start();
1012
+ require ADVADS_BASE_PATH . 'admin/views/ad-list/screen-options.php';
1013
+
1014
+ return $options . ob_get_clean();
1015
+ }
1016
+
1017
+ /**
1018
+ * Save the screen option setting.
1019
+ *
1020
+ * @return void
1021
+ */
1022
+ public function save_screen_options() {
1023
+ if ( ! isset( $_POST['advanced-ads-screen-options'] ) || ! is_array( $_POST['advanced-ads-screen-options'] ) ) {
1024
+ return;
1025
+ }
1026
+
1027
+ check_admin_referer( 'screen-options-nonce', 'screenoptionnonce' );
1028
+
1029
+ $user = wp_get_current_user();
1030
+
1031
+ if ( ! $user ) {
1032
+ return;
1033
+ }
1034
+
1035
+ // sanitize options
1036
+ update_user_meta( $user->ID, 'advanced-ads-ad-list-screen-options', array(
1037
+ 'show-filters' => ! empty( $_POST['advanced-ads-screen-options']['show-filters'] ),
1038
+ ) );
1039
+ }
1040
+
1041
+ /**
1042
+ * Add the screen options to the WP_Screen options
1043
+ *
1044
+ * @return void
1045
+ */
1046
+ public function set_screen_options() {
1047
+ $screen = get_current_screen();
1048
+
1049
+ if ( ! isset( $screen->id ) || $screen->id !== 'edit-advanced_ads' ) {
1050
+ return;
1051
+ }
1052
+
1053
+ $screen_options = get_user_meta( get_current_user_id(), 'advanced-ads-ad-list-screen-options', true );
1054
+ if ( ! is_array( $screen_options ) ) {
1055
+ return;
1056
+ }
1057
+ foreach ( $screen_options as $option_name => $value ) {
1058
+ add_screen_option( $option_name, $value );
1059
+ }
1060
+ }
1061
+
1062
+ /**
1063
+ * Get the ad size string to display in post list.
1064
+ *
1065
+ * @param Advanced_Ads_Ad $ad Ad object.
1066
+ *
1067
+ * @return string
1068
+ */
1069
+ private function get_ad_size_string( Advanced_Ads_Ad $ad ) {
1070
+ // load ad size.
1071
+ $size = '';
1072
+ if ( ! empty( $ad->width ) || ! empty( $ad->height ) ) {
1073
+ $size = sprintf( '%d &times; %d', $ad->width, $ad->height );
1074
+ }
1075
+
1076
+ /**
1077
+ * Filter the ad size string to display in the ads post list.
1078
+ *
1079
+ * @param string $size Size string.
1080
+ * @param Advanced_Ads_Ad $ad Ad object.
1081
+ */
1082
+ return (string) apply_filters( 'advanced-ads-list-ad-size', $size, $ad );
1083
+ }
1084
  }
admin/includes/class-list-filters.php CHANGED
@@ -67,6 +67,27 @@ class Advanced_Ads_Ad_List_Filters {
67
 
68
  add_filter( 'views_edit-' . Advanced_Ads::POST_TYPE_SLUG, array( $this, 'add_expired_view' ) );
69
  add_filter( 'views_edit-' . Advanced_Ads::POST_TYPE_SLUG, array( $this, 'add_expiring_view' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  }
71
 
72
  /**
@@ -77,7 +98,6 @@ class Advanced_Ads_Ad_List_Filters {
77
  * @return null
78
  */
79
  private function collect_filters( $posts ) {
80
-
81
  $all_sizes = array();
82
  $all_types = array();
83
  $all_dates = array();
@@ -91,7 +111,7 @@ class Advanced_Ads_Ad_List_Filters {
91
  );
92
 
93
  // can not filter correctly with "trashed" posts. Do not display any filtering option in this case.
94
- if ( isset( $_REQUEST['post_status'] ) && 'trash' === $_REQUEST['post_status'] ) {
95
  $this->all_filters = $all_filters;
96
 
97
  return;
@@ -152,7 +172,6 @@ class Advanced_Ads_Ad_List_Filters {
152
  }
153
 
154
  $all_filters = apply_filters( 'advanced-ads-ad-list-column-filter', $all_filters, $post, $ad_option );
155
-
156
  }
157
 
158
  $this->all_filters = $all_filters;
@@ -178,7 +197,7 @@ class Advanced_Ads_Ad_List_Filters {
178
  $expiration->is_ad_expired();
179
  }
180
 
181
- $this->all_ads = $posts;
182
  }
183
 
184
  /**
@@ -292,6 +311,32 @@ class Advanced_Ads_Ad_List_Filters {
292
  return $posts;
293
  }
294
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  $this->collect_all_ads( $posts );
296
  $this->collect_all_groups();
297
 
@@ -384,7 +429,6 @@ class Advanced_Ads_Ad_List_Filters {
384
  * Filter by taxonomy
385
  */
386
  if ( isset( $request['taxonomy'] ) && isset( $request['term'] ) ) {
387
-
388
  $term = $request['term'];
389
  global $wpdb;
390
  $q = 'SELECT `object_id` FROM `' . $wpdb->prefix . 'term_relationships` WHERE `term_taxonomy_id` = (' .
@@ -412,7 +456,6 @@ class Advanced_Ads_Ad_List_Filters {
412
  $posts = $new_posts;
413
  $the_query->found_posts = count( $posts );
414
  $using_original = false;
415
-
416
  }
417
 
418
  /**
@@ -440,15 +483,15 @@ class Advanced_Ads_Ad_List_Filters {
440
  $the_list = $using_original ? $this->all_ads : $posts;
441
  foreach ( $the_list as $post ) {
442
  $option = $this->all_ads_options[ $post->ID ];
443
- if ( 'responsive' === $request['adsize'] ) {
444
- if ( 'adsense' === $option['type'] ) {
445
  $content = false;
446
  try {
447
  $content = json_decode( $post->post_content, true );
448
  } catch ( Exception $e ) {
449
  $content = false;
450
  }
451
- if ( $content && 'responsive' === $content['unitType'] ) {
452
  $new_posts[] = $post;
453
  }
454
  }
@@ -588,7 +631,7 @@ class Advanced_Ads_Ad_List_Filters {
588
  private function views_order() {
589
  static $views_order;
590
  if ( $views_order === null ) {
591
- $views_order = array_flip( array( 'all', 'publish', 'future', 'expiring', Advanced_Ads_Ad_Expiration::POST_STATUS, 'draft', 'pending', 'trash' ) );
592
  }
593
 
594
  return $views_order;
@@ -619,4 +662,98 @@ class Advanced_Ads_Ad_List_Filters {
619
  );
620
  } );
621
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
622
  }
67
 
68
  add_filter( 'views_edit-' . Advanced_Ads::POST_TYPE_SLUG, array( $this, 'add_expired_view' ) );
69
  add_filter( 'views_edit-' . Advanced_Ads::POST_TYPE_SLUG, array( $this, 'add_expiring_view' ) );
70
+ add_action( 'manage_posts_extra_tablenav', array( $this, 'ad_views' ) );
71
+ add_action( 'admin_enqueue_scripts', array( $this, 'ad_list_scripts' ), 11 );
72
+ }
73
+
74
+ /**
75
+ * Return true if the current screen is the ad list.
76
+ *
77
+ * @return bool
78
+ */
79
+ private function is_ad_list_screen() {
80
+ $screen = get_current_screen();
81
+ return isset( $screen->id ) && $screen->id === 'edit-advanced_ads';
82
+ }
83
+
84
+ /**
85
+ * Check if the current screen uses a search or filter.
86
+ *
87
+ * @return bool
88
+ */
89
+ public static function uses_filter_or_search() {
90
+ return ! empty( $_GET['s'] ) || ! empty( $_GET['adtype'] ) || ! empty( $_GET['adsize'] ) || ! empty( $_GET['adgroup'] );
91
  }
92
 
93
  /**
98
  * @return null
99
  */
100
  private function collect_filters( $posts ) {
 
101
  $all_sizes = array();
102
  $all_types = array();
103
  $all_dates = array();
111
  );
112
 
113
  // can not filter correctly with "trashed" posts. Do not display any filtering option in this case.
114
+ if ( isset( $_REQUEST['post_status'] ) && $_REQUEST['post_status'] === 'trash' ) {
115
  $this->all_filters = $all_filters;
116
 
117
  return;
172
  }
173
 
174
  $all_filters = apply_filters( 'advanced-ads-ad-list-column-filter', $all_filters, $post, $ad_option );
 
175
  }
176
 
177
  $this->all_filters = $all_filters;
197
  $expiration->is_ad_expired();
198
  }
199
 
200
+ $this->all_ads = $posts;
201
  }
202
 
203
  /**
311
  return $posts;
312
  }
313
 
314
+ // Searching an ad ID.
315
+ if ( (int) $the_query->query_vars['s'] !== 0 ) {
316
+ global $wpdb;
317
+ $single_ad = ( new Advanced_Ads_Model( $wpdb ) )->get_ads(
318
+ array(
319
+ 'p' => (int) $the_query->query_vars['s'],
320
+ 'post_status' => array( 'any' ),
321
+ )
322
+ );
323
+
324
+ if ( ! empty( $single_ad ) ) {
325
+ // Head to the ad edit page if one and only one ad found.
326
+ if ( empty( $posts ) ) {
327
+ wp_safe_redirect( add_query_arg( array(
328
+ 'post' => $single_ad[0]->ID,
329
+ 'action' => 'edit',
330
+ ), admin_url( 'post.php' ) ) );
331
+ die;
332
+ }
333
+
334
+ if ( ! in_array( $single_ad[0]->ID, wp_list_pluck( $posts, 'ID' ), true ) ) {
335
+ $posts[] = $single_ad[0];
336
+ }
337
+ }
338
+ }
339
+
340
  $this->collect_all_ads( $posts );
341
  $this->collect_all_groups();
342
 
429
  * Filter by taxonomy
430
  */
431
  if ( isset( $request['taxonomy'] ) && isset( $request['term'] ) ) {
 
432
  $term = $request['term'];
433
  global $wpdb;
434
  $q = 'SELECT `object_id` FROM `' . $wpdb->prefix . 'term_relationships` WHERE `term_taxonomy_id` = (' .
456
  $posts = $new_posts;
457
  $the_query->found_posts = count( $posts );
458
  $using_original = false;
 
459
  }
460
 
461
  /**
483
  $the_list = $using_original ? $this->all_ads : $posts;
484
  foreach ( $the_list as $post ) {
485
  $option = $this->all_ads_options[ $post->ID ];
486
+ if ( $request['adsize'] === 'responsive' ) {
487
+ if ( isset( $option['type'] ) && $option['type'] === 'adsense' ) {
488
  $content = false;
489
  try {
490
  $content = json_decode( $post->post_content, true );
491
  } catch ( Exception $e ) {
492
  $content = false;
493
  }
494
+ if ( $content && $content['unitType'] === 'responsive' ) {
495
  $new_posts[] = $post;
496
  }
497
  }
631
  private function views_order() {
632
  static $views_order;
633
  if ( $views_order === null ) {
634
+ $views_order = array_flip( array( 'all', 'mine', 'publish', 'future', 'expiring', Advanced_Ads_Ad_Expiration::POST_STATUS, 'draft', 'pending', 'trash' ) );
635
  }
636
 
637
  return $views_order;
662
  );
663
  } );
664
  }
665
+
666
+ /**
667
+ * Displays the list of views available for Ads.
668
+ */
669
+ public function ad_views() {
670
+ global $wp_list_table;
671
+
672
+ if ( ! $this->is_ad_list_screen() ) {
673
+ return;
674
+ }
675
+
676
+ // unregister the hook to prevent the navigation to appear again below the footer
677
+ remove_action( 'manage_posts_extra_tablenav', array( $this, 'ad_views' ) );
678
+
679
+ $views = $wp_list_table->get_views();
680
+ /**
681
+ * Filters the list of available list table views.
682
+ *
683
+ * The dynamic portion of the hook name, `$this->screen->id`, refers
684
+ * to the ID of the current screen.
685
+ *
686
+ * @param string[] $views An array of available list table views.
687
+ */
688
+ $views = apply_filters( "views_{$wp_list_table->screen->id}", $views );
689
+
690
+ if ( empty( $views ) ) {
691
+ return;
692
+ }
693
+
694
+ $wp_list_table->screen->render_screen_reader_content( 'heading_views' );
695
+ $views_new = array();
696
+
697
+ $is_all = count( array_diff_key( $_GET, array(
698
+ 'post_type' => Advanced_Ads::POST_TYPE_SLUG,
699
+ 'orderby' => '',
700
+ 'order' => '',
701
+ 'paged' => '',
702
+ 'mode' => '',
703
+ ) ) ) === 0;
704
+
705
+ foreach ( $views as $class => $view ) {
706
+ $view = str_replace( array( ')', '(' ), array( '', '' ), $view );
707
+ $class .= strpos( $view, 'current' ) ? ' advads-button-primary' : ' advads-button-secondary';
708
+ $views_new[ $class ] = $view;
709
+ }
710
+
711
+ $show_trash_delete_button = isset( $_GET['post_status'] ) && 'trash' === $_GET['post_status'] && have_posts() && current_user_can( get_post_type_object( $wp_list_table->screen->post_type )->cap->edit_others_posts );
712
+
713
+ include ADVADS_BASE_PATH . 'admin/views/ad-list/view-list.php';
714
+ }
715
+
716
+ /**
717
+ * Custom scripts and styles for the ad list page
718
+ *
719
+ * @return void
720
+ */
721
+ public function ad_list_scripts() {
722
+ if ( ! $this->is_ad_list_screen() ) {
723
+ return;
724
+ }
725
+
726
+ // show label before the search form if this is a search
727
+ if ( ! empty( $_GET['s'] ) ) {
728
+ wp_add_inline_style( ADVADS_SLUG . '-admin-styles', "
729
+ .post-type-advanced_ads .search-box:before { content: '" . esc_html__( 'Showing search results for', 'advanced-ads' ) . "'; float: left; margin-right: 8px; line-height: 30px; font-weight: 700; }
730
+ .post-type-advanced_ads .subtitle { display: none; }
731
+ " );
732
+ }
733
+
734
+ // adjust search form when there are no results
735
+ if ( self::uses_filter_or_search() && 0 === count( $this->all_ads ) ) {
736
+ wp_add_inline_style( ADVADS_SLUG . '-admin-styles', '.post-type-advanced_ads .search-box { display: block; margin-top: 10px; }' );
737
+ return;
738
+ }
739
+
740
+ // show filters, if the option to show them is enabled or a search is running
741
+ if ( get_current_screen()->get_option( 'show-filters' ) || self::uses_filter_or_search() ) {
742
+ wp_add_inline_style( ADVADS_SLUG . '-admin-styles', '.post-type-advanced_ads .search-box { display: block; }
743
+ .post-type-advanced_ads .tablenav.top .alignleft.actions:not(.bulkactions) { display: block; }' );
744
+ return;
745
+ }
746
+
747
+ wp_add_inline_script( ADVADS_SLUG . '-admin-script', "
748
+ jQuery( document ).ready( function ( $ ) {
749
+ $( '#advads-show-filters' ).on( 'click', function() {
750
+ const disabled = $( this ).find( '.dashicons' ).hasClass('dashicons-arrow-up');
751
+ $( '.post-type-advanced_ads .search-box' ).toggle(!disabled);
752
+ $( '.post-type-advanced_ads .tablenav.top .alignleft.actions:not(.bulkactions)' ).toggle(!disabled);
753
+ $( '#advads-show-filters .dashicons' ).toggleClass( 'dashicons-filter', disabled );
754
+ $( '#advads-show-filters .dashicons' ).toggleClass( 'dashicons-arrow-up', ! disabled );
755
+ });
756
+ });
757
+ " );
758
+ }
759
  }
admin/includes/class-menu.php CHANGED
@@ -363,6 +363,7 @@ class Advanced_Ads_Admin_Menu {
363
  $screen->taxonomy = Advanced_Ads::AD_GROUP_TAXONOMY;
364
  $wp_list_table = _get_list_table( 'WP_Terms_List_Table' );
365
  $wp_list_table->prepare_items();
 
366
  // load template.
367
  include ADVADS_BASE_PATH . 'admin/views/ad-group.php';
368
  }
363
  $screen->taxonomy = Advanced_Ads::AD_GROUP_TAXONOMY;
364
  $wp_list_table = _get_list_table( 'WP_Terms_List_Table' );
365
  $wp_list_table->prepare_items();
366
+ $is_search = ! empty( $_GET['s'] );
367
  // load template.
368
  include ADVADS_BASE_PATH . 'admin/views/ad-group.php';
369
  }
admin/views/ad-group.php CHANGED
@@ -10,6 +10,7 @@
10
  *
11
  * @var WP_List_Table|false $wp_list_table the groups list table
12
  * @var WP_Taxonomy $tax ad group taxonomy
 
13
  */
14
 
15
  $ad_groups_list = new Advanced_Ads_Groups_List();
@@ -84,9 +85,9 @@ if ( isset( $_REQUEST['advads-last-edited-group'] ) ) {
84
 
85
  <div id="col-container">
86
  <div class="col-wrap">
87
- <div class="tablenav top" style="padding-bottom: 20px;">
88
  <?php
89
- if ( ! empty( $_REQUEST['s'] ) ) {
90
  printf( '<span class="subtitle" style="float:left;">' . __( 'Search results for: %s' ) . '</span>', '<strong>' . esc_html( wp_unslash( $_REQUEST['s'] ) ) . '</strong>' );
91
  }
92
  ?>
10
  *
11
  * @var WP_List_Table|false $wp_list_table the groups list table
12
  * @var WP_Taxonomy $tax ad group taxonomy
13
+ * @var bool $is_search true if a group is searched.
14
  */
15
 
16
  $ad_groups_list = new Advanced_Ads_Groups_List();
85
 
86
  <div id="col-container">
87
  <div class="col-wrap">
88
+ <div class="tablenav top <?php echo $is_search ? '' : 'hidden advads-toggle-with-filters-button'; ?>" style="padding-bottom: 20px;">
89
  <?php
90
+ if ( $is_search ) {
91
  printf( '<span class="subtitle" style="float:left;">' . __( 'Search results for: %s' ) . '</span>', '<strong>' . esc_html( wp_unslash( $_REQUEST['s'] ) ) . '</strong>' );
92
  }
93
  ?>
admin/views/ad-info-top.php CHANGED
@@ -1,6 +1,10 @@
1
  <?php // display ad wizard controls.
2
- ?><button id="advads-start-wizard" type="button" class="header-action button"><span class="dashicons dashicons-controls-play"></span><?php esc_html_e( 'Start Wizard', 'advanced-ads' ); ?></button>
3
- <button id="advads-stop-wizard" type="button" class="header-action button advads-stop-wizard hidden"><span class="dashicons dashicons-no"></span><?php esc_html_e( 'Stop Wizard', 'advanced-ads' ); ?></button>
 
 
 
 
4
  <script>
5
  // move wizard button to head.
6
  jQuery('#advads-start-wizard').appendTo('#advads-header-actions');
1
  <?php // display ad wizard controls.
2
+ ?><button id="advads-start-wizard" type="button" class="header-action button advads-button-secondary">
3
+ <span class="dashicons dashicons-controls-play"></span><?php esc_html_e( 'Start Wizard', 'advanced-ads' ); ?>
4
+ </button>
5
+ <button id="advads-stop-wizard" type="button" class="header-action button advads-button-secondary advads-stop-wizard hidden">
6
+ <span class="dashicons dashicons-no"></span><?php esc_html_e( 'Stop Wizard', 'advanced-ads' ); ?>
7
+ </button>
8
  <script>
9
  // move wizard button to head.
10
  jQuery('#advads-start-wizard').appendTo('#advads-header-actions');
admin/views/ad-list-details-column.php DELETED
@@ -1,25 +0,0 @@
1
- <fieldset class="inline-edit-col-left">
2
- <div class="inline-edit-col">
3
- <?php if ( ! empty( $type ) ) :
4
- // display image, if this is the image type.
5
- if ( 'image' === $ad->type ) {
6
- $image_id = ( isset( $ad->output['image_id'] ) ) ? $ad->output['image_id'] : '';
7
- $types[ $ad->type ]->create_image_icon( $image_id );
8
- }
9
- ?><p><strong class="advads-ad-type"><?php echo esc_attr( $type ); ?></strong></p>
10
- <?php
11
- endif;
12
- if ( ! empty( $size ) ) :
13
- ?>
14
- <p class="advads-ad-size"><?php echo esc_attr( $size ); ?></p>
15
- <?php
16
- endif;
17
- ?>
18
- <?php if ( $privacy_overriden ) : ?>
19
- <p><?php esc_html_e( 'Consent disabled', 'advanced-ads' ); ?></p>
20
- <?php endif; ?>
21
- <?php
22
- do_action( 'advanced-ads-ad-list-details-column-after', $ad );
23
- ?>
24
- </div>
25
- </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/views/ad-list/description.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render the "Notes" column content in the ad list.
4
+ *
5
+ * @var string $description ad description.
6
+ */
7
+ ?>
8
+ <div class="advads-ad-list-description"><?php echo esc_html( $description ); ?></div>
admin/views/ad-list/preview-image.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render preview information for the image ad type
4
+ *
5
+ * @var string $src image source URL.
6
+ * @var string $alt alt attribute value.
7
+ * @var string $preview_hwstring width and height information for the smaller preview icon.
8
+ * @var string $tooltip_hwstring width and height information for the larger version in the tooltip.
9
+ */
10
+ ?>
11
+ <span class="advads-ad-list-tooltip">
12
+ <span class="advads-ad-list-tooltip-content">
13
+ <?php
14
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $hwstring is not something we can escape.
15
+ printf( '<img src="%s" alt="%s" %s/>', esc_url( $src ), esc_attr( $alt ), $tooltip_hwstring );
16
+ ?>
17
+ </span>
18
+ <?php
19
+ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $hwstring is not something we can escape.
20
+ printf( '<img src="%s" alt="%s" %s/>', esc_url( $src ), esc_attr( $alt ), $preview_hwstring );
21
+ ?>
22
+ </span>
admin/views/ad-list/screen-options.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Screen Options for the ad list
4
+ * #list-view-mode needs to be here to fix an issue were the list view mode cannot be reset automatically. Saving the form again does that.
5
+ *
6
+ * @var bool $show_filters
7
+ */
8
+ ?>
9
+ <input id="list-view-mode" type="hidden" name="mode" value="list">
10
+ <fieldset class="metabox-prefs advads-show-filter">
11
+ <legend><?php esc_html_e( 'Filters', 'advanced-ads' ); ?></legend>
12
+ <input id="advads-screen-options-show-filters" type="checkbox" name="advanced-ads-screen-options[show-filters]" value="true" <?php checked( $show_filters ); ?> />
13
+ <label for="advads-screen-options-show-filters"><?php esc_html_e( 'Show filters permanently', 'advanced-ads' ); ?></label>
14
+ </fieldset>
15
+ <input type="hidden" name="advanced-ads-screen-options[sent]" value="true"/>
admin/views/{ad-list-shortcode-column.php → ad-list/shortcode.php} RENAMED
File without changes
admin/views/ad-list/size.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render the ad size column content in the ad list.
4
+ *
5
+ * @var string $size ad size string.
6
+ */
7
+ ?>
8
+ <span class="advads-ad-size"><?php echo esc_html( $size ); ?></span>
9
+
admin/views/{ad-list-timing-column.php → ad-list/timing.php} RENAMED
File without changes
admin/views/ad-list/type.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render the ad type column content in the ad list.
4
+ *
5
+ * @var Advanced_Ads_Ad_Type_Abstract[] $ad_types class instances for each ad type.
6
+ * @var Advanced_Ads_Ad $ad ad object.
7
+ */
8
+ ?>
9
+ <span class="advads-ad-list-tooltip">
10
+ <span class="advads-ad-list-tooltip-content">
11
+ <strong><?php echo esc_html( $ad_types[ $ad->type ]->title ); ?></strong><br/>
12
+ <?php if ( ! empty( $size ) ) : ?>
13
+ <span class="advads-ad-size"><?php echo esc_html( $size ); ?></span>
14
+ <?php
15
+ endif;
16
+ $ad_types[ $ad->type ]->render_ad_type_tooltip( $ad );
17
+ ?>
18
+ </span>
19
+ <a href="<?php echo esc_url( get_edit_post_link( $ad->id ) ); ?>">
20
+ <?php $ad_types[ $ad->type ]->render_icon( $ad ); ?>
21
+ </a>
22
+ </span>
admin/views/ad-list/view-list.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render the view navigation items on the ad list.
4
+ *
5
+ * @var array $views_new list of views.
6
+ * @var bool $show_trash_delete_button if the trash delete button is visible.
7
+ */
8
+ ?>
9
+ <ul class="advanced-ads-ad-list-views">
10
+ <?php foreach ( $views_new as $class => $view ) : ?>
11
+ <li class="button <?php echo esc_attr( $class ); ?>">
12
+ <?php
13
+ echo wp_kses( $view, array(
14
+ 'a' => array( 'href' => array() ),
15
+ 'span' => array( 'class' => array() ),
16
+ ) );
17
+ ?>
18
+ </li>
19
+ <?php endforeach; ?>
20
+ </ul>
21
+ <?php if ( $show_trash_delete_button ) : ?>
22
+ <button type="submit" name="delete_all" id="delete_all" class="button advads-button-primary">
23
+ <span class="dashicons dashicons-trash"></span><?php esc_html_e( 'Empty Trash', 'advanced-ads' ); ?>
24
+ </button>
25
+ <?php
26
+ endif;
27
+
admin/views/header.php CHANGED
@@ -2,8 +2,16 @@
2
  /**
3
  * Header on admin pages
4
  *
5
- * @var string $title page title.
6
- * @var string $screen_id ID of the current screen.
 
 
 
 
 
 
 
 
7
  */
8
  ?>
9
  <div id="advads-header">
@@ -13,38 +21,34 @@
13
  <h1><?php echo esc_html( $title ); ?></h1>
14
  </div>
15
  <div id="advads-header-actions">
16
- <?php
17
- // load page-specific information
18
- $manual_url = 'manual/';
19
- switch ( $screen_id ) :
20
- case 'advanced_ads': // ad edit page
21
- case 'edit-advanced_ads': // ad overview
22
- ?>
23
- <a href="<?php echo esc_url( admin_url( 'post-new.php?post_type=advanced_ads' ) ); ?>" class="header-action button" ><span class="dashicons dashicons-plus"></span><?php esc_html_e( 'New Ad', 'advanced-ads' ); ?></a>
24
- <?php
25
- $manual_url = 'manual/first-ad/';
26
- break;
27
- case 'advanced-ads_page_advanced-ads-groups': // ad groups
28
- ?>
29
- <a href="#" id="advads-new-ad-group-link" class="header-action button"><span class="dashicons dashicons-plus"></span><?php esc_html_e( 'New Ad Group', 'advanced-ads' ); ?></a>
30
- <?php
31
- $manual_url = 'manual/rotate-ad/';
32
- break;
33
- case 'advanced-ads_page_advanced-ads-placements':
34
- ?>
35
- <a href="#modal-placement-new" class="header-action button" title="<?php esc_html_e( 'Create a new placement', 'advanced-ads' ); ?>"><span class="dashicons dashicons-plus"></span><?php esc_html_e( 'New Placement', 'advanced-ads' ); ?></a>
36
- <?php
37
- $manual_url = 'manual/placements/';
38
- break;
39
- endswitch;
40
- $manual_url = apply_filters( 'advanced-ads-admin-header-manual-url', $manual_url, $screen_id );
41
- ?>
42
  </div>
43
  <div id="advads-header-links">
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  <?php if ( ! defined( 'AAP_VERSION' ) ) : ?>
45
- <a class="advads-upgrade" href="<?php echo esc_url( ADVADS_URL ); ?>add-ons/?utm_source=advanced-ads&utm_medium=link&utm_campaign=header-upgrade-<?php echo esc_attr( $screen_id ); ?>" target="_blank"><?php esc_html_e( 'See all Add-ons', 'advanced-ads' ); ?></a>
 
 
46
  <?php endif; ?>
47
- <a href="<?php echo esc_url( ADVADS_URL . $manual_url ); ?>?utm_source=advanced-ads&utm_medium=link&utm_campaign=header-manual-<?php echo esc_attr( $screen_id ); ?>" target="_blank" class="advads-manual-link"><?php esc_html_e( 'Manual', 'advanced-ads' ); ?></a>
 
 
48
  </div>
49
  </div>
50
  </div>
2
  /**
3
  * Header on admin pages
4
  *
5
+ * @var string $title page title.
6
+ * @var WP_Screen $screen Current screen
7
+ * @var string $reset_href href attribute for the reset button
8
+ * @var bool $show_filter_button if the filter button is visible
9
+ * @var string $filter_disabled if the visible filter button is disabled
10
+ * @var string $new_button_label text displayed on the New button
11
+ * @var string $new_button_href href of the New button
12
+ * @var string $new_button_id id of the New button
13
+ * @var string $show_screen_options if to show the Screen Options button
14
+ * @var string $manual_url target of the manual link
15
  */
16
  ?>
17
  <div id="advads-header">
21
  <h1><?php echo esc_html( $title ); ?></h1>
22
  </div>
23
  <div id="advads-header-actions">
24
+ <?php if ( $new_button_label ) : ?>
25
+ <a href="<?php echo esc_url( $new_button_href ); ?>" class="header-action button advads-button-primary" id="<?php echo esc_attr( $new_button_id ); ?>">
26
+ <span class="dashicons dashicons-plus"></span><?php echo esc_html( $new_button_label ); ?>
27
+ </a>
28
+ <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  </div>
30
  <div id="advads-header-links">
31
+ <?php if ( $reset_href ) : ?>
32
+ <a href="<?php echo esc_url( $reset_href ); ?>" class="button advads-button-secondary advads-button-icon-right">
33
+ <?php esc_html_e( 'Reset', 'advanced-ads' ); ?><span class="dashicons dashicons-undo"></span>
34
+ </a>
35
+ <?php endif; ?>
36
+ <?php if ( $show_filter_button ) : ?>
37
+ <a id="advads-show-filters" class="button advads-button-secondary advads-button-icon-right <?php echo esc_attr( $filter_disabled ); ?>">
38
+ <?php esc_html_e( 'Filters', 'advanced-ads' ); ?><span class="dashicons dashicons-filter"></span>
39
+ </a>
40
+ <?php endif; ?>
41
+ <?php if ( $show_screen_options ) : ?>
42
+ <a id="advads-show-screen-options" class="button advads-button-secondary"><?php esc_html_e( 'Screen Options', 'advanced-ads' ); ?></a>
43
+ <?php endif; ?>
44
  <?php if ( ! defined( 'AAP_VERSION' ) ) : ?>
45
+ <a href="<?php echo esc_url( ADVADS_URL ); ?>add-ons/?utm_source=advanced-ads&utm_medium=link&utm_campaign=header-upgrade-<?php echo esc_attr( $screen->id ); ?>" target="_blank" class="advads-upgrade button advads-button-secondary advads-button-icon-right">
46
+ <?php esc_html_e( 'See all Add-ons', 'advanced-ads' ); ?><span class="dashicons dashicons-star-filled"></span>
47
+ </a>
48
  <?php endif; ?>
49
+ <a href="<?php echo esc_url( ADVADS_URL . $manual_url ); ?>?utm_source=advanced-ads&utm_medium=link&utm_campaign=header-manual-<?php echo esc_attr( $screen->id ); ?>" target="_blank" class="button advads-button-secondary advads-button-icon-right">
50
+ <?php esc_html_e( 'Manual', 'advanced-ads' ); ?><span class="dashicons dashicons-welcome-learn-more"></span>
51
+ </a>
52
  </div>
53
  </div>
54
  </div>
admin/views/placements.php CHANGED
@@ -68,7 +68,7 @@ $quick_actions['delete'] = '<a style="cursor: pointer;" class="advads-delete-tag
68
  ?>
69
 
70
  <?php if ( isset( $placement_types ) && ! empty( $placement_types ) ) : ?>
71
- <div class="tablenav top">
72
  <select class="advads_filter_placement_type">
73
  <option value="0"><?php esc_html_e( '- show all types -', 'advanced-ads' ); ?></option>
74
  <?php foreach ( $placement_types as $type_name => $placement_type ) : ?>
68
  ?>
69
 
70
  <?php if ( isset( $placement_types ) && ! empty( $placement_types ) ) : ?>
71
+ <div class="tablenav top hidden advads-toggle-with-filters-button">
72
  <select class="advads_filter_placement_type">
73
  <option value="0"><?php esc_html_e( '- show all types -', 'advanced-ads' ); ?></option>
74
  <?php foreach ( $placement_types as $type_name => $placement_type ) : ?>
advanced-ads.php CHANGED
@@ -12,7 +12,7 @@
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: https://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
- * Version: 1.36.3
16
  * Author: Thomas Maier, Advanced Ads GmbH
17
  * Author URI: https://wpadvancedads.com
18
  * Text Domain: advanced-ads
@@ -39,7 +39,7 @@ define( 'ADVADS_BASE_DIR', dirname( ADVADS_BASE ) ); // directory of the plugin
39
  // general and global slug, e.g. to store options in WP.
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
- define( 'ADVADS_VERSION', '1.36.3' );
43
 
44
  // Autoloading, modules and functions.
45
 
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: https://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
+ * Version: 1.37.0
16
  * Author: Thomas Maier, Advanced Ads GmbH
17
  * Author URI: https://wpadvancedads.com
18
  * Text Domain: advanced-ads
39
  // general and global slug, e.g. to store options in WP.
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
+ define( 'ADVADS_VERSION', '1.37.0' );
43
 
44
  // Autoloading, modules and functions.
45
 
changelog.txt CHANGED
@@ -1,5 +1,24 @@
1
  == Changelog ==
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 1.36.3 (September 30, 2022) =
4
 
5
  - Fix: getting values for container ID and class
1
  == Changelog ==
2
 
3
+ = 1.37.0 (October 11, 2022) =
4
+
5
+ - Feature: bump minimum required PHP version to 7.2
6
+ - Improvement: add a "Notes" column for the ad description
7
+ - Improvement: add a new "Size" column for the ad size only
8
+ - Improvement: add a new "Type" column to the beginning of the ad list with a tooltip with more details
9
+ - Improvement: cleanup the header items on list pages and unify layout elements
10
+ - Fix: highlight the "All" view on the ad list
11
+ - Improvement: hide the following columns on the ad list view by default: notes, size, author
12
+ - Improvement: remove the background color for some ad status, like draft
13
+ - Improvement: rename the "Ad Details" column into "Preview", showing image ad previews
14
+ - Improvement: rename the "Title" column into "Name"
15
+ - Improvement: search ad by ID on the ad overview page
16
+ - Improvement: show filters on the ad overview list permanently using the new "Show Filters Permanently" screen option
17
+ - Improvement: show the bulk options only when items in the ad list are selected
18
+ - Improvement: unify the links and buttons in the header of admin pages related to Advanced Ads
19
+ - Fix: prevent undefined index notice on Ad Blocker setting in multisite
20
+ - Fix: show proper message for empty AdSense account
21
+
22
  = 1.36.3 (September 30, 2022) =
23
 
24
  - Fix: getting values for container ID and class
classes/ad.php CHANGED
@@ -52,6 +52,13 @@ class Advanced_Ads_Ad {
52
  */
53
  public $type = 'content';
54
 
 
 
 
 
 
 
 
55
  /**
56
  * Ad width
57
  *
52
  */
53
  public $type = 'content';
54
 
55
+ /**
56
+ * Notes about the ad usage
57
+ *
58
+ * @var string $description
59
+ */
60
+ public $description = '';
61
+
62
  /**
63
  * Ad width
64
  *
classes/ad_type_abstract.php CHANGED
@@ -50,22 +50,12 @@ class Advanced_Ads_Ad_Type_Abstract {
50
  */
51
  public $parameters = array();
52
 
53
- /**
54
- * Set basic attributes
55
- *
56
- * @since 1.0.0
57
- */
58
- public function __construct() {
59
- // initiall
60
- }
61
-
62
  /**
63
  * Output for the ad parameters metabox
64
  *
65
- * @param obj $ad ad object
66
- * @since 1.0.0
67
  */
68
- public function render_parameters($ad){
69
  /**
70
  * This will be loaded by default or using ajax when changing the ad type radio buttons
71
  * echo the output right away here
@@ -73,6 +63,29 @@ class Advanced_Ads_Ad_Type_Abstract {
73
  */
74
  }
75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  /**
77
  * Sanitize ad options on save
78
  *
@@ -92,8 +105,6 @@ class Advanced_Ads_Ad_Type_Abstract {
92
  * @since 1.0.0
93
  */
94
  public function sanitize_content($content = ''){
95
-
96
- // remove slashes from content
97
  return $content = wp_unslash( $content );
98
  }
99
 
@@ -105,7 +116,6 @@ class Advanced_Ads_Ad_Type_Abstract {
105
  * @since 1.0.0
106
  */
107
  public function load_content($post){
108
-
109
  return $post->post_content;
110
  }
111
 
50
  */
51
  public $parameters = array();
52
 
 
 
 
 
 
 
 
 
 
53
  /**
54
  * Output for the ad parameters metabox
55
  *
56
+ * @param Advanced_Ads_Ad $ad ad object.
 
57
  */
58
+ public function render_parameters( Advanced_Ads_Ad $ad ) {
59
  /**
60
  * This will be loaded by default or using ajax when changing the ad type radio buttons
61
  * echo the output right away here
63
  */
64
  }
65
 
66
+ /**
67
+ * Render icon on the ad overview list
68
+ *
69
+ * @param Advanced_Ads_Ad $ad ad object.
70
+ */
71
+ public function render_icon( Advanced_Ads_Ad $ad ) {
72
+ printf( '<img src="%sadmin/assets/img/ad-types/%s.svg" width="50" height="50"/>', esc_url( ADVADS_BASE_URL ), esc_attr( $ad->type ) );
73
+ }
74
+
75
+ /**
76
+ * Render preview on the ad overview list
77
+ *
78
+ * @param Advanced_Ads_Ad $ad ad object.
79
+ */
80
+ public function render_preview( Advanced_Ads_Ad $ad ) {}
81
+
82
+ /**
83
+ * Render additional information in the ad type tooltip on the ad overview page
84
+ *
85
+ * @param Advanced_Ads_Ad $ad ad object.
86
+ */
87
+ public function render_ad_type_tooltip( Advanced_Ads_Ad $ad ) {}
88
+
89
  /**
90
  * Sanitize ad options on save
91
  *
105
  * @since 1.0.0
106
  */
107
  public function sanitize_content($content = ''){
 
 
108
  return $content = wp_unslash( $content );
109
  }
110
 
116
  * @since 1.0.0
117
  */
118
  public function load_content($post){
 
119
  return $post->post_content;
120
  }
121
 
classes/ad_type_dummy.php CHANGED
@@ -23,9 +23,8 @@ class Advanced_Ads_Ad_Type_Dummy extends Advanced_Ads_Ad_Type_Abstract{
23
  * Set basic attributes
24
  */
25
  public function __construct() {
26
- $this->title = __( 'Dummy', 'advanced-ads' );
27
  $this->description = __( 'Uses a simple placeholder ad for quick testing.', 'advanced-ads' );
28
-
29
  }
30
 
31
  /**
23
  * Set basic attributes
24
  */
25
  public function __construct() {
26
+ $this->title = __( 'Dummy', 'advanced-ads' );
27
  $this->description = __( 'Uses a simple placeholder ad for quick testing.', 'advanced-ads' );
 
28
  }
29
 
30
  /**
classes/ad_type_image.php CHANGED
@@ -40,7 +40,7 @@ class Advanced_Ads_Ad_Type_Image extends Advanced_Ads_Ad_Type_Abstract {
40
  *
41
  * @param Advanced_Ads_Ad $ad ad object.
42
  */
43
- public function render_parameters( $ad ) {
44
  // load tinymc content exitor
45
  $id = ( isset( $ad->output['image_id'] ) ) ? $ad->output['image_id'] : '';
46
  $url = ( isset( $ad->url ) ) ? esc_attr( $ad->url ) : '';
@@ -85,7 +85,6 @@ class Advanced_Ads_Ad_Type_Image extends Advanced_Ads_Ad_Type_Abstract {
85
  * @param Advanced_Ads_Ad $ad ad object.
86
  */
87
  public function create_image_tag( $attachment_id, $ad ) {
88
-
89
  $image = wp_get_attachment_image_src( $attachment_id, 'full' );
90
  $style = '';
91
 
@@ -164,31 +163,37 @@ class Advanced_Ads_Ad_Type_Image extends Advanced_Ads_Ad_Type_Abstract {
164
  }
165
 
166
  /**
167
- * Render image icon for overview pages
168
  *
169
- * @param int $attachment_id post id of the image.
170
  */
171
- public function create_image_icon( $attachment_id ) {
172
-
173
- $image = wp_get_attachment_image_src( $attachment_id, 'medium', true );
174
- if ( $image ) {
175
- list( $src, $width, $height ) = $image;
176
 
177
- // scale down width or height to max 100px
178
- if ( $width > $height ) {
179
- $height = absint( $height / ( $width / 100 ) );
180
- $width = 100;
181
- } else {
182
- $width = absint( $width / ( $height / 100 ) );
183
- $height = 100;
184
- }
 
 
 
 
 
 
 
 
185
 
186
- $hwstring = trim( image_hwstring( $width, $height ) );
187
- $alt = trim( wp_strip_all_tags( get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ) ) );
 
188
 
189
- // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $hwstring is not something we can escape.
190
- printf( '<img src="%s" alt="%s" %s/>', esc_url( $src ), esc_attr( $alt ), $hwstring );
191
- }
192
  }
193
 
194
  /**
@@ -198,7 +203,6 @@ class Advanced_Ads_Ad_Type_Image extends Advanced_Ads_Ad_Type_Abstract {
198
  * @return string $content ad content prepared for frontend output
199
  */
200
  public function prepare_output( $ad ) {
201
-
202
  $id = ( isset( $ad->output['image_id'] ) ) ? absint( $ad->output['image_id'] ) : '';
203
  $url = ( isset( $ad->url ) ) ? esc_url( $ad->url ) : '';
204
 
@@ -222,8 +226,7 @@ class Advanced_Ads_Ad_Type_Image extends Advanced_Ads_Ad_Type_Abstract {
222
  * @param Advanced_Ads_Ad $ad ad object.
223
  * @return string empty, if the entered size is the same as the original size
224
  */
225
- public static function show_original_image_size( $ad ) {
226
-
227
  $attachment_id = ( isset( $ad->output['image_id'] ) ) ? absint( $ad->output['image_id'] ) : '';
228
 
229
  $image = wp_get_attachment_image_src( $attachment_id, 'full' );
@@ -250,7 +253,6 @@ class Advanced_Ads_Ad_Type_Image extends Advanced_Ads_Ad_Type_Abstract {
250
  }
251
 
252
  return '';
253
-
254
  }
255
 
256
  }
40
  *
41
  * @param Advanced_Ads_Ad $ad ad object.
42
  */
43
+ public function render_parameters( Advanced_Ads_Ad $ad ) {
44
  // load tinymc content exitor
45
  $id = ( isset( $ad->output['image_id'] ) ) ? $ad->output['image_id'] : '';
46
  $url = ( isset( $ad->url ) ) ? esc_attr( $ad->url ) : '';
85
  * @param Advanced_Ads_Ad $ad ad object.
86
  */
87
  public function create_image_tag( $attachment_id, $ad ) {
 
88
  $image = wp_get_attachment_image_src( $attachment_id, 'full' );
89
  $style = '';
90
 
163
  }
164
 
165
  /**
166
+ * Render preview on the ad overview list
167
  *
168
+ * @param Advanced_Ads_Ad $ad ad object.
169
  */
170
+ public function render_preview( Advanced_Ads_Ad $ad ) {
171
+ if ( empty( $ad->output['image_id'] ) ) {
172
+ return;
173
+ }
 
174
 
175
+ list( $src, $width, $height ) = wp_get_attachment_image_src( $ad->output['image_id'], 'medium', true );
176
+ $preview_size_small = 50;
177
+ $preview_size_large = 200;
178
+
179
+ // scale down width or height for the preview
180
+ if ( $width > $height ) {
181
+ $preview_height = ceil( $height / ( $width / $preview_size_small ) );
182
+ $preview_width = $preview_size_small;
183
+ $tooltip_height = ceil( $height / ( $width / $preview_size_large ) );
184
+ $tooltip_width = $preview_size_large;
185
+ } else {
186
+ $preview_width = ceil( $width / ( $height / $preview_size_small ) );
187
+ $preview_height = $preview_size_small;
188
+ $tooltip_width = ceil( $width / ( $height / $preview_size_large ) );
189
+ $tooltip_height = $preview_size_large;
190
+ }
191
 
192
+ $preview_hwstring = image_hwstring( $preview_width, $preview_height );
193
+ $tooltip_hwstring = image_hwstring( $tooltip_width, $tooltip_height );
194
+ $alt = wp_strip_all_tags( get_post_meta( $ad->output['image_id'], '_wp_attachment_image_alt', true ) );
195
 
196
+ include ADVADS_BASE_PATH . 'admin/views/ad-list/preview-image.php';
 
 
197
  }
198
 
199
  /**
203
  * @return string $content ad content prepared for frontend output
204
  */
205
  public function prepare_output( $ad ) {
 
206
  $id = ( isset( $ad->output['image_id'] ) ) ? absint( $ad->output['image_id'] ) : '';
207
  $url = ( isset( $ad->url ) ) ? esc_url( $ad->url ) : '';
208
 
226
  * @param Advanced_Ads_Ad $ad ad object.
227
  * @return string empty, if the entered size is the same as the original size
228
  */
229
+ public static function show_original_image_size( Advanced_Ads_Ad $ad ) {
 
230
  $attachment_id = ( isset( $ad->output['image_id'] ) ) ? absint( $ad->output['image_id'] ) : '';
231
 
232
  $image = wp_get_attachment_image_src( $attachment_id, 'full' );
253
  }
254
 
255
  return '';
 
256
  }
257
 
258
  }
languages/advanced-ads.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the GPL-2.0+.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Advanced Ads 1.36.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads/\n"
7
  "Last-Translator: Thomas Maier <post@webzunft.de>\n"
8
  "Language-Team: webgilde <support@wpadvancedads.com>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2022-09-30T10:52:17+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.6.0\n"
15
  "X-Domain: advanced-ads\n"
@@ -94,42 +94,70 @@ msgstr ""
94
  msgid "Permanently delete this placement?"
95
  msgstr ""
96
 
97
- #: admin/class-advanced-ads-admin.php:419
 
 
 
 
 
 
 
 
98
  #: admin/includes/class-menu.php:166
99
  #: admin/includes/class-menu.php:169
100
  #: admin/views/settings.php:29
101
  msgid "Support"
102
  msgstr ""
103
 
104
- #: admin/class-advanced-ads-admin.php:424
105
  #: admin/includes/class-overview-widgets.php:72
106
  msgid "Add-Ons"
107
  msgstr ""
108
 
109
- #: admin/class-advanced-ads-admin.php:426
110
  msgid "See Pro Features"
111
  msgstr ""
112
 
113
  #. translators: %s is the URL to add a new review, https://wordpress.org/support/plugin/advanced-ads/reviews/#new-post
114
  #. translators: %s is a URL.
115
- #: admin/class-advanced-ads-admin.php:700
116
  #: admin/includes/class-overview-widgets.php:191
117
  msgid "Thank the developer with a &#9733;&#9733;&#9733;&#9733;&#9733; review on <a href=\"%s\" target=\"_blank\">wordpress.org</a>"
118
  msgstr ""
119
 
120
- #: admin/class-advanced-ads-admin.php:783
 
 
 
 
 
 
 
 
 
121
  msgid "Your Ads"
122
  msgstr ""
123
 
124
- #: admin/class-advanced-ads-admin.php:786
125
  msgid "Your Groups"
126
  msgstr ""
127
 
128
- #: admin/class-advanced-ads-admin.php:789
 
 
 
 
 
129
  msgid "Your Placements"
130
  msgstr ""
131
 
132
- #: admin/class-advanced-ads-admin.php:792
 
 
 
 
 
 
133
  #: admin/includes/class-menu.php:150
134
  msgid "Advanced Ads Settings"
135
  msgstr ""
@@ -200,7 +228,7 @@ msgstr ""
200
 
201
  #: admin/includes/ad-health-notices.php:135
202
  #: admin/includes/ad-health-notices.php:142
203
- #: modules/gadsense/includes/class-mapi.php:98
204
  msgid "Last AdSense account connection attempt failed."
205
  msgstr ""
206
 
@@ -280,21 +308,21 @@ msgstr ""
280
 
281
  #. translators: %s is a date.
282
  #: admin/includes/class-ad-groups-list.php:199
283
- #: admin/views/ad-list-timing-column.php:21
284
  msgid "starts %s"
285
  msgstr ""
286
 
287
  #. translators: %s is a date.
288
  #. translators: %s is a time and date string.
289
  #: admin/includes/class-ad-groups-list.php:220
290
- #: admin/views/ad-list-timing-column.php:59
291
  msgid "expires %s"
292
  msgstr ""
293
 
294
  #. translators: %s is a date.
295
  #. translators: %s is a time and date string.
296
  #: admin/includes/class-ad-groups-list.php:223
297
- #: admin/views/ad-list-timing-column.php:70
298
  msgid "<strong>expired</strong> %s"
299
  msgstr ""
300
 
@@ -367,99 +395,122 @@ msgstr ""
367
  msgid "No ad group created"
368
  msgstr ""
369
 
370
- #: admin/includes/class-ad-type.php:258
371
- #: admin/includes/class-ad-type.php:264
372
- msgid "Ad Details"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
373
  msgstr ""
374
 
375
- #: admin/includes/class-ad-type.php:259
376
- #: admin/includes/class-ad-type.php:265
377
  msgid "Ad Planning"
378
  msgstr ""
379
 
380
- #: admin/includes/class-ad-type.php:260
381
- #: admin/includes/class-ad-type.php:266
382
  msgid "Ad Shortcode"
383
  msgstr ""
384
 
385
  #. translators: %s is the number of ads.
386
- #: admin/includes/class-ad-type.php:431
387
  msgid "%s ad updated."
388
  msgid_plural "%s ads updated."
389
  msgstr[0] ""
390
  msgstr[1] ""
391
 
392
  #. translators: %s is the number of ads.
393
- #: admin/includes/class-ad-type.php:433
394
  msgid "%s ad not updated, somebody is editing it."
395
  msgid_plural "%s ads not updated, somebody is editing them."
396
  msgstr[0] ""
397
  msgstr[1] ""
398
 
399
  #. translators: %s is the number of ads.
400
- #: admin/includes/class-ad-type.php:435
401
  msgid "%s ad permanently deleted."
402
  msgid_plural "%s ads permanently deleted."
403
  msgstr[0] ""
404
  msgstr[1] ""
405
 
406
  #. translators: %s is the number of ads.
407
- #: admin/includes/class-ad-type.php:437
408
  msgid "%s ad moved to the Trash."
409
  msgid_plural "%s ads moved to the Trash."
410
  msgstr[0] ""
411
  msgstr[1] ""
412
 
413
  #. translators: %s is the number of ads.
414
- #: admin/includes/class-ad-type.php:439
415
  msgid "%s ad restored from the Trash."
416
  msgid_plural "%s ads restored from the Trash."
417
  msgstr[0] ""
418
  msgstr[1] ""
419
 
420
  #. Translators: %s is the time the ad was first saved.
421
- #: admin/includes/class-ad-type.php:677
422
  msgid "Ad created on %s"
423
  msgstr ""
424
 
425
- #: admin/includes/class-ad-type.php:863
426
- #: admin/includes/class-ad-type.php:864
427
  msgid "Ad updated."
428
  msgstr ""
429
 
430
  #. translators: %s: date and time of the revision
431
- #: admin/includes/class-ad-type.php:865
432
  msgid "Ad restored to revision from %s"
433
  msgstr ""
434
 
435
- #: admin/includes/class-ad-type.php:866
436
- #: admin/includes/class-ad-type.php:867
437
  msgid "Ad saved."
438
  msgstr ""
439
 
440
- #: admin/includes/class-ad-type.php:868
441
  msgid "Ad submitted."
442
  msgstr ""
443
 
444
  #. translators: %1$s is a date.
445
- #: admin/includes/class-ad-type.php:871
446
  msgid "Ad scheduled for: <strong>%1$s</strong>."
447
  msgstr ""
448
 
449
  #. translators: Publish box date format, see http://php.net/date.
450
- #: admin/includes/class-ad-type.php:873
451
  msgid "M j, Y @ G:i"
452
  msgstr ""
453
 
454
- #: admin/includes/class-ad-type.php:875
455
  msgid "Ad draft updated."
456
  msgstr ""
457
 
458
- #: admin/includes/class-ad-type.php:931
459
  msgid "You don’t have access to ads. Please deactivate and re-enable Advanced Ads again to fix this."
460
  msgstr ""
461
 
462
- #: admin/includes/class-ad-type.php:932
463
  #: classes/frontend_checks.php:503
464
  msgid "Get help"
465
  msgstr ""
@@ -561,22 +612,26 @@ msgstr ""
561
  msgid "Download failed. <a href=\"%s\" target=\"_blank\">Click here to learn why</a>."
562
  msgstr ""
563
 
564
- #: admin/includes/class-list-filters.php:141
565
- #: modules/gadsense/admin/admin.php:73
566
  #: modules/gadsense/admin/views/adsense-ad-parameters.php:109
 
567
  msgid "Responsive"
568
  msgstr ""
569
 
570
- #: admin/includes/class-list-filters.php:516
571
  msgctxt "Post list header for expired ads."
572
  msgid "Expired"
573
  msgstr ""
574
 
575
- #: admin/includes/class-list-filters.php:556
576
  msgctxt "Post list header for ads expiring in the future."
577
  msgid "Expiring"
578
  msgstr ""
579
 
 
 
 
 
580
  #: admin/includes/class-menu.php:66
581
  #: admin/includes/class-menu.php:78
582
  #: admin/includes/class-menu.php:79
@@ -606,14 +661,6 @@ msgstr ""
606
  msgid "Add New Ad"
607
  msgstr ""
608
 
609
- #: admin/includes/class-menu.php:123
610
- #: admin/views/ad-group-list-ads.php:36
611
- #: admin/views/header.php:23
612
- #: public/class-advanced-ads.php:798
613
- #: public/class-advanced-ads.php:802
614
- msgid "New Ad"
615
- msgstr ""
616
-
617
  #: admin/includes/class-menu.php:131
618
  msgid "Ad Groups & Rotations"
619
  msgstr ""
@@ -703,10 +750,10 @@ msgstr ""
703
  #: admin/includes/class-meta-box.php:231
704
  #: admin/includes/class-meta-box.php:236
705
  #: admin/includes/class-overview-widgets.php:179
706
- #: admin/views/ad-group.php:75
707
  #: admin/views/ad-main-metabox.php:29
708
  #: admin/views/ad-output-metabox.php:43
709
- #: admin/views/header.php:47
710
  #: admin/views/placements.php:28
711
  #: admin/views/settings/general/custom-label.php:10
712
  #: admin/views/settings/general/disable-notices.php:6
@@ -780,8 +827,8 @@ msgid "Create your first ad"
780
  msgstr ""
781
 
782
  #: admin/includes/class-overview-widgets.php:118
783
- #: modules/gadsense/admin/views/adsense-account.php:98
784
- #: modules/gadsense/admin/views/adsense-account.php:118
785
  msgid "Connect to AdSense"
786
  msgstr ""
787
 
@@ -1230,20 +1277,6 @@ msgstr ""
1230
  msgid "add"
1231
  msgstr ""
1232
 
1233
- #: admin/views/ad-group-list-form-row.php:36
1234
- #: admin/views/placements.php:56
1235
- #: modules/gadsense/admin/views/external-ads-list.php:38
1236
- #: modules/privacy/admin/views/setting-general.php:44
1237
- msgid "Name"
1238
- msgstr ""
1239
-
1240
- #: admin/views/ad-group-list-form-row.php:61
1241
- #: admin/views/placements.php:56
1242
- #: admin/views/placements.php:256
1243
- #: modules/gadsense/admin/views/adsense-ad-parameters.php:105
1244
- msgid "Type"
1245
- msgstr ""
1246
-
1247
  #: admin/views/ad-group-list-form-row.php:77
1248
  msgctxt "option to display all ads in an ad groups"
1249
  msgid "all"
@@ -1286,27 +1319,27 @@ msgstr ""
1286
  msgid "ID: %s"
1287
  msgstr ""
1288
 
1289
- #: admin/views/ad-group.php:30
1290
  msgid "Ad Group successfully created"
1291
  msgstr ""
1292
 
1293
- #: admin/views/ad-group.php:43
1294
  msgid "Ad Groups successfully updated"
1295
  msgstr ""
1296
 
1297
- #: admin/views/ad-group.php:68
1298
  msgid "Group title"
1299
  msgstr ""
1300
 
1301
- #: admin/views/ad-group.php:69
1302
  msgid "save"
1303
  msgstr ""
1304
 
1305
- #: admin/views/ad-group.php:73
1306
  msgid "Ad Groups are a very flexible method to bundle ads. You can use them to display random ads in the frontend or run split tests, but also just for informational purposes. Not only can an Ad Groups have multiple ads, but an ad can belong to multiple ad groups."
1307
  msgstr ""
1308
 
1309
- #: admin/views/ad-group.php:109
1310
  msgid "Update Groups"
1311
  msgstr ""
1312
 
@@ -1335,22 +1368,18 @@ msgid "next"
1335
  msgstr ""
1336
 
1337
  #: admin/views/ad-info-bottom.php:21
1338
- #: admin/views/ad-info-top.php:27
1339
  msgid "Stop Wizard and show all options"
1340
  msgstr ""
1341
 
1342
- #: admin/views/ad-info-top.php:2
1343
  msgid "Start Wizard"
1344
  msgstr ""
1345
 
1346
- #: admin/views/ad-info-top.php:3
1347
  msgid "Stop Wizard"
1348
  msgstr ""
1349
 
1350
- #: admin/views/ad-list-details-column.php:19
1351
- msgid "Consent disabled"
1352
- msgstr ""
1353
-
1354
  #: admin/views/ad-list-filters.php:18
1355
  msgid "all ad types"
1356
  msgstr ""
@@ -1371,6 +1400,19 @@ msgstr ""
1371
  msgid "Watch the “First Ad” Tutorial (Video)"
1372
  msgstr ""
1373
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1374
  #: admin/views/ad-main-metabox.php:3
1375
  msgid "No ad types defined"
1376
  msgstr ""
@@ -1684,33 +1726,18 @@ msgstr ""
1684
  msgid "There is an error in your AdSense setup."
1685
  msgstr ""
1686
 
1687
- #: admin/views/header.php:29
1688
- #: public/class-advanced-ads.php:762
1689
- msgid "New Ad Group"
1690
  msgstr ""
1691
 
1692
- #: admin/views/header.php:35
1693
- #: admin/views/placements.php:464
1694
- msgid "Create a new placement"
1695
  msgstr ""
1696
 
1697
- #: admin/views/header.php:35
1698
- #: admin/views/placements.php:37
1699
- #: admin/views/placements.php:464
1700
- msgid "New Placement"
1701
- msgstr ""
1702
-
1703
- #: admin/views/header.php:45
1704
  msgid "See all Add-ons"
1705
  msgstr ""
1706
 
1707
- #: admin/views/modal.php:48
1708
- #: admin/views/modal.php:49
1709
- #: admin/views/placements.php:319
1710
- #: admin/views/placements.php:320
1711
- msgid "Close"
1712
- msgstr ""
1713
-
1714
  #. Translators: 1: "Options", 2: the name of a placement.
1715
  #: admin/views/modal.php:51
1716
  #: admin/views/placements.php:231
@@ -1835,12 +1862,12 @@ msgstr ""
1835
  #. translators: %s is a URL.
1836
  #. Translators: %s is a URL.
1837
  #: admin/views/placement-injection-top.php:46
1838
- #: modules/gadsense/admin/admin.php:237
1839
  msgid "The AdSense verification and Auto ads code is already activated in the <a href=\"%s\">AdSense settings</a>."
1840
  msgstr ""
1841
 
1842
  #: admin/views/placement-injection-top.php:58
1843
- #: modules/gadsense/admin/admin.php:240
1844
  msgid "No need to add the code manually here, unless you want to include it into certain pages only."
1845
  msgstr ""
1846
 
@@ -2117,6 +2144,10 @@ msgstr ""
2117
  msgid "Save Placements"
2118
  msgstr ""
2119
 
 
 
 
 
2120
  #: admin/views/post-ad-settings-metabox.php:1
2121
  msgid "How to disable ads on specific pages"
2122
  msgstr ""
@@ -2542,7 +2573,7 @@ msgstr ""
2542
 
2543
  #. translators: %1$s is an anchor (link) opening tag, %2$s is the closing tag.
2544
  #: classes/ad-health-notices.php:865
2545
- #: modules/gadsense/includes/class-mapi.php:1644
2546
  msgid "Learn more about AdSense account issues %1$shere%2$s."
2547
  msgstr ""
2548
 
@@ -2685,7 +2716,7 @@ msgstr ""
2685
  msgid "Uses a simple placeholder ad for quick testing."
2686
  msgstr ""
2687
 
2688
- #: classes/ad_type_dummy.php:45
2689
  #: classes/ad_type_image.php:69
2690
  msgid "URL"
2691
  msgstr ""
@@ -2727,7 +2758,7 @@ msgid "Link to target site including http(s)"
2727
  msgstr ""
2728
 
2729
  #. translators: $s is a size string like "728 x 90".
2730
- #: classes/ad_type_image.php:243
2731
  msgid "Original size: %s"
2732
  msgstr ""
2733
 
@@ -3298,35 +3329,35 @@ msgstr ""
3298
  msgid "Ad blocker fix"
3299
  msgstr ""
3300
 
3301
- #: modules/ad-blocker/admin/admin.php:135
3302
  #: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:381
3303
  msgid "Unable to connect to the filesystem. Please confirm your credentials."
3304
  msgstr ""
3305
 
3306
- #: modules/ad-blocker/admin/admin.php:149
3307
  msgid "The asset folder was rebuilt successfully"
3308
  msgstr ""
3309
 
3310
- #: modules/ad-blocker/admin/admin.php:194
3311
  msgid "There is no writable upload folder"
3312
  msgstr ""
3313
 
3314
- #: modules/ad-blocker/admin/admin.php:226
3315
  msgid "Unable to rename \"%s\" directory"
3316
  msgstr ""
3317
 
3318
- #: modules/ad-blocker/admin/admin.php:242
3319
- #: modules/ad-blocker/admin/admin.php:255
3320
- #: modules/ad-blocker/admin/admin.php:272
3321
  msgid "Unable to copy assets to the \"%s\" directory"
3322
  msgstr ""
3323
 
3324
- #: modules/ad-blocker/admin/admin.php:305
3325
- #: modules/ad-blocker/admin/admin.php:390
3326
  msgid "We do not have direct write access to the \"%s\" directory"
3327
  msgstr ""
3328
 
3329
- #: modules/ad-blocker/admin/admin.php:401
3330
  msgid "Unable to copy files to %s"
3331
  msgstr ""
3332
 
@@ -3511,10 +3542,6 @@ msgstr ""
3511
  msgid "Check for problems"
3512
  msgstr ""
3513
 
3514
- #: modules/ads-txt/admin/views/setting-additional-content.php:36
3515
- msgid "Preview"
3516
- msgstr ""
3517
-
3518
  #: modules/ads-txt/admin/views/setting-create.php:21
3519
  msgid "Generate a single ads.txt file for all sites in the multisite network."
3520
  msgstr ""
@@ -3524,21 +3551,21 @@ msgid "Usually, this should be enabled on the main site of the network - often t
3524
  msgstr ""
3525
 
3526
  #. Translators: %s is a URL.
3527
- #: modules/gadsense/admin/admin.php:186
3528
  msgid "Responsive AdSense ads don’t work reliably with <em>Position</em> set to left or right. Either switch the <em>Type</em> to \"normal\" or follow <a href=\"%s\" target=\"_blank\">this tutorial</a> if you want the ad to be wrapped in text."
3529
  msgstr ""
3530
 
3531
  #. Translators: %s is a URL.
3532
- #: modules/gadsense/admin/admin.php:196
3533
  msgid "<a href=\"%s\" target=\"_blank\">Install the free AdSense In-feed add-on</a> in order to place ads between posts."
3534
  msgstr ""
3535
 
3536
  #. Translators: %s is a URL.
3537
- #: modules/gadsense/admin/admin.php:245
3538
  msgid "The AdSense verification and Auto ads code should be set up in the <a href=\"%s\">AdSense settings</a>. Click on the following button to enable it now."
3539
  msgstr ""
3540
 
3541
- #: modules/gadsense/admin/admin.php:248
3542
  msgid "Activate"
3543
  msgstr ""
3544
 
@@ -3559,7 +3586,6 @@ msgid "AdSense warnings"
3559
  msgstr ""
3560
 
3561
  #: modules/gadsense/admin/views/adsense-account.php:50
3562
- #: modules/gadsense/admin/views/adsense-account.php:89
3563
  msgid "dismiss"
3564
  msgstr ""
3565
 
@@ -3568,51 +3594,51 @@ msgstr ""
3568
  msgid "last checked: %s"
3569
  msgstr ""
3570
 
3571
- #: modules/gadsense/admin/views/adsense-account.php:101
3572
  msgid "Revoke API acccess"
3573
  msgstr ""
3574
 
3575
- #: modules/gadsense/admin/views/adsense-account.php:107
3576
  msgid "Account holder name"
3577
  msgstr ""
3578
 
3579
- #: modules/gadsense/admin/views/adsense-account.php:110
3580
- #: modules/gadsense/includes/class-ad-type-adsense.php:91
3581
  msgid "The Publisher ID has an incorrect format. (must start with \"pub-\")"
3582
  msgstr ""
3583
 
3584
- #: modules/gadsense/admin/views/adsense-account.php:117
3585
  msgid "Yes, I have an AdSense account"
3586
  msgstr ""
3587
 
3588
- #: modules/gadsense/admin/views/adsense-account.php:119
3589
  msgid "Configure everything manually"
3590
  msgstr ""
3591
 
3592
- #: modules/gadsense/admin/views/adsense-account.php:122
3593
  msgid "No, I still don't have an AdSense account"
3594
  msgstr ""
3595
 
3596
- #: modules/gadsense/admin/views/adsense-account.php:123
3597
  msgid "Get a free AdSense account"
3598
  msgstr ""
3599
 
3600
  #. translators: %1$s is an opening a tag, %2$s is the closing one
3601
- #: modules/gadsense/admin/views/adsense-account.php:129
3602
- #: modules/gadsense/admin/views/adsense-account.php:221
3603
  msgid "See all %1$srecommended ad networks%2$s."
3604
  msgstr ""
3605
 
3606
- #: modules/gadsense/admin/views/adsense-account.php:195
3607
  msgid "How to choose specific positions for AdSense ad units"
3608
  msgstr ""
3609
 
3610
  #. translators: %1$s is the opening link tag to our manual; %2$s is the appropriate closing link tag; %3$s is the opening link tag to our help forum; %4$s is the appropriate closing link tag
3611
- #: modules/gadsense/admin/views/adsense-account.php:203
3612
  msgid "Problems with AdSense? Check out the %1$smanual%2$s or %3$sask here%4$s."
3613
  msgstr ""
3614
 
3615
- #: modules/gadsense/admin/views/adsense-account.php:235
3616
  #: modules/gadsense/admin/views/external-ads-links.php:38
3617
  msgid "Can not connect AdSense account. PHP version is too low."
3618
  msgstr ""
@@ -3658,26 +3684,33 @@ msgid "Please <a href=\"%s\" target=\"_blank\">change it here</a>."
3658
  msgstr ""
3659
 
3660
  #: modules/gadsense/admin/views/adsense-ad-parameters.php:108
 
 
3661
  msgid "Normal"
3662
  msgstr ""
3663
 
3664
  #: modules/gadsense/admin/views/adsense-ad-parameters.php:110
 
3665
  msgid "Multiplex"
3666
  msgstr ""
3667
 
3668
  #: modules/gadsense/admin/views/adsense-ad-parameters.php:112
 
3669
  msgid "Link ads"
3670
  msgstr ""
3671
 
3672
  #: modules/gadsense/admin/views/adsense-ad-parameters.php:115
 
3673
  msgid "Link ads (Responsive)"
3674
  msgstr ""
3675
 
3676
  #: modules/gadsense/admin/views/adsense-ad-parameters.php:117
 
3677
  msgid "In-article"
3678
  msgstr ""
3679
 
3680
  #: modules/gadsense/admin/views/adsense-ad-parameters.php:118
 
3681
  msgid "In-feed"
3682
  msgstr ""
3683
 
@@ -3768,10 +3801,6 @@ msgctxt "AdSense ad"
3768
  msgid "Type"
3769
  msgstr ""
3770
 
3771
- #: modules/gadsense/admin/views/external-ads-list.php:41
3772
- msgid "Size"
3773
- msgstr ""
3774
-
3775
  #: modules/gadsense/admin/views/external-ads-list.php:48
3776
  msgid "No ad units found"
3777
  msgstr ""
@@ -3840,7 +3869,7 @@ msgstr ""
3840
  msgid "Use ads from your Google AdSense account"
3841
  msgstr ""
3842
 
3843
- #: modules/gadsense/includes/class-ad-type-adsense.php:132
3844
  msgid "Your AdSense Publisher ID is missing."
3845
  msgstr ""
3846
 
@@ -3853,120 +3882,123 @@ msgid "Auto"
3853
  msgstr ""
3854
 
3855
  #. translators: %s: ad unit ID.
3856
- #: modules/gadsense/includes/class-mapi.php:371
3857
  msgid "Error while retrieving ad code for \"%s\"."
3858
  msgstr ""
3859
 
3860
  #. translators: %s: ad unit ID.
3861
- #: modules/gadsense/includes/class-mapi.php:398
3862
  msgid "Invalid response while retrieving ad code for \"%s\"."
3863
  msgstr ""
3864
 
 
3865
  #. translators: the publisher ID.
3866
- #: modules/gadsense/includes/class-mapi.php:457
3867
- #: modules/gadsense/includes/class-mapi.php:527
3868
- msgid "Error while retrieving adUnits list for \"%s\"."
 
 
 
 
 
3869
  msgstr ""
3870
 
3871
  #. translators: %s is the publisher ID.
3872
  #: modules/gadsense/includes/class-mapi.php:465
3873
- msgid "Invalid response while retrieving adUnits list for \"%s\"."
3874
  msgstr ""
3875
 
3876
- #: modules/gadsense/includes/class-mapi.php:473
 
3877
  msgid "Reason:"
3878
  msgstr ""
3879
 
3880
- #: modules/gadsense/includes/class-mapi.php:474
 
3881
  msgid "Message:"
3882
  msgstr ""
3883
 
3884
- #. translators: %1$s is the AdSense publisher ID; %2$s a starting a tag to the AdSense ad unit list and %3$s the closing link.
3885
- #: modules/gadsense/includes/class-mapi.php:488
3886
- msgid "The account \"%1$s\" does not seem to have any ad units. Please create some %2$shere%3$s."
3887
- msgstr ""
3888
-
3889
- #: modules/gadsense/includes/class-mapi.php:605
3890
  msgid "It seems that some changes have been made in the Advanced Ads settings. Please refresh this page."
3891
  msgstr ""
3892
 
3893
- #: modules/gadsense/includes/class-mapi.php:612
3894
  msgid "Advanced Ads does not have access to your account (<code>%s</code>) anymore."
3895
  msgstr ""
3896
 
3897
- #: modules/gadsense/includes/class-mapi.php:656
3898
  msgid "error while renewing access token for \"%s\""
3899
  msgstr ""
3900
 
3901
  #. translators: %s AdSense account ID
3902
- #: modules/gadsense/includes/class-mapi.php:683
3903
  msgid "invalid response received while renewing access token for \"%s\""
3904
  msgstr ""
3905
 
3906
- #: modules/gadsense/includes/class-mapi.php:685
3907
  msgid "You could try to connect again under Advanced Ads > Settings > AdSense."
3908
  msgstr ""
3909
 
3910
- #: modules/gadsense/includes/class-mapi.php:754
3911
  msgid "This ad code is from a different AdSense Account"
3912
  msgstr ""
3913
 
3914
- #: modules/gadsense/includes/class-mapi.php:991
3915
  msgid "Invalid response body while retrieving account alerts"
3916
  msgstr ""
3917
 
3918
- #: modules/gadsense/includes/class-mapi.php:1000
3919
  msgid "error while retrieving account alerts"
3920
  msgstr ""
3921
 
3922
- #: modules/gadsense/includes/class-mapi.php:1115
3923
  msgid "No token provided. Token data needed to get account details."
3924
  msgstr ""
3925
 
3926
- #: modules/gadsense/includes/class-mapi.php:1135
3927
- #: modules/gadsense/includes/class-mapi.php:1139
3928
  msgid "No AdSense account data found."
3929
  msgstr ""
3930
 
3931
- #: modules/gadsense/includes/class-mapi.php:1390
3932
- #: modules/gadsense/includes/class-mapi.php:1408
3933
  #: modules/gadsense/includes/class-network-adsense.php:514
3934
  msgctxt "AdSense ad type"
3935
  msgid "Multiplex"
3936
  msgstr ""
3937
 
3938
- #: modules/gadsense/includes/class-mapi.php:1393
3939
- #: modules/gadsense/includes/class-mapi.php:1411
3940
  #: modules/gadsense/includes/class-network-adsense.php:515
3941
  msgctxt "AdSense ad type"
3942
  msgid "In-article"
3943
  msgstr ""
3944
 
3945
- #: modules/gadsense/includes/class-mapi.php:1395
3946
- #: modules/gadsense/includes/class-mapi.php:1414
3947
  #: modules/gadsense/includes/class-network-adsense.php:516
3948
  msgctxt "AdSense ad type"
3949
  msgid "In-feed"
3950
  msgstr ""
3951
 
3952
- #: modules/gadsense/includes/class-mapi.php:1402
3953
  #: modules/gadsense/includes/class-network-adsense.php:517
3954
  msgctxt "AdSense ad type"
3955
  msgid "Display"
3956
  msgstr ""
3957
 
3958
- #: modules/gadsense/includes/class-mapi.php:1405
3959
  #: modules/gadsense/includes/class-network-adsense.php:518
3960
  msgctxt "AdSense ad type"
3961
  msgid "Link"
3962
  msgstr ""
3963
 
3964
- #: modules/gadsense/includes/class-mapi.php:1611
3965
  msgid "There are one or more warnings about the currently linked AdSense account. You can view them <a href=\"%s\">here</a>"
3966
  msgstr ""
3967
 
3968
  #. translators: 1:A link to the settings page translators: 2:The name of an ad network
3969
- #: modules/gadsense/includes/class-mapi.php:1698
3970
  msgid "Please try to <a href=\"%1$s\" target=\"_blank\">reconnect to your %2$s account</a>."
3971
  msgstr ""
3972
 
2
  # This file is distributed under the GPL-2.0+.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Advanced Ads 1.36.3\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads/\n"
7
  "Last-Translator: Thomas Maier <post@webzunft.de>\n"
8
  "Language-Team: webgilde <support@wpadvancedads.com>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2022-10-11T12:28:30+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.6.0\n"
15
  "X-Domain: advanced-ads\n"
94
  msgid "Permanently delete this placement?"
95
  msgstr ""
96
 
97
+ #: admin/class-advanced-ads-admin.php:241
98
+ #: admin/views/modal.php:48
99
+ #: admin/views/modal.php:49
100
+ #: admin/views/placements.php:319
101
+ #: admin/views/placements.php:320
102
+ msgid "Close"
103
+ msgstr ""
104
+
105
+ #: admin/class-advanced-ads-admin.php:420
106
  #: admin/includes/class-menu.php:166
107
  #: admin/includes/class-menu.php:169
108
  #: admin/views/settings.php:29
109
  msgid "Support"
110
  msgstr ""
111
 
112
+ #: admin/class-advanced-ads-admin.php:425
113
  #: admin/includes/class-overview-widgets.php:72
114
  msgid "Add-Ons"
115
  msgstr ""
116
 
117
+ #: admin/class-advanced-ads-admin.php:427
118
  msgid "See Pro Features"
119
  msgstr ""
120
 
121
  #. translators: %s is the URL to add a new review, https://wordpress.org/support/plugin/advanced-ads/reviews/#new-post
122
  #. translators: %s is a URL.
123
+ #: admin/class-advanced-ads-admin.php:701
124
  #: admin/includes/class-overview-widgets.php:191
125
  msgid "Thank the developer with a &#9733;&#9733;&#9733;&#9733;&#9733; review on <a href=\"%s\" target=\"_blank\">wordpress.org</a>"
126
  msgstr ""
127
 
128
+ #: admin/class-advanced-ads-admin.php:795
129
+ #: admin/class-advanced-ads-admin.php:801
130
+ #: admin/includes/class-menu.php:123
131
+ #: admin/views/ad-group-list-ads.php:36
132
+ #: public/class-advanced-ads.php:798
133
+ #: public/class-advanced-ads.php:802
134
+ msgid "New Ad"
135
+ msgstr ""
136
+
137
+ #: admin/class-advanced-ads-admin.php:800
138
  msgid "Your Ads"
139
  msgstr ""
140
 
141
+ #: admin/class-advanced-ads-admin.php:810
142
  msgid "Your Groups"
143
  msgstr ""
144
 
145
+ #: admin/class-advanced-ads-admin.php:811
146
+ #: public/class-advanced-ads.php:762
147
+ msgid "New Ad Group"
148
+ msgstr ""
149
+
150
+ #: admin/class-advanced-ads-admin.php:819
151
  msgid "Your Placements"
152
  msgstr ""
153
 
154
+ #: admin/class-advanced-ads-admin.php:820
155
+ #: admin/views/placements.php:37
156
+ #: admin/views/placements.php:464
157
+ msgid "New Placement"
158
+ msgstr ""
159
+
160
+ #: admin/class-advanced-ads-admin.php:826
161
  #: admin/includes/class-menu.php:150
162
  msgid "Advanced Ads Settings"
163
  msgstr ""
228
 
229
  #: admin/includes/ad-health-notices.php:135
230
  #: admin/includes/ad-health-notices.php:142
231
+ #: modules/gadsense/includes/class-mapi.php:97
232
  msgid "Last AdSense account connection attempt failed."
233
  msgstr ""
234
 
308
 
309
  #. translators: %s is a date.
310
  #: admin/includes/class-ad-groups-list.php:199
311
+ #: admin/views/ad-list/timing.php:21
312
  msgid "starts %s"
313
  msgstr ""
314
 
315
  #. translators: %s is a date.
316
  #. translators: %s is a time and date string.
317
  #: admin/includes/class-ad-groups-list.php:220
318
+ #: admin/views/ad-list/timing.php:59
319
  msgid "expires %s"
320
  msgstr ""
321
 
322
  #. translators: %s is a date.
323
  #. translators: %s is a time and date string.
324
  #: admin/includes/class-ad-groups-list.php:223
325
+ #: admin/views/ad-list/timing.php:70
326
  msgid "<strong>expired</strong> %s"
327
  msgstr ""
328
 
395
  msgid "No ad group created"
396
  msgstr ""
397
 
398
+ #: admin/includes/class-ad-type.php:133
399
+ #: admin/views/ad-group-list-form-row.php:61
400
+ #: admin/views/placements.php:56
401
+ #: admin/views/placements.php:256
402
+ #: modules/gadsense/admin/views/adsense-ad-parameters.php:105
403
+ msgid "Type"
404
+ msgstr ""
405
+
406
+ #: admin/includes/class-ad-type.php:138
407
+ #: admin/views/ad-group-list-form-row.php:36
408
+ #: admin/views/placements.php:56
409
+ #: modules/gadsense/admin/views/external-ads-list.php:38
410
+ #: modules/privacy/admin/views/setting-general.php:44
411
+ msgid "Name"
412
+ msgstr ""
413
+
414
+ #: admin/includes/class-ad-type.php:139
415
+ msgid "Notes"
416
+ msgstr ""
417
+
418
+ #: admin/includes/class-ad-type.php:140
419
+ #: modules/ads-txt/admin/views/setting-additional-content.php:36
420
+ msgid "Preview"
421
+ msgstr ""
422
+
423
+ #: admin/includes/class-ad-type.php:141
424
+ #: modules/gadsense/admin/views/external-ads-list.php:41
425
+ msgid "Size"
426
  msgstr ""
427
 
428
+ #: admin/includes/class-ad-type.php:142
 
429
  msgid "Ad Planning"
430
  msgstr ""
431
 
432
+ #: admin/includes/class-ad-type.php:143
 
433
  msgid "Ad Shortcode"
434
  msgstr ""
435
 
436
  #. translators: %s is the number of ads.
437
+ #: admin/includes/class-ad-type.php:386
438
  msgid "%s ad updated."
439
  msgid_plural "%s ads updated."
440
  msgstr[0] ""
441
  msgstr[1] ""
442
 
443
  #. translators: %s is the number of ads.
444
+ #: admin/includes/class-ad-type.php:388
445
  msgid "%s ad not updated, somebody is editing it."
446
  msgid_plural "%s ads not updated, somebody is editing them."
447
  msgstr[0] ""
448
  msgstr[1] ""
449
 
450
  #. translators: %s is the number of ads.
451
+ #: admin/includes/class-ad-type.php:390
452
  msgid "%s ad permanently deleted."
453
  msgid_plural "%s ads permanently deleted."
454
  msgstr[0] ""
455
  msgstr[1] ""
456
 
457
  #. translators: %s is the number of ads.
458
+ #: admin/includes/class-ad-type.php:392
459
  msgid "%s ad moved to the Trash."
460
  msgid_plural "%s ads moved to the Trash."
461
  msgstr[0] ""
462
  msgstr[1] ""
463
 
464
  #. translators: %s is the number of ads.
465
+ #: admin/includes/class-ad-type.php:394
466
  msgid "%s ad restored from the Trash."
467
  msgid_plural "%s ads restored from the Trash."
468
  msgstr[0] ""
469
  msgstr[1] ""
470
 
471
  #. Translators: %s is the time the ad was first saved.
472
+ #: admin/includes/class-ad-type.php:629
473
  msgid "Ad created on %s"
474
  msgstr ""
475
 
476
+ #: admin/includes/class-ad-type.php:815
477
+ #: admin/includes/class-ad-type.php:816
478
  msgid "Ad updated."
479
  msgstr ""
480
 
481
  #. translators: %s: date and time of the revision
482
+ #: admin/includes/class-ad-type.php:817
483
  msgid "Ad restored to revision from %s"
484
  msgstr ""
485
 
486
+ #: admin/includes/class-ad-type.php:818
487
+ #: admin/includes/class-ad-type.php:819
488
  msgid "Ad saved."
489
  msgstr ""
490
 
491
+ #: admin/includes/class-ad-type.php:820
492
  msgid "Ad submitted."
493
  msgstr ""
494
 
495
  #. translators: %1$s is a date.
496
+ #: admin/includes/class-ad-type.php:823
497
  msgid "Ad scheduled for: <strong>%1$s</strong>."
498
  msgstr ""
499
 
500
  #. translators: Publish box date format, see http://php.net/date.
501
+ #: admin/includes/class-ad-type.php:825
502
  msgid "M j, Y @ G:i"
503
  msgstr ""
504
 
505
+ #: admin/includes/class-ad-type.php:827
506
  msgid "Ad draft updated."
507
  msgstr ""
508
 
509
+ #: admin/includes/class-ad-type.php:883
510
  msgid "You don’t have access to ads. Please deactivate and re-enable Advanced Ads again to fix this."
511
  msgstr ""
512
 
513
+ #: admin/includes/class-ad-type.php:884
514
  #: classes/frontend_checks.php:503
515
  msgid "Get help"
516
  msgstr ""
612
  msgid "Download failed. <a href=\"%s\" target=\"_blank\">Click here to learn why</a>."
613
  msgstr ""
614
 
615
+ #: admin/includes/class-list-filters.php:161
 
616
  #: modules/gadsense/admin/views/adsense-ad-parameters.php:109
617
+ #: modules/gadsense/includes/class-ad-type-adsense.php:49
618
  msgid "Responsive"
619
  msgstr ""
620
 
621
+ #: admin/includes/class-list-filters.php:559
622
  msgctxt "Post list header for expired ads."
623
  msgid "Expired"
624
  msgstr ""
625
 
626
+ #: admin/includes/class-list-filters.php:599
627
  msgctxt "Post list header for ads expiring in the future."
628
  msgid "Expiring"
629
  msgstr ""
630
 
631
+ #: admin/includes/class-list-filters.php:729
632
+ msgid "Showing search results for"
633
+ msgstr ""
634
+
635
  #: admin/includes/class-menu.php:66
636
  #: admin/includes/class-menu.php:78
637
  #: admin/includes/class-menu.php:79
661
  msgid "Add New Ad"
662
  msgstr ""
663
 
 
 
 
 
 
 
 
 
664
  #: admin/includes/class-menu.php:131
665
  msgid "Ad Groups & Rotations"
666
  msgstr ""
750
  #: admin/includes/class-meta-box.php:231
751
  #: admin/includes/class-meta-box.php:236
752
  #: admin/includes/class-overview-widgets.php:179
753
+ #: admin/views/ad-group.php:76
754
  #: admin/views/ad-main-metabox.php:29
755
  #: admin/views/ad-output-metabox.php:43
756
+ #: admin/views/header.php:50
757
  #: admin/views/placements.php:28
758
  #: admin/views/settings/general/custom-label.php:10
759
  #: admin/views/settings/general/disable-notices.php:6
827
  msgstr ""
828
 
829
  #: admin/includes/class-overview-widgets.php:118
830
+ #: modules/gadsense/admin/views/adsense-account.php:107
831
+ #: modules/gadsense/admin/views/adsense-account.php:127
832
  msgid "Connect to AdSense"
833
  msgstr ""
834
 
1277
  msgid "add"
1278
  msgstr ""
1279
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1280
  #: admin/views/ad-group-list-form-row.php:77
1281
  msgctxt "option to display all ads in an ad groups"
1282
  msgid "all"
1319
  msgid "ID: %s"
1320
  msgstr ""
1321
 
1322
+ #: admin/views/ad-group.php:31
1323
  msgid "Ad Group successfully created"
1324
  msgstr ""
1325
 
1326
+ #: admin/views/ad-group.php:44
1327
  msgid "Ad Groups successfully updated"
1328
  msgstr ""
1329
 
1330
+ #: admin/views/ad-group.php:69
1331
  msgid "Group title"
1332
  msgstr ""
1333
 
1334
+ #: admin/views/ad-group.php:70
1335
  msgid "save"
1336
  msgstr ""
1337
 
1338
+ #: admin/views/ad-group.php:74
1339
  msgid "Ad Groups are a very flexible method to bundle ads. You can use them to display random ads in the frontend or run split tests, but also just for informational purposes. Not only can an Ad Groups have multiple ads, but an ad can belong to multiple ad groups."
1340
  msgstr ""
1341
 
1342
+ #: admin/views/ad-group.php:110
1343
  msgid "Update Groups"
1344
  msgstr ""
1345
 
1368
  msgstr ""
1369
 
1370
  #: admin/views/ad-info-bottom.php:21
1371
+ #: admin/views/ad-info-top.php:31
1372
  msgid "Stop Wizard and show all options"
1373
  msgstr ""
1374
 
1375
+ #: admin/views/ad-info-top.php:3
1376
  msgid "Start Wizard"
1377
  msgstr ""
1378
 
1379
+ #: admin/views/ad-info-top.php:6
1380
  msgid "Stop Wizard"
1381
  msgstr ""
1382
 
 
 
 
 
1383
  #: admin/views/ad-list-filters.php:18
1384
  msgid "all ad types"
1385
  msgstr ""
1400
  msgid "Watch the “First Ad” Tutorial (Video)"
1401
  msgstr ""
1402
 
1403
+ #: admin/views/ad-list/screen-options.php:11
1404
+ #: admin/views/header.php:38
1405
+ msgid "Filters"
1406
+ msgstr ""
1407
+
1408
+ #: admin/views/ad-list/screen-options.php:13
1409
+ msgid "Show filters permanently"
1410
+ msgstr ""
1411
+
1412
+ #: admin/views/ad-list/view-list.php:23
1413
+ msgid "Empty Trash"
1414
+ msgstr ""
1415
+
1416
  #: admin/views/ad-main-metabox.php:3
1417
  msgid "No ad types defined"
1418
  msgstr ""
1726
  msgid "There is an error in your AdSense setup."
1727
  msgstr ""
1728
 
1729
+ #: admin/views/header.php:33
1730
+ msgid "Reset"
 
1731
  msgstr ""
1732
 
1733
+ #: admin/views/header.php:42
1734
+ msgid "Screen Options"
 
1735
  msgstr ""
1736
 
1737
+ #: admin/views/header.php:46
 
 
 
 
 
 
1738
  msgid "See all Add-ons"
1739
  msgstr ""
1740
 
 
 
 
 
 
 
 
1741
  #. Translators: 1: "Options", 2: the name of a placement.
1742
  #: admin/views/modal.php:51
1743
  #: admin/views/placements.php:231
1862
  #. translators: %s is a URL.
1863
  #. Translators: %s is a URL.
1864
  #: admin/views/placement-injection-top.php:46
1865
+ #: modules/gadsense/admin/admin.php:217
1866
  msgid "The AdSense verification and Auto ads code is already activated in the <a href=\"%s\">AdSense settings</a>."
1867
  msgstr ""
1868
 
1869
  #: admin/views/placement-injection-top.php:58
1870
+ #: modules/gadsense/admin/admin.php:220
1871
  msgid "No need to add the code manually here, unless you want to include it into certain pages only."
1872
  msgstr ""
1873
 
2144
  msgid "Save Placements"
2145
  msgstr ""
2146
 
2147
+ #: admin/views/placements.php:464
2148
+ msgid "Create a new placement"
2149
+ msgstr ""
2150
+
2151
  #: admin/views/post-ad-settings-metabox.php:1
2152
  msgid "How to disable ads on specific pages"
2153
  msgstr ""
2573
 
2574
  #. translators: %1$s is an anchor (link) opening tag, %2$s is the closing tag.
2575
  #: classes/ad-health-notices.php:865
2576
+ #: modules/gadsense/includes/class-mapi.php:1637
2577
  msgid "Learn more about AdSense account issues %1$shere%2$s."
2578
  msgstr ""
2579
 
2716
  msgid "Uses a simple placeholder ad for quick testing."
2717
  msgstr ""
2718
 
2719
+ #: classes/ad_type_dummy.php:44
2720
  #: classes/ad_type_image.php:69
2721
  msgid "URL"
2722
  msgstr ""
2758
  msgstr ""
2759
 
2760
  #. translators: $s is a size string like "728 x 90".
2761
+ #: classes/ad_type_image.php:246
2762
  msgid "Original size: %s"
2763
  msgstr ""
2764
 
3329
  msgid "Ad blocker fix"
3330
  msgstr ""
3331
 
3332
+ #: modules/ad-blocker/admin/admin.php:140
3333
  #: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:381
3334
  msgid "Unable to connect to the filesystem. Please confirm your credentials."
3335
  msgstr ""
3336
 
3337
+ #: modules/ad-blocker/admin/admin.php:154
3338
  msgid "The asset folder was rebuilt successfully"
3339
  msgstr ""
3340
 
3341
+ #: modules/ad-blocker/admin/admin.php:199
3342
  msgid "There is no writable upload folder"
3343
  msgstr ""
3344
 
3345
+ #: modules/ad-blocker/admin/admin.php:231
3346
  msgid "Unable to rename \"%s\" directory"
3347
  msgstr ""
3348
 
3349
+ #: modules/ad-blocker/admin/admin.php:247
3350
+ #: modules/ad-blocker/admin/admin.php:260
3351
+ #: modules/ad-blocker/admin/admin.php:277
3352
  msgid "Unable to copy assets to the \"%s\" directory"
3353
  msgstr ""
3354
 
3355
+ #: modules/ad-blocker/admin/admin.php:310
3356
+ #: modules/ad-blocker/admin/admin.php:395
3357
  msgid "We do not have direct write access to the \"%s\" directory"
3358
  msgstr ""
3359
 
3360
+ #: modules/ad-blocker/admin/admin.php:406
3361
  msgid "Unable to copy files to %s"
3362
  msgstr ""
3363
 
3542
  msgid "Check for problems"
3543
  msgstr ""
3544
 
 
 
 
 
3545
  #: modules/ads-txt/admin/views/setting-create.php:21
3546
  msgid "Generate a single ads.txt file for all sites in the multisite network."
3547
  msgstr ""
3551
  msgstr ""
3552
 
3553
  #. Translators: %s is a URL.
3554
+ #: modules/gadsense/admin/admin.php:166
3555
  msgid "Responsive AdSense ads don’t work reliably with <em>Position</em> set to left or right. Either switch the <em>Type</em> to \"normal\" or follow <a href=\"%s\" target=\"_blank\">this tutorial</a> if you want the ad to be wrapped in text."
3556
  msgstr ""
3557
 
3558
  #. Translators: %s is a URL.
3559
+ #: modules/gadsense/admin/admin.php:176
3560
  msgid "<a href=\"%s\" target=\"_blank\">Install the free AdSense In-feed add-on</a> in order to place ads between posts."
3561
  msgstr ""
3562
 
3563
  #. Translators: %s is a URL.
3564
+ #: modules/gadsense/admin/admin.php:225
3565
  msgid "The AdSense verification and Auto ads code should be set up in the <a href=\"%s\">AdSense settings</a>. Click on the following button to enable it now."
3566
  msgstr ""
3567
 
3568
+ #: modules/gadsense/admin/admin.php:228
3569
  msgid "Activate"
3570
  msgstr ""
3571
 
3586
  msgstr ""
3587
 
3588
  #: modules/gadsense/admin/views/adsense-account.php:50
 
3589
  msgid "dismiss"
3590
  msgstr ""
3591
 
3594
  msgid "last checked: %s"
3595
  msgstr ""
3596
 
3597
+ #: modules/gadsense/admin/views/adsense-account.php:110
3598
  msgid "Revoke API acccess"
3599
  msgstr ""
3600
 
3601
+ #: modules/gadsense/admin/views/adsense-account.php:116
3602
  msgid "Account holder name"
3603
  msgstr ""
3604
 
3605
+ #: modules/gadsense/admin/views/adsense-account.php:119
3606
+ #: modules/gadsense/includes/class-ad-type-adsense.php:119
3607
  msgid "The Publisher ID has an incorrect format. (must start with \"pub-\")"
3608
  msgstr ""
3609
 
3610
+ #: modules/gadsense/admin/views/adsense-account.php:126
3611
  msgid "Yes, I have an AdSense account"
3612
  msgstr ""
3613
 
3614
+ #: modules/gadsense/admin/views/adsense-account.php:128
3615
  msgid "Configure everything manually"
3616
  msgstr ""
3617
 
3618
+ #: modules/gadsense/admin/views/adsense-account.php:131
3619
  msgid "No, I still don't have an AdSense account"
3620
  msgstr ""
3621
 
3622
+ #: modules/gadsense/admin/views/adsense-account.php:132
3623
  msgid "Get a free AdSense account"
3624
  msgstr ""
3625
 
3626
  #. translators: %1$s is an opening a tag, %2$s is the closing one
3627
+ #: modules/gadsense/admin/views/adsense-account.php:138
3628
+ #: modules/gadsense/admin/views/adsense-account.php:230
3629
  msgid "See all %1$srecommended ad networks%2$s."
3630
  msgstr ""
3631
 
3632
+ #: modules/gadsense/admin/views/adsense-account.php:204
3633
  msgid "How to choose specific positions for AdSense ad units"
3634
  msgstr ""
3635
 
3636
  #. translators: %1$s is the opening link tag to our manual; %2$s is the appropriate closing link tag; %3$s is the opening link tag to our help forum; %4$s is the appropriate closing link tag
3637
+ #: modules/gadsense/admin/views/adsense-account.php:212
3638
  msgid "Problems with AdSense? Check out the %1$smanual%2$s or %3$sask here%4$s."
3639
  msgstr ""
3640
 
3641
+ #: modules/gadsense/admin/views/adsense-account.php:244
3642
  #: modules/gadsense/admin/views/external-ads-links.php:38
3643
  msgid "Can not connect AdSense account. PHP version is too low."
3644
  msgstr ""
3684
  msgstr ""
3685
 
3686
  #: modules/gadsense/admin/views/adsense-ad-parameters.php:108
3687
+ #: modules/gadsense/includes/class-ad-type-adsense.php:48
3688
+ #: modules/gadsense/includes/class-ad-type-adsense.php:66
3689
  msgid "Normal"
3690
  msgstr ""
3691
 
3692
  #: modules/gadsense/admin/views/adsense-ad-parameters.php:110
3693
+ #: modules/gadsense/includes/class-ad-type-adsense.php:50
3694
  msgid "Multiplex"
3695
  msgstr ""
3696
 
3697
  #: modules/gadsense/admin/views/adsense-ad-parameters.php:112
3698
+ #: modules/gadsense/includes/class-ad-type-adsense.php:51
3699
  msgid "Link ads"
3700
  msgstr ""
3701
 
3702
  #: modules/gadsense/admin/views/adsense-ad-parameters.php:115
3703
+ #: modules/gadsense/includes/class-ad-type-adsense.php:52
3704
  msgid "Link ads (Responsive)"
3705
  msgstr ""
3706
 
3707
  #: modules/gadsense/admin/views/adsense-ad-parameters.php:117
3708
+ #: modules/gadsense/includes/class-ad-type-adsense.php:53
3709
  msgid "In-article"
3710
  msgstr ""
3711
 
3712
  #: modules/gadsense/admin/views/adsense-ad-parameters.php:118
3713
+ #: modules/gadsense/includes/class-ad-type-adsense.php:54
3714
  msgid "In-feed"
3715
  msgstr ""
3716
 
3801
  msgid "Type"
3802
  msgstr ""
3803
 
 
 
 
 
3804
  #: modules/gadsense/admin/views/external-ads-list.php:48
3805
  msgid "No ad units found"
3806
  msgstr ""
3869
  msgid "Use ads from your Google AdSense account"
3870
  msgstr ""
3871
 
3872
+ #: modules/gadsense/includes/class-ad-type-adsense.php:160
3873
  msgid "Your AdSense Publisher ID is missing."
3874
  msgstr ""
3875
 
3882
  msgstr ""
3883
 
3884
  #. translators: %s: ad unit ID.
3885
+ #: modules/gadsense/includes/class-mapi.php:353
3886
  msgid "Error while retrieving ad code for \"%s\"."
3887
  msgstr ""
3888
 
3889
  #. translators: %s: ad unit ID.
3890
+ #: modules/gadsense/includes/class-mapi.php:380
3891
  msgid "Invalid response while retrieving ad code for \"%s\"."
3892
  msgstr ""
3893
 
3894
+ #. translators: %s is the publisher ID.
3895
  #. translators: the publisher ID.
3896
+ #: modules/gadsense/includes/class-mapi.php:441
3897
+ #: modules/gadsense/includes/class-mapi.php:538
3898
+ msgid "Error while retrieving ad unit list for \"%s\"."
3899
+ msgstr ""
3900
+
3901
+ #. translators: %1$s is the AdSense publisher ID; %2$s a starting a tag to the AdSense ad unit list and %3$s the closing link.
3902
+ #: modules/gadsense/includes/class-mapi.php:452
3903
+ msgid "The account \"%1$s\" does not seem to have any ad units. Please create some %2$shere%3$s."
3904
  msgstr ""
3905
 
3906
  #. translators: %s is the publisher ID.
3907
  #: modules/gadsense/includes/class-mapi.php:465
3908
+ msgid "Invalid response while retrieving ad unit list for \"%s\"."
3909
  msgstr ""
3910
 
3911
+ #: modules/gadsense/includes/class-mapi.php:475
3912
+ msgctxt "Reason of the API call error"
3913
  msgid "Reason:"
3914
  msgstr ""
3915
 
3916
+ #: modules/gadsense/includes/class-mapi.php:477
3917
+ msgctxt "Error message from Google"
3918
  msgid "Message:"
3919
  msgstr ""
3920
 
3921
+ #: modules/gadsense/includes/class-mapi.php:600
 
 
 
 
 
3922
  msgid "It seems that some changes have been made in the Advanced Ads settings. Please refresh this page."
3923
  msgstr ""
3924
 
3925
+ #: modules/gadsense/includes/class-mapi.php:607
3926
  msgid "Advanced Ads does not have access to your account (<code>%s</code>) anymore."
3927
  msgstr ""
3928
 
3929
+ #: modules/gadsense/includes/class-mapi.php:651
3930
  msgid "error while renewing access token for \"%s\""
3931
  msgstr ""
3932
 
3933
  #. translators: %s AdSense account ID
3934
+ #: modules/gadsense/includes/class-mapi.php:678
3935
  msgid "invalid response received while renewing access token for \"%s\""
3936
  msgstr ""
3937
 
3938
+ #: modules/gadsense/includes/class-mapi.php:680
3939
  msgid "You could try to connect again under Advanced Ads > Settings > AdSense."
3940
  msgstr ""
3941
 
3942
+ #: modules/gadsense/includes/class-mapi.php:749
3943
  msgid "This ad code is from a different AdSense Account"
3944
  msgstr ""
3945
 
3946
+ #: modules/gadsense/includes/class-mapi.php:986
3947
  msgid "Invalid response body while retrieving account alerts"
3948
  msgstr ""
3949
 
3950
+ #: modules/gadsense/includes/class-mapi.php:995
3951
  msgid "error while retrieving account alerts"
3952
  msgstr ""
3953
 
3954
+ #: modules/gadsense/includes/class-mapi.php:1110
3955
  msgid "No token provided. Token data needed to get account details."
3956
  msgstr ""
3957
 
3958
+ #: modules/gadsense/includes/class-mapi.php:1130
3959
+ #: modules/gadsense/includes/class-mapi.php:1134
3960
  msgid "No AdSense account data found."
3961
  msgstr ""
3962
 
3963
+ #: modules/gadsense/includes/class-mapi.php:1382
3964
+ #: modules/gadsense/includes/class-mapi.php:1400
3965
  #: modules/gadsense/includes/class-network-adsense.php:514
3966
  msgctxt "AdSense ad type"
3967
  msgid "Multiplex"
3968
  msgstr ""
3969
 
3970
+ #: modules/gadsense/includes/class-mapi.php:1385
3971
+ #: modules/gadsense/includes/class-mapi.php:1403
3972
  #: modules/gadsense/includes/class-network-adsense.php:515
3973
  msgctxt "AdSense ad type"
3974
  msgid "In-article"
3975
  msgstr ""
3976
 
3977
+ #: modules/gadsense/includes/class-mapi.php:1387
3978
+ #: modules/gadsense/includes/class-mapi.php:1406
3979
  #: modules/gadsense/includes/class-network-adsense.php:516
3980
  msgctxt "AdSense ad type"
3981
  msgid "In-feed"
3982
  msgstr ""
3983
 
3984
+ #: modules/gadsense/includes/class-mapi.php:1394
3985
  #: modules/gadsense/includes/class-network-adsense.php:517
3986
  msgctxt "AdSense ad type"
3987
  msgid "Display"
3988
  msgstr ""
3989
 
3990
+ #: modules/gadsense/includes/class-mapi.php:1397
3991
  #: modules/gadsense/includes/class-network-adsense.php:518
3992
  msgctxt "AdSense ad type"
3993
  msgid "Link"
3994
  msgstr ""
3995
 
3996
+ #: modules/gadsense/includes/class-mapi.php:1604
3997
  msgid "There are one or more warnings about the currently linked AdSense account. You can view them <a href=\"%s\">here</a>"
3998
  msgstr ""
3999
 
4000
  #. translators: 1:A link to the settings page translators: 2:The name of an ad network
4001
+ #: modules/gadsense/includes/class-mapi.php:1691
4002
  msgid "Please try to <a href=\"%1$s\" target=\"_blank\">reconnect to your %2$s account</a>."
4003
  msgstr ""
4004
 
modules/ad-blocker/admin/admin.php CHANGED
@@ -106,6 +106,11 @@ class Advanced_Ads_Ad_Blocker_Admin {
106
 
107
  include ADVADS_AB_BASE_PATH . 'admin/views/setting-use-adblocker.php';
108
 
 
 
 
 
 
109
  // add the rebuild form directly after the settings
110
  ?>
111
  <div id="advads-adblocker-wrapper" <?php echo( $checked ? '' : 'style="display: none;"' ); ?>>
106
 
107
  include ADVADS_AB_BASE_PATH . 'admin/views/setting-use-adblocker.php';
108
 
109
+ // if this is a sub site in a network, don't run the rebuild form code.
110
+ if ( ! $is_main_site ) {
111
+ return;
112
+ }
113
+
114
  // add the rebuild form directly after the settings
115
  ?>
116
  <div id="advads-adblocker-wrapper" <?php echo( $checked ? '' : 'style="display: none;"' ); ?>>
modules/gadsense/admin/admin.php CHANGED
@@ -52,29 +52,9 @@ class Advanced_Ads_AdSense_Admin {
52
 
53
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
54
  add_action( 'admin_print_scripts', array( $this, 'print_scripts' ) );
55
- add_filter( 'advanced-ads-list-ad-size', array( $this, 'ad_details_column' ), 10, 2 );
56
  add_filter( 'advanced-ads-ad-notices', array( $this, 'ad_notices' ), 10, 3 );
57
  }
58
 
59
- /**
60
- * Add content to ad details column on ad overview list.
61
- *
62
- * @param string $size size string.
63
- * @param Advanced_Ads_Ad $the_ad ad object.
64
- *
65
- * @return string|void
66
- */
67
- public function ad_details_column( $size, $the_ad ) {
68
- if ( 'adsense' === $the_ad->type ) {
69
- $content = json_decode( $the_ad->content );
70
-
71
- //phpcs:ignore
72
- if ( $content && 'responsive' === $content->unitType ) {
73
- $size = __( 'Responsive', 'advanced-ads' ); }
74
- }
75
- return $size;
76
- }
77
-
78
  /**
79
  * Load JavaScript needed on some pages.
80
  */
52
 
53
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
54
  add_action( 'admin_print_scripts', array( $this, 'print_scripts' ) );
 
55
  add_filter( 'advanced-ads-ad-notices', array( $this, 'ad_notices' ), 10, 3 );
56
  }
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  /**
59
  * Load JavaScript needed on some pages.
60
  */
modules/gadsense/admin/assets/img/adsense-display.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" overflow="visible"><path fill="#fff" d="M19.878 99C9.469 99 1 90.532 1 80.123V2a1 1 0 0 1 1-1h78.122C90.531 1 99 9.469 99 19.878V98a1 1 0 0 1-1 1H19.878z"/><path d="M80.122 2C89.98 2 98 10.02 98 19.878V98H19.878C10.02 98 2 89.981 2 80.123V2h78.122m0-2H2a2 2 0 0 0-2 2v78.123C0 91.083 8.917 100 19.878 100H98a2 2 0 0 0 2-2V19.878C100 8.917 91.083 0 80.122 0h0zm5.326 17.555H14.635a2.961 2.961 0 1 1 0-5.921h70.813a2.961 2.961 0 1 1 0 5.921zm0 70.812H14.635a2.961 2.961 0 1 1 0-5.921h70.813a2.961 2.961 0 1 1 0 5.921z" fill="#0074a2"/><path fill="#39f" d="M73.604 76.524H26.478a2.96 2.96 0 0 1-2.961-2.961V26.438a2.96 2.96 0 0 1 2.961-2.961h47.126a2.96 2.96 0 0 1 2.961 2.961v47.126c-.001 1.634-1.326 2.96-2.961 2.96z"/><path fill="#add6ff" d="M55.313 42.02c1.806-3.091.733-7.041-2.396-8.825s-7.131-.727-8.937 2.364l-.225.423-6.105 10.445c-.136.208-.261.42-.375.642l-6.341 10.94 11.331 6.352 6.309-10.848a6.75 6.75 0 0 0 .374-.642l6.106-10.447.259-.404"/><path fill="#fff" d="M42.319 64.327c-1.797 3.141-5.848 4.297-8.957 2.485s-4.217-5.747-2.418-8.888 5.811-4.3 8.921-2.488 4.249 5.751 2.454 8.891"/><path fill="#d6ebff" d="M66.769 44.089a6.48 6.48 0 0 0-8.837 2.361l-6.468 11.175c-1.782 3.083-.73 7.023 2.35 8.806.007.003.012.007.018.011a6.48 6.48 0 0 0 8.839-2.362l6.468-11.175a6.45 6.45 0 0 0-2.355-8.807"/></svg>
modules/gadsense/admin/assets/img/adsense-in-article.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" overflow="visible"><path fill="#fff" d="M19.878 99C9.469 99 1 90.531 1 80.121V2a1 1 0 0 1 1-1h78.122C90.531 1 99 9.468 99 19.877V98a1 1 0 0 1-1 1H19.878z"/><path d="M80.122 2C89.98 2 98 10.02 98 19.877V98H19.878C10.02 98 2 89.979 2 80.121V2h78.122m0-2H2a2 2 0 0 0-2 2v78.121C0 91.082 8.917 100 19.878 100H98a2 2 0 0 0 2-2V19.877C100 8.917 91.083 0 80.122 0h0zm5.324 17.554H14.633a2.961 2.961 0 1 1 0-5.921h70.813a2.961 2.961 0 1 1 0 5.921zm0 70.813H14.633a2.962 2.962 0 0 1 0-5.923h70.813a2.96 2.96 0 0 1 2.961 2.962c0 1.634-1.326 2.961-2.961 2.961z" fill="#0074a2"/><path fill="#ffbf00" d="M85.444 76.522H14.633a2.96 2.96 0 0 1-2.96-2.961V26.436a2.96 2.96 0 0 1 2.96-2.96h70.812a2.96 2.96 0 0 1 2.961 2.96v47.125c-.001 1.636-1.327 2.961-2.962 2.961z"/><path fill="#ffe599" d="M54.384 37.389c1.49-2.549.606-5.804-1.973-7.276s-5.878-.599-7.367 1.949l-.184.35-5.034 8.611c-.113.17-.213.345-.309.526l-5.228 9.019 9.339 5.236 5.202-8.942c.112-.17.218-.348.31-.53l5.031-8.609.213-.334"/><path fill="#fff" d="M43.673 55.777c-1.48 2.59-4.819 3.54-7.384 2.047s-3.475-4.735-1.994-7.325 4.792-3.545 7.356-2.051 3.501 4.739 2.021 7.327"/><path fill="#fff2cc" d="M63.829 39.093a5.34 5.34 0 0 0-7.285 1.947l-5.333 9.212c-1.469 2.542-.601 5.79 1.94 7.259 2.562 1.477 5.822.607 7.3-1.939l5.329-9.212c1.469-2.539.602-5.791-1.94-7.259"/><path fill="#fff" d="M79.523 70.602h-58.97a2.96 2.96 0 1 1 0-5.922h58.97a2.96 2.96 0 1 1 0 5.922z"/></svg>
modules/gadsense/admin/assets/img/adsense-in-feed.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="100" overflow="visible"><path fill="#fff" d="M19.878 99C9.469 99 1 90.531 1 80.122V2a1 1 0 0 1 1-1h78.122C90.531 1 99 9.468 99 19.877V98a1 1 0 0 1-1 1H19.878z"/><g fill="#0074a2"><path d="M80.122 2C89.98 2 98 10.02 98 19.877V98H19.878C10.02 98 2 89.98 2 80.122V2h78.122m0-2H2a2 2 0 0 0-2 2v78.122C0 91.083 8.917 100 19.878 100H98a2 2 0 0 0 2-2V19.877C100 8.917 91.083 0 80.122 0h0z"/><use xlink:href="#B"/><use xlink:href="#B" y="11.843"/></g><path fill="#52cc52" d="M85.408 64.809H14.596c-1.57 0-2.845-1.273-2.845-2.844V38.278c0-1.571 1.274-2.845 2.845-2.845h70.812c1.57 0 2.844 1.274 2.844 2.845v23.687c0 1.57-1.273 2.844-2.844 2.844z"/><path d="M79.484 47.161h-35.28a2.961 2.961 0 1 1 0-5.921h35.28a2.961 2.961 0 1 1 0 5.921zm0 11.843h-35.28a2.961 2.961 0 1 1 0-5.922h35.28a2.961 2.961 0 1 1 0 5.922z" fill="#fff"/><g fill="#0074a2"><path d="M79.484 76.769H44.206a2.96 2.96 0 1 1 0-5.922h35.278a2.96 2.96 0 1 1 0 5.922z"/><use xlink:href="#B" y="71.057"/><path d="M32.858 20.581a5.99 5.99 0 0 1-5.99 5.987 5.99 5.99 0 0 1-5.987-5.987 5.99 5.99 0 0 1 5.987-5.988 5.99 5.99 0 0 1 5.99 5.988zm0 59.213a5.99 5.99 0 0 1-5.99 5.989 5.99 5.99 0 0 1-5.987-5.989 5.99 5.99 0 0 1 5.987-5.986 5.99 5.99 0 0 1 5.99 5.986z"/></g><path fill="#baebba" d="M28.688 46.717a2.74 2.74 0 0 0-1.023-3.767 2.81 2.81 0 0 0-3.812 1.01l-.096.18-2.604 4.457c-.058.088-.112.179-.16.273l-2.705 4.669 4.833 2.709 2.691-4.629c.061-.088.113-.18.161-.274l2.604-4.456.111-.172"/><path fill="#fff" d="M23.145 56.233c-.767 1.341-2.496 1.833-3.823 1.061s-1.798-2.451-1.032-3.792 2.481-1.836 3.81-1.062 1.81 2.454 1.045 3.793"/><path fill="#dcf5dc" d="M33.575 47.598c-1.317-.76-3.005-.309-3.771 1.008l-2.759 4.768a2.75 2.75 0 0 0 1.003 3.758c1.327.766 3.014.315 3.779-1.005l2.758-4.768a2.75 2.75 0 0 0-1.004-3.757"/><defs ><path id="B" d="M79.484 17.553H44.206a2.96 2.96 0 1 1 0-5.921h35.278a2.96 2.96 0 1 1 0 5.921z"/></defs></svg>
modules/gadsense/admin/assets/img/adsense-multiplex.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" overflow="visible"><path fill="#fff" d="M19.878 99C9.469 99 1 90.531 1 80.122V2a1 1 0 0 1 1-1h78.122C90.531 1 99 9.468 99 19.877V98a1 1 0 0 1-1 1H19.878z"/><path d="M80.122 2C89.98 2 98 10.02 98 19.877V98H19.878C10.02 98 2 89.98 2 80.122V2h78.122m0-2H2a2 2 0 0 0-2 2v78.122C0 91.083 8.917 100 19.878 100H98a2 2 0 0 0 2-2V19.877C100 8.917 91.083 0 80.122 0h0zm-.599 17.556H20.559a2.961 2.961 0 1 1 0-5.921h58.965a2.96 2.96 0 0 1 2.962 2.961c-.001 1.634-1.327 2.96-2.963 2.96zm0 11.842H20.559a2.961 2.961 0 1 1 0-5.921h58.965a2.96 2.96 0 0 1 2.962 2.96c-.001 1.635-1.327 2.961-2.963 2.961z" fill="#0074a2"/><path fill="#d95757" d="M85.446 88.496H14.635c-1.57 0-2.844-1.273-2.844-2.845V38.28c0-1.57 1.273-2.844 2.844-2.844h70.812c1.57 0 2.844 1.274 2.844 2.844v47.372c-.001 1.571-1.274 2.844-2.845 2.844z"/><path fill="#fff" d="M79.523 53.083h-35.28a2.96 2.96 0 1 1 0-5.921h35.28a2.96 2.96 0 1 1 0 5.921z"/><path fill="#f0bcbc" d="M28.727 46.719a2.74 2.74 0 0 0-1.021-3.766c-1.337-.762-3.043-.311-3.813 1.009l-.095.18-2.605 4.458c-.058.087-.11.178-.16.274l-2.704 4.666 4.834 2.712 2.689-4.631a2.49 2.49 0 0 0 .161-.272l2.604-4.457.11-.173"/><path fill="#fff" d="M23.183 56.235c-.766 1.341-2.495 1.834-3.821 1.061s-1.799-2.45-1.031-3.792 2.479-1.836 3.807-1.061 1.811 2.453 1.045 3.792"/><path fill="#f7dddd" d="M33.615 47.6c-1.319-.759-3.005-.309-3.769 1.009l-2.762 4.768a2.75 2.75 0 0 0 1.003 3.758c1.327.765 3.015.315 3.78-1.004l2.759-4.768a2.75 2.75 0 0 0-1.006-3.757"/><path fill="#fff" d="M79.523 76.77h-35.28a2.96 2.96 0 0 1 0-5.923h35.28c1.636 0 2.962 1.326 2.962 2.962s-1.326 2.961-2.962 2.961z"/><path fill="#f0bcbc" d="M28.727 70.404a2.74 2.74 0 0 0-1.021-3.766 2.81 2.81 0 0 0-3.813 1.009l-.095.18-2.605 4.458a3.34 3.34 0 0 0-.16.272l-2.704 4.668 4.834 2.709 2.689-4.628c.059-.088.114-.179.161-.273l2.604-4.457.11-.172"/><path fill="#fff" d="M23.183 79.921c-.766 1.341-2.495 1.834-3.821 1.061s-1.799-2.451-1.031-3.791 2.479-1.836 3.807-1.062 1.811 2.453 1.045 3.792"/><path fill="#f7dddd" d="M33.615 71.286a2.76 2.76 0 0 0-3.769 1.008l-2.762 4.77a2.75 2.75 0 0 0 1.003 3.756c1.327.765 3.015.315 3.78-1.003l2.759-4.769c.76-1.315.309-2.997-1.006-3.758"/></svg>
modules/gadsense/admin/assets/js/mapi-settings.js CHANGED
@@ -32,18 +32,6 @@
32
  ev.preventDefault();
33
  } );
34
 
35
- $( document ).on( 'click', '#dissmiss-connect-error', function() {
36
- $( '#mapi-connect-errors' ).empty();
37
- $.ajax({
38
- url: ajaxurl,
39
- type: 'get',
40
- data: {
41
- action: 'advads-mapi-dismiss-connect-error',
42
- nonce: AdsenseMAPI.nonce,
43
- }
44
- });
45
- } );
46
-
47
  $( document ).on( 'keypress', '#adsense input[type="text"]', function( ev ) {
48
  if ( $( this ).hasClass( 'preventDefault' ) ) {
49
  ev.preventDefault();
32
  ev.preventDefault();
33
  } );
34
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  $( document ).on( 'keypress', '#adsense input[type="text"]', function( ev ) {
36
  if ( $( this ).hasClass( 'preventDefault' ) ) {
37
  ev.preventDefault();
modules/gadsense/admin/views/adsense-account.php CHANGED
@@ -75,22 +75,31 @@ $alerts_advads_messages = Advanced_Ads_Adsense_MAPI::get_adsense_alert_messag
75
  <p class="description alignright"><?php printf( __( 'last checked: %s', 'advanced-ads' ), $alerts['lastCheck'] ? esc_html( ( new DateTime( '@' . $alerts['lastCheck'], Advanced_Ads_Utils::get_wp_timezone() ) )->format( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) ) ) : '-' ); ?></p>
76
  </div>
77
  <?php endif; ?>
78
- </div>
79
- <div id="mapi-connect-errors">
80
- <?php if ( !empty( $mapi_options['connect_error'] ) ) {
81
- $message = isset( $mapi_options['connect_error']['message'] ) ? $mapi_options['connect_error']['message'] : '';
82
- if ( isset( $connection_error_messages[ $mapi_options['connect_error']['reason'] ] ) ) {
83
- $message = $connection_error_messages[ $mapi_options['connect_error']['reason'] ];
84
- }
85
- if ( ! empty( $message ) ) {
86
- echo '<p class="advads-notice-inline advads-error">' . wp_kses_post( $message );
87
- echo '<i id="dissmiss-connect-error" class="dashicons dashicons-dismiss align';
88
- echo is_rtl() ? 'left' : 'right';
89
- echo '" title=" ' . esc_attr( __( 'dismiss', 'advanced-ads' ) ) . '"></i>';
90
- echo '</p>';
 
 
 
 
 
 
 
 
 
 
91
  }
92
- }
93
- ?>
94
  </div>
95
  <div id="full-adsense-settings-div" <?php if ( empty( $adsense_id ) ) echo 'style="display:none"' ?>>
96
  <input type="text" <?php echo $has_token ? 'readonly' : ''; ?> name="<?php echo esc_attr( GADSENSE_OPT_NAME ); ?>[adsense-id]" placeholder="pub-1234567891234567" style="margin-right:.8em" id="adsense-id" size="32" value="<?php echo esc_attr( $adsense_id ); ?>"/>
75
  <p class="description alignright"><?php printf( __( 'last checked: %s', 'advanced-ads' ), $alerts['lastCheck'] ? esc_html( ( new DateTime( '@' . $alerts['lastCheck'], Advanced_Ads_Utils::get_wp_timezone() ) )->format( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ) ) ) : '-' ); ?></p>
76
  </div>
77
  <?php endif; ?>
78
+ <?php
79
+ if ( ! empty( $mapi_options['connect_error'] ) ) {
80
+ $message = isset( $mapi_options['connect_error']['message'] ) ? $mapi_options['connect_error']['message'] : '';
81
+ if ( isset( $connection_error_messages[ $mapi_options['connect_error']['reason'] ] ) ) {
82
+ $message = $connection_error_messages[ $mapi_options['connect_error']['reason'] ];
83
+ }
84
+ if ( ! empty( $message ) ) {
85
+ echo '<div id="mapi-connect-errors" class="notice error inline"><p class="advads-notice-inline advads-error">';
86
+ echo wp_kses( $message, array(
87
+ 'a' => array(
88
+ 'id' => array(),
89
+ 'class' => array(),
90
+ 'href' => array(),
91
+ 'style' => array(),
92
+ ),
93
+ 'i' => array(
94
+ 'id' => array(),
95
+ 'class' => array(),
96
+ 'style' => array(),
97
+ ),
98
+ ) );
99
+ echo '</p></div>';
100
+ }
101
  }
102
+ ?>
 
103
  </div>
104
  <div id="full-adsense-settings-div" <?php if ( empty( $adsense_id ) ) echo 'style="display:none"' ?>>
105
  <input type="text" <?php echo $has_token ? 'readonly' : ''; ?> name="<?php echo esc_attr( GADSENSE_OPT_NAME ); ?>[adsense-id]" placeholder="pub-1234567891234567" style="margin-right:.8em" id="adsense-id" size="32" value="<?php echo esc_attr( $adsense_id ); ?>"/>
modules/gadsense/includes/class-ad-type-adsense.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
 
3
  /**
4
- * Advanced Ads dfp Ad Type
5
  *
6
  * @package Advanced_Ads
7
  * @author Thomas Maier <support@wpadvancedads.com>
8
  * @license GPL-2.0+
9
  * @link https://wpadvancedads.com
10
- * @copyright 2013-2018 Thomas Maier, Advanced Ads GmbH
11
  *
12
  * Class containing information about the adsense ad type
13
  *
@@ -38,6 +38,34 @@ class Advanced_Ads_Ad_Type_Adsense extends Advanced_Ads_Ad_Type_Abstract {
38
  );
39
  }
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  /**
42
  * Output for the ad parameters metabox
43
  * this will be loaded using ajax when changing the ad type radio buttons
@@ -146,6 +174,44 @@ class Advanced_Ads_Ad_Type_Adsense extends Advanced_Ads_Ad_Type_Abstract {
146
  require $template;
147
  }
148
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  /**
150
  * Sanitize content field on save
151
  *
1
  <?php
2
 
3
  /**
4
+ * Advanced Ads AdSense Ad Type
5
  *
6
  * @package Advanced_Ads
7
  * @author Thomas Maier <support@wpadvancedads.com>
8
  * @license GPL-2.0+
9
  * @link https://wpadvancedads.com
10
+ * @copyright 2013-2022 Thomas Maier, Advanced Ads GmbH
11
  *
12
  * Class containing information about the adsense ad type
13
  *
38
  );
39
  }
40
 
41
+ /**
42
+ * Return an array with AdSense ad type keys and readable labels
43
+ *
44
+ * @return array
45
+ */
46
+ public static function get_ad_types() {
47
+ return array(
48
+ 'normal' => __( 'Normal', 'advanced-ads' ),
49
+ 'responsive' => __( 'Responsive', 'advanced-ads' ),
50
+ 'matched-content' => __( 'Multiplex', 'advanced-ads' ),
51
+ 'link' => __( 'Link ads', 'advanced-ads' ),
52
+ 'link-responsive' => __( 'Link ads (Responsive)', 'advanced-ads' ),
53
+ 'in-article' => __( 'In-article', 'advanced-ads' ),
54
+ 'in-feed' => __( 'In-feed', 'advanced-ads' ),
55
+ );
56
+ }
57
+
58
+ /**
59
+ * Get readable names for each AdSense ad type
60
+ *
61
+ * @param string $ad_type ad type key.
62
+ * @return string
63
+ */
64
+ public static function get_ad_type_label( $ad_type ) {
65
+ $ad_types = self::get_ad_types();
66
+ return isset( $ad_types[ $ad_type ] ) ? $ad_types[ $ad_type ] : __( 'Normal', 'advanced-ads' );
67
+ }
68
+
69
  /**
70
  * Output for the ad parameters metabox
71
  * this will be loaded using ajax when changing the ad type radio buttons
174
  require $template;
175
  }
176
 
177
+ /**
178
+ * Render icon on the ad overview list
179
+ *
180
+ * @param Advanced_Ads_Ad $ad ad object.
181
+ */
182
+ public function render_icon( Advanced_Ads_Ad $ad ) {
183
+ $image = 'adsense-display.svg';
184
+
185
+ $content = json_decode( wp_unslash( $ad->content ), true );
186
+ if ( isset( $content['unitType'] ) ) {
187
+ switch ( $content['unitType'] ) {
188
+ case 'matched-content':
189
+ $image = 'adsense-multiplex.svg';
190
+ break;
191
+ case 'in-article':
192
+ $image = 'adsense-in-article.svg';
193
+ break;
194
+ case 'in-feed':
195
+ $image = 'adsense-in-feed.svg';
196
+ break;
197
+ }
198
+ }
199
+
200
+ echo '<img src="' . esc_url( ADVADS_BASE_URL ) . '/modules/gadsense/admin/assets/img/' . esc_attr( $image ) . '" width="50" height="50">';
201
+ }
202
+
203
+ /**
204
+ * Render additional information in the ad type tooltip on the ad overview page
205
+ *
206
+ * @param Advanced_Ads_Ad $ad ad object.
207
+ */
208
+ public function render_ad_type_tooltip( Advanced_Ads_Ad $ad ) {
209
+ $content = json_decode( stripslashes( $ad->content ), true );
210
+ if ( isset( $content['unitType'] ) ) {
211
+ echo esc_html( self::get_ad_type_label( $content['unitType'] ) );
212
+ }
213
+ }
214
+
215
  /**
216
  * Sanitize content field on save
217
  *
modules/gadsense/includes/class-mapi.php CHANGED
@@ -56,7 +56,6 @@ class Advanced_Ads_AdSense_MAPI {
56
  add_action( 'wp_ajax_advads-mapi-revoke-token', array( $this, 'ajax_revoke_tokken' ) );
57
  add_action( 'wp_ajax_advads-mapi-get-alerts', array( $this, 'ajax_get_account_alerts' ) );
58
  add_action( 'wp_ajax_advads-mapi-dismiss-alert', array( $this, 'ajax_dismiss_alert' ) );
59
- add_action( 'wp_ajax_advads-mapi-dismiss-connect-error', array( $this, 'ajax_dismiss_connect_error' ) );
60
  add_action( 'wp_ajax_advads_adsense_report_refresh', array( 'Advanced_Ads_Overview_Widgets_Callbacks', 'ajax_gadsense_dashboard' ) );
61
 
62
  add_action( 'admin_footer', array( $this, 'admin_footer' ) );
@@ -171,23 +170,6 @@ class Advanced_Ads_AdSense_MAPI {
171
  }
172
  }
173
 
174
- /**
175
- * Discard account connection error
176
- */
177
- public function ajax_dismiss_connect_error() {
178
- $nonce = isset( $_GET['nonce'] ) ? $_GET['nonce'] : '';
179
- if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options' ) ) ) {
180
- die;
181
- }
182
- if ( false !== wp_verify_nonce( $nonce, 'advads-mapi' ) ) {
183
- $options = self::get_option();
184
- $options['connect_error'] = array();
185
- update_option( self::OPTNAME, $options );
186
- echo 1;
187
- }
188
- die;
189
- }
190
-
191
  /**
192
  * Get available quota and eventual message about remaining call
193
  */
@@ -436,137 +418,150 @@ class Advanced_Ads_AdSense_MAPI {
436
  /**
437
  * Get/Update ad unit list for a given client
438
  *
439
- * @param [string] $account The publisher ID.
 
 
440
  */
441
  public static function get_ad_units( $account ) {
442
  $url = 'https://adsense.googleapis.com/v2/accounts/' . $account . '/adclients/ca-' . $account . '/adunits?pageSize=350';
443
  $access_token = self::get_access_token( $account );
444
- $options = self::get_option();
445
- $page = 1;
446
 
447
- if ( ! isset( $access_token['msg'] ) ) {
448
- $headers = array(
449
- 'Authorization' => 'Bearer ' . $access_token,
 
 
 
 
 
 
 
 
 
 
 
450
  );
451
- $response = wp_remote_get( $url, array( 'headers' => $headers ) );
452
- self::log( 'Get ad units list for ca-' . $account );
453
 
454
- if ( is_wp_error( $response ) ) {
455
- return array(
456
- 'status' => false,
457
- 'msg' => sprintf( esc_html__( 'Error while retrieving adUnits list for "%s".', 'advanced-ads' ), $account ),
458
- 'raw' => $response->get_error_message(),
459
- );
460
- } else {
461
- $resp_body = json_decode( $response['body'], true );
462
-
463
- if ( $resp_body === null || ! isset( $resp_body['adUnits'] ) ) {
464
- // translators: %s is the publisher ID.
465
- $error_message = sprintf( esc_html__( 'Invalid response while retrieving adUnits list for "%s".', 'advanced-ads' ), $account );
466
- // check the response for errors and display them for better problem solving.
467
- if ( $resp_body && isset( $resp_body['error'] ) && isset( $resp_body['error']['errors'] ) && count( $resp_body['error']['errors'] ) ) {
468
- foreach ( $resp_body['error']['errors'] as $err ) {
469
- $hint = self::get_adsense_error_hint( $err['reason'] );
470
- if ( $hint ) {
471
- $error_message .= "<p class=\"description\">$hint</p>";
472
- }
473
- $error_message .= '<p class="description">' . __( 'Reason:', 'advanced-ads' ) . ' "' . $err['reason'] . '"<br>';
474
- $error_message .= __( 'Message:', 'advanced-ads' ) . ' "' . $err['message'] . '"</p>';
475
- }
 
 
 
 
476
  }
477
- return array(
478
- 'status' => false,
479
- 'msg' => $error_message,
480
- 'raw' => $response['body'],
 
 
481
  );
482
- } else {
483
- if ( empty( $resp_body['adUnits'] ) ) {
484
- return array(
485
- 'status' => false,
486
- 'msg' => sprintf(
487
- // translators: %1$s is the AdSense publisher ID; %2$s a starting a tag to the AdSense ad unit list and %3$s the closing link.
488
- esc_html__( 'The account "%1$s" does not seem to have any ad units. Please create some %2$shere%3$s.', 'advanced-ads' ),
489
- $account,
490
- '<a href="https://www.google.com/adsense/new/u/0/' . $account . '/main/myads-viewall-adunits?product=SELF_SERVICE_CONTENT_ADS" target="_blank">',
491
- '</a>'
492
- ),
493
- 'raw' => $response['body'],
494
- );
495
- } else {
496
- // There are more than 350 items in the account.
497
- if ( isset( $resp_body['nextPageToken'] ) ) {
498
- $page_token = $resp_body['nextPageToken'];
499
- $new_ad_units = array();
500
- foreach ( $resp_body['adUnits'] as $item ) {
501
- $item = self::convert_ad_unit_format( $item );
502
- $new_ad_units[ $item['id'] ] = $item;
503
- }
504
 
505
- // While there is a next page of results do . . .
506
- while ( $page_token ) {
507
- $access_token = self::get_access_token( $account );
 
 
 
508
 
509
- if ( isset( $access_token['msg'] ) ) {
510
- // return the original error info.
511
- return $access_token;
512
- }
513
 
514
- $next_url = $url . '&pageToken=' . urlencode( $page_token );
515
- $headers = array(
516
- 'Authorization' => 'Bearer ' . $access_token,
517
- );
518
- $response = wp_remote_get( $next_url, array( 'headers' => $headers ) );
519
- self::log( 'Get ad units list for ca-' . $account . ' page ' . $page );
520
- $page++;
521
-
522
- if ( is_wp_error( $response ) ) {
523
- // An error occurred. Abort.
524
- return array(
525
- 'status' => false,
526
- // translators: the publisher ID.
527
- 'msg' => sprintf( esc_html__( 'Error while retrieving adUnits list for "%s".', 'advanced-ads' ), $account ),
528
- 'raw' => $response->get_error_message(),
529
- );
530
- } else {
531
- $resp_body = json_decode( $response['body'], true );
532
- // Update page token if there are ad units left.
533
- $page_token = isset( $resp_body['nextPageToken'] ) ? $resp_body['nextPageToken'] : false;
534
- // Add items from this page into the final result.
535
- foreach ( $resp_body['adUnits'] as $item ) {
536
- $item = self::convert_ad_unit_format( $item );
537
- $new_ad_units[ $item['id'] ] = $item;
538
- }
539
- }
540
- }
541
 
542
- $options['accounts'][ $account ]['ad_units'] = $new_ad_units;
543
- update_option( self::OPTNAME, $options );
544
- return true;
545
- } else {
546
- // Results fit into a single page (of 350 items).
547
- $new_ad_units = array();
548
 
549
- foreach ( $resp_body['adUnits'] as $item ) {
550
- $item = self::convert_ad_unit_format( $item );
551
- $new_ad_units[ $item['id'] ] = $item;
552
- }
553
 
554
- $options['accounts'][ $account ]['ad_units'] = $new_ad_units;
555
- update_option( self::OPTNAME, $options );
556
- return true;
557
- }
558
- }
559
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
560
  }
561
  }
562
- // return the original error info
563
- return $access_token;
 
 
 
564
  }
565
 
566
  /**
567
- * Get the appropriate access token (default one or from user's Google app). Update it if needed.
568
  *
569
- * @return [str]|[array] the token on success, error info (as array) if an error occurred.
 
 
570
  */
571
  public static function get_access_token( $account ) {
572
  $options = self::get_option();
@@ -597,7 +592,7 @@ class Advanced_Ads_AdSense_MAPI {
597
  }
598
  }
599
  } else {
600
- // Account does not exists.
601
  if ( ! empty( $options['accounts'] ) ) {
602
  // There is another account connected.
603
  return array(
@@ -1030,7 +1025,7 @@ class Advanced_Ads_AdSense_MAPI {
1030
  $account = wp_strip_all_tags( stripslashes( $post_vars['account'] ) );
1031
  $units = self::get_ad_units( $account );
1032
 
1033
- if ( true === $units ) {
1034
  ob_start();
1035
  Advanced_Ads_AdSense_Admin::get_mapi_ad_selector();
1036
  $ad_selector = ob_get_clean();
@@ -1151,9 +1146,6 @@ class Advanced_Ads_AdSense_MAPI {
1151
  $accounts_list = json_decode( trim( $child_accounts['body'] ), true );
1152
  if ( trim( $child_accounts['body'] ) === '{}' ) {
1153
  // Standard AdSense account.
1154
- $options = self::get_option();
1155
- $options['connect_error'] = array();
1156
- update_option( self::OPTNAME, $options );
1157
  self::save_token_from_data( $token_data, $accounts['accounts'][0] );
1158
  wp_send_json_success( array(
1159
  'reload' => true,
@@ -1493,6 +1485,7 @@ class Advanced_Ads_AdSense_MAPI {
1493
  'id' => $adsense_id,
1494
  'name' => isset( $details['displayName'] ) ? $details['displayName'] : $details['name'],
1495
  );
 
1496
  update_option( self::OPTNAME, $options );
1497
 
1498
  $gadsense_data = Advanced_Ads_AdSense_Data::get_instance();
56
  add_action( 'wp_ajax_advads-mapi-revoke-token', array( $this, 'ajax_revoke_tokken' ) );
57
  add_action( 'wp_ajax_advads-mapi-get-alerts', array( $this, 'ajax_get_account_alerts' ) );
58
  add_action( 'wp_ajax_advads-mapi-dismiss-alert', array( $this, 'ajax_dismiss_alert' ) );
 
59
  add_action( 'wp_ajax_advads_adsense_report_refresh', array( 'Advanced_Ads_Overview_Widgets_Callbacks', 'ajax_gadsense_dashboard' ) );
60
 
61
  add_action( 'admin_footer', array( $this, 'admin_footer' ) );
170
  }
171
  }
172
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  /**
174
  * Get available quota and eventual message about remaining call
175
  */
418
  /**
419
  * Get/Update ad unit list for a given client
420
  *
421
+ * @param string $account publisher ID.
422
+ *
423
+ * @return array
424
  */
425
  public static function get_ad_units( $account ) {
426
  $url = 'https://adsense.googleapis.com/v2/accounts/' . $account . '/adclients/ca-' . $account . '/adunits?pageSize=350';
427
  $access_token = self::get_access_token( $account );
 
 
428
 
429
+ if ( isset( $access_token['msg'] ) ) {
430
+ // Return the token related message.
431
+ return $access_token;
432
+ }
433
+
434
+ $response = wp_remote_get( $url, array( 'headers' => array( 'Authorization' => 'Bearer ' . $access_token ) ) );
435
+ self::log( 'Get ad units list for ca-' . $account );
436
+
437
+ if ( is_wp_error( $response ) ) {
438
+ return array(
439
+ 'status' => false,
440
+ // translators: %s is the publisher ID.
441
+ 'msg' => sprintf( esc_html__( 'Error while retrieving ad unit list for "%s".', 'advanced-ads' ), $account ),
442
+ 'raw' => $response->get_error_message(),
443
  );
444
+ }
 
445
 
446
+ if ( trim( $response['body'] ) === '{}' ) {
447
+ // Empty account.
448
+ return array(
449
+ 'status' => false,
450
+ 'msg' => sprintf(
451
+ // translators: %1$s is the AdSense publisher ID; %2$s a starting a tag to the AdSense ad unit list and %3$s the closing link.
452
+ esc_html__( 'The account "%1$s" does not seem to have any ad units. Please create some %2$shere%3$s.', 'advanced-ads' ),
453
+ $account,
454
+ '<a href="https://www.google.com/adsense/new/u/0/' . $account . '/myads/units" target="_blank">',
455
+ '</a>'
456
+ ),
457
+ 'raw' => $response['body'],
458
+ );
459
+ }
460
+
461
+ $response_body = json_decode( trim( $response['body'] ), true );
462
+
463
+ if ( $response_body === null || ! isset( $response_body['adUnits'] ) ) {
464
+ // translators: %s is the publisher ID.
465
+ $error_message = sprintf( esc_html__( 'Invalid response while retrieving ad unit list for "%s".', 'advanced-ads' ), $account );
466
+ // check the response for errors and display them for better problem-solving.
467
+ if ( ! empty( $response_body['error']['errors'] ) ) {
468
+ foreach ( $response_body['error']['errors'] as $err ) {
469
+ $hint = self::get_adsense_error_hint( $err['reason'] );
470
+ if ( $hint ) {
471
+ $error_message .= '<p class="description">' . $hint . '</p>';
472
  }
473
+ $error_message .= sprintf(
474
+ '<p class="description">%1$s %2$s<br>%3$s %4$s</p>',
475
+ _x( 'Reason:', 'Reason of the API call error', 'advanced-ads' ),
476
+ $err['reason'],
477
+ _x( 'Message:', 'Error message from Google', 'advanced-ads' ),
478
+ $err['message']
479
  );
480
+ }
481
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
482
 
483
+ return array(
484
+ 'status' => false,
485
+ 'msg' => $error_message,
486
+ 'raw' => trim( $response['body'] ),
487
+ );
488
+ }
489
 
490
+ $options = self::get_option();
 
 
 
491
 
492
+ if ( ! isset( $response_body['nextPageToken'] ) ) {
493
+ // Results fit into a single page (of 350 items).
494
+ $new_ad_units = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
495
 
496
+ foreach ( $response_body['adUnits'] as $item ) {
497
+ $item = self::convert_ad_unit_format( $item );
498
+ $new_ad_units[ $item['id'] ] = $item;
499
+ }
 
 
500
 
501
+ $options['accounts'][ $account ]['ad_units'] = $new_ad_units;
502
+ update_option( self::OPTNAME, $options );
 
 
503
 
504
+ return array( 'done' => true );
505
+ }
506
+
507
+ // There are more than 350 items in the account.
508
+ $page_token = $response_body['nextPageToken'];
509
+ $new_ad_units = array();
510
+
511
+ foreach ( $response_body['adUnits'] as $item ) {
512
+ $item = self::convert_ad_unit_format( $item );
513
+ $new_ad_units[ $item['id'] ] = $item;
514
+ }
515
+
516
+ $page = 1;
517
+ // While there is a next page of results do . . .
518
+ while ( $page_token ) {
519
+ $access_token = self::get_access_token( $account );
520
+
521
+ if ( isset( $access_token['msg'] ) ) {
522
+ // return the original error info.
523
+ return $access_token;
524
+ }
525
+
526
+ $next_url = $url . '&pageToken=' . urlencode( $page_token );
527
+ $headers = array(
528
+ 'Authorization' => 'Bearer ' . $access_token,
529
+ );
530
+ $response = wp_remote_get( $next_url, array( 'headers' => $headers ) );
531
+ self::log( 'Get ad unit list for ca-' . $account . ' page ' . $page );
532
+ $page++;
533
+
534
+ if ( is_wp_error( $response ) ) {
535
+ return array(
536
+ 'status' => false,
537
+ // translators: the publisher ID.
538
+ 'msg' => sprintf( esc_html__( 'Error while retrieving ad unit list for "%s".', 'advanced-ads' ), $account ),
539
+ 'raw' => $response->get_error_message(),
540
+ );
541
+ }
542
+
543
+ $response_body = json_decode( $response['body'], true );
544
+ // Update page token if there are ad units left.
545
+ $page_token = isset( $response_body['nextPageToken'] ) ? $response_body['nextPageToken'] : false;
546
+ // Add items from this page into the final result.
547
+ foreach ( $response_body['adUnits'] as $item ) {
548
+ $item = self::convert_ad_unit_format( $item );
549
+ $new_ad_units[ $item['id'] ] = $item;
550
  }
551
  }
552
+
553
+ $options['accounts'][ $account ]['ad_units'] = $new_ad_units;
554
+ update_option( self::OPTNAME, $options );
555
+
556
+ return array( 'done' => true );
557
  }
558
 
559
  /**
560
+ * Get the appropriate access token (default one or from user's Google app). Update it if needed.
561
  *
562
+ * @param string $account publisher ID.
563
+ *
564
+ * @return array|string the access token on success, error info (as array) if an error occurred.
565
  */
566
  public static function get_access_token( $account ) {
567
  $options = self::get_option();
592
  }
593
  }
594
  } else {
595
+ // Account does not exist.
596
  if ( ! empty( $options['accounts'] ) ) {
597
  // There is another account connected.
598
  return array(
1025
  $account = wp_strip_all_tags( stripslashes( $post_vars['account'] ) );
1026
  $units = self::get_ad_units( $account );
1027
 
1028
+ if ( isset( $units['done'] ) && $units['done'] === true ) {
1029
  ob_start();
1030
  Advanced_Ads_AdSense_Admin::get_mapi_ad_selector();
1031
  $ad_selector = ob_get_clean();
1146
  $accounts_list = json_decode( trim( $child_accounts['body'] ), true );
1147
  if ( trim( $child_accounts['body'] ) === '{}' ) {
1148
  // Standard AdSense account.
 
 
 
1149
  self::save_token_from_data( $token_data, $accounts['accounts'][0] );
1150
  wp_send_json_success( array(
1151
  'reload' => true,
1485
  'id' => $adsense_id,
1486
  'name' => isset( $details['displayName'] ) ? $details['displayName'] : $details['name'],
1487
  );
1488
+ $options['connect_error'] = array();
1489
  update_option( self::OPTNAME, $options );
1490
 
1491
  $gadsense_data = Advanced_Ads_AdSense_Data::get_instance();
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: webzunft, advancedads
3
  Tags: ads, adsense, amp, ads.txt, ad rotations, ad blocker, amazon, banner, click fraud protection, google ad manager, header code, lazy loading,
4
  Requires at least: 4.9
5
  Tested up to: 6.0
6
- Requires PHP: 5.6
7
- Stable tag: 1.36.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -337,29 +337,22 @@ Yes. You can use plenty of [hooks](https://wpadvancedads.com/codex/) to customiz
337
 
338
  == Changelog ==
339
 
340
- = 1.36.3 (September 30, 2022) =
341
-
342
- - Fix: getting values for container ID and class
343
-
344
- = 1.36.2 (September 29, 2022) =
345
-
346
- - Fix: ensure well formed positioning array
347
-
348
- = 1.36.1 (September 29, 2022) =
349
-
350
- - Fix: centering for dummy and image ads
351
- - Fix: positioning migration if ads are centered
352
- - Fix: remove additional clearfix `br` if ad is centered
353
-
354
- = 1.36.0 (September 27, 2022) =
355
-
356
- - Feature: add a Usage box to the ad edit screen with notes, shortcode and PHP function information
357
- - Improvement: move the 'create a placement' form into a modal
358
- - Improvement: reset certain features with URL parameters
359
- - Improvement: sanitize the positioning options and make the margin inputs more user-friendly
360
- - Improvement: show helpful hints about displaying ad groups using cache busting
361
- - Improvement: unify the layout of outgoing links that lead to the Advanced Ads manual or another external source
362
- - Fix: clear ad sizes when an AdSense ad is to be responsive
363
- - Fix: correct order of placements on the Placement page
364
- - Fix: ensure admins can edit an ad, even if the original author can't anymore
365
- - Fix: hook into the current `WP_Query` instead of setting `$_GET` parameters to order the ad list
3
  Tags: ads, adsense, amp, ads.txt, ad rotations, ad blocker, amazon, banner, click fraud protection, google ad manager, header code, lazy loading,
4
  Requires at least: 4.9
5
  Tested up to: 6.0
6
+ Requires PHP: 7.2
7
+ Stable tag: 1.37.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
337
 
338
  == Changelog ==
339
 
340
+ = 1.37.0 (October 11, 2022) =
341
+
342
+ - Feature: bump minimum required PHP version to 7.2
343
+ - Improvement: cleanup of the header items on list pages in the admin and unified layout elements
344
+ - Improvement: show filters and search options on the ad, group, and placement list pages with the new Filters button in the page header
345
+ - Improvement: show filters on the ad overview list permanently using the new Show Filters Permanently screen option
346
+ - Improvement: unify the links and buttons in the header of admin pages related to Advanced Ads
347
+ - Improvement: show the bulk options only when items in the ad list are selected
348
+ - Improvement: hide the following columns on the ad list view by default: notes, size, author
349
+ - Improvement: remove the background color for some ad status, like draft
350
+ - Improvement: add a new "Type" column to the beginning of the ad list with a tooltip with more details
351
+ - Improvement: add a new "Size" column for the ad size only
352
+ - Improvement: add a "Notes" column for the ad description
353
+ - Improvement: rename the "Title" Column into "Name"
354
+ - Improvement: rename the Ad Details column into "Preview", showing only image ad previews
355
+ - Improvement: search ad by post ID on the ad overview page
356
+ - Fix: "All" view on the ad list not highlighted
357
+ - Fix: show proper message for empty AdSense account
358
+ - Fix: prevent undefined index notice on Ad Blocker setting in multisite