From 2ecf3f155a2d73c02f582203554472ff7c786cd1 Mon Sep 17 00:00:00 2001 From: Alex Zaharia Date: Thu, 17 Nov 2022 13:36:27 +0200 Subject: [PATCH 01/15] fix: jenkins scripts --- jenkins/git-initialize.sh | 4 +++- jenkins/git-publish.sh | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/jenkins/git-initialize.sh b/jenkins/git-initialize.sh index 2273d17a28..a781c8b1d8 100755 --- a/jenkins/git-initialize.sh +++ b/jenkins/git-initialize.sh @@ -10,5 +10,7 @@ git fetch origin echo -e "\nCheckout: $1" echo -e "-----------------------------------------------------------------------------" -git checkout $1 +git checkout master +git branch -d $1 +git checkout -t origin/$1 git reset --hard origin/$1 diff --git a/jenkins/git-publish.sh b/jenkins/git-publish.sh index c8597ee433..49b054712d 100755 --- a/jenkins/git-publish.sh +++ b/jenkins/git-publish.sh @@ -16,13 +16,17 @@ git push origin $RELEASE_BRANCH echo -e "\nMerge the $RELEASE_BRANCH in master" echo -e "-----------------------------------------------------------------------------" -git checkout master + +git branch -d master +git checkout -t origin/master git reset --hard origin/master # shellcheck disable=SC2086 git merge --no-ff -m "Merge [$RELEASE_BRANCH] in master" $RELEASE_BRANCH echo -e "\Creating the release tag: $BUILD_VERSION" echo -e "-----------------------------------------------------------------------------" +git tag -d $BUILD_VERSION +git push --delete origin $BUILD_VERSION git tag $BUILD_VERSION echo -e "\Creating the fixes branch: fixes-$BUILD_VERSION" @@ -38,7 +42,8 @@ git push origin $FIXES_BRANCH echo -e "\nMerge the $RELEASE_BRANCH in develop" echo -e "-----------------------------------------------------------------------------" -git checkout develop +git branch -d develop +git checkout -t origin/develop git reset --hard origin/develop git merge --no-ff -m "Merge [$RELEASE_BRANCH] in develop" $RELEASE_BRANCH git push origin develop From 869e4339e5e0337daeeee574304a17c235723ef7 Mon Sep 17 00:00:00 2001 From: Viorel Date: Thu, 24 Nov 2022 11:10:23 +0200 Subject: [PATCH 02/15] Fix: Updated translations --- languages/brizy.pot | 3400 +++++++++++++++++++++++++++++-------------- 1 file changed, 2282 insertions(+), 1118 deletions(-) diff --git a/languages/brizy.pot b/languages/brizy.pot index 2f5985acf9..b87aa6cbb4 100644 --- a/languages/brizy.pot +++ b/languages/brizy.pot @@ -2,14 +2,14 @@ # This file is distributed under the GPLv3. msgid "" msgstr "" -"Project-Id-Version: Brizy 2.4.0\n" +"Project-Id-Version: Brizy 2.4.13\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/brizy\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2022-05-23T12:03:50+03:00\n" +"POT-Creation-Date: 2022-11-24T11:04:32+02:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.5.0\n" "X-Domain: brizy\n" @@ -120,7 +120,7 @@ msgid "Leads details" msgstr "" #: admin/form-entries.php:62 -#: public/editor-build/236-wp/texts.php:247 +#: public/editor-build/250-wp/texts.php:309 msgid "Date" msgstr "" @@ -163,9 +163,9 @@ msgid "Lead" msgstr "" #: admin/form-entries.php:331 -#: admin/popups/main.php:115 -#: admin/templates.php:247 -#: public/editor-build/236-wp/texts.php:51 +#: admin/popups/main.php:106 +#: admin/templates.php:237 +#: public/editor-build/250-wp/texts.php:56 msgid "Add New" msgstr "" @@ -205,37 +205,47 @@ msgstr "" msgid "Layout." msgstr "" -#: admin/main.php:242 +#: admin/main.php:244 #: admin/settings.php:109 #: admin/settings.php:110 -#: public/editor-build/236-wp/texts.php:770 +#: public/editor-build/250-wp/texts.php:973 msgid "Settings" msgstr "" -#: admin/main.php:250 +#: admin/main.php:252 #: admin/settings.php:159 -#: import/main.php:52 +#: import/main.php:54 msgid "Go Pro" msgstr "" -#: admin/main.php:309 +#: admin/main.php:311 msgid "Submit & Deactivate" msgstr "" -#: admin/main.php:310 +#: admin/main.php:312 msgid "Skip & Deactivate" msgstr "" -#: admin/main.php:424 +#: admin/main.php:423 #: admin/views/button.php:25 #: admin/views/button.php:44 -#: compatibilities/gutenberg.php:98 -#: compatibilities/gutenberg.php:112 +#: compatibilities/gutenberg.php:92 +#: compatibilities/gutenberg.php:106 msgid "Edit with %s" msgstr "" +#: admin/main.php:535 +msgid "Heads up, Please backup before upgrade!" +msgstr "" + +#. translators: %1$s Link open tag, %2$s: Link close tag. +#: admin/main.php:541 +msgid "The latest update includes some substantial changes across different areas of the plugin. We highly recommend you %1$sbackup your site before upgrading%2$s, and make sure you first update in a staging environment" +msgstr "" + #: admin/membership/membership.php:64 #: editor/post.php:592 +#: public/editor-build/250-wp/texts.php:311 msgid "Default" msgstr "" @@ -256,86 +266,85 @@ msgstr "" msgid "View Page As %s" msgstr "" -#: admin/network-settings.php:82 -#: admin/settings.php:315 -msgid "Full Access" -msgstr "" - -#: admin/popups/main.php:111 +#: admin/popups/main.php:102 msgctxt "post type general name" msgid "Popups" msgstr "" -#: admin/popups/main.php:112 +#: admin/popups/main.php:103 msgctxt "post type singular name" msgid "Popup" msgstr "" -#: admin/popups/main.php:113 +#: admin/popups/main.php:104 msgctxt "admin menu" msgid "Popups" msgstr "" -#: admin/popups/main.php:114 +#: admin/popups/main.php:105 msgctxt "add new on admin bar" msgid "Popup" msgstr "" -#: admin/popups/main.php:116 +#: admin/popups/main.php:107 msgid "Add New Popup" msgstr "" -#: admin/popups/main.php:117 +#: admin/popups/main.php:108 msgid "New Popup" msgstr "" -#: admin/popups/main.php:118 +#: admin/popups/main.php:109 msgid "Edit Popup" msgstr "" -#: admin/popups/main.php:119 +#: admin/popups/main.php:110 msgid "View Popup" msgstr "" -#: admin/popups/main.php:120 -#: admin/popups/main.php:134 -#: public/editor-build/236-wp/texts.php:636 +#: admin/popups/main.php:111 +#: admin/popups/main.php:125 +#: public/editor-build/250-wp/texts.php:790 msgid "Popups" msgstr "" -#: admin/popups/main.php:121 +#: admin/popups/main.php:112 msgid "Search Popups" msgstr "" -#: admin/popups/main.php:122 +#: admin/popups/main.php:113 msgid "Parent Popups:" msgstr "" -#: admin/popups/main.php:123 +#: admin/popups/main.php:114 msgid "No Popups found." msgstr "" -#: admin/popups/main.php:124 +#: admin/popups/main.php:115 msgid "No Popups found in Trash." msgstr "" -#: admin/popups/main.php:125 +#: admin/popups/main.php:116 msgid "Popup attributes:" msgstr "" -#: admin/rules/api.php:476 +#: admin/rules/api.php:463 msgid "From" msgstr "" -#: admin/rules/api.php:488 +#: admin/rules/api.php:481 msgid "From any child of" msgstr "" -#: admin/rules/api.php:548 +#: admin/rules/api.php:503 +msgid "All Authors" +msgstr "" + +#: admin/rules/api.php:544 msgid "Specific" msgstr "" -#: admin/rules/api.php:558 +#: admin/rules/api.php:560 msgid "Any child of" msgstr "" @@ -350,7 +359,6 @@ msgid "Get Help" msgstr "" #: admin/settings.php:171 -#: public/editor-build/236-wp/texts.php:400 msgid "General" msgstr "" @@ -362,6 +370,10 @@ msgstr "" msgid "Maintenance Mode" msgstr "" +#: admin/settings.php:315 +msgid "Full Access" +msgstr "" + #: admin/settings.php:543 msgid "You must be an administrator running a replace URL session" msgstr "" @@ -416,7 +428,7 @@ msgid "View Story" msgstr "" #: admin/stories/main.php:48 -#: public/editor-build/236-wp/texts.php:845 +#: public/editor-build/250-wp/texts.php:1070 msgid "Stories" msgstr "" @@ -437,107 +449,107 @@ msgid "No Stories found in Trash." msgstr "" #: admin/stories/main.php:60 -#: public/editor-build/236-wp/texts.php:1012 +#: public/editor-build/250-wp/texts.php:1298 msgid "stories" msgstr "" -#: admin/templates.php:127 +#: admin/templates.php:120 msgid "Single" msgstr "" -#: admin/templates.php:128 -#: public/editor-build/236-wp/texts.php:83 +#: admin/templates.php:121 +#: public/editor-build/250-wp/texts.php:100 msgid "Archive" msgstr "" -#: admin/templates.php:133 -#: public/editor-build/236-wp/texts.php:658 +#: admin/templates.php:126 +#: public/editor-build/250-wp/texts.php:818 msgid "Product" msgstr "" -#: admin/templates.php:134 +#: admin/templates.php:127 msgid "Product Archive" msgstr "" -#: admin/templates.php:243 +#: admin/templates.php:233 msgctxt "post type general name" msgid "Templates" msgstr "" -#: admin/templates.php:244 +#: admin/templates.php:234 msgctxt "post type singular name" msgid "Template" msgstr "" -#: admin/templates.php:245 +#: admin/templates.php:235 msgctxt "admin menu" msgid "Templates" msgstr "" -#: admin/templates.php:246 +#: admin/templates.php:236 msgctxt "add new on admin bar" msgid "Template" msgstr "" -#: admin/templates.php:248 +#: admin/templates.php:238 msgid "Add New Template" msgstr "" -#: admin/templates.php:249 +#: admin/templates.php:239 msgid "New Template" msgstr "" -#: admin/templates.php:250 +#: admin/templates.php:240 msgid "Edit Template" msgstr "" -#: admin/templates.php:251 +#: admin/templates.php:241 msgid "View Template" msgstr "" -#: admin/templates.php:252 +#: admin/templates.php:242 msgid "Templates" msgstr "" -#: admin/templates.php:253 +#: admin/templates.php:243 msgid "Search Templates" msgstr "" -#: admin/templates.php:254 +#: admin/templates.php:244 msgid "Parent Templates:" msgstr "" -#: admin/templates.php:255 +#: admin/templates.php:245 msgid "No Templates found." msgstr "" -#: admin/templates.php:256 +#: admin/templates.php:246 msgid "No Templates found in Trash." msgstr "" -#: admin/templates.php:265 +#: admin/templates.php:255 msgid "templates" msgstr "" -#: admin/templates.php:294 +#: admin/templates.php:283 msgid "Display Conditions" msgstr "" -#: admin/templates.php:346 +#: admin/templates.php:333 msgid "Unable to show the rule box." msgstr "" -#: admin/templates.php:903 +#: admin/templates.php:887 msgid "Unable to get the rule validator for this post type." msgstr "" -#: admin/templates.php:910 -#: admin/templates.php:931 +#: admin/templates.php:894 +#: admin/templates.php:914 msgid "Invalid data version." msgstr "" #: admin/views/button.php:19 -#: compatibilities/gutenberg.php:90 +#: compatibilities/gutenberg.php:84 msgid "Back to WordPress Editor" msgstr "" @@ -558,7 +570,7 @@ msgid "Recently Edited" msgstr "" #: admin/views/dashboard.php:12 -#: public/editor-build/236-wp/texts.php:128 +#: public/editor-build/250-wp/texts.php:164 msgid "Blog" msgstr "" @@ -601,12 +613,12 @@ msgid "Who Can Access" msgstr "" #: admin/views/settings/maintenance.php:27 -#: public/editor-build/236-wp/texts.php:236 +#: public/editor-build/250-wp/texts.php:295 msgid "Custom" msgstr "" #: admin/views/settings/maintenance.php:33 -#: public/editor-build/236-wp/texts.php:723 +#: public/editor-build/250-wp/texts.php:917 msgid "Roles" msgstr "" @@ -644,15 +656,23 @@ msgstr "" msgid "Enter your old and new URLs for your WordPress installation, to update all %s data (Relevant for domain transfers or move to 'HTTPS')." msgstr "" -#: brizy.php:67 +#: brizy.php:70 #: system-checks.php:37 msgid "%1$s requires PHP version 5.6+, you currently running PHP %2$s. %3$s IS NOT RUNNING." msgstr "" -#: brizy.php:84 +#: brizy.php:91 msgid "%1$s failed to start. Please contact the support here." msgstr "" +#: compatibilities/brizy-pro-compatibility.php:28 +msgid "%s PRO IS NOT RUNNING." +msgstr "" + +#: compatibilities/brizy-pro-compatibility.php:29 +msgid "Please update %s PRO to the latest version." +msgstr "" + #: compatibilities/wordpress-importer.php:38 msgid "Importing Brizy post “%s” will be skipped due to incompatible version: %s " msgstr "" @@ -667,11 +687,11 @@ msgstr[1] "" msgid "Please set a valid product" msgstr "" -#: editor.php:281 +#: editor.php:297 msgid " Template" msgstr "" -#: editor.php:603 +#: editor.php:594 msgid "Original" msgstr "" @@ -727,105 +747,105 @@ msgstr "" msgid "The uploaded file could not be moved" msgstr "" -#: import/main.php:32 -#: import/main.php:33 +#: import/main.php:34 +#: import/main.php:35 msgid "Starter Templates" msgstr "" -#: import/main.php:45 -#: public/editor-build/236-wp/texts.php:72 +#: import/main.php:47 +#: public/editor-build/250-wp/texts.php:84 msgid "All" msgstr "" -#: import/main.php:46 +#: import/main.php:48 msgid "Live Preview" msgstr "" -#: import/main.php:47 +#: import/main.php:49 msgid "Install" msgstr "" -#: import/main.php:48 -#: public/editor-build/236-wp/texts.php:384 +#: import/main.php:50 +#: public/editor-build/250-wp/texts.php:471 msgid "Free" msgstr "" -#: import/main.php:49 +#: import/main.php:51 msgid "Pro" msgstr "" -#: import/main.php:50 -#: public/editor-build/236-wp/texts.php:757 +#: import/main.php:52 +#: public/editor-build/250-wp/texts.php:957 msgid "Search" msgstr "" -#: import/main.php:51 -#: public/editor-build/236-wp/texts.php:73 +#: import/main.php:53 +#: public/editor-build/250-wp/texts.php:85 msgid "All Categories" msgstr "" -#: import/main.php:53 -#: public/editor-build/236-wp/texts.php:820 +#: import/main.php:55 +#: public/editor-build/250-wp/texts.php:1037 msgid "Something went wrong" msgstr "" -#: import/main.php:54 +#: import/main.php:56 msgid "Bad news, your starter template was not installed. Something went wrong and we couldn’t do it. Please contact us." msgstr "" -#: import/main.php:55 +#: import/main.php:57 msgid "Ok" msgstr "" -#: import/main.php:56 +#: import/main.php:58 msgid "Template Successfully Installed" msgstr "" -#: import/main.php:57 +#: import/main.php:59 msgid "Good news, your starter template was successfully installed. Time to build your amaizing website fast & easy!" msgstr "" -#: import/main.php:58 +#: import/main.php:60 msgid "Thank You!" msgstr "" -#: import/main.php:59 +#: import/main.php:61 msgid "Installing Starter Template" msgstr "" -#: import/main.php:60 +#: import/main.php:62 msgid "Please don’t close this window until the installation is finished. This might take up to a couple of minutes (five min, usually less)." msgstr "" -#: import/main.php:61 +#: import/main.php:63 msgid "Keep existing content" msgstr "" -#: import/main.php:62 +#: import/main.php:64 msgid "Choose this option if you want to keep your current content. If you are using %s, some of the global options might overlap." msgstr "" -#: import/main.php:63 +#: import/main.php:65 msgid "Install Template" msgstr "" -#: import/main.php:64 +#: import/main.php:66 msgid "Delete existing content" msgstr "" -#: import/main.php:65 +#: import/main.php:67 msgid "Choose this option if you want to start fresh and delete your current content. A backup is advisable, there is no turning back from this." msgstr "" -#: import/main.php:66 +#: import/main.php:68 msgid "Deletes your current content" msgstr "" -#: import/main.php:88 +#: import/main.php:90 msgid "Invalid demo id. Please contact our support." msgstr "" -#: import/main.php:99 +#: import/main.php:101 msgid "Template imported successfully." msgstr "" @@ -853,3970 +873,5114 @@ msgstr "" msgid "Edit Page" msgstr "" -#: public/editor-build/236-wp/texts.php:6 +#: public/editor-build/250-wp/texts.php:6 msgid " Display Conditions" msgstr "" -#: public/editor-build/236-wp/texts.php:7 +#: public/editor-build/250-wp/texts.php:7 msgid "%s Selected" msgstr "" -#: public/editor-build/236-wp/texts.php:8 +#: public/editor-build/250-wp/texts.php:8 msgid "+ 10:00 (Sydney, Melbourne)" msgstr "" -#: public/editor-build/236-wp/texts.php:9 +#: public/editor-build/250-wp/texts.php:9 msgid "+ 11:00 (Ponape)" msgstr "" -#: public/editor-build/236-wp/texts.php:10 +#: public/editor-build/250-wp/texts.php:10 msgid "+ 12:00 (Auckland)" msgstr "" -#: public/editor-build/236-wp/texts.php:11 +#: public/editor-build/250-wp/texts.php:11 msgid "+ 1:00 (Berlin, Paris)" msgstr "" -#: public/editor-build/236-wp/texts.php:12 +#: public/editor-build/250-wp/texts.php:12 msgid "+ 2:00 (Athens, Istanbul)" msgstr "" -#: public/editor-build/236-wp/texts.php:13 +#: public/editor-build/250-wp/texts.php:13 msgid "+ 3:00 (Moscow, Baghdad)" msgstr "" -#: public/editor-build/236-wp/texts.php:14 +#: public/editor-build/250-wp/texts.php:14 msgid "+ 4:00 (Dubai, Baku)" msgstr "" -#: public/editor-build/236-wp/texts.php:15 +#: public/editor-build/250-wp/texts.php:15 msgid "+ 5:00 (Yekaterinburg)" msgstr "" -#: public/editor-build/236-wp/texts.php:16 +#: public/editor-build/250-wp/texts.php:16 msgid "+ 6:00 (Nur-Sultan)" msgstr "" -#: public/editor-build/236-wp/texts.php:17 +#: public/editor-build/250-wp/texts.php:17 msgid "+ 7:00 (Bangkok, Jakarta)" msgstr "" -#: public/editor-build/236-wp/texts.php:18 +#: public/editor-build/250-wp/texts.php:18 msgid "+ 8:00 (Singapore, Beijing)" msgstr "" -#: public/editor-build/236-wp/texts.php:19 +#: public/editor-build/250-wp/texts.php:19 msgid "+ 9:00 (Tokyo, Seoul)" msgstr "" -#: public/editor-build/236-wp/texts.php:20 +#: public/editor-build/250-wp/texts.php:20 msgid "- 10:00 (Honolulu, Papeete)" msgstr "" -#: public/editor-build/236-wp/texts.php:21 +#: public/editor-build/250-wp/texts.php:21 msgid "- 11:00 (Niue)" msgstr "" -#: public/editor-build/236-wp/texts.php:22 +#: public/editor-build/250-wp/texts.php:22 msgid "- 1:00 (Cape Verde)" msgstr "" -#: public/editor-build/236-wp/texts.php:23 +#: public/editor-build/250-wp/texts.php:23 msgid "- 2:00 (Noronha)" msgstr "" -#: public/editor-build/236-wp/texts.php:24 +#: public/editor-build/250-wp/texts.php:24 msgid "- 3:00 (Brasilia, Santiago)" msgstr "" -#: public/editor-build/236-wp/texts.php:25 +#: public/editor-build/250-wp/texts.php:25 msgid "- 4:00 (Halifax, Manaus)" msgstr "" -#: public/editor-build/236-wp/texts.php:26 +#: public/editor-build/250-wp/texts.php:26 msgid "- 5:00 (New York, Miami)" msgstr "" -#: public/editor-build/236-wp/texts.php:27 +#: public/editor-build/250-wp/texts.php:27 msgid "- 6:00 (Chicago, Dallas)" msgstr "" -#: public/editor-build/236-wp/texts.php:28 +#: public/editor-build/250-wp/texts.php:28 msgid "- 7:00 (Denver, Phoenix)" msgstr "" -#: public/editor-build/236-wp/texts.php:29 +#: public/editor-build/250-wp/texts.php:29 msgid "- 8:00 (Los Angeles)" msgstr "" -#: public/editor-build/236-wp/texts.php:30 +#: public/editor-build/250-wp/texts.php:30 msgid "- 9:00 (Anchorage)" msgstr "" -#: public/editor-build/236-wp/texts.php:31 +#: public/editor-build/250-wp/texts.php:31 msgid "0 Selected" msgstr "" -#: public/editor-build/236-wp/texts.php:32 +#: public/editor-build/250-wp/texts.php:32 msgid "0-10" msgstr "" -#: public/editor-build/236-wp/texts.php:33 +#: public/editor-build/250-wp/texts.php:33 msgid "0-5" msgstr "" -#: public/editor-build/236-wp/texts.php:34 +#: public/editor-build/250-wp/texts.php:34 msgid "00:00 (London, Dublin)" msgstr "" -#: public/editor-build/236-wp/texts.php:35 +#: public/editor-build/250-wp/texts.php:35 msgid "3D Tilt" msgstr "" -#: public/editor-build/236-wp/texts.php:36 +#: public/editor-build/250-wp/texts.php:36 +msgid "
Settings -> General Settings" +msgstr "" + +#: public/editor-build/250-wp/texts.php:447 +msgid "First Name" +msgstr "" + +#: public/editor-build/250-wp/texts.php:448 +msgid "Fit" +msgstr "" + +#: public/editor-build/250-wp/texts.php:449 +msgid "Fixed" +msgstr "" + +#: public/editor-build/250-wp/texts.php:450 +msgid "Flag" +msgstr "" + +#: public/editor-build/250-wp/texts.php:451 msgid "Flags" msgstr "" -#: public/editor-build/236-wp/texts.php:365 +#: public/editor-build/250-wp/texts.php:452 msgid "Flash" msgstr "" -#: public/editor-build/236-wp/texts.php:366 +#: public/editor-build/250-wp/texts.php:453 msgid "Flip" msgstr "" -#: public/editor-build/236-wp/texts.php:367 +#: public/editor-build/250-wp/texts.php:454 msgid "FlipInX" msgstr "" -#: public/editor-build/236-wp/texts.php:368 +#: public/editor-build/250-wp/texts.php:455 msgid "FlipInY" msgstr "" -#: public/editor-build/236-wp/texts.php:369 +#: public/editor-build/250-wp/texts.php:456 msgid "Follow" msgstr "" -#: public/editor-build/236-wp/texts.php:370 +#: public/editor-build/250-wp/texts.php:457 msgid "Followers" msgstr "" -#: public/editor-build/236-wp/texts.php:371 +#: public/editor-build/250-wp/texts.php:458 msgid "Font Family" msgstr "" -#: public/editor-build/236-wp/texts.php:372 +#: public/editor-build/250-wp/texts.php:459 msgid "Font Name is Required" msgstr "" -#: public/editor-build/236-wp/texts.php:373 +#: public/editor-build/250-wp/texts.php:460 +msgid "Font Size" +msgstr "" + +#: public/editor-build/250-wp/texts.php:461 msgid "Font name" msgstr "" -#: public/editor-build/236-wp/texts.php:374 +#: public/editor-build/250-wp/texts.php:462 msgid "Font weight" msgstr "" -#: public/editor-build/236-wp/texts.php:375 +#: public/editor-build/250-wp/texts.php:463 msgid "Fonts" msgstr "" -#: public/editor-build/236-wp/texts.php:376 +#: public/editor-build/250-wp/texts.php:464 msgid "Food" msgstr "" -#: public/editor-build/236-wp/texts.php:377 +#: public/editor-build/250-wp/texts.php:465 msgid "Footer" msgstr "" -#: public/editor-build/236-wp/texts.php:378 -msgid "Footer Color" -msgstr "" - -#: public/editor-build/236-wp/texts.php:379 +#: public/editor-build/250-wp/texts.php:466 msgid "Footers" msgstr "" -#: public/editor-build/236-wp/texts.php:380 +#: public/editor-build/250-wp/texts.php:467 msgid "Form" msgstr "" -#: public/editor-build/236-wp/texts.php:381 +#: public/editor-build/250-wp/texts.php:468 msgid "Form Fields" msgstr "" -#: public/editor-build/236-wp/texts.php:382 +#: public/editor-build/250-wp/texts.php:469 msgid "Form Submit" msgstr "" -#: public/editor-build/236-wp/texts.php:383 +#: public/editor-build/250-wp/texts.php:470 msgid "Forms" msgstr "" -#: public/editor-build/236-wp/texts.php:385 +#: public/editor-build/250-wp/texts.php:472 msgid "French" msgstr "" -#: public/editor-build/236-wp/texts.php:386 +#: public/editor-build/250-wp/texts.php:473 +msgid "Frequently Bought" +msgstr "" + +#: public/editor-build/250-wp/texts.php:474 msgid "From Email" msgstr "" -#: public/editor-build/236-wp/texts.php:387 +#: public/editor-build/250-wp/texts.php:475 msgid "From Name" msgstr "" -#: public/editor-build/236-wp/texts.php:388 +#: public/editor-build/250-wp/texts.php:476 msgid "Full" msgstr "" -#: public/editor-build/236-wp/texts.php:389 +#: public/editor-build/250-wp/texts.php:477 msgid "Full Height" msgstr "" -#: public/editor-build/236-wp/texts.php:390 +#: public/editor-build/250-wp/texts.php:478 msgid "Full Name" msgstr "" -#: public/editor-build/236-wp/texts.php:391 +#: public/editor-build/250-wp/texts.php:479 msgid "Full Screen" msgstr "" -#: public/editor-build/236-wp/texts.php:392 +#: public/editor-build/250-wp/texts.php:480 msgid "Full name" msgstr "" -#: public/editor-build/236-wp/texts.php:393 +#: public/editor-build/250-wp/texts.php:481 msgid "Future" msgstr "" -#: public/editor-build/236-wp/texts.php:394 +#: public/editor-build/250-wp/texts.php:482 msgid "Gallery" msgstr "" -#: public/editor-build/236-wp/texts.php:395 +#: public/editor-build/250-wp/texts.php:483 msgid "Gallery Tags" msgstr "" -#: public/editor-build/236-wp/texts.php:396 +#: public/editor-build/250-wp/texts.php:484 msgid "Gaming" msgstr "" -#: public/editor-build/236-wp/texts.php:397 +#: public/editor-build/250-wp/texts.php:485 msgid "Gap" msgstr "" -#: public/editor-build/236-wp/texts.php:398 +#: public/editor-build/250-wp/texts.php:486 msgid "Gap Above" msgstr "" -#: public/editor-build/236-wp/texts.php:399 +#: public/editor-build/250-wp/texts.php:487 msgid "Gap Below" msgstr "" -#: public/editor-build/236-wp/texts.php:401 +#: public/editor-build/250-wp/texts.php:488 +msgid "Gap Size" +msgstr "" + +#: public/editor-build/250-wp/texts.php:489 msgid "German" msgstr "" -#: public/editor-build/236-wp/texts.php:402 +#: public/editor-build/250-wp/texts.php:490 msgid "Get a PRO plan" msgstr "" -#: public/editor-build/236-wp/texts.php:403 +#: public/editor-build/250-wp/texts.php:491 +msgid "Get your tracking page URL in the Tracking pages session of AfterShip application." +msgstr "" + +#: public/editor-build/250-wp/texts.php:492 msgid "Global Blocks" msgstr "" -#: public/editor-build/236-wp/texts.php:404 +#: public/editor-build/250-wp/texts.php:493 msgid "Global Popups" msgstr "" -#: public/editor-build/236-wp/texts.php:405 +#: public/editor-build/250-wp/texts.php:494 msgid "Go Back" msgstr "" -#: public/editor-build/236-wp/texts.php:406 +#: public/editor-build/250-wp/texts.php:495 msgid "Go to" msgstr "" -#: public/editor-build/236-wp/texts.php:407 +#: public/editor-build/250-wp/texts.php:496 +msgid "Go to Checkout" +msgstr "" + +#: public/editor-build/250-wp/texts.php:497 msgid "Go to Dashboard" msgstr "" -#: public/editor-build/236-wp/texts.php:408 +#: public/editor-build/250-wp/texts.php:498 msgid "Gradient" msgstr "" -#: public/editor-build/236-wp/texts.php:409 +#: public/editor-build/250-wp/texts.php:499 msgid "Group" msgstr "" -#: public/editor-build/236-wp/texts.php:410 +#: public/editor-build/250-wp/texts.php:500 msgid "H1" msgstr "" -#: public/editor-build/236-wp/texts.php:411 +#: public/editor-build/250-wp/texts.php:501 msgid "H2" msgstr "" -#: public/editor-build/236-wp/texts.php:412 +#: public/editor-build/250-wp/texts.php:502 msgid "H3" msgstr "" -#: public/editor-build/236-wp/texts.php:413 +#: public/editor-build/250-wp/texts.php:503 msgid "H4" msgstr "" -#: public/editor-build/236-wp/texts.php:414 +#: public/editor-build/250-wp/texts.php:504 msgid "H5" msgstr "" -#: public/editor-build/236-wp/texts.php:415 +#: public/editor-build/250-wp/texts.php:505 msgid "H6" msgstr "" -#: public/editor-build/236-wp/texts.php:416 +#: public/editor-build/250-wp/texts.php:506 msgid "HTML Tag" msgstr "" -#: public/editor-build/236-wp/texts.php:417 +#: public/editor-build/250-wp/texts.php:507 msgid "Handle" msgstr "" -#: public/editor-build/236-wp/texts.php:418 +#: public/editor-build/250-wp/texts.php:508 msgid "Head" msgstr "" -#: public/editor-build/236-wp/texts.php:419 +#: public/editor-build/250-wp/texts.php:509 msgid "Header" msgstr "" -#: public/editor-build/236-wp/texts.php:420 +#: public/editor-build/250-wp/texts.php:510 +msgid "Header Customisation" +msgstr "" + +#: public/editor-build/250-wp/texts.php:511 +msgid "Heading Text" +msgstr "" + +#: public/editor-build/250-wp/texts.php:512 msgid "Health / Beauty" msgstr "" -#: public/editor-build/236-wp/texts.php:421 +#: public/editor-build/250-wp/texts.php:513 msgid "Heavy" msgstr "" -#: public/editor-build/236-wp/texts.php:422 +#: public/editor-build/250-wp/texts.php:514 msgid "Height" msgstr "" -#: public/editor-build/236-wp/texts.php:423 +#: public/editor-build/250-wp/texts.php:515 msgid "Hero" msgstr "" -#: public/editor-build/236-wp/texts.php:424 +#: public/editor-build/250-wp/texts.php:516 msgid "Hidden" msgstr "" -#: public/editor-build/236-wp/texts.php:425 +#: public/editor-build/250-wp/texts.php:517 msgid "Hide" msgstr "" -#: public/editor-build/236-wp/texts.php:426 +#: public/editor-build/250-wp/texts.php:518 +msgid "Hide Aftership Icon" +msgstr "" + +#: public/editor-build/250-wp/texts.php:519 msgid "Hide Cover Photo" msgstr "" -#: public/editor-build/236-wp/texts.php:427 +#: public/editor-build/250-wp/texts.php:520 msgid "Hide Hidden Elements" msgstr "" -#: public/editor-build/236-wp/texts.php:428 +#: public/editor-build/250-wp/texts.php:521 +msgid "Hide Load More Arrow" +msgstr "" + +#: public/editor-build/250-wp/texts.php:522 msgid "Hierarchical" msgstr "" -#: public/editor-build/236-wp/texts.php:429 +#: public/editor-build/250-wp/texts.php:523 +msgid "HomePage" +msgstr "" + +#: public/editor-build/250-wp/texts.php:524 msgid "Horizontal" msgstr "" -#: public/editor-build/236-wp/texts.php:430 +#: public/editor-build/250-wp/texts.php:525 msgid "Horizontal Align" msgstr "" -#: public/editor-build/236-wp/texts.php:431 +#: public/editor-build/250-wp/texts.php:526 msgid "Horizontal Offset" msgstr "" -#: public/editor-build/236-wp/texts.php:432 +#: public/editor-build/250-wp/texts.php:527 msgid "Host" msgstr "" -#: public/editor-build/236-wp/texts.php:433 +#: public/editor-build/250-wp/texts.php:528 msgid "Hour" msgstr "" -#: public/editor-build/236-wp/texts.php:434 +#: public/editor-build/250-wp/texts.php:529 msgid "Hours" msgstr "" -#: public/editor-build/236-wp/texts.php:435 +#: public/editor-build/250-wp/texts.php:530 msgid "Hover" msgstr "" -#: public/editor-build/236-wp/texts.php:436 +#: public/editor-build/250-wp/texts.php:531 msgid "Hover Transition" msgstr "" -#: public/editor-build/236-wp/texts.php:437 +#: public/editor-build/250-wp/texts.php:532 +msgid "Hover Zoom" +msgstr "" + +#: public/editor-build/250-wp/texts.php:533 +msgid "HoverOpacity" +msgstr "" + +#: public/editor-build/250-wp/texts.php:534 msgid "Hue" msgstr "" -#: public/editor-build/236-wp/texts.php:438 +#: public/editor-build/250-wp/texts.php:535 +msgid "I agree with Terms & Conditions" +msgstr "" + +#: public/editor-build/250-wp/texts.php:536 msgid "ID" msgstr "" -#: public/editor-build/236-wp/texts.php:439 +#: public/editor-build/250-wp/texts.php:537 msgid "Icon" msgstr "" -#: public/editor-build/236-wp/texts.php:440 +#: public/editor-build/250-wp/texts.php:538 msgid "Icon Box" msgstr "" -#: public/editor-build/236-wp/texts.php:441 +#: public/editor-build/250-wp/texts.php:539 msgid "Icon Styles" msgstr "" -#: public/editor-build/236-wp/texts.php:442 +#: public/editor-build/250-wp/texts.php:540 msgid "Icons" msgstr "" -#: public/editor-build/236-wp/texts.php:443 +#: public/editor-build/250-wp/texts.php:541 +msgid "If filtered results is empty, fill widget with other reviews" +msgstr "" + +#: public/editor-build/250-wp/texts.php:542 msgid "If you need to have multiple emails you can separate them by commas" msgstr "" -#: public/editor-build/236-wp/texts.php:444 +#: public/editor-build/250-wp/texts.php:543 msgid "If you need to increase max upload size please contact your hosting." msgstr "" -#: public/editor-build/236-wp/texts.php:445 +#: public/editor-build/250-wp/texts.php:544 msgid "Image" msgstr "" -#: public/editor-build/236-wp/texts.php:446 +#: public/editor-build/250-wp/texts.php:545 +msgid "Image Link Text" +msgstr "" + +#: public/editor-build/250-wp/texts.php:546 msgid "Image Test" msgstr "" -#: public/editor-build/236-wp/texts.php:447 +#: public/editor-build/250-wp/texts.php:547 msgid "Image file is too large." msgstr "" -#: public/editor-build/236-wp/texts.php:448 +#: public/editor-build/250-wp/texts.php:548 msgid "Import New Block" msgstr "" -#: public/editor-build/236-wp/texts.php:449 +#: public/editor-build/250-wp/texts.php:549 msgid "Import New Layout" msgstr "" -#: public/editor-build/236-wp/texts.php:450 +#: public/editor-build/250-wp/texts.php:550 msgid "Import New Popup" msgstr "" -#: public/editor-build/236-wp/texts.php:451 +#: public/editor-build/250-wp/texts.php:551 msgid "Import This Layout" msgstr "" -#: public/editor-build/236-wp/texts.php:452 +#: public/editor-build/250-wp/texts.php:552 msgid "Import This Story" msgstr "" -#: public/editor-build/236-wp/texts.php:453 +#: public/editor-build/250-wp/texts.php:553 msgid "In" msgstr "" -#: public/editor-build/236-wp/texts.php:454 +#: public/editor-build/250-wp/texts.php:554 msgid "InOut" msgstr "" -#: public/editor-build/236-wp/texts.php:455 +#: public/editor-build/250-wp/texts.php:555 msgid "Include" msgstr "" -#: public/editor-build/236-wp/texts.php:456 +#: public/editor-build/250-wp/texts.php:556 msgid "Include By" msgstr "" -#: public/editor-build/236-wp/texts.php:457 +#: public/editor-build/250-wp/texts.php:557 msgid "Include Full Post" msgstr "" -#: public/editor-build/236-wp/texts.php:458 +#: public/editor-build/250-wp/texts.php:558 +msgid "Include Q & A" +msgstr "" + +#: public/editor-build/250-wp/texts.php:559 msgid "Include Share Button" msgstr "" -#: public/editor-build/236-wp/texts.php:459 +#: public/editor-build/250-wp/texts.php:560 msgid "Incorrect" msgstr "" -#: public/editor-build/236-wp/texts.php:460 +#: public/editor-build/250-wp/texts.php:561 msgid "Incorrect username or password" msgstr "" -#: public/editor-build/236-wp/texts.php:461 +#: public/editor-build/250-wp/texts.php:562 msgid "Inequality operator" msgstr "" -#: public/editor-build/236-wp/texts.php:462 +#: public/editor-build/250-wp/texts.php:563 +msgid "Infinite Animation" +msgstr "" + +#: public/editor-build/250-wp/texts.php:564 +msgid "Infinite Options" +msgstr "" + +#: public/editor-build/250-wp/texts.php:565 +msgid "Infinite Options by ShopPad" +msgstr "" + +#: public/editor-build/250-wp/texts.php:566 msgid "Info" msgstr "" -#: public/editor-build/236-wp/texts.php:463 +#: public/editor-build/250-wp/texts.php:567 +msgid "Information" +msgstr "" + +#: public/editor-build/250-wp/texts.php:568 msgid "Inherit" msgstr "" -#: public/editor-build/236-wp/texts.php:464 +#: public/editor-build/250-wp/texts.php:569 msgid "Inline" msgstr "" -#: public/editor-build/236-wp/texts.php:465 +#: public/editor-build/250-wp/texts.php:570 msgid "Input" msgstr "" -#: public/editor-build/236-wp/texts.php:466 +#: public/editor-build/250-wp/texts.php:571 msgid "Inputted a valid site key" msgstr "" -#: public/editor-build/236-wp/texts.php:467 +#: public/editor-build/250-wp/texts.php:572 +msgid "Insert AppKey" +msgstr "" + +#: public/editor-build/250-wp/texts.php:573 +msgid "Insert IDs..." +msgstr "" + +#: public/editor-build/250-wp/texts.php:574 +msgid "Insert Text..." +msgstr "" + +#: public/editor-build/250-wp/texts.php:575 +msgid "Insert Title..." +msgstr "" + +#: public/editor-build/250-wp/texts.php:576 +msgid "Insert Type..." +msgstr "" + +#: public/editor-build/250-wp/texts.php:577 +msgid "Insert Types..." +msgstr "" + +#: public/editor-build/250-wp/texts.php:578 +msgid "Insert Vendor..." +msgstr "" + +#: public/editor-build/250-wp/texts.php:579 +msgid "Insert only one of each type of upsell on your page!" +msgstr "" + +#: public/editor-build/250-wp/texts.php:580 msgid "Inset" msgstr "" -#: public/editor-build/236-wp/texts.php:468 +#: public/editor-build/250-wp/texts.php:581 +msgid "Inside" +msgstr "" + +#: public/editor-build/250-wp/texts.php:582 +msgid "Interval" +msgstr "" + +#: public/editor-build/250-wp/texts.php:583 msgid "Intro" msgstr "" -#: public/editor-build/236-wp/texts.php:469 +#: public/editor-build/250-wp/texts.php:584 msgid "Invalid api data" msgstr "" -#: public/editor-build/236-wp/texts.php:470 +#: public/editor-build/250-wp/texts.php:585 msgid "It's a sample" msgstr "" -#: public/editor-build/236-wp/texts.php:471 +#: public/editor-build/250-wp/texts.php:586 msgid "Italian" msgstr "" -#: public/editor-build/236-wp/texts.php:472 +#: public/editor-build/250-wp/texts.php:587 msgid "Italic" msgstr "" -#: public/editor-build/236-wp/texts.php:473 +#: public/editor-build/250-wp/texts.php:588 msgid "Item" msgstr "" -#: public/editor-build/236-wp/texts.php:474 +#: public/editor-build/250-wp/texts.php:589 msgid "JackInTheBox" msgstr "" -#: public/editor-build/236-wp/texts.php:475 +#: public/editor-build/250-wp/texts.php:590 msgid "Jello" msgstr "" -#: public/editor-build/236-wp/texts.php:476 +#: public/editor-build/250-wp/texts.php:591 msgid "Keyboard Shortcuts" msgstr "" -#: public/editor-build/236-wp/texts.php:477 +#: public/editor-build/250-wp/texts.php:592 +msgid "Kiwi Size Chart" +msgstr "" + +#: public/editor-build/250-wp/texts.php:593 +msgid "Kiwi Size Chart & Recommender" +msgstr "" + +#: public/editor-build/250-wp/texts.php:594 msgid "Label" msgstr "" -#: public/editor-build/236-wp/texts.php:478 +#: public/editor-build/250-wp/texts.php:595 msgid "Label Bg" msgstr "" -#: public/editor-build/236-wp/texts.php:479 +#: public/editor-build/250-wp/texts.php:596 +msgid "Label Subtitle" +msgstr "" + +#: public/editor-build/250-wp/texts.php:597 +msgid "Landing Page Link" +msgstr "" + +#: public/editor-build/250-wp/texts.php:598 msgid "Language" msgstr "" -#: public/editor-build/236-wp/texts.php:480 +#: public/editor-build/250-wp/texts.php:599 msgid "Languages" msgstr "" -#: public/editor-build/236-wp/texts.php:481 +#: public/editor-build/250-wp/texts.php:600 +msgid "Large" +msgstr "" + +#: public/editor-build/250-wp/texts.php:601 +msgid "Large Centered" +msgstr "" + +#: public/editor-build/250-wp/texts.php:602 msgid "Last Name" msgstr "" -#: public/editor-build/236-wp/texts.php:482 +#: public/editor-build/250-wp/texts.php:603 msgid "Lateral" msgstr "" -#: public/editor-build/236-wp/texts.php:483 +#: public/editor-build/250-wp/texts.php:604 msgid "Layout" msgstr "" -#: public/editor-build/236-wp/texts.php:484 +#: public/editor-build/250-wp/texts.php:605 msgid "Layouts" msgstr "" -#: public/editor-build/236-wp/texts.php:485 +#: public/editor-build/250-wp/texts.php:606 +msgid "Lazy Load" +msgstr "" + +#: public/editor-build/250-wp/texts.php:607 msgid "Left" msgstr "" -#: public/editor-build/236-wp/texts.php:486 +#: public/editor-build/250-wp/texts.php:608 msgid "Letter Sp." msgstr "" -#: public/editor-build/236-wp/texts.php:487 +#: public/editor-build/250-wp/texts.php:609 msgid "Level" msgstr "" -#: public/editor-build/236-wp/texts.php:488 +#: public/editor-build/250-wp/texts.php:610 msgid "Light" msgstr "" -#: public/editor-build/236-wp/texts.php:489 +#: public/editor-build/250-wp/texts.php:611 msgid "LightSpeedIn" msgstr "" -#: public/editor-build/236-wp/texts.php:490 +#: public/editor-build/250-wp/texts.php:612 msgid "Lighten" msgstr "" -#: public/editor-build/236-wp/texts.php:491 +#: public/editor-build/250-wp/texts.php:613 msgid "Like" msgstr "" -#: public/editor-build/236-wp/texts.php:492 +#: public/editor-build/250-wp/texts.php:614 msgid "Like Button" msgstr "" -#: public/editor-build/236-wp/texts.php:493 +#: public/editor-build/250-wp/texts.php:615 +msgid "Limit Words" +msgstr "" + +#: public/editor-build/250-wp/texts.php:616 +msgid "Limit the max number of words for review body" +msgstr "" + +#: public/editor-build/250-wp/texts.php:617 msgid "Line" msgstr "" -#: public/editor-build/236-wp/texts.php:494 +#: public/editor-build/250-wp/texts.php:618 msgid "Line Hgt." msgstr "" -#: public/editor-build/236-wp/texts.php:495 +#: public/editor-build/250-wp/texts.php:619 msgid "Linear" msgstr "" -#: public/editor-build/236-wp/texts.php:496 +#: public/editor-build/250-wp/texts.php:620 msgid "Link" msgstr "" -#: public/editor-build/236-wp/texts.php:497 +#: public/editor-build/250-wp/texts.php:621 +msgid "Link Text" +msgstr "" + +#: public/editor-build/250-wp/texts.php:622 +msgid "Link To Page" +msgstr "" + +#: public/editor-build/250-wp/texts.php:623 msgid "Link to" msgstr "" -#: public/editor-build/236-wp/texts.php:498 +#: public/editor-build/250-wp/texts.php:624 msgid "Links" msgstr "" -#: public/editor-build/236-wp/texts.php:499 +#: public/editor-build/250-wp/texts.php:625 msgid "List" msgstr "" -#: public/editor-build/236-wp/texts.php:500 +#: public/editor-build/250-wp/texts.php:626 msgid "List are not created please connect the support" msgstr "" -#: public/editor-build/236-wp/texts.php:501 +#: public/editor-build/250-wp/texts.php:627 msgid "Lists are empty. Please add a new list and try again." msgstr "" -#: public/editor-build/236-wp/texts.php:502 +#: public/editor-build/250-wp/texts.php:628 +msgid "Load More On Scroll" +msgstr "" + +#: public/editor-build/250-wp/texts.php:629 msgid "Locked" msgstr "" -#: public/editor-build/236-wp/texts.php:503 +#: public/editor-build/250-wp/texts.php:630 msgid "Login" msgstr "" -#: public/editor-build/236-wp/texts.php:504 +#: public/editor-build/250-wp/texts.php:631 msgid "Logout" msgstr "" -#: public/editor-build/236-wp/texts.php:505 +#: public/editor-build/250-wp/texts.php:632 +msgid "Lookup Options" +msgstr "" + +#: public/editor-build/250-wp/texts.php:633 msgid "Loop" msgstr "" -#: public/editor-build/236-wp/texts.php:506 +#: public/editor-build/250-wp/texts.php:634 msgid "Lost Password" msgstr "" -#: public/editor-build/236-wp/texts.php:507 +#: public/editor-build/250-wp/texts.php:635 msgid "Lottie" msgstr "" -#: public/editor-build/236-wp/texts.php:508 +#: public/editor-build/250-wp/texts.php:636 msgid "Lottie File" msgstr "" -#: public/editor-build/236-wp/texts.php:509 +#: public/editor-build/250-wp/texts.php:637 msgid "Lottie Link" msgstr "" -#: public/editor-build/236-wp/texts.php:510 +#: public/editor-build/250-wp/texts.php:638 msgid "Luminosity" msgstr "" -#: public/editor-build/236-wp/texts.php:511 +#: public/editor-build/250-wp/texts.php:639 msgid "Main" msgstr "" -#: public/editor-build/236-wp/texts.php:512 +#: public/editor-build/250-wp/texts.php:640 +msgid "Main product image" +msgstr "" + +#: public/editor-build/250-wp/texts.php:641 msgid "Make it Global" msgstr "" -#: public/editor-build/236-wp/texts.php:513 +#: public/editor-build/250-wp/texts.php:642 msgid "Make it Hamburger" msgstr "" -#: public/editor-build/236-wp/texts.php:514 +#: public/editor-build/250-wp/texts.php:643 msgid "Make it Nofollow" msgstr "" -#: public/editor-build/236-wp/texts.php:515 +#: public/editor-build/250-wp/texts.php:644 msgid "Make it a Slider" msgstr "" -#: public/editor-build/236-wp/texts.php:516 +#: public/editor-build/250-wp/texts.php:645 msgid "Manual" msgstr "" -#: public/editor-build/236-wp/texts.php:517 +#: public/editor-build/250-wp/texts.php:646 msgid "Map" msgstr "" -#: public/editor-build/236-wp/texts.php:518 +#: public/editor-build/250-wp/texts.php:647 msgid "Margin" msgstr "" -#: public/editor-build/236-wp/texts.php:519 +#: public/editor-build/250-wp/texts.php:648 +msgid "Marketing" +msgstr "" + +#: public/editor-build/250-wp/texts.php:649 +msgid "Marketing by Marsello" +msgstr "" + +#: public/editor-build/250-wp/texts.php:650 +msgid "Marketing by Omnisend" +msgstr "" + +#: public/editor-build/250-wp/texts.php:651 +msgid "Marketing by Social SnowBall" +msgstr "" + +#: public/editor-build/250-wp/texts.php:652 msgid "Mask" msgstr "" -#: public/editor-build/236-wp/texts.php:520 +#: public/editor-build/250-wp/texts.php:653 +msgid "Masonry Arrangement" +msgstr "" + +#: public/editor-build/250-wp/texts.php:654 msgid "Max" msgstr "" -#: public/editor-build/236-wp/texts.php:521 +#: public/editor-build/250-wp/texts.php:655 msgid "Max Date" msgstr "" -#: public/editor-build/236-wp/texts.php:522 +#: public/editor-build/250-wp/texts.php:656 msgid "Max Time" msgstr "" -#: public/editor-build/236-wp/texts.php:523 +#: public/editor-build/250-wp/texts.php:657 msgid "Max. File Size" msgstr "" -#: public/editor-build/236-wp/texts.php:524 +#: public/editor-build/250-wp/texts.php:658 msgid "Medium" msgstr "" -#: public/editor-build/236-wp/texts.php:525 +#: public/editor-build/250-wp/texts.php:659 msgid "Mega Menu" msgstr "" -#: public/editor-build/236-wp/texts.php:526 +#: public/editor-build/250-wp/texts.php:660 msgid "Membership" msgstr "" -#: public/editor-build/236-wp/texts.php:527 +#: public/editor-build/250-wp/texts.php:661 msgid "Mention" msgstr "" -#: public/editor-build/236-wp/texts.php:528 +#: public/editor-build/250-wp/texts.php:662 msgid "Menu" msgstr "" -#: public/editor-build/236-wp/texts.php:529 +#: public/editor-build/250-wp/texts.php:663 msgid "Menu Items" msgstr "" -#: public/editor-build/236-wp/texts.php:530 +#: public/editor-build/250-wp/texts.php:664 msgid "Menu Order" msgstr "" -#: public/editor-build/236-wp/texts.php:531 +#: public/editor-build/250-wp/texts.php:665 msgid "Menu order" msgstr "" -#: public/editor-build/236-wp/texts.php:532 +#: public/editor-build/250-wp/texts.php:666 msgid "Message" msgstr "" -#: public/editor-build/236-wp/texts.php:533 +#: public/editor-build/250-wp/texts.php:667 msgid "Message not sent" msgstr "" -#: public/editor-build/236-wp/texts.php:534 +#: public/editor-build/250-wp/texts.php:668 msgid "Message sent" msgstr "" -#: public/editor-build/236-wp/texts.php:535 +#: public/editor-build/250-wp/texts.php:669 msgid "Messages" msgstr "" -#: public/editor-build/236-wp/texts.php:536 +#: public/editor-build/250-wp/texts.php:670 msgid "Meta" msgstr "" -#: public/editor-build/236-wp/texts.php:537 +#: public/editor-build/250-wp/texts.php:671 msgid "Meta Data" msgstr "" -#: public/editor-build/236-wp/texts.php:538 +#: public/editor-build/250-wp/texts.php:672 msgid "Meta Key" msgstr "" -#: public/editor-build/236-wp/texts.php:539 +#: public/editor-build/250-wp/texts.php:673 msgid "Meta Value" msgstr "" -#: public/editor-build/236-wp/texts.php:540 +#: public/editor-build/250-wp/texts.php:674 msgid "Min" msgstr "" -#: public/editor-build/236-wp/texts.php:541 +#: public/editor-build/250-wp/texts.php:675 msgid "Min Date" msgstr "" -#: public/editor-build/236-wp/texts.php:542 +#: public/editor-build/250-wp/texts.php:676 msgid "Min Time" msgstr "" -#: public/editor-build/236-wp/texts.php:543 +#: public/editor-build/250-wp/texts.php:677 msgid "Minimal" msgstr "" -#: public/editor-build/236-wp/texts.php:544 +#: public/editor-build/250-wp/texts.php:678 +msgid "Minimum Rating" +msgstr "" + +#: public/editor-build/250-wp/texts.php:679 msgid "Minutes" msgstr "" -#: public/editor-build/236-wp/texts.php:545 +#: public/editor-build/250-wp/texts.php:680 msgid "Missing Element" msgstr "" -#: public/editor-build/236-wp/texts.php:546 +#: public/editor-build/250-wp/texts.php:681 msgid "Mobile" msgstr "" -#: public/editor-build/236-wp/texts.php:547 +#: public/editor-build/250-wp/texts.php:682 +msgid "Mobile Grid Style" +msgstr "" + +#: public/editor-build/250-wp/texts.php:683 msgid "Mobile view" msgstr "" -#: public/editor-build/236-wp/texts.php:548 +#: public/editor-build/250-wp/texts.php:684 msgid "Modified" msgstr "" -#: public/editor-build/236-wp/texts.php:549 +#: public/editor-build/250-wp/texts.php:685 msgid "More" msgstr "" -#: public/editor-build/236-wp/texts.php:550 +#: public/editor-build/250-wp/texts.php:686 msgid "More Settings" msgstr "" -#: public/editor-build/236-wp/texts.php:551 +#: public/editor-build/250-wp/texts.php:687 msgid "MouseTrack" msgstr "" -#: public/editor-build/236-wp/texts.php:552 +#: public/editor-build/250-wp/texts.php:688 msgid "Move down" msgstr "" -#: public/editor-build/236-wp/texts.php:553 +#: public/editor-build/250-wp/texts.php:689 msgid "Move left" msgstr "" -#: public/editor-build/236-wp/texts.php:554 +#: public/editor-build/250-wp/texts.php:690 msgid "Move right" msgstr "" -#: public/editor-build/236-wp/texts.php:555 +#: public/editor-build/250-wp/texts.php:691 msgid "Move up" msgstr "" -#: public/editor-build/236-wp/texts.php:556 +#: public/editor-build/250-wp/texts.php:692 msgid "Multi-Language" msgstr "" -#: public/editor-build/236-wp/texts.php:557 +#: public/editor-build/250-wp/texts.php:693 msgid "Multiple Selection" msgstr "" -#: public/editor-build/236-wp/texts.php:558 +#: public/editor-build/250-wp/texts.php:694 msgid "Multiply" msgstr "" -#: public/editor-build/236-wp/texts.php:559 +#: public/editor-build/250-wp/texts.php:695 msgid "Muted" msgstr "" -#: public/editor-build/236-wp/texts.php:560 +#: public/editor-build/250-wp/texts.php:696 msgid "My Account" msgstr "" -#: public/editor-build/236-wp/texts.php:561 -msgid "MyAccount" -msgstr "" - -#: public/editor-build/236-wp/texts.php:562 +#: public/editor-build/250-wp/texts.php:697 msgid "N/A" msgstr "" -#: public/editor-build/236-wp/texts.php:563 +#: public/editor-build/250-wp/texts.php:698 msgid "Name" msgstr "" -#: public/editor-build/236-wp/texts.php:564 +#: public/editor-build/250-wp/texts.php:699 +msgid "Name - First on Mobile" +msgstr "" + +#: public/editor-build/250-wp/texts.php:700 msgid "Native HTML5" msgstr "" -#: public/editor-build/236-wp/texts.php:565 +#: public/editor-build/250-wp/texts.php:701 msgid "Nav" msgstr "" -#: public/editor-build/236-wp/texts.php:566 +#: public/editor-build/250-wp/texts.php:702 msgid "Navigation" msgstr "" -#: public/editor-build/236-wp/texts.php:567 +#: public/editor-build/250-wp/texts.php:703 msgid "Need help" msgstr "" -#: public/editor-build/236-wp/texts.php:568 +#: public/editor-build/250-wp/texts.php:704 msgid "New Style #%s" msgstr "" -#: public/editor-build/236-wp/texts.php:569 +#: public/editor-build/250-wp/texts.php:705 msgid "No matches found" msgstr "" -#: public/editor-build/236-wp/texts.php:570 +#: public/editor-build/250-wp/texts.php:706 +msgid "No product selected" +msgstr "" + +#: public/editor-build/250-wp/texts.php:707 msgid "No results" msgstr "" -#: public/editor-build/236-wp/texts.php:571 +#: public/editor-build/250-wp/texts.php:708 +msgid "No-Repeat" +msgstr "" + +#: public/editor-build/250-wp/texts.php:709 msgid "Non Profit" msgstr "" -#: public/editor-build/236-wp/texts.php:572 +#: public/editor-build/250-wp/texts.php:710 msgid "None" msgstr "" -#: public/editor-build/236-wp/texts.php:573 +#: public/editor-build/250-wp/texts.php:711 msgid "Normal" msgstr "" -#: public/editor-build/236-wp/texts.php:574 +#: public/editor-build/250-wp/texts.php:712 msgid "Not Required" msgstr "" -#: public/editor-build/236-wp/texts.php:575 +#: public/editor-build/250-wp/texts.php:713 msgid "Nothing Found" msgstr "" -#: public/editor-build/236-wp/texts.php:576 +#: public/editor-build/250-wp/texts.php:714 msgid "Nothing here yet, make a global block first." msgstr "" -#: public/editor-build/236-wp/texts.php:577 +#: public/editor-build/250-wp/texts.php:715 msgid "Nothing here yet, make a global popup first." msgstr "" -#: public/editor-build/236-wp/texts.php:578 +#: public/editor-build/250-wp/texts.php:716 msgid "Nothing here yet, save a block first." msgstr "" -#: public/editor-build/236-wp/texts.php:579 +#: public/editor-build/250-wp/texts.php:717 msgid "Nothing here yet, save a layout first." msgstr "" -#: public/editor-build/236-wp/texts.php:580 +#: public/editor-build/250-wp/texts.php:718 msgid "Nothing here yet, save a popup first." msgstr "" -#: public/editor-build/236-wp/texts.php:581 +#: public/editor-build/250-wp/texts.php:719 msgid "Nothing here, please refine your search." msgstr "" -#: public/editor-build/236-wp/texts.php:582 +#: public/editor-build/250-wp/texts.php:720 +msgid "Notification" +msgstr "" + +#: public/editor-build/250-wp/texts.php:721 +msgid "Notifications" +msgstr "" + +#: public/editor-build/250-wp/texts.php:722 +msgid "Notifications by OnVoard" +msgstr "" + +#: public/editor-build/250-wp/texts.php:723 +msgid "Notifications by PushOwl" +msgstr "" + +#: public/editor-build/250-wp/texts.php:724 +msgid "Notifications by ReferralCandy" +msgstr "" + +#: public/editor-build/250-wp/texts.php:725 msgid "Nr" msgstr "" -#: public/editor-build/236-wp/texts.php:583 +#: public/editor-build/250-wp/texts.php:726 msgid "Number" msgstr "" -#: public/editor-build/236-wp/texts.php:584 +#: public/editor-build/250-wp/texts.php:727 +msgid "Number of Reviews" +msgstr "" + +#: public/editor-build/250-wp/texts.php:728 +msgid "Number of items in stock" +msgstr "" + +#: public/editor-build/250-wp/texts.php:729 msgid "Number of posts" msgstr "" -#: public/editor-build/236-wp/texts.php:585 +#: public/editor-build/250-wp/texts.php:730 msgid "Offset" msgstr "" -#: public/editor-build/236-wp/texts.php:586 +#: public/editor-build/250-wp/texts.php:731 msgid "On Click" msgstr "" -#: public/editor-build/236-wp/texts.php:587 +#: public/editor-build/250-wp/texts.php:732 msgid "On Hover" msgstr "" -#: public/editor-build/236-wp/texts.php:588 +#: public/editor-build/250-wp/texts.php:733 msgid "One Page" msgstr "" -#: public/editor-build/236-wp/texts.php:589 +#: public/editor-build/250-wp/texts.php:734 msgid "Open In New Tab" msgstr "" -#: public/editor-build/236-wp/texts.php:590 +#: public/editor-build/250-wp/texts.php:735 msgid "Open in Lightbox" msgstr "" -#: public/editor-build/236-wp/texts.php:591 +#: public/editor-build/250-wp/texts.php:736 msgid "Opposite" msgstr "" -#: public/editor-build/236-wp/texts.php:592 +#: public/editor-build/250-wp/texts.php:737 +msgid "Options" +msgstr "" + +#: public/editor-build/250-wp/texts.php:738 +msgid "Options by Hulk" +msgstr "" + +#: public/editor-build/250-wp/texts.php:739 msgid "Order" msgstr "" -#: public/editor-build/236-wp/texts.php:593 +#: public/editor-build/250-wp/texts.php:740 msgid "Order By" msgstr "" -#: public/editor-build/236-wp/texts.php:594 +#: public/editor-build/250-wp/texts.php:741 msgid "Order Tracking" msgstr "" -#: public/editor-build/236-wp/texts.php:595 +#: public/editor-build/250-wp/texts.php:742 +msgid "Order Tracking by Automazily" +msgstr "" + +#: public/editor-build/250-wp/texts.php:743 +msgid "Order Tracking by Automizely" +msgstr "" + +#: public/editor-build/250-wp/texts.php:744 msgid "Orientation" msgstr "" -#: public/editor-build/236-wp/texts.php:596 +#: public/editor-build/250-wp/texts.php:745 msgid "Out" msgstr "" -#: public/editor-build/236-wp/texts.php:597 +#: public/editor-build/250-wp/texts.php:746 msgid "OutIn" msgstr "" -#: public/editor-build/236-wp/texts.php:598 +#: public/editor-build/250-wp/texts.php:747 msgid "Outline" msgstr "" -#: public/editor-build/236-wp/texts.php:599 +#: public/editor-build/250-wp/texts.php:748 msgid "Outset" msgstr "" -#: public/editor-build/236-wp/texts.php:600 +#: public/editor-build/250-wp/texts.php:749 +msgid "Outside" +msgstr "" + +#: public/editor-build/250-wp/texts.php:750 msgid "Overlay" msgstr "" -#: public/editor-build/236-wp/texts.php:601 +#: public/editor-build/250-wp/texts.php:751 msgid "Overlay " msgstr "" -#: public/editor-build/236-wp/texts.php:602 +#: public/editor-build/250-wp/texts.php:752 msgid "P" msgstr "" -#: public/editor-build/236-wp/texts.php:603 +#: public/editor-build/250-wp/texts.php:753 +msgid "POWR Form Embed code" +msgstr "" + +#: public/editor-build/250-wp/texts.php:754 msgid "PRE" msgstr "" -#: public/editor-build/236-wp/texts.php:604 +#: public/editor-build/250-wp/texts.php:755 msgid "Padding" msgstr "" -#: public/editor-build/236-wp/texts.php:605 +#: public/editor-build/250-wp/texts.php:756 msgid "Page" msgstr "" -#: public/editor-build/236-wp/texts.php:606 +#: public/editor-build/250-wp/texts.php:757 msgid "Page Layout" msgstr "" -#: public/editor-build/236-wp/texts.php:607 +#: public/editor-build/250-wp/texts.php:758 msgid "Page Template" msgstr "" -#: public/editor-build/236-wp/texts.php:608 +#: public/editor-build/250-wp/texts.php:759 msgid "Page Title" msgstr "" -#: public/editor-build/236-wp/texts.php:609 +#: public/editor-build/250-wp/texts.php:760 msgid "Page title" msgstr "" -#: public/editor-build/236-wp/texts.php:610 +#: public/editor-build/250-wp/texts.php:761 msgid "Pages" msgstr "" -#: public/editor-build/236-wp/texts.php:611 +#: public/editor-build/250-wp/texts.php:762 msgid "Pagination" msgstr "" -#: public/editor-build/236-wp/texts.php:612 +#: public/editor-build/250-wp/texts.php:763 msgid "Paragraph" msgstr "" -#: public/editor-build/236-wp/texts.php:613 +#: public/editor-build/250-wp/texts.php:764 msgid "Parallax" msgstr "" -#: public/editor-build/236-wp/texts.php:614 +#: public/editor-build/250-wp/texts.php:765 +msgid "Parcel Panel Order Tracking" +msgstr "" + +#: public/editor-build/250-wp/texts.php:766 msgid "Parent" msgstr "" -#: public/editor-build/236-wp/texts.php:615 +#: public/editor-build/250-wp/texts.php:767 msgid "Password" msgstr "" -#: public/editor-build/236-wp/texts.php:616 +#: public/editor-build/250-wp/texts.php:768 msgid "Password and confirm password is not the same" msgstr "" -#: public/editor-build/236-wp/texts.php:617 +#: public/editor-build/250-wp/texts.php:769 msgid "Paste" msgstr "" -#: public/editor-build/236-wp/texts.php:618 +#: public/editor-build/250-wp/texts.php:770 msgid "Paste Style" msgstr "" -#: public/editor-build/236-wp/texts.php:619 +#: public/editor-build/250-wp/texts.php:771 msgid "Paste Styles" msgstr "" -#: public/editor-build/236-wp/texts.php:620 +#: public/editor-build/250-wp/texts.php:772 msgid "Paste your HTML code here..." msgstr "" -#: public/editor-build/236-wp/texts.php:621 +#: public/editor-build/250-wp/texts.php:773 msgid "Pending" msgstr "" -#: public/editor-build/236-wp/texts.php:622 +#: public/editor-build/250-wp/texts.php:774 msgid "Percent" msgstr "" -#: public/editor-build/236-wp/texts.php:623 +#: public/editor-build/250-wp/texts.php:775 msgid "Percentage" msgstr "" -#: public/editor-build/236-wp/texts.php:624 +#: public/editor-build/250-wp/texts.php:776 +msgid "Personalizer by Zepto" +msgstr "" + +#: public/editor-build/250-wp/texts.php:777 msgid "Phone Number" msgstr "" -#: public/editor-build/236-wp/texts.php:625 +#: public/editor-build/250-wp/texts.php:778 +msgid "Pinterest" +msgstr "" + +#: public/editor-build/250-wp/texts.php:779 msgid "Placeholder" msgstr "" -#: public/editor-build/236-wp/texts.php:626 +#: public/editor-build/250-wp/texts.php:780 msgid "Plain" msgstr "" -#: public/editor-build/236-wp/texts.php:627 +#: public/editor-build/250-wp/texts.php:781 msgid "Play" msgstr "" -#: public/editor-build/236-wp/texts.php:628 +#: public/editor-build/250-wp/texts.php:782 msgid "Play Counts" msgstr "" -#: public/editor-build/236-wp/texts.php:629 +#: public/editor-build/250-wp/texts.php:783 msgid "Playlist" msgstr "" -#: public/editor-build/236-wp/texts.php:630 +#: public/editor-build/250-wp/texts.php:784 msgid "Playlist Items" msgstr "" -#: public/editor-build/236-wp/texts.php:631 +#: public/editor-build/250-wp/texts.php:785 msgid "Plugin Settings" msgstr "" -#: public/editor-build/236-wp/texts.php:632 +#: public/editor-build/250-wp/texts.php:786 msgid "Points" msgstr "" -#: public/editor-build/236-wp/texts.php:633 +#: public/editor-build/250-wp/texts.php:787 msgid "Popularity" msgstr "" -#: public/editor-build/236-wp/texts.php:634 +#: public/editor-build/250-wp/texts.php:788 msgid "Popup" msgstr "" -#: public/editor-build/236-wp/texts.php:635 +#: public/editor-build/250-wp/texts.php:789 msgid "Popup Close Icon" msgstr "" -#: public/editor-build/236-wp/texts.php:637 +#: public/editor-build/250-wp/texts.php:791 msgid "Port" msgstr "" -#: public/editor-build/236-wp/texts.php:638 +#: public/editor-build/250-wp/texts.php:792 msgid "Portfolio" msgstr "" -#: public/editor-build/236-wp/texts.php:639 +#: public/editor-build/250-wp/texts.php:793 msgid "Position" msgstr "" -#: public/editor-build/236-wp/texts.php:640 +#: public/editor-build/250-wp/texts.php:794 msgid "Post" msgstr "" -#: public/editor-build/236-wp/texts.php:641 +#: public/editor-build/250-wp/texts.php:795 msgid "Post Content" msgstr "" -#: public/editor-build/236-wp/texts.php:642 +#: public/editor-build/250-wp/texts.php:796 msgid "Post Excerpt" msgstr "" -#: public/editor-build/236-wp/texts.php:643 +#: public/editor-build/250-wp/texts.php:797 msgid "Post Info" msgstr "" -#: public/editor-build/236-wp/texts.php:644 +#: public/editor-build/250-wp/texts.php:798 msgid "Post Navigation" msgstr "" -#: public/editor-build/236-wp/texts.php:645 +#: public/editor-build/250-wp/texts.php:799 +msgid "Post Subscription Text" +msgstr "" + +#: public/editor-build/250-wp/texts.php:800 msgid "Post Title" msgstr "" -#: public/editor-build/236-wp/texts.php:646 +#: public/editor-build/250-wp/texts.php:801 msgid "Post Type" msgstr "" -#: public/editor-build/236-wp/texts.php:647 +#: public/editor-build/250-wp/texts.php:802 msgid "Post info" msgstr "" -#: public/editor-build/236-wp/texts.php:648 +#: public/editor-build/250-wp/texts.php:803 +msgid "Post-display Button" +msgstr "" + +#: public/editor-build/250-wp/texts.php:804 msgid "Posts" msgstr "" -#: public/editor-build/236-wp/texts.php:649 +#: public/editor-build/250-wp/texts.php:805 msgid "Posts Pagination" msgstr "" -#: public/editor-build/236-wp/texts.php:650 +#: public/editor-build/250-wp/texts.php:806 msgid "Posts Tags" msgstr "" -#: public/editor-build/236-wp/texts.php:651 +#: public/editor-build/250-wp/texts.php:807 +msgid "Pre-display Button" +msgstr "" + +#: public/editor-build/250-wp/texts.php:808 +msgid "PreProduct" +msgstr "" + +#: public/editor-build/250-wp/texts.php:809 msgid "Prefix" msgstr "" -#: public/editor-build/236-wp/texts.php:652 +#: public/editor-build/250-wp/texts.php:810 msgid "Press the button above to add blocks" msgstr "" -#: public/editor-build/236-wp/texts.php:653 +#: public/editor-build/250-wp/texts.php:811 msgid "Press the button above to add popup" msgstr "" -#: public/editor-build/236-wp/texts.php:654 +#: public/editor-build/250-wp/texts.php:812 msgid "Press the button to add blocks" msgstr "" -#: public/editor-build/236-wp/texts.php:655 +#: public/editor-build/250-wp/texts.php:813 +msgid "Preview additional Images" +msgstr "" + +#: public/editor-build/250-wp/texts.php:814 msgid "Price" msgstr "" -#: public/editor-build/236-wp/texts.php:656 +#: public/editor-build/250-wp/texts.php:815 msgid "Pricing" msgstr "" -#: public/editor-build/236-wp/texts.php:657 +#: public/editor-build/250-wp/texts.php:816 +msgid "Privacy Mode" +msgstr "" + +#: public/editor-build/250-wp/texts.php:817 msgid "Private" msgstr "" -#: public/editor-build/236-wp/texts.php:659 +#: public/editor-build/250-wp/texts.php:819 msgid "Product Attributes" msgstr "" -#: public/editor-build/236-wp/texts.php:660 +#: public/editor-build/250-wp/texts.php:820 msgid "Product Breadcrumbs" msgstr "" -#: public/editor-build/236-wp/texts.php:661 +#: public/editor-build/250-wp/texts.php:821 msgid "Product Content" msgstr "" -#: public/editor-build/236-wp/texts.php:662 +#: public/editor-build/250-wp/texts.php:822 msgid "Product Excerpt" msgstr "" -#: public/editor-build/236-wp/texts.php:663 +#: public/editor-build/250-wp/texts.php:823 msgid "Product Gallery" msgstr "" -#: public/editor-build/236-wp/texts.php:664 +#: public/editor-build/250-wp/texts.php:824 msgid "Product ID" msgstr "" -#: public/editor-build/236-wp/texts.php:665 +#: public/editor-build/250-wp/texts.php:825 msgid "Product ID or SKU" msgstr "" -#: public/editor-build/236-wp/texts.php:666 +#: public/editor-build/250-wp/texts.php:826 +msgid "Product IDs" +msgstr "" + +#: public/editor-build/250-wp/texts.php:827 msgid "Product Meta" msgstr "" -#: public/editor-build/236-wp/texts.php:667 +#: public/editor-build/250-wp/texts.php:828 +msgid "Product Options" +msgstr "" + +#: public/editor-build/250-wp/texts.php:829 +msgid "Product Options by Bold" +msgstr "" + +#: public/editor-build/250-wp/texts.php:830 +msgid "Product Options by Hulk" +msgstr "" + +#: public/editor-build/250-wp/texts.php:831 msgid "Product Price" msgstr "" -#: public/editor-build/236-wp/texts.php:668 +#: public/editor-build/250-wp/texts.php:832 msgid "Product Rating" msgstr "" -#: public/editor-build/236-wp/texts.php:669 +#: public/editor-build/250-wp/texts.php:833 msgid "Product Review" msgstr "" -#: public/editor-build/236-wp/texts.php:670 +#: public/editor-build/250-wp/texts.php:834 msgid "Product Sku" msgstr "" -#: public/editor-build/236-wp/texts.php:671 +#: public/editor-build/250-wp/texts.php:835 +msgid "Product Source" +msgstr "" + +#: public/editor-build/250-wp/texts.php:836 msgid "Product Stock" msgstr "" -#: public/editor-build/236-wp/texts.php:672 +#: public/editor-build/250-wp/texts.php:837 msgid "Product Thumbnail" msgstr "" -#: public/editor-build/236-wp/texts.php:673 +#: public/editor-build/250-wp/texts.php:838 msgid "Product Title" msgstr "" -#: public/editor-build/236-wp/texts.php:674 +#: public/editor-build/250-wp/texts.php:839 +msgid "Product Type" +msgstr "" + +#: public/editor-build/250-wp/texts.php:840 +msgid "Product Vendor" +msgstr "" + +#: public/editor-build/250-wp/texts.php:841 msgid "Products" msgstr "" -#: public/editor-build/236-wp/texts.php:675 +#: public/editor-build/250-wp/texts.php:842 msgid "Products Count" msgstr "" -#: public/editor-build/236-wp/texts.php:676 +#: public/editor-build/250-wp/texts.php:843 msgid "Products Pagination" msgstr "" -#: public/editor-build/236-wp/texts.php:677 +#: public/editor-build/250-wp/texts.php:844 msgid "Products Tags" msgstr "" -#: public/editor-build/236-wp/texts.php:678 +#: public/editor-build/250-wp/texts.php:845 msgid "Progress" msgstr "" -#: public/editor-build/236-wp/texts.php:679 +#: public/editor-build/250-wp/texts.php:846 msgid "Protected Form" msgstr "" -#: public/editor-build/236-wp/texts.php:680 +#: public/editor-build/250-wp/texts.php:847 msgid "Protected Page" msgstr "" -#: public/editor-build/236-wp/texts.php:681 +#: public/editor-build/250-wp/texts.php:848 msgid "Publish" msgstr "" -#: public/editor-build/236-wp/texts.php:682 +#: public/editor-build/250-wp/texts.php:849 msgid "Publish Page" msgstr "" -#: public/editor-build/236-wp/texts.php:683 +#: public/editor-build/250-wp/texts.php:850 msgid "Pulse" msgstr "" -#: public/editor-build/236-wp/texts.php:684 +#: public/editor-build/250-wp/texts.php:851 msgid "Quantity" msgstr "" -#: public/editor-build/236-wp/texts.php:685 +#: public/editor-build/250-wp/texts.php:852 msgid "Query" msgstr "" -#: public/editor-build/236-wp/texts.php:686 +#: public/editor-build/250-wp/texts.php:853 msgid "Query Source" msgstr "" -#: public/editor-build/236-wp/texts.php:687 +#: public/editor-build/250-wp/texts.php:854 msgid "Radial" msgstr "" -#: public/editor-build/236-wp/texts.php:688 +#: public/editor-build/250-wp/texts.php:855 msgid "Radio" msgstr "" -#: public/editor-build/236-wp/texts.php:689 +#: public/editor-build/250-wp/texts.php:856 msgid "Random" msgstr "" -#: public/editor-build/236-wp/texts.php:690 +#: public/editor-build/250-wp/texts.php:857 +msgid "Randomize the reviews results" +msgstr "" + +#: public/editor-build/250-wp/texts.php:858 msgid "Rating" msgstr "" -#: public/editor-build/236-wp/texts.php:691 +#: public/editor-build/250-wp/texts.php:859 msgid "Rating scale" msgstr "" -#: public/editor-build/236-wp/texts.php:692 +#: public/editor-build/250-wp/texts.php:860 msgid "Ratio" msgstr "" -#: public/editor-build/236-wp/texts.php:693 +#: public/editor-build/250-wp/texts.php:861 msgid "ReCAPTCHA" msgstr "" -#: public/editor-build/236-wp/texts.php:694 +#: public/editor-build/250-wp/texts.php:862 msgid "Real-Estate" msgstr "" -#: public/editor-build/236-wp/texts.php:695 +#: public/editor-build/250-wp/texts.php:863 msgid "Recommend" msgstr "" -#: public/editor-build/236-wp/texts.php:696 +#: public/editor-build/250-wp/texts.php:864 msgid "Redirect" msgstr "" -#: public/editor-build/236-wp/texts.php:697 +#: public/editor-build/250-wp/texts.php:865 msgid "Redirect After Login" msgstr "" -#: public/editor-build/236-wp/texts.php:698 +#: public/editor-build/250-wp/texts.php:866 msgid "Redirect After Logout" msgstr "" -#: public/editor-build/236-wp/texts.php:699 +#: public/editor-build/250-wp/texts.php:867 msgid "Redo" msgstr "" -#: public/editor-build/236-wp/texts.php:700 +#: public/editor-build/250-wp/texts.php:868 +msgid "Referral" +msgstr "" + +#: public/editor-build/250-wp/texts.php:869 msgid "Refresh" msgstr "" -#: public/editor-build/236-wp/texts.php:701 +#: public/editor-build/250-wp/texts.php:870 msgid "Register" msgstr "" -#: public/editor-build/236-wp/texts.php:702 +#: public/editor-build/250-wp/texts.php:871 msgid "Register Info" msgstr "" -#: public/editor-build/236-wp/texts.php:703 +#: public/editor-build/250-wp/texts.php:872 msgid "Related Products" msgstr "" -#: public/editor-build/236-wp/texts.php:704 +#: public/editor-build/250-wp/texts.php:873 msgid "Related Products Pagination" msgstr "" -#: public/editor-build/236-wp/texts.php:705 +#: public/editor-build/250-wp/texts.php:874 msgid "Related Products Tags" msgstr "" -#: public/editor-build/236-wp/texts.php:706 +#: public/editor-build/250-wp/texts.php:875 msgid "Religion" msgstr "" -#: public/editor-build/236-wp/texts.php:707 +#: public/editor-build/250-wp/texts.php:876 msgid "Remember me" msgstr "" -#: public/editor-build/236-wp/texts.php:708 +#: public/editor-build/250-wp/texts.php:877 msgid "Renderer" msgstr "" -#: public/editor-build/236-wp/texts.php:709 +#: public/editor-build/250-wp/texts.php:878 msgid "Reorder Blocks" msgstr "" -#: public/editor-build/236-wp/texts.php:710 +#: public/editor-build/250-wp/texts.php:879 msgid "Repair" msgstr "" -#: public/editor-build/236-wp/texts.php:711 +#: public/editor-build/250-wp/texts.php:880 msgid "Repeat" msgstr "" -#: public/editor-build/236-wp/texts.php:712 +#: public/editor-build/250-wp/texts.php:881 +msgid "Repeat-X" +msgstr "" + +#: public/editor-build/250-wp/texts.php:882 +msgid "Repeat-Y" +msgstr "" + +#: public/editor-build/250-wp/texts.php:883 msgid "Replace global styling" msgstr "" -#: public/editor-build/236-wp/texts.php:713 +#: public/editor-build/250-wp/texts.php:884 msgid "Replay Animation" msgstr "" -#: public/editor-build/236-wp/texts.php:714 +#: public/editor-build/250-wp/texts.php:885 msgid "Reply" msgstr "" -#: public/editor-build/236-wp/texts.php:715 +#: public/editor-build/250-wp/texts.php:886 msgid "Reply-To" msgstr "" -#: public/editor-build/236-wp/texts.php:716 +#: public/editor-build/250-wp/texts.php:887 msgid "Required" msgstr "" -#: public/editor-build/236-wp/texts.php:717 +#: public/editor-build/250-wp/texts.php:888 msgid "Reset Password" msgstr "" -#: public/editor-build/236-wp/texts.php:718 +#: public/editor-build/250-wp/texts.php:889 msgid "Responsive Zoom In / Out" msgstr "" -#: public/editor-build/236-wp/texts.php:719 +#: public/editor-build/250-wp/texts.php:890 msgid "Reverse" msgstr "" -#: public/editor-build/236-wp/texts.php:720 +#: public/editor-build/250-wp/texts.php:891 msgid "Reverse Columns" msgstr "" -#: public/editor-build/236-wp/texts.php:721 +#: public/editor-build/250-wp/texts.php:892 msgid "Review" msgstr "" -#: public/editor-build/236-wp/texts.php:722 +#: public/editor-build/250-wp/texts.php:893 +msgid "Review IDs" +msgstr "" + +#: public/editor-build/250-wp/texts.php:894 +msgid "Review Logic" +msgstr "" + +#: public/editor-build/250-wp/texts.php:895 +msgid "Review Type" +msgstr "" + +#: public/editor-build/250-wp/texts.php:896 +msgid "Review by AliExpress" +msgstr "" + +#: public/editor-build/250-wp/texts.php:897 +msgid "Review by Growave" +msgstr "" + +#: public/editor-build/250-wp/texts.php:898 +msgid "Review by Judge" +msgstr "" + +#: public/editor-build/250-wp/texts.php:899 +msgid "Review by Loox" +msgstr "" + +#: public/editor-build/250-wp/texts.php:900 +msgid "Review by Okendo" +msgstr "" + +#: public/editor-build/250-wp/texts.php:901 +msgid "Review by Opinew" +msgstr "" + +#: public/editor-build/250-wp/texts.php:902 +msgid "Review by Rivyo" +msgstr "" + +#: public/editor-build/250-wp/texts.php:903 +msgid "Review by Vitals" +msgstr "" + +#: public/editor-build/250-wp/texts.php:904 +msgid "Reviews" +msgstr "" + +#: public/editor-build/250-wp/texts.php:905 +msgid "Reviews Limit" +msgstr "" + +#: public/editor-build/250-wp/texts.php:906 +msgid "Reviews Type" +msgstr "" + +#: public/editor-build/250-wp/texts.php:907 +msgid "Reviews by Ali" +msgstr "" + +#: public/editor-build/250-wp/texts.php:908 +msgid "Reviews by Areview" +msgstr "" + +#: public/editor-build/250-wp/texts.php:909 +msgid "Reviews by Fera" +msgstr "" + +#: public/editor-build/250-wp/texts.php:910 +msgid "Reviews by Growave" +msgstr "" + +#: public/editor-build/250-wp/texts.php:911 +msgid "Reviews by Lai" +msgstr "" + +#: public/editor-build/250-wp/texts.php:912 +msgid "Reviews by Stamped" +msgstr "" + +#: public/editor-build/250-wp/texts.php:913 +msgid "Reviews by Vitals" +msgstr "" + +#: public/editor-build/250-wp/texts.php:914 +msgid "Reviews with Photo" +msgstr "" + +#: public/editor-build/250-wp/texts.php:915 +msgid "Ribbon" +msgstr "" + +#: public/editor-build/250-wp/texts.php:916 msgid "Right" msgstr "" -#: public/editor-build/236-wp/texts.php:724 +#: public/editor-build/250-wp/texts.php:918 msgid "RollIn" msgstr "" -#: public/editor-build/236-wp/texts.php:725 +#: public/editor-build/250-wp/texts.php:919 msgid "Rotate" msgstr "" -#: public/editor-build/236-wp/texts.php:726 +#: public/editor-build/250-wp/texts.php:920 msgid "RotateIn" msgstr "" -#: public/editor-build/236-wp/texts.php:727 +#: public/editor-build/250-wp/texts.php:921 msgid "RotateInDownLeft" msgstr "" -#: public/editor-build/236-wp/texts.php:728 +#: public/editor-build/250-wp/texts.php:922 msgid "RotateInDownRight" msgstr "" -#: public/editor-build/236-wp/texts.php:729 +#: public/editor-build/250-wp/texts.php:923 msgid "RotateInUpLeft" msgstr "" -#: public/editor-build/236-wp/texts.php:730 +#: public/editor-build/250-wp/texts.php:924 msgid "RotateInUpRight" msgstr "" -#: public/editor-build/236-wp/texts.php:731 +#: public/editor-build/250-wp/texts.php:925 msgid "Round" msgstr "" -#: public/editor-build/236-wp/texts.php:732 +#: public/editor-build/250-wp/texts.php:926 msgid "Row" msgstr "" -#: public/editor-build/236-wp/texts.php:733 +#: public/editor-build/250-wp/texts.php:927 msgid "Rows" msgstr "" -#: public/editor-build/236-wp/texts.php:734 +#: public/editor-build/250-wp/texts.php:928 msgid "RubberBand" msgstr "" -#: public/editor-build/236-wp/texts.php:735 +#: public/editor-build/250-wp/texts.php:929 msgid "Russian" msgstr "" -#: public/editor-build/236-wp/texts.php:736 +#: public/editor-build/250-wp/texts.php:930 msgid "SELECT ACCOUNT" msgstr "" -#: public/editor-build/236-wp/texts.php:737 +#: public/editor-build/250-wp/texts.php:931 msgid "SELECT FOR WHAT TEMPLATE IS USED" msgstr "" -#: public/editor-build/236-wp/texts.php:738 +#: public/editor-build/250-wp/texts.php:932 msgid "SELECT LIST" msgstr "" -#: public/editor-build/236-wp/texts.php:739 +#: public/editor-build/250-wp/texts.php:933 +msgid "SKU" +msgstr "" + +#: public/editor-build/250-wp/texts.php:934 +msgid "SMS Marketing" +msgstr "" + +#: public/editor-build/250-wp/texts.php:935 +msgid "SMS Marketing by Yotpo" +msgstr "" + +#: public/editor-build/250-wp/texts.php:936 +msgid "SMSBump's embed code" +msgstr "" + +#: public/editor-build/250-wp/texts.php:937 msgid "START BUILDING YOUR PAGE" msgstr "" -#: public/editor-build/236-wp/texts.php:740 +#: public/editor-build/250-wp/texts.php:938 msgid "START BUILDING YOUR POPUP" msgstr "" -#: public/editor-build/236-wp/texts.php:741 +#: public/editor-build/250-wp/texts.php:939 msgid "SWITCH TO DESKTOP" msgstr "" -#: public/editor-build/236-wp/texts.php:742 +#: public/editor-build/250-wp/texts.php:940 msgid "Sale" msgstr "" -#: public/editor-build/236-wp/texts.php:743 +#: public/editor-build/250-wp/texts.php:941 msgid "Same Page" msgstr "" -#: public/editor-build/236-wp/texts.php:744 +#: public/editor-build/250-wp/texts.php:942 msgid "Saturation" msgstr "" -#: public/editor-build/236-wp/texts.php:745 +#: public/editor-build/250-wp/texts.php:943 msgid "Save" msgstr "" -#: public/editor-build/236-wp/texts.php:746 +#: public/editor-build/250-wp/texts.php:944 msgid "Save Draft" msgstr "" -#: public/editor-build/236-wp/texts.php:747 +#: public/editor-build/250-wp/texts.php:945 msgid "Save Draft / Update Page" msgstr "" -#: public/editor-build/236-wp/texts.php:748 +#: public/editor-build/250-wp/texts.php:946 msgid "Save Layout" msgstr "" -#: public/editor-build/236-wp/texts.php:749 +#: public/editor-build/250-wp/texts.php:947 msgid "Saved" msgstr "" -#: public/editor-build/236-wp/texts.php:750 +#: public/editor-build/250-wp/texts.php:948 msgid "Saved Library is syncing to your Account" msgstr "" -#: public/editor-build/236-wp/texts.php:751 +#: public/editor-build/250-wp/texts.php:949 msgid "Saved Popups" msgstr "" -#: public/editor-build/236-wp/texts.php:752 +#: public/editor-build/250-wp/texts.php:950 msgid "Saving" msgstr "" -#: public/editor-build/236-wp/texts.php:753 +#: public/editor-build/250-wp/texts.php:951 msgid "Scale" msgstr "" -#: public/editor-build/236-wp/texts.php:754 +#: public/editor-build/250-wp/texts.php:952 msgid "Screen" msgstr "" -#: public/editor-build/236-wp/texts.php:755 +#: public/editor-build/250-wp/texts.php:953 msgid "Scroll" msgstr "" -#: public/editor-build/236-wp/texts.php:756 +#: public/editor-build/250-wp/texts.php:954 msgid "Scroll Page Behind" msgstr "" -#: public/editor-build/236-wp/texts.php:758 +#: public/editor-build/250-wp/texts.php:955 +msgid "Seal Type" +msgstr "" + +#: public/editor-build/250-wp/texts.php:956 +msgid "Seals" +msgstr "" + +#: public/editor-build/250-wp/texts.php:958 msgid "Search element" msgstr "" -#: public/editor-build/236-wp/texts.php:759 +#: public/editor-build/250-wp/texts.php:959 msgid "Seconds" msgstr "" -#: public/editor-build/236-wp/texts.php:760 +#: public/editor-build/250-wp/texts.php:960 msgid "Section" msgstr "" -#: public/editor-build/236-wp/texts.php:761 +#: public/editor-build/250-wp/texts.php:961 msgid "Select" msgstr "" -#: public/editor-build/236-wp/texts.php:762 +#: public/editor-build/250-wp/texts.php:962 msgid "Select Item" msgstr "" -#: public/editor-build/236-wp/texts.php:763 +#: public/editor-build/250-wp/texts.php:963 msgid "Select Parent Element" msgstr "" -#: public/editor-build/236-wp/texts.php:764 +#: public/editor-build/250-wp/texts.php:964 +msgid "Select Product" +msgstr "" + +#: public/editor-build/250-wp/texts.php:965 +msgid "Select Seal" +msgstr "" + +#: public/editor-build/250-wp/texts.php:966 msgid "Select a Menu" msgstr "" -#: public/editor-build/236-wp/texts.php:765 +#: public/editor-build/250-wp/texts.php:967 msgid "Select a menu from the element options" msgstr "" -#: public/editor-build/236-wp/texts.php:766 +#: public/editor-build/250-wp/texts.php:968 msgid "Select an element on the page to display more settings" msgstr "" -#: public/editor-build/236-wp/texts.php:767 +#: public/editor-build/250-wp/texts.php:969 msgid "Select tags" msgstr "" -#: public/editor-build/236-wp/texts.php:768 +#: public/editor-build/250-wp/texts.php:970 +msgid "Select..." +msgstr "" + +#: public/editor-build/250-wp/texts.php:971 msgid "Semi Bold" msgstr "" -#: public/editor-build/236-wp/texts.php:769 +#: public/editor-build/250-wp/texts.php:972 msgid "Separator" msgstr "" -#: public/editor-build/236-wp/texts.php:771 +#: public/editor-build/250-wp/texts.php:974 msgid "Shadow" msgstr "" -#: public/editor-build/236-wp/texts.php:772 +#: public/editor-build/250-wp/texts.php:975 msgid "Shake" msgstr "" -#: public/editor-build/236-wp/texts.php:773 +#: public/editor-build/250-wp/texts.php:976 msgid "Shape" msgstr "" -#: public/editor-build/236-wp/texts.php:774 +#: public/editor-build/250-wp/texts.php:977 msgid "Share Button" msgstr "" -#: public/editor-build/236-wp/texts.php:775 +#: public/editor-build/250-wp/texts.php:978 +msgid "Share Buttons" +msgstr "" + +#: public/editor-build/250-wp/texts.php:979 msgid "Shop Cart" msgstr "" -#: public/editor-build/236-wp/texts.php:776 +#: public/editor-build/250-wp/texts.php:980 msgid "Shop Categories" msgstr "" -#: public/editor-build/236-wp/texts.php:777 +#: public/editor-build/250-wp/texts.php:981 msgid "Shop Pages" msgstr "" -#: public/editor-build/236-wp/texts.php:778 +#: public/editor-build/250-wp/texts.php:982 msgid "Shop Products" msgstr "" -#: public/editor-build/236-wp/texts.php:779 +#: public/editor-build/250-wp/texts.php:983 msgid "Shopping Bag" msgstr "" -#: public/editor-build/236-wp/texts.php:780 +#: public/editor-build/250-wp/texts.php:984 +msgid "Short Code" +msgstr "" + +#: public/editor-build/250-wp/texts.php:985 msgid "Shortcode" msgstr "" -#: public/editor-build/236-wp/texts.php:781 +#: public/editor-build/250-wp/texts.php:986 msgid "Shortcuts" msgstr "" -#: public/editor-build/236-wp/texts.php:782 +#: public/editor-build/250-wp/texts.php:987 msgid "Shortname" msgstr "" -#: public/editor-build/236-wp/texts.php:783 +#: public/editor-build/250-wp/texts.php:988 +msgid "Show" +msgstr "" + +#: public/editor-build/250-wp/texts.php:989 msgid "Show Apply" msgstr "" -#: public/editor-build/236-wp/texts.php:784 +#: public/editor-build/250-wp/texts.php:990 msgid "Show Button Counter" msgstr "" -#: public/editor-build/236-wp/texts.php:785 +#: public/editor-build/250-wp/texts.php:991 msgid "Show Counter" msgstr "" -#: public/editor-build/236-wp/texts.php:786 +#: public/editor-build/250-wp/texts.php:992 msgid "Show Friend's Faces" msgstr "" -#: public/editor-build/236-wp/texts.php:787 +#: public/editor-build/250-wp/texts.php:993 msgid "Show Friends' Faces" msgstr "" -#: public/editor-build/236-wp/texts.php:788 +#: public/editor-build/250-wp/texts.php:994 +msgid "Show Heading" +msgstr "" + +#: public/editor-build/250-wp/texts.php:995 msgid "Show Hidden Elements" msgstr "" -#: public/editor-build/236-wp/texts.php:789 +#: public/editor-build/250-wp/texts.php:996 msgid "Show If Language" msgstr "" -#: public/editor-build/236-wp/texts.php:790 +#: public/editor-build/250-wp/texts.php:997 msgid "Show Label" msgstr "" -#: public/editor-build/236-wp/texts.php:791 +#: public/editor-build/250-wp/texts.php:998 msgid "Show Meta Data" msgstr "" -#: public/editor-build/236-wp/texts.php:792 +#: public/editor-build/250-wp/texts.php:999 +msgid "Show Navigation" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1000 msgid "Show Original image" msgstr "" -#: public/editor-build/236-wp/texts.php:793 +#: public/editor-build/250-wp/texts.php:1001 +msgid "Show Product Image" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1002 +msgid "Show QTY" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1003 msgid "Show Social Context" msgstr "" -#: public/editor-build/236-wp/texts.php:794 +#: public/editor-build/250-wp/texts.php:1004 msgid "Show Text" msgstr "" -#: public/editor-build/236-wp/texts.php:795 +#: public/editor-build/250-wp/texts.php:1005 +msgid "Show Total Reviews" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1006 +msgid "Show Total Reviews Count And Average Ratings" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1007 msgid "Show message" msgstr "" -#: public/editor-build/236-wp/texts.php:796 +#: public/editor-build/250-wp/texts.php:1008 msgid "Show on Desktop" msgstr "" -#: public/editor-build/236-wp/texts.php:797 +#: public/editor-build/250-wp/texts.php:1009 +msgid "Show only reviews above the selected minimum rating" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1010 msgid "Show to" msgstr "" -#: public/editor-build/236-wp/texts.php:798 +#: public/editor-build/250-wp/texts.php:1011 +msgid "Showcase" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1012 msgid "Sidebar" msgstr "" -#: public/editor-build/236-wp/texts.php:799 -msgid "Sign-in link" +#: public/editor-build/250-wp/texts.php:1013 +msgid "Sign in link" msgstr "" -#: public/editor-build/236-wp/texts.php:800 +#: public/editor-build/250-wp/texts.php:1014 msgid "SignUp" msgstr "" -#: public/editor-build/236-wp/texts.php:801 +#: public/editor-build/250-wp/texts.php:1015 msgid "Size" msgstr "" -#: public/editor-build/236-wp/texts.php:802 +#: public/editor-build/250-wp/texts.php:1016 msgid "Size 2" msgstr "" -#: public/editor-build/236-wp/texts.php:803 +#: public/editor-build/250-wp/texts.php:1017 msgid "Skin" msgstr "" -#: public/editor-build/236-wp/texts.php:804 +#: public/editor-build/250-wp/texts.php:1018 msgid "Skin 1" msgstr "" -#: public/editor-build/236-wp/texts.php:805 +#: public/editor-build/250-wp/texts.php:1019 msgid "Skin 2" msgstr "" -#: public/editor-build/236-wp/texts.php:806 +#: public/editor-build/250-wp/texts.php:1020 msgid "Skin 3" msgstr "" -#: public/editor-build/236-wp/texts.php:807 +#: public/editor-build/250-wp/texts.php:1021 msgid "Skin 4" msgstr "" -#: public/editor-build/236-wp/texts.php:808 +#: public/editor-build/250-wp/texts.php:1022 msgid "Skip" msgstr "" -#: public/editor-build/236-wp/texts.php:809 +#: public/editor-build/250-wp/texts.php:1023 msgid "Sku" msgstr "" -#: public/editor-build/236-wp/texts.php:810 +#: public/editor-build/250-wp/texts.php:1024 msgid "Slide" msgstr "" -#: public/editor-build/236-wp/texts.php:811 +#: public/editor-build/250-wp/texts.php:1025 +msgid "Slide Size" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1026 msgid "SlideInDown" msgstr "" -#: public/editor-build/236-wp/texts.php:812 +#: public/editor-build/250-wp/texts.php:1027 msgid "SlideInLeft" msgstr "" -#: public/editor-build/236-wp/texts.php:813 +#: public/editor-build/250-wp/texts.php:1028 msgid "SlideInRight" msgstr "" -#: public/editor-build/236-wp/texts.php:814 +#: public/editor-build/250-wp/texts.php:1029 msgid "SlideInUp" msgstr "" -#: public/editor-build/236-wp/texts.php:815 +#: public/editor-build/250-wp/texts.php:1030 msgid "Slider" msgstr "" -#: public/editor-build/236-wp/texts.php:816 +#: public/editor-build/250-wp/texts.php:1031 msgid "Slides" msgstr "" -#: public/editor-build/236-wp/texts.php:817 +#: public/editor-build/250-wp/texts.php:1032 msgid "Slug" msgstr "" -#: public/editor-build/236-wp/texts.php:818 +#: public/editor-build/250-wp/texts.php:1033 +msgid "Small" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1034 +msgid "Snowball" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1035 msgid "Solid" msgstr "" -#: public/editor-build/236-wp/texts.php:819 +#: public/editor-build/250-wp/texts.php:1036 msgid "Some integrations are available only in PRO" msgstr "" -#: public/editor-build/236-wp/texts.php:821 +#: public/editor-build/250-wp/texts.php:1038 +msgid "Sorting Options" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1039 msgid "SoundCloud" msgstr "" -#: public/editor-build/236-wp/texts.php:822 +#: public/editor-build/250-wp/texts.php:1040 msgid "SoundCloud Link" msgstr "" -#: public/editor-build/236-wp/texts.php:823 +#: public/editor-build/250-wp/texts.php:1041 msgid "Source" msgstr "" -#: public/editor-build/236-wp/texts.php:824 +#: public/editor-build/250-wp/texts.php:1042 msgid "Source ID" msgstr "" -#: public/editor-build/236-wp/texts.php:825 +#: public/editor-build/250-wp/texts.php:1043 msgid "Source Type" msgstr "" -#: public/editor-build/236-wp/texts.php:826 +#: public/editor-build/250-wp/texts.php:1044 +msgid "Space" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1045 msgid "Spacer" msgstr "" -#: public/editor-build/236-wp/texts.php:827 +#: public/editor-build/250-wp/texts.php:1046 msgid "Spacing" msgstr "" -#: public/editor-build/236-wp/texts.php:828 +#: public/editor-build/250-wp/texts.php:1047 msgid "Span" msgstr "" -#: public/editor-build/236-wp/texts.php:829 +#: public/editor-build/250-wp/texts.php:1048 msgid "Spanish" msgstr "" -#: public/editor-build/236-wp/texts.php:830 +#: public/editor-build/250-wp/texts.php:1049 +msgid "Special Offers" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1050 +msgid "Specific Category" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1051 +msgid "Specific Product" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1052 msgid "Specific User" msgstr "" -#: public/editor-build/236-wp/texts.php:831 +#: public/editor-build/250-wp/texts.php:1053 msgid "Specify a start time (in seconds)" msgstr "" -#: public/editor-build/236-wp/texts.php:832 +#: public/editor-build/250-wp/texts.php:1054 msgid "Specify an end time (in seconds)" msgstr "" -#: public/editor-build/236-wp/texts.php:833 +#: public/editor-build/250-wp/texts.php:1055 msgid "Speed" msgstr "" -#: public/editor-build/236-wp/texts.php:834 +#: public/editor-build/250-wp/texts.php:1056 msgid "Sport" msgstr "" -#: public/editor-build/236-wp/texts.php:835 +#: public/editor-build/250-wp/texts.php:1057 msgid "Square" msgstr "" -#: public/editor-build/236-wp/texts.php:836 +#: public/editor-build/250-wp/texts.php:1058 +msgid "Stamped Reviews" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1059 +msgid "Star" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1060 msgid "Stars" msgstr "" -#: public/editor-build/236-wp/texts.php:837 +#: public/editor-build/250-wp/texts.php:1061 msgid "Stars Bg" msgstr "" -#: public/editor-build/236-wp/texts.php:838 +#: public/editor-build/250-wp/texts.php:1062 msgid "Stars count" msgstr "" -#: public/editor-build/236-wp/texts.php:839 +#: public/editor-build/250-wp/texts.php:1063 msgid "Start" msgstr "" -#: public/editor-build/236-wp/texts.php:840 +#: public/editor-build/250-wp/texts.php:1064 msgid "Static" msgstr "" -#: public/editor-build/236-wp/texts.php:841 +#: public/editor-build/250-wp/texts.php:1065 msgid "Status" msgstr "" -#: public/editor-build/236-wp/texts.php:842 +#: public/editor-build/250-wp/texts.php:1066 msgid "Step" msgstr "" -#: public/editor-build/236-wp/texts.php:843 +#: public/editor-build/250-wp/texts.php:1067 msgid "Sticky" msgstr "" -#: public/editor-build/236-wp/texts.php:844 +#: public/editor-build/250-wp/texts.php:1068 msgid "Stock" msgstr "" -#: public/editor-build/236-wp/texts.php:846 +#: public/editor-build/250-wp/texts.php:1069 +msgid "Stock Availability labels" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1071 msgid "Story" msgstr "" -#: public/editor-build/236-wp/texts.php:847 +#: public/editor-build/250-wp/texts.php:1072 msgid "Strike" msgstr "" -#: public/editor-build/236-wp/texts.php:848 +#: public/editor-build/250-wp/texts.php:1073 msgid "Stroke" msgstr "" -#: public/editor-build/236-wp/texts.php:849 +#: public/editor-build/250-wp/texts.php:1074 msgid "Style" msgstr "" -#: public/editor-build/236-wp/texts.php:850 +#: public/editor-build/250-wp/texts.php:1075 msgid "Styles" msgstr "" -#: public/editor-build/236-wp/texts.php:851 +#: public/editor-build/250-wp/texts.php:1076 msgid "Styling" msgstr "" -#: public/editor-build/236-wp/texts.php:852 +#: public/editor-build/250-wp/texts.php:1077 msgid "Sub Title" msgstr "" -#: public/editor-build/236-wp/texts.php:853 +#: public/editor-build/250-wp/texts.php:1078 msgid "Subject" msgstr "" -#: public/editor-build/236-wp/texts.php:854 +#: public/editor-build/250-wp/texts.php:1079 +msgid "Subscribtion by Paywhirl" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1080 +msgid "Subscription by Appstle" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1081 +msgid "Subscription by Bold" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1082 +msgid "Subscription by Paywhirl" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1083 +msgid "Subscription by Seal" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1084 +msgid "Subscriptions by Recharge" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1085 +msgid "Subtitle" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1086 msgid "Subtotal" msgstr "" -#: public/editor-build/236-wp/texts.php:855 +#: public/editor-build/250-wp/texts.php:1087 msgid "Success" msgstr "" -#: public/editor-build/236-wp/texts.php:856 +#: public/editor-build/250-wp/texts.php:1088 msgid "Suffix" msgstr "" -#: public/editor-build/236-wp/texts.php:857 +#: public/editor-build/250-wp/texts.php:1089 +msgid "Suggested Videos" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1090 msgid "Support" msgstr "" -#: public/editor-build/236-wp/texts.php:858 +#: public/editor-build/250-wp/texts.php:1091 +msgid "Surcharge" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1092 msgid "Swing" msgstr "" -#: public/editor-build/236-wp/texts.php:859 +#: public/editor-build/250-wp/texts.php:1093 msgid "Switch to Draft" msgstr "" -#: public/editor-build/236-wp/texts.php:860 +#: public/editor-build/250-wp/texts.php:1094 msgid "Switch to desktop to add blocks" msgstr "" -#: public/editor-build/236-wp/texts.php:861 +#: public/editor-build/250-wp/texts.php:1095 msgid "Switch to desktop to add popup" msgstr "" -#: public/editor-build/236-wp/texts.php:862 +#: public/editor-build/250-wp/texts.php:1096 msgid "Switcher" msgstr "" -#: public/editor-build/236-wp/texts.php:863 +#: public/editor-build/250-wp/texts.php:1097 msgid "Sync Now" msgstr "" -#: public/editor-build/236-wp/texts.php:864 +#: public/editor-build/250-wp/texts.php:1098 msgid "TTF File" msgstr "" -#: public/editor-build/236-wp/texts.php:865 +#: public/editor-build/250-wp/texts.php:1099 msgid "Tab" msgstr "" -#: public/editor-build/236-wp/texts.php:866 +#: public/editor-build/250-wp/texts.php:1100 msgid "Table" msgstr "" -#: public/editor-build/236-wp/texts.php:867 +#: public/editor-build/250-wp/texts.php:1101 msgid "Table Head" msgstr "" -#: public/editor-build/236-wp/texts.php:868 +#: public/editor-build/250-wp/texts.php:1102 msgid "Table Sidebar" msgstr "" -#: public/editor-build/236-wp/texts.php:869 +#: public/editor-build/250-wp/texts.php:1103 msgid "Tablet" msgstr "" -#: public/editor-build/236-wp/texts.php:870 +#: public/editor-build/250-wp/texts.php:1104 msgid "Tabs" msgstr "" -#: public/editor-build/236-wp/texts.php:871 +#: public/editor-build/250-wp/texts.php:1105 msgid "Tada" msgstr "" -#: public/editor-build/236-wp/texts.php:872 +#: public/editor-build/250-wp/texts.php:1106 msgid "Tags" msgstr "" -#: public/editor-build/236-wp/texts.php:873 +#: public/editor-build/250-wp/texts.php:1107 msgid "Tail" msgstr "" -#: public/editor-build/236-wp/texts.php:874 +#: public/editor-build/250-wp/texts.php:1108 msgid "Take over" msgstr "" -#: public/editor-build/236-wp/texts.php:875 +#: public/editor-build/250-wp/texts.php:1109 msgid "Take over failed please refresh the page" msgstr "" -#: public/editor-build/236-wp/texts.php:876 +#: public/editor-build/250-wp/texts.php:1110 msgid "Target URL" msgstr "" -#: public/editor-build/236-wp/texts.php:877 +#: public/editor-build/250-wp/texts.php:1111 msgid "Taxonomy" msgstr "" -#: public/editor-build/236-wp/texts.php:878 +#: public/editor-build/250-wp/texts.php:1112 msgid "Team" msgstr "" -#: public/editor-build/236-wp/texts.php:879 +#: public/editor-build/250-wp/texts.php:1113 msgid "Tel" msgstr "" -#: public/editor-build/236-wp/texts.php:880 +#: public/editor-build/250-wp/texts.php:1114 msgid "Testimonials" msgstr "" -#: public/editor-build/236-wp/texts.php:881 +#: public/editor-build/250-wp/texts.php:1115 msgid "Text" msgstr "" -#: public/editor-build/236-wp/texts.php:882 +#: public/editor-build/250-wp/texts.php:1116 +msgid "Text Field" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1117 msgid "Text Shadow" msgstr "" -#: public/editor-build/236-wp/texts.php:883 +#: public/editor-build/250-wp/texts.php:1118 +msgid "The button's state after visitors have subscribed" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1119 +msgid "The button's state before visitors have subscribed" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1120 msgid "The element you have selected doesn't have more settings" msgstr "" -#: public/editor-build/236-wp/texts.php:884 +#: public/editor-build/250-wp/texts.php:1121 msgid "The email address format is not valid" msgstr "" -#: public/editor-build/236-wp/texts.php:885 +#: public/editor-build/250-wp/texts.php:1122 msgid "The integration is not responding, please try again or verify the account credentials" msgstr "" -#: public/editor-build/236-wp/texts.php:886 +#: public/editor-build/250-wp/texts.php:1123 msgid "Theme" msgstr "" -#: public/editor-build/236-wp/texts.php:887 +#: public/editor-build/250-wp/texts.php:1124 msgid "There are no choices" msgstr "" -#: public/editor-build/236-wp/texts.php:888 +#: public/editor-build/250-wp/texts.php:1125 msgid "Thin" msgstr "" -#: public/editor-build/236-wp/texts.php:889 +#: public/editor-build/250-wp/texts.php:1126 +msgid "This element should stay inside a Product Details Component" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1127 msgid "This is Lottie .json URL. Get more from LottieFiles.com." msgstr "" -#: public/editor-build/236-wp/texts.php:890 +#: public/editor-build/250-wp/texts.php:1128 msgid "This page needs a refresh. You’ve probably updated this page (or another page) in a different tab or browser." msgstr "" -#: public/editor-build/236-wp/texts.php:891 +#: public/editor-build/250-wp/texts.php:1129 +msgid "Thumbnail" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1130 msgid "Thumbs" msgstr "" -#: public/editor-build/236-wp/texts.php:892 +#: public/editor-build/250-wp/texts.php:1131 msgid "Time" msgstr "" -#: public/editor-build/236-wp/texts.php:893 +#: public/editor-build/250-wp/texts.php:1132 msgid "Time Zone" msgstr "" -#: public/editor-build/236-wp/texts.php:894 +#: public/editor-build/250-wp/texts.php:1133 msgid "Timeline" msgstr "" -#: public/editor-build/236-wp/texts.php:895 +#: public/editor-build/250-wp/texts.php:1134 msgid "Timeline Items" msgstr "" -#: public/editor-build/236-wp/texts.php:896 +#: public/editor-build/250-wp/texts.php:1135 msgid "Timeline Labels" msgstr "" -#: public/editor-build/236-wp/texts.php:897 +#: public/editor-build/250-wp/texts.php:1136 msgid "Timer" msgstr "" -#: public/editor-build/236-wp/texts.php:898 +#: public/editor-build/250-wp/texts.php:1137 msgid "Tip: Use these shortcodes to populate your template" msgstr "" -#: public/editor-build/236-wp/texts.php:899 +#: public/editor-build/250-wp/texts.php:1138 msgid "Tip: You can browse the Google font library" msgstr "" -#: public/editor-build/236-wp/texts.php:900 +#: public/editor-build/250-wp/texts.php:1139 msgid "Title" msgstr "" -#: public/editor-build/236-wp/texts.php:901 +#: public/editor-build/250-wp/texts.php:1140 msgid "Title Padding" msgstr "" -#: public/editor-build/236-wp/texts.php:902 +#: public/editor-build/250-wp/texts.php:1141 msgid "Titles" msgstr "" -#: public/editor-build/236-wp/texts.php:903 +#: public/editor-build/250-wp/texts.php:1142 msgid "To Dashboard" msgstr "" -#: public/editor-build/236-wp/texts.php:904 +#: public/editor-build/250-wp/texts.php:1143 msgid "Toggle Menu" msgstr "" -#: public/editor-build/236-wp/texts.php:905 +#: public/editor-build/250-wp/texts.php:1144 msgid "Top" msgstr "" -#: public/editor-build/236-wp/texts.php:906 +#: public/editor-build/250-wp/texts.php:1145 +msgid "Top Center" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1146 +msgid "Top Left" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1147 +msgid "Top Right" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1148 msgid "Total" msgstr "" -#: public/editor-build/236-wp/texts.php:907 +#: public/editor-build/250-wp/texts.php:1149 +msgid "Tracking Page URL" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1150 +msgid "Tracking by Omega" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1151 msgid "Translation" msgstr "" -#: public/editor-build/236-wp/texts.php:908 +#: public/editor-build/250-wp/texts.php:1152 msgid "Transparency" msgstr "" -#: public/editor-build/236-wp/texts.php:909 +#: public/editor-build/250-wp/texts.php:1153 msgid "Trash" msgstr "" -#: public/editor-build/236-wp/texts.php:910 +#: public/editor-build/250-wp/texts.php:1154 msgid "Travel" msgstr "" -#: public/editor-build/236-wp/texts.php:911 +#: public/editor-build/250-wp/texts.php:1155 msgid "Trigger Popup Only Once" msgstr "" -#: public/editor-build/236-wp/texts.php:912 +#: public/editor-build/250-wp/texts.php:1156 msgid "Triggers" msgstr "" -#: public/editor-build/236-wp/texts.php:913 +#: public/editor-build/250-wp/texts.php:1157 +msgid "Trust Me Badges" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1158 +msgid "Trust Product Rating" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1159 +msgid "Trust Product Review" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1160 +msgid "Trust Product Seals" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1161 +msgid "Trust Seals" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1162 +msgid "Trusted's embed code" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1163 msgid "Try Again" msgstr "" -#: public/editor-build/236-wp/texts.php:914 +#: public/editor-build/250-wp/texts.php:1164 msgid "Tweet" msgstr "" -#: public/editor-build/236-wp/texts.php:915 +#: public/editor-build/250-wp/texts.php:1165 msgid "Twitter" msgstr "" -#: public/editor-build/236-wp/texts.php:916 +#: public/editor-build/250-wp/texts.php:1166 +msgid "Two Heroes" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1167 msgid "Type" msgstr "" -#: public/editor-build/236-wp/texts.php:917 +#: public/editor-build/250-wp/texts.php:1168 msgid "Type to Search ..." msgstr "" -#: public/editor-build/236-wp/texts.php:918 +#: public/editor-build/250-wp/texts.php:1169 msgid "Type to search" msgstr "" -#: public/editor-build/236-wp/texts.php:919 +#: public/editor-build/250-wp/texts.php:1170 msgid "Typography" msgstr "" -#: public/editor-build/236-wp/texts.php:920 +#: public/editor-build/250-wp/texts.php:1171 msgid "UPLOAD" msgstr "" -#: public/editor-build/236-wp/texts.php:921 +#: public/editor-build/250-wp/texts.php:1172 msgid "UPLOAD FONT" msgstr "" -#: public/editor-build/236-wp/texts.php:922 +#: public/editor-build/250-wp/texts.php:1173 msgid "URL" msgstr "" -#: public/editor-build/236-wp/texts.php:923 +#: public/editor-build/250-wp/texts.php:1174 msgid "USE CUSTOM TEMPLATE" msgstr "" -#: public/editor-build/236-wp/texts.php:924 +#: public/editor-build/250-wp/texts.php:1175 msgid "Unable to insert block. Please try again or contact support" msgstr "" -#: public/editor-build/236-wp/texts.php:925 +#: public/editor-build/250-wp/texts.php:1176 msgid "Unable to insert layout. Please try again or contact support" msgstr "" -#: public/editor-build/236-wp/texts.php:926 +#: public/editor-build/250-wp/texts.php:1177 msgid "Unable to insert popup. Please try again or contact support" msgstr "" -#: public/editor-build/236-wp/texts.php:927 +#: public/editor-build/250-wp/texts.php:1178 msgid "Unable to upload" msgstr "" -#: public/editor-build/236-wp/texts.php:928 +#: public/editor-build/250-wp/texts.php:1179 msgid "Underline" msgstr "" -#: public/editor-build/236-wp/texts.php:929 +#: public/editor-build/250-wp/texts.php:1180 msgid "Undo" msgstr "" -#: public/editor-build/236-wp/texts.php:930 +#: public/editor-build/250-wp/texts.php:1181 +msgid "Unlimited Bundles" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1182 msgid "Unlocked" msgstr "" -#: public/editor-build/236-wp/texts.php:931 +#: public/editor-build/250-wp/texts.php:1183 msgid "Unsuccessful sync" msgstr "" -#: public/editor-build/236-wp/texts.php:932 +#: public/editor-build/250-wp/texts.php:1184 msgid "Up" msgstr "" -#: public/editor-build/236-wp/texts.php:933 +#: public/editor-build/250-wp/texts.php:1185 msgid "UpDown" msgstr "" -#: public/editor-build/236-wp/texts.php:934 +#: public/editor-build/250-wp/texts.php:1186 msgid "UpLeft" msgstr "" -#: public/editor-build/236-wp/texts.php:935 +#: public/editor-build/250-wp/texts.php:1187 msgid "UpRight" msgstr "" -#: public/editor-build/236-wp/texts.php:936 +#: public/editor-build/250-wp/texts.php:1188 msgid "Update" msgstr "" -#: public/editor-build/236-wp/texts.php:937 +#: public/editor-build/250-wp/texts.php:1189 msgid "Upgrade to PRO to use this" msgstr "" -#: public/editor-build/236-wp/texts.php:938 +#: public/editor-build/250-wp/texts.php:1190 msgid "Upgrade to PRO to use this block" msgstr "" -#: public/editor-build/236-wp/texts.php:939 +#: public/editor-build/250-wp/texts.php:1191 msgid "Upgrade to PRO to use this element" msgstr "" -#: public/editor-build/236-wp/texts.php:940 +#: public/editor-build/250-wp/texts.php:1192 msgid "Upgrade to PRO to use this integration" msgstr "" -#: public/editor-build/236-wp/texts.php:941 +#: public/editor-build/250-wp/texts.php:1193 msgid "Upgrade to PRO to use this layout" msgstr "" -#: public/editor-build/236-wp/texts.php:942 +#: public/editor-build/250-wp/texts.php:1194 msgid "Upgrade to PRO to use this story" msgstr "" -#: public/editor-build/236-wp/texts.php:943 +#: public/editor-build/250-wp/texts.php:1195 msgid "Upgrade to Pro" msgstr "" -#: public/editor-build/236-wp/texts.php:944 +#: public/editor-build/250-wp/texts.php:1196 +msgid "Upload Fields" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1197 +msgid "Upload Fields by UploadKit" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1198 +msgid "Upload only [ .png or .svg ]" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1199 msgid "Upsell" msgstr "" -#: public/editor-build/236-wp/texts.php:945 +#: public/editor-build/250-wp/texts.php:1200 msgid "Upsell Pagination" msgstr "" -#: public/editor-build/236-wp/texts.php:946 +#: public/editor-build/250-wp/texts.php:1201 msgid "Upsell Tags" msgstr "" -#: public/editor-build/236-wp/texts.php:947 +#: public/editor-build/250-wp/texts.php:1202 +msgid "Upsell Type" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1203 +msgid "Upsell by FastSimon" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1204 +msgid "Upsell by LimeSpot" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1205 +msgid "Upsell by Wiser" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1206 +msgid "Upsell by Zoorix" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1207 +msgid "Upsells" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1208 +msgid "Upsells by LimeSpot" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1209 msgid "Url" msgstr "" -#: public/editor-build/236-wp/texts.php:948 +#: public/editor-build/250-wp/texts.php:1210 msgid "Use Small Header" msgstr "" -#: public/editor-build/236-wp/texts.php:949 +#: public/editor-build/250-wp/texts.php:1211 +msgid "Use only one widget per page among Widget, HomePage Review, Showcase Review" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1212 +msgid "User" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1213 msgid "Username" msgstr "" -#: public/editor-build/236-wp/texts.php:950 +#: public/editor-build/250-wp/texts.php:1214 msgid "Users" msgstr "" -#: public/editor-build/236-wp/texts.php:951 +#: public/editor-build/250-wp/texts.php:1215 +msgid "VK" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1216 msgid "Value" msgstr "" -#: public/editor-build/236-wp/texts.php:952 +#: public/editor-build/250-wp/texts.php:1217 msgid "Value Bg" msgstr "" -#: public/editor-build/236-wp/texts.php:953 +#: public/editor-build/250-wp/texts.php:1218 msgid "Values" msgstr "" -#: public/editor-build/236-wp/texts.php:954 +#: public/editor-build/250-wp/texts.php:1219 msgid "Variations" msgstr "" -#: public/editor-build/236-wp/texts.php:955 +#: public/editor-build/250-wp/texts.php:1220 msgid "Verification process failed, please make sure you have done the following three things and try again in a few minutes." msgstr "" -#: public/editor-build/236-wp/texts.php:956 +#: public/editor-build/250-wp/texts.php:1221 +msgid "Verified" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1222 msgid "Vertical" msgstr "" -#: public/editor-build/236-wp/texts.php:957 +#: public/editor-build/250-wp/texts.php:1223 msgid "Vertical Align" msgstr "" -#: public/editor-build/236-wp/texts.php:958 +#: public/editor-build/250-wp/texts.php:1224 msgid "Vertical Offset" msgstr "" -#: public/editor-build/236-wp/texts.php:959 +#: public/editor-build/250-wp/texts.php:1225 msgid "Video" msgstr "" -#: public/editor-build/236-wp/texts.php:960 +#: public/editor-build/250-wp/texts.php:1226 +msgid "Video Embed Code" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1227 +msgid "Video Shopping" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1228 +msgid "View Favorites" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1229 msgid "View as" msgstr "" -#: public/editor-build/236-wp/texts.php:961 +#: public/editor-build/250-wp/texts.php:1230 msgid "Vimeo" msgstr "" -#: public/editor-build/236-wp/texts.php:962 +#: public/editor-build/250-wp/texts.php:1231 msgid "Volume" msgstr "" -#: public/editor-build/236-wp/texts.php:963 +#: public/editor-build/250-wp/texts.php:1232 msgid "WHAT WILL TRIGGER THE POPUP TO OPEN" msgstr "" -#: public/editor-build/236-wp/texts.php:964 +#: public/editor-build/250-wp/texts.php:1233 msgid "WHERE DO YOU WANT TO DISPLAY IT?" msgstr "" -#: public/editor-build/236-wp/texts.php:965 +#: public/editor-build/250-wp/texts.php:1234 msgid "WOFF File" msgstr "" -#: public/editor-build/236-wp/texts.php:966 +#: public/editor-build/250-wp/texts.php:1235 msgid "WOFF2 File" msgstr "" -#: public/editor-build/236-wp/texts.php:967 +#: public/editor-build/250-wp/texts.php:1236 msgid "WOOCart" msgstr "" -#: public/editor-build/236-wp/texts.php:968 +#: public/editor-build/250-wp/texts.php:1237 msgid "WOORating" msgstr "" -#: public/editor-build/236-wp/texts.php:969 +#: public/editor-build/250-wp/texts.php:1238 msgid "Weight" msgstr "" -#: public/editor-build/236-wp/texts.php:970 +#: public/editor-build/250-wp/texts.php:1239 msgid "When Finished" msgstr "" -#: public/editor-build/236-wp/texts.php:971 +#: public/editor-build/250-wp/texts.php:1240 +msgid "Wholesale Price" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1241 +msgid "Wholesale Prices" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1242 +msgid "Wide Bundle" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1243 +msgid "Widget" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1244 +msgid "Widget List" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1245 +msgid "Widget Type" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1246 +msgid "Widgets" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1247 +msgid "Widgets by AliExpress" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1248 +msgid "Widgets by PickyStory" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1249 msgid "Width" msgstr "" -#: public/editor-build/236-wp/texts.php:972 +#: public/editor-build/250-wp/texts.php:1250 msgid "Width Option" msgstr "" -#: public/editor-build/236-wp/texts.php:973 +#: public/editor-build/250-wp/texts.php:1251 +msgid "Wish List by Hero" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1252 +msgid "WishList by Hero" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1253 +msgid "WishList by Swym" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1254 +msgid "Wishlist by Growave" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1255 msgid "Wobble" msgstr "" -#: public/editor-build/236-wp/texts.php:974 +#: public/editor-build/250-wp/texts.php:1256 msgid "Woo Product" msgstr "" -#: public/editor-build/236-wp/texts.php:975 +#: public/editor-build/250-wp/texts.php:1257 msgid "WordPress" msgstr "" -#: public/editor-build/236-wp/texts.php:976 +#: public/editor-build/250-wp/texts.php:1258 +msgid "Works if PRO Plan" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1259 msgid "X" msgstr "" -#: public/editor-build/236-wp/texts.php:977 +#: public/editor-build/250-wp/texts.php:1260 msgid "Y" msgstr "" -#: public/editor-build/236-wp/texts.php:978 +#: public/editor-build/250-wp/texts.php:1261 msgid "YOUR PAGE IS READY TO PUBLISH!" msgstr "" -#: public/editor-build/236-wp/texts.php:979 +#: public/editor-build/250-wp/texts.php:1262 +msgid "YotPo Product Review" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1263 msgid "You can" msgstr "" -#: public/editor-build/236-wp/texts.php:980 +#: public/editor-build/250-wp/texts.php:1264 +msgid "You can add only 1 element on page" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1265 msgid "You can use these shortcodes in your email: " msgstr "" -#: public/editor-build/236-wp/texts.php:981 +#: public/editor-build/250-wp/texts.php:1266 msgid "You can't add it again" msgstr "" -#: public/editor-build/236-wp/texts.php:982 +#: public/editor-build/250-wp/texts.php:1267 msgid "You can’t make changes" msgstr "" -#: public/editor-build/236-wp/texts.php:983 +#: public/editor-build/250-wp/texts.php:1268 msgid "You have successfully connect the form with" msgstr "" -#: public/editor-build/236-wp/texts.php:984 +#: public/editor-build/250-wp/texts.php:1269 msgid "You must be have one font added" msgstr "" -#: public/editor-build/236-wp/texts.php:985 +#: public/editor-build/250-wp/texts.php:1270 msgid "You must be have one selected item" msgstr "" -#: public/editor-build/236-wp/texts.php:986 +#: public/editor-build/250-wp/texts.php:1271 msgid "You must specify a title" msgstr "" -#: public/editor-build/236-wp/texts.php:987 +#: public/editor-build/250-wp/texts.php:1272 msgid "YouTube or Vimeo" msgstr "" -#: public/editor-build/236-wp/texts.php:988 +#: public/editor-build/250-wp/texts.php:1273 msgid "Your Plugin version is incompatible with Account version, please update plugin" msgstr "" -#: public/editor-build/236-wp/texts.php:989 +#: public/editor-build/250-wp/texts.php:1274 msgid "Your block was saved without screenshot, browser is not compatible" msgstr "" -#: public/editor-build/236-wp/texts.php:990 +#: public/editor-build/250-wp/texts.php:1275 msgid "Your link is not correct" msgstr "" -#: public/editor-build/236-wp/texts.php:991 +#: public/editor-build/250-wp/texts.php:1276 msgid "Youtube" msgstr "" -#: public/editor-build/236-wp/texts.php:992 +#: public/editor-build/250-wp/texts.php:1277 msgid "Z-index" msgstr "" -#: public/editor-build/236-wp/texts.php:993 +#: public/editor-build/250-wp/texts.php:1278 msgid "Zoom" msgstr "" -#: public/editor-build/236-wp/texts.php:994 +#: public/editor-build/250-wp/texts.php:1279 msgid "ZoomIn" msgstr "" -#: public/editor-build/236-wp/texts.php:995 +#: public/editor-build/250-wp/texts.php:1280 msgid "ZoomInDown" msgstr "" -#: public/editor-build/236-wp/texts.php:996 +#: public/editor-build/250-wp/texts.php:1281 msgid "ZoomInLeft" msgstr "" -#: public/editor-build/236-wp/texts.php:997 +#: public/editor-build/250-wp/texts.php:1282 msgid "ZoomInRight" msgstr "" -#: public/editor-build/236-wp/texts.php:998 +#: public/editor-build/250-wp/texts.php:1283 msgid "ZoomInUp" msgstr "" -#: public/editor-build/236-wp/texts.php:999 +#: public/editor-build/250-wp/texts.php:1284 msgid "block-name" msgstr "" -#: public/editor-build/236-wp/texts.php:1000 +#: public/editor-build/250-wp/texts.php:1285 msgid "component" msgstr "" -#: public/editor-build/236-wp/texts.php:1001 +#: public/editor-build/250-wp/texts.php:1286 msgid "element" msgstr "" -#: public/editor-build/236-wp/texts.php:1002 +#: public/editor-build/250-wp/texts.php:1287 msgid "here" msgstr "" -#: public/editor-build/236-wp/texts.php:1003 +#: public/editor-build/250-wp/texts.php:1288 +msgid "image" +msgstr "" + +#: public/editor-build/250-wp/texts.php:1289 msgid "in your WordPress admin" msgstr "" -#: public/editor-build/236-wp/texts.php:1004 +#: public/editor-build/250-wp/texts.php:1290 msgid "is already editing project" msgstr "" -#: public/editor-build/236-wp/texts.php:1005 +#: public/editor-build/250-wp/texts.php:1291 msgid "is currently working on this page. Do you want to take over" msgstr "" -#: public/editor-build/236-wp/texts.php:1006 +#: public/editor-build/250-wp/texts.php:1292 msgid "layout" msgstr "" -#: public/editor-build/236-wp/texts.php:1007 +#: public/editor-build/250-wp/texts.php:1293 msgid "layouts" msgstr "" -#: public/editor-build/236-wp/texts.php:1008 +#: public/editor-build/250-wp/texts.php:1294 msgid "open an issue" msgstr "" -#: public/editor-build/236-wp/texts.php:1009 +#: public/editor-build/250-wp/texts.php:1295 msgid "or" msgstr "" -#: public/editor-build/236-wp/texts.php:1010 +#: public/editor-build/250-wp/texts.php:1296 msgid "remove this element" msgstr "" -#: public/editor-build/236-wp/texts.php:1011 +#: public/editor-build/250-wp/texts.php:1297 msgid "required" msgstr "" -#: public/editor-build/236-wp/texts.php:1013 +#: public/editor-build/250-wp/texts.php:1299 msgid "story" msgstr "" -#: public/main.php:225 +#: public/main.php:180 msgid "Edit %s with %s" msgstr "" From 6cd93bc90ae154c756b63bc7d183897516ac4e23 Mon Sep 17 00:00:00 2001 From: Viorel Date: Tue, 6 Dec 2022 12:02:36 +0200 Subject: [PATCH 03/15] Fix: Corrected some strings --- admin/blocks/api.php | 2 +- admin/views/settings/general.php | 21 ++++++++++++--------- editor/zip/archiver.php | 2 +- import/main.php | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/admin/blocks/api.php b/admin/blocks/api.php index e7addb966c..93a89d71df 100644 --- a/admin/blocks/api.php +++ b/admin/blocks/api.php @@ -105,7 +105,7 @@ public function actionDownloadBlocks() { $items = array_filter( $items ); if ( count( $items ) == 0 ) { - $this->error( 404, __( 'There are no block to be archived' ) ); + $this->error( 404, __( 'There are no blocks to be archived', 'brizy' ) ); } $fontManager = new Brizy_Admin_Fonts_Manager(); diff --git a/admin/views/settings/general.php b/admin/views/settings/general.php index 89288d3bcf..df325d06ea 100755 --- a/admin/views/settings/general.php +++ b/admin/views/settings/general.php @@ -9,7 +9,9 @@ - + - + - +
+ +
+ +
+ +
-

- +

diff --git a/editor/zip/archiver.php b/editor/zip/archiver.php index e6f0aa8632..1f464f6be4 100644 --- a/editor/zip/archiver.php +++ b/editor/zip/archiver.php @@ -299,7 +299,7 @@ protected function downloadFileToTemporaryFile( $basename, $content ) { if ( $result === false ) { Brizy_Logger::instance()->error( 'Filed to write font content', [ 'filePath' => $filePath ] ); - throw new Exception( __( 'Filed to write font content' ) ); + throw new Exception( __( 'Failed to write font content', 'brizy' ) ); } return array( diff --git a/import/main.php b/import/main.php index fe2cc8424b..92ecf40edd 100644 --- a/import/main.php +++ b/import/main.php @@ -56,7 +56,7 @@ public function renderTemplatesPage() { 't2' => __( 'Bad news, your starter template was not installed. Something went wrong and we couldn’t do it. Please contact us.', 'brizy' ), 't3' => __( 'Ok', 'brizy' ), 't4' => __( 'Template Successfully Installed', 'brizy' ), - 't5' => __( 'Good news, your starter template was successfully installed. Time to build your amaizing website fast & easy!', 'brizy' ), + 't5' => __( 'Good news, your starter template was successfully installed. Time to build your amazing website fast & easy!', 'brizy' ), 't6' => __( 'Thank You!', 'brizy' ), 't7' => __( 'Installing Starter Template', 'brizy' ), 't8' => __( 'Please don’t close this window until the installation is finished. This might take up to a couple of minutes (five min, usually less).', 'brizy' ), From 3c579b4267f7d2f7e3d227151fd2802681855b23 Mon Sep 17 00:00:00 2001 From: Alex Zaharia Date: Mon, 5 Dec 2022 13:59:56 +0200 Subject: [PATCH 04/15] fix: jenkins scripts --- composer.lock | 12 ++++++------ jenkins/git-initialize.sh | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 4d1782662e..1e60633704 100644 --- a/composer.lock +++ b/composer.lock @@ -442,12 +442,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", "shasum": "" }, "require": { @@ -463,7 +463,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -501,7 +501,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" }, "funding": [ { @@ -517,7 +517,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "tburry/pquery", diff --git a/jenkins/git-initialize.sh b/jenkins/git-initialize.sh index a781c8b1d8..4109e130b4 100755 --- a/jenkins/git-initialize.sh +++ b/jenkins/git-initialize.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -e # Deatached head fix. echo -e "\nGiT Cleanup" From 290a2f5de96826edc9a1fc4e675042c7bd2cfb71 Mon Sep 17 00:00:00 2001 From: Alex Zaharia Date: Wed, 7 Dec 2022 14:07:00 +0200 Subject: [PATCH 05/15] new: Added permalink in the result of the search post function --- editor/api.php | 1 + 1 file changed, 1 insertion(+) diff --git a/editor/api.php b/editor/api.php index d658b521fc..cfe46f85c9 100755 --- a/editor/api.php +++ b/editor/api.php @@ -924,6 +924,7 @@ public function search_post() $out[] = [ 'ID' => $post->ID, 'title' => $post->post_title, + 'permalink'=>get_permalink($post) ]; } From 150a25d7a3b494624ba706b40c677d6efdb627a8 Mon Sep 17 00:00:00 2001 From: Alex Zaharia Date: Wed, 7 Dec 2022 14:38:11 +0200 Subject: [PATCH 06/15] fix: return a placeholder for link in searhc posts --- editor/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/api.php b/editor/api.php index cfe46f85c9..e1830d6a9d 100755 --- a/editor/api.php +++ b/editor/api.php @@ -924,7 +924,7 @@ public function search_post() $out[] = [ 'ID' => $post->ID, 'title' => $post->post_title, - 'permalink'=>get_permalink($post) + 'permalink'=>"{{brizy_dc_permalink post_id=\"{$post->ID}\"}}" ]; } From 59c091f327d2e7860a0ebb014edf5208eb3f5f8b Mon Sep 17 00:00:00 2001 From: Alex Zaharia Date: Wed, 14 Dec 2022 10:52:01 +0200 Subject: [PATCH 07/15] fix: return a post type and labels when searching posts --- editor/api.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/editor/api.php b/editor/api.php index e1830d6a9d..33bb621d60 100755 --- a/editor/api.php +++ b/editor/api.php @@ -921,10 +921,15 @@ public function search_post() $out = []; foreach ($posts as $post) { + $pt = get_post_type_object( $post->post_type ); $out[] = [ 'ID' => $post->ID, 'title' => $post->post_title, - 'permalink'=>"{{brizy_dc_permalink post_id=\"{$post->ID}\"}}" + 'permalink'=>"{{brizy_dc_permalink post_id=\"{$post->ID}\"}}", + 'postType' => [ 'type' => $post->post_type, + 'singular_name' => $pt->labels->singular_name, + 'name' => $pt->labels->name + ] ]; } From d4bab74be47a1e005c56b0c19de5cb5da8d76354 Mon Sep 17 00:00:00 2001 From: Viorel Date: Wed, 14 Dec 2022 12:01:11 +0200 Subject: [PATCH 08/15] Fix: #20717 - Corrected translatable words --- admin/form-entries.php | 2 +- admin/membership/membership.php | 2 +- compatibilities/wordpress-importer.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/form-entries.php b/admin/form-entries.php index a540441fef..3e100acce6 100644 --- a/admin/form-entries.php +++ b/admin/form-entries.php @@ -145,7 +145,7 @@ public function addOnOffOption() { $class = 'disableFormLogs'; $val = 0; } else { - $label = __( 'Enable ', 'brizy' ); + $label = __( 'Enable', 'brizy' ); $class = 'enableFormLogs'; $val = 1; } diff --git a/admin/membership/membership.php b/admin/membership/membership.php index defdf592fa..af72ac6d0a 100644 --- a/admin/membership/membership.php +++ b/admin/membership/membership.php @@ -65,7 +65,7 @@ public function admin_bar_menu( &$wp_admin_bar ) { 'role' => 'default' ], [ - 'name' => esc_html__( 'Not Logged', 'brizy' ), + 'name' => esc_html__( 'Not Logged In', 'brizy' ), 'role' => 'not_logged' ], [ diff --git a/compatibilities/wordpress-importer.php b/compatibilities/wordpress-importer.php index e5d218fa03..0350bdff1e 100644 --- a/compatibilities/wordpress-importer.php +++ b/compatibilities/wordpress-importer.php @@ -35,7 +35,7 @@ public function handlePostsImport( $posts ) { if ( count( $incompatibleBrizyPosts ) ) { foreach ( $incompatibleBrizyPosts as $brizy_post ) { - printf( __( 'Importing Brizy post “%s” will be skipped due to incompatible version: %s ', 'brizy' ), + printf( __( 'Importing Brizy post “%s” will be skipped due to incompatible version: %s', 'brizy' ), esc_html( $brizy_post['post_title'] ), esc_html( $brizy_post['version'] ) ); echo '
'; } From 47cd6303c9dc83db1a6915ab041a3c2165563c9f Mon Sep 17 00:00:00 2001 From: Viorel Date: Wed, 14 Dec 2022 12:44:15 +0200 Subject: [PATCH 09/15] Fix: #20717 - Corrected translatable words --- brizy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brizy.php b/brizy.php index 6f4d1e82b7..8a67e41d46 100755 --- a/brizy.php +++ b/brizy.php @@ -68,7 +68,7 @@ function brizy_notices() %3$s IS NOT RUNNING.', + '%1$s requires PHP version 5.6+, your currently running PHP %2$s. %3$s IS NOT RUNNING.', 'brizy' ), __bt('brizy', 'Brizy'), From 2520608ce4f24cb7e42ba3cb04b28d8af753443e Mon Sep 17 00:00:00 2001 From: Alex Zaharia Date: Mon, 19 Dec 2022 09:13:54 +0200 Subject: [PATCH 10/15] new: changes required for editor client --- editor/api/client.php | 52 +- editor/url-builder.php | 10 + public/editor-client/build/index.js | 6 + public/main.php | 726 ++++++++++++++-------------- 4 files changed, 397 insertions(+), 397 deletions(-) create mode 100644 public/editor-client/build/index.js diff --git a/editor/api/client.php b/editor/api/client.php index 04428bb00c..1ec1f5f8e0 100755 --- a/editor/api/client.php +++ b/editor/api/client.php @@ -198,35 +198,36 @@ public function compile_page(Brizy_Editor_Project $project, $page_data, $config, { $blockManager = new Brizy_Admin_Blocks_Manager(Brizy_Admin_Blocks_Main::CP_GLOBAL); - - $body = apply_filters( - 'brizy_compiler_params', - array( - 'page_id' => (int)$config['wp']['page'], - 'free_version' => BRIZY_EDITOR_VERSION, - 'free_url' => Brizy_Config::getCompilerDownloadUrl(), - 'config_json' => json_encode($config), - 'pages_json' => json_encode( - array( - array( - 'id' => (int)$config['wp']['page'], - 'data' => $page_data, - 'is_index' => true, - ), - ) - ), - 'project_json' => json_encode($project->createResponse()), - 'global_blocks_json' => json_encode( - $blockManager->createResponseForEntities($blockManager->getEntities([])) - ), - ) - ); - + $urlBuilder = new Brizy_Editor_UrlBuilder( $project ); + $body = apply_filters( + 'brizy_compiler_params', + array( + 'page_id' => (int) $config['wp']['page'], + 'free_version' => BRIZY_EDITOR_VERSION, + 'free_url' => Brizy_Config::getCompilerDownloadUrl(), + 'config_json' => json_encode( $config ), + 'pages_json' => json_encode( + array( + array( + 'id' => (int) $config['wp']['page'], + 'data' => $page_data, + 'is_index' => true, + ), + ) + ), + 'project_json' => json_encode( $project->createResponse() ), + 'global_blocks_json' => json_encode( + $blockManager->createResponseForEntities( $blockManager->getEntities( [] ) ) + ), + 'api' => [ + 'imageUrlPattern' => $urlBuilder->mediaUrlPattern() + ] + ) + ); $page = parent::request($compiler_url, array('body' => $body), 'POST')->get_response_body(); $template_context = array( - 'editorData' => array( 'urls' => array( 'assets' => $config['urls']['assets'], @@ -254,7 +255,6 @@ public function compile_page(Brizy_Editor_Project $project, $page_data, $config, 'pro' => (isset($blocks['proStyles']) ? $blocks['proStyles'] : []), ], ]; - } /** diff --git a/editor/url-builder.php b/editor/url-builder.php index a831fd4f40..15592bff4c 100644 --- a/editor/url-builder.php +++ b/editor/url-builder.php @@ -43,6 +43,16 @@ public function compiler_url() return Brizy_Config::getCompilerUrls(); } + public function mediaUrlPattern() { + $home_url = home_url(); + + $query = [ + Brizy_Editor::prefix().'_media'=>'__MEDIA_UID__', + Brizy_Editor::prefix().'_crop'=>'__CROP_QUERY__' + ]; + + return $home_url.(strpos( $home_url,'?' )!==false?'&':'?').http_build_query($query); + } public function application_form_notification_url() { diff --git a/public/editor-client/build/index.js b/public/editor-client/build/index.js new file mode 100644 index 0000000000..c464d6b2e7 --- /dev/null +++ b/public/editor-client/build/index.js @@ -0,0 +1,6 @@ +__VISUAL_CONFIG__.client = { + t: function(){ + alert(1); + } +} + diff --git a/public/main.php b/public/main.php index 57c499c3f8..5b9581572e 100755 --- a/public/main.php +++ b/public/main.php @@ -2,34 +2,32 @@ use BrizyMerge\Assets\Asset; use BrizyMerge\Assets\AssetGroup; -if (!defined('ABSPATH')) { - die('Direct access forbidden.'); +if ( ! defined( 'ABSPATH' ) ) { + die( 'Direct access forbidden.' ); } -class Brizy_Public_Main -{ +class Brizy_Public_Main { - /** - * @var Brizy_Public_Main[] - */ - static $instance = null; + /** + * @var Brizy_Public_Main[] + */ + static $instance = null; - /** - * @var Brizy_Editor_Post - */ - private $post; + /** + * @var Brizy_Editor_Post + */ + private $post; - static $is_excerpt = false; + static $is_excerpt = false; /** * Brizy_Public_Main constructor. * * @param Brizy_Editor_Entity $post */ - private function __construct(Brizy_Editor_Entity $post) - { - $this->post = $post; - } + private function __construct( Brizy_Editor_Entity $post ) { + $this->post = $post; + } /** * @param Brizy_Editor_Entity $post @@ -37,35 +35,34 @@ private function __construct(Brizy_Editor_Entity $post) * @return Brizy_Public_Main * @throws Exception */ - static public function get(Brizy_Editor_Entity $post) - { - if ( ! $post->getWpPost() ) { - throw new Exception('Unable to create Brizy_Public_Main instance with null wp post'); - } - - $wpPostId = $post->getWpPost()->ID; - - if ( isset( self::$instance[ $wpPostId ] ) ) { - return self::$instance[ $wpPostId ]; - } - - return self::$instance[ $wpPostId ] = new self( $post ); - } - - public function editMode() { - if ( self::is_editing_page_with_editor( $this->post ) ) { - add_action( 'admin_action_in-front-editor', [ $this, 'loadEditPage' ] ); - } elseif ( self::is_editing_page_with_editor_on_iframe( $this->post ) ) { - add_filter( 'template_include', array( $this, 'templateIncludeForEditor' ), 10000 ); - add_filter( 'show_admin_bar', '__return_false' ); - add_filter( 'body_class', array( $this, 'body_class_editor' ) ); - add_action( 'wp_enqueue_scripts', array( $this, '_action_enqueue_editor_assets' ), 9999 ); - add_filter( 'the_content', array( $this, '_filter_the_content' ), - 12000 ); - add_action( 'brizy_template_content', array( $this, '_action_the_content' ) ); - add_action( 'post_password_required', '__return_false' ); - - } - } + static public function get( Brizy_Editor_Entity $post ) { + if ( ! $post->getWpPost() ) { + throw new Exception( 'Unable to create Brizy_Public_Main instance with null wp post' ); + } + + $wpPostId = $post->getWpPost()->ID; + + if ( isset( self::$instance[ $wpPostId ] ) ) { + return self::$instance[ $wpPostId ]; + } + + return self::$instance[ $wpPostId ] = new self( $post ); + } + + public function editMode() { + if ( self::is_editing_page_with_editor( $this->post ) ) { + add_action( 'admin_action_in-front-editor', [ $this, 'loadEditPage' ] ); + } elseif ( self::is_editing_page_with_editor_on_iframe( $this->post ) ) { + add_filter( 'template_include', array( $this, 'templateIncludeForEditor' ), 10000 ); + add_filter( 'show_admin_bar', '__return_false' ); + add_filter( 'body_class', array( $this, 'body_class_editor' ) ); + add_action( 'wp_enqueue_scripts', array( $this, '_action_enqueue_editor_assets' ), 9999 ); + add_filter( 'the_content', array( $this, '_filter_the_content' ), - 12000 ); + add_action( 'brizy_template_content', array( $this, '_action_the_content' ) ); + add_action( 'post_password_required', '__return_false' ); + + } + } public function previewMode() { @@ -75,170 +72,164 @@ public function previewMode() { $this->preparePost(); - add_action('template_include', array($this, 'templateIncludeForEditor'), 10000); - remove_filter('the_content', 'wpautop'); + add_action( 'template_include', array( $this, 'templateIncludeForEditor' ), 10000 ); + remove_filter( 'the_content', 'wpautop' ); // insert the compiled head and content - add_filter('body_class', array($this, 'body_class_frontend')); - add_action('wp_head', array($this, 'insert_page_head')); - add_action('admin_bar_menu', array($this, 'toolbar_link'), 999); - add_action('wp_enqueue_scripts', array($this, '_action_enqueue_preview_assets'), 9999); - add_filter('the_content', array($this, 'insert_page_content'), -12000); - add_action('brizy_template_content', array($this, 'brizy_the_content')); + add_filter( 'body_class', array( $this, 'body_class_frontend' ) ); + add_action( 'wp_head', array( $this, 'insert_page_head' ) ); + add_action( 'admin_bar_menu', array( $this, 'toolbar_link' ), 999 ); + add_action( 'wp_enqueue_scripts', array( $this, '_action_enqueue_preview_assets' ), 9999 ); + add_filter( 'the_content', array( $this, 'insert_page_content' ), - 12000 ); + add_action( 'brizy_template_content', array( $this, 'brizy_the_content' ) ); } - /** - * @internal - */ - public function _action_enqueue_editor_assets() - { - if (wp_script_is('wp-mediaelement') === false) { - wp_register_script( - 'wp-mediaelement', - "/wp-includes/js/mediaelement/wp-mediaelement.min.js", - array('mediaelement'), - false, - 1 - ); - } - - if (wp_style_is('wp-mediaelement') === false) { - wp_register_style( - 'wp-mediaelement', - "/wp-includes/js/mediaelement/wp-mediaelement.min.css", - array('mediaelement') - ); - } - - wp_enqueue_media(); - - $config_object = $this->getConfigObject(); - $assets_url = $config_object->urls->assets; - $editor_js_deps = ['brizy-editor-polyfill', 'brizy-editor-vendor']; - $editor_js_config = json_encode($config_object); - - if (class_exists('WooCommerce')) { - $editor_js_deps[] = 'zoom'; - $editor_js_deps[] = 'photoswipe'; - $editor_js_deps[] = 'flexslider'; - $editor_js_deps[] = 'wc-single-product'; - } - wp_enqueue_style('brizy-editor', "${assets_url}/editor/css/editor.css", array(), null); - wp_register_script('brizy-editor-polyfill', "${assets_url}/editor/js/polyfill.js", array(), null, true); - wp_register_script('brizy-editor-vendor', "${assets_url}/editor/js/editor.vendor.js", array(), null, true); - wp_enqueue_script('brizy-editor', "${assets_url}/editor/js/editor.js", apply_filters('brizy_editor_js_deps', $editor_js_deps), null, true); - wp_add_inline_script('brizy-editor', "var __VISUAL_CONFIG__ = ${editor_js_config};", 'before'); - - do_action('brizy_editor_enqueue_scripts'); - - // include REST api authenticate nonce - wp_localize_script( - 'wp-api', - 'wpApiSettings', - array( - 'root' => esc_url_raw(rest_url()), - 'nonce' => wp_create_nonce('wp_rest'), - 'editorVersion' => BRIZY_EDITOR_VERSION, - 'pluginVersion' => BRIZY_VERSION, - ) - ); - - if (BRIZY_DEVELOPMENT === true) { - wp_add_inline_script( - 'brizy-editor', - "window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;", - 'before' - ); - } - } - - - /** - * Do not remove this function it is used to compatibilities like astra theme - * - * @internal - */ - public function _action_enqueue_preview_assets() - { - Brizy_Public_AssetEnqueueManager::_init()->enqueuePost( $this->post ); - - do_action( 'brizy_preview_enqueue_scripts', $this->post ); - } - - public function toolbar_link($wp_admin_bar) - { - - global $wp_post_types; - - if (!Brizy_Editor_User::is_user_allowed()) { - return; - } - - $type = $this->post->getWpPost()->post_type; - $postTypeLabel = $wp_post_types[$type]->labels->singular_name; - $args = array( - 'id' => 'brizy_Edit_page_link', - 'title' => sprintf( __( 'Edit %s with %s', 'brizy' ), $postTypeLabel, __bt( 'brizy', 'Brizy' ) ), - 'href' => apply_filters('brizy_toolbar_link', $this->post->edit_url(), $this->post), - 'meta' => array(), - ); - $wp_admin_bar->add_node($args); - } - - public function templateIncludeForEditor($template) - { - $post = $this->post->getWpPost(); - - $template_path = get_post_meta($post->ID, '_wp_page_template', true); - $template_path = !$template_path && $post->post_type == Brizy_Admin_Templates::CP_TEMPLATE ? Brizy_Config::BRIZY_TEMPLATE_FILE_NAME : $template_path; - - if (in_array( - basename($template_path), - array( - Brizy_Config::BRIZY_BLANK_TEMPLATE_FILE_NAME, - Brizy_Config::BRIZY_TEMPLATE_FILE_NAME, - ) - )) { - $urlBuilder = new Brizy_Editor_UrlBuilder(); - - return $urlBuilder->plugin_path('/public/views/templates/' . $template_path); - } - - return $template; - } - - public function body_class_frontend($classes) - { - $classes[] = 'brz'; - - return $classes; - } - - public function body_class_editor($classes) - { - - $classes[] = 'brz'; - $classes[] = 'brz-ed'; - $classes[] = 'brz-ed--desktop'; - - if (class_exists('WooCommerce')) { - if ($this->post->getWpPost()->post_type == Brizy_Admin_Templates::CP_TEMPLATE) { - $classes[] = 'woocommerce'; - } - } - - return $classes; - } - - /** - * @return bool - */ + /** + * @internal + */ + public function _action_enqueue_editor_assets() { + if ( wp_script_is( 'wp-mediaelement' ) === false ) { + wp_register_script( + 'wp-mediaelement', + "/wp-includes/js/mediaelement/wp-mediaelement.min.js", + array( 'mediaelement' ), + false, + 1 + ); + } + + if ( wp_style_is( 'wp-mediaelement' ) === false ) { + wp_register_style( + 'wp-mediaelement', + "/wp-includes/js/mediaelement/wp-mediaelement.min.css", + array( 'mediaelement' ) + ); + } + + wp_enqueue_media(); + + $config_object = $this->getConfigObject(); + $assets_url = $config_object->urls->assets; + $client_asset_url = $this->urlBuilder->plugin_url("/public"); + $editor_js_deps = [ 'brizy-editor-polyfill', 'brizy-editor-vendor' ]; + $editor_js_config = json_encode( $config_object ); + + if ( class_exists( 'WooCommerce' ) ) { + $editor_js_deps[] = 'zoom'; + $editor_js_deps[] = 'photoswipe'; + $editor_js_deps[] = 'flexslider'; + $editor_js_deps[] = 'wc-single-product'; + } + wp_enqueue_style( 'brizy-editor', "${assets_url}/editor/css/editor.css", array(), null ); + wp_register_script( 'brizy-editor-polyfill', "${assets_url}/editor/js/polyfill.js", array(), null, true ); + wp_register_script( 'brizy-editor-vendor', "${assets_url}/editor/js/editor.vendor.js", array(), null, true ); + wp_enqueue_script( 'brizy-client-editor', "${client_asset_url}/editor-client/build/index.js", [ 'brizy-editor-vendor' ], null, true ); + wp_enqueue_script( 'brizy-editor', "${assets_url}/editor/js/editor.js", apply_filters( 'brizy_editor_js_deps', $editor_js_deps ), null, true ); + wp_add_inline_script( 'brizy-editor-vendor', "var __VISUAL_CONFIG__ = ${editor_js_config}; ", 'after' ); + + do_action( 'brizy_editor_enqueue_scripts' ); + + // include REST api authenticate nonce + wp_localize_script( + 'wp-api', + 'wpApiSettings', + array( + 'root' => esc_url_raw( rest_url() ), + 'nonce' => wp_create_nonce( 'wp_rest' ), + 'editorVersion' => BRIZY_EDITOR_VERSION, + 'pluginVersion' => BRIZY_VERSION, + ) + ); + + if ( BRIZY_DEVELOPMENT === true ) { + wp_add_inline_script( + 'brizy-editor', + "window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;", + 'before' + ); + } + } + + /** + * Do not remove this function it is used to compatibilities like astra theme + * + * @internal + */ + public function _action_enqueue_preview_assets() { + Brizy_Public_AssetEnqueueManager::_init()->enqueuePost( $this->post ); + + do_action( 'brizy_preview_enqueue_scripts', $this->post ); + } + + public function toolbar_link( $wp_admin_bar ) { + global $wp_post_types; + + if ( ! Brizy_Editor_User::is_user_allowed() ) { + return; + } + + $type = $this->post->getWpPost()->post_type; + $postTypeLabel = $wp_post_types[ $type ]->labels->singular_name; + $args = array( + 'id' => 'brizy_Edit_page_link', + 'title' => sprintf( __( 'Edit %s with %s', 'brizy' ), $postTypeLabel, __bt( 'brizy', 'Brizy' ) ), + 'href' => apply_filters( 'brizy_toolbar_link', $this->post->edit_url(), $this->post ), + 'meta' => array(), + ); + $wp_admin_bar->add_node( $args ); + } + + public function templateIncludeForEditor( $template ) { + $post = $this->post->getWpPost(); + + $template_path = get_post_meta( $post->ID, '_wp_page_template', true ); + $template_path = ! $template_path && $post->post_type == Brizy_Admin_Templates::CP_TEMPLATE ? Brizy_Config::BRIZY_TEMPLATE_FILE_NAME : $template_path; + + if ( in_array( + basename( $template_path ), + array( + Brizy_Config::BRIZY_BLANK_TEMPLATE_FILE_NAME, + Brizy_Config::BRIZY_TEMPLATE_FILE_NAME, + ) + ) ) { + $urlBuilder = new Brizy_Editor_UrlBuilder(); + + return $urlBuilder->plugin_path( '/public/views/templates/' . $template_path ); + } + + return $template; + } + + public function body_class_frontend( $classes ) { + $classes[] = 'brz'; + + return $classes; + } + + public function body_class_editor( $classes ) { + + $classes[] = 'brz'; + $classes[] = 'brz-ed'; + $classes[] = 'brz-ed--desktop'; + + if ( class_exists( 'WooCommerce' ) ) { + if ( $this->post->getWpPost()->post_type == Brizy_Admin_Templates::CP_TEMPLATE ) { + $classes[] = 'woocommerce'; + } + } + + return $classes; + } + + /** + * @return bool + */ public static function is_editing_page_with_editor( Brizy_Editor_Post $post = null ) { return is_admin() && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'in-front-editor' && ( $post ? $post->uses_editor() : true ); } - /** - * @return bool - */ + /** + * @return bool + */ public static function is_editing_page_with_editor_on_iframe( Brizy_Editor_Post $post = null ) { return ! is_admin() && ! empty( $_REQUEST['is-editor-iframe'] ) && ( $post ? $post->uses_editor() : true ); } @@ -265,173 +256,165 @@ public static function is_view_page( Brizy_Editor_Post $post = null ) { return $isView; } - /** - * @param $content - * - * @return string - * - * @internal - */ - function _filter_the_content($content) - { - if (is_main_query() && !doing_filter('brizy_content')) { - - try { - //$config_object = $this->getConfigObject(); - $context = array( - //'editorData' => $config_object, - 'editorVersion' => BRIZY_EDITOR_VERSION, - ); - - if (WP_DEBUG) { - $context['DEBUG'] = true; - } - - $render_block = Brizy_TwigEngine::instance(self::path('views')) - ->render('editor.html.twig', $context); - - return $render_block; - } catch (Exception $e) { - return $e->getMessage(); - } - } - - return $content; - } - - public function _action_the_content() - { - echo $this->_filter_the_content(''); - } - - /** - * Show the compiled page head content - */ - public function insert_page_head() - { - if (!$this->post->get_compiled_html()) { - $compiled_html_head = $this->post->get_compiled_html_head(); - $compiled_html_head = Brizy_SiteUrlReplacer::restoreSiteUrl($compiled_html_head); - $this->post->set_needs_compile(true)->saveStorage(); - $html = $compiled_html_head; - } else { - $compiled_page = $this->post->get_compiled_page(); - $head = $compiled_page->get_head(); - $html = $head; - } - - if ( empty( $html ) ) { - return; - } - - $params['content'] = apply_filters( - 'brizy_content', - $html, - Brizy_Editor_Project::get(), - $this->post->getWpPost(), - 'head' - ); - - echo Brizy_TwigEngine::instance(self::path('views'))->render('head-partial.html.twig', $params); - } - - /** - * @param $content - * - * @return null|string|string[] - * @throws Exception - */ - public function insert_page_content($content) - { - if (doing_filter('brizy_dc_excerpt')) { - return $content; - } - - if (false === strpos($content, 'brz-root__container')) { - return $content; - } - - if (self::$is_excerpt) { - return apply_filters('brizy_content', $content, Brizy_Editor_Project::get(), $this->post->getWpPost(), 'body'); - } - - $project = Brizy_Editor_Project::get(); - - if (!$this->post->get_compiled_html()) { - $compiled_html_body = $this->post->get_compiled_html_body(); - $content = Brizy_SiteUrlReplacer::restoreSiteUrl($compiled_html_body); - $this->post->set_needs_compile(true)->saveStorage(); - } else { - $compiled_page = $this->post->get_compiled_page(); - $content = $compiled_page->get_body(); - } - - return apply_filters( - 'brizy_content', - $content, - $project, - $this->post->getWpPost(), - 'body' - ); - } - - public function brizy_the_content() - { - echo do_shortcode( $this->insert_page_content( 'brz-root__container' ) ); - } - - /** - * @param string $rel - * - * @return string - */ - public static function path($rel) - { - return dirname(__FILE__) . "/$rel"; - } - - private function getConfigObject($context = Brizy_Editor_Editor_Editor::EDITOR_CONTEXT) - { - $editor = Brizy_Editor_Editor_Editor::get(Brizy_Editor_Project::get(), $this->post); - $config_json = json_encode($editor->config($context)); - $config_object = json_decode($config_json); - - return $config_object; - } - - private function preparePost() - { - $is_preview = is_preview() || isset($_GET['preview']); - $needs_compile = !$this->post->isCompiledWithCurrentVersion() || $this->post->get_needs_compile(); - $autosaveId = null; - if ($is_preview) { - $user_id = get_current_user_id(); - $postParentId = $this->post->getWpPostId(); - $autosaveId = Brizy_Editor_AutoSaveAware::getAutoSavePost($postParentId, $user_id); - - if ($autosaveId) { - $this->post = Brizy_Editor_Post::get($autosaveId); - $needs_compile = !$this->post->isCompiledWithCurrentVersion() || $this->post->get_needs_compile(); - } else { - // we make this false because the page was saved. - $is_preview = false; - } - } - - try { - if ($is_preview || $needs_compile) { - $this->post->compile_page(); - } - - if (!$is_preview && $needs_compile || $autosaveId) { - $this->post->saveStorage(); - $this->post->savePost(); - } - - } catch (Exception $e) { - Brizy_Logger::instance()->exception($e); - } - } + /** + * @param $content + * + * @return string + * + * @internal + */ + function _filter_the_content( $content ) { + if ( is_main_query() && ! doing_filter( 'brizy_content' ) ) { + + try { + //$config_object = $this->getConfigObject(); + $context = array( + //'editorData' => $config_object, + 'editorVersion' => BRIZY_EDITOR_VERSION, + ); + + if ( WP_DEBUG ) { + $context['DEBUG'] = true; + } + + $render_block = Brizy_TwigEngine::instance( self::path( 'views' ) ) + ->render( 'editor.html.twig', $context ); + + return $render_block; + } catch ( Exception $e ) { + return $e->getMessage(); + } + } + + return $content; + } + + public function _action_the_content() { + echo $this->_filter_the_content( '' ); + } + + /** + * Show the compiled page head content + */ + public function insert_page_head() { + if ( ! $this->post->get_compiled_html() ) { + $compiled_html_head = $this->post->get_compiled_html_head(); + $compiled_html_head = Brizy_SiteUrlReplacer::restoreSiteUrl( $compiled_html_head ); + $this->post->set_needs_compile( true )->saveStorage(); + $html = $compiled_html_head; + } else { + $compiled_page = $this->post->get_compiled_page(); + $head = $compiled_page->get_head(); + $html = $head; + } + + if ( empty( $html ) ) { + return; + } + + $params['content'] = apply_filters( + 'brizy_content', + $html, + Brizy_Editor_Project::get(), + $this->post->getWpPost(), + 'head' + ); + + echo Brizy_TwigEngine::instance( self::path( 'views' ) )->render( 'head-partial.html.twig', $params ); + } + + /** + * @param $content + * + * @return null|string|string[] + * @throws Exception + */ + public function insert_page_content( $content ) { + if ( doing_filter( 'brizy_dc_excerpt' ) ) { + return $content; + } + + if ( false === strpos( $content, 'brz-root__container' ) ) { + return $content; + } + + if ( self::$is_excerpt ) { + return apply_filters( 'brizy_content', $content, Brizy_Editor_Project::get(), $this->post->getWpPost(), 'body' ); + } + + $project = Brizy_Editor_Project::get(); + + if ( ! $this->post->get_compiled_html() ) { + $compiled_html_body = $this->post->get_compiled_html_body(); + $content = Brizy_SiteUrlReplacer::restoreSiteUrl( $compiled_html_body ); + $this->post->set_needs_compile( true )->saveStorage(); + } else { + $compiled_page = $this->post->get_compiled_page(); + $content = $compiled_page->get_body(); + } + + return apply_filters( + 'brizy_content', + $content, + $project, + $this->post->getWpPost(), + 'body' + ); + } + + public function brizy_the_content() { + echo do_shortcode( $this->insert_page_content( 'brz-root__container' ) ); + } + + /** + * @param string $rel + * + * @return string + */ + public static function path( $rel ) { + return dirname( __FILE__ ) . "/$rel"; + } + + private function getConfigObject( $context = Brizy_Editor_Editor_Editor::EDITOR_CONTEXT ) { + $editor = Brizy_Editor_Editor_Editor::get( Brizy_Editor_Project::get(), $this->post ); + $config_json = json_encode( $editor->config( $context ) ); + $config_object = json_decode( $config_json ); + + return $config_object; + } + + private function preparePost() { + $is_preview = is_preview() || isset( $_GET['preview'] ); + $needs_compile = ! $this->post->isCompiledWithCurrentVersion() || $this->post->get_needs_compile(); + $autosaveId = null; + if ( $is_preview ) { + $user_id = get_current_user_id(); + $postParentId = $this->post->getWpPostId(); + $autosaveId = Brizy_Editor_AutoSaveAware::getAutoSavePost( $postParentId, $user_id ); + + if ( $autosaveId ) { + $this->post = Brizy_Editor_Post::get( $autosaveId ); + $needs_compile = ! $this->post->isCompiledWithCurrentVersion() || $this->post->get_needs_compile(); + } else { + // we make this false because the page was saved. + $is_preview = false; + } + } + + try { + if ( $is_preview || $needs_compile ) { + $this->post->compile_page(); + } + + if ( ! $is_preview && $needs_compile || $autosaveId ) { + $this->post->saveStorage(); + $this->post->savePost(); + } + + } catch ( Exception $e ) { + Brizy_Logger::instance()->exception( $e ); + } + } public function loadEditPage() { @@ -447,7 +430,8 @@ public function loadEditPage() { $favicon = ''; if ( has_site_icon() ) { - ob_start(); ob_clean(); + ob_start(); + ob_clean(); wp_site_icon(); $favicon = ob_get_clean(); } From 5f89bec99636e5b8313d2c98d58e8a84106ec7fd Mon Sep 17 00:00:00 2001 From: Alex Zaharia Date: Mon, 19 Dec 2022 17:16:22 +0200 Subject: [PATCH 11/15] fix: undefined property $urlBuilder --- public/main.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/main.php b/public/main.php index 5b9581572e..9f3700bef6 100755 --- a/public/main.php +++ b/public/main.php @@ -107,9 +107,10 @@ public function _action_enqueue_editor_assets() { wp_enqueue_media(); + $urlBuilder = new Brizy_Editor_UrlBuilder(); $config_object = $this->getConfigObject(); $assets_url = $config_object->urls->assets; - $client_asset_url = $this->urlBuilder->plugin_url("/public"); + $client_asset_url = $urlBuilder->plugin_url("/public"); $editor_js_deps = [ 'brizy-editor-polyfill', 'brizy-editor-vendor' ]; $editor_js_config = json_encode( $config_object ); From 1a24edf240882757a58ece787222b03990e34207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98Maxim?= Date: Wed, 21 Dec 2022 13:40:20 +0200 Subject: [PATCH 12/15] feat(editor-client): init package --- public/editor-client/.editorconfig | 16 ++ public/editor-client/.gitignore | 3 + public/editor-client/bin/index.js | 25 +++ public/editor-client/build/index.js | 6 - public/editor-client/package-lock.json | 209 ++++++++++++++++++ public/editor-client/package.json | 24 ++ public/editor-client/src/api/index.ts | 37 ++++ .../editor-client/src/classes/getClasses.ts | 13 ++ public/editor-client/src/config.ts | 17 ++ public/editor-client/src/index.ts | 7 + public/editor-client/src/types/NewType.ts | 1 + public/editor-client/src/types/Response.ts | 1 + public/editor-client/src/types/global.d.ts | 16 ++ public/editor-client/tsconfig.json | 27 +++ 14 files changed, 396 insertions(+), 6 deletions(-) create mode 100644 public/editor-client/.editorconfig create mode 100644 public/editor-client/.gitignore create mode 100644 public/editor-client/bin/index.js delete mode 100644 public/editor-client/build/index.js create mode 100644 public/editor-client/package-lock.json create mode 100644 public/editor-client/package.json create mode 100644 public/editor-client/src/api/index.ts create mode 100644 public/editor-client/src/classes/getClasses.ts create mode 100644 public/editor-client/src/config.ts create mode 100644 public/editor-client/src/index.ts create mode 100644 public/editor-client/src/types/NewType.ts create mode 100644 public/editor-client/src/types/Response.ts create mode 100644 public/editor-client/src/types/global.d.ts create mode 100644 public/editor-client/tsconfig.json diff --git a/public/editor-client/.editorconfig b/public/editor-client/.editorconfig new file mode 100644 index 0000000000..290cb2465c --- /dev/null +++ b/public/editor-client/.editorconfig @@ -0,0 +1,16 @@ +# http://editorconfig.org/ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true + +[*.php] +indent_size = 4 + +[*.md] +trim_trailing_whitespace = false diff --git a/public/editor-client/.gitignore b/public/editor-client/.gitignore new file mode 100644 index 0000000000..62cefeb709 --- /dev/null +++ b/public/editor-client/.gitignore @@ -0,0 +1,3 @@ +/build/ +/node_modules/ +.env diff --git a/public/editor-client/bin/index.js b/public/editor-client/bin/index.js new file mode 100644 index 0000000000..4687fc338f --- /dev/null +++ b/public/editor-client/bin/index.js @@ -0,0 +1,25 @@ +const esbuild = require("esbuild"); + +const argv_ = require("minimist")(process.argv.slice(2)); + +const IS_PRODUCTION = Boolean(argv_.production); +const WATCH = Boolean(argv_.watch); + +const define = { + "process.env.IS_PRODUCTION": JSON.stringify(IS_PRODUCTION), +}; + +esbuild + .build({ + entryPoints: ["src/index.ts"], + outfile: "build/index.js", + bundle: true, + loader: { ".ts": "ts" }, + minify: IS_PRODUCTION, + watch: WATCH, + sourcemap: IS_PRODUCTION ? false : "inline", + format: "iife", + define: define, + }) + .then(() => console.log("⚡ Done")) + .catch(() => process.exit(1)); diff --git a/public/editor-client/build/index.js b/public/editor-client/build/index.js deleted file mode 100644 index c464d6b2e7..0000000000 --- a/public/editor-client/build/index.js +++ /dev/null @@ -1,6 +0,0 @@ -__VISUAL_CONFIG__.client = { - t: function(){ - alert(1); - } -} - diff --git a/public/editor-client/package-lock.json b/public/editor-client/package-lock.json new file mode 100644 index 0000000000..bd287c863b --- /dev/null +++ b/public/editor-client/package-lock.json @@ -0,0 +1,209 @@ +{ + "name": "@brizy-wp/api-client", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@esbuild/android-arm": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.10.tgz", + "integrity": "sha512-RmJjQTRrO6VwUWDrzTBLmV4OJZTarYsiepLGlF2rYTVB701hSorPywPGvP6d8HCuuRibyXa5JX4s3jN2kHEtjQ==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.10.tgz", + "integrity": "sha512-47Y+NwVKTldTlDhSgJHZ/RpvBQMUDG7eKihqaF/u6g7s0ZPz4J1vy8A3rwnnUOF2CuDn7w7Gj/QcMoWz3U3SJw==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.10.tgz", + "integrity": "sha512-C4PfnrBMcuAcOurQzpF1tTtZz94IXO5JmICJJ3NFJRHbXXsQUg9RFG45KvydKqtFfBaFLCHpduUkUfXwIvGnRg==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.10.tgz", + "integrity": "sha512-bH/bpFwldyOKdi9HSLCLhhKeVgRYr9KblchwXgY2NeUHBB/BzTUHtUSBgGBmpydB1/4E37m+ggXXfSrnD7/E7g==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.10.tgz", + "integrity": "sha512-OXt7ijoLuy+AjDSKQWu+KdDFMBbdeaL6wtgMKtDUXKWHiAMKHan5+R1QAG6HD4+K0nnOvEJXKHeA9QhXNAjOTQ==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.10.tgz", + "integrity": "sha512-shSQX/3GHuspE3Uxtq5kcFG/zqC+VuMnJkqV7LczO41cIe6CQaXHD3QdMLA4ziRq/m0vZo7JdterlgbmgNIAlQ==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.10.tgz", + "integrity": "sha512-5YVc1zdeaJGASijZmTzSO4h6uKzsQGG3pkjI6fuXvolhm3hVRhZwnHJkforaZLmzvNv5Tb7a3QL2FAVmrgySIA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.10.tgz", + "integrity": "sha512-c360287ZWI2miBnvIj23bPyVctgzeMT2kQKR+x94pVqIN44h3GF8VMEs1SFPH1UgyDr3yBbx3vowDS1SVhyVhA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.10.tgz", + "integrity": "sha512-2aqeNVxIaRfPcIaMZIFoblLh588sWyCbmj1HHCCs9WmeNWm+EIN0SmvsmPvTa/TsNZFKnxTcvkX2eszTcCqIrA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.10.tgz", + "integrity": "sha512-sqMIEWeyrLGU7J5RB5fTkLRIFwsgsQ7ieWXlDLEmC2HblPYGb3AucD7inw2OrKFpRPKsec1l+lssiM3+NV5aOw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.10.tgz", + "integrity": "sha512-O7Pd5hLEtTg37NC73pfhUOGTjx/+aXu5YoSq3ahCxcN7Bcr2F47mv+kG5t840thnsEzrv0oB70+LJu3gUgchvg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.10.tgz", + "integrity": "sha512-FN8mZOH7531iPHM0kaFhAOqqNHoAb6r/YHW2ZIxNi0a85UBi2DO4Vuyn7t1p4UN8a4LoAnLOT1PqNgHkgBJgbA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.10.tgz", + "integrity": "sha512-Dg9RiqdvHOAWnOKIOTsIx8dFX9EDlY2IbPEY7YFzchrCiTZmMkD7jWA9UdZbNUygPjdmQBVPRCrLydReFlX9yg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.10.tgz", + "integrity": "sha512-XMqtpjwzbmlar0BJIxmzu/RZ7EWlfVfH68Vadrva0Wj5UKOdKvqskuev2jY2oPV3aoQUyXwnMbMrFmloO2GfAw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.10.tgz", + "integrity": "sha512-fu7XtnoeRNFMx8DjK3gPWpFBDM2u5ba+FYwg27SjMJwKvJr4bDyKz5c+FLXLUSSAkMAt/UL+cUbEbra+rYtUgw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.10.tgz", + "integrity": "sha512-61lcjVC/RldNNMUzQQdyCWjCxp9YLEQgIxErxU9XluX7juBdGKb0pvddS0vPNuCvotRbzijZ1pzII+26haWzbA==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.10.tgz", + "integrity": "sha512-JeZXCX3viSA9j4HqSoygjssdqYdfHd6yCFWyfSekLbz4Ef+D2EjvsN02ZQPwYl5a5gg/ehdHgegHhlfOFP0HCA==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.10.tgz", + "integrity": "sha512-3qpxQKuEVIIg8SebpXsp82OBrqjPV/OwNWmG+TnZDr3VGyChNnGMHccC1xkbxCHDQNnnXjxhMQNyHmdFJbmbRA==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.10.tgz", + "integrity": "sha512-z+q0xZ+et/7etz7WoMyXTHZ1rB8PMSNp/FOqURLJLOPb3GWJ2aj4oCqFCjPwEbW1rsT7JPpxeH/DwGAWk/I1Bg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.10.tgz", + "integrity": "sha512-+YYu5sbQ9npkNT9Dec+tn1F/kjg6SMgr6bfi/6FpXYZvCRfu2YFPZGb+3x8K30s8eRxFpoG4sGhiSUkr1xbHEw==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.10.tgz", + "integrity": "sha512-Aw7Fupk7XNehR1ftHGYwUteyJ2q+em/aE+fVU3YMTBN2V5A7Z4aVCSV+SvCp9HIIHZavPFBpbdP3VfjQpdf6Xg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.10.tgz", + "integrity": "sha512-qddWullt3sC1EIpfHvCRBq3H4g3L86DZpD6n8k2XFjFVyp01D++uNbN1hT/JRsHxTbyyemZcpwL5aRlJwc/zFw==", + "dev": true, + "optional": true + }, + "@types/node": { + "version": "18.11.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.17.tgz", + "integrity": "sha512-HJSUJmni4BeDHhfzn6nF0sVmd1SMezP7/4F0Lq+aXzmp2xm9O7WXrUtHW/CHlYVtZUbByEvWidHqRtcJXGF2Ng==", + "dev": true + }, + "esbuild": { + "version": "0.16.10", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.10.tgz", + "integrity": "sha512-z5dIViHoVnw2l+NCJ3zj5behdXjYvXne9gL18OOivCadXDUhyDkeSvEtLcGVAJW2fNmh33TDUpsi704XYlDodw==", + "dev": true, + "requires": { + "@esbuild/android-arm": "0.16.10", + "@esbuild/android-arm64": "0.16.10", + "@esbuild/android-x64": "0.16.10", + "@esbuild/darwin-arm64": "0.16.10", + "@esbuild/darwin-x64": "0.16.10", + "@esbuild/freebsd-arm64": "0.16.10", + "@esbuild/freebsd-x64": "0.16.10", + "@esbuild/linux-arm": "0.16.10", + "@esbuild/linux-arm64": "0.16.10", + "@esbuild/linux-ia32": "0.16.10", + "@esbuild/linux-loong64": "0.16.10", + "@esbuild/linux-mips64el": "0.16.10", + "@esbuild/linux-ppc64": "0.16.10", + "@esbuild/linux-riscv64": "0.16.10", + "@esbuild/linux-s390x": "0.16.10", + "@esbuild/linux-x64": "0.16.10", + "@esbuild/netbsd-x64": "0.16.10", + "@esbuild/openbsd-x64": "0.16.10", + "@esbuild/sunos-x64": "0.16.10", + "@esbuild/win32-arm64": "0.16.10", + "@esbuild/win32-ia32": "0.16.10", + "@esbuild/win32-x64": "0.16.10" + } + }, + "minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "dev": true + }, + "typescript": { + "version": "4.9.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", + "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==" + } + } +} diff --git a/public/editor-client/package.json b/public/editor-client/package.json new file mode 100644 index 0000000000..bb33c745f3 --- /dev/null +++ b/public/editor-client/package.json @@ -0,0 +1,24 @@ +{ + "name": "@brizy-wp/api-client", + "version": "1.0.0", + "description": "Api Client for builder", + "main": "index.js", + "scripts": { + "start": "npm run build -- --watch", + "build": "node bin/index.js", + "build:prod": "npm run build -- --production" + }, + "keywords": [ + "api" + ], + "author": "brizy", + "license": "MIT", + "dependencies": { + "typescript": "^4.9.4" + }, + "devDependencies": { + "@types/node": "^18.11.17", + "esbuild": "^0.16.10", + "minimist": "^1.2.7" + } +} diff --git a/public/editor-client/src/api/index.ts b/public/editor-client/src/api/index.ts new file mode 100644 index 0000000000..c77f3568be --- /dev/null +++ b/public/editor-client/src/api/index.ts @@ -0,0 +1,37 @@ +import { getConfig } from "../config"; + +//#region Common Utils Request & PersistentRequest +export function request( + url: string, + config: RequestInit = {} +): Promise { + // will see later if we'll have to hardcode + // some settings into config like we do for brizy cloud + // In WP referer must be root window not iframe + const { fetch } = window.parent || window; + return fetch(url, config); +} + +export const makeUrl = ( + baseUrl: string, + params: Record = {} +): string => { + const url = new URL(baseUrl); + + Object.entries(params).forEach(([key, value]) => { + url.searchParams.append(key, value); + }); + + return url.toString(); +}; + +export function getClasses(): Promise { + const { url: _url, hash, getSymbols, editorVersion } = getConfig(); + const url = makeUrl(_url, { + action: getSymbols, + version: editorVersion, + hash, + }); + + return request(url, { method: "GET" }); +} diff --git a/public/editor-client/src/classes/getClasses.ts b/public/editor-client/src/classes/getClasses.ts new file mode 100644 index 0000000000..3c864cb890 --- /dev/null +++ b/public/editor-client/src/classes/getClasses.ts @@ -0,0 +1,13 @@ +import { getClasses as apiGetClasses } from "../api"; + +export type Classes = Record; + +export const getClasses = (res, rej): void => { + apiGetClasses() + .then((r) => { + res(r); + }) + .catch((r) => { + rej("Somehting went worn"); + }); +}; diff --git a/public/editor-client/src/config.ts b/public/editor-client/src/config.ts new file mode 100644 index 0000000000..e73c0ab94d --- /dev/null +++ b/public/editor-client/src/config.ts @@ -0,0 +1,17 @@ +interface Config { + url: string; + hash: string; + editorVersion: string; +} + +export const getConfig = (): Config | undefined => { + if (!window.__BRZ_PLUGIN_ENV__) { + throw "missing __BRZ_PLUGIN_ENV__"; + } + + return { + url: "", + hash: "", + editorVersion: window.__BRZ_PLUGIN_ENV__.editorVersion, + }; +}; diff --git a/public/editor-client/src/index.ts b/public/editor-client/src/index.ts new file mode 100644 index 0000000000..0f9ede9dc4 --- /dev/null +++ b/public/editor-client/src/index.ts @@ -0,0 +1,7 @@ +const api = { + // All API need to be here +}; + +if (window.__VISUAL_CONFIG__) { + window.__VISUAL_CONFIG__.api = api; +} diff --git a/public/editor-client/src/types/NewType.ts b/public/editor-client/src/types/NewType.ts new file mode 100644 index 0000000000..7dd7aa80fa --- /dev/null +++ b/public/editor-client/src/types/NewType.ts @@ -0,0 +1 @@ +export type NewType = T & { __typeId: I }; diff --git a/public/editor-client/src/types/Response.ts b/public/editor-client/src/types/Response.ts new file mode 100644 index 0000000000..7ca961b7ca --- /dev/null +++ b/public/editor-client/src/types/Response.ts @@ -0,0 +1 @@ +export type Response = (r: R) => void; diff --git a/public/editor-client/src/types/global.d.ts b/public/editor-client/src/types/global.d.ts new file mode 100644 index 0000000000..d784b7d2a3 --- /dev/null +++ b/public/editor-client/src/types/global.d.ts @@ -0,0 +1,16 @@ +declare global { + namespace NodeJS { + interface Global { + "process.env.IS_PRODUCTION": boolean; + } + } + interface Window { + __BRZ_PLUGIN_ENV__?: { + hash: string; + editorVersion: string; + }; + __VISUAL_CONFIG__?: { + api?: {}; + }; + } +} diff --git a/public/editor-client/tsconfig.json b/public/editor-client/tsconfig.json new file mode 100644 index 0000000000..6fffb42a1a --- /dev/null +++ b/public/editor-client/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "moduleResolution": "node", + "declaration": true, + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true /* Enable strict null checks. */, + "strictFunctionTypes": true /* Enable strict checking of function types. */, + "noUnusedLocals": true /* Report errors on unused locals. */, + "noUnusedParameters": true /* Report errors on unused parameters. */, + "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, + "importHelpers": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "experimentalDecorators": true, + "sourceMap": true, + "outDir": "build", + "types": ["node"], + "lib": ["ES6", "DOM"] + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules"] +} From 343ba071de6c3ca4b74d9a397132ccd43f49c054 Mon Sep 17 00:00:00 2001 From: Zaharia Alexandru Date: Wed, 21 Sep 2022 00:31:31 +0300 Subject: [PATCH 13/15] new: Symbols api --- admin/abstract-api.php | 2 +- admin/symbols/api.php | 126 ++ admin/symbols/manager.php | 118 ++ admin/symbols/symbol.php | 161 +++ editor/editor/editor.php | 2335 +++++++++++++++++++------------------ 5 files changed, 1594 insertions(+), 1148 deletions(-) create mode 100644 admin/symbols/api.php create mode 100644 admin/symbols/manager.php create mode 100644 admin/symbols/symbol.php diff --git a/admin/abstract-api.php b/admin/abstract-api.php index de4f739f4f..76499875ec 100644 --- a/admin/abstract-api.php +++ b/admin/abstract-api.php @@ -23,7 +23,7 @@ protected function verifyNonce( $action ) { $version = $this->param( 'version' ); if ( $version !== BRIZY_EDITOR_VERSION ) { - Brizy_Logger::instance()->critical( 'Request with invalid version', + Brizy_Logger::instance()->critical( 'Request with invalid editor version', [ 'editorVersion' => BRIZY_EDITOR_VERSION, 'providedVersion' => $version diff --git a/admin/symbols/api.php b/admin/symbols/api.php new file mode 100644 index 0000000000..2eaa88c206 --- /dev/null +++ b/admin/symbols/api.php @@ -0,0 +1,126 @@ +manager = $manager; + + parent::__construct(); + } + + /** + * @return Brizy_Admin_Rules_Api + */ + public static function _init() + { + static $instance; + + if ( ! $instance) { + $instance = new self(new Brizy_Admin_Symbols_Manager()); + } + + return $instance; + } + + protected function getRequestNonce() + { + return $this->param('hash'); + } + + protected function initializeApiActions() + { + $pref = 'wp_ajax_'.Brizy_Editor::prefix(); + + add_action($pref.self::CREATE_ACTION, array($this, 'actionCreateOrUpdate')); + add_action($pref.self::UPDATE_ACTION, array($this, 'actionCreateOrUpdate')); + add_action($pref.self::DELETE_ACTION, array($this, 'actionDelete')); + add_action($pref.self::LIST_ACTION, array($this, 'actionGetList')); + } + + /** + * @return null|void + */ + public function actionGetList() + { + $this->verifyNonce(self::nonce); + + try { + $symbols = $this->manager->getList(); + + $this->success($symbols); + } catch (Exception $e) { + Brizy_Logger::instance()->error($e->getMessage(), [$e]); + $this->error(400, $e->getMessage()); + } + + return null; + } + + public function actionCreateOrUpdate() + { + + $this->verifyNonce(self::nonce); + + $data = file_get_contents("php://input"); + + try { + $asymbol = $this->manager->createFromJson($data); + $symbol = null; + if ($asymbol->getUid()) { + $symbol = $this->manager->get($asymbol->getUid()); + $symbol->patchFrom($asymbol); + } else { + $symbol = $asymbol; + } + $symbol->incrementVersion(); + $this->manager->validateSymbol($symbol); + $this->manager->saveSymbol($symbol); + } catch (Exception $e) { + $this->error(400, "Error".$e->getMessage()); + } + + wp_send_json_success($symbol, 200); + } + + public function actionDelete() + { + + $this->verifyNonce(self::nonce); + + $uid = $this->param('uid'); + + if ( ! $uid) { + $this->error(400, "Error: Please provide the symbol uid"); + } + + try { + $symbol = $this->manager->get($uid); + $this->manager->deleteSymbol($symbol); + } catch (Exception $e) { + $this->error(400, 'Unable to delete symbol'); + } + + $this->success(null); + } + +} diff --git a/admin/symbols/manager.php b/admin/symbols/manager.php new file mode 100644 index 0000000000..382fd930a9 --- /dev/null +++ b/admin/symbols/manager.php @@ -0,0 +1,118 @@ +getUid()) || empty($symbol->getUid())) { + throw new Exception('Please provide the symbol uid'); + } + + if (is_null($symbol->getVersion()) || empty($symbol->getVersion())) { + throw new Exception('Please provide the symbol version'); + } + + $currentSymbol = $this->get($symbol->getUid()); + + if ($currentSymbol && ($currentSymbol->getVersion() + 1 != $symbol->getVersion())) { + throw new Exception('Invalid symbol version. Please refresh and try again.'); + } + + if ( is_null($symbol->getLabel()) || empty($symbol->getLabel())) { + throw new Exception('Please provide the symbol label'); + } + + if ( is_null($symbol->getData()) || empty($symbol->getData())) { + throw new Exception('Please provide the symbol data'); + } + + } + +} diff --git a/admin/symbols/symbol.php b/admin/symbols/symbol.php new file mode 100644 index 0000000000..4e1dc8c770 --- /dev/null +++ b/admin/symbols/symbol.php @@ -0,0 +1,161 @@ +setUid($uid); + $this->setLabel($label); + $this->setData($data); + $this->setVersion($version); + } + + /** + * @return mixed + */ + public function getUid() + { + return $this->uid; + } + + /** + * @param mixed $uid + */ + public function setUid($uid) + { + $this->uid = $uid; + } + + /** + * @return mixed + */ + public function getLabel() + { + return $this->label; + } + + /** + * @param mixed $label + */ + public function setLabel($label) + { + $this->label = $label; + } + + /** + * @return int + */ + public function getVersion() + { + return $this->version; + } + + /** + * @param int $version + */ + public function setVersion($version) + { + $this->version = $version; + } + + /** + * @return mixed + */ + public function getData() + { + return $this->data; + } + + /** + * @param mixed $data + */ + public function setData($data) + { + $this->data = $data; + } + + /** + * @param $data + * + * @return Brizy_Admin_Symbols_Symbol + * @throws Exception + */ + static public function createFromSerializedData($data) + { + + if (is_null($data)) { + throw new Exception('Invalid parameter provided'); + } + + return new self( + isset($data['uid']) ? $data['uid'] : null, + isset($data['label']) && ! empty($data['label']) ? $data['label'] : null, + isset($data['data']) && ! empty($data['data']) ? $data['data'] : null, + isset($data['version']) ? $data['version'] : null + ); + } + + + /** + * @param $json + * + * @return Brizy_Admin_Symbols_Symbol + * @throws Exception + */ + static public function createFromJsonObject($json) + { + if (is_null($json)) { + throw new Exception('Invalid parameter provided'); + } + + return new self( + isset($json->uid) ? $json->uid : null, + isset($json->label) ? $json->label : null, + isset($json->data) ? $json->data : null, + isset($json->version) ? $json->version : null + ); + } + + + /** + * @param Brizy_Admin_Symbols_Symbol $patch + * + * @return void + */ + public function patchFrom($patch) + { + if ( ! is_null($patch->getData()) && ! empty($patch->getData())) { + $this->setData($patch->getData()); + } + if ( ! is_null($patch->getLabel()) && ! empty($patch->getLabel())) { + $this->setLabel($patch->getLabel()); + } + if ( ! is_null($patch->getVersion()) && ! empty($patch->getVersion())) { + $this->setVersion($patch->getVersion()); + } + } + + public function incrementVersion() { + $this->setVersion($this->getVersion()+1); + } + + public function convertToOptionValue() + { + return array( + 'uid' => $this->getUid(), + 'label' => $this->getLabel(), + 'data' => $this->getData(), + 'version' => $this->getVersion(), + ); + } + + +} diff --git a/editor/editor/editor.php b/editor/editor/editor.php index 6f99fcae4a..79e118a7dd 100755 --- a/editor/editor/editor.php +++ b/editor/editor/editor.php @@ -1,1168 +1,1209 @@ getWpPostId() ? $post->getWpPostId() : 0; - if ( isset( self::$insance[ $postId ] ) ) { - return self::$insance[ $postId ]; - } - - return self::$insance[ $postId ] = new self( $project, $post ); - } - - /** - * Brizy_Editor_Editor_Editor constructor. - * - * @param Brizy_Editor_Project $project - * @param Brizy_Editor_Post $post - */ - public function __construct( Brizy_Editor_Project $project, Brizy_Editor_Post $post = null ) { - $this->post = $post; - $this->project = $project; - $this->urlBuilder = new Brizy_Editor_UrlBuilder( $project, $post ? $post->getWpPostId() : null ); - } - - private function getMode( $postType ) { - switch ( $postType ) { - case Brizy_Admin_Stories_Main::CP_STORY: - return 'internal_story'; - case Brizy_Admin_Templates::CP_TEMPLATE: - return 'template'; - case Brizy_Admin_Popups_Main::CP_POPUP: - return 'internal_popup'; - case 'product': - case 'product_variation': - return 'product'; - default: - return 'page'; - } - } - - /** - * @throws Exception - */ - public function config( $context = self::COMPILE_CONTEXT ) { - do_action( 'brizy_create_editor_config_before' ); - - $cachePostId = ( $this->post ? $this->post->getWpPostId() : 0 ) . '_' . $context; - if ( isset( self::$config[ $cachePostId ] ) ) { - return self::$config[ $cachePostId ]; - } - - global $wp_registered_sidebars; - - $parent_post_type = get_post_type( $this->post->getWpPostId() ); - $wp_post_id = $this->post->getWpPostId(); - $preview_post_link = $this->getPreviewUrl( $this->post->getWpPost() ); - - $change_template_url = set_url_scheme( - admin_url( 'admin-post.php?post=' . $this->post->getWpPostId() . '&action=_brizy_change_template' ) - ); - $mode = $this->getMode( $parent_post_type ); - - $heartBeatInterval = (int) apply_filters( 'wp_check_post_lock_window', 150 ); - $config = array( - 'user' => array( - 'role' => 'admin', - 'isAuthorized' => $this->project->getMetaValue( 'brizy-cloud-token' ) !== null, - 'allowScripts' => $this->isUserAllowedToAddScripts( $context ) - ), - 'project' => array( - 'id' => $this->project->getId(), - 'status' => $this->getProjectStatus(), - 'heartBeatInterval' => ( $heartBeatInterval > 10 && $heartBeatInterval < 30 ? $heartBeatInterval : 30 ) * 1000, - ), - 'urls' => array( - 'site' => home_url(), - 'api' => home_url( '/wp-json/v1' ), - 'assets' => $context == self::COMPILE_CONTEXT ? Brizy_Config::EDITOR_BUILD_RELATIVE_PATH : $this->urlBuilder->editor_build_url(), - 'image' => $this->urlBuilder->external_media_url() . "", - 'blockThumbnails' => $this->urlBuilder->external_asset_url( 'thumbs' ) . "", - 'templateThumbnails' => $this->urlBuilder->external_asset_url( 'thumbs' ) . "", - 'templateIcons' => $this->urlBuilder->proxy_url( 'editor/icons' ), - 'templateFonts' => $this->urlBuilder->external_fonts_url(), - 'editorFonts' => home_url( '/' ), - 'pagePreview' => $preview_post_link, - 'about' => __bt( 'about-url', apply_filters( 'brizy_about_url', Brizy_Config::ABOUT_URL ) ), - 'backToDashboard' => get_edit_post_link( $wp_post_id, null ), - 'assetsExternal' => $this->urlBuilder->external_asset_url() . "", - - // wp specific - 'changeTemplate' => $change_template_url, - 'upgradeToPro' => - apply_filters( 'brizy_upgrade_to_pro_url', Brizy_Config::UPGRADE_TO_PRO_URL ), - - 'support' => - Brizy_Config::getSupportUrl(), - 'pluginSettings' => admin_url( 'admin.php?page=' . Brizy_Admin_Settings::menu_slug() ), - 'dashboardNavMenu' => admin_url( 'nav-menus.php' ), - 'customFile' => home_url( '?' . Brizy_Editor::prefix( '_attachment' ) . '=' ), - ), - 'form' => array( - 'submitUrl' => '{{brizy_dc_ajax_url}}?action=' . Brizy_Editor::prefix( - Brizy_Editor_Forms_Api::AJAX_SUBMIT_FORM - ), - ), - 'serverTimestamp' => time(), - 'menuData' => $this->get_menu_data(), - 'wp' => array( - 'pluginPrefix' => Brizy_Editor::prefix(), - 'permalink' => get_permalink( $wp_post_id ), - 'page' => $wp_post_id, - 'postType' => get_post_type( $wp_post_id ), - 'featuredImage' => $this->getThumbnailData( $wp_post_id ), - 'templates' => $this->post->get_templates(), - - 'plugins' => array( - 'dummy' => true, +class Brizy_Editor_Editor_Editor +{ + + const COMPILE_CONTEXT = 'compile'; + const EDITOR_CONTEXT = 'editor'; + + /** + * @var self + */ + static private $insance; + + /** + * @var array + */ + static private $config; + + /** + * @var Brizy_Editor_Post + */ + private $post; + + /** + * @var Brizy_Editor_Project + */ + private $project; + + /** + * @var Brizy_Editor_UrlBuilder + */ + private $urlBuilder; + + /** + * @param Brizy_Editor_Project $project + * @param Brizy_Editor_Post $post + * + * @return Brizy_Editor_Editor_Editor + */ + public static function get(Brizy_Editor_Project $project, Brizy_Editor_Post $post) + { + + $postId = $post && $post->getWpPostId() ? $post->getWpPostId() : 0; + if (isset(self::$insance[$postId])) { + return self::$insance[$postId]; + } + + return self::$insance[$postId] = new self($project, $post); + } + + /** + * Brizy_Editor_Editor_Editor constructor. + * + * @param Brizy_Editor_Project $project + * @param Brizy_Editor_Post $post + */ + public function __construct(Brizy_Editor_Project $project, Brizy_Editor_Post $post = null) + { + $this->post = $post; + $this->project = $project; + $this->urlBuilder = new Brizy_Editor_UrlBuilder($project, $post ? $post->getWpPostId() : null); + } + + private function getMode($postType) + { + switch ($postType) { + case Brizy_Admin_Stories_Main::CP_STORY: + return 'internal_story'; + case Brizy_Admin_Templates::CP_TEMPLATE: + return 'template'; + case Brizy_Admin_Popups_Main::CP_POPUP: + return 'internal_popup'; + case 'product': + case 'product_variation': + return 'product'; + default: + return 'page'; + } + } + + /** + * @throws Exception + */ + public function config($context = self::COMPILE_CONTEXT) + { + do_action('brizy_create_editor_config_before'); + + $cachePostId = ($this->post ? $this->post->getWpPostId() : 0).'_'.$context; + if (isset(self::$config[$cachePostId])) { + return self::$config[$cachePostId]; + } + + global $wp_registered_sidebars; + + $parent_post_type = get_post_type($this->post->getWpPostId()); + $wp_post_id = $this->post->getWpPostId(); + $preview_post_link = $this->getPreviewUrl($this->post->getWpPost()); + + $change_template_url = set_url_scheme( + admin_url('admin-post.php?post='.$this->post->getWpPostId().'&action=_brizy_change_template') + ); + $mode = $this->getMode($parent_post_type); + + $heartBeatInterval = (int)apply_filters('wp_check_post_lock_window', 150); + $config = array( + 'user' => array( + 'role' => 'admin', + 'isAuthorized' => $this->project->getMetaValue('brizy-cloud-token') !== null, + 'allowScripts' => $this->isUserAllowedToAddScripts($context), + ), + 'project' => array( + 'id' => $this->project->getId(), + 'status' => $this->getProjectStatus(), + 'heartBeatInterval' => ($heartBeatInterval > 10 && $heartBeatInterval < 30 ? $heartBeatInterval : 30) * 1000, + ), + 'urls' => array( + 'site' => home_url(), + 'api' => home_url('/wp-json/v1'), + 'assets' => $context == self::COMPILE_CONTEXT ? Brizy_Config::EDITOR_BUILD_RELATIVE_PATH : $this->urlBuilder->editor_build_url( + ), + 'image' => $this->urlBuilder->external_media_url()."", + 'blockThumbnails' => $this->urlBuilder->external_asset_url('thumbs')."", + 'templateThumbnails' => $this->urlBuilder->external_asset_url('thumbs')."", + 'templateIcons' => $this->urlBuilder->proxy_url('editor/icons'), + 'templateFonts' => $this->urlBuilder->external_fonts_url(), + 'editorFonts' => home_url('/'), + 'pagePreview' => $preview_post_link, + 'about' => __bt('about-url', apply_filters('brizy_about_url', Brizy_Config::ABOUT_URL)), + 'backToDashboard' => get_edit_post_link($wp_post_id, null), + 'assetsExternal' => $this->urlBuilder->external_asset_url()."", + + // wp specific + 'changeTemplate' => $change_template_url, + 'upgradeToPro' => + apply_filters('brizy_upgrade_to_pro_url', Brizy_Config::UPGRADE_TO_PRO_URL), + + 'support' => + Brizy_Config::getSupportUrl(), + 'pluginSettings' => admin_url('admin.php?page='.Brizy_Admin_Settings::menu_slug()), + 'dashboardNavMenu' => admin_url('nav-menus.php'), + 'customFile' => home_url('?'.Brizy_Editor::prefix('_attachment').'='), + ), + 'form' => array( + 'submitUrl' => '{{brizy_dc_ajax_url}}?action='.Brizy_Editor::prefix( + Brizy_Editor_Forms_Api::AJAX_SUBMIT_FORM + ), + ), + 'serverTimestamp' => time(), + 'menuData' => $this->get_menu_data(), + 'wp' => array( + 'pluginPrefix' => Brizy_Editor::prefix(), + 'permalink' => get_permalink($wp_post_id), + 'page' => $wp_post_id, + 'postType' => get_post_type($wp_post_id), + 'featuredImage' => $this->getThumbnailData($wp_post_id), + 'templates' => $this->post->get_templates(), + + 'plugins' => array( + 'dummy' => true, 'woocommerce' => self::get_woocomerce_plugin_info(), ), - 'hasSidebars' => count($wp_registered_sidebars) > 0, - 'l10n' => $this->getTexts(), - 'pageData' => apply_filters('brizy_page_data', array()), - 'availableRoles' => Brizy_Admin_Membership_Membership::roleList(), + 'hasSidebars' => count($wp_registered_sidebars) > 0, + 'l10n' => $this->getTexts(), + 'pageData' => apply_filters('brizy_page_data', array()), + 'availableRoles' => Brizy_Admin_Membership_Membership::roleList(), 'usersCanRegister' => get_option('users_can_register'), ), - 'mode' => $mode, - 'applications' => array( + 'mode' => $mode, + 'applications' => array( 'form' => array( - 'submitUrl' => '{{brizy_dc_ajax_url}}?action=' . Brizy_Editor::prefix( + 'submitUrl' => '{{brizy_dc_ajax_url}}?action='.Brizy_Editor::prefix( Brizy_Editor_Forms_Api::AJAX_SUBMIT_FORM ), ), ), - 'server' => array( + 'server' => array( 'maxUploadFileSize' => $this->fileUploadMaxSize(), ), - 'branding' => array('name' => __bt('brizy', 'Brizy')), - 'prefix' => Brizy_Editor::prefix(), - 'cloud' => $this->getCloudInfo(), - 'editorVersion' => BRIZY_EDITOR_VERSION, - 'imageSizes' => $this->getImgSizes() - ); - $manager = new Brizy_Editor_Accounts_ServiceAccountManager( Brizy_Editor_Project::get() ); - - $config = $this->addRecaptchaAccounts( $manager, $config, $context ); - $config = $this->addSocialAccounts( $manager, $config, $context ); - $config = $this->addWpPostTypes( $config, $context ); - $config = $this->addTemplateFields( $config, $mode === 'template', $wp_post_id, $context ); - $config = $this->getApiActions( $config, $context ); - $config = $this->addGlobalBlocksData( $config ); - $config = $this->addGlobalBlocksData( $config ); - $config = $this->getPostLoopSources( $config,$mode === 'template', $wp_post_id, $context ); - - self::$config[ $cachePostId ] = apply_filters( 'brizy_editor_config', $config, $context ); - - do_action( 'brizy_create_editor_config_after' ); - - return self::$config[ $cachePostId ]; - } - - /** - * @param $config - * - * @return string[]|WP_Post_Type[] - */ - private function addWpPostTypes( $config, $context ) { - $excludePostTypes = [ 'attachment' ]; - - $types = get_post_types( [ 'public' => true ] ); - $result = []; - foreach ( $types as $type ) { - if ( in_array( $type, $excludePostTypes ) ) { - continue; - } - $typeObj = get_post_type_object( $type ); - $typeDto = [ - 'name' => $typeObj->name, - 'label' => $typeObj->label, - ]; - $result[] = $typeDto; - - } - - $config['wp']['postTypes'] = $result; - - return $config; - } - - - private function getPostLoopSources($config, $isTemplate, $wp_post_id, $context ) { - $excludePostTypes = [ 'attachment' ]; - - $types = get_post_types( [ 'public' => true ] ); - $result = []; - - $templateTypeArchive = false; - if( $isTemplate ) { - $template_type = Brizy_Admin_Templates::getTemplateType( $wp_post_id ); - if($template_type==Brizy_Admin_Templates::TYPE_ARCHIVE || $template_type==Brizy_Admin_Templates::TYPE_PRODUCT_ARCHIVE ) { - $templateTypeArchive = true; - } - } - - if ( $templateTypeArchive) { - $result[] = [ - "name" => "brz_current_context", - "label" => "Current Query" - ]; - } - - foreach ( $types as $type ) { - if ( in_array( $type, $excludePostTypes ) ) { - continue; - } - $typeObj = get_post_type_object( $type ); - $typeDto = [ - 'name' => $typeObj->name, - 'label' => $typeObj->label, - ]; - $result[] = $typeDto; - - } - - $config['wp']['postLoopSources'] = $result; - - return $config; - } - - private function addGlobalBlocksData( $config ) { - - $postTaxonomies = get_post_taxonomies( $wp_post_id = (int) $config['wp']['page'] ); - $postTerms = []; - foreach ( $postTaxonomies as $tax ) { - $postTerms = array_merge( $postTerms, wp_get_post_terms( $wp_post_id, $tax ) ); - } - - $postTermsByKeys = []; - foreach ( $postTerms as $term ) { - $postTermsByKeys[ $term->term_id ] = $term; - } - - $config['wp']['postTerms'] = $postTerms; - $config['wp']['postTermParents'] = array_diff_key( $this->getAllParents( $postTermsByKeys ), $postTermsByKeys ); - $config['wp']['postAuthor'] = (int) $this->post->getWpPost()->post_author; - - return $config; - } - - /** - * @return object - */ - private function get_page_attachments() { - global $wpdb; - $query = $wpdb->prepare( - "SELECT + 'branding' => array('name' => __bt('brizy', 'Brizy')), + 'prefix' => Brizy_Editor::prefix(), + 'cloud' => $this->getCloudInfo(), + 'editorVersion' => BRIZY_EDITOR_VERSION, + 'imageSizes' => $this->getImgSizes(), + ); + $manager = new Brizy_Editor_Accounts_ServiceAccountManager(Brizy_Editor_Project::get()); + + $config = $this->addRecaptchaAccounts($manager, $config, $context); + $config = $this->addSocialAccounts($manager, $config, $context); + $config = $this->addWpPostTypes($config, $context); + $config = $this->addTemplateFields($config, $mode === 'template', $wp_post_id, $context); + $config = $this->getApiActions($config, $context); + $config = $this->addGlobalBlocksData($config); + $config = $this->addGlobalBlocksData($config); + $config = $this->getPostLoopSources($config, $mode === 'template', $wp_post_id, $context); + + self::$config[$cachePostId] = apply_filters('brizy_editor_config', $config, $context); + + do_action('brizy_create_editor_config_after'); + + return self::$config[$cachePostId]; + } + + /** + * @param $config + * + * @return string[]|WP_Post_Type[] + */ + private function addWpPostTypes($config, $context) + { + $excludePostTypes = ['attachment']; + + $types = get_post_types(['public' => true]); + $result = []; + foreach ($types as $type) { + if (in_array($type, $excludePostTypes)) { + continue; + } + $typeObj = get_post_type_object($type); + $typeDto = [ + 'name' => $typeObj->name, + 'label' => $typeObj->label, + ]; + $result[] = $typeDto; + + } + + $config['wp']['postTypes'] = $result; + + return $config; + } + + + private function getPostLoopSources($config, $isTemplate, $wp_post_id, $context) + { + $excludePostTypes = ['attachment']; + + $types = get_post_types(['public' => true]); + $result = []; + + $templateTypeArchive = false; + if ($isTemplate) { + $template_type = Brizy_Admin_Templates::getTemplateType($wp_post_id); + if ($template_type == Brizy_Admin_Templates::TYPE_ARCHIVE || $template_type == Brizy_Admin_Templates::TYPE_PRODUCT_ARCHIVE) { + $templateTypeArchive = true; + } + } + + if ($templateTypeArchive) { + $result[] = [ + "name" => "brz_current_context", + "label" => "Current Query", + ]; + } + + foreach ($types as $type) { + if (in_array($type, $excludePostTypes)) { + continue; + } + $typeObj = get_post_type_object($type); + $typeDto = [ + 'name' => $typeObj->name, + 'label' => $typeObj->label, + ]; + $result[] = $typeDto; + + } + + $config['wp']['postLoopSources'] = $result; + + return $config; + } + + private function addGlobalBlocksData($config) + { + + $postTaxonomies = get_post_taxonomies($wp_post_id = (int)$config['wp']['page']); + $postTerms = []; + foreach ($postTaxonomies as $tax) { + $postTerms = array_merge($postTerms, wp_get_post_terms($wp_post_id, $tax)); + } + + $postTermsByKeys = []; + foreach ($postTerms as $term) { + $postTermsByKeys[$term->term_id] = $term; + } + + $config['wp']['postTerms'] = $postTerms; + $config['wp']['postTermParents'] = array_diff_key($this->getAllParents($postTermsByKeys), $postTermsByKeys); + $config['wp']['postAuthor'] = (int)$this->post->getWpPost()->post_author; + + return $config; + } + + /** + * @return object + */ + private function get_page_attachments() + { + global $wpdb; + $query = $wpdb->prepare( + "SELECT pm.* FROM {$wpdb->prefix}postmeta pm JOIN {$wpdb->prefix}postmeta pm2 ON pm2.post_id=pm.post_id AND pm2.meta_key='brizy_post_uid' AND pm2.meta_value=%s WHERE pm.meta_key='brizy_attachment_uid' GROUP BY pm.post_id", - $this->post->getUid() - ); - - $results = $wpdb->get_results( $query ); - $attachment_data = array(); - foreach ( $results as $row ) { - $attachment_data[ $row->meta_value ] = true; - } - - return (object) $attachment_data; - } - - /** - * @return array|null - */ - public static function get_woocomerce_plugin_info() { - if ( function_exists( 'wc' ) && defined( 'WC_PLUGIN_FILE' ) ) { - return array( 'version' => WooCommerce::instance()->version ); - } - - return null; - } - - /** - * @param $wp_post_id - * - * @return array|null - */ - private function getThumbnailData( $wp_post_id ) { - $post_thumbnail_id = get_post_thumbnail_id( $wp_post_id ); - $post_thumbnail = ""; - - if ( $post_thumbnail_id ) { - $post_thumbnail_focal_point = get_post_meta( $wp_post_id, 'brizy_attachment_focal_point', true ); - - if ( ! is_array( $post_thumbnail_focal_point ) ) { - $post_thumbnail_focal_point = array( 'x' => "", 'y' => "" ); - } - - $post_thumbnail = array( - 'id' => $post_thumbnail_id, - 'url' => get_the_post_thumbnail_url( $wp_post_id ), - 'pointX' => isset( $post_thumbnail_focal_point['x'] ) ? $post_thumbnail_focal_point['x'] : "", - 'pointY' => isset( $post_thumbnail_focal_point['y'] ) ? $post_thumbnail_focal_point['y'] : "", - ); - } - - return $post_thumbnail; - } - - private function getAllParents( $terms ) { - $result = []; - foreach ( $terms as $i => $term ) { - foreach ( $this->getTermParents( $term ) as $aTerm ) { - if ( ! isset( $result[ $aTerm->term_id ] ) ) { - $result[ $aTerm->term_id ] = $aTerm; - } - } - } - - return $result; - } - - private function getTermParents( $term ) { - $parents = []; - if ( $term->parent ) { - $parent = get_term_by( 'id', $term->parent, $term->taxonomy ); - - if ( $parent ) { - $parents[ $parent->term_id ] = $parent; - if ( $parent->parent > 0 ) { - $parents = array_merge( $parents, $this->getTermParents( $parent ) ); - } - } - } - - return $parents; - } - - /** - * @param $wp_post - * - * @return null|string - * @throws Brizy_Editor_Exceptions_NotFound - * @throws Brizy_Editor_Exceptions_UnsupportedPostType - */ - private function getPreviewUrl( $wp_post ) { - - if ( $wp_post->post_type == Brizy_Admin_Templates::CP_TEMPLATE ) { - - $ruleManager = new Brizy_Admin_Rules_Manager(); - $rules = $ruleManager->getRules( $wp_post->ID ); - $rule = null; - - - if ( ! function_exists( 'addQueryStringToUrl' ) ) { - function addQueryStringToUrl( $link, $query ) { - $parsedUrl = parse_url( $link ); - $separator = ( ! isset( $parsedUrl['query'] ) || $parsedUrl['query'] == null ) ? '?' : '&'; - $link .= $separator . $query; - - return $link; - } - } - - - // find first include rule - foreach ( $rules as $rule ) { - /** - * @var Brizy_Admin_Rule $rule ; - */ - if ( $rule->getType() == Brizy_Admin_Rule::TYPE_INCLUDE ) { - break; - } - } - - if ( $rule ) { - - switch ( $rule->getAppliedFor() ) { - case Brizy_Admin_Rule::WOO_SHOP_PAGE: - if ( function_exists( 'wc_get_page_id' ) && wc_get_page_id( 'shop' ) ) { - $wp_post = get_post( wc_get_page_id( 'shop' ) ); - } - break; - case Brizy_Admin_Rule::POSTS : - $args = array( - 'post_type' => $rule->getEntityType(), - ); - - if ( count( $rule->getEntityValues() ) ) { - $args['post__in'] = $rule->getEntityValues(); - } - - $array = get_posts( $args ); - - foreach ( $array as $p ) { - - if ( $p->post_type == 'attachment' ) { - return addQueryStringToUrl( get_attachment_link( $p->ID ), 'preview=1' ); - } - - if ( ! Brizy_Editor::checkIfPostTypeIsSupported( $p->ID, false ) || - ! Brizy_Editor_Entity::isBrizyEnabled( $p->ID ) ) { - $wp_post = $p; - break; - } - - } - break; - case Brizy_Admin_Rule::TAXONOMY : - $args = array( - 'taxonomy' => $rule->getEntityType(), - 'hide_empty' => true, - ); - if ( count( $rule->getEntityValues() ) ) { - $args['term_taxonomy_id'] = $rule->getEntityValues(); - } - - $array = get_terms( $args ); - - if ( count( $array ) == 0 ) { - break; - } - $term = array_pop( $array ); - $link = get_term_link( $term ); - - return addQueryStringToUrl( $link, 'preview=1' ); - break; - case Brizy_Admin_Rule::ARCHIVE : - if ( $rule->getEntityType() ) { - $link = get_post_type_archive_link( $rule->getEntityType() ); - - return addQueryStringToUrl( $link, 'preview=1' ); - } - - $link = $this->getOneArchiveLink(); - - return addQueryStringToUrl( $link, 'preview=1' ); - break; - case Brizy_Admin_Rule::TEMPLATE : - - // array( 'title' => 'Author page', 'value' => 'author', 'groupValue' => Brizy_Admin_Rule::TEMPLATE ), - // array( 'title' => 'Search page', 'value' => 'search', 'groupValue' => Brizy_Admin_Rule::TEMPLATE ), - // array( 'title' => 'Home page', 'value' => 'front_page', 'groupValue' => Brizy_Admin_Rule::TEMPLATE ), - // array( 'title' => '404 page', 'value' => '404', 'groupValue' => Brizy_Admin_Rule::TEMPLATE ), - // array( 'title' => 'Archive page', 'value' => '', 'groupValue' => Brizy_Admin_Rule::ARCHIVE ), - switch ( $rule->getEntityType() ) { - case 'author': - $authors = get_users(); - $author = array_pop( $authors ); - $link = get_author_posts_url( $author->ID ); - - return addQueryStringToUrl( $link, 'preview=1' ); - break; - - case 'search': - return addQueryStringToUrl( get_search_link( 'find-me' ), 'preview=1' ); - break; - case '404': - return addQueryStringToUrl( get_home_url( null, (string) time() ), 'preview=1' ); - break; - case 'home_page': - $get_option = get_option( 'page_for_posts' ); - - if ( $get_option ) { - return addQueryStringToUrl( get_permalink( $get_option ), 'preview=1' ); - } - break; - case 'front_page': - return addQueryStringToUrl( home_url(), 'preview=1' ); - break; - } - - break; - } - - } - } - - return get_preview_post_link( - $wp_post, - array( - 'preview_id' => $wp_post->ID, - 'preview_nonce' => wp_create_nonce( 'post_preview_' . $wp_post->ID ), - ) - ); - } - - /** - * @return array - */ - private function get_menu_data() { - $menus = wp_get_nav_menus(); - $menu_data = array(); - - foreach ( $menus as $menu ) { - - $custom_menu_data = get_term_meta( $menu->term_id, 'brizy_data', true ); - - $menu_uid = get_term_meta( $menu->term_id, 'brizy_uid', true ); - if ( ! $menu_uid ) { - $menu_uid = md5( $menu->term_id . time() ); - update_term_meta( $menu->term_id, 'brizy_uid', $menu_uid ); - } - - $amenu = array( - 'id' => $menu_uid, - 'name' => $menu->name, - 'items' => array(), - ); - - $amenu = (object) array_merge( - $amenu, - get_object_vars( is_object( $custom_menu_data ) ? $custom_menu_data : (object) array() ) - ); - - $menuItems = []; - - add_action( 'wp_get_nav_menu_items', function ( $items ) use ( &$menuItems ) { - foreach ( $items as $item ) { - $menuItems[ $item->ID ] = $item; - } - - return $items; - }, - 1000 ); - - $currentItems = wp_get_nav_menu_items( $menu->term_id ); - - _wp_menu_item_classes_by_context( $menuItems ); - - $currentItemsAssociative = []; - foreach ( $currentItems as $currentItem ) { - $currentItemsAssociative[ $currentItem->ID ] = $currentItem; - } - - $menuItems = $currentItemsAssociative + $menuItems; - - $menu_items = $this->get_menu_tree( $menuItems ); - - if ( count( $menu_items ) > 0 ) { - $amenu->items = $menu_items; - } - - $menu_data[] = $amenu; - } - - return apply_filters( 'brizy_menu_data', $menu_data ); - } - - /** - * @param $items - * @param int $parent - * - * @return array - */ - private function get_menu_tree( $items, $parent = 0 ) { - $result_items = array(); - - foreach ( $items as $item ) { - if ( (string) $item->menu_item_parent !== (string) $parent ) { - continue; - } - - $menu_uid = get_post_meta( $item->ID, 'brizy_post_uid', true ); - - if ( ! $menu_uid ) { - $menu_uid = md5( $item->ID . time() ); - $update = update_post_meta( $item->ID, 'brizy_post_uid', $menu_uid ); - - if ( ! $update ) { - $menu_uid = $item->ID; - } - } - - $megaMenuItems = $this->getMegaMenuItems(); - - $menu_data = get_post_meta( $item->ID, 'brizy_data', true ); - - $item_value = array( - 'id' => $menu_uid, - 'title' => $item->title, - 'url' => $item->url, - 'megaMenuItems' => $megaMenuItems, - 'description' => $item->post_content, - 'position' => $item->menu_order, - 'attrTitle' => $item->post_excerpt, - 'current' => count( - array_intersect( - [ - 'current-menu-parent', - 'current-menu-item', - ], - $item->classes - ) - ) > 0, - 'target' => get_post_meta( $item->ID, '_menu_item_target', true ), - 'classes' => array_values( array_filter( $item->classes ) ), - 'xfn' => get_post_meta( $item->ID, '_menu_item_xfn', true ), - ); - - $an_item = (object) array( - 'type' => 'MenuItem', - ); - - $an_item->value = (object) array_merge( - $item_value, - get_object_vars( is_object( $menu_data ) ? $menu_data : (object) array() ) - ); - - $child_items = $this->get_menu_tree( $items, $item->ID ); - - $an_item->value->items = array(); - - if ( count( $child_items ) > 0 ) { - $an_item->value->items = $child_items; - } - - $result_items[] = $an_item; - } - - return $result_items; - } - - /** - * @return array - */ - private function getMegaMenuItems() { - - return array( - (object) ( array( - 'type' => "SectionMegaMenu", - 'value' => (object) array( 'items' => array() ), - ) ), - ); - } - - /** - * @param Brizy_Editor_Accounts_ServiceAccountManager $manager - * @param array $config - * - * @return array - */ - private function addRecaptchaAccounts( Brizy_Editor_Accounts_ServiceAccountManager $manager, array $config, $context ) { - $accounts = $manager->getAccountsByGroup( Brizy_Editor_Accounts_AbstractAccount::RECAPTCHA_GROUP ); - - if ( isset( $accounts[0] ) && $accounts[0] instanceof Brizy_Editor_Accounts_RecaptchaAccount ) { - $config['applications']['form']['recaptcha']['siteKey'] = $accounts[0]->getSiteKey(); - } - - return $config; - } - - /** - * @param Brizy_Editor_Accounts_ServiceAccountManager $manager - * @param array $config - * - * @return array - */ - private function addSocialAccounts( Brizy_Editor_Accounts_ServiceAccountManager $manager, array $config, $context ) { - $accounts = $manager->getAccountsByGroup( Brizy_Editor_Accounts_AbstractAccount::SOCIAL_GROUP ); - - foreach ( $accounts as $account ) { - if ( isset( $account ) && $account instanceof Brizy_Editor_Accounts_SocialAccount ) { - $config['applications'][ $account->getGroup() ][] = $account->convertToOptionValue(); - } - } - - return $config; - } - - - private function fileUploadMaxSize() { - static $max_size = - 1; - - if ( $max_size < 0 ) { - // Start with post_max_size. - $post_max_size = $this->parseSize( ini_get( 'post_max_size' ) ); - if ( $post_max_size > 0 ) { - $max_size = number_format( $post_max_size / 1048576, 2, '.', '' ); - } - - // If upload_max_size is less, then reduce. Except if upload_max_size is - // zero, which indicates no limit. - $upload_max = $this->parseSize( ini_get( 'upload_max_filesize' ) ); - if ( $upload_max > 0 && $upload_max < $max_size ) { - $max_size = number_format( $upload_max / 1048576, 2, '.', '' ); - } - } - - return $max_size; - } - - private function parseSize( $size ) { - $unit = preg_replace( '/[^bkmgtpezy]/i', '', $size ); // Remove the non-unit characters from the size. - $size = preg_replace( '/[^0-9\.]/', '', $size ); // Remove the non-numeric characters from the size. - if ( $unit ) { - // Find the position of the unit in the ordered string which is the power of magnitude to multiply a kilobyte by. - return round( $size * pow( 1024, stripos( 'bkmgtpezy', $unit[0] ) ) ); - } else { - return round( $size ); - } - } - - - private function getOneArchiveLink( $args = '' ) { - global $wpdb, $wp_locale; - - $defaults = array( - 'type' => 'monthly', - 'limit' => '', - 'order' => 'DESC', - 'post_type' => 'post', - 'year' => get_query_var( 'year' ), - 'monthnum' => get_query_var( 'monthnum' ), - 'day' => get_query_var( 'day' ), - 'w' => get_query_var( 'w' ), - ); - - $r = wp_parse_args( $args, $defaults ); - - $post_type_object = get_post_type_object( $r['post_type'] ); - if ( ! is_post_type_viewable( $post_type_object ) ) { - return; - } - $r['post_type'] = $post_type_object->name; - - if ( '' == $r['type'] ) { - $r['type'] = 'monthly'; - } - - if ( ! empty( $r['limit'] ) ) { - $r['limit'] = absint( $r['limit'] ); - $r['limit'] = ' LIMIT ' . $r['limit']; - } - - $order = strtoupper( $r['order'] ); - if ( $order !== 'ASC' ) { - $order = 'DESC'; - } - - // this is what will separate dates on weekly archive links - $archive_week_separator = '–'; - - $sql_where = $wpdb->prepare( "WHERE post_type = %s AND post_status = 'publish'", $r['post_type'] ); - - /** - * Filters the SQL WHERE clause for retrieving archives. - * - * @param string $sql_where Portion of SQL query containing the WHERE clause. - * @param array $r An array of default arguments. - * - * @since 2.2.0 - * - */ - $where = apply_filters( 'getarchives_where', $sql_where, $r ); - - /** - * Filters the SQL JOIN clause for retrieving archives. - * - * @param string $sql_join Portion of SQL query containing JOIN clause. - * @param array $r An array of default arguments. - * - * @since 2.2.0 - * - */ - $join = apply_filters( 'getarchives_join', '', $r ); - - $output = ''; - - $last_changed = wp_cache_get_last_changed( 'posts' ); - - $limit = $r['limit']; - - if ( 'monthly' == $r['type'] ) { - $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date $order $limit"; - $key = md5( $query ); - $key = "wp_get_archives:$key:$last_changed"; - if ( ! $results = wp_cache_get( $key, 'posts' ) ) { - $results = $wpdb->get_results( $query ); - wp_cache_set( $key, $results, 'posts' ); - } - if ( $results ) { - foreach ( (array) $results as $result ) { - $url = get_month_link( $result->year, $result->month ); - if ( 'post' !== $r['post_type'] ) { - $url = add_query_arg( 'post_type', $r['post_type'], $url ); - } - - return $url; - } - } - } - } - - /** - * @return string - * @throws Exception - */ - private function getTexts() { - if ( BRIZY_DEVELOPMENT ) { - $brizy_public_editor_build_texts = '\Brizy_Public_EditorBuild_Dev_Texts'; - } else { - $version = ''; - foreach ( explode( '-', BRIZY_EDITOR_VERSION ) as $tmp ) { - $version .= ucfirst( $tmp ); - } - $brizy_public_editor_build_texts = '\Brizy_Public_EditorBuild_' . $version . '_Texts'; - } - - if ( ! class_exists( $brizy_public_editor_build_texts ) ) { - if ( BRIZY_DEVELOPMENT ) { - throw new \Exception( 'You must build the editor first.' ); - } else { - throw new \Exception( 'Unable to find class ' . $brizy_public_editor_build_texts ); - } - } - - return (object) $brizy_public_editor_build_texts::get_editor_texts(); - } - - private function addTemplateFields( $config, $is_template, $wp_post_id, $context ) { - - $template_rules = []; - if ( $is_template ) { - $rule_manager = new Brizy_Admin_Rules_Manager(); - $template_rules = $rule_manager->getRules( $wp_post_id ); - $config['template_type'] = $this->getTemplateType( $template_rules ); - } - - $config['wp']['ruleMatches'] = $this->getTemplateRuleMatches( $is_template, $wp_post_id, $template_rules ); - - return $config; - } - - /** - * @param $isTemplate - * @param $wpPostId - * @param $templateRules - * - * @return array - */ - private function getTemplateRuleMatches( $isTemplate, $wpPostId, $templateRules ) { - - $ruleMatches = array(); - - if ( $isTemplate ) { - - foreach ( $templateRules as $rule ) { - /** - * @var Brizy_Admin_Rule $rule ; - */ - $ruleMatches[] = array( - 'type' => $rule->getType(), - 'group' => $rule->getAppliedFor(), - 'entityType' => $rule->getEntityType(), - 'values' => $rule->getEntityValues(), - ); - } - $ruleMatches[] = array( - 'type' => Brizy_Admin_Rule::TYPE_INCLUDE, - 'group' => Brizy_Admin_Rule::BRIZY_TEMPLATE, - 'entityType' => $this->post->getWpPost()->post_type, - 'values' => array( $wpPostId ), - ); - } else { - $ruleMatches[] = array( - 'type' => Brizy_Admin_Rule::TYPE_INCLUDE, - 'group' => Brizy_Admin_Rule::POSTS, - 'entityType' => $this->post->getWpPost()->post_type, - 'values' => array( $wpPostId ), - ); - } - - return $ruleMatches; - } - - - /** - * - * @param $template_rules - */ - private function getTemplateType( $template_rules ) { - foreach ( $template_rules as $rule ) { - - if ( $rule->getType() != Brizy_Admin_Rule::TYPE_INCLUDE ) { - continue; - } - - // single mode - if ( $rule->getAppliedFor() == Brizy_Admin_Rule::POSTS ) { - if ( $rule->getEntityType() == 'product' ) { - return 'product'; - } else { - return 'single'; - } - } - - - // single mode - if ( $rule->getAppliedFor() == Brizy_Admin_Rule::TEMPLATE ) { - if ( in_array( $rule->getEntityType(), [ '404', 'front_page' ] ) ) { - return 'single'; - } - - if ( in_array( $rule->getEntityType(), [ 'search', 'author', 'home_page' ] ) ) { - return 'archive'; - } - } - - // archive mode - if ( $rule->getAppliedFor() == Brizy_Admin_Rule::TAXONOMY ) { - if ( in_array( $rule->getEntityType(), [ 'product_cat', 'product_tag' ] ) ) { - return 'product_archive'; - } - if ( in_array( $rule->getEntityType(), [ 'category', 'post_tag', ] ) ) { - return 'archive'; - } - } - - // product archive mode - if ( in_array( $rule->getAppliedFor(), [ - Brizy_Admin_Rule::ARCHIVE, - Brizy_Admin_Rule::DATE_ARCHIVE, - Brizy_Admin_Rule::DAY_ARCHIVE, - Brizy_Admin_Rule::MONTH_ARCHIVE, - Brizy_Admin_Rule::YEAR_ARCHIVE, - Brizy_Admin_Rule::TAXONOMY, - Brizy_Admin_Rule::WOO_SHOP_PAGE - ] ) ) { - if ( $rule->getAppliedFor() == Brizy_Admin_Rule::WOO_SHOP_PAGE && in_array( $rule->getEntityType(), [ - 'product', - 'shop_page' - ] ) ) { - return 'product_archive'; - } else { - return 'archive'; - } - } - } - - return ''; - } - - /** - * @return array - */ - public function getProjectStatus() { - $projectLockedBy = Brizy_Editor::get()->checkIfProjectIsLocked(); - $userData = WP_User::get_data_by( 'id', $projectLockedBy ); - unset( $userData->user_pass ); - unset( $userData->user_registered ); - unset( $userData->user_status ); - unset( $userData->user_activation_key ); - - return [ - 'locked' => $projectLockedBy !== false, - 'lockedBy' => $userData, - ]; - } - - /** - * @return array - */ - public function getApiActions( $config, $context ) { - - $pref = Brizy_Editor::prefix(); - - $config['wp']['api'] = array( - 'hash' => wp_create_nonce( Brizy_Editor_API::nonce ), - 'url' => set_url_scheme( admin_url( 'admin-ajax.php' ) ), - - 'heartBeat' => $pref . Brizy_Editor_API::AJAX_HEARTBEAT, - 'takeOver' => $pref . Brizy_Editor_API::AJAX_TAKE_OVER, - 'lockProject' => $pref . Brizy_Editor_API::AJAX_LOCK_PROJECT, - 'removeLock' => $pref . Brizy_Editor_API::AJAX_REMOVE_LOCK, - 'getPage' => $pref . Brizy_Editor_API::AJAX_GET, - 'getPostInfo' => $pref . Brizy_Editor_API::AJAX_GET_POST_INFO, - 'updatePage' => $pref . Brizy_Editor_API::AJAX_UPDATE, - 'getProject' => $pref . Brizy_Editor_API::AJAX_GET_PROJECT, - 'setProject' => $pref . Brizy_Editor_API::AJAX_SET_PROJECT, - 'setProjectMeta' => $pref . Brizy_Editor_API::AJAX_UPDATE_EDITOR_META_DATA, - 'getGlobalBlockList' => $pref . Brizy_Admin_Blocks_Api::GET_GLOBAL_BLOCKS_ACTION, - 'createGlobalBlock' => $pref . Brizy_Admin_Blocks_Api::CREATE_GLOBAL_BLOCK_ACTION, - 'updateGlobalBlock' => $pref . Brizy_Admin_Blocks_Api::UPDATE_GLOBAL_BLOCK_ACTION, - 'updateGlobalBlocks' => $pref . Brizy_Admin_Blocks_Api::UPDATE_GLOBAL_BLOCKS_ACTION, - 'deleteGlobalBlock' => $pref . Brizy_Admin_Blocks_Api::DELETE_GLOBAL_BLOCK_ACTION, - 'getRuleGroupList' => $pref . Brizy_Admin_Rules_Api::RULE_GROUP_LIST, - 'getLayoutByUid' => $pref . Brizy_Admin_Layouts_Api::GET_LAYOUT_BY_UID_ACTION, - 'getLayoutList' => $pref . Brizy_Admin_Layouts_Api::GET_LAYOUTS_ACTION, - 'createLayout' => $pref . Brizy_Admin_Layouts_Api::CREATE_LAYOUT_ACTION, - 'updateLayout' => $pref . Brizy_Admin_Layouts_Api::UPDATE_LAYOUT_ACTION, - 'deleteLayout' => $pref . Brizy_Admin_Layouts_Api::DELETE_LAYOUT_ACTION, - 'cloudSignIn' => $pref . Brizy_Admin_Cloud_Api::AJAX_SIGNIN_ACTION, - 'cloudSignUp' => $pref . Brizy_Admin_Cloud_Api::AJAX_SIGNUP_ACTION, - 'cloudSignOut' => $pref . Brizy_Admin_Cloud_Api::AJAX_SIGNOUT_ACTION, - 'cloudSyncAllowed' => $pref . Brizy_Admin_Cloud_Api::AJAX_SYNC_ALLOWED, - 'cloudResetPassword' => $pref . Brizy_Admin_Cloud_Api::AJAX_RESET_PASSWORD_ACTION, - 'cloudSync' => $pref . Brizy_Admin_Cloud_Api::AJAX_TRIGGER_SYNC_ACTION, - 'createRule' => $pref . Brizy_Admin_Rules_Api::CREATE_RULE_ACTION, - 'createRules' => $pref . Brizy_Admin_Rules_Api::CREATE_RULES_ACTION, - 'updateRules' => $pref . Brizy_Admin_Rules_Api::UPDATE_RULES_ACTION, - 'deleteRule' => $pref . Brizy_Admin_Rules_Api::DELETE_RULE_ACTION, - 'getRuleList' => $pref . Brizy_Admin_Rules_Api::LIST_RULE_ACTION, - 'updateBlockPositions' => $pref . Brizy_Admin_Blocks_Api::UPDATE_POSITIONS_ACTION, - 'getSavedBlockByUid' => $pref . Brizy_Admin_Blocks_Api::GET_SAVED_BLOCK_ACTION, - 'getSavedBlockList' => $pref . Brizy_Admin_Blocks_Api::GET_SAVED_BLOCKS_ACTION, - 'createSavedBlock' => $pref . Brizy_Admin_Blocks_Api::CREATE_SAVED_BLOCK_ACTION, - 'updateSavedBlock' => $pref . Brizy_Admin_Blocks_Api::UPDATE_SAVED_BLOCK_ACTION, - 'deleteSavedBlock' => $pref . Brizy_Admin_Blocks_Api::DELETE_SAVED_BLOCK_ACTION, - 'downloadBlocks' => $pref . Brizy_Admin_Blocks_Api::DOWNLOAD_BLOCKS, - 'uploadBlocks' => $pref . Brizy_Admin_Blocks_Api::UPLOAD_BLOCKS, - 'downloadLayouts' => $pref . Brizy_Admin_Layouts_Api::DOWNLOAD_LAYOUTS, - 'uploadLayouts' => $pref . Brizy_Admin_Layouts_Api::UPLOAD_LAYOUTS, - 'media' => $pref . Brizy_Editor_API::AJAX_MEDIA, - 'getMediaUid' => $pref . Brizy_Editor_API::AJAX_MEDIA_METAKEY, - 'getAttachmentUid' => $pref . Brizy_Editor_API::AJAX_CREATE_ATTACHMENT_UID, - 'getServerTimeStamp' => $pref . Brizy_Editor_API::AJAX_TIMESTAMP, - 'createBlockScreenshot' => $pref . Brizy_Editor_BlockScreenshotApi::AJAX_CREATE_BLOCK_SCREENSHOT, - 'updateBlockScreenshot' => $pref . Brizy_Editor_BlockScreenshotApi::AJAX_UPDATE_BLOCK_SCREENSHOT, - 'getSidebars' => $pref . Brizy_Editor_API::AJAX_SIDEBARS, - 'shortcodeContent' => $pref . Brizy_Editor_API::AJAX_SHORTCODE_CONTENT, - 'placeholderContent' => $pref . Brizy_Editor_API::AJAX_PLACEHOLDER_CONTENT, - 'placeholdersContent' => $pref . Brizy_Editor_API::AJAX_PLACEHOLDERS_CONTENT, - 'getPostTaxonomies' => $pref . Brizy_Editor_API::AJAX_GET_POST_TAXONOMIES, - 'getMenus' => $pref . Brizy_Editor_API::AJAX_GET_MENU_LIST, - 'getTerms' => $pref . Brizy_Editor_API::AJAX_GET_TERMS, - 'getTermsBy' => $pref . Brizy_Editor_API::AJAX_GET_TERMS_BY, - 'getUsers' => $pref . Brizy_Editor_API::AJAX_GET_USERS, - 'getPostObjects' => $pref . Brizy_Editor_API::AJAX_GET_POST_OBJECTS, // ??? - 'searchPosts' => $pref . Brizy_Editor_API::AJAX_SEARCH_POST, - 'setFeaturedImage' => $pref . Brizy_Editor_API::AJAX_SET_FEATURED_IMAGE, - 'setFeaturedImageFocalPoint' => $pref . Brizy_Editor_API::AJAX_SET_IMAGE_FOCAL_PT, - 'removeFeaturedImage' => $pref . Brizy_Editor_API::AJAX_REMOVE_FEATURED_IMAGE, - 'getForm' => $pref . Brizy_Editor_Forms_Api::AJAX_GET_FORM, - 'createForm' => $pref . Brizy_Editor_Forms_Api::AJAX_CREATE_FORM, - 'updateForm' => $pref . Brizy_Editor_Forms_Api::AJAX_UPDATE_FORM, - 'deleteForm' => $pref . Brizy_Editor_Forms_Api::AJAX_DELETE_FORM, - 'getIntegration' => $pref . Brizy_Editor_Forms_Api::AJAX_GET_INTEGRATION, - 'createIntegration' => $pref . Brizy_Editor_Forms_Api::AJAX_CREATE_INTEGRATION, - 'updateIntegration' => $pref . Brizy_Editor_Forms_Api::AJAX_UPDATE_INTEGRATION, - 'deleteIntegration' => $pref . Brizy_Editor_Forms_Api::AJAX_DELETE_INTEGRATION, - 'createFont' => $pref . Brizy_Admin_Fonts_Api::AJAX_CREATE_FONT_ACTION, - 'deleteFont' => $pref . Brizy_Admin_Fonts_Api::AJAX_DELETE_FONT_ACTION, - 'getFonts' => $pref . Brizy_Admin_Fonts_Api::AJAX_GET_FONTS_ACTION, - 'getAccount' => $pref . Brizy_Editor_Accounts_Api::BRIZY_GET_ACCOUNT, - 'getAccounts' => $pref . Brizy_Editor_Accounts_Api::BRIZY_GET_ACCOUNTS, - 'addAccount' => $pref . Brizy_Editor_Accounts_Api::BRIZY_ADD_ACCOUNT, - 'updateAccount' => $pref . Brizy_Editor_Accounts_Api::BRIZY_UPDATE_ACCOUNT, - 'deleteAccount' => $pref . Brizy_Editor_Accounts_Api::BRIZY_DELETE_ACCOUNT, - 'validateRecaptchaAccount' => $pref . Brizy_Editor_Forms_Api::AJAX_VALIDATE_RECAPTCHA_ACCOUNT, - 'rulePostsGroupList' => $pref . Brizy_Admin_Rules_Api::RULE_POSTS_GROUP_LIST, - 'ruleArchiveGroupList' => $pref . Brizy_Admin_Rules_Api::RULE_ARCHIVE_GROUP_LIST, - 'ruleTemplateGroupList' => $pref . Brizy_Admin_Rules_Api::RULE_TEMPLATE_GROUP_LIST, - ); - - return $config; - } - - /** - * @return array - * @throws Exception - */ - public function getCloudInfo() { - // the cloud will be always initialized with the exception when the white label is enabled - // we wil return isSyncAllowed = false just in case - if ( class_exists( 'BrizyPro_Admin_WhiteLabel' ) && BrizyPro_Admin_WhiteLabel::_init()->getEnabled() ) { - return array( - 'isSyncAllowed' => false, - ); - } - - $response = array( - 'isSyncAllowed' => true, - ); - - if ( $this->project->getMetaValue( 'brizy-cloud-token' ) !== null ) { - try { - $cloudClient = Brizy_Admin_Cloud_Client::instance( Brizy_Editor_Project::get(), new WP_Http() ); - $versions = $cloudClient->getCloudEditorVersions(); - $response['isSyncAllowed'] = $versions['sync'] == BRIZY_SYNC_VERSION; - } catch ( Exception $e ) { - return [ 'isSyncAllowed' => false ]; - } - } - - return $response; - } - - /** - * Do not use: $userId = get_post_meta( $this->post->getWpPostId(), '_edit_last', true ); - * This meta _edit_last is often deleted by plugins dealing with optimize database - * - * @param $context - * - * @return bool - */ - private function isUserAllowedToAddScripts( $context ) { - - if ( $context == self::COMPILE_CONTEXT ) { - - $userId = $this->post->getLastUserEdited(); - - if ( $userId === null ) { - return true; - } - - } else { - $userId = get_current_user_id(); - } - - $userCan = user_can( $userId, 'unfiltered_html' ); - - return $userCan; - } - - private function getImgSizes() { - - $sizes = []; - - foreach ( Brizy_Editor::get_all_image_sizes() as $name => $size ) { - if ( isset( $size['crop'] ) ) { - unset( $size['crop'] ); - } - $size['name'] = $name; - $sizes[] = $size; - } - - return $sizes; - } + $this->post->getUid() + ); + + $results = $wpdb->get_results($query); + $attachment_data = array(); + foreach ($results as $row) { + $attachment_data[$row->meta_value] = true; + } + + return (object)$attachment_data; + } + + /** + * @return array|null + */ + public static function get_woocomerce_plugin_info() + { + if (function_exists('wc') && defined('WC_PLUGIN_FILE')) { + return array('version' => WooCommerce::instance()->version); + } + + return null; + } + + /** + * @param $wp_post_id + * + * @return array|null + */ + private function getThumbnailData($wp_post_id) + { + $post_thumbnail_id = get_post_thumbnail_id($wp_post_id); + $post_thumbnail = ""; + + if ($post_thumbnail_id) { + $post_thumbnail_focal_point = get_post_meta($wp_post_id, 'brizy_attachment_focal_point', true); + + if ( ! is_array($post_thumbnail_focal_point)) { + $post_thumbnail_focal_point = array('x' => "", 'y' => ""); + } + + $post_thumbnail = array( + 'id' => $post_thumbnail_id, + 'url' => get_the_post_thumbnail_url($wp_post_id), + 'pointX' => isset($post_thumbnail_focal_point['x']) ? $post_thumbnail_focal_point['x'] : "", + 'pointY' => isset($post_thumbnail_focal_point['y']) ? $post_thumbnail_focal_point['y'] : "", + ); + } + + return $post_thumbnail; + } + + private function getAllParents($terms) + { + $result = []; + foreach ($terms as $i => $term) { + foreach ($this->getTermParents($term) as $aTerm) { + if ( ! isset($result[$aTerm->term_id])) { + $result[$aTerm->term_id] = $aTerm; + } + } + } + + return $result; + } + + private function getTermParents($term) + { + $parents = []; + if ($term->parent) { + $parent = get_term_by('id', $term->parent, $term->taxonomy); + + if ($parent) { + $parents[$parent->term_id] = $parent; + if ($parent->parent > 0) { + $parents = array_merge($parents, $this->getTermParents($parent)); + } + } + } + + return $parents; + } + + /** + * @param $wp_post + * + * @return null|string + * @throws Brizy_Editor_Exceptions_NotFound + * @throws Brizy_Editor_Exceptions_UnsupportedPostType + */ + private function getPreviewUrl($wp_post) + { + + if ($wp_post->post_type == Brizy_Admin_Templates::CP_TEMPLATE) { + + $ruleManager = new Brizy_Admin_Rules_Manager(); + $rules = $ruleManager->getRules($wp_post->ID); + $rule = null; + + + if ( ! function_exists('addQueryStringToUrl')) { + function addQueryStringToUrl($link, $query) + { + $parsedUrl = parse_url($link); + $separator = ( ! isset($parsedUrl['query']) || $parsedUrl['query'] == null) ? '?' : '&'; + $link .= $separator.$query; + + return $link; + } + } + + + // find first include rule + foreach ($rules as $rule) { + /** + * @var Brizy_Admin_Rule $rule ; + */ + if ($rule->getType() == Brizy_Admin_Rule::TYPE_INCLUDE) { + break; + } + } + + if ($rule) { + + switch ($rule->getAppliedFor()) { + case Brizy_Admin_Rule::WOO_SHOP_PAGE: + if (function_exists('wc_get_page_id') && wc_get_page_id('shop')) { + $wp_post = get_post(wc_get_page_id('shop')); + } + break; + case Brizy_Admin_Rule::POSTS : + $args = array( + 'post_type' => $rule->getEntityType(), + ); + + if (count($rule->getEntityValues())) { + $args['post__in'] = $rule->getEntityValues(); + } + + $array = get_posts($args); + + foreach ($array as $p) { + + if ($p->post_type == 'attachment') { + return addQueryStringToUrl(get_attachment_link($p->ID), 'preview=1'); + } + + if ( ! Brizy_Editor::checkIfPostTypeIsSupported($p->ID, false) || + ! Brizy_Editor_Entity::isBrizyEnabled($p->ID)) { + $wp_post = $p; + break; + } + + } + break; + case Brizy_Admin_Rule::TAXONOMY : + $args = array( + 'taxonomy' => $rule->getEntityType(), + 'hide_empty' => true, + ); + if (count($rule->getEntityValues())) { + $args['term_taxonomy_id'] = $rule->getEntityValues(); + } + + $array = get_terms($args); + + if (count($array) == 0) { + break; + } + $term = array_pop($array); + $link = get_term_link($term); + + return addQueryStringToUrl($link, 'preview=1'); + break; + case Brizy_Admin_Rule::ARCHIVE : + if ($rule->getEntityType()) { + $link = get_post_type_archive_link($rule->getEntityType()); + + return addQueryStringToUrl($link, 'preview=1'); + } + + $link = $this->getOneArchiveLink(); + + return addQueryStringToUrl($link, 'preview=1'); + break; + case Brizy_Admin_Rule::TEMPLATE : + + // array( 'title' => 'Author page', 'value' => 'author', 'groupValue' => Brizy_Admin_Rule::TEMPLATE ), + // array( 'title' => 'Search page', 'value' => 'search', 'groupValue' => Brizy_Admin_Rule::TEMPLATE ), + // array( 'title' => 'Home page', 'value' => 'front_page', 'groupValue' => Brizy_Admin_Rule::TEMPLATE ), + // array( 'title' => '404 page', 'value' => '404', 'groupValue' => Brizy_Admin_Rule::TEMPLATE ), + // array( 'title' => 'Archive page', 'value' => '', 'groupValue' => Brizy_Admin_Rule::ARCHIVE ), + switch ($rule->getEntityType()) { + case 'author': + $authors = get_users(); + $author = array_pop($authors); + $link = get_author_posts_url($author->ID); + + return addQueryStringToUrl($link, 'preview=1'); + break; + + case 'search': + return addQueryStringToUrl(get_search_link('find-me'), 'preview=1'); + break; + case '404': + return addQueryStringToUrl(get_home_url(null, (string)time()), 'preview=1'); + break; + case 'home_page': + $get_option = get_option('page_for_posts'); + + if ($get_option) { + return addQueryStringToUrl(get_permalink($get_option), 'preview=1'); + } + break; + case 'front_page': + return addQueryStringToUrl(home_url(), 'preview=1'); + break; + } + + break; + } + + } + } + + return get_preview_post_link( + $wp_post, + array( + 'preview_id' => $wp_post->ID, + 'preview_nonce' => wp_create_nonce('post_preview_'.$wp_post->ID), + ) + ); + } + + /** + * @return array + */ + private function get_menu_data() + { + $menus = wp_get_nav_menus(); + $menu_data = array(); + + foreach ($menus as $menu) { + + $custom_menu_data = get_term_meta($menu->term_id, 'brizy_data', true); + + $menu_uid = get_term_meta($menu->term_id, 'brizy_uid', true); + if ( ! $menu_uid) { + $menu_uid = md5($menu->term_id.time()); + update_term_meta($menu->term_id, 'brizy_uid', $menu_uid); + } + + $amenu = array( + 'id' => $menu_uid, + 'name' => $menu->name, + 'items' => array(), + ); + + $amenu = (object)array_merge( + $amenu, + get_object_vars(is_object($custom_menu_data) ? $custom_menu_data : (object)array()) + ); + + $menuItems = []; + + add_action('wp_get_nav_menu_items', function ($items) use (&$menuItems) { + foreach ($items as $item) { + $menuItems[$item->ID] = $item; + } + + return $items; + }, -1000); + + $currentItems = wp_get_nav_menu_items($menu->term_id); + + _wp_menu_item_classes_by_context($menuItems); + + $currentItemsAssociative = []; + foreach ($currentItems as $currentItem) { + $currentItemsAssociative[$currentItem->ID] = $currentItem; + } + + $menuItems = $currentItemsAssociative + $menuItems; + + $menu_items = $this->get_menu_tree($menuItems); + + if (count($menu_items) > 0) { + $amenu->items = $menu_items; + } + + $menu_data[] = $amenu; + } + + return apply_filters('brizy_menu_data', $menu_data); + } + + /** + * @param $items + * @param int $parent + * + * @return array + */ + private function get_menu_tree($items, $parent = 0) + { + $result_items = array(); + + foreach ($items as $item) { + if ((string)$item->menu_item_parent !== (string)$parent) { + continue; + } + + $menu_uid = get_post_meta($item->ID, 'brizy_post_uid', true); + + if ( ! $menu_uid) { + $menu_uid = md5($item->ID.time()); + $update = update_post_meta($item->ID, 'brizy_post_uid', $menu_uid); + + if ( ! $update) { + $menu_uid = $item->ID; + } + } + + $megaMenuItems = $this->getMegaMenuItems(); + + $menu_data = get_post_meta($item->ID, 'brizy_data', true); + + $item_value = array( + 'id' => $menu_uid, + 'title' => $item->title, + 'url' => $item->url, + 'megaMenuItems' => $megaMenuItems, + 'description' => $item->post_content, + 'position' => $item->menu_order, + 'attrTitle' => $item->post_excerpt, + 'current' => count( + array_intersect( + [ + 'current-menu-parent', + 'current-menu-item', + ], + $item->classes + ) + ) > 0, + 'target' => get_post_meta($item->ID, '_menu_item_target', true), + 'classes' => array_values(array_filter($item->classes)), + 'xfn' => get_post_meta($item->ID, '_menu_item_xfn', true), + ); + + $an_item = (object)array( + 'type' => 'MenuItem', + ); + + $an_item->value = (object)array_merge( + $item_value, + get_object_vars(is_object($menu_data) ? $menu_data : (object)array()) + ); + + $child_items = $this->get_menu_tree($items, $item->ID); + + $an_item->value->items = array(); + + if (count($child_items) > 0) { + $an_item->value->items = $child_items; + } + + $result_items[] = $an_item; + } + + return $result_items; + } + + /** + * @return array + */ + private function getMegaMenuItems() + { + + return array( + (object)(array( + 'type' => "SectionMegaMenu", + 'value' => (object)array('items' => array()), + )), + ); + } + + /** + * @param Brizy_Editor_Accounts_ServiceAccountManager $manager + * @param array $config + * + * @return array + */ + private function addRecaptchaAccounts(Brizy_Editor_Accounts_ServiceAccountManager $manager, array $config, $context) + { + $accounts = $manager->getAccountsByGroup(Brizy_Editor_Accounts_AbstractAccount::RECAPTCHA_GROUP); + + if (isset($accounts[0]) && $accounts[0] instanceof Brizy_Editor_Accounts_RecaptchaAccount) { + $config['applications']['form']['recaptcha']['siteKey'] = $accounts[0]->getSiteKey(); + } + + return $config; + } + + /** + * @param Brizy_Editor_Accounts_ServiceAccountManager $manager + * @param array $config + * + * @return array + */ + private function addSocialAccounts(Brizy_Editor_Accounts_ServiceAccountManager $manager, array $config, $context) + { + $accounts = $manager->getAccountsByGroup(Brizy_Editor_Accounts_AbstractAccount::SOCIAL_GROUP); + + foreach ($accounts as $account) { + if (isset($account) && $account instanceof Brizy_Editor_Accounts_SocialAccount) { + $config['applications'][$account->getGroup()][] = $account->convertToOptionValue(); + } + } + + return $config; + } + + + private function fileUploadMaxSize() + { + static $max_size = -1; + + if ($max_size < 0) { + // Start with post_max_size. + $post_max_size = $this->parseSize(ini_get('post_max_size')); + if ($post_max_size > 0) { + $max_size = number_format($post_max_size / 1048576, 2, '.', ''); + } + + // If upload_max_size is less, then reduce. Except if upload_max_size is + // zero, which indicates no limit. + $upload_max = $this->parseSize(ini_get('upload_max_filesize')); + if ($upload_max > 0 && $upload_max < $max_size) { + $max_size = number_format($upload_max / 1048576, 2, '.', ''); + } + } + + return $max_size; + } + + private function parseSize($size) + { + $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size. + $size = preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size. + if ($unit) { + // Find the position of the unit in the ordered string which is the power of magnitude to multiply a kilobyte by. + return round($size * pow(1024, stripos('bkmgtpezy', $unit[0]))); + } else { + return round($size); + } + } + + + private function getOneArchiveLink($args = '') + { + global $wpdb, $wp_locale; + + $defaults = array( + 'type' => 'monthly', + 'limit' => '', + 'order' => 'DESC', + 'post_type' => 'post', + 'year' => get_query_var('year'), + 'monthnum' => get_query_var('monthnum'), + 'day' => get_query_var('day'), + 'w' => get_query_var('w'), + ); + + $r = wp_parse_args($args, $defaults); + + $post_type_object = get_post_type_object($r['post_type']); + if ( ! is_post_type_viewable($post_type_object)) { + return; + } + $r['post_type'] = $post_type_object->name; + + if ('' == $r['type']) { + $r['type'] = 'monthly'; + } + + if ( ! empty($r['limit'])) { + $r['limit'] = absint($r['limit']); + $r['limit'] = ' LIMIT '.$r['limit']; + } + + $order = strtoupper($r['order']); + if ($order !== 'ASC') { + $order = 'DESC'; + } + + // this is what will separate dates on weekly archive links + $archive_week_separator = '–'; + + $sql_where = $wpdb->prepare("WHERE post_type = %s AND post_status = 'publish'", $r['post_type']); + + /** + * Filters the SQL WHERE clause for retrieving archives. + * + * @param string $sql_where Portion of SQL query containing the WHERE clause. + * @param array $r An array of default arguments. + * + * @since 2.2.0 + * + */ + $where = apply_filters('getarchives_where', $sql_where, $r); + + /** + * Filters the SQL JOIN clause for retrieving archives. + * + * @param string $sql_join Portion of SQL query containing JOIN clause. + * @param array $r An array of default arguments. + * + * @since 2.2.0 + * + */ + $join = apply_filters('getarchives_join', '', $r); + + $output = ''; + + $last_changed = wp_cache_get_last_changed('posts'); + + $limit = $r['limit']; + + if ('monthly' == $r['type']) { + $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date $order $limit"; + $key = md5($query); + $key = "wp_get_archives:$key:$last_changed"; + if ( ! $results = wp_cache_get($key, 'posts')) { + $results = $wpdb->get_results($query); + wp_cache_set($key, $results, 'posts'); + } + if ($results) { + foreach ((array)$results as $result) { + $url = get_month_link($result->year, $result->month); + if ('post' !== $r['post_type']) { + $url = add_query_arg('post_type', $r['post_type'], $url); + } + + return $url; + } + } + } + } + + /** + * @return string + * @throws Exception + */ + private function getTexts() + { + if (BRIZY_DEVELOPMENT) { + $brizy_public_editor_build_texts = '\Brizy_Public_EditorBuild_Dev_Texts'; + } else { + $version = ''; + foreach (explode('-', BRIZY_EDITOR_VERSION) as $tmp) { + $version .= ucfirst($tmp); + } + $brizy_public_editor_build_texts = '\Brizy_Public_EditorBuild_'.$version.'_Texts'; + } + + if ( ! class_exists($brizy_public_editor_build_texts)) { + if (BRIZY_DEVELOPMENT) { + throw new \Exception('You must build the editor first.'); + } else { + throw new \Exception('Unable to find class '.$brizy_public_editor_build_texts); + } + } + + return (object)$brizy_public_editor_build_texts::get_editor_texts(); + } + + private function addTemplateFields($config, $is_template, $wp_post_id, $context) + { + + $template_rules = []; + if ($is_template) { + $rule_manager = new Brizy_Admin_Rules_Manager(); + $template_rules = $rule_manager->getRules($wp_post_id); + $config['template_type'] = $this->getTemplateType($template_rules); + } + + $config['wp']['ruleMatches'] = $this->getTemplateRuleMatches($is_template, $wp_post_id, $template_rules); + + return $config; + } + + /** + * @param $isTemplate + * @param $wpPostId + * @param $templateRules + * + * @return array + */ + private function getTemplateRuleMatches($isTemplate, $wpPostId, $templateRules) + { + + $ruleMatches = array(); + + if ($isTemplate) { + + foreach ($templateRules as $rule) { + /** + * @var Brizy_Admin_Rule $rule ; + */ + $ruleMatches[] = array( + 'type' => $rule->getType(), + 'group' => $rule->getAppliedFor(), + 'entityType' => $rule->getEntityType(), + 'values' => $rule->getEntityValues(), + ); + } + $ruleMatches[] = array( + 'type' => Brizy_Admin_Rule::TYPE_INCLUDE, + 'group' => Brizy_Admin_Rule::BRIZY_TEMPLATE, + 'entityType' => $this->post->getWpPost()->post_type, + 'values' => array($wpPostId), + ); + } else { + $ruleMatches[] = array( + 'type' => Brizy_Admin_Rule::TYPE_INCLUDE, + 'group' => Brizy_Admin_Rule::POSTS, + 'entityType' => $this->post->getWpPost()->post_type, + 'values' => array($wpPostId), + ); + } + + return $ruleMatches; + } + + + /** + * + * @param $template_rules + */ + private function getTemplateType($template_rules) + { + foreach ($template_rules as $rule) { + + if ($rule->getType() != Brizy_Admin_Rule::TYPE_INCLUDE) { + continue; + } + + // single mode + if ($rule->getAppliedFor() == Brizy_Admin_Rule::POSTS) { + if ($rule->getEntityType() == 'product') { + return 'product'; + } else { + return 'single'; + } + } + + + // single mode + if ($rule->getAppliedFor() == Brizy_Admin_Rule::TEMPLATE) { + if (in_array($rule->getEntityType(), ['404', 'front_page'])) { + return 'single'; + } + + if (in_array($rule->getEntityType(), ['search', 'author', 'home_page'])) { + return 'archive'; + } + } + + // archive mode + if ($rule->getAppliedFor() == Brizy_Admin_Rule::TAXONOMY) { + if (in_array($rule->getEntityType(), ['product_cat', 'product_tag'])) { + return 'product_archive'; + } + if (in_array($rule->getEntityType(), ['category', 'post_tag',])) { + return 'archive'; + } + } + + // product archive mode + if (in_array($rule->getAppliedFor(), [ + Brizy_Admin_Rule::ARCHIVE, + Brizy_Admin_Rule::DATE_ARCHIVE, + Brizy_Admin_Rule::DAY_ARCHIVE, + Brizy_Admin_Rule::MONTH_ARCHIVE, + Brizy_Admin_Rule::YEAR_ARCHIVE, + Brizy_Admin_Rule::TAXONOMY, + Brizy_Admin_Rule::WOO_SHOP_PAGE, + ])) { + if ($rule->getAppliedFor() == Brizy_Admin_Rule::WOO_SHOP_PAGE && in_array($rule->getEntityType(), [ + 'product', + 'shop_page', + ])) { + return 'product_archive'; + } else { + return 'archive'; + } + } + } + + return ''; + } + + /** + * @return array + */ + public function getProjectStatus() + { + $projectLockedBy = Brizy_Editor::get()->checkIfProjectIsLocked(); + $userData = WP_User::get_data_by('id', $projectLockedBy); + unset($userData->user_pass); + unset($userData->user_registered); + unset($userData->user_status); + unset($userData->user_activation_key); + + return [ + 'locked' => $projectLockedBy !== false, + 'lockedBy' => $userData, + ]; + } + + /** + * @return array + */ + public function getApiActions($config, $context) + { + + $pref = Brizy_Editor::prefix(); + + $config['wp']['api'] = array( + 'hash' => wp_create_nonce(Brizy_Editor_API::nonce), + 'url' => set_url_scheme(admin_url('admin-ajax.php')), + + 'heartBeat' => $pref.Brizy_Editor_API::AJAX_HEARTBEAT, + 'takeOver' => $pref.Brizy_Editor_API::AJAX_TAKE_OVER, + 'lockProject' => $pref.Brizy_Editor_API::AJAX_LOCK_PROJECT, + 'removeLock' => $pref.Brizy_Editor_API::AJAX_REMOVE_LOCK, + 'getPage' => $pref.Brizy_Editor_API::AJAX_GET, + 'getPostInfo' => $pref.Brizy_Editor_API::AJAX_GET_POST_INFO, + 'updatePage' => $pref.Brizy_Editor_API::AJAX_UPDATE, + 'getProject' => $pref.Brizy_Editor_API::AJAX_GET_PROJECT, + 'setProject' => $pref.Brizy_Editor_API::AJAX_SET_PROJECT, + 'setProjectMeta' => $pref.Brizy_Editor_API::AJAX_UPDATE_EDITOR_META_DATA, + 'getGlobalBlockList' => $pref.Brizy_Admin_Blocks_Api::GET_GLOBAL_BLOCKS_ACTION, + 'createGlobalBlock' => $pref.Brizy_Admin_Blocks_Api::CREATE_GLOBAL_BLOCK_ACTION, + 'updateGlobalBlock' => $pref.Brizy_Admin_Blocks_Api::UPDATE_GLOBAL_BLOCK_ACTION, + 'updateGlobalBlocks' => $pref.Brizy_Admin_Blocks_Api::UPDATE_GLOBAL_BLOCKS_ACTION, + 'deleteGlobalBlock' => $pref.Brizy_Admin_Blocks_Api::DELETE_GLOBAL_BLOCK_ACTION, + 'getRuleGroupList' => $pref.Brizy_Admin_Rules_Api::RULE_GROUP_LIST, + 'getLayoutByUid' => $pref.Brizy_Admin_Layouts_Api::GET_LAYOUT_BY_UID_ACTION, + 'getLayoutList' => $pref.Brizy_Admin_Layouts_Api::GET_LAYOUTS_ACTION, + 'createLayout' => $pref.Brizy_Admin_Layouts_Api::CREATE_LAYOUT_ACTION, + 'updateLayout' => $pref.Brizy_Admin_Layouts_Api::UPDATE_LAYOUT_ACTION, + 'deleteLayout' => $pref.Brizy_Admin_Layouts_Api::DELETE_LAYOUT_ACTION, + 'cloudSignIn' => $pref.Brizy_Admin_Cloud_Api::AJAX_SIGNIN_ACTION, + 'cloudSignUp' => $pref.Brizy_Admin_Cloud_Api::AJAX_SIGNUP_ACTION, + 'cloudSignOut' => $pref.Brizy_Admin_Cloud_Api::AJAX_SIGNOUT_ACTION, + 'cloudSyncAllowed' => $pref.Brizy_Admin_Cloud_Api::AJAX_SYNC_ALLOWED, + 'cloudResetPassword' => $pref.Brizy_Admin_Cloud_Api::AJAX_RESET_PASSWORD_ACTION, + 'cloudSync' => $pref.Brizy_Admin_Cloud_Api::AJAX_TRIGGER_SYNC_ACTION, + 'createRule' => $pref.Brizy_Admin_Rules_Api::CREATE_RULE_ACTION, + 'createRules' => $pref.Brizy_Admin_Rules_Api::CREATE_RULES_ACTION, + 'updateRules' => $pref.Brizy_Admin_Rules_Api::UPDATE_RULES_ACTION, + 'deleteRule' => $pref.Brizy_Admin_Rules_Api::DELETE_RULE_ACTION, + 'getRuleList' => $pref.Brizy_Admin_Rules_Api::LIST_RULE_ACTION, + 'updateBlockPositions' => $pref.Brizy_Admin_Blocks_Api::UPDATE_POSITIONS_ACTION, + 'getSavedBlockByUid' => $pref.Brizy_Admin_Blocks_Api::GET_SAVED_BLOCK_ACTION, + 'getSavedBlockList' => $pref.Brizy_Admin_Blocks_Api::GET_SAVED_BLOCKS_ACTION, + 'createSavedBlock' => $pref.Brizy_Admin_Blocks_Api::CREATE_SAVED_BLOCK_ACTION, + 'updateSavedBlock' => $pref.Brizy_Admin_Blocks_Api::UPDATE_SAVED_BLOCK_ACTION, + 'deleteSavedBlock' => $pref.Brizy_Admin_Blocks_Api::DELETE_SAVED_BLOCK_ACTION, + 'downloadBlocks' => $pref.Brizy_Admin_Blocks_Api::DOWNLOAD_BLOCKS, + 'uploadBlocks' => $pref.Brizy_Admin_Blocks_Api::UPLOAD_BLOCKS, + 'downloadLayouts' => $pref.Brizy_Admin_Layouts_Api::DOWNLOAD_LAYOUTS, + 'uploadLayouts' => $pref.Brizy_Admin_Layouts_Api::UPLOAD_LAYOUTS, + 'media' => $pref.Brizy_Editor_API::AJAX_MEDIA, + 'getMediaUid' => $pref.Brizy_Editor_API::AJAX_MEDIA_METAKEY, + 'getAttachmentUid' => $pref.Brizy_Editor_API::AJAX_CREATE_ATTACHMENT_UID, + 'getServerTimeStamp' => $pref.Brizy_Editor_API::AJAX_TIMESTAMP, + 'createBlockScreenshot' => $pref.Brizy_Editor_BlockScreenshotApi::AJAX_CREATE_BLOCK_SCREENSHOT, + 'updateBlockScreenshot' => $pref.Brizy_Editor_BlockScreenshotApi::AJAX_UPDATE_BLOCK_SCREENSHOT, + 'getSidebars' => $pref.Brizy_Editor_API::AJAX_SIDEBARS, + 'shortcodeContent' => $pref.Brizy_Editor_API::AJAX_SHORTCODE_CONTENT, + 'placeholderContent' => $pref.Brizy_Editor_API::AJAX_PLACEHOLDER_CONTENT, + 'placeholdersContent' => $pref.Brizy_Editor_API::AJAX_PLACEHOLDERS_CONTENT, + 'getPostTaxonomies' => $pref.Brizy_Editor_API::AJAX_GET_POST_TAXONOMIES, + 'getMenus' => $pref.Brizy_Editor_API::AJAX_GET_MENU_LIST, + 'getTerms' => $pref.Brizy_Editor_API::AJAX_GET_TERMS, + 'getTermsBy' => $pref.Brizy_Editor_API::AJAX_GET_TERMS_BY, + 'getUsers' => $pref.Brizy_Editor_API::AJAX_GET_USERS, + 'getPostObjects' => $pref.Brizy_Editor_API::AJAX_GET_POST_OBJECTS, // ??? + 'searchPosts' => $pref.Brizy_Editor_API::AJAX_SEARCH_POST, + 'setFeaturedImage' => $pref.Brizy_Editor_API::AJAX_SET_FEATURED_IMAGE, + 'setFeaturedImageFocalPoint' => $pref.Brizy_Editor_API::AJAX_SET_IMAGE_FOCAL_PT, + 'removeFeaturedImage' => $pref.Brizy_Editor_API::AJAX_REMOVE_FEATURED_IMAGE, + 'getForm' => $pref.Brizy_Editor_Forms_Api::AJAX_GET_FORM, + 'createForm' => $pref.Brizy_Editor_Forms_Api::AJAX_CREATE_FORM, + 'updateForm' => $pref.Brizy_Editor_Forms_Api::AJAX_UPDATE_FORM, + 'deleteForm' => $pref.Brizy_Editor_Forms_Api::AJAX_DELETE_FORM, + 'getIntegration' => $pref.Brizy_Editor_Forms_Api::AJAX_GET_INTEGRATION, + 'createIntegration' => $pref.Brizy_Editor_Forms_Api::AJAX_CREATE_INTEGRATION, + 'updateIntegration' => $pref.Brizy_Editor_Forms_Api::AJAX_UPDATE_INTEGRATION, + 'deleteIntegration' => $pref.Brizy_Editor_Forms_Api::AJAX_DELETE_INTEGRATION, + 'createFont' => $pref.Brizy_Admin_Fonts_Api::AJAX_CREATE_FONT_ACTION, + 'deleteFont' => $pref.Brizy_Admin_Fonts_Api::AJAX_DELETE_FONT_ACTION, + 'getFonts' => $pref.Brizy_Admin_Fonts_Api::AJAX_GET_FONTS_ACTION, + 'getAccount' => $pref.Brizy_Editor_Accounts_Api::BRIZY_GET_ACCOUNT, + 'getAccounts' => $pref.Brizy_Editor_Accounts_Api::BRIZY_GET_ACCOUNTS, + 'addAccount' => $pref.Brizy_Editor_Accounts_Api::BRIZY_ADD_ACCOUNT, + 'updateAccount' => $pref.Brizy_Editor_Accounts_Api::BRIZY_UPDATE_ACCOUNT, + 'deleteAccount' => $pref.Brizy_Editor_Accounts_Api::BRIZY_DELETE_ACCOUNT, + 'validateRecaptchaAccount' => $pref.Brizy_Editor_Forms_Api::AJAX_VALIDATE_RECAPTCHA_ACCOUNT, + 'rulePostsGroupList' => $pref.Brizy_Admin_Rules_Api::RULE_POSTS_GROUP_LIST, + 'ruleArchiveGroupList' => $pref.Brizy_Admin_Rules_Api::RULE_ARCHIVE_GROUP_LIST, + 'ruleTemplateGroupList' => $pref.Brizy_Admin_Rules_Api::RULE_TEMPLATE_GROUP_LIST, + 'symbolCreate' => $pref.Brizy_Admin_Symbols_Api::CREATE_ACTION, + 'symbolUpdate' => $pref.Brizy_Admin_Symbols_Api::UPDATE_ACTION, + 'symbolDelete' => $pref.Brizy_Admin_Symbols_Api::DELETE_ACTION, + 'symbolList' => $pref.Brizy_Admin_Symbols_Api::LIST_ACTION, + + ); + + return $config; + } + + /** + * @return array + * @throws Exception + */ + public function getCloudInfo() + { + // the cloud will be always initialized with the exception when the white label is enabled + // we wil return isSyncAllowed = false just in case + if (class_exists('BrizyPro_Admin_WhiteLabel') && BrizyPro_Admin_WhiteLabel::_init()->getEnabled()) { + return array( + 'isSyncAllowed' => false, + ); + } + + $response = array( + 'isSyncAllowed' => true, + ); + + if ($this->project->getMetaValue('brizy-cloud-token') !== null) { + try { + $cloudClient = Brizy_Admin_Cloud_Client::instance( + Brizy_Editor_Project::get(), + new WP_Http() + ); + $versions = $cloudClient->getCloudEditorVersions(); + $response['isSyncAllowed'] = $versions['sync'] == BRIZY_SYNC_VERSION; + } catch (Exception $e) { + return ['isSyncAllowed' => false]; + } + } + + return $response; + } + + /** + * Do not use: $userId = get_post_meta( $this->post->getWpPostId(), '_edit_last', true ); + * This meta _edit_last is often deleted by plugins dealing with optimize database + * + * @param $context + * + * @return bool + */ + private function isUserAllowedToAddScripts($context) + { + + if ($context == self::COMPILE_CONTEXT) { + + $userId = $this->post->getLastUserEdited(); + + if ($userId === null) { + return true; + } + + } else { + $userId = get_current_user_id(); + } + + $userCan = user_can($userId, 'unfiltered_html'); + + return $userCan; + } + + private function getImgSizes() + { + + $sizes = []; + + foreach (Brizy_Editor::get_all_image_sizes() as $name => $size) { + if (isset($size['crop'])) { + unset($size['crop']); + } + $size['name'] = $name; + $sizes[] = $size; + } + + return $sizes; + } } From af6c2b45adf2e44320a395a29fec8112cd7dab6e Mon Sep 17 00:00:00 2001 From: Alex Zaharia Date: Wed, 21 Dec 2022 14:53:39 +0200 Subject: [PATCH 14/15] new: Added build script for editor client --- Jenkinsfile | 1 + jenkins/build-client.sh | 12 + public/main.php | 991 +++++++++++++++++++++------------------- 3 files changed, 534 insertions(+), 470 deletions(-) create mode 100755 jenkins/build-client.sh diff --git a/Jenkinsfile b/Jenkinsfile index 4b7ec64f25..f5edaf3a60 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -67,6 +67,7 @@ pipeline { stage('Prepare the build') { steps { + sh "./jenkins/build-client.sh" sh "./jenkins/version-update.sh ${params.buildVersion} ${params.minProVersion} ${params.editorVersion} ${params.syncVersion}" sh "./jenkins/update-tested-version.sh README.md readme.txt" } diff --git a/jenkins/build-client.sh b/jenkins/build-client.sh new file mode 100755 index 0000000000..3411f21ec5 --- /dev/null +++ b/jenkins/build-client.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +echo -e "\nClean node modules in editor client" +sudo rm -rf ./public/editor-client/node_modules +sudo rm -rf ./public/editor-client/build + +cd ./public/editor-client +echo -e "\nInstall dependencies" +npm install --silent + +echo -e "\Build editor client dependencies" +npm run build:prod \ No newline at end of file diff --git a/public/main.php b/public/main.php index 9f3700bef6..8b894f6ec9 100755 --- a/public/main.php +++ b/public/main.php @@ -1,474 +1,525 @@ -post = $post; - } - - /** - * @param Brizy_Editor_Entity $post - * - * @return Brizy_Public_Main - * @throws Exception - */ - static public function get( Brizy_Editor_Entity $post ) { - if ( ! $post->getWpPost() ) { - throw new Exception( 'Unable to create Brizy_Public_Main instance with null wp post' ); - } - - $wpPostId = $post->getWpPost()->ID; - - if ( isset( self::$instance[ $wpPostId ] ) ) { - return self::$instance[ $wpPostId ]; - } - - return self::$instance[ $wpPostId ] = new self( $post ); - } - - public function editMode() { - if ( self::is_editing_page_with_editor( $this->post ) ) { - add_action( 'admin_action_in-front-editor', [ $this, 'loadEditPage' ] ); - } elseif ( self::is_editing_page_with_editor_on_iframe( $this->post ) ) { - add_filter( 'template_include', array( $this, 'templateIncludeForEditor' ), 10000 ); - add_filter( 'show_admin_bar', '__return_false' ); - add_filter( 'body_class', array( $this, 'body_class_editor' ) ); - add_action( 'wp_enqueue_scripts', array( $this, '_action_enqueue_editor_assets' ), 9999 ); - add_filter( 'the_content', array( $this, '_filter_the_content' ), - 12000 ); - add_action( 'brizy_template_content', array( $this, '_action_the_content' ) ); - add_action( 'post_password_required', '__return_false' ); - - } - } - - public function previewMode() { - - if ( ! self::is_view_page( $this->post ) ) { - return; - } - - $this->preparePost(); - - add_action( 'template_include', array( $this, 'templateIncludeForEditor' ), 10000 ); - remove_filter( 'the_content', 'wpautop' ); - // insert the compiled head and content - add_filter( 'body_class', array( $this, 'body_class_frontend' ) ); - add_action( 'wp_head', array( $this, 'insert_page_head' ) ); - add_action( 'admin_bar_menu', array( $this, 'toolbar_link' ), 999 ); - add_action( 'wp_enqueue_scripts', array( $this, '_action_enqueue_preview_assets' ), 9999 ); - add_filter( 'the_content', array( $this, 'insert_page_content' ), - 12000 ); - add_action( 'brizy_template_content', array( $this, 'brizy_the_content' ) ); - } - - /** - * @internal - */ - public function _action_enqueue_editor_assets() { - if ( wp_script_is( 'wp-mediaelement' ) === false ) { - wp_register_script( - 'wp-mediaelement', - "/wp-includes/js/mediaelement/wp-mediaelement.min.js", - array( 'mediaelement' ), - false, - 1 - ); - } - - if ( wp_style_is( 'wp-mediaelement' ) === false ) { - wp_register_style( - 'wp-mediaelement', - "/wp-includes/js/mediaelement/wp-mediaelement.min.css", - array( 'mediaelement' ) - ); - } - - wp_enqueue_media(); - - $urlBuilder = new Brizy_Editor_UrlBuilder(); - $config_object = $this->getConfigObject(); - $assets_url = $config_object->urls->assets; - $client_asset_url = $urlBuilder->plugin_url("/public"); - $editor_js_deps = [ 'brizy-editor-polyfill', 'brizy-editor-vendor' ]; - $editor_js_config = json_encode( $config_object ); - - if ( class_exists( 'WooCommerce' ) ) { - $editor_js_deps[] = 'zoom'; - $editor_js_deps[] = 'photoswipe'; - $editor_js_deps[] = 'flexslider'; - $editor_js_deps[] = 'wc-single-product'; - } - wp_enqueue_style( 'brizy-editor', "${assets_url}/editor/css/editor.css", array(), null ); - wp_register_script( 'brizy-editor-polyfill', "${assets_url}/editor/js/polyfill.js", array(), null, true ); - wp_register_script( 'brizy-editor-vendor', "${assets_url}/editor/js/editor.vendor.js", array(), null, true ); - wp_enqueue_script( 'brizy-client-editor', "${client_asset_url}/editor-client/build/index.js", [ 'brizy-editor-vendor' ], null, true ); - wp_enqueue_script( 'brizy-editor', "${assets_url}/editor/js/editor.js", apply_filters( 'brizy_editor_js_deps', $editor_js_deps ), null, true ); - wp_add_inline_script( 'brizy-editor-vendor', "var __VISUAL_CONFIG__ = ${editor_js_config}; ", 'after' ); - - do_action( 'brizy_editor_enqueue_scripts' ); - - // include REST api authenticate nonce - wp_localize_script( - 'wp-api', - 'wpApiSettings', - array( - 'root' => esc_url_raw( rest_url() ), - 'nonce' => wp_create_nonce( 'wp_rest' ), - 'editorVersion' => BRIZY_EDITOR_VERSION, - 'pluginVersion' => BRIZY_VERSION, - ) - ); - - if ( BRIZY_DEVELOPMENT === true ) { - wp_add_inline_script( - 'brizy-editor', - "window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;", - 'before' - ); - } - } - - /** - * Do not remove this function it is used to compatibilities like astra theme - * - * @internal - */ - public function _action_enqueue_preview_assets() { - Brizy_Public_AssetEnqueueManager::_init()->enqueuePost( $this->post ); - - do_action( 'brizy_preview_enqueue_scripts', $this->post ); - } - - public function toolbar_link( $wp_admin_bar ) { - global $wp_post_types; - - if ( ! Brizy_Editor_User::is_user_allowed() ) { - return; - } - - $type = $this->post->getWpPost()->post_type; - $postTypeLabel = $wp_post_types[ $type ]->labels->singular_name; - $args = array( - 'id' => 'brizy_Edit_page_link', - 'title' => sprintf( __( 'Edit %s with %s', 'brizy' ), $postTypeLabel, __bt( 'brizy', 'Brizy' ) ), - 'href' => apply_filters( 'brizy_toolbar_link', $this->post->edit_url(), $this->post ), - 'meta' => array(), - ); - $wp_admin_bar->add_node( $args ); - } - - public function templateIncludeForEditor( $template ) { - $post = $this->post->getWpPost(); - - $template_path = get_post_meta( $post->ID, '_wp_page_template', true ); - $template_path = ! $template_path && $post->post_type == Brizy_Admin_Templates::CP_TEMPLATE ? Brizy_Config::BRIZY_TEMPLATE_FILE_NAME : $template_path; - - if ( in_array( - basename( $template_path ), - array( - Brizy_Config::BRIZY_BLANK_TEMPLATE_FILE_NAME, - Brizy_Config::BRIZY_TEMPLATE_FILE_NAME, - ) - ) ) { - $urlBuilder = new Brizy_Editor_UrlBuilder(); - - return $urlBuilder->plugin_path( '/public/views/templates/' . $template_path ); - } - - return $template; - } - - public function body_class_frontend( $classes ) { - $classes[] = 'brz'; - - return $classes; - } - - public function body_class_editor( $classes ) { - - $classes[] = 'brz'; - $classes[] = 'brz-ed'; - $classes[] = 'brz-ed--desktop'; - - if ( class_exists( 'WooCommerce' ) ) { - if ( $this->post->getWpPost()->post_type == Brizy_Admin_Templates::CP_TEMPLATE ) { - $classes[] = 'woocommerce'; - } - } - - return $classes; - } - - /** - * @return bool - */ - public static function is_editing_page_with_editor( Brizy_Editor_Post $post = null ) { - return is_admin() && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'in-front-editor' && ( $post ? $post->uses_editor() : true ); - } - - /** - * @return bool - */ - public static function is_editing_page_with_editor_on_iframe( Brizy_Editor_Post $post = null ) { - return ! is_admin() && ! empty( $_REQUEST['is-editor-iframe'] ) && ( $post ? $post->uses_editor() : true ); - } - - public static function is_editing( Brizy_Editor_Post $post = null ) { - return self::is_editing_page_with_editor( $post ) || self::is_editing_page_with_editor_on_iframe( $post ); - } - - /** - * @return bool - */ - public static function is_view_page( Brizy_Editor_Post $post = null ) { - $isView = false; - - if ( ! is_admin() && $post && $post->uses_editor() && ! isset( $_GET['is-editor-iframe'] ) ) { - $isView = true; - - if ( in_array( get_post_status( $post->getWpPost() ), - [ 'future', 'draft', 'pending', 'private' ] ) && ! Brizy_Editor_User::is_user_allowed() ) { - $isView = false; - } - } - - return $isView; - } - - /** - * @param $content - * - * @return string - * - * @internal - */ - function _filter_the_content( $content ) { - if ( is_main_query() && ! doing_filter( 'brizy_content' ) ) { - - try { - //$config_object = $this->getConfigObject(); - $context = array( - //'editorData' => $config_object, - 'editorVersion' => BRIZY_EDITOR_VERSION, - ); - - if ( WP_DEBUG ) { - $context['DEBUG'] = true; - } - - $render_block = Brizy_TwigEngine::instance( self::path( 'views' ) ) - ->render( 'editor.html.twig', $context ); - - return $render_block; - } catch ( Exception $e ) { - return $e->getMessage(); - } - } - - return $content; - } - - public function _action_the_content() { - echo $this->_filter_the_content( '' ); - } - - /** - * Show the compiled page head content - */ - public function insert_page_head() { - if ( ! $this->post->get_compiled_html() ) { - $compiled_html_head = $this->post->get_compiled_html_head(); - $compiled_html_head = Brizy_SiteUrlReplacer::restoreSiteUrl( $compiled_html_head ); - $this->post->set_needs_compile( true )->saveStorage(); - $html = $compiled_html_head; - } else { - $compiled_page = $this->post->get_compiled_page(); - $head = $compiled_page->get_head(); - $html = $head; - } - - if ( empty( $html ) ) { - return; - } - - $params['content'] = apply_filters( - 'brizy_content', - $html, - Brizy_Editor_Project::get(), - $this->post->getWpPost(), - 'head' - ); - - echo Brizy_TwigEngine::instance( self::path( 'views' ) )->render( 'head-partial.html.twig', $params ); - } - - /** - * @param $content - * - * @return null|string|string[] - * @throws Exception - */ - public function insert_page_content( $content ) { - if ( doing_filter( 'brizy_dc_excerpt' ) ) { - return $content; - } - - if ( false === strpos( $content, 'brz-root__container' ) ) { - return $content; - } - - if ( self::$is_excerpt ) { - return apply_filters( 'brizy_content', $content, Brizy_Editor_Project::get(), $this->post->getWpPost(), 'body' ); - } - - $project = Brizy_Editor_Project::get(); - - if ( ! $this->post->get_compiled_html() ) { - $compiled_html_body = $this->post->get_compiled_html_body(); - $content = Brizy_SiteUrlReplacer::restoreSiteUrl( $compiled_html_body ); - $this->post->set_needs_compile( true )->saveStorage(); - } else { - $compiled_page = $this->post->get_compiled_page(); - $content = $compiled_page->get_body(); - } - - return apply_filters( - 'brizy_content', - $content, - $project, - $this->post->getWpPost(), - 'body' - ); - } - - public function brizy_the_content() { - echo do_shortcode( $this->insert_page_content( 'brz-root__container' ) ); - } - - /** - * @param string $rel - * - * @return string - */ - public static function path( $rel ) { - return dirname( __FILE__ ) . "/$rel"; - } - - private function getConfigObject( $context = Brizy_Editor_Editor_Editor::EDITOR_CONTEXT ) { - $editor = Brizy_Editor_Editor_Editor::get( Brizy_Editor_Project::get(), $this->post ); - $config_json = json_encode( $editor->config( $context ) ); - $config_object = json_decode( $config_json ); - - return $config_object; - } - - private function preparePost() { - $is_preview = is_preview() || isset( $_GET['preview'] ); - $needs_compile = ! $this->post->isCompiledWithCurrentVersion() || $this->post->get_needs_compile(); - $autosaveId = null; - if ( $is_preview ) { - $user_id = get_current_user_id(); - $postParentId = $this->post->getWpPostId(); - $autosaveId = Brizy_Editor_AutoSaveAware::getAutoSavePost( $postParentId, $user_id ); - - if ( $autosaveId ) { - $this->post = Brizy_Editor_Post::get( $autosaveId ); - $needs_compile = ! $this->post->isCompiledWithCurrentVersion() || $this->post->get_needs_compile(); - } else { - // we make this false because the page was saved. - $is_preview = false; - } - } - - try { - if ( $is_preview || $needs_compile ) { - $this->post->compile_page(); - } - - if ( ! $is_preview && $needs_compile || $autosaveId ) { - $this->post->saveStorage(); - $this->post->savePost(); - } - - } catch ( Exception $e ) { - Brizy_Logger::instance()->exception( $e ); - } - } - - public function loadEditPage() { - - query_posts( [ - 'p' => $this->post->getWpPostId(), - 'post_type' => get_post_type( $this->post->getWpPostId() ), - ] ); - - // Send MIME Type header like WP admin-header. - @header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); - - $config_object = $this->getConfigObject(); - - $favicon = ''; - if ( has_site_icon() ) { - ob_start(); - ob_clean(); - wp_site_icon(); - $favicon = ob_get_clean(); - } - - $context = array( - 'editorData' => $config_object, - 'editorVersion' => BRIZY_EDITOR_VERSION, - 'iframe_url' => add_query_arg( - [ - 'is-editor-iframe' => time(), - 'post' => $this->post->getWpPostId() - ], - get_permalink( $this->post->getWpPostId() ) - ), - 'page_title' => apply_filters( - 'the_title', - $this->post->getWpPost()->post_title, - $this->post->getWpPostId() - ), - 'favicon' => $favicon, - 'styles' => [ $config_object->urls->assets . "/editor/css/editor.css" ], - 'scripts' => [ $config_object->urls->assets . "/editor/js/polyfill.js" ], - ); - - if ( defined( 'BRIZY_DEVELOPMENT' ) ) { - $context['DEBUG'] = true; - } - - $context = apply_filters( 'brizy_editor_page_context', $context ); - - if ( ! $context ) { - throw new Exception( 'Invalid template context. Probably a bad filter implementation' ); - } - - echo Brizy_TwigEngine::instance( self::path( 'views' ) )->render( 'page.html.twig', $context ); - - die(); - } +class Brizy_Public_Main +{ + + /** + * @var Brizy_Public_Main[] + */ + static $instance = null; + + /** + * @var Brizy_Editor_Post + */ + private $post; + + static $is_excerpt = false; + + /** + * Brizy_Public_Main constructor. + * + * @param Brizy_Editor_Entity $post + */ + private function __construct(Brizy_Editor_Entity $post) + { + $this->post = $post; + } + + /** + * @param Brizy_Editor_Entity $post + * + * @return Brizy_Public_Main + * @throws Exception + */ + static public function get(Brizy_Editor_Entity $post) + { + if ( ! $post->getWpPost()) { + throw new Exception('Unable to create Brizy_Public_Main instance with null wp post'); + } + + $wpPostId = $post->getWpPost()->ID; + + if (isset(self::$instance[$wpPostId])) { + return self::$instance[$wpPostId]; + } + + return self::$instance[$wpPostId] = new self($post); + } + + public function editMode() + { + if (self::is_editing_page_with_editor($this->post)) { + add_action('admin_action_in-front-editor', [$this, 'loadEditPage']); + } elseif (self::is_editing_page_with_editor_on_iframe($this->post)) { + add_filter('template_include', array($this, 'templateIncludeForEditor'), 10000); + add_filter('show_admin_bar', '__return_false'); + add_filter('body_class', array($this, 'body_class_editor')); + add_action('wp_enqueue_scripts', array($this, '_action_enqueue_editor_assets'), 9999); + add_filter('the_content', array($this, '_filter_the_content'), -12000); + add_action('brizy_template_content', array($this, '_action_the_content')); + add_action('post_password_required', '__return_false'); + + } + } + + public function previewMode() + { + + if ( ! self::is_view_page($this->post)) { + return; + } + + $this->preparePost(); + + add_action('template_include', array($this, 'templateIncludeForEditor'), 10000); + remove_filter('the_content', 'wpautop'); + // insert the compiled head and content + add_filter('body_class', array($this, 'body_class_frontend')); + add_action('wp_head', array($this, 'insert_page_head')); + add_action('admin_bar_menu', array($this, 'toolbar_link'), 999); + add_action('wp_enqueue_scripts', array($this, '_action_enqueue_preview_assets'), 9999); + add_filter('the_content', array($this, 'insert_page_content'), -12000); + add_action('brizy_template_content', array($this, 'brizy_the_content')); + } + + /** + * @internal + */ + public function _action_enqueue_editor_assets() + { + if (wp_script_is('wp-mediaelement') === false) { + wp_register_script( + 'wp-mediaelement', + "/wp-includes/js/mediaelement/wp-mediaelement.min.js", + array('mediaelement'), + false, + 1 + ); + } + + if (wp_style_is('wp-mediaelement') === false) { + wp_register_style( + 'wp-mediaelement', + "/wp-includes/js/mediaelement/wp-mediaelement.min.css", + array('mediaelement') + ); + } + + wp_enqueue_media(); + + $urlBuilder = new Brizy_Editor_UrlBuilder(); + $config_object = $this->getConfigObject(); + $assets_url = $config_object->urls->assets; + $client_asset_url = $urlBuilder->plugin_url("/public"); + $editor_js_deps = ['brizy-editor-polyfill', 'brizy-editor-vendor']; + $editor_js_config = json_encode($config_object); + + if (class_exists('WooCommerce')) { + $editor_js_deps[] = 'zoom'; + $editor_js_deps[] = 'photoswipe'; + $editor_js_deps[] = 'flexslider'; + $editor_js_deps[] = 'wc-single-product'; + } + wp_enqueue_style('brizy-editor', "${assets_url}/editor/css/editor.css", array(), null); + wp_register_script('brizy-editor-polyfill', "${assets_url}/editor/js/polyfill.js", array(), null, true); + wp_register_script('brizy-editor-vendor', "${assets_url}/editor/js/editor.vendor.js", array(), null, true); + wp_enqueue_script( + 'brizy-client-editor', + "${client_asset_url}/editor-client/build/index.js", + ['brizy-editor-vendor'], + null, + true + ); + wp_enqueue_script( + 'brizy-editor', + "${assets_url}/editor/js/editor.js", + apply_filters('brizy_editor_js_deps', $editor_js_deps), + null, + true + ); + wp_add_inline_script('brizy-editor-vendor', "var __VISUAL_CONFIG__ = ${editor_js_config}; ", 'after'); + wp_add_inline_script( + 'brizy-client-editor', + "var __BRZ_PLUGIN_ENV__ = { hash: '".wp_create_nonce( + Brizy_Editor_API::nonce + )."'; editorVersion: '".BRIZY_EDITOR_VERSION."'; };", + 'before' + ); + + do_action('brizy_editor_enqueue_scripts'); + + // include REST api authenticate nonce + wp_localize_script( + 'wp-api', + 'wpApiSettings', + array( + 'root' => esc_url_raw(rest_url()), + 'nonce' => wp_create_nonce('wp_rest'), + 'editorVersion' => BRIZY_EDITOR_VERSION, + 'pluginVersion' => BRIZY_VERSION, + ) + ); + + if (BRIZY_DEVELOPMENT === true) { + wp_add_inline_script( + 'brizy-editor', + "window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;", + 'before' + ); + } + } + + /** + * Do not remove this function it is used to compatibilities like astra theme + * + * @internal + */ + public function _action_enqueue_preview_assets() + { + Brizy_Public_AssetEnqueueManager::_init()->enqueuePost($this->post); + + do_action('brizy_preview_enqueue_scripts', $this->post); + } + + public function toolbar_link($wp_admin_bar) + { + global $wp_post_types; + + if ( ! Brizy_Editor_User::is_user_allowed()) { + return; + } + + $type = $this->post->getWpPost()->post_type; + $postTypeLabel = $wp_post_types[$type]->labels->singular_name; + $args = array( + 'id' => 'brizy_Edit_page_link', + 'title' => sprintf(__('Edit %s with %s', 'brizy'), $postTypeLabel, __bt('brizy', 'Brizy')), + 'href' => apply_filters('brizy_toolbar_link', $this->post->edit_url(), $this->post), + 'meta' => array(), + ); + $wp_admin_bar->add_node($args); + } + + public function templateIncludeForEditor($template) + { + $post = $this->post->getWpPost(); + + $template_path = get_post_meta($post->ID, '_wp_page_template', true); + $template_path = ! $template_path && $post->post_type == Brizy_Admin_Templates::CP_TEMPLATE ? Brizy_Config::BRIZY_TEMPLATE_FILE_NAME : $template_path; + + if (in_array( + basename($template_path), + array( + Brizy_Config::BRIZY_BLANK_TEMPLATE_FILE_NAME, + Brizy_Config::BRIZY_TEMPLATE_FILE_NAME, + ) + )) { + $urlBuilder = new Brizy_Editor_UrlBuilder(); + + return $urlBuilder->plugin_path('/public/views/templates/'.$template_path); + } + + return $template; + } + + public function body_class_frontend($classes) + { + $classes[] = 'brz'; + + return $classes; + } + + public function body_class_editor($classes) + { + + $classes[] = 'brz'; + $classes[] = 'brz-ed'; + $classes[] = 'brz-ed--desktop'; + + if (class_exists('WooCommerce')) { + if ($this->post->getWpPost()->post_type == Brizy_Admin_Templates::CP_TEMPLATE) { + $classes[] = 'woocommerce'; + } + } + + return $classes; + } + + /** + * @return bool + */ + public static function is_editing_page_with_editor(Brizy_Editor_Post $post = null) + { + return is_admin( + ) && isset($_REQUEST['action']) && $_REQUEST['action'] == 'in-front-editor' && ($post ? $post->uses_editor( + ) : true); + } + + /** + * @return bool + */ + public static function is_editing_page_with_editor_on_iframe(Brizy_Editor_Post $post = null) + { + return ! is_admin() && ! empty($_REQUEST['is-editor-iframe']) && ($post ? $post->uses_editor() : true); + } + + public static function is_editing(Brizy_Editor_Post $post = null) + { + return self::is_editing_page_with_editor($post) || self::is_editing_page_with_editor_on_iframe($post); + } + + /** + * @return bool + */ + public static function is_view_page(Brizy_Editor_Post $post = null) + { + $isView = false; + + if ( ! is_admin() && $post && $post->uses_editor() && ! isset($_GET['is-editor-iframe'])) { + $isView = true; + + if (in_array( + get_post_status($post->getWpPost()), + ['future', 'draft', 'pending', 'private'] + ) && ! Brizy_Editor_User::is_user_allowed()) { + $isView = false; + } + } + + return $isView; + } + + /** + * @param $content + * + * @return string + * + * @internal + */ + function _filter_the_content($content) + { + if (is_main_query() && ! doing_filter('brizy_content')) { + + try { + //$config_object = $this->getConfigObject(); + $context = array( + //'editorData' => $config_object, + 'editorVersion' => BRIZY_EDITOR_VERSION, + ); + + if (WP_DEBUG) { + $context['DEBUG'] = true; + } + + $render_block = Brizy_TwigEngine::instance(self::path('views')) + ->render('editor.html.twig', $context); + + return $render_block; + } catch (Exception $e) { + return $e->getMessage(); + } + } + + return $content; + } + + public function _action_the_content() + { + echo $this->_filter_the_content(''); + } + + /** + * Show the compiled page head content + */ + public function insert_page_head() + { + if ( ! $this->post->get_compiled_html()) { + $compiled_html_head = $this->post->get_compiled_html_head(); + $compiled_html_head = Brizy_SiteUrlReplacer::restoreSiteUrl($compiled_html_head); + $this->post->set_needs_compile(true)->saveStorage(); + $html = $compiled_html_head; + } else { + $compiled_page = $this->post->get_compiled_page(); + $head = $compiled_page->get_head(); + $html = $head; + } + + if (empty($html)) { + return; + } + + $params['content'] = apply_filters( + 'brizy_content', + $html, + Brizy_Editor_Project::get(), + $this->post->getWpPost(), + 'head' + ); + + echo Brizy_TwigEngine::instance(self::path('views'))->render('head-partial.html.twig', $params); + } + + /** + * @param $content + * + * @return null|string|string[] + * @throws Exception + */ + public function insert_page_content($content) + { + if (doing_filter('brizy_dc_excerpt')) { + return $content; + } + + if (false === strpos($content, 'brz-root__container')) { + return $content; + } + + if (self::$is_excerpt) { + return apply_filters( + 'brizy_content', + $content, + Brizy_Editor_Project::get(), + $this->post->getWpPost(), + 'body' + ); + } + + $project = Brizy_Editor_Project::get(); + + if ( ! $this->post->get_compiled_html()) { + $compiled_html_body = $this->post->get_compiled_html_body(); + $content = Brizy_SiteUrlReplacer::restoreSiteUrl($compiled_html_body); + $this->post->set_needs_compile(true)->saveStorage(); + } else { + $compiled_page = $this->post->get_compiled_page(); + $content = $compiled_page->get_body(); + } + + return apply_filters( + 'brizy_content', + $content, + $project, + $this->post->getWpPost(), + 'body' + ); + } + + public function brizy_the_content() + { + echo do_shortcode($this->insert_page_content('brz-root__container')); + } + + /** + * @param string $rel + * + * @return string + */ + public static function path($rel) + { + return dirname(__FILE__)."/$rel"; + } + + private function getConfigObject($context = Brizy_Editor_Editor_Editor::EDITOR_CONTEXT) + { + $editor = Brizy_Editor_Editor_Editor::get(Brizy_Editor_Project::get(), $this->post); + $config_json = json_encode($editor->config($context)); + $config_object = json_decode($config_json); + + return $config_object; + } + + private function preparePost() + { + $is_preview = is_preview() || isset($_GET['preview']); + $needs_compile = ! $this->post->isCompiledWithCurrentVersion() || $this->post->get_needs_compile(); + $autosaveId = null; + if ($is_preview) { + $user_id = get_current_user_id(); + $postParentId = $this->post->getWpPostId(); + $autosaveId = Brizy_Editor_AutoSaveAware::getAutoSavePost($postParentId, $user_id); + + if ($autosaveId) { + $this->post = Brizy_Editor_Post::get($autosaveId); + $needs_compile = ! $this->post->isCompiledWithCurrentVersion() || $this->post->get_needs_compile(); + } else { + // we make this false because the page was saved. + $is_preview = false; + } + } + + try { + if ($is_preview || $needs_compile) { + $this->post->compile_page(); + } + + if ( ! $is_preview && $needs_compile || $autosaveId) { + $this->post->saveStorage(); + $this->post->savePost(); + } + + } catch (Exception $e) { + Brizy_Logger::instance()->exception($e); + } + } + + public function loadEditPage() + { + + query_posts([ + 'p' => $this->post->getWpPostId(), + 'post_type' => get_post_type($this->post->getWpPostId()), + ]); + + // Send MIME Type header like WP admin-header. + @header('Content-Type: '.get_option('html_type').'; charset='.get_option('blog_charset')); + + $config_object = $this->getConfigObject(); + + $favicon = ''; + if (has_site_icon()) { + ob_start(); + ob_clean(); + wp_site_icon(); + $favicon = ob_get_clean(); + } + + $context = array( + 'editorData' => $config_object, + 'editorVersion' => BRIZY_EDITOR_VERSION, + 'iframe_url' => add_query_arg( + [ + 'is-editor-iframe' => time(), + 'post' => $this->post->getWpPostId(), + ], + get_permalink($this->post->getWpPostId()) + ), + 'page_title' => apply_filters( + 'the_title', + $this->post->getWpPost()->post_title, + $this->post->getWpPostId() + ), + 'favicon' => $favicon, + 'styles' => [$config_object->urls->assets."/editor/css/editor.css"], + 'scripts' => [$config_object->urls->assets."/editor/js/polyfill.js"], + ); + + if (defined('BRIZY_DEVELOPMENT')) { + $context['DEBUG'] = true; + } + + $context = apply_filters('brizy_editor_page_context', $context); + + if ( ! $context) { + throw new Exception('Invalid template context. Probably a bad filter implementation'); + } + + echo Brizy_TwigEngine::instance(self::path('views'))->render('page.html.twig', $context); + + die(); + } } From 0f22f1293410904cb5ce9db2fef9b57edf1ccbc6 Mon Sep 17 00:00:00 2001 From: Alex Zaharia Date: Wed, 21 Dec 2022 16:38:57 +0200 Subject: [PATCH 15/15] new: added actions in client config --- editor/editor/editor.php | 39 +++++++++++++++++++++++++-------------- public/main.php | 21 ++++++++++++++++----- 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/editor/editor/editor.php b/editor/editor/editor.php index 79e118a7dd..cad89ad2c9 100755 --- a/editor/editor/editor.php +++ b/editor/editor/editor.php @@ -78,6 +78,18 @@ private function getMode($postType) } } + public function getClientConfig($context) + { + $config = [ + 'hash' => wp_create_nonce(Brizy_Editor_API::nonce), + 'editorVersion' => BRIZY_EDITOR_VERSION, + 'url' => set_url_scheme(admin_url('admin-ajax.php')), + 'actions' => $this->getApiActions(), + ]; + + return $config; + } + /** * @throws Exception */ @@ -184,14 +196,14 @@ public function config($context = self::COMPILE_CONTEXT) ); $manager = new Brizy_Editor_Accounts_ServiceAccountManager(Brizy_Editor_Project::get()); - $config = $this->addRecaptchaAccounts($manager, $config, $context); - $config = $this->addSocialAccounts($manager, $config, $context); - $config = $this->addWpPostTypes($config, $context); - $config = $this->addTemplateFields($config, $mode === 'template', $wp_post_id, $context); - $config = $this->getApiActions($config, $context); - $config = $this->addGlobalBlocksData($config); - $config = $this->addGlobalBlocksData($config); - $config = $this->getPostLoopSources($config, $mode === 'template', $wp_post_id, $context); + $config = $this->addRecaptchaAccounts($manager, $config, $context); + $config = $this->addSocialAccounts($manager, $config, $context); + $config = $this->addWpPostTypes($config, $context); + $config = $this->addTemplateFields($config, $mode === 'template', $wp_post_id, $context); + $config = $this->addGlobalBlocksData($config); + $config = $this->addGlobalBlocksData($config); + $config = $this->getPostLoopSources($config, $mode === 'template', $wp_post_id, $context); + $config['wp']['api'] = $this->getApiActions($config, $context); self::$config[$cachePostId] = apply_filters('brizy_editor_config', $config, $context); @@ -1027,15 +1039,14 @@ public function getProjectStatus() /** * @return array */ - public function getApiActions($config, $context) + public function getApiActions($config = [], $context = null) { $pref = Brizy_Editor::prefix(); - $config['wp']['api'] = array( - 'hash' => wp_create_nonce(Brizy_Editor_API::nonce), - 'url' => set_url_scheme(admin_url('admin-ajax.php')), - + $actions = array( + 'hash' => wp_create_nonce(Brizy_Editor_API::nonce), + 'url' => set_url_scheme(admin_url('admin-ajax.php')), 'heartBeat' => $pref.Brizy_Editor_API::AJAX_HEARTBEAT, 'takeOver' => $pref.Brizy_Editor_API::AJAX_TAKE_OVER, 'lockProject' => $pref.Brizy_Editor_API::AJAX_LOCK_PROJECT, @@ -1125,7 +1136,7 @@ public function getApiActions($config, $context) ); - return $config; + return $actions; } /** diff --git a/public/main.php b/public/main.php index 8b894f6ec9..92def3e8f1 100755 --- a/public/main.php +++ b/public/main.php @@ -111,12 +111,16 @@ public function _action_enqueue_editor_assets() wp_enqueue_media(); - $urlBuilder = new Brizy_Editor_UrlBuilder(); - $config_object = $this->getConfigObject(); + $urlBuilder = new Brizy_Editor_UrlBuilder(); + $config_object = $this->getConfigObject(); + $client_config_object = $this->getClientConfigObject(); + + $assets_url = $config_object->urls->assets; $client_asset_url = $urlBuilder->plugin_url("/public"); $editor_js_deps = ['brizy-editor-polyfill', 'brizy-editor-vendor']; $editor_js_config = json_encode($config_object); + $client_js_config = json_encode($client_config_object); if (class_exists('WooCommerce')) { $editor_js_deps[] = 'zoom'; @@ -144,9 +148,7 @@ public function _action_enqueue_editor_assets() wp_add_inline_script('brizy-editor-vendor', "var __VISUAL_CONFIG__ = ${editor_js_config}; ", 'after'); wp_add_inline_script( 'brizy-client-editor', - "var __BRZ_PLUGIN_ENV__ = { hash: '".wp_create_nonce( - Brizy_Editor_API::nonce - )."'; editorVersion: '".BRIZY_EDITOR_VERSION."'; };", + "var __BRZ_PLUGIN_ENV__ = ${client_js_config}; ", 'before' ); @@ -433,6 +435,15 @@ private function getConfigObject($context = Brizy_Editor_Editor_Editor::EDITOR_C return $config_object; } + private function getClientConfigObject($context = Brizy_Editor_Editor_Editor::EDITOR_CONTEXT) + { + $editor = Brizy_Editor_Editor_Editor::get(Brizy_Editor_Project::get(), $this->post); + $config_json = json_encode($editor->getClientConfig($context)); + $config_object = json_decode($config_json); + + return $config_object; + } + private function preparePost() { $is_preview = is_preview() || isset($_GET['preview']);