Version Description
- 2020-09-28 =
- Added debug mode
- Fixed admin assets loading
- Fixed COD Enable for shipping methods
Download this release
Release Info
Developer | wpdesk |
Plugin | Flexible Shipping for WooCommerce |
Version | 3.14.0 |
Comparing to | |
See all releases |
Code changes from version 3.13.0 to 3.14.0
- assets/css/admin.css +1 -1
- assets/css/admin.min.css +1 -1
- assets/js/ap_conditional_logic.js +0 -61
- assets/js/collection-points-map.js +0 -58
- assets/js/collection-points-map.min.js +0 -1
- classes/Flexible_Shipping_Contextual_Info.php +9 -6
- classes/class-flexible-shipping-plugin.php +90 -81
- classes/table-rate/abtests/ab-deactivation-contact-information-test/class-ab-variant-old.php +0 -33
- classes/table-rate/abtests/ab-deactivation-contact-information-test/class-ab-variant-with-contact-information-button.php +0 -34
- classes/table-rate/abtests/ab-deactivation-contact-information-test/class-ab-variant-with-contact-information-on-bottom.php +0 -34
- classes/table-rate/abtests/ab-deactivation-contact-information-test/class-ab-variant-with-contact-information-on-top.php +0 -34
- classes/table-rate/abtests/class-ab-deactivation-contact-information.php +0 -111
- classes/table-rate/abtests/class-ab-tracker-deactivation-data.php +0 -51
- classes/table-rate/abtests/class-deactivation-thickbox-factory.php +0 -51
- classes/table-rate/abtests/views/html-empty.php +0 -0
- classes/table-rate/abtests/views/html-information.php +0 -18
- classes/table-rate/abtests/views/html-thickbox-buttons-additional-button.php +0 -13
- classes/table-rate/abtests/views/html-thickbox-buttons.php +0 -4
- classes/table-rate/abtests/views/html-thickbox-contact-information-button.php +0 -8
- classes/table-rate/abtests/views/html-thickbox-contact-information-on-bottom.php +0 -7
- classes/table-rate/abtests/views/html-thickbox-contact-information-on-top.php +0 -8
- classes/table-rate/abtests/views/html-thickbox-content.php +0 -91
- classes/table-rate/flexible-shipping-settings.php +15 -4
- classes/table-rate/settings/shipping-method-form.php +13 -1
- classes/table-rate/shipping-method.php +131 -12
- classes/table-rate/views/html-ads.php +3 -2
- classes/table-rate/views/html-shipping-method-rules.php +1 -6
- classes/wp-wpdesk-fs-shipment/rate-notice.php +8 -31
- classes/wp-wpdesk-fs-shipment/rate-notices/first-rate-notice.php +0 -65
- classes/wp-wpdesk-fs-shipment/rate-notices/order-counter.php +0 -53
- classes/wp-wpdesk-fs-shipment/rate-notices/{second-rate-notice.php → rate-notice-implementation.php} +2 -4
- classes/wp-wpdesk-fs-shipment/rate-notices/rate-notices-creator.php +0 -24
- classes/wp-wpdesk-fs-shipment/rate-notices/third-rate-notice.php +0 -63
- classes/wp-wpdesk-fs-shipment/shipment/class-shipment.php +2 -0
- composer.lock +151 -129
- flexible-shipping.php +3 -4
- readme.txt +11 -2
- src/WPDesk/FS/TableRate/Debug/NoShippingMethodsNotice.php +128 -0
- src/WPDesk/FS/TableRate/Debug/Tracker.php +103 -0
- src/WPDesk/FS/TableRate/NewRulesTableDeactivationTracker.php +1 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_classmap.php +22 -44
- vendor/composer/autoload_psr4.php +0 -2
- vendor/composer/autoload_real.php +4 -4
- vendor/composer/autoload_static.php +27 -62
- vendor/composer/installed.json +0 -98
- vendor/wpdesk/wp-builder/.editorconfig +0 -21
- vendor/wpdesk/wp-builder/.gitignore +0 -3
- vendor/wpdesk/wp-builder/.gitlab/issue_templates/Bug.md +0 -32
- vendor/wpdesk/wp-builder/CHANGELOG.md +0 -50
- vendor/wpdesk/wp-builder/apigen.neon +0 -27
- vendor/wpdesk/wp-builder/composer.json +0 -33
- vendor/wpdesk/wp-builder/phpcs.xml.dist +0 -18
- vendor/wpdesk/wp-builder/phpunit-integration.xml +0 -28
- vendor/wpdesk/wp-builder/phpunit-unit.xml +0 -21
- vendor/wpdesk/wp-builder/src/BuildDirector/LegacyBuildDirector.php +0 -37
- vendor/wpdesk/wp-builder/src/Builder/AbstractBuilder.php +0 -64
- vendor/wpdesk/wp-builder/src/Builder/InfoActivationBuilder.php +0 -82
- vendor/wpdesk/wp-builder/src/Builder/InfoBuilder.php +0 -58
- vendor/wpdesk/wp-builder/src/Plugin/AbstractPlugin.php +0 -223
- vendor/wpdesk/wp-builder/src/Plugin/Activateable.php +0 -21
- vendor/wpdesk/wp-builder/src/Plugin/ActivationAware.php +0 -27
- vendor/wpdesk/wp-builder/src/Plugin/ActivationTracker.php +0 -75
- vendor/wpdesk/wp-builder/src/Plugin/Conditional.php +0 -20
- vendor/wpdesk/wp-builder/src/Plugin/Deactivateable.php +0 -21
- vendor/wpdesk/wp-builder/src/Plugin/Hookable.php +0 -15
- vendor/wpdesk/wp-builder/src/Plugin/HookableCollection.php +0 -24
- vendor/wpdesk/wp-builder/src/Plugin/HookableParent.php +0 -59
- vendor/wpdesk/wp-builder/src/Plugin/HookablePluginDependant.php +0 -24
- vendor/wpdesk/wp-builder/src/Plugin/PluginAccess.php +0 -34
- vendor/wpdesk/wp-builder/src/Plugin/SlimPlugin.php +0 -20
- vendor/wpdesk/wp-builder/src/Plugin/TemplateLoad.php +0 -74
- vendor/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Buildable.php +0 -11
- vendor/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Has_Plugin_Info.php +0 -29
- vendor/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Plugin_Info.php +0 -171
- vendor/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Translable.php +0 -9
- vendor/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Translatable.php +0 -15
- vendor/wpdesk/wp-builder/src/Storage/Exception/ClassAlreadyExists.php +0 -8
- vendor/wpdesk/wp-builder/src/Storage/Exception/ClassNotExists.php +0 -8
- vendor/wpdesk/wp-builder/src/Storage/PluginStorage.php +0 -22
- vendor/wpdesk/wp-builder/src/Storage/StaticStorage.php +0 -38
- vendor/wpdesk/wp-builder/src/Storage/StorageFactory.php +0 -14
- vendor/wpdesk/wp-builder/src/Storage/WordpressFilterStorage.php +0 -44
- vendor/wpdesk/wp-pointer/CHANGELOG.md +0 -7
- vendor/wpdesk/wp-pointer/LICENSE.md +0 -21
- vendor/wpdesk/wp-pointer/composer.json +0 -38
- vendor/wpdesk/wp-pointer/src/WPDesk/Pointer/PointerConditions.php +0 -111
- vendor/wpdesk/wp-pointer/src/WPDesk/Pointer/PointerMessage.php +0 -353
- vendor/wpdesk/wp-pointer/src/WPDesk/Pointer/PointerPosition.php +0 -77
- vendor/wpdesk/wp-pointer/src/WPDesk/Pointer/PointersScripts.php +0 -57
- vendor/wpdesk/wp-pointer/src/WPDesk/Pointer/views/html-script-pointer-message.php +0 -36
- vendor_prefixed/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Has_Plugin_Info.php +0 -5
- vendor_prefixed/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Translatable.php +0 -5
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/assets/css/notices.css +6 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/assets/js/notices.js +39 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/composer.json +11 -3
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/AbstractOptions.php +29 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/BasedOnOptions.php +22 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/CalculationMethodOptions.php +22 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/ArrayLogger.php +41 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/Assets.php +48 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/CanFormatForLog.php +18 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/NoticeLogger.php +114 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/ShippingMethodLogger.php +94 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/view/display-notice-content-single-value.php +23 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/view/display-notice-footer.php +10 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/view/display-notice-header.php +11 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/CheckboxValue.php +27 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/IntegrationSettings.php +16 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/IntegrationSettingsFactory.php +25 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/IntegrationSettingsImplementation.php +43 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/MethodSettings.php +70 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/MethodSettingsFactory.php +24 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/MethodSettingsImplementation.php +214 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/RuleSettings.php +47 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/RuleSettingsFactory.php +40 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/RuleSettingsImplementation.php +120 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/RulesSettingsFactory.php +37 -0
- vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Weight/Rounding.php +6 -5
- vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/class-wpdesk-tracker-interface.php +9 -0
assets/css/admin.css
CHANGED
@@ -1014,7 +1014,7 @@ table.wc_input_table.flexible_shipping_rules input.select2-search__field {
|
|
1014 |
border: 0px;
|
1015 |
}
|
1016 |
|
1017 |
-
table.wc_input_table.
|
1018 |
display: none;
|
1019 |
}
|
1020 |
|
1014 |
border: 0px;
|
1015 |
}
|
1016 |
|
1017 |
+
table.wc_input_table.flexible_shipping_method_rules td p label span.optional {
|
1018 |
display: none;
|
1019 |
}
|
1020 |
|
assets/css/admin.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
table.flexible_shipping_methods th.select,table.flexible_shipping_methods td.select{text-align:center;width:40px;margin-top:-7px;margin-left:-6px;padding:2px}table.flexible_shipping_methods .checkbox-select-all{margin:0 12px 0 8px}table.flexible_shipping_methods th.integration,table.flexible_shipping_methods td.integration{text-align:center;width:130px}table.flexible_shipping_methods tr.highlight td{background-color:#e4f2fd}table.flexible_shipping_methods.wc_shipping th{font-weight:400;width:auto}table.flexible_shipping_methods td.ui-sortable-handle:before,table.flexible_shipping_services td.ui-sortable-handle:before{content:'\f333';font-family:Dashicons;text-align:center;line-height:1;color:#999;display:block;width:17px;float:left;height:100%;line-height:24px}table.wc_input_table.flexible_shipping_rules.fs_new_interface td{padding:25px 5px;vertical-align:middle;border:0}table.wc_input_table.flexible_shipping_rules.fs_new_interface tr:nth-child(even) td{background:#f9f9f9}table.wc_input_table.flexible_shipping_rules.fs_new_interface tr:nth-child(odd) td.sort{background:white}table.wc_input_table.flexible_shipping_rules.fs_new_interface td p.form-row{margin-top:0}table.wc_input_table.flexible_shipping_rules.fs_new_interface .description{padding-top:5px}table.wc_input_table.flexible_shipping_rules.fs_new_interface .form-row{padding-right:5px}table.wc_input_table.flexible_shipping_rules.fs_new_interface .single_rule_condition{vertical-align:middle;display:flex}table.wc_input_table.flexible_shipping_rules.fs_new_interface tbody .sort{padding-top:27px !important;padding-bottom:23px !important}.flexible_shipping_method_rules th{width:auto}.flexible_shipping_method_rules th.sort{width:10px}td.fs_cost{width:75px !important}div.rule_condition div{display:inline-block}div.rule_condition div.based_on{width:70px}div.rule_condition div input{width:70px}table.flexible_shipping_method_rules th,table.flexible_shipping_method_rules th{padding:5px 10px 5px 0}table.flexible_shipping_method_rules td p,table.flexible_shipping_method_rules td p input,table.flexible_shipping_method_rules td p select{margin:0;width:100%;box-shadow:none;padding:0 !important}table.flexible_shipping_method_rules td p input[type=text]{text-align:right;padding:0 5px 0 5px !important;width:100% !important}table.flexible_shipping_method_rules td p select{margin:0;width:100% !important;box-shadow:none;line-height:28px;height:37px;vertical-align:middle}table.flexible_shipping_method_rules td p input[type=checkbox]{margin:0;width:auto}table.flexible_shipping_method_rules th,table.flexible_shipping_method_rules td{text-align:center}table.flexible_shipping_method_rules th.shipping_class,table.flexible_shipping_method_rules td.shipping_class{text-align:center;width:200px}table.flexible_shipping_method_rules td.shipping_class span{border:0}table.flexible_shipping_method_rules th.stop,table.flexible_shipping_method_rules td.stop{text-align:center;width:30px}table.flexible_shipping_method_rules th.cancel,table.flexible_shipping_method_rules td.cancel{text-align:center;width:60px}.woocommerce table.form-table .flexible_shipping_method_rules th span.woocommerce-help-tip{float:none;margin:0}.woocommerce table.form-table .flexible_shipping_method_rules .select2-container{margin:0}.woocommerce table.form-table .fs-locations-table .select2-container{max-width:none}.woocommerce table.form-table .fs-locations-table th .woocommerce-help-tip{float:none}div.flexilble_shipping_export_import{float:right}table.flexible_shipping_method_rules tfoot th{padding:10px}.woocommerce_page_wc-settings #mainform{position:relative}.column-flexible_shipping{width:130px}.column-flexible_shipping .shipping-status{float:left;margin-right:8px;margin-top:4px;text-align:left;width:18px}.column-flexible_shipping .shipping-status .created:after{color:#d0c21f !important}.column-flexible_shipping .shipping-actions a.button{float:left;margin:0 4px 2px 0;display:block;height:2em !important;padding:0 !important;position:relative;text-indent:-9999px;width:2em}.column-flexible_shipping .shipping-actions a.button:after{font-family:WooCommerce;font-variant:normal;font-weight:400;height:100%;left:0;line-height:1.85;margin:0;position:absolute;text-align:center;text-indent:0;text-transform:none;top:0;width:100%}.column-flexible_shipping .shipping-actions a.button.get-label:after{content:"\e01e"}.column-flexible_shipping .shipping-actions a.button.track:after{content:"\e01b"}.column-flexible_shipping mark.failed:after{color:#a00 !important}.column-flexible_shipping mark.manifest:after{color:#2ea2cc !important}.flexible_shipping_shipment_message{color:green}.flexible_shipping_shipment_message_error{color:#a00 !important}.flexible_shipping_shipment_message_error span{color:#444;font-weight:bold}.woocommerce .wp-admin select{height:100%}.button.flexible-printing-button-print{height:auto !important;white-space:normal !important;word-wrap:break-word !important}.inspire-settings{display:table;width:100%}.inspire-settings .inspire-main-content,.inspire-settings .inspire-sidebar{display:table-cell;height:500px;margin:0;padding:0;vertical-align:top}.inspire-settings .inspire-main-content{min-width:800px}.inspire-settings .inspire-sidebar{padding-left:30px;width:250px}.flexible-shipping-info ol{margin-top:0}#wpbody-content .flexible-shipping-info .metabox-holder{padding-top:0}#adminmenu #toplevel_page_flexible-shipping .menu-icon-generic div.wp-menu-image::before{font-family:WooCommerce !important;content:'\e01d'}.fs-new-service{color:#006799}.fs-order-item-fallback{margin-top:.5em;color:#888}.flexible_shipping_shipment_content p select{max-width:95%}.flexible_shipping_shipment_content span.description{display:block}.fs-saas-button-cancel-created{float:right;color:#a00;margin-top:5px}.fs-saas-button-cancel-created:hover{color:#a00;cursor:pointer}.flexible_shipping_shipment_content input[type=checkbox]{float:left;margin-right:5px;margin-top:2px !important;opacity:1;border-color:#888}.flexible_shipping_shipment_content input[type=checkbox]:disabled{opacity:.7;border-color:rgba(51,51,51,0.5)}.flexible_shipping_shipment_content p.fs-saas-status span{font-weight:bold;color:#444}.flexible_shipping_shipment_content p.fs-saas-status-fs-new{color:#ffba00}.flexible_shipping_shipment_content p.fs-saas-status-fs-created{color:#d0c21f}.flexible_shipping_shipment_content p.fs-saas-status-fs-confirmed{color:#444}.flexible_shipping_shipment_content p.fs-saas-status-fs-failed{color:#a00}.flexible_shipping_shipment_content p.fs-saas-status-fs-manifest{color:#2ea2cc}.flexible_shipping_shipment_content p.connection-error{font-weight:bold;color:#a00}.fs-saas-shipment span{font-weight:bold}.fs-saas-labels-counts span{font-weight:bold}.fs-saas-no-labels-left{color:#a00}div.flexible-shipping-shipment-attachments p{display:inline}.flexible_shipping_shipment_attachment_message{padding-top:10px;color:green}table.flexible_shipping_services{max-width:550px}table.flexible_shipping_services .sort{width:1%}table.flexible_shipping_services .service_code{width:30px}table.flexible_shipping_services .select{text-align:center;width:1%}table.flexible_shipping_services .select input{margin:0 8px 0 8px}.woocommerce table.form-table table.flexible_shipping_services td.service_name input{width:100%}input.woocommerce_flexible_shipping_service_name{width:100%}.updated .fs-banner__button-container{padding:.75rem 0 0}.notice-info.fs-connect__container{border-left:0;padding:0;box-shadow:0 0 0 1px #dfdfdf,0 1px 2px #dfdfdf}@media screen and (max-width:782px){.notice-info.fs-connect__container{padding:0 !important}}.fs-connect__container{display:block;position:relative;box-sizing:border-box}.fs-connect__inner-container>a:first-child{z-index:1}.fs-connect__inner-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:left;justify-content:left}.fs-connect__content-container{width:1250px;position:relative;padding:2rem;z-index:0}@media(min-width:782px){.fs-connect__content-container{padding:2rem 2rem 4rem 2rem}}.fs-connect__content-container p{color:#555;font-size:.875rem}.fs-connect__content-container h2{margin-top:0;color:#555;line-height:1.6}.fs-connect__content-icon{float:right;margin:0 1.5rem 0 2.25rem}.fs-connect__content-icon svg{fill:#0085ba;height:180px;width:auto}@media(max-width:782px){.fs-connect__content-icon.fs-connect-illo{float:none;width:100%;text-align:center;margin:2.25rem 0 1.5rem}}.fs-connect__slide{display:none}.fs-connect__slide.fs__slide-is-active{display:block}@media(min-width:782px){.fs-connect__content-container .fs-banner__button-container{position:absolute;bottom:.5rem}}.fs-banner__button-container .button-primary{margin:0 .3125rem .3125rem 0}.fs-connect__vertical-nav{background-color:#f1f1f1}@media(min-width:600px){.fs-connect__vertical-nav{-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:start;justify-content:flex-start}}@media(max-width:600px){.fs-connect__vertical-nav{display:none}}.fs-connect__vertical-nav-container{width:15rem}.vertical-menu__feature-item-label{display:none}@media(min-width:600px){.vertical-menu__feature-item{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;border:0;padding:.5rem;border-bottom:1px solid #dfdfdf;border-right:1px solid #dfdfdf;border-left:3px solid #f9f9f9;background-color:#f9f9f9;color:#555;cursor:pointer}.vertical-menu__feature-item:last-of-type{position:relative;top:1px}.vertical-menu__feature-item-is-selected{border-left:3px solid #0085ba;border-right:1px solid #fff;background-color:#fff;color:#2e4453}.vertical-menu__feature-item-is-selected.fs-feature-intro{border-left:3px solid #00be28}.vertical-menu__feature-item-icon{width:1.25rem;height:1.25rem;padding:.25rem;text-align:center}.vertical-menu__feature-item svg{fill:#555;vertical-align:middle}.vertical-menu__feature-item-is-selected svg{fill:#0085ba}.vertical-menu__feature-item-label{display:block;padding:.5rem}}.fs-couriers{margin-top:2.5em}.fs-courier{position:relative;margin-bottom:2.5em;text-align:center}.fs-courier img{height:50px;width:auto}.fs-courier-label{background-color:#333;border-radius:3px;color:#fff;padding:0 4px 1px;position:absolute;right:0;top:-10px}@media(min-width:1200px){.fs-couriers{align-items:center;display:flex;flex-wrap:wrap;justify-content:flex-start}.fs-courier{width:20%}}.admin_page_flexible_shipping_connect_register .notice.is-dismissible,.admin_page_flexible_shipping_connect_register .update-nag,.admin_page_flexible_shipping_connect_register .updated,.admin_page_flexible_shipping_connect_register .settings-error{display:none !important}.fs-page-wrap{margin:0 auto;max-width:45rem}.fs-page-wrap h1{font-weight:normal;margin-bottom:.67em;text-align:center}.fs-box{display:block;position:relative;margin:0 auto 20px;padding:16px;box-sizing:border-box;background:white;box-shadow:0 0 0 1px #dfdfdf,0 1px 2px #dfdfdf}.fs-box:after{content:".";display:block;height:0;clear:both;visibility:hidden}.admin_page_flexible_shipping_connect_register .fs-box,.fs-box.text-center{text-align:center}.admin_page_flexible_shipping_connect_register .fs-box p{margin:1.5em 0}.fs-box input[type="email"]{padding:8px 10px}.fs-actions{padding-left:40px}.fs-actions button:active{vertical-align:inherit !important}.fs-actions .spinner{float:none;margin-top:0}.fs-cols{display:flex;flex-wrap:wrap;justify-content:space-between}.fs-inner-box{box-sizing:border-box;margin-top:30px;padding:0 20px}.fs-inner-box h4{font-size:1.2em;margin-bottom:.37em}.fs-inner-box svg{fill:#0085ba;height:70px;width:auto}@media(min-width:600px){.fs-inner-box{width:33.33%}}.fs-connect-box-header{margin-top:3em}.hide-fs-connect-integration-box{display:none}.fs-settings-div table.form-table{width:700px;float:left}.fs-flexible-shipping-sidebar{float:right;padding-left:30px;width:300px;margin-top:-100px}@media(max-width:1200px){.fs-flexible-shipping-sidebar{display:none}}.wpdesk-metabox{background-color:#23282d;color:#fff;padding:20px}.wpdesk-metabox .title{color:#fff}.wpdesk-metabox .icon{display:block;margin:0 auto;width:110px}table.wc_input_table.flexible_shipping_rules{width:auto;min-width:764px}table.wc_input_table.flexible_shipping_rules td{padding:3px 5px}table.wc_input_table.flexible_shipping_rules span.input-wrapper{line-height:2em}table.wc_input_table.flexible_shipping_rules span.input-wrapper input{line-height:2em}table.wc_input_table.flexible_shipping_rules span.input-wrapper select,table.wc_input_table.flexible_shipping_rules p span.woocommerce-input-wrapper select{line-height:2em}table.wc_input_table.flexible_shipping_rules span.input-wrapper label{padding-right:3px;padding-left:3px}table.wc_input_table.flexible_shipping_rules td label{padding-right:3px;padding-left:3px;padding-top:5px}table.wc_input_table.flexible_shipping_rules.fs_new_interface td label{padding-right:10px;padding-left:10px;padding-top:5px}table.wc_input_table.flexible_shipping_rules span.input-wrapper span.description,table.wc_input_table.flexible_shipping_rules p.form-row span.description{padding-right:3px;padding-left:3px;vertical-align:middle;font-style:normal;font-size:14px}table.wc_input_table.flexible_shipping_rules p.form-row span.description{padding-top:4px;position:absolute}table.wc_input_table.flexible_shipping_rules td{vertical-align:top}table.wc_input_table.flexible_shipping_rules td{padding-top:2px;padding-bottom:2px}table.wc_input_table.flexible_shipping_rules th.sort,table.wc_input_table.flexible_shipping_rules th.sort{width:20px;text-align:center}table.wc_input_table.flexible_shipping_rules th.cb,table.wc_input_table.flexible_shipping_rules td.cb{width:20px;text-align:center;padding:10px 5px;padding-right:5px !important;margin:0}table.wc_input_table.flexible_shipping_rules th.cb input,table.wc_input_table.flexible_shipping_rules td.cb input{margin:0}table.wc_input_table.flexible_shipping_rules th.rule_costs{width:220px}table.wc_input_table.flexible_shipping_rules input[type=text]{width:100px !important;height:2em !important;border:1px solid}table.wc_input_table.flexible_shipping_rules select{width:120px !important;height:2em !important;border:1px solid;padding:0 5px}table.wc_input_table.flexible_shipping_rules.fs_new_interface select{width:130px !important}table.wc_input_table.flexible_shipping_rules input.cost_additional{width:60px !important;min-width:60px}table.wc_input_table.flexible_shipping_rules input.per_value{width:60px !important;min-width:60px}table.wc_input_table.flexible_shipping_rules td.rule_costs div.input-wrapper.cost_per_order{display:block}table.wc_input_table.flexible_shipping_rules td.rule_costs a.button.plus.insert{display:inline-block;float:right;clear:both}table.wc_input_table.flexible_shipping_rules td.rule_costs div.additional_cost_wrapper{border-top:1px solid #dfdfdf;margin-top:2px;padding-top:2px;display:block}table.wc_input_table.flexible_shipping_rules td.rule_costs a.button.minus{display:inline-block;float:right;clear:both}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:nth-child(n+2){border-top:1px solid #dfdfdf;padding-top:2px;margin-top:2px}table.wc_input_table.flexible_shipping_rules div.single_rule_condition div.condition_field_wrapper{display:inline-block}table.wc_input_table.flexible_shipping_rules div.single_rule_condition div.condition_parameters_wrapper{display:inline-block}table.wc_input_table.flexible_shipping_rules div.single_rule_condition div.condition_parameters_wrapper input.parameter_min{width:60px !important;min-width:60px}table.wc_input_table.flexible_shipping_rules div.single_rule_condition div.condition_parameters_wrapper input.parameter_max{width:60px !important;min-width:60px}table.wc_input_table.flexible_shipping_rules div.single_rule_condition label.condition_field_label{width:55px;text-align:right}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:first-child label.condition_field_label_where{display:inline-block}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:nth-child(n+2) label.condition_field_label_where{display:none}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:first-child label.condition_field_label_and{display:none}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:nth-child(n+2) label.condition_field_label_and{display:inline-block}table.wc_input_table.flexible_shipping_rules div.single_rule_condition a.minus{float:right}table.wc_input_table.flexible_shipping_rules div.single_rule_condition a.plus{float:right}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:first-child a.minus{display:none}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:nth-child(n+2) a.plus{display:none}table.wc_input_table.flexible_shipping_rules input.select2-search__field{border:0}table.wc_input_table.flexible_shipping_rules td p label span.optional{display:none}table.wc_input_table.flexible_shipping_rules td.rule_conditions{min-width:465px}table.wc_input_table.flexible_shipping_rules td.rule_conditions div.single_rule_condition p.form-row{display:inline-block}table#fs_new_rules_table_banner.widefat thead td,table#fs_new_rules_table_banner_for_new_table.widefat thead td{padding:5px 20px 20px}
|
1 |
+
table.flexible_shipping_methods th.select,table.flexible_shipping_methods td.select{text-align:center;width:40px;margin-top:-7px;margin-left:-6px;padding:2px}table.flexible_shipping_methods .checkbox-select-all{margin:0 12px 0 8px}table.flexible_shipping_methods th.integration,table.flexible_shipping_methods td.integration{text-align:center;width:130px}table.flexible_shipping_methods tr.highlight td{background-color:#e4f2fd}table.flexible_shipping_methods.wc_shipping th{font-weight:400;width:auto}table.flexible_shipping_methods td.ui-sortable-handle:before,table.flexible_shipping_services td.ui-sortable-handle:before{content:'\f333';font-family:Dashicons;text-align:center;line-height:1;color:#999;display:block;width:17px;float:left;height:100%;line-height:24px}table.wc_input_table.flexible_shipping_rules.fs_new_interface td{padding:25px 5px;vertical-align:middle;border:0}table.wc_input_table.flexible_shipping_rules.fs_new_interface tr:nth-child(even) td{background:#f9f9f9}table.wc_input_table.flexible_shipping_rules.fs_new_interface tr:nth-child(odd) td.sort{background:white}table.wc_input_table.flexible_shipping_rules.fs_new_interface td p.form-row{margin-top:0}table.wc_input_table.flexible_shipping_rules.fs_new_interface .description{padding-top:5px}table.wc_input_table.flexible_shipping_rules.fs_new_interface .form-row{padding-right:5px}table.wc_input_table.flexible_shipping_rules.fs_new_interface .single_rule_condition{vertical-align:middle;display:flex}table.wc_input_table.flexible_shipping_rules.fs_new_interface tbody .sort{padding-top:27px !important;padding-bottom:23px !important}.flexible_shipping_method_rules th{width:auto}.flexible_shipping_method_rules th.sort{width:10px}td.fs_cost{width:75px !important}div.rule_condition div{display:inline-block}div.rule_condition div.based_on{width:70px}div.rule_condition div input{width:70px}table.flexible_shipping_method_rules th,table.flexible_shipping_method_rules th{padding:5px 10px 5px 0}table.flexible_shipping_method_rules td p,table.flexible_shipping_method_rules td p input,table.flexible_shipping_method_rules td p select{margin:0;width:100%;box-shadow:none;padding:0 !important}table.flexible_shipping_method_rules td p input[type=text]{text-align:right;padding:0 5px 0 5px !important;width:100% !important}table.flexible_shipping_method_rules td p select{margin:0;width:100% !important;box-shadow:none;line-height:28px;height:37px;vertical-align:middle}table.flexible_shipping_method_rules td p input[type=checkbox]{margin:0;width:auto}table.flexible_shipping_method_rules th,table.flexible_shipping_method_rules td{text-align:center}table.flexible_shipping_method_rules th.shipping_class,table.flexible_shipping_method_rules td.shipping_class{text-align:center;width:200px}table.flexible_shipping_method_rules td.shipping_class span{border:0}table.flexible_shipping_method_rules th.stop,table.flexible_shipping_method_rules td.stop{text-align:center;width:30px}table.flexible_shipping_method_rules th.cancel,table.flexible_shipping_method_rules td.cancel{text-align:center;width:60px}.woocommerce table.form-table .flexible_shipping_method_rules th span.woocommerce-help-tip{float:none;margin:0}.woocommerce table.form-table .flexible_shipping_method_rules .select2-container{margin:0}.woocommerce table.form-table .fs-locations-table .select2-container{max-width:none}.woocommerce table.form-table .fs-locations-table th .woocommerce-help-tip{float:none}div.flexilble_shipping_export_import{float:right}table.flexible_shipping_method_rules tfoot th{padding:10px}.woocommerce_page_wc-settings #mainform{position:relative}.column-flexible_shipping{width:130px}.column-flexible_shipping .shipping-status{float:left;margin-right:8px;margin-top:4px;text-align:left;width:18px}.column-flexible_shipping .shipping-status .created:after{color:#d0c21f !important}.column-flexible_shipping .shipping-actions a.button{float:left;margin:0 4px 2px 0;display:block;height:2em !important;padding:0 !important;position:relative;text-indent:-9999px;width:2em}.column-flexible_shipping .shipping-actions a.button:after{font-family:WooCommerce;font-variant:normal;font-weight:400;height:100%;left:0;line-height:1.85;margin:0;position:absolute;text-align:center;text-indent:0;text-transform:none;top:0;width:100%}.column-flexible_shipping .shipping-actions a.button.get-label:after{content:"\e01e"}.column-flexible_shipping .shipping-actions a.button.track:after{content:"\e01b"}.column-flexible_shipping mark.failed:after{color:#a00 !important}.column-flexible_shipping mark.manifest:after{color:#2ea2cc !important}.flexible_shipping_shipment_message{color:green}.flexible_shipping_shipment_message_error{color:#a00 !important}.flexible_shipping_shipment_message_error span{color:#444;font-weight:bold}.woocommerce .wp-admin select{height:100%}.button.flexible-printing-button-print{height:auto !important;white-space:normal !important;word-wrap:break-word !important}.inspire-settings{display:table;width:100%}.inspire-settings .inspire-main-content,.inspire-settings .inspire-sidebar{display:table-cell;height:500px;margin:0;padding:0;vertical-align:top}.inspire-settings .inspire-main-content{min-width:800px}.inspire-settings .inspire-sidebar{padding-left:30px;width:250px}.flexible-shipping-info ol{margin-top:0}#wpbody-content .flexible-shipping-info .metabox-holder{padding-top:0}#adminmenu #toplevel_page_flexible-shipping .menu-icon-generic div.wp-menu-image::before{font-family:WooCommerce !important;content:'\e01d'}.fs-new-service{color:#006799}.fs-order-item-fallback{margin-top:.5em;color:#888}.flexible_shipping_shipment_content p select{max-width:95%}.flexible_shipping_shipment_content span.description{display:block}.fs-saas-button-cancel-created{float:right;color:#a00;margin-top:5px}.fs-saas-button-cancel-created:hover{color:#a00;cursor:pointer}.flexible_shipping_shipment_content input[type=checkbox]{float:left;margin-right:5px;margin-top:2px !important;opacity:1;border-color:#888}.flexible_shipping_shipment_content input[type=checkbox]:disabled{opacity:.7;border-color:rgba(51,51,51,0.5)}.flexible_shipping_shipment_content p.fs-saas-status span{font-weight:bold;color:#444}.flexible_shipping_shipment_content p.fs-saas-status-fs-new{color:#ffba00}.flexible_shipping_shipment_content p.fs-saas-status-fs-created{color:#d0c21f}.flexible_shipping_shipment_content p.fs-saas-status-fs-confirmed{color:#444}.flexible_shipping_shipment_content p.fs-saas-status-fs-failed{color:#a00}.flexible_shipping_shipment_content p.fs-saas-status-fs-manifest{color:#2ea2cc}.flexible_shipping_shipment_content p.connection-error{font-weight:bold;color:#a00}.fs-saas-shipment span{font-weight:bold}.fs-saas-labels-counts span{font-weight:bold}.fs-saas-no-labels-left{color:#a00}div.flexible-shipping-shipment-attachments p{display:inline}.flexible_shipping_shipment_attachment_message{padding-top:10px;color:green}table.flexible_shipping_services{max-width:550px}table.flexible_shipping_services .sort{width:1%}table.flexible_shipping_services .service_code{width:30px}table.flexible_shipping_services .select{text-align:center;width:1%}table.flexible_shipping_services .select input{margin:0 8px 0 8px}.woocommerce table.form-table table.flexible_shipping_services td.service_name input{width:100%}input.woocommerce_flexible_shipping_service_name{width:100%}.updated .fs-banner__button-container{padding:.75rem 0 0}.notice-info.fs-connect__container{border-left:0;padding:0;box-shadow:0 0 0 1px #dfdfdf,0 1px 2px #dfdfdf}@media screen and (max-width:782px){.notice-info.fs-connect__container{padding:0 !important}}.fs-connect__container{display:block;position:relative;box-sizing:border-box}.fs-connect__inner-container>a:first-child{z-index:1}.fs-connect__inner-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:left;justify-content:left}.fs-connect__content-container{width:1250px;position:relative;padding:2rem;z-index:0}@media(min-width:782px){.fs-connect__content-container{padding:2rem 2rem 4rem 2rem}}.fs-connect__content-container p{color:#555;font-size:.875rem}.fs-connect__content-container h2{margin-top:0;color:#555;line-height:1.6}.fs-connect__content-icon{float:right;margin:0 1.5rem 0 2.25rem}.fs-connect__content-icon svg{fill:#0085ba;height:180px;width:auto}@media(max-width:782px){.fs-connect__content-icon.fs-connect-illo{float:none;width:100%;text-align:center;margin:2.25rem 0 1.5rem}}.fs-connect__slide{display:none}.fs-connect__slide.fs__slide-is-active{display:block}@media(min-width:782px){.fs-connect__content-container .fs-banner__button-container{position:absolute;bottom:.5rem}}.fs-banner__button-container .button-primary{margin:0 .3125rem .3125rem 0}.fs-connect__vertical-nav{background-color:#f1f1f1}@media(min-width:600px){.fs-connect__vertical-nav{-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:start;justify-content:flex-start}}@media(max-width:600px){.fs-connect__vertical-nav{display:none}}.fs-connect__vertical-nav-container{width:15rem}.vertical-menu__feature-item-label{display:none}@media(min-width:600px){.vertical-menu__feature-item{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;border:0;padding:.5rem;border-bottom:1px solid #dfdfdf;border-right:1px solid #dfdfdf;border-left:3px solid #f9f9f9;background-color:#f9f9f9;color:#555;cursor:pointer}.vertical-menu__feature-item:last-of-type{position:relative;top:1px}.vertical-menu__feature-item-is-selected{border-left:3px solid #0085ba;border-right:1px solid #fff;background-color:#fff;color:#2e4453}.vertical-menu__feature-item-is-selected.fs-feature-intro{border-left:3px solid #00be28}.vertical-menu__feature-item-icon{width:1.25rem;height:1.25rem;padding:.25rem;text-align:center}.vertical-menu__feature-item svg{fill:#555;vertical-align:middle}.vertical-menu__feature-item-is-selected svg{fill:#0085ba}.vertical-menu__feature-item-label{display:block;padding:.5rem}}.fs-couriers{margin-top:2.5em}.fs-courier{position:relative;margin-bottom:2.5em;text-align:center}.fs-courier img{height:50px;width:auto}.fs-courier-label{background-color:#333;border-radius:3px;color:#fff;padding:0 4px 1px;position:absolute;right:0;top:-10px}@media(min-width:1200px){.fs-couriers{align-items:center;display:flex;flex-wrap:wrap;justify-content:flex-start}.fs-courier{width:20%}}.admin_page_flexible_shipping_connect_register .notice.is-dismissible,.admin_page_flexible_shipping_connect_register .update-nag,.admin_page_flexible_shipping_connect_register .updated,.admin_page_flexible_shipping_connect_register .settings-error{display:none !important}.fs-page-wrap{margin:0 auto;max-width:45rem}.fs-page-wrap h1{font-weight:normal;margin-bottom:.67em;text-align:center}.fs-box{display:block;position:relative;margin:0 auto 20px;padding:16px;box-sizing:border-box;background:white;box-shadow:0 0 0 1px #dfdfdf,0 1px 2px #dfdfdf}.fs-box:after{content:".";display:block;height:0;clear:both;visibility:hidden}.admin_page_flexible_shipping_connect_register .fs-box,.fs-box.text-center{text-align:center}.admin_page_flexible_shipping_connect_register .fs-box p{margin:1.5em 0}.fs-box input[type="email"]{padding:8px 10px}.fs-actions{padding-left:40px}.fs-actions button:active{vertical-align:inherit !important}.fs-actions .spinner{float:none;margin-top:0}.fs-cols{display:flex;flex-wrap:wrap;justify-content:space-between}.fs-inner-box{box-sizing:border-box;margin-top:30px;padding:0 20px}.fs-inner-box h4{font-size:1.2em;margin-bottom:.37em}.fs-inner-box svg{fill:#0085ba;height:70px;width:auto}@media(min-width:600px){.fs-inner-box{width:33.33%}}.fs-connect-box-header{margin-top:3em}.hide-fs-connect-integration-box{display:none}.fs-settings-div table.form-table{width:700px;float:left}.fs-flexible-shipping-sidebar{float:right;padding-left:30px;width:300px;margin-top:-100px}@media(max-width:1200px){.fs-flexible-shipping-sidebar{display:none}}.wpdesk-metabox{background-color:#23282d;color:#fff;padding:20px}.wpdesk-metabox .title{color:#fff}.wpdesk-metabox .icon{display:block;margin:0 auto;width:110px}table.wc_input_table.flexible_shipping_rules{width:auto;min-width:764px}table.wc_input_table.flexible_shipping_rules td{padding:3px 5px}table.wc_input_table.flexible_shipping_rules span.input-wrapper{line-height:2em}table.wc_input_table.flexible_shipping_rules span.input-wrapper input{line-height:2em}table.wc_input_table.flexible_shipping_rules span.input-wrapper select,table.wc_input_table.flexible_shipping_rules p span.woocommerce-input-wrapper select{line-height:2em}table.wc_input_table.flexible_shipping_rules span.input-wrapper label{padding-right:3px;padding-left:3px}table.wc_input_table.flexible_shipping_rules td label{padding-right:3px;padding-left:3px;padding-top:5px}table.wc_input_table.flexible_shipping_rules.fs_new_interface td label{padding-right:10px;padding-left:10px;padding-top:5px}table.wc_input_table.flexible_shipping_rules span.input-wrapper span.description,table.wc_input_table.flexible_shipping_rules p.form-row span.description{padding-right:3px;padding-left:3px;vertical-align:middle;font-style:normal;font-size:14px}table.wc_input_table.flexible_shipping_rules p.form-row span.description{padding-top:4px;position:absolute}table.wc_input_table.flexible_shipping_rules td{vertical-align:top}table.wc_input_table.flexible_shipping_rules td{padding-top:2px;padding-bottom:2px}table.wc_input_table.flexible_shipping_rules th.sort,table.wc_input_table.flexible_shipping_rules th.sort{width:20px;text-align:center}table.wc_input_table.flexible_shipping_rules th.cb,table.wc_input_table.flexible_shipping_rules td.cb{width:20px;text-align:center;padding:10px 5px;padding-right:5px !important;margin:0}table.wc_input_table.flexible_shipping_rules th.cb input,table.wc_input_table.flexible_shipping_rules td.cb input{margin:0}table.wc_input_table.flexible_shipping_rules th.rule_costs{width:220px}table.wc_input_table.flexible_shipping_rules input[type=text]{width:100px !important;height:2em !important;border:1px solid}table.wc_input_table.flexible_shipping_rules select{width:120px !important;height:2em !important;border:1px solid;padding:0 5px}table.wc_input_table.flexible_shipping_rules.fs_new_interface select{width:130px !important}table.wc_input_table.flexible_shipping_rules input.cost_additional{width:60px !important;min-width:60px}table.wc_input_table.flexible_shipping_rules input.per_value{width:60px !important;min-width:60px}table.wc_input_table.flexible_shipping_rules td.rule_costs div.input-wrapper.cost_per_order{display:block}table.wc_input_table.flexible_shipping_rules td.rule_costs a.button.plus.insert{display:inline-block;float:right;clear:both}table.wc_input_table.flexible_shipping_rules td.rule_costs div.additional_cost_wrapper{border-top:1px solid #dfdfdf;margin-top:2px;padding-top:2px;display:block}table.wc_input_table.flexible_shipping_rules td.rule_costs a.button.minus{display:inline-block;float:right;clear:both}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:nth-child(n+2){border-top:1px solid #dfdfdf;padding-top:2px;margin-top:2px}table.wc_input_table.flexible_shipping_rules div.single_rule_condition div.condition_field_wrapper{display:inline-block}table.wc_input_table.flexible_shipping_rules div.single_rule_condition div.condition_parameters_wrapper{display:inline-block}table.wc_input_table.flexible_shipping_rules div.single_rule_condition div.condition_parameters_wrapper input.parameter_min{width:60px !important;min-width:60px}table.wc_input_table.flexible_shipping_rules div.single_rule_condition div.condition_parameters_wrapper input.parameter_max{width:60px !important;min-width:60px}table.wc_input_table.flexible_shipping_rules div.single_rule_condition label.condition_field_label{width:55px;text-align:right}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:first-child label.condition_field_label_where{display:inline-block}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:nth-child(n+2) label.condition_field_label_where{display:none}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:first-child label.condition_field_label_and{display:none}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:nth-child(n+2) label.condition_field_label_and{display:inline-block}table.wc_input_table.flexible_shipping_rules div.single_rule_condition a.minus{float:right}table.wc_input_table.flexible_shipping_rules div.single_rule_condition a.plus{float:right}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:first-child a.minus{display:none}table.wc_input_table.flexible_shipping_rules div.single_rule_condition:nth-child(n+2) a.plus{display:none}table.wc_input_table.flexible_shipping_rules input.select2-search__field{border:0}table.wc_input_table.flexible_shipping_method_rules td p label span.optional{display:none}table.wc_input_table.flexible_shipping_rules td.rule_conditions{min-width:465px}table.wc_input_table.flexible_shipping_rules td.rule_conditions div.single_rule_condition p.form-row{display:inline-block}table#fs_new_rules_table_banner.widefat thead td,table#fs_new_rules_table_banner_for_new_table.widefat thead td{padding:5px 20px 20px}
|
assets/js/ap_conditional_logic.js
DELETED
@@ -1,61 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Conditional Logic for Access Point
|
3 |
-
*
|
4 |
-
* @param field_name
|
5 |
-
* @param shipment_id
|
6 |
-
* @param conditions
|
7 |
-
* @constructor
|
8 |
-
*/
|
9 |
-
function ApConditionalLogic(field_name, shipment_id, conditions) {
|
10 |
-
this.field_name = field_name;
|
11 |
-
this.shipment_id = shipment_id;
|
12 |
-
this.conditions = conditions;
|
13 |
-
|
14 |
-
this.field_id = '#' + this.field_name + '_' + this.shipment_id;
|
15 |
-
|
16 |
-
this.field_id = this.createFieldId( this.field_name, this.shipment_id );
|
17 |
-
|
18 |
-
let conditional_logic = this;
|
19 |
-
this.conditions.forEach(function(value){
|
20 |
-
jQuery( conditional_logic.createFieldId( value.field, shipment_id ) ).on('change', function(event) {
|
21 |
-
conditional_logic.doLogic(event)
|
22 |
-
});
|
23 |
-
});
|
24 |
-
jQuery(document).ready(function(event) { conditional_logic.doLogic(event) });
|
25 |
-
}
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Create field id from field name and shipment id;
|
29 |
-
*
|
30 |
-
* @param field_name
|
31 |
-
* @param shipment_id
|
32 |
-
* @return {string}
|
33 |
-
*/
|
34 |
-
ApConditionalLogic.prototype.createFieldId = function( field_name, shipment_id ) {
|
35 |
-
return '#' + field_name + '_' + shipment_id;
|
36 |
-
};
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Do logic.
|
40 |
-
*
|
41 |
-
* @param event
|
42 |
-
*/
|
43 |
-
ApConditionalLogic.prototype.doLogic = function(event) {
|
44 |
-
let show_field = true;
|
45 |
-
let field_id = this.field_id;
|
46 |
-
let shipment_id = this.shipment_id;
|
47 |
-
let ap_conditional_logic = this;
|
48 |
-
this.conditions.forEach(function(condition) {
|
49 |
-
let cond_value = false;
|
50 |
-
if ( condition.cond === 'in' && condition.values.indexOf( jQuery( ap_conditional_logic.createFieldId( condition.field, shipment_id ) ).val() ) !== -1 ) {
|
51 |
-
cond_value = true;
|
52 |
-
}
|
53 |
-
show_field = show_field && cond_value;
|
54 |
-
});
|
55 |
-
var field_div = jQuery(field_id).closest('div');
|
56 |
-
if ( show_field ) {
|
57 |
-
field_div.show();
|
58 |
-
} else {
|
59 |
-
field_div.hide();
|
60 |
-
}
|
61 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/collection-points-map.js
DELETED
@@ -1,58 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function () {
|
2 |
-
var window_map;
|
3 |
-
|
4 |
-
jQuery(document).on('click', '.flexible-shipping-collection-point-map-selector', function () {
|
5 |
-
var service_id = jQuery(this).attr('data-service-id');
|
6 |
-
var select_id = jQuery(this).attr('data-select-id');
|
7 |
-
var params = {
|
8 |
-
service_id: service_id,
|
9 |
-
select_id: select_id,
|
10 |
-
};
|
11 |
-
|
12 |
-
var y = window.top.outerHeight / 2 + window.top.screenY - (600 / 2);
|
13 |
-
var x = window.top.outerWidth / 2 + window.top.screenX - (800 / 2);
|
14 |
-
|
15 |
-
window_map = window.open(fs_collection_points_map.collection_points_map_url + '&' + jQuery.param(params), "", "width=800,height=600,top=" + y + ",left=" + x);
|
16 |
-
window.addEventListener('message', function (event) {
|
17 |
-
if (event.origin !== window.location.origin) {
|
18 |
-
return false;
|
19 |
-
}
|
20 |
-
|
21 |
-
if ('get_adresses_data' === event.data.action) {
|
22 |
-
send_adresses_data_to_map(window_map, service_id, select_id);
|
23 |
-
}
|
24 |
-
|
25 |
-
if (event.data.point_id && 'select_point' === event.data.action) {
|
26 |
-
update_point_from_map(event.data.point_id, select_id);
|
27 |
-
}
|
28 |
-
}, true);
|
29 |
-
return false;
|
30 |
-
});
|
31 |
-
|
32 |
-
function update_point_from_map(point_id, select_id) {
|
33 |
-
var point_select = jQuery('#' + select_id);
|
34 |
-
point_select.val(point_id);
|
35 |
-
point_select.trigger('change.select2');
|
36 |
-
jQuery(document.body).trigger('update_checkout');
|
37 |
-
}
|
38 |
-
|
39 |
-
function send_adresses_data_to_map(window_map, service_id, select_field_id) {
|
40 |
-
var data = {
|
41 |
-
different_addres: jQuery('#ship-to-different-address-checkbox').prop('checked'),
|
42 |
-
shipping_country: jQuery('#shipping_country').val(),
|
43 |
-
shipping_address_1: jQuery('#shipping_address_1').val(),
|
44 |
-
shipping_address_2: jQuery('#shipping_address_2').val(),
|
45 |
-
shipping_postcode: jQuery('#shipping_postcode').val(),
|
46 |
-
shipping_city: jQuery('#shipping_city').val(),
|
47 |
-
billing_country: jQuery('#billing_country').val(),
|
48 |
-
billing_address_1: jQuery('#billing_address_1').val(),
|
49 |
-
billing_address_2: jQuery('#billing_address_2').val(),
|
50 |
-
billing_postcode: jQuery('#billing_postcode').val(),
|
51 |
-
billing_city: jQuery('#billing_city').val(),
|
52 |
-
selected_point: jQuery('#' + select_field_id).val(),
|
53 |
-
action: 'fs_collection_points_' + service_id,
|
54 |
-
security: fs_collection_points_map.ajax_nonce
|
55 |
-
};
|
56 |
-
window_map.postMessage({addresses_data: data, action: 'send_address_data'}, window.location.origin);
|
57 |
-
}
|
58 |
-
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/collection-points-map.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function(){var b;jQuery(document).on("click",".flexible-shipping-collection-point-map-selector",function(){var e=jQuery(this).attr("data-service-id");var h=jQuery(this).attr("data-select-id");var f={service_id:e,select_id:h};var g=window.top.outerHeight/2+window.top.screenY-(600/2);var d=window.top.outerWidth/2+window.top.screenX-(800/2);b=window.open(fs_collection_points_map.collection_points_map_url+"&"+jQuery.param(f),"","width=800,height=600,top="+g+",left="+d);window.addEventListener("message",function(i){if(i.origin!==window.location.origin){return false}if("get_adresses_data"===i.data.action){c(b,e,h)}if(i.data.point_id&&"select_point"===i.data.action){a(i.data.point_id,h)}},true);return false});function a(d,f){var e=jQuery("#"+f);e.val(d);e.trigger("change.select2");jQuery(document.body).trigger("update_checkout")}function c(d,f,e){var g={different_addres:jQuery("#ship-to-different-address-checkbox").prop("checked"),shipping_country:jQuery("#shipping_country").val(),shipping_address_1:jQuery("#shipping_address_1").val(),shipping_address_2:jQuery("#shipping_address_2").val(),shipping_postcode:jQuery("#shipping_postcode").val(),shipping_city:jQuery("#shipping_city").val(),billing_country:jQuery("#billing_country").val(),billing_address_1:jQuery("#billing_address_1").val(),billing_address_2:jQuery("#billing_address_2").val(),billing_postcode:jQuery("#billing_postcode").val(),billing_city:jQuery("#billing_city").val(),selected_point:jQuery("#"+e).val(),action:"fs_collection_points_"+f,security:fs_collection_points_map.ajax_nonce};d.postMessage({addresses_data:g,action:"send_address_data"},window.location.origin)}});
|
|
classes/Flexible_Shipping_Contextual_Info.php
CHANGED
@@ -77,12 +77,15 @@ class Flexible_Shipping_Contextual_Info implements \FSVendor\WPDesk\PluginBuilde
|
|
77 |
* Add contextual info script.
|
78 |
*/
|
79 |
public function add_contextual_info_script() {
|
80 |
-
$
|
81 |
-
$
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
|
|
|
|
|
|
86 |
}
|
87 |
|
88 |
}
|
77 |
* Add contextual info script.
|
78 |
*/
|
79 |
public function add_contextual_info_script() {
|
80 |
+
$current_screen = get_current_screen();
|
81 |
+
if ( 'shop_order' === $current_screen->post_type || 'woocommerce_page_wc-settings' === $current_screen->id ) {
|
82 |
+
$html_elements_ids = '#' . implode( ',#', explode( ',', $this->html_elements_ids ) );
|
83 |
+
$info_id = $this->info_id;
|
84 |
+
$phrases_in = $this->phrases_in;
|
85 |
+
$info_html = $this->info_html;
|
86 |
+
$phrases_not_in = $this->phrases_not_in;
|
87 |
+
include __DIR__ . '/views/contextual-info-script.php';
|
88 |
+
}
|
89 |
}
|
90 |
|
91 |
}
|
classes/class-flexible-shipping-plugin.php
CHANGED
@@ -5,7 +5,6 @@
|
|
5 |
* @package Flexible Shippign
|
6 |
*/
|
7 |
|
8 |
-
use FSVendor\WPDesk\ABTesting\ABVariant;
|
9 |
use FSVendor\WPDesk\Logger\WPDeskLoggerFactory;
|
10 |
use FSVendor\WPDesk\Mutex\WordpressPostMutex;
|
11 |
use FSVendor\WPDesk\Notice\AjaxHandler;
|
@@ -56,7 +55,7 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
|
|
56 |
*
|
57 |
* @var string
|
58 |
*/
|
59 |
-
private $scripts_version = FLEXIBLE_SHIPPING_VERSION . '.
|
60 |
|
61 |
/**
|
62 |
* Admin notices.
|
@@ -93,13 +92,6 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
|
|
93 |
*/
|
94 |
private $logger;
|
95 |
|
96 |
-
/**
|
97 |
-
* Selected variant for AB message testing.
|
98 |
-
*
|
99 |
-
* @var ABVariant
|
100 |
-
*/
|
101 |
-
private $variant;
|
102 |
-
|
103 |
/**
|
104 |
* Flexible_Invoices_Reports_Plugin constructor.
|
105 |
*
|
@@ -115,10 +107,19 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
|
|
115 |
/**
|
116 |
* Init logger on WPDesk_Flexible_Shipping_Shipment class.
|
117 |
*/
|
118 |
-
|
119 |
WPDesk_Flexible_Shipping_Shipment::set_fs_logger( $this->logger );
|
120 |
}
|
121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
/**
|
123 |
* Initialize $this->logger
|
124 |
*
|
@@ -159,18 +160,12 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
|
|
159 |
|
160 |
$this->admin_notices = new WPDesk_Flexible_Shipping_Admin_Notices( $this );
|
161 |
|
162 |
-
$abtesting = new WPDesk_Flexible_Shipping_AB_Deactivation_Contact_Information();
|
163 |
-
$this->variant = $abtesting->get_variant();
|
164 |
-
|
165 |
$this->add_hookable( new WPDesk_Flexible_Shipping_Single_Label_File_Dispatcher() );
|
166 |
|
167 |
$this->add_hookable( new WPDesk_Flexible_Shipping_Tracker() );
|
168 |
|
169 |
-
$this->add_hookable( new WPDesk\FS\Rate\Flexible_Shipping_Order_Counter() );
|
170 |
$this->add_hookable( new WPDesk\FS\Rate\WPDesk_Flexible_Shipping_Rate_Notice() );
|
171 |
|
172 |
-
$this->add_hookable( new WPDesk_Flexible_Shipping_AB_Tracker_Deactivation_Data( $this->variant ) );
|
173 |
-
|
174 |
$this->add_hookable( new WPDesk_Flexible_Shipping_Add_Shipping() );
|
175 |
|
176 |
$this->add_hookable( new WPDesk_Flexible_Shipping_Shorcode_Unit_Weight() );
|
@@ -203,18 +198,27 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
|
|
203 |
|
204 |
$this->add_hookable( new UserFeedback() );
|
205 |
|
206 |
-
$this->
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
|
208 |
}
|
209 |
|
210 |
/**
|
211 |
* Init contextual info on Flexible Shipping settings fields.
|
|
|
|
|
212 |
*/
|
213 |
-
|
214 |
$base_location = wc_get_base_location();
|
215 |
-
$
|
216 |
-
$
|
217 |
$contextual_info_creator->create_contextual_info();
|
|
|
218 |
}
|
219 |
|
220 |
/**
|
@@ -314,6 +318,10 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
|
|
314 |
|
315 |
add_action( 'woocommerce_init', array( $this, 'init_free_shipping_notice' ) );
|
316 |
|
|
|
|
|
|
|
|
|
317 |
$this->hooks_on_hookable_objects();
|
318 |
|
319 |
}
|
@@ -336,20 +344,11 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
|
|
336 |
* Init deactivation tracker.
|
337 |
*/
|
338 |
public function init_deactivation_tracker() {
|
339 |
-
$
|
340 |
WPDesk_Flexible_Shipping_Tracker::FLEXIBLE_SHIPPING_PLUGIN_SLUG,
|
341 |
WPDesk_Flexible_Shipping_Tracker::FLEXIBLE_SHIPPING_PLUGIN_FILE,
|
342 |
WPDesk_Flexible_Shipping_Tracker::FLEXIBLE_SHIPPING_PLUGIN_TITLE
|
343 |
);
|
344 |
-
$thickbox_factory = new WPDesk_Flexible_Shipping_Deactivation_Thickbox_Factory(
|
345 |
-
$this->variant,
|
346 |
-
$plugin_data
|
347 |
-
);
|
348 |
-
$deactivation_tracker = TrackerFactory::createCustomTracker(
|
349 |
-
$plugin_data,
|
350 |
-
null,
|
351 |
-
$thickbox_factory->create_thickbox()
|
352 |
-
);
|
353 |
$deactivation_tracker->hooks();
|
354 |
}
|
355 |
|
@@ -532,59 +531,69 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
|
|
532 |
* Admin enqueue scripts.
|
533 |
*/
|
534 |
public function admin_enqueue_scripts() {
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
542 |
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
wp_enqueue_script( 'fs_admin' );
|
558 |
|
|
|
|
|
|
|
|
|
559 |
$current_screen = get_current_screen();
|
560 |
-
|
561 |
-
|
562 |
-
'wpdesk_contextual_info',
|
563 |
-
trailingslashit( $this->get_plugin_assets_url() ) . 'js/contextual-info' . $suffix . '.js',
|
564 |
-
array( 'jquery' ),
|
565 |
-
$this->scripts_version
|
566 |
-
);
|
567 |
-
wp_enqueue_script( 'wpdesk_contextual_info' );
|
568 |
-
|
569 |
-
if ( ! empty( $current_screen ) && 'shop_order' === $current_screen->id ) {
|
570 |
-
wp_enqueue_media();
|
571 |
}
|
572 |
-
|
573 |
-
wp_register_script( 'fs_ap_conditional_logic', trailingslashit( $this->get_plugin_assets_url() ) . 'js/ap_conditional_logic' . $suffix . '.js', array( 'jquery' ), $this->scripts_version );
|
574 |
-
wp_enqueue_script( 'fs_ap_conditional_logic' );
|
575 |
-
|
576 |
-
wp_enqueue_style(
|
577 |
-
'fs_admin',
|
578 |
-
trailingslashit( $this->get_plugin_assets_url() ) . 'css/admin' . $suffix . '.css',
|
579 |
-
array(),
|
580 |
-
$this->scripts_version
|
581 |
-
);
|
582 |
-
wp_enqueue_style(
|
583 |
-
'fs_font',
|
584 |
-
trailingslashit( $this->get_plugin_assets_url() ) . 'css/font' . $suffix . '.css',
|
585 |
-
array(),
|
586 |
-
$this->scripts_version
|
587 |
-
);
|
588 |
}
|
589 |
|
590 |
/**
|
@@ -617,8 +626,8 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
|
|
617 |
'<a target="_blank" href="' . $docs_link . '">' . __( 'Docs', 'flexible-shipping' ) . '</a>',
|
618 |
'<a target="_blank" href="' . $support_link . '">' . __( 'Support', 'flexible-shipping' ) . '</a>',
|
619 |
);
|
620 |
-
$pro_link = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/sklep/flexible-shipping-pro-woocommerce/' : 'https://flexibleshipping.com/
|
621 |
-
$utm = '?utm_campaign=flexible-shipping&utm_source=user-site&utm_medium=link&utm_term=&utm_content=fs-plugins-upgrade';
|
622 |
|
623 |
if ( ! wpdesk_is_plugin_active( 'flexible-shipping-pro/flexible-shipping-pro.php' ) ) {
|
624 |
$plugin_links[] = '<a href="' . $pro_link . $utm . '" target="_blank" style="color:#d64e07;font-weight:bold;">' . __(
|
5 |
* @package Flexible Shippign
|
6 |
*/
|
7 |
|
|
|
8 |
use FSVendor\WPDesk\Logger\WPDeskLoggerFactory;
|
9 |
use FSVendor\WPDesk\Mutex\WordpressPostMutex;
|
10 |
use FSVendor\WPDesk\Notice\AjaxHandler;
|
55 |
*
|
56 |
* @var string
|
57 |
*/
|
58 |
+
private $scripts_version = FLEXIBLE_SHIPPING_VERSION . '.211';
|
59 |
|
60 |
/**
|
61 |
* Admin notices.
|
92 |
*/
|
93 |
private $logger;
|
94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
/**
|
96 |
* Flexible_Invoices_Reports_Plugin constructor.
|
97 |
*
|
107 |
/**
|
108 |
* Init logger on WPDesk_Flexible_Shipping_Shipment class.
|
109 |
*/
|
110 |
+
private function init_logger_on_shipment() {
|
111 |
WPDesk_Flexible_Shipping_Shipment::set_fs_logger( $this->logger );
|
112 |
}
|
113 |
|
114 |
+
/**
|
115 |
+
* Init logger on WPDesk_Flexible_Shipping class.
|
116 |
+
*
|
117 |
+
* @internal
|
118 |
+
*/
|
119 |
+
public function init_logger_on_shipping_method() {
|
120 |
+
WPDesk_Flexible_Shipping::set_fs_logger( $this->logger );
|
121 |
+
}
|
122 |
+
|
123 |
/**
|
124 |
* Initialize $this->logger
|
125 |
*
|
160 |
|
161 |
$this->admin_notices = new WPDesk_Flexible_Shipping_Admin_Notices( $this );
|
162 |
|
|
|
|
|
|
|
163 |
$this->add_hookable( new WPDesk_Flexible_Shipping_Single_Label_File_Dispatcher() );
|
164 |
|
165 |
$this->add_hookable( new WPDesk_Flexible_Shipping_Tracker() );
|
166 |
|
|
|
167 |
$this->add_hookable( new WPDesk\FS\Rate\WPDesk_Flexible_Shipping_Rate_Notice() );
|
168 |
|
|
|
|
|
169 |
$this->add_hookable( new WPDesk_Flexible_Shipping_Add_Shipping() );
|
170 |
|
171 |
$this->add_hookable( new WPDesk_Flexible_Shipping_Shorcode_Unit_Weight() );
|
198 |
|
199 |
$this->add_hookable( new UserFeedback() );
|
200 |
|
201 |
+
$this->add_hookable( new \FSVendor\WPDesk\FS\TableRate\Logger\Assets( $this->get_plugin_assets_url() . '/../../vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/assets', $this->scripts_version ) );
|
202 |
+
|
203 |
+
$this->add_hookable( new \WPDesk\FS\TableRate\Debug\NoShippingMethodsNotice(
|
204 |
+
current_user_can( 'manage_woocommerce' ) && 'yes' === get_option( 'woocommerce_shipping_debug_mode', 'no' )
|
205 |
+
) );
|
206 |
+
|
207 |
+
$this->add_hookable( new \WPDesk\FS\TableRate\Debug\Tracker() );
|
208 |
|
209 |
}
|
210 |
|
211 |
/**
|
212 |
* Init contextual info on Flexible Shipping settings fields.
|
213 |
+
*
|
214 |
+
* @internal
|
215 |
*/
|
216 |
+
public function init_contextual_info() {
|
217 |
$base_location = wc_get_base_location();
|
218 |
+
$base_country = $base_location['country'];
|
219 |
+
$contextual_info_creator = new ContextualInfo\Creator( $base_country );
|
220 |
$contextual_info_creator->create_contextual_info();
|
221 |
+
$contextual_info_creator->hooks();
|
222 |
}
|
223 |
|
224 |
/**
|
318 |
|
319 |
add_action( 'woocommerce_init', array( $this, 'init_free_shipping_notice' ) );
|
320 |
|
321 |
+
add_action( 'woocommerce_init', array( $this, 'init_logger_on_shipping_method' ) );
|
322 |
+
|
323 |
+
add_action( 'woocommerce_init', array( $this, 'init_contextual_info' ) );
|
324 |
+
|
325 |
$this->hooks_on_hookable_objects();
|
326 |
|
327 |
}
|
344 |
* Init deactivation tracker.
|
345 |
*/
|
346 |
public function init_deactivation_tracker() {
|
347 |
+
$deactivation_tracker = TrackerFactory::createDefaultTracker(
|
348 |
WPDesk_Flexible_Shipping_Tracker::FLEXIBLE_SHIPPING_PLUGIN_SLUG,
|
349 |
WPDesk_Flexible_Shipping_Tracker::FLEXIBLE_SHIPPING_PLUGIN_FILE,
|
350 |
WPDesk_Flexible_Shipping_Tracker::FLEXIBLE_SHIPPING_PLUGIN_TITLE
|
351 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
352 |
$deactivation_tracker->hooks();
|
353 |
}
|
354 |
|
531 |
* Admin enqueue scripts.
|
532 |
*/
|
533 |
public function admin_enqueue_scripts() {
|
534 |
+
if ( $this->should_enqueue_admin_scripts() ) {
|
535 |
+
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
536 |
+
wp_register_script(
|
537 |
+
'fs_admin',
|
538 |
+
trailingslashit( $this->get_plugin_assets_url() ) . 'js/admin' . $suffix . '.js',
|
539 |
+
array( 'jquery' ),
|
540 |
+
$this->scripts_version
|
541 |
+
);
|
542 |
+
|
543 |
+
$notice_url = get_locale() == 'pl_PL' ? 'https://wpde.sk/fs-rate-not-good-pl' : 'https://wpde.sk/fs-rate-not-good';
|
544 |
+
wp_localize_script(
|
545 |
+
'fs_admin',
|
546 |
+
'fs_admin',
|
547 |
+
array(
|
548 |
+
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
549 |
+
'notice_not_good_enought' => sprintf(
|
550 |
+
// Translators: link.
|
551 |
+
__( 'How can We make Flexible Shipping better for you? %1$sJust write to us.%2$s', 'flexible-shipping' ),
|
552 |
+
'<a class="button close-fs-rate-notice" target="_blank" href="' . esc_url( $notice_url ) . '">',
|
553 |
+
'</a>'
|
554 |
+
),
|
555 |
+
)
|
556 |
+
);
|
557 |
+
wp_enqueue_script( 'fs_admin' );
|
558 |
+
|
559 |
+
$current_screen = get_current_screen();
|
560 |
+
|
561 |
+
wp_register_script(
|
562 |
+
'wpdesk_contextual_info',
|
563 |
+
trailingslashit( $this->get_plugin_assets_url() ) . 'js/contextual-info' . $suffix . '.js',
|
564 |
+
array( 'jquery' ),
|
565 |
+
$this->scripts_version
|
566 |
+
);
|
567 |
+
wp_enqueue_script( 'wpdesk_contextual_info' );
|
568 |
+
|
569 |
+
if ( ! empty( $current_screen ) && 'shop_order' === $current_screen->id ) {
|
570 |
+
wp_enqueue_media();
|
571 |
+
}
|
572 |
|
573 |
+
wp_enqueue_style(
|
574 |
+
'fs_admin',
|
575 |
+
trailingslashit( $this->get_plugin_assets_url() ) . 'css/admin' . $suffix . '.css',
|
576 |
+
array(),
|
577 |
+
$this->scripts_version
|
578 |
+
);
|
579 |
+
wp_enqueue_style(
|
580 |
+
'fs_font',
|
581 |
+
trailingslashit( $this->get_plugin_assets_url() ) . 'css/font' . $suffix . '.css',
|
582 |
+
array(),
|
583 |
+
$this->scripts_version
|
584 |
+
);
|
585 |
+
}
|
586 |
+
}
|
|
|
587 |
|
588 |
+
/**
|
589 |
+
* Should enqueue admin scripts?
|
590 |
+
*/
|
591 |
+
private function should_enqueue_admin_scripts() {
|
592 |
$current_screen = get_current_screen();
|
593 |
+
if ( 'shop_order' === $current_screen->post_type || 'woocommerce_page_wc-settings' === $current_screen->id ) {
|
594 |
+
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
595 |
}
|
596 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
597 |
}
|
598 |
|
599 |
/**
|
626 |
'<a target="_blank" href="' . $docs_link . '">' . __( 'Docs', 'flexible-shipping' ) . '</a>',
|
627 |
'<a target="_blank" href="' . $support_link . '">' . __( 'Support', 'flexible-shipping' ) . '</a>',
|
628 |
);
|
629 |
+
$pro_link = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/sklep/flexible-shipping-pro-woocommerce/' : 'https://flexibleshipping.com/products/flexible-shipping-pro-woocommerce/';
|
630 |
+
$utm = get_locale() === 'pl_PL' ? '?utm_campaign=flexible-shipping&utm_source=user-site&utm_medium=link&utm_term=&utm_content=fs-plugins-upgrade' : '?utm_source=fs&utm_medium=quick-link&utm_campaign=upgrade-quick-link';
|
631 |
|
632 |
if ( ! wpdesk_is_plugin_active( 'flexible-shipping-pro/flexible-shipping-pro.php' ) ) {
|
633 |
$plugin_links[] = '<a href="' . $pro_link . $utm . '" target="_blank" style="color:#d64e07;font-weight:bold;">' . __(
|
classes/table-rate/abtests/ab-deactivation-contact-information-test/class-ab-variant-old.php
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
use FSVendor\WPDesk\ABTesting\ABVariant;
|
4 |
-
|
5 |
-
class WPDesk_Flexible_Shipping_AB_Variant_Old implements ABVariant {
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Define a new value for the generated variant.
|
9 |
-
*
|
10 |
-
* @var int
|
11 |
-
*/
|
12 |
-
const VARIANT_ID = 0;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Is On?
|
16 |
-
*
|
17 |
-
* @param string $functionality Functionality.
|
18 |
-
*
|
19 |
-
* @return bool
|
20 |
-
*/
|
21 |
-
public function is_on( $functionality ) {
|
22 |
-
return WPDesk_Flexible_Shipping_AB_Deactivation_Contact_Information::CONTACT_INFORMATION_ON_TOP === ! $functionality;
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Get variant id.
|
27 |
-
*
|
28 |
-
* @return int|string
|
29 |
-
*/
|
30 |
-
public function get_variant_id() {
|
31 |
-
return self::VARIANT_ID;
|
32 |
-
}
|
33 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/table-rate/abtests/ab-deactivation-contact-information-test/class-ab-variant-with-contact-information-button.php
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
use FSVendor\WPDesk\ABTesting\ABVariant;
|
4 |
-
|
5 |
-
class WPDesk_Flexible_Shipping_AB_Variant_With_Contact_Information_Button implements ABVariant {
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Define a new value for the generated variant
|
9 |
-
*
|
10 |
-
* @var int
|
11 |
-
*/
|
12 |
-
const VARIANT_ID = 12;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Is on?
|
16 |
-
*
|
17 |
-
* @param string $functionality Functionality.
|
18 |
-
*
|
19 |
-
* @return bool
|
20 |
-
*/
|
21 |
-
public function is_on( $functionality ) {
|
22 |
-
return WPDesk_Flexible_Shipping_AB_Deactivation_Contact_Information::CONTACT_INFORMATION_BUTTON === $functionality;
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Get variant id.
|
27 |
-
*
|
28 |
-
* @return int|string
|
29 |
-
*/
|
30 |
-
public function get_variant_id() {
|
31 |
-
return self::VARIANT_ID;
|
32 |
-
}
|
33 |
-
|
34 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/table-rate/abtests/ab-deactivation-contact-information-test/class-ab-variant-with-contact-information-on-bottom.php
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
use FSVendor\WPDesk\ABTesting\ABVariant;
|
4 |
-
|
5 |
-
class WPDesk_Flexible_Shipping_AB_Variant_With_Contact_Information_On_Bottom implements ABVariant {
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Define a new value for the generated variant
|
9 |
-
*
|
10 |
-
* @var int
|
11 |
-
*/
|
12 |
-
const VARIANT_ID = 11;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Is on?
|
16 |
-
*
|
17 |
-
* @param string $functionality Functionality.
|
18 |
-
*
|
19 |
-
* @return bool
|
20 |
-
*/
|
21 |
-
public function is_on( $functionality ) {
|
22 |
-
return WPDesk_Flexible_Shipping_AB_Deactivation_Contact_Information::CONTACT_INFORMATION_ON_BOTTOM === $functionality;
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Get variant id.
|
27 |
-
*
|
28 |
-
* @return int|string
|
29 |
-
*/
|
30 |
-
public function get_variant_id() {
|
31 |
-
return self::VARIANT_ID;
|
32 |
-
}
|
33 |
-
|
34 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/table-rate/abtests/ab-deactivation-contact-information-test/class-ab-variant-with-contact-information-on-top.php
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
use FSVendor\WPDesk\ABTesting\ABVariant;
|
4 |
-
|
5 |
-
class WPDesk_Flexible_Shipping_AB_Variant_With_Contact_Information_On_Top implements ABVariant {
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Define a new value for the generated variant
|
9 |
-
*
|
10 |
-
* @var int
|
11 |
-
*/
|
12 |
-
const VARIANT_ID = 10;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Is on?
|
16 |
-
*
|
17 |
-
* @param string $functionality Functionality.
|
18 |
-
*
|
19 |
-
* @return bool
|
20 |
-
*/
|
21 |
-
public function is_on( $functionality ) {
|
22 |
-
return WPDesk_Flexible_Shipping_AB_Deactivation_Contact_Information::CONTACT_INFORMATION_ON_TOP === $functionality;
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Get variant id.
|
27 |
-
*
|
28 |
-
* @return int|string
|
29 |
-
*/
|
30 |
-
public function get_variant_id() {
|
31 |
-
return self::VARIANT_ID;
|
32 |
-
}
|
33 |
-
|
34 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/table-rate/abtests/class-ab-deactivation-contact-information.php
DELETED
@@ -1,111 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
use FSVendor\WPDesk\ABTesting\ABTest\EqualGroupsRandomABTest;
|
4 |
-
use FSVendor\WPDesk\Persistence\PersistentContainer;
|
5 |
-
use FSVendor\WPDesk\Persistence\Wordpress\WordpressOptionsContainer;
|
6 |
-
use FSVendor\WPDesk\ABTesting\ABVariant;
|
7 |
-
|
8 |
-
|
9 |
-
/**
|
10 |
-
* AB Menu Test https://docs.google.com/document/d/1O7SDr-suN1ooLrHdtkM7L6ARbsnveSj_fsRWMpFr5Ac/
|
11 |
-
*
|
12 |
-
* We've created 2 groups/variants.
|
13 |
-
*/
|
14 |
-
class WPDesk_Flexible_Shipping_AB_Deactivation_Contact_Information extends EqualGroupsRandomABTest {
|
15 |
-
const TEST_NAME = 'deactivation-contact-information';
|
16 |
-
const GROUP_COUNT = 3;
|
17 |
-
|
18 |
-
const VARIANT_WITH_CONTACT_INFORMATION_ON_TOP = 1;
|
19 |
-
const VARIANT_WITH_CONTACT_INFORMATION_ON_BOTTOM = 2;
|
20 |
-
const VARIANT_WITH_CONTACT_BUTTON = 3;
|
21 |
-
|
22 |
-
const NEW_USER_AFTER_THIS_DATE = '2019-11-06 01:00:00';
|
23 |
-
|
24 |
-
const VARIANT_ID_FOR_OLD_INSTALLATION = 0;
|
25 |
-
|
26 |
-
const CONTACT_INFORMATION_ON_TOP = 'contact_information_on_top';
|
27 |
-
const CONTACT_INFORMATION_ON_BOTTOM = 'contact_information_on_bottom';
|
28 |
-
const CONTACT_INFORMATION_BUTTON = 'contact_information_button';
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Persistent container
|
32 |
-
*
|
33 |
-
* @var PersistentContainer
|
34 |
-
*/
|
35 |
-
public $container;
|
36 |
-
|
37 |
-
/**
|
38 |
-
* WPDesk_Flexible_Shipping_AB_Deactivation_Contact_Information constructor.
|
39 |
-
*/
|
40 |
-
public function __construct() {
|
41 |
-
$container = new WordpressOptionsContainer();
|
42 |
-
$this->container = $container;
|
43 |
-
|
44 |
-
parent::__construct( self::GROUP_COUNT, self::TEST_NAME, $container );
|
45 |
-
|
46 |
-
$this->override_id_for_old_user( $container );
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Clears info about variant and draws again
|
51 |
-
*/
|
52 |
-
public function reset() {
|
53 |
-
parent::reset();
|
54 |
-
$this->override_id_for_old_user( $this->container );
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* If old user then should have static group
|
59 |
-
*
|
60 |
-
* @param PersistentContainer $container Persistent container.
|
61 |
-
*/
|
62 |
-
private function override_id_for_old_user( PersistentContainer $container ) {
|
63 |
-
if ( self::VARIANT_ID_FOR_OLD_INSTALLATION !== $this->current_variant_id && $this->is_old_installation() ) {
|
64 |
-
$this->current_variant_id = self::VARIANT_ID_FOR_OLD_INSTALLATION;
|
65 |
-
$container->set( $this->get_container_key(), self::VARIANT_ID_FOR_OLD_INSTALLATION );
|
66 |
-
}
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* If this a old user? If so then FS should work like always.
|
71 |
-
*
|
72 |
-
* @return bool
|
73 |
-
*/
|
74 |
-
private function is_old_installation() {
|
75 |
-
return strtotime( self::NEW_USER_AFTER_THIS_DATE ) > $this->activation_date_according_to_wpdesk_helper();
|
76 |
-
}
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Activation date according to wpdesk helper.
|
80 |
-
*
|
81 |
-
* @return int timestamp
|
82 |
-
*/
|
83 |
-
private function activation_date_according_to_wpdesk_helper() {
|
84 |
-
$option_name = 'plugin_activation_flexible-shipping/flexible-shipping.php';
|
85 |
-
$activation_date = get_option( $option_name, current_time( 'mysql' ) );
|
86 |
-
|
87 |
-
if ( ! $activation_date ) {
|
88 |
-
return time();
|
89 |
-
}
|
90 |
-
|
91 |
-
return strtotime( $activation_date );
|
92 |
-
}
|
93 |
-
|
94 |
-
/**
|
95 |
-
* Get variant.
|
96 |
-
*
|
97 |
-
* @return ABVariant
|
98 |
-
*/
|
99 |
-
public function get_variant() {
|
100 |
-
switch ( $this->current_variant_id ) {
|
101 |
-
case self::VARIANT_WITH_CONTACT_INFORMATION_ON_TOP:
|
102 |
-
return new WPDesk_Flexible_Shipping_AB_Variant_With_Contact_Information_On_Top();
|
103 |
-
case self::VARIANT_WITH_CONTACT_INFORMATION_ON_BOTTOM:
|
104 |
-
return new WPDesk_Flexible_Shipping_AB_Variant_With_Contact_Information_On_Bottom();
|
105 |
-
case self::VARIANT_WITH_CONTACT_BUTTON:
|
106 |
-
return new WPDesk_Flexible_Shipping_AB_Variant_With_Contact_Information_Button();
|
107 |
-
default:
|
108 |
-
return new WPDesk_Flexible_Shipping_AB_Variant_Old();
|
109 |
-
}
|
110 |
-
}
|
111 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/table-rate/abtests/class-ab-tracker-deactivation-data.php
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
use FSVendor\WPDesk\ABTesting\ABVariant;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* AB Test https://docs.google.com/document/d/1JA49dgOqJ1SawEdL506tWdW6zgD30cXDpFZhJ7r_SNo/edit?usp=sharing
|
7 |
-
*
|
8 |
-
* Class by which we can push some data to the deactivation filter
|
9 |
-
*/
|
10 |
-
class WPDesk_Flexible_Shipping_AB_Tracker_Deactivation_Data implements \FSVendor\WPDesk\PluginBuilder\Plugin\Hookable {
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Variant.
|
14 |
-
*
|
15 |
-
* @var ABVariant
|
16 |
-
*/
|
17 |
-
protected $variant;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* WPDesk_Flexible_Shipping_AB_Tracker_Deactivation_Data constructor.
|
21 |
-
*
|
22 |
-
* @param ABVariant $variant Variant.
|
23 |
-
*/
|
24 |
-
public function __construct( ABVariant $variant ) {
|
25 |
-
$this->variant = $variant;
|
26 |
-
}
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Fires hooks
|
30 |
-
*
|
31 |
-
* @return void
|
32 |
-
*/
|
33 |
-
public function hooks() {
|
34 |
-
add_filter( 'wpdesk_tracker_deactivation_data', array( $this, 'append_variant_id_to_data' ) );
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Set variant ID to data array
|
39 |
-
*
|
40 |
-
* @param array $data Data.
|
41 |
-
*
|
42 |
-
* @return array
|
43 |
-
*/
|
44 |
-
public function append_variant_id_to_data( array $data ) {
|
45 |
-
if ( WPDesk_Flexible_Shipping_Tracker::is_plugin_flexible_shipping_in_data( $data ) ) {
|
46 |
-
$data['variant_id'] = $this->variant->get_variant_id();
|
47 |
-
}
|
48 |
-
return $data;
|
49 |
-
}
|
50 |
-
|
51 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/table-rate/abtests/class-deactivation-thickbox-factory.php
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
use FSVendor\WPDesk\ABTesting\ABVariant;
|
4 |
-
use FSVendor\WPDesk\Tracker\Deactivation\PluginData;
|
5 |
-
use FSVendor\WPDesk\Tracker\Deactivation\Thickbox;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Can display deactivation thickbox content.
|
9 |
-
*/
|
10 |
-
class WPDesk_Flexible_Shipping_Deactivation_Thickbox_Factory {
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Variant.
|
14 |
-
*
|
15 |
-
* @var ABVariant
|
16 |
-
*/
|
17 |
-
private $variant;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* @var PluginData
|
21 |
-
*/
|
22 |
-
private $plugin_data;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* WPDesk_Flexible_Shipping_Deactivation_Thickbox_Factory constructor.
|
26 |
-
*
|
27 |
-
* @param ABVariant $variant Variant.
|
28 |
-
* @param PluginData $plugin_data .
|
29 |
-
*/
|
30 |
-
public function __construct( ABVariant $variant, PluginData $plugin_data ) {
|
31 |
-
$this->variant = $variant;
|
32 |
-
$this->plugin_data = $plugin_data;
|
33 |
-
}
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Create thickbox.
|
37 |
-
*
|
38 |
-
* @return Thickbox
|
39 |
-
*/
|
40 |
-
public function create_thickbox() {
|
41 |
-
$view_file = null;
|
42 |
-
if ( $this->variant->is_on( WPDesk_Flexible_Shipping_AB_Deactivation_Contact_Information::CONTACT_INFORMATION_ON_TOP ) ) {
|
43 |
-
$view_file = __DIR__ . '/views/html-thickbox-contact-information-on-top.php';
|
44 |
-
} elseif ( $this->variant->is_on( WPDesk_Flexible_Shipping_AB_Deactivation_Contact_Information::CONTACT_INFORMATION_ON_BOTTOM ) ) {
|
45 |
-
$view_file = __DIR__ . '/views/html-thickbox-contact-information-on-bottom.php';
|
46 |
-
} elseif ( $this->variant->is_on( WPDesk_Flexible_Shipping_AB_Deactivation_Contact_Information::CONTACT_INFORMATION_BUTTON ) ) {
|
47 |
-
$view_file = __DIR__ . '/views/html-thickbox-contact-information-button.php';
|
48 |
-
}
|
49 |
-
return new Thickbox( $this->plugin_data, $view_file );
|
50 |
-
}
|
51 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/table-rate/abtests/views/html-empty.php
DELETED
File without changes
|
classes/table-rate/abtests/views/html-information.php
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @var $support_link string
|
4 |
-
*
|
5 |
-
*/
|
6 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
-
exit;
|
8 |
-
}
|
9 |
-
?><h4><strong><?php
|
10 |
-
echo sprintf(
|
11 |
-
__(
|
12 |
-
'Do you have a problem with our plugin or do not know how to configure it? Write to our support department - we will try to help. %1$sGo to contact form →%2$s',
|
13 |
-
'flexible-shipping'
|
14 |
-
),
|
15 |
-
"<a target=\"_blank\" href=\"{$support_link}\">",
|
16 |
-
'</a>'
|
17 |
-
);
|
18 |
-
?></strong></h4>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/table-rate/abtests/views/html-thickbox-buttons-additional-button.php
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @var $support_link string
|
4 |
-
*
|
5 |
-
*/
|
6 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
-
exit;
|
8 |
-
}
|
9 |
-
?><div class="footer">
|
10 |
-
<a href="#" class="button button-secondary button-close tracker-button-close"><?php _e( 'Cancel', 'flexible-shipping' ); ?></a>
|
11 |
-
<a target="_blank" href="<?php echo $support_link; ?>" class="button button-secondary button-support"><?php _e( 'Any problems? Write to us.', 'flexible-shipping' ); ?></a>
|
12 |
-
<a href="#" class="button button-primary button-deactivate allow-deactivate"><?php _e( 'Skip & Deactivate', 'flexible-shipping' ); ?></a>
|
13 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/table-rate/abtests/views/html-thickbox-buttons.php
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
<div class="footer">
|
2 |
-
<a href="#" class="button button-secondary button-close tracker-button-close"><?php _e( 'Cancel', 'flexible-shipping' ); ?></a>
|
3 |
-
<a href="#" class="button button-primary button-deactivate allow-deactivate"><?php _e( 'Skip & Deactivate', 'flexible-shipping' ); ?></a>
|
4 |
-
</div>
|
|
|
|
|
|
|
|
classes/table-rate/abtests/views/html-thickbox-contact-information-button.php
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$support_link = get_locale() === 'pl_PL' ? 'https://wpde.sk/tracker-help-pl-3' : 'https://wpde.sk/tracker-help-3';
|
4 |
-
$buttons_html_file = __DIR__ . '/html-thickbox-buttons-additional-button.php';
|
5 |
-
$top_html_file = __DIR__ . '/html-empty.php';
|
6 |
-
$bottom_html_file = __DIR__ . '/html-empty.php';
|
7 |
-
require __DIR__ . '/html-thickbox-content.php';
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/table-rate/abtests/views/html-thickbox-contact-information-on-bottom.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$support_link = get_locale() === 'pl_PL' ? 'https://wpde.sk/tracker-help-pl-2' : 'https://wpde.sk/tracker-help-2';
|
4 |
-
$buttons_html_file = __DIR__ . '/html-thickbox-buttons.php';
|
5 |
-
$top_html_file = __DIR__ . '/html-empty.php';
|
6 |
-
$bottom_html_file = __DIR__ . '/html-information.php';
|
7 |
-
require __DIR__ . '/html-thickbox-content.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/table-rate/abtests/views/html-thickbox-contact-information-on-top.php
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
$support_link = get_locale() === 'pl_PL' ? 'https://wpde.sk/tracker-help-pl-1' : 'https://wpde.sk/tracker-help-1';
|
4 |
-
$buttons_html_file = __DIR__ . '/html-thickbox-buttons.php';
|
5 |
-
$top_html_file = __DIR__ . '/html-information.php';
|
6 |
-
$bottom_html_file = __DIR__ . '/html-empty.php';
|
7 |
-
require __DIR__ . '/html-thickbox-content.php';
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/table-rate/abtests/views/html-thickbox-content.php
DELETED
@@ -1,91 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @var $top_html_file string
|
4 |
-
* @var $bottom_html_file string
|
5 |
-
* @var $plugin_title string
|
6 |
-
* @var $plugin_file string
|
7 |
-
* @var $plugin_slug string
|
8 |
-
* @var $thickbox_id string
|
9 |
-
* @var $ajax_action string
|
10 |
-
* @var $ajax_nonce string
|
11 |
-
*/
|
12 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
13 |
-
exit;
|
14 |
-
}
|
15 |
-
?><div id="<?php echo $thickbox_id; ?>" style="display:none;">
|
16 |
-
<h2><?php echo sprintf( __( 'You are deactivating %s plugin.', 'flexible-shipping' ), $plugin_title ); ?></h2>
|
17 |
-
<div class="wpdesk_tracker_deactivate <?php echo $thickbox_id; ?>">
|
18 |
-
<?php include $top_html_file; ?>
|
19 |
-
<div class="body">
|
20 |
-
<div class="panel active" data-panel-id="reasons">
|
21 |
-
<h4><strong><?php _e( 'If you have a moment, please let us know why you are deactivating the plugin (anonymous feedback):', 'flexible-shipping' ); ?></strong></h4>
|
22 |
-
<ul class="reasons-list">
|
23 |
-
<li class="reason">
|
24 |
-
<label>
|
25 |
-
<span>
|
26 |
-
<input type="radio" name="selected-reason" value="plugin_stopped_working">
|
27 |
-
</span>
|
28 |
-
<span><?php _e( 'The plugin suddenly stopped working', 'flexible-shipping' ); ?></span>
|
29 |
-
</label>
|
30 |
-
</li>
|
31 |
-
<li class="reason">
|
32 |
-
<label>
|
33 |
-
<span>
|
34 |
-
<input type="radio" name="selected-reason" value="broke_my_site">
|
35 |
-
</span>
|
36 |
-
<span><?php _e( 'The plugin broke my site', 'flexible-shipping' ); ?></span>
|
37 |
-
</label>
|
38 |
-
</li>
|
39 |
-
<li class="reason has-input">
|
40 |
-
<label>
|
41 |
-
<span>
|
42 |
-
<input type="radio" name="selected-reason" value="found_better_plugin" data-show="found-better-plugin">
|
43 |
-
</span>
|
44 |
-
<span><?php _e( 'I have found a better plugin', 'flexible-shipping' ); ?></span>
|
45 |
-
</label>
|
46 |
-
<div class="found-better-plugin" class="reason-input" style="display: none">
|
47 |
-
<input type="text" class="additional-info" name="better_plugin_name" placeholder="<?php _e( 'What\'s the plugin\'s name?', 'flexible-shipping' ); ?>">
|
48 |
-
</div>
|
49 |
-
</li>
|
50 |
-
<li class="reason">
|
51 |
-
<label>
|
52 |
-
<span>
|
53 |
-
<input type="radio" name="selected-reason" value="plugin_for_short_period">
|
54 |
-
</span>
|
55 |
-
<span><?php _e('I only needed the plugin for a short period', 'flexible-shipping' ); ?></span>
|
56 |
-
</label>
|
57 |
-
</li>
|
58 |
-
<li class="reason">
|
59 |
-
<label>
|
60 |
-
<span>
|
61 |
-
<input type="radio" name="selected-reason" value="no_longer_need">
|
62 |
-
</span>
|
63 |
-
<span><?php _e( 'I no longer need the plugin', 'flexible-shipping' ); ?></span>
|
64 |
-
</label>
|
65 |
-
</li>
|
66 |
-
<li class="reason">
|
67 |
-
<label>
|
68 |
-
<span>
|
69 |
-
<input type="radio" name="selected-reason" value="temporary_deactivation">
|
70 |
-
</span>
|
71 |
-
<span><?php _e( 'It\'s a temporary deactivation. I\'m just debugging an issue.', 'flexible-shipping' ); ?></span>
|
72 |
-
</label>
|
73 |
-
</li>
|
74 |
-
<li class="reason has-input">
|
75 |
-
<label>
|
76 |
-
<span>
|
77 |
-
<input type="radio" name="selected-reason" value="other" data-show="other">
|
78 |
-
</span>
|
79 |
-
<span><?php _e( 'Other', 'flexible-shipping' ); ?></span>
|
80 |
-
</label>
|
81 |
-
<div class="other" class="reason-input" style="display: none">
|
82 |
-
<input type="text" name="other" class="additional-info" placeholder="<?php _e( 'Please let us know how we can improve our plugin', 'flexible-shipping' ); ?>">
|
83 |
-
</div>
|
84 |
-
</li>
|
85 |
-
</ul>
|
86 |
-
</div>
|
87 |
-
</div>
|
88 |
-
<?php include $bottom_html_file; ?>
|
89 |
-
<?php include $buttons_html_file; ?>
|
90 |
-
</div>
|
91 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/table-rate/flexible-shipping-settings.php
CHANGED
@@ -1,4 +1,9 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
use WPDesk\FS\TableRate\NewRulesTablePointer\ShippingMethodNewRuleTableSetting;
|
4 |
|
@@ -37,7 +42,7 @@ class WPDesk_Flexible_Shipping_Settings extends WC_Shipping_Method {
|
|
37 |
parent::__construct( $instance_id );
|
38 |
$this->id = self::METHOD_ID;
|
39 |
$this->enabled = 'no';
|
40 |
-
$this->method_title = __( 'Flexible Shipping', 'flexible-shipping' );
|
41 |
|
42 |
$this->supports = array(
|
43 |
'settings',
|
@@ -102,7 +107,7 @@ class WPDesk_Flexible_Shipping_Settings extends WC_Shipping_Method {
|
|
102 |
);
|
103 |
$this->form_fields[] = array(
|
104 |
'type' => 'title',
|
105 |
-
'title' => __( 'Advanced settings', 'flexible-shipping' )
|
106 |
);
|
107 |
$this->form_fields = $this->logger_settings->add_fields_to_settings( $this->form_fields );
|
108 |
|
@@ -114,7 +119,7 @@ class WPDesk_Flexible_Shipping_Settings extends WC_Shipping_Method {
|
|
114 |
* Generate FC connect box
|
115 |
*
|
116 |
* @param string $key Key.
|
117 |
-
* @param array
|
118 |
*
|
119 |
* @return string
|
120 |
*/
|
@@ -127,13 +132,19 @@ class WPDesk_Flexible_Shipping_Settings extends WC_Shipping_Method {
|
|
127 |
return $notice_content;
|
128 |
}
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
public function generate_settings_html( $form_fields = array(), $echo = \true ) {
|
131 |
$html = parent::generate_settings_html( $form_fields, $echo );
|
132 |
ob_start();
|
133 |
$this->new_rules_table_settings->settings_script();
|
134 |
$html .= ob_get_clean();
|
135 |
if ( $echo ) {
|
136 |
-
echo $html;
|
137 |
} else {
|
138 |
return $html;
|
139 |
}
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* WPDesk_Flexible_Shipping_Settings
|
4 |
+
*
|
5 |
+
* @package Flexible Shipping
|
6 |
+
*/
|
7 |
|
8 |
use WPDesk\FS\TableRate\NewRulesTablePointer\ShippingMethodNewRuleTableSetting;
|
9 |
|
42 |
parent::__construct( $instance_id );
|
43 |
$this->id = self::METHOD_ID;
|
44 |
$this->enabled = 'no';
|
45 |
+
$this->method_title = __( 'Flexible Shipping Info', 'flexible-shipping' );
|
46 |
|
47 |
$this->supports = array(
|
48 |
'settings',
|
107 |
);
|
108 |
$this->form_fields[] = array(
|
109 |
'type' => 'title',
|
110 |
+
'title' => __( 'Advanced settings', 'flexible-shipping' ),
|
111 |
);
|
112 |
$this->form_fields = $this->logger_settings->add_fields_to_settings( $this->form_fields );
|
113 |
|
119 |
* Generate FC connect box
|
120 |
*
|
121 |
* @param string $key Key.
|
122 |
+
* @param array $data Data.
|
123 |
*
|
124 |
* @return string
|
125 |
*/
|
132 |
return $notice_content;
|
133 |
}
|
134 |
|
135 |
+
/**
|
136 |
+
* @param array $form_fields .
|
137 |
+
* @param bool $echo .
|
138 |
+
*
|
139 |
+
* @return string
|
140 |
+
*/
|
141 |
public function generate_settings_html( $form_fields = array(), $echo = \true ) {
|
142 |
$html = parent::generate_settings_html( $form_fields, $echo );
|
143 |
ob_start();
|
144 |
$this->new_rules_table_settings->settings_script();
|
145 |
$html .= ob_get_clean();
|
146 |
if ( $echo ) {
|
147 |
+
echo $html; // phpcs:ignore
|
148 |
} else {
|
149 |
return $html;
|
150 |
}
|
classes/table-rate/settings/shipping-method-form.php
CHANGED
@@ -100,7 +100,7 @@ $settings = array(
|
|
100 |
'description' => __( 'Select how rules will be calculated. If you choose "sum" the rules order is important.', 'flexible-shipping' ),
|
101 |
'default' => $shipping_method['method_calculation_method'],
|
102 |
'desc_tip' => true,
|
103 |
-
'options' =>
|
104 |
),
|
105 |
'method_visibility' => array(
|
106 |
'title' => __( 'Visibility', 'flexible-shipping' ),
|
@@ -114,6 +114,18 @@ $settings = array(
|
|
114 |
'default' => $shipping_method['method_default'],
|
115 |
'label' => __( 'Check the box to set this option as the default selected choice on the cart page.', 'flexible-shipping' ),
|
116 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
);
|
118 |
|
119 |
if ( 1 < count( $integrations_options ) ) {
|
100 |
'description' => __( 'Select how rules will be calculated. If you choose "sum" the rules order is important.', 'flexible-shipping' ),
|
101 |
'default' => $shipping_method['method_calculation_method'],
|
102 |
'desc_tip' => true,
|
103 |
+
'options' => ( new \FSVendor\WPDesk\FS\TableRate\CalculationMethodOptions() )->get_options(),
|
104 |
),
|
105 |
'method_visibility' => array(
|
106 |
'title' => __( 'Visibility', 'flexible-shipping' ),
|
114 |
'default' => $shipping_method['method_default'],
|
115 |
'label' => __( 'Check the box to set this option as the default selected choice on the cart page.', 'flexible-shipping' ),
|
116 |
),
|
117 |
+
'method_debug_mode' => array(
|
118 |
+
'title' => __( 'FS Debug Mode', 'flexible-shipping' ),
|
119 |
+
'type' => 'checkbox',
|
120 |
+
'default' => isset( $shipping_method['method_debug_mode'] ) ? $shipping_method['method_debug_mode'] : 'no',
|
121 |
+
'label' => __( 'Enable FS Debug Mode', 'flexible-shipping' ),
|
122 |
+
'description' => sprintf(
|
123 |
+
// Translators: documentation link.
|
124 |
+
__( 'Enable FS debug mode to verify the shipping methods\' configuration, check which one was used and how the shipping cost was calculated as well as identify any possible mistakes. %1$sLearn more how the Debug Mode works →%2$s', 'flexible-shipping' ),
|
125 |
+
'<a href="' . ( 'pl_PL' !== get_locale() ? 'https://docs.flexibleshipping.com/article/421-fs-table-rate-debug-mode?utm_source=flexible-shipping-method&utm_medium=link&utm_campaign=flexible-shipping-debug-mode' : 'https://www.wpdesk.pl/docs/tryb-debugowania-flexible-shipping/?utm_source=flexible-shipping-method&utm_medium=link&utm_campaign=flexible-shipping-debug-mode' ) . '" target="_blank">',
|
126 |
+
'</a>'
|
127 |
+
),
|
128 |
+
),
|
129 |
);
|
130 |
|
131 |
if ( 1 < count( $integrations_options ) ) {
|
classes/table-rate/shipping-method.php
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
use FSVendor\WPDesk\Beacon\Beacon\WooCommerceSettingsFieldsModifier;
|
|
|
4 |
use WPDesk\FS\TableRate\NewRulesTableBanner\RulesPointerBannerForOldTable;
|
5 |
use WPDesk\FS\TableRate\NewRulesTablePointer\RulesPointerOption;
|
6 |
use WPDesk\FS\TableRate\NewRulesTablePointer\ShippingMethodNewRuleTableSetting;
|
@@ -20,6 +21,13 @@ class WPDesk_Flexible_Shipping extends WC_Shipping_Method {
|
|
20 |
|
21 |
const SETTING_METHOD_FREE_SHIPPING_NOTICE = 'method_free_shipping_cart_notice';
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
/**
|
24 |
* Message added.
|
25 |
*
|
@@ -72,14 +80,46 @@ class WPDesk_Flexible_Shipping extends WC_Shipping_Method {
|
|
72 |
|
73 |
$this->init();
|
74 |
|
75 |
-
|
76 |
-
//$this->method_title = $this->get_option( 'title' );
|
77 |
-
|
78 |
-
//add_action( 'woocommerce_sections_' . $this->id, array( $this, 'process_admin_options' ) );
|
79 |
add_action( 'woocommerce_update_options_shipping_' . $this->id, array( $this, 'process_admin_options' ) );
|
80 |
|
81 |
}
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
/**
|
84 |
* Init your settings
|
85 |
*
|
@@ -315,6 +355,10 @@ class WPDesk_Flexible_Shipping extends WC_Shipping_Method {
|
|
315 |
if ( isset( $_POST['woocommerce_' . $this->id . '_method_default'] ) && $_POST['woocommerce_' . $this->id . '_method_default'] == 1 )
|
316 |
{$shipping_method['method_default'] = 'yes';}
|
317 |
//
|
|
|
|
|
|
|
|
|
318 |
$shipping_method['method_enabled'] = 'no';
|
319 |
if ( isset( $_POST['woocommerce_' . $this->id . '_method_enabled'] ) && $_POST['woocommerce_' . $this->id . '_method_enabled'] == 1 )
|
320 |
{$shipping_method['method_enabled'] = 'yes';}
|
@@ -609,6 +653,12 @@ class WPDesk_Flexible_Shipping extends WC_Shipping_Method {
|
|
609 |
|
610 |
foreach ( $shipping_methods as $shipping_method ) {
|
611 |
|
|
|
|
|
|
|
|
|
|
|
|
|
612 |
$rule_costs = array();
|
613 |
|
614 |
$add_method = false;
|
@@ -620,16 +670,34 @@ class WPDesk_Flexible_Shipping extends WC_Shipping_Method {
|
|
620 |
|
621 |
$weight_rounding_precision = $this->get_weight_rounding_precision( $shipping_method[ self::SETTING_METHOD_RULES ] );
|
622 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
623 |
foreach ( $shipping_method[ self::SETTING_METHOD_RULES ] as $rule_key => $method_rule ) {
|
|
|
|
|
|
|
624 |
$rule_triggered = false;
|
625 |
|
626 |
if ( $method_rule['based_on'] == 'none' ) {
|
627 |
$rule_triggered = true;
|
628 |
}
|
629 |
|
630 |
-
$contents_cost = $this->contents_cost();
|
631 |
-
$cart_contents_cost = $contents_cost;
|
632 |
-
|
633 |
if ( $method_rule['based_on'] == 'value' ) {
|
634 |
if ( trim( $method_rule['min'] ) == '' ) {
|
635 |
$min = 0;
|
@@ -661,27 +729,68 @@ class WPDesk_Flexible_Shipping extends WC_Shipping_Method {
|
|
661 |
else {
|
662 |
$max = floatval( $method_rule['max'] );
|
663 |
}
|
664 |
-
|
665 |
if ( $contents_weight >= $min && $contents_weight <= $max ) {
|
666 |
$rule_triggered = true;
|
667 |
}
|
668 |
}
|
|
|
|
|
|
|
|
|
669 |
if ( $rule_triggered ) {
|
670 |
-
$rule_triggered = apply_filters( 'flexible_shipping_rule_triggered', $rule_triggered, $method_rule, $package );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
671 |
}
|
|
|
672 |
if ( $rule_triggered ) {
|
673 |
$rule_cost = array( 'cost' => floatval( $method_rule['cost_per_order'] ) );
|
|
|
674 |
$rule_costs[$rule_key] = $rule_cost;
|
675 |
$add_method = true;
|
676 |
}
|
677 |
|
|
|
678 |
}
|
679 |
-
|
|
|
|
|
|
|
680 |
$add_method = apply_filters( 'flexible_shipping_add_method' , $add_method, $shipping_method, $package, $this );
|
|
|
|
|
|
|
|
|
681 |
if ( $add_method === true ) {
|
682 |
|
683 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
684 |
$cost = 0;
|
|
|
685 |
}
|
686 |
|
687 |
$method_title = wpdesk__( $shipping_method['method_title'], 'flexible-shipping' );
|
@@ -697,7 +806,10 @@ class WPDesk_Flexible_Shipping extends WC_Shipping_Method {
|
|
697 |
}
|
698 |
|
699 |
$id = $this->id . '_' . $this->instance_id . '_' . sanitize_title( $shipping_method['method_title'] );
|
|
|
700 |
$id = apply_filters( 'flexible_shipping_method_rate_id', $id, $shipping_method );
|
|
|
|
|
701 |
$this->add_rate( array(
|
702 |
'id' => $id,
|
703 |
'label' => $method_title,
|
@@ -710,6 +822,9 @@ class WPDesk_Flexible_Shipping extends WC_Shipping_Method {
|
|
710 |
'_fs_method' => $shipping_method
|
711 |
)
|
712 |
) );
|
|
|
|
|
|
|
713 |
if ( isset( $shipping_method['method_description'] ) ) {
|
714 |
WC()->session->set('flexible_shipping_description_' . $id, wpdesk__( $shipping_method['method_description'], 'flexible-shipping' ) );
|
715 |
}
|
@@ -717,6 +832,8 @@ class WPDesk_Flexible_Shipping extends WC_Shipping_Method {
|
|
717 |
WC()->session->set( 'flexible_shipping_description_' . $id, '' );
|
718 |
}
|
719 |
}
|
|
|
|
|
720 |
}
|
721 |
}
|
722 |
}
|
@@ -749,7 +866,9 @@ class WPDesk_Flexible_Shipping extends WC_Shipping_Method {
|
|
749 |
* @return int
|
750 |
*/
|
751 |
private function get_weight_rounding_precision( array $shipping_method_rules ) {
|
752 |
-
$weight_rounding = new \FSVendor\WPDesk\FS\TableRate\Weight\Rounding(
|
|
|
|
|
753 |
return (int) apply_filters( 'flexible_shipping_weight_rounding_precision', $weight_rounding->get_rounding_from_rules() );
|
754 |
}
|
755 |
|
1 |
<?php
|
2 |
|
3 |
use FSVendor\WPDesk\Beacon\Beacon\WooCommerceSettingsFieldsModifier;
|
4 |
+
use Psr\Log\LoggerInterface;
|
5 |
use WPDesk\FS\TableRate\NewRulesTableBanner\RulesPointerBannerForOldTable;
|
6 |
use WPDesk\FS\TableRate\NewRulesTablePointer\RulesPointerOption;
|
7 |
use WPDesk\FS\TableRate\NewRulesTablePointer\ShippingMethodNewRuleTableSetting;
|
21 |
|
22 |
const SETTING_METHOD_FREE_SHIPPING_NOTICE = 'method_free_shipping_cart_notice';
|
23 |
|
24 |
+
/**
|
25 |
+
* Logger provided by Flexible Shipping plugin.
|
26 |
+
*
|
27 |
+
* @var LoggerInterface
|
28 |
+
*/
|
29 |
+
protected static $fs_logger;
|
30 |
+
|
31 |
/**
|
32 |
* Message added.
|
33 |
*
|
80 |
|
81 |
$this->init();
|
82 |
|
|
|
|
|
|
|
|
|
83 |
add_action( 'woocommerce_update_options_shipping_' . $this->id, array( $this, 'process_admin_options' ) );
|
84 |
|
85 |
}
|
86 |
|
87 |
+
/**
|
88 |
+
* Set logger. This logger is set by Flexible Shipping plugin.
|
89 |
+
*
|
90 |
+
* @param LoggerInterface $fs_logger .
|
91 |
+
*/
|
92 |
+
public static function set_fs_logger( LoggerInterface $fs_logger ) {
|
93 |
+
static::$fs_logger = $fs_logger;
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* @param \FSVendor\WPDesk\FS\TableRate\Settings\MethodSettings $shipping_method_settings
|
98 |
+
*
|
99 |
+
* @return \WPDesk\FS\TableRate\Logger\ShippingMethodLogger
|
100 |
+
*/
|
101 |
+
private function prepare_shipping_method_calculation_logger( $shipping_method_settings ) {
|
102 |
+
$method_debug_mode = $shipping_method_settings->get_debug_mode();
|
103 |
+
$shipping_method_title = $shipping_method_settings->get_title();
|
104 |
+
$shipping_method_url = admin_url(
|
105 |
+
'admin.php?page=wc-settings&tab=shipping&instance_id=' . sanitize_key( $this->instance_id ) . '&action=edit&method_id=' . sanitize_key( $shipping_method_settings->get_id() )
|
106 |
+
);
|
107 |
+
if ( null !== static::$fs_logger ) {
|
108 |
+
$fs_logger = static::$fs_logger;
|
109 |
+
} else {
|
110 |
+
$fs_logger = \Psr\Log\NullLogger();
|
111 |
+
}
|
112 |
+
|
113 |
+
return new \FSVendor\WPDesk\FS\TableRate\Logger\ShippingMethodLogger(
|
114 |
+
$fs_logger,
|
115 |
+
new \FSVendor\WPDesk\FS\TableRate\Logger\NoticeLogger(
|
116 |
+
$shipping_method_title,
|
117 |
+
$shipping_method_url,
|
118 |
+
'yes' === $method_debug_mode && current_user_can( 'manage_woocommerce' )
|
119 |
+
)
|
120 |
+
);
|
121 |
+
}
|
122 |
+
|
123 |
/**
|
124 |
* Init your settings
|
125 |
*
|
355 |
if ( isset( $_POST['woocommerce_' . $this->id . '_method_default'] ) && $_POST['woocommerce_' . $this->id . '_method_default'] == 1 )
|
356 |
{$shipping_method['method_default'] = 'yes';}
|
357 |
//
|
358 |
+
$shipping_method['method_debug_mode'] = 'no';
|
359 |
+
if ( isset( $_POST['woocommerce_' . $this->id . '_method_debug_mode'] ) && $_POST['woocommerce_' . $this->id . '_method_debug_mode'] == 1 )
|
360 |
+
{$shipping_method['method_debug_mode'] = 'yes';}
|
361 |
+
//
|
362 |
$shipping_method['method_enabled'] = 'no';
|
363 |
if ( isset( $_POST['woocommerce_' . $this->id . '_method_enabled'] ) && $_POST['woocommerce_' . $this->id . '_method_enabled'] == 1 )
|
364 |
{$shipping_method['method_enabled'] = 'yes';}
|
653 |
|
654 |
foreach ( $shipping_methods as $shipping_method ) {
|
655 |
|
656 |
+
$method_settings = \FSVendor\WPDesk\FS\TableRate\Settings\MethodSettingsFactory::create_from_array( $shipping_method );
|
657 |
+
|
658 |
+
$logger = $this->prepare_shipping_method_calculation_logger( $method_settings );
|
659 |
+
|
660 |
+
$logger->debug( $method_settings->format_for_log(), $logger->get_configuration_section_context() );
|
661 |
+
|
662 |
$rule_costs = array();
|
663 |
|
664 |
$add_method = false;
|
670 |
|
671 |
$weight_rounding_precision = $this->get_weight_rounding_precision( $shipping_method[ self::SETTING_METHOD_RULES ] );
|
672 |
|
673 |
+
$logger->debug( sprintf( __( 'Number of decimal places the weight is rounded to: %1$s', 'flexible-shipping' ), $weight_rounding_precision ), $logger->get_configuration_section_context() );
|
674 |
+
|
675 |
+
$contents_weight = round( $this->cart_weight(), $weight_rounding_precision );
|
676 |
+
|
677 |
+
$logger->debug( sprintf( __( 'Cart weight after rounding: %1$s', 'flexible-shipping' ), $contents_weight ), $logger->get_input_data_context() );
|
678 |
+
|
679 |
+
$contents_cost = $this->contents_cost();
|
680 |
+
$cart_contents_cost = $contents_cost;
|
681 |
+
|
682 |
+
$logger->debug( sprintf( __( 'Cart value: %1$s', 'flexible-shipping' ), $cart_contents_cost ), $logger->get_input_data_context() );
|
683 |
+
|
684 |
+
$shop_currency = get_option( 'woocommerce_currency' );
|
685 |
+
$cart_currency = get_woocommerce_currency();
|
686 |
+
if ( $shop_currency !== $cart_currency ) {
|
687 |
+
$logger->debug( sprintf( __( 'Shop currency: %1$s', 'flexible-shipping' ), $shop_currency ), $logger->get_input_data_context() );
|
688 |
+
$logger->debug( sprintf( __( 'Cart currency: %1$s', 'flexible-shipping' ), $cart_currency ), $logger->get_input_data_context() );
|
689 |
+
}
|
690 |
+
|
691 |
foreach ( $shipping_method[ self::SETTING_METHOD_RULES ] as $rule_key => $method_rule ) {
|
692 |
+
|
693 |
+
$method_rule_settings = \FSVendor\WPDesk\FS\TableRate\Settings\RuleSettingsFactory::create_single_from_array( $rule_key, $method_rule );
|
694 |
+
|
695 |
$rule_triggered = false;
|
696 |
|
697 |
if ( $method_rule['based_on'] == 'none' ) {
|
698 |
$rule_triggered = true;
|
699 |
}
|
700 |
|
|
|
|
|
|
|
701 |
if ( $method_rule['based_on'] == 'value' ) {
|
702 |
if ( trim( $method_rule['min'] ) == '' ) {
|
703 |
$min = 0;
|
729 |
else {
|
730 |
$max = floatval( $method_rule['max'] );
|
731 |
}
|
732 |
+
|
733 |
if ( $contents_weight >= $min && $contents_weight <= $max ) {
|
734 |
$rule_triggered = true;
|
735 |
}
|
736 |
}
|
737 |
+
|
738 |
+
$rule_triggered_before_filters = $rule_triggered;
|
739 |
+
|
740 |
+
$rule_triggered_filter_logger = new \FSVendor\WPDesk\FS\TableRate\Logger\ArrayLogger();
|
741 |
if ( $rule_triggered ) {
|
742 |
+
$rule_triggered = apply_filters( 'flexible_shipping_rule_triggered', $rule_triggered, $method_rule, $package, $rule_triggered_filter_logger );
|
743 |
+
}
|
744 |
+
|
745 |
+
$logger->debug( $method_rule_settings->format_for_log(), $logger->get_rule_context( $rule_triggered ) );
|
746 |
+
|
747 |
+
if ( $method_rule_settings->is_based_on_value() && $shop_currency !== $cart_currency ) {
|
748 |
+
$logger->debug(
|
749 |
+
sprintf(
|
750 |
+
__( 'Converted to cart currency: min: %1$s, max: %2$s', 'flexible-shipping' ),
|
751 |
+
! empty( $method_rule['min'] ) ? $min : null,
|
752 |
+
! empty( $method_rule['max'] ) ? $max : null
|
753 |
+
),
|
754 |
+
$logger->get_rule_context( $rule_triggered )
|
755 |
+
);
|
756 |
+
}
|
757 |
+
|
758 |
+
$logger->log_from_array_logger( $rule_triggered_filter_logger, $logger->get_rule_context( $rule_triggered ) );
|
759 |
+
|
760 |
+
if ( $rule_triggered_before_filters !== $rule_triggered ) {
|
761 |
+
$logger->debug( sprintf( __( 'Rule triggered after before filter: %1$s', 'flexible-shipping' ), $rule_triggered_before_filters ? __( 'yes', 'flexible-shipping' ) : __( 'no', 'flexible-shipping' ) ), $logger->get_rule_context( $rule_triggered ) );
|
762 |
+
$logger->debug( sprintf( __( 'Rule triggered after filter: %1$s', 'flexible-shipping' ), $rule_triggered ? __( 'yes', 'flexible-shipping' ) : __( 'no', 'flexible-shipping' ) ), $logger->get_rule_context( $rule_triggered ) );
|
763 |
}
|
764 |
+
|
765 |
if ( $rule_triggered ) {
|
766 |
$rule_cost = array( 'cost' => floatval( $method_rule['cost_per_order'] ) );
|
767 |
+
$logger->debug( sprintf( __( 'Calculated rule cost: %1$s %2$s', 'flexible-shipping' ), $rule_cost['cost'], $shop_currency ), $logger->get_rule_context( $rule_triggered ) );
|
768 |
$rule_costs[$rule_key] = $rule_cost;
|
769 |
$add_method = true;
|
770 |
}
|
771 |
|
772 |
+
$logger->debug( '', $logger->get_rule_context( $rule_triggered ) );
|
773 |
}
|
774 |
+
|
775 |
+
$logger->debug( sprintf( __( 'Used and displayed in the cart/checkout: %1$s', 'flexible-shipping' ), $add_method ? __( 'yes', 'flexible-shipping' ) : __( 'no', 'flexible-shipping' ) ), $logger->get_results_context() );
|
776 |
+
$add_method_before_filters = $add_method;
|
777 |
+
|
778 |
$add_method = apply_filters( 'flexible_shipping_add_method' , $add_method, $shipping_method, $package, $this );
|
779 |
+
if ( $add_method_before_filters !== $add_method ) {
|
780 |
+
$logger->debug( sprintf( __( 'Used and displayed in the cart/checkout after filters: %1$s', 'flexible-shipping' ), $add_method ? __( 'yes', 'flexible-shipping' ) : __( 'no', 'flexible-shipping' ) ), $logger->get_results_context() );
|
781 |
+
}
|
782 |
+
|
783 |
if ( $add_method === true ) {
|
784 |
|
785 |
+
$cost = $this->calculate_method_cost( $shipping_method, $rule_costs );
|
786 |
+
$logger->debug( sprintf( __( 'Calculated shipping cost: %1$s %2$s', 'flexible-shipping' ), $cost, $shop_currency ), $logger->get_results_context() );
|
787 |
+
|
788 |
+
$is_free_shipping = $this->is_free_shipping( $shipping_method, $cart_contents_cost );
|
789 |
+
$logger->debug( sprintf( __( 'Free shipping: %1$s', 'flexible-shipping' ), $is_free_shipping ? __( 'yes', 'flexible-shipping' ) : __( 'no', 'flexible-shipping' ) ), $logger->get_results_context() );
|
790 |
+
|
791 |
+
if ( $is_free_shipping ) {
|
792 |
$cost = 0;
|
793 |
+
$logger->debug( sprintf( __( 'Shipping cost after free shipping applied: %1$s', 'flexible-shipping' ), $cost ), $logger->get_results_context() );
|
794 |
}
|
795 |
|
796 |
$method_title = wpdesk__( $shipping_method['method_title'], 'flexible-shipping' );
|
806 |
}
|
807 |
|
808 |
$id = $this->id . '_' . $this->instance_id . '_' . sanitize_title( $shipping_method['method_title'] );
|
809 |
+
|
810 |
$id = apply_filters( 'flexible_shipping_method_rate_id', $id, $shipping_method );
|
811 |
+
$logger->debug( sprintf( __( 'Shipping method ID: %1$s', 'flexible-shipping' ), $id ), $logger->get_results_context() );
|
812 |
+
|
813 |
$this->add_rate( array(
|
814 |
'id' => $id,
|
815 |
'label' => $method_title,
|
822 |
'_fs_method' => $shipping_method
|
823 |
)
|
824 |
) );
|
825 |
+
|
826 |
+
$logger->debug( __( 'Shipping cost added.', 'flexible-shipping' ), $logger->get_results_context() );
|
827 |
+
|
828 |
if ( isset( $shipping_method['method_description'] ) ) {
|
829 |
WC()->session->set('flexible_shipping_description_' . $id, wpdesk__( $shipping_method['method_description'], 'flexible-shipping' ) );
|
830 |
}
|
832 |
WC()->session->set( 'flexible_shipping_description_' . $id, '' );
|
833 |
}
|
834 |
}
|
835 |
+
|
836 |
+
$logger->show_notice_if_enabled();
|
837 |
}
|
838 |
}
|
839 |
}
|
866 |
* @return int
|
867 |
*/
|
868 |
private function get_weight_rounding_precision( array $shipping_method_rules ) {
|
869 |
+
$weight_rounding = new \FSVendor\WPDesk\FS\TableRate\Weight\Rounding(
|
870 |
+
\FSVendor\WPDesk\FS\TableRate\Settings\RuleSettingsFactory::create_rules_from_shipping_rules_array( $shipping_method_rules )
|
871 |
+
);
|
872 |
return (int) apply_filters( 'flexible_shipping_weight_rounding_precision', $weight_rounding->get_rounding_from_rules() );
|
873 |
}
|
874 |
|
classes/table-rate/views/html-ads.php
CHANGED
@@ -4,7 +4,8 @@
|
|
4 |
<div class="wpdesk-stuffbox">
|
5 |
<h3 class="title"><?php _e( 'Get Flexible Shipping PRO!', 'flexible-shipping' ); ?></h3>
|
6 |
<?php
|
7 |
-
$fs_link = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/sklep/flexible-shipping-pro-woocommerce/' : 'https://flexibleshipping.com/
|
|
|
8 |
?>
|
9 |
|
10 |
<div class="inside">
|
@@ -16,7 +17,7 @@
|
|
16 |
<li><span class="dashicons dashicons-yes"></span> <?php _e( 'Additional calculation methods', 'flexible-shipping' ); ?></li>
|
17 |
</ul>
|
18 |
|
19 |
-
<a class="button button-primary" href="<?php echo $fs_link;
|
20 |
</div>
|
21 |
</div>
|
22 |
</div>
|
4 |
<div class="wpdesk-stuffbox">
|
5 |
<h3 class="title"><?php _e( 'Get Flexible Shipping PRO!', 'flexible-shipping' ); ?></h3>
|
6 |
<?php
|
7 |
+
$fs_link = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/sklep/flexible-shipping-pro-woocommerce/' : 'https://flexibleshipping.com/products/flexible-shipping-pro-woocommerce/';
|
8 |
+
$utm = get_locale() === 'pl_PL' ? '?utm_campaign=flexible-shipping&utm_source=user-site&utm_medium=button&utm_term=upgrade-now&utm_content=fs-shippingzone-upgradenow' : '?utm_source=fs-settings&utm_medium=link&utm_campaign=settings-upgrade-link';
|
9 |
?>
|
10 |
|
11 |
<div class="inside">
|
17 |
<li><span class="dashicons dashicons-yes"></span> <?php _e( 'Additional calculation methods', 'flexible-shipping' ); ?></li>
|
18 |
</ul>
|
19 |
|
20 |
+
<a class="button button-primary" href="<?php echo esc_attr( $fs_link . $utm ); ?>" target="_blank"><?php _e( 'Upgrade Now →', 'flexible-shipping' ); ?></a>
|
21 |
</div>
|
22 |
</div>
|
23 |
</div>
|
classes/table-rate/views/html-shipping-method-rules.php
CHANGED
@@ -3,12 +3,7 @@
|
|
3 |
|
4 |
$field = $this->get_field_key( $key );
|
5 |
|
6 |
-
$options_based_on =
|
7 |
-
'none' => __( 'None', 'flexible-shipping' ),
|
8 |
-
'value' => __( 'Price', 'flexible-shipping' ),
|
9 |
-
'weight' => __( 'Weight', 'flexible-shipping' ),
|
10 |
-
));
|
11 |
-
|
12 |
|
13 |
$key = 'method_rules[xxx][based_on]';
|
14 |
$args_based_on = array(
|
3 |
|
4 |
$field = $this->get_field_key( $key );
|
5 |
|
6 |
+
$options_based_on = (new \FSVendor\WPDesk\FS\TableRate\BasedOnOptions())->get_options();
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
$key = 'method_rules[xxx][based_on]';
|
9 |
$args_based_on = array(
|
classes/wp-wpdesk-fs-shipment/rate-notice.php
CHANGED
@@ -7,8 +7,6 @@ namespace WPDesk\FS\Rate;
|
|
7 |
*/
|
8 |
class WPDesk_Flexible_Shipping_Rate_Notice implements \FSVendor\WPDesk\PluginBuilder\Plugin\Hookable {
|
9 |
|
10 |
-
const FIRST_NOTICE_MIN_ORDERS = 100;
|
11 |
-
const CLOSE_TEMPORARY_NOTICE_NUMBER = 'close-temporary-notice-number';
|
12 |
const CLOSE_TEMPORARY_NOTICE_DATE = 'close-temporary-notice-date';
|
13 |
const CLOSE_ALREADY_DID = 'already-did';
|
14 |
|
@@ -17,7 +15,6 @@ class WPDesk_Flexible_Shipping_Rate_Notice implements \FSVendor\WPDesk\PluginBui
|
|
17 |
const SETTINGS_RATE_NOTICE_VARIANT_ID = 'flexible_shipping_rate_notice_variant_id';
|
18 |
|
19 |
const SETTINGS_OPTION_RATE_NOTICE_DATE_DISMISS = 'flexible_shipping_rate_notice_date_dismiss';
|
20 |
-
const SETTINGS_OPTION_RATE_NOTICE_NUMBER_DISMISS = 'flexible_shipping_rate_notice_number_dismiss';
|
21 |
|
22 |
/**
|
23 |
* Hooks.
|
@@ -36,21 +33,16 @@ class WPDesk_Flexible_Shipping_Rate_Notice implements \FSVendor\WPDesk\PluginBui
|
|
36 |
* @param string $source Sorcue.
|
37 |
*/
|
38 |
public function reset_rate_variant_action( $notice_name, $source ) {
|
39 |
-
$variant_id = get_option( self::SETTINGS_RATE_NOTICE_VARIANT_ID );
|
40 |
if ( 'flexible_shipping_rate_plugin' !== $notice_name ) {
|
41 |
return false;
|
42 |
}
|
43 |
|
44 |
$dismissed_count = (int) get_option( self::SETTINGS_OPTION_DISMISSED_COUNT, 0 );
|
45 |
|
46 |
-
if ( ( empty( $source ) || self::CLOSE_TEMPORARY_NOTICE_DATE === $source )
|
47 |
update_option( self::SETTINGS_OPTION_RATE_NOTICE_DATE_DISMISS, date( "Y-m-d H:i:s", strtotime( 'NOW + 2 weeks' ) ) );
|
48 |
delete_option( \FSVendor\WPDesk\Notice\PermanentDismissibleNotice::OPTION_NAME_PREFIX . $notice_name );
|
49 |
update_option( self::SETTINGS_OPTION_DISMISSED_COUNT, 1 );
|
50 |
-
} elseif ( ( empty( $source ) || self::CLOSE_TEMPORARY_NOTICE_NUMBER === $source ) && $variant_id === ThirdRateNotice::SETTINGS_VARIANT_ID ) {
|
51 |
-
update_option( Flexible_Shipping_Order_Counter::FS_ORDER_COUNTER, 0 );
|
52 |
-
delete_option( \FSVendor\WPDesk\Notice\PermanentDismissibleNotice::OPTION_NAME_PREFIX . $notice_name );
|
53 |
-
update_option( self::SETTINGS_OPTION_DISMISSED_COUNT, 1 );
|
54 |
} elseif ( self::CLOSE_ALREADY_DID === $source ) {
|
55 |
update_option( \FSVendor\WPDesk\Notice\PermanentDismissibleNotice::OPTION_NAME_PREFIX . $notice_name, 1 );
|
56 |
}
|
@@ -61,8 +53,6 @@ class WPDesk_Flexible_Shipping_Rate_Notice implements \FSVendor\WPDesk\PluginBui
|
|
61 |
|
62 |
}
|
63 |
|
64 |
-
|
65 |
-
|
66 |
/**
|
67 |
* Should display notice.
|
68 |
*
|
@@ -78,32 +68,20 @@ class WPDesk_Flexible_Shipping_Rate_Notice implements \FSVendor\WPDesk\PluginBui
|
|
78 |
}
|
79 |
|
80 |
/**
|
81 |
-
* Generate rate notice variant ID
|
82 |
*
|
83 |
* @return string
|
84 |
*/
|
85 |
private function generate_rate_notice_variant_id()
|
86 |
{
|
87 |
-
|
88 |
-
if ( $variant === '0' ) {
|
89 |
-
$variant = 'notice_' . mt_rand(1, 3);
|
90 |
-
add_option( self::SETTINGS_RATE_NOTICE_VARIANT_ID, $variant );
|
91 |
-
$this->set_notice_defaults( $variant );
|
92 |
-
}
|
93 |
-
return $variant;
|
94 |
}
|
95 |
|
96 |
/**
|
97 |
-
* Set defaults for notice
|
98 |
-
*
|
99 |
-
* @param string $variant Variant ID.
|
100 |
*/
|
101 |
-
private function set_notice_defaults(
|
102 |
-
|
103 |
-
add_option( self::SETTINGS_OPTION_RATE_NOTICE_DATE_DISMISS, date( "Y-m-d H:i:s", strtotime('NOW + 2 weeks') ) );
|
104 |
-
} else {
|
105 |
-
add_option( Flexible_Shipping_Order_Counter::FS_ORDER_COUNTER, 0 );
|
106 |
-
}
|
107 |
}
|
108 |
|
109 |
/**
|
@@ -111,10 +89,9 @@ class WPDesk_Flexible_Shipping_Rate_Notice implements \FSVendor\WPDesk\PluginBui
|
|
111 |
*/
|
112 |
public function add_admin_notice_action()
|
113 |
{
|
114 |
-
$variant = $this->generate_rate_notice_variant_id();
|
115 |
if ( $this->should_display_notice() ) {
|
116 |
-
$
|
117 |
-
$
|
118 |
if( $instance->should_show_message() ) {
|
119 |
$instance->show_message();
|
120 |
}
|
7 |
*/
|
8 |
class WPDesk_Flexible_Shipping_Rate_Notice implements \FSVendor\WPDesk\PluginBuilder\Plugin\Hookable {
|
9 |
|
|
|
|
|
10 |
const CLOSE_TEMPORARY_NOTICE_DATE = 'close-temporary-notice-date';
|
11 |
const CLOSE_ALREADY_DID = 'already-did';
|
12 |
|
15 |
const SETTINGS_RATE_NOTICE_VARIANT_ID = 'flexible_shipping_rate_notice_variant_id';
|
16 |
|
17 |
const SETTINGS_OPTION_RATE_NOTICE_DATE_DISMISS = 'flexible_shipping_rate_notice_date_dismiss';
|
|
|
18 |
|
19 |
/**
|
20 |
* Hooks.
|
33 |
* @param string $source Sorcue.
|
34 |
*/
|
35 |
public function reset_rate_variant_action( $notice_name, $source ) {
|
|
|
36 |
if ( 'flexible_shipping_rate_plugin' !== $notice_name ) {
|
37 |
return false;
|
38 |
}
|
39 |
|
40 |
$dismissed_count = (int) get_option( self::SETTINGS_OPTION_DISMISSED_COUNT, 0 );
|
41 |
|
42 |
+
if ( ( empty( $source ) || self::CLOSE_TEMPORARY_NOTICE_DATE === $source ) ) {
|
43 |
update_option( self::SETTINGS_OPTION_RATE_NOTICE_DATE_DISMISS, date( "Y-m-d H:i:s", strtotime( 'NOW + 2 weeks' ) ) );
|
44 |
delete_option( \FSVendor\WPDesk\Notice\PermanentDismissibleNotice::OPTION_NAME_PREFIX . $notice_name );
|
45 |
update_option( self::SETTINGS_OPTION_DISMISSED_COUNT, 1 );
|
|
|
|
|
|
|
|
|
46 |
} elseif ( self::CLOSE_ALREADY_DID === $source ) {
|
47 |
update_option( \FSVendor\WPDesk\Notice\PermanentDismissibleNotice::OPTION_NAME_PREFIX . $notice_name, 1 );
|
48 |
}
|
53 |
|
54 |
}
|
55 |
|
|
|
|
|
56 |
/**
|
57 |
* Should display notice.
|
58 |
*
|
68 |
}
|
69 |
|
70 |
/**
|
71 |
+
* Generate rate notice variant ID.
|
72 |
*
|
73 |
* @return string
|
74 |
*/
|
75 |
private function generate_rate_notice_variant_id()
|
76 |
{
|
77 |
+
return 'notice_2';
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
|
80 |
/**
|
81 |
+
* Set defaults for notice.
|
|
|
|
|
82 |
*/
|
83 |
+
private function set_notice_defaults() {
|
84 |
+
add_option( self::SETTINGS_OPTION_RATE_NOTICE_DATE_DISMISS, date( "Y-m-d H:i:s", strtotime('NOW + 2 weeks') ) );
|
|
|
|
|
|
|
|
|
85 |
}
|
86 |
|
87 |
/**
|
89 |
*/
|
90 |
public function add_admin_notice_action()
|
91 |
{
|
|
|
92 |
if ( $this->should_display_notice() ) {
|
93 |
+
$instance = new RateNoticeImplementation();
|
94 |
+
$this->set_notice_defaults();
|
95 |
if( $instance->should_show_message() ) {
|
96 |
$instance->show_message();
|
97 |
}
|
classes/wp-wpdesk-fs-shipment/rate-notices/first-rate-notice.php
DELETED
@@ -1,65 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\FS\Rate;
|
4 |
-
|
5 |
-
class FirstRateNotice extends RateNotice
|
6 |
-
{
|
7 |
-
|
8 |
-
const SETTINGS_VARIANT_ID = 'notice_1';
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Action links
|
12 |
-
*
|
13 |
-
* @return array
|
14 |
-
*/
|
15 |
-
protected function action_links() {
|
16 |
-
$actions[] = sprintf(
|
17 |
-
__( '%1$sOk, you deserved it%2$s', 'flexible-shipping' ),
|
18 |
-
'<a target="_blank" href="' . esc_url( 'https://wpde.sk/fs-rate-1' ) . '">',
|
19 |
-
'</a>'
|
20 |
-
);
|
21 |
-
$actions[] = sprintf(
|
22 |
-
__( '%1$sNope, maybe later%2$s', 'flexible-shipping' ),
|
23 |
-
'<a data-type="date" class="fs-close-temporary-notice notice-dismiss-link" data-source="' . self::CLOSE_TEMPORARY_NOTICE . '" href="#">',
|
24 |
-
'</a>'
|
25 |
-
);
|
26 |
-
$actions[] = sprintf(
|
27 |
-
__( '%1$sI already did%2$s', 'flexible-shipping' ),
|
28 |
-
'<a class="close-rate-notice notice-dismiss-link" data-source="already-did" href="#">',
|
29 |
-
'</a>'
|
30 |
-
);
|
31 |
-
|
32 |
-
return $actions;
|
33 |
-
}
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Should show message
|
37 |
-
*
|
38 |
-
* @return bool
|
39 |
-
*/
|
40 |
-
public function should_show_message() {
|
41 |
-
$notice_date_dissmis = get_option( WPDesk_Flexible_Shipping_Rate_Notice::SETTINGS_OPTION_RATE_NOTICE_DATE_DISMISS, date( "Y-m-d H:i:s", strtotime( 'NOW + 2 weeks' ) ) );
|
42 |
-
$notice_date = strtotime( $notice_date_dissmis );
|
43 |
-
$current_date = strtotime( 'NOW' );
|
44 |
-
$difference = $current_date - $notice_date;
|
45 |
-
$days = (int) floor( $difference / ( 60 * 60 * 24 ) );
|
46 |
-
if ( $days > 0 ) {
|
47 |
-
return true;
|
48 |
-
}
|
49 |
-
|
50 |
-
return false;
|
51 |
-
}
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Get rate message
|
55 |
-
*
|
56 |
-
* @return string
|
57 |
-
*/
|
58 |
-
protected function get_message() {
|
59 |
-
$message = __( 'Awesome, you\'ve been using Flexible Shipping for more than 2 weeks. May I ask you to give it a 5-star rating on WordPress?', 'flexible-shipping' );
|
60 |
-
$message .= '<br/>';
|
61 |
-
$message .= implode( ' | ', $this->action_links() );
|
62 |
-
return $message;
|
63 |
-
}
|
64 |
-
|
65 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/wp-wpdesk-fs-shipment/rate-notices/order-counter.php
DELETED
@@ -1,53 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\FS\Rate;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Counts orders with FS shipping method.
|
7 |
-
*/
|
8 |
-
class Flexible_Shipping_Order_Counter implements \FSVendor\WPDesk\PluginBuilder\Plugin\Hookable {
|
9 |
-
|
10 |
-
const ORDER_STATUS_COMPLETED = 'completed';
|
11 |
-
const FS_ORDER_COUNTER = 'flexible_shipping_rate_notice_counter';
|
12 |
-
const FS_METHOD = 'flexible_shipping';
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Hooks.
|
16 |
-
*/
|
17 |
-
public function hooks() {
|
18 |
-
add_action( 'woocommerce_order_status_changed', array( $this, 'count_order_for_fs_methods' ), 10, 4 );
|
19 |
-
}
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Count order.
|
23 |
-
*
|
24 |
-
* @param WC_Order $order .
|
25 |
-
*/
|
26 |
-
private function count_order( $order ) {
|
27 |
-
update_option( self::FS_ORDER_COUNTER, intval( get_option( self::FS_ORDER_COUNTER, '0' ) ) + 1 );
|
28 |
-
$order->update_meta_data( self::FS_ORDER_COUNTER, 1 );
|
29 |
-
$order->save();
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Count orders for FS methods.
|
34 |
-
*
|
35 |
-
* @param int $order_id Order ID.
|
36 |
-
* @param string $status_from Status from.
|
37 |
-
* @param string $status_to Status to.
|
38 |
-
* @param WC_Order $order Order.
|
39 |
-
*/
|
40 |
-
public function count_order_for_fs_methods( $order_id, $status_from, $status_to, $order ) {
|
41 |
-
if ( self::ORDER_STATUS_COMPLETED === $status_to ) {
|
42 |
-
$shipping_methods = $order->get_shipping_methods();
|
43 |
-
foreach ( $shipping_methods as $shipping_method ) {
|
44 |
-
if ( self::FS_METHOD === $shipping_method->get_method_id() ) {
|
45 |
-
if ( '' === $order->get_meta( self::FS_ORDER_COUNTER ) ) {
|
46 |
-
$this->count_order( $order );
|
47 |
-
}
|
48 |
-
}
|
49 |
-
}
|
50 |
-
}
|
51 |
-
}
|
52 |
-
|
53 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/wp-wpdesk-fs-shipment/rate-notices/{second-rate-notice.php → rate-notice-implementation.php}
RENAMED
@@ -2,11 +2,9 @@
|
|
2 |
|
3 |
namespace WPDesk\FS\Rate;
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
|
8 |
-
const SETTINGS_VARIANT_ID = 'notice_2';
|
9 |
-
|
10 |
/**
|
11 |
* Action links
|
12 |
*
|
@@ -56,7 +54,7 @@ class SecondRateNotice extends RateNotice
|
|
56 |
* @return string
|
57 |
*/
|
58 |
protected function get_message() {
|
59 |
-
$message = __( 'Awesome, you\'ve been using Flexible Shipping for more than 2 weeks. Could you please do me a BIG favor and give it a 5-star rating on WordPress? ~
|
60 |
$message .= '<br/>';
|
61 |
$message .= implode( ' | ', $this->action_links() );
|
62 |
return $message;
|
2 |
|
3 |
namespace WPDesk\FS\Rate;
|
4 |
|
5 |
+
class RateNoticeImplementation extends RateNotice
|
6 |
{
|
7 |
|
|
|
|
|
8 |
/**
|
9 |
* Action links
|
10 |
*
|
54 |
* @return string
|
55 |
*/
|
56 |
protected function get_message() {
|
57 |
+
$message = __( 'Awesome, you\'ve been using Flexible Shipping for more than 2 weeks. Could you please do me a BIG favor and give it a 5-star rating on WordPress? ~FS Team', 'flexible-shipping' );
|
58 |
$message .= '<br/>';
|
59 |
$message .= implode( ' | ', $this->action_links() );
|
60 |
return $message;
|
classes/wp-wpdesk-fs-shipment/rate-notices/rate-notices-creator.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\FS\Rate;
|
4 |
-
|
5 |
-
class RateNoticeCreator {
|
6 |
-
|
7 |
-
const SETTINGS_RATE_NOTICE_VARIANT_ID = 'flexible_shipping_rate_notice_variant_id';
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Create rate variant
|
11 |
-
*
|
12 |
-
* @param string $notice_id Variant ID.
|
13 |
-
*
|
14 |
-
* @return RateNoticeInterface;
|
15 |
-
*/
|
16 |
-
public function create( $variant ) {
|
17 |
-
switch( $variant ) {
|
18 |
-
case FirstRateNotice::SETTINGS_VARIANT_ID: return new FirstRateNotice(); break;
|
19 |
-
case SecondRateNotice::SETTINGS_VARIANT_ID: return new SecondRateNotice(); break;
|
20 |
-
case ThirdRateNotice::SETTINGS_VARIANT_ID: return new ThirdRateNotice(); break;
|
21 |
-
default: return new FirstRateNotice();
|
22 |
-
}
|
23 |
-
}
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/wp-wpdesk-fs-shipment/rate-notices/third-rate-notice.php
DELETED
@@ -1,63 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\FS\Rate;
|
4 |
-
|
5 |
-
class ThirdRateNotice extends RateNotice
|
6 |
-
{
|
7 |
-
|
8 |
-
const CLOSE_TEMPORARY_NOTICE = 'close-temporary-notice-number';
|
9 |
-
|
10 |
-
const SETTINGS_VARIANT_ID = 'notice_3';
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Action links
|
14 |
-
*
|
15 |
-
* @return array
|
16 |
-
*/
|
17 |
-
protected function action_links() {
|
18 |
-
$actions[] = sprintf(
|
19 |
-
__( '%1$sOk, you deserved it%2$s', 'flexible-shipping' ),
|
20 |
-
'<a target="_blank" href="' . esc_url( 'https://wpde.sk/fs-rate-3' ) . '">',
|
21 |
-
'</a>'
|
22 |
-
);
|
23 |
-
$actions[] = sprintf(
|
24 |
-
__( '%1$sNope, maybe later%2$s', 'flexible-shipping' ),
|
25 |
-
'<a data-type="number" class="fs close-temporary-notice notice-dismiss-link" data-source="' . self::CLOSE_TEMPORARY_NOTICE . '" href="#">',
|
26 |
-
'</a>'
|
27 |
-
);
|
28 |
-
$actions[] = sprintf(
|
29 |
-
__( '%1$sI already did%2$s', 'flexible-shipping' ),
|
30 |
-
'<a class="close-rate-notice notice-dismiss-link" data-source="already-did" href="#">',
|
31 |
-
'</a>'
|
32 |
-
);
|
33 |
-
|
34 |
-
return $actions;
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Should show message
|
39 |
-
*
|
40 |
-
* @return bool
|
41 |
-
*/
|
42 |
-
public function should_show_message() {
|
43 |
-
$total_orders = intval( get_option( Flexible_Shipping_Order_Counter::FS_ORDER_COUNTER, '0' ) );
|
44 |
-
if ( $total_orders >= 100 ) {
|
45 |
-
return true;
|
46 |
-
}
|
47 |
-
|
48 |
-
return false;
|
49 |
-
}
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Get rate message
|
53 |
-
*
|
54 |
-
* @return string
|
55 |
-
*/
|
56 |
-
protected function get_message() {
|
57 |
-
$message = __( 'Awesome, you just crossed the 100 orders on Flexible Shipping method. Could you please do me a BIG favor and give it a 5-star rating on WordPress? ~ Peter', 'flexible-shipping' );
|
58 |
-
$message .= '<br/>';
|
59 |
-
$message .= implode( ' | ', $this->action_links() );
|
60 |
-
return $message;
|
61 |
-
}
|
62 |
-
|
63 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/wp-wpdesk-fs-shipment/shipment/class-shipment.php
CHANGED
@@ -30,12 +30,14 @@ abstract class WPDesk_Flexible_Shipping_Shipment {
|
|
30 |
|
31 |
const LABEL_ACTION_DOWNLOAD = 'download';
|
32 |
const LABEL_ACTION_OPEN = 'open';
|
|
|
33 |
/**
|
34 |
* Logger provided by Flexible Shipping plugin.
|
35 |
*
|
36 |
* @var LoggerInterface
|
37 |
*/
|
38 |
protected static $fs_logger;
|
|
|
39 |
/**
|
40 |
* @var int
|
41 |
*/
|
30 |
|
31 |
const LABEL_ACTION_DOWNLOAD = 'download';
|
32 |
const LABEL_ACTION_OPEN = 'open';
|
33 |
+
|
34 |
/**
|
35 |
* Logger provided by Flexible Shipping plugin.
|
36 |
*
|
37 |
* @var LoggerInterface
|
38 |
*/
|
39 |
protected static $fs_logger;
|
40 |
+
|
41 |
/**
|
42 |
* @var int
|
43 |
*/
|
composer.lock
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
5 |
"This file is @generated automatically"
|
6 |
],
|
7 |
-
"content-hash": "
|
8 |
"packages": [
|
9 |
{
|
10 |
"name": "psr/log",
|
@@ -53,100 +53,6 @@
|
|
53 |
],
|
54 |
"time": "2020-03-23T09:12:05+00:00"
|
55 |
},
|
56 |
-
{
|
57 |
-
"name": "wpdesk/wp-builder",
|
58 |
-
"version": "1.4.4",
|
59 |
-
"source": {
|
60 |
-
"type": "git",
|
61 |
-
"url": "https://gitlab.com/wpdesk/wp-builder.git",
|
62 |
-
"reference": "e18df43bc3bc047c7bc0ed3e52eabb16118f4bc9"
|
63 |
-
},
|
64 |
-
"dist": {
|
65 |
-
"type": "zip",
|
66 |
-
"url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-builder/repository/archive.zip?sha=e18df43bc3bc047c7bc0ed3e52eabb16118f4bc9",
|
67 |
-
"reference": "e18df43bc3bc047c7bc0ed3e52eabb16118f4bc9",
|
68 |
-
"shasum": ""
|
69 |
-
},
|
70 |
-
"require": {
|
71 |
-
"php": ">=5.5"
|
72 |
-
},
|
73 |
-
"require-dev": {
|
74 |
-
"10up/wp_mock": "*",
|
75 |
-
"mockery/mockery": "*",
|
76 |
-
"phpunit/phpunit": "<7",
|
77 |
-
"squizlabs/php_codesniffer": "^3.0.2",
|
78 |
-
"wimg/php-compatibility": "^8",
|
79 |
-
"wp-coding-standards/wpcs": "^0.14.1"
|
80 |
-
},
|
81 |
-
"type": "library",
|
82 |
-
"autoload": {
|
83 |
-
"psr-4": {
|
84 |
-
"WPDesk\\PluginBuilder\\": "src/"
|
85 |
-
},
|
86 |
-
"classmap": [
|
87 |
-
"src/Plugin/WithoutNamespace"
|
88 |
-
]
|
89 |
-
},
|
90 |
-
"notification-url": "https://packagist.org/downloads/",
|
91 |
-
"authors": [
|
92 |
-
{
|
93 |
-
"name": "Krzysiek",
|
94 |
-
"email": "krzysiek@wpdesk.pl"
|
95 |
-
}
|
96 |
-
],
|
97 |
-
"time": "2020-06-17T08:00:07+00:00"
|
98 |
-
},
|
99 |
-
{
|
100 |
-
"name": "wpdesk/wp-pointer",
|
101 |
-
"version": "2.0.0",
|
102 |
-
"source": {
|
103 |
-
"type": "git",
|
104 |
-
"url": "https://gitlab.com/wpdesk/wp-pointer.git",
|
105 |
-
"reference": "2468b7f3412ba3dafbf3b8964b23ead89138102f"
|
106 |
-
},
|
107 |
-
"dist": {
|
108 |
-
"type": "zip",
|
109 |
-
"url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-pointer/repository/archive.zip?sha=2468b7f3412ba3dafbf3b8964b23ead89138102f",
|
110 |
-
"reference": "2468b7f3412ba3dafbf3b8964b23ead89138102f",
|
111 |
-
"shasum": ""
|
112 |
-
},
|
113 |
-
"require": {
|
114 |
-
"php": ">=5.5",
|
115 |
-
"wpdesk/wp-builder": "^1.1"
|
116 |
-
},
|
117 |
-
"require-dev": {
|
118 |
-
"10up/wp_mock": "*",
|
119 |
-
"mockery/mockery": "*",
|
120 |
-
"phpunit/phpunit": "<7",
|
121 |
-
"squizlabs/php_codesniffer": "^3.0.2",
|
122 |
-
"wimg/php-compatibility": "^8",
|
123 |
-
"wp-coding-standards/wpcs": "^0.14.1"
|
124 |
-
},
|
125 |
-
"type": "library",
|
126 |
-
"autoload": {
|
127 |
-
"psr-4": {
|
128 |
-
"WPDesk\\Pointer\\": "src/WPDesk/Pointer/"
|
129 |
-
}
|
130 |
-
},
|
131 |
-
"notification-url": "https://packagist.org/downloads/",
|
132 |
-
"license": [
|
133 |
-
"MIT"
|
134 |
-
],
|
135 |
-
"authors": [
|
136 |
-
{
|
137 |
-
"name": "grola",
|
138 |
-
"email": "grola@wpdesk.net"
|
139 |
-
}
|
140 |
-
],
|
141 |
-
"description": "Library for displaying Wordpress pointer messages.",
|
142 |
-
"homepage": "https://gitlab.com/wpdesk/wp-pointer",
|
143 |
-
"keywords": [
|
144 |
-
"admin",
|
145 |
-
"pointer",
|
146 |
-
"wordpress"
|
147 |
-
],
|
148 |
-
"time": "2020-07-14T15:33:40+00:00"
|
149 |
-
},
|
150 |
{
|
151 |
"name": "wpdesk/wp-wpdesk-helper-override",
|
152 |
"version": "1.1.0",
|
@@ -786,16 +692,16 @@
|
|
786 |
},
|
787 |
{
|
788 |
"name": "codeception/module-rest",
|
789 |
-
"version": "1.2.
|
790 |
"source": {
|
791 |
"type": "git",
|
792 |
"url": "https://github.com/Codeception/module-rest.git",
|
793 |
-
"reference": "
|
794 |
},
|
795 |
"dist": {
|
796 |
"type": "zip",
|
797 |
-
"url": "https://api.github.com/repos/Codeception/module-rest/zipball/
|
798 |
-
"reference": "
|
799 |
"shasum": ""
|
800 |
},
|
801 |
"require": {
|
@@ -833,7 +739,7 @@
|
|
833 |
"codeception",
|
834 |
"rest"
|
835 |
],
|
836 |
-
"time": "2020-
|
837 |
},
|
838 |
{
|
839 |
"name": "codeception/module-webdriver",
|
@@ -1071,16 +977,16 @@
|
|
1071 |
},
|
1072 |
{
|
1073 |
"name": "composer/composer",
|
1074 |
-
"version": "1.10.
|
1075 |
"source": {
|
1076 |
"type": "git",
|
1077 |
"url": "https://github.com/composer/composer.git",
|
1078 |
-
"reference": "
|
1079 |
},
|
1080 |
"dist": {
|
1081 |
"type": "zip",
|
1082 |
-
"url": "https://api.github.com/repos/composer/composer/zipball/
|
1083 |
-
"reference": "
|
1084 |
"shasum": ""
|
1085 |
},
|
1086 |
"require": {
|
@@ -1161,20 +1067,20 @@
|
|
1161 |
"type": "tidelift"
|
1162 |
}
|
1163 |
],
|
1164 |
-
"time": "2020-
|
1165 |
},
|
1166 |
{
|
1167 |
"name": "composer/semver",
|
1168 |
-
"version": "1.
|
1169 |
"source": {
|
1170 |
"type": "git",
|
1171 |
"url": "https://github.com/composer/semver.git",
|
1172 |
-
"reference": "
|
1173 |
},
|
1174 |
"dist": {
|
1175 |
"type": "zip",
|
1176 |
-
"url": "https://api.github.com/repos/composer/semver/zipball/
|
1177 |
-
"reference": "
|
1178 |
"shasum": ""
|
1179 |
},
|
1180 |
"require": {
|
@@ -1222,7 +1128,21 @@
|
|
1222 |
"validation",
|
1223 |
"versioning"
|
1224 |
],
|
1225 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1226 |
},
|
1227 |
{
|
1228 |
"name": "composer/spdx-licenses",
|
@@ -2238,16 +2158,16 @@
|
|
2238 |
},
|
2239 |
{
|
2240 |
"name": "lucatume/wp-browser",
|
2241 |
-
"version": "2.6.
|
2242 |
"source": {
|
2243 |
"type": "git",
|
2244 |
"url": "https://github.com/lucatume/wp-browser.git",
|
2245 |
-
"reference": "
|
2246 |
},
|
2247 |
"dist": {
|
2248 |
"type": "zip",
|
2249 |
-
"url": "https://api.github.com/repos/lucatume/wp-browser/zipball/
|
2250 |
-
"reference": "
|
2251 |
"shasum": ""
|
2252 |
},
|
2253 |
"require": {
|
@@ -2317,7 +2237,7 @@
|
|
2317 |
"codeception",
|
2318 |
"wordpress"
|
2319 |
],
|
2320 |
-
"time": "2020-
|
2321 |
},
|
2322 |
{
|
2323 |
"name": "matthiasmullie/minify",
|
@@ -8083,6 +8003,49 @@
|
|
8083 |
],
|
8084 |
"time": "2019-12-17T13:58:01+00:00"
|
8085 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8086 |
{
|
8087 |
"name": "wpdesk/wp-code-sniffer",
|
8088 |
"version": "1.0.1",
|
@@ -8488,6 +8451,57 @@
|
|
8488 |
],
|
8489 |
"time": "2020-05-06T10:17:53+00:00"
|
8490 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8491 |
{
|
8492 |
"name": "wpdesk/wp-view",
|
8493 |
"version": "1.1.0",
|
@@ -8530,16 +8544,16 @@
|
|
8530 |
},
|
8531 |
{
|
8532 |
"name": "wpdesk/wp-wpdesk-composer",
|
8533 |
-
"version": "2.8.
|
8534 |
"source": {
|
8535 |
"type": "git",
|
8536 |
"url": "https://gitlab.com/wpdesk/wp-wpdesk-composer.git",
|
8537 |
-
"reference": "
|
8538 |
},
|
8539 |
"dist": {
|
8540 |
"type": "zip",
|
8541 |
-
"url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-wpdesk-composer/repository/archive.zip?sha=
|
8542 |
-
"reference": "
|
8543 |
"shasum": ""
|
8544 |
},
|
8545 |
"require": {
|
@@ -8569,33 +8583,41 @@
|
|
8569 |
"email": "krzysiek@wpdesk.pl"
|
8570 |
}
|
8571 |
],
|
8572 |
-
"time": "2020-
|
8573 |
},
|
8574 |
{
|
8575 |
"name": "wpdesk/wp-wpdesk-fs-table-rate",
|
8576 |
-
"version": "2.
|
8577 |
"source": {
|
8578 |
"type": "git",
|
8579 |
"url": "https://gitlab.com/wpdesk/wp-wpdesk-fs-table-rate.git",
|
8580 |
-
"reference": "
|
8581 |
},
|
8582 |
"dist": {
|
8583 |
"type": "zip",
|
8584 |
-
"url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-wpdesk-fs-table-rate/repository/archive.zip?sha=
|
8585 |
-
"reference": "
|
8586 |
"shasum": ""
|
8587 |
},
|
8588 |
"require": {
|
8589 |
-
"php": ">=5.6"
|
|
|
|
|
|
|
8590 |
},
|
8591 |
"require-dev": {
|
8592 |
"10up/wp_mock": "^0.3",
|
8593 |
"mockery/mockery": "^1.2",
|
8594 |
-
"phpunit/phpunit": "<7"
|
8595 |
-
"squizlabs/php_codesniffer": "^3.4.2",
|
8596 |
-
"wp-coding-standards/wpcs": "^0.14.1"
|
8597 |
},
|
8598 |
"type": "library",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8599 |
"autoload": {
|
8600 |
"psr-4": {
|
8601 |
"WPDesk\\FS\\TableRate\\": "src/"
|
@@ -8612,7 +8634,7 @@
|
|
8612 |
"email": "grzegorz@wpdesk.net"
|
8613 |
}
|
8614 |
],
|
8615 |
-
"time": "2020-09-
|
8616 |
},
|
8617 |
{
|
8618 |
"name": "wpdesk/wp-wpdesk-helper",
|
4 |
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
5 |
"This file is @generated automatically"
|
6 |
],
|
7 |
+
"content-hash": "d920924048c76f2d20cc1646c227553c",
|
8 |
"packages": [
|
9 |
{
|
10 |
"name": "psr/log",
|
53 |
],
|
54 |
"time": "2020-03-23T09:12:05+00:00"
|
55 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
{
|
57 |
"name": "wpdesk/wp-wpdesk-helper-override",
|
58 |
"version": "1.1.0",
|
692 |
},
|
693 |
{
|
694 |
"name": "codeception/module-rest",
|
695 |
+
"version": "1.2.3",
|
696 |
"source": {
|
697 |
"type": "git",
|
698 |
"url": "https://github.com/Codeception/module-rest.git",
|
699 |
+
"reference": "63d09a1ed9fb9bb981d22396e7c2c7d20570f217"
|
700 |
},
|
701 |
"dist": {
|
702 |
"type": "zip",
|
703 |
+
"url": "https://api.github.com/repos/Codeception/module-rest/zipball/63d09a1ed9fb9bb981d22396e7c2c7d20570f217",
|
704 |
+
"reference": "63d09a1ed9fb9bb981d22396e7c2c7d20570f217",
|
705 |
"shasum": ""
|
706 |
},
|
707 |
"require": {
|
739 |
"codeception",
|
740 |
"rest"
|
741 |
],
|
742 |
+
"time": "2020-09-17T13:36:51+00:00"
|
743 |
},
|
744 |
{
|
745 |
"name": "codeception/module-webdriver",
|
977 |
},
|
978 |
{
|
979 |
"name": "composer/composer",
|
980 |
+
"version": "1.10.13",
|
981 |
"source": {
|
982 |
"type": "git",
|
983 |
"url": "https://github.com/composer/composer.git",
|
984 |
+
"reference": "47c841ba3b2d3fc0b4b13282cf029ea18b66d78b"
|
985 |
},
|
986 |
"dist": {
|
987 |
"type": "zip",
|
988 |
+
"url": "https://api.github.com/repos/composer/composer/zipball/47c841ba3b2d3fc0b4b13282cf029ea18b66d78b",
|
989 |
+
"reference": "47c841ba3b2d3fc0b4b13282cf029ea18b66d78b",
|
990 |
"shasum": ""
|
991 |
},
|
992 |
"require": {
|
1067 |
"type": "tidelift"
|
1068 |
}
|
1069 |
],
|
1070 |
+
"time": "2020-09-09T09:46:34+00:00"
|
1071 |
},
|
1072 |
{
|
1073 |
"name": "composer/semver",
|
1074 |
+
"version": "1.7.0",
|
1075 |
"source": {
|
1076 |
"type": "git",
|
1077 |
"url": "https://github.com/composer/semver.git",
|
1078 |
+
"reference": "114f819054a2ea7db03287f5efb757e2af6e4079"
|
1079 |
},
|
1080 |
"dist": {
|
1081 |
"type": "zip",
|
1082 |
+
"url": "https://api.github.com/repos/composer/semver/zipball/114f819054a2ea7db03287f5efb757e2af6e4079",
|
1083 |
+
"reference": "114f819054a2ea7db03287f5efb757e2af6e4079",
|
1084 |
"shasum": ""
|
1085 |
},
|
1086 |
"require": {
|
1128 |
"validation",
|
1129 |
"versioning"
|
1130 |
],
|
1131 |
+
"funding": [
|
1132 |
+
{
|
1133 |
+
"url": "https://packagist.com",
|
1134 |
+
"type": "custom"
|
1135 |
+
},
|
1136 |
+
{
|
1137 |
+
"url": "https://github.com/composer",
|
1138 |
+
"type": "github"
|
1139 |
+
},
|
1140 |
+
{
|
1141 |
+
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
|
1142 |
+
"type": "tidelift"
|
1143 |
+
}
|
1144 |
+
],
|
1145 |
+
"time": "2020-09-09T09:34:06+00:00"
|
1146 |
},
|
1147 |
{
|
1148 |
"name": "composer/spdx-licenses",
|
2158 |
},
|
2159 |
{
|
2160 |
"name": "lucatume/wp-browser",
|
2161 |
+
"version": "2.6.12",
|
2162 |
"source": {
|
2163 |
"type": "git",
|
2164 |
"url": "https://github.com/lucatume/wp-browser.git",
|
2165 |
+
"reference": "31c723b52a578dabd7cb31fe7dcc1518e0ee0778"
|
2166 |
},
|
2167 |
"dist": {
|
2168 |
"type": "zip",
|
2169 |
+
"url": "https://api.github.com/repos/lucatume/wp-browser/zipball/31c723b52a578dabd7cb31fe7dcc1518e0ee0778",
|
2170 |
+
"reference": "31c723b52a578dabd7cb31fe7dcc1518e0ee0778",
|
2171 |
"shasum": ""
|
2172 |
},
|
2173 |
"require": {
|
2237 |
"codeception",
|
2238 |
"wordpress"
|
2239 |
],
|
2240 |
+
"time": "2020-09-17T08:27:46+00:00"
|
2241 |
},
|
2242 |
{
|
2243 |
"name": "matthiasmullie/minify",
|
8003 |
],
|
8004 |
"time": "2019-12-17T13:58:01+00:00"
|
8005 |
},
|
8006 |
+
{
|
8007 |
+
"name": "wpdesk/wp-builder",
|
8008 |
+
"version": "1.4.4",
|
8009 |
+
"source": {
|
8010 |
+
"type": "git",
|
8011 |
+
"url": "https://gitlab.com/wpdesk/wp-builder.git",
|
8012 |
+
"reference": "e18df43bc3bc047c7bc0ed3e52eabb16118f4bc9"
|
8013 |
+
},
|
8014 |
+
"dist": {
|
8015 |
+
"type": "zip",
|
8016 |
+
"url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-builder/repository/archive.zip?sha=e18df43bc3bc047c7bc0ed3e52eabb16118f4bc9",
|
8017 |
+
"reference": "e18df43bc3bc047c7bc0ed3e52eabb16118f4bc9",
|
8018 |
+
"shasum": ""
|
8019 |
+
},
|
8020 |
+
"require": {
|
8021 |
+
"php": ">=5.5"
|
8022 |
+
},
|
8023 |
+
"require-dev": {
|
8024 |
+
"10up/wp_mock": "*",
|
8025 |
+
"mockery/mockery": "*",
|
8026 |
+
"phpunit/phpunit": "<7",
|
8027 |
+
"squizlabs/php_codesniffer": "^3.0.2",
|
8028 |
+
"wimg/php-compatibility": "^8",
|
8029 |
+
"wp-coding-standards/wpcs": "^0.14.1"
|
8030 |
+
},
|
8031 |
+
"type": "library",
|
8032 |
+
"autoload": {
|
8033 |
+
"psr-4": {
|
8034 |
+
"WPDesk\\PluginBuilder\\": "src/"
|
8035 |
+
},
|
8036 |
+
"classmap": [
|
8037 |
+
"src/Plugin/WithoutNamespace"
|
8038 |
+
]
|
8039 |
+
},
|
8040 |
+
"notification-url": "https://packagist.org/downloads/",
|
8041 |
+
"authors": [
|
8042 |
+
{
|
8043 |
+
"name": "Krzysiek",
|
8044 |
+
"email": "krzysiek@wpdesk.pl"
|
8045 |
+
}
|
8046 |
+
],
|
8047 |
+
"time": "2020-06-17T08:00:07+00:00"
|
8048 |
+
},
|
8049 |
{
|
8050 |
"name": "wpdesk/wp-code-sniffer",
|
8051 |
"version": "1.0.1",
|
8451 |
],
|
8452 |
"time": "2020-05-06T10:17:53+00:00"
|
8453 |
},
|
8454 |
+
{
|
8455 |
+
"name": "wpdesk/wp-pointer",
|
8456 |
+
"version": "2.0.0",
|
8457 |
+
"source": {
|
8458 |
+
"type": "git",
|
8459 |
+
"url": "https://gitlab.com/wpdesk/wp-pointer.git",
|
8460 |
+
"reference": "2468b7f3412ba3dafbf3b8964b23ead89138102f"
|
8461 |
+
},
|
8462 |
+
"dist": {
|
8463 |
+
"type": "zip",
|
8464 |
+
"url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-pointer/repository/archive.zip?sha=2468b7f3412ba3dafbf3b8964b23ead89138102f",
|
8465 |
+
"reference": "2468b7f3412ba3dafbf3b8964b23ead89138102f",
|
8466 |
+
"shasum": ""
|
8467 |
+
},
|
8468 |
+
"require": {
|
8469 |
+
"php": ">=5.5",
|
8470 |
+
"wpdesk/wp-builder": "^1.1"
|
8471 |
+
},
|
8472 |
+
"require-dev": {
|
8473 |
+
"10up/wp_mock": "*",
|
8474 |
+
"mockery/mockery": "*",
|
8475 |
+
"phpunit/phpunit": "<7",
|
8476 |
+
"squizlabs/php_codesniffer": "^3.0.2",
|
8477 |
+
"wimg/php-compatibility": "^8",
|
8478 |
+
"wp-coding-standards/wpcs": "^0.14.1"
|
8479 |
+
},
|
8480 |
+
"type": "library",
|
8481 |
+
"autoload": {
|
8482 |
+
"psr-4": {
|
8483 |
+
"WPDesk\\Pointer\\": "src/WPDesk/Pointer/"
|
8484 |
+
}
|
8485 |
+
},
|
8486 |
+
"notification-url": "https://packagist.org/downloads/",
|
8487 |
+
"license": [
|
8488 |
+
"MIT"
|
8489 |
+
],
|
8490 |
+
"authors": [
|
8491 |
+
{
|
8492 |
+
"name": "grola",
|
8493 |
+
"email": "grola@wpdesk.net"
|
8494 |
+
}
|
8495 |
+
],
|
8496 |
+
"description": "Library for displaying Wordpress pointer messages.",
|
8497 |
+
"homepage": "https://gitlab.com/wpdesk/wp-pointer",
|
8498 |
+
"keywords": [
|
8499 |
+
"admin",
|
8500 |
+
"pointer",
|
8501 |
+
"wordpress"
|
8502 |
+
],
|
8503 |
+
"time": "2020-07-14T15:33:40+00:00"
|
8504 |
+
},
|
8505 |
{
|
8506 |
"name": "wpdesk/wp-view",
|
8507 |
"version": "1.1.0",
|
8544 |
},
|
8545 |
{
|
8546 |
"name": "wpdesk/wp-wpdesk-composer",
|
8547 |
+
"version": "2.8.11",
|
8548 |
"source": {
|
8549 |
"type": "git",
|
8550 |
"url": "https://gitlab.com/wpdesk/wp-wpdesk-composer.git",
|
8551 |
+
"reference": "71f396e96e7a7008541ff9ce2c184ad4ff9122ac"
|
8552 |
},
|
8553 |
"dist": {
|
8554 |
"type": "zip",
|
8555 |
+
"url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-wpdesk-composer/repository/archive.zip?sha=71f396e96e7a7008541ff9ce2c184ad4ff9122ac",
|
8556 |
+
"reference": "71f396e96e7a7008541ff9ce2c184ad4ff9122ac",
|
8557 |
"shasum": ""
|
8558 |
},
|
8559 |
"require": {
|
8583 |
"email": "krzysiek@wpdesk.pl"
|
8584 |
}
|
8585 |
],
|
8586 |
+
"time": "2020-09-21T12:19:50+00:00"
|
8587 |
},
|
8588 |
{
|
8589 |
"name": "wpdesk/wp-wpdesk-fs-table-rate",
|
8590 |
+
"version": "2.2.1",
|
8591 |
"source": {
|
8592 |
"type": "git",
|
8593 |
"url": "https://gitlab.com/wpdesk/wp-wpdesk-fs-table-rate.git",
|
8594 |
+
"reference": "a36604ce3edf7fedd5398619044f0542835900e9"
|
8595 |
},
|
8596 |
"dist": {
|
8597 |
"type": "zip",
|
8598 |
+
"url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-wpdesk-fs-table-rate/repository/archive.zip?sha=a36604ce3edf7fedd5398619044f0542835900e9",
|
8599 |
+
"reference": "a36604ce3edf7fedd5398619044f0542835900e9",
|
8600 |
"shasum": ""
|
8601 |
},
|
8602 |
"require": {
|
8603 |
+
"php": ">=5.6",
|
8604 |
+
"psr/log": "^1.1",
|
8605 |
+
"wpdesk/wp-plugin-flow": "^2.7",
|
8606 |
+
"wpdesk/wp-view": "^1.1"
|
8607 |
},
|
8608 |
"require-dev": {
|
8609 |
"10up/wp_mock": "^0.3",
|
8610 |
"mockery/mockery": "^1.2",
|
8611 |
+
"phpunit/phpunit": "<7"
|
|
|
|
|
8612 |
},
|
8613 |
"type": "library",
|
8614 |
+
"extra": {
|
8615 |
+
"text-domain": "wp-wpdesk-fs-table-rate",
|
8616 |
+
"translations-folder": "lang",
|
8617 |
+
"po-files": {
|
8618 |
+
"pl_PL": "pl_PL.po"
|
8619 |
+
}
|
8620 |
+
},
|
8621 |
"autoload": {
|
8622 |
"psr-4": {
|
8623 |
"WPDesk\\FS\\TableRate\\": "src/"
|
8634 |
"email": "grzegorz@wpdesk.net"
|
8635 |
}
|
8636 |
],
|
8637 |
+
"time": "2020-09-22T17:43:38+00:00"
|
8638 |
},
|
8639 |
{
|
8640 |
"name": "wpdesk/wp-wpdesk-helper",
|
flexible-shipping.php
CHANGED
@@ -3,13 +3,13 @@
|
|
3 |
* Plugin Name: Flexible Shipping
|
4 |
* Plugin URI: https://wordpress.org/plugins/flexible-shipping/
|
5 |
* Description: Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.
|
6 |
-
* Version: 3.
|
7 |
* Author: WP Desk
|
8 |
* Author URI: https://www.wpdesk.net/
|
9 |
* Text Domain: flexible-shipping
|
10 |
* Domain Path: /lang/
|
11 |
* Requires at least: 4.9
|
12 |
-
* Tested up to: 5.5
|
13 |
* WC requires at least: 4.2
|
14 |
* WC tested up to: 4.5
|
15 |
* Requires PHP: 5.6
|
@@ -38,7 +38,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
38 |
} // Exit if accessed directly
|
39 |
|
40 |
/* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
|
41 |
-
$plugin_version = '3.
|
42 |
|
43 |
$plugin_name = 'Flexible Shipping';
|
44 |
$product_id = 'Flexible Shipping';
|
@@ -50,7 +50,6 @@ $plugin_dir = dirname( __FILE__ );
|
|
50 |
define( 'FLEXIBLE_SHIPPING_VERSION', $plugin_version );
|
51 |
define( $plugin_class_name, $plugin_version );
|
52 |
|
53 |
-
|
54 |
$requirements = array(
|
55 |
'php' => '5.6',
|
56 |
'wp' => '4.5',
|
3 |
* Plugin Name: Flexible Shipping
|
4 |
* Plugin URI: https://wordpress.org/plugins/flexible-shipping/
|
5 |
* Description: Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.
|
6 |
+
* Version: 3.14.0
|
7 |
* Author: WP Desk
|
8 |
* Author URI: https://www.wpdesk.net/
|
9 |
* Text Domain: flexible-shipping
|
10 |
* Domain Path: /lang/
|
11 |
* Requires at least: 4.9
|
12 |
+
* Tested up to: 5.5
|
13 |
* WC requires at least: 4.2
|
14 |
* WC tested up to: 4.5
|
15 |
* Requires PHP: 5.6
|
38 |
} // Exit if accessed directly
|
39 |
|
40 |
/* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
|
41 |
+
$plugin_version = '3.14.0';
|
42 |
|
43 |
$plugin_name = 'Flexible Shipping';
|
44 |
$product_id = 'Flexible Shipping';
|
50 |
define( 'FLEXIBLE_SHIPPING_VERSION', $plugin_version );
|
51 |
define( $plugin_class_name, $plugin_version );
|
52 |
|
|
|
53 |
$requirements = array(
|
54 |
'php' => '5.6',
|
55 |
'wp' => '4.5',
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: wpdesk,dyszczo,grola,piotrpo,marcinkolanko
|
|
3 |
Donate link: https://flexibleshipping.com/table-rate/
|
4 |
Tags: table rate, table rate shipping, conditional shipping, shipping method, woocommerce shipping, flexible shipping, woocommerce table rate shipping, cart based shipping, weight shipping, weight based shipping, totals based shipping, order based shipping, shipping zones, shipping classes, shipping, free shipping, advanced shipping
|
5 |
Requires at least: 4.5
|
6 |
-
Tested up to: 5.5
|
7 |
-
Stable tag: 3.
|
8 |
Requires PHP: 5.6
|
9 |
License: GPLv3 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -163,6 +163,15 @@ If you are upgrading from the old Flexible Shipping version (1.3.2, woo-flexible
|
|
163 |
|
164 |
== Changelog ==
|
165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
= 3.13.0 - 2020-09-09 =
|
167 |
* Removed tax calculation method notice
|
168 |
* Removed redundant shipments data
|
3 |
Donate link: https://flexibleshipping.com/table-rate/
|
4 |
Tags: table rate, table rate shipping, conditional shipping, shipping method, woocommerce shipping, flexible shipping, woocommerce table rate shipping, cart based shipping, weight shipping, weight based shipping, totals based shipping, order based shipping, shipping zones, shipping classes, shipping, free shipping, advanced shipping
|
5 |
Requires at least: 4.5
|
6 |
+
Tested up to: 5.5
|
7 |
+
Stable tag: 3.14.0
|
8 |
Requires PHP: 5.6
|
9 |
License: GPLv3 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
163 |
|
164 |
== Changelog ==
|
165 |
|
166 |
+
= 3.14.0 - 2020-09-28 =
|
167 |
+
* Added debug mode
|
168 |
+
* Fixed admin assets loading
|
169 |
+
* Fixed COD Enable for shipping methods
|
170 |
+
|
171 |
+
= 3.13.1 - 2020-09-14 =
|
172 |
+
* Removed AB test variants on plugin deactivation
|
173 |
+
* Removed test on rating notice
|
174 |
+
|
175 |
= 3.13.0 - 2020-09-09 =
|
176 |
* Removed tax calculation method notice
|
177 |
* Removed redundant shipments data
|
src/WPDesk/FS/TableRate/Debug/NoShippingMethodsNotice.php
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class NoShippingMethodNotice
|
4 |
+
*
|
5 |
+
* @package WPDesk\FS\TableRate\Debug
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace WPDesk\FS\TableRate\Debug;
|
9 |
+
|
10 |
+
use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Can display notice when no shipping methods are defined in shipping zone.
|
14 |
+
*/
|
15 |
+
class NoShippingMethodsNotice implements Hookable {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @var bool
|
19 |
+
*/
|
20 |
+
private $debug_mode_enabled;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* NoShippingMethodsNotice constructor.
|
24 |
+
*
|
25 |
+
* @param bool $debug_mode_enabled .
|
26 |
+
*/
|
27 |
+
public function __construct( $debug_mode_enabled ) {
|
28 |
+
$this->debug_mode_enabled = $debug_mode_enabled;
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Hooks.
|
33 |
+
*/
|
34 |
+
public function hooks() {
|
35 |
+
add_action( 'woocommerce_load_shipping_methods', array( $this, 'display_notice_if_needed_for_package' ) );
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* .
|
40 |
+
*
|
41 |
+
* @param array $package .
|
42 |
+
*/
|
43 |
+
public function display_notice_if_needed_for_package( $package ) {
|
44 |
+
if ( ! empty( $package ) && $this->debug_mode_enabled ) {
|
45 |
+
$shipping_zone = \WC_Shipping_Zones::get_zone_matching_package( $package );
|
46 |
+
$shipping_methods = $shipping_zone->get_shipping_methods( true );
|
47 |
+
if ( ! $this->zone_has_flexible_shipping( $shipping_methods ) ) {
|
48 |
+
$this->add_notice(
|
49 |
+
$shipping_zone->get_zone_name(),
|
50 |
+
admin_url( 'admin.php?page=wc-settings&tab=shipping&zone_id=' . $shipping_zone->get_id() )
|
51 |
+
);
|
52 |
+
} elseif ( ! $this->are_flexible_shipping_methods_defined( $shipping_methods ) ) {
|
53 |
+
$this->add_notice(
|
54 |
+
$shipping_zone->get_zone_name(),
|
55 |
+
admin_url( 'admin.php?page=wc-settings&tab=shipping&instance_id=' . $this->get_flexible_shipping_instance_id( $shipping_methods ) )
|
56 |
+
);
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* .
|
63 |
+
*
|
64 |
+
* @param string $zone_name .
|
65 |
+
* @param string $link_url .
|
66 |
+
*/
|
67 |
+
private function add_notice( $zone_name, $link_url ) {
|
68 |
+
wc_add_notice(
|
69 |
+
sprintf(
|
70 |
+
// Translators: shipping zone name and shipping method settings url.
|
71 |
+
__( 'No shipping method handled by Flexible Shipping found in the %1$s shipping zone. %2$sAdd shipping method →%3$s', 'flexible-shipping' ),
|
72 |
+
$zone_name,
|
73 |
+
'<a target="_blank" href="' . $link_url . '">',
|
74 |
+
'</a>'
|
75 |
+
),
|
76 |
+
'notice'
|
77 |
+
);
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* @param array $shipping_methods .
|
82 |
+
*
|
83 |
+
* @return bool
|
84 |
+
*/
|
85 |
+
private function zone_has_flexible_shipping( $shipping_methods ) {
|
86 |
+
foreach ( $shipping_methods as $shipping_method ) {
|
87 |
+
if ( $shipping_method instanceof \WPDesk_Flexible_Shipping ) {
|
88 |
+
return true;
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
return false;
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* @param array $shipping_methods .
|
97 |
+
*
|
98 |
+
* @return bool
|
99 |
+
*/
|
100 |
+
private function are_flexible_shipping_methods_defined( $shipping_methods ) {
|
101 |
+
foreach ( $shipping_methods as $shipping_method ) {
|
102 |
+
if ( $shipping_method instanceof \WPDesk_Flexible_Shipping ) {
|
103 |
+
$flexible_shipping_methods = $shipping_method->get_shipping_methods();
|
104 |
+
if ( count( $shipping_method->get_shipping_methods() ) ) {
|
105 |
+
return true;
|
106 |
+
}
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
return false;
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* @param array $shipping_methods .
|
115 |
+
*
|
116 |
+
* @return int
|
117 |
+
*/
|
118 |
+
private function get_flexible_shipping_instance_id( $shipping_methods ) {
|
119 |
+
foreach ( $shipping_methods as $shipping_method ) {
|
120 |
+
if ( $shipping_method instanceof \WPDesk_Flexible_Shipping ) {
|
121 |
+
return $shipping_method->get_instance_id();
|
122 |
+
}
|
123 |
+
}
|
124 |
+
|
125 |
+
return 0;
|
126 |
+
}
|
127 |
+
|
128 |
+
}
|
src/WPDesk/FS/TableRate/Debug/Tracker.php
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class Tracker
|
4 |
+
*
|
5 |
+
* @package WPDesk\FS\TableRate\Debug
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace WPDesk\FS\TableRate\Debug;
|
9 |
+
|
10 |
+
use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Can handle tracker data related to debug mode.
|
14 |
+
*/
|
15 |
+
class Tracker implements Hookable {
|
16 |
+
|
17 |
+
const NOTICE_OPTION_NAME = 'flexible_shipping_debug_notice_added';
|
18 |
+
const NOTICE_OPTION_VALUE = 1;
|
19 |
+
|
20 |
+
const SETTINGS_OPTION_NAME = 'flexible_shipping_debug_was_enabled';
|
21 |
+
const SETTINGS_OPTION_VALUE = 1;
|
22 |
+
|
23 |
+
const PRIORITY_AFTER_FS_TRACKER = 12;
|
24 |
+
|
25 |
+
const ADDITIONAL_DATA = 'additional_data';
|
26 |
+
|
27 |
+
const METHOD_DEBUG_MODE = 'method_debug_mode';
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Hooks.
|
31 |
+
*/
|
32 |
+
public function hooks() {
|
33 |
+
add_filter( 'flexible_shipping_process_admin_options', array( $this, 'update_settings_option_if_not_set_and_debug_enabled' ) );
|
34 |
+
|
35 |
+
add_action( 'flexible_shipping_debug_notice_added', array( $this, 'update_notice_option_if_not_set' ) );
|
36 |
+
|
37 |
+
add_filter( 'wpdesk_tracker_data', array( $this, 'append_debug_notice_data_to_tracker' ), self::PRIORITY_AFTER_FS_TRACKER );
|
38 |
+
add_filter( 'wpdesk_tracker_deactivation_data', array( $this, 'append_debug_notice_data_to_deactivation_tracker' ) );
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Update option when debug is enabled and option not set.
|
43 |
+
*
|
44 |
+
* @param array $shipping_method_settings .
|
45 |
+
*
|
46 |
+
* @return array
|
47 |
+
*/
|
48 |
+
public function update_settings_option_if_not_set_and_debug_enabled( $shipping_method_settings ) {
|
49 |
+
if ( isset( $shipping_method_settings[ self::METHOD_DEBUG_MODE ] ) && 'yes' === $shipping_method_settings[ self::METHOD_DEBUG_MODE ]
|
50 |
+
&& self::SETTINGS_OPTION_VALUE !== (int) get_option( self::SETTINGS_OPTION_NAME, 0 )
|
51 |
+
) {
|
52 |
+
update_option( self::SETTINGS_OPTION_NAME, self::SETTINGS_OPTION_VALUE );
|
53 |
+
}
|
54 |
+
return $shipping_method_settings;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Update option when notice is added.
|
59 |
+
*
|
60 |
+
* @internal
|
61 |
+
*/
|
62 |
+
public function update_notice_option_if_not_set() {
|
63 |
+
if ( self::NOTICE_OPTION_VALUE !== (int) get_option( self::NOTICE_OPTION_NAME, 0 ) ) {
|
64 |
+
update_option( self::NOTICE_OPTION_NAME, self::NOTICE_OPTION_VALUE );
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Append debug notice dara to tracker.
|
70 |
+
*
|
71 |
+
* @param array $data .
|
72 |
+
*
|
73 |
+
* @return array
|
74 |
+
*
|
75 |
+
* @internal
|
76 |
+
*/
|
77 |
+
public function append_debug_notice_data_to_tracker( $data ) {
|
78 |
+
$data['flexible_shipping']['debug_notice_was_enabled'] = self::SETTINGS_OPTION_VALUE === (int) get_option( self::SETTINGS_OPTION_NAME, 0 ) ? 'yes' : 'no';
|
79 |
+
$data['flexible_shipping']['debug_notice_displayed'] = self::NOTICE_OPTION_VALUE === (int) get_option( self::NOTICE_OPTION_NAME, 0 ) ? 'yes' : 'no';
|
80 |
+
|
81 |
+
return $data;
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Set new rules table data to data array.
|
86 |
+
*
|
87 |
+
* @param array $data Data.
|
88 |
+
*
|
89 |
+
* @return array
|
90 |
+
*
|
91 |
+
* @internal
|
92 |
+
*/
|
93 |
+
public function append_debug_notice_data_to_deactivation_tracker( array $data ) {
|
94 |
+
if ( empty( $data[ self::ADDITIONAL_DATA ] ) || ! is_array( $data[ self::ADDITIONAL_DATA ] ) ) {
|
95 |
+
$data[ self::ADDITIONAL_DATA ] = array();
|
96 |
+
}
|
97 |
+
$data[ self::ADDITIONAL_DATA ]['fs_debug_notice_was_enabled'] = self::SETTINGS_OPTION_VALUE === (int) get_option( self::SETTINGS_OPTION_NAME, 0 ) ? 'yes' : 'no';
|
98 |
+
$data[ self::ADDITIONAL_DATA ]['fs_debug_notice_displayed'] = self::NOTICE_OPTION_VALUE === (int) get_option( self::NOTICE_OPTION_NAME, 0 ) ? 'yes' : 'no';
|
99 |
+
|
100 |
+
return $data;
|
101 |
+
}
|
102 |
+
|
103 |
+
}
|
src/WPDesk/FS/TableRate/NewRulesTableDeactivationTracker.php
CHANGED
@@ -36,7 +36,7 @@ class NewRulesTableDeactivationTracker implements Hookable {
|
|
36 |
* @return array
|
37 |
*/
|
38 |
public function append_new_rules_table_data_to_deactivation_tracker( array $data ) {
|
39 |
-
if ( empty( $data[ self::ADDITIONAL_DATA ] ) || is_array( $data[ self::ADDITIONAL_DATA ] ) ) {
|
40 |
$data[ self::ADDITIONAL_DATA ] = array();
|
41 |
}
|
42 |
$data[ self::ADDITIONAL_DATA ]['fs_new_rules_table_v2'] = ( new NewRulesTableTrackerData() )->get_data();
|
36 |
* @return array
|
37 |
*/
|
38 |
public function append_new_rules_table_data_to_deactivation_tracker( array $data ) {
|
39 |
+
if ( empty( $data[ self::ADDITIONAL_DATA ] ) || ! is_array( $data[ self::ADDITIONAL_DATA ] ) ) {
|
40 |
$data[ self::ADDITIONAL_DATA ] = array();
|
41 |
}
|
42 |
$data[ self::ADDITIONAL_DATA ]['fs_new_rules_table_v2'] = ( new NewRulesTableTrackerData() )->get_data();
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit9c4619ba18f465b5d2d0661bac445811::getLoader();
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -122,6 +122,25 @@ return array(
|
|
122 |
'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunCodeceptionTests' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunCodeceptionTests.php',
|
123 |
'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\SedTrait' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/SedTrait.php',
|
124 |
'FSVendor\\WPDesk\\Composer\\Codeception\\Plugin' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Plugin.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
'FSVendor\\WPDesk\\FS\\TableRate\\Weight\\Rounding' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Weight/Rounding.php',
|
126 |
'FSVendor\\WPDesk\\Helper\\Debug\\LibraryDebug' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-helper/src/Debug/LibraryDebug.php',
|
127 |
'FSVendor\\WPDesk\\Helper\\HelperRemoveInfo' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-helper/src/HelperRemoveNotice.php',
|
@@ -303,15 +322,13 @@ return array(
|
|
303 |
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
304 |
'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
|
305 |
'WPDesk\\FS\\Helpers\\ShippingMethod' => $baseDir . '/src/WPDesk/FS/Helpers/ShippingMethod.php',
|
306 |
-
'WPDesk\\FS\\Rate\\FirstRateNotice' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rate-notices/first-rate-notice.php',
|
307 |
-
'WPDesk\\FS\\Rate\\Flexible_Shipping_Order_Counter' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rate-notices/order-counter.php',
|
308 |
'WPDesk\\FS\\Rate\\RateNotice' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rate-notices/abstract-rate.php',
|
309 |
-
'WPDesk\\FS\\Rate\\
|
310 |
'WPDesk\\FS\\Rate\\RateNoticeInterface' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rate-notices/interface-rate.php',
|
311 |
-
'WPDesk\\FS\\Rate\\SecondRateNotice' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rate-notices/second-rate-notice.php',
|
312 |
-
'WPDesk\\FS\\Rate\\ThirdRateNotice' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rate-notices/third-rate-notice.php',
|
313 |
'WPDesk\\FS\\Rate\\WPDesk_Flexible_Shipping_Rate_Notice' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rate-notice.php',
|
314 |
'WPDesk\\FS\\TableRate\\ContextualInfo\\Creator' => $baseDir . '/src/WPDesk/FS/TableRate/ContextualInfo/Creator.php',
|
|
|
|
|
315 |
'WPDesk\\FS\\TableRate\\FreeShipping\\FreeShippingNotice' => $baseDir . '/src/WPDesk/FS/TableRate/FreeShipping/FreeShippingNotice.php',
|
316 |
'WPDesk\\FS\\TableRate\\FreeShipping\\FreeShippingNoticeGenerator' => $baseDir . '/src/WPDesk/FS/TableRate/FreeShipping/FreeShippingNoticeGenerator.php',
|
317 |
'WPDesk\\FS\\TableRate\\NewRulesTableBanner\\RulesBannerClickedOption' => $baseDir . '/src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesBannerClickedOption.php',
|
@@ -329,48 +346,13 @@ return array(
|
|
329 |
'WPDesk\\FS\\TableRate\\RulesSettingsField' => $baseDir . '/src/WPDesk/FS/TableRate/RulesSettingsField.php',
|
330 |
'WPDesk\\FS\\TableRate\\UserFeedback' => $baseDir . '/src/WPDesk/FS/TableRate/UserFeedback.php',
|
331 |
'WPDesk\\Helper\\HelperAsLibrary' => $vendorDir . '/wpdesk/wp-wpdesk-helper-override/src/Helper/HelperAsLibrary.php',
|
332 |
-
'WPDesk\\PluginBuilder\\BuildDirector\\LegacyBuildDirector' => $vendorDir . '/wpdesk/wp-builder/src/BuildDirector/LegacyBuildDirector.php',
|
333 |
-
'WPDesk\\PluginBuilder\\Builder\\AbstractBuilder' => $vendorDir . '/wpdesk/wp-builder/src/Builder/AbstractBuilder.php',
|
334 |
-
'WPDesk\\PluginBuilder\\Builder\\InfoActivationBuilder' => $vendorDir . '/wpdesk/wp-builder/src/Builder/InfoActivationBuilder.php',
|
335 |
-
'WPDesk\\PluginBuilder\\Builder\\InfoBuilder' => $vendorDir . '/wpdesk/wp-builder/src/Builder/InfoBuilder.php',
|
336 |
-
'WPDesk\\PluginBuilder\\Plugin\\AbstractPlugin' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/AbstractPlugin.php',
|
337 |
-
'WPDesk\\PluginBuilder\\Plugin\\Activateable' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/Activateable.php',
|
338 |
-
'WPDesk\\PluginBuilder\\Plugin\\ActivationAware' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/ActivationAware.php',
|
339 |
-
'WPDesk\\PluginBuilder\\Plugin\\ActivationTracker' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/ActivationTracker.php',
|
340 |
-
'WPDesk\\PluginBuilder\\Plugin\\Conditional' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/Conditional.php',
|
341 |
-
'WPDesk\\PluginBuilder\\Plugin\\Deactivateable' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/Deactivateable.php',
|
342 |
-
'WPDesk\\PluginBuilder\\Plugin\\Hookable' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/Hookable.php',
|
343 |
-
'WPDesk\\PluginBuilder\\Plugin\\HookableCollection' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/HookableCollection.php',
|
344 |
-
'WPDesk\\PluginBuilder\\Plugin\\HookableParent' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/HookableParent.php',
|
345 |
-
'WPDesk\\PluginBuilder\\Plugin\\HookablePluginDependant' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/HookablePluginDependant.php',
|
346 |
-
'WPDesk\\PluginBuilder\\Plugin\\PluginAccess' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/PluginAccess.php',
|
347 |
-
'WPDesk\\PluginBuilder\\Plugin\\SlimPlugin' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/SlimPlugin.php',
|
348 |
-
'WPDesk\\PluginBuilder\\Plugin\\TemplateLoad' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/TemplateLoad.php',
|
349 |
-
'WPDesk\\PluginBuilder\\Storage\\Exception\\ClassAlreadyExists' => $vendorDir . '/wpdesk/wp-builder/src/Storage/Exception/ClassAlreadyExists.php',
|
350 |
-
'WPDesk\\PluginBuilder\\Storage\\Exception\\ClassNotExists' => $vendorDir . '/wpdesk/wp-builder/src/Storage/Exception/ClassNotExists.php',
|
351 |
-
'WPDesk\\PluginBuilder\\Storage\\PluginStorage' => $vendorDir . '/wpdesk/wp-builder/src/Storage/PluginStorage.php',
|
352 |
-
'WPDesk\\PluginBuilder\\Storage\\StaticStorage' => $vendorDir . '/wpdesk/wp-builder/src/Storage/StaticStorage.php',
|
353 |
-
'WPDesk\\PluginBuilder\\Storage\\StorageFactory' => $vendorDir . '/wpdesk/wp-builder/src/Storage/StorageFactory.php',
|
354 |
-
'WPDesk\\PluginBuilder\\Storage\\WordpressFilterStorage' => $vendorDir . '/wpdesk/wp-builder/src/Storage/WordpressFilterStorage.php',
|
355 |
-
'WPDesk\\Pointer\\PointerConditions' => $vendorDir . '/wpdesk/wp-pointer/src/WPDesk/Pointer/PointerConditions.php',
|
356 |
-
'WPDesk\\Pointer\\PointerMessage' => $vendorDir . '/wpdesk/wp-pointer/src/WPDesk/Pointer/PointerMessage.php',
|
357 |
-
'WPDesk\\Pointer\\PointerPosition' => $vendorDir . '/wpdesk/wp-pointer/src/WPDesk/Pointer/PointerPosition.php',
|
358 |
-
'WPDesk\\Pointer\\PointersScripts' => $vendorDir . '/wpdesk/wp-pointer/src/WPDesk/Pointer/PointersScripts.php',
|
359 |
-
'WPDesk_Buildable' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Buildable.php',
|
360 |
'WPDesk_Flexible_Shipping' => $baseDir . '/classes/table-rate/shipping-method.php',
|
361 |
-
'WPDesk_Flexible_Shipping_AB_Deactivation_Contact_Information' => $baseDir . '/classes/table-rate/abtests/class-ab-deactivation-contact-information.php',
|
362 |
-
'WPDesk_Flexible_Shipping_AB_Tracker_Deactivation_Data' => $baseDir . '/classes/table-rate/abtests/class-ab-tracker-deactivation-data.php',
|
363 |
-
'WPDesk_Flexible_Shipping_AB_Variant_Old' => $baseDir . '/classes/table-rate/abtests/ab-deactivation-contact-information-test/class-ab-variant-old.php',
|
364 |
-
'WPDesk_Flexible_Shipping_AB_Variant_With_Contact_Information_Button' => $baseDir . '/classes/table-rate/abtests/ab-deactivation-contact-information-test/class-ab-variant-with-contact-information-button.php',
|
365 |
-
'WPDesk_Flexible_Shipping_AB_Variant_With_Contact_Information_On_Bottom' => $baseDir . '/classes/table-rate/abtests/ab-deactivation-contact-information-test/class-ab-variant-with-contact-information-on-bottom.php',
|
366 |
-
'WPDesk_Flexible_Shipping_AB_Variant_With_Contact_Information_On_Top' => $baseDir . '/classes/table-rate/abtests/ab-deactivation-contact-information-test/class-ab-variant-with-contact-information-on-top.php',
|
367 |
'WPDesk_Flexible_Shipping_Add_Shipping' => $baseDir . '/classes/wp-wpdesk-fs-shipment/class-order-add-shipping.php',
|
368 |
'WPDesk_Flexible_Shipping_Admin_Notices' => $baseDir . '/classes/wp-wpdesk-fs-shipment/admin-notices.php',
|
369 |
'WPDesk_Flexible_Shipping_Bulk_Actions' => $baseDir . '/classes/table-rate/bulk-actions.php',
|
370 |
'WPDesk_Flexible_Shipping_Cancel_Shipment_Exception' => $baseDir . '/classes/wp-wpdesk-fs-shipment/exception/class-cancel-shipment-exception.php',
|
371 |
'WPDesk_Flexible_Shipping_Csv_Importer' => $baseDir . '/classes/table-rate/csv/class-wpdesk-flexible-shipping-csv-importer.php',
|
372 |
'WPDesk_Flexible_Shipping_Csv_Importer_Exception' => $baseDir . '/classes/table-rate/csv/class-csv-importer-exception.php',
|
373 |
-
'WPDesk_Flexible_Shipping_Deactivation_Thickbox_Factory' => $baseDir . '/classes/table-rate/abtests/class-deactivation-thickbox-factory.php',
|
374 |
'WPDesk_Flexible_Shipping_Export' => $baseDir . '/classes/table-rate/csv/flexible-shipping-export.php',
|
375 |
'WPDesk_Flexible_Shipping_Get_Label_Exception' => $baseDir . '/classes/wp-wpdesk-fs-shipment/exception/class-get-label-exception.php',
|
376 |
'WPDesk_Flexible_Shipping_Integration_Label_Builder' => $baseDir . '/classes/wp-wpdesk-fs-shipment/label/class-integration-label-builder.php',
|
@@ -409,12 +391,8 @@ return array(
|
|
409 |
'WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_File_Exception' => $baseDir . '/classes/wp-wpdesk-fs-shipment/exception/class-shipment-unable-to-create-tmp-file-exception.php',
|
410 |
'WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_Zip_File_Exception' => $baseDir . '/classes/wp-wpdesk-fs-shipment/exception/class-shipment-unable-to-create-tmp-zip-file-exception.php',
|
411 |
'WPDesk_Flexible_Shipping_WooCommerce_Context_Logger' => $baseDir . '/classes/table-rate/logger/class-woocommerce-context-logger.php',
|
412 |
-
'WPDesk_Has_Plugin_Info' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Has_Plugin_Info.php',
|
413 |
-
'WPDesk_Plugin_Info' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Plugin_Info.php',
|
414 |
'WPDesk_Tracker_Data_Provider' => $vendorDir . '/wpdesk/wp-wpdesk-helper-override/src/Interop/Tracker/class-wpdesk-tracker-data-provider.php',
|
415 |
'WPDesk_Tracker_Factory' => $vendorDir . '/wpdesk/wp-wpdesk-helper-override/src/Helper/TrackerFactory.php',
|
416 |
'WPDesk_Tracker_Interface' => $vendorDir . '/wpdesk/wp-wpdesk-helper-override/src/Interop/Tracker/class-wpdesk-tracker-interface.php',
|
417 |
'WPDesk_Tracker_Sender' => $vendorDir . '/wpdesk/wp-wpdesk-helper-override/src/Interop/Tracker/class-wpdesk-tracker-sender.php',
|
418 |
-
'WPDesk_Translable' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Translable.php',
|
419 |
-
'WPDesk_Translatable' => $vendorDir . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Translatable.php',
|
420 |
);
|
122 |
'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunCodeceptionTests' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunCodeceptionTests.php',
|
123 |
'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\SedTrait' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/SedTrait.php',
|
124 |
'FSVendor\\WPDesk\\Composer\\Codeception\\Plugin' => $baseDir . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Plugin.php',
|
125 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\AbstractOptions' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/AbstractOptions.php',
|
126 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\BasedOnOptions' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/BasedOnOptions.php',
|
127 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\CalculationMethodOptions' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/CalculationMethodOptions.php',
|
128 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Logger\\ArrayLogger' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/ArrayLogger.php',
|
129 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Logger\\Assets' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/Assets.php',
|
130 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Logger\\CanFormatForLog' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/CanFormatForLog.php',
|
131 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Logger\\NoticeLogger' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/NoticeLogger.php',
|
132 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Logger\\ShippingMethodLogger' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/ShippingMethodLogger.php',
|
133 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\CheckboxValue' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/CheckboxValue.php',
|
134 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\IntegrationSettings' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/IntegrationSettings.php',
|
135 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\IntegrationSettingsFactory' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/IntegrationSettingsFactory.php',
|
136 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\IntegrationSettingsImplementation' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/IntegrationSettingsImplementation.php',
|
137 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\MethodSettings' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/MethodSettings.php',
|
138 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\MethodSettingsFactory' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/MethodSettingsFactory.php',
|
139 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\MethodSettingsImplementation' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/MethodSettingsImplementation.php',
|
140 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\RuleSettings' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/RuleSettings.php',
|
141 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\RuleSettingsFactory' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/RuleSettingsFactory.php',
|
142 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\RuleSettingsImplementation' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/RuleSettingsImplementation.php',
|
143 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\RulesSettingsFactory' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/RulesSettingsFactory.php',
|
144 |
'FSVendor\\WPDesk\\FS\\TableRate\\Weight\\Rounding' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Weight/Rounding.php',
|
145 |
'FSVendor\\WPDesk\\Helper\\Debug\\LibraryDebug' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-helper/src/Debug/LibraryDebug.php',
|
146 |
'FSVendor\\WPDesk\\Helper\\HelperRemoveInfo' => $baseDir . '/vendor_prefixed/wpdesk/wp-wpdesk-helper/src/HelperRemoveNotice.php',
|
322 |
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
323 |
'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
|
324 |
'WPDesk\\FS\\Helpers\\ShippingMethod' => $baseDir . '/src/WPDesk/FS/Helpers/ShippingMethod.php',
|
|
|
|
|
325 |
'WPDesk\\FS\\Rate\\RateNotice' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rate-notices/abstract-rate.php',
|
326 |
+
'WPDesk\\FS\\Rate\\RateNoticeImplementation' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rate-notices/rate-notice-implementation.php',
|
327 |
'WPDesk\\FS\\Rate\\RateNoticeInterface' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rate-notices/interface-rate.php',
|
|
|
|
|
328 |
'WPDesk\\FS\\Rate\\WPDesk_Flexible_Shipping_Rate_Notice' => $baseDir . '/classes/wp-wpdesk-fs-shipment/rate-notice.php',
|
329 |
'WPDesk\\FS\\TableRate\\ContextualInfo\\Creator' => $baseDir . '/src/WPDesk/FS/TableRate/ContextualInfo/Creator.php',
|
330 |
+
'WPDesk\\FS\\TableRate\\Debug\\NoShippingMethodsNotice' => $baseDir . '/src/WPDesk/FS/TableRate/Debug/NoShippingMethodsNotice.php',
|
331 |
+
'WPDesk\\FS\\TableRate\\Debug\\Tracker' => $baseDir . '/src/WPDesk/FS/TableRate/Debug/Tracker.php',
|
332 |
'WPDesk\\FS\\TableRate\\FreeShipping\\FreeShippingNotice' => $baseDir . '/src/WPDesk/FS/TableRate/FreeShipping/FreeShippingNotice.php',
|
333 |
'WPDesk\\FS\\TableRate\\FreeShipping\\FreeShippingNoticeGenerator' => $baseDir . '/src/WPDesk/FS/TableRate/FreeShipping/FreeShippingNoticeGenerator.php',
|
334 |
'WPDesk\\FS\\TableRate\\NewRulesTableBanner\\RulesBannerClickedOption' => $baseDir . '/src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesBannerClickedOption.php',
|
346 |
'WPDesk\\FS\\TableRate\\RulesSettingsField' => $baseDir . '/src/WPDesk/FS/TableRate/RulesSettingsField.php',
|
347 |
'WPDesk\\FS\\TableRate\\UserFeedback' => $baseDir . '/src/WPDesk/FS/TableRate/UserFeedback.php',
|
348 |
'WPDesk\\Helper\\HelperAsLibrary' => $vendorDir . '/wpdesk/wp-wpdesk-helper-override/src/Helper/HelperAsLibrary.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
349 |
'WPDesk_Flexible_Shipping' => $baseDir . '/classes/table-rate/shipping-method.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
350 |
'WPDesk_Flexible_Shipping_Add_Shipping' => $baseDir . '/classes/wp-wpdesk-fs-shipment/class-order-add-shipping.php',
|
351 |
'WPDesk_Flexible_Shipping_Admin_Notices' => $baseDir . '/classes/wp-wpdesk-fs-shipment/admin-notices.php',
|
352 |
'WPDesk_Flexible_Shipping_Bulk_Actions' => $baseDir . '/classes/table-rate/bulk-actions.php',
|
353 |
'WPDesk_Flexible_Shipping_Cancel_Shipment_Exception' => $baseDir . '/classes/wp-wpdesk-fs-shipment/exception/class-cancel-shipment-exception.php',
|
354 |
'WPDesk_Flexible_Shipping_Csv_Importer' => $baseDir . '/classes/table-rate/csv/class-wpdesk-flexible-shipping-csv-importer.php',
|
355 |
'WPDesk_Flexible_Shipping_Csv_Importer_Exception' => $baseDir . '/classes/table-rate/csv/class-csv-importer-exception.php',
|
|
|
356 |
'WPDesk_Flexible_Shipping_Export' => $baseDir . '/classes/table-rate/csv/flexible-shipping-export.php',
|
357 |
'WPDesk_Flexible_Shipping_Get_Label_Exception' => $baseDir . '/classes/wp-wpdesk-fs-shipment/exception/class-get-label-exception.php',
|
358 |
'WPDesk_Flexible_Shipping_Integration_Label_Builder' => $baseDir . '/classes/wp-wpdesk-fs-shipment/label/class-integration-label-builder.php',
|
391 |
'WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_File_Exception' => $baseDir . '/classes/wp-wpdesk-fs-shipment/exception/class-shipment-unable-to-create-tmp-file-exception.php',
|
392 |
'WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_Zip_File_Exception' => $baseDir . '/classes/wp-wpdesk-fs-shipment/exception/class-shipment-unable-to-create-tmp-zip-file-exception.php',
|
393 |
'WPDesk_Flexible_Shipping_WooCommerce_Context_Logger' => $baseDir . '/classes/table-rate/logger/class-woocommerce-context-logger.php',
|
|
|
|
|
394 |
'WPDesk_Tracker_Data_Provider' => $vendorDir . '/wpdesk/wp-wpdesk-helper-override/src/Interop/Tracker/class-wpdesk-tracker-data-provider.php',
|
395 |
'WPDesk_Tracker_Factory' => $vendorDir . '/wpdesk/wp-wpdesk-helper-override/src/Helper/TrackerFactory.php',
|
396 |
'WPDesk_Tracker_Interface' => $vendorDir . '/wpdesk/wp-wpdesk-helper-override/src/Interop/Tracker/class-wpdesk-tracker-interface.php',
|
397 |
'WPDesk_Tracker_Sender' => $vendorDir . '/wpdesk/wp-wpdesk-helper-override/src/Interop/Tracker/class-wpdesk-tracker-sender.php',
|
|
|
|
|
398 |
);
|
vendor/composer/autoload_psr4.php
CHANGED
@@ -6,8 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
|
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
9 |
-
'WPDesk\\Pointer\\' => array($vendorDir . '/wpdesk/wp-pointer/src/WPDesk/Pointer'),
|
10 |
-
'WPDesk\\PluginBuilder\\' => array($vendorDir . '/wpdesk/wp-builder/src'),
|
11 |
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
12 |
'' => array($baseDir . '/src'),
|
13 |
);
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
|
|
|
|
9 |
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
10 |
'' => array($baseDir . '/src'),
|
11 |
);
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit0064257423e0b8f8962fac51c2e3ce79
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit9c4619ba18f465b5d2d0661bac445811
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit9c4619ba18f465b5d2d0661bac445811', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit9c4619ba18f465b5d2d0661bac445811', 'loadClassLoader'));
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit9c4619ba18f465b5d2d0661bac445811::getInitializer($loader));
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,14 +4,9 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
-
'W' =>
|
11 |
-
array (
|
12 |
-
'WPDesk\\Pointer\\' => 15,
|
13 |
-
'WPDesk\\PluginBuilder\\' => 21,
|
14 |
-
),
|
15 |
'P' =>
|
16 |
array (
|
17 |
'Psr\\Log\\' => 8,
|
@@ -19,14 +14,6 @@ class ComposerStaticInit0064257423e0b8f8962fac51c2e3ce79
|
|
19 |
);
|
20 |
|
21 |
public static $prefixDirsPsr4 = array (
|
22 |
-
'WPDesk\\Pointer\\' =>
|
23 |
-
array (
|
24 |
-
0 => __DIR__ . '/..' . '/wpdesk/wp-pointer/src/WPDesk/Pointer',
|
25 |
-
),
|
26 |
-
'WPDesk\\PluginBuilder\\' =>
|
27 |
-
array (
|
28 |
-
0 => __DIR__ . '/..' . '/wpdesk/wp-builder/src',
|
29 |
-
),
|
30 |
'Psr\\Log\\' =>
|
31 |
array (
|
32 |
0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
|
@@ -154,6 +141,25 @@ class ComposerStaticInit0064257423e0b8f8962fac51c2e3ce79
|
|
154 |
'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunCodeceptionTests' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunCodeceptionTests.php',
|
155 |
'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\SedTrait' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/SedTrait.php',
|
156 |
'FSVendor\\WPDesk\\Composer\\Codeception\\Plugin' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Plugin.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
'FSVendor\\WPDesk\\FS\\TableRate\\Weight\\Rounding' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Weight/Rounding.php',
|
158 |
'FSVendor\\WPDesk\\Helper\\Debug\\LibraryDebug' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-helper/src/Debug/LibraryDebug.php',
|
159 |
'FSVendor\\WPDesk\\Helper\\HelperRemoveInfo' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-helper/src/HelperRemoveNotice.php',
|
@@ -335,15 +341,13 @@ class ComposerStaticInit0064257423e0b8f8962fac51c2e3ce79
|
|
335 |
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
336 |
'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
|
337 |
'WPDesk\\FS\\Helpers\\ShippingMethod' => __DIR__ . '/../..' . '/src/WPDesk/FS/Helpers/ShippingMethod.php',
|
338 |
-
'WPDesk\\FS\\Rate\\FirstRateNotice' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rate-notices/first-rate-notice.php',
|
339 |
-
'WPDesk\\FS\\Rate\\Flexible_Shipping_Order_Counter' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rate-notices/order-counter.php',
|
340 |
'WPDesk\\FS\\Rate\\RateNotice' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rate-notices/abstract-rate.php',
|
341 |
-
'WPDesk\\FS\\Rate\\
|
342 |
'WPDesk\\FS\\Rate\\RateNoticeInterface' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rate-notices/interface-rate.php',
|
343 |
-
'WPDesk\\FS\\Rate\\SecondRateNotice' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rate-notices/second-rate-notice.php',
|
344 |
-
'WPDesk\\FS\\Rate\\ThirdRateNotice' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rate-notices/third-rate-notice.php',
|
345 |
'WPDesk\\FS\\Rate\\WPDesk_Flexible_Shipping_Rate_Notice' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rate-notice.php',
|
346 |
'WPDesk\\FS\\TableRate\\ContextualInfo\\Creator' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/ContextualInfo/Creator.php',
|
|
|
|
|
347 |
'WPDesk\\FS\\TableRate\\FreeShipping\\FreeShippingNotice' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/FreeShipping/FreeShippingNotice.php',
|
348 |
'WPDesk\\FS\\TableRate\\FreeShipping\\FreeShippingNoticeGenerator' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/FreeShipping/FreeShippingNoticeGenerator.php',
|
349 |
'WPDesk\\FS\\TableRate\\NewRulesTableBanner\\RulesBannerClickedOption' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesBannerClickedOption.php',
|
@@ -361,48 +365,13 @@ class ComposerStaticInit0064257423e0b8f8962fac51c2e3ce79
|
|
361 |
'WPDesk\\FS\\TableRate\\RulesSettingsField' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/RulesSettingsField.php',
|
362 |
'WPDesk\\FS\\TableRate\\UserFeedback' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/UserFeedback.php',
|
363 |
'WPDesk\\Helper\\HelperAsLibrary' => __DIR__ . '/..' . '/wpdesk/wp-wpdesk-helper-override/src/Helper/HelperAsLibrary.php',
|
364 |
-
'WPDesk\\PluginBuilder\\BuildDirector\\LegacyBuildDirector' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/BuildDirector/LegacyBuildDirector.php',
|
365 |
-
'WPDesk\\PluginBuilder\\Builder\\AbstractBuilder' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Builder/AbstractBuilder.php',
|
366 |
-
'WPDesk\\PluginBuilder\\Builder\\InfoActivationBuilder' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Builder/InfoActivationBuilder.php',
|
367 |
-
'WPDesk\\PluginBuilder\\Builder\\InfoBuilder' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Builder/InfoBuilder.php',
|
368 |
-
'WPDesk\\PluginBuilder\\Plugin\\AbstractPlugin' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/AbstractPlugin.php',
|
369 |
-
'WPDesk\\PluginBuilder\\Plugin\\Activateable' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/Activateable.php',
|
370 |
-
'WPDesk\\PluginBuilder\\Plugin\\ActivationAware' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/ActivationAware.php',
|
371 |
-
'WPDesk\\PluginBuilder\\Plugin\\ActivationTracker' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/ActivationTracker.php',
|
372 |
-
'WPDesk\\PluginBuilder\\Plugin\\Conditional' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/Conditional.php',
|
373 |
-
'WPDesk\\PluginBuilder\\Plugin\\Deactivateable' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/Deactivateable.php',
|
374 |
-
'WPDesk\\PluginBuilder\\Plugin\\Hookable' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/Hookable.php',
|
375 |
-
'WPDesk\\PluginBuilder\\Plugin\\HookableCollection' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/HookableCollection.php',
|
376 |
-
'WPDesk\\PluginBuilder\\Plugin\\HookableParent' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/HookableParent.php',
|
377 |
-
'WPDesk\\PluginBuilder\\Plugin\\HookablePluginDependant' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/HookablePluginDependant.php',
|
378 |
-
'WPDesk\\PluginBuilder\\Plugin\\PluginAccess' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/PluginAccess.php',
|
379 |
-
'WPDesk\\PluginBuilder\\Plugin\\SlimPlugin' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/SlimPlugin.php',
|
380 |
-
'WPDesk\\PluginBuilder\\Plugin\\TemplateLoad' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/TemplateLoad.php',
|
381 |
-
'WPDesk\\PluginBuilder\\Storage\\Exception\\ClassAlreadyExists' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Storage/Exception/ClassAlreadyExists.php',
|
382 |
-
'WPDesk\\PluginBuilder\\Storage\\Exception\\ClassNotExists' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Storage/Exception/ClassNotExists.php',
|
383 |
-
'WPDesk\\PluginBuilder\\Storage\\PluginStorage' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Storage/PluginStorage.php',
|
384 |
-
'WPDesk\\PluginBuilder\\Storage\\StaticStorage' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Storage/StaticStorage.php',
|
385 |
-
'WPDesk\\PluginBuilder\\Storage\\StorageFactory' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Storage/StorageFactory.php',
|
386 |
-
'WPDesk\\PluginBuilder\\Storage\\WordpressFilterStorage' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Storage/WordpressFilterStorage.php',
|
387 |
-
'WPDesk\\Pointer\\PointerConditions' => __DIR__ . '/..' . '/wpdesk/wp-pointer/src/WPDesk/Pointer/PointerConditions.php',
|
388 |
-
'WPDesk\\Pointer\\PointerMessage' => __DIR__ . '/..' . '/wpdesk/wp-pointer/src/WPDesk/Pointer/PointerMessage.php',
|
389 |
-
'WPDesk\\Pointer\\PointerPosition' => __DIR__ . '/..' . '/wpdesk/wp-pointer/src/WPDesk/Pointer/PointerPosition.php',
|
390 |
-
'WPDesk\\Pointer\\PointersScripts' => __DIR__ . '/..' . '/wpdesk/wp-pointer/src/WPDesk/Pointer/PointersScripts.php',
|
391 |
-
'WPDesk_Buildable' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Buildable.php',
|
392 |
'WPDesk_Flexible_Shipping' => __DIR__ . '/../..' . '/classes/table-rate/shipping-method.php',
|
393 |
-
'WPDesk_Flexible_Shipping_AB_Deactivation_Contact_Information' => __DIR__ . '/../..' . '/classes/table-rate/abtests/class-ab-deactivation-contact-information.php',
|
394 |
-
'WPDesk_Flexible_Shipping_AB_Tracker_Deactivation_Data' => __DIR__ . '/../..' . '/classes/table-rate/abtests/class-ab-tracker-deactivation-data.php',
|
395 |
-
'WPDesk_Flexible_Shipping_AB_Variant_Old' => __DIR__ . '/../..' . '/classes/table-rate/abtests/ab-deactivation-contact-information-test/class-ab-variant-old.php',
|
396 |
-
'WPDesk_Flexible_Shipping_AB_Variant_With_Contact_Information_Button' => __DIR__ . '/../..' . '/classes/table-rate/abtests/ab-deactivation-contact-information-test/class-ab-variant-with-contact-information-button.php',
|
397 |
-
'WPDesk_Flexible_Shipping_AB_Variant_With_Contact_Information_On_Bottom' => __DIR__ . '/../..' . '/classes/table-rate/abtests/ab-deactivation-contact-information-test/class-ab-variant-with-contact-information-on-bottom.php',
|
398 |
-
'WPDesk_Flexible_Shipping_AB_Variant_With_Contact_Information_On_Top' => __DIR__ . '/../..' . '/classes/table-rate/abtests/ab-deactivation-contact-information-test/class-ab-variant-with-contact-information-on-top.php',
|
399 |
'WPDesk_Flexible_Shipping_Add_Shipping' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/class-order-add-shipping.php',
|
400 |
'WPDesk_Flexible_Shipping_Admin_Notices' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/admin-notices.php',
|
401 |
'WPDesk_Flexible_Shipping_Bulk_Actions' => __DIR__ . '/../..' . '/classes/table-rate/bulk-actions.php',
|
402 |
'WPDesk_Flexible_Shipping_Cancel_Shipment_Exception' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/exception/class-cancel-shipment-exception.php',
|
403 |
'WPDesk_Flexible_Shipping_Csv_Importer' => __DIR__ . '/../..' . '/classes/table-rate/csv/class-wpdesk-flexible-shipping-csv-importer.php',
|
404 |
'WPDesk_Flexible_Shipping_Csv_Importer_Exception' => __DIR__ . '/../..' . '/classes/table-rate/csv/class-csv-importer-exception.php',
|
405 |
-
'WPDesk_Flexible_Shipping_Deactivation_Thickbox_Factory' => __DIR__ . '/../..' . '/classes/table-rate/abtests/class-deactivation-thickbox-factory.php',
|
406 |
'WPDesk_Flexible_Shipping_Export' => __DIR__ . '/../..' . '/classes/table-rate/csv/flexible-shipping-export.php',
|
407 |
'WPDesk_Flexible_Shipping_Get_Label_Exception' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/exception/class-get-label-exception.php',
|
408 |
'WPDesk_Flexible_Shipping_Integration_Label_Builder' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/label/class-integration-label-builder.php',
|
@@ -441,23 +410,19 @@ class ComposerStaticInit0064257423e0b8f8962fac51c2e3ce79
|
|
441 |
'WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_File_Exception' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/exception/class-shipment-unable-to-create-tmp-file-exception.php',
|
442 |
'WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_Zip_File_Exception' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/exception/class-shipment-unable-to-create-tmp-zip-file-exception.php',
|
443 |
'WPDesk_Flexible_Shipping_WooCommerce_Context_Logger' => __DIR__ . '/../..' . '/classes/table-rate/logger/class-woocommerce-context-logger.php',
|
444 |
-
'WPDesk_Has_Plugin_Info' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Has_Plugin_Info.php',
|
445 |
-
'WPDesk_Plugin_Info' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Plugin_Info.php',
|
446 |
'WPDesk_Tracker_Data_Provider' => __DIR__ . '/..' . '/wpdesk/wp-wpdesk-helper-override/src/Interop/Tracker/class-wpdesk-tracker-data-provider.php',
|
447 |
'WPDesk_Tracker_Factory' => __DIR__ . '/..' . '/wpdesk/wp-wpdesk-helper-override/src/Helper/TrackerFactory.php',
|
448 |
'WPDesk_Tracker_Interface' => __DIR__ . '/..' . '/wpdesk/wp-wpdesk-helper-override/src/Interop/Tracker/class-wpdesk-tracker-interface.php',
|
449 |
'WPDesk_Tracker_Sender' => __DIR__ . '/..' . '/wpdesk/wp-wpdesk-helper-override/src/Interop/Tracker/class-wpdesk-tracker-sender.php',
|
450 |
-
'WPDesk_Translable' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Translable.php',
|
451 |
-
'WPDesk_Translatable' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Translatable.php',
|
452 |
);
|
453 |
|
454 |
public static function getInitializer(ClassLoader $loader)
|
455 |
{
|
456 |
return \Closure::bind(function () use ($loader) {
|
457 |
-
$loader->prefixLengthsPsr4 =
|
458 |
-
$loader->prefixDirsPsr4 =
|
459 |
-
$loader->fallbackDirsPsr4 =
|
460 |
-
$loader->classMap =
|
461 |
|
462 |
}, null, ClassLoader::class);
|
463 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit9c4619ba18f465b5d2d0661bac445811
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
|
|
|
|
|
|
|
|
|
|
10 |
'P' =>
|
11 |
array (
|
12 |
'Psr\\Log\\' => 8,
|
14 |
);
|
15 |
|
16 |
public static $prefixDirsPsr4 = array (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
'Psr\\Log\\' =>
|
18 |
array (
|
19 |
0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
|
141 |
'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\RunCodeceptionTests' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/RunCodeceptionTests.php',
|
142 |
'FSVendor\\WPDesk\\Composer\\Codeception\\Commands\\SedTrait' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/SedTrait.php',
|
143 |
'FSVendor\\WPDesk\\Composer\\Codeception\\Plugin' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Plugin.php',
|
144 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\AbstractOptions' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/AbstractOptions.php',
|
145 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\BasedOnOptions' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/BasedOnOptions.php',
|
146 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\CalculationMethodOptions' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/CalculationMethodOptions.php',
|
147 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Logger\\ArrayLogger' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/ArrayLogger.php',
|
148 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Logger\\Assets' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/Assets.php',
|
149 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Logger\\CanFormatForLog' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/CanFormatForLog.php',
|
150 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Logger\\NoticeLogger' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/NoticeLogger.php',
|
151 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Logger\\ShippingMethodLogger' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/ShippingMethodLogger.php',
|
152 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\CheckboxValue' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/CheckboxValue.php',
|
153 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\IntegrationSettings' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/IntegrationSettings.php',
|
154 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\IntegrationSettingsFactory' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/IntegrationSettingsFactory.php',
|
155 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\IntegrationSettingsImplementation' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/IntegrationSettingsImplementation.php',
|
156 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\MethodSettings' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/MethodSettings.php',
|
157 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\MethodSettingsFactory' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/MethodSettingsFactory.php',
|
158 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\MethodSettingsImplementation' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/MethodSettingsImplementation.php',
|
159 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\RuleSettings' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/RuleSettings.php',
|
160 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\RuleSettingsFactory' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/RuleSettingsFactory.php',
|
161 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\RuleSettingsImplementation' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/RuleSettingsImplementation.php',
|
162 |
+
'FSVendor\\WPDesk\\FS\\TableRate\\Settings\\RulesSettingsFactory' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/RulesSettingsFactory.php',
|
163 |
'FSVendor\\WPDesk\\FS\\TableRate\\Weight\\Rounding' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Weight/Rounding.php',
|
164 |
'FSVendor\\WPDesk\\Helper\\Debug\\LibraryDebug' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-helper/src/Debug/LibraryDebug.php',
|
165 |
'FSVendor\\WPDesk\\Helper\\HelperRemoveInfo' => __DIR__ . '/../..' . '/vendor_prefixed/wpdesk/wp-wpdesk-helper/src/HelperRemoveNotice.php',
|
341 |
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
342 |
'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
|
343 |
'WPDesk\\FS\\Helpers\\ShippingMethod' => __DIR__ . '/../..' . '/src/WPDesk/FS/Helpers/ShippingMethod.php',
|
|
|
|
|
344 |
'WPDesk\\FS\\Rate\\RateNotice' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rate-notices/abstract-rate.php',
|
345 |
+
'WPDesk\\FS\\Rate\\RateNoticeImplementation' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rate-notices/rate-notice-implementation.php',
|
346 |
'WPDesk\\FS\\Rate\\RateNoticeInterface' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rate-notices/interface-rate.php',
|
|
|
|
|
347 |
'WPDesk\\FS\\Rate\\WPDesk_Flexible_Shipping_Rate_Notice' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/rate-notice.php',
|
348 |
'WPDesk\\FS\\TableRate\\ContextualInfo\\Creator' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/ContextualInfo/Creator.php',
|
349 |
+
'WPDesk\\FS\\TableRate\\Debug\\NoShippingMethodsNotice' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Debug/NoShippingMethodsNotice.php',
|
350 |
+
'WPDesk\\FS\\TableRate\\Debug\\Tracker' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Debug/Tracker.php',
|
351 |
'WPDesk\\FS\\TableRate\\FreeShipping\\FreeShippingNotice' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/FreeShipping/FreeShippingNotice.php',
|
352 |
'WPDesk\\FS\\TableRate\\FreeShipping\\FreeShippingNoticeGenerator' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/FreeShipping/FreeShippingNoticeGenerator.php',
|
353 |
'WPDesk\\FS\\TableRate\\NewRulesTableBanner\\RulesBannerClickedOption' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesBannerClickedOption.php',
|
365 |
'WPDesk\\FS\\TableRate\\RulesSettingsField' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/RulesSettingsField.php',
|
366 |
'WPDesk\\FS\\TableRate\\UserFeedback' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/UserFeedback.php',
|
367 |
'WPDesk\\Helper\\HelperAsLibrary' => __DIR__ . '/..' . '/wpdesk/wp-wpdesk-helper-override/src/Helper/HelperAsLibrary.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
368 |
'WPDesk_Flexible_Shipping' => __DIR__ . '/../..' . '/classes/table-rate/shipping-method.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
369 |
'WPDesk_Flexible_Shipping_Add_Shipping' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/class-order-add-shipping.php',
|
370 |
'WPDesk_Flexible_Shipping_Admin_Notices' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/admin-notices.php',
|
371 |
'WPDesk_Flexible_Shipping_Bulk_Actions' => __DIR__ . '/../..' . '/classes/table-rate/bulk-actions.php',
|
372 |
'WPDesk_Flexible_Shipping_Cancel_Shipment_Exception' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/exception/class-cancel-shipment-exception.php',
|
373 |
'WPDesk_Flexible_Shipping_Csv_Importer' => __DIR__ . '/../..' . '/classes/table-rate/csv/class-wpdesk-flexible-shipping-csv-importer.php',
|
374 |
'WPDesk_Flexible_Shipping_Csv_Importer_Exception' => __DIR__ . '/../..' . '/classes/table-rate/csv/class-csv-importer-exception.php',
|
|
|
375 |
'WPDesk_Flexible_Shipping_Export' => __DIR__ . '/../..' . '/classes/table-rate/csv/flexible-shipping-export.php',
|
376 |
'WPDesk_Flexible_Shipping_Get_Label_Exception' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/exception/class-get-label-exception.php',
|
377 |
'WPDesk_Flexible_Shipping_Integration_Label_Builder' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/label/class-integration-label-builder.php',
|
410 |
'WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_File_Exception' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/exception/class-shipment-unable-to-create-tmp-file-exception.php',
|
411 |
'WPDesk_Flexible_Shipping_Unable_To_Create_Tmp_Zip_File_Exception' => __DIR__ . '/../..' . '/classes/wp-wpdesk-fs-shipment/exception/class-shipment-unable-to-create-tmp-zip-file-exception.php',
|
412 |
'WPDesk_Flexible_Shipping_WooCommerce_Context_Logger' => __DIR__ . '/../..' . '/classes/table-rate/logger/class-woocommerce-context-logger.php',
|
|
|
|
|
413 |
'WPDesk_Tracker_Data_Provider' => __DIR__ . '/..' . '/wpdesk/wp-wpdesk-helper-override/src/Interop/Tracker/class-wpdesk-tracker-data-provider.php',
|
414 |
'WPDesk_Tracker_Factory' => __DIR__ . '/..' . '/wpdesk/wp-wpdesk-helper-override/src/Helper/TrackerFactory.php',
|
415 |
'WPDesk_Tracker_Interface' => __DIR__ . '/..' . '/wpdesk/wp-wpdesk-helper-override/src/Interop/Tracker/class-wpdesk-tracker-interface.php',
|
416 |
'WPDesk_Tracker_Sender' => __DIR__ . '/..' . '/wpdesk/wp-wpdesk-helper-override/src/Interop/Tracker/class-wpdesk-tracker-sender.php',
|
|
|
|
|
417 |
);
|
418 |
|
419 |
public static function getInitializer(ClassLoader $loader)
|
420 |
{
|
421 |
return \Closure::bind(function () use ($loader) {
|
422 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit9c4619ba18f465b5d2d0661bac445811::$prefixLengthsPsr4;
|
423 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit9c4619ba18f465b5d2d0661bac445811::$prefixDirsPsr4;
|
424 |
+
$loader->fallbackDirsPsr4 = ComposerStaticInit9c4619ba18f465b5d2d0661bac445811::$fallbackDirsPsr4;
|
425 |
+
$loader->classMap = ComposerStaticInit9c4619ba18f465b5d2d0661bac445811::$classMap;
|
426 |
|
427 |
}, null, ClassLoader::class);
|
428 |
}
|
vendor/composer/installed.json
CHANGED
@@ -48,104 +48,6 @@
|
|
48 |
"psr-3"
|
49 |
]
|
50 |
},
|
51 |
-
{
|
52 |
-
"name": "wpdesk/wp-builder",
|
53 |
-
"version": "1.4.4",
|
54 |
-
"version_normalized": "1.4.4.0",
|
55 |
-
"source": {
|
56 |
-
"type": "git",
|
57 |
-
"url": "https://gitlab.com/wpdesk/wp-builder.git",
|
58 |
-
"reference": "e18df43bc3bc047c7bc0ed3e52eabb16118f4bc9"
|
59 |
-
},
|
60 |
-
"dist": {
|
61 |
-
"type": "zip",
|
62 |
-
"url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-builder/repository/archive.zip?sha=e18df43bc3bc047c7bc0ed3e52eabb16118f4bc9",
|
63 |
-
"reference": "e18df43bc3bc047c7bc0ed3e52eabb16118f4bc9",
|
64 |
-
"shasum": ""
|
65 |
-
},
|
66 |
-
"require": {
|
67 |
-
"php": ">=5.5"
|
68 |
-
},
|
69 |
-
"require-dev": {
|
70 |
-
"10up/wp_mock": "*",
|
71 |
-
"mockery/mockery": "*",
|
72 |
-
"phpunit/phpunit": "<7",
|
73 |
-
"squizlabs/php_codesniffer": "^3.0.2",
|
74 |
-
"wimg/php-compatibility": "^8",
|
75 |
-
"wp-coding-standards/wpcs": "^0.14.1"
|
76 |
-
},
|
77 |
-
"time": "2020-06-17T08:00:07+00:00",
|
78 |
-
"type": "library",
|
79 |
-
"installation-source": "dist",
|
80 |
-
"autoload": {
|
81 |
-
"psr-4": {
|
82 |
-
"WPDesk\\PluginBuilder\\": "src/"
|
83 |
-
},
|
84 |
-
"classmap": [
|
85 |
-
"src/Plugin/WithoutNamespace"
|
86 |
-
]
|
87 |
-
},
|
88 |
-
"notification-url": "https://packagist.org/downloads/",
|
89 |
-
"authors": [
|
90 |
-
{
|
91 |
-
"name": "Krzysiek",
|
92 |
-
"email": "krzysiek@wpdesk.pl"
|
93 |
-
}
|
94 |
-
]
|
95 |
-
},
|
96 |
-
{
|
97 |
-
"name": "wpdesk/wp-pointer",
|
98 |
-
"version": "2.0.0",
|
99 |
-
"version_normalized": "2.0.0.0",
|
100 |
-
"source": {
|
101 |
-
"type": "git",
|
102 |
-
"url": "https://gitlab.com/wpdesk/wp-pointer.git",
|
103 |
-
"reference": "2468b7f3412ba3dafbf3b8964b23ead89138102f"
|
104 |
-
},
|
105 |
-
"dist": {
|
106 |
-
"type": "zip",
|
107 |
-
"url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-pointer/repository/archive.zip?sha=2468b7f3412ba3dafbf3b8964b23ead89138102f",
|
108 |
-
"reference": "2468b7f3412ba3dafbf3b8964b23ead89138102f",
|
109 |
-
"shasum": ""
|
110 |
-
},
|
111 |
-
"require": {
|
112 |
-
"php": ">=5.5",
|
113 |
-
"wpdesk/wp-builder": "^1.1"
|
114 |
-
},
|
115 |
-
"require-dev": {
|
116 |
-
"10up/wp_mock": "*",
|
117 |
-
"mockery/mockery": "*",
|
118 |
-
"phpunit/phpunit": "<7",
|
119 |
-
"squizlabs/php_codesniffer": "^3.0.2",
|
120 |
-
"wimg/php-compatibility": "^8",
|
121 |
-
"wp-coding-standards/wpcs": "^0.14.1"
|
122 |
-
},
|
123 |
-
"time": "2020-07-14T15:33:40+00:00",
|
124 |
-
"type": "library",
|
125 |
-
"installation-source": "dist",
|
126 |
-
"autoload": {
|
127 |
-
"psr-4": {
|
128 |
-
"WPDesk\\Pointer\\": "src/WPDesk/Pointer/"
|
129 |
-
}
|
130 |
-
},
|
131 |
-
"notification-url": "https://packagist.org/downloads/",
|
132 |
-
"license": [
|
133 |
-
"MIT"
|
134 |
-
],
|
135 |
-
"authors": [
|
136 |
-
{
|
137 |
-
"name": "grola",
|
138 |
-
"email": "grola@wpdesk.net"
|
139 |
-
}
|
140 |
-
],
|
141 |
-
"description": "Library for displaying Wordpress pointer messages.",
|
142 |
-
"homepage": "https://gitlab.com/wpdesk/wp-pointer",
|
143 |
-
"keywords": [
|
144 |
-
"admin",
|
145 |
-
"pointer",
|
146 |
-
"wordpress"
|
147 |
-
]
|
148 |
-
},
|
149 |
{
|
150 |
"name": "wpdesk/wp-wpdesk-helper-override",
|
151 |
"version": "1.1.0",
|
48 |
"psr-3"
|
49 |
]
|
50 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
{
|
52 |
"name": "wpdesk/wp-wpdesk-helper-override",
|
53 |
"version": "1.1.0",
|
vendor/wpdesk/wp-builder/.editorconfig
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
# This file is for unifying the coding style for different editors and IDEs
|
2 |
-
# editorconfig.org
|
3 |
-
|
4 |
-
# WordPress Coding Standards
|
5 |
-
# https://make.wordpress.org/core/handbook/coding-standards/
|
6 |
-
|
7 |
-
root = true
|
8 |
-
|
9 |
-
[*]
|
10 |
-
charset = utf-8
|
11 |
-
end_of_line = lf
|
12 |
-
insert_final_newline = true
|
13 |
-
trim_trailing_whitespace = true
|
14 |
-
indent_style = tab
|
15 |
-
|
16 |
-
[*.yml]
|
17 |
-
indent_style = space
|
18 |
-
indent_size = 2
|
19 |
-
|
20 |
-
[*.md]
|
21 |
-
trim_trailing_whitespace = false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/.gitignore
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
/vendor/
|
2 |
-
.idea
|
3 |
-
composer.lock
|
|
|
|
|
|
vendor/wpdesk/wp-builder/.gitlab/issue_templates/Bug.md
DELETED
@@ -1,32 +0,0 @@
|
|
1 |
-
### Select WooCommerce version e.g: [x] 2.6
|
2 |
-
<!--- Select the WooCommerce version on which the error occurred -->
|
3 |
-
|
4 |
-
- [ ] [2.6](http://woo26.tests.wpdesk.org)
|
5 |
-
- [ ] [2.7](http://woo27.tests.wpdesk.org)
|
6 |
-
- [ ] [3.0](http://woo30.tests.wpdesk.org)
|
7 |
-
- [ ] [3.1](http://woo31.tests.wpdesk.org)
|
8 |
-
- [ ] [3.2](http://woo32.tests.wpdesk.org)
|
9 |
-
- [ ] [3.3](http://woo33.tests.wpdesk.org)
|
10 |
-
- [ ] [3.4](http://woo34.tests.wpdesk.org)
|
11 |
-
- [ ] [Stable](https://stable.wpdesk.org/)
|
12 |
-
|
13 |
-
### Select PHP version e.g: [x] 5.6
|
14 |
-
<!--- Select the PHP version on which the error occurred -->
|
15 |
-
|
16 |
-
- [ ] 5.3
|
17 |
-
- [ ] 5.5
|
18 |
-
- [ ] 5.6
|
19 |
-
- [ ] 7.1
|
20 |
-
- [ ] 7.2
|
21 |
-
|
22 |
-
## Steps to Reproduce
|
23 |
-
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
|
24 |
-
|
25 |
-
1.
|
26 |
-
2.
|
27 |
-
|
28 |
-
|
29 |
-
## Expected Behavior
|
30 |
-
<!--- Tell what should happen -->
|
31 |
-
|
32 |
-
1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/CHANGELOG.md
DELETED
@@ -1,50 +0,0 @@
|
|
1 |
-
## [1.4.4] - 2020-06-17
|
2 |
-
### Fixed
|
3 |
-
- Replaced class_exists to interface_exists for interfaces
|
4 |
-
|
5 |
-
|
6 |
-
## [1.4.3] - 2020-06-03
|
7 |
-
### Fixed
|
8 |
-
- Path for require_once
|
9 |
-
|
10 |
-
## [1.4.2] - 2020-05-15
|
11 |
-
### Changed
|
12 |
-
- Settings should open in default target
|
13 |
-
|
14 |
-
## [1.4.1] - 2019-11-19
|
15 |
-
### Fixed
|
16 |
-
- Invalid return type in Hookable interface
|
17 |
-
|
18 |
-
## [1.4.0] - 2019-09-26
|
19 |
-
### Added
|
20 |
-
- SlimPlugin - abstract class with only most important plugin elements
|
21 |
-
- AbstractPlugin - docs and cleaning
|
22 |
-
- Activateable - interface to tag plugin to hook into activation hook
|
23 |
-
- Deactivateable - interface to tag plugin to hook into deactivation hook
|
24 |
-
- Conditional - interface to tag classes that should be instantiated/hooked only in given state
|
25 |
-
### Changed
|
26 |
-
- WordpressFilterStorage - store plugin using WordPress filter system
|
27 |
-
- target blank in default plugin links
|
28 |
-
### Fixed
|
29 |
-
- Fixed assets and plugin url issues
|
30 |
-
|
31 |
-
## [1.3.4] - 2019-09-26
|
32 |
-
### Fixed
|
33 |
-
- Gitlab.ci
|
34 |
-
|
35 |
-
## [1.3.3] - 2019-09-24
|
36 |
-
### Added
|
37 |
-
- Support URL
|
38 |
-
|
39 |
-
## [1.3.2] - 2019-09-18
|
40 |
-
### Fixed
|
41 |
-
- Forgotten classes
|
42 |
-
- Fixed require_once
|
43 |
-
|
44 |
-
## [1.3.0] - 2019-09-18
|
45 |
-
### Added
|
46 |
-
- Plugin classes from wp-requirements
|
47 |
-
|
48 |
-
## [1.2.0] - 2019-06-26
|
49 |
-
### Added
|
50 |
-
- InfoActivationBuilder with capability to set info if plugin subscription is active
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/apigen.neon
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
destination: docs
|
2 |
-
templateConfig: /app/theme-woocommerce/config.neon
|
3 |
-
extensions: [php]
|
4 |
-
source:
|
5 |
-
- src
|
6 |
-
exclude:
|
7 |
-
- vendor
|
8 |
-
- tests
|
9 |
-
- languages
|
10 |
-
|
11 |
-
charset: [UTF-8]
|
12 |
-
main: Library wp-builder
|
13 |
-
title: Library that provides basic info how build a plugin and what a plugin is
|
14 |
-
baseUrl: "/"
|
15 |
-
|
16 |
-
templateTheme: default
|
17 |
-
php: false
|
18 |
-
sourceCode: false
|
19 |
-
tree: true
|
20 |
-
deprecated: false
|
21 |
-
todo: false
|
22 |
-
download: false
|
23 |
-
|
24 |
-
accessLevels:
|
25 |
-
- public
|
26 |
-
- private
|
27 |
-
- protected
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/composer.json
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"name": "wpdesk/wp-builder",
|
3 |
-
"authors": [
|
4 |
-
{
|
5 |
-
"name": "Krzysiek",
|
6 |
-
"email": "krzysiek@wpdesk.pl"
|
7 |
-
}
|
8 |
-
],
|
9 |
-
"require": {
|
10 |
-
"php": ">=5.5"
|
11 |
-
},
|
12 |
-
"require-dev": {
|
13 |
-
"phpunit/phpunit": "<7",
|
14 |
-
"wp-coding-standards/wpcs": "^0.14.1",
|
15 |
-
"squizlabs/php_codesniffer": "^3.0.2",
|
16 |
-
"mockery/mockery": "*",
|
17 |
-
"10up/wp_mock": "*",
|
18 |
-
"wimg/php-compatibility": "^8"
|
19 |
-
},
|
20 |
-
"autoload": {
|
21 |
-
"psr-4": {"WPDesk\\PluginBuilder\\": "src/"},
|
22 |
-
"classmap": ["src/Plugin/WithoutNamespace"]
|
23 |
-
},
|
24 |
-
"autoload-dev": {
|
25 |
-
},
|
26 |
-
"scripts": {
|
27 |
-
"phpcs": "phpcs",
|
28 |
-
"phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never",
|
29 |
-
"phpunit-unit-fast": "phpunit --configuration phpunit-unit.xml --no-coverage",
|
30 |
-
"phpunit-integration": "phpunit --configuration phpunit-integration.xml --coverage-text --colors=never",
|
31 |
-
"phpunit-integration-fast": "phpunit --configuration phpunit-integration.xml --no-coverage"
|
32 |
-
}
|
33 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/phpcs.xml.dist
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<ruleset name="WordPress Coding Standards for WP Desk Plugin">
|
3 |
-
<description>Sniffs for WordPress WPDesk plugins</description>
|
4 |
-
|
5 |
-
<config name="installed_paths" value="vendor/wp-coding-standards/wpcs,vendor/wimg/php-compatibility" />
|
6 |
-
|
7 |
-
<rule ref="PHPCompatibility"/>
|
8 |
-
<config name="testVersion" value="5.5-"/>
|
9 |
-
|
10 |
-
<rule ref="WordPress"/>
|
11 |
-
|
12 |
-
<config name="text_domain" value="wpdesk-plugin,default,s214-settings-demo"/>
|
13 |
-
|
14 |
-
<arg name="extensions" value="php"/>
|
15 |
-
|
16 |
-
<file>./classes</file>
|
17 |
-
<exclude-pattern>*/settings-api/*</exclude-pattern>
|
18 |
-
</ruleset>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/phpunit-integration.xml
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
<phpunit bootstrap="tests/integration/bootstrap.php"
|
2 |
-
backupGlobals="false"
|
3 |
-
>
|
4 |
-
<testsuites>
|
5 |
-
<testsuite>
|
6 |
-
<directory prefix="Test_" suffix=".php">./tests/integration</directory>
|
7 |
-
</testsuite>
|
8 |
-
</testsuites>
|
9 |
-
|
10 |
-
<filter>
|
11 |
-
<whitelist>
|
12 |
-
<directory suffix=".php">classes</directory>
|
13 |
-
</whitelist>
|
14 |
-
</filter>
|
15 |
-
|
16 |
-
<logging>
|
17 |
-
<log type="junit" target="build-coverage/report.junit.xml"/>
|
18 |
-
<log type="coverage-html" target="build-coverage/coverage" charset="UTF-8" yui="true" highlight="true"/>
|
19 |
-
<log type="coverage-text" target="build-coverage/coverage.txt"/>
|
20 |
-
<log type="coverage-clover" target="build-coverage/clover.xml"/>
|
21 |
-
</logging>
|
22 |
-
|
23 |
-
<php>
|
24 |
-
<env name="WP_DEVELOP_DIR" value="/tmp/wordpress-develop"/>
|
25 |
-
<env name="WC_DEVELOP_DIR" value="/tmp/woocommerce"/>
|
26 |
-
</php>
|
27 |
-
|
28 |
-
</phpunit>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/phpunit-unit.xml
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
<phpunit bootstrap="tests/unit/bootstrap.php">
|
2 |
-
<testsuites>
|
3 |
-
<testsuite>
|
4 |
-
<directory prefix="test-" suffix=".php">./tests/unit/</directory>
|
5 |
-
</testsuite>
|
6 |
-
</testsuites>
|
7 |
-
|
8 |
-
<filter>
|
9 |
-
<whitelist>
|
10 |
-
<directory suffix=".php">classes</directory>
|
11 |
-
</whitelist>
|
12 |
-
</filter>
|
13 |
-
|
14 |
-
<logging>
|
15 |
-
<log type="junit" target="build-coverage/report.junit.xml"/>
|
16 |
-
<log type="coverage-html" target="build-coverage/coverage" charset="UTF-8" yui="true" highlight="true"/>
|
17 |
-
<log type="coverage-text" target="build-coverage/coverage.txt"/>
|
18 |
-
<log type="coverage-clover" target="build-coverage/clover.xml"/>
|
19 |
-
</logging>
|
20 |
-
|
21 |
-
</phpunit>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/BuildDirector/LegacyBuildDirector.php
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\BuildDirector;
|
4 |
-
|
5 |
-
use WPDesk\PluginBuilder\Builder\AbstractBuilder;
|
6 |
-
use WPDesk\PluginBuilder\Plugin\AbstractPlugin;
|
7 |
-
use WPDesk\PluginBuilder\Storage\StorageFactory;
|
8 |
-
|
9 |
-
class LegacyBuildDirector {
|
10 |
-
|
11 |
-
/** @var AbstractBuilder */
|
12 |
-
private $builder;
|
13 |
-
|
14 |
-
public function __construct( AbstractBuilder $builder ) {
|
15 |
-
$this->builder = $builder;
|
16 |
-
}
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Builds plugin
|
20 |
-
*/
|
21 |
-
public function build_plugin() {
|
22 |
-
$this->builder->build_plugin();
|
23 |
-
$this->builder->init_plugin();
|
24 |
-
|
25 |
-
$storage = new StorageFactory();
|
26 |
-
$this->builder->store_plugin( $storage->create_storage() );
|
27 |
-
}
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Returns built plugin
|
31 |
-
*
|
32 |
-
* @return AbstractPlugin
|
33 |
-
*/
|
34 |
-
public function get_plugin() {
|
35 |
-
return $this->builder->get_plugin();
|
36 |
-
}
|
37 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Builder/AbstractBuilder.php
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Builder;
|
4 |
-
|
5 |
-
use WPDesk\PluginBuilder\Plugin\AbstractPlugin;
|
6 |
-
use WPDesk\PluginBuilder\Storage\PluginStorage;
|
7 |
-
|
8 |
-
abstract class AbstractBuilder {
|
9 |
-
/**
|
10 |
-
* Create plugin class
|
11 |
-
*/
|
12 |
-
public function build_plugin() {
|
13 |
-
}
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Store plugin class in some kind of storage
|
17 |
-
*/
|
18 |
-
public function store_plugin( PluginStorage $storage ) {
|
19 |
-
}
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Init plugin internal structure
|
23 |
-
*/
|
24 |
-
public function init_plugin() {
|
25 |
-
}
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Return built plugin
|
29 |
-
* @return AbstractPlugin
|
30 |
-
*/
|
31 |
-
abstract function get_plugin();
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Set settings class in plugin
|
35 |
-
*
|
36 |
-
* @param $settings
|
37 |
-
*/
|
38 |
-
public function set_settings( $settings ) {
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Set view class in plugin
|
43 |
-
*
|
44 |
-
* @param $view
|
45 |
-
*/
|
46 |
-
public function set_view( $view ) {
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Set tracker class in plugin
|
51 |
-
*
|
52 |
-
* @param $tracker
|
53 |
-
*/
|
54 |
-
public function set_tracker( $tracker ) {
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Set helper class in plugin
|
59 |
-
*
|
60 |
-
* @param $helper
|
61 |
-
*/
|
62 |
-
public function set_helper( $helper ) {
|
63 |
-
}
|
64 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Builder/InfoActivationBuilder.php
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Builder;
|
4 |
-
|
5 |
-
use WPDesk\PluginBuilder\Plugin\AbstractPlugin;
|
6 |
-
use WPDesk\PluginBuilder\Plugin\ActivationAware;
|
7 |
-
use WPDesk\PluginBuilder\Storage\PluginStorage;
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Builder that have info about activations
|
11 |
-
*
|
12 |
-
* Warning: We can't extend InfoBuilder.php as some old plugins(without wp-flow) will load the old version od InfoBuilder class that have private plugin property.
|
13 |
-
*
|
14 |
-
* @package WPDesk\PluginBuilder\Builder
|
15 |
-
*/
|
16 |
-
class InfoActivationBuilder extends AbstractBuilder
|
17 |
-
{
|
18 |
-
const FILTER_PLUGIN_CLASS = 'wp_builder_plugin_class';
|
19 |
-
const HOOK_BEFORE_PLUGIN_INIT = 'wp_builder_before_plugin_init';
|
20 |
-
const HOOK_AFTER_PLUGIN_INIT = 'wp_builder_before_init';
|
21 |
-
|
22 |
-
/** @var AbstractPlugin */
|
23 |
-
private $plugin;
|
24 |
-
|
25 |
-
/** @var \WPDesk_Buildable */
|
26 |
-
private $info;
|
27 |
-
|
28 |
-
/** @var string */
|
29 |
-
protected $storage_id;
|
30 |
-
|
31 |
-
/**
|
32 |
-
* @var bool
|
33 |
-
*/
|
34 |
-
private $is_active;
|
35 |
-
|
36 |
-
/**
|
37 |
-
* @param \WPDesk_Buildable $info
|
38 |
-
* @param bool $is_active
|
39 |
-
*/
|
40 |
-
public function __construct(\WPDesk_Buildable $info, $is_active)
|
41 |
-
{
|
42 |
-
$this->info = $info;
|
43 |
-
$this->storage_id = $info->get_class_name();
|
44 |
-
$this->is_active = $is_active;
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Builds instance of plugin
|
49 |
-
*/
|
50 |
-
public function build_plugin()
|
51 |
-
{
|
52 |
-
$class_name = apply_filters(self::FILTER_PLUGIN_CLASS, $this->info->get_class_name());
|
53 |
-
|
54 |
-
/** @var AbstractPlugin $plugin */
|
55 |
-
$this->plugin = new $class_name($this->info);
|
56 |
-
if ($this->plugin instanceof ActivationAware && $this->is_active) {
|
57 |
-
$this->plugin->set_active();
|
58 |
-
}
|
59 |
-
|
60 |
-
return $this->plugin;
|
61 |
-
}
|
62 |
-
|
63 |
-
public function store_plugin(PluginStorage $storage)
|
64 |
-
{
|
65 |
-
$storage->add_to_storage($this->storage_id, $this->plugin);
|
66 |
-
}
|
67 |
-
|
68 |
-
public function init_plugin()
|
69 |
-
{
|
70 |
-
do_action(self::HOOK_BEFORE_PLUGIN_INIT, $this->plugin);
|
71 |
-
$this->plugin->init();
|
72 |
-
do_action(self::HOOK_AFTER_PLUGIN_INIT, $this->plugin);
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* @return AbstractPlugin
|
77 |
-
*/
|
78 |
-
public function get_plugin()
|
79 |
-
{
|
80 |
-
return $this->plugin;
|
81 |
-
}
|
82 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Builder/InfoBuilder.php
DELETED
@@ -1,58 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Builder;
|
4 |
-
|
5 |
-
use WPDesk\PluginBuilder\Plugin\AbstractPlugin;
|
6 |
-
use WPDesk\PluginBuilder\Storage\PluginStorage;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* @deprecated Should not be used as some old plugins are using it and we can't touch this.
|
10 |
-
*
|
11 |
-
* @package WPDesk\PluginBuilder\Builder
|
12 |
-
*/
|
13 |
-
class InfoBuilder extends AbstractBuilder {
|
14 |
-
const FILTER_PLUGIN_CLASS = 'wp_builder_plugin_class';
|
15 |
-
const HOOK_BEFORE_PLUGIN_INIT = 'wp_builder_before_plugin_init';
|
16 |
-
const HOOK_AFTER_PLUGIN_INIT = 'wp_builder_before_init';
|
17 |
-
|
18 |
-
/** @var AbstractPlugin */
|
19 |
-
private $plugin;
|
20 |
-
|
21 |
-
/** @var \WPDesk_Buildable */
|
22 |
-
private $info;
|
23 |
-
|
24 |
-
/** @var string */
|
25 |
-
protected $storage_id;
|
26 |
-
|
27 |
-
public function __construct( \WPDesk_Buildable $info ) {
|
28 |
-
$this->info = $info;
|
29 |
-
$this->storage_id = $info->get_class_name();
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Builds instance of plugin
|
34 |
-
*/
|
35 |
-
public function build_plugin() {
|
36 |
-
$class_name = apply_filters( self::FILTER_PLUGIN_CLASS, $this->info->get_class_name() );
|
37 |
-
|
38 |
-
/** @var AbstractPlugin $plugin */
|
39 |
-
$this->plugin = new $class_name( $this->info );
|
40 |
-
}
|
41 |
-
|
42 |
-
public function store_plugin( PluginStorage $storage ) {
|
43 |
-
$storage->add_to_storage( $this->storage_id, $this->plugin );
|
44 |
-
}
|
45 |
-
|
46 |
-
public function init_plugin() {
|
47 |
-
do_action( self::HOOK_BEFORE_PLUGIN_INIT, $this->plugin );
|
48 |
-
$this->plugin->init();
|
49 |
-
do_action( self::HOOK_AFTER_PLUGIN_INIT, $this->plugin );
|
50 |
-
}
|
51 |
-
|
52 |
-
/**
|
53 |
-
* @return AbstractPlugin
|
54 |
-
*/
|
55 |
-
public function get_plugin() {
|
56 |
-
return $this->plugin;
|
57 |
-
}
|
58 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/AbstractPlugin.php
DELETED
@@ -1,223 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Plugin;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Base plugin with most basic functionalities used by every WPDesk plugin.
|
7 |
-
*
|
8 |
-
*
|
9 |
-
* Known issues:
|
10 |
-
*
|
11 |
-
* The class name is too generic but can't be changed as it would introduce a major incompatibility for most of the plugins.
|
12 |
-
* The $plugin_url, $docs_url and most other fields should be removed as they only litter the place but for compatibility reasons we can't do it right now.
|
13 |
-
* Hook methods should be moved to external classes but for compatibility reasons we can't do it right now.
|
14 |
-
*/
|
15 |
-
abstract class AbstractPlugin extends SlimPlugin {
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Most info about plugin internals.
|
19 |
-
*
|
20 |
-
* @var \WPDesk_Plugin_Info
|
21 |
-
*/
|
22 |
-
protected $plugin_info;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Unique string for this plugin in [a-z_]+ format.
|
26 |
-
*
|
27 |
-
* @var string
|
28 |
-
*/
|
29 |
-
protected $plugin_namespace;
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Absolute URL to the plugin dir.
|
33 |
-
*
|
34 |
-
* @var string
|
35 |
-
*/
|
36 |
-
protected $plugin_url;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Absolute URL to the plugin docs.
|
40 |
-
*
|
41 |
-
* @var string
|
42 |
-
*/
|
43 |
-
protected $docs_url;
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Absolute URL to the plugin settings url.
|
47 |
-
*
|
48 |
-
* @var string
|
49 |
-
*/
|
50 |
-
protected $settings_url;
|
51 |
-
|
52 |
-
/**
|
53 |
-
* Support URL.
|
54 |
-
*
|
55 |
-
* @var string
|
56 |
-
*/
|
57 |
-
protected $support_url;
|
58 |
-
|
59 |
-
/**
|
60 |
-
* AbstractPlugin constructor.
|
61 |
-
*
|
62 |
-
* @param \WPDesk_Plugin_Info $plugin_info
|
63 |
-
*/
|
64 |
-
public function __construct( $plugin_info ) {
|
65 |
-
$this->plugin_info = $plugin_info;
|
66 |
-
$this->plugin_namespace = strtolower( $plugin_info->get_plugin_dir() );
|
67 |
-
$this->plugin_url = $this->plugin_info->get_plugin_url();
|
68 |
-
$this->init_base_variables();
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Initialize internal state of the plugin.
|
73 |
-
*
|
74 |
-
* @return void
|
75 |
-
* @deprecated Just use __construct to initialize plugin internal state.
|
76 |
-
*
|
77 |
-
*/
|
78 |
-
public function init_base_variables() {
|
79 |
-
}
|
80 |
-
|
81 |
-
/**
|
82 |
-
* Initializes plugin external state.
|
83 |
-
*
|
84 |
-
* The plugin internal state is initialized in the constructor and the plugin should be internally consistent after creation.
|
85 |
-
* The external state includes hooks execution, communication with other plugins, integration with WC etc.
|
86 |
-
*
|
87 |
-
* @return void
|
88 |
-
*/
|
89 |
-
public function init() {
|
90 |
-
$this->hooks();
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Returns absolute path to the plugin dir.
|
95 |
-
*
|
96 |
-
* @return string
|
97 |
-
*/
|
98 |
-
public function get_plugin_file_path() {
|
99 |
-
return $this->plugin_info->get_plugin_file_name();
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Returns plugin text domain.
|
104 |
-
*
|
105 |
-
* @return string
|
106 |
-
*/
|
107 |
-
public function get_text_domain() {
|
108 |
-
return $this->plugin_info->get_text_domain();
|
109 |
-
}
|
110 |
-
|
111 |
-
/**
|
112 |
-
* Returns unique string for plugin in [a-z_]+ format. Can be used as plugin id in various places like plugin slug etc.
|
113 |
-
*
|
114 |
-
* @return string
|
115 |
-
*/
|
116 |
-
public function get_namespace() {
|
117 |
-
return $this->plugin_namespace;
|
118 |
-
}
|
119 |
-
|
120 |
-
/**
|
121 |
-
* Returns plugin absolute URL.
|
122 |
-
*
|
123 |
-
* @return string
|
124 |
-
*/
|
125 |
-
public function get_plugin_url() {
|
126 |
-
return esc_url( trailingslashit( $this->plugin_url ) );
|
127 |
-
}
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Returns plugin absolute URL to dir with front end assets.
|
131 |
-
*
|
132 |
-
* @return string
|
133 |
-
*/
|
134 |
-
public function get_plugin_assets_url() {
|
135 |
-
return esc_url( trailingslashit( $this->get_plugin_url() . 'assets' ) );
|
136 |
-
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
* @return $this
|
140 |
-
* @deprecated For backward compatibility.
|
141 |
-
*
|
142 |
-
*/
|
143 |
-
public function get_plugin() {
|
144 |
-
return $this;
|
145 |
-
}
|
146 |
-
|
147 |
-
/**
|
148 |
-
* Integrate with WordPress and with other plugins using action/filter system.
|
149 |
-
*
|
150 |
-
* @return void
|
151 |
-
*/
|
152 |
-
protected function hooks() {
|
153 |
-
add_action( 'admin_enqueue_scripts', [ $this, 'admin_enqueue_scripts' ] );
|
154 |
-
add_action( 'wp_enqueue_scripts', [ $this, 'wp_enqueue_scripts' ] );
|
155 |
-
add_action( 'plugins_loaded', [ $this, 'load_plugin_text_domain' ] );
|
156 |
-
add_filter( 'plugin_action_links_' . plugin_basename( $this->get_plugin_file_path() ), [
|
157 |
-
$this,
|
158 |
-
'links_filter'
|
159 |
-
] );
|
160 |
-
}
|
161 |
-
/**
|
162 |
-
* Initialize plugin test domain. This is a hook function. Do not execute directly.
|
163 |
-
*
|
164 |
-
* @return void
|
165 |
-
*/
|
166 |
-
public function load_plugin_text_domain() {
|
167 |
-
load_plugin_textdomain( $this->get_text_domain(), false, $this->get_namespace() . '/lang/' );
|
168 |
-
}
|
169 |
-
|
170 |
-
/**
|
171 |
-
* Append JS scripts in the WordPress admin panel. This is a hook function. Do not execute directly.
|
172 |
-
*
|
173 |
-
* @return void
|
174 |
-
*/
|
175 |
-
public function admin_enqueue_scripts() {
|
176 |
-
}
|
177 |
-
|
178 |
-
/**
|
179 |
-
* Append JS scripts in WordPress. This is a hook function. Do not execute directly.
|
180 |
-
*
|
181 |
-
* @return void
|
182 |
-
*/
|
183 |
-
public function wp_enqueue_scripts() {
|
184 |
-
}
|
185 |
-
|
186 |
-
/**
|
187 |
-
* Initialize plugin admin links. This is a hook function. Do not execute directly.
|
188 |
-
*
|
189 |
-
* @param string[] $links
|
190 |
-
*
|
191 |
-
* @return string[]
|
192 |
-
*/
|
193 |
-
public function links_filter( $links ) {
|
194 |
-
$support_link = get_locale() === 'pl_PL' ? 'https://www.wpdesk.pl/support/' : 'https://www.wpdesk.net/support';
|
195 |
-
|
196 |
-
if ( $this->support_url ) {
|
197 |
-
$support_link = $this->support_url;
|
198 |
-
}
|
199 |
-
|
200 |
-
$plugin_links = [
|
201 |
-
'<a target="_blank" href="' . $support_link . '">' . __( 'Support', $this->get_text_domain() ) . '</a>',
|
202 |
-
];
|
203 |
-
$links = array_merge( $plugin_links, $links );
|
204 |
-
|
205 |
-
if ( $this->docs_url ) {
|
206 |
-
$plugin_links = [
|
207 |
-
'<a target="_blank" href="' . $this->docs_url . '">' . __( 'Docs', $this->get_text_domain() ) . '</a>',
|
208 |
-
];
|
209 |
-
$links = array_merge( $plugin_links, $links );
|
210 |
-
}
|
211 |
-
|
212 |
-
if ( $this->settings_url ) {
|
213 |
-
$plugin_links = [
|
214 |
-
'<a href="' . $this->settings_url . '">' . __( 'Settings', $this->get_text_domain() ) . '</a>',
|
215 |
-
];
|
216 |
-
$links = array_merge( $plugin_links, $links );
|
217 |
-
}
|
218 |
-
|
219 |
-
return $links;
|
220 |
-
}
|
221 |
-
|
222 |
-
}
|
223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/Activateable.php
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
namespace WPDesk\PluginBuilder\Plugin;
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Tag the plugin with this ingterface to hook it to the WordPress activation hook.
|
8 |
-
*
|
9 |
-
* Note: works from plugin flow ^2.2.
|
10 |
-
*
|
11 |
-
* @package WPDesk\PluginBuilder\Plugin
|
12 |
-
*/
|
13 |
-
interface Activateable {
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Plugin activated in WordPress. Do not execute directly.
|
17 |
-
*
|
18 |
-
* @return void
|
19 |
-
*/
|
20 |
-
public function activate();
|
21 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/ActivationAware.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Plugin;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* It means that this class is should know about SUBSCRIPTION activation
|
7 |
-
*
|
8 |
-
* @package WPDesk\PluginBuilder\Plugin
|
9 |
-
*/
|
10 |
-
interface ActivationAware {
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Set the activation flag to true
|
14 |
-
*
|
15 |
-
* @return void
|
16 |
-
*/
|
17 |
-
public function set_active();
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Is subscription active?
|
21 |
-
*
|
22 |
-
* @return bool
|
23 |
-
*/
|
24 |
-
public function is_active();
|
25 |
-
|
26 |
-
}
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/ActivationTracker.php
DELETED
@@ -1,75 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Plugin;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* @deprecated nobody uses it :) And also this library is not a place for this class
|
7 |
-
*
|
8 |
-
* @package WPDesk\PluginBuilder\Plugin
|
9 |
-
*/
|
10 |
-
class ActivationTracker {
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Namespace.
|
14 |
-
*
|
15 |
-
* @var string
|
16 |
-
*/
|
17 |
-
private $namespace;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* ActivationTracker constructor.
|
21 |
-
*
|
22 |
-
* @param string $namespace Namespace for settings.
|
23 |
-
*/
|
24 |
-
public function __construct( $namespace ) {
|
25 |
-
$this->namespace = $namespace;
|
26 |
-
}
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Option name for date storage
|
30 |
-
*
|
31 |
-
* @return string
|
32 |
-
*/
|
33 |
-
private function get_option_name_activation_date() {
|
34 |
-
return $this->namespace . '_activation';
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Returns activation date and sets it if were not set before
|
39 |
-
*
|
40 |
-
* @return int unix timestamp for activation datetime
|
41 |
-
*/
|
42 |
-
public function get_activation_date() {
|
43 |
-
$activation_date
|
44 |
-
= get_option( $this->get_option_name_activation_date() );
|
45 |
-
if ( empty( $activation_date ) ) {
|
46 |
-
return $this->touch_activation_date();
|
47 |
-
}
|
48 |
-
|
49 |
-
return intval( $activation_date );
|
50 |
-
}
|
51 |
-
|
52 |
-
/**
|
53 |
-
* Was activation more than two weeks before today
|
54 |
-
*
|
55 |
-
* @return bool
|
56 |
-
*/
|
57 |
-
public function is_activated_more_than_two_weeks() {
|
58 |
-
$two_weeks = 60 * 60 * 24 * 7 * 2;
|
59 |
-
|
60 |
-
return $this->get_activation_date() + $two_weeks < time();
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Sets activatiion date for today
|
65 |
-
*
|
66 |
-
* @return int unit timestamp for now
|
67 |
-
*/
|
68 |
-
public function touch_activation_date() {
|
69 |
-
$now = time();
|
70 |
-
update_option( $this->get_option_name_activation_date(), $now );
|
71 |
-
|
72 |
-
return $now;
|
73 |
-
}
|
74 |
-
|
75 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/Conditional.php
DELETED
@@ -1,20 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
namespace WPDesk\PluginBuilder\Plugin;
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Something that can be instantiated/hooked conditionally.
|
8 |
-
*
|
9 |
-
* @see https://github.com/mwpd/basic-scaffold/blob/master/src/Infrastructure/Conditional.php by Alain Schlesser
|
10 |
-
*
|
11 |
-
* @package WPDesk\PluginBuilder\Plugin
|
12 |
-
*/
|
13 |
-
interface Conditional {
|
14 |
-
/**
|
15 |
-
* Check whether the conditional object is currently needed.
|
16 |
-
*
|
17 |
-
* @return bool Whether the conditional object is needed.
|
18 |
-
*/
|
19 |
-
public static function is_needed();
|
20 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/Deactivateable.php
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
namespace WPDesk\PluginBuilder\Plugin;
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Tag the plugin with this ingterface to hook it to the WordPress deactivation hook.
|
8 |
-
*
|
9 |
-
* Note: works from plugin flow ^2.2.
|
10 |
-
*
|
11 |
-
* @package WPDesk\PluginBuilder\Plugin
|
12 |
-
*/
|
13 |
-
interface Deactivateable {
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Plugin deactivate in WordPress. Do not execute directly.
|
17 |
-
*
|
18 |
-
* @return void
|
19 |
-
*/
|
20 |
-
public function deactivate();
|
21 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/Hookable.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Plugin;
|
4 |
-
|
5 |
-
interface Hookable {
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Init hooks (actions and filters).
|
9 |
-
*
|
10 |
-
* @return void
|
11 |
-
*/
|
12 |
-
public function hooks();
|
13 |
-
|
14 |
-
}
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/HookableCollection.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Plugin;
|
4 |
-
|
5 |
-
interface HookableCollection extends Hookable {
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Add hookable object.
|
9 |
-
*
|
10 |
-
* @param Hookable|HookablePluginDependant $hookable_object Hookable object.
|
11 |
-
*/
|
12 |
-
public function add_hookable( Hookable $hookable_object );
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Get hookable instance.
|
16 |
-
*
|
17 |
-
* @param string $class_name Class name.
|
18 |
-
*
|
19 |
-
* @return false|Hookable
|
20 |
-
*/
|
21 |
-
public function get_hookable_instance_by_class_name( $class_name );
|
22 |
-
|
23 |
-
}
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/HookableParent.php
DELETED
@@ -1,59 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Plugin;
|
4 |
-
|
5 |
-
trait HookableParent {
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Hookable objects.
|
9 |
-
*
|
10 |
-
* @var array[Hookable]
|
11 |
-
*/
|
12 |
-
private $hookable_objects = array();
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Add hookable object.
|
16 |
-
*
|
17 |
-
* @param Hookable|HookablePluginDependant $hookable_object Hookable object.
|
18 |
-
*/
|
19 |
-
public function add_hookable( Hookable $hookable_object ) {
|
20 |
-
if ( $hookable_object instanceof HookablePluginDependant ) {
|
21 |
-
$hookable_object->set_plugin( $this );
|
22 |
-
}
|
23 |
-
$this->hookable_objects[] = $hookable_object;
|
24 |
-
}
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Get hookable instance.
|
28 |
-
*
|
29 |
-
* @param string $class_name Class name.
|
30 |
-
*
|
31 |
-
* @return false|Hookable
|
32 |
-
*/
|
33 |
-
public function get_hookable_instance_by_class_name( $class_name ) {
|
34 |
-
foreach ( $this->hookable_objects as $hookable_object ) {
|
35 |
-
if ( $hookable_object instanceof $class_name ) {
|
36 |
-
return $hookable_object;
|
37 |
-
}
|
38 |
-
}
|
39 |
-
return false;
|
40 |
-
}
|
41 |
-
|
42 |
-
/**
|
43 |
-
* Run hooks method on all hookable objects.
|
44 |
-
*/
|
45 |
-
protected function hooks_on_hookable_objects() {
|
46 |
-
/** @var Hookable $hookable_object $hookable_object */
|
47 |
-
foreach ( $this->hookable_objects as $hookable_object ) {
|
48 |
-
if ($hookable_object instanceof Conditional) {
|
49 |
-
if ($hookable_object::is_needed()) {
|
50 |
-
$hookable_object->hooks();
|
51 |
-
}
|
52 |
-
} else {
|
53 |
-
$hookable_object->hooks();
|
54 |
-
}
|
55 |
-
}
|
56 |
-
}
|
57 |
-
|
58 |
-
|
59 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/HookablePluginDependant.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Plugin;
|
4 |
-
|
5 |
-
interface HookablePluginDependant extends Hookable {
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Set Plugin.
|
9 |
-
*
|
10 |
-
* @param AbstractPlugin $plugin Plugin.
|
11 |
-
*
|
12 |
-
* @return null
|
13 |
-
*/
|
14 |
-
public function set_plugin( AbstractPlugin $plugin );
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Get plugin.
|
18 |
-
*
|
19 |
-
* @return AbstractPlugin.
|
20 |
-
*/
|
21 |
-
public function get_plugin();
|
22 |
-
|
23 |
-
}
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/PluginAccess.php
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Plugin;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* @package WPDesk\PluginBuilder\Plugin
|
7 |
-
*/
|
8 |
-
trait PluginAccess {
|
9 |
-
/**
|
10 |
-
* Plugin.
|
11 |
-
*
|
12 |
-
* @var AbstractPlugin
|
13 |
-
*/
|
14 |
-
private $plugin;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Set plugin.
|
18 |
-
*
|
19 |
-
* @param AbstractPlugin $plugin Plugin.
|
20 |
-
*/
|
21 |
-
public function set_plugin( AbstractPlugin $plugin ) {
|
22 |
-
$this->plugin = $plugin;
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Get plugin.
|
27 |
-
*
|
28 |
-
* @return AbstractPlugin
|
29 |
-
*/
|
30 |
-
public function get_plugin() {
|
31 |
-
return $this->plugin;
|
32 |
-
}
|
33 |
-
|
34 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/SlimPlugin.php
DELETED
@@ -1,20 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Plugin;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Most clean plugin class with only most important details.
|
7 |
-
*/
|
8 |
-
abstract class SlimPlugin implements \WPDesk_Translatable {
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Initializes plugin external state.
|
12 |
-
*
|
13 |
-
* The plugin internal state is initialized in the constructor and the plugin should be internally consistent after creation.
|
14 |
-
* The external state includes hooks execution, communication with other plugins, integration with WC etc.
|
15 |
-
*
|
16 |
-
* @return void
|
17 |
-
*/
|
18 |
-
abstract public function init();
|
19 |
-
}
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/TemplateLoad.php
DELETED
@@ -1,74 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Plugin;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* @deprecated Use wpdesk/wp-view
|
7 |
-
*
|
8 |
-
* @package WPDesk\PluginBuilder\Plugin
|
9 |
-
*/
|
10 |
-
trait TemplateLoad {
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Plugin path.
|
14 |
-
*
|
15 |
-
* @var string
|
16 |
-
*/
|
17 |
-
protected $plugin_path;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Template path.
|
21 |
-
*
|
22 |
-
* @var string
|
23 |
-
*/
|
24 |
-
protected $template_path;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Init base variables for plugin
|
28 |
-
*/
|
29 |
-
public function init_template_base_variables() {
|
30 |
-
$this->plugin_path = $this->plugin_info->get_plugin_dir();
|
31 |
-
$this->template_path = $this->plugin_info->get_text_domain();
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Renders end returns selected template
|
36 |
-
*
|
37 |
-
* @param string $name Name of the template.
|
38 |
-
* @param string $path Additional inner path to the template.
|
39 |
-
* @param array $args args Accessible from template.
|
40 |
-
*
|
41 |
-
* @return string
|
42 |
-
*/
|
43 |
-
public function load_template( $name, $path = '', $args = array() ) {
|
44 |
-
$plugin_template_path = trailingslashit( $this->plugin_path ) . 'templates/';
|
45 |
-
|
46 |
-
// Look within passed path within the theme - this is priority.
|
47 |
-
$template = locate_template(
|
48 |
-
array(
|
49 |
-
trailingslashit( $this->get_template_path() ) . trailingslashit( $path ) . $name . '.php',
|
50 |
-
)
|
51 |
-
);
|
52 |
-
|
53 |
-
if ( ! $template ) {
|
54 |
-
$template = $plugin_template_path . trailingslashit( $path ) . $name . '.php';
|
55 |
-
}
|
56 |
-
|
57 |
-
extract( $args );
|
58 |
-
ob_start();
|
59 |
-
include( $template );
|
60 |
-
|
61 |
-
return ob_get_clean();
|
62 |
-
}
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Get template path.
|
66 |
-
*
|
67 |
-
* @return string
|
68 |
-
*/
|
69 |
-
public function get_template_path() {
|
70 |
-
return trailingslashit( $this->template_path );
|
71 |
-
}
|
72 |
-
|
73 |
-
|
74 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Buildable.php
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Have info about what class should be built by WPDesk_Builder
|
5 |
-
*
|
6 |
-
* have to be compatible with PHP 5.2.x
|
7 |
-
*/
|
8 |
-
interface WPDesk_Buildable {
|
9 |
-
/** @return string */
|
10 |
-
public function get_class_name();
|
11 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Has_Plugin_Info.php
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! interface_exists( 'WPDesk_Translatable' ) ) {
|
4 |
-
require_once __DIR__ . '/Translatable.php';
|
5 |
-
}
|
6 |
-
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Have MUST HAVE info for plugin instantion
|
10 |
-
*
|
11 |
-
* have to be compatible with PHP 5.2.x
|
12 |
-
*/
|
13 |
-
interface WPDesk_Has_Plugin_Info extends WPDesk_Translatable {
|
14 |
-
/**
|
15 |
-
* @return string
|
16 |
-
*/
|
17 |
-
public function get_plugin_file_name();
|
18 |
-
|
19 |
-
/**
|
20 |
-
* @return string
|
21 |
-
*/
|
22 |
-
public function get_plugin_dir();
|
23 |
-
|
24 |
-
/**
|
25 |
-
* @return string
|
26 |
-
*/
|
27 |
-
public function get_version();
|
28 |
-
|
29 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Plugin_Info.php
DELETED
@@ -1,171 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! interface_exists( 'WPDesk_Translatable' ) ) {
|
4 |
-
require_once __DIR__ . '/Translatable.php';
|
5 |
-
}
|
6 |
-
if ( ! interface_exists( 'WPDesk_Buildable' ) ) {
|
7 |
-
require_once __DIR__ . '/Buildable.php';
|
8 |
-
}
|
9 |
-
if ( ! interface_exists( 'WPDesk_Has_Plugin_Info' ) ) {
|
10 |
-
require_once __DIR__ . '/Has_Plugin_Info.php';
|
11 |
-
}
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Structure with core info about plugin
|
15 |
-
*
|
16 |
-
* have to be compatible with PHP 5.2.x
|
17 |
-
*/
|
18 |
-
class WPDesk_Plugin_Info implements WPDesk_Translatable, WPDesk_Buildable, WPDesk_Has_Plugin_Info {
|
19 |
-
/** @var string */
|
20 |
-
private $plugin_file_name;
|
21 |
-
|
22 |
-
/** @var string */
|
23 |
-
private $plugin_dir;
|
24 |
-
|
25 |
-
/** @var string */
|
26 |
-
private $plugin_url;
|
27 |
-
|
28 |
-
/** @var string */
|
29 |
-
private $class_name;
|
30 |
-
|
31 |
-
/** @var string */
|
32 |
-
private $version;
|
33 |
-
|
34 |
-
/** @var string */
|
35 |
-
private $product_id;
|
36 |
-
|
37 |
-
/** @var string */
|
38 |
-
private $plugin_name;
|
39 |
-
|
40 |
-
/** @var \DateTimeInterface */
|
41 |
-
private $release_date;
|
42 |
-
|
43 |
-
/** string */
|
44 |
-
private $text_domain;
|
45 |
-
|
46 |
-
/**
|
47 |
-
* @return string
|
48 |
-
*/
|
49 |
-
public function get_plugin_file_name() {
|
50 |
-
return $this->plugin_file_name;
|
51 |
-
}
|
52 |
-
|
53 |
-
/**
|
54 |
-
* @param string $plugin_name
|
55 |
-
*/
|
56 |
-
public function set_plugin_file_name( $plugin_name ) {
|
57 |
-
$this->plugin_file_name = $plugin_name;
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* @return string
|
62 |
-
*/
|
63 |
-
public function get_plugin_dir() {
|
64 |
-
return $this->plugin_dir;
|
65 |
-
}
|
66 |
-
|
67 |
-
/**
|
68 |
-
* @param string $plugin_dir
|
69 |
-
*/
|
70 |
-
public function set_plugin_dir( $plugin_dir ) {
|
71 |
-
$this->plugin_dir = $plugin_dir;
|
72 |
-
}
|
73 |
-
|
74 |
-
/**
|
75 |
-
* @return string
|
76 |
-
*/
|
77 |
-
public function get_plugin_url() {
|
78 |
-
return $this->plugin_url;
|
79 |
-
}
|
80 |
-
|
81 |
-
/**
|
82 |
-
* @param string $plugin_url
|
83 |
-
*/
|
84 |
-
public function set_plugin_url( $plugin_url ) {
|
85 |
-
$this->plugin_url = $plugin_url;
|
86 |
-
}
|
87 |
-
|
88 |
-
/**
|
89 |
-
* @return string
|
90 |
-
*/
|
91 |
-
public function get_version() {
|
92 |
-
return $this->version;
|
93 |
-
}
|
94 |
-
|
95 |
-
/**
|
96 |
-
* @param string $version
|
97 |
-
*/
|
98 |
-
public function set_version( $version ) {
|
99 |
-
$this->version = $version;
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* @return string
|
104 |
-
*/
|
105 |
-
public function get_product_id() {
|
106 |
-
return $this->product_id;
|
107 |
-
}
|
108 |
-
|
109 |
-
/**
|
110 |
-
* @param string $product_id
|
111 |
-
*/
|
112 |
-
public function set_product_id( $product_id ) {
|
113 |
-
$this->product_id = $product_id;
|
114 |
-
}
|
115 |
-
|
116 |
-
/**
|
117 |
-
* @return string
|
118 |
-
*/
|
119 |
-
public function get_plugin_name() {
|
120 |
-
return $this->plugin_name;
|
121 |
-
}
|
122 |
-
|
123 |
-
/**
|
124 |
-
* @param string $plugin_name
|
125 |
-
*/
|
126 |
-
public function set_plugin_name( $plugin_name ) {
|
127 |
-
$this->plugin_name = $plugin_name;
|
128 |
-
}
|
129 |
-
|
130 |
-
/**
|
131 |
-
* @return DateTimeInterface
|
132 |
-
*/
|
133 |
-
public function get_release_date() {
|
134 |
-
return $this->release_date;
|
135 |
-
}
|
136 |
-
|
137 |
-
/**
|
138 |
-
* @param \DateTimeInterface $release_date
|
139 |
-
*/
|
140 |
-
public function set_release_date( $release_date ) {
|
141 |
-
$this->release_date = $release_date;
|
142 |
-
}
|
143 |
-
|
144 |
-
/**
|
145 |
-
* @return string
|
146 |
-
*/
|
147 |
-
public function get_class_name() {
|
148 |
-
return $this->class_name;
|
149 |
-
}
|
150 |
-
|
151 |
-
/**
|
152 |
-
* @param string $class_name
|
153 |
-
*/
|
154 |
-
public function set_class_name( $class_name ) {
|
155 |
-
$this->class_name = $class_name;
|
156 |
-
}
|
157 |
-
|
158 |
-
/**
|
159 |
-
* @return string
|
160 |
-
*/
|
161 |
-
public function get_text_domain() {
|
162 |
-
return $this->text_domain;
|
163 |
-
}
|
164 |
-
|
165 |
-
/**
|
166 |
-
* @param $value
|
167 |
-
*/
|
168 |
-
public function set_text_domain( $value ) {
|
169 |
-
$this->text_domain = $value;
|
170 |
-
}
|
171 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Translable.php
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* @deprecated Have typo so better use WPDesk_Translatable
|
5 |
-
*/
|
6 |
-
interface WPDesk_Translable {
|
7 |
-
/** @return string */
|
8 |
-
public function get_text_domain();
|
9 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Translatable.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! interface_exists( 'WPDesk_Translable' ) ) {
|
4 |
-
require_once 'Translable.php';
|
5 |
-
}
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Have info about textdomain - how to translate texts
|
9 |
-
*
|
10 |
-
* have to be compatible with PHP 5.2.x
|
11 |
-
*/
|
12 |
-
interface WPDesk_Translatable extends WPDesk_Translable {
|
13 |
-
/** @return string */
|
14 |
-
public function get_text_domain();
|
15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Storage/Exception/ClassAlreadyExists.php
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Storage\Exception;
|
4 |
-
|
5 |
-
class ClassAlreadyExists extends \RuntimeException
|
6 |
-
{
|
7 |
-
|
8 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Storage/Exception/ClassNotExists.php
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Storage\Exception;
|
4 |
-
|
5 |
-
class ClassNotExists extends \RuntimeException
|
6 |
-
{
|
7 |
-
|
8 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Storage/PluginStorage.php
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Storage;
|
4 |
-
|
5 |
-
use WPDesk\PluginBuilder\Plugin\AbstractPlugin;
|
6 |
-
|
7 |
-
interface PluginStorage {
|
8 |
-
|
9 |
-
/**
|
10 |
-
* @param string $class
|
11 |
-
* @param AbstractPlugin $object
|
12 |
-
*/
|
13 |
-
public function add_to_storage( $class, $object );
|
14 |
-
|
15 |
-
/**
|
16 |
-
* @param string $class
|
17 |
-
*
|
18 |
-
* @return AbstractPlugin
|
19 |
-
*/
|
20 |
-
public function get_from_storage( $class );
|
21 |
-
}
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Storage/StaticStorage.php
DELETED
@@ -1,38 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Storage;
|
4 |
-
|
5 |
-
use WPDesk\PluginBuilder\Plugin\AbstractPlugin;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Can store plugin instances in static variable
|
9 |
-
*
|
10 |
-
* @package WPDesk\PluginBuilder\Storage
|
11 |
-
*/
|
12 |
-
class StaticStorage implements PluginStorage {
|
13 |
-
protected static $instances = [];
|
14 |
-
|
15 |
-
/**
|
16 |
-
* @param string $class
|
17 |
-
* @param AbstractPlugin $object
|
18 |
-
*/
|
19 |
-
public function add_to_storage( $class, $object ) {
|
20 |
-
if ( isset( self::$instances[ $class ] ) ) {
|
21 |
-
throw new Exception\ClassAlreadyExists( "Class {$class} already exists" );
|
22 |
-
}
|
23 |
-
self::$instances[ $class ] = $object;
|
24 |
-
}
|
25 |
-
|
26 |
-
/**
|
27 |
-
* @param string $class
|
28 |
-
*
|
29 |
-
* @return AbstractPlugin
|
30 |
-
*/
|
31 |
-
public function get_from_storage( $class ) {
|
32 |
-
if ( isset( self::$instances[ $class ] ) ) {
|
33 |
-
return self::$instances[ $class ];
|
34 |
-
}
|
35 |
-
throw new Exception\ClassNotExists( "Class {$class} not exists in storage" );
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Storage/StorageFactory.php
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Storage;
|
4 |
-
|
5 |
-
class StorageFactory {
|
6 |
-
|
7 |
-
/**
|
8 |
-
* @return PluginStorage
|
9 |
-
*/
|
10 |
-
public function create_storage() {
|
11 |
-
return new WordpressFilterStorage();
|
12 |
-
}
|
13 |
-
}
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-builder/src/Storage/WordpressFilterStorage.php
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\PluginBuilder\Storage;
|
4 |
-
|
5 |
-
use WPDesk\PluginBuilder\Plugin\AbstractPlugin;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Can store plugin instances in WordPress filter system.
|
9 |
-
*
|
10 |
-
* @package WPDesk\PluginBuilder\Storage
|
11 |
-
*/
|
12 |
-
class WordpressFilterStorage implements PluginStorage {
|
13 |
-
const STORAGE_FILTER_NAME = 'wpdesk_plugin_instances';
|
14 |
-
|
15 |
-
/**
|
16 |
-
* @param string $class
|
17 |
-
* @param AbstractPlugin $object
|
18 |
-
*/
|
19 |
-
public function add_to_storage( $class, $object ) {
|
20 |
-
add_filter( self::STORAGE_FILTER_NAME, static function ( $plugins ) use ( $class, $object ) {
|
21 |
-
if ( isset( $plugins[ $class ] ) ) {
|
22 |
-
throw new Exception\ClassAlreadyExists( "Class {$class} already exists" );
|
23 |
-
}
|
24 |
-
$plugins[ $class ] = $object;
|
25 |
-
|
26 |
-
return $plugins;
|
27 |
-
} );
|
28 |
-
|
29 |
-
}
|
30 |
-
|
31 |
-
/**
|
32 |
-
* @param string $class
|
33 |
-
*
|
34 |
-
* @return AbstractPlugin
|
35 |
-
*/
|
36 |
-
public function get_from_storage( $class ) {
|
37 |
-
$plugins = apply_filters( self::STORAGE_FILTER_NAME, [] );
|
38 |
-
if ( isset( $plugins[ $class ] ) ) {
|
39 |
-
return $plugins[ $class ];
|
40 |
-
}
|
41 |
-
throw new Exception\ClassNotExists( "Class {$class} not exists in storage" );
|
42 |
-
}
|
43 |
-
}
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-pointer/CHANGELOG.md
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
## [2.0.0] - 2020-07-14
|
2 |
-
### Fixed
|
3 |
-
- pointer position relative to DOM element
|
4 |
-
|
5 |
-
## [1.0.3] - 2020-06-30
|
6 |
-
### Added
|
7 |
-
- additional pointer CSS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-pointer/LICENSE.md
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
MIT License
|
2 |
-
|
3 |
-
Copyright (c) 2018 WP Desk
|
4 |
-
|
5 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
-
of this software and associated documentation files (the "Software"), to deal
|
7 |
-
in the Software without restriction, including without limitation the rights
|
8 |
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
-
copies of the Software, and to permit persons to whom the Software is
|
10 |
-
furnished to do so, subject to the following conditions:
|
11 |
-
|
12 |
-
The above copyright notice and this permission notice shall be included in all
|
13 |
-
copies or substantial portions of the Software.
|
14 |
-
|
15 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
-
SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-pointer/composer.json
DELETED
@@ -1,38 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"name": "wpdesk/wp-pointer",
|
3 |
-
"description": "Library for displaying Wordpress pointer messages.",
|
4 |
-
"license": "MIT",
|
5 |
-
"keywords": ["wordpress", "pointer", "admin"],
|
6 |
-
"homepage": "https://gitlab.com/wpdesk/wp-pointer",
|
7 |
-
"minimum-stability": "stable",
|
8 |
-
"authors": [
|
9 |
-
{
|
10 |
-
"name": "grola",
|
11 |
-
"email": "grola@wpdesk.net"
|
12 |
-
}
|
13 |
-
],
|
14 |
-
"require": {
|
15 |
-
"php": ">=5.5",
|
16 |
-
"wpdesk/wp-builder": "^1.1"
|
17 |
-
},
|
18 |
-
"require-dev": {
|
19 |
-
"phpunit/phpunit": "<7",
|
20 |
-
"wp-coding-standards/wpcs": "^0.14.1",
|
21 |
-
"squizlabs/php_codesniffer": "^3.0.2",
|
22 |
-
"mockery/mockery": "*",
|
23 |
-
"10up/wp_mock": "*",
|
24 |
-
"wimg/php-compatibility": "^8"
|
25 |
-
},
|
26 |
-
"autoload": {
|
27 |
-
"psr-4": {"WPDesk\\Pointer\\": "src/WPDesk/Pointer/"}
|
28 |
-
},
|
29 |
-
"autoload-dev": {
|
30 |
-
},
|
31 |
-
"scripts": {
|
32 |
-
"phpcs": "phpcs",
|
33 |
-
"phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never",
|
34 |
-
"phpunit-unit-fast": "phpunit --configuration phpunit-unit.xml --no-coverage",
|
35 |
-
"phpunit-integration": "phpunit --configuration phpunit-integration.xml --coverage-text --colors=never",
|
36 |
-
"phpunit-integration-fast": "phpunit --configuration phpunit-integration.xml --no-coverage"
|
37 |
-
}
|
38 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-pointer/src/WPDesk/Pointer/PointerConditions.php
DELETED
@@ -1,111 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\Pointer;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Pointer conditions.
|
7 |
-
*
|
8 |
-
* @package WPDesk\Pointer
|
9 |
-
*/
|
10 |
-
class PointerConditions
|
11 |
-
{
|
12 |
-
|
13 |
-
/**
|
14 |
-
* @var null|string|array
|
15 |
-
*/
|
16 |
-
private $screenId;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* @var null|string
|
20 |
-
*/
|
21 |
-
private $capability;
|
22 |
-
|
23 |
-
/**
|
24 |
-
* PointerConditions constructor.
|
25 |
-
*
|
26 |
-
* @param null|string|array $screenId Screen id. null or empty string - all screens.
|
27 |
-
* @param null|string $capability User capability. null or empty string for all capabilities.
|
28 |
-
*/
|
29 |
-
public function __construct(
|
30 |
-
$screenId = null,
|
31 |
-
$capability = null
|
32 |
-
) {
|
33 |
-
$this->screenId = $screenId;
|
34 |
-
$this->capability = $capability;
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* @return array|string|null
|
39 |
-
*/
|
40 |
-
public function getScreenId()
|
41 |
-
{
|
42 |
-
return $this->screenId;
|
43 |
-
}
|
44 |
-
|
45 |
-
/**
|
46 |
-
* @param array|string|null $screenId
|
47 |
-
*/
|
48 |
-
public function setScreenId($screenId)
|
49 |
-
{
|
50 |
-
$this->screenId = $screenId;
|
51 |
-
}
|
52 |
-
|
53 |
-
/**
|
54 |
-
* @return string
|
55 |
-
*/
|
56 |
-
public function getCapability()
|
57 |
-
{
|
58 |
-
return $this->capability;
|
59 |
-
}
|
60 |
-
|
61 |
-
/**
|
62 |
-
* @param string $capability
|
63 |
-
*/
|
64 |
-
public function setCapability($capability)
|
65 |
-
{
|
66 |
-
$this->capability = $capability;
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* @return bool
|
71 |
-
*/
|
72 |
-
private function areScreenIdMet()
|
73 |
-
{
|
74 |
-
$screenIdMet = false;
|
75 |
-
if (!empty($this->screenId)) {
|
76 |
-
if (!is_array($this->screenId)) {
|
77 |
-
$this->screenId = array($this->screenId);
|
78 |
-
}
|
79 |
-
$screen = get_current_screen();
|
80 |
-
if (null !== $screen && in_array($screen->id, $this->screenId, true)) {
|
81 |
-
$screenIdMet = true;
|
82 |
-
}
|
83 |
-
} else {
|
84 |
-
$screenIdMet = true;
|
85 |
-
}
|
86 |
-
return $screenIdMet;
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* @return bool
|
91 |
-
*/
|
92 |
-
private function areCapabilityMet()
|
93 |
-
{
|
94 |
-
if (!empty($this->capability)) {
|
95 |
-
$capabilityMet = current_user_can($this->capability);
|
96 |
-
} else {
|
97 |
-
$capabilityMet = true;
|
98 |
-
}
|
99 |
-
return $capabilityMet;
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* @return bool
|
104 |
-
*/
|
105 |
-
public function areConditionsMet()
|
106 |
-
{
|
107 |
-
return $this->areCapabilityMet() && $this->areScreenIdMet();
|
108 |
-
}
|
109 |
-
|
110 |
-
}
|
111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-pointer/src/WPDesk/Pointer/PointerMessage.php
DELETED
@@ -1,353 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\Pointer;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* WordPress admin pointer message.
|
7 |
-
*
|
8 |
-
* @package WPDesk\Pointer
|
9 |
-
*/
|
10 |
-
class PointerMessage
|
11 |
-
{
|
12 |
-
const USER_META_DISMISSED_WP_POINTERS = 'dismissed_wp_pointers';
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Is action added?
|
16 |
-
* @var bool
|
17 |
-
*/
|
18 |
-
private $actionAdded = false;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* @var string
|
22 |
-
*/
|
23 |
-
private $id;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* @var string
|
27 |
-
*/
|
28 |
-
private $anchor;
|
29 |
-
|
30 |
-
/**
|
31 |
-
* @var string
|
32 |
-
*/
|
33 |
-
private $content;
|
34 |
-
|
35 |
-
/**
|
36 |
-
* @var string
|
37 |
-
*/
|
38 |
-
private $title;
|
39 |
-
|
40 |
-
/**
|
41 |
-
* @var PointerPosition
|
42 |
-
*/
|
43 |
-
private $position;
|
44 |
-
|
45 |
-
/**
|
46 |
-
* @var string|array
|
47 |
-
*/
|
48 |
-
private $pointerClass;
|
49 |
-
|
50 |
-
/**
|
51 |
-
* @var int
|
52 |
-
*/
|
53 |
-
private $pointerWidth;
|
54 |
-
|
55 |
-
/**
|
56 |
-
* @var PointerConditions
|
57 |
-
*/
|
58 |
-
private $conditions;
|
59 |
-
|
60 |
-
/**
|
61 |
-
* @var array
|
62 |
-
*/
|
63 |
-
private $pointerCss = array();
|
64 |
-
|
65 |
-
/**
|
66 |
-
* @var array
|
67 |
-
*/
|
68 |
-
private $defaultPointerCss = array(
|
69 |
-
'top' => '50%',
|
70 |
-
'left' => '100%',
|
71 |
-
'-webkit-transform' => 'translateY(-50%)',
|
72 |
-
'-ms-transform' => 'translateY(-50%)',
|
73 |
-
'transform' => 'translateY(-50%)',
|
74 |
-
);
|
75 |
-
|
76 |
-
/**
|
77 |
-
* PointerMessage constructor.
|
78 |
-
*
|
79 |
-
* @param string $id
|
80 |
-
* @param string $anchor
|
81 |
-
* @param string $title
|
82 |
-
* @param string $content
|
83 |
-
* @param PointerPosition $position
|
84 |
-
* @param string pointerClass
|
85 |
-
* @param int $pointerWidth
|
86 |
-
* @param null|PointerConditions $conditions Pointer conditions.
|
87 |
-
* @param array $pointerCss Pointer CSS.
|
88 |
-
*/
|
89 |
-
public function __construct(
|
90 |
-
$id,
|
91 |
-
$anchor,
|
92 |
-
$title,
|
93 |
-
$content,
|
94 |
-
$position = null,
|
95 |
-
$pointerClass = 'wp-pointer',
|
96 |
-
$pointerWidth = 320,
|
97 |
-
$conditions = null,
|
98 |
-
$pointerCss = array()
|
99 |
-
) {
|
100 |
-
$this->id = $id;
|
101 |
-
$this->anchor = $anchor;
|
102 |
-
$this->title = $title;
|
103 |
-
$this->content = $content;
|
104 |
-
if ($position === null) {
|
105 |
-
$position = new PointerPosition();
|
106 |
-
}
|
107 |
-
$this->position = $position;
|
108 |
-
$this->pointerClass = $pointerClass;
|
109 |
-
$this->pointerWidth = $pointerWidth;
|
110 |
-
if (null === $conditions) {
|
111 |
-
$this->conditions = new PointerConditions();
|
112 |
-
} else {
|
113 |
-
$this->conditions = $conditions;
|
114 |
-
}
|
115 |
-
$this->pointerCss = $pointerCss;
|
116 |
-
$this->addAction();
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* Enqueue scripts.
|
121 |
-
*/
|
122 |
-
public function enqueueScripts()
|
123 |
-
{
|
124 |
-
wp_enqueue_style('wp-pointer');
|
125 |
-
wp_enqueue_script('wp-pointer');
|
126 |
-
}
|
127 |
-
|
128 |
-
/**
|
129 |
-
* Add notice action.
|
130 |
-
*/
|
131 |
-
protected function addAction()
|
132 |
-
{
|
133 |
-
if (!$this->actionAdded) {
|
134 |
-
add_action('admin_print_footer_scripts', array($this, 'maybeRenderJavascript'));
|
135 |
-
add_action('admin_enqueue_scripts', array($this, 'enqueueScripts'));
|
136 |
-
$this->actionAdded = true;
|
137 |
-
}
|
138 |
-
}
|
139 |
-
|
140 |
-
/**
|
141 |
-
* Remove action.
|
142 |
-
*/
|
143 |
-
public function removeAction()
|
144 |
-
{
|
145 |
-
if ($this->actionAdded) {
|
146 |
-
remove_action('admin_print_footer_scripts', array($this, 'maybeRenderJavascript'));
|
147 |
-
remove_action('admin_enqueue_scripts', array($this, 'enqueueScripts'));
|
148 |
-
$this->actionAdded = false;
|
149 |
-
}
|
150 |
-
}
|
151 |
-
|
152 |
-
|
153 |
-
/**
|
154 |
-
* @return string
|
155 |
-
*/
|
156 |
-
public function getId()
|
157 |
-
{
|
158 |
-
return $this->id;
|
159 |
-
}
|
160 |
-
|
161 |
-
/**
|
162 |
-
* @param string $id
|
163 |
-
*/
|
164 |
-
public function setId($id)
|
165 |
-
{
|
166 |
-
$this->id = $id;
|
167 |
-
}
|
168 |
-
|
169 |
-
/**
|
170 |
-
* @return string
|
171 |
-
*/
|
172 |
-
public function getAnchor()
|
173 |
-
{
|
174 |
-
return $this->anchor;
|
175 |
-
}
|
176 |
-
|
177 |
-
/**
|
178 |
-
* @param string $anchor
|
179 |
-
*/
|
180 |
-
public function setAnchor($anchor)
|
181 |
-
{
|
182 |
-
$this->anchor = $anchor;
|
183 |
-
}
|
184 |
-
|
185 |
-
/**
|
186 |
-
* @return string
|
187 |
-
*/
|
188 |
-
public function getContent()
|
189 |
-
{
|
190 |
-
return $this->content;
|
191 |
-
}
|
192 |
-
|
193 |
-
/**
|
194 |
-
* @param string $content
|
195 |
-
*/
|
196 |
-
public function setContent($content)
|
197 |
-
{
|
198 |
-
$this->content = $content;
|
199 |
-
}
|
200 |
-
|
201 |
-
/**
|
202 |
-
* @return string
|
203 |
-
*/
|
204 |
-
public function getTitle()
|
205 |
-
{
|
206 |
-
return $this->title;
|
207 |
-
}
|
208 |
-
|
209 |
-
/**
|
210 |
-
* @param string $title
|
211 |
-
*/
|
212 |
-
public function setTitle($title)
|
213 |
-
{
|
214 |
-
$this->title = $title;
|
215 |
-
}
|
216 |
-
|
217 |
-
/**
|
218 |
-
* @return array|string
|
219 |
-
*/
|
220 |
-
public function getPosition()
|
221 |
-
{
|
222 |
-
return $this->position;
|
223 |
-
}
|
224 |
-
|
225 |
-
/**
|
226 |
-
* @param array|string $position
|
227 |
-
*/
|
228 |
-
public function setPosition($position)
|
229 |
-
{
|
230 |
-
$this->position = $position;
|
231 |
-
}
|
232 |
-
|
233 |
-
/**
|
234 |
-
* @return array|string
|
235 |
-
*/
|
236 |
-
public function getPointerClass()
|
237 |
-
{
|
238 |
-
return $this->pointerClass;
|
239 |
-
}
|
240 |
-
|
241 |
-
/**
|
242 |
-
* @param array|string $pointerClass
|
243 |
-
*/
|
244 |
-
public function setPointerClass($pointerClass)
|
245 |
-
{
|
246 |
-
$this->pointerClass = $pointerClass;
|
247 |
-
}
|
248 |
-
|
249 |
-
/**
|
250 |
-
* @return int
|
251 |
-
*/
|
252 |
-
public function getPointerWidth()
|
253 |
-
{
|
254 |
-
return $this->pointerWidth;
|
255 |
-
}
|
256 |
-
|
257 |
-
/**
|
258 |
-
* @param int $pointerWidth
|
259 |
-
*/
|
260 |
-
public function setPointerWidth($pointerWidth)
|
261 |
-
{
|
262 |
-
$this->pointerWidth = $pointerWidth;
|
263 |
-
}
|
264 |
-
|
265 |
-
/**
|
266 |
-
* @return PointerConditions
|
267 |
-
*/
|
268 |
-
public function getConditions()
|
269 |
-
{
|
270 |
-
return $this->conditions;
|
271 |
-
}
|
272 |
-
|
273 |
-
/**
|
274 |
-
* @return array
|
275 |
-
*/
|
276 |
-
public function getPointerCss() {
|
277 |
-
return $this->pointerCss;
|
278 |
-
}
|
279 |
-
|
280 |
-
/**
|
281 |
-
* @param PointerConditions $conditions
|
282 |
-
*/
|
283 |
-
public function setConditions($conditions)
|
284 |
-
{
|
285 |
-
$this->conditions = $conditions;
|
286 |
-
}
|
287 |
-
|
288 |
-
/**
|
289 |
-
* Render Java Script for pointer message.
|
290 |
-
*/
|
291 |
-
public function renderJavaScript()
|
292 |
-
{
|
293 |
-
$pointerAnchor = $this->getAnchor();
|
294 |
-
$pointerClass = $this->getPointerClass();
|
295 |
-
$pointerContentId = 'wpdesk_pointer_content_' . $this->getId();
|
296 |
-
$pointerWidth = $this->getPointerWidth();
|
297 |
-
$pointerContent = sprintf(
|
298 |
-
'<h3>%1$s</h3><p id="%2$s">%3$s</p>',
|
299 |
-
$this->title,
|
300 |
-
$pointerContentId,
|
301 |
-
$this->content
|
302 |
-
);
|
303 |
-
$pointerPosition = $this->getPosition();
|
304 |
-
$pointerId = $this->getId();
|
305 |
-
$pointerCss = array_merge($this->defaultPointerCss, $this->getPointerCss());
|
306 |
-
include 'views/html-script-pointer-message.php';
|
307 |
-
}
|
308 |
-
|
309 |
-
/**
|
310 |
-
* Meybe render Java Script for pointer message.
|
311 |
-
*/
|
312 |
-
public function maybeRenderJavascript()
|
313 |
-
{
|
314 |
-
if ($this->conditions->areConditionsMet() && !$this->isDismissed()) {
|
315 |
-
$this->renderJavaScript();
|
316 |
-
}
|
317 |
-
}
|
318 |
-
|
319 |
-
/**
|
320 |
-
* Is pointer message already dismissed?
|
321 |
-
*
|
322 |
-
* @return bool
|
323 |
-
*/
|
324 |
-
private function isDismissed()
|
325 |
-
{
|
326 |
-
$dismissedPointerMessages = array_filter(
|
327 |
-
explode(',', (string) get_user_meta(get_current_user_id(), self::USER_META_DISMISSED_WP_POINTERS, true))
|
328 |
-
);
|
329 |
-
return in_array($this->id, $dismissedPointerMessages, true);
|
330 |
-
}
|
331 |
-
|
332 |
-
/**
|
333 |
-
* Un dismiss pointer message.
|
334 |
-
*/
|
335 |
-
public function unDismiss()
|
336 |
-
{
|
337 |
-
$dismissedPointerMessages = array_filter(
|
338 |
-
explode(',', (string) get_user_meta(get_current_user_id(), self::USER_META_DISMISSED_WP_POINTERS, true))
|
339 |
-
);
|
340 |
-
foreach ($dismissedPointerMessages as $key => $value) {
|
341 |
-
if ($value === $this->getId()) {
|
342 |
-
unset($dismissedPointerMessages[$key]);
|
343 |
-
update_user_meta(
|
344 |
-
get_current_user_id(),
|
345 |
-
self::USER_META_DISMISSED_WP_POINTERS,
|
346 |
-
implode(',', $dismissedPointerMessages)
|
347 |
-
);
|
348 |
-
}
|
349 |
-
}
|
350 |
-
}
|
351 |
-
|
352 |
-
}
|
353 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-pointer/src/WPDesk/Pointer/PointerPosition.php
DELETED
@@ -1,77 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\Pointer;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* WordPress admin pointer message position.
|
7 |
-
*
|
8 |
-
* @package WPDesk\Pointer
|
9 |
-
*/
|
10 |
-
class PointerPosition
|
11 |
-
{
|
12 |
-
|
13 |
-
const TOP = 'top';
|
14 |
-
const RIGHT = 'right';
|
15 |
-
const BOTTOM = 'bottom';
|
16 |
-
const LEFT = 'left';
|
17 |
-
|
18 |
-
/**
|
19 |
-
* @var string
|
20 |
-
*/
|
21 |
-
private $edge = false;
|
22 |
-
|
23 |
-
/**
|
24 |
-
* @var string
|
25 |
-
*/
|
26 |
-
private $align;
|
27 |
-
|
28 |
-
public function __construct(
|
29 |
-
$edge = 'left',
|
30 |
-
$align = 'top'
|
31 |
-
) {
|
32 |
-
$this->edge = $edge;
|
33 |
-
$this->align = $align;
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* @return string
|
38 |
-
*/
|
39 |
-
public function getEdge()
|
40 |
-
{
|
41 |
-
return $this->edge;
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* @param string $edge
|
46 |
-
*/
|
47 |
-
public function setEdge($edge)
|
48 |
-
{
|
49 |
-
$this->edge = $edge;
|
50 |
-
}
|
51 |
-
|
52 |
-
/**
|
53 |
-
* @return string
|
54 |
-
*/
|
55 |
-
public function getAlign()
|
56 |
-
{
|
57 |
-
return $this->align;
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* @param string $align
|
62 |
-
*/
|
63 |
-
public function setAlign($align)
|
64 |
-
{
|
65 |
-
$this->align = $align;
|
66 |
-
}
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Render as JSON.
|
70 |
-
*/
|
71 |
-
public function render()
|
72 |
-
{
|
73 |
-
echo json_encode(array('edge' => $this->edge, 'align' => $this->align));
|
74 |
-
}
|
75 |
-
|
76 |
-
}
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-pointer/src/WPDesk/Pointer/PointersScripts.php
DELETED
@@ -1,57 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WPDesk\Pointer;
|
4 |
-
|
5 |
-
use WPDesk\PluginBuilder\Plugin\Hookable;
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Pointers handler.
|
9 |
-
*
|
10 |
-
* @package WPDesk\Pointer
|
11 |
-
*/
|
12 |
-
class PointersScripts implements Hookable
|
13 |
-
{
|
14 |
-
|
15 |
-
/**
|
16 |
-
* @var array
|
17 |
-
*/
|
18 |
-
private $enqueueOnScreens = array();
|
19 |
-
|
20 |
-
/**
|
21 |
-
* PointersScripts constructor.
|
22 |
-
*
|
23 |
-
* @param null|string|array $enqueueOnScreens Empty for all screens.
|
24 |
-
*/
|
25 |
-
public function __construct($enqueueOnScreens = array())
|
26 |
-
{
|
27 |
-
if (null === $enqueueOnScreens) {
|
28 |
-
$enqueueOnScreens = array();
|
29 |
-
}
|
30 |
-
if (!is_array($enqueueOnScreens)) {
|
31 |
-
$enqueueOnScreens = array($enqueueOnScreens);
|
32 |
-
}
|
33 |
-
$this->enqueueOnScreens = $enqueueOnScreens;
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Hooks.
|
38 |
-
*/
|
39 |
-
public function hooks()
|
40 |
-
{
|
41 |
-
add_action('admin_enqueue_scripts', array($this, 'enqueueScripts'));
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Enqueue scripts.
|
46 |
-
*
|
47 |
-
* @param string $hook
|
48 |
-
*/
|
49 |
-
public function enqueueScripts($hook)
|
50 |
-
{
|
51 |
-
if (count($this->enqueueOnScreens) === 0 || in_array($hook, $this->enqueueOnScreens, true)) {
|
52 |
-
wp_enqueue_style('wp-pointer');
|
53 |
-
wp_enqueue_script('wp-pointer');
|
54 |
-
}
|
55 |
-
}
|
56 |
-
|
57 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/wpdesk/wp-pointer/src/WPDesk/Pointer/views/html-script-pointer-message.php
DELETED
@@ -1,36 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @var string $pointerAnchor
|
4 |
-
* @var string $pointerContent
|
5 |
-
* @var \WPDesk\Pointer\PointerPosition $pointerPosition
|
6 |
-
* @var string $pointerId
|
7 |
-
* @var string $pointerContentId
|
8 |
-
* @var int $pointerWidth
|
9 |
-
* @var array $pointerCss
|
10 |
-
*/
|
11 |
-
?>
|
12 |
-
<script type="text/javascript">
|
13 |
-
jQuery(document).ready( function($) {
|
14 |
-
if(typeof(jQuery().pointer) != 'undefined') {
|
15 |
-
$('<?php echo $pointerAnchor; ?>').pointer({
|
16 |
-
pointerWidth: <?php echo $pointerWidth; ?>,
|
17 |
-
content: <?php echo json_encode($pointerContent); ?>,
|
18 |
-
position: <?php echo $pointerPosition->render(); ?>,
|
19 |
-
<?php if ( $pointerCss ) : ?>
|
20 |
-
show: function(event, t){
|
21 |
-
t.pointer.css(<?php echo json_encode( $pointerCss ); ?>);
|
22 |
-
$('<?php echo $pointerAnchor; ?>').css('position', 'relative');
|
23 |
-
t.pointer.appendTo('<?php echo $pointerAnchor; ?>');
|
24 |
-
},
|
25 |
-
<?php endif; ?>
|
26 |
-
close: function() {
|
27 |
-
$('#<?php echo $pointerContentId; ?>').remove();
|
28 |
-
$.post(ajaxurl, {
|
29 |
-
pointer: '<?php echo $pointerId; ?>',
|
30 |
-
action: 'dismiss-wp-pointer'
|
31 |
-
});
|
32 |
-
},
|
33 |
-
}).pointer('open');
|
34 |
-
}
|
35 |
-
});
|
36 |
-
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor_prefixed/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Has_Plugin_Info.php
CHANGED
@@ -5,11 +5,6 @@ namespace FSVendor;
|
|
5 |
if (!\interface_exists('FSVendor\\WPDesk_Translatable')) {
|
6 |
require_once __DIR__ . '/Translatable.php';
|
7 |
}
|
8 |
-
/**
|
9 |
-
* Have MUST HAVE info for plugin instantion
|
10 |
-
*
|
11 |
-
* have to be compatible with PHP 5.2.x
|
12 |
-
*/
|
13 |
interface WPDesk_Has_Plugin_Info extends \FSVendor\WPDesk_Translatable
|
14 |
{
|
15 |
/**
|
5 |
if (!\interface_exists('FSVendor\\WPDesk_Translatable')) {
|
6 |
require_once __DIR__ . '/Translatable.php';
|
7 |
}
|
|
|
|
|
|
|
|
|
|
|
8 |
interface WPDesk_Has_Plugin_Info extends \FSVendor\WPDesk_Translatable
|
9 |
{
|
10 |
/**
|
vendor_prefixed/wpdesk/wp-builder/src/Plugin/WithoutNamespace/Translatable.php
CHANGED
@@ -5,11 +5,6 @@ namespace FSVendor;
|
|
5 |
if (!\interface_exists('FSVendor\\WPDesk_Translable')) {
|
6 |
require_once 'Translable.php';
|
7 |
}
|
8 |
-
/**
|
9 |
-
* Have info about textdomain - how to translate texts
|
10 |
-
*
|
11 |
-
* have to be compatible with PHP 5.2.x
|
12 |
-
*/
|
13 |
interface WPDesk_Translatable extends \FSVendor\WPDesk_Translable
|
14 |
{
|
15 |
/** @return string */
|
5 |
if (!\interface_exists('FSVendor\\WPDesk_Translable')) {
|
6 |
require_once 'Translable.php';
|
7 |
}
|
|
|
|
|
|
|
|
|
|
|
8 |
interface WPDesk_Translatable extends \FSVendor\WPDesk_Translable
|
9 |
{
|
10 |
/** @return string */
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/assets/css/notices.css
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.flexible-shipping-log button.hide {
|
2 |
+
display: none;
|
3 |
+
}
|
4 |
+
.flexible-shipping-log pre {
|
5 |
+
display: none;
|
6 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/assets/js/notices.js
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery( document ).ready( function () {
|
2 |
+
jQuery( document ).on( 'click', '.flexible-shipping-log>button.show', function(event){
|
3 |
+
event.preventDefault();
|
4 |
+
let $parent = jQuery(this).parent();
|
5 |
+
$parent.find('.hide').show();
|
6 |
+
$parent.find('pre').show();
|
7 |
+
jQuery(this).hide();
|
8 |
+
});
|
9 |
+
jQuery( document ).on( 'click', '.flexible-shipping-log>button.hide', function(event){
|
10 |
+
event.preventDefault();
|
11 |
+
let $parent = jQuery(this).parent();
|
12 |
+
$parent.find('.show').show();
|
13 |
+
$parent.find('pre').hide();
|
14 |
+
jQuery(this).hide();
|
15 |
+
});
|
16 |
+
|
17 |
+
jQuery( document ).on( 'click', '.flexible-shipping-log>button.clipboard', function(event){
|
18 |
+
event.preventDefault();
|
19 |
+
let $temp = jQuery("<textarea>");
|
20 |
+
jQuery('body').append( $temp );
|
21 |
+
$temp.val(jQuery(this).parent().find('pre').text()).select();
|
22 |
+
document.execCommand('copy');
|
23 |
+
$temp.remove();
|
24 |
+
});
|
25 |
+
|
26 |
+
jQuery( document ).on( 'click', 'button.flexible-shipping-log-clipboard-all', function(event){
|
27 |
+
event.preventDefault();
|
28 |
+
let $temp = jQuery("<textarea>");
|
29 |
+
jQuery('body').append( $temp );
|
30 |
+
jQuery(this).parent().find('.flexible-shipping-log').find('pre').each(function(){
|
31 |
+
$temp.val( $temp.val() + "\n\n" + jQuery( this ).text() );
|
32 |
+
});
|
33 |
+
$temp.select();
|
34 |
+
|
35 |
+
document.execCommand('copy');
|
36 |
+
$temp.remove();
|
37 |
+
});
|
38 |
+
|
39 |
+
});
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/composer.json
CHANGED
@@ -11,12 +11,13 @@
|
|
11 |
}
|
12 |
],
|
13 |
"require": {
|
14 |
-
"php": ">=5.6"
|
|
|
|
|
|
|
15 |
},
|
16 |
"require-dev": {
|
17 |
"phpunit\/phpunit": "<7",
|
18 |
-
"wp-coding-standards\/wpcs": "^0.14.1",
|
19 |
-
"squizlabs\/php_codesniffer": "^3.4.2",
|
20 |
"mockery\/mockery": "^1.2",
|
21 |
"10up\/wp_mock": "^0.3"
|
22 |
},
|
@@ -26,6 +27,13 @@
|
|
26 |
}
|
27 |
},
|
28 |
"autoload-dev": {},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
"scripts": {
|
30 |
"phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never",
|
31 |
"phpunit-unit-fast": "phpunit --configuration phpunit-unit.xml --no-coverage",
|
11 |
}
|
12 |
],
|
13 |
"require": {
|
14 |
+
"php": ">=5.6",
|
15 |
+
"wpdesk\/wp-view": "^1.1",
|
16 |
+
"psr\/log": "^1.1",
|
17 |
+
"wpdesk\/wp-plugin-flow": "^2.7"
|
18 |
},
|
19 |
"require-dev": {
|
20 |
"phpunit\/phpunit": "<7",
|
|
|
|
|
21 |
"mockery\/mockery": "^1.2",
|
22 |
"10up\/wp_mock": "^0.3"
|
23 |
},
|
27 |
}
|
28 |
},
|
29 |
"autoload-dev": {},
|
30 |
+
"extra": {
|
31 |
+
"text-domain": "wp-wpdesk-fs-table-rate",
|
32 |
+
"translations-folder": "lang",
|
33 |
+
"po-files": {
|
34 |
+
"pl_PL": "pl_PL.po"
|
35 |
+
}
|
36 |
+
},
|
37 |
"scripts": {
|
38 |
"phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never",
|
39 |
"phpunit-unit-fast": "phpunit --configuration phpunit-unit.xml --no-coverage",
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/AbstractOptions.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Based on options.
|
5 |
+
*
|
6 |
+
* @package WPDesk\FS\TableRate
|
7 |
+
*/
|
8 |
+
namespace FSVendor\WPDesk\FS\TableRate;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Can provide options.
|
12 |
+
*/
|
13 |
+
abstract class AbstractOptions
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @return array
|
17 |
+
*/
|
18 |
+
public abstract function get_options();
|
19 |
+
/**
|
20 |
+
* @param $option_value
|
21 |
+
*
|
22 |
+
* @return string
|
23 |
+
*/
|
24 |
+
public function get_option_label($option_value)
|
25 |
+
{
|
26 |
+
$options = $this->get_options();
|
27 |
+
return isset($options[$option_value]) ? $options[$option_value] : $option_value;
|
28 |
+
}
|
29 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/BasedOnOptions.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Based on options.
|
5 |
+
*
|
6 |
+
* @package WPDesk\FS\TableRate
|
7 |
+
*/
|
8 |
+
namespace FSVendor\WPDesk\FS\TableRate;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Can provide Based On options.
|
12 |
+
*/
|
13 |
+
class BasedOnOptions extends \FSVendor\WPDesk\FS\TableRate\AbstractOptions
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @return array
|
17 |
+
*/
|
18 |
+
public function get_options()
|
19 |
+
{
|
20 |
+
return \apply_filters('flexible_shipping_method_rule_options_based_on', array('none' => \__('None', 'flexible-shipping'), 'value' => \__('Price', 'flexible-shipping'), 'weight' => \__('Weight', 'flexible-shipping')));
|
21 |
+
}
|
22 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/CalculationMethodOptions.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class CartCalculationOptions
|
5 |
+
*
|
6 |
+
* @package WPDesk\FSPro\TableRate
|
7 |
+
*/
|
8 |
+
namespace FSVendor\WPDesk\FS\TableRate;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Can provide calculation method options.
|
12 |
+
*/
|
13 |
+
class CalculationMethodOptions extends \FSVendor\WPDesk\FS\TableRate\AbstractOptions
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @return array
|
17 |
+
*/
|
18 |
+
public function get_options()
|
19 |
+
{
|
20 |
+
return array('sum' => \__('Sum', 'flexible-shipping'));
|
21 |
+
}
|
22 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/ArrayLogger.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Array logger.
|
5 |
+
*
|
6 |
+
* @package WPDesk\FS\TableRate\Logger
|
7 |
+
*/
|
8 |
+
namespace FSVendor\WPDesk\FS\TableRate\Logger;
|
9 |
+
|
10 |
+
use Psr\Log\LoggerInterface;
|
11 |
+
use Psr\Log\LoggerTrait;
|
12 |
+
use FSVendor\WPDesk\View\Renderer\SimplePhpRenderer;
|
13 |
+
use FSVendor\WPDesk\View\Resolver\ChainResolver;
|
14 |
+
use FSVendor\WPDesk\View\Resolver\DirResolver;
|
15 |
+
/**
|
16 |
+
* Can log to array.
|
17 |
+
*/
|
18 |
+
class ArrayLogger implements \Psr\Log\LoggerInterface
|
19 |
+
{
|
20 |
+
use LoggerTrait;
|
21 |
+
/**
|
22 |
+
* @var array
|
23 |
+
*/
|
24 |
+
private $messages = array();
|
25 |
+
/**
|
26 |
+
* @param mixed $level .
|
27 |
+
* @param string $message .
|
28 |
+
* @param array $context .
|
29 |
+
*/
|
30 |
+
public function log($level, $message, array $context = array())
|
31 |
+
{
|
32 |
+
$this->messages[] = array('level' => $level, 'message' => $message, 'context' => $context);
|
33 |
+
}
|
34 |
+
/**
|
35 |
+
* @return array
|
36 |
+
*/
|
37 |
+
public function get_messages()
|
38 |
+
{
|
39 |
+
return $this->messages;
|
40 |
+
}
|
41 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/Assets.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class Assets
|
5 |
+
* @package WPDesk\FS\TableRate\Logger
|
6 |
+
*/
|
7 |
+
namespace FSVendor\WPDesk\FS\TableRate\Logger;
|
8 |
+
|
9 |
+
use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
|
10 |
+
/**
|
11 |
+
* Can enqueue assets.
|
12 |
+
*/
|
13 |
+
class Assets implements \FSVendor\WPDesk\PluginBuilder\Plugin\Hookable
|
14 |
+
{
|
15 |
+
const HANDLE = 'flexible_shipping_notices';
|
16 |
+
private $assets_url;
|
17 |
+
private $scripts_version;
|
18 |
+
/**
|
19 |
+
* Assets constructor.
|
20 |
+
*
|
21 |
+
* @param $assets_url
|
22 |
+
* @param $scripts_version
|
23 |
+
*/
|
24 |
+
public function __construct($assets_url, $scripts_version)
|
25 |
+
{
|
26 |
+
$this->assets_url = $assets_url;
|
27 |
+
$this->scripts_version = $scripts_version;
|
28 |
+
}
|
29 |
+
/**
|
30 |
+
* Hooks.
|
31 |
+
*/
|
32 |
+
public function hooks()
|
33 |
+
{
|
34 |
+
\add_action('wp_enqueue_scripts', array($this, 'enqueue_assets'));
|
35 |
+
}
|
36 |
+
/**
|
37 |
+
* Enqueue assets.
|
38 |
+
*
|
39 |
+
* @internal
|
40 |
+
*/
|
41 |
+
public function enqueue_assets()
|
42 |
+
{
|
43 |
+
\wp_register_script(self::HANDLE, \trailingslashit($this->assets_url) . 'js/notices.js', array(), $this->scripts_version, \true);
|
44 |
+
\wp_enqueue_script(self::HANDLE);
|
45 |
+
\wp_register_style(self::HANDLE, \trailingslashit($this->assets_url) . 'css/notices.css', array(), $this->scripts_version);
|
46 |
+
\wp_enqueue_style(self::HANDLE);
|
47 |
+
}
|
48 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/CanFormatForLog.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Interface CanFormatForLog
|
5 |
+
* @package WPDesk\FS\TableRate\Logger
|
6 |
+
*/
|
7 |
+
namespace FSVendor\WPDesk\FS\TableRate\Logger;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Can format for log.
|
11 |
+
*/
|
12 |
+
interface CanFormatForLog
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* @return string
|
16 |
+
*/
|
17 |
+
public function format_for_log();
|
18 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/NoticeLogger.php
ADDED
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Notice logger.
|
5 |
+
*
|
6 |
+
* @package WPDesk\FS\TableRate\Logger
|
7 |
+
*/
|
8 |
+
namespace FSVendor\WPDesk\FS\TableRate\Logger;
|
9 |
+
|
10 |
+
use Psr\Log\LoggerInterface;
|
11 |
+
use Psr\Log\LoggerTrait;
|
12 |
+
use FSVendor\WPDesk\View\Renderer\SimplePhpRenderer;
|
13 |
+
use FSVendor\WPDesk\View\Resolver\ChainResolver;
|
14 |
+
use FSVendor\WPDesk\View\Resolver\DirResolver;
|
15 |
+
/**
|
16 |
+
* Can log to WC Notice.
|
17 |
+
*/
|
18 |
+
class NoticeLogger implements \Psr\Log\LoggerInterface
|
19 |
+
{
|
20 |
+
use LoggerTrait;
|
21 |
+
/**
|
22 |
+
* @var array
|
23 |
+
*/
|
24 |
+
private $messages = array();
|
25 |
+
/**
|
26 |
+
* @var bool
|
27 |
+
*/
|
28 |
+
private $notice_enabled;
|
29 |
+
/**
|
30 |
+
* @var string
|
31 |
+
*/
|
32 |
+
private $shipping_method_title;
|
33 |
+
/**
|
34 |
+
* @var string
|
35 |
+
*/
|
36 |
+
private $shipping_method_url;
|
37 |
+
/**
|
38 |
+
* NoticeLogger constructor.
|
39 |
+
*
|
40 |
+
* @param string $shipping_method_title .
|
41 |
+
* @param string $shipping_method_url .
|
42 |
+
* @param bool $notice_enabled .
|
43 |
+
*/
|
44 |
+
public function __construct($shipping_method_title, $shipping_method_url, $notice_enabled)
|
45 |
+
{
|
46 |
+
$this->notice_enabled = $notice_enabled;
|
47 |
+
$this->shipping_method_url = $shipping_method_url;
|
48 |
+
$this->shipping_method_title = $shipping_method_title;
|
49 |
+
}
|
50 |
+
/**
|
51 |
+
* @param mixed $level .
|
52 |
+
* @param string $message .
|
53 |
+
* @param array $context .
|
54 |
+
*/
|
55 |
+
public function log($level, $message, array $context = array())
|
56 |
+
{
|
57 |
+
if ($this->notice_enabled) {
|
58 |
+
if (isset($context['section'])) {
|
59 |
+
$context = $context['section'];
|
60 |
+
if (!isset($this->messages[$context])) {
|
61 |
+
$this->messages[$context] = array();
|
62 |
+
}
|
63 |
+
$this->messages[$context][] = array('level' => $level, 'message' => $message, 'context' => $context);
|
64 |
+
}
|
65 |
+
}
|
66 |
+
}
|
67 |
+
/**
|
68 |
+
* Show notice if logger is enabled.
|
69 |
+
*/
|
70 |
+
public function show_notice_if_enabled()
|
71 |
+
{
|
72 |
+
if ($this->notice_enabled && \count($this->messages)) {
|
73 |
+
$content = $this->prepare_notice_content();
|
74 |
+
if (!\wc_has_notice($content, 'notice')) {
|
75 |
+
\wc_add_notice($content, 'notice');
|
76 |
+
/**
|
77 |
+
* Do actions when Flexible Shipping debug notice is added.
|
78 |
+
*
|
79 |
+
* @param string $content Notice content.
|
80 |
+
*/
|
81 |
+
\do_action('flexible_shipping_debug_notice_added', $content);
|
82 |
+
}
|
83 |
+
}
|
84 |
+
}
|
85 |
+
/**
|
86 |
+
* Prepare notice content.
|
87 |
+
*
|
88 |
+
* @return string
|
89 |
+
*/
|
90 |
+
private function prepare_notice_content()
|
91 |
+
{
|
92 |
+
$renderer = new \FSVendor\WPDesk\View\Renderer\SimplePhpRenderer(new \FSVendor\WPDesk\View\Resolver\DirResolver(__DIR__ . '/view'));
|
93 |
+
$content = $renderer->render('display-notice-header', array('shipping_method_url' => $this->shipping_method_url, 'shipping_method_title' => $this->shipping_method_title));
|
94 |
+
foreach ($this->messages as $section => $section_messages) {
|
95 |
+
$section_content = $this->prepare_content_from_section_messages($section_messages);
|
96 |
+
$content .= $renderer->render('display-notice-content-single-value', array('section' => $section, 'section_content' => $section_content));
|
97 |
+
}
|
98 |
+
$content .= $renderer->render('display-notice-footer');
|
99 |
+
return $content;
|
100 |
+
}
|
101 |
+
/**
|
102 |
+
* @param array $section_messages .
|
103 |
+
*
|
104 |
+
* @return string
|
105 |
+
*/
|
106 |
+
private function prepare_content_from_section_messages(array $section_messages)
|
107 |
+
{
|
108 |
+
$content = '';
|
109 |
+
foreach ($section_messages as $message) {
|
110 |
+
$content .= $message['message'] . \PHP_EOL;
|
111 |
+
}
|
112 |
+
return \trim($content);
|
113 |
+
}
|
114 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/ShippingMethodLogger.php
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Shipping method logger.
|
5 |
+
*
|
6 |
+
* @package WPDesk\FS\TableRate\Logger
|
7 |
+
*/
|
8 |
+
namespace FSVendor\WPDesk\FS\TableRate\Logger;
|
9 |
+
|
10 |
+
use Psr\Log\LoggerInterface;
|
11 |
+
use Psr\Log\LoggerTrait;
|
12 |
+
/**
|
13 |
+
* Can log shipping method messages.
|
14 |
+
*/
|
15 |
+
class ShippingMethodLogger implements \Psr\Log\LoggerInterface
|
16 |
+
{
|
17 |
+
use LoggerTrait;
|
18 |
+
/**
|
19 |
+
* @var LoggerInterface
|
20 |
+
*/
|
21 |
+
private $fs_logger;
|
22 |
+
/**
|
23 |
+
* @var LoggerInterface
|
24 |
+
*/
|
25 |
+
private $notice_logger;
|
26 |
+
/**
|
27 |
+
* ShippingMethodLogger constructor.
|
28 |
+
*
|
29 |
+
* @param LoggerInterface $fs_logger
|
30 |
+
* @param NoticeLogger $notice_logger
|
31 |
+
*/
|
32 |
+
public function __construct(\Psr\Log\LoggerInterface $fs_logger, \Psr\Log\LoggerInterface $notice_logger)
|
33 |
+
{
|
34 |
+
$this->fs_logger = $fs_logger;
|
35 |
+
$this->notice_logger = $notice_logger;
|
36 |
+
}
|
37 |
+
/**
|
38 |
+
* @param mixed $level .
|
39 |
+
* @param string $message .
|
40 |
+
* @param array $context .
|
41 |
+
*/
|
42 |
+
public function log($level, $message, array $context = array())
|
43 |
+
{
|
44 |
+
$this->fs_logger->log($level, $message, $context);
|
45 |
+
$this->notice_logger->log($level, $message, $context);
|
46 |
+
}
|
47 |
+
/**
|
48 |
+
* Log entries from array logger.
|
49 |
+
*
|
50 |
+
* @param ArrayLogger $array_logger
|
51 |
+
* @param array $context
|
52 |
+
*/
|
53 |
+
public function log_from_array_logger(\FSVendor\WPDesk\FS\TableRate\Logger\ArrayLogger $array_logger, array $context = array())
|
54 |
+
{
|
55 |
+
foreach ($array_logger->get_messages() as $message) {
|
56 |
+
$this->log($message['level'], $message['message'], \array_merge($message['context'], $context));
|
57 |
+
}
|
58 |
+
}
|
59 |
+
/**
|
60 |
+
* Show notice if enabled.
|
61 |
+
*/
|
62 |
+
public function show_notice_if_enabled()
|
63 |
+
{
|
64 |
+
$this->notice_logger->show_notice_if_enabled();
|
65 |
+
}
|
66 |
+
/**
|
67 |
+
* @return array
|
68 |
+
*/
|
69 |
+
public function get_configuration_section_context()
|
70 |
+
{
|
71 |
+
return array('section' => \__('shipping method configuration', 'flexible-shipping'));
|
72 |
+
}
|
73 |
+
/**
|
74 |
+
* @return array
|
75 |
+
*/
|
76 |
+
public function get_input_data_context()
|
77 |
+
{
|
78 |
+
return array('section' => \__('input data', 'flexible-shipping'));
|
79 |
+
}
|
80 |
+
/**
|
81 |
+
* @return array
|
82 |
+
*/
|
83 |
+
public function get_rule_context($rule_triggered)
|
84 |
+
{
|
85 |
+
return array('section' => \sprintf(\__('rules (%1$s)', 'flexible-shipping'), $rule_triggered ? \__('triggered', 'flexible-shipping') : \__('not triggered', 'flexible-shipping')));
|
86 |
+
}
|
87 |
+
/**
|
88 |
+
* @return array
|
89 |
+
*/
|
90 |
+
public function get_results_context()
|
91 |
+
{
|
92 |
+
return array('section' => \__('the result of shipping method\'s usage', 'flexible-shipping'));
|
93 |
+
}
|
94 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/view/display-notice-content-single-value.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FSVendor;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @var string $section
|
7 |
+
* @var string $section_content
|
8 |
+
*/
|
9 |
+
?><br/>
|
10 |
+
<div class="flexible-shipping-log">
|
11 |
+
<button class="small show"><?php
|
12 |
+
echo \sprintf(\__('Show %1$s', 'flexible-shipping'), $section);
|
13 |
+
?></button>
|
14 |
+
<button class="small hide"><?php
|
15 |
+
echo \sprintf(\__('Hide %1$s', 'flexible-shipping'), $section);
|
16 |
+
?></button>
|
17 |
+
<button class="small clipboard"><?php
|
18 |
+
echo \sprintf(\__('Copy %1$s', 'flexible-shipping'), $section);
|
19 |
+
?></button>
|
20 |
+
<pre><?php
|
21 |
+
echo \esc_html($section_content);
|
22 |
+
?> </pre>
|
23 |
+
</div><?php
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/view/display-notice-footer.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FSVendor;
|
4 |
+
|
5 |
+
/**
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
?><br/><button class="small flexible-shipping-log-clipboard-all"><?php
|
9 |
+
echo \esc_html(\__('Copy all data', 'flexible-shipping'));
|
10 |
+
?></button><?php
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Logger/view/display-notice-header.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace FSVendor;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @var string $shipping_method_url
|
7 |
+
* @var string $shipping_method_title
|
8 |
+
*/
|
9 |
+
echo \sprintf(\__('FS Debug mode for %1$s%2$s%3$s shipping method.', 'flexible-shipping'), '<a href="' . \esc_attr($shipping_method_url) . '" target="_blank">', \esc_html($shipping_method_title), '</a>');
|
10 |
+
?><br/>
|
11 |
+
<?php
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/CheckboxValue.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Trait CheckboxValue
|
5 |
+
*
|
6 |
+
* @package WPDesk\FS\TableRate\Settings
|
7 |
+
*/
|
8 |
+
namespace FSVendor\WPDesk\FS\TableRate\Settings;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Checkbox value methods.
|
12 |
+
*/
|
13 |
+
trait CheckboxValue
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @param $checkbox_value
|
17 |
+
*
|
18 |
+
* @return string
|
19 |
+
*/
|
20 |
+
protected function get_as_translated_checkbox_value($checkbox_value)
|
21 |
+
{
|
22 |
+
if (\in_array($checkbox_value, array('yes', 'no'))) {
|
23 |
+
return 'yes' === $checkbox_value ? \__('yes', 'flexible-shipping') : \__('no', 'flexible-shipping');
|
24 |
+
}
|
25 |
+
return $checkbox_value;
|
26 |
+
}
|
27 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/IntegrationSettings.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Integration settings.
|
5 |
+
*
|
6 |
+
* @package WPDesk\FS\TableRate\Settings
|
7 |
+
*/
|
8 |
+
namespace FSVendor\WPDesk\FS\TableRate\Settings;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* FS Integration settings on shipping method.
|
12 |
+
*/
|
13 |
+
interface IntegrationSettings
|
14 |
+
{
|
15 |
+
public function get_name();
|
16 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/IntegrationSettingsFactory.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Integration settings Factory.
|
5 |
+
*
|
6 |
+
* @package WPDesk\FS\TableRate\Settings
|
7 |
+
*/
|
8 |
+
namespace FSVendor\WPDesk\FS\TableRate\Settings;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Can create Integration settings.
|
12 |
+
*/
|
13 |
+
class IntegrationSettingsFactory
|
14 |
+
{
|
15 |
+
const INTEGRATION_NONE = 'none';
|
16 |
+
/**
|
17 |
+
* @param array $shipping_method_array
|
18 |
+
*
|
19 |
+
* @return IntegrationSettingsImplementation
|
20 |
+
*/
|
21 |
+
public static function create_from_shipping_method_settings($shipping_method_array)
|
22 |
+
{
|
23 |
+
return new \FSVendor\WPDesk\FS\TableRate\Settings\IntegrationSettingsImplementation(isset($shipping_method_array['method_integration']) ? $shipping_method_array['method_integration'] : self::INTEGRATION_NONE);
|
24 |
+
}
|
25 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/IntegrationSettingsImplementation.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class IntegrationSettingsImplementation
|
5 |
+
* @package WPDesk\FS\TableRate\Settings
|
6 |
+
*/
|
7 |
+
namespace FSVendor\WPDesk\FS\TableRate\Settings;
|
8 |
+
|
9 |
+
use FSVendor\WPDesk\FS\TableRate\Logger\CanFormatForLog;
|
10 |
+
/**
|
11 |
+
* Integration settings implementation.
|
12 |
+
*/
|
13 |
+
class IntegrationSettingsImplementation implements \FSVendor\WPDesk\FS\TableRate\Settings\IntegrationSettings, \FSVendor\WPDesk\FS\TableRate\Logger\CanFormatForLog
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
+
private $name;
|
19 |
+
/**
|
20 |
+
* IntegrationSettingsImplementation constructor.
|
21 |
+
*
|
22 |
+
* @param string $name
|
23 |
+
*/
|
24 |
+
public function __construct($name)
|
25 |
+
{
|
26 |
+
$this->name = $name;
|
27 |
+
}
|
28 |
+
/**
|
29 |
+
* @return string
|
30 |
+
*/
|
31 |
+
public function get_name()
|
32 |
+
{
|
33 |
+
return $this->name;
|
34 |
+
}
|
35 |
+
/**
|
36 |
+
* @return string
|
37 |
+
*/
|
38 |
+
public function format_for_log()
|
39 |
+
{
|
40 |
+
$integrations_options = \apply_filters('flexible_shipping_integration_options', array('' => \__('None', 'flexible-shipping')));
|
41 |
+
return \sprintf(\__('Integration: %1$s', 'flexible-shipping'), isset($integrations_options[$this->name]) ? $integrations_options[$this->name] : $this->name) . "\n";
|
42 |
+
}
|
43 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/MethodSettings.php
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Method settings.
|
5 |
+
* @package WPDesk\FS\TableRate\Settings
|
6 |
+
*/
|
7 |
+
namespace FSVendor\WPDesk\FS\TableRate\Settings;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* FS Shipping method settings.
|
11 |
+
*/
|
12 |
+
interface MethodSettings
|
13 |
+
{
|
14 |
+
/**
|
15 |
+
* @return string
|
16 |
+
*/
|
17 |
+
public function get_id();
|
18 |
+
/**
|
19 |
+
* @return string
|
20 |
+
*/
|
21 |
+
public function get_enabled();
|
22 |
+
/**
|
23 |
+
* @return string
|
24 |
+
*/
|
25 |
+
public function get_title();
|
26 |
+
/**
|
27 |
+
* @return string
|
28 |
+
*/
|
29 |
+
public function get_description();
|
30 |
+
/**
|
31 |
+
* @return string
|
32 |
+
*/
|
33 |
+
public function get_free_shipping();
|
34 |
+
/**
|
35 |
+
* @return string
|
36 |
+
*/
|
37 |
+
public function get_free_shipping_label();
|
38 |
+
/**
|
39 |
+
* @return string
|
40 |
+
*/
|
41 |
+
public function get_free_shipping_cart_notice();
|
42 |
+
/**
|
43 |
+
* @return string
|
44 |
+
*/
|
45 |
+
public function get_calculation_method();
|
46 |
+
/**
|
47 |
+
* @return string
|
48 |
+
*/
|
49 |
+
public function get_visible();
|
50 |
+
/**
|
51 |
+
* @return string
|
52 |
+
*/
|
53 |
+
public function get_default();
|
54 |
+
/**
|
55 |
+
* @return string
|
56 |
+
*/
|
57 |
+
public function get_debug_mode();
|
58 |
+
/**
|
59 |
+
* @return string
|
60 |
+
*/
|
61 |
+
public function get_integration();
|
62 |
+
/**
|
63 |
+
* @return IntegrationSettings|null
|
64 |
+
*/
|
65 |
+
public function get_integration_settings();
|
66 |
+
/**
|
67 |
+
* @return RuleSettings[]
|
68 |
+
*/
|
69 |
+
public function get_rules_settings();
|
70 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/MethodSettingsFactory.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Method Factory.
|
5 |
+
*
|
6 |
+
* @package WPDesk\FS\TableRate\Settings
|
7 |
+
*/
|
8 |
+
namespace FSVendor\WPDesk\FS\TableRate\Settings;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Can create Method.
|
12 |
+
*/
|
13 |
+
class MethodSettingsFactory
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @param array $shipping_method_array
|
17 |
+
*
|
18 |
+
* @return MethodSettings
|
19 |
+
*/
|
20 |
+
public static function create_from_array($shipping_method_array)
|
21 |
+
{
|
22 |
+
return new \FSVendor\WPDesk\FS\TableRate\Settings\MethodSettingsImplementation(isset($shipping_method_array['id']) ? $shipping_method_array['id'] : 'no', isset($shipping_method_array['method_enabled']) ? $shipping_method_array['method_enabled'] : 'no', isset($shipping_method_array['method_title']) ? $shipping_method_array['method_title'] : '', isset($shipping_method_array['method_description']) ? $shipping_method_array['method_description'] : '', isset($shipping_method_array['method_free_shipping']) ? $shipping_method_array['method_free_shipping'] : '', isset($shipping_method_array['method_free_shipping_label']) ? $shipping_method_array['method_free_shipping_label'] : '', isset($shipping_method_array['method_free_shipping_cart_notice']) ? $shipping_method_array['method_free_shipping_cart_notice'] : 'no', isset($shipping_method_array['method_calculation_method']) ? $shipping_method_array['method_calculation_method'] : 'sum', isset($shipping_method_array['method_visibility']) ? $shipping_method_array['method_visibility'] : 'no', isset($shipping_method_array['method_default']) ? $shipping_method_array['method_default'] : 'no', isset($shipping_method_array['method_debug_mode']) ? $shipping_method_array['method_debug_mode'] : 'no', isset($shipping_method_array['method_integration']) ? $shipping_method_array['method_integration'] : 'no', \FSVendor\WPDesk\FS\TableRate\Settings\IntegrationSettingsFactory::create_from_shipping_method_settings($shipping_method_array), isset($shipping_method_array['method_rules']) ? \FSVendor\WPDesk\FS\TableRate\Settings\RuleSettingsFactory::create_rules_from_shipping_rules_array($shipping_method_array['method_rules']) : array());
|
23 |
+
}
|
24 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/MethodSettingsImplementation.php
ADDED
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Method Settings Implementation.
|
5 |
+
*
|
6 |
+
* @package WPDesk\FS\TableRate\Settings
|
7 |
+
*/
|
8 |
+
namespace FSVendor\WPDesk\FS\TableRate\Settings;
|
9 |
+
|
10 |
+
use FSVendor\WPDesk\FS\TableRate\CalculationMethodOptions;
|
11 |
+
use FSVendor\WPDesk\FS\TableRate\Logger\CanFormatForLog;
|
12 |
+
/**
|
13 |
+
* Class MethodSettingsImplementation
|
14 |
+
*/
|
15 |
+
class MethodSettingsImplementation implements \FSVendor\WPDesk\FS\TableRate\Settings\MethodSettings, \FSVendor\WPDesk\FS\TableRate\Logger\CanFormatForLog
|
16 |
+
{
|
17 |
+
use CheckboxValue;
|
18 |
+
/**
|
19 |
+
* @var string
|
20 |
+
*/
|
21 |
+
private $id;
|
22 |
+
/**
|
23 |
+
* @var string
|
24 |
+
*/
|
25 |
+
private $enabled;
|
26 |
+
/**
|
27 |
+
* @var string
|
28 |
+
*/
|
29 |
+
private $title;
|
30 |
+
/**
|
31 |
+
* @var string
|
32 |
+
*/
|
33 |
+
private $description;
|
34 |
+
/**
|
35 |
+
* @var float
|
36 |
+
*/
|
37 |
+
private $free_shipping;
|
38 |
+
/**
|
39 |
+
* @var string
|
40 |
+
*/
|
41 |
+
private $free_shipping_label;
|
42 |
+
/**
|
43 |
+
* @var bool
|
44 |
+
*/
|
45 |
+
private $free_shipping_cart_notice;
|
46 |
+
/**
|
47 |
+
* @var string
|
48 |
+
*/
|
49 |
+
private $calculation_method;
|
50 |
+
/**
|
51 |
+
* @var bool
|
52 |
+
*/
|
53 |
+
private $visibility;
|
54 |
+
/**
|
55 |
+
* @var bool
|
56 |
+
*/
|
57 |
+
private $default;
|
58 |
+
/**
|
59 |
+
* @var bool
|
60 |
+
*/
|
61 |
+
private $debug_mode;
|
62 |
+
/**
|
63 |
+
* @var string
|
64 |
+
*/
|
65 |
+
private $integration;
|
66 |
+
/**
|
67 |
+
* @var IntegrationSettingsImplementation
|
68 |
+
*/
|
69 |
+
private $integration_settings;
|
70 |
+
/**
|
71 |
+
* @var RuleSettings[]
|
72 |
+
*/
|
73 |
+
private $rules_settings;
|
74 |
+
/**
|
75 |
+
* MethodSettingsImplementation constructor.
|
76 |
+
*
|
77 |
+
* @param string $id
|
78 |
+
* @param string $enabled
|
79 |
+
* @param string $title
|
80 |
+
* @param string $description
|
81 |
+
* @param string $free_shipping
|
82 |
+
* @param string $free_shipping_label
|
83 |
+
* @param string $free_shipping_cart_notice
|
84 |
+
* @param string $calculation_method
|
85 |
+
* @param string $visibility
|
86 |
+
* @param string $default
|
87 |
+
* @param string $debug_mode
|
88 |
+
* @param string $integration
|
89 |
+
* @param IntegrationSettingsImplementation $integration_settings
|
90 |
+
* @param RuleSettings[] $rules_settings
|
91 |
+
*/
|
92 |
+
public function __construct($id, $enabled, $title, $description, $free_shipping, $free_shipping_label, $free_shipping_cart_notice, $calculation_method, $visibility, $default, $debug_mode, $integration, \FSVendor\WPDesk\FS\TableRate\Settings\IntegrationSettingsImplementation $integration_settings, array $rules_settings)
|
93 |
+
{
|
94 |
+
$this->id = $id;
|
95 |
+
$this->enabled = $enabled;
|
96 |
+
$this->title = $title;
|
97 |
+
$this->description = $description;
|
98 |
+
$this->free_shipping = $free_shipping;
|
99 |
+
$this->free_shipping_label = $free_shipping_label;
|
100 |
+
$this->free_shipping_cart_notice = $free_shipping_cart_notice;
|
101 |
+
$this->calculation_method = $calculation_method;
|
102 |
+
$this->visibility = $visibility;
|
103 |
+
$this->default = $default;
|
104 |
+
$this->debug_mode = $debug_mode;
|
105 |
+
$this->integration = $integration;
|
106 |
+
$this->integration_settings = $integration_settings;
|
107 |
+
$this->rules_settings = $rules_settings;
|
108 |
+
}
|
109 |
+
/**
|
110 |
+
* @return string
|
111 |
+
*/
|
112 |
+
public function get_id()
|
113 |
+
{
|
114 |
+
return $this->id;
|
115 |
+
}
|
116 |
+
/**
|
117 |
+
* @return bool
|
118 |
+
*/
|
119 |
+
public function get_enabled()
|
120 |
+
{
|
121 |
+
return $this->enabled;
|
122 |
+
}
|
123 |
+
/**
|
124 |
+
* @return string
|
125 |
+
*/
|
126 |
+
public function get_title()
|
127 |
+
{
|
128 |
+
return $this->title;
|
129 |
+
}
|
130 |
+
/**
|
131 |
+
* @return string
|
132 |
+
*/
|
133 |
+
public function get_description()
|
134 |
+
{
|
135 |
+
return $this->description;
|
136 |
+
}
|
137 |
+
/**
|
138 |
+
* @return float
|
139 |
+
*/
|
140 |
+
public function get_free_shipping()
|
141 |
+
{
|
142 |
+
return $this->free_shipping;
|
143 |
+
}
|
144 |
+
/**
|
145 |
+
* @return string
|
146 |
+
*/
|
147 |
+
public function get_free_shipping_label()
|
148 |
+
{
|
149 |
+
return $this->free_shipping_label;
|
150 |
+
}
|
151 |
+
/**
|
152 |
+
* @return bool
|
153 |
+
*/
|
154 |
+
public function get_free_shipping_cart_notice()
|
155 |
+
{
|
156 |
+
return $this->free_shipping_cart_notice;
|
157 |
+
}
|
158 |
+
/**
|
159 |
+
* @return string
|
160 |
+
*/
|
161 |
+
public function get_calculation_method()
|
162 |
+
{
|
163 |
+
return $this->calculation_method;
|
164 |
+
}
|
165 |
+
/**
|
166 |
+
* @return bool
|
167 |
+
*/
|
168 |
+
public function get_visible()
|
169 |
+
{
|
170 |
+
return $this->visibility;
|
171 |
+
}
|
172 |
+
/**
|
173 |
+
* @return bool
|
174 |
+
*/
|
175 |
+
public function get_default()
|
176 |
+
{
|
177 |
+
return $this->default;
|
178 |
+
}
|
179 |
+
/**
|
180 |
+
* @return bool
|
181 |
+
*/
|
182 |
+
public function get_debug_mode()
|
183 |
+
{
|
184 |
+
return $this->debug_mode;
|
185 |
+
}
|
186 |
+
/**
|
187 |
+
* @return string
|
188 |
+
*/
|
189 |
+
public function get_integration()
|
190 |
+
{
|
191 |
+
return $this->integration;
|
192 |
+
}
|
193 |
+
/**
|
194 |
+
* @return IntegrationSettingsImplementation
|
195 |
+
*/
|
196 |
+
public function get_integration_settings()
|
197 |
+
{
|
198 |
+
return $this->integration_settings;
|
199 |
+
}
|
200 |
+
/**
|
201 |
+
* @return RuleSettings[]
|
202 |
+
*/
|
203 |
+
public function get_rules_settings()
|
204 |
+
{
|
205 |
+
return $this->rules_settings;
|
206 |
+
}
|
207 |
+
/**
|
208 |
+
* @return string
|
209 |
+
*/
|
210 |
+
public function format_for_log()
|
211 |
+
{
|
212 |
+
return \sprintf(\__('Method settings:%1$s Enabled: %2$s Method Title: %3$s Method Description: %4$s Free Shipping: %5$s Free Shipping Label: %6$s \'Left to free shipping\' notice: %7$s Rules Calculation: %8$s Visibility (Show only for logged in users): %9$s Default: %10$s Debug mode: %11$s', 'flexible-shipping'), "\n", $this->get_as_translated_checkbox_value($this->get_enabled()) . "\n", $this->get_title() . "\n", $this->get_description() . "\n", $this->get_free_shipping() . "\n", $this->get_free_shipping_label() . "\n", $this->get_as_translated_checkbox_value($this->get_free_shipping_cart_notice()) . "\n", (new \FSVendor\WPDesk\FS\TableRate\CalculationMethodOptions())->get_option_label($this->get_calculation_method()) . "\n", $this->get_as_translated_checkbox_value($this->get_visible()) . "\n", $this->get_as_translated_checkbox_value($this->get_default()) . "\n", $this->get_as_translated_checkbox_value($this->get_debug_mode()) . "\n") . $this->integration_settings->format_for_log();
|
213 |
+
}
|
214 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/RuleSettings.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Rule settings.
|
5 |
+
*
|
6 |
+
* @package WPDesk\FS\TableRate\Settings
|
7 |
+
*/
|
8 |
+
namespace FSVendor\WPDesk\FS\TableRate\Settings;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Rule settings interface.
|
12 |
+
*/
|
13 |
+
interface RuleSettings
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @return string
|
17 |
+
*/
|
18 |
+
public function get_rule_key();
|
19 |
+
/**
|
20 |
+
* @return string
|
21 |
+
*/
|
22 |
+
public function get_based_on();
|
23 |
+
/**
|
24 |
+
* @return boolean
|
25 |
+
*/
|
26 |
+
public function is_based_on_weight();
|
27 |
+
/**
|
28 |
+
* @return boolean
|
29 |
+
*/
|
30 |
+
public function is_based_on_value();
|
31 |
+
/**
|
32 |
+
* @return boolean
|
33 |
+
*/
|
34 |
+
public function is_based_on_none();
|
35 |
+
/**
|
36 |
+
* @return string
|
37 |
+
*/
|
38 |
+
public function get_min();
|
39 |
+
/**
|
40 |
+
* @return string
|
41 |
+
*/
|
42 |
+
public function get_max();
|
43 |
+
/**
|
44 |
+
* @return string
|
45 |
+
*/
|
46 |
+
public function get_cost_per_order();
|
47 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/RuleSettingsFactory.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Rule Factory.
|
5 |
+
*
|
6 |
+
* @package WPDesk\FS\TableRate\Settings
|
7 |
+
*/
|
8 |
+
namespace FSVendor\WPDesk\FS\TableRate\Settings;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Can create Rules.
|
12 |
+
*/
|
13 |
+
class RuleSettingsFactory
|
14 |
+
{
|
15 |
+
const BASED_ON_NONE = 'none';
|
16 |
+
/**
|
17 |
+
*
|
18 |
+
* @param string $rule_key
|
19 |
+
* @param array $shipping_rule_array
|
20 |
+
*
|
21 |
+
* @return RuleSettings
|
22 |
+
*/
|
23 |
+
public static function create_single_from_array($rule_key, $shipping_rule_array)
|
24 |
+
{
|
25 |
+
return new \FSVendor\WPDesk\FS\TableRate\Settings\RuleSettingsImplementation($rule_key, isset($shipping_rule_array['based_on']) ? $shipping_rule_array['based_on'] : self::BASED_ON_NONE, isset($shipping_rule_array['min']) ? $shipping_rule_array['min'] : '', isset($shipping_rule_array['max']) ? $shipping_rule_array['max'] : '', isset($shipping_rule_array['cost_per_order']) ? $shipping_rule_array['cost_per_order'] : '');
|
26 |
+
}
|
27 |
+
/**
|
28 |
+
* @param array $shipping_rules_array
|
29 |
+
*
|
30 |
+
* @return RuleSettings[]
|
31 |
+
*/
|
32 |
+
public static function create_rules_from_shipping_rules_array(array $shipping_rules_array)
|
33 |
+
{
|
34 |
+
$rules = array();
|
35 |
+
foreach ($shipping_rules_array as $rule_key => $shipping_rule_array) {
|
36 |
+
$rules[] = self::create_single_from_array($rule_key, $shipping_rule_array);
|
37 |
+
}
|
38 |
+
return $rules;
|
39 |
+
}
|
40 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/RuleSettingsImplementation.php
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Rule settings implementation.
|
5 |
+
*
|
6 |
+
* @package WPDesk\FS\TableRate\Settings
|
7 |
+
*/
|
8 |
+
namespace FSVendor\WPDesk\FS\TableRate\Settings;
|
9 |
+
|
10 |
+
use FSVendor\WPDesk\FS\TableRate\BasedOnOptions;
|
11 |
+
use FSVendor\WPDesk\FS\TableRate\Logger\CanFormatForLog;
|
12 |
+
/**
|
13 |
+
* Rule Settings Implementation
|
14 |
+
*/
|
15 |
+
class RuleSettingsImplementation implements \FSVendor\WPDesk\FS\TableRate\Settings\RuleSettings, \FSVendor\WPDesk\FS\TableRate\Logger\CanFormatForLog
|
16 |
+
{
|
17 |
+
const BASED_ON_NONE = 'none';
|
18 |
+
const BASED_ON_VALUE = 'value';
|
19 |
+
const BASED_ON_WEIGHT = 'weight';
|
20 |
+
/**
|
21 |
+
* @var string
|
22 |
+
*/
|
23 |
+
private $rule_key;
|
24 |
+
/**
|
25 |
+
* @var string
|
26 |
+
*/
|
27 |
+
private $based_on;
|
28 |
+
/**
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
+
private $min;
|
32 |
+
/**
|
33 |
+
* @var string
|
34 |
+
*/
|
35 |
+
private $max;
|
36 |
+
/**
|
37 |
+
* @var string
|
38 |
+
*/
|
39 |
+
private $cost_per_order;
|
40 |
+
/**
|
41 |
+
* RuleImplementation constructor.
|
42 |
+
*
|
43 |
+
* @param string $rule_key
|
44 |
+
* @param string $based_on
|
45 |
+
* @param string $min
|
46 |
+
* @param string $max
|
47 |
+
* @param string $cost_per_order
|
48 |
+
*/
|
49 |
+
public function __construct($rule_key, $based_on, $min, $max, $cost_per_order)
|
50 |
+
{
|
51 |
+
$this->rule_key = $rule_key;
|
52 |
+
$this->based_on = $based_on;
|
53 |
+
$this->min = $min;
|
54 |
+
$this->max = $max;
|
55 |
+
$this->cost_per_order = $cost_per_order;
|
56 |
+
}
|
57 |
+
/**
|
58 |
+
* @inheritDoc
|
59 |
+
*/
|
60 |
+
public function get_rule_key()
|
61 |
+
{
|
62 |
+
return $this->rule_key;
|
63 |
+
}
|
64 |
+
/**
|
65 |
+
* @inheritDoc
|
66 |
+
*/
|
67 |
+
public function get_based_on()
|
68 |
+
{
|
69 |
+
return $this->based_on;
|
70 |
+
}
|
71 |
+
/**
|
72 |
+
* @inheritDoc
|
73 |
+
*/
|
74 |
+
public function is_based_on_weight()
|
75 |
+
{
|
76 |
+
return self::BASED_ON_WEIGHT === $this->based_on;
|
77 |
+
}
|
78 |
+
/**
|
79 |
+
* @inheritDoc
|
80 |
+
*/
|
81 |
+
public function is_based_on_value()
|
82 |
+
{
|
83 |
+
return self::BASED_ON_VALUE === $this->based_on;
|
84 |
+
}
|
85 |
+
/**
|
86 |
+
* @inheritDoc
|
87 |
+
*/
|
88 |
+
public function is_based_on_none()
|
89 |
+
{
|
90 |
+
return self::BASED_ON_NONE === $this->based_on;
|
91 |
+
}
|
92 |
+
/**
|
93 |
+
* @inheritDoc
|
94 |
+
*/
|
95 |
+
public function get_min()
|
96 |
+
{
|
97 |
+
return $this->min;
|
98 |
+
}
|
99 |
+
/**
|
100 |
+
* @inheritDoc
|
101 |
+
*/
|
102 |
+
public function get_max()
|
103 |
+
{
|
104 |
+
return $this->max;
|
105 |
+
}
|
106 |
+
/**
|
107 |
+
* @inheritDoc
|
108 |
+
*/
|
109 |
+
public function get_cost_per_order()
|
110 |
+
{
|
111 |
+
return $this->cost_per_order;
|
112 |
+
}
|
113 |
+
/**
|
114 |
+
* @return string
|
115 |
+
*/
|
116 |
+
public function format_for_log()
|
117 |
+
{
|
118 |
+
return \sprintf(\__('Rule %1$s:%2$s based on: %3$s min: %4$s max: %5$s cost per order: %6$s', 'flexible-shipping'), $this->get_rule_key(), "\n", (new \FSVendor\WPDesk\FS\TableRate\BasedOnOptions())->get_option_label($this->get_based_on()) . "; ", $this->get_min() . "; ", $this->get_max() . "; ", $this->get_cost_per_order());
|
119 |
+
}
|
120 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Settings/RulesSettingsFactory.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Rules Factory.
|
5 |
+
*
|
6 |
+
* @package WPDesk\FS\TableRate\Settings
|
7 |
+
*/
|
8 |
+
namespace FSVendor\WPDesk\FS\TableRate\Settings;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Can create Rules.
|
12 |
+
*/
|
13 |
+
class RulesSettingsFactory
|
14 |
+
{
|
15 |
+
/**
|
16 |
+
* @param array $shipping_rule_array
|
17 |
+
*
|
18 |
+
* @return RuleSettings
|
19 |
+
*/
|
20 |
+
public static function create_single_from_array($shipping_rule_array)
|
21 |
+
{
|
22 |
+
return new \FSVendor\WPDesk\FS\TableRate\Settings\RuleSettingsImplementation($shipping_rule_array['based_on'], isset($shipping_rule_array['min']) ? $shipping_rule_array['min'] : '', isset($shipping_rule_array['max']) ? $shipping_rule_array['max'] : '', isset($shipping_rule_array['cost_per_order']) ? $shipping_rule_array['cost_per_order'] : '');
|
23 |
+
}
|
24 |
+
/**
|
25 |
+
* @param array $shipping_rules_array
|
26 |
+
*
|
27 |
+
* @return RuleSettings[]
|
28 |
+
*/
|
29 |
+
public static function create_rules_from_shipping_rules_array(array $shipping_rules_array)
|
30 |
+
{
|
31 |
+
$rules = array();
|
32 |
+
foreach ($shipping_rules_array as $shipping_rule_array) {
|
33 |
+
$rules[] = self::create_single_from_array($shipping_rule_array);
|
34 |
+
}
|
35 |
+
return $rules;
|
36 |
+
}
|
37 |
+
}
|
vendor_prefixed/wpdesk/wp-wpdesk-fs-table-rate/src/Weight/Rounding.php
CHANGED
@@ -7,6 +7,7 @@
|
|
7 |
*/
|
8 |
namespace FSVendor\WPDesk\FS\TableRate\Weight;
|
9 |
|
|
|
10 |
/**
|
11 |
* Can compute rounding precision from Flexible Shipping rules.
|
12 |
*/
|
@@ -19,7 +20,7 @@ class Rounding
|
|
19 |
/**
|
20 |
* WeightRounding constructor.
|
21 |
*
|
22 |
-
* @param
|
23 |
*/
|
24 |
public function __construct(array $shipping_method_rules)
|
25 |
{
|
@@ -37,14 +38,14 @@ class Rounding
|
|
37 |
return $rounding;
|
38 |
}
|
39 |
/**
|
40 |
-
* @param
|
41 |
*
|
42 |
* @return int
|
43 |
*/
|
44 |
-
private function get_rounding_from_rule(
|
45 |
{
|
46 |
-
if (
|
47 |
-
return \max($this->get_rounding_from_value(
|
48 |
}
|
49 |
return 0;
|
50 |
}
|
7 |
*/
|
8 |
namespace FSVendor\WPDesk\FS\TableRate\Weight;
|
9 |
|
10 |
+
use FSVendor\WPDesk\FS\TableRate\Settings\RuleSettings;
|
11 |
/**
|
12 |
* Can compute rounding precision from Flexible Shipping rules.
|
13 |
*/
|
20 |
/**
|
21 |
* WeightRounding constructor.
|
22 |
*
|
23 |
+
* @param RuleSettings[] $shipping_method_rules .
|
24 |
*/
|
25 |
public function __construct(array $shipping_method_rules)
|
26 |
{
|
38 |
return $rounding;
|
39 |
}
|
40 |
/**
|
41 |
+
* @param RuleSettings $rule .
|
42 |
*
|
43 |
* @return int
|
44 |
*/
|
45 |
+
private function get_rounding_from_rule($rule)
|
46 |
{
|
47 |
+
if ($rule->is_based_on_weight()) {
|
48 |
+
return \max($this->get_rounding_from_value($rule->get_min()), $this->get_rounding_from_value($rule->get_max()));
|
49 |
}
|
50 |
return 0;
|
51 |
}
|
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/class-wpdesk-tracker-interface.php
CHANGED
@@ -14,6 +14,15 @@ namespace FSVendor;
|
|
14 |
if (!\defined('ABSPATH')) {
|
15 |
exit;
|
16 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
interface WPDesk_Tracker_Interface
|
18 |
{
|
19 |
/**
|
14 |
if (!\defined('ABSPATH')) {
|
15 |
exit;
|
16 |
}
|
17 |
+
/**
|
18 |
+
* WP Desk Tracker
|
19 |
+
*
|
20 |
+
* @class WPDESK_Tracker
|
21 |
+
* @version 1.3.2
|
22 |
+
* @package WPDESK/Helper
|
23 |
+
* @category Class
|
24 |
+
* @author WP Desk
|
25 |
+
*/
|
26 |
interface WPDesk_Tracker_Interface
|
27 |
{
|
28 |
/**
|