Markers

Table of Contents

lib/class-wc-settings-plugin-promo.php 1
lib/Plugin/Admin/Admin_Links.php 5
lib/Plugin/Admin/Plugin_Updater.php 9
lib/Plugin/License/Admin/edd-settings-functions.php 4
lib/Plugin/License/Admin/License_Key_Setting.php 14
lib/Plugin/License/Admin/License_Notices.php 9
lib/Plugin/License/EDD_Licensing.php 5
lib/Plugin/License/Plugin_License.php 46
lib/Plugin/Premium_Plugin.php 1
lib/Plugin/Simple_Plugin.php 2
lib/Rest/Base_Server.php 2
lib/Scheduled_Task.php 3
lib/Service_Container.php 1
lib/Util.php 4
lib/vendor/admin-notices/src/Dismiss.php 14
lib/vendor/admin-notices/src/Notice.php 22
lib/vendor/admin-notices/src/Notices.php 5
lib/WooCommerce/Admin/Custom_Settings_Fields.php 6
src/Admin/Settings_Page.php 6
src/Button_Display.php 5
src/deprecated.php 5
src/Frontend_Scripts.php 10
src/Integration/Composite_Products_Integration.php 2
src/Integration/Product_Addons_Integration.php 2
src/Integration/Product_Table_Integration.php 5
src/Integration/Theme_Integration.php 9
src/Integration/WooCommerce_Blocks.php 6
src/Integration/WooCommerce_Shortcodes.php 1
src/Plugin.php 5
src/Quick_View_Content.php 6
src/Rest/Add_To_Cart_Route.php 17
src/Rest/Quick_View_Route.php 7
src/Shortcode.php 3
src/Util.php 8
templates/product-hidden-content.php 1
templates/product-image.php 2
templates/product-thumbnails.php 2
templates/quick-view-variation-add-to-cart.php 1
templates/quick-view.php 2
templates/tabs/reviews.php 2
woocommerce-quick-view-pro.php 6

class-wc-settings-plugin-promo.php

Type Line Description
42 Check we're on the correct settings section

Admin_Links.php

Type Line Description
30 Add settings link from Plugins page.
33 Add documentation link to meta info on Plugins page.
42 Don't add link if it's a WooCommerce plugin but WooCommerce is not active.
47 Don't add link if it's an EDD plugin but EDD is not active.
61 Bail if there's no documentation URL.

Plugin_Updater.php

Type Line Description
70 First check if plugin info already exists in the WP transient.
114 Add note about license key if no automatic update available (i.e. no update package).
138 Make sure the plugin property is set to the plugin's name/location. See issue 1463 on Software Licensing's GitHub repo.
141 Add an ID for the update details.
144 Check the license before returning.
157 Prevent automatic plugin update if license is invalid. Clearing the package URL will do this.
165 First check the cache.
169 Nothing in cache, so get latest version from API.
193 We cache the version info for 4 hours, to reduce the number of API requests.

edd-settings-functions.php

Type Line Description
5 Prevent direct access.
23 Change setting back to a 'text' input. We set the type to 'barn2_license' initially so we can provide our own callback.
26 Settings_API_Helper uses input_class instead of class.
30 Ensure a default is set.

License_Key_Setting.php

Type Line Description
41 Include EDD settings callbacks.
44 Handle the license settings message for EDD.
47 Add hidden field to WooCommerce settings.
99 EDD uses title case for setting names, so let's keep things consistent.
102 Set type to 'barn2_license' so the callback to render setting will be 'edd_barn2_license_callback'.
105 EDD uses 'name' instead of 'title'.
150 Deactivate old license key first if it was valid.
155 If new license key is different to current key, or current key isn't active, attempt to activate.
186 Clear any other messages (e.g. 'Settings Updated') so we only show our license message.
189 Need to use 'edd-notices' setting to get message to show in EDD settings pages.
198 Check if we're overriding the license activation.
240 @todo: Spinner icon
250 If we have a license key and it's not active, mark it red for user to take action.
252 ...except if the user has just deactivated, in which case just show a plain confirmation message.

License_Notices.php

Type Line Description
41 Don't add notices if we're doing a post (e.g. saving the settings).
49 Add first activation notice.
52 Add expired license notice.
55 Add disabled license notice
58 Add 'site moved to new URL' notice.
64 Don't add the notice if it's a WooCommerce plugin and WooCommerce is not installed, as license page won't be available.
69 Ditto for EDD plugins.
156 Clear notice dismissal transients when license is activated.
180 Check data is valid.

EDD_Licensing.php

Type Line Description
18 barn2.com/edd-sl';
142 We're forced to use the (potentially usafe) maybe_unserialize here as the
143 EDD Software Licensing API serializes some of the returned plugin data.
152 Call the Software Licensing API.
160 Build the result.

Plugin_License.php

Type Line Description
45 early, before any is_valid() checks.
57 A 'valid' license is one which is active or expired.
58 For expired licenses the plugin will still work (i.e. is valid) but plugin updates will be disabled.
130 Check a license was supplied.
147 Successful response - now check whether license is valid.
150 $response->license will be 'valid' or 'invalid'.
157 Invalid license.
162 Store the returned license info.
165 API error - set license to invalid as we can't activate.
182 Bail early if already inactive.
187 If license is overridden bypass API and set status manually.
193 We can't deactivate a license if it's not currently active.
204 Successful response - now check whether license is valid.
208 $response->license will be 'deactivated' or 'failed'.
210 License deactivated, so update status.
213 Store returned license info.
217 Deactivation failed - reasons: already deactivated via Account page, license has expired, bad data, etc.
218 In this case we refresh license data to ensure we have correct state stored in database.
224 API error
240 No point refreshing if license doesn't exist.
245 If license is overridden, we shouldn't refresh as it will lose override state.
254 We use the home url when checking the license, as the license result should reflect the current site, not any previous site.
258 Successful response returned.
262 Valid (and active) license.
265 Invalid license - $response->license will contain the reason for the invalid license - e.g. expired, inactive, site_inactive, etc.
270 Store returned license info.
275 API error - store the error but don't change license status (e.g. temporary communication error).
357 See if we have a valid expiry date by checking first 4 chars are numbers (the expiry year).
358 This is only a rough check - createFromFormat() will validate fully and return a DateTime object if valid.
400 Exclude overridden licenses - we don't want to automatically deactivate these or show admin notice to user.
438 Migrate from legacy license data.
454 Remove legacy license data.
466 We don't use home_url() here as this runs the 'home_url' filter which other plugins hook into (e.g. multi-lingual plugins).
485 To lowercase.
488 Strip www.
489 www.', ':/www.' ), '://', $url );
491 Strip scheme.
492 ', 'https://', 'http:/', 'https:/' ), '', $url );
494 Remove trailing slash.
537 Clear any previous error before updating.
541 Merge current data with new $data before setting.
553 License is invalid if there's no license key.
579 License info should always return the expiry date, so it's considered valid if this is present.
581 Cast response to array.
584 Remove the stuff we don't need.
597 Status is sanitized during update_license_data().

Premium_Plugin.php

Type Line Description
70 Default to plugin settings URL if there's no license setting path.

Simple_Plugin.php

Type Line Description
41 Check for 'item_id' in case 'id' not set.
46 WooCommerce plugins cannot be EDD plugins (and vice-versa).

Base_Server.php

Type Line Description
42 implemented in sub-class.
46 implemented in sub-class.

Scheduled_Task.php

Type Line Description
25 Attach the action to run when the cron event is fired.
28 Schedule the cron event if not already scheduled.
33 Unschedule event on plugin deactivation.

Service_Container.php

Type Line Description
29 Overidden by classes using this trait.

Util.php

Type Line Description
15 barn2.com';
16 barn2.com';
17 barn2.com';
22 barn2.com.

Dismiss.php

Type Line Description
1 phpcs:ignore WordPress.Files.FileName
8 www.gnu.org/licenses/gpl-2.0.html GPL-2.0-or-later
9 github.com/WPTRT/admin-notices
58 Set the object properties.
63 Handle AJAX requests to dismiss the notice.
76 Create a nonce.
83 Add an event listener to the dismiss button.
88 Build the data to send in our request.
89 Data has to be formatted as a string here.
112 Check if the notice has been dismissed when using user-meta.
130 Sanity check: Early exit if we're not on a wptrt_dismiss_notice action.
135 Sanity check: Early exit if the ID of the notice is not the one from this object.
140 Security check: Make sure nonce is OK.
143 If we got this far, we need to dismiss the notice.

Notice.php

Type Line Description
1 phpcs:ignore WordPress.Files.FileName
10 www.gnu.org/licenses/gpl-2.0.html GPL-2.0-or-later
11 github.com/WPTRT/admin-notices
128 Set the object properties.
134 Sanity check: Early exit if ID or message are empty.
148 Instantiate the Dismiss object.
161 Early exit if we don't want to show this notice.
169 Print the notice.
172 The ID.
173 The classes.
174 The HTML.
187 Don't show if the user doesn't have the required capability.
192 Don't show if we're not on the right screen.
197 Don't show if notice has been dismissed.
218 Make sure the defined type is allowed.
221 Add the class for notice-type.
224 Do we want alt styles?
229 Combine classes to a string.
242 Sanity check: Early exit if no title is defined.
273 If screen is empty we want this shown on all screens.
278 Make sure the get_current_screen function exists.
283 Check if we're on one of the defined screens.

Notices.php

Type Line Description
1 phpcs:ignore WordPress.Files.FileName
10 www.gnu.org/licenses/gpl-2.0.html GPL-2.0-or-later
11 github.com/WPTRT/admin-notices
43 Add the notice.
46 Print the script to the footer.

Custom_Settings_Fields.php

Type Line Description
46 atts are escaped
55 Redo the description as WC runs wp_kes_post() on it which messes up any inline CSS
64 atts are escaped
114 Get current values
122 atts are escaped
188 atts are escaped

Settings_Page.php

Type Line Description
35 Add sections & settings
39 Save license setting
43 Plugin promo
54 Check we're on the correct settings section
67 License key settings.
84 Main quick view settings.

Button_Display.php

Type Line Description
63 this loop is admittedly a bit weird, the goal here is to build a complete tree of the categories
64 a product belongs to. sometimes if a product was assigned to both a category and that category's parent,
65 the parent category would override the setting on a child category. this loop ensures that the child
66 category always gets setting priority.
120 Register the hook to display the Quick View button in the shop.

deprecated.php

Type Line Description
11 Back compat for old version of JS which used 'rest_base_quick_view' and 'rest_base_cart' params.
12 We add these temporarily to prevent errors on sites where the JS is cached after a plugin update.
13 This can be removed in the next release after 1.4.
60 @todo Deprecate this fully.
61 _deprecated_function( __METHOD__, '1.3', 'Barn2\Plugin\WC_Quick_View_Pro\wqv()' );

Frontend_Scripts.php

Type Line Description
44 jQuery Modal styles
53 Add RTL data - we need suffix to correctly format RTL stylesheet when minified.
57 jQuery Modal scripts
105 Load product gallery scipts.
109 Force-enable zoom, regardless of theme support.
116 We need this for the $.wc_product_gallery() function.
119 Force-enable flexslider, regardless of theme support.
129 Load cart form scripts
136 Audio and video scripts
140 Playlist scripts

Composite_Products_Integration.php

Type Line Description
33 Enqueue script.
36 Enqueue styles.

Product_Addons_Integration.php

Type Line Description
26 Addons styles - we can't call WC_Product_Addons_Display->styles() as this runs on certain pages only, so we enqueue these ourselves.
35 Addons scripts - triggering this action will queue the scripts.

Product_Table_Integration.php

Type Line Description
34 Register product table data for 'quick-view' column.
37 Quick view column is not sortable.
40 Load the Quick View scripts when a product table is displayed, so Quick Views can be opened from the table.
43 Load the product table scripts so tables inside a Quick View work correctly.
46 Add note to product link setting on settings page.

Theme_Integration.php

Type Line Description
34 after main plugin hooks are registered
47 Don't add the Fusion builder classes inside Woo Product Blocks.
54 Wrap button text to match other Avada buttons.
83 Add inline script for Enfold to trigger 'updated_cart_totals' on QV load.
84 This will cause Enfold to add the +/- quantity buttons to the cart form.
101 add_filter( 'wc_quick_view_pro_shop_loop_use_thumbnail_wrapper', '__return_false' );
110 Disable product link option if using Flatsome's in-built quick view.
145 Add inline script for Goya to close the popup after adding to the cart
167 add_filter( 'wc_quick_view_pro_shop_loop_use_thumbnail_wrapper', '__return_false' );

WooCommerce_Blocks.php

Type Line Description
56 Enable QVP scripts for this page which contains the Woo Products Block.
59 Buttons in the Woo Products Block (e.g. Add To Cart) have the 'wp-block-button__link' class, so we add this to the Quick View
60 button too so that any specific button styles are picked up.
72 Don't add quick view button if product block button is disabled/empty.
80 Insert Quick View button in product block HTML output.
86 Add product ID data attribute to product link, to enable QV when clicking on product name or image.

WooCommerce_Shortcodes.php

Type Line Description
42 Enable the scripts for this page which contains the shortcode.

Plugin.php

Type Line Description
68 Don't load anything if WooCommerce not active.
80 Create core services if license is valid.
83 Frontend_Preview needs to be loaded first in order to load settings filter hook
93 Plugin and theme integrations.
118 woocommerce.com/', true ), '</a>' ),

Quick_View_Content.php

Type Line Description
43 Display sales flash with product image if no details displayed.
52 add_filter( 'woocommerce_single_product_carousel_options', array( $this, 'set_flexslider_options' ) );
59 Display sales flash inside product details.
135 Output the hidden content template.
140 Output the product image template.
145 Output the product thumbnails template.

Add_To_Cart_Route.php

Type Line Description
54 Successful addition, so we now build the response.
64 If we redirecting to the cart after addition, add the cart notice so it appears after redirect.
69 Error adding to the cart - build error message from notices.
73 An unknown error occurred (e.g. product didn't pass validation).
102 Remove any zero-quantity products.
117 Anything other than a grouped product.
129 Product successfully added.
164 Get success messages.
182 Check product exists.
190 For grouped products, quantity is passed as an array in the form array( product_id => quantity ).
193 For other products we should receive a single quantity.
195 Default to 1 if not set.
226 WC 3.6+ - Cart and notice functions are not included during a REST request.
246 We need to force a refresh of the cart contents from session here (cart contents are normally refreshed on wp_loaded, which has already happened by this point).
252 Fetch the mini-cart HTML.
272 Attributes for 'variable' products are not prefixed 'attribute_', so we do this to make it consistent with 'variation' products.
284 Return the params which are valid variations.

Quick_View_Route.php

Type Line Description
46 Check product exists.
57 Output the Quick View template.
76 WC 3.6+ - Template hooks are not included during a REST request.
84 Store current globals.
91 Overwrite globals.
93 post should be in cache at this point.
96 WooCommerce globals are set on this call.

Shortcode.php

Type Line Description
55 Filter button text using a closure bound to the current text and product.
64 Ensure scripts load for the shortcode button.
67 Add an extra class for shortcode buttons.

Util.php

Type Line Description
20 FORMATTING
26 SETTINGS
91 SCRIPTS
101 REST
107 TEMPLATES
113 QUICK VIEW CONTENT
214 NOTICES
220 WC > 3.8 uses nested arrays for each notice.

product-hidden-content.php

Type Line Description
11 Prevent direct file access

product-image.php

Type Line Description
11 Prevent direct file access
44 phpcs:disable WordPress.XSS.EscapeOutput.OutputNotEscaped

product-thumbnails.php

Type Line Description
13 Prevent direct file access
22 phpcs:disable WordPress.XSS.EscapeOutput.OutputNotEscaped

quick-view-variation-add-to-cart.php

Type Line Description
34 WPCS: CSRF ok, input var ok.

quick-view.php

Type Line Description
11 Prevent direct file access
31 attributes escaped

reviews.php

Type Line Description
10 Prevent direct file access
32 WPCS: XSS ok.

woocommerce-quick-view-pro.php

Type Line Description
14 barn2.com/wordpress-plugins/woocommerce-quick-view-pro/
18 barn2.com
27 www.gnu.org/licenses/gpl-3.0.html
31 Prevent direct file access.
39 Include autoloader.
51 Load the plugin.

Search results