From a989f0dc486e43be2dcde3304a299b636233d447 Mon Sep 17 00:00:00 2001 From: Jakub Mikita Date: Fri, 21 Apr 2023 08:05:16 +0200 Subject: [PATCH 001/327] fix: shortcode stripping regex --- readme.txt | 4 ++++ src/Abstracts/Carrier.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index a3e807466..1ea7010f4 100644 --- a/readme.txt +++ b/readme.txt @@ -302,6 +302,10 @@ Yes! We're offering a [custom plugin development](https://bracketspace.com/custo == Changelog == += [Next] = + +* [Fixed] Shortcodes being uncorrectly stripped leaving closing "]" behind. + = 8.0.15 = * [Fixed] Comment merge tags rendering empty values. diff --git a/src/Abstracts/Carrier.php b/src/Abstracts/Carrier.php index ef57f145e..c5d369291 100644 --- a/src/Abstracts/Carrier.php +++ b/src/Abstracts/Carrier.php @@ -385,7 +385,7 @@ protected function resolve_value( $value, Triggerable $trigger ) { ); if ( $strip_shortcodes ) { - $resolved = preg_replace( '@\[([^<>&/\[\]\x00-\x20=]++)@', '', $resolved ); + $resolved = preg_replace( '@\[([^<>&\\[\]\x00-\x20=]++)\]@', '', $resolved ); } else { $resolved = do_shortcode( $resolved ); } From 6a94d42c0aaea701ad98efe5b2ceca1865e136e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Sat, 24 Jun 2023 23:00:50 +0200 Subject: [PATCH 002/327] Merge phpstan baseline for register-hooks.php (#384) * Merge phpstan baseline for register-hooks.php * Update phpstan-baseline.neon * Update phpstan.neon.dist --------- Co-authored-by: Jakub Mikita --- phpstan.neon.dist | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 5086e6b40..0a279b7f2 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -20,3 +20,8 @@ parameters: ignoreErrors: # Uses func_get_args() - '#^Function apply_filters(_ref_array)? invoked with [34567] parameters, 2 required\.$#' + # PHPStan + - + message: "#^Parameter \\#2 \\$callback of function add_action expects callable\\(\\)\\: mixed, array\\(mixed, '\\S+'\\) given\\.$#" + count: 81 + path: compat/register-hooks.php From f7007ff556bc1d3965c01dba1f97557f34b150d5 Mon Sep 17 00:00:00 2001 From: Krystian Wojciechowski Date: Sat, 24 Jun 2023 23:01:34 +0200 Subject: [PATCH 003/327] change wp coding standards to psr (#431) * chore: Add PSR-12 to project and adjust phpcs.xml * refactor: first phpcbf after implementing new PSR * refactor: make strict type appear behind file docblock * refactor: all variables declaration with $ changed to camelCase * refactor: all variables & methods declaration with '->' changed to camelCase * refactor: all functions names changed to camelCase * refactor: all static declarations to camelCase * refactor: /resources variables to camelCase * refactor: /resources '->' declarations to camelCase * refactor: /resources static declarations to camelCase * refactor: /src phpstorm code refactor + phpcbf * refactor: /src + /resources phpstorm code refactor + phpcbf * refactor: fix rest of 120+ chars + phpcbf * refactor: add in @var array * refactor: add //translators above __() * refactor: fix rest of 120 chars+ * refactor: allow print_r, define, list in some places * refactor: fix docblocks + phpcs rule * refactor: fix docblocks + print_r * refactor: last fixes (clear phpcs) * fix: const TEMPLATESTORAGE changed to TEMPLATE_STORAGE * refactor: notification.php adjustment to new standard * fix: Runtime.php - change call to Micropackage methods to snake_case & call notification methods to camelCase * fix: Runtime.php - notificationRegisterSettings called snake_case methods * fix: Runtime.php - DocHooksHelper calls method snake_case * fix: Runtime.php - load_default to loadDefault * fix: CarrierRepository.php - notification method to camelCase * refactor: change all notification_get_setting to notificationGetSetting * refactor: fix rest of notification_ methods * fix: wpdb get_col method * fix: Notification.php - get_carriers * refactor: change add_action methods used with $this name to camelCase * fix: metabox.php - getVars -> get_vars() * fix: image_to_base64 to snake_case * fix: WP_Screen post_type change to snake_case * todo - cannot bind instance to static closure * fix - screen WP_Screen methods and props called camelCase * fix: functions.php - methods from plugin have to be called camelCase * fix: Adapter.php - phpstan iterable type array * fix: Extensions.php - WP_Error methods * refactor: phpstan - * @params array now have attached * refactor: notification magic methods to camelCase * refactor: navigate settings object to class in @param * refactor: array on @returns * refactor: PostType.php - array on @returns * fix: rest of array types, cases etc. PHPSTAN CLEAR * fix: magic methods __call in Core/Notification.php * fix: method the_esc was called by camelCase in templates * fix: singularName called on labels changed to snake_case * fix: singular_name * fix: Core/Debugging $wpdb methods call snake_case * fix: notificationLog $rawLog->time_logged * fix: core/notification setter * fix: notification log - time ago notification was sent * fix: trigger descriptions break line made issue with [[ ]] in options * fix: rest api check and repeaterControllers fields (callback method to camelCase) * fix: $post->postName PostUpdated trigger * fix: $resolver->getPattern() retruns static instead of self * fix: $resolver->getPriority() retruns static instead of self * fix: hint type $carrier to Abstract/Carrier in Proccessor.php * fix: Core/Resolver call to [$resolver, 'resolve_merge_tag'] to camelCase * fix: rest of method_exists, is_callable, call_user_func * fix: exclude rule DisallowLateStaticBindingForConstants.DisallowedLateStaticBindingForConstant * fix: solve MergeTags * refactor: copy snake_case function from api.php to depracted * fix: load casegnostic via VCS * feat: Casegnostic part 1 * fix: repair chanel fetch for recipient * refactor: remove abstract formFields() method from Carrier * fix: abstract/Recipient Casegnostic * refactor: remove magic methods from Core/Notification make getters and setters * fix: remove abstract from parseValue Abstracts/Recipient * refactor: add Casegnostic to Abstracts/Adapter * fix: add getter and setter to enabled property * feat: add casegnostic to Abstracts/Trigger * fix: remove file put contets from Carrier * Revert "fix: remove file put contets from Carrier" This reverts commit 593467f06e1e43763b0409c416d9017de54cb127. * fix: remove file put contets from Carrier * refactor: remove abstract methods from Trigger:mergeTags() and Resolver::resolveMergeTags() * fix: deprecated functions now take Core\Notification as a param * fix: change $this->{$this->postType} into $this->posts[$this->postType] in PostTriggers * fix: return type for Resolver::resolveMergeTag * feat: casegnostic to WpObjectHelper * refactor: rebuild mergeTags method * fix: phpstan memory limit * feat: casegnostic notification store * refactor: rebuild formFields method * fix: typo in Carrier rebuild formFields method * feat: add Casegnostic to Admin/Screen and Core/Processor * feat: Abstracts/Adapter & Field Casegnostic for Review Queue * refactor: phpcbf * fix: delete file_put_contents * fix: remove file put contents * refactor: phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps * refactor: phpcs:disable Squiz.NamingConventions.ValidVariableName.NotCamelCaps * refactor: add return type to setters in Core/Notification * refactor: define type of $post * refactor: change import * refactor: make $filename variable as string * fix: adjust param type in setTrigger method * fix: phpstan parameter X expects array ... * fix: phpcbf to clean up * fix: correct conflict solve * fix: delete composer.lock * fix: add composer.lock * fix: remove nullable type declarations * fix: phpcs ignore SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue.NullabilitySymbolRequired * refactor: change type of $version into string * refactor: add Casegnostic to Sync, Whitelabel, Store/Recipient and Traits - ClassUtils, HasName, HasSlug * refactor: return version as string * refactor: phpcbf * Revert "refactor: change type of $version into string" This reverts commit 19d40b8d6cee2b658cbcc082486d82596df156b4. * Revert "refactor: return version as string" This reverts commit f3e9effb * refactor: remove dynamic getter setter allocation from tests * fix: make version as int in tests * refactor: add casegnostic to Helper/Registerer * refactor: remove php 7.0 from git tests, add 8.0 and 8.1 * git tests: remove 7.1, 7.2, 7.3 * fix: casegnostic overwritten (?) * fix: remove casegnostic from Registerer.php * refactor: test Helper Carrier method form_fields to camel case * refactor: setter won't throw exception due to Casegnostic * refactor: getter won't throw exception due to Casegnostic * refactor: notification_add to camel case in test helper * git tests: only 7.4 and 8.0 * git tests: from 7.4 to 8.1 + ignore-platform-reqs * git tests: ignore-platform-reqs to composer bin * git tests: ignore-platform-reqs everywhere * git tests: remove ignore-platform-reqs everywhere * git tests: remove platform-check in composer * refactor: remove casegnostic from HasName and HasSlug traits * refactor: remove casegnostic from ClassUtils.php * refactor: add Casegnostic to test DummyClass * chore: remove casegnostic vcs entry * fix: preg replace fatal error on php8 * feat: add missing setSourcePostId method on notification * fix: lint errors * fix: lint errors --------- Co-authored-by: Jakub Mikita --- .github/workflows/test.yml | 2 +- compat/src-deprecated/functions.php | 187 ++- composer.json | 9 +- composer.lock | 853 +++++++--- load.php | 13 +- notification.php | 16 +- phpcs.xml | 122 +- phpstan-baseline.neon | 40 +- phpstan.neon.dist | 1 + .../fields/repeater/mixins/inputsHandler.js | 2 +- resources/templates/box.php | 90 +- resources/templates/carriers/widget-add.php | 101 +- resources/templates/debug/error-log.php | 70 +- .../templates/debug/notification-log.php | 200 ++- resources/templates/debug/pagination.php | 27 +- resources/templates/export/notifications.php | 51 +- .../templates/extension/activation-error.php | 19 +- .../extension/activation-success.php | 15 +- resources/templates/extension/bundle.php | 43 +- .../extension/extension-box-premium.php | 205 ++- .../templates/extension/extension-box.php | 192 ++- resources/templates/extension/page.php | 83 +- resources/templates/extension/promo-box.php | 64 +- resources/templates/form/empty-form.php | 20 +- resources/templates/form/field-hidden.php | 13 +- resources/templates/form/field.php | 86 +- resources/templates/form/table.php | 68 +- .../templates/help/global-merge-tags.php | 52 +- resources/templates/help/sidebar.php | 62 +- resources/templates/import/notifications.php | 29 +- .../templates/mergetag/metabox-accordion.php | 59 +- resources/templates/mergetag/metabox-list.php | 48 +- .../mergetag/metabox-nomergetags.php | 20 +- .../templates/mergetag/metabox-notrigger.php | 20 +- resources/templates/mergetag/searchbox.php | 26 +- resources/templates/mergetag/tag.php | 44 +- resources/templates/save-metabox.php | 112 +- resources/templates/settings/page.php | 186 ++- resources/templates/sync/actions.php | 27 +- resources/templates/sync/disabled.php | 25 +- .../templates/sync/notifications-empty.php | 13 +- resources/templates/sync/notifications.php | 88 +- resources/templates/trigger/metabox.php | 58 +- resources/templates/trigger/select.php | 57 +- resources/templates/upsell/carriers-list.php | 49 +- .../templates/upsell/carriers-upsell.php | 12 +- .../templates/upsell/conditionals-metabox.php | 57 +- .../templates/upsell/custom-development.php | 29 +- .../upsell/custom-fields-mergetag-group.php | 34 +- .../templates/upsell/review-queue-switch.php | 30 +- .../upsell/scheduled-triggers-setting.php | 30 +- .../templates/upsell/triggers-upsell.php | 12 +- resources/templates/wizard.php | 142 +- src/Abstracts/Adapter.php | 69 +- src/Abstracts/Carrier.php | 529 +++--- src/Abstracts/Field.php | 146 +- src/Abstracts/MergeTag.php | 210 ++- src/Abstracts/Recipient.php | 55 +- src/Abstracts/Resolver.php | 48 +- src/Abstracts/Trigger.php | 338 ++-- src/Admin/CheckRestApi.php | 61 +- src/Admin/Debugging.php | 277 +++- src/Admin/Extensions.php | 548 +++--- src/Admin/ImportExport.php | 274 +-- src/Admin/NotificationDuplicator.php | 101 +- src/Admin/PostTable.php | 284 ++-- src/Admin/PostType.php | 465 ++++-- src/Admin/Screen.php | 413 +++-- src/Admin/Scripts.php | 137 +- src/Admin/Settings.php | 1472 +++++++++++------ src/Admin/Sync.php | 171 +- src/Admin/Upsell.php | 215 ++- src/Admin/Wizard.php | 428 +++-- src/Api/Api.php | 64 +- src/Api/Controller/CheckRestApiController.php | 14 +- src/Api/Controller/RepeaterController.php | 213 +-- .../Controller/SectionRepeaterController.php | 106 +- src/Api/Controller/SelectInputController.php | 69 +- src/Cli/DumpHooks.php | 85 +- src/Core/Binder.php | 30 +- src/Core/Cron.php | 100 +- src/Core/Debugging.php | 205 ++- src/Core/License.php | 277 ++-- src/Core/Notification.php | 561 ++++--- src/Core/Processor.php | 199 ++- src/Core/Queue.php | 103 +- src/Core/Resolver.php | 56 +- src/Core/Runner.php | 132 +- src/Core/Settings.php | 82 +- src/Core/Sync.php | 183 +- src/Core/Templates.php | 61 +- src/Core/Upgrade.php | 273 +-- src/Core/Whitelabel.php | 81 +- src/Defaults/Adapter/JSON.php | 46 +- src/Defaults/Adapter/WordPress.php | 175 +- src/Defaults/Carrier/Email.php | 397 +++-- src/Defaults/Carrier/Webhook.php | 292 +++- src/Defaults/Carrier/WebhookJson.php | 221 ++- src/Defaults/Field/CheckboxField.php | 49 +- src/Defaults/Field/CodeEditorField.php | 49 +- src/Defaults/Field/ColorPickerField.php | 46 +- src/Defaults/Field/EditorField.php | 43 +- src/Defaults/Field/ImageField.php | 41 +- src/Defaults/Field/InputField.php | 68 +- src/Defaults/Field/MessageField.php | 55 +- src/Defaults/Field/NonceField.php | 42 +- src/Defaults/Field/RecipientsField.php | 93 +- src/Defaults/Field/RepeaterField.php | 140 +- src/Defaults/Field/SectionRepeater.php | 141 +- src/Defaults/Field/SectionsField.php | 35 +- src/Defaults/Field/SelectField.php | 47 +- src/Defaults/Field/TextareaField.php | 49 +- src/Defaults/MergeTag/BooleanTag.php | 29 +- .../MergeTag/Comment/CommentActionApprove.php | 55 +- .../MergeTag/Comment/CommentActionDelete.php | 52 +- .../MergeTag/Comment/CommentActionSpam.php | 50 +- .../MergeTag/Comment/CommentActionTrash.php | 50 +- .../MergeTag/Comment/CommentAuthorIP.php | 50 +- .../MergeTag/Comment/CommentAuthorUrl.php | 55 +- .../Comment/CommentAuthorUserAgent.php | 50 +- .../MergeTag/Comment/CommentContent.php | 49 +- .../MergeTag/Comment/CommentContentHtml.php | 49 +- src/Defaults/MergeTag/Comment/CommentID.php | 44 +- .../MergeTag/Comment/CommentIsReply.php | 59 +- .../MergeTag/Comment/CommentStatus.php | 81 +- src/Defaults/MergeTag/Comment/CommentType.php | 42 +- src/Defaults/MergeTag/DateTime/Date.php | 62 +- src/Defaults/MergeTag/DateTime/DateTime.php | 64 +- src/Defaults/MergeTag/DateTime/Time.php | 71 +- src/Defaults/MergeTag/EmailTag.php | 29 +- src/Defaults/MergeTag/FloatTag.php | 29 +- src/Defaults/MergeTag/HtmlTag.php | 26 +- src/Defaults/MergeTag/IPTag.php | 27 +- src/Defaults/MergeTag/IntegerTag.php | 29 +- .../MergeTag/Media/AttachmentDirectUrl.php | 48 +- src/Defaults/MergeTag/Media/AttachmentID.php | 36 +- .../MergeTag/Media/AttachmentMimeType.php | 36 +- .../MergeTag/Media/AttachmentPage.php | 41 +- .../MergeTag/Media/AttachmentTitle.php | 41 +- .../MergeTag/Post/FeaturedImageId.php | 49 +- .../MergeTag/Post/FeaturedImageUrl.php | 48 +- src/Defaults/MergeTag/Post/PostContent.php | 48 +- .../MergeTag/Post/PostContentHtml.php | 48 +- src/Defaults/MergeTag/Post/PostExcerpt.php | 45 +- src/Defaults/MergeTag/Post/PostID.php | 40 +- src/Defaults/MergeTag/Post/PostPermalink.php | 45 +- src/Defaults/MergeTag/Post/PostSlug.php | 45 +- src/Defaults/MergeTag/Post/PostStatus.php | 40 +- src/Defaults/MergeTag/Post/PostTerms.php | 66 +- src/Defaults/MergeTag/Post/PostTitle.php | 45 +- src/Defaults/MergeTag/Post/PostType.php | 32 +- src/Defaults/MergeTag/Post/RevisionLink.php | 58 +- src/Defaults/MergeTag/Post/ThumbnailUrl.php | 46 +- src/Defaults/MergeTag/StringTag.php | 26 +- .../MergeTag/Taxonomy/TaxonomyName.php | 45 +- .../MergeTag/Taxonomy/TaxonomySlug.php | 43 +- .../MergeTag/Taxonomy/TermDescription.php | 38 +- src/Defaults/MergeTag/Taxonomy/TermID.php | 38 +- src/Defaults/MergeTag/Taxonomy/TermName.php | 38 +- .../MergeTag/Taxonomy/TermPermalink.php | 36 +- src/Defaults/MergeTag/Taxonomy/TermSlug.php | 38 +- src/Defaults/MergeTag/UrlTag.php | 29 +- src/Defaults/MergeTag/User/Avatar.php | 42 +- src/Defaults/MergeTag/User/AvatarUrl.php | 41 +- src/Defaults/MergeTag/User/UserBio.php | 40 +- .../MergeTag/User/UserDisplayName.php | 40 +- src/Defaults/MergeTag/User/UserEmail.php | 40 +- src/Defaults/MergeTag/User/UserFirstName.php | 40 +- src/Defaults/MergeTag/User/UserID.php | 35 +- src/Defaults/MergeTag/User/UserLastName.php | 40 +- src/Defaults/MergeTag/User/UserLogin.php | 40 +- src/Defaults/MergeTag/User/UserNicename.php | 40 +- .../MergeTag/User/UserPasswordResetLink.php | 49 +- src/Defaults/MergeTag/User/UserRole.php | 51 +- src/Defaults/Recipient/Administrator.php | 75 +- src/Defaults/Recipient/Email.php | 119 +- src/Defaults/Recipient/Role.php | 85 +- src/Defaults/Recipient/User.php | 73 +- src/Defaults/Recipient/UserID.php | 90 +- src/Defaults/Recipient/Webhook.php | 67 +- src/Defaults/Resolver/Basic.php | 39 +- src/Defaults/Trigger/Comment/CommentAdded.php | 129 +- .../Trigger/Comment/CommentApproved.php | 77 +- .../Trigger/Comment/CommentPublished.php | 65 +- .../Trigger/Comment/CommentReplied.php | 443 +++-- .../Trigger/Comment/CommentSpammed.php | 73 +- .../Trigger/Comment/CommentTrashed.php | 73 +- .../Trigger/Comment/CommentTrigger.php | 714 +++++--- .../Trigger/Comment/CommentUnapproved.php | 78 +- src/Defaults/Trigger/Media/MediaAdded.php | 54 +- src/Defaults/Trigger/Media/MediaTrashed.php | 232 ++- src/Defaults/Trigger/Media/MediaTrigger.php | 241 ++- src/Defaults/Trigger/Media/MediaUpdated.php | 207 ++- src/Defaults/Trigger/Plugin/Activated.php | 90 +- src/Defaults/Trigger/Plugin/Deactivated.php | 89 +- src/Defaults/Trigger/Plugin/Installed.php | 92 +- src/Defaults/Trigger/Plugin/PluginTrigger.php | 145 +- src/Defaults/Trigger/Plugin/Removed.php | 88 +- src/Defaults/Trigger/Plugin/Updated.php | 131 +- src/Defaults/Trigger/Post/PostAdded.php | 110 +- src/Defaults/Trigger/Post/PostApproved.php | 407 +++-- src/Defaults/Trigger/Post/PostDrafted.php | 98 +- src/Defaults/Trigger/Post/PostPending.php | 94 +- src/Defaults/Trigger/Post/PostPublished.php | 418 +++-- .../Trigger/Post/PostPublishedPrivately.php | 417 +++-- src/Defaults/Trigger/Post/PostScheduled.php | 416 +++-- src/Defaults/Trigger/Post/PostTrashed.php | 383 +++-- src/Defaults/Trigger/Post/PostTrigger.php | 886 +++++++--- src/Defaults/Trigger/Post/PostUpdated.php | 416 +++-- .../Trigger/Privacy/DataEraseRequest.php | 48 +- src/Defaults/Trigger/Privacy/DataErased.php | 54 +- .../Trigger/Privacy/DataExportRequest.php | 54 +- src/Defaults/Trigger/Privacy/DataExported.php | 233 ++- .../Trigger/Privacy/PrivacyTrigger.php | 286 +++- src/Defaults/Trigger/Taxonomy/TermAdded.php | 104 +- src/Defaults/Trigger/Taxonomy/TermDeleted.php | 103 +- src/Defaults/Trigger/Taxonomy/TermTrigger.php | 64 +- src/Defaults/Trigger/Taxonomy/TermUpdated.php | 103 +- src/Defaults/Trigger/Theme/Installed.php | 88 +- src/Defaults/Trigger/Theme/Switched.php | 301 ++-- src/Defaults/Trigger/Theme/ThemeTrigger.php | 243 ++- src/Defaults/Trigger/Theme/Updated.php | 132 +- src/Defaults/Trigger/User/UserDeleted.php | 104 +- .../Trigger/User/UserEmailChangeRequest.php | 169 +- src/Defaults/Trigger/User/UserLogin.php | 156 +- src/Defaults/Trigger/User/UserLoginFailed.php | 99 +- src/Defaults/Trigger/User/UserLogout.php | 105 +- .../Trigger/User/UserPasswordChanged.php | 99 +- .../Trigger/User/UserPasswordResetRequest.php | 121 +- .../Trigger/User/UserProfileUpdated.php | 103 +- src/Defaults/Trigger/User/UserRegistered.php | 160 +- src/Defaults/Trigger/User/UserRoleChanged.php | 176 +- src/Defaults/Trigger/User/UserTrigger.php | 58 +- .../Trigger/WordPress/EmailChangeRequest.php | 212 ++- .../Trigger/WordPress/UpdatesAvailable.php | 373 +++-- src/ErrorHandler.php | 37 +- src/Integration/TwoFactor.php | 38 +- src/Integration/WordPress.php | 129 +- src/Integration/WordPressEmails.php | 272 +-- src/Interfaces/Adaptable.php | 18 +- src/Interfaces/Fillable.php | 34 +- src/Interfaces/Nameable.php | 12 +- src/Interfaces/Receivable.php | 18 +- src/Interfaces/Resolvable.php | 20 +- src/Interfaces/Sendable.php | 38 +- src/Interfaces/Storable.php | 7 +- src/Interfaces/Taggable.php | 39 +- src/Interfaces/Triggerable.php | 31 +- src/Queries/NotificationQueries.php | 62 +- src/Queries/UserQueries.php | 83 +- src/Register.php | 111 +- src/Repository/CarrierRepository.php | 22 +- src/Repository/GlobalMergeTagRepository.php | 355 ++-- src/Repository/RecipientRepository.php | 67 +- src/Repository/ResolverRepository.php | 13 +- src/Repository/TriggerRepository.php | 200 ++- src/Runtime.php | 394 +++-- src/Store/Carrier.php | 11 +- src/Store/GlobalMergeTag.php | 13 +- src/Store/Notification.php | 23 +- src/Store/Recipient.php | 93 +- src/Store/Resolver.php | 28 +- src/Store/Trigger.php | 23 +- src/Traits/ClassUtils.php | 33 +- src/Traits/HasDescription.php | 16 +- src/Traits/HasGroup.php | 16 +- src/Traits/HasName.php | 20 +- src/Traits/HasSlug.php | 20 +- src/Traits/Storage.php | 65 +- src/Traits/Webhook.php | 136 +- src/Utils/EDDUpdater.php | 699 +++++--- src/Utils/Settings.php | 338 ++-- src/Utils/Settings/CoreFields/Button.php | 27 +- src/Utils/Settings/CoreFields/Checkbox.php | 42 +- src/Utils/Settings/CoreFields/Editor.php | 56 +- src/Utils/Settings/CoreFields/Image.php | 47 +- src/Utils/Settings/CoreFields/Message.php | 36 +- src/Utils/Settings/CoreFields/Number.php | 37 +- src/Utils/Settings/CoreFields/Range.php | 38 +- src/Utils/Settings/CoreFields/Select.php | 62 +- src/Utils/Settings/CoreFields/Text.php | 28 +- src/Utils/Settings/CoreFields/Url.php | 28 +- src/Utils/Settings/Field.php | 241 +-- src/Utils/Settings/Fields/ErrorLog.php | 51 +- src/Utils/Settings/Fields/Export.php | 31 +- src/Utils/Settings/Fields/Import.php | 16 +- src/Utils/Settings/Fields/NotificationLog.php | 67 +- src/Utils/Settings/Fields/SyncTable.php | 101 +- src/Utils/Settings/Group.php | 185 ++- src/Utils/Settings/Section.php | 125 +- src/Utils/WpObjectHelper.php | 179 +- src/api.php | 238 +-- tests/Core/TestNotification.php | 43 +- tests/Helpers/Objects/Carrier.php | 2 +- tests/Helpers/Objects/DummyClassName.php | 4 +- tests/Helpers/Registerer.php | 4 +- uninstall.php | 59 +- 297 files changed, 22797 insertions(+), 11261 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fb8a34e44..c6f11c2a3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -124,7 +124,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ['7.0', '7.1', '7.2', '7.3', '7.4'] + php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] services: mysql: image: mysql:5.7 diff --git a/compat/src-deprecated/functions.php b/compat/src-deprecated/functions.php index 1d6b79a0f..4f917c92e 100644 --- a/compat/src-deprecated/functions.php +++ b/compat/src-deprecated/functions.php @@ -243,7 +243,7 @@ function notification_cache() { function notification_display_wizard() { _deprecated_function( __FUNCTION__, '8.0.0', 'BracketSpace\\Notification\\Admin\\Wizard::should_display' ); - return Wizard::should_display(); + return Wizard::shouldDisplay(); } /** @@ -303,7 +303,7 @@ function notification_get_posts( $trigger_slug = null, $all = false ) { function notification_get_post_by_hash( $hash ) { _deprecated_function( __FUNCTION__, '8.0.0', 'BracketSpace\\Notification\\Queries\\NotificationQueries::with_hash()' ); - return NotificationQueries::with_hash( $hash ); + return NotificationQueries::withHash( $hash ); } /** @@ -318,8 +318,8 @@ function notification_post_is_new( $post ) { _deprecated_function( __FUNCTION__, '8.0.0' ); /** @var BracketSpace\Notification\Defaults\Adapter\WordPress $notification */ - $notification = notification_adapt_from( 'WordPress', $post ); - return $notification->is_new(); + $notification = notificationAdaptFrom( 'WordPress', $post ); + return $notification->isNew(); } /** @@ -381,7 +381,7 @@ function notification_sync( $path = null ) { function notification_get_sync_path() { _deprecated_function( __FUNCTION__, '8.0.0', 'BracketSpace\\Notification\\Core\\Sync::get_sync_path' ); - return Sync::get_sync_path(); + return Sync::getSyncPath(); } /** @@ -394,7 +394,7 @@ function notification_get_sync_path() { function notification_is_syncing() { _deprecated_function( __FUNCTION__, '8.0.0', 'BracketSpace\\Notification\\Core\\Sync::is_syncing' ); - return Sync::is_syncing(); + return Sync::isSyncing(); } /** @@ -421,7 +421,7 @@ function notification_whitelabel( $args = [] ) { function notification_is_whitelabeled() { _deprecated_function( __FUNCTION__, '8.0.0', 'BracketSpace\\Notification\\Core\\Whitelabel::is_whitelabeled' ); - return Whitelabel::is_whitelabeled(); + return Whitelabel::isWhitelabeled(); } /** @@ -508,7 +508,7 @@ function notification_get_recipients() { function notification_get_carrier_recipients( $carrier_slug ) { _deprecated_function( __FUNCTION__, '8.0.0', 'BracketSpace\\Notification\\Store\\Recipient::all_for_carrier' ); - return Store\Recipient::all_for_carrier( $carrier_slug ); + return Store\Recipient::allForCarrier( $carrier_slug ); } /** @@ -655,7 +655,7 @@ function notification_get_triggers_grouped() { function notification_add_global_merge_tag( Interfaces\Taggable $merge_tag ) { _deprecated_function( __FUNCTION__, '8.0.0', 'BracketSpace\\Notification\\Register::global_merge_tag' ); - return Register::global_merge_tag( $merge_tag ); + return Register::globalMergeTag( $merge_tag ); } /** @@ -670,3 +670,172 @@ function notification_get_global_merge_tags() { return Store\GlobalMergeTag::all(); } + +/** + * Adapts Notification object + * Default adapters are: WordPress || JSON + * + * @param string $adapterName Adapter class name. + * @param \BracketSpace\Notification\Core\Notification $notification Notification object. + * @return \BracketSpace\Notification\Interfaces\Adaptable + * @since 6.0.0 + * @deprecated [Next] + */ +function notification_adapt($adapterName, \BracketSpace\Notification\Core\Notification $notification) { + _deprecated_function( __FUNCTION__, '[Next]', 'notificationAdapt'); + + return notificationAdapt($adapterName, $notification); +} + +/** + * Adapts Notification from input data + * Default adapters are: WordPress || JSON + * + * @param string $adapterName Adapter class name. + * @param mixed $data Input data needed by adapter. + * @return \BracketSpace\Notification\Interfaces\Adaptable + * @since 6.0.0 + * @deprecated [Next] + */ +function notification_adapt_from($adapterName, $data) { + _deprecated_function( __FUNCTION__, '[Next]', 'notificationAdaptFrom'); + + return notificationAdaptFrom($adapterName, $data); +} + +/** + * Changes one adapter to another + * + * @param string $newAdapterName Adapter class name. + * @param \BracketSpace\Notification\Interfaces\Adaptable $adapter Adapter. + * @return \BracketSpace\Notification\Interfaces\Adaptable + * @since 6.0.0 + * @deprecated [Next] + */ +function notification_swap_adapter($newAdapterName, Interfaces\Adaptable $adapter) { + _deprecated_function( __FUNCTION__, '[Next]', 'notificationSwapAdapter'); + + return notificationSwapAdapter($newAdapterName, $adapter); +} + +/** + * Logs the message in database + * + * @param string $component Component nice name, like `Core` or `Any Plugin Name`. + * @param string $type Log type, values: notification|error|warning. + * @param string $message Log formatted message. + * @return bool|\WP_Error + * @since 6.0.0 + * @deprecated [Next] + */ +function notification_log($component, $type, $message) { + _deprecated_function( __FUNCTION__, '[Next]', 'notificationLog'); + + return notificationLog($component, $type, $message); +} + +/** + * Adds Notification to Store + * + * @param \BracketSpace\Notification\Core\Notification $notification Notification object. + * @return void + * @since 6.0.0 + * @deprecated [Next] + */ +function notification_add(\BracketSpace\Notification\Core\Notification $notification) { + _deprecated_function( __FUNCTION__, '[Next]', 'notificationAdd'); + + Store\Notification::insert( + $notification->getHash(), + $notification + ); + do_action( + 'notification/notification/registered', + $notification + ); +} + +/** + * Converts the static data to Trigger and Carrier objects + * + * If no `trigger` nor `carriers` keys are available it does nothing. + * If the data is already in form of objects it does nothing. + * + * @param array $data Notification static data. + * @return array Converted data. + * @since 6.0.0 + * @deprecated [Next] + */ +function notification_convert_data($data = []) { + _deprecated_function( __FUNCTION__, '[Next]', 'notificationConvertData'); + + return notificationConvertData($data); +} + +/** + * Registers settings + * + * @param mixed $callback Callback for settings registration, array of string. + * @param int $priority Action priority. + * @return void + * @since 5.0.0 + * @deprecated [Next] + */ +function notification_register_settings($callback, $priority = 10) { + _deprecated_function( __FUNCTION__, '[Next]', 'notificationRegisterSettings'); + + if (!is_callable($callback)) { + trigger_error( + 'You have to pass callable while registering the settings', + E_USER_ERROR + ); + } + + add_action( + 'notification/settings/register', + $callback, + $priority + ); +} + +/** + * Gets setting values + * + * @return mixed + * @since 5.0.0 + * @deprecated [Next] + */ +function notification_get_settings() { + _deprecated_function( __FUNCTION__, '[Next]', 'notificationGetSettings'); + + return notificationGetSettings(); +} + +/** + * Gets single setting value + * + * @param string $setting setting name in `a/b/c` format. + * @return mixed + * @since 5.0.0 + * @since 7.0.0 The `notifications` section has been changed to `carriers`. + * @deprecated [Next] + */ +function notification_get_setting($setting) { + _deprecated_function( __FUNCTION__, '[Next]', 'notificationGetSetting'); + + return notificationGetSetting($setting); +} + +/** + * Updates single setting value. + * + * @param string $setting setting name in `a/b/c` format. + * @param mixed $value setting value. + * @return mixed + * @deprecated [Next] + */ +function notification_update_setting($setting, $value) { + _deprecated_function( __FUNCTION__, '[Next]', 'notificationUpdateSetting'); + + return notificationUpdateSetting($setting, $value); +} diff --git a/composer.json b/composer.json index 20c92bb7f..092db9ff5 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,8 @@ "micropackage/dochooks": "1.0.2", "micropackage/filesystem": "^1.1", "micropackage/requirements": "^1.1", - "micropackage/templates": "^1.1" + "micropackage/templates": "^1.1", + "micropackage/casegnostic": "^1.0" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.4", @@ -22,6 +23,7 @@ "phpcompatibility/php-compatibility": "^9.3", "phpunit/phpunit": "6.5", "roots/wordpress": "*", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.6.1", "szepeviktor/phpstan-wordpress": "^0.7.2", "wp-coding-standards/wpcs": "^2.0", "wp-phpunit/wp-phpunit": "^5.8", @@ -31,7 +33,8 @@ "optimize-autoloader": true, "preferred-install": "dist", "sort-packages": true, - "allow-plugins": true + "allow-plugins": true, + "platform-check": false }, "extra": { "mozart": { @@ -66,7 +69,7 @@ "phpcs": "phpcs", "phpcompat": "phpcs --standard=PHPCompatibility --runtime-set testVersion 7.0 notification.php load.php uninstall.php src/ resources/templates/", "phplint": "parallel-lint --exclude node_modules --exclude vendor --exclude vendor-bin .", - "phpstan": "phpstan analyze", + "phpstan": "phpstan analyze --memory-limit=-1", "phpunit": "phpunit", "phpunit-coverage": "phpunit --coverage-text" } diff --git a/composer.lock b/composer.lock index a337d1abc..5b3b98743 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "858bf31c6c396d961ef9cc1593bfd90a", + "content-hash": "f3ba3481141dde1ee1f46ce38fc31b8b", "packages": [ { "name": "enshrined/svg-sanitize", @@ -206,6 +206,59 @@ }, "time": "2021-10-30T17:44:14+00:00" }, + { + "name": "micropackage/casegnostic", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/micropackage/casegnostic.git", + "reference": "fbe11c5c1ce8bc57ed5544a206244af78ce31619" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/micropackage/casegnostic/zipball/fbe11c5c1ce8bc57ed5544a206244af78ce31619", + "reference": "fbe11c5c1ce8bc57ed5544a206244af78ce31619", + "shasum": "" + }, + "require": { + "php": ">=7.4" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", + "pestphp/pest": "^1.22", + "phpstan/phpstan": "^1.9", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.6.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Micropackage\\Casegnostic\\": "src/" + } + }, + "scripts": { + "phpcs": [ + "phpcs" + ], + "phpcbf": [ + "phpcbf" + ], + "phpstan": [ + "phpstan analyze" + ], + "pest": [ + "./vendor/bin/pest" + ] + }, + "license": [ + "GPL-3.0-or-later" + ], + "description": "Casegnostic - access properties and methods both snake_case and camelCase", + "support": { + "source": "https://github.com/micropackage/casegnostic/tree/1.0.0", + "issues": "https://github.com/micropackage/casegnostic/issues" + }, + "time": "2022-11-28T13:47:17+00:00" + }, { "name": "micropackage/dochooks", "version": "1.0.2", @@ -344,16 +397,16 @@ }, { "name": "micropackage/requirements", - "version": "1.1.2", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/micropackage/requirements.git", - "reference": "d21f2b54100d15246d493382dfd06a23ed49630a" + "reference": "114d49df7c5860108c008853b514d9a7eccaedf3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/micropackage/requirements/zipball/d21f2b54100d15246d493382dfd06a23ed49630a", - "reference": "d21f2b54100d15246d493382dfd06a23ed49630a", + "url": "https://api.github.com/repos/micropackage/requirements/zipball/114d49df7c5860108c008853b514d9a7eccaedf3", + "reference": "114d49df7c5860108c008853b514d9a7eccaedf3", "shasum": "" }, "require": { @@ -361,7 +414,7 @@ "php": ">=5.6" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", "php-mock/php-mock-phpunit": "^2.5", "phpcompatibility/php-compatibility": "^9.1", "phpunit/phpunit": "^6.5.5", @@ -386,9 +439,9 @@ "description": "Requirements checker for WordPress plugins", "support": { "issues": "https://github.com/micropackage/requirements/issues", - "source": "https://github.com/micropackage/requirements/tree/1.1.2" + "source": "https://github.com/micropackage/requirements/tree/1.2.0" }, - "time": "2021-11-14T08:45:42+00:00" + "time": "2022-01-20T14:02:33+00:00" }, { "name": "micropackage/templates", @@ -417,12 +470,12 @@ }, "type": "library", "autoload": { - "psr-4": { - "Micropackage\\Templates\\": "src" - }, "files": [ "src/functions/template.php" - ] + ], + "psr-4": { + "Micropackage\\Templates\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -443,31 +496,122 @@ } ], "packages-dev": [ + { + "name": "automattic/phpcs-neutron-ruleset", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/phpcs-neutron-ruleset.git", + "reference": "0d79b6016a274d1bb8cbb359592e8dad7ffa47ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/phpcs-neutron-ruleset/zipball/0d79b6016a274d1bb8cbb359592e8dad7ffa47ca", + "reference": "0d79b6016a274d1bb8cbb359592e8dad7ffa47ca", + "shasum": "" + }, + "require": { + "automattic/phpcs-neutron-standard": "^1.5.3", + "php": "^7.0 || ^8.0", + "sirbrillig/phpcs-import-detection": "^1.1.4", + "sirbrillig/phpcs-variable-analysis": "^2.6.1", + "wp-coding-standards/wpcs": "^2.1.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", + "squizlabs/php_codesniffer": "^3.4.2" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHPCS meta-ruleset for WordPress development", + "support": { + "issues": "https://github.com/Automattic/phpcs-neutron-ruleset/issues", + "source": "https://github.com/Automattic/phpcs-neutron-ruleset/tree/v3.4.0" + }, + "time": "2021-03-15T19:18:33+00:00" + }, + { + "name": "automattic/phpcs-neutron-standard", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/phpcs-neutron-standard.git", + "reference": "566ad70534296073afa9143858671356444ddead" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/phpcs-neutron-standard/zipball/566ad70534296073afa9143858671356444ddead", + "reference": "566ad70534296073afa9143858671356444ddead", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "squizlabs/php_codesniffer": "^3.3.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4 || ^0.5 || ^0.6 || ^0.7", + "phpunit/phpunit": "^5.0 || ^6.5 || ^7.0 || ^8.0", + "sirbrillig/phpcs-variable-analysis": "^2.0.1" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "NeutronStandard\\": "NeutronStandard/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Payton Swick", + "email": "payton@foolord.com" + } + ], + "description": "A set of phpcs sniffs for modern php development.", + "support": { + "issues": "https://github.com/sirbrillig/phpcs-neutron-standard/issues", + "source": "https://github.com/sirbrillig/phpcs-neutron-standard", + "wiki": "https://github.com/sirbrillig/phpcs-neutron-standard/wiki" + }, + "time": "2021-02-15T22:42:03+00:00" + }, { "name": "bamarni/composer-bin-plugin", - "version": "1.4.1", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/bamarni/composer-bin-plugin.git", - "reference": "9329fb0fbe29e0e1b2db8f4639a193e4f5406225" + "reference": "92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bamarni/composer-bin-plugin/zipball/9329fb0fbe29e0e1b2db8f4639a193e4f5406225", - "reference": "9329fb0fbe29e0e1b2db8f4639a193e4f5406225", + "url": "https://api.github.com/repos/bamarni/composer-bin-plugin/zipball/92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880", + "reference": "92fd7b1e6e9cdae19b0d57369d8ad31a37b6a880", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": "^5.5.9 || ^7.0 || ^8.0" + "composer-plugin-api": "^2.0", + "php": "^7.2.5 || ^8.0" }, "require-dev": { - "composer/composer": "^1.0 || ^2.0", - "symfony/console": "^2.5 || ^3.0 || ^4.0" + "composer/composer": "^2.0", + "ext-json": "*", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.5", + "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", + "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", + "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0" }, "type": "composer-plugin", "extra": { - "class": "Bamarni\\Composer\\Bin\\Plugin" + "class": "Bamarni\\Composer\\Bin\\BamarniBinPlugin" }, "autoload": { "psr-4": { @@ -489,33 +633,33 @@ ], "support": { "issues": "https://github.com/bamarni/composer-bin-plugin/issues", - "source": "https://github.com/bamarni/composer-bin-plugin/tree/master" + "source": "https://github.com/bamarni/composer-bin-plugin/tree/1.8.2" }, - "time": "2020-05-03T08:27:20+00:00" + "time": "2022-10-31T08:38:03+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.1", + "version": "v0.7.2", "source": { "type": "git", "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c" + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/fe390591e0241955f22eb9ba327d137e501c771c", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", "shasum": "" }, "require": { "composer-plugin-api": "^1.0 || ^2.0", "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.0 || ^3.0 || ^4.0" + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { "composer/composer": "*", - "phpcompatibility/php-compatibility": "^9.0", - "sensiolabs/security-checker": "^4.1.0" + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0" }, "type": "composer-plugin", "extra": { @@ -536,6 +680,10 @@ "email": "franck.nijhof@dealerdirect.com", "homepage": "http://www.frenck.nl", "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", @@ -547,6 +695,7 @@ "codesniffer", "composer", "installer", + "phpcbf", "phpcs", "plugin", "qa", @@ -561,33 +710,34 @@ "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" }, - "time": "2020-12-07T18:04:37+00:00" + "time": "2022-02-04T12:51:07+00:00" }, { "name": "doctrine/instantiator", - "version": "1.4.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^8.0", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -614,7 +764,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { @@ -630,7 +780,7 @@ "type": "tidelift" } ], - "time": "2020-11-10T18:47:58+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "jakub-onderka/php-parallel-lint", @@ -687,37 +837,38 @@ }, { "name": "myclabs/deep-copy", - "version": "1.10.2", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, - "replace": { - "myclabs/deep-copy": "self.version" + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, "files": [ "src/DeepCopy/deep_copy.php" - ] + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -733,7 +884,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, "funding": [ { @@ -741,7 +892,7 @@ "type": "tidelift" } ], - "time": "2020-11-13T09:40:50+00:00" + "time": "2023-03-08T13:26:56+00:00" }, { "name": "phar-io/manifest", @@ -855,24 +1006,27 @@ }, { "name": "php-stubs/wordpress-stubs", - "version": "v5.8.1", + "version": "v5.9.5", "source": { "type": "git", "url": "https://github.com/php-stubs/wordpress-stubs.git", - "reference": "8b333464d3183bccde2fdbb814e3cae592434943" + "reference": "13ecf204a7e6d215a7c0d23e2aa27940fe617717" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/8b333464d3183bccde2fdbb814e3cae592434943", - "reference": "8b333464d3183bccde2fdbb814e3cae592434943", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/13ecf204a7e6d215a7c0d23e2aa27940fe617717", + "reference": "13ecf204a7e6d215a7c0d23e2aa27940fe617717", "shasum": "" }, "replace": { "giacocorsiglia/wordpress-stubs": "*" }, "require-dev": { - "giacocorsiglia/stubs-generator": "^0.5.0", - "php": "~7.1" + "nikic/php-parser": "< 4.12.0", + "php": "~7.3 || ~8.0", + "php-stubs/generator": "^0.8.1", + "phpdocumentor/reflection-docblock": "^5.3", + "phpstan/phpstan": "^1.2" }, "suggest": { "paragonie/sodium_compat": "Pure PHP implementation of libsodium", @@ -893,30 +1047,30 @@ ], "support": { "issues": "https://github.com/php-stubs/wordpress-stubs/issues", - "source": "https://github.com/php-stubs/wordpress-stubs/tree/v5.8.1" + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v5.9.5" }, - "time": "2021-09-09T22:10:19+00:00" + "time": "2022-11-09T05:32:14+00:00" }, { "name": "php-stubs/wp-cli-stubs", - "version": "v2.5.0", + "version": "v2.7.0", "source": { "type": "git", "url": "https://github.com/php-stubs/wp-cli-stubs.git", - "reference": "9140bf3f59d9df1f67f69c0d49d9364ee1684348" + "reference": "428544fc3696273bfbb4cffe4ac88f5fed428fc8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/wp-cli-stubs/zipball/9140bf3f59d9df1f67f69c0d49d9364ee1684348", - "reference": "9140bf3f59d9df1f67f69c0d49d9364ee1684348", + "url": "https://api.github.com/repos/php-stubs/wp-cli-stubs/zipball/428544fc3696273bfbb4cffe4ac88f5fed428fc8", + "reference": "428544fc3696273bfbb4cffe4ac88f5fed428fc8", "shasum": "" }, "require": { - "php-stubs/wordpress-stubs": "^4.7 || ^5.0" + "php-stubs/wordpress-stubs": "^4.7 || ^5.0 || ^6.0" }, "require-dev": { - "giacocorsiglia/stubs-generator": "^0.5.0", - "php": "~7.1" + "php": "~7.3 || ~8.0", + "php-stubs/generator": "^0.8.0" }, "suggest": { "symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", @@ -937,9 +1091,9 @@ ], "support": { "issues": "https://github.com/php-stubs/wp-cli-stubs/issues", - "source": "https://github.com/php-stubs/wp-cli-stubs/tree/v2.5.0" + "source": "https://github.com/php-stubs/wp-cli-stubs/tree/v2.7.0" }, - "time": "2021-05-19T16:06:45+00:00" + "time": "2022-11-10T19:19:05+00:00" }, { "name": "phpcompatibility/php-compatibility", @@ -1115,25 +1269,30 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.5.1", + "version": "1.6.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" + "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/48f445a408c131e38cab1c235aa6d2bb7a0bb20d", + "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", + "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { "ext-tokenizer": "*", - "psalm/phar": "^4.8" + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" }, "type": "library", "extra": { @@ -1159,9 +1318,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.2" }, - "time": "2021-10-02T14:08:47+00:00" + "time": "2022-10-14T12:47:21+00:00" }, { "name": "phpspec/prophecy", @@ -1230,18 +1389,71 @@ }, "time": "2020-03-05T15:02:03+00:00" }, + { + "name": "phpstan/phpdoc-parser", + "version": "0.4.9", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "98a088b17966bdf6ee25c8a4b634df313d8aa531" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/98a088b17966bdf6ee25c8a4b634df313d8aa531", + "reference": "98a088b17966bdf6ee25c8a4b634df313d8aa531", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "consistence/coding-standard": "^3.5", + "ergebnis/composer-normalize": "^2.0.2", + "jakub-onderka/php-parallel-lint": "^0.9.2", + "phing/phing": "^2.16.0", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.26", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^6.3", + "slevomat/coding-standard": "^4.7.2", + "symfony/process": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.4-dev" + } + }, + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/master" + }, + "time": "2020-08-03T20:32:43+00:00" + }, { "name": "phpstan/phpstan", - "version": "0.12.99", + "version": "0.12.100", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "b4d40f1d759942f523be267a1bab6884f46ca3f7" + "reference": "48236ddf823547081b2b153d1cd2994b784328c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b4d40f1d759942f523be267a1bab6884f46ca3f7", - "reference": "b4d40f1d759942f523be267a1bab6884f46ca3f7", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/48236ddf823547081b2b153d1cd2994b784328c3", + "reference": "48236ddf823547081b2b153d1cd2994b784328c3", "shasum": "" }, "require": { @@ -1272,7 +1484,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/0.12.99" + "source": "https://github.com/phpstan/phpstan/tree/0.12.100" }, "funding": [ { @@ -1283,16 +1495,12 @@ "url": "https://github.com/phpstan", "type": "github" }, - { - "url": "https://www.patreon.com/phpstan", - "type": "patreon" - }, { "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", "type": "tidelift" } ], - "time": "2021-09-12T20:09:55+00:00" + "time": "2022-11-01T09:52:08+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1719,35 +1927,29 @@ }, { "name": "roots/wordpress", - "version": "5.8.2", + "version": "6.2", "source": { "type": "git", - "url": "https://github.com/WordPress/WordPress.git", - "reference": "5.8.2" + "url": "https://github.com/roots/wordpress.git", + "reference": "41ff6e23ccbc3a1691406d69fe8c211a225514e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress/zipball/refs/tags/5.8.2" + "url": "https://api.github.com/repos/roots/wordpress/zipball/41ff6e23ccbc3a1691406d69fe8c211a225514e2", + "reference": "41ff6e23ccbc3a1691406d69fe8c211a225514e2", + "shasum": "" }, "require": { - "php": ">=5.3.2", - "roots/wordpress-core-installer": ">=1.0.0" + "roots/wordpress-core-installer": "^1.0.0", + "roots/wordpress-no-content": "self.version" }, - "provide": { - "wordpress/core-implementation": "5.8.2" - }, - "type": "wordpress-core", + "type": "metapackage", "notification-url": "https://packagist.org/downloads/", "license": [ + "MIT", "GPL-2.0-or-later" ], - "authors": [ - { - "name": "WordPress Community", - "homepage": "https://wordpress.org/about/" - } - ], - "description": "WordPress is web software you can use to create a beautiful website or blog.", + "description": "WordPress is open source software you can use to create a beautiful website, blog, or app.", "homepage": "https://wordpress.org/", "keywords": [ "blog", @@ -1755,25 +1957,16 @@ "wordpress" ], "support": { - "docs": "https://developer.wordpress.org/", - "forum": "https://wordpress.org/support/", - "irc": "irc://irc.freenode.net/wordpress", - "issues": "https://core.trac.wordpress.org/", - "rss": "https://wordpress.org/news/feed/", - "source": "https://core.trac.wordpress.org/browser", - "wiki": "https://codex.wordpress.org/" + "issues": "https://github.com/roots/wordpress/issues", + "source": "https://github.com/roots/wordpress/tree/6.2" }, "funding": [ { "url": "https://github.com/roots", "type": "github" - }, - { - "url": "https://www.patreon.com/rootsdev", - "type": "patreon" } ], - "time": "2021-11-10T23:24:02+00:00" + "time": "2022-06-01T16:54:37+00:00" }, { "name": "roots/wordpress-core-installer", @@ -1846,6 +2039,76 @@ ], "time": "2020-08-20T00:27:30+00:00" }, + { + "name": "roots/wordpress-no-content", + "version": "6.2", + "source": { + "type": "git", + "url": "https://github.com/WordPress/WordPress.git", + "reference": "6.2" + }, + "dist": { + "type": "zip", + "url": "https://downloads.wordpress.org/release/wordpress-6.2-no-content.zip", + "shasum": "f584c96734b9b7d3f770dbc176740cf92e54aa6c" + }, + "require": { + "php": ">= 5.6.20" + }, + "provide": { + "wordpress/core-implementation": "6.2" + }, + "suggest": { + "ext-curl": "Performs remote request operations.", + "ext-dom": "Used to validate Text Widget content and to automatically configuring IIS7+.", + "ext-exif": "Works with metadata stored in images.", + "ext-fileinfo": "Used to detect mimetype of file uploads.", + "ext-hash": "Used for hashing, including passwords and update packages.", + "ext-imagick": "Provides better image quality for media uploads.", + "ext-json": "Used for communications with other servers.", + "ext-libsodium": "Validates Signatures and provides securely random bytes.", + "ext-mbstring": "Used to properly handle UTF8 text.", + "ext-mysqli": "Connects to MySQL for database interactions.", + "ext-openssl": "Permits SSL-based connections to other hosts.", + "ext-pcre": "Increases performance of pattern matching in code searches.", + "ext-xml": "Used for XML parsing, such as from a third-party site.", + "ext-zip": "Used for decompressing Plugins, Themes, and WordPress update packages." + }, + "type": "wordpress-core", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "WordPress Community", + "homepage": "https://wordpress.org/about/" + } + ], + "description": "WordPress is open source software you can use to create a beautiful website, blog, or app.", + "homepage": "https://wordpress.org/", + "keywords": [ + "blog", + "cms", + "wordpress" + ], + "support": { + "docs": "https://developer.wordpress.org/", + "forum": "https://wordpress.org/support/", + "irc": "irc://irc.freenode.net/wordpress", + "issues": "https://core.trac.wordpress.org/", + "rss": "https://wordpress.org/news/feed/", + "source": "https://core.trac.wordpress.org/browser", + "wiki": "https://codex.wordpress.org/" + }, + "funding": [ + { + "url": "https://wordpressfoundation.org/donate/", + "type": "other" + } + ], + "time": "2023-03-29T18:03:09+00:00" + }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.2", @@ -2081,16 +2344,16 @@ }, { "name": "sebastian/exporter", - "version": "3.1.4", + "version": "3.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db" + "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/73a9676f2833b9a7c36968f9d882589cd75511e6", + "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6", "shasum": "" }, "require": { @@ -2146,7 +2409,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.5" }, "funding": [ { @@ -2154,7 +2417,7 @@ "type": "github" } ], - "time": "2021-11-11T13:51:24+00:00" + "time": "2022-09-14T06:00:17+00:00" }, { "name": "sebastian/global-state", @@ -2480,152 +2743,243 @@ "time": "2016-10-03T07:35:21+00:00" }, { - "name": "squizlabs/php_codesniffer", - "version": "3.6.1", + "name": "sirbrillig/phpcs-import-detection", + "version": "v1.3.3", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e" + "url": "https://github.com/sirbrillig/phpcs-import-detection.git", + "reference": "7035ef6f3a15db182b59664d2c060918aa827e16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/f268ca40d54617c6e06757f83f699775c9b3ff2e", - "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e", + "url": "https://api.github.com/repos/sirbrillig/phpcs-import-detection/zipball/7035ef6f3a15db182b59664d2c060918aa827e16", + "reference": "7035ef6f3a15db182b59664d2c060918aa827e16", "shasum": "" }, "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" + "php": "^7.0 || ^8.0", + "squizlabs/php_codesniffer": "^3.5.8" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", + "phpunit/phpunit": "^9.0", + "sirbrillig/phpcs-variable-analysis": "^2.0.1" }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "ImportDetection\\": "ImportDetection/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Greg Sherwood", - "role": "lead" + "name": "Payton Swick", + "email": "payton@foolord.com" } ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "description": "A set of phpcs sniffs to look for unused or unimported symbols.", "keywords": [ "phpcs", - "standards" + "static analysis" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "issues": "https://github.com/sirbrillig/phpcs-import-detection/issues", + "source": "https://github.com/sirbrillig/phpcs-import-detection/tree/v1.3.3" }, - "time": "2021-10-11T04:00:11+00:00" + "time": "2022-10-30T19:04:13+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.23.0", + "name": "sirbrillig/phpcs-variable-analysis", + "version": "v2.11.16", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", + "reference": "dc5582dc5a93a235557af73e523c389aac9a8e88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/dc5582dc5a93a235557af73e523c389aac9a8e88", + "reference": "dc5582dc5a93a235557af73e523c389aac9a8e88", "shasum": "" }, "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-ctype": "For best performance" + "php": ">=5.4.0", + "squizlabs/php_codesniffer": "^3.5.6" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", + "phpcsstandards/phpcsdevcs": "^1.1", + "phpstan/phpstan": "^1.7", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0", + "sirbrillig/phpcs-import-detection": "^1.1", + "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0@beta" }, + "type": "phpcodesniffer-standard", "autoload": { "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] + "VariableAnalysis\\": "VariableAnalysis/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-2-Clause" ], "authors": [ { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "name": "Sam Graham", + "email": "php-codesniffer-variableanalysis@illusori.co.uk" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Payton Swick", + "email": "payton@foolord.com" } ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", + "description": "A PHPCS sniff to detect problems with variables.", "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" + "phpcs", + "static analysis" + ], + "support": { + "issues": "https://github.com/sirbrillig/phpcs-variable-analysis/issues", + "source": "https://github.com/sirbrillig/phpcs-variable-analysis", + "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" + }, + "time": "2023-03-31T16:46:32+00:00" + }, + { + "name": "slevomat/coding-standard", + "version": "6.4.1", + "source": { + "type": "git", + "url": "https://github.com/slevomat/coding-standard.git", + "reference": "696dcca217d0c9da2c40d02731526c1e25b65346" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/696dcca217d0c9da2c40d02731526c1e25b65346", + "reference": "696dcca217d0c9da2c40d02731526c1e25b65346", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7", + "php": "^7.1 || ^8.0", + "phpstan/phpdoc-parser": "0.4.5 - 0.4.9", + "squizlabs/php_codesniffer": "^3.5.6" + }, + "require-dev": { + "phing/phing": "2.16.3", + "php-parallel-lint/php-parallel-lint": "1.2.0", + "phpstan/phpstan": "0.12.48", + "phpstan/phpstan-deprecation-rules": "0.12.5", + "phpstan/phpstan-phpunit": "0.12.16", + "phpstan/phpstan-strict-rules": "0.12.5", + "phpunit/phpunit": "7.5.20|8.5.5|9.4.0" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-master": "6.x-dev" + } + }, + "autoload": { + "psr-4": { + "SlevomatCodingStandard\\": "SlevomatCodingStandard" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" ], + "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + "issues": "https://github.com/slevomat/coding-standard/issues", + "source": "https://github.com/slevomat/coding-standard/tree/6.4.1" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/kukulich", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2020-10-05T12:39:37+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.7.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2023-02-22T23:07:41+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.23.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", "shasum": "" }, "require": { @@ -2634,7 +2988,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2642,12 +2996,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -2675,7 +3029,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" }, "funding": [ { @@ -2691,7 +3045,45 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset", + "version": "v0.6.1", + "source": { + "type": "git", + "url": "https://github.com/szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset.git", + "reference": "9b6f8a08bf5ebc8b70da4d37d4d584b954fc5a41" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset/zipball/9b6f8a08bf5ebc8b70da4d37d4d584b954fc5a41", + "reference": "9b6f8a08bf5ebc8b70da4d37d4d584b954fc5a41", + "shasum": "" + }, + "require": { + "automattic/phpcs-neutron-ruleset": "^3.4.0", + "php": "^7.1 || ^8.0", + "slevomat/coding-standard": "^6.0.0", + "squizlabs/php_codesniffer": "^3.5.3" + }, + "require-dev": { + "phpcsstandards/phpcsdevcs": "^1.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Hybrid PHPCS ruleset for OOP WordPress development", + "support": { + "issues": "https://github.com/szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset/issues", + "source": "https://github.com/szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset/tree/v0.6.1" + }, + "time": "2021-07-01T07:23:18+00:00" }, { "name": "szepeviktor/phpstan-wordpress", @@ -2809,21 +3201,21 @@ }, { "name": "webmozart/assert", - "version": "1.10.0", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" + "ext-ctype": "*", + "php": "^7.2 || ^8.0" }, "conflict": { "phpstan/phpstan": "<0.12.20", @@ -2861,9 +3253,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.10.0" + "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, - "time": "2021-03-09T10:59:23+00:00" + "time": "2022-06-03T18:03:27+00:00" }, { "name": "wp-coding-standards/wpcs", @@ -2918,16 +3310,16 @@ }, { "name": "wp-phpunit/wp-phpunit", - "version": "5.8.2", + "version": "5.9.5", "source": { "type": "git", "url": "https://github.com/wp-phpunit/wp-phpunit.git", - "reference": "0cefcc49fd8a7e8c2f8d755e314532441618aee5" + "reference": "f9b5b3a44d3677c7d4803074d81ad3cd12b0eeea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-phpunit/wp-phpunit/zipball/0cefcc49fd8a7e8c2f8d755e314532441618aee5", - "reference": "0cefcc49fd8a7e8c2f8d755e314532441618aee5", + "url": "https://api.github.com/repos/wp-phpunit/wp-phpunit/zipball/f9b5b3a44d3677c7d4803074d81ad3cd12b0eeea", + "reference": "f9b5b3a44d3677c7d4803074d81ad3cd12b0eeea", "shasum": "" }, "type": "library", @@ -2962,20 +3354,20 @@ "issues": "https://github.com/wp-phpunit/issues", "source": "https://github.com/wp-phpunit/wp-phpunit" }, - "time": "2021-11-10T19:49:29+00:00" + "time": "2022-08-30T21:14:52+00:00" }, { "name": "yoast/phpunit-polyfills", - "version": "1.0.2", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", - "reference": "1a582ab1d91e86aa450340c4d35631a85314ff9f" + "reference": "3b59adeef77fb1c03ff5381dbb9d68b0aaff3171" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/1a582ab1d91e86aa450340c4d35631a85314ff9f", - "reference": "1a582ab1d91e86aa450340c4d35631a85314ff9f", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/3b59adeef77fb1c03ff5381dbb9d68b0aaff3171", + "reference": "3b59adeef77fb1c03ff5381dbb9d68b0aaff3171", "shasum": "" }, "require": { @@ -2983,13 +3375,12 @@ "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "require-dev": { - "yoast/yoastcs": "^2.2.0" + "yoast/yoastcs": "^2.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.x-dev", - "dev-develop": "1.x-dev" + "dev-main": "2.x-dev" } }, "autoload": { @@ -3023,7 +3414,7 @@ "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", "source": "https://github.com/Yoast/PHPUnit-Polyfills" }, - "time": "2021-10-03T08:40:26+00:00" + "time": "2023-03-30T23:39:05+00:00" } ], "aliases": [], @@ -3036,5 +3427,5 @@ "composer-runtime-api": "^2.0" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.1.0" } diff --git a/load.php b/load.php index 9f5e89f85..69c02e69a 100644 --- a/load.php +++ b/load.php @@ -1,10 +1,13 @@ init(); -}, 4 ); +add_action( + 'init', + static function () { + Notification::init(__FILE__)->init(); + }, + 4 +); diff --git a/notification.php b/notification.php index 736c47030..be51d1ff7 100644 --- a/notification.php +++ b/notification.php @@ -30,14 +30,14 @@ class Notification { * Initializes the plugin runtime * * @since 7.0.0 - * @param string $plugin_file Main plugin file. + * @param string $pluginFile Main plugin file. * @return BracketSpace\Notification\Runtime */ - public static function init( $plugin_file ) { + public static function init( $pluginFile ) { if ( ! isset( self::$runtime ) ) { // Autoloading. - require_once dirname( $plugin_file ) . '/vendor/autoload.php'; - self::$runtime = new BracketSpace\Notification\Runtime( $plugin_file ); + require_once dirname( $pluginFile ) . '/vendor/autoload.php'; + self::$runtime = new BracketSpace\Notification\Runtime( $pluginFile ); } return self::$runtime; @@ -57,11 +57,11 @@ public static function components() { * Gets runtime component * * @since 7.0.0 - * @param string $component_name Component name. + * @param string $componentName Component name. * @return mixed */ - public static function component( $component_name ) { - return isset( self::$runtime ) ? self::$runtime->component( $component_name ) : null; + public static function component( $componentName ) { + return isset( self::$runtime ) ? self::$runtime->component( $componentName ) : null; } /** @@ -96,7 +96,7 @@ public static function fs() { throw new Exception( 'Notification runtime has not been invoked yet.' ); } - return self::$runtime->get_filesystem(); + return self::$runtime->getFilesystem(); } } diff --git a/phpcs.xml b/phpcs.xml index f2a11ba35..b35b8c13d 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,38 +1,91 @@ - - Sniffs for Notification WordPress plugin - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + @@ -41,12 +94,11 @@ + bin/* node_modules/* tests/* vendor/* - vendor-bin/* src/Dependencies/* - src/Utils/EDDUpdater.php - resources/css/* - resources/js/* + compat/* + notification.php diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 1b478baab..8d4d98d30 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -470,26 +470,11 @@ parameters: count: 1 path: src/Abstracts/Adapter.php - - - message: "#^Method BracketSpace\\\\Notification\\\\Abstracts\\\\Adapter\\:\\:setup_notification\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Abstracts/Adapter.php - - message: "#^Parameter \\#1 \\$function of function call_user_func_array expects callable\\(\\)\\: mixed, array\\(BracketSpace\\\\Notification\\\\Core\\\\Notification, string\\) given\\.$#" count: 1 path: src/Abstracts/Adapter.php - - - message: "#^Method BracketSpace\\\\Notification\\\\Abstracts\\\\Carrier\\:\\:get_data\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: src/Abstracts/Carrier.php - - - - message: "#^Method BracketSpace\\\\Notification\\\\Abstracts\\\\Carrier\\:\\:set_data\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/Abstracts/Carrier.php - - message: "#^Parameter \\#1 \\$str of function md5 expects string, string\\|false given\\.$#" count: 1 @@ -675,6 +660,11 @@ parameters: count: 1 path: src/Admin/ImportExport.php + - + message: "#^Parameter \\#1 \\$args of function get_posts expects array*.+$#" + count: 1 + path: src/Admin/ImportExport.php + - message: "#^Access to an undefined property object\\:\\:\\$ID\\.$#" count: 1 @@ -1130,6 +1120,11 @@ parameters: count: 1 path: src/Core/Upgrade.php + - + message: "#^Parameter \\#1 \\$args of function get_posts expects array*.+$#" + count: 1 + path: src/Core/Upgrade.php + - message: "#^Cannot access property \\$post_name on WP_Post\\|null\\.$#" count: 1 @@ -1250,6 +1245,11 @@ parameters: count: 1 path: src/Defaults/Field/EditorField.php + - + message: "#^Parameter \\#3 \\$settings of function wp_editor expects array*.+$#" + count: 1 + path: src/Utils/Settings/CoreFields/Editor.php + - message: "#^Method BracketSpace\\\\Notification\\\\Defaults\\\\Field\\\\InputField\\:\\:__construct\\(\\) has parameter \\$params with no value type specified in iterable type array\\.$#" count: 1 @@ -1620,6 +1620,11 @@ parameters: count: 1 path: src/Defaults/Recipient/UserID.php + - + message: "#^Parameter \\#1 \\$args of function get_users expects array*.+$#" + count: 1 + path: src/Defaults/Recipient/UserID.php + - message: "#^Method BracketSpace\\\\Notification\\\\Defaults\\\\Recipient\\\\Webhook\\:\\:parse_value\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -2390,6 +2395,11 @@ parameters: count: 1 path: src/Queries/NotificationQueries.php + - + message: "#^Parameter \\#1 \\$args of function get_posts expects array*.+$#" + count: 1 + path: src/Queries/NotificationQueries.php + - message: "#^Method BracketSpace\\\\Notification\\\\Runtime\\:\\:components\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 5086e6b40..ae9e258ac 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -4,6 +4,7 @@ includes: parameters: level: max inferPrivatePropertyTypeFromConstructor: true + reportUnmatchedIgnoredErrors: false bootstrapFiles: - tests/phpstan/bootstrap.php scanFiles: diff --git a/resources/js/src/fields/repeater/mixins/inputsHandler.js b/resources/js/src/fields/repeater/mixins/inputsHandler.js index ed224d67e..7747113fc 100644 --- a/resources/js/src/fields/repeater/mixins/inputsHandler.js +++ b/resources/js/src/fields/repeater/mixins/inputsHandler.js @@ -55,7 +55,7 @@ export const inputsHandler = { data = data.join("&"); - fetch(notification.select_rest_url, { + fetch(notification.selectRestUrl, { method: "POST", headers: { "Content-Type": diff --git a/resources/templates/box.php b/resources/templates/box.php index 26b5b93e3..a2f0429a6 100644 --- a/resources/templates/box.php +++ b/resources/templates/box.php @@ -1,31 +1,93 @@ -
> +
+ >
- data-nt-carrier-input-switch /> -
-

+

- - - - - + + + + +
diff --git a/resources/templates/carriers/widget-add.php b/resources/templates/carriers/widget-add.php index 0e5e4b361..e2fbaa8b6 100644 --- a/resources/templates/carriers/widget-add.php +++ b/resources/templates/carriers/widget-add.php @@ -1,63 +1,122 @@ -
> -
    - - -
  • get_slug(), $get( 'carriers_exists' ) ) ) ? 'data-nt-hidden' : ''; ?>> - +
    + > + diff --git a/resources/templates/debug/error-log.php b/resources/templates/debug/error-log.php index 5fb02f85a..36e10326a 100644 --- a/resources/templates/debug/error-log.php +++ b/resources/templates/debug/error-log.php @@ -1,47 +1,77 @@
    - - - -
    + + +
    - type ) : ?> - + type === 'warning') : ?> + - + - component ); ?> - message ) ) ); ?> + component); ?> + + message) + ) + ); + ?> + - - - time_logged ) ) ) ); ?> + + timeLogged)) + ) + ); + ?>
    - message ); ?> + message); ?>
    @@ -49,7 +79,7 @@ -

    +

    diff --git a/resources/templates/debug/notification-log.php b/resources/templates/debug/notification-log.php index c6e175043..ed9ec7092 100644 --- a/resources/templates/debug/notification-log.php +++ b/resources/templates/debug/notification-log.php @@ -1,105 +1,210 @@
    - - - + +
    - - - + + + - - - + +
    - + - - + + - - + + - - + + - - + + - - + +
    + +
    + +
    + +
    + +
    - + + - + +
    - + + - + +
    - - $value ) : ?> + + $value) : ?> - +
    - +
    
     												
     											
    -
    +
    - + - + - - + + - $value ) : ?> + $value) : ?> - + @@ -113,7 +218,14 @@ -

    +

    + +

    diff --git a/resources/templates/debug/pagination.php b/resources/templates/debug/pagination.php index 83fb4e4d2..03692efe1 100644 --- a/resources/templates/debug/pagination.php +++ b/resources/templates/debug/pagination.php @@ -1,23 +1,30 @@ admin_url( 'edit.php?post_type=notification&page=settings§ion=debugging&' . $get( 'query_arg' ) . '=%#%' ), - 'current' => $get( 'current' ), - 'total' => $get( 'total' ), -] ); +$links = paginate_links( + [ + 'base' => admin_url( + 'edit.php?post_type=notification&page=settings§ion=debugging&' . $get('query_arg') . '=%#%' + ), + 'current' => $get('current'), + 'total' => $get('total'), + ] +); ?>
    - +
    diff --git a/resources/templates/export/notifications.php b/resources/templates/export/notifications.php index c1331d92b..8bef2e13f 100644 --- a/resources/templates/export/notifications.php +++ b/resources/templates/export/notifications.php @@ -1,32 +1,57 @@ $notifications */ +$notifications = $get('notifications'); ?> - -

    + +

    -
      -
    • - -
    • +
    • + +
    • + +
    • + +
    - +
    diff --git a/resources/templates/extension/activation-error.php b/resources/templates/extension/activation-error.php index a9ff75609..d9c2979e6 100644 --- a/resources/templates/extension/activation-error.php +++ b/resources/templates/extension/activation-error.php @@ -1,23 +1,26 @@
    -

    - +

    +
      - -
    • + +
    diff --git a/resources/templates/extension/activation-success.php b/resources/templates/extension/activation-success.php index ff17114f4..18c8b24f2 100644 --- a/resources/templates/extension/activation-success.php +++ b/resources/templates/extension/activation-success.php @@ -1,17 +1,22 @@
    -

    +

    diff --git a/resources/templates/extension/bundle.php b/resources/templates/extension/bundle.php index e689c3e28..82dc47763 100644 --- a/resources/templates/extension/bundle.php +++ b/resources/templates/extension/bundle.php @@ -1,29 +1,54 @@
    -

    +

    -
    +
    diff --git a/resources/templates/extension/extension-box-premium.php b/resources/templates/extension/extension-box-premium.php index 6968d3c7b..568b89f45 100644 --- a/resources/templates/extension/extension-box-premium.php +++ b/resources/templates/extension/extension-box-premium.php @@ -1,63 +1,206 @@ get(); ?> -
    +

    - - <?php echo esc_attr( $ext['name'] ); ?> + + <?php echo esc_attr($ext['name']); ?>

    - -

    + +

    + +

    - expires ) : ?> - -

    expires, time() ) ) ) ); ?>

    + expires !== 'lifetime') : ?> +

    + expires, + time() + ) + ) + ) + ); + ?> +

    -

    +

    + +

    - license, [ 'inactive', 'site_inactive' ], true ) ) : ?> -

    + license, + ['inactive', 'site_inactive'], + true + ) + ) : + ?> +

    + +

    - license ) : ?> -

    + license === 'expired') : ?> +

    + +

    -

    +

    + + + +

    -
    - - - - -
    -
    + + + + + +
    + +
    +
    + +
    - - -
    -
    + + +
    + +
    +
    + +
    diff --git a/resources/templates/extension/extension-box.php b/resources/templates/extension/extension-box.php index f6175cd13..043ef3159 100644 --- a/resources/templates/extension/extension-box.php +++ b/resources/templates/extension/extension-box.php @@ -1,101 +1,197 @@ ' . __( 'Install Now', 'notification' ) . ''; + if ($status['url']) { + $actionButton = + '' . __( + 'Install Now', + 'notification' + ) . ''; } break; case 'update_available': - if ( $status['url'] ) { - /* translators: 1: Plugin name and version */ - $action_button = '' . __( 'Update Now', 'notification' ) . ''; + if ($status['url']) { + $actionButton = '' . __( + 'Update Now', + 'notification' + ) . ''; } break; case 'latest_installed': case 'newer_installed': - if ( is_plugin_active( $status['file'] ) ) { - $action_button = ''; - } elseif ( current_user_can( 'activate_plugins' ) ) { - $button_text = __( 'Activate', 'notification' ); + if (is_plugin_active($status['file'])) { + $actionButton = ''; + } elseif (current_user_can('activate_plugins')) { + $buttonText = __( + 'Activate', + 'notification' + ); /* translators: %s: Plugin name */ - $button_label = _x( 'Activate %s', 'plugin', 'notification' ); - $activate_url = add_query_arg( - array( - '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $status['file'] ), - 'action' => 'activate', - 'plugin' => $status['file'], - ), - network_admin_url( 'plugins.php' ) + $buttonLabel = _x( + 'Activate %s', + 'plugin', + 'notification' + ); + $activateUrl = add_query_arg( + [ + '_wpnonce' => wp_create_nonce('activate-plugin_' . $status['file']), + 'action' => 'activate', + 'plugin' => $status['file'], + ], + network_admin_url('plugins.php') ); - if ( is_network_admin() ) { - $button_text = __( 'Network Activate', 'notification' ); + if (is_network_admin()) { + $buttonText = __( + 'Network Activate', + 'notification' + ); /* translators: %s: Plugin name */ - $button_label = _x( 'Network Activate %s', 'plugin', 'notification' ); - $activate_url = add_query_arg( array( 'networkwide' => 1 ), $activate_url ); + $buttonLabel = _x( + 'Network Activate %s', + 'plugin', + 'notification' + ); + $activateUrl = add_query_arg( + ['networkwide' => 1], + $activateUrl + ); } - $action_button = sprintf( + $actionButton = sprintf( '%3$s', - esc_url( $activate_url ), - esc_attr( sprintf( $button_label, $ext['name'] ) ), - $button_text + esc_url($activateUrl), + esc_attr( + sprintf( + $buttonLabel, + $ext['name'] + ) + ), + $buttonText ); } else { - $action_button = ''; + $actionButton = ''; } break; } } else { - - $action_button = '' . __( 'More Details', 'notification' ) . ''; - + $actionButton = '' . __( + 'More Details', + 'notification' + ) . ''; } ?> -
    +

    - - <?php echo esc_attr( $ext['name'] ); ?> + + <?php echo esc_attr($ext['name']); ?>

    -

    -

    :

    +

    + +

    +

    + + :

    diff --git a/resources/templates/extension/page.php b/resources/templates/extension/page.php index 609aa35d6..cf526819d 100644 --- a/resources/templates/extension/page.php +++ b/resources/templates/extension/page.php @@ -1,33 +1,54 @@
    -

    - - - -

    +

    + +

    + + +

    + +

    - - $extension ] ); ?> + + $extension] + ); + ?>
    @@ -35,25 +56,47 @@ -

    +

    + +

    -

    +

    + +

    - - $extension ] ); ?> + + $extension] + ); + ?> - +
    diff --git a/resources/templates/extension/promo-box.php b/resources/templates/extension/promo-box.php index 251cbc76c..88a57079a 100644 --- a/resources/templates/extension/promo-box.php +++ b/resources/templates/extension/promo-box.php @@ -1,18 +1,21 @@
    -

    +

    + +

    -

    - -

    ' . esc_html__( 'documentation', 'notification' ) . '' ); ?>

    +

    + +

    +

    + ' . + esc_html__( + 'documentation', + 'notification' + ) . '' + ); + ?> +

    diff --git a/resources/templates/form/empty-form.php b/resources/templates/form/empty-form.php index 9584b0ed8..d15dc09d9 100644 --- a/resources/templates/form/empty-form.php +++ b/resources/templates/form/empty-form.php @@ -1,15 +1,25 @@ -

    +

    + +

    diff --git a/resources/templates/form/field-hidden.php b/resources/templates/form/field-hidden.php index e874bc160..9524a360b 100644 --- a/resources/templates/form/field-hidden.php +++ b/resources/templates/form/field-hidden.php @@ -1,15 +1,18 @@ field(); +echo $get('current_field')->field(); diff --git a/resources/templates/form/field.php b/resources/templates/form/field.php index 54910adc9..6e2fd52d8 100644 --- a/resources/templates/form/field.php +++ b/resources/templates/form/field.php @@ -1,56 +1,86 @@ field_type ) ) { - $type = $field->field_type; - $id = 'id=' . $field->id . ''; - if ( 'repeater' === $type ) { - $vue_class = ' vue-repeater'; - } elseif ( 'section-repeater' === $type ) { - $vue_class = ' vue-section-repeater'; +if (isset($field->fieldType)) { + $type = $field->fieldType; + $id = 'id=' . $field->id . ''; + if ($type === 'repeater') { + $vueClass = ' vue-repeater'; + } elseif ($type === 'section-repeater') { + $vueClass = ' vue-section-repeater'; } } -$data_carrier = $carrier ? ' data-carrier=' . $carrier : ''; +$dataCarrier = $carrier + ? ' data-carrier=' . $carrier + : ''; ?> -
    class="get_raw_name() ) . esc_attr( $vue_class ); ?>" data-field-name=get_raw_name() ) . esc_attr( $data_carrier ); ?> > + class="getRawName()) . esc_attr($vueClass); ?>" + data-field-name=getRawName()) . esc_attr($dataCarrier); ?>> diff --git a/resources/templates/form/table.php b/resources/templates/form/table.php index e500305d7..472c9e139 100644 --- a/resources/templates/form/table.php +++ b/resources/templates/form/table.php @@ -1,56 +1,74 @@
    + +
    + + + +
    - +
    
     													
     												
    -
    +
    - + - - + + field(); ?> - get_description(); ?> - -

    + getDescription(); ?> + +

    - - + +
    get_form_fields() as $field ) { + foreach ($carrier->getFormFields() as $field) { // Check if this is the right moment to print recipients field. - if ( ! $recipient_field_printed && $carrier->has_recipients_field() && $current_index === $carrier->recipients_field_index ) { - Templates::render( 'form/field', [ - 'current_field' => $carrier->get_recipients_field(), - 'carrier' => $carrier->get_slug(), - ] ); - $recipient_field_printed = true; + if ( + !$recipientFieldPrinted && $carrier->hasRecipientsField( + ) && $currentIndex === $carrier->recipientsFieldIndex + ) { + Templates::render( + 'form/field', + [ + 'current_field' => $carrier->getRecipientsField(), + 'carrier' => $carrier->getSlug(), + ] + ); + $recipientFieldPrinted = true; } $vars = [ 'current_field' => $field, - 'carrier' => $carrier->get_slug(), + 'carrier' => $carrier->getSlug(), ]; - if ( empty( $field->get_label() ) ) { - Templates::render( 'form/field-hidden', $vars ); + if (empty($field->getLabel())) { + Templates::render( + 'form/field-hidden', + $vars + ); } else { - Templates::render( 'form/field', $vars ); - $current_index++; + Templates::render( + 'form/field', + $vars + ); + $currentIndex++; } } // Check if the recipients field should be printed as a last field. - if ( $carrier->has_recipients_field() && $current_index === $carrier->recipients_field_index ) { - Templates::render( 'form/field', [ - 'current_field' => $carrier->get_recipients_field(), - 'carrier' => $carrier->get_slug(), - ] ); + if ($carrier->hasRecipientsField() && $currentIndex === $carrier->recipientsFieldIndex) { + Templates::render( + 'form/field', + [ + 'current_field' => $carrier->getRecipientsField(), + 'carrier' => $carrier->getSlug(), + ] + ); } ?> diff --git a/resources/templates/help/global-merge-tags.php b/resources/templates/help/global-merge-tags.php index 0f9b6b88b..4a1c293b3 100644 --- a/resources/templates/help/global-merge-tags.php +++ b/resources/templates/help/global-merge-tags.php @@ -1,32 +1,58 @@ -

    +

    + +

    - + - - + + diff --git a/resources/templates/help/sidebar.php b/resources/templates/help/sidebar.php index f491bd458..d76d76ae5 100644 --- a/resources/templates/help/sidebar.php +++ b/resources/templates/help/sidebar.php @@ -1,21 +1,67 @@ -

    +

    + +

    diff --git a/resources/templates/import/notifications.php b/resources/templates/import/notifications.php index d22d278f7..433626b95 100644 --- a/resources/templates/import/notifications.php +++ b/resources/templates/import/notifications.php @@ -1,19 +1,36 @@
    - - + + + +

    diff --git a/resources/templates/mergetag/metabox-accordion.php b/resources/templates/mergetag/metabox-accordion.php index f846669a5..27855d83d 100644 --- a/resources/templates/mergetag/metabox-accordion.php +++ b/resources/templates/mergetag/metabox-accordion.php @@ -1,39 +1,66 @@
    - - $group_value ) : ?> -

    - -
      - + + $groupValue) : ?> +

      + +
        +
      • - $tag ] ); ?> + $tag] + ); + ?>
      - +
    - + diff --git a/resources/templates/mergetag/metabox-list.php b/resources/templates/mergetag/metabox-list.php index 99834bf9c..abccc462f 100644 --- a/resources/templates/mergetag/metabox-list.php +++ b/resources/templates/mergetag/metabox-list.php @@ -1,33 +1,57 @@
      - - + +
    • - $tag ] ); ?> + $tag] + ); + ?>
    • - +
    - + diff --git a/resources/templates/mergetag/metabox-nomergetags.php b/resources/templates/mergetag/metabox-nomergetags.php index 02382b71e..b73833cb0 100644 --- a/resources/templates/mergetag/metabox-nomergetags.php +++ b/resources/templates/mergetag/metabox-nomergetags.php @@ -1,15 +1,25 @@ -

    +

    + +

    diff --git a/resources/templates/mergetag/metabox-notrigger.php b/resources/templates/mergetag/metabox-notrigger.php index 3254be740..9e61cf21f 100644 --- a/resources/templates/mergetag/metabox-notrigger.php +++ b/resources/templates/mergetag/metabox-notrigger.php @@ -1,15 +1,25 @@ -

    +

    + +

    diff --git a/resources/templates/mergetag/searchbox.php b/resources/templates/mergetag/searchbox.php index ea2748abc..5650c0bae 100644 --- a/resources/templates/mergetag/searchbox.php +++ b/resources/templates/mergetag/searchbox.php @@ -1,15 +1,31 @@ - + diff --git a/resources/templates/mergetag/tag.php b/resources/templates/mergetag/tag.php index 64a762355..d7b12b261 100644 --- a/resources/templates/mergetag/tag.php +++ b/resources/templates/mergetag/tag.php @@ -1,38 +1,52 @@
    - - {get_slug() ); ?>} + + {getSlug()); ?> + }
    -get_description(); ?> - +getDescription(); ?> + ?
    - is_description_example() ) : ?> - + isDescriptionExample()) : ?> +
    - +
    - is_description_example() ) : ?> - (get_value_type() ); ?>) + isDescriptionExample()) : ?> + (getValueType()); ?>)
    diff --git a/resources/templates/save-metabox.php b/resources/templates/save-metabox.php index e59ba804b..26b0fa225 100644 --- a/resources/templates/save-metabox.php +++ b/resources/templates/save-metabox.php @@ -1,42 +1,124 @@ -
    - +
    +
    - - + +
    - > -
    - +
    - - - + + + + +
    - +
    diff --git a/resources/templates/settings/page.php b/resources/templates/settings/page.php index ecf286cdc..13151a389 100644 --- a/resources/templates/settings/page.php +++ b/resources/templates/settings/page.php @@ -1,94 +1,181 @@ -
    - -

    textdomain ); ?>

    - - -

    textdomain ); ?>

    +
    + +

    + textdomain + ); + ?> +

    + + +

    + textdomain + ); + ?> +

    - - get_section( $current_section ); ?> + getSection($currentSection); ?> -
    +
    - handle . '/settings/section/' . $section->slug() . '/before' ); ?> + handle . '/settings/section/' . $section->slug() . '/before'); ?> -
    + - handle . '_settings', 'nonce' ); ?> + handle . '_settings', + 'nonce' + ); + ?> - + - - - get_groups(); ?> - - - -
    -
    -

    name() ); ?>

    + + + getGroups(); ?> + + +
    +
    +

    name()); ?>

    description(); ?> - -

    + +

    - handle . '/settings/group/' . $group->slug() . '/before' ); ?> + handle . '/settings/group/' . $group->slug() . '/before'); ?>
    get_name() ); ?>{get_slug() ); ?>}getName()); ?>{ + getSlug() + ); + ?> + } - get_description(); ?> - + getDescription(); ?> +

    - is_description_example() ) : ?> - + isDescriptionExample()) : ?> + + + - +

    - get_fields() as $field ) : ?> - - - + getFields() as $field) : ?> + + @@ -96,19 +183,24 @@
    + + render(); - $field_description = $field->description(); + $fieldDescription = $field->description(); ?> - - + + + +
    - handle . '/settings/sections/after', $group->slug() ); ?> + handle . '/settings/sections/after', + $group->slug() + ); + ?>
    - + - handle . '/settings/section/' . $section->slug() . '/after' ); ?> + handle . '/settings/section/' . $section->slug() . '/after'); ?>
    diff --git a/resources/templates/sync/actions.php b/resources/templates/sync/actions.php index 040fa2fe2..930f34b21 100644 --- a/resources/templates/sync/actions.php +++ b/resources/templates/sync/actions.php @@ -1,22 +1,33 @@ diff --git a/resources/templates/sync/disabled.php b/resources/templates/sync/disabled.php index 2f19dc135..effccf452 100644 --- a/resources/templates/sync/disabled.php +++ b/resources/templates/sync/disabled.php @@ -1,19 +1,26 @@ notification_sync()' - ), 'notification' ) + // Translators: %s Function name. + __( + sprintf( + 'Synchronization is disabled. You can enable it with %s function', + 'notification_sync()' + ), + 'notification' + ) ); diff --git a/resources/templates/sync/notifications-empty.php b/resources/templates/sync/notifications-empty.php index 159aabbca..81ce4db50 100644 --- a/resources/templates/sync/notifications-empty.php +++ b/resources/templates/sync/notifications-empty.php @@ -1,13 +1,16 @@ - - - - - - + + + + + + - - get_hash(); ?> + + getHash(); ?> diff --git a/resources/templates/trigger/metabox.php b/resources/templates/trigger/metabox.php index f7b03020c..379dfc2f2 100644 --- a/resources/templates/trigger/metabox.php +++ b/resources/templates/trigger/metabox.php @@ -1,31 +1,65 @@ -

    - - +

    + +

    -

    + +

    + +

    + - - - get_vars() ); ?> + get_vars() + ); + ?> - + diff --git a/resources/templates/trigger/select.php b/resources/templates/trigger/select.php index d1c410b0f..4828acbe8 100644 --- a/resources/templates/trigger/select.php +++ b/resources/templates/trigger/select.php @@ -1,34 +1,55 @@ - - $subtriggers ) : ?> - - - - $trigger ) : ?> - - - - + + $trigger) : ?> + + + diff --git a/resources/templates/upsell/carriers-list.php b/resources/templates/upsell/carriers-list.php index ffa26a85d..71975f58f 100644 --- a/resources/templates/upsell/carriers-list.php +++ b/resources/templates/upsell/carriers-list.php @@ -1,37 +1,64 @@ - +
  • - - + + + +
    sanitize( $carrier['icon'] ); + echo $svgSanitizer->sanitize($carrier['icon']); ?>
    -
    +
    -
    +
    + +
    diff --git a/resources/templates/upsell/carriers-upsell.php b/resources/templates/upsell/carriers-upsell.php index dd6915b2c..c71af9338 100644 --- a/resources/templates/upsell/carriers-upsell.php +++ b/resources/templates/upsell/carriers-upsell.php @@ -1,19 +1,25 @@

    extensions.', 'notification' ), - admin_url( 'edit.php?post_type=notification&page=extensions' ) + // Translators: Link to extension. + __( + 'Unlock SMS, Slack, Discord and more Carriers with our free and paid extensions.', + 'notification' + ), + admin_url('edit.php?post_type=notification&page=extensions') ); // phpcs:enable ?> diff --git a/resources/templates/upsell/conditionals-metabox.php b/resources/templates/upsell/conditionals-metabox.php index 7eb33ec76..692c075ec 100644 --- a/resources/templates/upsell/conditionals-metabox.php +++ b/resources/templates/upsell/conditionals-metabox.php @@ -1,26 +1,69 @@ %s', - __( 'Conditionals extension', 'notification' ) + __( + 'Conditionals extension', + 'notification' + ) ); ?> PRO diff --git a/resources/templates/upsell/custom-development.php b/resources/templates/upsell/custom-development.php index be41bd69a..770de32d1 100644 --- a/resources/templates/upsell/custom-development.php +++ b/resources/templates/upsell/custom-development.php @@ -1,21 +1,42 @@

    -

    -

    +

    + +

    +

    + +

    %s', - esc_html__( 'Find out more', 'notification' ) + esc_html__( + 'Find out more', + 'notification' + ) ); - echo wp_kses_post( $description ); + echo wp_kses_post($description); ?>
    diff --git a/resources/templates/upsell/custom-fields-mergetag-group.php b/resources/templates/upsell/custom-fields-mergetag-group.php index 7b26eaa52..def41f4ca 100644 --- a/resources/templates/upsell/custom-fields-mergetag-group.php +++ b/resources/templates/upsell/custom-fields-mergetag-group.php @@ -1,26 +1,46 @@ %s', - __( 'Custom Fields extension', 'notification' ) + __( + 'Custom Fields extension', + 'notification' + ) ); ?> -

    -
      +

      + +

      +
        PRO {postmeta …}, {usermeta …}, {commentmeta …}, or {acf …}' ); // phpcs:enable diff --git a/resources/templates/upsell/review-queue-switch.php b/resources/templates/upsell/review-queue-switch.php index c43a69fe1..d1c5e19d6 100644 --- a/resources/templates/upsell/review-queue-switch.php +++ b/resources/templates/upsell/review-queue-switch.php @@ -1,18 +1,40 @@ -
  • - - - - get_title() ); ?> - - + + + getTitle()); ?> + + + - + - - - - + + + + - + - - + + - + - - - - - + + + + +