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 |
+
|