Version Description
(12th June 2020) = * New: MGID Integration #167 * New: Added new Position to display Ad After word count #23 * New: Added new Position to show Ad After 20,40,60,80 percent of content #175 * New: Made Ads.txt modifiable #162 * New: Ads not loading specific "page template" of Page attribute #53 * New: Ampforwp & advances amp ads importer #163 * Fix: Published going to auto Draft #169 * Fix: Settings are opened, but the page is not selected #157 * Fix: CSS shows in the head of the website in AMP after update #165 * Fix: Responsive option not working #114 * Fix: positioning bug Ad was displaying when two visibility options are selected #166 * Fix: LazyLoad does not work in custom code having an Adsense code #170 * Fix: Undefined variable Warning #177
Release Info
Developer | wpquads |
Plugin | AdSense Plugin WP QUADS |
Version | 2.0.8 |
Comparing to | |
See all releases |
Code changes from version 2.0.7 to 2.0.8
- admin/assets/js/dist/adminscript.js +240 -28
- admin/assets/js/dist/style.css +8 -0
- admin/assets/js/src/components/ads/ad-create-router/QuadsAdCreateRouter.jsx +29 -11
- admin/assets/js/src/components/ads/ad-list/QuadsAdList.jsx +4 -1
- admin/assets/js/src/components/ads/ad-type-selector-nav/AdTypeSelectorNavLink.jsx +5 -1
- admin/assets/js/src/components/ads/config-fields/QuadsAdConfigFields.jsx +57 -2
- admin/assets/js/src/components/ads/nav/QuadsAdListNavLink.jsx +8 -2
- admin/assets/js/src/components/common/advance-position/QuadsAdvancePosition.jsx +22 -1
- admin/assets/js/src/components/common/advance-position/QuadsAdvancePosition.scss +3 -0
- admin/assets/js/src/components/common/layout/QuadsLayout.jsx +9 -8
- admin/assets/js/src/components/common/visibility/QuadsVisibility.jsx +2 -1
- admin/assets/js/src/components/settings/QuadsAdListSettings.jsx +49 -10
- admin/assets/js/src/components/settings/QuadsAdListSettings.scss +5 -0
- admin/assets/js/src/components/settings/QuadsAdSettingsNavLink.jsx +1 -0
- admin/assets/js/src/images/mgid.png +0 -0
- admin/assets/js/src/images/mgid_icon.png +0 -0
- admin/includes/rest-api-service.php +14 -4
- admin/includes/rest-api.php +560 -0
- includes/conditions.php +8 -1
- includes/render-ad-functions.php +191 -10
- includes/scripts.php +15 -1
- includes/template-functions.php +62 -6
- package.json +1 -1
- quick-adsense-reloaded.php +2 -2
- readme.txt +16 -1
@@ -10224,10 +10224,17 @@ var QuadsAdCreateRouter = /*#__PURE__*/function (_Component) {
|
|
10224 |
_defineProperty(_assertThisInitialized(_this), "publish", function (event) {
|
10225 |
event.preventDefault();
|
10226 |
var quads_post_meta = _this.state.quads_post_meta;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10227 |
|
10228 |
switch (quads_post_meta.ad_type) {
|
10229 |
case 'plain_text':
|
10230 |
-
if (quads_post_meta.code && quads_post_meta.position && quads_post_meta.visibility_include.length > 0) {
|
10231 |
_this.saveAdFormData('publish');
|
10232 |
} else {
|
10233 |
_this.setState({
|
@@ -10238,7 +10245,7 @@ var QuadsAdCreateRouter = /*#__PURE__*/function (_Component) {
|
|
10238 |
break;
|
10239 |
|
10240 |
case 'adsense':
|
10241 |
-
if (quads_post_meta.g_data_ad_slot && quads_post_meta.g_data_ad_client && quads_post_meta.position && quads_post_meta.visibility_include.length > 0) {
|
10242 |
_this.saveAdFormData('publish');
|
10243 |
} else {
|
10244 |
_this.setState({
|
@@ -10249,7 +10256,7 @@ var QuadsAdCreateRouter = /*#__PURE__*/function (_Component) {
|
|
10249 |
break;
|
10250 |
|
10251 |
case 'random_ads':
|
10252 |
-
if (quads_post_meta.random_ads_list.length > 0 && quads_post_meta.position && quads_post_meta.visibility_include.length > 0) {
|
10253 |
_this.saveAdFormData('publish');
|
10254 |
} else {
|
10255 |
_this.setState({
|
@@ -10260,7 +10267,7 @@ var QuadsAdCreateRouter = /*#__PURE__*/function (_Component) {
|
|
10260 |
break;
|
10261 |
|
10262 |
case 'double_click':
|
10263 |
-
if (quads_post_meta.ad_unit_name && quads_post_meta.network_code && quads_post_meta.position && quads_post_meta.visibility_include.length > 0) {
|
10264 |
_this.saveAdFormData('publish');
|
10265 |
} else {
|
10266 |
_this.setState({
|
@@ -10271,7 +10278,18 @@ var QuadsAdCreateRouter = /*#__PURE__*/function (_Component) {
|
|
10271 |
break;
|
10272 |
|
10273 |
case 'yandex':
|
10274 |
-
if (quads_post_meta.block_id && quads_post_meta.position && quads_post_meta.visibility_include.length > 0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10275 |
_this.saveAdFormData('publish');
|
10276 |
} else {
|
10277 |
_this.setState({
|
@@ -10307,11 +10325,9 @@ var QuadsAdCreateRouter = /*#__PURE__*/function (_Component) {
|
|
10307 |
var new_url = _this.props.location.pathname + '?page=quads-settings';
|
10308 |
|
10309 |
if (_this.state.quads_state_changed && !_this.state.quads_is_saved) {
|
10310 |
-
var r = confirm("
|
10311 |
|
10312 |
if (r == true) {
|
10313 |
-
_this.saveAdFormData(_this.state.quads_ad_status);
|
10314 |
-
|
10315 |
_this.props.history.push(new_url);
|
10316 |
} else {
|
10317 |
return false;
|
@@ -10387,6 +10403,17 @@ var QuadsAdCreateRouter = /*#__PURE__*/function (_Component) {
|
|
10387 |
|
10388 |
break;
|
10389 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10390 |
default:
|
10391 |
break;
|
10392 |
}
|
@@ -10472,9 +10499,11 @@ var QuadsAdCreateRouter = /*#__PURE__*/function (_Component) {
|
|
10472 |
margin: 0,
|
10473 |
position: 'beginning_of_post',
|
10474 |
paragraph_number: 1,
|
|
|
10475 |
image_number: 1,
|
10476 |
enabled_on_amp: false,
|
10477 |
enable_on_end_of_post: false,
|
|
|
10478 |
image_caption: false,
|
10479 |
include_dropdown: false,
|
10480 |
exclude_dropdown: false,
|
@@ -55767,6 +55796,7 @@ var QuadsAdConfigFields = /*#__PURE__*/function (_Component) {
|
|
55767 |
}, /*#__PURE__*/_react["default"].createElement("table", null, /*#__PURE__*/_react["default"].createElement("tbody", null, /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("label", null, __('Data Client ID', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("input", {
|
55768 |
className: show_form_error && post_meta.g_data_ad_client == '' ? 'quads_form_error' : '',
|
55769 |
value: post_meta.g_data_ad_client,
|
|
|
55770 |
onChange: this.props.adFormChangeHandler,
|
55771 |
type: "text",
|
55772 |
id: "g_data_ad_client",
|
@@ -55781,7 +55811,8 @@ var QuadsAdConfigFields = /*#__PURE__*/function (_Component) {
|
|
55781 |
onChange: this.props.adFormChangeHandler,
|
55782 |
type: "text",
|
55783 |
id: "g_data_ad_slot",
|
55784 |
-
name: "g_data_ad_slot"
|
|
|
55785 |
}), show_form_error && post_meta.g_data_ad_slot == '' ? /*#__PURE__*/_react["default"].createElement("div", {
|
55786 |
className: "quads_form_msg"
|
55787 |
}, /*#__PURE__*/_react["default"].createElement("span", {
|
@@ -55954,6 +55985,88 @@ var QuadsAdConfigFields = /*#__PURE__*/function (_Component) {
|
|
55954 |
}, "error_outline"), "Enter Block Id") : ''))))));
|
55955 |
break;
|
55956 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55957 |
default:
|
55958 |
comp_html.push( /*#__PURE__*/_react["default"].createElement("div", {
|
55959 |
key: "noads"
|
@@ -60986,7 +61099,14 @@ var QuadsLayout = /*#__PURE__*/function (_Component) {
|
|
60986 |
name: "ad_label_check",
|
60987 |
onChange: this.props.adFormChangeHandler,
|
60988 |
type: "checkbox"
|
60989 |
-
}))), post_meta.ad_label_check ? /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("label", null, __('Ad Label
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60990 |
name: "adlabel",
|
60991 |
value: post_meta.adlabel,
|
60992 |
onChange: this.props.adFormChangeHandler
|
@@ -60994,14 +61114,7 @@ var QuadsLayout = /*#__PURE__*/function (_Component) {
|
|
60994 |
value: "above"
|
60995 |
}, __('Above Ad', 'quick-adsense-reloaded')), /*#__PURE__*/_react["default"].createElement("option", {
|
60996 |
value: "below"
|
60997 |
-
}, __('Below Ad', 'quick-adsense-reloaded'))))) : null
|
60998 |
-
onChange: this.props.adFormChangeHandler,
|
60999 |
-
type: "text",
|
61000 |
-
className: "small-text",
|
61001 |
-
id: "ad_label_text",
|
61002 |
-
name: "ad_label_text",
|
61003 |
-
value: post_meta.ad_label_text
|
61004 |
-
}))) : null)))));
|
61005 |
}
|
61006 |
}]);
|
61007 |
|
@@ -62975,6 +63088,9 @@ var QuadsVisibility = /*#__PURE__*/function (_Component) {
|
|
62975 |
}, {
|
62976 |
label: 'Tags',
|
62977 |
value: 'tags'
|
|
|
|
|
|
|
62978 |
}]
|
62979 |
};
|
62980 |
return _this;
|
@@ -63202,6 +63318,10 @@ var QuadsAdvancePosition = /*#__PURE__*/function (_Component) {
|
|
63202 |
}, __('After Paragraph', 'quick-adsense-reloaded')), /*#__PURE__*/_react["default"].createElement("option", {
|
63203 |
value: "after_image"
|
63204 |
}, __('After Image', 'quick-adsense-reloaded')), /*#__PURE__*/_react["default"].createElement("option", {
|
|
|
|
|
|
|
|
|
63205 |
value: "ad_shortcode"
|
63206 |
}, __('Shortcode (Manual)', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("optgroup", {
|
63207 |
label: "Partial Support ( AMP Only )"
|
@@ -63247,6 +63367,10 @@ var QuadsAdvancePosition = /*#__PURE__*/function (_Component) {
|
|
63247 |
}, __('After Paragraph', 'quick-adsense-reloaded')), /*#__PURE__*/_react["default"].createElement("option", {
|
63248 |
value: "after_image"
|
63249 |
}, __('After Image', 'quick-adsense-reloaded')), /*#__PURE__*/_react["default"].createElement("option", {
|
|
|
|
|
|
|
|
|
63250 |
value: "ad_shortcode"
|
63251 |
}, __('Shortcode (Manual)', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("div", null, show_form_error && post_meta.position == '' ? /*#__PURE__*/_react["default"].createElement("span", {
|
63252 |
className: "quads-error"
|
@@ -63291,7 +63415,23 @@ var QuadsAdvancePosition = /*#__PURE__*/function (_Component) {
|
|
63291 |
type: "checkbox"
|
63292 |
}), /*#__PURE__*/_react["default"].createElement("label", {
|
63293 |
"for": "repeat_paragraph"
|
63294 |
-
}, " ", __('Display After Every ', 'quick-adsense-reloaded'), post_meta.paragraph_number))) : '', post_meta.position == '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63295 |
checked: post_meta.image_caption,
|
63296 |
name: "image_caption",
|
63297 |
onChange: this.props.adFormChangeHandler,
|
@@ -63729,6 +63869,35 @@ var QuadsAdListSettings = /*#__PURE__*/function (_Component) {
|
|
63729 |
});
|
63730 |
});
|
63731 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63732 |
_defineProperty(_assertThisInitialized(_this), "open_global_excluder", function () {
|
63733 |
_this.setState({
|
63734 |
global_excluder_modal: true
|
@@ -63895,7 +64064,8 @@ var QuadsAdListSettings = /*#__PURE__*/function (_Component) {
|
|
63895 |
|
63896 |
_defineProperty(_assertThisInitialized(_this), "closeQuerySuccess", function (e) {
|
63897 |
_this.setState({
|
63898 |
-
customer_querey_success: ''
|
|
|
63899 |
});
|
63900 |
});
|
63901 |
|
@@ -64355,7 +64525,9 @@ var QuadsAdListSettings = /*#__PURE__*/function (_Component) {
|
|
64355 |
multiTagsValue: [],
|
64356 |
multiPluginsValue: []
|
64357 |
},
|
64358 |
-
quads_wp_quads_pro_license_key: ''
|
|
|
|
|
64359 |
};
|
64360 |
return _this;
|
64361 |
}
|
@@ -64525,7 +64697,10 @@ var QuadsAdListSettings = /*#__PURE__*/function (_Component) {
|
|
64525 |
checked: settings.adsTxtEnabled
|
64526 |
}), /*#__PURE__*/_react["default"].createElement("span", {
|
64527 |
className: "quads-slider"
|
64528 |
-
}))
|
|
|
|
|
|
|
64529 |
htmlFor: "global_excluder_enabled"
|
64530 |
}, __('Global Excluder', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("label", {
|
64531 |
className: "quads-switch"
|
@@ -64619,11 +64794,26 @@ var QuadsAdListSettings = /*#__PURE__*/function (_Component) {
|
|
64619 |
}, __('Copy System Info', 'quick-adsense-reloaded')), /*#__PURE__*/_react["default"].createElement("div", null, _this2.state.copied ? /*#__PURE__*/_react["default"].createElement("span", null, __('System info copied to clipboard', 'quick-adsense-reloaded')) : null))), /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("th", null, /*#__PURE__*/_react["default"].createElement("label", null, __('Export', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("a", {
|
64620 |
href: "".concat(quads_localize_data.rest_url, "quads-route/export-settings"),
|
64621 |
className: "quads-btn quads-btn-primary"
|
64622 |
-
}, "Export"), /*#__PURE__*/_react["default"].createElement("p", null, __('Export the Quick AdSense Reloaded settings for this site as a .json file. This allows you to easily import the configuration into another site.', 'quick-adsense-reloaded'))))
|
64623 |
-
|
64624 |
-
|
64625 |
-
|
64626 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64627 |
|
64628 |
case "settings_google_autoads":
|
64629 |
return /*#__PURE__*/_react["default"].createElement("div", {
|
@@ -103444,6 +103634,9 @@ var QuadsAdSettingsNavLink = /*#__PURE__*/function (_Component) {
|
|
103444 |
to: 'admin.php?page=quads-settings&path=settings_tools',
|
103445 |
className: current == 'settings_tools' ? 'quads-nav-link quads-nav-link-active' : 'quads-nav-link'
|
103446 |
}, __('Tools', 'quick-adsense-reloaded')))), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("h2", null, /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Link, {
|
|
|
|
|
|
|
103447 |
to: 'admin.php?page=quads-settings&path=settings_legacy',
|
103448 |
className: current == 'settings_legacy' ? 'quads-nav-link quads-nav-link-active' : 'quads-nav-link'
|
103449 |
}, __('Legacy', 'quick-adsense-reloaded')))), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("h2", null, /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Link, {
|
@@ -104149,6 +104342,11 @@ var QuadsAdList = /*#__PURE__*/function (_Component) {
|
|
104149 |
type = "Yandex";
|
104150 |
break;
|
104151 |
|
|
|
|
|
|
|
|
|
|
|
104152 |
default:
|
104153 |
break;
|
104154 |
}
|
@@ -104493,7 +104691,14 @@ var QuadsAdListNavLink = /*#__PURE__*/function (_Component) {
|
|
104493 |
var current = 'ads';
|
104494 |
|
104495 |
if (typeof page.path != 'undefined') {
|
104496 |
-
if (page.path == 'settings' || page.path == 'settings_tools' || page.path == 'settings_legacy' || page.path == 'settings_support' || page.path == 'settings_licenses' || page.path == 'settings_google_autoads')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104497 |
}
|
104498 |
|
104499 |
return /*#__PURE__*/_react["default"].createElement("div", {
|
@@ -104619,6 +104824,10 @@ var AdTypeSelectorNavLink = /*#__PURE__*/function (_Component) {
|
|
104619 |
img_url = quads_localize_data.quads_plugin_url + 'admin/assets/js/src/images/yandex.png';
|
104620 |
break;
|
104621 |
|
|
|
|
|
|
|
|
|
104622 |
default:
|
104623 |
break;
|
104624 |
}
|
@@ -104648,6 +104857,9 @@ var AdTypeSelectorNavLink = /*#__PURE__*/function (_Component) {
|
|
104648 |
}, {
|
104649 |
ad_type: 'yandex',
|
104650 |
ad_type_name: 'Yandex'
|
|
|
|
|
|
|
104651 |
}, {
|
104652 |
ad_type: 'plain_text',
|
104653 |
ad_type_name: 'Plain Text / HTML / JS'
|
10224 |
_defineProperty(_assertThisInitialized(_this), "publish", function (event) {
|
10225 |
event.preventDefault();
|
10226 |
var quads_post_meta = _this.state.quads_post_meta;
|
10227 |
+
var validation_flag = true;
|
10228 |
+
|
10229 |
+
if (quads_post_meta.position == 'after_the_percentage') {
|
10230 |
+
if (quads_post_meta.after_the_percentage_value == '' || parseInt(quads_post_meta.after_the_percentage_value) < 10 || parseInt(quads_post_meta.after_the_percentage_value) > 101) {
|
10231 |
+
validation_flag = false;
|
10232 |
+
}
|
10233 |
+
}
|
10234 |
|
10235 |
switch (quads_post_meta.ad_type) {
|
10236 |
case 'plain_text':
|
10237 |
+
if (validation_flag && quads_post_meta.code && quads_post_meta.position && quads_post_meta.visibility_include.length > 0) {
|
10238 |
_this.saveAdFormData('publish');
|
10239 |
} else {
|
10240 |
_this.setState({
|
10245 |
break;
|
10246 |
|
10247 |
case 'adsense':
|
10248 |
+
if (validation_flag && quads_post_meta.g_data_ad_slot && quads_post_meta.g_data_ad_client && quads_post_meta.position && quads_post_meta.visibility_include.length > 0) {
|
10249 |
_this.saveAdFormData('publish');
|
10250 |
} else {
|
10251 |
_this.setState({
|
10256 |
break;
|
10257 |
|
10258 |
case 'random_ads':
|
10259 |
+
if (validation_flag && quads_post_meta.random_ads_list.length > 0 && quads_post_meta.position && quads_post_meta.visibility_include.length > 0) {
|
10260 |
_this.saveAdFormData('publish');
|
10261 |
} else {
|
10262 |
_this.setState({
|
10267 |
break;
|
10268 |
|
10269 |
case 'double_click':
|
10270 |
+
if (validation_flag && quads_post_meta.ad_unit_name && quads_post_meta.network_code && quads_post_meta.position && quads_post_meta.visibility_include.length > 0) {
|
10271 |
_this.saveAdFormData('publish');
|
10272 |
} else {
|
10273 |
_this.setState({
|
10278 |
break;
|
10279 |
|
10280 |
case 'yandex':
|
10281 |
+
if (validation_flag && quads_post_meta.block_id && quads_post_meta.position && quads_post_meta.visibility_include.length > 0) {
|
10282 |
+
_this.saveAdFormData('publish');
|
10283 |
+
} else {
|
10284 |
+
_this.setState({
|
10285 |
+
show_form_error: true
|
10286 |
+
});
|
10287 |
+
}
|
10288 |
+
|
10289 |
+
break;
|
10290 |
+
|
10291 |
+
case 'mgid':
|
10292 |
+
if (validation_flag && quads_post_meta.data_publisher && quads_post_meta.data_widget && quads_post_meta.data_container && quads_post_meta.position && quads_post_meta.visibility_include.length > 0) {
|
10293 |
_this.saveAdFormData('publish');
|
10294 |
} else {
|
10295 |
_this.setState({
|
10325 |
var new_url = _this.props.location.pathname + '?page=quads-settings';
|
10326 |
|
10327 |
if (_this.state.quads_state_changed && !_this.state.quads_is_saved) {
|
10328 |
+
var r = confirm("Changes you made may not be saved.");
|
10329 |
|
10330 |
if (r == true) {
|
|
|
|
|
10331 |
_this.props.history.push(new_url);
|
10332 |
} else {
|
10333 |
return false;
|
10403 |
|
10404 |
break;
|
10405 |
|
10406 |
+
case 'mgid':
|
10407 |
+
if (quads_post_meta.data_publisher && quads_post_meta.data_widget && quads_post_meta.data_container) {
|
10408 |
+
_this.props.history.push(new_url);
|
10409 |
+
} else {
|
10410 |
+
_this.setState({
|
10411 |
+
show_form_error: true
|
10412 |
+
});
|
10413 |
+
}
|
10414 |
+
|
10415 |
+
break;
|
10416 |
+
|
10417 |
default:
|
10418 |
break;
|
10419 |
}
|
10499 |
margin: 0,
|
10500 |
position: 'beginning_of_post',
|
10501 |
paragraph_number: 1,
|
10502 |
+
word_count_number: 100,
|
10503 |
image_number: 1,
|
10504 |
enabled_on_amp: false,
|
10505 |
enable_on_end_of_post: false,
|
10506 |
+
after_the_percentage_value: 50,
|
10507 |
image_caption: false,
|
10508 |
include_dropdown: false,
|
10509 |
exclude_dropdown: false,
|
55796 |
}, /*#__PURE__*/_react["default"].createElement("table", null, /*#__PURE__*/_react["default"].createElement("tbody", null, /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("label", null, __('Data Client ID', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("input", {
|
55797 |
className: show_form_error && post_meta.g_data_ad_client == '' ? 'quads_form_error' : '',
|
55798 |
value: post_meta.g_data_ad_client,
|
55799 |
+
placeholder: "ca-pub-2005XXXXXXXXX342",
|
55800 |
onChange: this.props.adFormChangeHandler,
|
55801 |
type: "text",
|
55802 |
id: "g_data_ad_client",
|
55811 |
onChange: this.props.adFormChangeHandler,
|
55812 |
type: "text",
|
55813 |
id: "g_data_ad_slot",
|
55814 |
+
name: "g_data_ad_slot",
|
55815 |
+
placeholder: "70XXXXXX12"
|
55816 |
}), show_form_error && post_meta.g_data_ad_slot == '' ? /*#__PURE__*/_react["default"].createElement("div", {
|
55817 |
className: "quads_form_msg"
|
55818 |
}, /*#__PURE__*/_react["default"].createElement("span", {
|
55985 |
}, "error_outline"), "Enter Block Id") : ''))))));
|
55986 |
break;
|
55987 |
|
55988 |
+
case 'mgid':
|
55989 |
+
ad_type_name = 'MGID';
|
55990 |
+
comp_html.push( /*#__PURE__*/_react["default"].createElement("div", {
|
55991 |
+
key: "mgid"
|
55992 |
+
}, /*#__PURE__*/_react["default"].createElement("table", null, /*#__PURE__*/_react["default"].createElement("tbody", null, /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("label", null, __('Data Publisher', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("input", {
|
55993 |
+
className: show_form_error && post_meta.data_publisher == '' ? 'quads_form_error' : '',
|
55994 |
+
value: post_meta.data_publisher,
|
55995 |
+
onChange: this.props.adFormChangeHandler,
|
55996 |
+
type: "text",
|
55997 |
+
id: "data_publisher",
|
55998 |
+
name: "data_publisher",
|
55999 |
+
placeholder: "site.com"
|
56000 |
+
}), show_form_error && post_meta.data_publisher == '' ? /*#__PURE__*/_react["default"].createElement("div", {
|
56001 |
+
className: "quads_form_msg"
|
56002 |
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
56003 |
+
className: "material-icons"
|
56004 |
+
}, "error_outline"), "Data Publisher") : '')), /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("label", null, __('Data Widget', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("input", {
|
56005 |
+
className: show_form_error && post_meta.data_widget == '' ? 'quads_form_error' : '',
|
56006 |
+
value: post_meta.data_widget,
|
56007 |
+
onChange: this.props.adFormChangeHandler,
|
56008 |
+
type: "text",
|
56009 |
+
id: "data_widget",
|
56010 |
+
name: "data_widget",
|
56011 |
+
placeholder: "123456"
|
56012 |
+
}), show_form_error && post_meta.data_widget == '' ? /*#__PURE__*/_react["default"].createElement("div", {
|
56013 |
+
className: "quads_form_msg"
|
56014 |
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
56015 |
+
className: "material-icons"
|
56016 |
+
}, "error_outline"), "Enter Data Widget") : '')), /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("label", null, __('Data Container', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("input", {
|
56017 |
+
className: show_form_error && post_meta.data_container == '' ? 'quads_form_error' : '',
|
56018 |
+
value: post_meta.data_container,
|
56019 |
+
onChange: this.props.adFormChangeHandler,
|
56020 |
+
type: "text",
|
56021 |
+
id: "data_container",
|
56022 |
+
name: "data_container",
|
56023 |
+
placeholder: "M87ScriptRootC123645"
|
56024 |
+
}), show_form_error && post_meta.data_container == '' ? /*#__PURE__*/_react["default"].createElement("div", {
|
56025 |
+
className: "quads_form_msg"
|
56026 |
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
56027 |
+
className: "material-icons"
|
56028 |
+
}, "error_outline"), "Enter Data Container") : '')), /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("label", null, __('Data Js Src', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("input", {
|
56029 |
+
className: show_form_error && post_meta.data_js_src == '' ? 'quads_form_error' : '',
|
56030 |
+
value: post_meta.data_js_src,
|
56031 |
+
onChange: this.props.adFormChangeHandler,
|
56032 |
+
type: "text",
|
56033 |
+
id: "data_js_src",
|
56034 |
+
name: "data_js_src",
|
56035 |
+
placeholder: "//jsc.mgid.com/a/m/quads.com.123645.js"
|
56036 |
+
}), show_form_error && post_meta.data_js_src == '' ? /*#__PURE__*/_react["default"].createElement("div", {
|
56037 |
+
className: "quads_form_msg"
|
56038 |
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
56039 |
+
className: "material-icons"
|
56040 |
+
}, "error_outline"), "Enter Data Js Src") : '')), /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("label", null, __('Size', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("select", {
|
56041 |
+
value: post_meta.adsense_type,
|
56042 |
+
onChange: this.props.adFormChangeHandler,
|
56043 |
+
name: "adsense_type",
|
56044 |
+
id: "adsense_type"
|
56045 |
+
}, /*#__PURE__*/_react["default"].createElement("option", {
|
56046 |
+
value: "normal"
|
56047 |
+
}, __('Fixed Size', 'quick-adsense-reloaded')), /*#__PURE__*/_react["default"].createElement("option", {
|
56048 |
+
value: "responsive"
|
56049 |
+
}, __('Responsive', 'quick-adsense-reloaded'))), post_meta.adsense_type !== 'responsive' ? /*#__PURE__*/_react["default"].createElement("div", {
|
56050 |
+
className: "quads-adsense-width-heigth"
|
56051 |
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
56052 |
+
className: "quads-adsense-width"
|
56053 |
+
}, /*#__PURE__*/_react["default"].createElement("label", null, __('Width', 'quick-adsense-reloaded'), /*#__PURE__*/_react["default"].createElement("input", {
|
56054 |
+
value: post_meta.g_data_ad_width ? post_meta.g_data_ad_width : '300',
|
56055 |
+
onChange: this.props.adFormChangeHandler,
|
56056 |
+
type: "number",
|
56057 |
+
id: "g_data_ad_width",
|
56058 |
+
name: "g_data_ad_width"
|
56059 |
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
56060 |
+
className: "quads-adsense-height"
|
56061 |
+
}, /*#__PURE__*/_react["default"].createElement("label", null, __('Height', 'quick-adsense-reloaded'), /*#__PURE__*/_react["default"].createElement("input", {
|
56062 |
+
value: post_meta.g_data_ad_height ? post_meta.g_data_ad_height : '250',
|
56063 |
+
onChange: this.props.adFormChangeHandler,
|
56064 |
+
type: "number",
|
56065 |
+
id: "g_data_ad_height",
|
56066 |
+
name: "g_data_ad_height"
|
56067 |
+
})))) : '')))))));
|
56068 |
+
break;
|
56069 |
+
|
56070 |
default:
|
56071 |
comp_html.push( /*#__PURE__*/_react["default"].createElement("div", {
|
56072 |
key: "noads"
|
61099 |
name: "ad_label_check",
|
61100 |
onChange: this.props.adFormChangeHandler,
|
61101 |
type: "checkbox"
|
61102 |
+
}))), post_meta.ad_label_check ? /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("label", null, __('Ad Label Text', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("input", {
|
61103 |
+
onChange: this.props.adFormChangeHandler,
|
61104 |
+
type: "text",
|
61105 |
+
className: "small-text",
|
61106 |
+
id: "ad_label_text",
|
61107 |
+
name: "ad_label_text",
|
61108 |
+
value: post_meta.ad_label_text
|
61109 |
+
}))) : null, post_meta.ad_label_check ? /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("label", null, __('Ad Label Position', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("select", {
|
61110 |
name: "adlabel",
|
61111 |
value: post_meta.adlabel,
|
61112 |
onChange: this.props.adFormChangeHandler
|
61114 |
value: "above"
|
61115 |
}, __('Above Ad', 'quick-adsense-reloaded')), /*#__PURE__*/_react["default"].createElement("option", {
|
61116 |
value: "below"
|
61117 |
+
}, __('Below Ad', 'quick-adsense-reloaded'))))) : null)))));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61118 |
}
|
61119 |
}]);
|
61120 |
|
63088 |
}, {
|
63089 |
label: 'Tags',
|
63090 |
value: 'tags'
|
63091 |
+
}, {
|
63092 |
+
label: 'Page Template',
|
63093 |
+
value: 'page_template'
|
63094 |
}]
|
63095 |
};
|
63096 |
return _this;
|
63318 |
}, __('After Paragraph', 'quick-adsense-reloaded')), /*#__PURE__*/_react["default"].createElement("option", {
|
63319 |
value: "after_image"
|
63320 |
}, __('After Image', 'quick-adsense-reloaded')), /*#__PURE__*/_react["default"].createElement("option", {
|
63321 |
+
value: "after_word_count"
|
63322 |
+
}, __('By Word Count', 'quick-adsense-reloaded')), /*#__PURE__*/_react["default"].createElement("option", {
|
63323 |
+
value: "after_the_percentage"
|
63324 |
+
}, __('After the Percentage', 'quick-adsense-reloaded')), /*#__PURE__*/_react["default"].createElement("option", {
|
63325 |
value: "ad_shortcode"
|
63326 |
}, __('Shortcode (Manual)', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("optgroup", {
|
63327 |
label: "Partial Support ( AMP Only )"
|
63367 |
}, __('After Paragraph', 'quick-adsense-reloaded')), /*#__PURE__*/_react["default"].createElement("option", {
|
63368 |
value: "after_image"
|
63369 |
}, __('After Image', 'quick-adsense-reloaded')), /*#__PURE__*/_react["default"].createElement("option", {
|
63370 |
+
value: "after_word_count"
|
63371 |
+
}, __('By Word Count', 'quick-adsense-reloaded')), /*#__PURE__*/_react["default"].createElement("option", {
|
63372 |
+
value: "after_the_percentage"
|
63373 |
+
}, __('After the Percentage', 'quick-adsense-reloaded')), /*#__PURE__*/_react["default"].createElement("option", {
|
63374 |
value: "ad_shortcode"
|
63375 |
}, __('Shortcode (Manual)', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("div", null, show_form_error && post_meta.position == '' ? /*#__PURE__*/_react["default"].createElement("span", {
|
63376 |
className: "quads-error"
|
63415 |
type: "checkbox"
|
63416 |
}), /*#__PURE__*/_react["default"].createElement("label", {
|
63417 |
"for": "repeat_paragraph"
|
63418 |
+
}, " ", __('Display After Every ', 'quick-adsense-reloaded'), post_meta.paragraph_number))) : '', post_meta.position == 'after_word_count' ? /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("label", null, /*#__PURE__*/_react["default"].createElement("input", {
|
63419 |
+
min: "1",
|
63420 |
+
onChange: this.props.adFormChangeHandler,
|
63421 |
+
name: "word_count_number",
|
63422 |
+
value: post_meta.word_count_number,
|
63423 |
+
type: "number"
|
63424 |
+
}))) : '', post_meta.position == 'after_the_percentage' ? /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("label", null, /*#__PURE__*/_react["default"].createElement("input", {
|
63425 |
+
min: "1",
|
63426 |
+
onChange: this.props.adFormChangeHandler,
|
63427 |
+
name: "after_the_percentage_value",
|
63428 |
+
value: post_meta.after_the_percentage_value,
|
63429 |
+
type: "number"
|
63430 |
+
}), " %")) : '', show_form_error && post_meta.position == 'after_the_percentage' && (post_meta.g_data_ad_client == '' || parseInt(quads_post_meta.after_the_percentage_value) < 10 || parseInt(quads_post_meta.after_the_percentage_value) > 101) ? /*#__PURE__*/_react["default"].createElement("div", {
|
63431 |
+
className: "quads_form_msg"
|
63432 |
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
63433 |
+
className: "material-icons"
|
63434 |
+
}, "error_outline"), "Percentage should be between 10 to 100") : '', post_meta.position == 'after_image' ? /*#__PURE__*/_react["default"].createElement("label", null, /*#__PURE__*/_react["default"].createElement("input", {
|
63435 |
checked: post_meta.image_caption,
|
63436 |
name: "image_caption",
|
63437 |
onChange: this.props.adFormChangeHandler,
|
63869 |
});
|
63870 |
});
|
63871 |
|
63872 |
+
_defineProperty(_assertThisInitialized(_this), "importampforwpdata", function () {
|
63873 |
+
if (_this.state.importampforwpmsgprocessing != '') {
|
63874 |
+
return;
|
63875 |
+
}
|
63876 |
+
|
63877 |
+
_this.setState({
|
63878 |
+
importampforwpmsgprocessing: 'Importing Ads'
|
63879 |
+
});
|
63880 |
+
|
63881 |
+
var url = quads_localize_data.rest_url + 'quads-route/import-ampforwp-ads';
|
63882 |
+
fetch(url, {
|
63883 |
+
method: "post",
|
63884 |
+
headers: {
|
63885 |
+
'Accept': 'application/json',
|
63886 |
+
'Content-Type': 'application/json',
|
63887 |
+
'X-WP-Nonce': quads_localize_data.nonce
|
63888 |
+
}
|
63889 |
+
}).then(function (res) {
|
63890 |
+
return res.json();
|
63891 |
+
}).then(function (result) {
|
63892 |
+
if (result.status === 't') {
|
63893 |
+
_this.setState({
|
63894 |
+
importampforwpmsg: result.data,
|
63895 |
+
importampforwpmsgprocessing: ''
|
63896 |
+
});
|
63897 |
+
}
|
63898 |
+
}, function (error) {});
|
63899 |
+
});
|
63900 |
+
|
63901 |
_defineProperty(_assertThisInitialized(_this), "open_global_excluder", function () {
|
63902 |
_this.setState({
|
63903 |
global_excluder_modal: true
|
64064 |
|
64065 |
_defineProperty(_assertThisInitialized(_this), "closeQuerySuccess", function (e) {
|
64066 |
_this.setState({
|
64067 |
+
customer_querey_success: '',
|
64068 |
+
importampforwpmsg: ''
|
64069 |
});
|
64070 |
});
|
64071 |
|
64525 |
multiTagsValue: [],
|
64526 |
multiPluginsValue: []
|
64527 |
},
|
64528 |
+
quads_wp_quads_pro_license_key: '',
|
64529 |
+
importampforwpmsg: "",
|
64530 |
+
importampforwpmsgprocessing: ""
|
64531 |
};
|
64532 |
return _this;
|
64533 |
}
|
64697 |
checked: settings.adsTxtEnabled
|
64698 |
}), /*#__PURE__*/_react["default"].createElement("span", {
|
64699 |
className: "quads-slider"
|
64700 |
+
})), _this2.state.adsTxtEnabled ? /*#__PURE__*/_react["default"].createElement("span", {
|
64701 |
+
onClick: _this2.open_ad_text_modal,
|
64702 |
+
className: "quads-generic-icon dashicons dashicons-admin-generic"
|
64703 |
+
}) : '')), quads_localize_data.is_pro ? /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("th", null, /*#__PURE__*/_react["default"].createElement("label", {
|
64704 |
htmlFor: "global_excluder_enabled"
|
64705 |
}, __('Global Excluder', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("label", {
|
64706 |
className: "quads-switch"
|
64794 |
}, __('Copy System Info', 'quick-adsense-reloaded')), /*#__PURE__*/_react["default"].createElement("div", null, _this2.state.copied ? /*#__PURE__*/_react["default"].createElement("span", null, __('System info copied to clipboard', 'quick-adsense-reloaded')) : null))), /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("th", null, /*#__PURE__*/_react["default"].createElement("label", null, __('Export', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("a", {
|
64795 |
href: "".concat(quads_localize_data.rest_url, "quads-route/export-settings"),
|
64796 |
className: "quads-btn quads-btn-primary"
|
64797 |
+
}, "Export"), /*#__PURE__*/_react["default"].createElement("p", null, __('Export the Quick AdSense Reloaded settings for this site as a .json file. This allows you to easily import the configuration into another site.', 'quick-adsense-reloaded')))))));
|
64798 |
+
|
64799 |
+
case "settings_importer":
|
64800 |
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
64801 |
+
className: "quads-settings-tab-container"
|
64802 |
+
}, /*#__PURE__*/_react["default"].createElement("table", {
|
64803 |
+
className: "form-table",
|
64804 |
+
role: "presentation"
|
64805 |
+
}, /*#__PURE__*/_react["default"].createElement("tbody", null, /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("th", null, /*#__PURE__*/_react["default"].createElement("label", null, __('AMP for WP Ads', 'quick-adsense-reloaded'))), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("a", {
|
64806 |
+
className: "quads-btn quads-btn-primary",
|
64807 |
+
id: "import_amp_for_wp",
|
64808 |
+
onClick: _this2.importampforwpdata
|
64809 |
+
}, __('Import', 'quick-adsense-reloaded')), _this2.state.importampforwpmsg ? /*#__PURE__*/_react["default"].createElement(_lab.Alert, {
|
64810 |
+
severity: "success",
|
64811 |
+
action: /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
|
64812 |
+
onClick: _this2.closeQuerySuccess
|
64813 |
+
}, "close")
|
64814 |
+
}, _this2.state.importampforwpmsg) : null, _this2.state.importampforwpmsgprocessing ? /*#__PURE__*/_react["default"].createElement("div", {
|
64815 |
+
className: "updating-message importampforwpmsgprocessing"
|
64816 |
+
}, /*#__PURE__*/_react["default"].createElement("p", null, "Importing Ads")) : '')))));
|
64817 |
|
64818 |
case "settings_google_autoads":
|
64819 |
return /*#__PURE__*/_react["default"].createElement("div", {
|
103634 |
to: 'admin.php?page=quads-settings&path=settings_tools',
|
103635 |
className: current == 'settings_tools' ? 'quads-nav-link quads-nav-link-active' : 'quads-nav-link'
|
103636 |
}, __('Tools', 'quick-adsense-reloaded')))), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("h2", null, /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Link, {
|
103637 |
+
to: 'admin.php?page=quads-settings&path=settings_importer',
|
103638 |
+
className: current == 'settings_importer' ? 'quads-nav-link quads-nav-link-active' : 'quads-nav-link'
|
103639 |
+
}, __('Importer', 'quick-adsense-reloaded')))), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("h2", null, /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Link, {
|
103640 |
to: 'admin.php?page=quads-settings&path=settings_legacy',
|
103641 |
className: current == 'settings_legacy' ? 'quads-nav-link quads-nav-link-active' : 'quads-nav-link'
|
103642 |
}, __('Legacy', 'quick-adsense-reloaded')))), /*#__PURE__*/_react["default"].createElement("li", null, /*#__PURE__*/_react["default"].createElement("h2", null, /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Link, {
|
104342 |
type = "Yandex";
|
104343 |
break;
|
104344 |
|
104345 |
+
case 'mgid':
|
104346 |
+
img_url = quads_localize_data.quads_plugin_url + 'admin/assets/js/src/images/mgid_icon.png';
|
104347 |
+
type = "MGID";
|
104348 |
+
break;
|
104349 |
+
|
104350 |
default:
|
104351 |
break;
|
104352 |
}
|
104691 |
var current = 'ads';
|
104692 |
|
104693 |
if (typeof page.path != 'undefined') {
|
104694 |
+
if (page.path == 'settings' || page.path == 'settings_tools' || page.path == 'settings_importer' || page.path == 'settings_legacy' || page.path == 'settings_support' || page.path == 'settings_licenses' || page.path == 'settings_google_autoads') {
|
104695 |
+
jQuery('.wp-submenu li').removeClass('current');
|
104696 |
+
jQuery('a[href$="quads-settings&path=settings"]').parent().addClass('current');
|
104697 |
+
current = 'settings';
|
104698 |
+
}
|
104699 |
+
} else if (page.page == 'quads-settings') {
|
104700 |
+
jQuery('.wp-submenu li').removeClass('current');
|
104701 |
+
jQuery('a[href$="quads-settings"]').parent().addClass('current');
|
104702 |
}
|
104703 |
|
104704 |
return /*#__PURE__*/_react["default"].createElement("div", {
|
104824 |
img_url = quads_localize_data.quads_plugin_url + 'admin/assets/js/src/images/yandex.png';
|
104825 |
break;
|
104826 |
|
104827 |
+
case 'mgid':
|
104828 |
+
img_url = quads_localize_data.quads_plugin_url + 'admin/assets/js/src/images/mgid.png';
|
104829 |
+
break;
|
104830 |
+
|
104831 |
default:
|
104832 |
break;
|
104833 |
}
|
104857 |
}, {
|
104858 |
ad_type: 'yandex',
|
104859 |
ad_type_name: 'Yandex'
|
104860 |
+
}, {
|
104861 |
+
ad_type: 'mgid',
|
104862 |
+
ad_type_name: 'MGID'
|
104863 |
}, {
|
104864 |
ad_type: 'plain_text',
|
104865 |
ad_type_name: 'Plain Text / HTML / JS'
|
@@ -271,6 +271,9 @@ and open the template in the editor.
|
|
271 |
|
272 |
#repeat_paragraph + label {
|
273 |
text-transform: none; }
|
|
|
|
|
|
|
274 |
/*
|
275 |
To change this license header, choose License Headers in Project Properties.
|
276 |
To change this template file, choose Tools | Templates
|
@@ -1178,6 +1181,11 @@ a.quads-nav-link-active {
|
|
1178 |
|
1179 |
.quads-save-settings {
|
1180 |
padding: 25px; }
|
|
|
|
|
|
|
|
|
|
|
1181 |
/*
|
1182 |
To change this license header, choose License Headers in Project Properties.
|
1183 |
To change this template file, choose Tools | Templates
|
271 |
|
272 |
#repeat_paragraph + label {
|
273 |
text-transform: none; }
|
274 |
+
|
275 |
+
.quads-settings-group .quads-tr-position .quads-position-dropdown select {
|
276 |
+
width: 311px; }
|
277 |
/*
|
278 |
To change this license header, choose License Headers in Project Properties.
|
279 |
To change this template file, choose Tools | Templates
|
1181 |
|
1182 |
.quads-save-settings {
|
1183 |
padding: 25px; }
|
1184 |
+
|
1185 |
+
.importampforwpmsgprocessing {
|
1186 |
+
background-color: #edf7ed;
|
1187 |
+
padding: 6px 16px;
|
1188 |
+
font-size: 0.875rem; }
|
1189 |
/*
|
1190 |
To change this license header, choose License Headers in Project Properties.
|
1191 |
To change this template file, choose Tools | Templates
|
@@ -73,9 +73,11 @@ class QuadsAdCreateRouter extends Component {
|
|
73 |
margin : 0,
|
74 |
position : 'beginning_of_post',
|
75 |
paragraph_number : 1,
|
|
|
76 |
image_number : 1,
|
77 |
enabled_on_amp : false,
|
78 |
enable_on_end_of_post : false,
|
|
|
79 |
image_caption : false,
|
80 |
include_dropdown : false,
|
81 |
exclude_dropdown : false,
|
@@ -375,12 +377,17 @@ class QuadsAdCreateRouter extends Component {
|
|
375 |
|
376 |
event.preventDefault();
|
377 |
const {quads_post_meta} = this.state;
|
378 |
-
|
|
|
|
|
|
|
|
|
|
|
379 |
switch (quads_post_meta.ad_type) {
|
380 |
|
381 |
case 'plain_text':
|
382 |
|
383 |
-
if(quads_post_meta.code && quads_post_meta.position && quads_post_meta.visibility_include.length > 0){
|
384 |
this.saveAdFormData('publish');
|
385 |
}else{
|
386 |
this.setState({show_form_error:true});
|
@@ -389,7 +396,7 @@ class QuadsAdCreateRouter extends Component {
|
|
389 |
break;
|
390 |
|
391 |
case 'adsense':
|
392 |
-
if(quads_post_meta.g_data_ad_slot && quads_post_meta.g_data_ad_client && quads_post_meta.position && quads_post_meta.visibility_include.length > 0){
|
393 |
this.saveAdFormData('publish');
|
394 |
}else{
|
395 |
this.setState({show_form_error:true});
|
@@ -397,21 +404,28 @@ class QuadsAdCreateRouter extends Component {
|
|
397 |
|
398 |
break;
|
399 |
case 'random_ads':
|
400 |
-
if(quads_post_meta.random_ads_list.length > 0 && quads_post_meta.position && quads_post_meta.visibility_include.length > 0){
|
401 |
this.saveAdFormData('publish');
|
402 |
}else{
|
403 |
this.setState({show_form_error:true});
|
404 |
}
|
405 |
break;
|
406 |
case 'double_click':
|
407 |
-
if(quads_post_meta.ad_unit_name && quads_post_meta.network_code && quads_post_meta.position && quads_post_meta.visibility_include.length > 0){
|
408 |
this.saveAdFormData('publish');
|
409 |
}else{
|
410 |
this.setState({show_form_error:true});
|
411 |
}
|
412 |
break;
|
413 |
case 'yandex':
|
414 |
-
if(quads_post_meta.block_id && quads_post_meta.position && quads_post_meta.visibility_include.length > 0){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
415 |
this.saveAdFormData('publish');
|
416 |
}else{
|
417 |
this.setState({show_form_error:true});
|
@@ -469,13 +483,10 @@ class QuadsAdCreateRouter extends Component {
|
|
469 |
|
470 |
if(this.state.quads_state_changed && !this.state.quads_is_saved){
|
471 |
|
472 |
-
let r = confirm("
|
473 |
|
474 |
if (r == true) {
|
475 |
-
|
476 |
-
this.saveAdFormData(this.state.quads_ad_status);
|
477 |
-
|
478 |
-
this.props.history.push(new_url);
|
479 |
|
480 |
} else {
|
481 |
return false
|
@@ -537,6 +548,13 @@ class QuadsAdCreateRouter extends Component {
|
|
537 |
this.setState({show_form_error:true});
|
538 |
}
|
539 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
540 |
default:
|
541 |
break;
|
542 |
}
|
73 |
margin : 0,
|
74 |
position : 'beginning_of_post',
|
75 |
paragraph_number : 1,
|
76 |
+
word_count_number : 100,
|
77 |
image_number : 1,
|
78 |
enabled_on_amp : false,
|
79 |
enable_on_end_of_post : false,
|
80 |
+
after_the_percentage_value: 50,
|
81 |
image_caption : false,
|
82 |
include_dropdown : false,
|
83 |
exclude_dropdown : false,
|
377 |
|
378 |
event.preventDefault();
|
379 |
const {quads_post_meta} = this.state;
|
380 |
+
let validation_flag = true;
|
381 |
+
if(quads_post_meta.position == 'after_the_percentage'){
|
382 |
+
if(quads_post_meta.after_the_percentage_value == '' || parseInt(quads_post_meta.after_the_percentage_value) < 10 || parseInt(quads_post_meta.after_the_percentage_value) > 101){
|
383 |
+
validation_flag = false;
|
384 |
+
}
|
385 |
+
}
|
386 |
switch (quads_post_meta.ad_type) {
|
387 |
|
388 |
case 'plain_text':
|
389 |
|
390 |
+
if(validation_flag && quads_post_meta.code && quads_post_meta.position && quads_post_meta.visibility_include.length > 0){
|
391 |
this.saveAdFormData('publish');
|
392 |
}else{
|
393 |
this.setState({show_form_error:true});
|
396 |
break;
|
397 |
|
398 |
case 'adsense':
|
399 |
+
if(validation_flag && quads_post_meta.g_data_ad_slot && quads_post_meta.g_data_ad_client && quads_post_meta.position && quads_post_meta.visibility_include.length > 0){
|
400 |
this.saveAdFormData('publish');
|
401 |
}else{
|
402 |
this.setState({show_form_error:true});
|
404 |
|
405 |
break;
|
406 |
case 'random_ads':
|
407 |
+
if(validation_flag && quads_post_meta.random_ads_list.length > 0 && quads_post_meta.position && quads_post_meta.visibility_include.length > 0){
|
408 |
this.saveAdFormData('publish');
|
409 |
}else{
|
410 |
this.setState({show_form_error:true});
|
411 |
}
|
412 |
break;
|
413 |
case 'double_click':
|
414 |
+
if(validation_flag && quads_post_meta.ad_unit_name && quads_post_meta.network_code && quads_post_meta.position && quads_post_meta.visibility_include.length > 0){
|
415 |
this.saveAdFormData('publish');
|
416 |
}else{
|
417 |
this.setState({show_form_error:true});
|
418 |
}
|
419 |
break;
|
420 |
case 'yandex':
|
421 |
+
if(validation_flag && quads_post_meta.block_id && quads_post_meta.position && quads_post_meta.visibility_include.length > 0){
|
422 |
+
this.saveAdFormData('publish');
|
423 |
+
}else{
|
424 |
+
this.setState({show_form_error:true});
|
425 |
+
}
|
426 |
+
break;
|
427 |
+
case 'mgid':
|
428 |
+
if(validation_flag && quads_post_meta.data_publisher && quads_post_meta.data_widget && quads_post_meta.data_container && quads_post_meta.position && quads_post_meta.visibility_include.length > 0){
|
429 |
this.saveAdFormData('publish');
|
430 |
}else{
|
431 |
this.setState({show_form_error:true});
|
483 |
|
484 |
if(this.state.quads_state_changed && !this.state.quads_is_saved){
|
485 |
|
486 |
+
let r = confirm("Changes you made may not be saved.");
|
487 |
|
488 |
if (r == true) {
|
489 |
+
this.props.history.push(new_url);
|
|
|
|
|
|
|
490 |
|
491 |
} else {
|
492 |
return false
|
548 |
this.setState({show_form_error:true});
|
549 |
}
|
550 |
break;
|
551 |
+
case 'mgid':
|
552 |
+
if(quads_post_meta.data_publisher && quads_post_meta.data_widget && quads_post_meta.data_container){
|
553 |
+
this.props.history.push(new_url);
|
554 |
+
}else{
|
555 |
+
this.setState({show_form_error:true});
|
556 |
+
}
|
557 |
+
break;
|
558 |
default:
|
559 |
break;
|
560 |
}
|
@@ -57,7 +57,10 @@ class QuadsAdList extends Component {
|
|
57 |
img_url = quads_localize_data.quads_plugin_url+'admin/assets/js/src/images/yandex_icon.png';
|
58 |
type = "Yandex";
|
59 |
break;
|
60 |
-
|
|
|
|
|
|
|
61 |
default:
|
62 |
break;
|
63 |
}
|
57 |
img_url = quads_localize_data.quads_plugin_url+'admin/assets/js/src/images/yandex_icon.png';
|
58 |
type = "Yandex";
|
59 |
break;
|
60 |
+
case 'mgid':
|
61 |
+
img_url = quads_localize_data.quads_plugin_url+'admin/assets/js/src/images/mgid_icon.png';
|
62 |
+
type = "MGID";
|
63 |
+
break;
|
64 |
default:
|
65 |
break;
|
66 |
}
|
@@ -16,7 +16,8 @@ class AdTypeSelectorNavLink extends Component {
|
|
16 |
All_ad_network: [
|
17 |
{ad_type:'adsense',ad_type_name:'AdSense'},
|
18 |
{ad_type:'double_click',ad_type_name:'Google Ad Manager'},
|
19 |
-
{ad_type:'yandex',ad_type_name:'Yandex'},
|
|
|
20 |
{ad_type:'plain_text',ad_type_name:'Plain Text / HTML / JS'},
|
21 |
{ad_type:'random_ads',ad_type_name:'Random Ads'},
|
22 |
|
@@ -44,6 +45,9 @@ class AdTypeSelectorNavLink extends Component {
|
|
44 |
case 'yandex':
|
45 |
img_url = quads_localize_data.quads_plugin_url+'admin/assets/js/src/images/yandex.png';
|
46 |
break;
|
|
|
|
|
|
|
47 |
|
48 |
default:
|
49 |
break;
|
16 |
All_ad_network: [
|
17 |
{ad_type:'adsense',ad_type_name:'AdSense'},
|
18 |
{ad_type:'double_click',ad_type_name:'Google Ad Manager'},
|
19 |
+
{ad_type:'yandex',ad_type_name:'Yandex'},
|
20 |
+
{ad_type:'mgid',ad_type_name:'MGID'},
|
21 |
{ad_type:'plain_text',ad_type_name:'Plain Text / HTML / JS'},
|
22 |
{ad_type:'random_ads',ad_type_name:'Random Ads'},
|
23 |
|
45 |
case 'yandex':
|
46 |
img_url = quads_localize_data.quads_plugin_url+'admin/assets/js/src/images/yandex.png';
|
47 |
break;
|
48 |
+
case 'mgid':
|
49 |
+
img_url = quads_localize_data.quads_plugin_url+'admin/assets/js/src/images/mgid.png';
|
50 |
+
break;
|
51 |
|
52 |
default:
|
53 |
break;
|
@@ -131,10 +131,10 @@ removeSeleted = (e) => {
|
|
131 |
comp_html.push(<div key="adsense">
|
132 |
<table>
|
133 |
<tbody>
|
134 |
-
<tr><td><label>{__('Data Client ID', 'quick-adsense-reloaded')}</label></td><td><input className={(show_form_error && post_meta.g_data_ad_client == '') ? 'quads_form_error' : ''} value={post_meta.g_data_ad_client} onChange={this.props.adFormChangeHandler} type="text" id="g_data_ad_client" name="g_data_ad_client" />
|
135 |
{(show_form_error && post_meta.g_data_ad_client == '') ? <div className="quads_form_msg"><span className="material-icons">
|
136 |
error_outline</span>Enter Data Client ID</div> :''} </td></tr>
|
137 |
-
<tr><td><label>{__('Data Slot ID', 'quick-adsense-reloaded')}</label></td><td><input className={(show_form_error && post_meta.g_data_ad_slot == '') ? 'quads_form_error' : ''} value={post_meta.g_data_ad_slot} onChange={this.props.adFormChangeHandler} type="text" id="g_data_ad_slot" name="g_data_ad_slot" />
|
138 |
{(show_form_error && post_meta.g_data_ad_slot == '') ? <div className="quads_form_msg"><span className="material-icons">
|
139 |
error_outline
|
140 |
</span>Enter Data Slot ID</div> :''}</td></tr>
|
@@ -282,6 +282,61 @@ error_outline
|
|
282 |
</div>);
|
283 |
|
284 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
|
286 |
default:
|
287 |
comp_html.push(<div key="noads" >{__('Ad not found', 'quick-adsense-reloaded')}</div>);
|
131 |
comp_html.push(<div key="adsense">
|
132 |
<table>
|
133 |
<tbody>
|
134 |
+
<tr><td><label>{__('Data Client ID', 'quick-adsense-reloaded')}</label></td><td><input className={(show_form_error && post_meta.g_data_ad_client == '') ? 'quads_form_error' : ''} value={post_meta.g_data_ad_client} placeholder="ca-pub-2005XXXXXXXXX342" onChange={this.props.adFormChangeHandler} type="text" id="g_data_ad_client" name="g_data_ad_client" />
|
135 |
{(show_form_error && post_meta.g_data_ad_client == '') ? <div className="quads_form_msg"><span className="material-icons">
|
136 |
error_outline</span>Enter Data Client ID</div> :''} </td></tr>
|
137 |
+
<tr><td><label>{__('Data Slot ID', 'quick-adsense-reloaded')}</label></td><td><input className={(show_form_error && post_meta.g_data_ad_slot == '') ? 'quads_form_error' : ''} value={post_meta.g_data_ad_slot} onChange={this.props.adFormChangeHandler} type="text" id="g_data_ad_slot" name="g_data_ad_slot" placeholder="70XXXXXX12" />
|
138 |
{(show_form_error && post_meta.g_data_ad_slot == '') ? <div className="quads_form_msg"><span className="material-icons">
|
139 |
error_outline
|
140 |
</span>Enter Data Slot ID</div> :''}</td></tr>
|
282 |
</div>);
|
283 |
|
284 |
break;
|
285 |
+
case 'mgid':
|
286 |
+
ad_type_name = 'MGID';
|
287 |
+
comp_html.push(<div key="mgid">
|
288 |
+
<table>
|
289 |
+
<tbody>
|
290 |
+
<tr><td>
|
291 |
+
<label>{__('Data Publisher', 'quick-adsense-reloaded')}</label></td><td><input className={(show_form_error && post_meta.data_publisher == '') ? 'quads_form_error' : ''} value={post_meta.data_publisher} onChange={this.props.adFormChangeHandler} type="text" id="data_publisher" name="data_publisher" placeholder="site.com" />
|
292 |
+
{(show_form_error && post_meta.data_publisher == '') ? <div className="quads_form_msg"><span className="material-icons">
|
293 |
+
error_outline</span>Data Publisher</div> :''}
|
294 |
+
</td></tr>
|
295 |
+
<tr><td>
|
296 |
+
<label>{__('Data Widget', 'quick-adsense-reloaded')}</label></td><td><input className={(show_form_error && post_meta.data_widget == '') ? 'quads_form_error' : ''} value={post_meta.data_widget} onChange={this.props.adFormChangeHandler} type="text" id="data_widget" name="data_widget" placeholder="123456" />
|
297 |
+
{(show_form_error && post_meta.data_widget == '') ? <div className="quads_form_msg"><span className="material-icons">
|
298 |
+
error_outline</span>Enter Data Widget</div> :''}
|
299 |
+
</td></tr>
|
300 |
+
<tr><td>
|
301 |
+
<label>{__('Data Container', 'quick-adsense-reloaded')}</label></td><td><input className={(show_form_error && post_meta.data_container == '') ? 'quads_form_error' : ''} value={post_meta.data_container} onChange={this.props.adFormChangeHandler} type="text" id="data_container" name="data_container" placeholder="M87ScriptRootC123645" />
|
302 |
+
{(show_form_error && post_meta.data_container == '') ? <div className="quads_form_msg"><span className="material-icons">
|
303 |
+
error_outline</span>Enter Data Container</div> :''}
|
304 |
+
</td></tr>
|
305 |
+
<tr><td>
|
306 |
+
<label>{__('Data Js Src', 'quick-adsense-reloaded')}</label></td><td><input className={(show_form_error && post_meta.data_js_src == '') ? 'quads_form_error' : ''} value={post_meta.data_js_src} onChange={this.props.adFormChangeHandler} type="text" id="data_js_src" name="data_js_src" placeholder="//jsc.mgid.com/a/m/quads.com.123645.js" />
|
307 |
+
{(show_form_error && post_meta.data_js_src == '') ? <div className="quads_form_msg"><span className="material-icons">
|
308 |
+
error_outline</span>Enter Data Js Src</div> :''}
|
309 |
+
</td></tr>
|
310 |
+
<tr><td><label>{__('Size', 'quick-adsense-reloaded')}</label></td><td>
|
311 |
+
<div>
|
312 |
+
<select value={post_meta.adsense_type} onChange={this.props.adFormChangeHandler} name="adsense_type" id="adsense_type">
|
313 |
+
<option value="normal">{__('Fixed Size', 'quick-adsense-reloaded')}</option>
|
314 |
+
<option value="responsive">{__('Responsive', 'quick-adsense-reloaded')}</option>
|
315 |
+
</select>
|
316 |
+
{
|
317 |
+
post_meta.adsense_type !== 'responsive' ?
|
318 |
+
<div className="quads-adsense-width-heigth">
|
319 |
+
|
320 |
+
<div className="quads-adsense-width">
|
321 |
+
<label>{__('Width', 'quick-adsense-reloaded')}
|
322 |
+
<input value={post_meta.g_data_ad_width ? post_meta.g_data_ad_width:'300'} onChange={this.props.adFormChangeHandler} type="number" id="g_data_ad_width" name="g_data_ad_width" />
|
323 |
+
</label>
|
324 |
+
</div>
|
325 |
+
<div className="quads-adsense-height">
|
326 |
+
<label>{__('Height', 'quick-adsense-reloaded')}
|
327 |
+
<input value={post_meta.g_data_ad_height ? post_meta.g_data_ad_height:'250'} onChange={this.props.adFormChangeHandler} type="number" id="g_data_ad_height" name="g_data_ad_height" />
|
328 |
+
</label>
|
329 |
+
</div>
|
330 |
+
</div>
|
331 |
+
: ''
|
332 |
+
}
|
333 |
+
</div>
|
334 |
+
</td></tr>
|
335 |
+
</tbody>
|
336 |
+
</table>
|
337 |
+
</div>);
|
338 |
+
|
339 |
+
break;
|
340 |
|
341 |
default:
|
342 |
comp_html.push(<div key="noads" >{__('Ad not found', 'quick-adsense-reloaded')}</div>);
|
@@ -29,9 +29,15 @@ class QuadsAdListNavLink extends Component {
|
|
29 |
|
30 |
if(typeof(page.path) != 'undefined' ) {
|
31 |
|
32 |
-
if( page.path == 'settings' || page.path == 'settings_tools' || page.path == 'settings_legacy' || page.path == 'settings_support' || page.path == 'settings_licenses' || page.path == 'settings_google_autoads')
|
|
|
|
|
33 |
current = 'settings';
|
34 |
-
}
|
|
|
|
|
|
|
|
|
35 |
return(
|
36 |
<div className="quads-ad-tab-wrapper">
|
37 |
<div className="quads-hidden-element">
|
29 |
|
30 |
if(typeof(page.path) != 'undefined' ) {
|
31 |
|
32 |
+
if( page.path == 'settings' || page.path == 'settings_tools' || page.path == 'settings_importer' || page.path == 'settings_legacy' || page.path == 'settings_support' || page.path == 'settings_licenses' || page.path == 'settings_google_autoads') {
|
33 |
+
jQuery('.wp-submenu li').removeClass('current');
|
34 |
+
jQuery('a[href$="quads-settings&path=settings"]').parent().addClass('current');
|
35 |
current = 'settings';
|
36 |
+
}
|
37 |
+
}else if(page.page == 'quads-settings'){
|
38 |
+
jQuery('.wp-submenu li').removeClass('current');
|
39 |
+
jQuery('a[href$="quads-settings"]').parent().addClass('current');
|
40 |
+
}
|
41 |
return(
|
42 |
<div className="quads-ad-tab-wrapper">
|
43 |
<div className="quads-hidden-element">
|
@@ -31,7 +31,9 @@ class QuadsAdvancePosition extends Component {
|
|
31 |
<option value="before_last_paragraph">{__('Right before the last Paragraph', 'quick-adsense-reloaded')}</option>
|
32 |
<option value="after_paragraph">{__('After Paragraph', 'quick-adsense-reloaded')}</option>
|
33 |
<option value="after_image">{__('After Image', 'quick-adsense-reloaded')}</option>
|
34 |
-
<option value="
|
|
|
|
|
35 |
</optgroup>
|
36 |
|
37 |
<optgroup label="Partial Support ( AMP Only )">
|
@@ -57,6 +59,9 @@ class QuadsAdvancePosition extends Component {
|
|
57 |
<option value="before_last_paragraph">{__('Right before the last Paragraph', 'quick-adsense-reloaded')}</option>
|
58 |
<option value="after_paragraph">{__('After Paragraph', 'quick-adsense-reloaded')}</option>
|
59 |
<option value="after_image">{__('After Image', 'quick-adsense-reloaded')}</option>
|
|
|
|
|
|
|
60 |
<option value="ad_shortcode">{__('Shortcode (Manual)', 'quick-adsense-reloaded')}</option>
|
61 |
</select> }
|
62 |
<div>{ (show_form_error && post_meta.position == '') ? <span className="quads-error"><div className="quads_form_msg"><span className="material-icons">error_outline</span>Select Where Will The AD Appear</div></span> : ''}</div>
|
@@ -84,6 +89,22 @@ class QuadsAdvancePosition extends Component {
|
|
84 |
|
85 |
</div></div> : ''}
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
{post_meta.position == 'after_image' ?
|
88 |
<label>
|
89 |
<input checked={post_meta.image_caption} name="image_caption" onChange={this.props.adFormChangeHandler} type="checkbox"/>
|
31 |
<option value="before_last_paragraph">{__('Right before the last Paragraph', 'quick-adsense-reloaded')}</option>
|
32 |
<option value="after_paragraph">{__('After Paragraph', 'quick-adsense-reloaded')}</option>
|
33 |
<option value="after_image">{__('After Image', 'quick-adsense-reloaded')}</option>
|
34 |
+
<option value="after_word_count">{__('By Word Count', 'quick-adsense-reloaded')}</option>
|
35 |
+
<option value="after_the_percentage">{__('After the Percentage', 'quick-adsense-reloaded')}</option>
|
36 |
+
<option value="ad_shortcode">{__('Shortcode (Manual)', 'quick-adsense-reloaded')}</option>
|
37 |
</optgroup>
|
38 |
|
39 |
<optgroup label="Partial Support ( AMP Only )">
|
59 |
<option value="before_last_paragraph">{__('Right before the last Paragraph', 'quick-adsense-reloaded')}</option>
|
60 |
<option value="after_paragraph">{__('After Paragraph', 'quick-adsense-reloaded')}</option>
|
61 |
<option value="after_image">{__('After Image', 'quick-adsense-reloaded')}</option>
|
62 |
+
<option value="after_word_count">{__('By Word Count', 'quick-adsense-reloaded')}</option>
|
63 |
+
<option value="after_the_percentage">{__('After the Percentage', 'quick-adsense-reloaded')}</option>
|
64 |
+
|
65 |
<option value="ad_shortcode">{__('Shortcode (Manual)', 'quick-adsense-reloaded')}</option>
|
66 |
</select> }
|
67 |
<div>{ (show_form_error && post_meta.position == '') ? <span className="quads-error"><div className="quads_form_msg"><span className="material-icons">error_outline</span>Select Where Will The AD Appear</div></span> : ''}</div>
|
89 |
|
90 |
</div></div> : ''}
|
91 |
|
92 |
+
{post_meta.position == 'after_word_count' ?
|
93 |
+
<div>
|
94 |
+
<label>
|
95 |
+
<input min="1" onChange={this.props.adFormChangeHandler} name="word_count_number" value={post_meta.word_count_number} type="number" />
|
96 |
+
</label>
|
97 |
+
</div> : ''}
|
98 |
+
{post_meta.position == 'after_the_percentage' ?
|
99 |
+
<div>
|
100 |
+
<label>
|
101 |
+
<input min="1" onChange={this.props.adFormChangeHandler} name="after_the_percentage_value" value={post_meta.after_the_percentage_value} type="number" /> %
|
102 |
+
</label>
|
103 |
+
</div> : ''}
|
104 |
+
{(show_form_error && post_meta.position == 'after_the_percentage' && (post_meta.g_data_ad_client == '' || parseInt(quads_post_meta.after_the_percentage_value) < 10 || parseInt(quads_post_meta.after_the_percentage_value) > 101)) ? <div className="quads_form_msg"><span className="material-icons">
|
105 |
+
error_outline</span>Percentage should be
|
106 |
+
between 10 to 100</div> :''}
|
107 |
+
|
108 |
{post_meta.position == 'after_image' ?
|
109 |
<label>
|
110 |
<input checked={post_meta.image_caption} name="image_caption" onChange={this.props.adFormChangeHandler} type="checkbox"/>
|
@@ -27,4 +27,7 @@ and open the template in the editor.
|
|
27 |
}
|
28 |
#repeat_paragraph+label {
|
29 |
text-transform: none;
|
|
|
|
|
|
|
30 |
}
|
27 |
}
|
28 |
#repeat_paragraph+label {
|
29 |
text-transform: none;
|
30 |
+
}
|
31 |
+
.quads-settings-group .quads-tr-position .quads-position-dropdown select{
|
32 |
+
width: 311px
|
33 |
}
|
@@ -41,6 +41,14 @@ class QuadsLayout extends Component {
|
|
41 |
</td>
|
42 |
</tr>
|
43 |
{post_meta.ad_label_check ?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
<tr>
|
45 |
<td><label>{__('Ad Label Position', 'quick-adsense-reloaded')}</label></td>
|
46 |
<td>
|
@@ -51,14 +59,7 @@ class QuadsLayout extends Component {
|
|
51 |
</td>
|
52 |
</tr>
|
53 |
: null }
|
54 |
-
|
55 |
-
<tr>
|
56 |
-
<td><label>{__('Ad Label Text', 'quick-adsense-reloaded')}</label></td>
|
57 |
-
<td>
|
58 |
-
<input onChange={this.props.adFormChangeHandler} type="text" className="small-text" id="ad_label_text" name="ad_label_text" value={post_meta.ad_label_text}/>
|
59 |
-
</td>
|
60 |
-
</tr>
|
61 |
-
: null }
|
62 |
</tbody>
|
63 |
</table>
|
64 |
</div>
|
41 |
</td>
|
42 |
</tr>
|
43 |
{post_meta.ad_label_check ?
|
44 |
+
<tr>
|
45 |
+
<td><label>{__('Ad Label Text', 'quick-adsense-reloaded')}</label></td>
|
46 |
+
<td>
|
47 |
+
<input onChange={this.props.adFormChangeHandler} type="text" className="small-text" id="ad_label_text" name="ad_label_text" value={post_meta.ad_label_text}/>
|
48 |
+
</td>
|
49 |
+
</tr>
|
50 |
+
: null }
|
51 |
+
{post_meta.ad_label_check ?
|
52 |
<tr>
|
53 |
<td><label>{__('Ad Label Position', 'quick-adsense-reloaded')}</label></td>
|
54 |
<td>
|
59 |
</td>
|
60 |
</tr>
|
61 |
: null }
|
62 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
</tbody>
|
64 |
</table>
|
65 |
</div>
|
@@ -32,7 +32,8 @@ class QuadsVisibility extends Component {
|
|
32 |
{label:'Post Format', value:'post_format'},
|
33 |
{label:'Page', value:'page'},
|
34 |
{label:'Taxonomy Terms', value:'taxonomy'},
|
35 |
-
{label:'Tags', value:'tags'}
|
|
|
36 |
]
|
37 |
};
|
38 |
}
|
32 |
{label:'Post Format', value:'post_format'},
|
33 |
{label:'Page', value:'page'},
|
34 |
{label:'Taxonomy Terms', value:'taxonomy'},
|
35 |
+
{label:'Tags', value:'tags'},
|
36 |
+
{label:'Page Template', value:'page_template'}
|
37 |
]
|
38 |
};
|
39 |
}
|
@@ -51,14 +51,42 @@ class QuadsAdListSettings extends Component {
|
|
51 |
multiTagsValue : [],
|
52 |
multiPluginsValue : []
|
53 |
},
|
54 |
-
quads_wp_quads_pro_license_key : '',
|
|
|
|
|
55 |
};
|
56 |
}
|
57 |
handleCopy = () => {
|
58 |
copy(this.state.textToCopy);
|
59 |
this.setState({ copied: true });
|
60 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
|
|
62 |
open_global_excluder = () => {
|
63 |
this.setState({global_excluder_modal:true});
|
64 |
}
|
@@ -244,7 +272,7 @@ handleMultiPluginsChange = (option) => {
|
|
244 |
|
245 |
}
|
246 |
closeQuerySuccess = (e) => {
|
247 |
-
this.setState({customer_querey_success: ''});
|
248 |
}
|
249 |
closeQueryError = (e) => {
|
250 |
this.setState({customer_querey_error: ''});
|
@@ -738,7 +766,7 @@ handleMultiPluginsChange = (option) => {
|
|
738 |
<span className="quads-slider"></span>
|
739 |
</label>
|
740 |
|
741 |
-
{
|
742 |
</td>
|
743 |
</tr>
|
744 |
{
|
@@ -811,19 +839,30 @@ handleMultiPluginsChange = (option) => {
|
|
811 |
<a href={`${quads_localize_data.rest_url}quads-route/export-settings`} className="quads-btn quads-btn-primary">Export</a>
|
812 |
<p>{__('Export the Quick AdSense Reloaded settings for this site as a .json file. This allows you to easily import the configuration into another site.', 'quick-adsense-reloaded')}</p>
|
813 |
</td>
|
814 |
-
</tr>
|
815 |
-
|
816 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
817 |
<td>
|
818 |
-
<
|
819 |
-
|
|
|
820 |
</td>
|
821 |
-
</tr>
|
822 |
</tbody>
|
823 |
</table>
|
824 |
|
825 |
</div>
|
826 |
-
|
|
|
827 |
case "settings_google_autoads": return(
|
828 |
<div className="quads-settings-tab-container">
|
829 |
<div className="quads-help-support">
|
51 |
multiTagsValue : [],
|
52 |
multiPluginsValue : []
|
53 |
},
|
54 |
+
quads_wp_quads_pro_license_key : '',
|
55 |
+
importampforwpmsg : "",
|
56 |
+
importampforwpmsgprocessing : "",
|
57 |
};
|
58 |
}
|
59 |
handleCopy = () => {
|
60 |
copy(this.state.textToCopy);
|
61 |
this.setState({ copied: true });
|
62 |
}
|
63 |
+
importampforwpdata = () => {
|
64 |
+
if(this.state.importampforwpmsgprocessing !=''){
|
65 |
+
return;
|
66 |
+
}
|
67 |
+
this.setState({importampforwpmsgprocessing: 'Importing Ads'});
|
68 |
+
const url = quads_localize_data.rest_url + 'quads-route/import-ampforwp-ads';
|
69 |
+
fetch(url,{
|
70 |
+
method: "post",
|
71 |
+
headers: {
|
72 |
+
'Accept': 'application/json',
|
73 |
+
'Content-Type': 'application/json',
|
74 |
+
'X-WP-Nonce': quads_localize_data.nonce,
|
75 |
+
}
|
76 |
+
})
|
77 |
+
.then(res => res.json())
|
78 |
+
.then(
|
79 |
+
(result) => {
|
80 |
+
if(result.status === 't'){
|
81 |
+
this.setState({importampforwpmsg: result.data,importampforwpmsgprocessing:''});
|
82 |
+
}
|
83 |
+
},
|
84 |
+
(error) => {
|
85 |
+
|
86 |
+
}
|
87 |
+
);
|
88 |
|
89 |
+
}
|
90 |
open_global_excluder = () => {
|
91 |
this.setState({global_excluder_modal:true});
|
92 |
}
|
272 |
|
273 |
}
|
274 |
closeQuerySuccess = (e) => {
|
275 |
+
this.setState({customer_querey_success: '',importampforwpmsg: ''});
|
276 |
}
|
277 |
closeQueryError = (e) => {
|
278 |
this.setState({customer_querey_error: ''});
|
766 |
<span className="quads-slider"></span>
|
767 |
</label>
|
768 |
|
769 |
+
{this.state.adsTxtEnabled ? <span onClick={this.open_ad_text_modal} className="quads-generic-icon dashicons dashicons-admin-generic"></span> : ''}
|
770 |
</td>
|
771 |
</tr>
|
772 |
{
|
839 |
<a href={`${quads_localize_data.rest_url}quads-route/export-settings`} className="quads-btn quads-btn-primary">Export</a>
|
840 |
<p>{__('Export the Quick AdSense Reloaded settings for this site as a .json file. This allows you to easily import the configuration into another site.', 'quick-adsense-reloaded')}</p>
|
841 |
</td>
|
842 |
+
</tr>
|
843 |
+
</tbody>
|
844 |
+
</table>
|
845 |
+
|
846 |
+
</div>
|
847 |
+
);
|
848 |
+
case "settings_importer": return(
|
849 |
+
<div className="quads-settings-tab-container">
|
850 |
+
<table className="form-table" role="presentation">
|
851 |
+
<tbody>
|
852 |
+
<tr>
|
853 |
+
<th><label>{__('AMP for WP Ads', 'quick-adsense-reloaded')}</label></th>
|
854 |
<td>
|
855 |
+
<a className="quads-btn quads-btn-primary" id="import_amp_for_wp" onClick={this.importampforwpdata}>{__('Import', 'quick-adsense-reloaded')}</a>
|
856 |
+
{this.state.importampforwpmsg ? <Alert severity="success" action={<Icon onClick={this.closeQuerySuccess}>close</Icon>}>{this.state.importampforwpmsg}</Alert> : null}
|
857 |
+
{this.state.importampforwpmsgprocessing ? <div className='updating-message importampforwpmsgprocessing'><p>Importing Ads</p></div>: ''}
|
858 |
</td>
|
859 |
+
</tr>
|
860 |
</tbody>
|
861 |
</table>
|
862 |
|
863 |
</div>
|
864 |
+
|
865 |
+
);
|
866 |
case "settings_google_autoads": return(
|
867 |
<div className="quads-settings-tab-container">
|
868 |
<div className="quads-help-support">
|
@@ -108,4 +108,9 @@ a.quads-nav-link-active {
|
|
108 |
}
|
109 |
.quads-save-settings{
|
110 |
padding: 25px;
|
|
|
|
|
|
|
|
|
|
|
111 |
}
|
108 |
}
|
109 |
.quads-save-settings{
|
110 |
padding: 25px;
|
111 |
+
}
|
112 |
+
.importampforwpmsgprocessing{
|
113 |
+
background-color: rgb(237, 247, 237);
|
114 |
+
padding: 6px 16px;
|
115 |
+
font-size: 0.875rem;
|
116 |
}
|
@@ -28,6 +28,7 @@ class QuadsAdSettingsNavLink extends Component {
|
|
28 |
<li><h2><Link to={'admin.php?page=quads-settings&path=settings'} className={current == 'settings' ? 'quads-nav-link quads-nav-link-active' : 'quads-nav-link'}>{__('Features', 'quick-adsense-reloaded')}</Link></h2></li>
|
29 |
{/* <li><h2><Link to={'admin.php?page=quads-settings&path=main_settings_importer'} className="quads-nav-link">{__('Migrator', 'quick-adsense-reloaded')}</Link></h2></li> */}
|
30 |
<li><h2><Link to={'admin.php?page=quads-settings&path=settings_tools'} className={current == 'settings_tools' ? 'quads-nav-link quads-nav-link-active' : 'quads-nav-link'}>{__('Tools', 'quick-adsense-reloaded')}</Link></h2></li>
|
|
|
31 |
<li><h2><Link to={'admin.php?page=quads-settings&path=settings_legacy'} className={current == 'settings_legacy' ? 'quads-nav-link quads-nav-link-active' : 'quads-nav-link'}>{__('Legacy', 'quick-adsense-reloaded')}</Link></h2></li>
|
32 |
<li><h2><Link to={'admin.php?page=quads-settings&path=settings_support'} className={current == 'settings_support' ? 'quads-nav-link quads-nav-link-active' : 'quads-nav-link'}>{__('Help & Support', 'quick-adsense-reloaded')}</Link></h2></li>
|
33 |
{quads_localize_data.is_pro ?
|
28 |
<li><h2><Link to={'admin.php?page=quads-settings&path=settings'} className={current == 'settings' ? 'quads-nav-link quads-nav-link-active' : 'quads-nav-link'}>{__('Features', 'quick-adsense-reloaded')}</Link></h2></li>
|
29 |
{/* <li><h2><Link to={'admin.php?page=quads-settings&path=main_settings_importer'} className="quads-nav-link">{__('Migrator', 'quick-adsense-reloaded')}</Link></h2></li> */}
|
30 |
<li><h2><Link to={'admin.php?page=quads-settings&path=settings_tools'} className={current == 'settings_tools' ? 'quads-nav-link quads-nav-link-active' : 'quads-nav-link'}>{__('Tools', 'quick-adsense-reloaded')}</Link></h2></li>
|
31 |
+
<li><h2><Link to={'admin.php?page=quads-settings&path=settings_importer'} className={current == 'settings_importer' ? 'quads-nav-link quads-nav-link-active' : 'quads-nav-link'}>{__('Importer', 'quick-adsense-reloaded')}</Link></h2></li>
|
32 |
<li><h2><Link to={'admin.php?page=quads-settings&path=settings_legacy'} className={current == 'settings_legacy' ? 'quads-nav-link quads-nav-link-active' : 'quads-nav-link'}>{__('Legacy', 'quick-adsense-reloaded')}</Link></h2></li>
|
33 |
<li><h2><Link to={'admin.php?page=quads-settings&path=settings_support'} className={current == 'settings_support' ? 'quads-nav-link quads-nav-link-active' : 'quads-nav-link'}>{__('Help & Support', 'quick-adsense-reloaded')}</Link></h2></li>
|
34 |
{quads_localize_data.is_pro ?
|
Binary file
|
Binary file
|
@@ -47,13 +47,13 @@ class QUADS_Ad_Setup_Api_Service {
|
|
47 |
|
48 |
$choices[] = array('label' => 'Default Template', 'value' => 'default');
|
49 |
|
50 |
-
$templates = get_page_templates();
|
51 |
|
52 |
if($templates){
|
53 |
|
54 |
foreach($templates as $k => $v){
|
55 |
|
56 |
-
$choices[] = array('label' => $
|
57 |
|
58 |
}
|
59 |
|
@@ -344,7 +344,8 @@ class QUADS_Ad_Setup_Api_Service {
|
|
344 |
$response = array();
|
345 |
if(count($this->amp_front_loop)==0){
|
346 |
$query_data = get_posts($arg);
|
347 |
-
$post_meta = array();
|
|
|
348 |
foreach ($query_data as $key => $value) {
|
349 |
$data = array();
|
350 |
$data['post_id'] = $value->ID;
|
@@ -384,7 +385,16 @@ class QUADS_Ad_Setup_Api_Service {
|
|
384 |
|
385 |
if($key == 'QckTags'){
|
386 |
$quads_options['quicktags'] = array($key => $val);
|
387 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
388 |
$quads_options[$key] = $val;
|
389 |
}
|
390 |
|
47 |
|
48 |
$choices[] = array('label' => 'Default Template', 'value' => 'default');
|
49 |
|
50 |
+
$templates = wp_get_theme()->get_page_templates();
|
51 |
|
52 |
if($templates){
|
53 |
|
54 |
foreach($templates as $k => $v){
|
55 |
|
56 |
+
$choices[] = array('label' => $v, 'value' => $k);
|
57 |
|
58 |
}
|
59 |
|
344 |
$response = array();
|
345 |
if(count($this->amp_front_loop)==0){
|
346 |
$query_data = get_posts($arg);
|
347 |
+
$post_meta = array();
|
348 |
+
$posts_data = array();
|
349 |
foreach ($query_data as $key => $value) {
|
350 |
$data = array();
|
351 |
$data['post_id'] = $value->ID;
|
385 |
|
386 |
if($key == 'QckTags'){
|
387 |
$quads_options['quicktags'] = array($key => $val);
|
388 |
+
}else if($key == 'adsTxtText' ){
|
389 |
+
if($parameters['adsTxtEnabled']){
|
390 |
+
if (false !== file_put_contents(ABSPATH . 'ads.txt', $val)) {
|
391 |
+
// show notice that ads.txt has been created
|
392 |
+
set_transient('quads_vi_ads_txt_notice', true, 300);
|
393 |
+
}else{
|
394 |
+
set_transient('quads_vi_ads_txt_error', true, 300);
|
395 |
+
}
|
396 |
+
}
|
397 |
+
} else{
|
398 |
$quads_options[$key] = $val;
|
399 |
}
|
400 |
|
@@ -144,8 +144,567 @@ class QUADS_Ad_Setup_Api {
|
|
144 |
return current_user_can( 'manage_options' );
|
145 |
}
|
146 |
));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
|
148 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
public function quadsSubscribeNewsletter($request){
|
150 |
$parameters = $request->get_params();
|
151 |
$api_url = 'http://magazine3.company/wp-json/api/central/email/subscribe';
|
@@ -371,6 +930,7 @@ class QUADS_Ad_Setup_Api {
|
|
371 |
$add = array('none' => 'Exclude nothing');
|
372 |
$quads_settings['auto_ads_get_post_types'] = $add + $post_types;
|
373 |
$quads_settings['autoads_excl_user_roles'] = array_merge(array('none' => 'Exclude nothing'), $this->quads_get_user_roles_api());
|
|
|
374 |
return $quads_settings;
|
375 |
}
|
376 |
public function getConditionList($request_data){
|
144 |
return current_user_can( 'manage_options' );
|
145 |
}
|
146 |
));
|
147 |
+
register_rest_route( 'quads-route', 'import-ampforwp-ads', array(
|
148 |
+
'methods' => 'POST',
|
149 |
+
'callback' => array($this, 'importampforwp_ads'),
|
150 |
+
'permission_callback' => function(){
|
151 |
+
return current_user_can( 'manage_options' );
|
152 |
+
}
|
153 |
+
));
|
154 |
|
155 |
}
|
156 |
+
/** Here we are importing AMP for WP and advance Amp ads to Quads**/
|
157 |
+
public function importampforwp_ads(){
|
158 |
+
global $redux_builder_amp;
|
159 |
+
$args = array(
|
160 |
+
'post_type' => 'quads-ads'
|
161 |
+
);
|
162 |
+
$the_query = new WP_Query( $args );
|
163 |
+
$ad_count = $the_query->found_posts;
|
164 |
+
$post_status = 'publish';
|
165 |
+
$amp_options = get_option('redux_builder_amp');
|
166 |
+
$user_id = get_current_user_id();
|
167 |
+
$after_the_percentage_value = '';
|
168 |
+
|
169 |
+
for($i=1; $i<=6; $i++){
|
170 |
+
if($amp_options['enable-amp-ads-'.$i] != 1){
|
171 |
+
continue;
|
172 |
+
}
|
173 |
+
$ad_type = $amp_options['enable-amp-ads-type-'.$i];
|
174 |
+
if(($ad_type== 'adsense' && (empty($amp_options['enable-amp-ads-text-feild-client-'.$i]) || empty($amp_options['enable-amp-ads-text-feild-slot-'.$i]))) || ($ad_type== 'mgid' && (empty($amp_options['enable-amp-ads-mgid-field-data-pub-'.$i]) || empty($amp_options['enable-amp-ads-mgid-field-data-widget-'.$i])))){
|
175 |
+
continue;
|
176 |
+
}
|
177 |
+
$ad_count++;
|
178 |
+
switch ($i) {
|
179 |
+
case 1:
|
180 |
+
$position = 'amp_below_the_header';
|
181 |
+
break;
|
182 |
+
case 2:
|
183 |
+
$position = 'amp_below_the_footer';
|
184 |
+
break;
|
185 |
+
case 3:
|
186 |
+
$position = 'amp_above_the_post_content';
|
187 |
+
break;
|
188 |
+
case 4:
|
189 |
+
$position = 'amp_below_the_post_content';
|
190 |
+
break;
|
191 |
+
case 5:
|
192 |
+
$position = 'amp_below_the_title';
|
193 |
+
break;
|
194 |
+
case 6:
|
195 |
+
$position = 'amp_above_related_post';
|
196 |
+
break;
|
197 |
+
}
|
198 |
+
switch ($amp_options['enable-amp-ads-select-'.$i]) {
|
199 |
+
case '1':
|
200 |
+
$g_data_ad_width = '300';
|
201 |
+
$g_data_ad_height = '250';
|
202 |
+
break;
|
203 |
+
case '2':
|
204 |
+
$g_data_ad_width = '336';
|
205 |
+
$g_data_ad_height = '280';
|
206 |
+
break;
|
207 |
+
case '3':
|
208 |
+
$g_data_ad_width = '728';
|
209 |
+
$g_data_ad_height = '90';
|
210 |
+
break;
|
211 |
+
case '4':
|
212 |
+
$g_data_ad_width = '300';
|
213 |
+
$g_data_ad_height = '600';
|
214 |
+
break;
|
215 |
+
case '5':
|
216 |
+
$g_data_ad_width = '320';
|
217 |
+
$g_data_ad_height = '100';
|
218 |
+
break;
|
219 |
+
case '6':
|
220 |
+
$g_data_ad_width = '200';
|
221 |
+
$g_data_ad_height = '50';
|
222 |
+
break;
|
223 |
+
case '7':
|
224 |
+
$g_data_ad_width = '320';
|
225 |
+
$g_data_ad_height = '50';
|
226 |
+
break;
|
227 |
+
default:
|
228 |
+
$g_data_ad_width = '300';
|
229 |
+
$g_data_ad_height= '250';
|
230 |
+
break;
|
231 |
+
}
|
232 |
+
if($ad_type== 'mgid'){
|
233 |
+
if($i == 2){
|
234 |
+
$position = 'ad_shortcode';
|
235 |
+
}
|
236 |
+
$post_title ='MGID Ad '.$i.' (Migrated from AMP)';
|
237 |
+
$g_data_ad_width = $amp_options['enable-amp-ads-mgid-width-'.$i];
|
238 |
+
$g_data_ad_height= $amp_options['enable-amp-ads-mgid-height-'.$i];
|
239 |
+
}else{
|
240 |
+
$post_title ='Adsense Ad '.$i.' (Migrated from AMP)';
|
241 |
+
}
|
242 |
+
$ads_post = array(
|
243 |
+
'post_author' => $user_id,
|
244 |
+
'post_title' => $post_title,
|
245 |
+
'post_status' => $post_status,
|
246 |
+
'post_name' => $post_title,
|
247 |
+
'post_type' => 'quads-ads',
|
248 |
+
|
249 |
+
);
|
250 |
+
if($amp_options['enable-amp-ads-resp-'.$i]){
|
251 |
+
$adsense_type = 'responsive';
|
252 |
+
}else{
|
253 |
+
$adsense_type = 'normal';
|
254 |
+
}
|
255 |
+
$post_id = wp_insert_post($ads_post);
|
256 |
+
$visibility_include =array();
|
257 |
+
if($i == 3){
|
258 |
+
$display_on = $amp_options['made-amp-ad-3-global'];
|
259 |
+
$j =0;
|
260 |
+
foreach ($display_on as $display_on_data) {
|
261 |
+
switch ($display_on_data) {
|
262 |
+
case '1':
|
263 |
+
$visibility_include[$j]['type']['label'] = 'Post Type';
|
264 |
+
$visibility_include[$j]['type']['value'] = 'post_type';
|
265 |
+
$visibility_include[$j]['value']['label'] = "post";
|
266 |
+
$visibility_include[$j]['value']['value'] = "post";
|
267 |
+
$j++;
|
268 |
+
break;
|
269 |
+
case '2':
|
270 |
+
$visibility_include[$j]['type']['label'] = 'Post Type';
|
271 |
+
$visibility_include[$j]['type']['value'] = 'post_type';
|
272 |
+
$visibility_include[$j]['value']['label'] = "page";
|
273 |
+
$visibility_include[$j]['value']['value'] = "page";
|
274 |
+
$j++;
|
275 |
+
break;
|
276 |
+
case '4':
|
277 |
+
$visibility_include[$j]['type']['label'] = 'General';
|
278 |
+
$visibility_include[$j]['type']['value'] = 'general';
|
279 |
+
$visibility_include[$j]['value']['label'] = "Show Globally";
|
280 |
+
$visibility_include[$j]['value']['value'] = "show_globally";
|
281 |
+
$j++;
|
282 |
+
break;
|
283 |
+
}
|
284 |
+
}
|
285 |
+
}else{
|
286 |
+
$visibility_include[0]['type']['label'] = 'General';
|
287 |
+
$visibility_include[0]['type']['value'] = 'general';
|
288 |
+
$visibility_include[0]['value']['label'] = "Show Globally";
|
289 |
+
$visibility_include[0]['value']['value'] = "show_globally";
|
290 |
+
}
|
291 |
+
|
292 |
+
$adforwp_meta_key = array(
|
293 |
+
'ad_type' => $ad_type ,
|
294 |
+
'g_data_ad_client' => $amp_options['enable-amp-ads-text-feild-client-'.$i],
|
295 |
+
'g_data_ad_slot' => $amp_options['enable-amp-ads-text-feild-slot-'.$i],
|
296 |
+
'data_publisher' => $amp_options['enable-amp-ads-mgid-field-data-pub-'.$i],
|
297 |
+
'data_widget' => $amp_options['enable-amp-ads-mgid-field-data-widget-'.$i],
|
298 |
+
'data_container' => $amp_options['enable-amp-ads-mgid-field-data-con-'.$i],
|
299 |
+
'g_data_ad_width' => $g_data_ad_width,
|
300 |
+
'g_data_ad_height' => $g_data_ad_height,
|
301 |
+
'adsense_type' => $adsense_type,
|
302 |
+
'enabled_on_amp' => 1,
|
303 |
+
'visibility_include' => $visibility_include,
|
304 |
+
'position' => $position,
|
305 |
+
'imported_from' => 'ampforwp_ads',
|
306 |
+
'label' => $post_title,
|
307 |
+
'ad_id' => $post_id,
|
308 |
+
'code' => '',
|
309 |
+
'enable_one_end_of_post' =>'',
|
310 |
+
'quads_ad_old_id' => 'ad'.$ad_count,
|
311 |
+
'ad_label_check' => $amp_options['ampforwp-ads-sponsorship'],
|
312 |
+
'ad_label_text' => $amp_options['ampforwp-ads-sponsorship-label'],
|
313 |
+
);
|
314 |
+
|
315 |
+
foreach ($adforwp_meta_key as $key => $val){
|
316 |
+
update_post_meta($post_id, $key, $val);
|
317 |
+
}
|
318 |
+
}
|
319 |
+
if ( defined( 'ADVANCED_AMP_ADS_VERSION' ) ) {
|
320 |
+
// Incontent Ads
|
321 |
+
for($i=1; $i<=6; $i++){
|
322 |
+
if($redux_builder_amp['ampforwp-incontent-ad-'.$i] != 1){
|
323 |
+
continue;
|
324 |
+
}
|
325 |
+
$ad_type = $redux_builder_amp['ampforwp-advertisement-type-incontent-ad-'.$i];
|
326 |
+
$ad_type_label = '';
|
327 |
+
if($ad_type== '4'){
|
328 |
+
continue;
|
329 |
+
}
|
330 |
+
if(($ad_type== '1' && (empty($redux_builder_amp['ampforwp-adsense-ad-data-ad-client-incontent-ad-'.$i]) || empty($redux_builder_amp['ampforwp-adsense-ad-data-ad-slot-incontent-ad-'.$i]))) || ($ad_type== '5' && (empty($redux_builder_amp['ampforwp-mgid-ad-Data-Publisher-incontent-ad-'.$i]) || empty($redux_builder_amp['ampforwp-mgid-ad-Data-Widget-incontent-ad-'.$i])))){
|
331 |
+
continue;
|
332 |
+
}
|
333 |
+
$ad_count++;
|
334 |
+
$g_data_ad_width = '';
|
335 |
+
$g_data_ad_height= '';
|
336 |
+
if($ad_type == '1'){
|
337 |
+
$ad_type_label = 'adsense';
|
338 |
+
$post_title = 'Adsense Ad '.$i.' Incontent Ad (Migrated from AMP)';
|
339 |
+
$g_data_ad_width = $redux_builder_amp['ampforwp-adsense-ad-width-incontent-ad-'.$i];
|
340 |
+
$g_data_ad_height = $redux_builder_amp['ampforwp-adsense-ad-height-incontent-ad-'.$i];
|
341 |
+
$position = $redux_builder_amp['ampforwp-adsense-ad-position-incontent-ad-'.$i];
|
342 |
+
}else if($ad_type == '2'){
|
343 |
+
$ad_type_label = 'double_click';
|
344 |
+
$post_title = 'DoubleClick Ad '.$i.' Incontent Ad (Migrated from AMP)';
|
345 |
+
$g_data_ad_width = $redux_builder_amp['ampforwp-doubleclick-ad-width-incontent-ad-'.$i];
|
346 |
+
$g_data_ad_height = $redux_builder_amp['ampforwp-doubleclick-ad-height-incontent-ad-'.$i];
|
347 |
+
$position = $redux_builder_amp['ampforwp-doubleclick-ad-position-incontent-ad-'.$i];
|
348 |
+
}else if($ad_type == '3'){
|
349 |
+
$ad_type_label = 'plain_text';
|
350 |
+
$post_title = 'Plain Text Ad '.$i.' Incontent Ad (Migrated from AMP)';
|
351 |
+
$position = $redux_builder_amp['ampforwp-custom-ads-ad-position-incontent-ad-'.$i];
|
352 |
+
}else if($ad_type == '5'){
|
353 |
+
$ad_type_label = 'mgid';
|
354 |
+
$post_title ='MGID Ad '.$i.' Incontent Ad (Migrated from AMP)';
|
355 |
+
$g_data_ad_width = $redux_builder_amp['ampforwp-mgid-ad-width-incontent-ad-'.$i];
|
356 |
+
$g_data_ad_height = $redux_builder_amp['ampforwp-mgid-ad-height-incontent-ad-'.$i];
|
357 |
+
$position = $redux_builder_amp['ampforwp-mgid-ad-position-incontent-ad-'.$i];
|
358 |
+
}
|
359 |
+
if($redux_builder_amp['adsense-rspv-ad-incontent-'.$i]){
|
360 |
+
$adsense_type = 'responsive';
|
361 |
+
}else{
|
362 |
+
$adsense_type = 'normal';
|
363 |
+
}
|
364 |
+
$ads_post = array(
|
365 |
+
'post_author' => $user_id,
|
366 |
+
'post_title' => $post_title,
|
367 |
+
'post_status' => $post_status,
|
368 |
+
'post_name' => $post_title,
|
369 |
+
'post_type' => 'quads-ads',
|
370 |
+
);
|
371 |
+
$post_id = wp_insert_post($ads_post);
|
372 |
+
$visibility_include =array();
|
373 |
+
|
374 |
+
$visibility_include[0]['type']['label'] = 'Post Type';
|
375 |
+
$visibility_include[0]['type']['value'] = 'post_type';
|
376 |
+
$visibility_include[0]['value']['label'] = "post";
|
377 |
+
$visibility_include[0]['value']['value'] = "post";
|
378 |
+
$doubleclick_ad_data_slot = explode('/', $redux_builder_amp['ampforwp-doubleclick-ad-data-slot-incontent-ad-'.$i]);
|
379 |
+
$adlabel = 'above';
|
380 |
+
if($redux_builder_amp['ampforwp-ad-sponsorship-location'] == '2'){
|
381 |
+
$adlabel = 'below';
|
382 |
+
}
|
383 |
+
$paragraph_number = '1';
|
384 |
+
|
385 |
+
switch ($position) {
|
386 |
+
case '20-percent':
|
387 |
+
$position = 'after_the_percentage';
|
388 |
+
$after_the_percentage_value = '20';
|
389 |
+
break;
|
390 |
+
case '40-percent':
|
391 |
+
$position = 'after_the_percentage';
|
392 |
+
$after_the_percentage_value = '40';
|
393 |
+
break;
|
394 |
+
case '50-percent':
|
395 |
+
$position = 'after_the_percentage';
|
396 |
+
$after_the_percentage_value = '50';
|
397 |
+
break;
|
398 |
+
case '60-percent':
|
399 |
+
$position = 'after_the_percentage';
|
400 |
+
$after_the_percentage_value = '60';
|
401 |
+
break;
|
402 |
+
case '80-percent':
|
403 |
+
$position = 'after_the_percentage';
|
404 |
+
$after_the_percentage_value = '80';
|
405 |
+
break;
|
406 |
+
case 'custom':
|
407 |
+
$position = 'code';
|
408 |
+
break;
|
409 |
+
default:
|
410 |
+
if(is_numeric($position)){
|
411 |
+
$paragraph_number = $position;
|
412 |
+
$position = 'after_paragraph';
|
413 |
+
}
|
414 |
+
break;
|
415 |
+
}
|
416 |
+
$network_code = '';
|
417 |
+
$doubleclick_flag = 2;
|
418 |
+
if(isset($doubleclick_ad_data_slot[0]) && !empty($doubleclick_ad_data_slot[0])){
|
419 |
+
$doubleclick_flag = 3;
|
420 |
+
$network_code = $doubleclick_ad_data_slot[0];
|
421 |
+
}
|
422 |
+
if(isset($doubleclick_ad_data_slot[1]) && !empty($doubleclick_ad_data_slot[1])){
|
423 |
+
if($doubleclick_flag == 3){
|
424 |
+
$ad_unit_name = $doubleclick_ad_data_slot[1];
|
425 |
+
}else{
|
426 |
+
$network_code = $doubleclick_ad_data_slot[1];
|
427 |
+
if(isset($doubleclick_ad_data_slot[2]) && !empty($doubleclick_ad_data_slot[2])){
|
428 |
+
$ad_unit_name = $doubleclick_ad_data_slot[2];
|
429 |
+
}
|
430 |
+
}
|
431 |
+
}
|
432 |
+
|
433 |
+
$adforwp_meta_key = array(
|
434 |
+
'ad_type' => $ad_type_label ,
|
435 |
+
'g_data_ad_client' => $redux_builder_amp['ampforwp-adsense-ad-data-ad-client-incontent-ad-'.$i],
|
436 |
+
'g_data_ad_slot' => $redux_builder_amp['ampforwp-adsense-ad-data-ad-slot-incontent-ad-'.$i],
|
437 |
+
'data_publisher' => $redux_builder_amp['ampforwp-mgid-ad-Data-Publisher-incontent-ad-'.$i],
|
438 |
+
'data_widget' => $redux_builder_amp['ampforwp-mgid-ad-Data-Widget-incontent-ad-'.$i],
|
439 |
+
'data_container' => $redux_builder_amp['ampforwp-mgid-ad-Data-Container-incontent-ad-'.$i],
|
440 |
+
'network_code' => $network_code,
|
441 |
+
'ad_unit_name' => $ad_unit_name,
|
442 |
+
'code' => $redux_builder_amp['ampforwp-custom-advertisement-incontent-ad-'.$i],
|
443 |
+
'g_data_ad_width' => $g_data_ad_width,
|
444 |
+
'g_data_ad_height' => $g_data_ad_height,
|
445 |
+
'adsense_type' => $adsense_type,
|
446 |
+
'enabled_on_amp' => 1,
|
447 |
+
'visibility_include' => $visibility_include,
|
448 |
+
'position' => $position,
|
449 |
+
'after_the_percentage_value' => $after_the_percentage_value,
|
450 |
+
'paragraph_number' => $paragraph_number,
|
451 |
+
'imported_from' => 'ampforwp_ads',
|
452 |
+
'label' => $post_title,
|
453 |
+
'ad_id' => $post_id,
|
454 |
+
'enable_one_end_of_post' =>'',
|
455 |
+
'quads_ad_old_id' => 'ad'.$ad_count,
|
456 |
+
'ad_label_check' => $redux_builder_amp['ampforwp-ad-sponsorship'],
|
457 |
+
'adlabel' => $adlabel,
|
458 |
+
'ad_label_text' => $redux_builder_amp['ampforwp-ad-sponsorship-label'],
|
459 |
+
);
|
460 |
+
|
461 |
+
foreach ($adforwp_meta_key as $key => $val){
|
462 |
+
update_post_meta($post_id, $key, $val);
|
463 |
+
}
|
464 |
+
|
465 |
+
require_once QUADS_PLUGIN_DIR . '/admin/includes/migration-service.php';
|
466 |
+
$this->migration_service = new QUADS_Ad_Migration();
|
467 |
+
$this->migration_service->quadsUpdateOldAd('ad'.$ad_count, $adforwp_meta_key);
|
468 |
+
|
469 |
+
}
|
470 |
+
// General Ads
|
471 |
+
for($i=1; $i<=10; $i++){
|
472 |
+
if($amp_options['ampforwp-standard-ads-'.$i] != 1){
|
473 |
+
continue;
|
474 |
+
}
|
475 |
+
$ad_type = $amp_options['ampforwp-advertisement-type-standard-'.$i];
|
476 |
+
if(($ad_type== '1' && (empty($redux_builder_amp['ampforwp-adsense-ad-data-ad-client-standard-'.$i]) || empty($redux_builder_amp['ampforwp-adsense-ad-data-ad-slot-standard-'.$i])))|| ($ad_type== '2' && empty($redux_builder_amp['ampforwp-doubleclick-ad-data-slot-standard-'.$i])) || ($ad_type== '5' && (empty($redux_builder_amp['ampforwp-mgid-data-ad-data-publisher-standard-'.$i]) || empty($redux_builder_amp['ampforwp-mgid-data-ad-data-widget-standard-'.$i])))){
|
477 |
+
continue;
|
478 |
+
}
|
479 |
+
$ad_count++;
|
480 |
+
switch ($i) {
|
481 |
+
case 1:
|
482 |
+
$position = 'amp_below_the_header';
|
483 |
+
break;
|
484 |
+
case 2:
|
485 |
+
$position = 'amp_below_the_footer';
|
486 |
+
break;
|
487 |
+
case 3:
|
488 |
+
$position = 'amp_above_the_footer';
|
489 |
+
break;
|
490 |
+
case 4:
|
491 |
+
$position = 'amp_above_the_post_content';
|
492 |
+
break;
|
493 |
+
case 5:
|
494 |
+
$position = 'amp_below_the_post_content';
|
495 |
+
break;
|
496 |
+
case 6:
|
497 |
+
$position = 'amp_below_the_title';
|
498 |
+
break;
|
499 |
+
case 7:
|
500 |
+
$position = 'amp_above_related_post';
|
501 |
+
break;
|
502 |
+
case 8:
|
503 |
+
$position = 'amp_below_author_box';
|
504 |
+
break;
|
505 |
+
case 9:
|
506 |
+
$position = 'amp_ads_in_loops';
|
507 |
+
break;
|
508 |
+
}
|
509 |
+
|
510 |
+
$g_data_ad_width = '';
|
511 |
+
$g_data_ad_height= '';
|
512 |
+
$adsense_type = 'normal';
|
513 |
+
if($ad_type == '1'){
|
514 |
+
$ad_type_label = 'adsense';
|
515 |
+
$post_title = 'Adsense Ad '.$i.' General Options (Migrated from AMP)';
|
516 |
+
$g_data_ad_width = $redux_builder_amp['ampforwp-adsense-ad-width-standard-'.$i];
|
517 |
+
$g_data_ad_height = $redux_builder_amp['ampforwp-adsense-ad-height-standard-'.$i];
|
518 |
+
if($amp_options['adsense-rspv-ad-type-standard-'.$i]){
|
519 |
+
$adsense_type = 'responsive';
|
520 |
+
}else{
|
521 |
+
$adsense_type = 'normal';
|
522 |
+
}
|
523 |
+
}else if($ad_type == '2'){
|
524 |
+
$ad_type_label = 'double_click';
|
525 |
+
$post_title = 'DoubleClick Ad '.$i.' General Options (Migrated from AMP)';
|
526 |
+
$g_data_ad_width = $redux_builder_amp['ampforwp-doubleclick-ad-width-standard-'.$i];
|
527 |
+
$g_data_ad_height = $redux_builder_amp['ampforwp-doubleclick-ad-height-standard-'.$i];
|
528 |
+
$adsense_type = 'normal';
|
529 |
+
}else if($ad_type == '3'){
|
530 |
+
$ad_type_label = 'plain_text';
|
531 |
+
$post_title = 'Ad '.$i.' General Options (Migrated from AMP)';
|
532 |
+
}else if($ad_type == '5'){
|
533 |
+
$ad_type_label = 'mgid';
|
534 |
+
$post_title ='MGID Ad '.$i.' General Options (Migrated from AMP)';
|
535 |
+
$g_data_ad_width = $redux_builder_amp['ampforwp-mgid-ad-width-standard-'.$i];
|
536 |
+
$g_data_ad_height = $redux_builder_amp['ampforwp-mgid-ad-height-standard-'.$i];
|
537 |
+
$adsense_type = 'normal';
|
538 |
+
}
|
539 |
+
$ads_post = array(
|
540 |
+
'post_author' => $user_id,
|
541 |
+
'post_title' => $post_title,
|
542 |
+
'post_status' => $post_status,
|
543 |
+
'post_name' => $post_title,
|
544 |
+
'post_type' => 'quads-ads',
|
545 |
+
|
546 |
+
);
|
547 |
+
$post_id = wp_insert_post($ads_post);
|
548 |
+
$visibility_include =array();
|
549 |
+
$visibility_include[0]['type']['label'] = 'Post Type';
|
550 |
+
$visibility_include[0]['type']['value'] = 'post_type';
|
551 |
+
$visibility_include[0]['value']['label'] = "post";
|
552 |
+
$visibility_include[0]['value']['value'] = "post";
|
553 |
+
|
554 |
+
$network_code = '';
|
555 |
+
$ad_unit_name = '';
|
556 |
+
$doubleclick_flag = 2;
|
557 |
+
$doubleclick_ad_data_slot = explode('/', $redux_builder_amp['ampforwp-doubleclick-ad-data-slot-standard-'.$i]);
|
558 |
+
if(isset($doubleclick_ad_data_slot[0]) && !empty($doubleclick_ad_data_slot[0])){
|
559 |
+
$doubleclick_flag = 3;
|
560 |
+
$network_code = $doubleclick_ad_data_slot[0];
|
561 |
+
}
|
562 |
+
if(isset($doubleclick_ad_data_slot[1]) && !empty($doubleclick_ad_data_slot[1])){
|
563 |
+
if($doubleclick_flag == 3){
|
564 |
+
$ad_unit_name = $doubleclick_ad_data_slot[1];
|
565 |
+
}else{
|
566 |
+
$network_code = $doubleclick_ad_data_slot[1];
|
567 |
+
if(isset($doubleclick_ad_data_slot[2]) && !empty($doubleclick_ad_data_slot[2])){
|
568 |
+
$ad_unit_name = $doubleclick_ad_data_slot[2];
|
569 |
+
}
|
570 |
+
}
|
571 |
+
}
|
572 |
+
|
573 |
+
$adforwp_meta_key = array(
|
574 |
+
'ad_type' => $ad_type_label ,
|
575 |
+
'g_data_ad_client' => $redux_builder_amp['ampforwp-adsense-ad-data-ad-client-standard-'.$i],
|
576 |
+
'g_data_ad_slot' => $redux_builder_amp['ampforwp-adsense-ad-data-ad-slot-standard-'.$i],
|
577 |
+
'data_publisher' => $redux_builder_amp['ampforwp-mgid-ad-Data-Publisher-standard-'.$i],
|
578 |
+
'data_widget' => $redux_builder_amp['ampforwp-mgid-ad-Data-Widget-standard-'.$i],
|
579 |
+
'data_container' => $redux_builder_amp['ampforwp-mgid-ad-Data-Container-standard-'.$i],
|
580 |
+
'network_code' => $network_code,
|
581 |
+
'ad_unit_name' => $ad_unit_name,
|
582 |
+
'code' => $redux_builder_amp['ampforwp-custom-advertisement-standard-'.$i],
|
583 |
+
'g_data_ad_width' => $g_data_ad_width,
|
584 |
+
'g_data_ad_height' => $g_data_ad_height,
|
585 |
+
'adsense_type' => $adsense_type,
|
586 |
+
'enabled_on_amp' => 1,
|
587 |
+
'visibility_include' => $visibility_include,
|
588 |
+
'position' => $position,
|
589 |
+
'imported_from' => 'ampforwp_ads',
|
590 |
+
'label' => $post_title,
|
591 |
+
'ad_id' => $post_id,
|
592 |
+
'enable_one_end_of_post' => '',
|
593 |
+
'quads_ad_old_id' => 'ad'.$ad_count,
|
594 |
+
'ad_label_check' => $redux_builder_amp['ampforwp-ad-sponsorship'],
|
595 |
+
'adlabel' => $adlabel,
|
596 |
+
'ad_label_text' => $redux_builder_amp['ampforwp-ad-sponsorship-label'],
|
597 |
+
);
|
598 |
+
|
599 |
+
foreach ($adforwp_meta_key as $key => $val){
|
600 |
+
update_post_meta($post_id, $key, $val);
|
601 |
+
}
|
602 |
+
require_once QUADS_PLUGIN_DIR . '/admin/includes/migration-service.php';
|
603 |
+
$this->migration_service = new QUADS_Ad_Migration();
|
604 |
+
$this->migration_service->quadsUpdateOldAd('ad'.$ad_count, $adforwp_meta_key);
|
605 |
+
}
|
606 |
+
|
607 |
+
if($amp_options['ampforwp-after-featured-image-ad']){
|
608 |
+
$ad_count++;
|
609 |
+
$ad_type = $amp_options['ampforwp-after-featured-image-ad-type'];
|
610 |
+
$g_data_ad_width = '';
|
611 |
+
$g_data_ad_height = '';
|
612 |
+
$adsense_type = 'normal';
|
613 |
+
if($ad_type == '1'){
|
614 |
+
$ad_type_label = 'adsense';
|
615 |
+
$post_title = 'Adsense Ad '.$ad_count.' (Migrated from AMP)';
|
616 |
+
$g_data_ad_width = $redux_builder_amp['ampforwp-after-featured-image-ad-type-1-width'];
|
617 |
+
$g_data_ad_height = $redux_builder_amp['ampforwp-after-featured-image-ad-type-1-height'];
|
618 |
+
if($redux_builder_amp['adsense-rspv-ad-after-featured-img']){
|
619 |
+
$adsense_type = 'responsive';
|
620 |
+
}else{
|
621 |
+
$adsense_type = 'normal';
|
622 |
+
}
|
623 |
+
}else if($ad_type == '2'){
|
624 |
+
$ad_type_label = 'double_click';
|
625 |
+
$post_title = 'DoubleClick Ad '.$ad_count.' (Migrated from AMP)';
|
626 |
+
$g_data_ad_width = $redux_builder_amp['ampforwp-after-featured-image-ad-type-2-width'];
|
627 |
+
$g_data_ad_height = $redux_builder_amp['ampforwp-after-featured-image-ad-type-2-height'];
|
628 |
+
}else if($ad_type == '3'){
|
629 |
+
$ad_type_label = 'plain_text';
|
630 |
+
$post_title = 'Adsense Ad '.$ad_count.' (Migrated from AMP)';
|
631 |
+
}else if($ad_type == '5'){
|
632 |
+
$ad_type_label = 'mgid';
|
633 |
+
$post_title = 'MGID Ad '.$ad_count.' (Migrated from AMP)';
|
634 |
+
$g_data_ad_width = $redux_builder_amp['ampforwp-after-featured-image-ad-type-5-width'];
|
635 |
+
$g_data_ad_height = $redux_builder_amp['ampforwp-after-featured-image-ad-type-5-height'];
|
636 |
+
}
|
637 |
+
$network_code = '';
|
638 |
+
$ad_unit_name = '';
|
639 |
+
$doubleclick_flag = 2;
|
640 |
+
$doubleclick_ad_data_slot = explode('/', $redux_builder_amp['ampforwp-after-featured-image-ad-type-2-ad-data-slot']);
|
641 |
+
if(isset($doubleclick_ad_data_slot[0]) && !empty($doubleclick_ad_data_slot[0])){
|
642 |
+
$doubleclick_flag = 3;
|
643 |
+
$network_code = $doubleclick_ad_data_slot[0];
|
644 |
+
}
|
645 |
+
if(isset($doubleclick_ad_data_slot[1]) && !empty($doubleclick_ad_data_slot[1])){
|
646 |
+
if($doubleclick_flag == 3){
|
647 |
+
$ad_unit_name = $doubleclick_ad_data_slot[1];
|
648 |
+
}else{
|
649 |
+
$network_code = $doubleclick_ad_data_slot[1];
|
650 |
+
if(isset($doubleclick_ad_data_slot[2]) && !empty($doubleclick_ad_data_slot[2])){
|
651 |
+
$ad_unit_name = $doubleclick_ad_data_slot[2];
|
652 |
+
}
|
653 |
+
}
|
654 |
+
}
|
655 |
+
|
656 |
+
$visibility_include =array();
|
657 |
+
$visibility_include[0]['type']['label'] = 'Post Type';
|
658 |
+
$visibility_include[0]['type']['value'] = 'post_type';
|
659 |
+
$visibility_include[0]['value']['label'] = "post";
|
660 |
+
$visibility_include[0]['value']['value'] = "post";
|
661 |
+
$ads_post = array(
|
662 |
+
'post_author' => $user_id,
|
663 |
+
'post_title' => $post_title,
|
664 |
+
'post_status' => $post_status,
|
665 |
+
'post_name' => $post_title,
|
666 |
+
'post_type' => 'quads-ads',
|
667 |
+
|
668 |
+
);
|
669 |
+
$post_id = wp_insert_post($ads_post);
|
670 |
+
|
671 |
+
$adforwp_meta_key = array(
|
672 |
+
'ad_type' => $ad_type_label ,
|
673 |
+
'g_data_ad_client' => $redux_builder_amp['ampforwp-after-featured-image-ad-type-1-data-ad-client'],
|
674 |
+
'g_data_ad_slot' => $redux_builder_amp['ampforwp-after-featured-image-ad-type-1-data-ad-slot'],
|
675 |
+
'data_publisher' => $redux_builder_amp['ampforwp-after-featured-image-ad-type-5-Data-publisher'],
|
676 |
+
'data_widget' => $redux_builder_amp['ampforwp-after-featured-image-ad-type-5-Data-widget'],
|
677 |
+
'data_container' => $redux_builder_amp['ampforwp-after-featured-image-ad-type-5-Data-Container'],
|
678 |
+
'network_code' => $network_code,
|
679 |
+
'ad_unit_name' => $ad_unit_name,
|
680 |
+
'code' => $redux_builder_amp['ampforwp-after-featured-image-ad-custom-advertisement'],
|
681 |
+
'g_data_ad_width' => $g_data_ad_width,
|
682 |
+
'g_data_ad_height' => $g_data_ad_height,
|
683 |
+
'adsense_type' => $adsense_type,
|
684 |
+
'enabled_on_amp' => 1,
|
685 |
+
'visibility_include' => $visibility_include,
|
686 |
+
'position' => 'amp_after_featured_image',
|
687 |
+
'imported_from' => 'ampforwp_ads',
|
688 |
+
'label' => $post_title,
|
689 |
+
'ad_id' => $post_id,
|
690 |
+
'enable_one_end_of_post' => '',
|
691 |
+
'quads_ad_old_id' => 'ad'.$ad_count,
|
692 |
+
'ad_label_check' => $redux_builder_amp['ampforwp-ad-sponsorship'],
|
693 |
+
'adlabel' => $adlabel,
|
694 |
+
'ad_label_text' => $redux_builder_amp['ampforwp-ad-sponsorship-label'],
|
695 |
+
);
|
696 |
+
|
697 |
+
foreach ($adforwp_meta_key as $key => $val){
|
698 |
+
update_post_meta($post_id, $key, $val);
|
699 |
+
}
|
700 |
+
require_once QUADS_PLUGIN_DIR . '/admin/includes/migration-service.php';
|
701 |
+
$this->migration_service = new QUADS_Ad_Migration();
|
702 |
+
$this->migration_service->quadsUpdateOldAd('ad'.$ad_count, $adforwp_meta_key);
|
703 |
+
}
|
704 |
+
}
|
705 |
+
return array('status' => 't', 'data' => 'Ads have been successfully imported');
|
706 |
+
|
707 |
+
}
|
708 |
public function quadsSubscribeNewsletter($request){
|
709 |
$parameters = $request->get_params();
|
710 |
$api_url = 'http://magazine3.company/wp-json/api/central/email/subscribe';
|
930 |
$add = array('none' => 'Exclude nothing');
|
931 |
$quads_settings['auto_ads_get_post_types'] = $add + $post_types;
|
932 |
$quads_settings['autoads_excl_user_roles'] = array_merge(array('none' => 'Exclude nothing'), $this->quads_get_user_roles_api());
|
933 |
+
$quads_settings['adsTxtText'] = trim(file_get_contents(ABSPATH . 'ads.txt'));
|
934 |
return $quads_settings;
|
935 |
}
|
936 |
public function getConditionList($request_data){
|
@@ -349,7 +349,7 @@ function quads_is_visibility_on($ads){
|
|
349 |
|
350 |
if(!empty($include)){
|
351 |
|
352 |
-
$include = array_filter(array_unique($include));
|
353 |
|
354 |
if(isset($include[0])){
|
355 |
$response = true;
|
@@ -697,6 +697,13 @@ function quads_comparison_logic_checker($visibility){
|
|
697 |
}
|
698 |
}
|
699 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
700 |
|
701 |
default:
|
702 |
$result = false;
|
349 |
|
350 |
if(!empty($include)){
|
351 |
|
352 |
+
$include = array_values(array_filter(array_unique($include)));
|
353 |
|
354 |
if(isset($include[0])){
|
355 |
$response = true;
|
697 |
}
|
698 |
}
|
699 |
break;
|
700 |
+
case 'page_template':
|
701 |
+
$object = get_queried_object();
|
702 |
+
$template = get_page_template_slug($object);
|
703 |
+
if($v_id == $template){
|
704 |
+
$result = true;
|
705 |
+
}
|
706 |
+
break;
|
707 |
|
708 |
default:
|
709 |
$result = false;
|
@@ -24,7 +24,7 @@ if( !defined( 'ABSPATH' ) )
|
|
24 |
* @return string HTML js adsense code
|
25 |
*/
|
26 |
function quads_render_ad( $id, $string, $widget = false,$ampsupport='' ) {
|
27 |
-
|
28 |
// Return empty string
|
29 |
if( empty( $id ) ) {
|
30 |
return '';
|
@@ -46,7 +46,13 @@ function quads_render_ad( $id, $string, $widget = false,$ampsupport='' ) {
|
|
46 |
|
47 |
// Return the adsense ad code
|
48 |
if( true === quads_is_adsense( $id, $string ) ) {
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
}
|
51 |
if( true === quads_is_double_click( $id, $string ) ) {
|
52 |
return apply_filters( 'quads_render_ad', quads_render_double_click_async( $id ),$id );
|
@@ -54,18 +60,23 @@ function quads_render_ad( $id, $string, $widget = false,$ampsupport='' ) {
|
|
54 |
if( true === quads_is_yandex( $id, $string ) ) {
|
55 |
return apply_filters( 'quads_render_ad', quads_render_yandex_async( $id ),$id );
|
56 |
}
|
|
|
|
|
|
|
57 |
|
58 |
// Return empty string
|
59 |
return '';
|
60 |
}
|
61 |
-
function
|
62 |
-
|
|
|
|
|
|
|
63 |
$data_slot = '';
|
64 |
$adsense = false;
|
65 |
require_once QUADS_PLUGIN_DIR . '/admin/includes/rest-api-service.php';
|
66 |
$api_service = new QUADS_Ad_Setup_Api_Service();
|
67 |
$quads_ads = $api_service->getAdDataByParam('quads-ads');
|
68 |
-
|
69 |
if(isset($quads_ads['posts_data'])){
|
70 |
|
71 |
foreach($quads_ads['posts_data'] as $key => $value){
|
@@ -125,7 +136,7 @@ function quads_doubleclick_head_code(){
|
|
125 |
|
126 |
}
|
127 |
/**
|
128 |
-
* Render
|
129 |
*
|
130 |
* @global array $quads_options
|
131 |
* @param int $id
|
@@ -146,7 +157,7 @@ function quads_render_double_click_async( $id ) {
|
|
146 |
return apply_filters( 'quads_render_double_click_async', $html );
|
147 |
}
|
148 |
/**
|
149 |
-
* Render
|
150 |
*
|
151 |
* @global array $quads_options
|
152 |
* @param int $id
|
@@ -178,6 +189,128 @@ function quads_render_yandex_async( $id ) {
|
|
178 |
$html .= "\n <!-- end WP QUADS --> \n\n";
|
179 |
return apply_filters( 'quads_render_yandex_async', $html );
|
180 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
|
182 |
/**
|
183 |
* Render Google async ad
|
@@ -622,6 +755,23 @@ function quads_is_yandex( $id, $string ) {
|
|
622 |
}
|
623 |
return false;
|
624 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
625 |
/**
|
626 |
* Render advert on amp pages
|
627 |
*
|
@@ -649,9 +799,9 @@ function quads_render_amp($id,$ampsupport=''){
|
|
649 |
if((isset($quads_options['ads'][$id]['enabled_on_amp']) && isset($quads_options['ads'][$id]['code']) && !empty($quads_options['ads'][$id]['code']))|| (!empty($ampsupport) && $ampsupport)){
|
650 |
if((isset($quads_options['ads'][$id]['enabled_on_amp']) && $quads_options['ads'][$id]['enabled_on_amp']) || (!empty($ampsupport) && $ampsupport)){
|
651 |
if(isset($quads_options['ads'][$id]['code'])){
|
652 |
-
|
653 |
}else if(isset($quads_options['ads'][$id]['post_meta'])){
|
654 |
-
|
655 |
}else{
|
656 |
return '';
|
657 |
}
|
@@ -681,9 +831,40 @@ function quads_render_amp($id,$ampsupport=''){
|
|
681 |
$height = (isset($quads_options['ads'][$id]['g_data_ad_height']) && !empty($quads_options['ads'][$id]['g_data_ad_height'])) ? $quads_options['ads'][$id]['g_data_ad_height'] : '250';
|
682 |
|
683 |
$html = '<amp-ad width='.esc_attr($width).' height='.esc_attr($height).' type="yandex" data-block-id="'.esc_attr($quads_options['ads'][$id]['block_id']).'" data-html-access-allowed="true"></amp-ad>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
684 |
}else{
|
685 |
// Return default adsense code
|
686 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
687 |
}
|
688 |
|
689 |
}
|
24 |
* @return string HTML js adsense code
|
25 |
*/
|
26 |
function quads_render_ad( $id, $string, $widget = false,$ampsupport='' ) {
|
27 |
+
global $quads_mode;
|
28 |
// Return empty string
|
29 |
if( empty( $id ) ) {
|
30 |
return '';
|
46 |
|
47 |
// Return the adsense ad code
|
48 |
if( true === quads_is_adsense( $id, $string ) ) {
|
49 |
+
if($quads_mode == 'new'){
|
50 |
+
|
51 |
+
return apply_filters( 'quads_render_ad', quads_render_google_async_new( $id ),$id );
|
52 |
+
|
53 |
+
}else{
|
54 |
+
return apply_filters( 'quads_render_ad', quads_render_google_async( $id ),$id );
|
55 |
+
}
|
56 |
}
|
57 |
if( true === quads_is_double_click( $id, $string ) ) {
|
58 |
return apply_filters( 'quads_render_ad', quads_render_double_click_async( $id ),$id );
|
60 |
if( true === quads_is_yandex( $id, $string ) ) {
|
61 |
return apply_filters( 'quads_render_ad', quads_render_yandex_async( $id ),$id );
|
62 |
}
|
63 |
+
if( true === quads_is_mgid( $id, $string ) ) {
|
64 |
+
return apply_filters( 'quads_render_ad', quads_render_mgid_async( $id ),$id );
|
65 |
+
}
|
66 |
|
67 |
// Return empty string
|
68 |
return '';
|
69 |
}
|
70 |
+
function quads_common_head_code(){
|
71 |
+
global $quads_options;
|
72 |
+
if ( isset($quads_options['lazy_load_global']) && $quads_options['lazy_load_global']===true) {
|
73 |
+
echo quads_load_loading_script();
|
74 |
+
}
|
75 |
$data_slot = '';
|
76 |
$adsense = false;
|
77 |
require_once QUADS_PLUGIN_DIR . '/admin/includes/rest-api-service.php';
|
78 |
$api_service = new QUADS_Ad_Setup_Api_Service();
|
79 |
$quads_ads = $api_service->getAdDataByParam('quads-ads');
|
|
|
80 |
if(isset($quads_ads['posts_data'])){
|
81 |
|
82 |
foreach($quads_ads['posts_data'] as $key => $value){
|
136 |
|
137 |
}
|
138 |
/**
|
139 |
+
* Render Double Click ad
|
140 |
*
|
141 |
* @global array $quads_options
|
142 |
* @param int $id
|
157 |
return apply_filters( 'quads_render_double_click_async', $html );
|
158 |
}
|
159 |
/**
|
160 |
+
* Render Yandex ad
|
161 |
*
|
162 |
* @global array $quads_options
|
163 |
* @param int $id
|
189 |
$html .= "\n <!-- end WP QUADS --> \n\n";
|
190 |
return apply_filters( 'quads_render_yandex_async', $html );
|
191 |
}
|
192 |
+
/**
|
193 |
+
* Render MGID ad
|
194 |
+
*
|
195 |
+
* @global array $quads_options
|
196 |
+
* @param int $id
|
197 |
+
* @return html
|
198 |
+
*/
|
199 |
+
function quads_render_mgid_async( $id ) {
|
200 |
+
global $quads_options;
|
201 |
+
|
202 |
+
$data_publisher = esc_attr($quads_options['ads'][$id]['data_publisher']);
|
203 |
+
$data_widget = esc_attr($quads_options['ads'][$id]['data_widget']);
|
204 |
+
$data_container = esc_attr($quads_options['ads'][$id]['data_container']);
|
205 |
+
$data_js_src = esc_attr($quads_options['ads'][$id]['data_js_src']);
|
206 |
+
$width = (isset($quads_options['ads'][$id]['g_data_ad_width']) && !empty($quads_options['ads'][$id]['g_data_ad_width'])) ? $quads_options['ads'][$id]['g_data_ad_width'] : '300';
|
207 |
+
$height = (isset($quads_options['ads'][$id]['g_data_ad_height']) && !empty($quads_options['ads'][$id]['g_data_ad_height'])) ? $quads_options['ads'][$id]['g_data_ad_height'] : '250';
|
208 |
+
|
209 |
+
$html = "\n <!-- " . QUADS_NAME . " v." . QUADS_VERSION . " Content MGID --> \n\n";
|
210 |
+
$html .= '<div style="height:'.esc_attr($height). 'px; width:'.esc_attr($width). 'px;" >
|
211 |
+
<div id="'. esc_attr($data_container).'">
|
212 |
+
<script>
|
213 |
+
(function() {
|
214 |
+
var D = new Date(),
|
215 |
+
d = document,
|
216 |
+
b = "body",
|
217 |
+
ce = "createElement",
|
218 |
+
ac = "appendChild",
|
219 |
+
st = "style",
|
220 |
+
ds = "display",
|
221 |
+
n = "none",
|
222 |
+
gi = "getElementById",
|
223 |
+
lp = d.location.protocol,
|
224 |
+
wp = lp.indexOf("http") == 0 ? lp : "https:";
|
225 |
+
var i = d[ce]("iframe");
|
226 |
+
i[st][ds] = n;
|
227 |
+
d[gi]("'. esc_attr($data_container).'")[ac](i);
|
228 |
+
try {
|
229 |
+
var iw = i.contentWindow.document;
|
230 |
+
iw.open();
|
231 |
+
iw.writeln("<ht" + "ml><bo" + "dy></bo" + "dy></ht" + "ml>");
|
232 |
+
iw.close();
|
233 |
+
var c = iw;
|
234 |
+
} catch (e) {
|
235 |
+
var iw = d;
|
236 |
+
var c = d[gi]("'. esc_attr($data_container).'");
|
237 |
+
}
|
238 |
+
var dv = iw[ce]("div");
|
239 |
+
dv.id = "MG_ID";
|
240 |
+
dv[st][ds] = n;
|
241 |
+
dv.innerHTML = '. esc_attr($data_widget).';
|
242 |
+
c[ac](dv);
|
243 |
+
var s = iw[ce]("script");
|
244 |
+
s.async = "async";
|
245 |
+
s.defer = "defer";
|
246 |
+
s.charset = "utf-8";
|
247 |
+
s.src = wp + "'.esc_url($data_js_src).'?t=" + D.getYear() + D.getMonth() + D.getUTCDate() + D.getUTCHours();
|
248 |
+
c[ac](s);
|
249 |
+
})();
|
250 |
+
</script>
|
251 |
+
</div>
|
252 |
+
</div>';
|
253 |
+
$html .= "\n <!-- end WP QUADS --> \n\n";
|
254 |
+
return apply_filters( 'quads_render_mgid_async', $html );
|
255 |
+
}
|
256 |
+
|
257 |
+
|
258 |
+
/**
|
259 |
+
* Render Google async ad
|
260 |
+
*
|
261 |
+
* @global array $quads_options
|
262 |
+
* @param int $id
|
263 |
+
* @return html
|
264 |
+
*/
|
265 |
+
function quads_render_google_async_new( $id ) {
|
266 |
+
global $quads_options,$loaded_lazy_load;
|
267 |
+
|
268 |
+
$id_name = "quads-".esc_attr($id)."-place";
|
269 |
+
$html = "\n <!-- " . QUADS_NAME . " v." . QUADS_VERSION . " Content AdSense async --> \n\n";
|
270 |
+
if ( isset($quads_options['lazy_load_global']) && $quads_options['lazy_load_global']===true) {
|
271 |
+
|
272 |
+
$html .= '<div id="'.esc_attr($id_name).'" class="quads-ll">' ;
|
273 |
+
}
|
274 |
+
|
275 |
+
|
276 |
+
if (isset($quads_options['ads'][$id]['adsense_type']) && $quads_options['ads'][$id]['adsense_type'] == 'normal') {
|
277 |
+
$width = (isset($quads_options['ads'][$id]['g_data_ad_width']) && (!empty($quads_options['ads'][$id]['g_data_ad_width']))) ? $quads_options['ads'][$id]['g_data_ad_width']:300;
|
278 |
+
$height = (isset($quads_options['ads'][$id]['g_data_ad_height']) && (!empty($quads_options['ads'][$id]['g_data_ad_height']))) ? $quads_options['ads'][$id]['g_data_ad_height']:250;
|
279 |
+
$style = 'display:inline-block;width:' . esc_attr($width) . 'px;height:' . esc_attr($height) . 'px;' ;
|
280 |
+
|
281 |
+
$html .= '<ins class="adsbygoogle" style="' . $style . '"';
|
282 |
+
$html .= ' data-ad-client="' . esc_attr($quads_options['ads'][$id]['g_data_ad_client'] ). '"';
|
283 |
+
$html .= ' data-ad-slot="' . esc_attr($quads_options['ads'][$id]['g_data_ad_slot']) . '"></ins>
|
284 |
+
<script>
|
285 |
+
(adsbygoogle = window.adsbygoogle || []).push({});</script>';
|
286 |
+
}else{
|
287 |
+
$html .= '
|
288 |
+
<ins class="adsbygoogle"
|
289 |
+
style="display:block"
|
290 |
+
data-ad-client="'. esc_attr($quads_options['ads'][$id]['g_data_ad_client'] ).'"
|
291 |
+
data-ad-slot="'. esc_attr($quads_options['ads'][$id]['g_data_ad_slot']) .'"
|
292 |
+
data-ad-format="auto"
|
293 |
+
data-full-width-responsive="true"></ins>
|
294 |
+
<script>
|
295 |
+
(adsbygoogle = window.adsbygoogle || []).push({});</script>';
|
296 |
+
|
297 |
+
}
|
298 |
+
|
299 |
+
if ( isset($quads_options['lazy_load_global']) && $quads_options['lazy_load_global']===true) {
|
300 |
+
$html = str_replace( 'class="adsbygoogle"', '', $html );
|
301 |
+
$html = str_replace( '></ins>', '><span>Loading...</span></ins></div>', $html );
|
302 |
+
$code = 'instant= new adsenseLoader( \'#quads-' . esc_attr($id) . '-place\', {
|
303 |
+
onLoad: function( ad ){
|
304 |
+
if (ad.classList.contains("quads-ll")) {
|
305 |
+
ad.classList.remove("quads-ll");
|
306 |
+
}
|
307 |
+
}
|
308 |
+
});';
|
309 |
+
$html = str_replace( '(adsbygoogle = window.adsbygoogle || []).push({});', $code, $html );
|
310 |
+
}
|
311 |
+
$html .= "\n <!-- end WP QUADS --> \n\n";
|
312 |
+
return apply_filters( 'quads_render_adsense_async', $html );
|
313 |
+
}
|
314 |
|
315 |
/**
|
316 |
* Render Google async ad
|
755 |
}
|
756 |
return false;
|
757 |
}
|
758 |
+
|
759 |
+
/**
|
760 |
+
* Check if ad code is MGID or other ad code
|
761 |
+
*
|
762 |
+
* @param1 id int id of the ad
|
763 |
+
* @param string $string ad code
|
764 |
+
* @return boolean
|
765 |
+
*/
|
766 |
+
function quads_is_mgid( $id, $string ) {
|
767 |
+
global $quads_options;
|
768 |
+
|
769 |
+
if( isset($quads_options['ads'][$id]['ad_type']) && $quads_options['ads'][$id]['ad_type'] === 'mgid') {
|
770 |
+
return true;
|
771 |
+
}
|
772 |
+
return false;
|
773 |
+
}
|
774 |
+
|
775 |
/**
|
776 |
* Render advert on amp pages
|
777 |
*
|
799 |
if((isset($quads_options['ads'][$id]['enabled_on_amp']) && isset($quads_options['ads'][$id]['code']) && !empty($quads_options['ads'][$id]['code']))|| (!empty($ampsupport) && $ampsupport)){
|
800 |
if((isset($quads_options['ads'][$id]['enabled_on_amp']) && $quads_options['ads'][$id]['enabled_on_amp']) || (!empty($ampsupport) && $ampsupport)){
|
801 |
if(isset($quads_options['ads'][$id]['code'])){
|
802 |
+
return $quads_options['ads'][$id]['code'];
|
803 |
}else if(isset($quads_options['ads'][$id]['post_meta'])){
|
804 |
+
return $quads_options['ads'][$id]['post_meta']['code'];
|
805 |
}else{
|
806 |
return '';
|
807 |
}
|
831 |
$height = (isset($quads_options['ads'][$id]['g_data_ad_height']) && !empty($quads_options['ads'][$id]['g_data_ad_height'])) ? $quads_options['ads'][$id]['g_data_ad_height'] : '250';
|
832 |
|
833 |
$html = '<amp-ad width='.esc_attr($width).' height='.esc_attr($height).' type="yandex" data-block-id="'.esc_attr($quads_options['ads'][$id]['block_id']).'" data-html-access-allowed="true"></amp-ad>';
|
834 |
+
}else if($quads_options['ads'][$id]['ad_type'] == 'mgid'){
|
835 |
+
|
836 |
+
$width = (isset($quads_options['ads'][$id]['g_data_ad_width']) && !empty($quads_options['ads'][$id]['g_data_ad_width'])) ? $quads_options['ads'][$id]['g_data_ad_width'] : '300';
|
837 |
+
$height = (isset($quads_options['ads'][$id]['g_data_ad_height']) && !empty($quads_options['ads'][$id]['g_data_ad_height'])) ? $quads_options['ads'][$id]['g_data_ad_height'] : '250';
|
838 |
+
|
839 |
+
$html = '<amp-ad width='.esc_attr($width).' height='.esc_attr($height).'
|
840 |
+
type="mgid"
|
841 |
+
data-publisher="'.esc_attr($quads_options['ads'][$id]['data_publisher']).'"
|
842 |
+
data-widget="'.esc_attr($quads_options['ads'][$id]['data_widget']).'"
|
843 |
+
data-container="'.esc_attr($quads_options['ads'][$id]['data_container']).'"
|
844 |
+
>
|
845 |
+
</amp-ad>';
|
846 |
}else{
|
847 |
// Return default adsense code
|
848 |
+
|
849 |
+
if (isset($quads_options['ads'][$id]['adsense_type']) && $quads_options['ads'][$id]['adsense_type'] == 'normal') {
|
850 |
+
$width = (isset($quads_options['ads'][$id]['g_data_ad_width']) && (!empty($quads_options['ads'][$id]['g_data_ad_width']))) ? $quads_options['ads'][$id]['g_data_ad_width']:300;
|
851 |
+
$height = (isset($quads_options['ads'][$id]['g_data_ad_height']) && (!empty($quads_options['ads'][$id]['g_data_ad_height']))) ? $quads_options['ads'][$id]['g_data_ad_height']:250;
|
852 |
+
|
853 |
+
$html = '<amp-ad layout="fixed" width='.esc_attr($width).' height='.esc_attr($height).' type="adsense" data-ad-client="'. esc_attr($quads_options['ads'][$id]['g_data_ad_client']) . '" data-ad-slot="'.esc_attr($quads_options['ads'][$id]['g_data_ad_slot']).'"></amp-ad>';
|
854 |
+
}else{
|
855 |
+
$html = '<amp-ad
|
856 |
+
width="100vw"
|
857 |
+
height="320"
|
858 |
+
type="adsense"
|
859 |
+
data-ad-client="'. esc_attr($quads_options['ads'][$id]['g_data_ad_client']) . '"
|
860 |
+
data-ad-slot="'. esc_attr($quads_options['ads'][$id]['g_data_ad_slot']) . '"
|
861 |
+
data-auto-format="rspv"
|
862 |
+
data-full-width
|
863 |
+
>
|
864 |
+
<div overflow></div>
|
865 |
+
</amp-ad>';
|
866 |
+
}
|
867 |
+
|
868 |
}
|
869 |
|
870 |
}
|
@@ -14,7 +14,7 @@ if( !defined( 'ABSPATH' ) )
|
|
14 |
|
15 |
//add_action( 'wp_enqueue_scripts', 'quads_register_styles', 10 );
|
16 |
add_action( 'wp_print_styles', 'quads_inline_styles', 9999 );
|
17 |
-
add_action('amp_post_template_css','
|
18 |
|
19 |
add_action( 'admin_enqueue_scripts', 'quads_load_admin_scripts', 100 );
|
20 |
add_action( 'admin_enqueue_scripts', 'quads_load_plugins_admin_scripts', 100 );
|
@@ -235,11 +235,25 @@ function quads_inline_styles() {
|
|
235 |
wp_enqueue_style( 'quads-styles' );
|
236 |
// Add inline css to that style
|
237 |
wp_add_inline_style( 'quads-styles', $css );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
if (quads_is_amp_endpoint()){
|
239 |
echo $css;
|
240 |
}
|
241 |
}
|
242 |
|
|
|
243 |
/**
|
244 |
* Render Media Queries
|
245 |
*
|
14 |
|
15 |
//add_action( 'wp_enqueue_scripts', 'quads_register_styles', 10 );
|
16 |
add_action( 'wp_print_styles', 'quads_inline_styles', 9999 );
|
17 |
+
add_action('amp_post_template_css','quads_inline_styles_amp', 11);
|
18 |
|
19 |
add_action( 'admin_enqueue_scripts', 'quads_load_admin_scripts', 100 );
|
20 |
add_action( 'admin_enqueue_scripts', 'quads_load_plugins_admin_scripts', 100 );
|
235 |
wp_enqueue_style( 'quads-styles' );
|
236 |
// Add inline css to that style
|
237 |
wp_add_inline_style( 'quads-styles', $css );
|
238 |
+
}
|
239 |
+
function quads_inline_styles_amp() {
|
240 |
+
global $quads_options;
|
241 |
+
|
242 |
+
$css = '';
|
243 |
+
|
244 |
+
if( isset( $quads_options['ads'] ) ) {
|
245 |
+
foreach ( $quads_options['ads'] as $key => $value ) {
|
246 |
+
$css .= quads_render_media_query( $key, $value );
|
247 |
+
}
|
248 |
+
}
|
249 |
+
$css .=".quads-ad-label { font-size: 12px; text-align: center; color: #333;}";
|
250 |
+
|
251 |
if (quads_is_amp_endpoint()){
|
252 |
echo $css;
|
253 |
}
|
254 |
}
|
255 |
|
256 |
+
|
257 |
/**
|
258 |
* Render Media Queries
|
259 |
*
|
@@ -17,7 +17,7 @@ add_filter('the_content', 'quads_post_settings_to_quicktags', 5);
|
|
17 |
add_filter('the_content', 'quads_process_content', quads_get_load_priority());
|
18 |
add_filter('rest_prepare_post', 'quads_classic_to_gutenberg', 10, 1);
|
19 |
add_filter('the_content', 'quads_change_adsbygoogle_to_amp',11);
|
20 |
-
add_action('wp_head', '
|
21 |
|
22 |
/**
|
23 |
* Show ads before posts
|
@@ -381,6 +381,7 @@ function quads_filter_default_ads_new( $content ) {
|
|
381 |
|
382 |
$position = (isset($ads['position']) && $ads['position'] !='') ? $ads['position'] : '';
|
383 |
$paragraph_no = (isset($ads['paragraph_number']) && $ads['paragraph_number'] !='') ? $ads['paragraph_number'] : 1;
|
|
|
384 |
$imageNo = (isset($ads['image_number']) && $ads['image_number'] !='') ? $ads['image_number'] : 1;
|
385 |
$imageCaption = isset($ads['image_caption']) ? $ads['image_caption'] : false;
|
386 |
$end_of_post = isset($ads['enable_on_end_of_post']) ? $ads['enable_on_end_of_post'] : false;
|
@@ -454,7 +455,26 @@ function quads_filter_default_ads_new( $content ) {
|
|
454 |
}
|
455 |
|
456 |
break;
|
457 |
-
case '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
458 |
|
459 |
if(strpos( $content, '<!--OffBfLastPara-->' ) === false ) {
|
460 |
$closing_p = '</p>';
|
@@ -520,9 +540,23 @@ function quads_filter_default_ads_new( $content ) {
|
|
520 |
}
|
521 |
|
522 |
break;
|
523 |
-
|
524 |
-
|
525 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
526 |
}
|
527 |
|
528 |
$adsArrayCus[] = $i;
|
@@ -1140,7 +1174,29 @@ function quads_replace_ads_new($content, $quicktag, $id,$ampsupport='') {
|
|
1140 |
}
|
1141 |
$ad_meta = get_post_meta($id, '',true);
|
1142 |
if (isset($ad_meta['code'][0])) {
|
1143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1144 |
$style = quads_get_inline_ad_style_new($id);
|
1145 |
$adscode =
|
1146 |
"\n".'<!-- WP QUADS Content Ad Plugin v. ' . QUADS_VERSION .' -->'."\n".
|
17 |
add_filter('the_content', 'quads_process_content', quads_get_load_priority());
|
18 |
add_filter('rest_prepare_post', 'quads_classic_to_gutenberg', 10, 1);
|
19 |
add_filter('the_content', 'quads_change_adsbygoogle_to_amp',11);
|
20 |
+
add_action('wp_head', 'quads_common_head_code');
|
21 |
|
22 |
/**
|
23 |
* Show ads before posts
|
381 |
|
382 |
$position = (isset($ads['position']) && $ads['position'] !='') ? $ads['position'] : '';
|
383 |
$paragraph_no = (isset($ads['paragraph_number']) && $ads['paragraph_number'] !='') ? $ads['paragraph_number'] : 1;
|
384 |
+
$word_count_number = (isset($ads['word_count_number']) && $ads['word_count_number'] !='') ? $ads['word_count_number'] : 1;
|
385 |
$imageNo = (isset($ads['image_number']) && $ads['image_number'] !='') ? $ads['image_number'] : 1;
|
386 |
$imageCaption = isset($ads['image_caption']) ? $ads['image_caption'] : false;
|
387 |
$end_of_post = isset($ads['enable_on_end_of_post']) ? $ads['enable_on_end_of_post'] : false;
|
455 |
}
|
456 |
|
457 |
break;
|
458 |
+
case 'after_word_count':
|
459 |
+
|
460 |
+
if(strpos( $content, '<!--OffBfLastPara-->' ) === false ) {
|
461 |
+
$paragraphs = explode( ' ', $content );
|
462 |
+
$p_count = count($paragraphs);
|
463 |
+
$original_paragraph_no = $paragraph_no;
|
464 |
+
if($word_count_number <= $p_count){
|
465 |
+
|
466 |
+
foreach ($paragraphs as $index => $paragraph) {
|
467 |
+
|
468 |
+
if ( $word_count_number == $index + 1 ) {
|
469 |
+
$paragraphs[$index] .= $cusads;
|
470 |
+
}
|
471 |
+
}
|
472 |
+
$content = implode( ' ', $paragraphs );
|
473 |
+
}
|
474 |
+
}
|
475 |
+
|
476 |
+
break;
|
477 |
+
case 'after_paragraph':
|
478 |
|
479 |
if(strpos( $content, '<!--OffBfLastPara-->' ) === false ) {
|
480 |
$closing_p = '</p>';
|
540 |
}
|
541 |
|
542 |
break;
|
543 |
+
case 'after_the_percentage':
|
544 |
+
|
545 |
+
$closing_p = '</p>';
|
546 |
+
$paragraphs = explode( $closing_p, $content );
|
547 |
+
$total_paragraphs = count($paragraphs);
|
548 |
+
$percentage = intval($ads['after_the_percentage_value']);
|
549 |
+
$paragraph_id = floor(($percentage / 100) * $total_paragraphs);
|
550 |
+
foreach ($paragraphs as $index => $paragraph) {
|
551 |
+
if ( trim( $paragraph ) ) {
|
552 |
+
$paragraphs[$index] .= $closing_p;
|
553 |
+
}
|
554 |
+
if ( $paragraph_id == $index + 1 ) {
|
555 |
+
$paragraphs[$index] .= $cusads;
|
556 |
+
}
|
557 |
+
}
|
558 |
+
$content = implode('', $paragraphs );
|
559 |
+
break;
|
560 |
}
|
561 |
|
562 |
$adsArrayCus[] = $i;
|
1174 |
}
|
1175 |
$ad_meta = get_post_meta($id, '',true);
|
1176 |
if (isset($ad_meta['code'][0])) {
|
1177 |
+
if(!empty($ad_meta['code'][0])){
|
1178 |
+
|
1179 |
+
$code = '';
|
1180 |
+
if ( isset($quads_options['lazy_load_global']) && $quads_options['lazy_load_global']===true && strpos($ad_meta['code'][0], 'class="adsbygoogle"') !== false) {
|
1181 |
+
$id_name = "quads-".esc_attr($id)."-place";
|
1182 |
+
$code .= '<div id="'.esc_attr($id_name).'" class="quads-ll">' ;
|
1183 |
+
}
|
1184 |
+
$code .= $ad_meta['code'][0];
|
1185 |
+
if ( isset($quads_options['lazy_load_global']) && $quads_options['lazy_load_global']===true && strpos($ad_meta['code'][0], 'class="adsbygoogle"') !== false) {
|
1186 |
+
$code = str_replace( 'class="adsbygoogle"', '', $code );
|
1187 |
+
$code = str_replace( '></ins>', '><span>Loading...</span></ins></div>', $code );
|
1188 |
+
$code1 = 'instant= new adsenseLoader( \'#quads-' . esc_attr($id) . '-place\', {
|
1189 |
+
onLoad: function( ad ){
|
1190 |
+
if (ad.classList.contains("quads-ll")) {
|
1191 |
+
ad.classList.remove("quads-ll");
|
1192 |
+
}
|
1193 |
+
}
|
1194 |
+
});';
|
1195 |
+
$code = str_replace( '(adsbygoogle = window.adsbygoogle || []).push({});', $code1, $code );
|
1196 |
+
}
|
1197 |
+
}else{
|
1198 |
+
$code ='';
|
1199 |
+
}
|
1200 |
$style = quads_get_inline_ad_style_new($id);
|
1201 |
$adscode =
|
1202 |
"\n".'<!-- WP QUADS Content Ad Plugin v. ' . QUADS_VERSION .' -->'."\n".
|
@@ -1,6 +1,6 @@
|
|
1 |
{
|
2 |
"name": "quick-adsense-reloaded",
|
3 |
-
"version": "2.0.
|
4 |
"devDependencies": {
|
5 |
"grunt": "~0.4.5",
|
6 |
"grunt-contrib-clean": "~0.6.0",
|
1 |
{
|
2 |
"name": "quick-adsense-reloaded",
|
3 |
+
"version": "2.0.8",
|
4 |
"devDependencies": {
|
5 |
"grunt": "~0.4.5",
|
6 |
"grunt-contrib-clean": "~0.6.0",
|
@@ -6,7 +6,7 @@
|
|
6 |
* Description: Insert Google AdSense and other ad formats fully automatic into your website
|
7 |
* Author: WP Quads
|
8 |
* Author URI: https://wordpress.org/plugins/quick-adsense-reloaded/
|
9 |
-
* Version: 2.0.
|
10 |
* Text Domain: quick-adsense-reloaded
|
11 |
* Domain Path: languages
|
12 |
* Credits: WP QUADS - Quick AdSense Reloaded is a fork of Quick AdSense
|
@@ -38,7 +38,7 @@ if( !defined( 'ABSPATH' ) )
|
|
38 |
|
39 |
// Plugin version
|
40 |
if( !defined( 'QUADS_VERSION' ) ) {
|
41 |
-
define( 'QUADS_VERSION', '2.0.
|
42 |
}
|
43 |
|
44 |
// Plugin name
|
6 |
* Description: Insert Google AdSense and other ad formats fully automatic into your website
|
7 |
* Author: WP Quads
|
8 |
* Author URI: https://wordpress.org/plugins/quick-adsense-reloaded/
|
9 |
+
* Version: 2.0.8
|
10 |
* Text Domain: quick-adsense-reloaded
|
11 |
* Domain Path: languages
|
12 |
* Credits: WP QUADS - Quick AdSense Reloaded is a fork of Quick AdSense
|
38 |
|
39 |
// Plugin version
|
40 |
if( !defined( 'QUADS_VERSION' ) ) {
|
41 |
+
define( 'QUADS_VERSION', '2.0.8' );
|
42 |
}
|
43 |
|
44 |
// Plugin name
|
@@ -10,7 +10,7 @@ Tags: adsense, ads, ad, google adsense, advertising, amp, ad injection, ad inser
|
|
10 |
Requires at least: 3.6+
|
11 |
Tested up to: 5.4
|
12 |
Requires PHP: 5.3
|
13 |
-
Stable tag: 2.0.
|
14 |
|
15 |
Ads & AdSense Plugin is the quickest way to insert Google AdSense & other ads into your website. Google AdSense integration with Google AMP support.
|
16 |
|
@@ -129,6 +129,21 @@ Alternative Installation:
|
|
129 |
|
130 |
|
131 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
= 2.0.7 =
|
133 |
* New: Added a new option to Reapeat Ad After nth Paragraph #118
|
134 |
* New: Added a URL of the site so it's easier to help user #78
|
10 |
Requires at least: 3.6+
|
11 |
Tested up to: 5.4
|
12 |
Requires PHP: 5.3
|
13 |
+
Stable tag: 2.0.8
|
14 |
|
15 |
Ads & AdSense Plugin is the quickest way to insert Google AdSense & other ads into your website. Google AdSense integration with Google AMP support.
|
16 |
|
129 |
|
130 |
|
131 |
== Changelog ==
|
132 |
+
= 2.0.8 (12th June 2020) =
|
133 |
+
* New: MGID Integration #167
|
134 |
+
* New: Added new Position to display Ad After word count #23
|
135 |
+
* New: Added new Position to show Ad After 20,40,60,80 percent of content #175
|
136 |
+
* New: Made Ads.txt modifiable #162
|
137 |
+
* New: Ads not loading specific "page template" of Page attribute #53
|
138 |
+
* New: Ampforwp & advances amp ads importer #163
|
139 |
+
* Fix: Published going to auto Draft #169
|
140 |
+
* Fix: Settings are opened, but the page is not selected #157
|
141 |
+
* Fix: CSS shows in the head of the website in AMP after update #165
|
142 |
+
* Fix: Responsive option not working #114
|
143 |
+
* Fix: positioning bug Ad was displaying when two visibility options are selected #166
|
144 |
+
* Fix: LazyLoad does not work in custom code having an Adsense code #170
|
145 |
+
* Fix: Undefined variable Warning #177
|
146 |
+
|
147 |
= 2.0.7 =
|
148 |
* New: Added a new option to Reapeat Ad After nth Paragraph #118
|
149 |
* New: Added a URL of the site so it's easier to help user #78
|