From c09d6b3580fe4948b583ea17964ef453f4affc0e Mon Sep 17 00:00:00 2001 From: gabiermi Date: Mon, 15 Apr 2024 11:41:10 +0500 Subject: [PATCH 1/4] hide all notices except omnisend --- omnisend/class-omnisend-core-bootstrap.php | 5 +++-- omnisend/src/connection/components/connection-page-layout.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/omnisend/class-omnisend-core-bootstrap.php b/omnisend/class-omnisend-core-bootstrap.php index e46b0d9..1590f9b 100644 --- a/omnisend/class-omnisend-core-bootstrap.php +++ b/omnisend/class-omnisend-core-bootstrap.php @@ -58,7 +58,7 @@ public static function load(): void { add_action( 'admin_enqueue_scripts', 'Omnisend_Core_Bootstrap::load_omnisend_admin_styles' ); add_action( 'wp_enqueue_scripts', 'Omnisend_Core_Bootstrap::load_omnisend_site_styles' ); add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'Omnisend_Core_Bootstrap::add_links_in_plugin_settings' ); - + add_action( 'admin_init', 'Omnisend\Internal\Connection::connect_with_omnisend_for_woo_plugin' ); if ( ! self::is_omnisend_woocommerce_plugin_active() || ! self::is_omnisend_woocommerce_plugin_connected() ) { @@ -209,7 +209,7 @@ public static function hide_notices(): void { if ( isset( $_SERVER['REQUEST_URI'] ) ) { $request_uri = esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ); if ( strpos( $request_uri, '/wp-admin/admin.php?page=omnisend' ) !== false ) { - echo ''; + echo ''; } } } @@ -296,6 +296,7 @@ function ( $suffix ) { array( 'nonce' => wp_create_nonce( 'wp_rest' ), 'action_nonce' => wp_create_nonce( 'connect' ), + 'site_url' => site_url(), ) ); } diff --git a/omnisend/src/connection/components/connection-page-layout.js b/omnisend/src/connection/components/connection-page-layout.js index aaf344c..4851e16 100644 --- a/omnisend/src/connection/components/connection-page-layout.js +++ b/omnisend/src/connection/components/connection-page-layout.js @@ -16,7 +16,7 @@ const ConnectionPageLayout = () => formData.append( 'api_key', apiKey ); formData.append( 'action_nonce', omnisend_connection.action_nonce ); - fetch( '/wp-json/omnisend/v1/connect', { + fetch( omnisend_connection.site_url + '/wp-json/omnisend/v1/connect', { method: 'POST', body: formData, headers: { From 3347daf36ac3c97d79e9874e444c6f12bcd94086 Mon Sep 17 00:00:00 2001 From: gabiermi Date: Mon, 15 Apr 2024 15:19:03 +0500 Subject: [PATCH 2/4] hide all notices --- omnisend/class-omnisend-core-bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omnisend/class-omnisend-core-bootstrap.php b/omnisend/class-omnisend-core-bootstrap.php index 1590f9b..65fc59c 100644 --- a/omnisend/class-omnisend-core-bootstrap.php +++ b/omnisend/class-omnisend-core-bootstrap.php @@ -209,7 +209,7 @@ public static function hide_notices(): void { if ( isset( $_SERVER['REQUEST_URI'] ) ) { $request_uri = esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ); if ( strpos( $request_uri, '/wp-admin/admin.php?page=omnisend' ) !== false ) { - echo ''; + echo ''; } } } From 2aafd2dd49e3791cf20c60cae4bbeaa34b2a1e98 Mon Sep 17 00:00:00 2001 From: gabiermi Date: Mon, 15 Apr 2024 17:33:44 +0500 Subject: [PATCH 3/4] fix lint --- composer.lock | 12 ++++++------ omnisend/class-omnisend-core-bootstrap.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.lock b/composer.lock index cff7966..49a38b5 100644 --- a/composer.lock +++ b/composer.lock @@ -809,16 +809,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.17", + "version": "10.5.18", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c1f736a473d21957ead7e94fcc029f571895abf5" + "reference": "835df1709ac6c968ba34bf23f3c30e5d5a266de8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c1f736a473d21957ead7e94fcc029f571895abf5", - "reference": "c1f736a473d21957ead7e94fcc029f571895abf5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/835df1709ac6c968ba34bf23f3c30e5d5a266de8", + "reference": "835df1709ac6c968ba34bf23f3c30e5d5a266de8", "shasum": "" }, "require": { @@ -890,7 +890,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.17" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.18" }, "funding": [ { @@ -906,7 +906,7 @@ "type": "tidelift" } ], - "time": "2024-04-05T04:39:01+00:00" + "time": "2024-04-14T07:05:31+00:00" }, { "name": "sebastian/cli-parser", diff --git a/omnisend/class-omnisend-core-bootstrap.php b/omnisend/class-omnisend-core-bootstrap.php index 65fc59c..8638248 100644 --- a/omnisend/class-omnisend-core-bootstrap.php +++ b/omnisend/class-omnisend-core-bootstrap.php @@ -58,7 +58,7 @@ public static function load(): void { add_action( 'admin_enqueue_scripts', 'Omnisend_Core_Bootstrap::load_omnisend_admin_styles' ); add_action( 'wp_enqueue_scripts', 'Omnisend_Core_Bootstrap::load_omnisend_site_styles' ); add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'Omnisend_Core_Bootstrap::add_links_in_plugin_settings' ); - + add_action( 'admin_init', 'Omnisend\Internal\Connection::connect_with_omnisend_for_woo_plugin' ); if ( ! self::is_omnisend_woocommerce_plugin_active() || ! self::is_omnisend_woocommerce_plugin_connected() ) { From 1677b735e333a6f3642a6e10ca492fbe26ae69be Mon Sep 17 00:00:00 2001 From: gabiermi Date: Mon, 15 Apr 2024 18:48:31 +0500 Subject: [PATCH 4/4] notices --- omnisend/build/connection.asset.php | 2 +- omnisend/build/connection.js | 3 ++- omnisend/build/connection.js.map | 2 +- omnisend/build/notices.asset.php | 2 +- omnisend/build/notices.js | 6 +++--- omnisend/build/notices.js.map | 2 +- omnisend/class-omnisend-core-bootstrap.php | 2 +- .../src/connection/components/connection-page-layout.js | 2 +- omnisend/src/notices/components/discount-notice.js | 2 +- 9 files changed, 12 insertions(+), 11 deletions(-) diff --git a/omnisend/build/connection.asset.php b/omnisend/build/connection.asset.php index 38cf7b0..fb1296b 100644 --- a/omnisend/build/connection.asset.php +++ b/omnisend/build/connection.asset.php @@ -1 +1 @@ - array('react', 'wp-components', 'wp-element'), 'version' => '2aa75a7bb9ce04a8bf1d'); + array('react', 'wp-components', 'wp-element'), 'version' => '34e540b8ddfcf251c71f'); diff --git a/omnisend/build/connection.js b/omnisend/build/connection.js index 2483df0..c4fc805 100644 --- a/omnisend/build/connection.js +++ b/omnisend/build/connection.js @@ -121,7 +121,7 @@ const ConnectionPageLayout = () => { const formData = new FormData(); formData.append('api_key', apiKey); formData.append('action_nonce', omnisend_connection.action_nonce); - fetch('/wp-json/omnisend/v1/connect', { + fetch(omnisend_connection.site_url + '/wp-json/omnisend/v1/connect', { method: 'POST', body: formData, headers: { @@ -152,6 +152,7 @@ const ConnectionPageLayout = () => { }, error && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { className: "omnisend-spacing-mb-8" }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.Notice, { + className: "omnisend-notice", status: "error" }, error)), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_connection_logos__WEBPACK_IMPORTED_MODULE_1__["default"], null), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { className: "omnisend-spacing-mv-8" diff --git a/omnisend/build/connection.js.map b/omnisend/build/connection.js.map index c9c24a2..71c6211 100644 --- a/omnisend/build/connection.js.map +++ b/omnisend/build/connection.js.map @@ -1 +1 @@ -{"version":3,"file":"connection.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAMA,kBAAkB,GAAGA,CAAA,KAAM;EAChC,OACCC,oDAAA,CAAAC,2CAAA,QACCD,oDAAA;IAAGE,SAAS,EAAC;EAAuB,GAAC,0CAElC,CAAC,EACJF,oDAAA;IAAKE,SAAS,EAAC;E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AATA,SAAS,cAATA,SAAS,GAAI,EAAE;EAAE,CACpD,CACQ,CAAC,EACXjE,oDAAA,CAACiD,2DAAQ,QACRjD,oDAAA,CAACgD,yDAAM;IAACkB,QAAQ,EAAE,CAAC1C,MAAO;IAACiC,OAAO,EAAC,SAAS;IAACU,IAAI,EAAC,SAAS;IAACC,IAAI,EAAC,QAAQ;IAACV,OAAO,EAAEA,CAAA,KAAMX,QAAQ,CAACvB,MAAM;EAAE,GAAC,kBAEnG,CACC,CACL,CACF,CACJ,CAAC;AAEL,CAAC;AAED,iEAAeX,eAAe;;;;;;;;;;AC3D9B;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;ACN4C;AAC2B;AAEvEwD,0DAAM,CACLrE,oDAAA,CAACkB,0EAAoB,MAAE,CAAC,EACxBoD,QAAQ,CAACC,cAAc,CAAE,qBAAsB,CAChD,CAAC,C","sources":["webpack://wp-omnisend/./src/connection/components/connection-features.js","webpack://wp-omnisend/./src/connection/components/connection-logos.js","webpack://wp-omnisend/./src/connection/components/connection-page-layout.js","webpack://wp-omnisend/./src/connection/components/connection-steps.js","webpack://wp-omnisend/external window \"React\"","webpack://wp-omnisend/external window [\"wp\",\"components\"]","webpack://wp-omnisend/external window [\"wp\",\"element\"]","webpack://wp-omnisend/webpack/bootstrap","webpack://wp-omnisend/webpack/runtime/compat get default export","webpack://wp-omnisend/webpack/runtime/define property getters","webpack://wp-omnisend/webpack/runtime/hasOwnProperty shorthand","webpack://wp-omnisend/webpack/runtime/make namespace object","webpack://wp-omnisend/./src/connection/index.js"],"sourcesContent":["const ConnectionFeatures = () => {\n\treturn (\n\t\t<>\n\t\t\t

\n\t\t\t\tConnect Omnisend plugin to Wordpress to:\n\t\t\t

\n\t\t\t
\n\t\t\t\t
    \n\t\t\t\t\t
  • \n\t\t\t\t\t\t\n\t\t\t\t\t\t\tAutomatically import all your WordPress users to\n\t\t\t\t\t\t\tOmnisend\n\t\t\t\t\t\t\n\t\t\t\t\t
  • \n\t\t\t\t\t
  • \n\t\t\t\t\t\t Collect subscribers through Forms \n\t\t\t\t\t
  • \n\t\t\t\t\t
  • \n\t\t\t\t\t\t Segment and target your customers \n\t\t\t\t\t
  • \n\t\t\t\t\t
  • \n\t\t\t\t\t\t Set up behavior-based automations \n\t\t\t\t\t
  • \n\t\t\t\t
\n\t\t\t
\n\t\t\n\t);\n};\n\nexport default ConnectionFeatures;\n","const ConnectionLogos = () => {\n\treturn (\n\t\t<>\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\n\t);\n};\n\nexport default ConnectionLogos;\n","import ConnectionLogos from './connection-logos';\nimport ConnectionFeatures from './connection-features';\nimport ConnectionSteps from './connection-steps';\nimport { Notice, Flex, Spinner } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\nconst ConnectionPageLayout = () =>\n{\n\tconst [ error, setError ] = useState( null );\n\tconst [ loading, setLoading ] = useState( null );\n\n\tconst handleSiteConnection = ( apiKey ) =>\n\t{\n\t\tsetLoading( true );\n\t\tconst formData = new FormData();\n\t\tformData.append( 'api_key', apiKey );\n\t\tformData.append( 'action_nonce', omnisend_connection.action_nonce );\n\n\t\tfetch( '/wp-json/omnisend/v1/connect', {\n\t\t\tmethod: 'POST',\n\t\t\tbody: formData,\n\t\t\theaders: {\n\t\t\t\t'x-wp-nonce': omnisend_connection.nonce,\n\t\t\t}\n\t\t} )\n\t\t\t.then( ( response ) => response.json() )\n\t\t\t.then( ( data ) =>\n\t\t\t{\n\t\t\t\tif ( data.success )\n\t\t\t\t{\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t\tif ( data.error )\n\t\t\t\t{\n\t\t\t\t\tsetError( data.error );\n\t\t\t\t\tsetLoading( false );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( ( e ) =>\n\t\t\t{\n\t\t\t\tsetError( e.message || e );\n\t\t\t\tsetLoading( false );\n\t\t\t} );\n\t};\n\n\tif ( loading )\n\t{\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t
\n\t\t\t\t{error && (\n\t\t\t\t\t
\n\t\t\t\t\t\t{error}\n\t\t\t\t\t
\n\t\t\t\t)}\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
Connect Omnisend plugin
\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
Steps to connect to Omnisend:
\n\t\t\t\t\n\t\t\t
\n\t\t\n\t);\n};\n\nexport default ConnectionPageLayout;\n","import { useState } from '@wordpress/element';\nimport { Button, Flex, FlexItem, TextControl } from '@wordpress/components';\n\nconst ConnectionSteps = ({ onSubmit }) => {\n\tconst [apiKey, setApiKey] = useState('');\n\n\tconst navigateToExternalUrl = (url) => {\n\t\twindow.open(url, '_blank').focus();\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
1. Create Omnisend account
\n\t\t\t\t
\n\t\t\t\t navigateToExternalUrl('https://app.omnisend.com/registrationv2?utm_source=wordpress_plugin')}\n\t\t\t\t>\n\t\t\t\t\tGo to Omnisend\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
2. Go to API keys section and create API key
\n\t\t\t\t
\n\t\t\t\t navigateToExternalUrl('https://app.omnisend.com/apps/connect-store/wordpress?source=wordpress%20plugin')}\n\t\t\t\t>\n\t\t\t\t\tGo to API keys\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
3. Paste created API key here:
\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t setApiKey(nextValue ?? '')}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\n\t);\n};\n\nexport default ConnectionSteps;\n","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"element\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { render } from \"@wordpress/element\";\nimport ConnectionPageLayout from \"./components/connection-page-layout\";\n\nrender(\n\t,\n\tdocument.getElementById( \"omnisend-connection\" ),\n);\n"],"names":["ConnectionFeatures","createElement","Fragment","className","ConnectionLogos","xmlns","width","height","viewBox","fill","d","x","y","transform","ConnectionSteps","Notice","Flex","Spinner","useState","ConnectionPageLayout","error","setError","loading","setLoading","handleSiteConnection","apiKey","formData","FormData","append","omnisend_connection","action_nonce","fetch","method","body","headers","nonce","then","response","json","data","success","location","reload","catch","e","message","justify","status","onSubmit","Button","FlexItem","TextControl","setApiKey","navigateToExternalUrl","url","window","open","focus","variant","onClick","align","gap","wrap","display","value","onChange","nextValue","disabled","size","type","render","document","getElementById"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"connection.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAMA,kBAAkB,GAAGA,CAAA,KAAM;EAChC,OACCC,oDAAA,CAAAC,2CAAA,QACCD,oDAAA;IAAGE,SAAS,EAAC;EAAuB,GAAC,0CAElC,CAAC,EACJF,oDAAA;IAAKE,SAAS,EAAC;EAAuB,GACrCF,oDAAA;IAAIE,SAAS,EAAC;EAAsB,GACnCF,oDAAA,aACCA,oDAAA,eAAM,2DAGA,CACH,CAAC,EACLA,oDAAA,aACCA,oDAAA,eAAM,qCAAyC,CAC5C,CAAC,EACLA,oDAAA,aACCA,oDAAA,eAAM,qCAAyC,CAC5C,CAAC,EACLA,oDAAA,aACCA,oDAAA,eAAM,qCAAyC,CAC5C,CACD,CACA,CACJ,CAAC;AAEL,CAAC;AAED,iE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EAAEA,CAAA,KAAMX,QAAQ,CAACxB,MAAM;EAAE,GAAC,kBAEnG,CACC,CACL,CACF,CACJ,CAAC;AAEL,CAAC;AAED,iEAAeX,eAAe;;;;;;;;;;AC3D9B;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;ACN4C;AAC2B;AAEvEyD,0DAAM,CACLtE,oDAAA,CAACkB,0EAAoB,MAAE,CAAC,EACxBqD,QAAQ,CAACC,cAAc,CAAE,qBAAsB,CAChD,CAAC,C","sources":["webpack://wp-omnisend/./src/connection/components/connection-features.js","webpack://wp-omnisend/./src/connection/components/connection-logos.js","webpack://wp-omnisend/./src/connection/components/connection-page-layout.js","webpack://wp-omnisend/./src/connection/components/connection-steps.js","webpack://wp-omnisend/external window \"React\"","webpack://wp-omnisend/external window [\"wp\",\"components\"]","webpack://wp-omnisend/external window [\"wp\",\"element\"]","webpack://wp-omnisend/webpack/bootstrap","webpack://wp-omnisend/webpack/runtime/compat get default export","webpack://wp-omnisend/webpack/runtime/define property getters","webpack://wp-omnisend/webpack/runtime/hasOwnProperty shorthand","webpack://wp-omnisend/webpack/runtime/make namespace object","webpack://wp-omnisend/./src/connection/index.js"],"sourcesContent":["const ConnectionFeatures = () => {\n\treturn (\n\t\t<>\n\t\t\t

\n\t\t\t\tConnect Omnisend plugin to Wordpress to:\n\t\t\t

\n\t\t\t
\n\t\t\t\t
    \n\t\t\t\t\t
  • \n\t\t\t\t\t\t\n\t\t\t\t\t\t\tAutomatically import all your WordPress users to\n\t\t\t\t\t\t\tOmnisend\n\t\t\t\t\t\t\n\t\t\t\t\t
  • \n\t\t\t\t\t
  • \n\t\t\t\t\t\t Collect subscribers through Forms \n\t\t\t\t\t
  • \n\t\t\t\t\t
  • \n\t\t\t\t\t\t Segment and target your customers \n\t\t\t\t\t
  • \n\t\t\t\t\t
  • \n\t\t\t\t\t\t Set up behavior-based automations \n\t\t\t\t\t
  • \n\t\t\t\t
\n\t\t\t
\n\t\t\n\t);\n};\n\nexport default ConnectionFeatures;\n","const ConnectionLogos = () => {\n\treturn (\n\t\t<>\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
\n\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\n\t);\n};\n\nexport default ConnectionLogos;\n","import ConnectionLogos from './connection-logos';\nimport ConnectionFeatures from './connection-features';\nimport ConnectionSteps from './connection-steps';\nimport { Notice, Flex, Spinner } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\nconst ConnectionPageLayout = () =>\n{\n\tconst [ error, setError ] = useState( null );\n\tconst [ loading, setLoading ] = useState( null );\n\n\tconst handleSiteConnection = ( apiKey ) =>\n\t{\n\t\tsetLoading( true );\n\t\tconst formData = new FormData();\n\t\tformData.append( 'api_key', apiKey );\n\t\tformData.append( 'action_nonce', omnisend_connection.action_nonce );\n\n\t\tfetch( omnisend_connection.site_url + '/wp-json/omnisend/v1/connect', {\n\t\t\tmethod: 'POST',\n\t\t\tbody: formData,\n\t\t\theaders: {\n\t\t\t\t'x-wp-nonce': omnisend_connection.nonce,\n\t\t\t}\n\t\t} )\n\t\t\t.then( ( response ) => response.json() )\n\t\t\t.then( ( data ) =>\n\t\t\t{\n\t\t\t\tif ( data.success )\n\t\t\t\t{\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}\n\t\t\t\tif ( data.error )\n\t\t\t\t{\n\t\t\t\t\tsetError( data.error );\n\t\t\t\t\tsetLoading( false );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( ( e ) =>\n\t\t\t{\n\t\t\t\tsetError( e.message || e );\n\t\t\t\tsetLoading( false );\n\t\t\t} );\n\t};\n\n\tif ( loading )\n\t{\n\t\treturn (\n\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t
\n\t\t\t\t{error && (\n\t\t\t\t\t
\n\t\t\t\t\t\t{error}\n\t\t\t\t\t
\n\t\t\t\t)}\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
Connect Omnisend plugin
\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
Steps to connect to Omnisend:
\n\t\t\t\t\n\t\t\t
\n\t\t\n\t);\n};\n\nexport default ConnectionPageLayout;\n","import { useState } from '@wordpress/element';\nimport { Button, Flex, FlexItem, TextControl } from '@wordpress/components';\n\nconst ConnectionSteps = ({ onSubmit }) => {\n\tconst [apiKey, setApiKey] = useState('');\n\n\tconst navigateToExternalUrl = (url) => {\n\t\twindow.open(url, '_blank').focus();\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
1. Create Omnisend account
\n\t\t\t\t
\n\t\t\t\t navigateToExternalUrl('https://app.omnisend.com/registrationv2?utm_source=wordpress_plugin')}\n\t\t\t\t>\n\t\t\t\t\tGo to Omnisend\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
2. Go to API keys section and create API key
\n\t\t\t\t
\n\t\t\t\t navigateToExternalUrl('https://app.omnisend.com/apps/connect-store/wordpress?source=wordpress%20plugin')}\n\t\t\t\t>\n\t\t\t\t\tGo to API keys\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
3. Paste created API key here:
\n\t\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t setApiKey(nextValue ?? '')}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\n\t);\n};\n\nexport default ConnectionSteps;\n","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"element\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { render } from \"@wordpress/element\";\nimport ConnectionPageLayout from \"./components/connection-page-layout\";\n\nrender(\n\t,\n\tdocument.getElementById( \"omnisend-connection\" ),\n);\n"],"names":["ConnectionFeatures","createElement","Fragment","className","ConnectionLogos","xmlns","width","height","viewBox","fill","d","x","y","transform","ConnectionSteps","Notice","Flex","Spinner","useState","ConnectionPageLayout","error","setError","loading","setLoading","handleSiteConnection","apiKey","formData","FormData","append","omnisend_connection","action_nonce","fetch","site_url","method","body","headers","nonce","then","response","json","data","success","location","reload","catch","e","message","justify","status","onSubmit","Button","FlexItem","TextControl","setApiKey","navigateToExternalUrl","url","window","open","focus","variant","onClick","align","gap","wrap","display","value","onChange","nextValue","disabled","size","type","render","document","getElementById"],"sourceRoot":""} \ No newline at end of file diff --git a/omnisend/build/notices.asset.php b/omnisend/build/notices.asset.php index cbaffc6..9b37b52 100644 --- a/omnisend/build/notices.asset.php +++ b/omnisend/build/notices.asset.php @@ -1 +1 @@ - array('react', 'wp-element'), 'version' => 'a6babe65506454df0983'); + array('react', 'wp-element'), 'version' => '3821d14dadbfd56a6a55'); diff --git a/omnisend/build/notices.js b/omnisend/build/notices.js index 605b768..0940465 100644 --- a/omnisend/build/notices.js +++ b/omnisend/build/notices.js @@ -16,8 +16,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); const DiscountNotice = () => { - return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { - class: "omnisend-custom-notice" + return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + class: "omnisend-custom-notice omnisend-notice" }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", { src: "/wp-content/plugins/omnisend/assets/img/omnisend-notice-discount-icon.svg" }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, "Get 30% off Omnisend for 6 months with code ", (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { @@ -26,7 +26,7 @@ const DiscountNotice = () => { href: "https://your.omnisend.com/LXqyZ0", target: "_blank", class: "omnisend-custom-notice-discount-button" - }, "Get Omnisend discount"))); + }, "Get Omnisend discount")); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DiscountNotice); diff --git a/omnisend/build/notices.js.map b/omnisend/build/notices.js.map index 97dec22..efe1b34 100644 --- a/omnisend/build/notices.js.map +++ b/omnisend/build/notices.js.map @@ -1 +1 @@ -{"version":3,"file":"notices.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAMA,cAAc,GAAGA,CAAA,KACvB;EACI,OACIC,oDAAA,CAAAC,2CAAA,QACID,oDAAA;IAAKE,KAAK,EAAC;EAAwB,GAC/BF,oDAAA;IAAKG,GAAG,EAAC;EAA2E,CAAE,CAAC,EAEvFH,oDAAA,cAAK,8CAA4C,EAAAA,oDAAA;IAAME,KAAK,EAAC;EAAoC,GAAC,iBAAqB,CAAM,CAAC,EAC9HF,oDAAA;IAAGI,IAAI,EAAC,kCAAkC;IAACC,MAAM,EAAC,QAAQ;IAACH,KAAK,EAAC;EAAwC,GAAC,uBAAwB,CACjI,CACP,CAAC;AAEX,CAAC;AAED,iEAAeH,cAAc;;;;;;;;;;ACd7B;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;ACN4C;AACc;AAE1DO,0DAAM,CACFN,oDAAA,CAACD,mEAAc,MAAE,CAAC,EAClBQ,QAAQ,CAACC,cAAc,CAAE,oCAAqC,CAClE,CAAC,C","sources":["webpack://wp-omnisend/./src/notices/components/discount-notice.js","webpack://wp-omnisend/external window \"React\"","webpack://wp-omnisend/external window [\"wp\",\"element\"]","webpack://wp-omnisend/webpack/bootstrap","webpack://wp-omnisend/webpack/runtime/compat get default export","webpack://wp-omnisend/webpack/runtime/define property getters","webpack://wp-omnisend/webpack/runtime/hasOwnProperty shorthand","webpack://wp-omnisend/webpack/runtime/make namespace object","webpack://wp-omnisend/./src/notices/index.js"],"sourcesContent":["const DiscountNotice = () =>\n{\n return (\n <>\n
\n \n\n
Get 30% off Omnisend for 6 months with code ONLYHOSTINGER30
\n Get Omnisend discount\n
\n \n );\n};\n\nexport default DiscountNotice;\n","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"element\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { render } from \"@wordpress/element\";\nimport DiscountNotice from './components/discount-notice';\n\nrender(\n ,\n document.getElementById( \"omnisend-hostinger-discount-notice\" ),\n);\n"],"names":["DiscountNotice","createElement","Fragment","class","src","href","target","render","document","getElementById"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"notices.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAMA,cAAc,GAAGA,CAAA,KACvB;EACI,OACIC,oDAAA;IAAKC,KAAK,EAAC;EAAwC,GAC/CD,oDAAA;IAAKE,GAAG,EAAC;EAA2E,CAAE,CAAC,EAEvFF,oDAAA,cAAK,8CAA4C,EAAAA,oDAAA;IAAMC,KAAK,EAAC;EAAoC,GAAC,iBAAqB,CAAM,CAAC,EAC9HD,oDAAA;IAAGG,IAAI,EAAC,kCAAkC;IAACC,MAAM,EAAC,QAAQ;IAACH,KAAK,EAAC;EAAwC,GAAC,uBAAwB,CACjI,CAAC;AAEd,CAAC;AAED,iEAAeF,cAAc;;;;;;;;;;ACZ7B;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;ACN4C;AACc;AAE1DM,0DAAM,CACFL,oDAAA,CAACD,mEAAc,MAAE,CAAC,EAClBO,QAAQ,CAACC,cAAc,CAAE,oCAAqC,CAClE,CAAC,C","sources":["webpack://wp-omnisend/./src/notices/components/discount-notice.js","webpack://wp-omnisend/external window \"React\"","webpack://wp-omnisend/external window [\"wp\",\"element\"]","webpack://wp-omnisend/webpack/bootstrap","webpack://wp-omnisend/webpack/runtime/compat get default export","webpack://wp-omnisend/webpack/runtime/define property getters","webpack://wp-omnisend/webpack/runtime/hasOwnProperty shorthand","webpack://wp-omnisend/webpack/runtime/make namespace object","webpack://wp-omnisend/./src/notices/index.js"],"sourcesContent":["const DiscountNotice = () =>\n{\n return (\n
\n \n\n
Get 30% off Omnisend for 6 months with code ONLYHOSTINGER30
\n Get Omnisend discount\n
\n );\n};\n\nexport default DiscountNotice;\n","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"element\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { render } from \"@wordpress/element\";\nimport DiscountNotice from './components/discount-notice';\n\nrender(\n ,\n document.getElementById( \"omnisend-hostinger-discount-notice\" ),\n);\n"],"names":["DiscountNotice","createElement","class","src","href","target","render","document","getElementById"],"sourceRoot":""} \ No newline at end of file diff --git a/omnisend/class-omnisend-core-bootstrap.php b/omnisend/class-omnisend-core-bootstrap.php index d9c79e9..6c61e7f 100644 --- a/omnisend/class-omnisend-core-bootstrap.php +++ b/omnisend/class-omnisend-core-bootstrap.php @@ -213,7 +213,7 @@ public static function hide_notices(): void { if ( isset( $_SERVER['REQUEST_URI'] ) ) { $request_uri = esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ); if ( strpos( $request_uri, '/wp-admin/admin.php?page=omnisend' ) !== false ) { - echo ''; + echo ''; } } } diff --git a/omnisend/src/connection/components/connection-page-layout.js b/omnisend/src/connection/components/connection-page-layout.js index 4851e16..d105a4d 100644 --- a/omnisend/src/connection/components/connection-page-layout.js +++ b/omnisend/src/connection/components/connection-page-layout.js @@ -59,7 +59,7 @@ const ConnectionPageLayout = () =>
{error && (
- {error} + {error}
)} diff --git a/omnisend/src/notices/components/discount-notice.js b/omnisend/src/notices/components/discount-notice.js index 60d6198..96b5021 100644 --- a/omnisend/src/notices/components/discount-notice.js +++ b/omnisend/src/notices/components/discount-notice.js @@ -1,7 +1,7 @@ const DiscountNotice = () => { return ( -
+
Get 30% off Omnisend for 6 months with code ONLYHOSTINGER30